def METHOD_NAME(name, default=None):
    """The same logic as in os.environ, but with None check."""
    result = os.getenv(name, default)
    if result is not None:
        result = six.ensure_text(result)
    return result