when we are using DOTML files, we need to transform them to DOT files first.
777742
protected File transformInputFile(File from) throws MojoExecutionException {
        // create a temp file
        File tempFile;
        try {
            tempFile = File.createTempFile("dotml-tmp", ".xml");
        } catch (IOException e) {
            throw new MojoExecutionException(
                    "error creating temp file to hold DOTML to DOT translation", e);
        }
        // perform an XSLT transform from the input file to the temp file
        Source xml = new StreamSource(from);
        Result result = new StreamResult(tempFile);
        try {
            Source xslt = new StreamSource(
                    getClass().getClassLoader().getResourceAsStream("dotml/dotml2dot.xsl"));
            transformerFactory.newTransformer(xslt).transform(xml, result);
        } catch (TransformerException e) {
            throw new MojoExecutionException(
                    String.format("error transforming %s from DOTML to DOT file", from), e);
        }
        // return the temp file
        return tempFile;
    }
1024432
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
    private static Iterable<Directive> transform(final Iterable<String> texts) {
        final Collection<Directive> list = new LinkedList<>();
        for (final String text : texts) {
            try {
                for (final Directive dir : new Directives(text)) {
                    list.add(dir);
                }
            } catch (final SyntaxException ex) {
                throw new IllegalStateException(ex);
            }
        }
        return list;
    }
1019291
def transform_collection(collection_dir):
    

    collxml_file = open(os.path.join(collection_dir, 'collection.xml'))
    collxml_html = transform_collxml(collxml_file)

    # For each included module, parse and convert it
    for node in INCLUDE_XPATH(collxml_html):
        href = node.attrib['href']
        module = href.split('@')[0]
        # version = None # We don't care about version
        module_dir = os.path.join(collection_dir, module)

        # By default, use the index_auto_generated.cnxml file for the module
        module_path = os.path.join(module_dir, 'index_auto_generated.cnxml')
        if not os.path.exists(module_path):
          module_path = os.path.join(module_dir, 'index.cnxml')

        module_html = transform_cnxml(module_path)

        # Replace the include link with the body of the module
        module_body = MODULE_BODY_XPATH(module_html)

        node.getparent().replace(node, module_body[0])
    return collxml_html
380349
@Override
	protected void doTransform(ITransformable.Scale transformable, float comp)
	{
		float fromX = reversed ? this.toX : this.fromX;
		float toX = reversed ? this.fromX : this.toX;
		float fromY = reversed ? this.toY : this.fromY;
		float toY = reversed ? this.fromY : this.toY;
		float fromZ = reversed ? this.toZ : this.fromZ;
		float toZ = reversed ? this.fromZ : this.toZ;

		transformable.scale(fromX + (toX - fromX) * comp, fromY + (toY - fromY) * comp, fromZ + (toZ - fromZ) * comp, offsetX, offsetY,
				offsetZ);
	}
1286208
def merge_custom_defaults!
      dotfile = File.join(ENV["HOME"], ".aprc")
      load dotfile if File.readable?(dotfile)
      merge_options!(AwesomePrintLite.defaults) if AwesomePrintLite.defaults.is_a?(Hash)
    rescue => e
      $stderr.puts "Could not load #{dotfile}: #{e}"
    end
532618
def require_mapping(self) -> None:
        """"""
        if not isinstance(self.yaml_node, yaml.MappingNode):
            raise RecognitionError(('{}{}A mapping is required here').format(
                self.yaml_node.start_mark, os.linesep))
1179504
def tree_to_dot(tree:BubbleTree, dotfile:str=None, render:bool=False):
    
    graph = tree_to_graph(tree)
    path = None
    if dotfile:  # first save the dot file.
        path = graph.save(dotfile)
    if render:  # secondly, show it.
        # As the dot file is known by the Graph object,
        # it will be placed around the dot file.
        graph.view()
    return path
472851
public static InputStream runDOT(File dotFile, String format, String... additionalOpts) throws IOException {
        return runDOT(IOUtil.asBufferedUTF8Reader(dotFile), format, additionalOpts);
    }
1048441
private void initializeTransformationConfig(TypedArray attributes) {
    useCircularTransformation =
        attributes.getBoolean(R.styleable.nox_use_circular_transformation, true);
  }
