Gets an array of TagGroup objects in the Kepware device
165454
def parse_tag_groups(self):
        """"""
        tag_groups = []
        if 'tag_groups' not in self._device_dict:
            return tag_groups
        to_remove = []
        for tag_group in self._device_dict['tag_groups']:
            if tag_group['common.ALLTYPES_NAME'] in self._ignore_list:
                to_remove.append(tag_group)
                continue
            tag_groups.append(TagGroup(tag_group))
        for removable in to_remove:
            self._device_dict['tag_groups'].remove(removable)

        return tag_groups
350618
function getTags($) {
  const tags = [];

  const tagElements = $('.concept_light-tag');
  for (let i = 0; i < tagElements.length; i += 1) {
    const tagText = tagElements.eq(i).text();
    tags.push(tagText);
  }

  return tags;
}
885311
def get_resource_tag_map(self, r_type, ids):
        
        manager = self.manager.get_resource_manager(r_type)
        r_id = manager.resource_type.id
        # TODO only fetch resource with the given ids.
        return {
            r[r_id]: {t['Key']: t['Value'] for t in r.get('Tags', [])}
            for r in manager.resources() if r[r_id] in ids
        }
724258
function getTags( $tag_group, $show_hidden_tags = true ) {

		/** @var $wpdb \wpdb */
		global $wpdb;

		$sql = "SELECT DISTINCT {$this->dbTagsTable}.id, {$this->dbTagsTable}.tag FROM {$this->dbTagsTable}
 				INNER JOIN {$this->dbLinkTable} ON {$this->dbLinkTable}.tags_id = {$this->dbTagsTable}.id
 				INNER JOIN {$this->dbTable} ON {$this->dbTable}.users_id = {$this->dbLinkTable}.users_id AND {$this->dbTable}.blogs_id = {$this->dbLinkTable}.blogs_id
 				WHERE {$this->dbLinkTable}.tags_group = %d AND {$this->dbLinkTable}.users_id = %d ";

		if ( true !== $show_hidden_tags ) {
			$sql .= "AND {$this->dbTable}.deleted = 0 ";
		}
		$sql .= "ORDER BY {$this->dbTagsTable}.tag ASC ";

		return $wpdb->get_results( $wpdb->prepare( $sql, $tag_group, $this->userId ), ARRAY_A ); // @codingStandardsIgnoreLine
	}
995430
def get_tag(self, tagtype):
        ''' '''
        for tag in self.__tags:
            if tag.tagtype == tagtype:
                return tag
        return None
1032558
def uniqueTags(tagList):
    '''
        
    '''
    ret = []
    alreadyAdded = set()
    for tag in tagList:
        myUid = tag.getUid()
        if myUid in alreadyAdded:
            continue
        ret.append(tag)
    return TagCollection(ret)
644581
SeeTag[] seeTags() {
        ListBuffer<SeeTag> found = new ListBuffer<SeeTag>();
        for (Tag next : tagList) {
            if (next instanceof SeeTag) {
                found.append((SeeTag)next);
            }
        }
        return found.toArray(new SeeTag[found.length()]);
    }
1367173
def from_group(cls, group):
        
        if not group:
            return
        tag_items = group.split(";")
        return list(map(cls.parse, tag_items))
8985
function () {
            var tagArray = [];
            if (this.tags && this.tags.length > 0) {
                var i, len, tag;
                for (i = 0, len = this.tags.length; i < len; i++) {
                    tag = this.tags[i];
                    switch (tag.kind) {
                    case Core.TK_STRING:
                        tagArray.push(tag.name + '="' + tag.value + '"');
                        break;
                    case Core.TK_REFERENCE:
                        if (tag.reference instanceof Core.Model) {
                            tagArray.push(tag.name + '=' + tag.reference.name);
                        } else {
                            tagArray.push(tag.name + '=null');
                        }
                        break;
                    case Core.TK_BOOLEAN:
                        tagArray.push(tag.name + '=' + tag.checked);
                        break;
                    case Core.TK_NUMBER:
                        tagArray.push(tag.name + '=' + tag.number);
                        break;
                    // TK_HIDDEN is not shown in Diagram.
                    }
                }
            }
            return tagArray;
        }
932683
def _manageTags(tagList, guids, add=True):
    
    objects = getObjectsFromGuids(guids)
    tags = []
    for tag in tagList:
        try:
            t = Tag.objects.get(pk=int(tag))
        except ValueError:
            t = Tag.objects.get_or_create(name=tag.lower())[0]
        tags.append(t)

    if add:
        return _addTags(tags, objects)
    else:
        return _removeTags(tags, objects)
