List all archives matching tag search criteria
439635
def search(ctx, tags, prefix=None):
    '''
    
    '''

    _generate_api(ctx)

    for i, match in enumerate(ctx.obj.api.search(*tags, prefix=prefix)):

        click.echo(match, nl=False)
        print('')
163234
def _build_search_query(self, from_date):
        

        sort = [{self._sort_on_field: {"order": "asc"}}]

        filters = []
        if self._repo:
            filters.append({"term": {"origin": self._repo}})

        if from_date:
            filters.append({"range": {self._sort_on_field: {"gte": from_date}}})

        if filters:
            query = {"bool": {"filter": filters}}
        else:
            query = {"match_all": {}}

        search_query = {
            "query": query,
            "sort": sort
        }

        return search_query
984274
def _match_tag_regex(self, event_tag, search_tag):
        '''
        
        '''
        return self.cache_regex.get(search_tag).search(event_tag) is not None
3896
def searchTag(self,HTAG="#python"):
        """"""
        self.t = Twython(app_key           =self.app_key           ,
                        app_secret         =self.app_secret        ,
                        oauth_token        =self.oauth_token       ,
                        oauth_token_secret =self.oauth_token_secret)

        search =self.t.search(q=HTAG,count=100,result_type="recent")
        ss=search[:]
        search = self.t.search(q=HTAG,count=150,max_id=ss[-1]['id']-1,result_type="recent")
        #search = t.search(q=HTAG,count=150,since_id=ss[-1]['id'],result_type="recent")
        while seach:
            ss+=search[:]
            search = self.t.search(q=HTAG,count=150,max_id=ss[-1]['id']-1,result_type="recent")
        self.ss=ss
299937
def search(self):
        ''''''
        s = super(TopicSearchMixin, self).search()
        s = s.filter('bool', should=[
            Q('term', tags=tag) for tag in self.topic.tags
        ])
        return s
1296095
def get_tagged_albums(self, tag, limit=None, cacheable=True):
        """"""

        params = self._get_params()
        params["tag"] = tag
        params["taggingtype"] = "album"
        if limit:
            params["limit"] = limit
        doc = self._request(self.ws_prefix + ".getpersonaltags", cacheable, params)
        return _extract_albums(doc, self.network)
699678
def get_tagged_tracks(self, tag, limit=None, cacheable=True):
        """"""

        params = self._get_params()
        params["tag"] = tag
        params["taggingtype"] = "track"
        if limit:
            params["limit"] = limit
        doc = self._request(self.ws_prefix + ".getpersonaltags", cacheable, params)
        return _extract_tracks(doc, self.network)
1283464
function getAllTags(version, cwd, repo, cb) {
  var str = 'git for-each-ref --format="%(tag)" --sort=\'*authordate\' refs/tags | sed \'1!G;h;$!d\'';
  exec(str, {cwd: cwd}, function (err, stdout, stderr) {

    var output = '';

    if (err) { return cb(err); }

    var stdoutAsString = stdout.toString('utf8');

    // Get the latest tag
    var lastTag = stdoutAsString.split('\n')[0];

    getTagDate(lastTag, function (err, tagDateAsString) {
      if (err) { return cb(err); }

      output += format('## [%s] -%s\n\n', version, tagDateAsString);
      output += '### Fixed\n\n';

      var str = 'git --no-pager log --pretty="format:- [] %%s (\\`%%an\\`)%%n  https://github.com/%s/commit/%H" "%s..HEAD"';
      str = format(str, repo, lastTag);

      exec(str, {cwd: cwd}, function (err, stdout, stderr) {
        if (err) { return cb(err); }
        output += stdout;

        return cb(null, output);
      });
    });
  });
}
1215781
def list_matching_entries(program, arguments):
    """"""
    output("\n".join(entry.name for entry in program.smart_search(*arguments)))
275670
def search_prod_type_tags(self, ins, type, tags, pipeline):
        ''''''
        return StoredProduct(id=100, content='null.fits', tags={})
347455
def search(self, *args, **kwargs):
        """"""
        ret = []
        for record in Handler.ALL_VERS_DATA.values():
            matchArgs = list(kwargs.keys())
            for k,v in iteritems(kwargs): # restrict records based on key-value match requirement
                try:
                    if record[k] != v: break # a non-matching requirement means this record doesn't match
                except: break # record doesn't have required key 'k'
                matchArgs.remove(k)
            if matchArgs: continue # didn't match all required kwargs
            matchArgs = list(args)
            for k,v in iteritems(record): # find any record with a <value> in it
                if k in matchArgs: matchArgs.remove(k)
                if v in matchArgs: matchArgs.remove(v)
            if matchArgs: continue # didn't match all required args
            ret.append(record)
        return ret
1268719
def _indexable_tags(self):
        """"""
        tags = current_app.extensions.get("tags")
        if not tags or not tags.supports_taggings(self):
            return ""

        default_ns = tags.entity_default_ns(self)
        return [t for t in tags.entity_tags(self) if t.ns == default_ns]
