:return: type suitable to handle the given object type name.
        Use the type to create new instances.

    :param object_type_name: Member of TYPES

    :raise ValueError: In case object_type_name is unknown
513432
def get_object_type_by_name(object_type_name):
    
    if object_type_name == b"commit":
        from . import commit
        return commit.Commit
    elif object_type_name == b"tag":
        from . import tag
        return tag.TagObject
    elif object_type_name == b"blob":
        from . import blob
        return blob.Blob
    elif object_type_name == b"tree":
        from . import tree
        return tree.Tree
    else:
        raise ValueError("Cannot handle unknown object type: %s" % object_type_name)
1305372
def get_type(type_name):
    
    parts = type_name.split('.')
    if len(parts) < 2:
        raise SphinxError(
            'Type must be fully-qualified, '
            'of the form ``module.MyClass``. Got: {}'.format(type_name)
        )
    module_name = ".".join(parts[0:-1])
    name = parts[-1]
    return getattr(import_module(module_name), name)
799405
def create(self, **kwargs):
        

        response = self.ghost.execute_post('%s/' % self._type_name, json={
            self._type_name: [
                kwargs
            ]
        })

        return self._model_type(response.get(self._type_name)[0])
107578
def create_for_object_attributes(item_type, faulty_attribute_name: str, hint):
        
        # this leads to infinite loops
        # try:
        #     prt_type = get_pretty_type_str(item_type)
        # except:
        #     prt_type = str(item_type)
        return TypeInformationRequiredError("Cannot create instances of type {t}: constructor attribute '{a}' has an"
                                            " invalid PEP484 type hint: {h}.".format(t=str(item_type),
                                                                                     a=faulty_attribute_name, h=hint))
473047
def python_object_name(item, module=True):
    
    if not isinstance(item, type):
        return python_object_name(type(item))

    return br'.'.join(filter(is_valid_python_name, (module and item.__module__, item.__name__)))
1324594
def converter(type_name):
    """"""
    converter = TYPES.get(type_name)
    if converter is None:
        raise ConverterError('Unknown converter: %r' % type_name)
    return converter()
1036154
def create(item_type: Type[Any], constructor_args: Dict[str, Any], cause: Exception):
        
        return ObjectInstantiationException('Error while building object of type <' + get_pretty_type_str(item_type)
                                            + '> using its constructor and parsed contents : ' + str(constructor_args)
                                            + ' : \n' + str(cause.__class__) + ' ' + str(cause)
                                            ).with_traceback(cause.__traceback__)
111031
def create_model(cls, name, field=None):
        
        if field:
            attrs = {'name': name, 'field': field}
        else:
            attrs = {'name': name, 'field': {'_id': ObjectId()}}

        return type(str(name), (cls, ), attrs)()
1336258
def object_type(self):
        

        from .statusobject import AbstractSensor, AbstractActuator
        from .program import Program
        if isinstance(self, AbstractSensor):
            return 'sensor'
        elif isinstance(self, AbstractActuator):
            return 'actuator'
        elif isinstance(self, Program):
            return 'program'
        else:
            return 'other'
976404
def create(cls, class_name, **attributes):
        
        object_class = cls.extend(class_name)
        return object_class(**attributes)
1077078
def is_object_type(type_):
    

    object_types = _get_types(Types.OBJECT)
    if is_typing_type(type_):
        return type_ in object_types or (
            hasattr(type_, "__origin__") and type_.__origin__ in object_types
        )
    return type_ in object_types
928521
def factory(cls, class_name):
        
        class_name = str(class_name.lstrip('_'))
        types = ParseResource.__subclasses__()
        while types:
            t = types.pop()
            if t.__name__ == class_name:
                return t
            types.extend(t.__subclasses__())
        else:
            return type(class_name, (Object,), {})
1173378
def _get_object(objname, objtype):
    '''
    
    '''
    ret = None
    if objname is None:
        return ret

    if isinstance(objname, string_types):
        if objname in __opts__:
            ret = __opts__[objname]
        master_opts = __pillar__.get('master', {})
        if objname in master_opts:
            ret = master_opts[objname]
        if objname in __pillar__:
            ret = __pillar__[objname]
    elif isinstance(objname, objtype):
        ret = objname

    if not isinstance(ret, objtype):
        ret = None

    return ret
682080
def typeOf(cls, expected_type): #pylint: disable=no-self-argument,invalid-name,no-self-use
        
        if isinstance(expected_type, type):
            options = {}
            options["target_type"] = expected_type
            return Matcher("__TYPE__", options)
        ErrorHandler.matcher_type_error(expected_type)
582729
def Create(self, name):
    
    precondition.AssertType(name, Text)

    try:
      constructor = self._constructors[name]
    except KeyError:
      message = "No constructor for name '%s' has been registered"
      message %= name
      raise ValueError(message)

    instance = constructor()
    if not isinstance(instance, self._cls):
      message = ("Constructor %r for name '%s' returned instance of type %r "
                 "(expected %r)")
      message %= (constructor, name, type(instance), self._cls)
      raise TypeError(message)

    return instance
229237
def open(cls, typename):
		
		return cls(opcode=OMAPI_OP_OPEN, message=[(b"type", typename)], tid=-1)
1090017
def object( object_name )
      object = objects.find do |obj|
        obj[ 'name' ] == object_name
      end

      if !object
        raise "Database #{name} does not have an object named '#{object_name}'."
      end

      klass = PSQL.const_get object[ 'type' ].capitalize
      klass.new object[ 'name' ], name
    end