Get a dictionary of enumerations for diseases.

        :param int att_ind_start: Starting index for enumeration.
        :return: Dictionary of disease, number pairs.
763855
def get_disease_mappings(self, att_ind_start):
        
        all_disease_ids = self.get_all_unique_diseases()
        disease_enum = enumerate(all_disease_ids, start=att_ind_start)
        disease_mappings = {}
        for num, dis in disease_enum:
            disease_mappings[dis] = num
        return disease_mappings
880874
def eds(self):
        
        _eds = self.get('eds')
        if _eds is not None:
            if isinstance(_eds, dict):
                _eds = eds.Eds.from_dict(_eds)
            elif isinstance(_eds, stringtypes):
                _eds = eds.loads_one(_eds)
        return _eds
1248025
def variant_indices(self):
        
        variant_start_index = len(self.prefix)
        variant_len = len(self.alt)
        variant_end_index = variant_start_index + variant_len
        return variant_start_index, variant_end_index
649797
def to_dict(self):
        
        d = dict(doses=self.doses, ns=self.ns, incidences=self.incidences)
        d.update(self.kwargs)
        return d
118630
def parse_disease_ids(path: str):
    
    if os.path.isdir(path) or not os.path.exists(path):
        logger.info("Couldn't find the disease identifiers file. Returning empty list.")
        return []

    df = pd.read_csv(path, names=["ID"])
    return set(df["ID"].tolist())
916136
def get_raw_index(self, i):
        
        if self.is_indexed:
            return int(self.order[i])
        if self.data.base is None:
            return int(i)
        return int(self.data_start - self.base_start + i)
504579
def labels_to_indices(self, labels: Sequence[str]) -> List[int]:
        

        return [self.LABEL_TO_INDEX[label] for label in labels]
383863
def dict(self):
        
        from collections import OrderedDict

        d = OrderedDict(
            [(p.key, getattr(self, p.key)) for p in self.__mapper__.attrs if p.key not in ('data',)])

        if 'list' in self.data:
            d['bundle_count'] = len(self.data['list'])
        else:
            d['bundle_count'] = None

        if self.data:
            for k, v in self.data.items():
                d[k] = v

        return d
1353590
def get_all():
    '''
    
    '''
    (enabled_services, disabled_services) = _get_service_list(include_enabled=True,
                                                              include_disabled=True)
    enabled_services.update(dict([(s, []) for s in disabled_services]))
    return odict.OrderedDict(enabled_services)
649098
def _init_get_dict():
        """"""
        get_dict = {'main chain': PandasPdb._get_mainchain,
                    'hydrogen': PandasPdb._get_hydrogen,
                    'c-alpha': PandasPdb._get_calpha,
                    'carbon': PandasPdb._get_carbon,
                    'heavy': PandasPdb._get_heavy}
        return get_dict
1292357
def _get_collisions(indices):
    # type: (...) -> Dict[int, List[int]]
    
    collisions = defaultdict(list)  # type: Dict[int, List[int]]
    for term_id, hash_id in enumerate(indices):
        collisions[hash_id].append(term_id)
    return dict(collisions)
43147
def start_index(self, value):
        """"""
        # TODO: Validate contents?  (May want to set before adding the data.)
        if not isinstance(value, dict):
            raise TypeError('start_index attribute must be a dict.')
        self._start_index = value
1137478
def devices_dict(self):
        """"""
        json_list = {}
        z = 0
        for x in self._raw[ROOT_START_ACTION]:
            if z != self.index:
                json_list.update(x)
            z = z + 1
        return json_list
494020
def dictionary(self):
        
        output = {}
        for i in range(self.topLevelItemCount() - 1):
            item = self.topLevelItem(i)
            output[nativestring(item.text(1))] = nativestring(item.text(2))
        return output
1367977
def get_disease_comments(self, entry):
        
        disease_comments = []
        query = "./comment[@type='disease']"

        for disease_comment in entry.iterfind(query):
            value_dict = {'comment': disease_comment.find('./text').text}

            disease = disease_comment.find("./disease")

            if disease is not None:
                disease_dict = {'identifier': disease.get('id')}

                for element in disease:
                    key = element.tag

                    if key in ['acronym', 'description', 'name']:
                        disease_dict[key] = element.text

                    if key == 'dbReference':
                        disease_dict['ref_id'] = element.get('id')
                        disease_dict['ref_type'] = element.get('type')

                disease_obj = models.get_or_create(self.session, models.Disease, **disease_dict)
                self.session.add(disease_obj)
                self.session.flush()
                value_dict['disease_id'] = disease_obj.id

            disease_comments.append(models.DiseaseComment(**value_dict))

        return disease_comments
459624
def _index_key_for(self, att, value=None):
        
        if value is None:
            value = getattr(self, att)
            if callable(value):
                value = value()
        if value is None:
            return None
        if att not in self.lists:
            return self._get_index_key_for_non_list_attr(att, value)
        else:
            return self._tuple_for_index_key_attr_list(att, value)
607217
def _BuildIndex(self):
        """"""
        self._index = {}
        for i, k in enumerate(self._keys):
            self._index[k] = i