

_lowerCamelCase							=[
    ['''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      snake_case__							(  lowerCAmelCase_     ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE 		=set()
     for row in edge_array:
          for item in row:
               distinct_edge.add(item[0]     )
     return list(_lowercase     )







def      snake_case__							(  lowerCAmelCase_,       lowerCAmelCase_     ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE 		=['0'] * len(_lowercase     )
     for i, row in enumerate(_lowercase     ):
          for item in row:
               if distinct_edge in item[0]:
                    SCREAMING_SNAKE_CASE 		='1'
                    break
     return "".join(_lowercase     )







def      snake_case__							(  lowerCAmelCase_     ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE 		=get_distinct_edge(_lowercase     )
     SCREAMING_SNAKE_CASE 		={}

     for item in distinct_edge:
          SCREAMING_SNAKE_CASE 		=get_bitcode(_lowercase,       _lowercase     )
          # print('bit',bit)
          # bt=''.join(bit)
          SCREAMING_SNAKE_CASE 		=bit.count('1'     )
          SCREAMING_SNAKE_CASE 		=[s, bit]
     # Store [Distinct edge, WT(Bitcode), Bitcode] in descending order
     SCREAMING_SNAKE_CASE 		=[
         [k, v[0], v[1]]
         for k, v in sorted(frequency_table.items(),       key=lambda lowerCAmelCase_     : v[1][0],       reverse=_lowercase     )
     ]
     return sorted_frequency_table







def      snake_case__							(  lowerCAmelCase_     ):





     """simple docstring"""







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







def      snake_case__							(  lowerCAmelCase_     ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE 		={}
     for key, value in nodes.items():
          SCREAMING_SNAKE_CASE 		=value
     return cluster







def      snake_case__							(  lowerCAmelCase_     ):





     """simple docstring"""







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







def      snake_case__							(  ):





     """simple docstring"""







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







def      snake_case__							(  lowerCAmelCase_,       lowerCAmelCase_,       lowerCAmelCase_,       lowerCAmelCase_     ):





     """simple docstring"""







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







def      snake_case__							(  lowerCAmelCase_,       lowerCAmelCase_     ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE 		=cluster[max(cluster.keys()     )]
     SCREAMING_SNAKE_CASE 		='Header'
     SCREAMING_SNAKE_CASE 		={}
     for i in x:
          if (["Header"],) in graph:
               graph[(["Header"],)].append(x[i]     )
          else:
               SCREAMING_SNAKE_CASE 		=[x[i]]
     for i in x:
          SCREAMING_SNAKE_CASE 		=[['Header']]
     SCREAMING_SNAKE_CASE 		=1
     while i < max(_lowercase     ) - 1:
          create_edge(_lowercase,       _lowercase,       _lowercase,       _lowercase     )
          SCREAMING_SNAKE_CASE 		=i + 1
     return graph







def      snake_case__							(  lowerCAmelCase_,       lowerCAmelCase_,       lowerCAmelCase_,       lowerCAmelCase_=None     ):





     """simple docstring"""







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







def      snake_case__							(  lowerCAmelCase_,       lowerCAmelCase_,       lowerCAmelCase_     ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE 		=int(s / 100 * (len(_lowercase     ) - 1)     )
     for i in cluster[k]:
          my_dfs(_lowercase,       tuple(cluster[k][i]     ),       (['Header'],)     )







def      snake_case__							(  lowerCAmelCase_     ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE 		=[]
     for edges in paths:
          SCREAMING_SNAKE_CASE 		=[]
          for j in range(len(_lowercase     ) - 1     ):
               SCREAMING_SNAKE_CASE 		=list(edges[j]     )
               for e in temp:
                    SCREAMING_SNAKE_CASE 		=(e[0], e[1])
                    el.append(_lowercase     )
          freq_sub_el.append(_lowercase     )
     return freq_sub_el







def      snake_case__							(  lowerCAmelCase_     ):





     """simple docstring"""







     for i in range(len(_lowercase     )     ):
          for j in range(len(edge_array[i]     )     ):
               SCREAMING_SNAKE_CASE 		=edge_array[i][j].split('-'     )
               SCREAMING_SNAKE_CASE 		=t


if __name__ == "__main__":
 preprocess(edge_array)
 _lowerCamelCase							=get_frequency_table(edge_array)
 _lowerCamelCase							=get_nodes(frequency_table)
 _lowerCamelCase							=get_cluster(nodes)
 _lowerCamelCase							=get_support(cluster)
 _lowerCamelCase							=construct_graph(cluster, nodes)
 find_freq_subgraph_given_support(60, cluster, graph)
 _lowerCamelCase							=[]
 _lowerCamelCase							=freq_subgraphs_edge_list(paths)
 print_all()






'''simple docstring'''

import torch

from transformers import PreTrainedModel

from .custom_configuration import CustomConfig, NoSuperInitConfig



class 		lowerCamelCase__   (    A  ):




					'''simple docstring'''



					A_         =    CustomConfig




					def __init__(	self					:						int  ,	UpperCamelCase_					:						List[str]       )	->							int:



						'''simple docstring'''





						super().__init__(UpperCamelCase_       )
						_lowercase       :							List[Any]  	=		torch.nn.Linear(config.hidden_size  ,	config.hidden_size       )




					def     __UpperCAmelCase  (	self					:						Optional[int]  ,	UpperCamelCase_					:						Any       )	->							Union[str, Any]:



						'''simple docstring'''





						return self.linear(UpperCamelCase_       )




					def     __UpperCAmelCase  (	self					:						Optional[int]  ,	UpperCamelCase_					:						Optional[Any]       )	->							str:



						'''simple docstring'''





						pass






class 		lowerCamelCase__   (    A  ):




					'''simple docstring'''



					A_         =    NoSuperInitConfig




					def __init__(	self					:						Optional[int]  ,	UpperCamelCase_					:						Dict       )	->							Optional[Any]:



						'''simple docstring'''





						super().__init__(UpperCamelCase_       )
						_lowercase       :							List[str]  	=		torch.nn.Linear(config.attribute  ,	config.attribute       )




					def     __UpperCAmelCase  (	self					:						Optional[Any]  ,	UpperCamelCase_					:						Optional[int]       )	->							List[Any]:



						'''simple docstring'''





						return self.linear(UpperCamelCase_       )




					def     __UpperCAmelCase  (	self					:						Optional[Any]  ,	UpperCamelCase_					:						int       )	->							List[str]:



						'''simple docstring'''





						pass
