Returns a dictionary mapping a public identifier name to a
        Python object. This counts the `__init__` method as being
        public.
2036
def __public_objs(self):
        
        _budoc = getattr(self.module.module, '__budoc__', {})

        def forced_out(name):
            return _budoc.get('%s.%s' % (self.name, name), False) is None

        def exported(name):
            exported = name == '__init__' or _is_exported(name)
            return not forced_out(name) and exported

        idents = dict(inspect.getmembers(self.cls))
        return dict([(n, o) for n, o in idents.items() if exported(n)])
150204
def add_identifier(self, name, obj):
        

        name = str(name)
        self._known_identifiers[name] = obj
15855
def repr_dict(_dict, indent):
    """"""
    # pprint represents OrderedDict objects using the tuple init syntax,
    # which is not very readable. Therefore, dictionaries are iterated over.
    if _dict is None:
        return 'None'
    if not isinstance(_dict, Mapping):
        raise TypeError("Object must be a mapping, but is a %s" %
                        type(_dict))
    if isinstance(_dict, OrderedDict):
        kind = 'ordered'
        ret = '%s {\n' % kind  # non standard syntax for the kind indicator
        for key in six.iterkeys(_dict):
            value = _dict[key]
            ret += _indent('%r: %r,\n' % (key, value), 2)
    else:  # dict
        kind = 'sorted'
        ret = '%s {\n' % kind  # non standard syntax for the kind indicator
        for key in sorted(six.iterkeys(_dict)):
            value = _dict[key]
            ret += _indent('%r: %r,\n' % (key, value), 2)
    ret += '}'
    ret = repr_text(ret, indent=indent)
    return ret.lstrip(' ')
1322695
def _fullqualname_method_py2(obj):
    

    if obj.__self__ is None:
        # unbound methods
        module = obj.im_class.__module__
        cls = obj.im_class.__name__
    else:
        # bound methods
        if inspect.isclass(obj.__self__):
            # methods decorated with @classmethod
            module = obj.__self__.__module__
            cls = obj.__self__.__name__
        else:
            module = obj.__self__.__class__.__module__
            cls = obj.__self__.__class__.__name__

    return module + '.' + cls + '.' + obj.__func__.__name__
505910
def _idForObject(self, defaultObject):
        
        identifier = self._allocateID()
        self._idsToObjects[identifier] = defaultObject
        return identifier
812867
def copy_public_vars(self):
        
        vars = self.get_vars()
        vars = dict([k for k in list(vars.items()) if not k[0].startswith('_')])
        return deepcopy(vars)
1194839
def SessionAuthSourceInitializer(
    value_key='sanity.'
):
    

    value_key = value_key + 'value'

    @implementer(IAuthSourceService)
    class SessionAuthSource(object):
        vary = []

        def __init__(self, context, request):
            self.request = request
            self.session = request.session
            self.cur_val = None

        def get_value(self):
            if self.cur_val is None:
                self.cur_val = self.session.get(value_key, [None, None])

            return self.cur_val

        def headers_remember(self, value):
            if self.cur_val is None:
                self.cur_val = self.session.get(value_key, [None, None])

            self.session[value_key] = value
            return []

        def headers_forget(self):
            if self.cur_val is None:
                self.cur_val = self.session.get(value_key, [None, None])

            if value_key in self.session:
                del self.session[value_key]
            return []

    return SessionAuthSource
619517
def ident_dict(self):
        """"""

        SKIP_KEYS = ['name','vname','fqname','vid','cache_key']
        return {k: v for k, v in iteritems(self.dict) if k not in SKIP_KEYS}
537762
def _initialize_tensor_name_to_ids(self):
    
    tensor_name_to_ids = {}
    for i, operation in enumerate(self._operations):
      for j, tensor in enumerate(operation.outputs):
        tensor_name_to_ids[tensor.name] = (i, j)
    return tensor_name_to_ids
928497
def build_instance_name(inst, obj=None):
    
    if obj is None:
        for _ in inst.properties.values():
            inst.path.keybindings.__setitem__(_.name, _.value)
        return inst.path
    if not isinstance(obj, list):
        return build_instance_name(inst, get_keys_from_class(obj))
    keys = {}
    for _ in obj:
        if _ not in inst.properties:
            raise pywbem.CIMError(pywbem.CIM_ERR_FAILED,
                                  "Instance of %s is missing key property %s" \
                                  %(inst.classname, _))
        keys[_] = inst[_]
    inst.path = pywbem.CIMInstanceName(classname=inst.classname,
                                       keybindings=keys,
                                       namespace=inst.path.namespace,
                                       host=inst.path.host)
    return inst.path
873353
def extract_init_args(instance):
    
    cls = instance.__class__
    args = [x for x in inspect.getargspec(cls.__init__).args if x != 'self']
    return [instance.__dict__[key] for key in args]
164915
def get_init_kwargs(self):
        
        init_kwargs = {}
        for k in self.init_kwargs:
            if k in self.core_property_set:
                init_kwargs[k] = getattr(self, k)
            elif k in self:
                init_kwargs[k] = self[k]
        return init_kwargs
1030551
def get_public_key(self):
        
        res = self.get_public_key_info()
        if 'error' in res:
            raise ValueError(res['error'])

        if res['type'] != 'singlesig':
            raise ValueError(res['error'])

        return res['public_keys'][0]
45415
def get_by_identifier(self, identifier):
        

        params = {'identifier': identifier}

        return self.client.get(self._url(), params=params)
1274622
def key_dict( from_dict ):
	
	new_dict = {}
	old2new = {}
	new2old = {}
	for key in from_dict:
		k = normalizeUnicode(key,'identifier')
		if k != key:
			i = ''
			while new_dict.has_key("%s%s" % (k,i) ):
				if not i:
					i = 1
				else:
					i += 1
			k = "%s%s" % (k,i)
			old2new[key] = k
			new2old[k] = key
		new_dict[k] = from_dict[key]
	return (new_dict.keys(), new_dict, old2new, new2old)
401785
def __public_objs(self):
        
        members = dict(inspect.getmembers(self.module))
        return dict([(name, obj)
                     for name, obj in members.items()
                     if self.__is_exported(name, inspect.getmodule(obj))])
227043
def getRegistered(self, context = ""):
		
		myobjs = {}
		try:
			# Python 2.x
			objs_iterator = self._objs[context].iteritems()
		except AttributeError:
			# Python 3.x
			objs_iterator = self._objs[context].items()
		for oidstr, snmpobj in objs_iterator:
			myobjs[oidstr] = {
				"type": type(snmpobj).__name__,
				"value": snmpobj.value()
			}
		return dict(myobjs)