The actual transformation occurs here.

    flask example: images/staticfy.jpg', ==>
        "{{ url_for('static', filename='images/staticfy.jpg') }}"
179036
def transform(matches, framework, namespace, static_endpoint):
    
    transformed = []
    namespace = namespace + '/' if namespace else ''

    for attribute, elements in matches:
        for element in elements:
            asset_location = get_asset_location(element, attribute)

            # string substitution
            sub_dict = {
                'static_endpoint': static_endpoint, 'namespace': namespace,
                'asset_location': asset_location
                }
            transformed_string = frameworks[framework] % sub_dict

            res = (attribute, element[attribute], transformed_string)
            transformed.append(res)

    return transformed
1359019
function renderStatic (
  index,
  isInFor
) {
  var tree = this._staticTrees[index];
  // if has already-rendered static tree and not inside v-for,
  // we can reuse the same tree by doing a shallow clone.
  if (tree && !isInFor) {
    return Array.isArray(tree)
      ? cloneVNodes(tree)
      : cloneVNode(tree)
  }
  // otherwise, render a fresh tree.
  tree = this._staticTrees[index] =
    this.$options.staticRenderFns[index].call(this._renderProxy);
  markStatic(tree, ("__static__" + index), false);
  return tree
}
311014
def __copy_static(self, template, output_path):
        """"""
        
        self.path_static = os.path.join(template, "static", "css")
        for file in os.listdir(self.path_static):
            print(file)
            shutil.copyfile(os.path.join(template, "static", "css", file), 
                            os.path.join(output_path, "output", self.name, "site", "static", "css", file))
            
        self.path_static = os.path.join(template, "static", "js")
        for file in os.listdir(self.path_static):
            print(file)
            shutil.copyfile(os.path.join(template, "static", "js", file), 
                            os.path.join(output_path, "output", self.name, "site", "static", "js", file))
389409
function(options) {
    this.transformations = options.transformations || [];
    this.rootUrl = options.baseUrl;
    this.baseUrl = options.baseUrl;
    this.user = options.user || options.publicKey;
    this.publicKey = options.publicKey;
    this.privateKey = options.privateKey;
    this.imageIdentifier = options.imageIdentifier;
    this.extension = options.extension;
    this.queryString = options.queryString;
    this.path = options.path || '';

    this.baseUrl += [
        '/users', this.user,
        'images', this.imageIdentifier
    ].join('/');
}
429634
function Image(src) {
  if (!(this instanceof Image)) {
    return new Image(src)
  }

  if (typeof src !== 'string') {
    throw new Error('param `src` must be a string')
  }

  var ret = reg.exec(src)

  if (!ret) {
    throw new Error('invalid param `src`')
  }

  this.src = src
  this.host = ret[1] || defaultHost
  this.version = ret[2] ? ret[2].slice(0, -1) : ''
  this.hash = ret[3]
  this.ext = ret[4]
}
645837
function executeTransform (filepath, incremental) {
  logger.info('Processing file: ' + filepath)

  var page = {} // Info about page passed to the template file

  var fileInPath = filepath
  var fileRelativePath = path.relative(config.html.src, fileInPath)
  page.source = fileRelativePath // fileRelativePath changes below hence we assign it here

  var fileOutDir = path.dirname(path.join(config.html.dest, fileRelativePath))
  var fileParsedPath = path.parse(fileInPath)
  var fileName = fileParsedPath.name
  var fileExt = fileParsedPath.ext

  var blog = blogs.getBlog(fileRelativePath, fileName)
  var post = null

  if (blog) {
    fileOutDir = blog.config.dest
    fileRelativePath = path.join(path.relative(config.out, blog.config.dest), (fileName + '.' + fileExt))
    post = blogs.getPost(blog, fileName)
    if (post === null) {
      return // most probably a draft in production build
    }
  }

  if (config.html.prettyurls && fileName !== 'index' && fileName !== '404') {
    // convert out files like about.html to about/index.html
    fileOutDir = path.join(fileOutDir, fileName)
    fileRelativePath = path.join(path.dirname(fileRelativePath), fileName, 'index' + fileExt)

    fileName = 'index'
  }

  logger.debug('File Relative Path: ' + fileRelativePath)

  var fileOutName = fileName + '.html'
  var fileOutPath = path.join(fileOutDir, fileOutName)

  shell.mkdir('-p', fileOutDir)

  logger.debug('File In Path: ' + fileInPath)
  logger.debug('File Out Path: ' + fileOutPath)

  page.path = sitemap.getRelativePath(fileRelativePath, fileOutName)
  page.url = sitemap.getPageURL(page.path)

  try {
    if (!blog) {
      var fileContents = fs.readFileSync(fileInPath, 'utf8')
      fileContents = fm(fileContents)

      page = utils.deepMerge(page, fileContents.attributes)

      if (page.draft) {
        if (config.env !== 'development') {
          return // dont process drafts if this is not development build
        }
      }

      if (fileExt === '.pug') {
        page.content = pug.processString(fileContents.body, fileInPath, page)
      } else {
        page.content = markdown.processString(fileContents.body)
      }
    } else {
      if (!incremental) {
        page = post
      } else {
        page = blogs.processPost(fileInPath, blog)
      }
    }

    if (!page.layout) {
      page.layout = blog ? blog.config.layout : 'default'
    }

    // logger.debug(JSON.stringify(page))

    var templateInPath = path.join(config.layouts, '_layout-' + page.layout + '.pug')
    logger.debug('Layout is: ' + templateInPath)

    pug.processFile(templateInPath, fileOutPath, page, incremental)

    if (!incremental && fileName !== '404') {
      sitemap.addToSitemap(fileRelativePath, fileOutName, fileInPath)
    }
  } catch (e) {
    logger.error('Error processing file: ' + e)
    process.exit(1)
  }
}
816393
static BindTransform getNetTransform(TypeName typeName) {
		if (URL.class.getName().equals(typeName.toString())) {
			return new UrlBindTransform();
		}

		return null;
	}
