**Handled first** - Set up path variables here and returns them.
540410
function check(directory, options) {
  var deferred = q.defer();

  var dir = path.resolve(process.cwd(), directory);
  util.info("\nSetting up in %s%s%s:", c.bldcyn, dir, c.txtrst);

  // **data**: All the markdown / yaml files.
  var dataPath =  path.resolve(dir, options.templates || "data");
  // **template**: All the Pug files.
  var templatePath =  path.resolve(dir, options.templates || "templates");
  // **output**: Static directory that includes HTML files.
  var outputPath =  path.resolve(dir, options.output || "public");
  // **css/js**: Additional directories that are created in the output directory.
  var cssPath =  path.resolve(dir, options.output || "public", "css");
  var jsPath =  path.resolve(dir, options.output || "public", "js");

  util.info("  %s%s", c.bldwht, dir); // Markade root directory
  util.info("  %s%s", c.bldwht, dataPath);
  util.info("  %s%s", c.bldwht, templatePath);
  util.info("  %s%s", c.bldwht, outputPath);
  util.info("  %s%s", c.bldwht, cssPath);
  util.info("  %s%s%s", c.bldwht, jsPath, c.txtrst);

  var json = {
    data: dataPath,
    template: templatePath,
    output: outputPath,
    css: cssPath,
    js: jsPath,
    root: dir
  };

  // And a confirmation is asked in the command line.
  rl.question("\n» Is that okay? ["+c.bldylw+"yes"+c.txtrst+"] " , function(answer) {
    if (answer == "y" || answer == "yes" || answer == "sure" || answer == "yup")
      deferred.resolve(json);
    else if (typeof answer == "undefined" || answer.length === 0)
      deferred.resolve(json);
    else {
      deferred.reject(false);
    }
  });

  return deferred.promise;
}
711881
def get_handle(self, filepath):
        
        localpath = self._get_localpath(filepath)
        return self._cache[localpath]
1064071
function processControllerHandlers() {
  var self = this;
  var jsFile = this.regex.jsFile;
  var handlersPath = this.mvcpath + 'handlers';
  var relPath = self.relPath(this.mvcpath) + 'handlers';
  
  if (fs.existsSync(handlersPath)) {
    
    fs.readdirSync(handlersPath).forEach(function(dirname) {
      var dir = handlersPath + '/' + dirname;
      var stat = fs.statSync(dir);
      
      if (stat.isDirectory(dir)) {
        
        var handlers = self.handlers[dirname] = {};
        
        fileModule.walkSync(dir, function(dirPath, dirs, files) {
          for (var path,hkey,callback,file,i=0; i < files.length; i++) {
            file = files[i];
            path = dirPath + '/' + file;
            hkey = self.relPath(path, pathModule.basename(self.mvcpath) + '/handlers/' + dirname);
            if (jsFile.test(file)) {
              callback = protos.require(path, true); // Don't use module cache (allow reloading)
              if (callback instanceof Function) {
                handlers[hkey] = callback;
              } else {
                throw new Error(util.format("Expected a function for handler: %s/%s", dirname, file));
              }
            }
          }
        });
        
      }
      
    });
    
  }
  
  this.emit('handlers_loaded', self.handlers); // Emit regardless
  
}
1270691
def prepend_path_variable_command(variable, paths):
    
    assert isinstance(variable, basestring)
    assert is_iterable_typed(paths, basestring)
    return path_variable_setting_command(
        variable, paths + [expand_variable(variable)])
948453
private static String getHandler(HttpServletRequest request) {
    String pathInfo = request.getPathInfo();
    return pathInfo == null ? "" : pathInfo.substring(1);
  }
1115332
function pathParamMiddleware (req, res, next, value, name) {
    if (req.pathParams) {
      // Path parameters have already been parsed by
      req.params[name] = req.pathParams[name] || req.params[name];
    }

    next();
  }
1264401
def mkdir(name, path):
    '''
    '''
    with Session() as session:
        try:
            session.VFolder(name).mkdir(path)
            print_done('Done.')
        except Exception as e:
            print_error(e)
            sys.exit(1)
