def _get_table_names(metadata, patterns):
 if patterns:
  table_names = set()
  for pattern in patterns:
   if (('.' in pattern) or ('/' in pattern)):
    (_, filename) = os.path.split(pattern)
    (table_name, _) = os.path.splitext(filename)
    pattern = table_name
   table_names.update(fnmatch.filter(metadata.tables.keys(), pattern))
 else:
  table_names = metadata.tables.keys()
 return list(table_names)

def _get_table_names ( metadata , patterns ) : if patterns : table_names = set ( ) for pattern in patterns : if ( ( '.' in pattern ) or ( '/' in pattern ) ) : ( _ , filename ) = os . path . split ( pattern ) ( table_name , _ ) = os . path . splitext ( filename ) pattern = table_name table_names . update ( fnmatch . filter ( metadata . tables . keys ( ) , pattern ) ) else : table_names = metadata . tables . keys ( ) return list ( table_names )
returns a list of table names from the given metadata .