Return source with transformations, if any
334749
def process_source(self):
        """"""
        if isinstance(self.source, str):
            # Replace single and double quotes with escaped single-quote
            self.source = self.source.replace("'", "\'").replace('"', "\'")
            return "\"{source}\"".format(source=self.source)
        return self.source
184389
function transformReact(source, options) {
  // TODO: just use react-tools
  options = options || {};
  var visitorList;
  if (options.harmony) {
    visitorList = visitors.getAllVisitors();
  } else {
    visitorList = visitors.transformVisitors.react;
  }

  if (options.stripTypes) {
    // Stripping types needs to happen before the other transforms
    // unfortunately, due to bad interactions. For example,
    // es6-rest-param-visitors conflict with stripping rest param type
    // annotation
    source = transform(typesSyntax.visitorList, source, options).code;
  }

  return transform(visitorList, source, {
    sourceMap: supportsAccessors && options.sourceMap
  });
}
192264
def transform(transform_func):
    """"""
    def decorator(func):
        @wraps(func)
        def f(*args, **kwargs):
            return transform_func(
                func(*args, **kwargs)
            )
        return f
    return decorator
118456
def python(source):
    
    """
    obj = type('', (object,), {})()
    _exec(source, obj.__dict__, obj.__dict__)
    return obj
302649
def _getTransformation(self):
        """"""
        CheckParent(self)

        val = _fitz.Page__getTransformation(self)
        val = Matrix(val)

        return val
374343
private AbstractTransform getTransform(String fileName) {
        File file = new File(fileName);
        
        for (Transform transform : transforms) {
            if (transform.filter.accept(file)) {
                return transform.transform;
            }
        }
        
        return null;
    }
352997
private Collection<Integer> transform(StreamTransformation<?> transform) {

		if (alreadyTransformed.containsKey(transform)) {
			return alreadyTransformed.get(transform);
		}

		LOG.debug("Transforming " + transform);

		if (transform.getMaxParallelism() <= 0) {

			// if the max parallelism hasn't been set, then first use the job wide max parallelism
			// from the ExecutionConfig.
			int globalMaxParallelismFromConfig = env.getConfig().getMaxParallelism();
			if (globalMaxParallelismFromConfig > 0) {
				transform.setMaxParallelism(globalMaxParallelismFromConfig);
			}
		}

		// call at least once to trigger exceptions about MissingTypeInfo
		transform.getOutputType();

		Collection<Integer> transformedIds;
		if (transform instanceof OneInputTransformation<?, ?>) {
			transformedIds = transformOneInputTransform((OneInputTransformation<?, ?>) transform);
		} else if (transform instanceof TwoInputTransformation<?, ?, ?>) {
			transformedIds = transformTwoInputTransform((TwoInputTransformation<?, ?, ?>) transform);
		} else if (transform instanceof SourceTransformation<?>) {
			transformedIds = transformSource((SourceTransformation<?>) transform);
		} else if (transform instanceof SinkTransformation<?>) {
			transformedIds = transformSink((SinkTransformation<?>) transform);
		} else if (transform instanceof UnionTransformation<?>) {
			transformedIds = transformUnion((UnionTransformation<?>) transform);
		} else if (transform instanceof SplitTransformation<?>) {
			transformedIds = transformSplit((SplitTransformation<?>) transform);
		} else if (transform instanceof SelectTransformation<?>) {
			transformedIds = transformSelect((SelectTransformation<?>) transform);
		} else if (transform instanceof FeedbackTransformation<?>) {
			transformedIds = transformFeedback((FeedbackTransformation<?>) transform);
		} else if (transform instanceof CoFeedbackTransformation<?>) {
			transformedIds = transformCoFeedback((CoFeedbackTransformation<?>) transform);
		} else if (transform instanceof PartitionTransformation<?>) {
			transformedIds = transformPartition((PartitionTransformation<?>) transform);
		} else if (transform instanceof SideOutputTransformation<?>) {
			transformedIds = transformSideOutput((SideOutputTransformation<?>) transform);
		} else {
			throw new IllegalStateException("Unknown transformation: " + transform);
		}

		// need this check because the iterate transformation adds itself before
		// transforming the feedback edges
		if (!alreadyTransformed.containsKey(transform)) {
			alreadyTransformed.put(transform, transformedIds);
		}

		if (transform.getBufferTimeout() >= 0) {
			streamGraph.setBufferTimeout(transform.getId(), transform.getBufferTimeout());
		}
		if (transform.getUid() != null) {
			streamGraph.setTransformationUID(transform.getId(), transform.getUid());
		}
		if (transform.getUserProvidedNodeHash() != null) {
			streamGraph.setTransformationUserHash(transform.getId(), transform.getUserProvidedNodeHash());
		}

		if (!streamGraph.getExecutionConfig().hasAutoGeneratedUIDsEnabled()) {
			if (transform.getUserProvidedNodeHash() == null && transform.getUid() == null) {
				throw new IllegalStateException("Auto generated UIDs have been disabled " +
					"but no UID or hash has been assigned to operator " + transform.getName());
			}
		}

		if (transform.getMinResources() != null && transform.getPreferredResources() != null) {
			streamGraph.setResources(transform.getId(), transform.getMinResources(), transform.getPreferredResources());
		}

		return transformedIds;
	}
304318
function relayRelayDirectiveTransform(
  context: CompilerContext,
): CompilerContext {
  return IRTransformer.transform(context, {
    Fragment: visitRelayMetadata(fragmentMetadata),
    FragmentSpread: visitRelayMetadata(fragmentSpreadMetadata),
  });
}
1291239
def get_lst(source, extract=None, transform=None):
  """"""
  if extract is None:
    raw_list = source
  else:
    raw_list = extract(source)

  if transform is None:
    return raw_list
  else:
    tlist = []
    for idx, item in enumerate(raw_list):
      try:
        tlist.append(transform(item))
      except Exception as ex:
        raise Exception("An error occurred with item #{0}".format(idx)) from ex
    return tlist
93614
function getTransformationCost(transformation) {
    let {
      inputItems
    } = transformation
    let promises = inputItems.map((item) => {
      let deferred = Q.defer()
      ItemsLogic.getItems({id: item._id})
        .then(item => {
          deferred.resolve(item.price * item.quantity)
        })
      return deferred.promise
    })
    Q.all(promises)
      .done(values => {
        return Q(values.reduce((m, i) => (m + i), 0))
      })
  }
87044
def is_transform_generator(fn):
    """"""
    try:
        if six.PY2:
            fn.func_dict['is_transform_generator'] = True
        else:
            # py3
            return fn.__dict__.get('is_transform_generator', False)
    except AttributeError:
        return False
872929
def get_composition(source, *fxns):
  """"""
  val = source
  for fxn in fxns:
    val = fxn(val)
  return val
32830
def get_source(
            self, environment: Environment, template: str,
    ) -> Tuple[str, Optional[str], Callable]:
        
        for loader in self._loaders():
            try:
                return loader.get_source(environment, template)
            except TemplateNotFound:
                continue
        raise TemplateNotFound(template)
125045
def get_transformer(cls, method_name):
        """"""
        transform_function = getattr(cls, method_name)
        assert callable(transform_function)

        def transformer_method(self, node):
            kwargs = {}
            if inspect.signature(transform_function).parameters.get("helper"):
                kwargs["helper"] = self.helper
            return transform_function(node, **kwargs)

        return transformer_method
34514
function transform(filename, source, options) {
  function templateToJs(template) {
    return '(function () {' +
          'var quasi = ' + stringify(template.slice(0)) + ';' +
          'quasi.raw = ' + stringify(template.raw.slice(0)) + ';' +
          'return quasi;}())';
  }

  if (/\.json$/.test(filename)) {
    var stream = new PassThrough();
    stream.end(source);
    return stream;
  }

  source = acornTransform(source, {
    TaggedTemplateExpression: function (node) {
      var cooked = node.quasi.quasis.map(function (q) {
        return q.value.cooked;
      });
      cooked.raw = node.quasi.quasis.map(function (q) {
        return q.value.raw;
      });
      var quasi = templateToJs(cooked);

      var expressions = node.quasi.expressions.map(acornTransform.getSource);

      acornTransform.setSource(node, acornTransform.getSource(node.tag) + '(' +
                               [quasi].concat(expressions).join(', ') + ')');
    }
  });
  // var $__0 = Object.freeze(Object.defineProperties(["\ndiv\n  h1 Page not found"], {raw: {value: Object.freeze(["\ndiv\n  h1 Page not found"])}}));
  // var notFound =  jade($__0);
  function isObjectDot(node, property) {
    return node.type === 'CallExpression' && node.callee.type === 'MemberExpression'  &&
      node.callee.object.type === 'Identifier' && node.callee.object.name === 'Object' &&
      node.callee.computed === false && node.callee.property.type === 'Identifier' &&
      node.callee.property.name === property;
  }
  function isArrayOfStrings(node) {
    return node.type === 'ArrayExpression' && node.elements.every(function (el) {
      return el.type === 'Literal' && typeof el.value === 'string';
    });
  }
  function isKeyedObject(node, key) {
    return node.type === 'ObjectExpression' && node.properties.length === 1 &&
      node.properties[0].computed === false && node.properties[0].key.type === 'Identifier' &&
      node.properties[0].key.name === key;
  }
  function isTraceuredTemplateLiteral(node) {
    if (isObjectDot(node, 'freeze') && node.arguments.length === 1 && isObjectDot(node.arguments[0], 'defineProperties')) {
      var args = node.arguments[0].arguments;
      if (isArrayOfStrings(args[0]) && isKeyedObject(args[1], 'raw')) {
        var raw = args[1].properties[0].value;
        if (isKeyedObject(raw, 'value')) {
          raw = raw.properties[0].value;
          if (isObjectDot(raw, 'freeze') && raw.arguments.length === 1 && isArrayOfStrings(raw.arguments[0])) {
            return Function('', 'return ' + acornTransform.getSource(node))();
          }
        }
      }
    }
  }

  var literals = {};
  source = acornTransform(source, {
    VariableDeclaration: function (node) {
      node.declarations.forEach(function (declaration) {
        if (declaration.id.type === 'Identifier' && declaration.id.name[0] === '$' && declaration.init) {
          var value = isTraceuredTemplateLiteral(declaration.init);
          if (value) {
            literals[declaration.id.name] = value;
            acornTransform.setSource(declaration.init, 'undefined');
          }
        }
      });
    },
    Identifier: function (node) {
      if (node.name[0] === '$' && node.name in literals) {
        acornTransform.setSource(node, templateToJs(literals[node.name]));
      }
    }
  });

  var makeStatic = staticModule({ 'react-jade': makeStaticImplementation(filename, options) }, {
    vars: {
      __dirname: path.dirname(filename),
      __filename: path.resolve(filename),
      path: path,
      require: makeClientRequire(filename)
    }
  });
  makeStatic.end(source);
  return makeStatic;
}
234092
function convertSource(key, inObj) {
	let source = inObj; // body, query : keep it as is
	
	if (inObj === 'header') {
		source = "headers";
	}
	if (inObj === 'formData') {
		source = "body";
	}
	if (inObj === 'path') {
		source = "params";
	}
	
	return [`${source}.${key}`];
}
981882
function(){
            if(errors.length) return cb(errors);
            var transform = opts.transform || function(_result, _cb){
              _cb(null, _result);
            };
            transform(result, function(err, _result){
              if(err){
                errors.push(formatError(err, key));
                cb(errors);
              }else{
                cb(null, _result);
              }
            });
          }