Return a thread local :class:`dossier.web.Tags` client.
540723
def tags(self):
        ''
        if self._tags is None:
            config = global_config('dossier.tags')
            self._tags = self.create(Tags, config=config)
        return self._tags
1021308
def thread_local_property(name):
    ''''''
    name = '_thread_local_' + name

    def fget(self):
        try:
            return getattr(self, name).value
        except AttributeError:
            return None

    def fset(self, value):
        getattr(self, name).value = value

    return property(fget=fget, fset=fset)
1118468
def get_top_tags(self, limit=None, cacheable=True):
        

        params = self._get_params()
        if limit:
            params["limit"] = limit

        doc = self._request(self.ws_prefix + ".getTopTags", cacheable, params)

        seq = []
        for node in doc.getElementsByTagName("tag"):
            seq.append(
                TopItem(
                    Tag(_extract(node, "name"), self.network), _extract(node, "count")
                )
            )

        return seq
708886
def newthread(template="EPCThread-{0}", **kwds):
    
    if not isinstance(template, str):
        template = '{0}.{1}-{{0}}'.format(template.__module__,
                                          template.__class__.__name__)
    return threading.Thread(
        name=newname(template), **kwds)
857650
def tagged(self, tag):
    """"""
    return Scm(self.connection, self.developer_connection, self.url, tag=tag)
709326
def threads_bt(self):
        """"""
        import threading
        import traceback

        threads = {}
        for thread in threading.enumerate():
            frames = sys._current_frames().get(thread.ident)
            if frames:
                stack = traceback.format_stack(frames)
            else:
                stack = []
            threads[thread] = "".join(stack)
        return flask.render_template("gourde/threads.html", threads=threads)
304813
def add_tag(self, task, params={}, **options): 
        
        path = "/tasks/%s/addTag" % (task)
        return self.client.post(path, params, **options)
116665
def get_tags(self):
        
        return github.PaginatedList.PaginatedList(
            github.Tag.Tag,
            self._requester,
            self.url + "/tags",
            None
        )
528507
def update(self):
        """"""
        if self._is_ignored or "tags" not in self._tag_group_dict:
            return
        for i in range(len(self._tag_group_dict["tags"])):
            tag_dict = self._tag_group_dict["tags"][i]
            for tag in self._tags:
                if tag.name == tag_dict["common.ALLTYPES_NAME"]:
                    self._tag_group_dict["tags"][i] = tag.as_dict()
                    break

        for i in range(len(self._sub_groups)):
            sub_group = self._sub_groups[i]
            sub_group.update()
            self._tag_group_dict["tag_groups"][i] = sub_group.as_dict()
169491
def tags(self):
        ''''''
        return itertools.product(
            self.py_version.split('.'),
            self.abi.split('.'),
            self.platform.split('.'),
        )
582241
def list_tags(Name,
           region=None, key=None, keyid=None, profile=None):
    '''
    

    '''

    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        rid = _get_trail_arn(Name,
                             region=region, key=key, keyid=keyid,
                             profile=profile)
        ret = conn.list_tags(ResourceIdList=[rid])
        tlist = ret.get('ResourceTagList', []).pop().get('TagsList')
        tagdict = {}
        for tag in tlist:
            tagdict[tag.get('Key')] = tag.get('Value')
        return {'tags': tagdict}
    except ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
614035
def add_tags(self, **kwargs):
        
        j, _ = self.datacenter.request('POST', self.path + '/tags', 
            data=kwargs)
        return j
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()
667547
def update(self, **kwds):
        
        result = self._client.tag.update(self, **kwds)
        self._replace_fields(result.get_fields())
227144
def sslPorts(self, req, tag):
        
        f = PortScrollingFragment(
            self.store,
            SSLPort,
            (SSLPort.portNumber,
             SSLPort.interface,
             CertificateColumn(SSLPort.certificatePath),
             FactoryColumn(SSLPort.factory)))
        f.setFragmentParent(self)
        f.docFactory = webtheme.getLoader(f.fragmentName)
        return tag[f]
373892
def create(self, tag, **kwds):
        
        return self._client.post("/tag/create.json", tag=tag, **kwds)["result"]
328698
def get_instances_by_tag(self, tags):
        

        try:
            c = ec2.connect_to_region(self._region,
                                      aws_access_key_id=self._aws_access_key_id,
                                      aws_secret_access_key=self._aws_secret_access_key)

            # select instance by list of tags (OR used)
            reservations = c.get_all_reservations(filters=SergentSsh.tags_to_dict(tags))
            instances = list()

            for r in reservations:
                # for each instance launched by this reservation
                for instance in r.instances:
                    # we need only running instances
                    if instance.state.lower() == 'running':
                        instances.append(instance)

            return instances
        except NoAuthHandlerFound:
            raise SergentSshException('Boto said that you should check your credentials')