






import collections
import types

import numpy as np

from ..utils import (
    add_end_docstrings,
    is_tensorflow_probability_available,
    is_tf_available,
    is_torch_available,
    requires_backends,
)
from .base import PIPELINE_INIT_ARGS, ArgumentHandler, Dataset, Pipeline, PipelineException


if is_torch_available():
						import torch

						from ..models.auto.modeling_auto import (
						    MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING,
						    MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING,
						)

if is_tf_available() and is_tensorflow_probability_available():
						import tensorflow as tf
						import tensorflow_probability as tfp

						from ..models.auto.modeling_tf_auto import (
						    TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING,
						    TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING,
						)





class  snake_case__      (							_lowerCAmelCase   ):
	def __call__(       self    ,     lowerCAmelCase__=None    ,     lowerCAmelCase__=None    ,     **lowerCAmelCase__				)							->   Optional[Any]:
							# Returns tqa_pipeline_inputs of shape:
							# [
							#   {"table": pd.DataFrame, "query": List[str]},
							#   ...,
							#   {"table": pd.DataFrame, "query" : List[str]}
							# ]
							requires_backends(self    ,     """pandas"""				)
							import pandas as pd

							if table is None:
													raise ValueError("""Keyword argument `table` cannot be None."""				)
							elif query is None:
													if isinstance(lowerCAmelCase__    ,     lowerCAmelCase__				) and table.get("""query"""				) is not None and table.get("""table"""				) is not None:
																			__magic_name__    :     Union[str, Any]     		=      [table]
													elif isinstance(lowerCAmelCase__    ,     lowerCAmelCase__				) and len(lowerCAmelCase__				) > 0:
																			if not all(isinstance(lowerCAmelCase__    ,     lowerCAmelCase__				) for d in table				):
																									raise ValueError(
																									    F'Keyword argument `table` should be a list of dict, but is {(type(lowerCAmelCase__				) for d in table)}'				)

																			if table[0].get("""query"""				) is not None and table[0].get("""table"""				) is not None:
																									__magic_name__    :     List[Any]     		=      table
																			else:
																									raise ValueError(
																									    """If keyword argument `table` is a list of dictionaries, each dictionary should have a `table`"""
																									    F' and `query` key, but only dictionary has keys {table[0].keys()} `table` and `query` keys.'				)
													elif Dataset is not None and isinstance(lowerCAmelCase__    ,     lowerCAmelCase__				) or isinstance(lowerCAmelCase__    ,     types.GeneratorType				):
																			return table
													else:
																			raise ValueError(
																			    """Invalid input. Keyword argument `table` should be either of type `dict` or `list`, but """
																			    F'is {type(lowerCAmelCase__				)})'				)
							else:
													__magic_name__    :     Tuple     		=      [{"""table""": table, """query""": query}]

							for tqa_pipeline_input in tqa_pipeline_inputs:
													if not isinstance(tqa_pipeline_input["""table"""]    ,     pd.DataFrame				):
																			if tqa_pipeline_input["table"] is None:
																									raise ValueError("""Table cannot be None."""				)

																			__magic_name__    :     Optional[int]     		=      pd.DataFrame(tqa_pipeline_input["""table"""]				)

							return tqa_pipeline_inputs





