Find an asset by key
        E.g.
            shopify.Asset.find('layout/theme.liquid', theme_id=99)
433813
def find(cls, key=None, **kwargs):
        
        if not key:
            return super(Asset, cls).find(**kwargs)

        params = {"asset[key]": key}
        params.update(kwargs)
        theme_id = params.get("theme_id")
        path_prefix = "%s/themes/%s" % (cls.site, theme_id) if theme_id else cls.site

        resource = cls.find_one("%s/assets.%s" % (path_prefix, cls.format.extension), **params)

        if theme_id and resource:
            resource._prefix_options["theme_id"] = theme_id
        return resource
1066384
function(url) {
            var needle = url.replace(/^https?:/, '');
            var assets = µb.availableFilterLists, asset;
            for ( var assetKey in assets ) {
                asset = assets[assetKey];
                if ( asset.content !== 'filters' ) { continue; }
                if ( typeof asset.contentURL === 'string' ) {
                    if ( asset.contentURL.endsWith(needle) ) { return assetKey; }
                    continue;
                }
                if ( Array.isArray(asset.contentURL) === false ) { continue; }
                for ( i = 0, n = asset.contentURL.length; i < n; i++ ) {
                    if ( asset.contentURL[i].endsWith(needle) ) {
                        return assetKey;
                    }
                }
            }
            return url;
        }
653267
def find(self, id):
        """"""
        for sprite in self.sprites:
            if sprite.id == id:
                return sprite

        for sprite in self.sprites:
            found = sprite.find(id)
            if found:
                return found
1008514
def find_by_index(self, cls, index_name, value):
        """"""
        query_args = {
            index_name + '__eq': DynamoMappings.map_index_val(value),
            'index': gsi_name(index_name)
        }

        final_results = []
        for db_result in self.get_class_table(cls).query_2(**query_args):
            obj = cls.from_data(db_result['value'])
            final_results.append(obj)

        return final_results
1050700
def Search(self,key):
		

		results = []
		for template in self.templates:
			if template.id.lower().find(key.lower()) != -1:  results.append(template)
			elif template.name.lower().find(key.lower()) != -1:  results.append(template)

		return(results)
966478
function find(tags, key) {
  var value = null

  tags.some(function(tag) {
    if (tag && tag.type === key) {
      value = tag

      return true
    }

    return false
  })

  return value && value.string
}
722915
function getResource(storeName, item) {
		var res,
			view = this,
			store = $views[storeName];

		res = store && store[item];
		while ((res === undefined) && view) {
			store = view.tmpl[storeName];
			res = store && store[item];
			view = view.parent;
		}
		return res;
	}
704371
def find(self, item_id, basic=False, **kwargs):
        
        if basic:
            return self.transport.GET(url='/item/%d/basic' % item_id)
        return self.transport.GET(kwargs, url='/item/%d' % item_id)
1311078
def get_asset_content_lookup_session(self, proxy):
        """"""
        return getattr(sessions, 'AssetContentLookupSession')(
            provider_session=self._provider_manager.get_asset_content_lookup_session(proxy),
            authz_session=self._get_authz_session(),
            proxy=proxy)
1077688
def query(self, search_model: QueryModel):
        
        self.logger.debug('bdb::get::{}'.format(search_model.query))
        assets = json.loads(requests.post("http://localhost:4000/query", data=search_model.query).content)['data']
        self.logger.debug('bdb::result::len {}'.format(len(assets)))
        assets_metadata = []
        for i in assets:
            try:
                assets_metadata.append(self._get(i['id'])['data']['data'])
            except:
                pass
        return assets_metadata
1131766
function _find( items, id ) {
        for ( var i=0; i < items.length; i++ ) {
            if (items[i].id == id) return i;
        }
    }
339511
def get_property(self, key):
        """"""
        _key = DJANGO_CONF[key]
        return getattr(self, _key, CONF_SPEC[_key])
1298141
def get_assets_by_search(self, asset_query, asset_search):
        """"""
        # Implemented from azosid template for -
        # osid.resource.ResourceSearchSession.get_resources_by_search_template
        if not self._can('search'):
            raise PermissionDenied()
        return self._provider_session.get_assets_by_search(asset_query, asset_search)
1194303
function getItemPropertyKey(itemID, propName) {
	if (itemID === undefined || propName === undefined) {
		throw new Error("itemID and propName are required for keys.getItemPropertyKey")
	}
	return 'I' + itemID + '@' + propName
}
996734
def extract_assets(dstore, what):
    
    qdict = parse(what)
    dic = {}
    dic1, dic2 = dstore['assetcol/tagcol'].__toh5__()
    dic.update(dic1)
    dic.update(dic2)
    arr = dstore['assetcol/array'].value
    for tag, vals in qdict.items():
        cond = numpy.zeros(len(arr), bool)
        for val in vals:
            tagidx, = numpy.where(dic[tag] == val)
            cond |= arr[tag] == tagidx
        arr = arr[cond]
    return ArrayWrapper(arr, dic)
1263423
def _get_item(self, package, flavor):
        """"""

        for item in package['items']:
            if item['keyName'] == flavor:
                return item

        raise SoftLayer.SoftLayerError("Could not find valid item for: '%s'" % flavor)
378028
def FindByName(cls, name):
        """"""

        reg = ComponentRegistry()
        for _, entry in reg.load_extensions('iotile.auth_provider', name_filter=name):
            return entry