Overrides superclass method and renames some properties
549429
def get_configuration_dict(self, secret_attrs=False):
        """"""
        cd = super(TaxonomicAmendmentsShard, self).get_configuration_dict(secret_attrs=secret_attrs)
        # "rename" some keys in the dict provided
        cd['number of amendments'] = cd.pop('number of documents')
        cd['amendments'] = cd.pop('documents')
        # add keys particular to this shard subclass
        if self._next_ott_id is not None:
            cd['_next_ott_id'] = self._next_ott_id,
        return cd
1209601
function Class(prop, superClass) {
        var ClassType = function() {
            function F(args) {
                for (var name in ClassType.__prop) {
                    var val = ClassType.__prop[name];
                    this[name] = isObject(val) ? extend({}, val) : val;
                }

                if (isFunction(this.__construct)) {
                    this.__construct.apply(this, [].slice.call(args));
                }

                return this;
            }

            F.prototype = ClassType.prototype;
            F.constructor = ClassType;
            return new F(arguments);
        };

        ClassType.extend = function(prop) {
            if (isFunction(prop)) {
                prop = prop();
            }

            if (isObject(prop)) {
                for (var name in prop) {
                    var val = prop[name];

                    if (name === 'parent') {
                        throw new Error("'parent' method must not be override wrote.");
                    }

                    if (isFunction(val)) {
                        ClassType.prototype[name] = val;
                    } else {
                        ClassType.__prop[name] = isObject(val) ? extend({}, val) : val;
                    }
                }
            }

            return this;
        };

        ClassType.inherits = function(superClass) {
            inherits(ClassType, superClass);
            extend(ClassType.__prop, superClass.__prop);

            return this;
        };

        ClassType.prototype.parent = function(methodName, args) {
            var super_ = this.constructor.super_;
            if (!isFunction(this[methodName]) || !isFunction(super_.prototype[methodName])) {
                throw new Error("parent has not method '" + methodName + "'.");
            }

            if (arguments.length === 1) {
                args = [];
            } else if (!isArray(args)) {
                args = [].slice.call(arguments, 1);
            }

            while ((this[methodName] === super_.prototype[methodName]) && super_.super_) {
                super_ = super_.super_;
            }

            var method = super_.prototype[methodName];
            delete super_.prototype[methodName];
            var retResult = method.apply(this, args);
            super_.prototype[methodName] = method;

            return retResult;
        };

        ClassType.__prop = {};
        if (superClass === true && isFunction(prop)) {
            superClass = prop;
            prop = undefined;
        }

        if (isFunction(superClass)) {
            ClassType.inherits(superClass);
        }

        if (prop) {
            ClassType.extend(prop);
        }

        return ClassType;
    }
81949
def super_method(name, ctx):
    """"""

    result = None, None

    # get class ctx
    if isclass(ctx):
        _ctx = ctx
        first_mro = 1
    else:
        _ctx = ctx.__class__
        first_mro = 0
    # get class hierachy
    mro = getmro(_ctx)
    for cls in mro[first_mro:]:
        if hasattr(cls, name):
            result = getattr(cls, name), cls
            break

    return result
885891
def override_spec(cls, **kwargs):
        """"""
        cls._default_spec.set(**kwargs)
        cls.spec.set(**kwargs)
