mendevi.database.meta.merge_extractors

mendevi.database.meta.merge_extractors(labels: set[str], select: str | None = None) Module[source]

Return the source code of the function that extracts all variables.

Examples

>>> from mendevi.database.meta import merge_extractors
>>> print("\n".join(merge_extractors({"rate", "profile"})[1]))
def line_extractor(raw: dict[str]) -> dict[str]:
"""Get the labels: profile, rate."""
    # deserialisation of basic values
    profile = extract.extract_profile(raw)
    size = extract.extract_video_size(raw)
    video_duration = extract.extract_video_duration(raw)

    # association of basic values
    rate = 8.0 * size / video_duration

    # packaging
    return {
        'profile': profile
        'rate': rate
    }
>>>