Return the number of datasets of user's organizations.
487209
def datasets_org_count(self):
        """"""
        from udata.models import Dataset  # Circular imports.
        return sum(Dataset.objects(organization=org).visible().count()
                   for org in self.organizations)
486173
def get_dataset_list(self):
        
        url = self.address + "/datasets"
        header = self.__check_authentication()
        response = requests.get(url, headers=header)
        response = response.json()
        datasets = response.get("datasets")
        res = pd.DataFrame.from_dict(datasets)
        return self.process_info_list(res, "info")
843312
def count(cls, user_id):
        
        return cls.query.with_entities(
            cls.user_id).filter_by(user_id=user_id).count()
1069851
def list(self):
        """"""
        mask = """mask[availableInstanceCount, occupiedInstanceCount,
instances[id, billingItem[description, hourlyRecurringFee]], instanceCount, backendRouter[datacenter]]"""
        results = self.client.call('Account', 'getReservedCapacityGroups', mask=mask)
        return results
445494
def get_filters_values(self):
        """"""
        # DATASETS --
        # badges
        self._DST_BADGES = requests.get(self.base_url + "datasets/badges/").json()
        # licences
        self._DST_LICENSES = {
            l.get("id"): l.get("title")
            for l in requests.get(self.base_url + "datasets/licenses").json()
        }
        # frequencies
        self._DST_FREQUENCIES = {
            f.get("id"): f.get("label")
            for f in requests.get(self.base_url + "datasets/frequencies").json()
        }
        # ORGANIZATIONS --
        # badges
        self._ORG_BADGES = requests.get(self.base_url + "organizations/badges/").json()
        # # licences
        # self._DST_LICENSES = {l.get("id"): l.get("title")
        #                   for l in requests.get(self.base_url + "datasets/licenses").json()}
        # # frequencies
        # self._DST_FREQUENCIES = {f.get("id"): f.get("label")
        #                      for f in requests.get(self.base_url + "datasets/frequencies").json()}
        # SPATIAL --
        # granularities
        self._GRANULARITIES = {
            g.get("id"): g.get("name")
            for g in requests.get(self.base_url + "spatial/granularities").json()
        }
        # levels
        self._LEVELS = {
            g.get("id"): g.get("name")
            for g in requests.get(self.base_url + "spatial/levels").json()
        }
        # MISC --
        # facets
        self._FACETS = (
            "all",
            "badge",
            "featured",
            "format",
            "geozone",
            "granularity",
            "license",
            "owner",
            "organization",
            "reuses",
            "tag",
            "temporal_coverage",
        )
        # reuses
        self._REUSES = ("none", "few", "quite", "many")
26670
def loaded_dataset_ids(self):
        """"""
        return set(ds_id for scene in self.scenes for ds_id in scene.keys())
1294304
def count_of_user(user_id):
        '''
        
        '''
        return TabCollect.select(
            TabCollect, TabPost.uid.alias('post_uid'),
            TabPost.title.alias('post_title'),
            TabPost.view_count.alias('post_view_count')
        ).where(
            TabCollect.user_id == user_id
        ).join(
            TabPost, on=(TabCollect.post_id == TabPost.uid)
        ).count()
572227
def getDataset(self, itemId):
        """"""
        if self._url.lower().find('datasets') > -1:
            url = self._url
        else:
            url = self._url + "/datasets"
        return OpenDataItem(url=url,
                            itemId=itemId,
                            securityHandler=self._securityHandler,
                            proxy_url=self._proxy_url,
                            proxy_port=self._proxy_port)
97502
def list_organizations(self):
        """"""

        try:
            res = self._send_request('GET', self._org_url, '', 'organizations')
            if res and res.status_code in self._resp_ok:
                return res.json()
        except dexc.DfaClientRequestFailed:
            LOG.error("Failed to send request to DCNM.")
103838
def list_datasets():
    """"""
    lines = []
    for name, resource in itertools.chain(LOCAL_DATASETS.items(), REMOTE_DATASETS.items()):

        if isinstance(resource, LocalFileMetadata):
            location = "local: {}".format(resource.filename)
        elif isinstance(resource, RemoteFileMetadata):
            location = "remote: {}".format(resource.url)
        else:
            location = "unknown"
        lines.append("{}\n{}\n{}\n{}".format(name, "=" * len(name), resource.description, location))

    return "\n\n{}\n\n".format(10 * "-").join(lines)
1336315
def users(self, drop_collections = True):
        
        base_df = self._data
        if drop_collections is True:
            out_df = self._drop_collections(base_df)
        else:
            out_df = base_df
        return out_df
392221
def _handle_userCount(self, data):
        """"""

        self.room.user_count = data
        self.conn.enqueue_data("user_count", self.room.user_count)
913550
def get_users(self, fetch=True):
        """"""
        return Users(self.resource.users, self.client, populate=fetch)
713960
def count(self, **query_dict):
        """"""
        param_dict = query_dict.copy()
        param_dict['count'] = 0
        resp_dict = self._get_query(**param_dict)
        return resp_dict['response']['numFound']
254311
function Dataset(sc, dependencies) {
  this.id = sc.datasetIdCounter++;
  this.dependencies = dependencies || [];
  this.persistent = false;
  this.sc = sc;
}
191272
def download_organizations():
    ""

    response = requests.get(URL)
    data = response.json()
    organizations = [organization["properties"] for organization in data["features"]]
    return rows.import_from_dicts(organizations)
337729
def rpc_get_num_names( self, **con_info ):
        
        db = get_db_state(self.working_dir)
        num_names = db.get_num_names()
        db.close()

        return self.success_response( {'count': num_names} )