creates a proxy for plain objects / arrays
507947
function createProxy$1(parent, base) {
      var proxy = shallowCopy(base);
      each(base, function (i) {
          Object.defineProperty(proxy, "" + i, createPropertyProxy("" + i));
      });
      var state = createState$1(parent, proxy, base);
      createHiddenProperty(proxy, PROXY_STATE, state);
      states.push(state);
      return proxy;
  }
1059853
function proxy(req, endpoint) {
	var source = req.connection;
	var target;

	source.pause();

	target = net.connect(endpoint, function proxyHandler() {
		// the header has already been consumed, so we must recreate it and send it first

		target.write(recreateRequestHeader(req));

		target.pipe(source);
		source.pipe(target);

		source.resume();
	});

	target.setTimeout(0);
	target.setNoDelay(true);
	target.setKeepAlive(true, 0);

	return target;
}
205003
function objectExtendDeep(extended) {
  var currentObject;
  var currentType;
  var extendedType;
  var currentItem;
  var currentTypeInner;

  for (var i = 1, c = arguments.length; i < c; i++) {
    currentObject = arguments[i];
    if (!currentObject)
      continue;
    currentType = type(currentObject);
    extendedType = type(extended);
    // type mismatch
    if (currentType !== extendedType) {
      if (currentType === 'array') {
        extended = [];
      } else if (currentType === 'object' && extendedType !== 'function') {
        extended = {};
      }
      // else copy, primitive, date, regexp, function ...
    }
    // extend arrays
    if (currentType === 'array') {
      extended = extended.concat(currentObject);
    } else {
      // or objects ;)
      for (var key in currentObject) {
        if (ownProperty.call(currentObject, key)) {
          currentTypeInner = type(currentObject[key]);
          currentItem = currentObject[key];
          if (/^(object|array)$/.test(currentTypeInner)) {
            extended[key] = objectExtendDeep(extended[key], currentItem);
          } else if (currentTypeInner === 'date') {
            extended[key] = new Date(currentItem.getTime());
          } else if (currentTypeInner === 'regexp') {
            extended[key] = cloneRegExp(currentItem);
          } else {
            extended[key] = currentItem;
          }
        }
      }
    }
  }
  return extended;
}
644436
private <J, T extends Proxy<J>> T marshalConstructor(final int opcode,
                                                         final J implementation,
                                                         final int version,
                                                         final Class<T> newProxyCls,
                                                         final long argsPointer) {
        try {
            final long wlProxy = WaylandClientCore.INSTANCE()
                                                  .wl_proxy_marshal_array_constructor(this.pointer,
                                                                                      opcode,
                                                                                      argsPointer,
                                                                                      InterfaceMeta.get(newProxyCls).pointer.address);
            return marshalProxy(wlProxy,
                                implementation,
                                version,
                                newProxyCls);
        }
        catch (final NoSuchMethodException |
                IllegalAccessException |
                InstantiationException |
                InvocationTargetException e) {
            throw new RuntimeException("Uh oh, this is a bug!",
                                       e);
        }
    }
432296
def object_from_json(self, object_type, object_json, parent=None):
        
        if not isinstance(object_json, dict):
            return object_json
        obj = self.instantiate_object(object_type, parent)
        for key, value in object_json.items():
            if key not in self.skip_attrs:
                key, value = self._deserialize(key, obj, value)
            if isinstance(value, dict):
                value = ProxyDict(value, dirty_callback=getattr(
                    obj, '_dirty_callback', None))
            elif isinstance(value, list):
                value = ProxyList(value, dirty_callback=getattr(
                    obj, '_dirty_callback', None))
            setattr(obj, key, value)
        if hasattr(obj, '_clean_dirty'):
            obj._clean_dirty()
        self.api.cache.add(obj)
        return obj
1270645
function javaClassConstructorProxy() {
    var args = [name];
    for (var i = 0; i < arguments.length; i++) {
      args.push(arguments[i]);
    }
    return java.newInstanceSync.apply(java, args);
  }