@add_end_docstrings(_lowerCAmelCase   )
class  snake_case__      (							_lowerCAmelCase   ):
	lowercase__		:  str							   =					'''table,query'''
	def __init__(       self    ,     lowerCAmelCase__=TableQuestionAnsweringArgumentHandler()    ,     *lowerCAmelCase__    ,     **lowerCAmelCase__				)							->   Any:
							super().__init__(*lowerCAmelCase__    ,     **lowerCAmelCase__				)
							__magic_name__    :     int     		=      args_parser

							self.check_model_type(
							    dict(
							        TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING.items()
							        + TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING.items()				)
							    if self.framework == """tf"""
							    else dict(
							        MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING.items() + MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING.items()				)				)

							__magic_name__    :     Dict     		=      bool(getattr(self.model.config    ,     """aggregation_labels"""    ,     lowerCAmelCase__				)				) and bool(
							    getattr(self.model.config    ,     """num_aggregation_labels"""    ,     lowerCAmelCase__				)				)
							__magic_name__    :     Tuple     		=      """tapas""" if hasattr(self.model.config    ,     """aggregation_labels"""				) else None
	def     __magic_name__       (       self    ,     **lowerCAmelCase__				)							->   Dict:
							return self.model(**lowerCAmelCase__				)
	def     __magic_name__       (       self    ,     **lowerCAmelCase__				)							->   Dict:
							if self.framework == "pt":
													__magic_name__    :     int     		=      []
													__magic_name__    :     List[str]     		=      []
													__magic_name__    :     Union[str, Any]     		=      None
													__magic_name__    :     Dict     		=      inputs["""input_ids"""].shape[0]

													__magic_name__    :     Tuple     		=      inputs["""input_ids"""].to(self.device				)
													__magic_name__    :     Dict     		=      inputs["""attention_mask"""].to(self.device				)
													__magic_name__    :     Optional[int]     		=      inputs["""token_type_ids"""].to(self.device				)
													__magic_name__    :     Tuple     		=      None

													for index in range(lowerCAmelCase__				):
																			# If sequences have already been processed, the token type IDs will be created according to the previous
																			# answer.
																			if prev_answers is not None:
																									__magic_name__    :     Optional[Any]     		=      token_type_ids_example[:, 3]  # shape (seq_len,)
																									__magic_name__    :     Dict     		=      np.zeros_like(prev_labels_example.cpu().numpy()				)  # shape (seq_len,)

																									__magic_name__    :     Optional[int]     		=      token_type_ids[index]  # shape (seq_len, 7)
																									for i in range(model_labels.shape[0]				):
																															__magic_name__    :     List[str]     		=      token_type_ids_example[:, 0].tolist()[i]
																															__magic_name__    :     str     		=      token_type_ids_example[:, 1].tolist()[i] - 1
																															__magic_name__    :     List[str]     		=      token_type_ids_example[:, 2].tolist()[i] - 1

																															if row_id >= 0 and col_id >= 0 and segment_id == 1:
																																					__magic_name__    :     int     		=      int(prev_answers[(col_id, row_id)]				)

																									__magic_name__    :     Optional[int]     		=      torch.from_numpy(lowerCAmelCase__				).type(torch.long				).to(self.device				)

																			__magic_name__    :     Optional[Any]     		=      input_ids[index]
																			__magic_name__    :     Union[str, Any]     		=      attention_mask[index]  # shape (seq_len,)
																			__magic_name__    :     Optional[int]     		=      token_type_ids[index]  # shape (seq_len, 7)
																			__magic_name__    :     Optional[Any]     		=      self.model(
																			    input_ids=input_ids_example.unsqueeze(0				)    ,     attention_mask=attention_mask_example.unsqueeze(0				)    ,     token_type_ids=token_type_ids_example.unsqueeze(0				)    ,     )
																			__magic_name__    :     Dict     		=      outputs.logits

																			if self.aggregate:
																									all_aggregations.append(outputs.logits_aggregation				)

																			all_logits.append(lowerCAmelCase__				)

																			__magic_name__    :     Union[str, Any]     		=      torch.distributions.Bernoulli(logits=lowerCAmelCase__				)
																			__magic_name__    :     Optional[Any]     		=      dist_per_token.probs * attention_mask_example.type(torch.floataa				).to(
																			    dist_per_token.probs.device				)

																			__magic_name__    :     List[str]     		=      collections.defaultdict(lowerCAmelCase__				)
																			for i, p in enumerate(probabilities.squeeze().tolist()				):
																									__magic_name__    :     List[Any]     		=      token_type_ids_example[:, 0].tolist()[i]
																									__magic_name__    :     List[Any]     		=      token_type_ids_example[:, 1].tolist()[i] - 1
																									__magic_name__    :     int     		=      token_type_ids_example[:, 2].tolist()[i] - 1
																									if col >= 0 and row >= 0 and segment_id == 1:
																															coords_to_probs[(col, row)].append(lowerCAmelCase__				)

																			__magic_name__    :     Union[str, Any]     		=      {key: np.array(coords_to_probs[key]				).mean() > 0.5 for key in coords_to_probs}

													__magic_name__    :     Any     		=      torch.cat(tuple(lowerCAmelCase__				)    ,     0				)

													return (logits_batch,) if not self.aggregate else (logits_batch, torch.cat(tuple(lowerCAmelCase__				)    ,     0				))
							else:
													__magic_name__    :     Optional[Any]     		=      []
													__magic_name__    :     str     		=      []
													__magic_name__    :     Optional[int]     		=      None
													__magic_name__    :     Optional[Any]     		=      inputs["""input_ids"""].shape[0]

													__magic_name__    :     List[Any]     		=      inputs["""input_ids"""]
													__magic_name__    :     Optional[int]     		=      inputs["""attention_mask"""]
													__magic_name__    :     Dict     		=      inputs["""token_type_ids"""].numpy()
													__magic_name__    :     Tuple     		=      None

													for index in range(lowerCAmelCase__				):
																			# If sequences have already been processed, the token type IDs will be created according to the previous
																			# answer.
																			if prev_answers is not None:
																									__magic_name__    :     str     		=      token_type_ids_example[:, 3]  # shape (seq_len,)
																									__magic_name__    :     Optional[int]     		=      np.zeros_like(lowerCAmelCase__    ,     dtype=np.intaa				)  # shape (seq_len,)

																									__magic_name__    :     Optional[Any]     		=      token_type_ids[index]  # shape (seq_len, 7)
																									for i in range(model_labels.shape[0]				):
																															__magic_name__    :     Optional[int]     		=      token_type_ids_example[:, 0].tolist()[i]
																															__magic_name__    :     int     		=      token_type_ids_example[:, 1].tolist()[i] - 1
																															__magic_name__    :     int     		=      token_type_ids_example[:, 2].tolist()[i] - 1

																															if row_id >= 0 and col_id >= 0 and segment_id == 1:
																																					__magic_name__    :     List[Any]     		=      int(prev_answers[(col_id, row_id)]				)

																									__magic_name__    :     Dict     		=      model_labels

																			__magic_name__    :     Optional[Any]     		=      input_ids[index]
																			__magic_name__    :     Tuple     		=      attention_mask[index]  # shape (seq_len,)
																			__magic_name__    :     Tuple     		=      token_type_ids[index]  # shape (seq_len, 7)
																			__magic_name__    :     int     		=      self.model(
																			    input_ids=np.expand_dims(lowerCAmelCase__    ,     axis=0				)    ,     attention_mask=np.expand_dims(lowerCAmelCase__    ,     axis=0				)    ,     token_type_ids=np.expand_dims(lowerCAmelCase__    ,     axis=0				)    ,     )
																			__magic_name__    :     int     		=      outputs.logits

																			if self.aggregate:
																									all_aggregations.append(outputs.logits_aggregation				)

																			all_logits.append(lowerCAmelCase__				)

																			__magic_name__    :     Optional[int]     		=      tfp.distributions.Bernoulli(logits=lowerCAmelCase__				)
																			__magic_name__    :     Tuple     		=      dist_per_token.probs_parameter() * tf.cast(lowerCAmelCase__    ,     tf.floataa				)

																			__magic_name__    :     str     		=      collections.defaultdict(lowerCAmelCase__				)
																			__magic_name__    :     Union[str, Any]     		=      token_type_ids_example
																			for i, p in enumerate(tf.squeeze(lowerCAmelCase__				).numpy().tolist()				):
																									__magic_name__    :     int     		=      token_type_ids_example[:, 0].tolist()[i]
																									__magic_name__    :     Any     		=      token_type_ids_example[:, 1].tolist()[i] - 1
																									__magic_name__    :     List[str]     		=      token_type_ids_example[:, 2].tolist()[i] - 1
																									if col >= 0 and row >= 0 and segment_id == 1:
																															coords_to_probs[(col, row)].append(lowerCAmelCase__				)

																			__magic_name__    :     Any     		=      {key: np.array(coords_to_probs[key]				).mean() > 0.5 for key in coords_to_probs}

													__magic_name__    :     List[str]     		=      tf.concat(tuple(lowerCAmelCase__				)    ,     0				)

													return (logits_batch,) if not self.aggregate else (logits_batch, tf.concat(tuple(lowerCAmelCase__				)    ,     0				))
	def __call__(       self    ,     *lowerCAmelCase__    ,     **lowerCAmelCase__				)							->   Union[str, Any]:
							__magic_name__    :     int     		=      self._args_parser(*lowerCAmelCase__    ,     **lowerCAmelCase__				)

							__magic_name__    :     Optional[int]     		=      super().__call__(lowerCAmelCase__    ,     **lowerCAmelCase__				)
							if len(lowerCAmelCase__				) == 1:
													return results[0]
							return results
	def     __magic_name__       (       self    ,     lowerCAmelCase__=None    ,     lowerCAmelCase__=None    ,     lowerCAmelCase__=None    ,     **lowerCAmelCase__				)							->   List[Any]:
							__magic_name__    :     List[str]     		=      {}
							if padding is not None:
													__magic_name__    :     Optional[int]     		=      padding
							if truncation is not None:
													__magic_name__    :     Optional[int]     		=      truncation

							__magic_name__    :     List[Any]     		=      {}
							if sequential is not None:
													__magic_name__    :     Tuple     		=      sequential
							return preprocess_params, forward_params, {}
	def     __magic_name__       (       self    ,     lowerCAmelCase__    ,     lowerCAmelCase__=None    ,     lowerCAmelCase__=True    ,     lowerCAmelCase__=None				)							->   Optional[Any]:
							if truncation is None:
													if self.type == "tapas":
																			__magic_name__    :     Union[str, Any]     		=      """drop_rows_to_fit"""
													else:
																			__magic_name__    :     List[Any]     		=      """do_not_truncate"""

							__magic_name__    :     List[str]     		=      pipeline_input["""table"""], pipeline_input["""query"""]
							if table.empty:
													raise ValueError("""table is empty"""				)
							if query is None or query == "":
													raise ValueError("""query is empty"""				)
							__magic_name__    :     Any     		=      self.tokenizer(lowerCAmelCase__    ,     lowerCAmelCase__    ,     return_tensors=self.framework    ,     truncation=lowerCAmelCase__    ,     padding=lowerCAmelCase__				)
							__magic_name__    :     str     		=      table
							return inputs
	def     __magic_name__       (       self    ,     lowerCAmelCase__    ,     lowerCAmelCase__=False				)							->   List[Any]:
							__magic_name__    :     Dict     		=      model_inputs.pop("""table"""				)

							if self.type == "tapas":
													if sequential:
																			__magic_name__    :     int     		=      self.sequential_inference(**lowerCAmelCase__				)
													else:
																			__magic_name__    :     List[str]     		=      self.batch_inference(**lowerCAmelCase__				)
							else:
													__magic_name__    :     List[str]     		=      self.model.generate(**lowerCAmelCase__				)
							__magic_name__    :     Optional[Any]     		=      {"""model_inputs""": model_inputs, """table""": table, """outputs""": outputs}
							return model_outputs







	def     __magic_name__       (       self    ,     lowerCAmelCase__				)							->   Union[str, Any]:
							__magic_name__    :     int     		=      model_outputs["""model_inputs"""]
							__magic_name__    :     Union[str, Any]     		=      model_outputs["""table"""]
							__magic_name__    :     Dict     		=      model_outputs["""outputs"""]
							if self.type == "tapas":
													if self.aggregate:
																			__magic_name__    :     Any     		=      outputs[:2]
																			__magic_name__    :     Optional[Any]     		=      self.tokenizer.convert_logits_to_predictions(lowerCAmelCase__    ,     lowerCAmelCase__    ,     lowerCAmelCase__				)
																			__magic_name__    :     Optional[int]     		=      predictions
																			__magic_name__    :     Optional[Any]     		=      {i: self.model.config.aggregation_labels[pred] for i, pred in enumerate(lowerCAmelCase__				)}

																			__magic_name__    :     List[Any]     		=      self.model.config.no_aggregation_label_index
																			__magic_name__    :     Union[str, Any]     		=      {
																			    i: aggregators[i] + """ > """ for i, pred in enumerate(lowerCAmelCase__				) if pred != no_agg_label_index
																			}
													else:
																			__magic_name__    :     Optional[Any]     		=      outputs[0]
																			__magic_name__    :     str     		=      self.tokenizer.convert_logits_to_predictions(lowerCAmelCase__    ,     lowerCAmelCase__				)
																			__magic_name__    :     str     		=      predictions[0]
																			__magic_name__    :     int     		=      {}
																			__magic_name__    :     str     		=      {}
													__magic_name__    :     Any     		=      []
													for index, coordinates in enumerate(lowerCAmelCase__				):
																			__magic_name__    :     List[str]     		=      [table.iat[coordinate] for coordinate in coordinates]
																			__magic_name__    :     int     		=      aggregators.get(lowerCAmelCase__    ,     """"""				)
																			__magic_name__    :     Dict     		=      aggregators_prefix.get(lowerCAmelCase__    ,     """"""				)
																			__magic_name__    :     Dict     		=      {
																			    """answer""": aggregator_prefix + """, """.join(lowerCAmelCase__				),
																			    """coordinates""": coordinates,
																			    """cells""": [table.iat[coordinate] for coordinate in coordinates],
																			}
																			if aggregator:
																									__magic_name__    :     List[Any]     		=      aggregator

																			answers.append(lowerCAmelCase__				)
													if len(lowerCAmelCase__				) == 0:
																			raise PipelineException("""Empty answer"""				)
							else:
													__magic_name__    :     List[Any]     		=      [{"""answer""": answer} for answer in self.tokenizer.batch_decode(lowerCAmelCase__    ,     skip_special_tokens=lowerCAmelCase__				)]

							return answers if len(lowerCAmelCase__				) > 1 else answers[0]








