MCPcopy Create free account
hub / github.com/IBM/AssetOpsBench / _normalise

Function _normalise

src/couchdb/loader.py:183–193  ·  view source on GitHub ↗
(doc, key, cfg, transform)

Source from the content-addressed store, hash-verified

181
182
183def _normalise(doc, key, cfg, transform):
184 doc.setdefault("dataset", key)
185 if cfg.get("doc_type"):
186 doc.setdefault("type", cfg["doc_type"])
187 if transform:
188 doc = transform(doc) or doc
189 if "_id" not in doc:
190 _id = _make_id(key, cfg, doc)
191 if _id is not None:
192 doc["_id"] = _id
193 return doc
194
195
196# --------------------------------------------------------------------------- #

Callers 1

load_collectionFunction · 0.85

Calls 2

_make_idFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected