Return the source roots for the given document.
760399
def source_roots(self, document_path):
        """"""
        files = _utils.find_parents(self._root_path, document_path, ['setup.py']) or []
        return [os.path.dirname(setup_py) for setup_py in files]
1313926
def get_roots(self):
    
    if self.__directionless:
      sys.stderr.write("ERROR: can't get roots of an undirected graph\n")
      sys.exit()
    outputids = self.__nodes.keys()
    #print outputids
    rootset  = set(outputids) -  set(self.__child_to_parent.keys())
    return [self.__nodes[x] for x in rootset]
1062658
def source_uris(self):
        """"""
        return [x.path for x in luigi.task.flatten(self.input())]
586869
def to_source(node, indentation=' ' * 4):
  """"""
  if isinstance(node, gast.AST):
    node = gast.gast_to_ast(node)
  generator = SourceWithCommentGenerator(indentation, False,
                                         astor.string_repr.pretty_string)
  generator.visit(node)
  generator.result.append('\n')
  return astor.source_repr.pretty_source(generator.result).lstrip()
662564
def getRoot():
    """"""
    root = settings.MEDIA_ROOT.replace('\\', '/')
    if not root.endswith('/'):
        root += '/'

    return path.Path(root)
1297691
def FindSourceFiles(self, node='.'):
        
        node = self.arg2nodes(node, self.fs.Entry)[0]

        sources = []
        def build_source(ss):
            for s in ss:
                if isinstance(s, SCons.Node.FS.Dir):
                    build_source(s.all_children())
                elif s.has_builder():
                    build_source(s.sources)
                elif isinstance(s.disambiguate(), SCons.Node.FS.File):
                    sources.append(s)
        build_source(node.all_children())

        def final_source(node):
            while (node != node.srcnode()):
              node = node.srcnode()
            return node
        sources = list(map( final_source, sources ));
        # remove duplicates
        return list(set(sources))
498000
def source_start(base='', book_id='book'):
    
    repo_htm_path = "{book_id}-h/{book_id}-h.htm".format(book_id=book_id)
    possible_paths = ["book.asciidoc",
                      repo_htm_path,
                      "{}-0.txt".format(book_id),
                      "{}-8.txt".format(book_id),
                      "{}.txt".format(book_id),
                      "{}-pdf.pdf".format(book_id),
                     ]

    # return the first match

    for path in possible_paths:
        fullpath = os.path.join(base, path)
        if os.path.exists(fullpath):
            return path

    return None
415055
def get_roots(app=None):
    '''
    
    '''
    roots = set()
    plugins = app.config['PLUGINS'] if app else None
    for name in ENTRYPOINTS.keys():
        for ep in iter_all(name):
            if plugins is None or ep.name in plugins:
                roots.add(ep.module_name.split('.', 1)[0])
    return list(roots)
294484
function findDataSources(connections, dataSources, cb) {
  //Just Want The Data Source IDs.
  logger.debug("findDataSources", {dataSources: dataSources});
  var dataSourceIDsToUpdate = _.map(dataSources, function(dataSourceUpdateData) {
    return dataSourceUpdateData.error ? null : dataSourceUpdateData._id;
  });

  dataSourceIDsToUpdate = _.compact(dataSourceIDsToUpdate);

  //No Valid Data Sources To Update. No Need To Search For Data Sources
  if (dataSourceIDsToUpdate.length === 0) {
    return cb(undefined, dataSourceIDsToUpdate);
  }

  var query = {

  };

  //Searching By ID. Just one mongo call to get them all. More Efficient
  query[CONSTANTS.DATA_SOURCE_ID] = {
    "$in": dataSourceIDsToUpdate
  };

  lookUpDataSources(connections, {
    query: query
  }, function(err, foundDataSources) {
    if (err) {
      logger.error("Error Finding Data Sources ", {error: err});
      return cb(buildErrorResponse({
        error: err,
        userDetail: "Unexpected Error When Searching For A Data Source",
        code: ERROR_CODES.FH_FORMS_UNEXPECTED_ERROR
      }));
    }

    //Map Found Data Source Documents
    var dsWithDocuments = _.map(dataSources, function(validDataSource) {
      var matchingDocument = _.find(foundDataSources, function(dataSourceDocument) {
        return _.isEqual(dataSourceDocument._id.toString(), validDataSource._id.toString());
      });

      //If the document is found, assign it to the object, if not, set an error
      if (matchingDocument) {
        validDataSource.document = matchingDocument;
      } else {
        validDataSource.error = buildErrorResponse({
          error: new Error("Data Source Not Found"),
          userDetail: "Data Source Not Found",
          code: ERROR_CODES.FH_FORMS_NOT_FOUND
        });
      }

      return validDataSource;
    });

    var validInvalidDataSources = updateValidAndInvalidDataSources(dsWithDocuments, []);

    logger.debug("findDataSources", {validInvalidDataSources: validInvalidDataSources});

    cb(undefined, validInvalidDataSources.valid, validInvalidDataSources.invalid);
  });
}
1227187
def get_sources(src_dir='src', ending='.cpp'):
    """"""
    return [os.path.join(src_dir, fnm) for fnm in os.listdir(src_dir) if fnm.endswith(ending)]
566393
def normalize_docroot(app, root):
    

    srcdir = app.env.srcdir
    default_version = app.config.javalink_default_version

    if isinstance(root, basestring):
        (url, base) = _parse_docroot_str(srcdir, root)
        return {'root': url, 'base': base, 'version': default_version}
    else:
        normalized = {}
        normalized['root'] = _parse_docroot_str(srcdir, root['root'])[0]

        if 'base' in root:
            normalized['base'] = _parse_docroot_str(srcdir, root['base'])[1]
        else:
            normalized['base'] = _parse_docroot_str(srcdir, root['root'])[1]

        if 'version' in root:
            normalized['version'] = root['version']
        else:
            normalized['version'] = default_version

        return normalized
146199
function getSourceNodes(sourceFile) {
    const nodes = [sourceFile];
    const result = [];
    while (nodes.length > 0) {
        const node = nodes.shift();
        if (node) {
            result.push(node);
            if (node.getChildCount(sourceFile) >= 0) {
                nodes.unshift(...node.getChildren());
            }
        }
    }
    return result;
}
596484
def roots(self):
      """"""
      return [x for x in self._nodes.values() if x.id not in self._c2p]
920133
public static function getDocumentRoot() {
    if(null === self::$docRoot) {
      self::$docRoot = System::realPath($_SERVER['DOCUMENT_ROOT']);
      if(!self::$docRoot) {
        self::$docRoot = System::realPath(getcwd());
      }
    }
    return self::$docRoot;
  }
912438
def get_root( self, key ):
        """"""
        if key not in self.roots:
            root,self.rows = load( self.filename, include_interpreter = self.include_interpreter )
            self.roots[key] = root
        return self.roots[key]
993352
function setAsRootDocument(doc) {
  rootDoc = doc;
  var window = rootDoc.defaultView;
  window.setTimeout = function(code, delay, arguments) {};
  window.setInterval = function(code, delay, arguments) {};
  anychartify(rootDoc);

  return rootDoc
}
466223
def get_xml_root(xml_file):
    """"""
    try:
        xml_root = etree.parse(os.path.expanduser(xml_file), NO_BLANKS_PARSER).getroot()
    # pylint: disable=broad-except
    except Exception as err:
        raise Dump2PolarionException("Failed to parse XML file '{}': {}".format(xml_file, err))
    return xml_root