Add all the elements of `lb` to `la` if they are not there already. The elements added to `la` maintain ordering with respect to `lb`. Args: la: List of Python objects. lb: List of Python objects. Returns: `la`: The list `la` with missing elements from `lb`.
(la, lb)
| 41 | |
| 42 | |
| 43 | def concatenate_unique(la, lb): |
| 44 | """Add all the elements of `lb` to `la` if they are not there already. |
| 45 | |
| 46 | The elements added to `la` maintain ordering with respect to `lb`. |
| 47 | |
| 48 | Args: |
| 49 | la: List of Python objects. |
| 50 | lb: List of Python objects. |
| 51 | Returns: |
| 52 | `la`: The list `la` with missing elements from `lb`. |
| 53 | """ |
| 54 | la_set = set(la) |
| 55 | for l in lb: |
| 56 | if l not in la_set: |
| 57 | la.append(l) |
| 58 | la_set.add(l) |
| 59 | return la |
| 60 | |
| 61 | |
| 62 | def get_tensors(graph): |
no test coverage detected