get list of indices and codes
        params:
            as_json: True | False
        returns: a list | json of index codes
491373
def get_index_list(self, as_json=False):
        

        url = self.index_url
        req = Request(url, None, self.headers)
        # raises URLError or HTTPError
        resp = self.opener.open(req)
        resp = byte_adaptor(resp)
        resp_list = json.load(resp)['data']
        index_list = [str(item['name']) for item in resp_list]
        return self.render_response(index_list, as_json)
1369399
def get_settings_json(self):
        
        return {
            'scanner': None if self.scanner is None else self.scanner.save(),
            'parser': None if self.parser is None else self.parser.save()
        }
850021
def AsJsonString(self):
        
        return json.dumps(self.AsDict(dt=False), sort_keys=True)
966971
def get_codes(s: Union[str, 'ChainedBase']) -> List[str]:
    
    return codegrabpat.findall(str(s))
237965
def get_json_online(self, url):
        
        if not requests:
            return False
        try:
            req = requests.get(url, timeout=.2)
            if not req.ok:
                return []
            return req
        except (requests.exceptions.ConnectTimeout, requests.exceptions.ConnectionError,
                requests.exceptions.ReadTimeout):
            return []
590366
def as_json(options=nil)
      actions = []
      indices.add_indices.each do |index|
        operation = { :index => index, :alias => name }
        operation.update( { :routing => routing } ) if respond_to?(:routing) and routing
        operation.update( { :filter  => filter } )  if respond_to?(:filter)  and filter
        actions.push( { :add => operation } )
      end

      indices.remove_indices.each do |index|
        operation = { :index => index, :alias => name }
        actions.push( { :remove => operation } )
      end

      { :actions => actions }
    end
809636
def get_params():
    

    parser = get_params_parser()
    args = parser.parse_args()

    if not args.enrich_only and not args.only_identities and not args.only_studies:
        if not args.index:
            # Check that the raw index name is defined
            print("[error] --index <name> param is required when collecting items from raw")
            sys.exit(1)

    return args
405293
def get_scans(self):
        
        code, data = self.send_request('/scans/', method='GET')

        if code != 200:
            msg = 'Failed to retrieve scans. Unexpected code %s'
            raise APIException(msg % code)

        scans = data.get('items', None)

        if scans is None:
            raise APIException('Failed to retrieve scans, no "items" in JSON.')

        scan_instances = []
        for scan_json in scans:
            scan_id = scan_json['id']
            scan_status = scan_json['status']
            scan = Scan(self, scan_id=scan_id, status=scan_status)
            scan_instances.append(scan)

        return scan_instances
243902
def as_json_dict(self):
        
        data = {}
        for key, value in self.__dict__.items():
            camel_key = utils.to_camel_case(key)
            if isinstance(value, (list, tuple, set)):
                data[camel_key] = list()
                for item in value:
                    if hasattr(item, 'as_json_dict'):
                        data[camel_key].append(item.as_json_dict())
                    else:
                        data[camel_key].append(item)

            elif hasattr(value, 'as_json_dict'):
                data[camel_key] = value.as_json_dict()
            elif value is not None:
                data[camel_key] = value

        return data
1137418
def json(self, *,  # type: ignore
             loads: Callable[[Any], Any]=json.loads) -> None:
        
        return loads(self.data)
189627
def get_params(self, deep=False):
        
        attrs = self.__dict__
        for attr in self._include:
            attrs[attr] = getattr(self, attr)

        if deep is True:
            return attrs
        return dict([(k,v) for k,v in list(attrs.items()) \
                     if (k[0] != '_') \
                        and (k[-1] != '_') \
                        and (k not in self._exclude)])
1073692
def dict(self):
        

        json_list = []
        for step in self.steps:
            json_list.append(step.dict)
        return json_list
921697
def json(self):
        

        data = {
            "segment_name": self.segment_name,
            "formula": self.formula,
            "warnings": [w.json() for w in self.warnings],
            "model_params": self.model_params,
        }
        return data
250178
def list_assets(self):
        
        response = self.requests_session.get(self._base_url).content
        if not response:
            return {}

        try:
            asset_list = json.loads(response)
        except TypeError:
            asset_list = None
        except ValueError:
            raise ValueError(response.decode('UTF-8'))

        if not asset_list:
            return []

        if 'ids' in asset_list:
            return asset_list['ids']
        return []
1089431
def get_indexes(self):
        
        ret = {}
        for index in self.iter_query_indexes():
            ret[index.name] = index
        return ret
858135
def get_stock_codes(self, cached=True, as_json=False):
        
        url = self.stocks_csv_url
        req = Request(url, None, self.headers)
        res_dict = {}
        if cached is not True or self.__CODECACHE__ is None:
            # raises HTTPError and URLError
            res = self.opener.open(req)
            if res is not None:
                # for py3 compat covert byte file like object to
                # string file like object
                res = byte_adaptor(res)
                for line in res.read().split('\n'):
                    if line != '' and re.search(',', line):
                        (code, name) = line.split(',')[0:2]
                        res_dict[code] = name
                    # else just skip the evaluation, line may not be a valid csv
            else:
                raise Exception('no response received')
            self.__CODECACHE__ = res_dict
        return self.render_response(self.__CODECACHE__, as_json)
461079
async def get_all(self, url, params=None):
        
        if not params:
            params = {}
        items = []
        next_page_token = None

        while True:
            if next_page_token:
                params['pageToken'] = next_page_token
            response = await self.get_json(url, params=params)

            items.append(response)
            next_page_token = response.get('nextPageToken')
            if not next_page_token:
                break
        return items