614943
public void handle(String pathInContext,
                       String pathParams,
                       HttpRequest httpRequest,
                       HttpResponse httpResponse)
         throws IOException
    {
        if (!isStarted())
            return;
        
        // Handle TRACE
        if (HttpRequest.__TRACE.equals(httpRequest.getMethod()))
        {
            handleTrace(httpRequest,httpResponse);
            return;
        }

        // Look for existing request/response objects (from enterScope call)
        ServletHttpRequest request = (ServletHttpRequest) httpRequest.getWrapper();
        ServletHttpResponse response = (ServletHttpResponse) httpResponse.getWrapper();
        if (request==null)
        {
            // Not in ServletHttpContext, but bumble on anyway
            request = new ServletHttpRequest(this,pathInContext,httpRequest);
            response = new ServletHttpResponse(request,httpResponse);
            httpRequest.setWrapper(request);
            httpResponse.setWrapper(response);
        }
        else
        {
            request.recycle(this,pathInContext);
            response.recycle();
        }
        
        // Look for the servlet
        Map.Entry servlet=getHolderEntry(pathInContext);
        ServletHolder servletHolder=servlet==null?null:(ServletHolder)servlet.getValue();
        if(log.isDebugEnabled())log.debug("servlet="+servlet);
            
        try
        {
            // Adjust request paths
            if (servlet!=null)
            {
                String servletPathSpec=(String)servlet.getKey(); 
                request.setServletPaths(PathMap.pathMatch(servletPathSpec,pathInContext),
                                        PathMap.pathInfo(servletPathSpec,pathInContext),
                                        servletHolder);
            }
            
            // Handle the session ID
            request.setRequestedSessionId(pathParams);
            HttpSession session=request.getSession(false);
            if (session!=null)
                ((SessionManager.Session)session).access();
            if(log.isDebugEnabled())log.debug("session="+session);
            
            // Do that funky filter and servlet thang!
            if (servletHolder!=null)
                dispatch(pathInContext,request,response,servletHolder, Dispatcher.__REQUEST);
        }
        catch(Exception e)
        {
            log.debug(LogSupport.EXCEPTION,e);
            
            Throwable th=e;
            while (th instanceof ServletException)
            {
                log.warn(LogSupport.EXCEPTION, th);
                Throwable cause=((ServletException)th).getRootCause();
                if (cause==th || cause==null)
                    break;
                th=cause;
            }
            
            if (th instanceof HttpException)
                throw (HttpException)th;
            if (th instanceof EOFException)
                throw (IOException)th;
            else if (log.isDebugEnabled() || !( th instanceof java.io.IOException))
            {
                if (_contextLog!=null)
                {
                    if (th instanceof RuntimeException) 
                        _contextLog.error(httpRequest.getURI()+": ",th);
                    else
                        _contextLog.warn(httpRequest.getURI()+": ",th);
                }
                
                if(log.isDebugEnabled())
                {
                    if (th instanceof RuntimeException) 
                        log.error(httpRequest.getURI()+": ",th);
                    else
                        log.warn(httpRequest.getURI()+": ",th);
                    log.debug(httpRequest);
                }
            }
            
            httpResponse.getHttpConnection().forceClose();
            if (!httpResponse.isCommitted())
            {
                request.setAttribute(ServletHandler.__J_S_ERROR_EXCEPTION_TYPE,th.getClass());
                request.setAttribute(ServletHandler.__J_S_ERROR_EXCEPTION,th);
                if (th instanceof UnavailableException)
                {
                    UnavailableException ue = (UnavailableException)th;
                    if (ue.isPermanent())
                        response.sendError(HttpResponse.__404_Not_Found,e.getMessage());
                    else
                        response.sendError(HttpResponse.__503_Service_Unavailable,e.getMessage());
                }
                else
                    response.sendError(HttpResponse.__500_Internal_Server_Error,e.getMessage());
            }
            else
                if(log.isDebugEnabled())log.debug("Response already committed for handling "+th);
        }
        catch(Error e)
        {   
            log.warn("Error for "+httpRequest.getURI(),e);
            if(log.isDebugEnabled())log.debug(httpRequest);
            
            httpResponse.getHttpConnection().forceClose();
            if (!httpResponse.isCommitted())
            {
                request.setAttribute(ServletHandler.__J_S_ERROR_EXCEPTION_TYPE,e.getClass());
                request.setAttribute(ServletHandler.__J_S_ERROR_EXCEPTION,e);
                response.sendError(HttpResponse.__500_Internal_Server_Error,
                                   e.getMessage());
            }
            else
                if(log.isDebugEnabled())log.debug("Response already committed for handling ",e);
        }
        finally
        {
            if (servletHolder!=null && response!=null)
            {
                response.complete();
            }
        }
    }
