class_docstr: Component for forwarding parameters to APIs
  
  Args:
      url: url of the API.
      out: count of expected returned values or their names in a chainer.
      param_names: list of parameter names for API requests.
      debatchify: if ``True``, single instances will be sent to the API endpoint instead of batches.
  
  Attributes:
      url: url of the API.
      out_count: count of expected returned values.
      param_names: list of parameter names for API requests.
      debatchify: if True, single instances will be sent to the API endpoint instead of batches.
docstr: Args:
      *args: list of parameters sent to the API endpoint. Parameter names are taken from self.param_names.
      **kwargs: named parameters to send to the API endpoint. If not empty, args are ignored
  
  Returns:
      result of the API request(s)
docstr_tok: ["Args",":","*","args",":","list","of","parameters","sent","to","the","API","endpoint",".","Parameter","names","are","taken","from","self.param_names",".","*","*","kwargs",":","named","parameters","to","send","to","the","API","endpoint",".","If","not","empty",",","args","are","ignored","Returns",":","result","of","the","API","request","(","s",")"]
code: def __call__(self, *args: List[Any], **kwargs: Dict[str, Any]):
      """
  
      Args:
          *args: list of parameters sent to the API endpoint. Parameter names are taken from self.param_names.
          **kwargs: named parameters to send to the API endpoint. If not empty, args are ignored
  
      Returns:
          result of the API request(s)
      """
      data = kwargs or dict(zip(self.param_names, args))
  
      if self.debatchify:
          batch_size = 0
          for v in data.values():
              batch_size = len(v)
              break
  
          assert batch_size > 0
  
          async def collect():
              return [
                  j
                  async for j in self.get_async_response(
                      data, batch_size
                  )
              ]
  
          loop = asyncio.get_event_loop()
          response = loop.run_until_complete(collect())
          if self.out_count > 1:
              response = list(zip(*response))
      else:
          response = requests.post(self.url, json=data).json()
  
      return response
  
file_path: DeepPavlov/deeppavlov/models/api_requester/api_requester.py
imports: import asyncio
  from typing import Any, List, Dict, AsyncIterable
  import requests
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.component import Component
label_desc: Use image node_id 2 for calling the ApiRequester obj's underlying member method code with example usage: obj.__call__() and returns: response, unknown