String (PyParameter parameter) { String paramType = PyNames.OBJECT; if (parameter instanceof PyNamedParameter) { PyAnnotation annotation = ((PyNamedParameter)parameter).getAnnotation(); if (annotation != null && annotation.getValue() != null) { return annotation.getValue().getText(); } } PyFunction function = PsiTreeUtil.getParentOfType(parameter, PyFunction.class); if (function != null) { final PySignature signature = PySignatureCacheManager.getInstance(parameter.getProject()).findSignature( function); String parameterName = parameter.getName(); if (signature != null && parameterName != null) { paramType = ObjectUtils.chooseNotNull(signature.getArgTypeQualifiedName(parameterName), paramType); } } return paramType; }