@Override
  public Ref<PyType> getReferenceType(@NotNull PsiElement target, @NotNull TypeEvalContext context, @Nullable PsiElement anchor) {
    if (target instanceof PyElement) {
      final PsiElement pythonStub = PyiUtil.getPythonStub((PyElement)target);
      if (pythonStub instanceof PyFunction pyFunction) {
        PyType allSignatures = StreamEx.ofNullable(PyiUtil.getImplementation(pyFunction, context))
          .prepend(PyiUtil.getOverloads(pyFunction, context))
          .map(context::getType)
          .collect(PyTypeUtil.toUnion());
        return PyTypeUtil.notNullToRef(allSignatures);
      }
      if (pythonStub instanceof PyTypedElement) {
        return PyTypeUtil.notNullToRef(context.getType((PyTypedElement)pythonStub));
      }
    }
    return null;
  }
@Override
  public Ref<PyType> getReferenceType(@NotNull PsiElement target, @NotNull TypeEvalContext context, @Nullable PsiElement anchor)