80527
def dotty (params = {})
      dotfile = "graph.dot"
      File.open(dotfile, "w") {|f|
        print_dotted_on(params, f)
      }
      system("dotty", dotfile)
    end
196860
static void appendDot(Node n, ControlFlowGraph<Node> inCFG,
      Appendable builder) throws IOException {
    new DotFormatter(n, inCFG, builder, false);
  }
590233
public void doTag() {
        JspContext jspContext = getJspContext();
        DataGridStateFactory factory = DataGridStateFactory.getInstance(jspContext);
        assert factory != null;

        DataGridState state = null;
        if(_config != null)
            state = factory.getDataGridState(_name, _config);
        else
            state = factory.getDataGridState(_name);

        jspContext.setAttribute(_var, state);
    }
281342
def intermediary_to_dot(tables, relationships, output):
    
    dot_file = _intermediary_to_dot(tables, relationships)
    with open(output, "w") as file_out:
        file_out.write(dot_file)
546849
def doTranslate(option, urlOrPaths, serverEndpoint=ServerEndpoint, verbose=Verbose, tikaServerJar=TikaServerJar, 
                responseMimeType='text/plain',
                services={'all': '/translate/all'}):
    '''
    
    '''
    paths = getPaths(urlOrPaths)
    return [doTranslate1(option, path, serverEndpoint, verbose, tikaServerJar, responseMimeType, services)
            for path in paths]
1273357
function transform(context, settings, next) {
  var fileSet = new FileSet()

  context.fileSet = fileSet

  fileSet.on('add', add).on('done', next)

  if (context.files.length === 0) {
    next()
  } else {
    context.files.forEach(fileSet.add, fileSet)
  }

  function add(file) {
    filePipeline.run(
      {
        configuration: context.configuration,
        processor: settings.processor(),
        cwd: settings.cwd,
        extensions: settings.extensions,
        pluginPrefix: settings.pluginPrefix,
        treeIn: settings.treeIn,
        treeOut: settings.treeOut,
        inspect: settings.inspect,
        color: settings.color,
        out: settings.out,
        output: settings.output,
        streamOut: settings.streamOut,
        alwaysStringify: settings.alwaysStringify
      },
      file,
      fileSet,
      done
    )

    function done(error) {
      /* istanbul ignore next - doesn’t occur as all
       * failures in `filePipeLine` are failed on each
       * file.  Still, just to ensure things work in
       * the future, we add an extra check. */
      if (error) {
        error = file.message(error)
        error.fatal = true
      }

      fileSet.emit('one', file)
    }
  }
}
795957
async function copyAndTransform(file, ampRuntimeVersion) {
  const originalHtml = await readFile(file);
  const ampFile = file.substring(1, file.length)
      .replace('.html', '.amp.html');
  const allTransformationsFile = file.substring(1, file.length)
      .replace('.html', '.all.html');
  const validTransformationsFile = file.substring(1, file.length)
      .replace('.html', '.valid.html');

  // Transform into valid optimized AMP
  ampOptimizer.setConfig({
    validAmp: true,
    verbose: true,
  });
  const validOptimizedHtml = await ampOptimizer.transformHtml(originalHtml);

  // Run all optimizations including versioned AMP runtime URLs
  ampOptimizer.setConfig({
    validAmp: false,
    verbose: true,
  });
  // The transformer needs the path to the original AMP document
  // to correctly setup AMP to canonical linking
  const optimizedHtml = await ampOptimizer.transformHtml(originalHtml, {
    ampUrl: ampFile,
    ampRuntimeVersion: ampRuntimeVersion,
  });
  writeFile(allTransformationsFile, optimizedHtml);
  writeFile(validTransformationsFile, validOptimizedHtml);
  // We change the path of the original AMP file to match the new
  // amphtml link and make the canonical link point to the transformed version.
  writeFile(ampFile, originalHtml);
}
1352186
public void consolidate() {
		Decl.Module module = target.getModule();
		for(ExternalGroup group : consolidations) {
			// TODO: this could be made way more efficient by collecting all consolidate
			// units into one batch
			module.putExtern(group.consolidate());
		}
		consolidations.clear();
	}