351860
function factory(root, definitions, existing) {
  var id = 0

  return one

  /* Transform a normal link/image based on bound
   * `definitions`. */
  function one(node, index, parent) {
    var url = node.url
    var title = node.title
    var replacement
    var identifier
    var titles
    var definition

    if (own.call(definitions, url)) {
      titles = definitions[url]
    } else {
      titles = {}
      definitions[url] = titles
    }

    if (own.call(titles, title)) {
      identifier = titles[title].identifier
    } else {
      do {
        identifier = String(++id)
      } while (existing.indexOf(identifier) !== -1)

      definition = {
        type: 'definition',
        identifier: identifier,
        title: title,
        url: url
      }

      titles[title] = definition

      root.children.push(definition)
    }

    replacement = {
      type: node.type + 'Reference',
      identifier: identifier,
      referenceType: 'full'
    }

    if (node.type === 'image') {
      replacement.alt = node.alt
    } else {
      replacement.children = node.children
    }

    parent.children[index] = replacement
  }
}
85601
function performChange(content) {
  const exampleFile = ExampleFile.fromPath(this.file.path);
  const match = content.match(/<!---([\s\S]*)?--->/);
  if (!match) {
    return content;
  }
  gutil.log('changing', exampleFile.title);
  const frontmatter = JSON.parse(match[1]);
  const yaml = require('js-yaml');
  const yamlFrontmatter = `<!---

${yaml.safeDump(frontmatter)}
--->
${content.substring(match[0].length)}`;
  /*
  if (!/<title>/.test(content)) {
    content = content.replace(/<meta charset="utf-8">/g,
        '<meta charset="utf-8">\n  <title>' + exampleFile.title() + '</title>');
  }
  */
  return yamlFrontmatter;
}
720520
def static(self, uri, file_or_directory, *args, **kwargs):
        
        name = kwargs.pop("name", "static")
        if not name.startswith(self.name + "."):
            name = "{}.{}".format(self.name, name)
        kwargs.update(name=name)

        strict_slashes = kwargs.get("strict_slashes")
        if strict_slashes is None and self.strict_slashes is not None:
            kwargs.update(strict_slashes=self.strict_slashes)

        static = FutureStatic(uri, file_or_directory, args, kwargs)
        self.statics.append(static)
1071871
function MorphTo(model, id, type) {
        var _this = _super.call(this, model) /* istanbul ignore next */ || this;
        _this.id = id;
        _this.type = type;
        return _this;
    }
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;
}
270748
def reverse(self, url, args=None, kwargs=None):
        '''  '''
        return reverse("%s:%s" % (self.instance_name, url,),
                        args=args,
                        kwargs=kwargs,
                        current_app = self.app_name)
228335
function transform(htmlStr) {
  var $ = cheerio.load(htmlStr, { decodeEntities: false });

  Object.keys(transformFunc).forEach(function(key) {
    transformFunc[key]($);
  });

  return $.html();
}
1326762
function applyTransform(data, headers, status, fns) {
		if (typeof fns === 'function') {
			data = fns(data, headers, status);
		} else {
			for (var i = 0; i < fns.length; i++) {
				data = fns[i](data, headers, status);
			}
		}
		return data;
	}
654710
function (hash, val) {
            var key,
              value,
              element = this.element,
              hasSetSymbolSize,
              ret = this,
              skipAttr;

            // single key-value pair
            if (typeof hash === 'string' && val !== UNDEFINED) {
                key = hash;
                hash = {};
                hash[key] = val;
            }

            // used as a getter: first argument is a string, second is undefined
            if (typeof hash === 'string') {
                ret = (this[hash + 'Getter'] || this._defaultGetter).call(this, hash, element);

                // setter
            } else {

                for (key in hash) {
                    value = hash[key];
                    skipAttr = false;



                    if (this.symbolName && /^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(key)) {
                        if (!hasSetSymbolSize) {
                            this.symbolAttr(hash);
                            hasSetSymbolSize = true;
                        }
                        skipAttr = true;
                    }

                    if (this.rotation && (key === 'x' || key === 'y')) {
                        this.doTransform = true;
                    }

                    if (!skipAttr) {
                        (this[key + 'Setter'] || this._defaultSetter).call(this, value, key, element);
                    }

                    // Let the shadow follow the main element
                    if (this.shadows && /^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(key)) {
                        this.updateShadows(key, value);
                    }
                }

                // Update transform. Do this outside the loop to prevent redundant updating for batch setting
                // of attributes.
                if (this.doTransform) {
                    this.updateTransform();
                    this.doTransform = false;
                }

            }

            return ret;
        }
770509
def transform(request, syntax_processor_name=None, var_name="text"):
    
    if request.method != 'POST':
        return HttpResponseNotAllowed("Only POST allowed")

    source = request.POST.get(var_name)
    if not source:
        return HttpResponse('')

    processor = TextProcessor.objects.get(name=syntax_processor_name or getattr(settings, "DEFAULT_MARKUP", "markdown"))
    output = processor.convert(source)

    try:
        t = template.Template(output, name='markup_preview')
        output = t.render(template.Context({'MEDIA_URL' : settings.MEDIA_URL}))
    except template.TemplateSyntaxError, e:
        log.warning('Error in preview rendering: %s' % e)
        output = '<h3 style="color:red">%s</h3><p>%s</p>' % (ugettext('You have an errors in source text!'), e)

    return HttpResponse(output)