avoid redudant and space consuming calls to 'self'
422211
def _passes_filter(self, proxy):


        '''  '''
        
        ''' validate proxy based on provided filters '''
        if self.allowed_countries is not None and proxy['country'] not in self.allowed_countries:
            return False
        if self.denied_countries is not None and  proxy['country'] in self.denied_countries:
            return False
        if self.https_only and proxy['https'] == False:
            return False

        if not self.all_ports and str(proxy.port) not in self.ports:
            return False

        return True
809484
def flush(self, meta=None):
        ''''''
        pattern = self.basekey(meta) if meta else self.namespace
        return self.client.delpattern('%s*' % pattern)
1241572
function beforeFirstCall(instance, method, callback) {
  instance[method] = function() {
    delete instance[method];
    callback.apply(this, arguments);
    return this[method].apply(this, arguments);
  };
}
584556
def leaveWhitespace( self ):
        """"""
        self.skipWhitespace = False
        self.exprs = [ e.copy() for e in self.exprs ]
        for e in self.exprs:
            e.leaveWhitespace()
        return self
1307451
def return_self_updater(func):
    '''
    
    '''
    @functools.wraps(func)
    def decorator(k,v):
        func(k,v)
        return v
    return decorator
603908
function resetCall (call) {
    // shallow clone call so that original can be reset
    var callClone = _.clone(call)
    // reset call state
    call.namespace = undefined
    call.module = undefined
    call.method = undefined
    // return cloned call
    return callClone
}
505741
function self_method(data, methods) {
            if (!data) {
                return data;
            }

            var i, ii, prop;

            if (data.constructor === ({}).constructor) {
                for (prop in data) {
                    if (_.isUndefined(data[prop])) {
                        delete data[prop];
                        continue;
                    }

                    data[prop] = self_method(data[prop], methods);
                }
            }
            else if (_.isArray(data)) {
                for (i = 0, ii = data.length; i < ii; ++i) {
                    if (_.isUndefined(data[i])) {
                        --i; --ii;
                        continue;
                    }

                    data[i] = self_method(data[i], methods);
                }
            }
            else {

                methods = _.extend({}, methods, { __getData: null });

                _.each(methods, function(params, method) {

                    if (!_.isFunction(data[method])) {
                        return;
                    }

                    if (_.isNull(params) || _.isUndefined(params)) {
                        params = [];
                    }
                    if (!_.isArray(params)) {
                        params = [params];
                    }

                    data = data[method].apply(data, params);
                });
            }

            return data;
        }
783171
public static void cleanup ()
  {
    if (MimeTypeInfoManager.isDefaultInstantiated ())
      MimeTypeInfoManager.getDefaultInstance ().reinitializeToDefault ();
    if (MicroTypeConverterRegistry.isInstantiated ())
      MicroTypeConverterRegistry.getInstance ().reinitialize ();
    if (XMLSchemaCache.isInstantiated ())
      XMLSchemaCache.getInstance ().clearCache ();
    XMLSchemaCache.clearPerClassLoaderCache ();
  }
873102
private void compact() {
        int from = 0;
        int to = 0;
        while (from < this.capacity) {
            Object key = this.list[from];
            long usage = age(this.ticks[from]);
            if (usage > 0) {
                this.ticks[to] = usage;
                this.list[to] = key;
                this.map.put(key, to);
                to += 1;
            } else {
                this.map.remove(key);
            }
            from += 1;
        }
        if (to < this.capacity) {
            this.length = to;
        } else {
            this.map.clear();
            this.length = 0;
        }
        this.power = 0;
    }
133101
def cancel(self):
        
        if self.cancelled:
            raise error.AlreadyCancelled
        elif self.called:
            raise error.AlreadyCalled
        else:
            self.canceller(self)
            self.cancelled = 1
            if self.debug:
                self._str = str(self)
            del self.func, self.args, self.kw
632266
function internalDestroy(cb, args) {
		var isError = Array.isArray(args) && args[0] instanceof Error
		if (self.writable) {
			self.writable = false
			if (isConnected) {
				isConnected = false
				process.disconnect()
				process.removeListener('disconnect', processDisconnectListener)
			}
			process.removeListener('error', processErrorListener)
			if (!isError) self.emit('close')
		}
		if (isError) self.emit.apply(self, ['error'].concat(args))
		if (cb) {
			var cbArgs = []
			if (isError) cbArgs.push(args[0])
			cb.apply(this, cbArgs)
		}
	}
1321315
def resolve_self_references(self, rules):
        """"""
        with suppress(KeyError):
            rule = rules.pop('$self')
            rules[self.app_name] = rule
        return rules
12061
private static void purgeQueue() {

        ChronoReference cref;

        while ((cref = (ChronoReference) QUEUE.poll()) != null) {
            for (ChronoReference test : CHRONOS) {
                if (test.name.equals(cref.name)) {
                    CHRONOS.remove(test);
                    break;
                }
            }
        }

    }
946103
def stop(self):
        

        self._clean_prior()

        if not self._loaded:
            raise errors.NoActiveTask

        self._clean()
611629
def only_self(self):
        """"""
        others, self.others = self.others, []
        try:
            yield
        finally:
            self.others = others + self.others
907008
private void prepareForReuse(boolean reuse)
    {
        if(reuse)
        {
            // using clone to avoid ConcurentModificationException
            Iterator iter = ((List) mvOrderOfIds.clone()).iterator();
            while(iter.hasNext())
            {
                ObjectEnvelope mod = (ObjectEnvelope) mhtObjectEnvelopes.get(iter.next());
                if(!needsCommit || (mod.getModificationState() == StateOldClean.getInstance()
                        || mod.getModificationState().isTransient()))
                {
                    // nothing to do
                }
                else
                {
                    mod.setModificationState(mod.getModificationState().markClean());
                }
            }
        }
    }
588404
function reduceFunctionCall(string, functionRE, callback) {
  var call = string
  return getFunctionCalls(string, functionRE).reduce(function(string, obj) {
    return string.replace(obj.functionIdentifier + "(" + obj.matches.body + ")", evalFunctionCall(obj.matches.body, obj.functionIdentifier, callback, call, functionRE))
  }, string)
}