MCPcopy Index your code
hub / github.com/hyperopt/hyperopt / attachment_names

Method attachment_names

hyperopt/mongoexp.py:576–581  ·  view source on GitHub ↗
(self, doc)

Source from the content-addressed store, hash-verified

574 return doc
575
576 def attachment_names(self, doc):
577 def as_str(name_id):
578 assert isinstance(name_id[0], str), name_id
579 return str(name_id[0])
580
581 return list(map(as_str, doc.get("_attachments", [])))
582
583 def set_attachment(self, doc, blob, name, collection=None):
584 """Attach potentially large data string `blob` to `doc` by name `name`

Callers 4

set_attachmentMethod · 0.95
__contains__Method · 0.80
__len__Method · 0.80
__iter__Method · 0.80

Calls 1

getMethod · 0.80

Tested by

no test coverage detected