def METHOD_NAME(distribution_name):
    """Get a distribution by name."""
    try:
        if python_version >= 0x380:
            from importlib import metadata
        else:
            import importlib_metadata as metadata
    except ImportError:
        return None
    try:
        return metadata.distribution(distribution_name)
    except metadata.PackageNotFoundError:
        # If not found, lets assume package name was given, and resolve to
        # the distribution.
        dists = getDistributionsFromModuleName(distribution_name)
        if len(dists) == 1:
            return dists[0]
        return None