__magic_name__:  Tuple  	=			[
    ["ab-e1", "ac-e3", "ad-e5", "bc-e4", "bd-e2", "be-e6", "bh-e12", "cd-e2", "ce-e4",
     "de-e1", "df-e8", "dg-e5", "dh-e10", "ef-e3", "eg-e2", "fg-e6", "gh-e6", "hi-e3"],
    ["ab-e1", "ac-e3", "ad-e5", "bc-e4", "bd-e2", "be-e6", "cd-e2", "de-e1", "df-e8",
     "ef-e3", "eg-e2", "fg-e6"],
    ["ab-e1", "ac-e3", "bc-e4", "bd-e2", "de-e1", "df-e8", "dg-e5", "ef-e3", "eg-e2",
     "eh-e12", "fg-e6", "fh-e10", "gh-e6"],
    ["ab-e1", "ac-e3", "bc-e4", "bd-e2", "bh-e12", "cd-e2", "df-e8", "dh-e10"],
    ["ab-e1", "ac-e3", "ad-e5", "bc-e4", "bd-e2", "cd-e2", "ce-e4", "de-e1", "df-e8",
     "dg-e5", "ef-e3", "eg-e2", "fg-e6"]
]

def 					UpperCamelCase		( _A				):






						"""simple docstring"""







						__magic_name__    :     str     		=      set()
						for row in edge_array:
												for item in row:
																		distinct_edge.add(item[0]				)
						return list(_A				)