1068718
function(obj) {
                // Object is array, plain object, Map or List
                if (obj && typeof obj === "object") {
                    // Get native object or array from Map or List
                    if (obj instanceof can.Map) {
                        obj = obj.attr();
                        // Clone object to prevent change original values
                    } else {
                        obj = can.isFunction(obj.slice) ? obj.slice() : can.extend({}, obj);
                    }
                    // Convert each object property or array item into stringified new
                    can.each(obj, function(val, prop) {
                        obj[prop] = stringify(val);
                    });
                    // Object supports toString function
                } else if (obj !== undefined && obj !== null && can.isFunction(obj.toString)) {
                    obj = obj.toString();
                }

                return obj;
            }
1311016
function proxy() {
  const defaultProxy = {
    changeOrigin: true,
    ws: true,
    logLevel: 'info',
    xfwd: true,
    logProvider() {
      return {
        log(...args) {
          Logger.log(proxyLogRewrite(args));
        },
        debug(...args) {
          Logger.debug(proxyLogRewrite(args));
        },
        info(...args) {
          Logger.info(proxyLogRewrite(args));
        },
        warn(...args) {
          Logger.warn(proxyLogRewrite(args));
        },
        error(...args) {
          Logger.error(proxyLogRewrite(args));
        }
      };
    }
  };

  const { proxies } = settings.configuration;

  if (!proxies) {
    return null;
  }

  const config = [];

  // Iterate through each proxy configuration
  proxies.forEach(proxyConfiguration => {
    // Merge in defaults including custom Logger and custom request/response function
    const proxyConfig = merge({}, defaultProxy, proxyConfiguration, {
      onProxyReq: (proxyReq, req) => {
        onRequest(proxyConfiguration, proxyReq, req);
        if (typeof proxyConfiguration.onProxyReq === 'function') {
          proxyConfiguration.onProxyReq(proxyReq, req);
        }
      },

      onProxyRes: (proxyRes, req, res) => {
        onResponse(proxyConfiguration, proxyRes, req, res);
        if (typeof proxyConfiguration.onProxyRes === 'function') {
          proxyConfiguration.onProxyRes(proxyRes, req, res);
        }
      },

      onError: (err, req, res) => {
        onProxyError(proxyConfiguration, err, req, res);
        if (typeof proxyConfiguration.onError === 'function') {
          proxyConfiguration.onError(err, req, res);
        }
      }
    });

    const proxyContext = Array.isArray(proxyConfig.context) ? proxyConfig.context[0] : proxyConfig.context;

    // Only create proxy if enabled
    if (proxyConfig.enabled) {
      config.push(proxyConfig);
    } else {
      Logger.info(
        `Proxy with context: ${chalk.dim(proxyContext)} and target: ${chalk.dim(proxyConfig.target)} is ${chalk.magenta(
          'DISABLED'
        )}`
      );
    }
  });

  // return null if the array is 0 to make the checks easier upstream
  return config.length === 0 ? null : config;
}
408339
def writeProxy(self, obj):
        
        proxy = self.context.getProxyForObject(obj)

        self.writeObject(proxy, is_proxy=True)
251570
private void createProxyJsMethod(Builder componentExposedTypeBuilder,
      ExecutableElement originalMethod, String proxyMethodName) {
    Emit emitAnnotation = originalMethod.getAnnotation(Emit.class);

    MethodSpec.Builder proxyMethodBuilder = MethodSpec
        .methodBuilder(proxyMethodName)
        .addModifiers(Modifier.PUBLIC)
        .addAnnotation(JsMethod.class)
        .addAnnotation(getUnusableByJSAnnotation())
        .returns(ClassName.get(originalMethod.getReturnType()));

    originalMethod
        .getParameters()
        .forEach(parameter -> proxyMethodBuilder.addParameter(TypeName.get(parameter.asType()),
            parameter.getSimpleName().toString()));

    String methodCallParameters = getSuperMethodCallParameters(originalMethod);
    boolean hasReturnValue = !"void".equals(originalMethod.getReturnType().toString());
    if (hasReturnValue) {
      proxyMethodBuilder.addStatement("$T result = super.$L($L)",
          originalMethod.getReturnType(),
          originalMethod.getSimpleName().toString(),
          methodCallParameters);
    } else {
      proxyMethodBuilder.addStatement("super.$L($L)",
          originalMethod.getSimpleName().toString(),
          methodCallParameters);
    }

    if (emitAnnotation != null) {
      addEmitEventCall(originalMethod, proxyMethodBuilder, methodCallParameters);
    }

    if (hasReturnValue) {
      proxyMethodBuilder.addStatement("return result");
    }

    componentExposedTypeBuilder.addMethod(proxyMethodBuilder.build());
  }
