f11e942dbe2069e1ac09c8d8d981179d24326c70,external_api/api.py,,transfer_entities,#Any#,51
Before Change
Returns:
HttpResponse : HttpResponse with appropriate status.
try:
engine = CHATBOT_NER_DATASTORE.get("engine")
source = CHATBOT_NER_DATASTORE.get(engine).get("es_scheme") + \
CHATBOT_NER_DATASTORE.get(engine).get("host") + ":" + \
CHATBOT_NER_DATASTORE.get(engine).get("port")
destination = CHATBOT_NER_DATASTORE.get(engine).get("destination_url")
es_object = ESTransfer(source=source, destination=destination)
entity_list_dict = json.loads(request.GET.get("word_info"))
entity_list = entity_list_dict.get("entity_list")
es_object.transfer_specific_entities(list_of_entities=entity_list)
except ValueError:
HttpResponse(status=500)
return HttpResponse(status=200)
After Change
result = {"status": status, "error": error}
if not status:
HttpResponse(json.dumps({"data": result}), content_type="application/json", status=500)
return HttpResponse(json.dumps({"data": result}), content_type="application/json", status=200)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: hellohaptik/chatbot_ner
Commit Name: f11e942dbe2069e1ac09c8d8d981179d24326c70
Time: 2018-08-19
Author: pratik.jayarao@haptik.co
File Name: external_api/api.py
Class Name:
Method Name: transfer_entities
Project Name: tensorflow/transform
Commit Name: ec9dcf7491c38f3531bfa718b496861ab19bb048
Time: 2019-08-28
Author: zoy@google.com
File Name: tensorflow_transform/analyzer_nodes.py
Class Name: _VocabularyAccumulatorCoder
Method Name: encode_cache
Project Name: home-assistant/home-assistant
Commit Name: 09d531b3b95e7943df53233d1abcb40d7e87de94
Time: 2016-08-18
Author: nkgilley@gmail.com
File Name: homeassistant/components/media_player/gpmdp.py
Class Name: GPMDP
Method Name: get_ws