A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mlflow.org/docs/latest/python_api/../_modules/mlflow/entities/source_type.html below:

mlflow.entities.source_type

Source code for mlflow.entities.source_type
[docs]class SourceType:
    """Enum for originating source of a :py:class:`mlflow.entities.Run`."""

    NOTEBOOK, JOB, PROJECT, LOCAL, UNKNOWN = range(1, 6)

    _STRING_TO_SOURCETYPE = {
        "NOTEBOOK": NOTEBOOK,
        "JOB": JOB,
        "PROJECT": PROJECT,
        "LOCAL": LOCAL,
        "UNKNOWN": UNKNOWN,
    }
    SOURCETYPE_TO_STRING = {value: key for key, value in _STRING_TO_SOURCETYPE.items()}

[docs]    @staticmethod
    def from_string(status_str):
        if status_str not in SourceType._STRING_TO_SOURCETYPE:
            raise Exception(
                f"Could not get run status corresponding to string {status_str}. Valid run "
                f"status strings: {list(SourceType._STRING_TO_SOURCETYPE.keys())}"
            )
        return SourceType._STRING_TO_SOURCETYPE[status_str]

[docs]    @staticmethod
    def to_string(status):
        if status not in SourceType.SOURCETYPE_TO_STRING:
            raise Exception(
                f"Could not get string corresponding to run status {status}. Valid run "
                f"statuses: {list(SourceType.SOURCETYPE_TO_STRING.keys())}"
            )
        return SourceType.SOURCETYPE_TO_STRING[status]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4