Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
-------
PaperRecord:
The corresponding record if i was an integer, or a list of records
if i was an iterable.
"""
if not is_iterable(i):
index_list = [i]
else:
index_list = i
if not by_index:
records = [PaperRecord(**self.df.loc[j, :], record_id=j,
column_spec=self.column_spec)
for j in index_list]
else:
records = [PaperRecord(**self.df.iloc[j],
column_spec=self.column_spec,
record_id=self.df.index.values[j])
for j in index_list]
if is_iterable(i):
return records
return records[0]
If True, take the i-th value as used internally by the review.
If False, take the record with record_id==i.
Returns
-------
PaperRecord:
The corresponding record if i was an integer, or a list of records
if i was an iterable.
"""
if not is_iterable(i):
index_list = [i]
else:
index_list = i
if not by_index:
records = [PaperRecord(**self.df.loc[j, :], record_id=j,
column_spec=self.column_spec)
for j in index_list]
else:
records = [PaperRecord(**self.df.iloc[j],
column_spec=self.column_spec,
record_id=self.df.index.values[j])
for j in index_list]
if is_iterable(i):
return records
return records[0]