def METHOD_NAME(
    input_type: Union[str, dict], skip_convert_error=False, as_str=False
):
    """Converting the TerminusDB datatypes into Python types, it will not detect self define types (i.e. object properties) so if converting object properties, skip_convert_error need to be True.
    Parameters
    ----------
    input_type : str or dict
        TerminusDB datatypes to be converted.
    skip_convert_error : bool
        Will an error be raised if the datatype given cannot be convert to Python types. If set to True (and as_type set to False) and type cannot be converted, the type will be returned back without convertion.
    as_str : bool
        Will convert the type and present it as string (e.g. used in constructing scripts). It will always skip convert error if set to True.
    """
    if as_str:
        skip_convert_error = True
    invert_type = {v: k for k, v in CONVERT_TYPE.items()}
    if isinstance(input_type, dict):
        if input_type["@type"] == "List":
            if as_str:
                return f'List[{METHOD_NAME(input_type["@class"], as_str=True)}]'
            else:
                return List[METHOD_NAME(input_type["@class"], as_str=True)]
        elif input_type["@type"] == "Set":
            if as_str:
                return f'Set[{METHOD_NAME(input_type["@class"], as_str=True)}]'
            else:
                return Set[METHOD_NAME(input_type["@class"], as_str=True)]
        elif input_type["@type"] == "Optional":
            if as_str:
                return f'Optional[{METHOD_NAME(input_type["@class"], as_str=True)}]'
            else:
                return Optional[METHOD_NAME(input_type["@class"], as_str=True)]
        else:
            raise TypeError(
                f"Input type {input_type} cannot be converted to Python type"
            )
    elif input_type in invert_type:
        if as_str:
            return invert_type[input_type].__name__
        return invert_type[input_type]
    elif skip_convert_error:
        if as_str:
            return f"'{input_type}'"
        return input_type
    else:
        raise TypeError(f"Input type {input_type} cannot be converted to Python type")