checks to see if the given path is the current page/link
 Params:
 +path+:: rake path of the link you want to check
771033
def cp(path, term_check = false)
      return "active" if term_check && request.url.include?('terms')
      return "active" if current_page?(path)
    end
756134
def _CheckIsLink(self, file_entry):
    
    if definitions.FILE_ENTRY_TYPE_LINK not in self._file_entry_types:
      return False
    return file_entry.IsLink()
1189302
function _checkPath (npmPath) {
  return new Promise((resolve, reject) => {
    if (npmPath) {
      fs.lstat(npmPath, (err, stats) => {
        if (err || !stats || (stats.isDirectory && !stats.isDirectory())) {
          reject(new Error(strings.givenPathNotValid(npmPath)))
        } else {
          resolve({
            path: npmPath,
            message: strings.givenPathValid(npmPath)
          })
        }
      })
    } else {
      reject(new Error('Called _checkPath() with insufficient parameters'))
    }
  })
}
647243
function isAnchor(href) {
    try {
        var parsed = url.parse(href);
        return !!(!parsed.protocol && !parsed.path && parsed.hash);
    } catch(err) {
        return false;
    }
}
486875
function _isValid(el, currentPath) {
	// Link has no destination URL
	if (! el.href) { return false; }

	// Link opens a new browser window
	if (el.target === '_blank') { return false; }

	// Link is not absolute URL
	if (! /https?:/.test(el.href)) { return false; }

	// Link is a download
	if (el.hasAttribute('download')) { return false; }

	// Link is supposed to be ignored
	if (el.hasAttribute('data-static')) { return false; }

	// Link is external URL
	if (el.host && el.host !== location.host) { return false; }

	// Link is current page, but with a hash added
	if (el.hash && el.pathname === currentPath) { return false; }

	return true;
}
912266
def search_path_by_state_link(state)
      path = search_path_by(resource_type: params.dig(:filter, :resource_type), space_state: state)
      is_active = params.dig(:filter, :space_state).to_s == state.to_s

      link_to path, class: "order-by__tab#{" is-active" if is_active}" do
        content_tag(:strong, t(state || :all, scope: "decidim.searches.filters.state"))
      end
    end
992516
def rake_require(file_name, paths=$LOAD_PATH, loaded=$")
      fn = file_name + ".rake"
      return false if loaded.include?(fn)
      paths.each do |path|
        full_path = File.join(path, fn)
        if File.exist?(full_path)
          Rake.load_rakefile(full_path)
          loaded << fn
          return true
        end
      end
      fail LoadError, "Can't find #{file_name}"
    end
1115984
def find_by_permalink!(permalink)
      result = scoped_by_permalink(permalink).first
      raise ActiveRecord::RecordNotFound.new "Could not find Content for Permalink id=#{permalink.id}" if result.nil?
      result
    end
980653
def check_path_consistency(self, resource):
        ''''''
        msg = ('Method "{}" path variables {}) do not conform with the '
               'resource subpath declaration ({}).')
        errors = []
        # If subpath is not set, it will be detected by another checker
        if resource.subpath is None:
            return errors
        declared = sorted(self.path_params_regex.findall(resource.subpath))
        for callback in resource.callbacks:
            actual = sorted(utils.filter_annotations_by_ptype(
                callback, Ptypes.path))
            if declared == actual:
                continue
            errors.append(msg.format(
                '{}.{}'.format(resource.__name__, callback.__name__),
                actual, resource.subpath))
        return errors
525896
def browse(self, path=None):
        
        params = None
        if path:
            assert isinstance(path, string_types)
            params = {'current': path}
        return self.get('browse', params=params)
925848
def path_exists(self, path, follow_symlinks=True):
        ""
        return (
            self.file_exists(path, follow_symlinks)
            or self.symlink_exists(path, follow_symlinks)
            or self.directory_exists(path, follow_symlinks)
        )
634462
def check_subdirectory(subpath)
      subdirectory = File.join(path, subpath)
      subdirectory if File.directory?(subdirectory)
    end
78421
def has_in_url_path(url, subs):
    """"""
    scheme, netloc, path, query, fragment = urlparse.urlsplit(url)
    return any([sub in path for sub in subs])
1079722
def check_path(file_path):
    '''
        
    '''
    directory = os.path.dirname(file_path)
    if directory != '':
        if not os.path.exists(directory):
            os.makedirs(directory, 0o775)
507699
def handcart_show_path(handcart)
      if Handcart.handcart_show_path.present?
        # Load it straight from the config
        "/#{Handcart.handcart_show_path}/#{handcart.to_param}"
      else
        if Rails.application.routes.url_helpers.respond_to?("#{Handcart.handcart_class.model_name.singular}_path".to_sym)
          # Is there one already defined
          Rails.application.routes.url_helpers.send("#{Handcart.handcart_class.model_name.singular}_path", handcart.to_param)
        else
          # Shot in the dark
          "/#{Handcart.handcart_class.model_name.route_key}/#{handcart.to_param}"
        end
      end
    end
4815
def get_path_url(path, relative=False):
    
    if relative:
        return os.path.relpath(path)
    else:
        return 'file://%s' % os.path.abspath(path)
1114316
def _parse_path(self, path):
        
        paths = path.split('/')
        current_path = paths[0]
        for p in paths[1:]:
            current_path = "{}/{}".format(current_path, p)
            if not self.map.get(current_path): # Create any folders that might not exist yet
                self._commit(current_path, p)