1263184
public void handle(String pathInContext,
                       String pathParams,
                       HttpRequest request,
                       HttpResponse response)
            throws HttpException,IOException
    {
        String user=null;
        String password=null;
        boolean IPValid=true;

        if(log.isDebugEnabled())log.debug("HTAccessHandler pathInContext="+pathInContext);

        String credentials=request.getField(HttpFields.__Authorization);

        if (credentials!=null)
        {
            credentials=credentials.substring(credentials.indexOf(' ')+1);
            credentials=B64Code.decode(credentials,StringUtil.__ISO_8859_1);
            int i=credentials.indexOf(':');
            user=credentials.substring(0,i);
            password=credentials.substring(i+1);

            if(log.isDebugEnabled())log.debug("User="+user+", password="+
                    "******************************".substring(0,password.length()));
        }

        HTAccess ht=null;

        try
        {
            Resource resource=null;
            String directory=pathInContext.endsWith("/")
                    ?pathInContext:
                    URI.parentPath(pathInContext);

            // Look for htAccess resource
            while (directory!=null)
            {
                String htPath=directory+_accessFile;
                resource=getHttpContext().getResource(htPath);
                if(log.isDebugEnabled())log.debug("directory="+directory+" resource="+resource);

                if (resource!=null && resource.exists() && !resource.isDirectory())
                    break;
                resource=null;
                directory=URI.parentPath(directory);
            }

            // Try default directory
            if (resource==null && _default!=null)
            {
                resource=Resource.newResource(_default);
                if (!resource.exists() || resource.isDirectory())
                    return;
            }
            if (resource==null)
                return;

            if(log.isDebugEnabled())log.debug("HTACCESS="+resource);

            ht=(HTAccess)_htCache.get(resource);
            if (ht==null || ht.getLastModified()!=resource.lastModified())
            {
                ht=new HTAccess(resource);
                _htCache.put(resource,ht);
                if(log.isDebugEnabled())log.debug("HTCache loaded "+ht);
            }

            // prevent access to htaccess files
            if (pathInContext.endsWith(_accessFile))
            {
                response.sendError(HttpResponse.__403_Forbidden);
                request.setHandled(true);
                return;
            }

            // See if there is a config problem
            if (ht.isForbidden())
            {
                log.warn("Mis-configured htaccess: "+ht);
                response.sendError(HttpResponse.__403_Forbidden);
                request.setHandled(true);
                return;
            }

            //first see if we need to handle based on method type
            Map methods=ht.getMethods();
            if (methods.size()>0 && !methods.containsKey(request.getMethod()))
                return; //Nothing to check

            // Check the accesss
            int satisfy=ht.getSatisfy();

            // second check IP address
            IPValid=ht.checkAccess("",request.getRemoteAddr());
            if(log.isDebugEnabled())log.debug("IPValid = "+IPValid);

            // If IP is correct and satify is ANY then access is allowed
            if (IPValid==true && satisfy==HTAccess.ANY)
                return;

            // If IP is NOT correct and satify is ALL then access is forbidden
            if (IPValid==false && satisfy==HTAccess.ALL)
            {
                response.sendError(HttpResponse.__403_Forbidden);
                request.setHandled(true);
                return;
            }

            // set required page
            if (!ht.checkAuth(user,password,getHttpContext(),request))
            {
                log.debug("Auth Failed");
                response.setField(HttpFields.__WwwAuthenticate,"basic realm="+ht.getName());
                response.sendError(HttpResponse.__401_Unauthorized);
                response.commit();
                request.setHandled(true);
                return;
            }

            // set user
            if (user!=null)
            {
                request.setAuthType(SecurityConstraint.__BASIC_AUTH);
                request.setAuthUser(user);
            }

        }
        catch (Exception ex)
        {
            log.warn(LogSupport.EXCEPTION,ex);
            if (ht!=null)
            {
                response.sendError(HttpResponse.__500_Internal_Server_Error);
                request.setHandled(true);
            }
        }
    }
