def get_related_files(filename, include_this_file=True):
 related_files = []
 (path, name, this_type) = split_filename(filename)
 for type_set in related_filetype_sets:
  if (this_type in type_set):
   for related_type in type_set:
    if (include_this_file or (related_type != this_type)):
     related_files.append(os.path.join(path, (name + related_type)))
 if (not len(related_files)):
  related_files = [filename]
 return related_files

def get_related_files ( filename , include_this_file = True ) : related_files = [ ] ( path , name , this_type ) = split_filename ( filename ) for type_set in related_filetype_sets : if ( this_type in type_set ) : for related_type in type_set : if ( include_this_file or ( related_type != this_type ) ) : related_files . append ( os . path . join ( path , ( name + related_type ) ) ) if ( not len ( related_files ) ) : related_files = [ filename ] return related_files
returns a list of related files .