Make a request to retrieve Wharton GSR listings.
970671
def get_wharton_gsrs(self, sessionid, date=None):
        
        if date:
            date += " {}".format(self.get_dst_gmt_timezone())
        else:
            date = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%S")
        resp = requests.get('https://apps.wharton.upenn.edu/gsr/api/app/grid_view/', params={
            'search_time': date
        }, cookies={
            'sessionid': sessionid
        })
        if resp.status_code == 200:
            return resp.json()
        else:
            raise APIError('Remote server returned status code {}.'.format(resp.status_code))
787352
def get_resp(url):
    """"""
    try:
        headers = {'User-Agent': random.choice(USER_AGENTS)}
        try:
            request = requests.get(url, headers=headers, proxies=get_proxies())
        except MissingSchema:
            url = add_protocol(url)
            request = requests.get(url, headers=headers, proxies=get_proxies())
        return lh.fromstring(request.text.encode('utf-8') if PY2 else request.text)
    except Exception:
        sys.stderr.write('Failed to retrieve {0}.\n'.format(url))
        raise
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)
725972
def fetch_list(cls, client, ids):
        
        results = []
        request_url = "https://api.robinhood.com/options/instruments/"

        for _ids in chunked_list(ids, 50):

            params = {"ids": ",".join(_ids)}
            data = client.get(request_url, params=params)
            partial_results = data["results"]

            while data["next"]:
                data = client.get(data["next"])
                partial_results.extend(data["results"])
            results.extend(partial_results)

        return results
596198
function req (params, spec, errs) {
  for (var key in spec) {
    if (spec[key].req && !params.hasOwnProperty(key)) reqError(key, errs)
  }
}
26725
def get_resources(cls):
        """"""
        exts = []
        parent = dict(member_name=ciscohostingdevicemanager.DEVICE,
                      collection_name=ciscohostingdevicemanager.DEVICES)
        controller = resource.Resource(
            RouterHostingDeviceSchedulerController(), cb_faults.FAULT_MAP)
        exts.append(extensions.ResourceExtension(
            DEVICE_L3_ROUTERS, controller, parent, path_prefix="/dev_mgr"))
        parent = dict(member_name="router",
                      collection_name=l3_const.ROUTERS)
        controller = resource.Resource(
            HostingDevicesHostingRouterController(), cb_faults.FAULT_MAP)
        exts.append(extensions.ResourceExtension(L3_ROUTER_DEVICES, controller,
                                                 parent))
        return exts
723676
def _get_jobs_url(self):
        """"""
        if self._jobs_url is None:
            self.get_instance_status()
            if self._jobs_url is None:
                raise ValueError("Cannot obtain jobs URL")
        return self._jobs_url
1053972
def get(self, request, pk):
        
        self.forum = get_object_or_404(Forum, pk=pk)
        return super().get(request, pk)
211622
def get_registered(self):
        """"""

        doc = self._request(self.ws_prefix + ".getInfo", True)

        return _extract(doc, "registered")
1195206
def listing(self, auth, types, options=None, resource=None, defer=False):
        """"""
        if options is None:
            # This variant is deprecated
            return self._call('listing', auth, [types], defer)
        else:
            if resource is None:
                # This variant is deprecated, too
                return self._call('listing',
                                  auth,
                                  [types, options],
                                  defer)
            else:
                # pass resource to use the non-deprecated variant
                return self._call('listing',
                                  auth,
                                  [resource, types, options],
                                  defer)
1021002
def list(self, request):
        """"""
        query = get_query_params(request).get("search", "")
        results = []
        base = self.model.get_base_class()
        doctypes = indexable_registry.families[base]
        for doctype, klass in doctypes.items():
            name = klass._meta.verbose_name.title()
            if query.lower() in name.lower():
                results.append(dict(
                    name=name,
                    doctype=doctype
                ))
                results.sort(key=lambda x: x["name"])
        return Response(dict(results=results))
538519
def searchResults(self, REQUEST=None, used=None, **kw):
    
    if REQUEST and REQUEST.get('getRequestUID') \
            and self.id == CATALOG_ANALYSIS_LISTING:

        # Fetch all analyses that have the request UID passed in as an ancestor,
        # cause we want Primary ARs to always display the analyses from their
        # derived ARs (if result is not empty)

        request = REQUEST.copy()
        orig_uid = request.get('getRequestUID')

        # If a list of request uid, retrieve them sequentially to make the
        # masking process easier
        if isinstance(orig_uid, list):
            results = list()
            for uid in orig_uid:
                request['getRequestUID'] = [uid]
                results += self.searchResults(REQUEST=request, used=used, **kw)
            return results

        # Get all analyses, those from descendant ARs included
        del request['getRequestUID']
        request['getAncestorsUIDs'] = orig_uid
        results = self.searchResults(REQUEST=request, used=used, **kw)

        # Masking
        primary = filter(lambda an: an.getParentUID == orig_uid, results)
        derived = filter(lambda an: an.getParentUID != orig_uid, results)
        derived_keys = map(lambda an: an.getKeyword, derived)
        results = filter(lambda an: an.getKeyword not in derived_keys, primary)
        return results + derived

    # Normal search
    return self._catalog.searchResults(REQUEST, used, **kw)
1331238
def Get(self):
    """"""

    args = user_management_pb2.ApiGetGrrUserArgs(username=self.username)
    data = self._context.SendRequest("GetGrrUser", args)
    return GrrUser(data=data, context=self._context)
967840
def get_urls(self, order="total_clicks desc", offset=None, count=None):
        
        req_data = [ None, order, fmt_paging(offset, count) ]
        return self.request("query:Message_Url", req_data)
261559
def on_get(resc, req, resp):
    

    signals.pre_req.send(resc.model)
    signals.pre_req_search.send(resc.model)

    models = goldman.sess.store.search(resc.rtype, **{
        'filters': req.filters,
        'pages': req.pages,
        'sorts': req.sorts,
    })

    props = to_rest_models(models, includes=req.includes)
    resp.serialize(props)

    signals.post_req.send(resc.model)
    signals.post_req_search.send(resc.model)
760321
def get_relevant(self, **kwargs):
        
        import warnings
        warnings.warn("get_relevant has been renamed get_relevant_stocks "
                      "and will be deprecated in v0.4.1")
        return self._get_endpoint("relevant", params=kwargs)
936152
def _get_indexes(self):
        """"""
        indexes = {}
        for resource in self._get_elastic_resources():
            try:
                index = self._resource_index(resource)

            except KeyError:  # ignore missing
                continue

            if index not in indexes:
                indexes.update({
                    index: {
                        'resource': self.elastic(resource),
                        'index_settings': {
                            'mappings': {}
                        }
                    }
                })

                settings = self._resource_config(resource, 'SETTINGS')
                if settings:
                    indexes[index]['index_settings'].update(settings)

            resource_config = self.app.config['DOMAIN'][resource]
            properties = self._get_mapping_properties(resource_config, parent=self._get_parent_type(resource))
            datasource = self.get_datasource(resource)
            indexes[index]['index_settings']['mappings'][datasource[0]] = properties

        return indexes