Gets the top-level lists available from the API.

        Returns:
          A dict respresentation of the JSON returned from the API.
196849
def lists(self, **kwargs):
        
        path = self._get_path('lists')

        response = self._GET(path, kwargs)
        self._set_attrs_to_values(response)
        return response
434460
def to_json(self):
        
        endpoints = []
        for endpoint in self.endpoints:
            list_fields = endpoint.fields
            resource_type = endpoint.Meta.resource_type
            table = endpoint.Meta.table

            data = endpoint.to_dict()
            data['fields'] = resource_type.get_type_of_fields(
                list_fields,
                table,
            )
            endpoints.append(data)

        data = {
            'title': self.title,
            'endpoints': sorted(endpoints, key=lambda x: x['name']),
        }

        return json.dumps(data)
443324
def get_items(self):
        
        url = self.build_url(self._endpoints.get('get_items'))

        response = self.con.get(url)

        if not response:
            return []

        data = response.json()

        return [self.list_item_constructor(parent=self,
                                           **{self._cloud_data_key: item})
                for item in data.get('value', [])]
803533
def to_json_basic(self):
        
        return {'name': self.__class__.__name__, 'priority': self.priority,
                'address': self.address, 'rtr': self.rtr}
444393
def as_dict(self):
        

        result_dict = super(Benchmark, self).as_dict()

        statuses = list()
        titles = list()
        descriptions = list()
        front_matters = list()
        rear_matters = list()
        platforms = list()
        version = None
        profiles = list()
        groups = list()

        for child in self.children:
            if isinstance(child, Version):
                version = child.as_dict()
            elif isinstance(child, Status):
                statuses.append(child.as_dict())
            elif isinstance(child, Title):
                titles.append(child.as_dict())
            elif isinstance(child, Description):
                descriptions.append(child.as_dict())
            elif isinstance(child, FrontMatter):
                front_matters.append(child.as_dict())
            elif isinstance(child, RearMatter):
                rear_matters.append(child.as_dict())
            elif isinstance(child, Platform):
                platforms.append(child.as_dict())
            elif isinstance(child, Profile):
                profiles.append(child.as_dict())
            elif isinstance(child, Group):
                groups.append(child.as_dict())

        if version is not None:
            result_dict['version'] = version
        if len(statuses) > 0:
            result_dict['statuses'] = statuses
        if len(titles) > 0:
            result_dict['titles'] = titles
        if len(descriptions) > 0:
            result_dict['descriptions'] = descriptions
        if len(front_matters) > 0:
            result_dict['front_matters'] = front_matters
        if len(rear_matters) > 0:
            result_dict['rear_matters'] = rear_matters
        if len(platforms) > 0:
            result_dict['platforms'] = platforms
        if len(profiles) > 0:
            result_dict['profiles'] = profiles
        if len(groups) > 0:
            result_dict['groups'] = groups

        return result_dict
1036275
def top(self):
        
        # let's get resources from .stats()
        ps_args = "-eo pid,ppid,wchan,args"
        # returns {"Processes": [values], "Titles": [values]}
        # it's easier to play with list of dicts: [{"pid": 1, "ppid": 0}]
        try:
            response = self.d.top(self.container_id, ps_args=ps_args)
        except docker.errors.APIError as ex:
            logger.warning("error getting processes: %r", ex)
            return []
        # TODO: sort?
        logger.debug(json.dumps(response, indent=2))
        return [dict(zip(response["Titles"], process))
                for process in response["Processes"] or []]
741608
def asJSON(self):
        
        self._json = json.dumps(self.asDictionary)
        return self._json
892819
def _dict_of_results(self):
        
        result_json = {}

        result_list = []
        for r in self.results:
            result_list.append({
                'name': r.check_name,
                'ok': r.ok,
                'status': r.status,
                'description': r.description,
                'message': r.message,
                'reference_url': r.reference_url,
                'logs': r.logs,
            })
        result_json["checks"] = result_list
        return result_json
872799
def _as_dict(self) -> Dict[str, JsonTypes]:
        
        return {k: v._as_dict if isinstance(v, JsonObj) else
                   self.__as_list(v) if isinstance(v, list) else
                   v for k, v in self.__dict__.items()}
686718
def _get_apis(self, apis):
        
        ret = []

        for data in apis:
            ret.append(SpecificationAPI(specification=self, data=data))

        return sorted(ret, key=lambda x: x.rest_name[1:])
1141493
def get_node_list(self):
        
        node_objs = list()

        for obj_dict_list in self.obj_dict['nodes'].values():
            node_objs.extend([
                Node(obj_dict=obj_d)
                for obj_d
                in obj_dict_list])

        return node_objs
13183
def statuses(self):
        
        r_json = self._get_json('status')
        statuses = [Status(self._options, self._session, raw_stat_json)
                    for raw_stat_json in r_json]
        return statuses
533421
def get_sections(self):
        
        try:
            obj_list = self.__dict__['sections']
            return [Section(i) for i in obj_list]
        except KeyError:
            self._lazy_load()
            obj_list = self.__dict__['sections']
            return [Section(i) for i in obj_list]
856299
def get_list(self, list_name, options=None):
        
        options = options or {}
        data = {'list': list_name}
        data.update(options)
        return self.api_get('list', data)
420778
def get_list(self, size=100, startIndex=0, searchText="", sortProperty="", sortOrder='ASC', status='Active,Pending'):
        

        url = urljoin(BASEURL, "sites", "list")

        params = {
            'api_key': self.token,
            'size': size,
            'startIndex': startIndex,
            'sortOrder': sortOrder,
            'status': status
        }

        if searchText:
            params['searchText'] = searchText

        if sortProperty:
            params['sortProperty'] = sortProperty

        r = requests.get(url, params)
        r.raise_for_status()
        return r.json()
568162
def all(self):
        
        return self._get_json(HTTPMethods.GET,
                              self._cached_datasets_url,
                              self._get_master_key())
573291
def sources(
            self):
        
        sourceResultsList = []
        sourceResultsList[:] = [dict(l) for l in self.sourceResultsList]
        return sourceResultsList