MCPcopy Index your code
hub / github.com/algorithmiaio/algorithmia-python / format_data

Method format_data

Algorithmia/handler.py:34–41  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

32 sys.stdout.flush()
33
34 def format_data(self, request):
35 if request['content_type'] in ['text', 'json']:
36 data = request['data']
37 elif request['content_type'] == 'binary':
38 data = self.wrap_binary_data(request['data'])
39 else:
40 raise Exception("Invalid content_type: {}".format(request['content_type']))
41 return data
42
43 def is_binary(self, arg):
44 if six.PY3:

Callers 1

serveMethod · 0.95

Calls 1

wrap_binary_dataMethod · 0.95

Tested by

no test coverage detected