get private protected name of an attribute

        :param str f: name of the private attribute to be accessed.
422735
def get_private_name(self, f):
        
        f = self.__swagger_rename__[f] if f in self.__swagger_rename__.keys() else f
        return '_' + self.__class__.__name__ + '__' + f
508688
private void checkNameVisibility(Scope scope, Node name) {
    if (!name.isName()) {
      return;
    }

    Var var = scope.getVar(name.getString());
    if (var == null) {
      return;
    }

    Visibility v = checkPrivateNameConvention(
        AccessControlUtils.getEffectiveNameVisibility(
            name, var, defaultVisibilityForFiles), name);

    switch (v) {
      case PACKAGE:
        if (!isPackageAccessAllowed(var, name)) {
          compiler.report(
              JSError.make(
                  name,
                  BAD_PACKAGE_PROPERTY_ACCESS,
                  name.getString(),
                  var.getSourceFile().getName()));
        }
        break;
      case PRIVATE:
        if (!isPrivateAccessAllowed(var, name)) {
          compiler.report(
              JSError.make(
                  name,
                  BAD_PRIVATE_GLOBAL_ACCESS,
                  name.getString(),
                  var.getSourceFile().getName()));
        }
        break;
      default:
        // Nothing to do for PUBLIC and PROTECTED
        // (which is irrelevant for names).
        break;
    }
  }
730707
def get_attr(self, name, default=None, fail_silently=True):
        
        try:
            return getattr(self, name)
        except KeyError:
            extra_context = getattr(self, "extra_context")

            if name in extra_context:
                value = extra_context[name]

                if callable(value):
                    return value(request=None)

            return default
157785
def has_access(f):
    
    if hasattr(f, '_permission_name'):
        permission_str = f._permission_name
    else:
        permission_str = f.__name__

    def wraps(self, *args, **kwargs):
        permission_str = PERMISSION_PREFIX + f._permission_name
        if self.appbuilder.sm.has_access(
                permission_str,
                self.__class__.__name__
        ):
            return f(self, *args, **kwargs)
        else:
            log.warning(
                LOGMSG_ERR_SEC_ACCESS_DENIED.format(
                    permission_str,
                    self.__class__.__name__
                )
            )
            flash(as_unicode(FLAMSG_ERR_SEC_ACCESS_DENIED), "danger")
        return redirect(
            url_for(
                self.appbuilder.sm.auth_view.__class__.__name__ + ".login",
                next=request.url
            )
        )
    f._permission_name = permission_str
    return functools.update_wrapper(wraps, f)
570517
def get_func_posargs_name(f):
    """"""
    sigparams = inspect.signature(f).parameters
    for p in sigparams:
        if sigparams[p].kind == inspect.Parameter.VAR_POSITIONAL:
            return sigparams[p].name
    return None
234423
def _get_ids_from_name_private(self, name):
        """"""
        results = self.list_private_images(name=name)
        return [result['id'] for result in results]
316196
def preserveName(f):
    
    def decorator(decorated):
        return copyfunction(decorated,
                            dict(name=f.__name__), dict(name=f.__name__))
    return decorator
272180
def remove_private_obfuscation(self):
    
    classname = self.__class__.__name__
    attrlist = [attr for attr in dir(self) if attr.startswith('_' + classname + '__')]
    for attr in attrlist:
        method = getattr(self, attr)
        truename = attr.replace('_' + classname + '__', '__')
        setattr(self, truename, method)
179336
def _get_attrs(self, names):
        
        assert isinstance(names, str)
        names = names.replace(",", " ").split(" ")
        res = []
        for n in names:
            if n == "":
                continue
            if n not in self.__dict__:
                raise KeyError("Unknown name for Container attribute: '{}'".format(n))
            res.append(getattr(self, n))
        return res
593231
def function_name(fn):
		
		fn_name = fn.__name__
		if hasattr(fn, '__qualname__'):
			return fn.__qualname__
		elif hasattr(fn, '__self__'):
			owner = fn.__self__
			if isclass(owner) is False:
				owner = owner.__class__
			return '%s.%s' % (owner.__name__, fn_name)
		return fn_name
215902
def _get_attribute(self, attribute, name):
        """"""
        try:
            if attribute is None:
                attribute = self._attribute_file_open( name )
            else:
                attribute.seek(0)
            return attribute, attribute.read().strip().decode()
        except Exception as ex:
            self._raise_friendly_access_error(ex, name)
1253474
def get_func_kwargs_name(f):
    """"""
    sigparams = inspect.signature(f).parameters
    for p in sigparams:
        if sigparams[p].kind == inspect.Parameter.VAR_KEYWORD:
            return sigparams[p].name
    return None
931409
private String getLabelNameForFunction(String fnName) {
    String name = (isNullOrEmpty(fnName)) ? "anon" : fnName;
    return "JSCompiler_inline_label_" + name + "_" + safeNameIdSupplier.get();
  }
751767
def _cached(f):
    

    attr_name = '_cached_' + f.__name__

    def wrapper(obj, *args, **kwargs):
        if not hasattr(obj, attr_name):
            setattr(obj, attr_name, f(obj, *args, **kwargs))
        return getattr(obj, attr_name)
    return wrapper
534228
@Override
	public String name() {

		if (file == null) {
			return null;
		}

		String name = null;

		try (Tx tx = StructrApp.getInstance(securityContext).tx()) {

			name = file.getName();
			tx.success();

		} catch (FrameworkException fex) {
			logger.error("", fex);
		}

		return name;
	}
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))
597092
def private_name_for(var_name, cls):
    """"""
    if not (isinstance(var_name, string_types) and var_name):
        raise TypeError('var_name must be non-empty string')
    if not (isinstance(cls, type) or isinstance(cls, string_types)):  # pylint: disable=consider-merging-isinstance
        raise TypeError('cls not a class or string')
    if __PRIVATE_NAME_PATTERN.match(var_name):
        class_name = cls.__name__ if isinstance(cls, type) else cls
        return '_%s%s' % (class_name.lstrip('_'), var_name)
    else:
        return var_name