1079464
def _process_tags(self):
        """"""
        tags = []

        while True:
            tag_bf = unpack_ui16(self._src)
            tag_type = tag_bf >> 6   # upper 10 bits
            if tag_type == 0:
                # the end
                break
            tag_len = tag_bf & 0x3f  # last 6 bits
            if tag_len == 0x3f:
                # the length is the next four bytes!
                tag_len = unpack_ui32(self._src)

            try:
                tag_name = TAG_NAMES[tag_type]
            except KeyError:
                # malformed SWF, create and unknown object with malformed tag
                tag_payload = self._src.read(tag_len)
                _dict = {
                    '__str__': _repr,
                    '__repr__': _repr,
                    'name': 'UnspecifiedObject(tag={!r})'.format(tag_type),
                }
                tag = type("UnknownObject", (SWFObject,), _dict)()
                tag.raw_payload = tag_payload
                tags.append(tag)
                continue

            try:
                tag_meth = getattr(self, "_handle_tag_" + tag_name.lower())
            except AttributeError:
                if self.unknown_alert:
                    raise ValueError("Unknown tag: " + repr(tag_name))

                tag_payload = self._src.read(tag_len)
                _dict = {'__str__': _repr, '__repr__': _repr, 'name': tag_name}
                tag = type("UnknownObject", (SWFObject,), _dict)()
                tag.raw_payload = tag_payload
                tags.append(tag)
                continue

            # we know the tag type, and have the handler, let's process it
            prev_pos = self._src.tell()
            self._src.guard = tag_len
            try:
                with ReadQuantityController(self._src, tag_len):
                    tag = tag_meth()
                assert tag is not None, tag_name
            except ValueError:
                # an attempt to read too much happened; create a failing
                # object with the raw payload
                self._src.guard = None
                self._src.seek(prev_pos)
                tag_payload = self._src.read(tag_len)
                _dict = {'__str__': _repr, '__repr__': _repr, 'name': tag_name}
                tag = type("FailingObject", (SWFObject,), _dict)()
                tag.raw_payload = tag_payload
            tags.append(tag)
        return tags
132514
public static function findManyByNameOrCreate(array $tags, string $group = null, string $locale = null): Collection
    {
        // Expects array of tag names
        return collect($tags)->map(function ($tag) use ($group, $locale) {
            return static::findByNameOrCreate($tag, $group, $locale);
        });
    }
1017034
function groupTags(tags, key) {
    var groupBy = 'data-combo';
    return tags.reduce(function (previous, current) {
        var combineName = current.attributes[groupBy];
        var keyValue = current.attributes[key];

        if (!keyValue || !combineName) {
            return previous;
        }

        var group = previous[combineName];

        if (!group) {
            group = previous[combineName] = [];
        }

        delete current.attributes[groupBy];
        group.push(current);

        return previous;
    }, {});
}
214589
protected function parseTags($rawTags, string $group = null, string $locale = null, $create = false): array
    {
        (is_iterable($rawTags) || is_null($rawTags)) || $rawTags = [$rawTags];

        [$strings, $tags] = collect($rawTags)->map(function ($tag) {
            ! is_numeric($tag) || $tag = (int) $tag;

            ! $tag instanceof Model || $tag = [$tag->getKey()];
            ! $tag instanceof Collection || $tag = $tag->modelKeys();
            ! $tag instanceof BaseCollection || $tag = $tag->toArray();

            return $tag;
        })->partition(function ($item) {
            return is_string($item);
        });

        return $tags->merge(app('rinvex.tags.tag')->{$create ? 'findByNameOrCreate' : 'findByName'}($strings->toArray(), $group, $locale)->pluck('id'))->toArray();
    }
639477
def to_array(self):
        
        array = super(InlineQueryResultCachedSticker, self).to_array()
        array['type'] = u(self.type)  # py2: type unicode, py3: type str

        array['id'] = u(self.id)  # py2: type unicode, py3: type str

        array['sticker_file_id'] = u(self.sticker_file_id)  # py2: type unicode, py3: type str

        if self.reply_markup is not None:
            array['reply_markup'] = self.reply_markup.to_array()  # type InlineKeyboardMarkup

        if self.input_message_content is not None:
            array['input_message_content'] = self.input_message_content.to_array()  # type InputMessageContent

        return array
885843
public String[][] toWordTagNerArray(NERTagSet tagSet)
    {
        List<String[]> tupleList = Utility.convertSentenceToNER(this, tagSet);
        String[][] result = new String[3][tupleList.size()];
        Iterator<String[]> iterator = tupleList.iterator();
        for (int i = 0; i < result[0].length; i++)
        {
            String[] tuple = iterator.next();
            for (int j = 0; j < 3; ++j)
            {
                result[j][i] = tuple[j];
            }
        }
        return result;
    }
661868
public Collection<Group> getGroups() throws FlickrException {
        GroupList<Group> groups = new GroupList<Group>();

        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("method", METHOD_GET_GROUPS);

        Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret);
        if (response.isError()) {
            throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
        }
        Element groupsElement = response.getPayload();
        groups.setPage(groupsElement.getAttribute("page"));
        groups.setPages(groupsElement.getAttribute("pages"));
        groups.setPerPage(groupsElement.getAttribute("perpage"));
        groups.setTotal(groupsElement.getAttribute("total"));
        NodeList groupNodes = groupsElement.getElementsByTagName("group");
        for (int i = 0; i < groupNodes.getLength(); i++) {
            Element groupElement = (Element) groupNodes.item(i);
            Group group = new Group();
            group.setId(groupElement.getAttribute("id"));
            group.setName(groupElement.getAttribute("name"));
            group.setAdmin("1".equals(groupElement.getAttribute("admin")));
            group.setPrivacy(groupElement.getAttribute("privacy"));
            group.setIconServer(groupElement.getAttribute("iconserver"));
            group.setIconFarm(groupElement.getAttribute("iconfarm"));
            group.setPhotoCount(groupElement.getAttribute("photos"));
            groups.add(group);
        }
        return groups;
    }