110939
def init_path():
    
    sitedirs = getsyssitepackages()
    for sitedir in sitedirs:
        env_path = os.environ['PATH'].split(os.pathsep)
        for module in allowed_modules:
            p = join(sitedir, module)
            if isdir(p) and not p in env_path:
                os.environ['PATH'] += env_t(os.pathsep + p)
484069
public void handle(String pathInContext, String pathParams, HttpRequest httpRequest, HttpResponse httpResponse)
        throws HttpException, IOException
    {
        if (!isStarted())
            return;
        try
        {
            super.handle(pathInContext, pathParams, httpRequest, httpResponse);
        }
        finally
        {
            if (!httpRequest.isHandled())
                httpResponse.sendError(HttpResponse.__404_Not_Found);
            httpRequest.setHandled(true);
            if (!httpResponse.isCommitted())
            {
                httpResponse.completing();
                httpResponse.commit();
            }
        }
    }
1338657
def setup_backtrace_cleaner_path
      return unless Rails.backtrace_cleaner.instance_variable_get(:@root) == '/'
      Rails.backtrace_cleaner.instance_variable_set :@root, Rails.root.to_s
    end
501154
public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException, IOException
    {
    }
555011
public static void get(@NotNull String path, @NotNull Handler handler) {
        staticInstance().get(prefixPath(path), handler);
    }
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__)))
1145122
private void setupPaths() {
    sourcePath = processingEnv.getOptions().get(OPT_SOURCEPATH);
    classPath = processingEnv.getOptions().get(OPT_CLASSPATH);
    outputDirectory = processingEnv.getOptions().get(OPT_CLASSOUTPUT);

    /*
     * Not using instanceof here because than in every case the JVM
     * tries to load the JavacProcessingEnvironment-class file which,
     * for instance, is not possible with an IBM JVM.
     *
     * TODO(lenh): This may not work; use reflection call instead.
     */
    if (processingEnv.getClass().getName().equals(
            "com.sun.tools.javac.processing.JavacProcessingEnvironment")) {
      JavacProcessingEnvironment javacEnv =
          (JavacProcessingEnvironment) processingEnv;
      Options options = Options.instance(javacEnv.getContext());

      if (sourcePath == null) {
        sourcePath = options.get(OptionName.SOURCEPATH);
      }

      if (classPath == null) {
        String classPath1 = options.get(OptionName.CP);
        String classPath2 = options.get(OptionName.CLASSPATH);
        if (classPath1 != null) {
          if (classPath2 != null) {
            classPath = classPath1 + File.pathSeparator + classPath2;
          } else {
            classPath = classPath1;
          }
        } else {
          classPath = classPath2;
        }
      }

      if (outputDirectory == null) {
        outputDirectory = options.get(OptionName.D);
      }
    }
  }
1014399
def path_for(self, handler, **kwargs):
        
        if type(handler) is not str:
            handler = handler.__qualname__
        if handler not in self.__reversedidx__:
            return None
        pattern = self.__reversedidx__[handler].pattern.lstrip('^').rstrip('$')
        path = self.param_macher.sub(lambda m: str(kwargs.pop(m.group(1))),
                                     pattern)
        if kwargs:
            path = "%s?%s" % (path, parse.urlencode(kwargs))
        return path