@classmethod<EOL><INDENT>def _call_api_on_func(cls, func):<DEDENT>
<EOL>if sys.version_info[<NUM_LIT:0>] < <NUM_LIT:3>:<EOL><INDENT>argspec = inspect.getargspec(func)<EOL><DEDENT>else:<EOL><INDENT>argspec = inspect.getfullargspec(func)<EOL><DEDENT>try:<EOL><INDENT>positional_count = len(argspec.args) - len(argspec.defaults)<EOL>defaults = dict(<EOL>zip(argspec.args[positional_count:], argspec.defaults))<EOL><DEDENT>except TypeError:<EOL><INDENT>if argspec.args:<EOL><INDENT>positional_count = len(argspec.args)<EOL>defaults = {}<EOL><DEDENT>elif argspec.defaults:<EOL><INDENT>positional_count = <NUM_LIT:0><EOL>defaults = argspec.defaults<EOL><DEDENT><DEDENT>@wraps(func)<EOL>def _call_wrapper(self, *args, **kwargs):<EOL><INDENT>used_kwargs = kwargs.copy()<EOL>used_kwargs.update(zip(argspec.args[positional_count:],<EOL>args[positional_count:]))<EOL>used_kwargs.update({k: used_kwargs.get(k, d)<EOL>for k, d in defaults.items()})<EOL>function_name, data_key, meta_data_key = func(<EOL>self, *args, **kwargs)<EOL>url = "<STR_LIT>".format(AlphaVantage._ALPHA_VANTAGE_API_URL,<EOL>function_name)<EOL>for idx, arg_name in enumerate(argspec.args[<NUM_LIT:1>:]):<EOL><INDENT>try:<EOL><INDENT>arg_value = args[idx]<EOL><DEDENT>except IndexError:<EOL><INDENT>arg_value = used_kwargs[arg_name]<EOL><DEDENT>if '<STR_LIT>' in arg_name and arg_value:<EOL><INDENT>arg_value = self.map_to_matype(arg_value)<EOL><DEDENT>if arg_value:<EOL><INDENT>if isinstance(arg_value, tuple) or isinstance(arg_value, list):<EOL><INDENT>arg_value = '<STR_LIT:U+002C>'.join(arg_value)<EOL><DEDENT>url = '<STR_LIT>'.format(url, arg_name, arg_value)<EOL><DEDENT><DEDENT>if '<STR_LIT>' in self.output_format.lower() or '<STR_LIT>' in self.output_format.lower():<EOL><INDENT>oformat = self.output_format.lower()<EOL><DEDENT>elif '<STR_LIT>' in self.output_format.lower():<EOL><INDENT>oformat = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>self.output_format.lower()))<EOL><DEDENT>if self._append_type:<EOL><INDENT>url = '<STR_LIT>'.format(url, self.key, oformat)<EOL><DEDENT>else:<EOL><INDENT>url = '<STR_LIT>'.format(url, self.key)<EOL><DEDENT>return self._handle_api_call(url), data_key, meta_data_key<EOL><DEDENT>return _call_wrapper<EOL>
Decorator for forming the api call with the arguments of the
        function, it works by taking the arguments given to the function
        and building the url to call the api on it

        Keyword Arguments:
            func:  The function to be decorated