594735
function FixtureProxy(fixture, childIndex) {
  this.aabb = new AABB();
  this.fixture = fixture;
  this.childIndex = childIndex;
  this.proxyId;
}
779484
def generate_proxy(
        prefix, base_url='', verify_ssl=True, middleware=None,
        append_middleware=None, cert=None, timeout=None):
    """"""
    middleware = list(middleware or HttpProxy.proxy_middleware)
    middleware += list(append_middleware or [])

    return type('ProxyClass', (HttpProxy,), {
        'base_url': base_url,
        'reverse_urls': [(prefix, base_url)],
        'verify_ssl': verify_ssl,
        'proxy_middleware': middleware,
        'cert': cert,
        'timeout': timeout
    })
648612
def proxy_global(name, no_expand_macro=False, fname='func', args=()):
    
    if no_expand_macro:  # pragma: no cover
        # handle older ROOT versions without _ExpandMacroFunction wrapping
        @property
        def gSomething_no_func(self):
            glob = self(getattr(ROOT, name))
            # create a fake func() that just returns self
            def func():
                return glob
            glob.func = func
            return glob
        return gSomething_no_func

    @property
    def gSomething(self):
        obj_func = getattr(getattr(ROOT, name), fname)
        try:
            obj = obj_func(*args)
        except ReferenceError:  # null pointer
            return None
        # asrootpy
        return self(obj)

    return gSomething
909953
function createProxies(config, map, parentPath) {
  parentPath = parentPath || [];

  var isBase = parentPath.length === 0;
  var proxies = {};
  var path;

  for (var key in map) {
    if (map.hasOwnProperty(key)) {
      if (isObject(map[key])) {
        proxies[key] = createProxies(config, map[key], parentPath.concat([key]));
      }
      else if (isBoolean(map[key])) {
        path = parentPath.join('/') + (isBase ? '' : '/') + key;
        proxies[key] = createProxiedMethod(config, path);
      }
    }
  }

  return proxies;
}
361473
def use(proxy, options = {}, &block)
      proxy = Moneta.const_get(proxy) if Symbol === proxy
      raise ArgumentError, 'You must give a Class or a Symbol' unless Class === proxy
      @proxies.unshift [proxy, options, block]
      nil
    end
251635
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy)
        throws Throwable {

        if (method.getName().equals("toString") && args.length == 0) {
            return locator.toString();
        }

        if (Object.class.equals(method.getDeclaringClass())) {
            return proxy.invokeSuper(obj, args);
        }

        if (WrapsDriver.class.isAssignableFrom(method.getDeclaringClass()) && method.getName()
            .equals("getWrappedDriver")) {
            return driver;
        }

        WebElement realElement = locator.findElement();
        return getObject(realElement, method, args);
    }
1297695
function ProxyGuest ( options ) {
	// prepare
	var name;

	// connection with server
	this.active = false;

	/**
	 * proxy instance configuration
	 * @namespace
	 */
	this.config = {
		// node.js server address
		host: '127.0.0.1',

		// http server port
		port: 8800,

		// session name
		name: 'anonymous',

		// cached url for posting requests
		urlPost: '',

		// cached url for info collecting
		urlInfo: ''
	};

	// single ajax object for performance
	this.xhr = new XMLHttpRequest();

	// validate and iterate input
	if ( options && typeof options === 'object' ) {
		for ( name in options ) {
			// rewrite defaults
			if ( options.hasOwnProperty(name) ) {
				this.config[name] = options[name];
			}
		}
	}

	// there may be some special chars
	name = encodeURIComponent(this.config.name);

	// cache final request urls
	this.config.urlPost = 'http://' + this.config.host + ':' + this.config.port + '/' + name;
	this.config.urlInfo = 'http://' + this.config.host + ':' + this.config.port + '/info/' + name;

	// check initial connection status
	this.active = this.info().active;

	console.log('%c[core]\t%c%s\t%c0\t%cconnection to the host %c(%s:%s): %c%s',
		'color:grey',
		'color:purple', this.config.name,
		'color:grey',
		'color:black',
		'color:grey', this.config.host, this.config.port,
		'color:' + (this.active ? 'green' : 'red'), this.active ? 'available' : 'not available'
	);
}