b5a525cb49f57bc4ffda979699db4c6b4bda6c1d,slips/core/database.py,Database,add_in_srcips,#Database#Any#Any#Any#,377

Before Change


                data = data.decode("utf-8")
                // For some weird reason (error?) the json library expects the keys to be delimited with double-quotes and not single-quotes.
                // Not sure how our single quotes got here. Fix this better
                data = data.replace("\"",""")
            try:
                // Convert the json str to a dictionary
                data = json.loads(data)
                // Add 1 because we found this ip again

After Change


                data = json.loads(data)
                // Add 1 because we found this ip again
                data[str(saddr_as_obj)] += 1
                data = json.dumps(data)
            except (KeyError, TypeError) as e:
                data[str(saddr_as_obj)] = 1
                // Convet the dictionary to json
                data = json.dumps(data)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: stratosphereips/StratosphereLinuxIPS
Commit Name: b5a525cb49f57bc4ffda979699db4c6b4bda6c1d
Time: 2019-01-26
Author: eldraco@gmail.com
File Name: slips/core/database.py
Class Name: Database
Method Name: add_in_srcips


Project Name: stratosphereips/StratosphereLinuxIPS
Commit Name: b5a525cb49f57bc4ffda979699db4c6b4bda6c1d
Time: 2019-01-26
Author: eldraco@gmail.com
File Name: slips/core/database.py
Class Name: Database
Method Name: add_out_dstips


Project Name: facebookresearch/ParlAI
Commit Name: 72c304fa7cac16ed19d8bc75a017f17c8073dd2f
Time: 2020-02-13
Author: roller@fb.com
File Name: parlai/utils/misc.py
Class Name: TimeLogger
Method Name: log


Project Name: stratosphereips/StratosphereLinuxIPS
Commit Name: b5a525cb49f57bc4ffda979699db4c6b4bda6c1d
Time: 2019-01-26
Author: eldraco@gmail.com
File Name: slips/core/database.py
Class Name: Database
Method Name: add_out_tuple