RETURN THE METADATA DESCRIPTORS FOR EACH KEY
352763
def metas(self, prefix=None, limit=None, delimiter=None):
        
        limit = coalesce(limit, TOO_MANY_KEYS)
        keys = self.bucket.list(prefix=prefix, delimiter=delimiter)
        prefix_len = len(prefix)
        output = []
        for i, k in enumerate(k for k in keys if len(k.key) == prefix_len or k.key[prefix_len] in [".", ":"]):
            output.append({
                "key": strip_extension(k.key),
                "etag": convert.quote2string(k.etag),
                "expiry_date": Date(k.expiry_date),
                "last_modified": Date(k.last_modified)
            })
            if i >= limit:
                break
        return wrap(output)
484964
def _field(self, *keys) -> Any:
        """"""
        try:
            d = self._node
            for key in keys:
                d = d[key]
            return d
        except KeyError:
            d = self._full_metadata
            for key in keys:
                d = d[key]
            return d
245603
def get_key_names(self):
        
        names = []
        for (k, _) in self.items():
            names.append(k)
        return names
892990
def get_keys(self, models, key=None):
        
        return list(set(map(lambda value: value.get_attribute(key) if key else value.get_key(), models)))
777966
def rels(self):
        """"""
        r = []
        for i in self.metadata:
            r = r + i[REL]
        return []
387338
def get_metadata_desc(self):
        
        entity_descriptions = []

        idp_entities = self.sp.metadata.with_descriptor("idpsso")
        for entity_id, entity in idp_entities.items():
            description = MetadataDescription(urlsafe_b64encode(entity_id.encode("utf-8")).decode("utf-8"))

            # Add organization info
            try:
                organization_info = entity["organization"]
            except KeyError:
                pass
            else:
                organization = OrganizationDesc()
                for name_info in organization_info.get("organization_name", []):
                    organization.add_name(name_info["text"], name_info["lang"])
                for display_name_info in organization_info.get("organization_display_name", []):
                    organization.add_display_name(display_name_info["text"], display_name_info["lang"])
                for url_info in organization_info.get("organization_url", []):
                    organization.add_url(url_info["text"], url_info["lang"])
                description.organization = organization

            # Add contact person info
            try:
                contact_persons = entity["contact_person"]
            except KeyError:
                pass
            else:
                for person in contact_persons:
                    person_desc = ContactPersonDesc()
                    person_desc.contact_type = person.get("contact_type")
                    for address in person.get('email_address', []):
                        person_desc.add_email_address(address["text"])
                    if "given_name" in person:
                        person_desc.given_name = person["given_name"]["text"]
                    if "sur_name" in person:
                        person_desc.sur_name = person["sur_name"]["text"]

                    description.add_contact_person(person_desc)

            # Add UI info
            ui_info = self.sp.metadata.extension(entity_id, "idpsso_descriptor", "{}&UIInfo".format(UI_NAMESPACE))
            if ui_info:
                ui_info = ui_info[0]
                ui_info_desc = UIInfoDesc()
                for desc in ui_info.get("description", []):
                    ui_info_desc.add_description(desc["text"], desc["lang"])
                for name in ui_info.get("display_name", []):
                    ui_info_desc.add_display_name(name["text"], name["lang"])
                for logo in ui_info.get("logo", []):
                    ui_info_desc.add_logo(logo["text"], logo["width"], logo["height"], logo.get("lang"))
                description.ui_info = ui_info_desc

            entity_descriptions.append(description)
        return entity_descriptions
54497
def get_pk_descriptors(cls):
    """"""
    pk_fields = {
        name: descriptor
        for name, descriptor in vars_class(cls).items()
        if isinstance(descriptor, ObjectField) and is_pk_descriptor(descriptor)
    }
    alt_pk_fields = defaultdict(list)
    for name, descriptor in vars_class(cls).items():
        if isinstance(descriptor, ObjectField):
            if descriptor.alt_pk is True:
                alt_pk_fields[0].append((name, descriptor))
            elif type(descriptor.alt_pk) is int:
                alt_pk_fields[descriptor.alt_pk].append((name, descriptor))
    if len(pk_fields) == 1:
        return ((pk_fields.popitem(),), (alt_pk_fields[0],))
    elif len(pk_fields) > 1:
        unique_pk_fields = {
            name: descriptor
            for name, descriptor in pk_fields.items()
            if descriptor.pk is True
        }
        if unique_pk_fields:
            raise AttributeError(
                "more than one field is marked as unique primary key: %s" % (
                    ', '.join(sorted(pk_fields))))
        pk_descriptors = tuple(sorted((
            (name, descriptor)
            for name, descriptor in pk_fields.items()
        ), key=lambda item: item[1].pk))
        alt_pk_descriptors = tuple(
            alt_pk_fields[idx]
            for idx, (name, descriptor) in enumerate(pk_descriptors)
        )
        return pk_descriptors, alt_pk_descriptors
    else:
        return tuple(), tuple()
735446
def get_document_models():
    """"""
    mappings = {}
    for i in get_index_names():
        for m in get_index_models(i):
            key = "%s.%s" % (i, m._meta.model_name)
            mappings[key] = m
    return mappings
1161246
def dict(self):
        
        metadata = {}
        properties = {}
        for name, prop in list(self.properties.items()):
            properties[name] = prop.dict
        metadata['properties'] = properties
        return metadata
1198901
def _data_keys(self):
        
        return [name for name, child in iteritems(self._children) if not isinstance(child, GroupNode)]
1149173
def metadata(self):
        
        result = []
        for layer in self._layers:
            if layer in self._values:
                result.append({
                    'layer': layer,
                    'value': self._values[layer][1],
                    'source': self._values[layer][0],
                    'default': layer == self._layers[-1]
                })
        return result
1235454
def get_keys(self, keymap):
        """"""
        keys = dict(modifiers=[], regular=[])

        # loop on keymap bytes
        for keymap_index, keymap_byte in enumerate(keymap):
            try:
                keymap_values = self._keymap_values_dict[keymap_index]
            except KeyError:
                continue

            # loop on keymap_values for that keymap byte
            for key, value in keymap_values.items():
                if not keymap_byte & key:
                    continue
                elif value in self._modifiers:
                    keys['modifiers'].append(value)
                elif not keys['regular']:
                    keys['regular'].append(value)

        return keys
1138219
def get_metadata(self, filename):
        ''''''
        dest = self.path(filename)
        with open(dest, 'rb', buffering=0) as f:
            checksum = 'sha1:{0}'.format(sha1(f))
        return {
            'checksum': checksum,
            'size': os.path.getsize(dest),
            'mime': files.mime(filename),
            'modified': datetime.fromtimestamp(os.path.getmtime(dest)),
        }
567208
def data(self):
        
        d = {}
        for name in self.key_names:
            d[name] = self.__dict__.get(name, None)
        return d
712952
def get_keys(self):
        
        keys = []
        for section in self.get_sections():
            phase = self._sections[section]
            for obj in phase:
                keys += obj.get_id()
        keys.sort()
        return keys
503555
def keys(self):
        ""
        return (list(self._pb.IntMap.keys()) + list(self._pb.StringMap.keys()) +
                list(self._pb.FloatMap.keys()) + list(self._pb.BoolMap.keys()))
1129694
def get_metadata(self, namespace, name):
        ""

        if namespace in NAMESPACES:
            namespace = NAMESPACES[namespace]

        return self.metadata[namespace].get(name, [])