def METHOD_NAME(
    self,
    key: str,
    cast: typing.Optional[typing.Callable[[typing.Any], typing.Any]] = None,
    default: typing.Any = undefined,
) -> typing.Any:
    key = self.env_prefix + key
    if key in self.environ:
        value = self.environ[key]
        return self._perform_cast(key, value, cast)
    if key in self.file_values:
        value = self.file_values[key]
        return self._perform_cast(key, value, cast)
    if default is not undefined:
        return self._perform_cast(key, default, cast)
    raise KeyError(f"Config '{key}' is missing, and has no default.")