7ef05274835b2272b1b431d3633d0559db684197,textblob/translate.py,Translator,_get_translation_from_json5,#Translator#Any#,71
Before Change
pos = 2
while True:
m = self.translation_pattern.match(content, pos)
if not m:
break
result += m.group(1)
pos = m.end()
return _unescape(result)
After Change
def _get_translation_from_json5(self, content):
result = u""
json_data = json.loads(content)
if "sentences" in json_data:
result = "".join([s["trans"] for s in json_data["sentences"]])
return _unescape(result)
def _get_json5(self, url, host=None, type_=None, data=None):
encoded_data = urlencode(data).encode("utf-8")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: sloria/TextBlob
Commit Name: 7ef05274835b2272b1b431d3633d0559db684197
Time: 2015-06-08
Author: jschnurr@gmail.com
File Name: textblob/translate.py
Class Name: Translator
Method Name: _get_translation_from_json5
Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: af164f572888a7ebdd2e6d297f6e35d98d598e53
Time: 2021-03-15
Author: tohaowu@google.com
File Name: perfkitbenchmarker/providers/gcp/gce_virtual_machine.py
Class Name: GceVirtualMachine
Method Name: UpdateInterruptibleVmStatus
Project Name: QUANTAXIS/QUANTAXIS
Commit Name: d262a0d3c567cf0543760bd238f67411acb697c2
Time: 2020-02-26
Author: 11652964@qq.com
File Name: QUANTAXIS/QAFetch/QAhuobi.py
Class Name:
Method Name: QA_fetch_huobi_kline