Return instances names associated to a given object.

        Implements the WBEM operation AssociatorNames in terms
        of the references method.  A derived class will not normally
        override this method.
420581
def MI_associatorNames(self,
                           env,
                           objectName,
                           assocClassName,
                           resultClassName,
                           role,
                           resultRole):
        # pylint: disable=invalid-name
        

        logger = env.get_logger()
        logger.log_debug('CIMProvider2 MI_associatorNames called. ' \
                         'assocClass: %s' % (assocClassName))
        if not assocClassName:
            raise pywbem.CIMError(
                pywbem.CIM_ERR_FAILED,
                "Empty assocClassName passed to AssociatorNames")
        model = pywbem.CIMInstance(classname=assocClassName)
        model.path = pywbem.CIMInstanceName(classname=assocClassName,
                                            namespace=objectName.namespace)
        gen = self.references(env=env,
                              object_name=objectName,
                              model=model,
                              result_class_name=resultClassName,
                              role=role,
                              result_role=None,
                              keys_only=False)
        if gen is None:
            logger.log_debug('references() returned None instead of ' \
                             'generator object')
            return
        for inst in gen:
            for prop in inst.properties.values():
                lpname = prop.name.lower()
                if prop.type != 'reference':
                    continue
                if role and role.lower() == lpname:
                    continue
                if resultRole and resultRole.lower() != lpname:
                    continue
                if self.paths_equal(prop.value, objectName):
                    continue
                if resultClassName and  \
                        resultClassName.lower() != prop.value.classname.lower():
                    continue
                if prop.value.namespace is None:
                    prop.value.namespace = objectName.namespace
                yield prop.value
        logger.log_debug('CIMProvider2 MI_associatorNames returning')
816167
def _iparam_classname(classname, arg_name):
        

        if isinstance(classname, CIMClassName):
            classname = classname.copy()
            classname.host = None
            classname.namespace = None
        elif isinstance(classname, six.string_types):
            classname = CIMClassName(classname)
        elif classname is None:
            pass
        else:
            raise TypeError(
                _format("The {0!A} argument of the WBEMConnection operation "
                        "has invalid type {1} (must be None, a string, or a "
                        "CIMClassName)",
                        arg_name, type(classname)))
        return classname
138673
def const_name
      components = title.gsub(/\W/,' ').split.collect {|word| word.strip.upcase }
      if @derived_from
        components << HQMF::Counter.instance.next
      end
      components.join '_'
    end
1051333
private Name getNameObject(List<? extends Name> list, double probability) {
        int index = Collections.binarySearch(list, new Name(null, probability), locateNameByCumulativeProbability);
        if (index >= 0) {
            return list.get(index);
        } else if (-index > list.size()) {
            throw new RuntimeException("Invalid probability provided - (" + probability +
                    "). Max allowed for this list is " + getMax(list));
        } else {
            return list.get((-index) - 1);
        }
    }
304234
def _iparam_objectname(objectname, arg_name):
        

        if isinstance(objectname, (CIMClassName, CIMInstanceName)):
            objectname = objectname.copy()
            objectname.host = None
            objectname.namespace = None
        elif isinstance(objectname, six.string_types):
            objectname = CIMClassName(objectname)
        elif objectname is None:
            pass
        else:
            raise TypeError(
                _format("The {0!A} argument of the WBEMConnection operation "
                        "has invalid type {1} (must be None, a string, a "
                        "CIMClassName, or a CIMInstanceName)",
                        arg_name, type(objectname)))
        return objectname
58545
@Override
    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
        if (obj instanceof Reference) {
            try {
                String jndiName = nameCtx == null ? "" : nameCtx.getNameInNamespace();
                jndiName += name == null ? "" : name.toString();
                String urlValue = (String) ((Reference) obj).get(0).getContent();
                return createURL(jndiName, urlValue);
            } catch (Throwable t) {
                NamingException ne = new NamingException();
                ne.initCause(t);
                throw ne;
            }
        }

        return null;
    }
1008893
def name_for_scalar_relationship(base, local_cls, referred_cls, constraint):
    
    name = referred_cls.__name__.lower() + "_ref"
    return name
603813
def get_name(self,item):
        
        if not isinstance(item,ford.sourceform.FortranBase):
            raise Exception('{} is not of a type derived from FortranBase'.format(str(item)))

        if item in self._items:
            return self._items[item]
        else:
            if item.get_dir() not in self._counts:
                self._counts[item.get_dir()] = {}
            if item.name in self._counts[item.get_dir()]:
                num = self._counts[item.get_dir()][item.name] + 1
            else:
                num = 1
            self._counts[item.get_dir()][item.name] = num
            name = item.name.lower().replace('<','lt')
            # name is already lower
            name = name.replace('>','gt')
            name = name.replace('/','SLASH')
            if name == '': name = '__unnamed__'
            if num > 1:
                name = name + '~' + str(num)
            self._items[item] = name
            return name
