Perform a GET query against the CIS
321028
def _get(url, use_kerberos=None, debug=False):
    
    from ligo.org import request

    # perform query
    try:
        response = request(url, debug=debug, use_kerberos=use_kerberos)
    except HTTPError:
        raise ValueError("Channel not found at URL %s "
                         "Information System. Please double check the "
                         "name and try again." % url)

    if isinstance(response, bytes):
        response = response.decode('utf-8')
    return json.loads(response)
122791
def get_query(self, q, request):
        
        return Project.objects.filter(
            Q(pid__icontains=q)
            | Q(name__icontains=q)
        )
727924
def get(self, sys_id=None, limit=100):
        

        if sys_id:
            return self.resource.get(query={'table_sys_id': sys_id, 'table_name': self.table_name}).all()

        return self.resource.get(query={'table_name': self.table_name}, limit=limit).all()
784195
def get(method, hmc, uri, uri_parms, logon_required):
        """"""
        query_str = uri_parms[0]
        try:
            console = hmc.consoles.lookup_by_oid(None)
        except KeyError:
            raise InvalidResourceError(method, uri)
        result_user_roles = []
        filter_args = parse_query_parms(method, uri, query_str)
        for user_role in console.user_roles.list(filter_args):
            result_user_role = {}
            for prop in user_role.properties:
                if prop in ('object-uri', 'name', 'type'):
                    result_user_role[prop] = user_role.properties[prop]
            result_user_roles.append(result_user_role)
        return {'user-roles': result_user_roles}
1154678
def _build_query(self, uri, params=None, action_token_type=None):
        """"""

        if params is None:
            params = QueryParams()

        params['response_format'] = 'json'

        session_token = None

        if action_token_type in self._action_tokens:
            # Favor action token
            using_action_token = True
            session_token = self._action_tokens[action_token_type]
        else:
            using_action_token = False
            if self._session:
                session_token = self._session['session_token']

        if session_token:
            params['session_token'] = session_token

        # make order of parameters predictable for testing
        keys = list(params.keys())
        keys.sort()

        query = urlencode([tuple([key, params[key]]) for key in keys])

        if not using_action_token and self._session:
            secret_key_mod = int(self._session['secret_key']) % 256

            signature_base = (str(secret_key_mod) +
                              self._session['time'] +
                              uri + '?' + query).encode('ascii')

            query += '&signature=' + hashlib.md5(signature_base).hexdigest()

        return query
337056
def get(self, path, query, **options):
        """"""
        api_options = self._parse_api_options(options, query_string=True)
        query_options = self._parse_query_options(options)
        parameter_options = self._parse_parameter_options(options)

        # options in the query takes precendence
        query = _merge(query_options, api_options, parameter_options, query)
        return self.request('get', path, params=query, **options)
923079
def _query(action=None,
           command=None,
           args=None,
           method='GET',
           header_dict=None,
           data=None):
    '''
    
    '''
    vm_ = get_configured_provider()
    apikey = config.get_cloud_config_value(
        'apikey', vm_, __opts__, search_global=False
    )
    sharedsecret = config.get_cloud_config_value(
        'sharedsecret', vm_, __opts__, search_global=False
    )

    path = 'https://api.gogrid.com/api/'

    if action:
        path += action

    if command:
        path += '/{0}'.format(command)

    log.debug('GoGrid URL: %s', path)

    if not isinstance(args, dict):
        args = {}

    epoch = six.text_type(int(time.time()))
    hashtext = ''.join((apikey, sharedsecret, epoch))
    args['sig'] = salt.utils.hashutils.md5_digest(hashtext)
    args['format'] = 'json'
    args['v'] = '1.0'
    args['api_key'] = apikey

    if header_dict is None:
        header_dict = {}

    if method != 'POST':
        header_dict['Accept'] = 'application/json'

    decode = True
    if method == 'DELETE':
        decode = False

    return_content = None
    result = salt.utils.http.query(
        path,
        method,
        params=args,
        data=data,
        header_dict=header_dict,
        decode=decode,
        decode_type='json',
        text=True,
        status=True,
        opts=__opts__,
    )
    log.debug('GoGrid Response Status Code: %s', result['status'])

    return result['dict']
852328
def get(query_url,
            headers: {})
      HttpRequest.new(HttpMethodEnum::GET,
                      query_url,
                      headers: headers)
    end
348023
def _get_query(self, cursor):
        '''
        
        '''
        query = {'q':'*:*',
                'sort':'id desc',
                'rows':self._rows,
                'cursorMark':cursor}
        if self._date_field:
            query['sort'] = "{} asc, id desc".format(self._date_field)
        if self._per_shard:
            query['distrib'] = 'false'
        return query
478618
def query(self, query, **kwargs):
        """"""
        if not self.connection:
            if not self.connect():
                return CasparResponse(500, "Unable to connect CasparCG server")

        query = query.strip()
        if kwargs.get("verbose", True):
            if not query.startswith("INFO"):
                logging.debug("Executing AMCP: {}".format(query))
        query += "\r\n"

        if PYTHON_VERSION >= 3:
            query = bytes(query.encode("utf-8"))
            delim = bytes("\r\n".encode("utf-8"))
        else:
            delim = "\r\n"

        try:
            self.connection.write(query)
            result = self.connection.read_until(delim).strip()
        except Exception:
            log_traceback()
            return CasparResponse(500, "Query failed")

        if PYTHON_VERSION >= 3:
            result = result.decode("UTF-8")

        if not result:
            return CasparResponse(500, "No result")

        try:
            if result[0:3] == "202":
                return CasparResponse(202, "No result")

            elif result[0:3] in ["201", "200"]:
                stat = int(result[0:3])
                result = decode_if_py3(self.connection.read_until(delim)).strip()
                return CasparResponse(stat, result)

            elif int(result[0:1]) > 3:
                stat = int(result[0:3])
                return CasparResponse(stat, result)
        except Exception:
            log_traceback()
            return CasparResponse(500, "Malformed result: {}".format(result))
        return CasparResponse(500, "Unexpected result: {}".format(result))
