Get the serialization format for the given mimetype
970848
def get_serialize_format(self, mimetype):
		
		format = self.formats.get(mimetype, None)
		if format is None:
			format = formats.get(mimetype, None)
		return format
492628
public MimeType getMimeType() {
		if (format >= 0 && format < MIME_TYPE_STRINGS.length) {
			if (format == FORMAT_JPEG && progressive)
			{
				return new MimeType("image/pjpeg");
			}
			return new MimeType(MIME_TYPE_STRINGS[format]);
		} else {
			return null;
		}
	}
763818
private static MimeType getContentMimeType(Resource resource) {
        MimeType result = null;
        if (resource != null && (resource = resource.getChild(ResourceUtil.CONTENT_NODE)) != null) {
            ResourceHandle handle = ResourceHandle.use(resource);
            result = getMimeType(handle.getProperty(ResourceUtil.PROP_MIME_TYPE, ""));
        }
        return result;
    }
470760
def get_default_mimetype(self):
		
		mimetype = self.default_mimetype
		if mimetype is None:	# class inherits from module default
			mimetype = DEFAULT_MIMETYPE
		if mimetype is None:	# module is set to None?
			mimetype = 'application/rdf+xml'
		return mimetype
856424
public static String getMimeType(Resource resource) {
    if (isNtResource(resource)) {
      return resource.getValueMap().get(JcrConstants.JCR_MIMETYPE, String.class);
    }
    else if (isNtFile(resource)) {
      return getMimeType(resource.getChild(JcrConstants.JCR_CONTENT));
    }
    return null;
  }
1154519
def get_mimetype(self):
        
        template_name = self.get_template_names()[0]
        for extension, mimetype in turrentine_settings.TURRENTINE_MIMETYPE_EXTENSIONS:
            if template_name.endswith(extension):
                return mimetype
        return 'text/html'
347292
def _get_object_as_soft(self):
        """"""
        soft = ["^%s = %s" % (self.geotype, self.name),
                self._get_metadata_as_string()]
        return "\n".join(soft)
1074936
def __getFormat(self, format):
		
		if format == "XML":
			self.sparql.setReturnFormat(XML)
			self.format = "XML"
		elif format == "RDF":
			self.sparql.setReturnFormat(RDF)
			self.format = "RDF"
		else:
			self.sparql.setReturnFormat(JSON)
			self.format = "JSON"
1120276
def mime_type(self):
        
        mime_type, encoding = mimetypes.guess_type(self.path)
        if not mime_type:
            mime_type = 'application/octet-stream'
        return mime_type
1354372
def _set_serializer_by_mime_type(self, mime_type):
        

        # ignore if binary response
        if isinstance(self._app_iter, BinaryResponse):
            self.logger.info("ignoring setting serializer for binary response")
            return

        for available_serializer in self._serializers:
            if available_serializer.content_type() == mime_type:
                self._selected_serializer = available_serializer
                self.logger.info("set serializer for mime type: %s" % mime_type)
                return

        self.logger.info("could not find serializer for mime type: %s" % mime_type)
        raise exception.UnsupportedVocabularyError(mime_type, self.supported_mime_types_str)
1012835
def dump(self,format='ttl'):

		'''
		
		'''

		return self.rdf.graph.serialize(format=format).decode('utf-8')
628715
function getMimeType(){
		static $mime_types = array(
			"jpg" => "image/jpeg",
			"png" => "image/png",
			"tiff" => "image/tiff",
			"gif" => "image/gif",
			"svg" => "image/svg+xml",
			"bmp" => "image/bmp",

			"doc" => "application/msword",
			"xls" => "application/vnd.ms-excel",
			"ppt" => "application/vnd.ms-powerpoint",
			"xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",

			"docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document",

			"odt" => "application/vnd.oasis.opendocument.text",
			"ods" => "application/vnd.oasis.opendocument.spreadsheet",

			"eps" => "application/postscript",
			"ai" => "application/postscript",
			"pdf" => "application/pdf",

			"zip" => "application/zip",

			"mp3" => "audio/mpeg",
		);
		$suffix = strtolower($this->getSuffix());
		if(isset($mime_types[$suffix])){
			return $mime_types[$suffix];
		}
	}
1249448
public String getEncodingByMimeType(String type)
    {
        String encoding =null;

        if (type!=null)
            encoding=(String)_encodingMap.get(type);

        return encoding;
    }
1130699
def serialize_dtype(o):
    
    if len(o) == 0:
        return dict(
            _type='np.dtype',
            descr=str(o))
    return dict(
        _type='np.dtype',
        descr=o.descr)
245515
private static final String getExtension(String MIMETYPE) throws Exception {
        if (m_extensionMappings == null) {
            m_extensionMappings = readExtensionMappings(Server.FEDORA_HOME + "/server/" + Server.CONFIG_DIR + "/" + DATASTREAM_MAPPING_SOURCE_FILE);
        }

        String extension = m_extensionMappings.get(MIMETYPE);
        if (extension != null) {
            return extension;
        } else {
            return "";
        }
    }
542112
def serialiseString(self, s):
        
        if type(s) is unicode:
            s = self.context.getBytesForString(s)

        self.serialiseBytes(s)
1101000
private static MimeType getParentMimeType(Resource resource) {
        MimeType result = null;
        if (resource != null && (resource = resource.getParent()) != null) {
            ResourceHandle handle = ResourceHandle.use(resource);
            result = getMimeType(handle.getProperty(ResourceUtil.PROP_MIME_TYPE, ""));
            if (result == null) {
                String filename = getResourceName(resource);
                result = getMimeType(filename);
            }
        }
        return result;
    }