def METHOD_NAME(module_name):
    r"""
    Find a top-level :class:`Feature` that provides the Python module of the given ``module_name``.
    Only features known to :func:`all_features` are considered.
    INPUT:
    - ``module_name`` -- string
    OUTPUT: a :class:`Feature` or ``None``.
    EXAMPLES::
        sage: from sage.features.all import module_feature
        sage: module_feature('sage.combinat.tableau')                                   # needs sage.combinat
        Feature('sage.combinat')
        sage: module_feature('sage.combinat.posets.poset')                              # needs sage.graphs
        Feature('sage.graphs')
        sage: module_feature('sage.schemes.toric.variety')                              # needs sage.geometry.polyhedron
        Feature('sage.geometry.polyhedron')
        sage: module_feature('scipy')                                                   # needs scipy
        Feature('scipy')
        sage: print(module_feature('sage.structure.element'))
        None
        sage: print(module_feature('sage.does_not_exist'))
        None
    """
    longest_prefix = ''
    longest_prefix_feature = None
    for feature in all_features():
        for joined in itertools.chain([feature], feature.joined_features()):
            if joined.name == module_name:
                return feature
            if (joined.name + '.').startswith(longest_prefix):
                if (module_name + '.').startswith(joined.name + '.'):
                    longest_prefix = feature.name + '.'
                    longest_prefix_feature = feature
    return longest_prefix_feature