Determine if any scripts are not on PATH and format a warning.

    Returns a warning message if one or more scripts are not on PATH,
    otherwise None.
346293
def message_about_scripts_not_on_PATH(scripts):
    # type: (Sequence[str]) -> Optional[str]
    
    if not scripts:
        return None

    # Group scripts by the path they were installed in
    grouped_by_dir = collections.defaultdict(set)  # type: Dict[str, set]
    for destfile in scripts:
        parent_dir = os.path.dirname(destfile)
        script_name = os.path.basename(destfile)
        grouped_by_dir[parent_dir].add(script_name)

    # We don't want to warn for directories that are on PATH.
    not_warn_dirs = [
        os.path.normcase(i).rstrip(os.sep) for i in
        os.environ.get("PATH", "").split(os.pathsep)
    ]
    # If an executable sits with sys.executable, we don't warn for it.
    #     This covers the case of venv invocations without activating the venv.
    executable_loc = os.environ.get("PIP_PYTHON_PATH", sys.executable)
    not_warn_dirs.append(os.path.normcase(os.path.dirname(executable_loc)))
    warn_for = {
        parent_dir: scripts for parent_dir, scripts in grouped_by_dir.items()
        if os.path.normcase(parent_dir) not in not_warn_dirs
    }
    if not warn_for:
        return None

    # Format a message
    msg_lines = []
    for parent_dir, scripts in warn_for.items():
        scripts = sorted(scripts)
        if len(scripts) == 1:
            start_text = "script {} is".format(scripts[0])
        else:
            start_text = "scripts {} are".format(
                ", ".join(scripts[:-1]) + " and " + scripts[-1]
            )

        msg_lines.append(
            "The {} installed in '{}' which is not on PATH."
            .format(start_text, parent_dir)
        )

    last_line_fmt = (
        "Consider adding {} to PATH or, if you prefer "
        "to suppress this warning, use --no-warn-script-location."
    )
    if len(msg_lines) == 1:
        msg_lines.append(last_line_fmt.format("this directory"))
    else:
        msg_lines.append(last_line_fmt.format("these directories"))

    # Returns the formatted multiline message
    return "\n".join(msg_lines)
499405
def check_directory_paths(self, *args):
        
        for path in enumerate(args):
            path = path[1]
            if path is not None:
                try:
                    self.check_directory_path(path)
                except OSError as ex:
                    logger.warn(ex)
                    raise
        return args
1100431
def ignored?(path)
      @@conf.ignore.each do |ignore|
        return true if rel_path(path).match(ignore)
      end
      return false
    end
650446
def is_not_none(self, a, message=None):
        ""
        if a is None:
            self.log_error("{} is None".format(str(a)), message)
            return False
        return True
350663
def _IsValidPath(message_descriptor, path):
  """"""
  parts = path.split('.')
  last = parts.pop()
  for name in parts:
    field = message_descriptor.fields_by_name[name]
    if (field is None or
        field.label == FieldDescriptor.LABEL_REPEATED or
        field.type != FieldDescriptor.TYPE_MESSAGE):
      return False
    message_descriptor = field.message_type
  return last in message_descriptor.fields_by_name
1222308
def is_dir(self, pathobj):
        
        try:
            stat = self.stat(pathobj)

            return stat.is_dir
        except OSError as exc:
            if exc.errno != errno.ENOENT:
                raise
            return False
107369
def _find_script(script_name):
    
    if os.path.isfile(script_name):
        return script_name
    path = os.getenv('PATH', os.defpath).split(os.pathsep)
    for dir in path:
        if dir == '':
            continue
        fn = os.path.join(dir, script_name)
        if os.path.isfile(fn):
            return fn

    print >> sys.stderr, 'Could not find script {0}'.format(script_name)
    raise SystemExit(1)
326499
def search_script_directory(self, path):
        
        for subdir, dirs, files in os.walk(path):
            for file_name in files:
                if file_name.endswith(".py"):
                    self.search_script_file(subdir, file_name)
22312
def file_is_present(self, file_path):
        
        p = self.p(file_path)
        if not os.path.exists(p):
            return False
        if not os.path.isfile(p):
            raise IOError("%s is not a file" % file_path)
        return True
535530
def _is_path(s):
    """"""
    if isinstance(s, string_types):
        try:
            return op.exists(s)
        except (OSError, ValueError):
            return False
    else:
        return False
20707
def path_is_ignored(self, path):
        
        try:
            self.run('check-ignore', '--quiet', path)
        except CommandError as e:
            if e.retcode == 1:
                # path is ignored
                return False
            else:
                # fatal error
                raise e
        return True
1077790
def __validate_and_fix_path(path, check_file=False, check_dir=False):
    """"""
    # pylint: disable=superfluous-parens
    if path is None:
        return path
    else:
        if not (os.path.isfile(path) if check_file else False) \
                and not (os.path.isdir(path) if check_dir else False):
            raise SystemExit('Path `%s` does not exist' % path)
        if not os.path.isabs(path):
            path = os.path.abspath(os.path.join(os.path.abspath(os.curdir), path))

    return path
600063
def _PrintWarningsDetails(self, storage):
    
    if not storage.HasWarnings():
      self._output_writer.Write('No warnings stored.\n\n')
      return

    for index, warning in enumerate(storage.GetWarnings()):
      title = 'Warning: {0:d}'.format(index)
      table_view = views.ViewsFactory.GetTableView(
          self._views_format_type, title=title)

      table_view.AddRow(['Message', warning.message])
      table_view.AddRow(['Parser chain', warning.parser_chain])

      path_specification = warning.path_spec.comparable
      for path_index, line in enumerate(path_specification.split('\n')):
        if not line:
          continue

        if path_index == 0:
          table_view.AddRow(['Path specification', line])
        else:
          table_view.AddRow(['', line])

      table_view.Write(self._output_writer)
665604
function(paths) {
			var base = Script.current(this).absolute;
			each(paths, function(item, index) {
				var path = paths[index] = URL.absolute(URL.clean(item), base);
				if (path[path.length - 1] !== '/') {
					paths[index] += '/';
				}
			});
			return paths;
		}
658844
def check(self):
        

        #for path in self.path.values():
        #    if not os.path.exists(path):
        #        raise RuntimeError("File '{}' is missing".format(path))

        for tool in ('cd-hit', 'prank', 'hmmbuild', 'hmmpress', 'hmmscan', 'phmmer', 'mafft', 'meme'):
            if not self.pathfinder.exists(tool):
                raise RuntimeError("Dependency {} is missing".format(tool))
988258
def not_found(res, path)
      path = ::Rack::Utils.escape_html(path)
      res.status = 404
      res.write "<html><head></head><body><h1>File Not Found</h1><p>#{path}</p></body></html>"
      res.finish
    end
1324446
def inform_if_paths_invalid(egrc_path, examples_dir, custom_dir, debug=True):
    
    if (not debug):
        return

    if (egrc_path):
        _inform_if_path_does_not_exist(egrc_path)

    if (examples_dir):
        _inform_if_path_does_not_exist(examples_dir)

    if (custom_dir):
        _inform_if_path_does_not_exist(custom_dir)