<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def datatype2schemacls( _datatype, _registry=None, _factory=None, _force=True, _besteffort=True, **kwargs ):
 """Get a schema class which has been associated to input data type by the registry or the factory in this order. :param type datatype: data type from where get associated schema. :param SchemaRegisgry _registry: registry from where call the getbydatatype . Default is the global registry. :param SchemaFactory _factory: factory from where call the getschemacls if getbydatatype returns None. Default is the global factory. :param bool _force: if true (default), force the building of schema class if no schema is associated to input data type. :param bool _besteffort: if True (default), try to resolve schema by inheritance. :param dict kwargs: factory builder kwargs. :rtype: type :return: Schema associated to input registry or factory. None if no association found. """

    result = None

    gdbt = getbydatatype if _registry is None else _registry.getbydatatype

    result = gdbt(_datatype, besteffort=_besteffort)

    if result is None:
        gscls = getschemacls if _factory is None else _factory.getschemacls
        result = gscls(_datatype, besteffort=_besteffort)

    if result is None and _force:
        _build = build if _factory is None else _factory.build

        result = _build(_resource=_datatype, **kwargs)

    return result