code: def _test_METHOD_with_credentials(
      self,
      http_method_function,
      http_session_method_function,
      headers=None,
      params=False,
      data=False,
      response=None,
  ):
      username, password = "username", "password"
      self.rnw.set_credentials(username, password)
  
      url = "url"
      _data = {"foo": "bar"}
  
      self.assertEqual(http_method_function(url, _data), response)
  
      pargs = {url}
      kwargs = {"timeout": None, "auth": self.rnw.auth}
      if data:
          kwargs["data"] = json.dumps(_data)
      if headers:
          kwargs["headers"] = headers
      if params:
          kwargs["params"] = _data
  
      http_session_method_function.assert_called_once_with(
          *pargs, **kwargs
      )
      self.assertEqual(self.rnw.auth, HTTPBasicAuth(username, password))
  
imports: import json
  import requests
  from requests.auth import HTTPBasicAuth
  from tabpy.tabpy_tools.rest import RequestsNetworkWrapper, ServiceClient
  import unittest
  from unittest.mock import Mock
label_desc: Use image node_id 18 for calling the TestRequestsNetworkWrapper obj's underlying member method code with example usage: obj._test_METHOD_with_credentials(http_method_function, http_session_method_function, headers, params, data, response) without return types