MCPcopy Index your code
hub / github.com/modelscope/modelscope / get_extension

Function get_extension

modelscope/utils/service_utils.py:66–74  ·  view source on GitHub ↗
(encoding)

Source from the content-addressed store, hash-verified

64
65
66def get_extension(encoding):
67 encoding = encoding.replace('audio/wav', 'audio/x-wav')
68 tp = mimetypes.guess_type(encoding)[0]
69 if tp == 'audio/flac': # flac is not supported by mimetypes
70 return 'flac'
71 extension = mimetypes.guess_extension(tp)
72 if extension is not None and extension.startswith('.'):
73 extension = extension[1:]
74 return extension
75
76
77def get_mimetype(filename):

Callers 1

decode_base64_to_binaryFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…