code: def netrc_from_environ(no_netrc, credentials):
      netrcpath = os.path.expanduser("~/.netrc")
      assert not os.path.exists(netrcpath)
      with open(netrcpath, "w") as f:
          f.write(
              "\n".join(
                  [
                      "machine apihub.copernicus.eu",
                      "login {}".format(credentials[0]),
                      "password {}".format(credentials[1]),
                  ]
              )
          )
      try:
          yield
      finally:
          os.remove(netrcpath)
  
imports: import json
  import os
  import re
  import glob
  import shutil
  from contextlib import contextmanager
  from functools import partialmethod
  import pytest
  import requests_mock
  from click.testing import CliRunner
  from sentinelsat import SentinelAPI, InvalidChecksumError
  from sentinelsat.scripts.cli import cli
label_desc: Use image node_id 4 for calling a global function with example usage: netrc_from_environ(no_netrc, credentials) without return types