Determines the controller name for the object's type

        Args:
            objtype (str): The object type

        Returns:
            A string with the controller name
770906
def _controller_name(self, objtype):
        
        # would be better to use inflect.pluralize here, but would add a dependency
        if objtype.endswith('y'):
            return objtype[:-1] + 'ies'

        if objtype[-1] in 'sx' or objtype[-2:] in ['sh', 'ch']:
            return objtype + 'es'

        if objtype.endswith('an'):
            return objtype[:-2] + 'en'

        return objtype + 's'
253525
public static String getTypeName(Type type) {
		if(type instanceof Class) {
			Class<?> clazz = (Class<?>) type;
			return clazz.isArray() ? (getTypeName(clazz.getComponentType()) + "[]") : clazz.getName();
		} else {
			return type.toString();
		}
	}
569107
def get_module_name(module: types.ModuleType) -> str:
    
    try:
        return module.__spec__.name
    except AttributeError:
        return module.__name__
1200589
def get_ancestor_object_by_type(self, obj_type):
        

        if self.type.lower() == obj_type.lower():
            return self
        else:
            if not self.parent:
                return None
            return self.parent.get_ancestor_object_by_type(obj_type)
1200572
async def get_controller(self):
        
        from juju.controller import Controller
        controller = Controller(jujudata=self._connector.jujudata)
        kwargs = self.connection().connect_params()
        kwargs.pop('uuid')
        await controller._connect_direct(**kwargs)
        return controller
423186
def getname(obj):
    
    for name_attribute in ('__qualname__', '__name__'):
        try:
            # an object always has a class, as per Python data model
            return getattr(obj, name_attribute, getattr(obj.__class__, name_attribute))
        except AttributeError:
            pass
    raise TypeError('object of type %r does not define a canonical name' % type(obj))
1029825
def obj_name(self, obj: Union[str, Element]) -> str:
        
        if isinstance(obj, str):
            obj = self.obj_for(obj)
        if isinstance(obj, SlotDefinition):
            return underscore(self.aliased_slot_name(obj))
        else:
            return camelcase(obj if isinstance(obj, str) else obj.name)
536044
def type_named(obj, name):
    
    # if obj is a member of the named class, return True
    name = str(name)
    if obj.__class__.__name__ == name:
        return obj.__class__
    for base in type_bases(obj):
        if base.__name__ == name:
            return base
    raise ValueError('Unable to extract class of name ' + name)
1041457
public String getAxisName(int controller, int axis) {
		return ((Controller) controllers.get(controller)).getAxisName(axis);
	}
6607
def tdController(self):
        
        cid = c_int()
        ctype = c_int()
        name = create_string_buffer(255)
        available = c_int()

        self._lib.tdController(byref(cid), byref(ctype), name, sizeof(name),
                               byref(available))
        return {'id': cid.value, 'type': ctype.value,
                'name': self._to_str(name), 'available': available.value}
166979
def fmt_type_name(data_type, inside_namespace=None):
    
    if is_user_defined_type(data_type) or is_alias(data_type):
        if data_type.namespace == inside_namespace:
            return data_type.name
        else:
            return '%s.%s' % (data_type.namespace.name, data_type.name)
    else:
        fmted_type = _base_type_table.get(data_type.__class__, 'Object')
        if is_list_type(data_type):
            fmted_type += '<' + fmt_type(data_type.data_type, inside_namespace) + '>'
        return fmted_type
138916
def _get_fullname(obj):
        # type: (Any) -> str
        
        if not hasattr(obj, "__name__"):
            obj = obj.__class__
        if obj.__module__ in ("builtins", "__builtin__"):
            return obj.__name__
        return "{}.{}".format(obj.__module__, obj.__name__)
1288937
def full_name(self):
        
        if not self.view_func:
            return None

        prefix = self.view_func.__module__
        if self._controller_cls:
            prefix = f'{prefix}.{self._controller_cls.__name__}'
        return f'{prefix}.{self.method_name}'
684766
def object_name_for(object_type, action)
      object_name = @object_names.find do |object_name|
        object_name[:object_type] == object_type
        object_name[:action] == action
      end
      object_name = object_name ? object_name[:new_object_name] : nil
      unless object_name
        object_name = object_type.to_s.gsub('-', '_')
      end
      object_name
    end
984633
def get_typename(x):
    '''
    '''
    if isinstance(x, type):
        ret = x.__name__
    else:
        ret = x.__class__.__name__
    return ret
1115042
def typename(obj):
    """"""
    if hasattr(obj, '__class__'):
        return getattr(obj, '__class__').__name__
    else:
        return type(obj).__name__
1246470
def _get_getter_fun(object_type,           # type: Type
                    parameter,             # type: Parameter
                    private_property_name  # type: str
                    ):
    

    property_name = parameter.name

    # -- check overridden getter for this property name
    overridden_getters = getmembers(object_type, predicate=_has_annotation(__GETTER_OVERRIDE_ANNOTATION, property_name))

    if len(overridden_getters) > 0:
        if len(overridden_getters) > 1:
            raise DuplicateOverrideError('Getter is overridden more than once for attribute name : ' + property_name)

        # --use the overridden getter
        getter_fun = overridden_getters[0][1]

        # --check its signature
        s = signature(getter_fun)
        if not ('self' in s.parameters.keys() and len(s.parameters.keys()) == 1):
            raise IllegalGetterSignatureException('overridden getter must only have a self parameter, found ' +
                                                  str(len(s.parameters.items()) - 1) + ' for function ' + str(
                getter_fun.__qualname__))

        # --use the overridden getter ?
        property_obj = property(getter_fun)
    else:
        # -- generate the getter :
        def autoprops_generated_getter(self):
            return getattr(self, private_property_name)

        # -- use the generated getter
        getter_fun = autoprops_generated_getter

        try:
            annotations = getter_fun.__annotations__
        except AttributeError:
            # python 2
            pass
        else:
            annotations['return'] = parameter.annotation  # add type hint to output declaration

    return getter_fun