Actually transform the code.
776059
function transformCode(transformFn, code, url) {
  let source;
  if (url != null) {
    source = url;
  } else {
    source = 'Inline Babel script';
    inlineScriptCount++;
    if (inlineScriptCount > 1) {
      source += ' (' + inlineScriptCount + ')';
    }
  }

  return transformFn(
    code,
    {
      filename: source,
      ...babelOpts
    }
  ).code;
}
1263590
def run(self):
        
        # Set a stream to replace stdout, and get results in it
        stdoutBak = sys.stdout
        streamResult = StringIO()
        sys.stdout = streamResult
        try:
            pycodestyle.Checker.check_all(self)
        finally:
            sys.stdout = stdoutBak
925788
def handle_code(code):
    ""

    code_keys = []
    # it is a known code (e.g. {DOWN}, {ENTER}, etc)
    if code in CODES:
        code_keys.append(VirtualKeyAction(CODES[code]))

    # it is an escaped modifier e.g. {%}, {^}, {+}
    elif len(code) == 1:
        code_keys.append(KeyAction(code))

    # it is a repetition or a pause  {DOWN 5}, {PAUSE 1.3}
    elif ' ' in code:
        to_repeat, count = code.rsplit(None, 1)
        if to_repeat == "PAUSE":
            try:
                pause_time = float(count)
            except ValueError:
                raise KeySequenceError('invalid pause time %s'% count)
            code_keys.append(PauseAction(pause_time))

        else:
            try:
                count = int(count)
            except ValueError:
                raise KeySequenceError(
                    'invalid repetition count %s'% count)

            # If the value in to_repeat is a VK e.g. DOWN
            # we need to add the code repeated
            if to_repeat in CODES:
                code_keys.extend(
                    [VirtualKeyAction(CODES[to_repeat])] * count)
            # otherwise parse the keys and we get back a KeyAction
            else:
                to_repeat = parse_keys(to_repeat)
                if isinstance(to_repeat, list):
                    keys = to_repeat * count
                else:
                    keys = [to_repeat] * count
                code_keys.extend(keys)
    else:
        raise RuntimeError("Unknown code: %s"% code)

    return code_keys
406911
private String applyTransformations(String src)
    {
        switch (transform)
        {
            case LOWERCASE:
                return src.toLowerCase();
            case UPPERCASE:
                return src.toUpperCase();
            case CAPITALIZE:
                StringBuilder ret = new StringBuilder(src.length());
                boolean ws = true;
                for (int i = 0; i < src.length(); i++)
                {
                    char ch = src.charAt(i);
                    if (Character.isWhitespace(ch))
                        ws = true;
                    else
                    {
                        if (ws)
                            ch = Character.toUpperCase(ch);
                        ws = false;
                    }
                    ret.append(ch);
                }
                return ret.toString();
            default:
                return src;
        }
    }
121653
function globalEval(code) {
        var script;

        code = code.replace(/^\s+/, '').replace(/\s+$/, '');

        if (code) {
            if (code.indexOf('use strict') === 1) {
                script = document.createElement('script');
                script.text = code;
                head.appendChild(script).parentNode.removeChild(script);
            }
            else {
                eval(code);
            }
        }
    }
5311
def apply_fixes(args, tmpdir):
  """"""
  invocation = [args.clang_apply_replacements_binary]
  if args.format:
    invocation.append('-format')
  if args.style:
    invocation.append('-style=' + args.style)
  invocation.append(tmpdir)
  subprocess.call(invocation)
1223404
def eval(self, code, mode="single"):
        """"""
        if isinstance(code, string_types):
            if PY2 and isinstance(code, text_type):  # noqa
                code = UTF8_COOKIE + code.encode("utf-8")
            code = compile(code, "<interactive>", mode)
        return eval(code, self.globals, self.locals)
192264
def transform(transform_func):
    """"""
    def decorator(func):
        @wraps(func)
        def f(*args, **kwargs):
            return transform_func(
                func(*args, **kwargs)
            )
        return f
    return decorator
526362
def translate(usercodes, rgb_mode=False):
    
    for code in usercodes:
        code = code.strip().lower()
        if code.isalpha() and (code in codes['fore']):
            # Basic color name.
            yield translate_basic(code)
        else:
            if ',' in code:
                try:
                    r, g, b = (int(c.strip()) for c in code.split(','))
                except (TypeError, ValueError):
                    raise InvalidColr(code)
                code = (r, g, b)

            colorcode = ColorCode(code, rgb_mode=rgb_mode)

            if disabled():
                yield str(colorcode)
            yield colorcode.example()
215826
def _run_code(code, run_globals, init_globals=None,
              mod_name=None, mod_fname=None,
              mod_loader=None, pkg_name=None):
    """"""
    if init_globals is not None:
        run_globals.update(init_globals)
    run_globals.update(__name__ = mod_name,
                       __file__ = mod_fname,
                       __loader__ = mod_loader,
                       __package__ = pkg_name)
    exec code in run_globals
    return run_globals
173742
def transform_cb(self, setting, value):
        """"""
        self.make_callback('transform')

        # whence=0 because need to calculate new extents for proper
        # cutout for rotation (TODO: always make extents consider
        #  room for rotation)
        whence = 0
        self.redraw(whence=whence)
1004600
def do_transform(self):
        """"""
        if not self.transform:
            return
        try:
            self.latest_value = utils.Transform(
                expr=self.transform, value=self.latest_value,
                timedelta=self.time_between_updates().total_seconds()).result()
        except (TypeError, ValueError):
            logger.warn("Invalid transformation '%s' for metric %s",
                        self.transfrom, self.pk)
        self.transform = ''
552259
def build_code(self, lang, body):
        """"""
        self.out.append("```" + lang)
        self.build_markdown(lang, body)
        self.out.append("```")
1286392
def refactor(self, symbol, value):
        
        if value:
            self.pset.add(symbol)
        else:
            self.pset.remove(symbol)
743606
def fit_transform(self, input, **fit_kwargs):
        """"""
        self.fit(input, **fit_kwargs)
        X = self.transform(input)
        return X
124172
def changebase(string, frm, to, minlen=0):
    
    if frm == to:
        return lpad(string, get_code_string(frm)[0], minlen)

    return encode(decode(string, frm), to, minlen)
603899
def refactor_rename_at_point(self, offset, new_name, in_hierarchy, docs):
        """"""
        try:
            refactor = Rename(self.project, self.resource, offset)
        except RefactoringError as e:
            raise Fault(str(e), code=400)
        return self._get_changes(refactor, new_name,
                                 in_hierarchy=in_hierarchy, docs=docs)