<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _read_requires_python(metadata):
 """Read wheel metadata to know the value of Requires-Python. This is surprisingly poorly supported in Distlib. This function tries several ways to get this information: * Metadata 2.0: metadata.dictionary.get("requires_python") is not None * Metadata 2.1: metadata._legacy.get("Requires-Python") is not None * Metadata 1.2: metadata._legacy.get("Requires-Python") != "UNKNOWN" """

    # TODO: Support more metadata formats.
    value = metadata.dictionary.get("requires_python")
    if value is not None:
        return value
    if metadata._legacy:
        value = metadata._legacy.get("Requires-Python")
        if value is not None and value != "UNKNOWN":
            return value
    return ""