def get_table_name_matches(conn, table_name_wildcard, separator):
  all_tables = []
  last_evaluated_table_name = None

  while True:
    table_list = conn.list_tables(exclusive_start_table_name=last_evaluated_table_name)
    all_tables.extend(table_list["TableNames"])

    try:
      last_evaluated_table_name = table_list["LastEvaluatedTableName"]
    except __HOLE__, e:
      break

  matching_tables = []
  for table_name in all_tables:
    if table_name_wildcard == "*":
      matching_tables.append(table_name)
    elif separator == None:
      if table_name.startswith(table_name_wildcard.split("*", 1)[0]):
        matching_tables.append(table_name)
    elif table_name.split(separator, 1)[0] == table_name_wildcard.split("*", 1)[0]:
      matching_tables.append(table_name)

  return matching_tables
dataset/ETHPy150Open bchew/dynamodump/dynamodump.py/get_table_name_matches