For babel.transform
17410
function extract(
  pattern /* : string */,
  babelPlugins /* : Array<string> */ = []
) /* : string */ {
  const srcPaths = glob.sync(pattern, { absolute: true });
  const relativeSrcPaths = glob.sync(pattern);
  const contents = srcPaths.map(p => fs.readFileSync(p, 'utf-8'));
  const reqBabelPlugins = babelPlugins.map(b =>
    require.resolve(`babel-plugin-${b}`)
  );
  const messages = contents
    .map(content =>
      babel.transform(content, {
        presets: [require.resolve('babel-preset-react-app')],
        plugins: [
          require.resolve('babel-plugin-react-intl'),
          ...reqBabelPlugins,
        ],
        babelrc: false,
      })
    )
    .map(R.path(['metadata', 'react-intl', 'messages']));

  const result = R.zipWith(
    (m, r) => m.map(R.assoc('filepath', r)),
    messages,
    relativeSrcPaths
  )
    .filter(R.complement(R.isEmpty))
    .reduce(R.concat, []);

  return result;
}
1357335
def babel2datetime(pattern):
    """"""
    if not isinstance(pattern, DateTimePattern):
        pattern = parse_pattern(pattern)

    map_fmt = {
        # days
        "d": "%d",
        "dd": "%d",
        "EEE": "%a",
        "EEEE": "%A",
        "EEEEE": "%a",  # narrow name => short name
        # months
        "M": "%m",
        "MM": "%m",
        "MMM": "%b",
        "MMMM": "%B",
        # years
        "y": "%Y",
        "yy": "%Y",
        "yyyy": "%Y",
        # hours
        "h": "%I",
        "hh": "%I",
        "H": "%H",
        "HH": "%H",
        # minutes,
        "m": "%M",
        "mm": "%M",
        # seconds
        "s": "%S",
        "ss": "%S",
        # am/pm
        "a": "%p",
    }

    return pattern.format % map_fmt
641020
function transformCase(str, transFn = 'pascalCase') {
  if (!allowedNameTransforms.hasOwnProperty(transFn)) {
    const message = `Invalid transform, allowed transform functions are:\n
    ${Object.keys(allowedNameTransforms).join(', ')}]`;
    throw new Error(message);
  }
  return changeCase[transFn](str);
}
1111053
function _transform() {
	var codeIn = $('#codeIn').val();
	try {
		var codeOut = Streamline.transform(codeIn, {
			runtime: _generators ? "generators" : "callbacks",
		});
		$('#codeOut').val(codeOut);
		info("ready");
	} catch (ex) {
		console.error(ex);
		error(ex.message);
	}
}
566833
function parseTransforms(value) {
  return value
    .match(/(rotate|translate|scale|skewX|skewY|matrix)\s*\(([^)]*)\)\s*/g)
    .map(transform => transform.match(/[\w.-]+/g));
}
672726
AtomSymbol transform(AffineTransform transform) {
        List<TextOutline> transformedAdjuncts = new ArrayList<TextOutline>(adjuncts.size());
        for (TextOutline adjunct : adjuncts)
            transformedAdjuncts.add(adjunct.transform(transform));
        List<TextOutline> transformedAnnAdjuncts = new ArrayList<TextOutline>(adjuncts.size());
        for (TextOutline adjunct : annotationAdjuncts)
            transformedAnnAdjuncts.add(adjunct.transform(transform));
        return new AtomSymbol(element.transform(transform), transformedAdjuncts, transformedAnnAdjuncts, alignment,
                hull.transform(transform));
    }
622373
function babel7toBabel6(ast) {
  const visitor = {
    ArrowFunctionExpression: node => {
      node.expression = node.body.type !== 'BlockStatement';
    },
    ExistsTypeAnnotation: node => {
      node.type = 'ExistentialTypeParam';
    },
    NumberLiteralTypeAnnotation: node => {
      node.type = 'NumericLiteralTypeAnnotation';
    },
    ObjectTypeIndexer: node => {
      node.end++;
      node.loc.end.column++;
    },
    ForOfStatement: node => {
      node.type = 'ForAwaitStatement';
      delete node.await;
    },
    SpreadElement: (node, path) => {
      if (
        path.parentPath.isObjectExpression() ||
        path.parentPath.isArrayExpression()
      ) {
        node.type = 'SpreadProperty';
      }
    },
    RestElement: (node, path) => {
      if (
        path.parentPath.isObjectPattern() ||
        path.parentPath.isArrayPattern()
      ) {
        node.type = 'RestProperty';
      }
    }
  };

  traverse(ast, {
    enter(path) {
      if (path.node.variance && path.node.variance.type === 'Variance') {
        path.node.variance = path.node.variance.kind;
      }

      let visitorFunc = visitor[path.node.type];
      if (visitorFunc) {
        visitorFunc(path.node, path);
      }
    }
  });

  return ast;
}
880411
function transformer(data) {
        var newData = {};
        var keys = Object.keys(data), length = keys.length, key, i;
        for ( i = 0; i < length; i++) {
          key = keys[i];
          newData[key] = data[key];
        }
        return newData;
      }
