(ref: Name, data: VariableData)
| 308 | ) |
| 309 | |
| 310 | def only_scoped_refs(ref: Name, data: VariableData) -> bool: |
| 311 | # TODO: Other common types could be added here, like numpy arrays that |
| 312 | # are not dtype=object, etc.. that are known not to be dependent on the |
| 313 | # functions that created them. |
| 314 | |
| 315 | # This errs on the side of including too much, but that's a better user |
| 316 | # experience than not having definitions available. |
| 317 | return ( |
| 318 | ref in glbls |
| 319 | and not isinstance(glbls[ref], primitives) |
| 320 | and ( |
| 321 | "_lambda" in data.required_refs |
| 322 | or any(map(check_ref, data.required_refs | {ref})) |
| 323 | ) |
| 324 | ) |
| 325 | |
| 326 | return only_scoped_refs |
nothing calls this directly
no test coverage detected
searching dependent graphs…