code: def _path_from_env(variable: str, default: Path) -> Path:
      
      # TODO(srstevenson): Use assignment expression in Python 3.8.
      value = os.environ.get(variable)
      if value:
          return Path(value)
      return default
docs: Read an environment variable as a path.
  
      The environment variable with the specified name is read, and its
      value returned as a path. If the environment variable is not set, or
      set to the empty string, the default value is returned.
  
      Parameters
      ----------
      variable : str
          Name of the environment variable.
      default : Path
          Default value.
  
      Returns
      -------
      Path
          Value from environment or default.