Decided whether current request path should be sampled or not. This is
    checked previous to `should_not_sample_route` and takes precedence.

    :param: current active pyramid request
    :returns: boolean whether current request path is blacklisted.
773087
def should_not_sample_path(request):
    
    blacklisted_paths = request.registry.settings.get(
        'zipkin.blacklisted_paths', [])
    # Only compile strings, since even recompiling existing
    # compiled regexes takes time.
    regexes = [
        re.compile(r) if isinstance(r, six.string_types) else r
        for r in blacklisted_paths
    ]
    return any(r.match(request.path) for r in regexes)
432462
def should_skip_middleware(self, middleware, matching, rest) -> bool:
        
        return bool(not matching) or bool(rest)
883381
def has_access(self, permission_name, view_name):
        
        if current_user.is_authenticated:
            return self._has_view_access(g.user, permission_name, view_name)
        elif current_user_jwt:
            return self._has_view_access(current_user_jwt, permission_name, view_name)
        else:
            return self.is_item_public(permission_name, view_name)
1310086
def check(self, request):
        
        if callable(self.check_func):
            self.visible = self.check_func(request)
884263
def _after_request(self, response):
        
        # Do not trace if the url is blacklisted
        if utils.disable_tracing_url(flask.request.url, self.blacklist_paths):
            return response

        try:
            tracer = execution_context.get_opencensus_tracer()
            tracer.add_attribute_to_current_span(
                HTTP_STATUS_CODE,
                str(response.status_code))
        except Exception:  # pragma: NO COVER
            log.error('Failed to trace request', exc_info=True)
        finally:
            return response
434640
def _get_trail(request, exclude_section=False):
    
    trail = []
    url = request.path
    while url:
        if url == '/':
            break
        if exclude_section and url in SECTIONS:
            break
        crumb = find_crumb(request, url)
        if not crumb:
            break
        trail.append(crumb)

        # go one level up
        url = urljoin(url, '..')

    trail.reverse()

    return trail
979212
def has_permission(self, request, *args, **kwargs):
        
        self.kwargs = kwargs
        self.args = args
        self.request = request
        self.org = self.derive_org()

        if self.get_user().is_superuser:
            return True

        if self.get_user().has_perm(self.permission):
            return True

        return self.has_org_perm(self.permission)
105361
def is_authenticated(self):
        
        if not self.token:
            return False

        try:
            self.lookup_token()
            return True
        except exceptions.Forbidden:
            return False
        except exceptions.InvalidPath:
            return False
        except exceptions.InvalidRequest:
            return False
896554
function isBlacklisted(moduleId)
{
  var i;

  // strip basePath
  moduleId = moduleId.replace(this.basePathRegexp, '');

  for (i = 0; i < this.blackList.length; i++)
  {
    if (minimatch(moduleId, this.blackList[i]))
    {
      return true;
    }
  }

  return false;
}
858408
def goForward(self):
        
        if not self.canGoForward():
            return ''
        
        self._blockStack = True
        self._index += 1
        self.emitCurrentChanged()
        self._blockStack = False
        return self.currentUrl()
646691
def exclude_current_instance(self, queryset):
        
        if self.instance is not None:
            return queryset.exclude(pk=self.instance.pk)
        return queryset
668596
def verify(self):
        
        log.debug('verify request=%s', self.lti_kwargs.get('request'))
        if self.lti_kwargs.get('request') == 'session':
            self._verify_session()
        elif self.lti_kwargs.get('request') == 'initial':
            self.verify_request()
        elif self.lti_kwargs.get('request') == 'any':
            self._verify_any()
        else:
            raise LTIException("Unknown request type")
        return True
819298
def _is_request_in_exclude_path(self, request):
        """"""
        if self._exclude_paths:
            for path in self._exclude_paths:
                if request.path.startswith(path):
                    return True
            return False
        else:
            return False
912721
def is_passive_request(self, request):
        
        if request.path in PASSIVE_URLS:
            return True

        try:
            match = resolve(request.path)
            # TODO: check namespaces too
            if match.url_name in PASSIVE_URL_NAMES:
                return True
        except Resolver404:
            pass

        return False
991951
def check_loops_in_grpah(self, current=None, visited=[]):
        '''
        
        '''
        if current in visited:
            path = ' -> '.join(v.get_name() for v in (visited + [current]))
            raise KittyException('loop detected in model: %s' % path)
        current = current if current else self._root
        for conn in self._graph[current.hash()]:
            self.check_loops_in_grpah(conn.dst, visited + [conn.src])
928614
def __spawn_new_request(self):
        

        first_in_line = self.queue.get_first(QueueItem.STATUS_QUEUED)
        
        if first_in_line is None:
            return False

        while self.routing.is_treshold_reached(first_in_line.request):
            self.queue.move(first_in_line, QueueItem.STATUS_CANCELLED)

            first_in_line = self.queue.get_first(QueueItem.STATUS_QUEUED)
            if first_in_line is None:
                return False

        self.__request_start(first_in_line)
        return True
230882
def is_url_allowed(url):
    
    blacklist = [
        r'\.ttf', r'\.woff', r'fonts\.googleapis\.com', r'\.png', r'\.jpe?g', r'\.gif',
        r'\.svg'
    ]

    for ft in blacklist:
        if re.search(ft, url):
            return False

    return True