package Ġedu . cm u . cs . al ab aster Ċ Ċ import Ġcom . intellij . openapi . project . Project Ċ import Ġcom . intellij . psi . Psi Element Ċ import Ġcom . jetbrains . python . psi . Py Element Ċ import Ġcom . jetbrains . python . psi . Py QualifiedName Owner Ċ import Ġcom . jetbrains . python . psi . search . Py Project Scope Builder Ċ import Ġcom . jetbrains . python . psi . stubs . Py ClassName Index Ċ import Ġcom . jetbrains . python . psi . stubs . Py FunctionName Index Ċ Ċ object ĠPsi Element Finder Ġ{ ĊĊĠ Ġprivate Ġval Ġprev Find s Ġ= Ġmutable Map Of < Pair < Project , ĠString >, ĠPsi Element ?> () ĊĊĠ Ġoperator Ġfun Ġget ( project : ĠProject , Ġname : ĠString ): ĠPsi Element ? Ġ{ ĊĠĠĠ Ġval Ġfinds Ġ= Ġprev Find s ĊĠĠĠ Ġreturn Ġfinds . compute If Absent ( Pair ( project , Ġname )) Ġ{ Ġfind Element ( it . first , Ġit . second ) Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġfind Element ( project : ĠProject , Ġname : ĠString ): ĠPy Element ? Ġ{ ĊĠĠĠ Ġval Ġelements Ġ= Ġmutable ListOf < Py QualifiedName Owner >() ĊĠĠĠ Ġval Ġtransform Name Ġ= Ġname . substring After Last ('.') ĊĠĠĠ Ġval Ġscope Ġ= ĠPy Project Scope Builder . exclude Sdk Tests Scope ( project ) ĊĠĠĠ Ġelements . addAll ( Py FunctionName Index . find ( transform Name , Ġproject , Ġscope )) ĊĠĠĠ Ġelements . addAll ( Py ClassName Index . find ( transform Name , Ġproject , Ġscope )) ĊĠĠĠ Ġreturn Ġelements . first OrNull Ġ{ Ġit . qualified Name Ġ== Ġname Ġ} ĊĠ Ġ} Ċ Ċ } Ċ