854501
private void findGroupBys() {
    if (filters == null || filters.isEmpty()) {
      return;
    }
    
    if ((use_multi_gets && override_multi_get) && !search_query_failure) {
      
    }
    
    row_key_literals = new ByteMap<byte[][]>();
    final int expansion_limit = tsdb.getConfig().getInt(
        "tsd.query.filter.expansion_limit");
    
    Collections.sort(filters);
    final Iterator<TagVFilter> current_iterator = filters.iterator();
    final Iterator<TagVFilter> look_ahead = filters.iterator();
    byte[] tagk = null;
    TagVFilter next = look_ahead.hasNext() ? look_ahead.next() : null;
    int row_key_literals_count = 0;
    while (current_iterator.hasNext()) {
      next = look_ahead.hasNext() ? look_ahead.next() : null;
      int gbs = 0;
      // sorted!
      final ByteMap<Void> literals = new ByteMap<Void>();
      final List<TagVFilter> literal_filters = new ArrayList<TagVFilter>();
      TagVFilter current = null;
      do { // yeah, I'm breakin out the do!!!
        current = current_iterator.next();
        if (tagk == null) {
          tagk = new byte[TSDB.tagk_width()];
          System.arraycopy(current.getTagkBytes(), 0, tagk, 0, TSDB.tagk_width());
        }
        
        if (current.isGroupBy()) {
          gbs++;
        }
        if (!current.getTagVUids().isEmpty()) {
          for (final byte[] uid : current.getTagVUids()) {
            literals.put(uid, null);
          }
          literal_filters.add(current);
        }

        if (next != null && Bytes.memcmp(tagk, next.getTagkBytes()) != 0) {
          break;
        }
        next = look_ahead.hasNext() ? look_ahead.next() : null;
      } while (current_iterator.hasNext() && 
          Bytes.memcmp(tagk, current.getTagkBytes()) == 0);

      if (gbs > 0) {
        if (group_bys == null) {
          group_bys = new ArrayList<byte[]>();
        }
        group_bys.add(current.getTagkBytes());
      }
      
      if (literals.size() > 0) {
        if (literals.size() + row_key_literals_count > expansion_limit) {
          LOG.debug("Skipping literals for " + current.getTagk() + 
              " as it exceedes the limit");
          //has_filter_cannot_use_get = true;
        } else {
          final byte[][] values = new byte[literals.size()][];
          literals.keySet().toArray(values);
          row_key_literals.put(current.getTagkBytes(), values);
          row_key_literals_count += values.length;
          
          for (final TagVFilter filter : literal_filters) {
            filter.setPostScan(false);
          }
        }
      } else {
        row_key_literals.put(current.getTagkBytes(), null);
        // no literal values, just keys, so we can't multi-get
        if (search_query_failure) {
          use_multi_gets = false;
        }
      }
      
      // make sure the multi-get cardinality doesn't exceed our limit (or disable
      // multi-gets)
      if ((use_multi_gets && override_multi_get)) {
        int multi_get_limit = tsdb.getConfig().getInt("tsd.query.multi_get.limit");
        int cardinality = filters.size() * row_key_literals_count;
        if (cardinality > multi_get_limit) {
          use_multi_gets = false;
        } else if (search_query_failure) {
          row_key_literals_list.add(row_key_literals);
        }
        // TODO - account for time as well
      }
    }
  }
225159
def query_tags(order=None, orderby=None, limit=None):
    
    from taggit.models import Tag, TaggedItem    # feature is still optional

    # Get queryset filters for published entries
    EntryModel = get_entry_model()
    ct = ContentType.objects.get_for_model(EntryModel)  # take advantage of local caching.

    entry_filter = {
        'status': EntryModel.PUBLISHED
    }
    if appsettings.FLUENT_BLOGS_FILTER_SITE_ID:
        entry_filter['parent_site'] = settings.SITE_ID

    entry_qs = EntryModel.objects.filter(**entry_filter).values_list('pk')

    # get tags
    queryset = Tag.objects.filter(
        taggit_taggeditem_items__content_type=ct,
        taggit_taggeditem_items__object_id__in=entry_qs
    ).annotate(
        count=Count('taggit_taggeditem_items')
    )

    # Ordering
    if orderby:
        queryset = queryset.order_by(*_get_order_by(order, orderby, TAG_ORDER_BY_FIELDS))
    else:
        queryset = queryset.order_by('-count')

    # Limit
    if limit:
        queryset = queryset[:limit]

    return queryset
704127
def get_tags(self):
        """"""
        res = self.get_request('/tag')
        return [Tag(cloud_manager=self, **tag) for tag in res['tags']['tag']]
1292682
def search_all(self, quota=50, format='json'):
        '''
        
        '''
        quota_left = quota
        results = []
        while quota_left > 0:
            more_results = self._search(quota_left, format)
            if not more_results:
                break
            results += more_results
            quota_left = quota_left - len(more_results)
            time.sleep(1)
        results = results[0:quota]
        return results
1083143
def list_tags(userdata):
        
        macros = re.findall('@(.*?)@', userdata)
        logging.info('List of available macros:')
        for macro in macros:
            logging.info('\t%r', macro)