848069
private void visitOverride(AnnotatedNode node, AnnotationNode visited) {
        ClassNode annotationClassNode = visited.getClassNode();
        if (annotationClassNode.isResolved() && annotationClassNode.getName().equals("java.lang.Override")) {
            if (node instanceof MethodNode) {
                MethodNode origMethod = (MethodNode) node;
                ClassNode cNode = node.getDeclaringClass();
                ClassNode next = cNode;
                outer:
                while (next != null) {
                    Map genericsSpec = createGenericsSpec(next);
                    MethodNode mn = correctToGenericsSpec(genericsSpec, origMethod);
                    if (next != cNode) {
                        ClassNode correctedNext = correctToGenericsSpecRecurse(genericsSpec, next);
                        MethodNode found = getDeclaredMethodCorrected(genericsSpec, mn, correctedNext);
                        if (found != null) break;
                    }
                    List<ClassNode> ifaces = new ArrayList<ClassNode>();
                    ifaces.addAll(Arrays.asList(next.getInterfaces()));
                    Map updatedGenericsSpec = new HashMap(genericsSpec);
                    while (!ifaces.isEmpty()) {
                        ClassNode origInterface = ifaces.remove(0);
                        if (!origInterface.equals(ClassHelper.OBJECT_TYPE)) {
                            updatedGenericsSpec = createGenericsSpec(origInterface, updatedGenericsSpec);
                            ClassNode iNode = correctToGenericsSpecRecurse(updatedGenericsSpec, origInterface);
                            MethodNode found2 = getDeclaredMethodCorrected(updatedGenericsSpec, mn, iNode);
                            if (found2 != null) break outer;
                            ifaces.addAll(Arrays.asList(iNode.getInterfaces()));
                        }
                    }
                    ClassNode superClass = next.getUnresolvedSuperClass();
                    if (superClass!=null) {
                        next =  correctToGenericsSpecRecurse(updatedGenericsSpec, superClass);
                    } else {
                        next = null;
                    }
                }
                if (next == null) {
                    addError("Method '" + origMethod.getName() + "' from class '" + cNode.getName() + "' does not override " +
                            "method from its superclass or interfaces but is annotated with @Override.", visited);
                }
            }
        }
    }
978432
private void removeOverriddenMethod(ExecutableElement method) {
        TypeElement overriddenClass = utils.overriddenClass(method);
        if (overriddenClass != null) {
            for (int i = 0; i < methlist.size(); i++) {
                TypeElement te = utils.getEnclosingTypeElement(methlist.get(i));
                if (te == overriddenClass || utils.isSubclassOf(overriddenClass, te)) {
                    methlist.remove(i);  // remove overridden method
                    return;
                }
            }
        }
    }
61629
private void processPropertyOverride(PropertyMetadata propertyMetadata) {
    String qualifiedName = field.getQualifiedName() + "." + propertyMetadata.getField().getName();
    Property override = entityMetadata.getPropertyOverride(qualifiedName);
    if (override != null) {
      String mappedName = override.name();
      if (mappedName != null && mappedName.trim().length() > 0) {
        propertyMetadata.setMappedName(mappedName);
      }
      propertyMetadata.setIndexed(override.indexed());
      propertyMetadata.setOptional(override.optional());
    }
  }
376733
function extend(from, to, path, overrideLoc) {
  for (var prop in from) {
    if (!(prop in to) || (prop == "loc" && overrideLoc)) {
      to[prop] = from[prop]
    } else if (prop == "properties" || prop == "staticProperties") {
      extend(from[prop], to[prop], path.concat(prop))
    } else {
      var msg = "Conflicting information for " + path.join(".") + "." + prop
      if (to.loc) msg += " at " + to.loc.file + ":" + to.loc.line
      if (from.loc) msg += (to.loc ? " and " : " at ") + from.loc.file + ":" + from.loc.line
      throw new SyntaxError(msg)
    }
  }
  return to
}
794893
private static void renameMethod(ClassNode buildee, MethodNode mNode, String newName) {
        buildee.addMethod(newName, mNode.getModifiers(), mNode.getReturnType(), mNode.getParameters(), mNode.getExceptions(), mNode.getCode());
        buildee.removeMethod(mNode);
    }
79745
private void renameFactoryMethod(JDefinedClass factoryClass, String oldMethodName, String newMethodName) {
		for (JMethod method : factoryClass.methods()) {
			String methodName = method.name();

			if (!methodName.contains(oldMethodName)) {
				continue;
			}

			method.name(methodName.replace(oldMethodName, newMethodName));

			writeSummary("\tRenamed " + methodName + " -> " + method.name() + " in " + factoryClass.fullName());
		}
	}
