private static void replaceKeywordContainerUsages(@NotNull PyFunction function, @NotNull Project project) {
    final Usages usages = findKeywordContainerUsages(function, true);

    final MultiMap<String, PySubscriptionExpression> subscriptions = usages.subscriptions;
    final MultiMap<String, PyCallExpression> calls = usages.calls;

    final PyElementGenerator elementGenerator = PyElementGenerator.getInstance(project);
    for (Map.Entry<String, DefaultValue> nameAndValue : usages.names.entrySet()) {
      if (nameAndValue.getValue().unableToHasDefaultValue) continue;

      final String name = nameAndValue.getKey();
      final String defaultValue = nameAndValue.getValue().defaultValue;

      final LanguageLevel languageLevel = LanguageLevel.forElement(function);

      final PyNamedParameter parameter = elementGenerator.createParameter(name, defaultValue, null, languageLevel);
      insertParameter(function.getParameterList(), parameter, parameter.hasDefaultValue(), elementGenerator);

      final PyExpression parameterUsage = elementGenerator.createExpressionFromText(languageLevel, name);
      subscriptions.get(name).forEach(e -> e.replace(parameterUsage));
      calls.get(name).forEach(e -> e.replace(parameterUsage));
    }
  }
private static void replaceKeywordContainerUsages(@NotNull PyFunction function, @NotNull Project project)