Set custom paths if necessary
334804
def __update_paths(self, settings):
        
        if not isinstance(settings, dict):
            return

        if 'custom_base_path' in settings:
            base_path = settings['custom_base_path']
            base_path = join(dirname(__file__), base_path)
            self.__load_paths(base_path)
490039
def _fixpath(self, p):
        """"""
        return os.path.abspath(os.path.expanduser(p))
744563
def hard_path(path, prefix_dir):
    """"""
    relative = abspath("%s/%s" % (prefix_dir, path))
    a_path = abspath(path)
    if os.path.exists(relative):
        LOG.debug("using relative path %s (%s)", relative, path)
        return relative

    LOG.debug("using absolute path %s", a_path)
    return a_path
830853
private static void setupPaths( PathsType paths) {
        File voltDbRoot;
        // Handles default voltdbroot (and completely missing "paths" element).
        voltDbRoot = getVoltDbRoot(paths);
        //Snapshot
        setupSnapshotPaths(paths.getSnapshots(), voltDbRoot);
        //export overflow
        setupExportOverflow(paths.getExportoverflow(), voltDbRoot);
        // only use these directories in the enterprise version
        setupCommandLog(paths.getCommandlog(), voltDbRoot);
        setupCommandLogSnapshot(paths.getCommandlogsnapshot(), voltDbRoot);
        setupDROverflow(paths.getDroverflow(), voltDbRoot);
        setupLargeQuerySwap(paths.getLargequeryswap(), voltDbRoot);
    }
1071736
def setup_versioned_routes(routes, version=None):
    """"""
    prefix = '/' + version if version else ""
    for r in routes:
        path, method = r
        route(prefix + path, method, routes[r])
173335
def set(self, paths: Union[str, Iterable[str]], access_controls: Union[AccessControl, Iterable[AccessControl]]):
        
1030166
def _fix_path():
  """"""
  import os
  import sys
  all_paths = os.environ.get('PYTHONPATH').split(os.pathsep)
  for path_dir in all_paths:
    dev_appserver_path = os.path.join(path_dir, 'dev_appserver.py')
    if os.path.exists(dev_appserver_path):
      logging.debug('Found appengine SDK on path!')
      google_appengine = os.path.dirname(os.path.realpath(dev_appserver_path))
      sys.path.append(google_appengine)
      # Use the next import will fix up sys.path even further to bring in
      # any dependent lib directories that the SDK needs.
      dev_appserver = __import__('dev_appserver')
      sys.path.extend(dev_appserver.EXTRA_PATHS)
      return
1334757
def _SetupPaths():
  """"""
  sdk_path = _FindSdkPath()
  if sdk_path:
    sys.path.append(sdk_path)
    try:
      import dev_appserver  # pylint: disable=g-import-not-at-top
      if hasattr(dev_appserver, 'fix_sys_path'):
        dev_appserver.fix_sys_path()
      else:
        logging.warning(_NO_FIX_SYS_PATH_WARNING)
    except ImportError:
      logging.warning(_IMPORT_ERROR_WARNING)
  else:
    logging.warning(_NOT_FOUND_WARNING)

  # Add the path above this directory, so we can import the endpoints package
  # from the user's app code (rather than from another, possibly outdated SDK).
  # pylint: disable=g-import-not-at-top
  from google.appengine.ext import vendor
  vendor.add(os.path.dirname(os.path.dirname(__file__)))
527762
def setFilepaths(self, filepaths):
        
        self.setFilepath(os.path.pathsep.join(filepaths))
769407
protected function setPathPrefix()
    {
        if ($this->media->local_root) {
            // Interpolate path
            $root = $this->media->getInterpolator()
                ->interpolate($this->media->local_root);

            // Set path
            $this->filesystem->getDriver()
                ->getAdapter()
                ->setPathPrefix($root);
        }
    }
982151
public function setPaths($paths)
    {
        $this->paths = $paths;
        self::$pathsMap[$this->namespace] = $this->paths;
    }
204716
protected function setDefaults()
  {
    $this->importPaths = array();
    $this->pluginPaths = array();
    $this->sourceMap = self::DEFAULT_SOURCEMAP;
    $this->mapComment = self::DEFAULT_MAPCOMMENT;
    $this->lineNumbers = self::DEFAULT_LINENUMBERS;
    $this->precision = self::DEFAULT_PRECISION;
    $this->style = self::DEFAULT_STYLE;
  }