467637
function(cls,superClass) {
    var super_;
    while (lib.type.isFunction(cls.super_)) {
      if (cls.super_ === superClass) {
        super_ = cls.super_;
        break;
      }
      cls = cls.super_;
    }
    return super_;
  }
337595
def monkey_patch_override_method(klass):
    
    def perform_override(override_fn):
        fn_name = override_fn.__name__
        original_fn_name = '_original_' + fn_name
        # Override class method, if it hasn't already been done
        if not hasattr(klass, original_fn_name):
            original_fn = getattr(klass, fn_name)
            setattr(klass, original_fn_name, original_fn)
            setattr(klass, fn_name, override_fn)
    return perform_override
562154
def _fix_up_properties(cls):
    
    # Verify that _get_kind() returns an 8-bit string.
    kind = cls._get_kind()
    if not isinstance(kind, basestring):
      raise KindError('Class %s defines a _get_kind() method that returns '
                      'a non-string (%r)' % (cls.__name__, kind))
    if not isinstance(kind, str):
      try:
        kind = kind.encode('ascii')  # ASCII contents is okay.
      except UnicodeEncodeError:
        raise KindError('Class %s defines a _get_kind() method that returns '
                        'a Unicode string (%r); please encode using utf-8' %
                        (cls.__name__, kind))
    cls._properties = {}  # Map of {name: Property}
    if cls.__module__ == __name__:  # Skip the classes in *this* file.
      return
    for name in set(dir(cls)):
      attr = getattr(cls, name, None)
      if isinstance(attr, ModelAttribute) and not isinstance(attr, ModelKey):
        if name.startswith('_'):
          raise TypeError('ModelAttribute %s cannot begin with an underscore '
                          'character. _ prefixed attributes are reserved for '
                          'temporary Model instance values.' % name)
        attr._fix_up(cls, name)
        if isinstance(attr, Property):
          if (attr._repeated or
              (isinstance(attr, StructuredProperty) and
               attr._modelclass._has_repeated)):
            cls._has_repeated = True
          cls._properties[attr._name] = attr
    cls._update_kind_map()
346642
function rename(object, fromKey, toKey) {
  if ((0, _has2.default)(object, fromKey)) {
    object[toKey] = object[fromKey];
    delete object[fromKey];
  }
}
1297123
def rename_property(cr, model, old_name, new_name):
    """"""
    cr.execute(
        "update ir_model_fields f set name=%s "
        "from ir_model m "
        "where m.id=f.model_id and m.model=%s and f.name=%s "
        "returning f.id",
        (new_name, model, old_name))
    field_ids = tuple(i for i, in cr.fetchall())
    cr.execute(
        "update ir_model_data set name=%s where model='ir.model.fields' and "
        "res_id in %s",
        ('%s,%s' % (model, new_name), field_ids))
    cr.execute(
        "update ir_property set name=%s where fields_id in %s",
        (new_name, field_ids))
26285
function overrideMethod(name, f) {
            // Use Object.defineProperty to prevent methods from appearing in
            // the subject's for in loop
            if (_es5_object_supported) {
                Object.defineProperty(subject, name, {
                    value: f
                });
            } else {
                subject[name] = f;
            }
        }
282247
public void renamedType(String oldName, Class<?> currentValue) {
        if (oldName == null) {
            throw new IllegalArgumentException("oldName must not be null");
        }
        if (currentValue == null) {
            throw new IllegalArgumentException("currentValue must not be null");
        }
        if (oldName.startsWith("java.") || oldName.startsWith("javax.") || oldName.startsWith("org.joda.")) {
            throw new IllegalArgumentException("oldName must not be a java.*, javax.* or org.joda.* type");
        }
        checkNotLocked();
        typeRenames.put(oldName, currentValue);
    }