code: def test_environment_override(self):
      var_name = "TF_FORWARD_COMPATIBILITY_DELTA_DAYS"
  
      def remove_os_environment_var():
          try:
              del os.environ[var_name]
          except KeyError:
              pass
  
      self.addCleanup(remove_os_environment_var)
  
      compatibility_date = self._compatibility_date()
      one_day_before = self._n_days_after(-1)
      one_day_after = self._n_days_after(1)
      ten_days_after = self._n_days_after(10)
      nine_days_after = self._n_days_after(9)
  
      self.assertTrue(compat.forward_compatible(*one_day_before))
      self.assertFalse(compat.forward_compatible(*compatibility_date))
      self.assertFalse(compat.forward_compatible(*one_day_after))
      self.assertFalse(compat.forward_compatible(*nine_days_after))
      self.assertFalse(compat.forward_compatible(*ten_days_after))
  
      os.environ[var_name] = "10"
      compat._update_forward_compatibility_date_number()
      self.assertTrue(compat.forward_compatible(*one_day_before))
      self.assertTrue(compat.forward_compatible(*compatibility_date))
      self.assertTrue(compat.forward_compatible(*one_day_after))
      self.assertTrue(compat.forward_compatible(*nine_days_after))
      self.assertFalse(compat.forward_compatible(*ten_days_after))
  
      del os.environ[var_name]
      compat._update_forward_compatibility_date_number()
      self.assertTrue(compat.forward_compatible(*one_day_before))
      self.assertFalse(compat.forward_compatible(*compatibility_date))
      self.assertFalse(compat.forward_compatible(*one_day_after))
      self.assertFalse(compat.forward_compatible(*nine_days_after))
      self.assertFalse(compat.forward_compatible(*ten_days_after))
  
      # Now test interaction between environment variable and context func.
      os.environ[var_name] = "10"
      compat._update_forward_compatibility_date_number()
      self.assertTrue(compat.forward_compatible(*one_day_after))
      with compat.forward_compatibility_horizon(*one_day_after):
          self.assertTrue(compat.forward_compatible(*one_day_before))
          self.assertTrue(
              compat.forward_compatible(*compatibility_date)
          )
          self.assertFalse(compat.forward_compatible(*one_day_after))
          self.assertFalse(compat.forward_compatible(*nine_days_after))
          self.assertFalse(compat.forward_compatible(*ten_days_after))
      self.assertTrue(compat.forward_compatible(*one_day_after))
  
file_path: tensorflow/tensorflow/python/compat/compat_test.py
imports: import datetime
  import os
  from tensorflow.python.compat import compat
  from tensorflow.python.platform import test
label_desc: Use image node_id 7 for calling the CompatTest obj's underlying member method code with example usage: obj.test_environment_override() without return types