Check if given path is active for current item
540370
def is_active(self, path):
        """"""
        if self.url == '/' and self.url == path:
            return True
        elif self.url == '/':
            return False

        if self.url and path.startswith(self.url):
            return True

        if self.active_regex and re.compile(self.active_regex).match(path):
            return True

        for child in self.childs:
            if child.is_active(path):
                return True
        return False
519445
def is_active(self):
    """"""
    if self._db_connection_provider:
      # The plugin is active if one relevant tag can be found in the database.
      db = self._db_connection_provider()
      cursor = db.execute('''
        SELECT
          1
        FROM Tags
        WHERE Tags.plugin_name = ?
        LIMIT 1
      ''', (metadata.PLUGIN_NAME,))
      return bool(list(cursor))

    return bool(self._multiplexer) and any(self.index_impl().values())
1316007
def has_files(the_path):
    """"""
    the_path = Path(the_path)
    try:
        for _ in the_path.walkfiles():
            return True
        return False
    except OSError as ex:
        if ex.errno == errno.ENOENT:
            # ignore
            return False
        else:
            raise
1264650
def findByPath(self, rel, path):
        """"""
        if((path=="") or (path=="/")):
            return(self)
        (front,dummy,rest) = path.lstrip("/").partition("/")
        for child in self.items:
            if front in child.values(rel):
                return child.findByPath(rel, rest)
        return None
928240
def record_path(self):
        '''
        
        '''
        if self.record_button.get_property('active') and (self.record_path_selector
                                                          .selected_path):
            return self.record_path_selector.selected_path
        else:
            return None
136219
def _refresh_path(self):
        
        # Unsynced items are remote so we can't check some of their
        # properties yet
        if os.path.exists(self.path):
            try:
                i = open(self.path, 'r')
                i.close()
                juicer.utils.Log.log_debug("Successfully read item at: %s" % self.path)
            except:
                raise IOError("Error while attempting to access item at path: %s" % self.path)
        else:
            raise IOError("Could not locate item at path: %s" % self.path)
1355782
function getActiveStepCount() {
            var tourWrapper = jQuery('.cd-tour-wrapper'), //get the wrapper element
                tourSteps = tourWrapper.children('li'); //get all its children with tag 'li'

            var current_index = 0;
            tourSteps.each(function (index, li) {
                if (jQuery(li).hasClass('is-selected'))
                    current_index = index;
            });

            return current_index;
        }
775189
protected void checkActiveState(Widget child) {
        // Check if this widget has a valid href
        String href = child.getElement().getAttribute("href");
        String url = Window.Location.getHref();
        int pos = url.indexOf("#");
        String location = pos >= 0 ? url.substring(pos, url.length()) : "";

        if (!href.isEmpty() && location.startsWith(href)) {
            ListItem li = findListItemParent(child);
            if (li != null) {
                makeActive(li);
            }
        } else if (child instanceof HasWidgets) {
            // Recursive check
            for (Widget w : (HasWidgets) child) {
                checkActiveState(w);
            }
        }
    }
342357
def on_any_path?(paths)
	      path_found = false
	      paths.each do |path|
	       	path_found = on_path?(path) ? true : path_found
	      end
	      return path_found
	    end
716002
def enter(self, path):
        
        self.current.append(self.add(path))
        return self.current[-1]
872220
public function isActive(): bool
    {
        if ($this->isNested()) {
            return str_contains(url()->current(), $this->url);
        }

        return url($this->url) == url()->current();
    }
221367
def check_cached_item(self, path):
        
        item_path = '%s/%s/%s' % (
                current_app.static_folder,
                self.cache_folder,
                path.strip('/')
            )

        if os.path.isfile(item_path):
            return '%s/%s/%s' % (current_app.static_url_path, self.cache_folder, path.strip('/'))
        else:
            return False
403596
protected function checkPath()
    {
        if ($this->path === null) {
            return true;
        }

        $pathinfo = \UtilsPath();

        if (strpos($pathinfo, $this->path) === 0) {
            $this->currentPrefixPath = $this->path;
            return true;
        } else {
            $re = Regex::parse($this->path);

            if ($re !== false && preg_match('#^' . $re . '#', $pathinfo, $matches)) {
                $this->currentPrefixPath = $matches[0];

                array_shift($matches);

                $this->arguments = array_merge($this->arguments, $matches);

                return true;
            }
        }

        return false;
    }
876729
def show(only_path=False):
    """"""
    logger.setLevel(logging.INFO)
    infos = ["\n", f'Instance path: "{current_app.instance_path}"']

    logger.info("\n  ".join(infos))

    if not only_path:
        log_config(current_app.config)
771033
def cp(path, term_check = false)
      return "active" if term_check && request.url.include?('terms')
      return "active" if current_page?(path)
    end
242639
function doesPathExist(pathToVerify) {
    let pathExists = true;

    try {
        fs.accessSync(pathToVerify);
    } catch (error) {
        pathExists = false;
    }

    return pathExists;
}
699734
def getitem_by_path(d, path):
    
    return reduce(
        lambda d, k: d[k],
        path,
        d
    )