Format the "klass" variable and value on class methods.
975336
def _formatter_class(name, value):
    
    __mname = value.__module__
    if __mname != '__main__':
        return "%s = <type '%s.%s'>" % (name, __mname, value.__name__)
    else:
        return "%s = <type '%s'>" % (name, value.__name__)
536774
def do_class(self, element, decl, pseudo):
        """"""
        step = self.state[self.state['current_step']]
        actions = step['actions']
        strval = self.eval_string_value(element, decl.value)
        actions.append(('attrib', ('class', strval)))
708863
function (classPrefix) {
            var text = this._getOutput();

            // Format the prefix for the CSS text
            var prefix = "." + classPrefix + " ";

            var prefixed = this.__prefixingAlgorithm(text, prefix);
            this.__prefixedText = prefixed.text;
            this.__numSelectors = prefixed.selectors;
        }
980822
def _make_class(cls, **kwargs):
    """"""
    kwargs = {k: (v if v is not None else getattr(cls, k, None))
              for k, v in kwargs.items()}
    # The class name contains a hash of the custom parameters.
    name = cls.__name__ + '_' + _hash(kwargs)
    if name not in _CLASSES:
        logger.log(5, "Create class %s %s.", name, kwargs)
        cls = type(name, (cls,), kwargs)
        _CLASSES[name] = cls
    return _CLASSES[name]
171732
def value(self):
        """"""
        f = types.FunctionType(
            self.code.value, self.globals, self.name, self.defaults, self.closure
        )
        d = self.dict.copy()
        for attr in PY3_ATTRS:
            try:
                setattr(f, attr, d.pop(attr, None))
            except TypeError:
                pass
        for attr in OPT_ATTRS:
            val = d.pop(attr, _missing)
            if val is not _missing:
                setattr(f, attr, val)
        __self__ = d.pop('__self__', _missing)
        __class__ = d.pop('im_class', _missing)
        getattr(f, DICT_ATTR).update(d)
        if __self__ is not _missing:
            if METHOD_HAS_CLASS:
                if __class__ is _missing:
                    __class__ = __self__.__class__
                f = types.MethodType(f, __self__, __class__)
            else:
                f = types.MethodType(f, __self__)
                if __class__ is not _missing:
                    f.im_class = __class__
        return f
409816
def _extend_str(class_node, rvalue):
    """"""
    code = dedent(
        """
    class whatever(object):
        def join(self, iterable):
            return {rvalue}
        def replace(self, old, new, count=None):
            return {rvalue}
        def format(self, *args, **kwargs):
            return {rvalue}
        def encode(self, encoding='ascii', errors=None):
            return ''
        def decode(self, encoding='ascii', errors=None):
            return u''
        def capitalize(self):
            return {rvalue}
        def title(self):
            return {rvalue}
        def lower(self):
            return {rvalue}
        def upper(self):
            return {rvalue}
        def swapcase(self):
            return {rvalue}
        def index(self, sub, start=None, end=None):
            return 0
        def find(self, sub, start=None, end=None):
            return 0
        def count(self, sub, start=None, end=None):
            return 0
        def strip(self, chars=None):
            return {rvalue}
        def lstrip(self, chars=None):
            return {rvalue}
        def rstrip(self, chars=None):
            return {rvalue}
        def rjust(self, width, fillchar=None):
            return {rvalue}
        def center(self, width, fillchar=None):
            return {rvalue}
        def ljust(self, width, fillchar=None):
            return {rvalue}
    """
    )
    code = code.format(rvalue=rvalue)
    fake = AstroidBuilder(MANAGER).string_build(code)["whatever"]
    for method in fake.mymethods():
        method.parent = class_node
        method.lineno = None
        method.col_offset = None
        if "__class__" in method.locals:
            method.locals["__class__"] = [class_node]
        class_node.locals[method.name] = [method]
        method.parent = class_node
277105
def class_string(self, klass):
        ''''''
        if isinstance(klass, string_types):
            return klass
        return klass.__module__ + '.' + klass.__name__
230814
public function format()
	{
		foreach($this->matches as $key => $match)
		{
			$potential = str_replace(['[', ']'], '', $match);

			// Seperate by comma
			$potential = explode(',', $potential);

			// Classes can have a dot seperator Class.method
			$mask = $potential[0];
			if(strpos($potential[0], '.') !== false) {
				$parts = explode('.', $potential[0]);
				$mask = $parts[0];
			}

			// The first value will be the mask name
			if($this->collection->getMethod()->has($mask))
			{
				$this->formatted[$mask] = Array();

				// Add the raw match so we can replace this
				$this->formatted[$mask]['raw'] = $match;
				$this->formatted[$mask]['params'] = Array();
				
				// Remove the name from the array
				unset($potential[0]);

				$this->processValues($mask, $potential);
			
			} else {
				
				// This isnt a mask
				unset($this->matches[$key]);
			}
		}	
	}
