Since werkzeug request objects are immutable, this is needed to create an
    identical reuet object with immutable values so it can be retried after a
    POST failure.
968131
def make_duplicate_request(request):
    
    class FakeRequest(object):
        method = 'GET'
        path = request.path
        headers = request.headers
        GET = request.GET
        POST = request.POST
        user = getattr(request, 'user', None)
        cookies = request.cookies
        is_xhr = request.is_xhr
    return FakeRequest()
124809
function(params) {

      var options = params ? corbel.utils.clone(params) : {};

      var args = corbel.utils.extend(options, {
        url: this._buildUri(this.uri, this.id),
        method: corbel.request.method.GET,
        query: params ? corbel.utils.serializeParams(params) : null
      });

      return this.request(args);

    }
1122178
protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException
    {
        // update counter
        numRequests++;

        try
        {
            // read request:
            LockManagerRemoteImpl.LockInfo info = (LockManagerRemoteImpl.LockInfo) buildObjectFromRequest(request);
            Object result = null;
            // now execute the command specified by the selector
            try
            {
                switch(info.methodName)
                {
                    case LockManagerRemoteImpl.METHOD_READ_LOCK:
                        {
                            result = new Boolean(lockmanager.readLock(info.key, info.resourceId, info.isolationLevel));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_RELEASE_SINGLE_LOCK:
                        {
                            result = new Boolean(lockmanager.releaseLock(info.key, info.resourceId));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_RELEASE_LOCKS:
                        {
                            lockmanager.releaseLocks(info.key);
                            result = Boolean.TRUE;
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_WRITE_LOCK:
                        {
                            result = new Boolean(lockmanager.writeLock(info.key, info.resourceId,
                                    info.isolationLevel));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_UPGRADE_LOCK:
                        {
                            result = new Boolean(lockmanager.upgradeLock(info.key, info.resourceId, info.isolationLevel));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_CHECK_READ:
                        {
                            result = new Boolean(lockmanager.hasRead(info.key, info.resourceId));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_CHECK_WRITE:
                        {
                            result = new Boolean(lockmanager.hasWrite(info.key, info.resourceId));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_CHECK_UPGRADE:
                        {
                            result = new Boolean(lockmanager.hasUpgrade(info.key, info.resourceId));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_LOCK_INFO:
                        {
                            result = lockmanager.getLockInfo();
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_LOCK_TIMEOUT:
                        {
                            result = new Long(lockmanager.getLockTimeout());
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_BLOCK_TIMEOUT:
                        {
                            result = new Long(lockmanager.getBlockTimeout());
                            break;
                        }
//                    case LockManagerRemoteImpl.METHOD_LOCK_TIMEOUT_SET:
//                        {
//                            lockmanager.setLockTimeout(info.lockTimeout);
//                            break;
//                        }
//
//                    case LockManagerRemoteImpl.METHOD_BLOCK_TIMEOUT_SET:
//                        {
//                            lockmanager.setBlockTimeout(info.blockTimeout);
//                            break;
//                        }
                    default :
                        {
                            throw new LockRuntimeException("Unknown command:" + info.methodName);
                        }
                }
            }
            catch(RuntimeException e)
            {
                result = new LockRuntimeException("Error while invoke specified method in servlet.", e);
            }

            ObjectOutputStream oos = new ObjectOutputStream(response.getOutputStream());
            oos.writeObject(result);
            oos.flush();
            oos.close();
        }
        catch(Throwable t)
        {
            lastError = t;
            t.printStackTrace();
        }
    }
426086
private void makeImmutable() {
        // Make the tags unmodifiable
        event.setTags(Collections.unmodifiableMap(event.getTags()));

        // Make the breadcrumbs unmodifiable
        event.setBreadcrumbs(Collections.unmodifiableList(event.getBreadcrumbs()));

        // Make the contexts unmodifiable
        Map<String, Map<String, Object>> tempContexts = new HashMap<>();
        for (Map.Entry<String, Map<String, Object>> contextEntry : event.getContexts().entrySet()) {
            tempContexts.put(contextEntry.getKey(), Collections.unmodifiableMap(contextEntry.getValue()));
        }
        event.setContexts(Collections.unmodifiableMap(tempContexts));

        // Make the extra properties unmodifiable (everything in it is still mutable though)
        event.setExtra(Collections.unmodifiableMap(event.getExtra()));

        // Make the SentryInterfaces unmodifiable
        event.setSentryInterfaces(Collections.unmodifiableMap(event.getSentryInterfaces()));
    }
448272
function reprovisionInstance(uuid, image_uuid, callback) {
    assert.string(uuid, 'uuid');
    assert.string(image_uuid, 'image_uuid');

    var opts = {};
    opts.image_uuid = image_uuid;

    return (this.put(sprintf('/instances/%s/upgrade', uuid), opts, callback));
}
1363993
private static void attemptRetryOnException(String logPrefix, Request<?> request,
            VolleyError exception) throws VolleyError {
        RetryPolicy retryPolicy = request.getRetryPolicy();
        int oldTimeout = request.getTimeoutMs();

        try {
            retryPolicy.retry(exception);
        } catch (VolleyError e) {
            request.addMarker(
                    String.format("%s-timeout-giveup [timeout=%s]", logPrefix, oldTimeout));
            throw e;
        }
        request.addMarker(String.format("%s-retry [timeout=%s]", logPrefix, oldTimeout));
    }
648051
function cloneWrap(obj, circularValue) {
  circularValue = safeDeepClone(undefined, [], circularValue);
  return safeDeepClone(circularValue, [], obj);
}
850728
function( obj1, obj2 ) {
            var newObj = {};
            if ( obj1 ) {
                this.inheritAttrs( newObj, this.cloneObj( obj1 ) );
            }
            if ( obj2 ) {
                this.inheritAttrs( newObj, obj2 );
            }
            return newObj;
        }
1007365
public static <T> T cloneIfPossible(final T obj) {
		T clone = null;
		try {
			clone = clone(obj);
		} catch (Exception e) {
			// pass
		}
		return clone == null ? obj : clone;
	}
627762
def post(self, request, *args, **kwargs):
        
        return self.unlock(request, *args, **kwargs)
531614
def duplicate(self, request, *args, **kwargs):
        """"""
        if not request.user.is_authenticated:
            raise exceptions.NotFound

        ids = self.get_ids(request.data)
        queryset = get_objects_for_user(request.user, 'view_collection', Collection.objects.filter(id__in=ids))
        actual_ids = queryset.values_list('id', flat=True)
        missing_ids = list(set(ids) - set(actual_ids))
        if missing_ids:
            raise exceptions.ParseError(
                "Collections with the following ids not found: {}".format(', '.join(map(str, missing_ids)))
            )

        duplicated = queryset.duplicate(contributor=request.user)

        serializer = self.get_serializer(duplicated, many=True)
        return Response(serializer.data)
1232747
@Override
	public void handleRequest(final Request request) {
		assertConfigured();

		//
		// Service the request for each row.
		//
		List beanList = getBeanList();
		HashSet rowIds = new HashSet(beanList.size());
		WComponent row = getRepeatedComponent();

		for (int i = 0; i < beanList.size(); i++) {
			Object rowData = beanList.get(i);
			rowIds.add(getRowId(rowData));

			// Each row has its own context. This is why we can reuse the same
			// WComponent instance for each row.
			UIContext rowContext = getRowContext(rowData, i);

			try {
				UIContextHolder.pushContext(rowContext);
				row.serviceRequest(request);
			} finally {
				UIContextHolder.popContext();
			}
		}

		cleanupStaleContexts(rowIds);
	}
194458
public RequestParameterBuilder reset() {
        buffer = new StringBuilder(originalUrl);
        jsonConverter.setType(null);
        added = false;

        return this;
    }
86372
function newCustomPostOne(endpoint, initParams, allowable) {
    var modify = newPostOne(endpoint, allowable);
    return function(body, callback) {
        _.assign(body, initParams);
        return modify.call(this, body, callback);
    };
}
711404
@Override
    public PutObjectResult putObjectSecurely(PutObjectRequest req) {
        // TODO: consider cloning req before proceeding further to reduce side
        // effects
        appendUserAgent(req, USER_AGENT);
        return cryptoConfig.getStorageMode() == InstructionFile
               ? putObjectUsingInstructionFile(req)
               : putObjectUsingMetadata(req);
    }
456760
def _duplicate_example(self, request):
    
    index = int(request.args.get('index'))
    if index >= len(self.examples):
      return http_util.Respond(request, {'error': 'invalid index provided'},
                               'application/json', code=400)
    new_example = self.example_class()
    new_example.CopyFrom(self.examples[index])
    self.examples.append(new_example)
    self.updated_example_indices.add(len(self.examples) - 1)
    self.generate_sprite([ex.SerializeToString() for ex in self.examples])
    return http_util.Respond(request, {}, 'application/json')
634215
private void reorder()
    {
        if(getTransaction().isOrdering() && needsCommit && mhtObjectEnvelopes.size() > 1)
        {
            ObjectEnvelopeOrdering ordering = new ObjectEnvelopeOrdering(mvOrderOfIds, mhtObjectEnvelopes);
            ordering.reorder();
            Identity[] newOrder = ordering.getOrdering();

            mvOrderOfIds.clear();
            for(int i = 0; i < newOrder.length; i++)
            {
                mvOrderOfIds.add(newOrder[i]);
            }
        }
    }