dummy helper that injects extension
357452
function rewrite_extension(source, ext) {
  var source_ext = path.extname(source);
  return (source_ext === ext) ? source : (source + ext);
}
299013
def bind(self, extension: Extension) -> 'DictMentor':
        
        if not Extension.is_valid_extension(extension):
            raise ValueError("Cannot bind extension due to missing interface requirements")
        self._extensions.append(extension)

        return self
215474
private ExtensionHandler getExtensionHandler(LocalExtension localExtension) throws ComponentLookupException
    {
        return this.componentManager.getInstance(ExtensionHandler.class, localExtension.getType().toLowerCase());
    }
66188
def injectClassCallback(annotationName, depth, methodName, *args, **kwargs):
    
    locals = reflect.class_locals(depth, annotationName)
    annotations = locals.get(_CLASS_ANNOTATIONS_ATTR, None)
    if annotations is None:
        annotations = list()
        locals[_CLASS_ANNOTATIONS_ATTR] = annotations
    annotation = (annotationName, methodName, args, kwargs)
    annotations.append(annotation)
1075531
function addInject(obj, inject) {
    if(!exists(inject)) {
      return;
    }

    var injectMe;

    if (inject === '$injector') {
      injectMe = new di.Inject(di.Injector);
    } else if (isObject(inject)) {
      if(isString(inject.inject)){
        injectMe = new di.Inject(inject.inject);
      } else if(isString(inject.promise)) {
        injectMe = new di.InjectPromise(inject.promise);
      } else if(isString(inject.lazy)) {
        injectMe = new di.InjectLazy(inject.lazy);
      }
    } else {
      injectMe = new di.Inject(inject);
    }

    di.annotate(obj, injectMe);
  }
1066429
def _inject_func(func, conn):
    
    name = func.__name__
    if not name in conn.namespace:
        if isbuiltin(func):
            inject_code = '%s = %s' % (name, name)
        elif isfunction(func):
            inject_code = getsource(func)
        conn.execute(inject_code)
    return conn.namespace[name]
426563
function gnodeJsExtensionCompiler (module, filename) {
  var content = fs.readFileSync(filename, 'utf8');

  // remove the Byte Order Marker if present
  content = stripBOM(content);

  // strip away the shebang if present
  content = stripShebang(content);

  if (genFunExp.test(content) && !isValid(content)) {
    // compile JS via facebook/regenerator
    content = regenerator.compile(content, {
      includeRuntime: 'object' !== typeof regeneratorRuntime
    }).code;
  }

  module._compile(content, filename);
}
487177
function registerHelper(name, helper) {
    var s = this;
    s.helpers = s.helpers || {};
    s.helpers[name] = helper;
    return s;
  }
268949
function (less, pluginManager) {
        var injector = this.getInstance(less);

        // only auto inject after 2.4.0
        if (pluginManager.addPreProcessor) {
            pluginManager.addPreProcessor(injector);
        }
    }
205003
function objectExtendDeep(extended) {
  var currentObject;
  var currentType;
  var extendedType;
  var currentItem;
  var currentTypeInner;

  for (var i = 1, c = arguments.length; i < c; i++) {
    currentObject = arguments[i];
    if (!currentObject)
      continue;
    currentType = type(currentObject);
    extendedType = type(extended);
    // type mismatch
    if (currentType !== extendedType) {
      if (currentType === 'array') {
        extended = [];
      } else if (currentType === 'object' && extendedType !== 'function') {
        extended = {};
      }
      // else copy, primitive, date, regexp, function ...
    }
    // extend arrays
    if (currentType === 'array') {
      extended = extended.concat(currentObject);
    } else {
      // or objects ;)
      for (var key in currentObject) {
        if (ownProperty.call(currentObject, key)) {
          currentTypeInner = type(currentObject[key]);
          currentItem = currentObject[key];
          if (/^(object|array)$/.test(currentTypeInner)) {
            extended[key] = objectExtendDeep(extended[key], currentItem);
          } else if (currentTypeInner === 'date') {
            extended[key] = new Date(currentItem.getTime());
          } else if (currentTypeInner === 'regexp') {
            extended[key] = cloneRegExp(currentItem);
          } else {
            extended[key] = currentItem;
          }
        }
      }
    }
  }
  return extended;
}
76879
function genWeexHandler (params, handlerCode) {
  var innerHandlerCode = handlerCode;
  var exps = params.filter(function (exp) { return simplePathRE.test(exp) && exp !== '$event'; });
  var bindings = exps.map(function (exp) { return ({ '@binding': exp }); });
  var args = exps.map(function (exp, i) {
    var key = "$_" + (i + 1);
    innerHandlerCode = innerHandlerCode.replace(exp, key);
    return key
  });
  args.push('$event');
  return '{\n' +
    "handler:function(" + (args.join(',')) + "){" + innerHandlerCode + "},\n" +
    "params:" + (JSON.stringify(bindings)) + "\n" +
    '}'
}
975853
def main(extension, strict_extensions, default_extension, x):
    

    # install a logbook handler before performing any other operations
    logbook.StderrHandler().push_application()
    create_args(x, zipline.extension_args)
    load_extensions(
        default_extension,
        extension,
        strict_extensions,
        os.environ,
    )
