def clean_groupname(string):
 string = string.strip(groupname_seps)
 if ((not (string.endswith(tuple(groupname_ignore_seps)) and string.startswith(tuple(groupname_ignore_seps)))) and (not any(((i in string.strip(groupname_ignore_seps)) for i in groupname_ignore_seps)))):
  string = string.strip(groupname_ignore_seps)
 for forbidden in forbidden_groupnames:
  if string.lower().startswith(forbidden):
   string = string[len(forbidden):]
   string = string.strip(groupname_seps)
  if string.lower().endswith(forbidden):
   string = string[:len(forbidden)]
   string = string.strip(groupname_seps)
 return string

def clean_groupname ( string ) : string = string . strip ( groupname_seps ) if ( ( not ( string . endswith ( tuple ( groupname_ignore_seps ) ) and string . startswith ( tuple ( groupname_ignore_seps ) ) ) ) and ( not any ( ( ( i in string . strip ( groupname_ignore_seps ) ) for i in groupname_ignore_seps ) ) ) ) : string = string . strip ( groupname_ignore_seps ) for forbidden in forbidden_groupnames : if string . lower ( ) . startswith ( forbidden ) : string = string [ len ( forbidden ) : ] string = string . strip ( groupname_seps ) if string . lower ( ) . endswith ( forbidden ) : string = string [ : len ( forbidden ) ] string = string . strip ( groupname_seps ) return string
removes and strip separators from input_string .