def _get_recurse_set(recurse):
 if (not recurse):
  return set()
 if (not isinstance(recurse, list)):
  raise TypeError('"recurse" must be formed as a list of strings')
 try:
  recurse_set = set(recurse)
 except TypeError:
  recurse_set = None
 if ((recurse_set is None) or (not (set(_RECURSE_TYPES) >= recurse_set))):
  raise ValueError('Types for "recurse" limited to {0}.'.format(', '.join(('"{0}"'.format(rtype) for rtype in _RECURSE_TYPES))))
 if (('ignore_files' in recurse_set) and ('ignore_dirs' in recurse_set)):
  raise ValueError('Must not specify "recurse" options "ignore_files" and "ignore_dirs" at the same time.')
 return recurse_set

def _get_recurse_set ( recurse ) : if ( not recurse ) : return set ( ) if ( not isinstance ( recurse , list ) ) : raise TypeError ( '"recurse" must be formed as a list of strings' ) try : recurse_set = set ( recurse ) except TypeError : recurse_set = None if ( ( recurse_set is None ) or ( not ( set ( _RECURSE_TYPES ) >= recurse_set ) ) ) : raise ValueError ( 'Types for "recurse" limited to {0}.' . format ( ', ' . join ( ( '"{0}"' . format ( rtype ) for rtype in _RECURSE_TYPES ) ) ) ) if ( ( 'ignore_files' in recurse_set ) and ( 'ignore_dirs' in recurse_set ) ) : raise ValueError ( 'Must not specify "recurse" options "ignore_files" and "ignore_dirs" at the same time.' ) return recurse_set
converse *recurse* definition to a set of strings .