<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _basicload(l: Loader, value: Any, type_: type) -> Any: """ This converts a value into a basic type. In theory it does nothing, but it performs type checking and raises if conditions fail. It also attempts casting, if enabled. """


    if type(value) != type_:
        if l.basiccast:
            try:
                return type_(value)
            except ValueError as e:
                raise TypedloadValueError(str(e), value=value, type_=type_)
            except TypeError as e:
                raise TypedloadTypeError(str(e), value=value, type_=type_)
            except Exception as e:
                raise TypedloadException(str(e), value=value, type_=type_)
        else:
            raise TypedloadValueError('Not of type %s' % type_, value=value, type_=type_)
    return value