INNER CODE UNIT · Python
remove_deprecated
mitre-attack/attack-scripts · scripts/technique_mappings_to_csv.py:72
def remove_deprecated(stix_objects):
"""Will remove any revoked or deprecated objects from queries made to the data source"""
# Note we use .get() because the property may not be present in the JSON data. The default is False
# if the property is not set.
return list(
filter(
lambda x: x.get("x_mitre_deprecated", False) is False and x.get("revoked", False) is False,
stix_objects
)
)
def escape_chars(a_string):
"""Some characters create problems when written to file"""
return a_string.translate(str.maketrans({
"\n": r"\\n",
}))