80792
function(value) {
			var attr = this.get('class');
			value = utils.trim(value);
			if (!attr) {
				return;
			}

			var reClass = new RegExp('(^|\\s+)' + utils.escapeForRegexp(value));
			var classVal = attr.value().replace(reClass, '');
			if (!utils.trim(classVal)) {
				this.remove('class');
			} else {
				attr.value(classVal);
			}
		}
3684
def attr(self, *args, **kwargs):
        """"""
        kwargs.update({k: bool for k in args})
        for key, value in kwargs.items():
            if key == "klass":
                self.attrs["klass"].update(value.split())
            elif key == "style":
                if isinstance(value, str):
                    splitted = iter(re.split(";|:", value))
                    value = dict(zip(splitted, splitted))
                self.attrs["style"].update(value)
            else:
                self.attrs[key] = value
        self._stable = False
        return self
1039956
function finalizeMixinMerge(classDef) {
  const propNames = Object.keys(classDef.properties || {});
  propNames.forEach((name) => {
    if (classDef['__' + name]) {

      // NOTE: Modes are currently applied to properties, but we do not yet support OVERWRITE mode.
      const setters = Util.sortBy(classDef['__' + name].filter(def => def.set), (setter) => {
        switch (setter.mode) {
          case registerComponent.MODES.BEFORE:
            return 1;
          case registerComponent.MODES.AFTER:
            return 3;
          default:
            return 2;
        }
      });
      classDef['__set_' + name] = setters.map(setter => setter.set);
    }
  });

  const methodNames = Object.keys(classDef.methods || {});

  methodNames.forEach((methodName) => {
    const methodDef = classDef.methods[methodName];
    let methodList = [
      ...methodDef.methodsBefore,
      ...methodDef.methodsMiddle,
      ...methodDef.methodsAfter,
      ...methodDef.methodLast,
    ];
    if (methodDef.lock) methodList = [methodDef.lock, ...methodDef.methodLast];

    // For each method, either set the method to be the function, or set it to be the
    // getTheMethod function which assembles all of the conditionals and mixins into a single function.
    if (methodList.length === 1 && !methodDef.conditional.length) {
      classDef.methods[methodName] = methodList[0];
    } else {
      classDef['__method_' + methodName] = methodList;
      classDef.methods[methodName] = getTheMethod(classDef, methodDef.conditional, classDef['__method_' + methodName]);
    }
  });
}
18133
def to_markdown(self, format='{id} {classes} {kvs}', surround=True):
        
        id = '#' + self.id if self.id else ''
        classes = ' '.join('.' + cls for cls in self.classes)
        kvs = ' '.join('{}={}'.format(k, v) for k, v in self.kvs.items())

        attrs = format.format(id=id, classes=classes, kvs=kvs).strip()

        if surround:
            return '{' + attrs + '}'
        elif not surround:
            return attrs
918761
private Object formatObject( final String    key,
                                 final String    className )
        throws
            UtilException
    {
        try
        {
            return Class.forName( className ).newInstance();
        }
        catch ( Throwable    ex )
        {
            throw new ResourceException().cantGetObject( key, className, ex );
        }
    }
200526
def niceStringify(self, level):
        """"""
        out = level * "    " + \
            "Function[" + str(self.keywordLine) + \
            ":" + str(self.keywordPos) + \
            ":" + self._getLPA() + \
            ":" + str(self.colonLine) + \
            ":" + str(self.colonPos) + \
            "]: '" + self.name + "'"
        if self.isAsync:
            out += " (async)"
        if self.returnAnnotation is not None:
            out += " -> '" + self.returnAnnotation + "'"
        for item in self.arguments:
            out += '\n' + level * "    " + "Argument: '" + str(item) + "'"
        for item in self.decorators:
            out += '\n' + level * "    " + str(item)
        if self.docstring is not None:
            out += '\n' + level * "    " + str(self.docstring)
        for item in self.functions:
            out += '\n' + item.niceStringify(level + 1)
        for item in self.classes:
            out += '\n' + item.niceStringify(level + 1)
        return out
235485
private static MethodSpec indexFormatters(
      String methodName, String registerMethodName, Map<LocaleID, ClassName> dateClasses) {
    
    MethodSpec.Builder method = MethodSpec.methodBuilder(methodName)
        .addModifiers(PRIVATE, STATIC);
    
    for (Map.Entry<LocaleID, ClassName> entry : dateClasses.entrySet()) {
      LocaleID localeId = entry.getKey();
      ClassName className = entry.getValue();
      method.addStatement("$T.$L(Locale.$L, $L.class)", CLDR_BASE, 
          registerMethodName, localeId.safe, className);
    }
    return method.build();
  }
1091579
def class_variables(self):
        
        p = lambda o: isinstance(o, Variable) and self.module._docfilter(o)
        return filter(p, self.doc.values())
1305827
protected function formatClass($class_name, $ctor_args)
    {
        $r = new ReflectionClass($class_name);
        $data = $r->newInstanceArgs((array) $ctor_args);

        foreach ($this->getData() as $key => $value) {
            $data->$key = $value;
        }

        return $data;
    }