TODO: Drasko: Extract this to new class!
426799
private function execute($type)
    {
        $uniqueId = $this->profiler->start();
        switch ($type) {
            case self::TYPE_GET:
                $response = $this->transformValue($this->driver->get($this->getKey()));
                break;
            case self::TYPE_DELETE:
                $response = $this->driver->delete($this->getKey());
                break;
            case self::TYPE_REPLACE:
                $response = $this->driver->replace($this->getKey(), $this->getValue(), $this->expiration);
                break;
            case self::TYPE_SET:
                $response = $this->driver->set($this->getKey(), $this->getValue(), $this->expiration);
                break;
        }
        $this->profiler
            ->setKey($uniqueId, $this->concatKeyParts())
            ->setType($uniqueId, $type)
            ->setHit($uniqueId, $response !== false)
            ->end($uniqueId);
        return $response;
    }
1031342
def create(cls, expr, binds):
        
        return cls(expr=expr, binds=binds, dtype=bool_dtype)
1118147
def new_scope(names)
      values = names.map { |n| self[n] }
      self.class.new(names, values + extras, self)
    end
752969
def instantiate(self, cls=None):
        
        if cls is None:
            cls = self.cls
        if cls is None:
            raise TypeError("cls must a class")
        return cls.create(*self.args, **self.kwargs)
1254218
function( options ) {
			var out = {},
				items,
				classItems,
				x,
				i;

			this.init();
			options = (options)? options : {};
			this.getDOMContext( options );

			// if we do not have any context create error
			if(!this.rootNode || !this.document){
				return {'errors': [this.noContentErr]};
			}else{

				items = this.findRootNodes( this.rootNode, true );
				i = items.length;
				while(i--) {
					classItems = modules.domUtils.getAttributeList(items[i], 'class');
					x = classItems.length;
					while(x--) {
						// find v2 names
						if(modules.utils.startWith( classItems[x], 'h-' )){
							this.appendCount(classItems[x], 1, out);
						}
						// find v1 names
						for(var key in modules.maps) {
							// dont double count if v1 and v2 roots are present
							if(modules.maps[key].root === classItems[x] && classItems.indexOf(key) === -1) {
								this.appendCount(key, 1, out);
							}
						}
					}
				}
				var relCount = this.countRels( this.rootNode );
				if(relCount > 0){
					out.rels = relCount;
				}

				return out;
			}
		}
700577
def method_missing(id_or_class, *args, &block)
      if id_or_class.to_s =~ /(.*)!$/
        @attrs[:id] = $1
      else
        id = id_or_class
        @attrs[:class] = @attrs[:class] ? "#{@attrs[:class]} #{id}".strip : id
      end

      unless args.empty?
        if args.last.respond_to? :to_hash
          @attrs.merge! args.pop.to_hash
        end
      end

      args.push(@attrs)

      while @stream.length > @original_stream_length
        @stream.pop
      end

      if block
        @builder.tag! @sym, *args, &block
      else
        @builder.tag! @sym, *args
      end

      self
    end
267165
def append_class (cls)
      return unless cls

      if c = html_options["class"]
        html_options["class"] << " " + cls.to_s
      else
        if c = has_option?("class")
          c << " " + cls.to_s
          cls = c
        end

        html_options["class"] = cls.to_s
      end
    end
16273
def class_from_string(name):
    '''
    
    '''
    module_name, class_name = name.rsplit('.', 1)
    __import__(module_name)
    module = sys.modules[module_name]
    return getattr(module, class_name)
169336
def from_pure(cls, z):
        
        return cls(cls._key, {z: 1.0}, {z: 1.0}, pyxray.element_symbol(z))
21388
def from_context(cls):
        
        try:
            ctx = click.get_current_context()
        except RuntimeError:
            return cls()
        return ctx.find_object(cls)
709221
function Class() {
			if (this.constructor !== root.Class) {
				throw new Error("You can only instanciate objects with the 'new' operator");
				return null;
			};
			// All construction is actually done in the init method
			if (!initializing && this.init) {
				var ret = this.init.apply(this, arguments);
				if (ret) {
					return ret;
				};
			};
			// add self object to each function, ekitjs
			_.each(this.__keys, function(value, key) {
				if (_.isFunction(this[key])) {
					this[key].self = this;
				};
			}, undefined, this);
			// add Class
			this.__Class = Class;
			// 
			return this;
		}
339852
function createAbstractClass(params, constructor) {
        var def,
            savedMembers,
            key,
            value;

        // Handle abstract methods
        if (hasOwn(params, '$abstracts')) {
            savedMembers = params.$abstracts;
            delete params.$abstracts;
        }

        // Create the class definition
        def = Class.$create(params, constructor);
        def[$abstract] = true;

        // Grab binds
        if (savedMembers) {
            for (key in savedMembers) {
                value = savedMembers[key];

                if (value[$bound]) {
                    insert(def[$class].binds, key);
                }
            }
        }

        return def;
    }
1354442
function() {
        var str = this[UID] + ': not bound to a node',
            node = this._node,
            attrs, id, className;

        if (node) {
            attrs = node.attributes;
            id = (attrs && attrs.id) ? node.getAttribute('id') : null;
            className = (attrs && attrs.className) ? node.getAttribute('className') : null;
            str = node[NODE_NAME];

            if (id) {
                str += '#' + id; 
            }

            if (className) {
                str += '.' + className.replace(' ', '.'); 
            }

            // TODO: add yuid?
            str += ' ' + this[UID];
        }
        return str;
    }
448895
function() {
    var e = this._element.classList;
    var i, arg;
    for (i = 0 ; i < arguments.length ; i++) {
      arg = arguments[i];
      if (typeof arg === 'string') {
        arg = arg.trim();
        if (arg.length > 0) e.add(arg);
      } else {
        console.error("[wdg.addClass] Arguments with bad type!", arguments);
      }
    }
    return this;
  }
888457
def extract(cls, obj):
        
        span = cls.extract_span(obj)
        if span:
            return span.context
1134263
def create_class(self, data, options=None, **kwargs):
        
        obj_map = dict(
            (cls.type, cls)
            for cls in [
                PythonClass,
                PythonFunction,
                PythonModule,
                PythonMethod,
                PythonPackage,
                PythonAttribute,
                PythonData,
                PythonException,
            ]
        )
        try:
            cls = obj_map[data["type"]]
        except KeyError:
            LOGGER.warning("Unknown type: %s" % data["type"])
        else:
            obj = cls(
                data,
                class_content=self.app.config.autoapi_python_class_content,
                options=self.app.config.autoapi_options,
                jinja_env=self.jinja_env,
                url_root=self.url_root,
                **kwargs
            )

            lines = sphinx.util.docstrings.prepare_docstring(obj.docstring)
            if lines and "autodoc-process-docstring" in self.app.events.events:
                self.app.emit(
                    "autodoc-process-docstring",
                    cls.type,
                    obj.name,
                    None,  # object
                    None,  # options
                    lines,
                )
            obj.docstring = "\n".join(lines)

            for child_data in data.get("children", []):
                for child_obj in self.create_class(
                    child_data, options=options, **kwargs
                ):
                    obj.children.append(child_obj)
            yield obj
80454
def copy(self):
        
        new = self.__class__()
        new.__dict__ = dict(self.__dict__)
        return new