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

Method cat

Algorithmia/CLI.py:223–241  ·  view source on GitHub ↗
(self, path, client)

Source from the content-addressed store, hash-verified

221
222 # algo cat <file>
223 def cat(self, path, client):
224 result = ""
225 for f in path:
226 if '://' in f and not f.startswith("http"):
227 if f[-1] == '*':
228 path += ['data://' + file.path for file in client.dir(f[:len(f) - 2]).files()]
229 else:
230 file = client.file(f)
231
232 if file.exists():
233 result += file.getString()
234 else:
235 result = "file does not exist " + f
236 break
237 else:
238 print("operands must be a path to a remote data source data://")
239 break
240
241 return result
242
243 # algo freeze
244 def freezeAlgo(self, client, manifest_path="model_manifest.json"):

Callers 2

mainFunction · 0.80
test_catMethod · 0.80

Calls 5

filesMethod · 0.45
dirMethod · 0.45
fileMethod · 0.45
existsMethod · 0.45
getStringMethod · 0.45

Tested by 1

test_catMethod · 0.64