parameters: (self, *args)
return_statement: return channels if len(channels) > 1 else channels[0]
docstring: Return list of channels that collects the input from all the arguments.
      The arguments can be channels, resources, or lists of channels or
      resources.
docstring_summary: Return list of channels that collects the input from all the arguments.
      The arguments can be channels, resources, or lists of channels or
      resources.
docstring_tokens: Return list of channels that collects the input from all the arguments . The arguments can be channels resources or lists of channels or resources .
function: def collect(self, *args):
      """Return list of channels that collects the input from all the arguments.
      The arguments can be channels, resources, or lists of channels or
      resources."""
      channels = []
      for arg in args:
        if isinstance(arg, Channel):
          channels.append(arg)
        elif isinstance(arg, Resource):
          channels.append(self.read(arg))
        elif isinstance(arg, list):
          for elem in arg:
            if isinstance(elem, Channel):
              channels.append(elem)
            elif isinstance(elem, Resource):
              channels.append(self.read(elem))
            else:
              raise Exception("illegal element")
        else:
          raise Exception("illegal argument")
      return channels if len(channels) > 1 else channels[0]
function_tokens: def collect ( self , * args ) : channels = [ ] for arg in args : if isinstance ( arg , Channel ) : channels . append ( arg ) elif isinstance ( arg , Resource ) : channels . append ( self . read ( arg ) ) elif isinstance ( arg , list ) : for elem in arg : if isinstance ( elem , Channel ) : channels . append ( elem ) elif isinstance ( elem , Resource ) : channels . append ( self . read ( elem ) ) else : raise Exception ( "illegal element" ) else : raise Exception ( "illegal argument" ) return channels if len ( channels ) > 1 else channels [ 0 ]