class_docstr: Async version of the base class where the decorators and base function for
  the other classes of this python wrapper will inherit from.
class_docstr_tok: ["Async","version","of","the","base","class","where","the","decorators","and","base","function","for","the","other","classes","of","this","python","wrapper","will","inherit","from","."]
docstr: 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
docstr_tok: ["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"]
code: def _call_api_on_func(cls, func):
      """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
      """
  
      # Argument Handling
      argspec = inspect.getfullargspec(func)
      try:
          # Asumme most of the cases have a mixed between args and named
          # args
          positional_count = len(argspec.args) - len(argspec.defaults)
          defaults = dict(
              zip(argspec.args[positional_count:], argspec.defaults)
          )
      except TypeError:
          if argspec.args:
              # No defaults
              positional_count = len(argspec.args)
              defaults = {}
          elif argspec.defaults:
              # Only defaults
              positional_count = 0
              defaults = argspec.defaults
      # Actual decorating
  
      @wraps(func)
      async def _call_wrapper(self, *args, **kwargs):
          used_kwargs = kwargs.copy()
          # Get the used positional arguments given to the function
          used_kwargs.update(
              zip(
                  argspec.args[positional_count:],
                  args[positional_count:],
              )
          )
          # Update the dictionary to include the default parameters from the
          # function
          used_kwargs.update(
              {k: used_kwargs.get(k, d) for k, d in defaults.items()}
          )
          # Form the base url, the original function called must return
          # the function name defined in the alpha vantage api and the data
          # key for it and for its meta data.
          function_name, data_key, meta_data_key = func(
              self, *args, **kwargs
          )
          base_url = (
              AlphaVantage._RAPIDAPI_URL
              if self.rapidapi
              else AlphaVantage._ALPHA_VANTAGE_API_URL
          )
          url = "{}function={}".format(base_url, function_name)
          for idx, arg_name in enumerate(argspec.args[1:]):
              try:
                  arg_value = args[idx]
              except IndexError:
                  arg_value = used_kwargs[arg_name]
              if "matype" in arg_name and arg_value:
                  # If the argument name has matype, we gotta map the string
                  # or the integer
                  arg_value = self.map_to_matype(arg_value)
              if arg_value:
                  # Discard argument in the url formation if it was set to
                  # None (in other words, this will call the api with its
                  # internal defined parameter)
                  if isinstance(arg_value, tuple) or isinstance(
                      arg_value, list
                  ):
                      # If the argument is given as list, then we have to
                      # format it, you gotta format it nicely
                      arg_value = ",".join(arg_value)
                  url = "{}&{}={}".format(url, arg_name, arg_value)
          # Allow the output format to be json or csv (supported by
          # alphavantage api). Pandas is simply json converted.
          if (
              "json" in self.output_format.lower()
              or "csv" in self.output_format.lower()
          ):
              oformat = self.output_format.lower()
          elif "pandas" in self.output_format.lower():
              oformat = "json"
          else:
              raise ValueError(
                  "Output format: {} not recognized, only json,"
                  "pandas and csv are supported".format(
                      self.output_format.lower()
                  )
              )
          apikey_parameter = (
              "" if self.rapidapi else "&apikey={}".format(self.key)
          )
          if self._append_type:
              url = "{}{}&datatype={}".format(
                  url, apikey_parameter, oformat
              )
          else:
              url = "{}{}".format(url, apikey_parameter)
          return (
              await self._handle_api_call(url),
              data_key,
              meta_data_key,
          )
  
      return _call_wrapper
  
file_path: alpha_vantage/alpha_vantage/async_support/alphavantage.py
imports: import aiohttp
  from functools import wraps
  import inspect
  import re
  import csv
  from ..alphavantage import AlphaVantage
label_desc: Use image node_id 2 for calling the AlphaVantage obj's underlying member method code with example usage: obj._call_api_on_func(cls, func) and returns: _call_wrapper, unknown,  data_key,  meta_data_key