def METHOD_NAME(instance: Any, sample_value: Optional[Any]) -> Type[Any]:
    """Infers type argument of a Generic class from an `instance` of that class using optional `sample_value` of the argument type
    Inference depends on the presence of __orig_class__ attribute in instance, if not present - sample_Value will be used
    Args:
        instance (Any): instance of Generic class
        sample_value (Optional[Any]): instance of type of generic class, optional
    Returns:
        Type[Any]: type argument or Any if not known
    """
    orig_param_type = Any
    if hasattr(instance, "__orig_class__"):
        orig_param_type = get_args(instance.__orig_class__)[0]
    if orig_param_type is Any and sample_value is not None:
        orig_param_type = type(sample_value)
    return orig_param_type  # type: ignor