def _select_helper(args, kwargs):
 if (len(args) > 1):
  raise TypeError('select accepts at most ONE positional argument.')
 if ((len(args) > 0) and (len(kwargs) > 0)):
  raise TypeError('select accepts EITHER a positional argument, OR keyword arguments (not both).')
 if ((len(args) == 0) and (len(kwargs) == 0)):
  raise TypeError('select requires EITHER a positional argument, OR keyword arguments.')
 if args:
  arg = args[0]
  if isinstance(arg, dict):
   selector = arg
  elif isinstance(arg, string_types):
   selector = dict(name=arg)
  elif issubclass(arg, Model):
   selector = {'type': arg}
  else:
   raise RuntimeError('Selector must be a dictionary, string or plot object.')
 else:
  selector = kwargs
 return selector

def _select_helper ( args , kwargs ) : if ( len ( args ) > 1 ) : raise TypeError ( 'select accepts at most ONE positional argument.' ) if ( ( len ( args ) > 0 ) and ( len ( kwargs ) > 0 ) ) : raise TypeError ( 'select accepts EITHER a positional argument, OR keyword arguments (not both).' ) if ( ( len ( args ) == 0 ) and ( len ( kwargs ) == 0 ) ) : raise TypeError ( 'select requires EITHER a positional argument, OR keyword arguments.' ) if args : arg = args [ 0 ] if isinstance ( arg , dict ) : selector = arg elif isinstance ( arg , string_types ) : selector = dict ( name = arg ) elif issubclass ( arg , Model ) : selector = { 'type' : arg } else : raise RuntimeError ( 'Selector must be a dictionary, string or plot object.' ) else : selector = kwargs return selector
allow flexible selector syntax .