MCPcopy Index your code
hub / github.com/STIXProject/python-stix / key_name

Function key_name

stix/utils/__init__.py:207–217  ·  view source on GitHub ↗

Converts the input attribute name `name` into a key to be used in `to_dict()` return dictionaries.

(name)

Source from the content-addressed store, hash-verified

205
206
207def key_name(name):
208 """Converts the input attribute name `name` into a key to be
209 used in `to_dict()` return dictionaries.
210
211 """
212 name = attr_name(name)
213
214 if name.endswith("_"):
215 return name[:-1]
216
217 return name
218
219
220def is_sequence(item):

Callers 1

to_dictFunction · 0.85

Calls 1

attr_nameFunction · 0.85

Tested by

no test coverage detected