def 					UpperCamelCase		( _A,					_A				):






						"""simple docstring"""







						__magic_name__    :     Union[str, Any]     		=      ["""0"""] * len(_A				)
						for i, row in enumerate(_A				):
												for item in row:
																		if distinct_edge in item[0]:
																								__magic_name__    :     Optional[Any]     		=      """1"""
																								break
						return "".join(_A				)

def 					UpperCamelCase		( _A				):






						"""simple docstring"""







						__magic_name__    :     List[str]     		=      get_distinct_edge(_A				)
						__magic_name__    :     List[str]     		=      {}

						for item in distinct_edge:
												__magic_name__    :     Optional[Any]     		=      get_bitcode(_A,					_A				)
												# print('bit',bit)
												# bt=''.join(bit)
												__magic_name__    :     Union[str, Any]     		=      bit.count("""1"""				)
												__magic_name__    :     Dict     		=      [s, bit]
						# Store [Distinct edge, WT(Bitcode), Bitcode] in descending order
						__magic_name__    :     List[Any]     		=      [
						    [k, v[0], v[1]]
						    for k, v in sorted(frequency_table.items(),					key=lambda _A				: v[1][0],					reverse=_A				)
						]
						return sorted_frequency_table

def 					UpperCamelCase		( _A				):






						"""simple docstring"""







						__magic_name__    :     str     		=      {}
						for _, item in enumerate(_A				):
												nodes.setdefault(item[2],					[]				).append(item[0]				)
						return nodes

