code: def test_set_requirements_with_cached_directory(self):
      tmp_dir = self.tempdir
      requirements_txt_path = os.path.join(
          tmp_dir, "requirements_txt_" + str(uuid.uuid4())
      )
      with open(requirements_txt_path, "w") as f:
          f.write("python-package1==0.0.0")
  
      requirements_dir_path = os.path.join(
          tmp_dir, "requirements_dir_" + str(uuid.uuid4())
      )
      os.mkdir(requirements_dir_path)
      package_file_name = "python-package1-0.0.0.tar.gz"
      with open(
          os.path.join(requirements_dir_path, package_file_name), "wb"
      ) as f:
          import base64
  
          # This base64 data is encoded from a python package file which includes a
          # "python_package1" module. The module contains a "plus(a, b)" function.
          # The base64 can be recomputed by following code:
          # base64.b64encode(open("python-package1-0.0.0.tar.gz", "rb").read()).decode("utf-8")
          f.write(
              base64.b64decode(
                  "H4sICNefrV0C/2Rpc3QvcHl0aG9uLXBhY2thZ2UxLTAuMC4wLnRhcgDtmVtv2jAYhnPtX2H1CrRCY+ckI"
                  "XEx7axuUA11u5imyICTRc1JiVnHfv1MKKWjYxwKEdPehws7xkmUfH5f+3PyqfqWpa1cjG5EKFnLbOvfhX"
                  "FQTI3nOPPSdavS5Pa8nGMwy3Esi3ke9wyTObbnGNQxamBSKlFQavzUryG8ldG6frpbEGx4yNmDLMp/hPy"
                  "P8b+6fNN613vdP1z8XdteG3+ug/17/F3Hcw1qIv5H54NUYiyUaH2SRRllaYeytkl6IpEdujI2yH2XapCQ"
                  "wSRJRDHt0OveZa//uUfeZonUvUO5bHo+0ZcoVo9bMhFRvGx9H41kWj447aUsR0WUq+pui8arWKggK5Jli"
                  "wGOo/95q79ovXi6/nfyf246Dof/n078fT9KI+X77Xx6BP83bX4Xf5NxT7dz7toO/L8OxjKgeTwpG+KcDp"
                  "sdQjWFVJMipYI+o0MCk4X/t2UYtqI0yPabCHb3f861XcD/Ty/+Y5nLdCzT0dSPo/SmbKsf6un+b7KV+Ls"
                  "W4/D/OoC9w/930P9eGwM75//csrD+Q/6P/P/k9D/oX3988Wqw1bS/tf6tR+s/m3EG/ddBqXO9XKf15C8p"
                  "P9k4HZBtBgzZaVW5vrfKcj+W32W82ygEB9D/Xu9+4/qfP9L/rBv0X1v87yONKRX61/qfzwqjIDzIPTbv/"
                  "7or3/88i0H/tfBFW7s/s/avRInQH06ieEy7tDrQeYHUdRN7wP+n/vf62LOH/pld7f9xz7a5Pfufedy0oP"
                  "86iJI8KxStAq6yLC4JWdbbVbWRikR2z1ZGytk5vauW3QdnBFE6XqwmykazCesAAAAAAAAAAAAAAAAAAAA"
                  "AAAAAAAAAAAAAAOBw/AJw5CHBAFAAAA=="
              )
          )
      self.t_env.set_python_requirements(
          requirements_txt_path, requirements_dir_path
      )
  
      def add_one(i):
          from python_package1 import plus
  
          return plus(i, 1)
  
      self.t_env.create_temporary_system_function(
          "add_one",
          udf(add_one, DataTypes.BIGINT(), DataTypes.BIGINT()),
      )
      sink_table_ddl = """
          CREATE TABLE Results(a BIGINT, b BIGINT) WITH ('connector'='test-sink')
          """
      self.t_env.execute_sql(sink_table_ddl)
      t = self.t_env.from_elements([(1, 2), (2, 5), (3, 1)], ["a", "b"])
      t.select(expr.call("add_one", t.a), t.a).execute_insert(
          "Results"
      ).wait()
  
      actual = source_sink_utils.results()
      self.assert_equals(actual, ["+I[2, 1]", "+I[3, 2]", "+I[4, 3]"])
  
imports: import os
  import shutil
  import sys
  import unittest
  import uuid
  from pyflink.table import DataTypes, TableEnvironment, EnvironmentSettings
  from pyflink.table import expressions
  from pyflink.table.udf import udf
  from pyflink.testing import source_sink_utils
  from pyflink.testing.test_case_utils import PyFlinkTestCase
label_desc: Use image node_id 3 for calling the StreamDependencyTests obj's underlying member method code with example usage: obj.test_set_requirements_with_cached_directory() and returns: plus