def METHOD_NAME(
    cls,
    obj: Optional[
        Union[Path, RunwayModuleDefinition, RunwayModuleDefinitionModel, str]
    ],
    *,
    cache_dir: Path,
    deploy_environment: Optional[DeployEnvironment] = None,
) -> ModulePath:
    """Parse object.
    Args:
        obj: Object to parse.
        cache_dir: Directory to use for caching if needed.
        deploy_environment: Current deploy environment object.
    Raises:
        TypeError: Unsupported type provided.
    """
    if isinstance(obj, (RunwayModuleDefinition, RunwayModuleDefinitionModel)):
        return cls(
            cache_dir=cache_dir,
            definition=obj.path,
            deploy_environment=deploy_environment,
        )
    if isinstance(obj, (type(None), Path, str)):
        return cls(
            cache_dir=cache_dir,
            definition=obj,
            deploy_environment=deploy_environment,
        )
    raise TypeError(
        f"object type {type(obj)}; expected pathlib.Path, "
        "RunwayModuleDefinition, RunwayModuleDefinitionModel, or str"
    )