1145163
def set_path(self, data, path, value):
        
        self.say('set_path:value:' + str(value) +
                 ' at:' + str(path) + ' in:' + str(data))

        if isinstance(path, str):
            path = path.split('.')
        if len(path) > 1:
            self.set_path(data.setdefault(path[0], {}), path[1:], value)
        else:
            data[path[0]] = value
        return data
507332
private function normalizePaths()
    {
        foreach ($this->paths as $key => $path) {
            $this->paths[$key] = $this->normalizePath($path);
        }
    }
1269360
protected function configureIncludePaths()
    {
        // get ini include path and split it to an array
        $iniIncludePaths = explode(PATH_SEPARATOR, ini_get('include_path'));

        // default entry
        $includePathsDoozr = '.';

        // build Doozr include paths
        foreach (self::$path as $path) {
            $includePathsDoozr .= self::buildPath($path);
        }

        if (!empty($iniIncludePaths)) {
            foreach ($iniIncludePaths as $iniIncludePath) {
                // If '.' or existing path -> do not attach twice
                if (in_array($iniIncludePath, self::$path) || trim($iniIncludePath) == '.') {
                    continue;
                }

                $includePathsDoozr .= self::buildPath($iniIncludePath);
            }
        }

        // Now try to set the ini value include_path
        ini_set('include_path', $includePathsDoozr);

        return $this;
    }
