Parse response.

        :param args: List. 2 first items used as parser name and response to parse
        :param kwargs: dict, not used
        :return: dictionary or return value of called callable from parser.
540121
def parse(self, *args, **kwargs):  # pylint: disable=unused-argument
        
        # pylint: disable=W0703
        cmd = args[0]
        resp = args[1]
        if cmd in self.parsers:
            try:
                return self.parsers[cmd](resp)
            except Exception as err:
                print(err)
        return {}
231438
def request(self, *args, **kwargs):
        
        response = requests.request(*args, **kwargs)
        return BeautifulSoup.BeautifulSoup(response.text, "html.parser")
992644
def _get(self, *args, **kwargs):
        
        response = requests.get(*args, **kwargs)

        response.raise_for_status()

        return response.json()
299871
def get_args(self, kwargs):
        """"""
        args = dict(self.LoggerArgs)
        args.update(kwargs)
        return args
211612
def parse(self, *args):
        

        if isinstance(self.dictionary, dict):
            return self.dictionary

        raise self.subparserException("Argument passed to Dictionary SubParser is not a dict: %s" % type(self.dictionary))
1175269
def parse_args(self, args=None, namespace=None):
        
        if not namespace:  # use the new Namespace class for handling _config
            namespace = Namespace(self)
        namespace = super(ArgumentParser, self).parse_args(args, namespace)
        if len(self._reparse_args['pos']) > 0 or \
           len(self._reparse_args['opt']) > 0 or \
           len(self._reparse_args['sub']) > 0:
            args = self._reset_args()
            namespace = super(ArgumentParser, self).parse_args(args, namespace)
        # process "-hh..." here, after having parsed the arguments
        help_level = getattr(namespace, "help", 0)
        if help_level > 0:
            self.print_help()
            self.print_extended_help(help_level)
            self.exit()
        return namespace
1342343
def _get_context(argspec, kwargs):
    
    if argspec.keywords is not None:
        return kwargs
    return dict((arg, kwargs[arg]) for arg in argspec.args if arg in kwargs)
1363817
def parse_args(args):
    
    parser = argparse.ArgumentParser(
        description="Just a Hello World demonstration")
    parser.add_argument(
        '-v',
        '--version',
        action='version',
        version='twip {ver}'.format(ver=__version__))
    return parser.parse_args(args)
1186358
def parse_func_kwarg_keys(func, with_vals=False):
    
    sourcecode = get_func_sourcecode(func, strip_docstr=True,
                                     strip_comments=True)
    kwkeys = parse_kwarg_keys(sourcecode, with_vals=with_vals)
    #ut.get_func_kwargs  TODO
    return kwkeys
573087
def fn_kwargs(callable):
    
    fn = get_fn(callable)
    (args, _, _, defaults) = _inspect.getargspec(fn)
    if defaults is None: return { }
    return dict(list(zip(reversed(args), reversed(defaults))))
246918
def request_args(self):
        '''
        
        '''
        kwargs = {}
        kwargs.update(self.request.match_info.items())
        kwargs.update(self.request.query.items())
        return kwargs
686358
def parse_filters_kwargs(request, client_keywords=None):
    
    filters = {}
    kwargs = {}
    client_keywords = client_keywords or {}
    for param in request.GET:
        param_value = PARAM_MAPPING.get(request.GET[param], request.GET[param])
        if param in client_keywords:
            kwargs[param] = param_value
        else:
            filters[param] = param_value
    return filters, kwargs
469692
def parser(description=None, usage=None):
    """"""

    class ArgNamespace(object):
        def __init__(self, result):
            self._result = result

        def __getattr__(self, name):
            try:
                super(ArgNamespace, self).__getattr__(name)
            except AttributeError:
                return getattr(self._result, name)

        def arg_strings(self, name=None):
            if not self._result:
                return None
            return extract_strings(self._result.__dict__, name)

    class ArgParser(object):

        def __init__(self, argument_parser):
            self.parser = argument_parser
            self.parse = self.parse_args
            self._parsed = None

            self.arg = self.parser.add_argument
            self.opt = self.true = partial(self.arg, action='store_true')
            self.int = partial(self.arg, type=int)

        def parse_args(self):
            return ArgNamespace(self.parser.parse_args())

        def sub(self, name, help=''):
            self.arg(name, metavar=name, help=help, type=str)

        def args(self, name, help='', many='*'):
            self.arg(name, metavar=name, help=help, type=str, nargs=many)

        def answer(self, answers=None):
            yes_no = {
                'n': ('-n', '--no', 'Answer no'),
                'y': ('-y', '--yes', 'Answer yes'),
            }
            options = yes_no
            options.update(answers)
            [self.true(options[o]) for o in options]

    lines = description.splitlines()
    if not usage:
        if len(lines) > 1 and not lines[1]:
            usage, epilog = lines[0], '\n\n'.join(lines[2:])
    else:
        usage = description = lines[0]
        epilog = None
    return ArgParser(
        argparse.ArgumentParser(usage=description))
943896
def argparser_factory(self):
        

        return ArgumentParser(
            prog=self.prog, description=self.__doc__, add_help=False,
        )
1347078
def parse_input_args(input_args):
        
        input_args = input_args if input_args else {}
        for task, args in input_args.items():
            if not isinstance(task, EOTask):
                raise ValueError('Invalid input argument {}, should be an instance of EOTask'.format(task))

            if not isinstance(args, (tuple, dict)):
                raise ValueError('Execution input arguments of each task should be a dictionary or a tuple, for task '
                                 '{} got arguments of type {}'.format(task.__class__.__name__, type(args)))

        return input_args
1039678
def simple_dict() -> Callable:
    

    def parse(dict_str: str):

        def _parse(value: str):
            if value == "True":
                return True
            if value == "False":
                return False
            if "." in value:
                return float(value)
            return int(value)

        _dict = dict()
        try:
            for entry in dict_str.split(","):
                key, value = entry.split(":")
                _dict[key] = _parse(value)
        except ValueError:
            raise argparse.ArgumentTypeError("Specify argument dictionary as key1:value1,key2:value2,..."
                                             " Supported types: bool, int, float.")
        return _dict

    return parse
603775
def return_value(self, *args, **kwargs):
        

        self._called()
        return self._return_value(*args, **kwargs)