return unique dict for each uwsgi request.
    note: won't work on non-uwsgi cases
504123
def request_uniq(func):
    

    def _wrapped(*args, **kwargs):
        data = _get_request_unique_cache()
        return func(data, *args, **kwargs)

    return _wrapped
930287
def distinct(self):
        
        new_query_set = self.clone()
        new_query_set.query.distinct = True
        return new_query_set
279510
def get_version(self, as_tuple=False):
        
        if as_tuple:
            return uwsgi.version_info

        return decode(uwsgi.version)
433259
def unique(cls, iterable, key=None):
    

    if key is None:
      key = lambda x: x
    def generator():
      seen = set()
      seen_add = seen.add
      for item in iterable:
        key_val = key(item)
        if key_val not in seen:
          seen_add(key_val)
          yield item
    return cls(generator())
551620
def as_dict(self):
        
        dict_fw = {
            'id': self.id,
            'name': self.name,
            'description': self.description,
            'rules_direction': self.rules_direction,
            'rules_ip_protocol': self.rules_ip_protocol,
            'rules_from_port': self.rules_from_port,
            'rules_to_port': self.rules_to_port,
            'rules_grants_group_id': self.rules_grants_group_id,
            'rules_grants_name': self.rules_grants_name,
            'rules_grants_cidr_ip': self.rules_grants_cidr_ip,
            'rules_description': self.rules_description
        }

        return dict_fw
125515
def unique (inlist):
    
    uniques = []
    for item in inlist:
        if item not in uniques:
            uniques.append(item)
    return uniques
982862
def unique_string(length=UUID_LENGTH):
    ''''''
    # We need a string at least as long as length
    string = str(uuid4()) * int(math.ceil(length / float(UUID_LENGTH)))
    return string[:length] if length else string
52227
def unique(seq):
    """"""
    seen = {}
    result = []
    for item in seq:
        marker = item
        if marker in seen:
            continue
        seen[marker] = 1
        result.append(item)
    return result
735479
def _maybe_unique_host(onion):
    
    hosts = [
        onion.get_client(nm).hostname
        for nm in onion.client_names()
    ]
    if not hosts:
        raise ValueError(
            "Can't access .onion_uri because there are no clients"
        )
    host = hosts[0]
    for h in hosts[1:]:
        if h != host:
            raise ValueError(
                "Cannot access .onion_uri for stealth-authenticated services "
                "because each client has a unique URI"
            )
    return host
510510
def where_unique(cls, ip, object_id, location):
        
        return cls.query.filter_by(
            ip=ip,
            object_id=object_id,
            location=location).first()
389847
def unique(objects, key=None):
    
    dupl = []
    for obj, group in itertools.groupby(sorted(objects), key):
        if sum(1 for _ in group) > 1:
            dupl.append(obj)
    if dupl:
        raise ValueError('Found duplicates %s' % dupl)
    return objects
913667
def unique(self):
        
        return LazyArrayResult(weld_unique(self.values,
                                           self.weld_type),
                               self.weld_type)
959819
def uuid(self):
        '''
        '''
        pk = self.pkvalue()
        if not pk:
            raise self.DoesNotExist(
                'Object not saved. Cannot obtain universally unique id')
        return self.get_uuid(pk)
813935
def uniqify(func):
  """"""
  @six.wraps(func)
  def unique(self, *args, **kwargs):
    return self.unique(func(self, *args, **kwargs))
  return unique
1089364
def _get_unique_links(page_url, soup):
    
    if "http://" not in page_url and "https://" not in page_url:
        return []
    prefix = 'http:'
    if page_url.startswith('https:'):
        prefix = 'https:'
    simple_url = page_url.split('://')[1]
    base_url = simple_url.split('/')[0]
    full_base_url = prefix + "//" + base_url

    raw_links = []
    raw_unique_links = []

    # Get "href" from all "a" tags
    links = soup.find_all('a')
    for link in links:
        raw_links.append(link.get('href'))

    # Get "src" from all "img" tags
    img_links = soup.find_all('img')
    for img_link in img_links:
        raw_links.append(img_link.get('src'))

    # Get "href" from all "link" tags
    links = soup.find_all('link')
    for link in links:
        raw_links.append(link.get('href'))

    # Get "src" from all "script" tags
    img_links = soup.find_all('script')
    for img_link in img_links:
        raw_links.append(img_link.get('src'))

    for link in raw_links:
        if link not in raw_unique_links:
            raw_unique_links.append(link)

    unique_links = []
    for link in raw_unique_links:
        if link and len(link) > 1:
            if link.startswith('//'):
                link = prefix + link
            elif link.startswith('/'):
                link = full_base_url + link
            elif link.startswith('./'):
                link = full_base_url + link[1:]
            elif link.startswith('#'):
                link = full_base_url + link
            elif '//' not in link:
                link = full_base_url + "/" + link
            else:
                pass
            unique_links.append(link)

    return unique_links
862905
def derived_get_requests(self):
        

        host = self.queue_item.response.url
        soup = self.queue_item.get_soup_response()

        found_requests = []

        for form in soup.find_all("form"):
            found_requests.append(self.__get_request(host, form))

        return found_requests
755841
def uniqify_once(func):
  """"""
  @six.wraps(func)
  def unique_once(self, *args, **kwargs):
    return self.unique_once(func(self, *args, **kwargs))
  return unique_once