private static int insertParametersForMethod(@NotNull PyFunction pyFunction, @NotNull Document document, int offset) {
    if (pyFunction.getContainingClass() != null) {
      final PyFunction.Modifier modifier = pyFunction.getModifier();
      String parameterName = null;
      if (modifier == null) parameterName = PyNames.CANONICAL_SELF;
      else if (modifier == PyAstFunction.Modifier.CLASSMETHOD) parameterName = PyNames.CANONICAL_CLS;

      if (parameterName != null) {
        document.insertString(offset, parameterName);
        return offset + parameterName.length();
      }
    }
    return offset;
  }
private static int insertParametersForMethod(@NotNull PyFunction pyFunction, @NotNull Document document, int offset)