Return an list containing the elements of `tallies`, without `entry`
(entry, tallies)
| 137 | |
| 138 | |
| 139 | def remove_from_tallies(entry, tallies): |
| 140 | """ |
| 141 | Return an list containing the elements of `tallies`, without `entry` |
| 142 | """ |
| 143 | pruned_tallies = [] |
| 144 | for t in tallies: |
| 145 | if ( |
| 146 | isinstance(entry, dict) |
| 147 | and t == entry |
| 148 | or isinstance(entry, (list, tuple)) |
| 149 | and t in entry |
| 150 | or isinstance(entry, (list, tuple)) |
| 151 | and t.get('value') in entry |
| 152 | or t.get('value') == entry |
| 153 | ): |
| 154 | continue |
| 155 | pruned_tallies.append(t) |
| 156 | return pruned_tallies |
| 157 | |
| 158 | |
| 159 | def get_declared_holders(codebase, holders_tallies): |