1266803
function setDeveloperRoutes( app, filingCabinet, paths, develop ) {

  // Create document template for resources.
  var head = '\n' +
    '  <link rel="stylesheet" href="' + develop.cssBootstrap + '" />\n' +
    '  <link rel="stylesheet" href="' + develop.cssHighlight + '">\n';
  var foot = '\n' +
    '  <script src="' + develop.jsJQuery + '"></script>\n' +
    '  <script src="' + develop.jsBootstrap + '"></script>\n' +
    '  <script src="' + develop.jsHighlight + '"></script>\n' +
    '  <script>hljs.initHighlightingOnLoad();</script>\n';

  function wrap( title, body ) {
    return '<html>\n<head>' + head + '</head>\n<style>\n' + css + '\n</style>\n\n' +
      '<h1>' + title + '</h1>\n' +
      '<p><i>' + pkgInfo.name + ' v' + pkgInfo.version + '</i></p>\n' +
      body + foot + '\n</body>\n</html>\n';
  }

  // Set up developer paths.
  PATH.init( paths.develop );

  // Developer home page.
  app.get( PATH.root, function ( req, res ) {
    res.status( 200 ).send( wrap( 'Resources',
      '<ul>\n' +
      '  <li><a href="' + PATH.list.languages + '">Languages</a></li>\n' +
      '  <li><a href="' + PATH.list.documents + '">Documents</a></li>\n' +
      '  <li><a href="' + PATH.list.layouts + '">Layouts</a></li>\n' +
      '  <li><a href="' + PATH.list.segments + '">Segments</a></li>\n' +
      '  <li><a href="' + PATH.list.contents + '">Contents</a></li>\n' +
      '  <li><a href="' + PATH.list.menus + '">Menus</a></li>\n' +
      '  <li><a href="' + PATH.list.locales + '">Locales</a></li>\n' +
      '  <li><a href="' + PATH.list.references + '">References</a></li>\n' +
      '  <li><a href="' + PATH.list.controls + '">Controls</a></li>\n' +
      '</ul>\n' +
      '<p><a class="btn btn-success" href="/">Go to site</a></p>\n'
    ) );
  } );
  logger.routeAdded( PATH.root );

  // Lists all languages.
  app.get( PATH.list.languages, function ( req, res ) {
    res.status( 200 ).send( wrap( 'Languages',
      filingCabinet.listLanguages() +
      backToRoot() ) );
  } );
  logger.routeAdded( PATH.list.languages );

  // Lists all documents.
  app.get( PATH.list.documents, function ( req, res ) {
    res.status( 200 ).send( wrap( 'Documents',
      filingCabinet.documents.list( PATH.show.document ) +
      backToRoot() ) );
  } );
  logger.routeAdded( PATH.list.documents );

  // Display a document.
  app.get( PATH.show.document + '/:key', function ( req, res ) {
    var key = PATH.unsafe( req.params[ 'key' ] );
    res.status( 200 ).send( wrap( 'Document: ' + show( key ),
      filingCabinet.documents.show( key ) +
      backTo( PATH.list.documents ) ) );
  } );
  logger.routeAdded( PATH.show.document );

  // Lists all layouts.
  app.get( PATH.list.layouts, function ( req, res ) {
    res.status( 200 ).send( wrap( 'Layouts',
      filingCabinet.layouts.list( PATH.show.layout ) +
      backToRoot() ) );
  } );
  logger.routeAdded( PATH.list.layouts );

  // Display a layout.
  app.get( PATH.show.layout + '/:key', function ( req, res ) {
    var key = PATH.unsafe( req.params[ 'key' ] );
    res.status( 200 ).send( wrap( 'Layout: ' + show( key ),
      filingCabinet.layouts.show( key ) +
      backTo( PATH.list.layouts ) ) );
  } );
  logger.routeAdded( PATH.show.layout );

  // Lists all segments.
  app.get( PATH.list.segments, function ( req, res ) {
    res.status( 200 ).send( wrap( 'Segments',
      filingCabinet.segments.list( PATH.show.segment ) +
      backToRoot() ) );
  } );
  logger.routeAdded( PATH.list.segments );

  // Display a segment.
  app.get( PATH.show.segment + '/:key', function ( req, res ) {
    var key = PATH.unsafe( req.params[ 'key' ] );
    res.status( 200 ).send( wrap( 'Segment: ' + show( key ),
      filingCabinet.segments.show( key ) +
      backTo( PATH.list.segments ) ) );
  } );
  logger.routeAdded( PATH.show.segment );

  // Lists all contents.
  app.get( PATH.list.contents, function ( req, res ) {
    res.status( 200 ).send( wrap( 'Contents',
      filingCabinet.contents.list( PATH.show.content ) +
      backToRoot() ) );
  } );
  logger.routeAdded( PATH.list.contents );

  // Display a content.
  app.get( PATH.show.content + '/:language/:key', function ( req, res ) {
    var language = req.params[ 'language' ];
    var key = PATH.unsafe( req.params[ 'key' ] );
    res.status( 200 ).send( wrap( 'Content: ' + show( key ),
      filingCabinet.contents.show( language, key ) +
      backTo( PATH.list.contents ) ) );
  } );
  logger.routeAdded( PATH.show.content );

  // Lists all menus.
  app.get( PATH.list.menus, function ( req, res ) {
    res.status( 200 ).send( wrap( 'Menus',
      filingCabinet.menus.list( PATH.show.menu ) +
      backToRoot() ) );
  } );
  logger.routeAdded( PATH.list.menus );

  // Display a menu.
  app.get( PATH.show.menu + '/:language/:key', function ( req, res ) {
    var language = req.params[ 'language' ];
    var key = req.params[ 'key' ];
    var result = filingCabinet.menus.show( language, +key );
    res.status( 200 ).send( wrap( 'Menu: ' + show( result.title ),
      result.list +
      backTo( PATH.list.menus ) ) );
  } );
  logger.routeAdded( PATH.show.menu );

  // Lists all locales.
  app.get( PATH.list.locales, function ( req, res ) {
    res.status( 200 ).send( wrap( 'Locales',
      filingCabinet.locales.list( filingCabinet.languages ) +
      backToRoot() ) );
  } );
  logger.routeAdded( PATH.list.locales );

  // Lists all references.
  app.get( PATH.list.references, function ( req, res ) {
    res.status( 200 ).send( wrap( 'References',
      filingCabinet.references.list( PATH.show.reference ) +
      backToRoot() ) );
  } );
  logger.routeAdded( PATH.list.references );

  // Display a reference.
  app.get( PATH.show.reference + '/:key', function ( req, res ) {
    var key = PATH.unsafe( req.params[ 'key' ] );
    res.status( 200 ).send( wrap( 'Reference: ' + show( key ),
      filingCabinet.references.show( key ) +
      backTo( PATH.list.references ) ) );
  } );
  logger.routeAdded( PATH.show.reference );

  // Lists all controls.
  app.get( PATH.list.controls, function ( req, res ) {
    res.status( 200 ).send( wrap( 'Controls',
      filingCabinet.controls.list( PATH.show.control ) +
      backToRoot() ) );
  } );
  logger.routeAdded( PATH.list.controls );

  // Display a control.
  app.get( PATH.show.control + '/:key', function ( req, res ) {
    var key = PATH.unsafe( req.params[ 'key' ] );
    res.status( 200 ).send( wrap( 'Control: ' + show( key ),
      filingCabinet.controls.show( key ) +
      backTo( PATH.list.controls ) ) );
  } );
  logger.routeAdded( PATH.show.control );
}
730892
def _expand_paths(self, paths):
        """"""
        paths = ninja_syntax.as_list(paths)
        return ' '.join(map(self._shell_escape, (map(self._expand, paths))))