@Override
    public void visitPyAssignmentStatement(PyAssignmentStatement node) {
      final PyExpression value = node.getAssignedValue();
      if (value instanceof PyCallExpression) {
        final PyType type = myTypeEvalContext.getType(value);
        final PyExpression callee = ((PyCallExpression) value).getCallee();

        if (type instanceof PyNoneType && callee != null) {
          final PyTypeChecker.AnalyzeCallResults analyzeCallResults =
              PyTypeChecker.analyzeCall(((PyCallExpression) value), myTypeEvalContext);
          if (analyzeCallResults != null) {
            final PyCallable callable = analyzeCallResults.getCallable();
            if (PySdkUtil.isElementInSkeletons(callable)) {
              return;
            }
            if (callable instanceof PyFunction) {
              final PyFunction function = (PyFunction) callable;
              // Currently we don't infer types returned by decorators
              if (hasInheritors(function) || PyUtil.hasCustomDecorators(function)) {
                return;
              }
            }
            registerProblem(
                node,
                PyBundle.message("INSP.none.function.assignment", callee.getName()),
                new PyRemoveAssignmentQuickFix());
          }
        }
      }
    }
  @Nullable
  @Override
  public PyType getReturnType(
      @NotNull TypeEvalContext context, @Nullable PyQualifiedExpression callSite) {
    final PyType type = getGenericReturnType(context, callSite);

    if (callSite == null) {
      return type;
    }
    final PyTypeChecker.AnalyzeCallResults results =
        PyTypeChecker.analyzeCallSite(callSite, context);

    if (PyTypeChecker.hasGenerics(type, context)) {
      if (results != null) {
        final Map<PyGenericType, PyType> substitutions =
            PyTypeChecker.unifyGenericCall(
                this, results.getReceiver(), results.getArguments(), context);
        if (substitutions != null) {
          return PyTypeChecker.substitute(type, substitutions, context);
        }
      }
      return null;
    }
    if (results != null && isDynamicallyEvaluated(results.getArguments().values(), context)) {
      return PyUnionType.createWeakType(type);
    } else {
      return type;
    }
  }
 @Nullable
 @Override
 public PyType getCallType(
     @NotNull TypeEvalContext context, @NotNull PyQualifiedExpression callSite) {
   PyType type = null;
   for (PyTypeProvider typeProvider : Extensions.getExtensions(PyTypeProvider.EP_NAME)) {
     type = typeProvider.getCallType(this, callSite, context);
     if (type != null) {
       type.assertValid(typeProvider.toString());
       break;
     }
   }
   if (type == null) {
     type = context.getReturnType(this);
   }
   final PyTypeChecker.AnalyzeCallResults results =
       PyTypeChecker.analyzeCallSite(callSite, context);
   if (results != null) {
     return analyzeCallType(type, results.getReceiver(), results.getArguments(), context);
   }
   return type;
 }
 public PyType getType(@NotNull TypeEvalContext context, @NotNull TypeEvalContext.Key key) {
   if (isOperator("and") || isOperator("or")) {
     final PyExpression left = getLeftExpression();
     final PyType leftType = left != null ? context.getType(left) : null;
     final PyExpression right = getRightExpression();
     final PyType rightType = right != null ? context.getType(right) : null;
     if (leftType == null && rightType == null) {
       return null;
     }
     return PyUnionType.union(leftType, rightType);
   }
   final PyTypeChecker.AnalyzeCallResults results = PyTypeChecker.analyzeCall(this, context);
   if (results != null) {
     final PyType type = results.getCallable().getCallType(context, this);
     if (!PyTypeChecker.isUnknown(type) && !(type instanceof PyNoneType)) {
       return type;
     }
   }
   if (PyNames.COMPARISON_OPERATORS.contains(getReferencedName())) {
     return PyBuiltinCache.getInstance(this).getBoolType();
   }
   return null;
 }