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 in charge of giving the output its right format, either
  json or pandas
  
  Keyword Arguments:
      func:  The function to be decorated
      override:  Override the internal format of the call, default None
docstr_tok: ["Decorator","in","charge","of","giving","the","output","its","right","format",",","either","json","or","pandas","Keyword","Arguments",":","func",":","The","function","to","be","decorated","override",":","Override","the","internal","format","of","the","call",",","default","None"]
code: def _output_format(cls, func, override=None):
      """Decorator in charge of giving the output its right format, either
      json or pandas
  
      Keyword Arguments:
          func:  The function to be decorated
          override:  Override the internal format of the call, default None
      """
  
      @wraps(func)
      async def _format_wrapper(self, *args, **kwargs):
          call_response, data_key, meta_data_key = await func(
              self, *args, **kwargs
          )
          if (
              "json" in self.output_format.lower()
              or "pandas" in self.output_format.lower()
          ):
              data = call_response[data_key]
  
              if meta_data_key is not None:
                  meta_data = call_response[meta_data_key]
              else:
                  meta_data = None
              # Allow to override the output parameter in the call
              if override is None:
                  output_format = self.output_format.lower()
              elif "json" or "pandas" in override.lower():
                  output_format = override.lower()
              # Choose output format
              if output_format == "json":
                  return data, meta_data
              elif output_format == "pandas":
                  if isinstance(data, list):
                      # If the call returns a list, then we will append them
                      # in the resulting data frame. If in the future
                      # alphavantage decides to do more with returning arrays
                      # this might become buggy. For now will do the trick.
                      data_array = []
                      for val in data:
                          data_array.append([v for _, v in val.items()])
                      data_pandas = pandas.DataFrame(
                          data_array,
                          columns=[k for k, _ in data[0].items()],
                      )
                  else:
                      try:
                          data_pandas = pandas.DataFrame.from_dict(
                              data, orient="index", dtype="float"
                          )
                      # This is for Global quotes or any other new Alpha Vantage
                      # data that is added.
                      # It will have to be updated so that we can get exactly
                      # The dataframes we want moving forward
                      except ValueError:
                          data = {data_key: data}
                          data_pandas = pandas.DataFrame.from_dict(
                              data, orient="index", dtype="object"
                          )
                          return data_pandas, meta_data
  
                  if "integer" in self.indexing_type:
                      # Set Date as an actual column so a new numerical index
                      # will be created, but only when specified by the user.
                      data_pandas.reset_index(level=0, inplace=True)
                      data_pandas.index.name = "index"
                  else:
                      data_pandas.index.name = "date"
                      # convert to pandas._libs.tslibs.timestamps.Timestamp
                      data_pandas.index = pandas.to_datetime(
                          data_pandas.index
                      )
                  return data_pandas, meta_data
          elif "csv" in self.output_format.lower():
              return call_response, None
          else:
              raise ValueError(
                  "Format: {} is not supported".format(
                      self.output_format
                  )
              )
  
      return _format_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 4 for calling the AlphaVantage obj's underlying member method code with example usage: obj._output_format(cls, func, override) and returns: _format_wrapper, data,  meta_data, call_response,  None, data_pandas,  meta_data, data_pandas,  meta_data