162048
def do_GET(self):
        
        if self.path.startswith(args.serve_url):
            res = None
            log_res = None
            mode = None
            params = urlparse.parse_qs(self.path[len(args.serve_url):])
            if "otp" in params:
                if args.mode_short_otp:
                    # YubiKey internal db OTP in KSM mode
                    mode = 'YubiKey OTP (short)'
                    res = validate_yubikey_otp_short(self, params)
                elif args.mode_otp:
                    # YubiKey internal db OTP validation 2.0
                    mode = 'YubiKey OTP'
                    res = validate_yubikey_otp(self, params)
                    #status = [x for x in res.split('\n') if x.startswith("status=")]
                    #if len(status) == 1:
                    #    res = status[0][7:]
                    log_res = '&'.join(res.split('\n'))
                else:
                    res = "ERR 'otp/otp2' disabled"
            elif "hotp" in params:
                if args.mode_hotp:
                    mode = 'OATH-HOTP'
                    res = validate_oath_hotp(self, params)
                else:
                    res = "ERR 'hotp' disabled"
            elif "totp" in params:
                if args.mode_totp:
                    mode = 'OATH-TOTP'
                    res = validate_oath_totp(self, params)
                else:
                    res = "ERR 'totp' disabled"
            elif "pwhash" in params:
                if args.mode_pwhash:
                    mode = 'Password hash'
                    res = validate_pwhash(self, params)
                else:
                    res = "ERR 'pwhash' disabled"

            if not log_res:
                log_res = res

            self.log_message("%s validation result: %s -> %s", mode, self.path, log_res)

            if res != None:
                self.send_response(200)
                self.send_header('Content-type', 'text/plain')
                self.end_headers()
                self.wfile.write(res)
                self.wfile.write("\n")
            else:
                self.log_error ("No validation result to '%s' (responding 403)" % (self.path))
                self.send_response(403, 'Forbidden')
                self.end_headers()
        else:
            self.log_error ("Bad URL '%s' - I'm serving '%s' (responding 403)" % (self.path, args.serve_url))
            self.send_response(403, 'Forbidden')
            self.end_headers()
767395
def get(path, params = nil, headers = {}, auth = true)
      request(path: path, query: params, headers: headers, auth: auth)
    end
1122357
def query(self):
        
        query_context = QueryContext(**json.loads(request.form.get('query_context')))
        security_manager.assert_datasource_permission(query_context.datasource)
        payload_json = query_context.get_payload()
        return json.dumps(
            payload_json,
            default=utils.json_int_dttm_ser,
            ignore_nan=True,
        )
1344204
def _query(action=None,
           routing_key=None,
           args=None,
           method='GET',
           header_dict=None,
           data=None):
    '''
    
    '''
    api_key = __salt__['config.get']('victorops.api_key') or \
        __salt__['config.get']('victorops:api_key')

    path = 'https://alert.victorops.com/integrations/generic/20131114/'

    if action:
        path += '{0}/'.format(action)

    if api_key:
        path += '{0}/'.format(api_key)

    if routing_key:
        path += routing_key

    log.debug('VictorOps URL: %s', path)

    if not isinstance(args, dict):
        args = {}

    if header_dict is None:
        header_dict = {'Content-type': 'application/json'}

    if method != 'POST':
        header_dict['Accept'] = 'application/json'

    decode = True
    if method == 'DELETE':
        decode = False

    result = salt.utils.http.query(
        path,
        method,
        params=args,
        data=data,
        header_dict=header_dict,
        decode=decode,
        decode_type='json',
        text=True,
        status=True,
        cookies=True,
        persist_session=True,
        opts=__opts__,
    )
    if 'error' in result:
        log.error(result['error'])
        return [result['status'], result['error']]

    return [result['status'], result.get('dict', {})]
1338855
def get(method, hmc, uri, uri_parms, logon_required):
        """"""
        query_str = uri_parms[0]
        result_cpcs = []
        filter_args = parse_query_parms(method, uri, query_str)
        for cpc in hmc.cpcs.list(filter_args):
            result_cpc = {}
            for prop in cpc.properties:
                if prop in ('object-uri', 'name', 'status'):
                    result_cpc[prop] = cpc.properties[prop]
            result_cpcs.append(result_cpc)
        return {'cpcs': result_cpcs}
17177
def query(self, url, method="GET", params=dict(), headers=dict()):
        
        access_token = self._get_at_from_session()
        oauth = OAuth1(
            self.consumer_key,
            client_secret=self.secret_key,
            resource_owner_key=access_token['oauth_token'],
            resource_owner_secret=access_token['oauth_token_secret'])
        response = getattr(requests, method.lower())(url,
                                                     auth=oauth,
                                                     headers=headers,
                                                     params=params)
        if response.status_code != 200:
            raise OAuthError(
                _('No access to private resources at "%s".')
                % get_token_prefix(self.request_token_url))

        return response.text
1008354
def hmget(key, *fields, **options):
    '''
    
    '''
    host = options.get('host', None)
    port = options.get('port', None)
    database = options.get('db', None)
    password = options.get('password', None)
    server = _connect(host, port, database, password)
    return server.hmget(key, *fields)