The content types with metadata
        @return: ['application/xxx', ...]
164726
def listMetaContentTypes(self):
        

        all_md_content_types = (
            CT_CORE_PROPS,
            CT_EXT_PROPS,
            CT_CUSTOM_PROPS)
        return [k for k in self.overrides.keys() if k in all_md_content_types]
244599
def read_metadata(self):  # type: () ->Dict[str,str]
        
        config = configparser.ConfigParser()
        config.read(self.file_inventory.config_files[0])
        try:
            return {"setup.cfg": config["metadata"]["version"]}
        except KeyError:
            return {}
1203652
def content_type(self):  # type: () -> str
        
        # todo(mvsusp): consider a better default content-type
        return self.headers.get('ContentType') or self.headers.get(
            'Content-Type') or _content_types.JSON
77114
def metadata(self):
        
        if self._metadata is None:
            try:
                with open(self.paths.metadata()) as metadata_fd:
                    self._metadata = json.load(metadata_fd)
            except IOError:
                self._metadata = {}
        return self._metadata
399593
def get_download_urls(self):
        
        info = self.model._meta.app_label, self.model._meta.model_name
        return [
            url(r'^.+(' + self.upload_to + '/.+)/$', self.file_download_view, name='%s_%s_file_download' % info),
        ]
952960
def get_content_type(self):
        
        extension = self.path_params.get('_extension')
        for ext, mime in self.EXTENSION_MAP:
            if ext == extension:
                return mime
        # Else: use the Accept headers
        if self.response.vary is None:
            self.response.vary = ['Accept']
        else:
            self.response.vary.append('Accept')
        types = [mime for ext, mime in self.EXTENSION_MAP]
        ct = self.request.accept.best_match(types)
        # No best match found. The specification allows us to either return a
        # 406 or just use another format in this case.
        # We pick the default format, though that may become a configurable
        # behavior in the future.
        if not ct:
            ct = types[0]
        return ct
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)
467865
def get_urls(self):
        
        info = '%s_%s' % (self.model._meta.app_label, self.model._meta.model_name)

        def pat(regex, fn):
            return url(regex, self.admin_site.admin_view(fn), name='%s_%s' % (info, fn.__name__))

        url_patterns = [
            pat(r'^([0-9]+)/delete-translation/$', self.delete_translation),
            pat(r'^([0-9]+)/([a-z\-]+)/publish/$', self.publish_article),
            pat(r'^([0-9]+)/([a-z\-]+)/unpublish/$', self.unpublish),
            pat(r'^([0-9]+)/([a-z\-]+)/preview/$', self.preview_article),
        ]

        url_patterns += super(ArticleAdmin, self).get_urls()
        return url_patterns
54270
protected function parseContenttypes()
    {
        $contentTypes = $this->config->get('contenttypes');

        foreach ($contentTypes as $type => $values) {
            $this->getSearchableColumns($type);
            if (isset($values['taxonomy'])) {
                $this->parseTaxonomies($type, $values['taxonomy']);
            }
        }
    }
610756
def data(self):
        
        if self.request.method == 'GET':
            return self.request.GET
        else:
            assert self.request.META['CONTENT_TYPE'].startswith('application/json')
            charset = self.request.encoding or settings.DEFAULT_CHARSET
            return json.loads(self.request.body.decode(charset))
1018891
public function getMetaHeaders()
    {
        if ($this->offsetExists('meta') && is_array($this->meta)) {
            $meta = $this->meta;
        } else {
            $meta = [];
        }
        if (!array_key_exists('Content-Type', $meta)) {
            $meta['Content-Type'] = 'text/html;charset=UTF-8';
        }

        // Remove null/empty values, this allow you to remove the Content-Type by making it empty.
        return array_filter($meta);
    }
1049385
public function getMetadata()
    {
        $schema = array();
        foreach ($this->from as $path) {
            if (is_dir($path)) {
                $files = glob($path . '/*.yml');
                foreach ($files as $file) {
                    $schema = array_merge($schema, (array) Yaml::parse(file_get_contents($file)));
                }
            } else {
                $schema = array_merge($schema, (array) Yaml::parse(file_get_contents($path)));
            }
        }

        $metadatas = array();
        foreach ($schema as $className => $mappingInformation) {
            $metadatas[] = $this->convertToClassMetadataInfo($className, $mappingInformation);
        }

        return $metadatas;
    }
1188493
def _get_ctypes(self):
        
        ctypes = []
        for related_object in self.model._meta.get_all_related_objects():
            model = getattr(related_object, 'related_model', related_object.model)
            ctypes.append(ContentType.objects.get_for_model(model).pk)
            if model.__subclasses__():
                for child in model.__subclasses__():
                    ctypes.append(ContentType.objects.get_for_model(child).pk)
        return ctypes
1010403
def get_filetypes(self):
        # type: () -> List[str]
        
        if not self.is_requestable():
            return [resource.get_file_type() for resource in self.get_resources()]
        return self._get_stringlist_from_commastring('file_types')
777966
def rels(self):
        """"""
        r = []
        for i in self.metadata:
            r = r + i[REL]
        return []
712227
def select_header_content_type(self, content_types):
        
        if not content_types:
            return 'application/json'

        content_types = [x.lower() for x in content_types]

        if 'application/json' in content_types or '*/*' in content_types:
            return 'application/json'
        else:
            return content_types[0]
651797
def metadata():
    """"""
    with open(os.path.join(charm_dir(), 'metadata.yaml')) as md:
        return yaml.safe_load(md)