925066
def get_object_name(object):
    

    if type(object) is property:
        return object.fget.__name__
    elif hasattr(object, "__name__"):
        return object.__name__
    elif hasattr(object, "__class__"):
        return object.__class__.__name__
    else:
        return NULL_OBJECT_NAME
720314
def object_model_name
        item = object

        is_collection = item.is_a?(Array)
        item = item.first if is_collection

        name = item.class.name.underscore

        name = name.pluralize if is_collection

        name.split("/").last
      end
208646
Set<String> findReferencedClassNames() {
        final Set<String> allReferencedClassNames = new LinkedHashSet<>();
        findReferencedClassNames(allReferencedClassNames);
        // Remove references to java.lang.Object
        allReferencedClassNames.remove("java.lang.Object");
        return allReferencedClassNames;
    }
880491
def callable_name(callable_obj):
    
    try:
        if (isinstance(callable_obj, type)
            and issubclass(callable_obj, param.ParameterizedFunction)):
            return callable_obj.__name__
        elif (isinstance(callable_obj, param.Parameterized)
              and 'operation' in callable_obj.params()):
            return callable_obj.operation.__name__
        elif isinstance(callable_obj, partial):
            return str(callable_obj)
        elif inspect.isfunction(callable_obj):  # functions and staticmethods
            return callable_obj.__name__
        elif inspect.ismethod(callable_obj):    # instance and class methods
            meth = callable_obj
            if sys.version_info < (3,0):
                owner =  meth.im_class if meth.im_self is None else meth.im_self
            else:
                owner =  meth.__self__
            if meth.__name__ == '__call__':
                return type(owner).__name__
            return '.'.join([owner.__name__, meth.__name__])
        elif isinstance(callable_obj, types.GeneratorType):
            return callable_obj.__name__
        else:
            return type(callable_obj).__name__
    except:
        return str(callable_obj)
454703
@Override
    protected void findReferencedClassNames(final Set<String> referencedClassNames) {
        if (this.referencedClassNames != null) {
            referencedClassNames.addAll(this.referencedClassNames);
        }
        getMethodInfo().findReferencedClassNames(referencedClassNames);
        getFieldInfo().findReferencedClassNames(referencedClassNames);
        getAnnotationInfo().findReferencedClassNames(referencedClassNames);
        if (annotationDefaultParamValues != null) {
            annotationDefaultParamValues.findReferencedClassNames(referencedClassNames);
        }
        final ClassTypeSignature classSig = getTypeSignature();
        if (classSig != null) {
            classSig.findReferencedClassNames(referencedClassNames);
        }
        // Remove any self-references
        referencedClassNames.remove(name);
    }
137076
def _refs(obj, named, *ats, **kwds):
    '''
    '''
    if named:
        for a in ats:  # cf. inspect.getmembers()
            if hasattr(obj, a):
                yield _NamedRef(a, getattr(obj, a))
        if kwds:  # kwds are _dir2() args
            for a, o in _dir2(obj, **kwds):
                yield _NamedRef(a, o)
    else:
        for a in ats:  # cf. inspect.getmembers()
            if hasattr(obj, a):
                yield getattr(obj, a)
        if kwds:  # kwds are _dir2() args
            for _, o in _dir2(obj, **kwds):
                yield o
398953
def get_object_name(obj):
    
    name_dispatch = {
        ast.Name: "id",
        ast.Attribute: "attr",
        ast.Call: "func",
        ast.FunctionDef: "name",
        ast.ClassDef: "name",
        ast.Subscript: "value",
    }

    # This is a new ast type in Python 3
    if hasattr(ast, "arg"):
        name_dispatch[ast.arg] = "arg"

    while not isinstance(obj, str):
        assert type(obj) in name_dispatch
        obj = getattr(obj, name_dispatch[type(obj)])

    return obj
1026727
def p_dynamic_class_name_reference(p):
    ''''''
    if len(p) == 5:
        name, dims = p[3]
        p[0] = ast.ObjectProperty(p[1], name, lineno=p.lineno(2))
        for class_, dim, lineno in dims:
            p[0] = class_(p[0], dim, lineno=lineno)
        for name, dims in p[4]:
            p[0] = ast.ObjectProperty(p[0], name, lineno=p.lineno(2))
            for class_, dim, lineno in dims:
                p[0] = class_(p[0], dim, lineno=lineno)
    else:
        p[0] = p[1]
264816
def _fake_enumerateinstancenames(self, namespace, **params):
        
        cname = params['ClassName']
        assert isinstance(cname, CIMClassName)
        cname = cname.classname

        # Validate namespace
        instance_repo = self._get_instance_repo(namespace)

        clns = self._get_subclass_list_for_enums(cname, namespace)

        inst_paths = [inst.path for inst in instance_repo
                      if inst.path.classname in clns]

        rtn_paths = [deepcopy(path) for path in inst_paths]

        return self._make_tuple(rtn_paths)