def 					UpperCamelCase		( _A				):






						"""simple docstring"""







						__magic_name__    :     Optional[int]     		=      {}
						for key, value in nodes.items():
												__magic_name__    :     Tuple     		=      value
						return cluster

def 					UpperCamelCase		( _A				):






						"""simple docstring"""







						return [i * 100 / len(_A				) for i in cluster]

def 					UpperCamelCase		( ):






						"""simple docstring"""







						print("""\nNodes\n"""				)
						for key, value in nodes.items():
												print(_A,					_A				)
						print("""\nSupport\n"""				)
						print(_A				)
						print("""\n Cluster \n"""				)
						for key, value in sorted(cluster.items(),					reverse=_A				):
												print(_A,					_A				)
						print("""\n Graph\n"""				)
						for key, value in graph.items():
												print(_A,					_A				)
						print("""\n Edge List of Frequent subgraphs \n"""				)
						for edge_list in freq_subgraph_edge_list:
												print(_A				)

def 					UpperCamelCase		( _A,					_A,					_A,					_A				):






						"""simple docstring"""







						for i in cluster[ca]:
												__magic_name__    :     Any     		=      0
												__magic_name__    :     Any     		=      ca + 1
												while ca < max(cluster.keys()				):
																		for j in cluster[ca]:
																								if int(_A,					2				) & int(_A,					2				) == int(_A,					2				):
																														if tuple(nodes[i]				) in graph:
																																				graph[tuple(nodes[i]				)].append(nodes[j]				)
																														else:
																																				__magic_name__    :     int     		=      [nodes[j]]
																														count += 1
																		if count == 0:
																								__magic_name__    :     Optional[Any]     		=      ca + 1
																		else:
																								break

