86d4c5df21db07ab75e7eac9ed36d2799b4bf440,research/src/fetch_campaign_donations.py,Donation,data,#Donation#,90
Before Change
"committees": self._data_by_pattern("Receitas", "comite")
}
paths = (os.path.join(self.directory, filename) for filename in files)
keys = ("candidates", "parties", "committees")
return {
key: self._read_csv(path, chunksize=10000)
for path, key in zip(keys, paths)
}
def __enter__(self):
self._download()
After Change
def data(self):
Takes self._data, clean, normalizes and translate it
data = self._data()
for key in KEYS:
normalize_columns = self.NORMALIZE_COLUMNS.get(key)
if key in data:
// strip columns names ("foobar " -> "foobar")
names = data[key].columns.values
cleaned_columns = {name: name.strip() for name in names}
data[key].rename(columns=cleaned_columns, inplace=True)
// normalize & translate
data[key].rename(columns=normalize_columns, inplace=True)
data[key].rename(columns=TRANSLATIONS, inplace=True)
return data
def __enter__(self):
self._download()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: okfn-brasil/serenata-de-amor
Commit Name: 86d4c5df21db07ab75e7eac9ed36d2799b4bf440
Time: 2017-11-19
Author: cuducos@users.noreply.github.com
File Name: research/src/fetch_campaign_donations.py
Class Name: Donation
Method Name: data
Project Name: tensorflow/tensorboard
Commit Name: 0b5565152aceed3796445c855ce187118787c857
Time: 2017-12-18
Author: nfelt@users.noreply.github.com
File Name: tensorboard/backend/event_processing/plugin_event_accumulator.py
Class Name: EventAccumulator
Method Name: _Purge
Project Name: pandas-dev/pandas
Commit Name: ae0d302c735720739ed4e1bc1e1a231df24356c0
Time: 2021-02-03
Author: 61934744+phofl@users.noreply.github.com
File Name: pandas/core/reshape/reshape.py
Class Name:
Method Name: _stack_multi_columns