167955
function _injectVaribles(value) {
    return value.replace(/\{([\w]+)\}/g, function(exp, varibleName, index, val) {
        return _options[varibleName];
    });
}
90768
function inject(targetContent, sourceContent, opt, tagsRegExp) {
	const startTag = tagsRegExp.start;
	const endTag = tagsRegExp.end;
	let startMatch;
	let endMatch;

	while ((startMatch = startTag.exec(targetContent)) !== null) {
		// Take care of content length change
		endTag.lastIndex = startTag.lastIndex;
		endMatch = endTag.exec(targetContent);
		if (!endMatch) {
			throw error('Missing end tag for start tag: ' + startMatch[0]);
		}
		const toInject = [sourceContent];
		// content part before start tag
		let newContent = targetContent.slice(0, startMatch.index);

		if (opt.removeTags) {
			// Take care of content length change
			startTag.lastIndex -= startMatch[0].length;
		} else {
			// <startMatch> + partial body + <endMatch>
			toInject.unshift(startMatch[0]);
			toInject.push(endMatch[0]);
		}
		const previousInnerContent = targetContent.substring(startTag.lastIndex, endMatch.index);
		const indent = getLeadingWhitespace(previousInnerContent);
		// add new content
		newContent += toInject.join(indent);
		// append rest of target file
		newContent += targetContent.slice(endTag.lastIndex);
		// replace old content with new
		targetContent = newContent;
	}
	startTag.lastIndex = 0;
	endTag.lastIndex = 0;
	return targetContent;
}
1012592
function createInjector(type, creator) {
  return function(WrappedComponent, inputs, outputs) {
    if (typeof WrappedComponent === 'function') {
      const componentName = WrappedComponent.name
      inputs = normalizeInputs(componentName, inputs, WrappedComponent.keys)
      outputs = normalizeOutputs(componentName, inputs, outputs)
      return creator(WrappedComponent, inputs, outputs)
    } else {
      // istanbul ignore next
      const error = `alfa.${type} only accepts function or class. Got "${typeof WrappedComponent}".`
      throw new TypeError(error)
    }
  }
}
182135
private <T extends Assignable> Class<T> loadExtension(ExtensionWrapper extensionWrapper) {
        return loadExtensionClass(extensionWrapper.implementingClassName);
    }
925806
function inject(moduleName) {
                    var localParams = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
                    var real = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];

                    var self = this,
                        deferred = $q.defer();
                    if (angular.isDefined(moduleName) && moduleName !== null) {
                        if (angular.isArray(moduleName)) {
                            var promisesList = [];
                            angular.forEach(moduleName, function (module) {
                                promisesList.push(self.inject(module, localParams, real));
                            });
                            return $q.all(promisesList);
                        } else {
                            self._addToLoadList(self._getModuleName(moduleName), true, real);
                        }
                    }
                    if (modulesToLoad.length > 0) {
                        var res = modulesToLoad.slice(); // clean copy
                        var loadNext = function loadNext(moduleName) {
                            moduleCache.push(moduleName);
                            modulePromises[moduleName] = deferred.promise;
                            self._loadDependencies(moduleName, localParams).then(function success() {
                                try {
                                    justLoaded = [];
                                    _register(providers, moduleCache, localParams);
                                } catch (e) {
                                    self._$log.error(e.message);
                                    deferred.reject(e);
                                    return;
                                }

                                if (modulesToLoad.length > 0) {
                                    loadNext(modulesToLoad.shift()); // load the next in list
                                } else {
                                        deferred.resolve(res); // everything has been loaded, resolve
                                    }
                            }, function error(err) {
                                deferred.reject(err);
                            });
                        };

                        // load the first in list
                        loadNext(modulesToLoad.shift());
                    } else if (localParams && localParams.name && modulePromises[localParams.name]) {
                        return modulePromises[localParams.name];
                    } else {
                        deferred.resolve();
                    }
                    return deferred.promise;
                }