def 					UpperCamelCase		( _A,					_A				):






						"""simple docstring"""







						__magic_name__    :     List[str]     		=      cluster[max(cluster.keys()				)]
						__magic_name__    :     List[Any]     		=      """Header"""
						__magic_name__    :     Tuple     		=      {}
						for i in x:
												if (["Header"],) in graph:
																		graph[(["Header"],)].append(x[i]				)
												else:
																		__magic_name__    :     List[str]     		=      [x[i]]
						for i in x:
												__magic_name__    :     Tuple     		=      [["""Header"""]]
						__magic_name__    :     Union[str, Any]     		=      1
						while i < max(_A				) - 1:
												create_edge(_A,					_A,					_A,					_A				)
												__magic_name__    :     Optional[Any]     		=      i + 1
						return graph

def 					UpperCamelCase		( _A,					_A,					_A,					_A=None				):






						"""simple docstring"""







						__magic_name__    :     str     		=      (path or []) + [start]
						if start == end:
												paths.append(_A				)
						for node in graph[start]:
												if tuple(_A				) not in path:
																		my_dfs(_A,					tuple(_A				),					_A,					_A				)

def 					UpperCamelCase		( _A,					_A,					_A				):






						"""simple docstring"""







						__magic_name__    :     Union[str, Any]     		=      int(s / 100 * (len(_A				) - 1)				)
						for i in cluster[k]:
												my_dfs(_A,					tuple(cluster[k][i]				),					(["""Header"""],)				)

def 					UpperCamelCase		( _A				):






						"""simple docstring"""







						__magic_name__    :     str     		=      []
						for edges in paths:
												__magic_name__    :     List[Any]     		=      []
												for j in range(len(_A				) - 1				):
																		__magic_name__    :     Any     		=      list(edges[j]				)
																		for e in temp:
																								__magic_name__    :     Optional[Any]     		=      (e[0], e[1])
																								el.append(_A				)
												freq_sub_el.append(_A				)
						return freq_sub_el

def 					UpperCamelCase		( _A				):






						"""simple docstring"""







						for i in range(len(_A				)				):
												for j in range(len(edge_array[i]				)				):
																		__magic_name__    :     Any     		=      edge_array[i][j].split("""-"""				)
																		__magic_name__    :     Optional[int]     		=      t


if __name__ == "__main__":
		preprocess(edge_array)
		__magic_name__:  Optional[int]  	=			get_frequency_table(edge_array)
		__magic_name__:  str  	=			get_nodes(frequency_table)
		__magic_name__:  List[str]  	=			get_cluster(nodes)
		__magic_name__:  Optional[Any]  	=			get_support(cluster)
		__magic_name__:  Dict  	=			construct_graph(cluster, nodes)
		find_freq_subgraph_given_support(60, cluster, graph)
		__magic_name__:  list  	=			[]
		__magic_name__:  Dict  	=			freq_subgraphs_edge_list(paths)
		print_all()
