List VRFs matching a search criteria
491967
def list_vrf(arg, opts, shell_opts):
    

    search_string = ''
    if type(arg) == list or type(arg) == tuple:
        search_string = ' '.join(arg)

    offset = 0
    limit = 100
    while True:
        res = VRF.smart_search(search_string, { 'offset': offset, 'max_result': limit })
        if offset == 0:
            if shell_opts.show_interpretation:
                print("Query interpretation:")
                _parse_interp_vrf(res['interpretation'])

            if res['error']:
                print("Query failed: %s" % res['error_message'])
                return

            if len(res['result']) == 0:
                print("No VRFs matching '%s' found." % search_string)
                return

            print("%-16s %-22s %-2s %-40s" % ("VRF RT", "Name", "#", "Description"))
            print("--------------------------------------------------------------------------------")

        for v in res['result']:
            tags = '-'
            if len(v.tags) > 0:
                tags = '#%d' % len(v.tags)
            if len(str(v.description)) > 100:
                desc = v.description[0:97] + "..."
            else:
                desc = v.description
            print("%-16s %-22s %-2s %-40s" % (v.rt or '-', v.name, tags, desc))

        if len(res['result']) < limit:
            break
        offset += limit
114580
async def List(self, arches, region, root_storage_type, series, stream, virt_type):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='ImageMetadata',
                   request='List',
                   version=2,
                   params=_params)
        _params['arches'] = arches
        _params['region'] = region
        _params['root-storage-type'] = root_storage_type
        _params['series'] = series
        _params['stream'] = stream
        _params['virt-type'] = virt_type
        reply = await self.rpc(msg)
        return reply
454604
def getall(self):
        
        vrfs_re = re.compile(r'(?<=^vrf definition\s)(\w+)', re.M)

        response = dict()
        for vrf in vrfs_re.findall(self.config):
            response[vrf] = self.get(vrf)
        return response
1248982
def matches(self, filter_props):
        """"""
        if filter_props is None:
            return False

        found_one = False
        for key, value in filter_props.items():
            if key in self.properties and value != self.properties[key]:
                return False
            elif key in self.properties and value == self.properties[key]:
                found_one = True

        return found_one
62522
def volume_list(search_opts=None, profile=None, **kwargs):
    '''
    

    '''
    conn = _auth(profile, **kwargs)
    return conn.volume_list(search_opts=search_opts)
1179510
def vif_list(name, call=None, kwargs=None):
    '''
    

    '''
    if call == 'function':
        raise SaltCloudSystemExit(
            'This function must be called with -a, --action argument.'
        )
    if name is None:
        return 'A name kwarg is rquired'
    ret = {}
    data = {}
    session = _get_session()
    vm = _get_vm(name)
    vifs = session.xenapi.VM.get_VIFs(vm)
    if vifs is not None:
        x = 0
        for vif in vifs:
            vif_record = session.xenapi.VIF.get_record(vif)
            data['vif-{}'.format(x)] = vif_record
            x += 1
    ret[name] = data
    return ret
404679
def _search_vals(self, compiled_pattern, fld_val):
        """"""
        matches = []
        if isinstance(fld_val, set):
            for val in fld_val:
                self._search_val(matches, compiled_pattern, val)
        elif isinstance(fld_val, str):
            self._search_val(matches, compiled_pattern, fld_val)
        return matches
805711
def list_(ctx, search_string, reverse, backend, used, inactive):
    
    if not reverse:
        list_aliases(ctx, search_string, backend, used, inactive=inactive)
    else:
        show_mapping(ctx, search_string, backend)
134300
@Action(semantics = SemanticsOf.SAFE)
    public List<ApplicationRole> findMatching(String search) {
        if (search != null && search.length() > 0 ) {
            return findNameContaining(search);
        }
        return Lists.newArrayList();
    }
553653
def list_(profile="splunk"):
    '''
    
    '''
    client = _get_splunk(profile)
    searches = [x['name'] for x in client.saved_searches]
    return searches
512070
def list_ar (archive, compression, cmd, verbosity, interactive):
    """"""
    opts = 't'
    if verbosity > 1:
        opts += 'v'
    return [cmd, opts, archive]
277595
private Collection<FsItemEx> findRecursively(FsItemFilter filter,
			FsItem root)
	{
		List<FsItemEx> results = new ArrayList<FsItemEx>();
		FsVolume vol = root.getVolume();
		for (FsItem child : vol.listChildren(root))
		{
			if (vol.isFolder(child))
			{
				results.addAll(findRecursively(filter, child));
			}
			else
			{
				FsItemEx item = new FsItemEx(child, this);
				if (filter.accepts(item))
					results.add(item);
			}
		}

		return results;
	}
56073
def _where(self, filter_fn):
        '''  '''
        assert callable(filter_fn), 'filter_fn needs to be callable'
        return VList(i for i in self if filter_fn(i()))
805398
def query(self, base, filterstr, attrlist=None):
		
		return self.conn.search_s(base, ldap.SCOPE_SUBTREE, filterstr, attrlist)
127488
def film_search(self, title):
        """"""
        films = []
        #check for cache or update
        if not hasattr(self, 'film_list'):
            self.get_film_list()
        #iterate over films and check for fuzzy string match    
        for film in self.film_list:
            strength = WRatio(title, film['title'])
            if  strength > 80:
                film.update({u'strength':strength})
                films.append(film)
        #sort films by the strength of the fuzzy string match
        films_sorted = sorted(films, key=itemgetter('strength'), reverse = True)
        return films_sorted
943102
def Search(self,key):
		

		results = []
		for disk in self.disks:
			if disk.id.lower().find(key.lower()) != -1:  results.append(disk)
			# TODO - search in list to match partial mount points
			elif key.lower() in disk.partition_paths:  results.append(disk)

		return(results)
1007751
def get_list(
        self,
        search='',
        start=0,
        limit=0,
        order_by='',
        order_by_dir='ASC',
        published_only=False,
        minimal=False
    ):
        

        parameters = {}
        args = ['search', 'start', 'limit', 'minimal']
        for arg in args:
            if arg in locals() and locals()[arg]:
                parameters[arg] = locals()[arg]
        if order_by:
            parameters['orderBy'] = order_by
        if order_by_dir:
            parameters['orderByDir'] = order_by_dir
        if published_only:
            parameters['publishedOnly'] = 'true'
        response = self._client.session.get(
            self.endpoint_url, params=parameters
        )
        return self.process_response(response)