code: def _nxapi_config(commands, methods='cli_conf', bsb_arg=None, **kwargs):
      '''
      Helper function to send configuration commands using NX-API.
      '''
      api_kwargs = __salt__['config.get']('nxos', {})
      api_kwargs.update(**kwargs)
      if not isinstance(commands, list):
          commands = [commands]
      try:
          ret = _nxapi_request(commands, **kwargs)
          if api_kwargs.get('no_save_config'):
              pass
          else:
              _nxapi_request(COPY_RS, **kwargs)
          for each in ret:
              if 'Failure' in each:
                  log.error(each)
      except CommandExecutionError as e:
          log.error(e)
          return [commands, repr(e)]
      return [commands, retf _nxapi_config(commands, methods='cli_conf', bsb_arg=None, **kwargs):
      '''
      Helper function to send configuration commands using NX-API.
      '''
      api_kwargs = __salt__['config.get']('nxos', {})
      api_kwargs.update(**kwargs)
      if not isinstance(commands, list):
          commands = [commands]
      try:
          ret = _nxapi_request(commands, **kwargs)
          if api_kwargs.get('no_save_config'):
              pass
          else:
              _nxapi_request(COPY_RS, **kwargs)
          for each in ret:
              if 'Failure' in each:
                  log.error(each)
      except CommandExecutionError as e:
          log.error(e)
          return [commands, repr(e)]
      return [commands, ret]
docs: Helper function to send configuration commands using NX-API.