code: def load_env_from_file(filename):
      
      if not os.path.exists(filename):
          raise FileNotFoundError("Environment file {} does not exist.".format(filename))
  
      with open(filename) as f:
          for lineno, line in enumerate(f):
              line = line.strip()
              if not line or line.startswith("#"):
                  continue
              if "=" not in line:
                  raise SyntaxError("Invalid environment file syntax in {} at line {}.".format(filename, lineno + 1))
  
              name, value = parse_var(line)
  
              yield name, value
docs: Read an env file into a collection of (name, value) tuples.