def list_to_scope(scope):
 if (isinstance(scope, unicode_type) or (scope is None)):
  return scope
 elif isinstance(scope, list):
  return u' '.join([unicode_type(s) for s in scope])
 elif isinstance(scope, set):
  return list_to_scope(list(scope))
 else:
  raise ValueError(u'Invalid scope, must be string or list.')

def list_to_scope ( scope ) : if ( isinstance ( scope , unicode_type ) or ( scope is None ) ) : return scope elif isinstance ( scope , list ) : return u' ' . join ( [ unicode_type ( s ) for s in scope ] ) elif isinstance ( scope , set ) : return list_to_scope ( list ( scope ) ) else : raise ValueError ( u'Invalid scope, must be string or list.' )
convert a list of scopes to a space separated string .