def query_single(self, object_type, url_params, query_params=None):<EOL>
<EOL>self.local_status["<STR_LIT>"] += <NUM_LIT:1><EOL>query_type = object_type + "<STR_LIT:s>"  <EOL>query_path = "<STR_LIT>".format(self.org_id, query_type)<EOL>for component in url_params if url_params else []:<EOL><INDENT>query_path += "<STR_LIT:/>" + urlparse.quote(component, safe='<STR_LIT>')<EOL><DEDENT>if query_params: query_path += "<STR_LIT:?>" + urlparse.urlencode(query_params)<EOL>try:<EOL><INDENT>result = self.make_call(query_path)<EOL>body = result.json()<EOL><DEDENT>except RequestError as re:<EOL><INDENT>if re.result.status_code == <NUM_LIT>:<EOL><INDENT>if self.logger: self.logger.debug("<STR_LIT>",<EOL>object_type, url_params, query_params)<EOL>return {}<EOL><DEDENT>else:<EOL><INDENT>raise re<EOL><DEDENT><DEDENT>if body.get("<STR_LIT:result>") == "<STR_LIT:success>":<EOL><INDENT>value = body.get(object_type, {})<EOL>if self.logger: self.logger.debug("<STR_LIT>", object_type, url_params, query_params)<EOL>return value<EOL><DEDENT>else:<EOL><INDENT>raise ClientError("<STR_LIT>", result)<EOL><DEDENT>
Query for a single object.
:param object_type: string query type (e.g., "users" or "groups")
:param url_params: required list of strings to provide as additional URL components
:param query_params: optional dictionary of query options
:return: the found object (a dictionary), which is empty if none were found