def sceneToNormalShowNames(name):
 if (not name):
  return []
 name_list = [name]
 new_name = re.sub('(?i)([\\. ])and([\\. ])', '\\1&\\2', name, re.I)
 if (new_name not in name_list):
  name_list.append(new_name)
 results = []
 for cur_name in name_list:
  results.append(re.sub('(\\D)(\\d{4})$', '\\1(\\2)', cur_name))
  country_match_str = '|'.join(countryList.values())
  results.append(re.sub((('(?i)([. _-])(' + country_match_str) + ')$'), '\\1(\\2)', cur_name))
 results += name_list
 return list(set(results))

def sceneToNormalShowNames ( name ) : if ( not name ) : return [ ] name_list = [ name ] new_name = re . sub ( '(?i)([\\. ])and([\\. ])' , '\\1&\\2' , name , re . I ) if ( new_name not in name_list ) : name_list . append ( new_name ) results = [ ] for cur_name in name_list : results . append ( re . sub ( '(\\D)(\\d{4})$' , '\\1(\\2)' , cur_name ) ) country_match_str = '|' . join ( countryList . values ( ) ) results . append ( re . sub ( ( ( '(?i)([. _-])(' + country_match_str ) + ')$' ) , '\\1(\\2)' , cur_name ) ) results += name_list return list ( set ( results ) )
takes a show name from a scene dirname and converts it to a more "human-readable" format .