code: 
  
  
  '''simple docstring'''
  
  import logging
  import os
  import sys
  import threading
  from logging import (
      CRITICAL,  # NOQA
      DEBUG,  # NOQA
      ERROR,  # NOQA
      FATAL,  # NOQA
      INFO,  # NOQA
      NOTSET,  # NOQA
      WARN,  # NOQA
      WARNING,  # NOQA
  )
  from typing import Optional
  
  from tqdm import auto as tqdm_lib
  
  
  lowerCAmelCase   :Optional[Any]								=    threading.Lock()
  lowerCAmelCase   :Dict								=    None
  
  lowerCAmelCase   :Optional[Any]								=    {
      '''debug''': logging.DEBUG,
      '''info''': logging.INFO,
      '''warning''': logging.WARNING,
      '''error''': logging.ERROR,
      '''critical''': logging.CRITICAL,
  }
  
  lowerCAmelCase   :Any								=    logging.WARNING
  
  lowerCAmelCase   :Union[str, Any]								=    True
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					str  			=  os.getenv('DIFFUSERS_VERBOSITY'	,	_A	)
  	if env_level_str:
  		if env_level_str in log_levels:
  			return log_levels[env_level_str]
  		else:
  			logging.getLogger().warning(
  			    f'Unknown option DIFFUSERS_VERBOSITY={env_level_str}, '
  			    f'has to be one of: { ", ".join(log_levels.keys()	) }'	)
  	return _default_log_level
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	return __name__.split('.'	)[0]
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	return logging.getLogger(_get_library_name()	)
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	global _default_handler
  
  	with _lock:
  		if _default_handler:
  			# This library has already configured the library root logger.
  			return
  		__magic_name__ :					Union[str, Any]  			=  logging.StreamHandler()  # Set sys.stderr as stream.
  		__magic_name__ :					Tuple  			=  sys.stderr.flush
  
  		# Apply our default configuration to the library root logger.
  		__magic_name__ :					Optional[int]  			=  _get_library_root_logger()
  		library_root_logger.addHandler(_default_handler	)
  		library_root_logger.setLevel(_get_default_logging_level()	)
  		__magic_name__ :					str  			=  False
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	global _default_handler
  
  	with _lock:
  		if not _default_handler:
  			return
  
  		__magic_name__ :					Tuple  			=  _get_library_root_logger()
  		library_root_logger.removeHandler(_default_handler	)
  		library_root_logger.setLevel(logging.NOTSET	)
  		__magic_name__ :					str  			=  None
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	return log_levels
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			Optional[str] = None	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	if name is None:
  		__magic_name__ :					int  			=  _get_library_name()
  
  	_configure_library_root_logger()
  	return logging.getLogger(_A	)
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	_configure_library_root_logger()
  	return _get_library_root_logger().getEffectiveLevel()
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			int	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	_configure_library_root_logger()
  	_get_library_root_logger().setLevel(_A	)
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	return set_verbosity(_A	)
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	return set_verbosity(_A	)
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	return set_verbosity(_A	)
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	return set_verbosity(_A	)
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	_configure_library_root_logger()
  
  	assert _default_handler is not None
  	_get_library_root_logger().removeHandler(_default_handler	)
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	_configure_library_root_logger()
  
  	assert _default_handler is not None
  	_get_library_root_logger().addHandler(_default_handler	)
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			logging.Handler	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	_configure_library_root_logger()
  
  	assert handler is not None
  	_get_library_root_logger().addHandler(_A	)
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			logging.Handler	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	_configure_library_root_logger()
  
  	assert handler is not None and handler not in _get_library_root_logger().handlers
  	_get_library_root_logger().removeHandler(_A	)
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	_configure_library_root_logger()
  	__magic_name__ :					Dict  			=  False
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	_configure_library_root_logger()
  	__magic_name__ :					List[str]  			=  True
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					Dict  			=  _get_library_root_logger().handlers
  
  	for handler in handlers:
  		__magic_name__ :					Tuple  			=  logging.Formatter('[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s >> %(message)s'	)
  		handler.setFormatter(_A	)
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					Any  			=  _get_library_root_logger().handlers
  
  	for handler in handlers:
  		handler.setFormatter(_A	)
  
  
  
  
  
  def lowerCamelCase    (    self       :			List[Any]	,	*lowerCAmelCase       :			int	,	**lowerCAmelCase       :			Any	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					List[str]  			=  os.getenv('DIFFUSERS_NO_ADVISORY_WARNINGS'	,	_A	)
  	if no_advisory_warnings:
  		return
  	self.warning(*_A	,	**_A	)
  
  
  lowerCAmelCase   :int								=    warning_advice
  class _lowerCamelCase :
  
  
  
  		'''simple docstring'''
  
  
  
  
  
  
  
  		def __init__(      self	:		int						,  *_A	:		Optional[int]						,  **_A	:		Optional[int]    )						->				Optional[Any]:  # pylint: disable=unused-argument
  			__magic_name__ :					Optional[Any]  			=  args[0] if args else None
  
  
  
  
  
  
  
  		def __iter__(      self	:		int    )						->				List[str]:
  			return iter(self._iterator    )
  
  
  
  
  
  
  
  		def __getattr__(      self	:		List[Any]						,  _A	:		Any    )						->				int:
  
  
  
  
  
  
  			def empty_fn(*_A	:		Optional[int]						,  **_A	:		Union[str, Any]    ):  # pylint: disable=unused-argument
  				return
  
  			return empty_fn
  
  
  
  
  
  
  
  		def __enter__(      self	:		Optional[int]    )						->				Dict:
  			return self
  
  
  
  
  
  
  
  		def __exit__(      self	:		str						,  _A	:		str						,  _A	:		Dict						,  _A	:		int    )						->				Any:
  			return
  
  
  
  
  
  
  
  class _lowerCamelCase :
  
  
  
  		'''simple docstring'''
  
  
  
  
  
  
  
  		def __call__(      self	:		Tuple						,  *_A	:		Dict						,  **_A	:		Optional[Any]    )						->				List[Any]:
  
  
  
  
  
  
  			if _tqdm_active:
  				return tqdm_lib.tqdm(*lowercase_						,  **lowercase_    )
  			else:
  				return EmptyTqdm(*lowercase_						,  **lowercase_    )
  
  
  
  
  
  
  
  		def      __lowerCAmelCase	(      self	:		int						,  *_A	:		Union[str, Any]						,  **_A	:		List[Any]    )						->				str:
  			__magic_name__ :					Optional[Any]  			=  None
  			if _tqdm_active:
  				return tqdm_lib.tqdm.set_lock(*lowercase_						,  **lowercase_    )
  
  
  
  
  
  
  
  		def      __lowerCAmelCase	(      self	:		Dict    )						->				int:
  
  
  
  
  
  
  			if _tqdm_active:
  				return tqdm_lib.tqdm.get_lock()
  
  
  
  
  
  
  
  lowerCAmelCase   :int								=    _tqdm_cls()
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	global _tqdm_active
  	return bool(_tqdm_active	)
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	global _tqdm_active
  	__magic_name__ :					Optional[Any]  			=  True
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	global _tqdm_active
  	__magic_name__ :					Tuple  			=  False
style_context: 
  
  
  '''simple docstring'''
  
  lowerCAmelCase   :int								=    [
      ['''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 lowerCamelCase    (    lowerCAmelCase       :			Tuple	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					Union[str, Any]  			=  set()
  	for row in edge_array:
  		for item in row:
  			distinct_edge.add(item[0]	)
  	return list(lowerCAmelCase	)
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			List[str]	,	lowerCAmelCase       :			Optional[int]	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					List[Any]  			=  ['0'] * len(lowerCAmelCase	)
  	for i, row in enumerate(lowerCAmelCase	):
  		for item in row:
  			if distinct_edge in item[0]:
  				__magic_name__ :					str  			=  '1'
  				break
  	return "".join(lowerCAmelCase	)
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			Tuple	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					Any  			=  get_distinct_edge(lowerCAmelCase	)
  	__magic_name__ :					Union[str, Any]  			=  {}
  
  	for item in distinct_edge:
  		__magic_name__ :					Union[str, Any]  			=  get_bitcode(lowerCAmelCase	,	lowerCAmelCase	)
  		# print('bit',bit)
  		# bt=''.join(bit)
  		__magic_name__ :					Dict  			=  bit.count('1'	)
  		__magic_name__ :					Dict  			=  [s, bit]
  	# Store [Distinct edge, WT(Bitcode), Bitcode] in descending order
  	__magic_name__ :					Optional[Any]  			=  [
  	    [k, v[0], v[1]]
  	    for k, v in sorted(frequency_table.items()	,	key=lambda lowerCAmelCase	: v[1][0]	,	reverse=lowerCAmelCase	)
  	]
  	return sorted_frequency_table
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			List[str]	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					Tuple  			=  {}
  	for _, item in enumerate(lowerCAmelCase	):
  		nodes.setdefault(item[2]	,	[]	).append(item[0]	)
  	return nodes
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			List[str]	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					str  			=  {}
  	for key, value in nodes.items():
  		__magic_name__ :					Union[str, Any]  			=  value
  	return cluster
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			List[str]	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	return [i * 100 / len(lowerCAmelCase	) for i in cluster]
  
  
  
  
  
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	print('\nNodes\n'	)
  	for key, value in nodes.items():
  		print(lowerCAmelCase	,	lowerCAmelCase	)
  	print('\nSupport\n'	)
  	print(lowerCAmelCase	)
  	print('\n Cluster \n'	)
  	for key, value in sorted(cluster.items()	,	reverse=lowerCAmelCase	):
  		print(lowerCAmelCase	,	lowerCAmelCase	)
  	print('\n Graph\n'	)
  	for key, value in graph.items():
  		print(lowerCAmelCase	,	lowerCAmelCase	)
  	print('\n Edge List of Frequent subgraphs \n'	)
  	for edge_list in freq_subgraph_edge_list:
  		print(lowerCAmelCase	)
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			int	,	lowerCAmelCase       :			str	,	lowerCAmelCase       :			Optional[Any]	,	lowerCAmelCase       :			int	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	for i in cluster[ca]:
  		__magic_name__ :					Tuple  			=  0
  		__magic_name__ :					Any  			=  ca + 1
  		while ca < max(cluster.keys()	):
  			for j in cluster[ca]:
  				if int(lowerCAmelCase	,	2	) & int(lowerCAmelCase	,	2	) == int(lowerCAmelCase	,	2	):
  					if tuple(nodes[i]	) in graph:
  						graph[tuple(nodes[i]	)].append(nodes[j]	)
  					else:
  						__magic_name__ :					List[Any]  			=  [nodes[j]]
  					count += 1
  			if count == 0:
  				__magic_name__ :					Tuple  			=  ca + 1
  			else:
  				break
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			Any	,	lowerCAmelCase       :			List[Any]	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					str  			=  cluster[max(cluster.keys()	)]
  	__magic_name__ :					Dict  			=  'Header'
  	__magic_name__ :					Optional[Any]  			=  {}
  	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__ :					Union[str, Any]  			=  [['Header']]
  	__magic_name__ :					List[str]  			=  1
  	while i < max(lowerCAmelCase	) - 1:
  		create_edge(lowerCAmelCase	,	lowerCAmelCase	,	lowerCAmelCase	,	lowerCAmelCase	)
  		__magic_name__ :					Dict  			=  i + 1
  	return graph
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			Dict	,	lowerCAmelCase       :			Tuple	,	lowerCAmelCase       :			List[Any]	,	lowerCAmelCase       :			Union[str, Any]=None	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					str  			=  (path or []) + [start]
  	if start == end:
  		paths.append(lowerCAmelCase	)
  	for node in graph[start]:
  		if tuple(lowerCAmelCase	) not in path:
  			my_dfs(lowerCAmelCase	,	tuple(lowerCAmelCase	)	,	lowerCAmelCase	,	lowerCAmelCase	)
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			Optional[Any]	,	lowerCAmelCase       :			Tuple	,	lowerCAmelCase       :			Union[str, Any]	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					Union[str, Any]  			=  int(s / 100 * (len(lowerCAmelCase	) - 1)	)
  	for i in cluster[k]:
  		my_dfs(lowerCAmelCase	,	tuple(cluster[k][i]	)	,	(['Header'],)	)
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			Optional[int]	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					str  			=  []
  	for edges in paths:
  		__magic_name__ :					List[Any]  			=  []
  		for j in range(len(lowerCAmelCase	) - 1	):
  			__magic_name__ :					List[str]  			=  list(edges[j]	)
  			for e in temp:
  				__magic_name__ :					Optional[int]  			=  (e[0], e[1])
  				el.append(lowerCAmelCase	)
  		freq_sub_el.append(lowerCAmelCase	)
  	return freq_sub_el
  
  
  
  
  
  def lowerCamelCase    (    lowerCAmelCase       :			str	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	for i in range(len(lowerCAmelCase	)	):
  		for j in range(len(edge_array[i]	)	):
  			__magic_name__ :					Any  			=  edge_array[i][j].split('-'	)
  			__magic_name__ :					Tuple  			=  t
  
  
  if __name__ == "__main__":
  							preprocess(edge_array)
  							lowerCAmelCase   :List[str]								=    get_frequency_table(edge_array)
  							lowerCAmelCase   :List[str]								=    get_nodes(frequency_table)
  							lowerCAmelCase   :Optional[int]								=    get_cluster(nodes)
  							lowerCAmelCase   :Tuple								=    get_support(cluster)
  							lowerCAmelCase   :Tuple								=    construct_graph(cluster, nodes)
  							find_freq_subgraph_given_support(6_0, cluster, graph)
  							lowerCAmelCase   :list								=    []
  							lowerCAmelCase   :str								=    freq_subgraphs_edge_list(paths)
  							print_all()