This is called upon unpickling, rather than the default which doesn't
    have arguments and breaks __new__.
6510
def _new_Index(cls, d):
    
    # required for backward compat, because PI can't be instantiated with
    # ordinals through __new__ GH #13277
    if issubclass(cls, ABCPeriodIndex):
        from pandas.core.indexes.period import _new_PeriodIndex
        return _new_PeriodIndex(cls, **d)
    return cls.__new__(cls, **d)
56062
def _copy_default(cls, default):
        ''' 

        '''
        if not isinstance(default, types.FunctionType):
            return copy(default)
        else:
            return default()
435712
function () {
                this.isDefaultPrevented = true;

                if (this.$) {
                    var e = this.$.orginalEvent;

                    if (e) {
                        if (e.preventDefault) {
                            e.preventDefault();
                        } else {
                            e.returnValue = false;  // IE
                        }
                    }
                }
            }
880403
def set_default(self_,param_name,value):
        
        cls = self_.cls
        setattr(cls,param_name,value)
964061
def method_missing(method, *args)
			cls = $1 if method =~ /(.*)_picker/
			return super unless cls #not a valid picker method call
			args = (args + Array.new(3)).slice(0..2).push("#{cls}picker") #pad args to 3 and add cls attr to end
			send(:hd_picker, *args)
		end
808543
function patchUncaught() {
  var name = 'uncaughtException';
  var originalListener = process.listeners(name).pop();

  if (originalListener) {
    process.removeListener(name, originalListener);
  }

  return function() {
    if (!originalListener) return;
    process.on(name, originalListener);
  };
}
965843
def _setdefault(obj, key, value):
    
    v = obj.get(key)
    if v == None:
        obj[key] = value
        return value
    return v
1157392
function applyNew(cls, args) {
    args = _.toArray(args);
    args.unshift(null);
    return new (cls.bind.apply(cls, args));
  }
585628
function callNew(T, args)
{
  return new (Function.prototype.bind.apply(T, [null].concat(args)));
}
104313
def on_value_change(self, picker, old, new):
        
        d = self.declaration
        with self.widget.setValue.suppressed():
            d.value = new
583484
def nonDefaults(self):
        
        nonDefaults = {}
        for k, d in self.__class__.defaults.items():
            v = getattr(self, k)
            if v != d and (v == v or d == d):  # tests for NaN too
                nonDefaults[k] = v
        return nonDefaults
901407
def _reset(self, **kwargs):
        
        # set object attributes from params
        for key in kwargs:
            setattr(self, key, kwargs[key])

        # set defaults (if need be) where the default is not None
        for attr in self.ATTRIBUTES:
            if not hasattr(self, attr) and self.ATTRIBUTES[attr] is not None:
                setattr(self, attr, self.ATTRIBUTES[attr])
1239304
def setdefault(self, name: str, default: Any=None) -> Any:
        """"""
        return self.__dict__.setdefault(name, default)
773297
def new(batch_size=None, **options):
    

    if batch_size:
        new_context = AutoContext(batch_size=batch_size, **options)
    else:
        new_context = Context(**options)

    _local.get_local_context().registry.append(new_context)

    return new_context
484606
def defaults(default=None):
    
    def _f(func):
        @functools.wraps(func)
        def __f(self, *args, **kwargs):
            try:
                return func(self, *args, **kwargs)
            except Exception:
                return default
        return __f
    return _f
1363376
def as_uninitialized(fn):
    
    @wraps(fn)
    def override_initialization(self_,*args,**kw):
        parameterized_instance = self_.self
        original_initialized=parameterized_instance.initialized
        parameterized_instance.initialized=False
        fn(parameterized_instance,*args,**kw)
        parameterized_instance.initialized=original_initialized
    return override_initialization
508324
def newline(self, *args, **kwargs):
        
        levelOverride = kwargs.get('level') or self._lastlevel
        self._log(levelOverride, '', 'newline', args, kwargs)