.. versionadded:: 2019.2.0

    Invoke an arbitrary method from the ``pyeapi`` library.
    This function forwards the existing connection details to the
    :mod:`pyeapi.run_commands <salt.module.arista_pyeapi.run_commands>`
    execution function.

    method
        The name of the ``pyeapi`` method to invoke.

    kwargs
        Key-value arguments to send to the ``pyeapi`` method.

    CLI Example:

    .. code-block:: bash

        salt '*' napalm.pyeapi_call run_commands 'show version' encoding=text
        salt '*' napalm.pyeapi_call get_config as_string=True

def pyeapi_call(method, *args, **kwargs):
    '''
    .. versionadded:: 2019.2.0

    Invoke an arbitrary method from the ``pyeapi`` library.
    This function forwards the existing connection details to the
    :mod:`pyeapi.run_commands <salt.module.arista_pyeapi.run_commands>`
    execution function.

    method
        The name of the ``pyeapi`` method to invoke.

    kwargs
        Key-value arguments to send to the ``pyeapi`` method.

    CLI Example:

    .. code-block:: bash

        salt '*' napalm.pyeapi_call run_commands 'show version' encoding=text
        salt '*' napalm.pyeapi_call get_config as_string=True
   '''
    pyeapi_kwargs = pyeapi_nxos_api_args(**kwargs)
    return __salt__['pyeapi.call'](method, *args, **pyeapi_kwargs)