:param tagnames:
            tagnames of lengths T1, T2, ... respectively
        :returns:
            the values of the exposure aggregated by tagnames as an array
            of shape (T1, T2, ..., L)
978294
def agg_value(self, *tagnames):
        
        aval = numpy.zeros((len(self), len(self.loss_types)), F32)  # (A, L)
        for asset in self:
            for lti, lt in enumerate(self.loss_types):
                if lt == 'occupants':
                    aval[asset['ordinal'], lti] = asset[lt + '_None']
                else:
                    aval[asset['ordinal'], lti] = asset['value-' + lt]
        return self.aggregate_by(list(tagnames), aval)
1209454
def tag_array(events):
    
    all_tags = sorted(set(tag for event in events for tag in event.tags))
    array = np.zeros((len(events), len(all_tags)))
    for row, event in enumerate(events):
        for tag in event.tags:
            array[row, all_tags.index(tag)] = 1
    return array
1348652
function tagSet(tags) {
    var e_1, _a;
    var res = {};
    try {
        for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(tags.split(',')), _c = _b.next(); !_c.done; _c = _b.next()) {
            var t = _c.value;
            res[t] = true;
        }
    }
    catch (e_1_1) { e_1 = { error: e_1_1 }; }
    finally {
        try {
            if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
        }
        finally { if (e_1) throw e_1.error; }
    }
    return res;
}
989281
def extract_exposure_metadata(dstore, what):
    
    dic = {}
    dic1, dic2 = dstore['assetcol/tagcol'].__toh5__()
    dic.update(dic1)
    dic.update(dic2)
    if 'asset_risk' in dstore:
        dic['multi_risk'] = sorted(
            set(dstore['asset_risk'].dtype.names) -
            set(dstore['assetcol/array'].dtype.names))
    names = [name for name in dstore['assetcol/array'].dtype.names
             if name.startswith(('value-', 'number', 'occupants_'))
             and not name.endswith('_None')]
    return ArrayWrapper(numpy.array(names), dic)
650758
function(node, tagNames){
			var i = tagNames.length;
			while(i--) {
				if(node.tagName.toLowerCase() === tagNames[i]) {
					return true;
				}
			}
			return false;
		}
106117
def tags(self):
        
        tags = self.fields['tags']
        return [(t, v) for t in tags for v in tags[t]]
966785
def getDarkCurrentAverages(exposuretimes, imgs):
    '''
    
    '''
    x, imgs_p = sortForSameExpTime(exposuretimes, imgs)
    s0, s1 = imgs[0].shape

    imgs = np.empty(shape=(len(x), s0, s1),
                    dtype=imgs[0].dtype)
    for i, ip in zip(imgs, imgs_p):
        if len(ip) == 1:
            i[:] = ip[0]
        else:
            i[:] = averageSameExpTimes(ip)
    return x, imgs
133241
def tags(*tags)
      if tags.size == 0
        attribute("tags")
      else
        tags = tags[0] if tags.size == 1 && tags[0].kind_of?(Array)
        attribute("tags", tags.map { |tag| tag.to_s })
      end
    end
1229611
def ns(self, prefix, tag):
        
        return etree.QName(self.prefixes[prefix], tag)
1092481
def build_asset_array(assets_by_site, tagnames=(), time_event=None):
    
    for assets in assets_by_site:
        if len(assets):
            first_asset = assets[0]
            break
    else:  # no break
        raise ValueError('There are no assets!')
    loss_types = []
    occupancy_periods = []
    for name in sorted(first_asset.values):
        if name.startswith('occupants_'):
            period = name.split('_', 1)[1]
            if period != 'None':
                # see scenario_risk test_case_2d
                occupancy_periods.append(period)
            loss_types.append(name)
            # discard occupants for different time periods
        else:
            loss_types.append('value-' + name)
    # loss_types can be ['value-business_interruption', 'value-contents',
    # 'value-nonstructural', 'occupants_None', 'occupants_day',
    # 'occupants_night', 'occupants_transit']
    deductible_d = first_asset.deductibles or {}
    limit_d = first_asset.insurance_limits or {}
    if deductible_d or limit_d:
        logging.warning('Exposures with insuranceLimit/deductible fields are '
                        'deprecated and may be removed in the future')
    retro = ['retrofitted'] if first_asset._retrofitted else []
    float_fields = loss_types + retro
    int_fields = [(str(name), U16) for name in tagnames]
    tagi = {str(name): i for i, name in enumerate(tagnames)}
    asset_dt = numpy.dtype(
        [('ordinal', U32), ('lon', F32), ('lat', F32), ('site_id', U32),
         ('number', F32), ('area', F32)] + [
             (str(name), float) for name in float_fields] + int_fields)
    num_assets = sum(len(assets) for assets in assets_by_site)
    assetcol = numpy.zeros(num_assets, asset_dt)
    asset_ordinal = 0
    fields = set(asset_dt.fields)
    for sid, assets_ in enumerate(assets_by_site):
        for asset in assets_:
            asset.ordinal = asset_ordinal
            record = assetcol[asset_ordinal]
            asset_ordinal += 1
            for field in fields:
                if field == 'ordinal':
                    value = asset.ordinal
                elif field == 'number':
                    value = asset.number
                elif field == 'area':
                    value = asset.area
                elif field == 'site_id':
                    value = sid
                elif field == 'lon':
                    value = asset.location[0]
                elif field == 'lat':
                    value = asset.location[1]
                elif field.startswith('occupants_'):
                    value = asset.values[field]
                elif field == 'retrofitted':
                    value = asset.retrofitted()
                elif field in tagnames:
                    value = asset.tagidxs[tagi[field]]
                else:
                    name, lt = field.split('-')
                    value = asset.value(lt, time_event)
                record[field] = value
    return assetcol, ' '.join(occupancy_periods)
1090678
def generated_tag_data(tags):
    
    generated_tags = []
    for key, value in tags.items():
        generated_tags.append({
            'Key': key,
            'Value': value,
        })
    return generated_tags
872186
def tag(self):
        
        return "{}{}_{}{:02d}".format(self.target.prefix,
                                      self,
                                      self.target.version,
                                      self.target.ccd)
170024
def names(self):
        
        result = []
        for key, value in self.iteritems():
            if value & self.bitmask:
                result.append(key)
        return result
976139
def get_tag_params(tag_model):
    ''''''

    tag_model = tag_model.replace('-', '')
    tags = dict()
    tags['W190PD3GT'] = ['Acceleration-X', 'Acceleration-Y', 'Acceleration-Z',
                         'Depth', 'Propeller', 'Temperature']

    # Return tag parameters if found, else raise error
    if tag_model in tags:
        return tags[tag_model]
    else:
        raise KeyError('{} not found in tag dictionary'.format(tag_model))
1205520
def getChildElementsByTagName(self, tagName):
    
    result = []
    for child in self.childNodes:
        if isinstance(child, Element):
            if child.tagName == tagName:
                result.append(child)
    return result
799130
def get_tags(self, tagtype):
        '''  '''
        return [t for t in self.__tags if t.tagtype == tagtype]
887773
def var_str(name, shape):
    

    size = prod(shape)
    ind = (indices(shape) + 1).reshape(-1, size)
    names = ['[' + ','.join(list(map(str, i))) + ']' for i in zip(*ind)]
    names[0] = '%s %s' % (name, names[0])
    return names