Wrapper for the Workbench search method
            Args:
                tags: a single tag 'pcap' or a list of tags to search for ['bad','aptz13']
            Returns:
                A sample_set that contains the md5s for all matching samples
167857
def search(self, tags=None):
        
        if isinstance(tags, str):
            tags = [tags]
        return self.workbench.generate_sample_set(tags)
1214429
def check_tags(my_expnum, ops_set, my_ccds, dry_run=True):
    
    tags = storage.get_tags(my_expnum)
    count = 0
    outcount = 0
    fails = []
    for ccd in my_ccds:
      success = True
      count += 1
      for ops in ops_set:
         for fake in ops[0]:
            for my_program in ops[1]:
               for version in ops[2]:
                    #print my_expnum, fake, my_program, version, ccd
                    key = storage.get_process_tag(fake + my_program, ccd, version)
                    uri = storage.tag_uri(key)
                    if "Failed to get image" in tags.get(uri, "Failed to get image"):
                        #print tags.get(uri, None)
                        fails.append(ccd)
                        success = False
      if success:
         outcount += 1
    sys.stderr.write("{} {} {:5.1f}%\n".format(outcount, count,100* float(outcount)/count))
    #print fails
    return set(fails)
1141090
def find_by_tag(self, tag) -> Dict[str, Set[Parameter]]:
        
        return self.tags[tag]
735473
def tag(self, *tags):
        
        if not all(isinstance(tag, collections.Hashable) for tag in tags):
            raise TypeError('Tags must be hashable')
        self.tags.update(tags)
        return self
1185290
def tags_from_hit(self, tag_ids):
        
        ids = []
        for t in tag_ids.split():
            t = t.strip()
            try:
                t = int(t)
            except ValueError:
                pass
            else:
                ids.append(t)

        if not ids:
            return []

        return Tag.query.filter(Tag.id.in_(ids)).all()
663556
def get_all_tags(image_name, branch=None):
    
    try:
        return get_all_tags_no_auth(image_name, branch)
    except AuthException:
        return get_all_tags_with_auth(image_name, branch)
626844
def pull_tag_dict(data):
    
    # If there are tags, set them to a normal dict, vs. a list of dicts:
    tags = data.pop('Tags', {}) or {}
    if tags:
        proper_tags = {}
        for tag in tags:
            proper_tags[tag['Key']] = tag['Value']

        tags = proper_tags

    return tags
870064
def tags():
    ""
    result = [t.decode('ascii') for t in subprocess.check_output([
        'git', 'tag'
    ]).split(b"\n")]
    assert len(set(result)) == len(result)
    return set(result)
540723
def tags(self):
        ''
        if self._tags is None:
            config = global_config('dossier.tags')
            self._tags = self.create(Tags, config=config)
        return self._tags
909792
def tag(self, tag):
        
        url = '%s/tags/%s' % (self, tag)
        response = self.http.get(url, auth=self.auth)
        response.raise_for_status()
        return response.json()
654647
def supported(self, tags=None):
        # type: (Optional[List[Pep425Tag]]) -> bool
        """"""
        if tags is None:  # for mock
            tags = pep425tags.get_supported()
        return bool(set(tags).intersection(self.file_tags))
540021
def get_sample_window(self, type_tag, size=10):
        

        # Convert size to MB
        size = size * 1024 * 1024

        # Grab all the samples of type=type_tag, sort by import_time (newest to oldest)
        cursor = self.database[self.sample_collection].find({'type_tag': type_tag},
            {'md5': 1,'length': 1}).sort('import_time',pymongo.DESCENDING)
        total_size = 0
        md5_list = []
        for item in cursor:
            if total_size > size:
                return md5_list
            md5_list.append(item['md5'])
            total_size += item['length']

        # If you get this far you don't have 'size' amount of data
        # so just return what you've got
        return md5_list
1289438
def find_tags(self, tag_name, **attribute_filter):
        
        all_tags = [
            self.find_tags_from_xml(
                i, tag_name, **attribute_filter
            )
            for i in self.xml
        ]
        return [tag for tag_list in all_tags for tag in tag_list]
641505
def tags(self):
        
        tag_list = self.spec.get('tag', [])
        if isinstance(tag_list, (list, set, tuple)):
            return list(tag_list)
        return [tag_list]
1248331
def get_tags(self):
        
        j, _ = self.datacenter.request('GET', self.path + '/tags')
        return j
949606
def tags(self):
        # type: () -> Set[str]
        
        tags = set()
        if self._tags:
            tags.update(self._tags)
        if self.binding:
            binding_tags = getattr(self.binding, 'tags', None)
            if binding_tags:
                tags.update(binding_tags)
        return tags
526917
def search_tags(self, tag_name):

        

        response = self._req('/browse/tags/search', {
            "tag_name":tag_name
        })

        tags = list()

        for item in response['results']:
            tags.append(item['tag_name'])

        return tags