1d7f6cff6acc7643a6b1f24f2c502f365c4af193,lib/streamlit/hashing.py,CodeHasher,_to_bytes,#CodeHasher#Any#Any#,200

Before Change


            return b"bool:0"
        elif util.is_type(obj, "pandas.core.frame.Series"):
            import pandas as pd
            return pd.util.hash_pandas_object(obj).sum()
        elif util.is_type(obj, "pandas.core.frame.DataFrame"):
            import pandas as pd

            if len(obj) >= PANDAS_ROWS_LARGE:

After Change


                except TypeError:
                    // Use pickle if pandas cannot hash the object for example if
                    // it contains unhashable objects.
                    return pickle.dumps(obj, pickle.HIGHEST_PROTOCOL)
            elif util.is_type(obj, "numpy.ndarray"):
                h = hashlib.new(self.name)
                self._update(h, obj.shape)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: streamlit/streamlit
Commit Name: 1d7f6cff6acc7643a6b1f24f2c502f365c4af193
Time: 2019-09-16
Author: domoritz@gmail.com
File Name: lib/streamlit/hashing.py
Class Name: CodeHasher
Method Name: _to_bytes


Project Name: OpenMined/PySyft
Commit Name: f776c0b8ead2d3bc04a9ddcb80a0f0c36fe030ca
Time: 2020-10-12
Author: 2017csb1092@iitrpr.ac.in
File Name: syft/grid/clients/data_centric_fl_client.py
Class Name: DataCentricFLClient
Method Name: simplify


Project Name: OpenMined/PySyft
Commit Name: b2cc6d7d3291fcf739415a65ac34026afac2a877
Time: 2020-08-10
Author: andrew@openmined.org
File Name: src/syft/core/node/common/node.py
Class Name: Node
Method Name: get_metadata_for_client