in frauddetector/frauddetector.py [0:0]
def delete_labels(self, labels):
"""Delete Amazon FraudDetector labels. Wraps the boto3 SDK API to allow bulk operations.
Args:
:labels: list of label-names to delete
Returns:
:response_all: {variable_name: API-response-status, variable_name: API-response-status} dict
"""
response_all = []
for lname in labels:
response = self.fd.delete_label(
name=lname,
)
lh.info("delete_labels: label {} deleted".format(lname))
status = {lname: response['ResponseMetadata']['HTTPStatusCode']}
response_all.append(status)
# update myself
self.variables = self.fd.get_labels()
# convert list of dicts to single dict
response_all = {k: v for d in response_all for k, v in d.items()}
return response_all