840154
private static PrefsTransform getTransform(TypeName typeName) {
		if (typeName.isPrimitive()) {
			return getPrimitiveTransform(typeName);
		}

		if (typeName instanceof ArrayTypeName) {
			ArrayTypeName typeNameArray = (ArrayTypeName) typeName;
			TypeName componentTypeName = typeNameArray.componentType;

			if (TypeUtility.isEquals(componentTypeName, Byte.TYPE.toString())) {
				return new ByteArrayPrefsTransform();
			} else {
				return new ArrayPrefsTransform();
			}
		} else if (typeName instanceof ParameterizedTypeName) {
			ParameterizedTypeName parameterizedTypeName = (ParameterizedTypeName) typeName;
			if (TypeUtility.isList(parameterizedTypeName)) {
				return new ListPrefsTransformation();
			} else if (TypeUtility.isSet(parameterizedTypeName)) {
				return new SetPrefsTransformation();
			} else if (TypeUtility.isMap(parameterizedTypeName)) {
				return new MapPrefsTransformation();
			}
		}

		PrefsTransform transform;

		transform = getLanguageTransform(typeName);
		if (transform != null) {
			return transform;
		}

		transform = getUtilTransform(typeName);
		if (transform != null) {
			return transform;
		}

		transform = getMathTransform(typeName);
		if (transform != null) {
			return transform;
		}

		transform = getNetTransform(typeName);
		if (transform != null) {
			return transform;
		}

		transform = getSqlTransform(typeName);
		if (transform != null) {
			return transform;
		}

		if (TypeUtility.isEnum(typeName)) {
			return new EnumPrefsTransform(typeName);
		}

		return new ObjectPrefsTransform();
	}
890515
function translate (content, contentTypes) {
  let output = {}
  content.forEach(each => {
    const base = path.parse(each.file).base
    if (base === 'index.md') {
      const type = each.dir.split('/').pop()
      const contentTypeTranslation = contentTypes.find(contentType => contentType[type])
      if (contentTypeTranslation && contentTypeTranslation[type]) {
        output[type] = contentTypeTranslation[type](content, type)
      }
    }
  })
  return output
}
170527
function compileGraphQLTag(
  t: $FlowFixMe,
  path: Object,
  state: BabelState,
  ast: DocumentNode,
): void {
  if (ast.definitions.length !== 1) {
    throw new Error(
      'BabelPluginRelay: Expected exactly one definition per graphql tag.',
    );
  }
  const definition = ast.definitions[0];
  if (
    definition.kind !== 'FragmentDefinition' &&
    definition.kind !== 'OperationDefinition'
  ) {
    throw new Error(
      'BabelPluginRelay: Expected a fragment, mutation, query, or ' +
        'subscription, got `' +
        definition.kind +
        '`.',
    );
  }
  return replaceMemoized(t, path, createAST(t, state, path, definition));
}
356234
function transformRaw(input, options) {
  const transformStream = new TransformStream(options);
  pipe(input, transformStream.writable);
  return transformStream.readable;
}
741027
function transformFile(from, to, modulesDirectory) {
  var contents = fs.readFileSync(from, 'utf8');

  // modules
  var modules = getModules(contents);
  for (var index in modules) {
    var module = modules[index];
    if (modulesManifest.hasOwnProperty(module)) {
      continue;
    }
    var modulePath = path_util.modulePath(module, node_modules);
    if (modulePath === null) {
      continue;
    }
    var targetPath = path_util.targetPath(modulePath, node_modules, modulesDirectory);
    modulesManifest[module] = path.relative(process.cwd(), targetPath);
    if (!fs.existsSync(targetPath)) {
      transformFile(modulePath, targetPath, modulesDirectory);
    }
    var relativePath = path_util.relativePath(to, targetPath);
    var re = eval('\/require\\\(\[\'\"\]' + module + '\[\'\"\]\\\)\/ig');
    contents = contents.replace(re, 'require(\'' + relativePath + '\')');
  }

  // requires
  var requires = getRequires(contents);
  for (var index in requires) {
    var require = requires[index];
    var requirePath = path_util.requirePath(from, require);
    if (requirePath === null) {
      continue;
    }
    if (requiresManifest.hasOwnProperty(requirePath)) {
      continue;
    } else {
      requiresManifest[requirePath] = true;
    }
    var targetPath = path_util.targetPath(requirePath, node_modules, modulesDirectory);
    if (!fs.existsSync(targetPath)) {
      transformFile(requirePath, targetPath, modulesDirectory);
    }
  }

  var dirname = path.dirname(to);
  fs.mkdirsSync(dirname);
  fs.writeFileSync(to, contents, 'utf8');
}
565555
function makeTranslation (original, replacement) {
    let translation = new Map()
    Array.prototype.forEach.call(original, function setMap (source, index) {
      translation.set(source, replacement[index] || '')
    })

    return function (string) {
      return Array.prototype.map.call(string, function replace (ch) {
        return translation.has(ch) ? translation.get(ch) : ch
      }).join('')
    }
  }
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;
}
161010
function transform(transformerCtx, options) {
    var html = options.template;
    for (var i = 0; i < transformers.length; i++) {
        html = transformers[i](html, transformerCtx, options);
    }
    return html;
}
730530
function transform(transform, flush) {
  const stream = new Transform({ objectMode: true });
  stream._transform = transform;
  if (typeof flush === 'function') {
    stream._flush = flush;
  }
  return stream;
}