Get metadata for a given resource: class
        :param resource: The name of the resource
        :param resource_class: The name of the class to get metadata from
        :return: list
968697
def get_table_metadata(self, resource, resource_class):
        
        return self._make_metadata_request(meta_id=resource + ':' + resource_class, metadata_type='METADATA-TABLE')
181429
def from_api_repr(cls, resource):
        
        name = resource.get("name")
        type_ = resource["parameterType"]["type"]
        value = resource["parameterValue"]["value"]
        converted = _QUERY_PARAMS_FROM_JSON[type_](value, None)
        return cls(name, type_, converted)
579841
def class_name_to_resource_name(class_name: str) -> str:
    
    s = re.sub('(.)([A-Z][a-z]+)', r'\1 \2', class_name)
    return re.sub('([a-z0-9])([A-Z])', r'\1 \2', s)
915165
def resource_definition(resource):
    
    meta = getmeta(resource)

    definition = {
        'type': "object",
        'properties': {}
    }

    for field in meta.all_fields:
        field_definition = {}

        type_def = map_field_to_type(field)
        if type_def:
            field_definition['type'] = str(type_def)
            if type_def.format:
                field_definition['format'] = type_def.format

        if field.doc_text:
            field_definition['description'] = field.doc_text

        if isinstance(field, VirtualField) or field in meta.readonly_fields:
            field_definition['readOnly'] = True

        # Use getattr to support calculated fields
        if getattr(field, 'choices', None):
            field_definition['enum'] = [c[0] for c in field.choices]

        definition['properties'][field.name] = field_definition

    return definition
1022800
def list_from_metadata(cls, url, metadata):
        ''''''
        key = cls._get_key(url)
        metadata = Metadata(**metadata)
        ct = cls._get_create_time(key)
        time_buckets = cls.get_time_buckets_from_metadata(metadata)
        return [cls(url, metadata, t, ct, key.size) for t in time_buckets]
478438
def extract_meta(cls, serializer, resource):
        
        if hasattr(serializer, 'child'):
            meta = getattr(serializer.child, 'Meta', None)
        else:
            meta = getattr(serializer, 'Meta', None)
        meta_fields = getattr(meta, 'meta_fields', [])
        data = OrderedDict()
        for field_name in meta_fields:
            data.update({
                field_name: resource.get(field_name)
            })
        return data
1061799
def _list(self, uri, obj_class=None, body=None, return_raw=False,
            other_keys=None):
        
        if body:
            resp, resp_body = self.api.method_post(uri, body=body)
        else:
            resp, resp_body = self.api.method_get(uri)
        if return_raw:
            return (resp, resp_body)
        if obj_class is None:
            obj_class = self.resource_class

        data = self._data_from_response(resp_body)
        ret = [obj_class(self, res, loaded=False) for res in data if res]
        if other_keys:
            keys = utils.coerce_to_list(other_keys)
            other = [self._data_from_response(resp_body, key) for key in keys]
            return (ret, other)
        else:
            return ret
413128
def get_resources(self):
        
        json_resources = self.rest_client.make_request(self.resource_url)['resources']
        return [RestResource(resource, self.rest_client) for resource in json_resources]
409108
def get_metadata(self):
        
        if self._metadata is None:
            self._metadata = ContainerMetadata()
        inspect_to_container_metadata(self._metadata, self.inspect(refresh=True), self.image)
        return self._metadata
349477
def resource_names(self, repo_type):
        
        try:
            names = self._resource_names[repo_type]
        except KeyError:
            names = [self.name, self.name.upper()]
        return names
177544
def resources(self):
        

        if self._resources_objects is not None:
            return self._resources_objects

        resources = self.parent.parent.resources
        resources = [resources[name] for name in self._resources]
        self._resources_objects = resources
        return resources
672625
def resource_listing(cls, request) -> [(200, 'Ok', ResourceListingModel)]:
        ''''''
        apis = [api.get_swagger_fragment() for api in Api if not api.private]
        Respond(200, {
            'apiVersion': cls.api.version,
            'swaggerVersion': cls.api.swagger_version,
            'apis': apis
        })
1131997
def get_rubric_metadata(self):
        
        # Implemented from template for osid.resource.ResourceForm.get_group_metadata_template
        metadata = dict(self._mdata['rubric'])
        metadata.update({'existing_id_values': self._my_map['rubricId']})
        return Metadata(**metadata)
689619
public ResourceMetaData getResourceMetaData(Resource resource)
    {
        Object o=resource.getAssociate();
        if (o instanceof ResourceMetaData)
            return (ResourceMetaData)o;
        return new ResourceMetaData(resource);
    }
63863
def get(cls, resource_id):
        
        res = Resource.get(resource_id)
        return cls(res) if res else None
1033699
def resource(self, resource_type):
        
        try:
            resource = getattr(self.resources, self.safe_rt(resource_type))(self)
        except AttributeError:
            self._resources(True)
            resource = getattr(self.resources, self.safe_rt(resource_type))(self)
        return resource
462708
def get_metadata(self):
        
        if self._metadata is None:
            self._metadata = ImageMetadata()
        inspect_to_metadata(self._metadata, self.inspect(refresh=True))
        return self._metadata