calls 'get_all' on the given API with a search name and returns the ID of the entity retrieved, if any, None otherwise
    :param api: api to search
    :param search_name: name to test for
    :return ID of entity matching search_name, None otherwise
198183
def get_id_by_name(api, search_name):
    
    entities = api.get_all(q='name==' + "'" + search_name + "'").content
    if entities:
        return entities[0].id
    return
1272228
def get_scope_by_name(self, scope_name):
        
        query_parameters = {}
        if scope_name is not None:
            query_parameters['scopeName'] = self._serialize.query('scope_name', scope_name, 'str')
        response = self._send(http_method='GET',
                              location_id='4e11e2bf-1e79-4eb5-8f34-a6337bd0de38',
                              version='5.0-preview.2',
                              query_parameters=query_parameters)
        return self._deserialize('IdentityScope', response)
851948
def get_by_name(self, name):
        
        scopes = self._client.get_all()
        result = [x for x in scopes if x['name'] == name]
        return result[0] if result else None
786096
def get_by_name(self, name, alias=None):
        """"""
        search_filter = "[?name=='{}']".format(name)

        if alias:
            if self.version == 1:
                search_filter = "accounts[?name=='{name}' || contains(alias, '{name}')]".format(name=name)

            elif self.version == 2:
                search_filter = "[?name=='{name}' || contains(aliases, '{name}')]".format(name=name)

        return self.get_all(search_filter)
706368
def get_service_name(self, name, search_filter):
        
        service_filter = "services[?name=='{}'].metadata.name".format(name)
        return one(jmespath.search(service_filter, self.get(search_filter)))
1235097
def find_api_id(self):
        """"""
        allapis = self.client.get_rest_apis()
        api_name = self.trigger_settings['api_name']
        api_id = None
        for api in allapis['items']:
            if api['name'] == api_name:
                api_id = api['id']
                self.log.info("Found API for: %s", api_name)
                break
        else:
            api_id = self.create_api()

        return api_id
321800
def get_by_name(self, name: str) -> List[Account]:
        
        # return self.query.filter(Account.name == name).all()
        return self.get_by_name_from(self.book.root, name)
1111618
def get_api_params(self):
        
        result = self.params
        if type(result) != dict:
            raise ValueError(
                '{}.params should return dictionary'.format(
                    self.__class__.__name__
                )
            )
        return result
799367
def get_api_keys(self, api_id, stage_name):
        
        response = self.apigateway_client.get_api_keys(limit=500)
        stage_key = '{}/{}'.format(api_id, stage_name)
        for api_key in response.get('items'):
            if stage_key in api_key.get('stageKeys'):
                yield api_key.get('id')
586199
def get_query(query_name):
    
    query_file_match = list(
        filter(lambda i: query_name == i.stem, FLAT_QUERIES))
    if not query_file_match:
        return None
    # TODO: Log warning if more than one match
    query_file = query_file_match[0]
    with open(query_file) as f:
        metadata, query_body = frontmatter.parse(f.read())
    result_mod = query_file.suffix.strip('.')
    query_obj = SimpleNamespace(
        name=query_name,
        metadata=metadata,
        path=query_file,
        result_mod=result_mod,
        body=query_body,
        error=False,
        executed=datetime.utcnow().isoformat())
    return query_obj
9737
def find_by_name name
      name = CGI.escape name.downcase.gsub(/\s/, '')
      DynamicModel.new perform_request api_url "summoners/by-name/#{name}"
    end
1242837
def search(query)
      get('/v1/search'.freeze, { q: query })
    rescue => e
      logger.warn "API v1 - Search failed #{e.backtrace}"
      { 'results' => catalog(query) }
    end
1100398
def get(self, name):
        
        parameter = next((p for p in self.parameters if p.name == name), None)
        if parameter is None:
            raise LookupError("Cannot find parameter '" + name + "'.")
        return parameter
1047634
def create_item_returning_id(self, api):
        
        resp = api.create_item(self)
        item = resp.json()
        return item['id']
605395
def get_by_name(self, name):
        
        result = self.get_by("name", name)

        if result:
            data = result[0]
            new_resource = self.new(self._connection, data)
        else:
            new_resource = None

        return new_resource
351959
def get_by_entityid(self, entityid):
		
		data = self.list(entityid=entityid)
		if len(data) == 0:
			return None

		eid = int( next(iter(data)) )
		entity = self.get(eid)

		self.debug(0x01,entity)
		return entity
1207378
def get_api(self, name=None):
        """"""
        if name is None:
            try:
                return self.conf.get("api").copy()
            except:  # NOQA
                raise Exception(f"Couldn't find the API configuration")