The state of the mock server will be stored in the resulting
    object created here
188168
def get_store(url_details):
    
    store = {}
    for detail in url_details:
        base_url = detail['url'].strip()

        # If a url detail has instances, it means that
        # we want to also create an endpoint that can list
        # all of the instances
        has_instances = False

        try:
            if len(detail['response']) > 1:
                if '__key' in detail['full_url']:
                    for resp in detail['response']:
                        parsed_resp = ast.literal_eval(resp)
                        tmp_copy_resp = deepcopy(parsed_resp)
                        cleaned_resp = {}
                        # Remove meta keys or hidden attributes from cleaned resp
                        for k, v in tmp_copy_resp.items():
                            if '__' not in k and '--' not in k:
                                cleaned_resp[k] = v
                        if parsed_resp['__key_position'] == 'url':
                            unique_key = parsed_resp['__key_name']
                            constructed_url = re.sub(r'\_\_key', str(parsed_resp[unique_key]), base_url)
                            store[constructed_url] = {
                                'data': cleaned_resp,
                                'pk': True,
                                'pkName': parsed_resp['__key_name'],
                                'position': 'url',
                                'options': parsed_resp.get('__options', '{}')
                            }
                            has_instances = True
                        elif parsed_resp['__key_position'] == 'query':
                            unique_key = parsed_resp['__key_name']
                            if not base_url.endswith('/'):
                                url_with_slash = base_url + '/'
                            constructed_url = url_with_slash + '__pk/' + str(parsed_resp[unique_key])
                            constructed_url = re.sub(r'\_\_key', '', constructed_url)  # if '__key' hasn't already been replaced, remove it
                            store[constructed_url] = {
                                'data': cleaned_resp,
                                'pk': True,
                                'pkName': unique_key,
                                'position': 'query',
                                'options': parsed_resp.get('__options', '{}')
                            }
                            has_instances = True

                    if has_instances:
                        # This endpoint has multiple instances
                        # we will need to create a new endpoint to list all
                        # these instances
                        list_url = re.sub(r'\/?\_\_key', '', base_url)
                        instances = []
                        for k, v in store.items():
                            if list_url in k:
                                instances.append(v['data'])
                        store[list_url] = {'data': instances}
                else:
                    # This is for an array of responses that don't
                    # have primary keys. I.e. the endpoint only serves
                    # a list
                    clean_resp = []
                    for resp in detail['response']:
                        parsed_resp = ast.literal_eval(resp)
                        tmp_copy_resp = deepcopy(parsed_resp)
                        cleaned_resp = {}
                        # Remove meta keys or hidden attributes from cleaned resp
                        for k, v in tmp_copy_resp.items():
                            if '__' not in k and '--' not in k:
                                cleaned_resp[k] = v
                        clean_resp.append(cleaned_resp)
                    store[base_url] = {
                        'data': clean_resp,
                        'pk': False
                    }

            else:
                # If the length of the response is not more than 1
                # Check if unique key is a dynamic key
                if isinstance(detail['response'], list) and len(detail['response']) == 1:
                    response = ast.literal_eval(detail['response'][0])
                    if response['__key_name'] is not None and response['__key_name'].startswith('*'):
                        for k, v in response.items():
                            if k.startswith('__') or k.startswith('--'):
                                continue
                            unique_key = k
                            if response['__key_position'] == 'query':
                                if not base_url.endswith('/'):
                                    url_with_slash = base_url + '/'
                                constructed_url = url_with_slash + '__pk/' + str(unique_key)
                                constructed_url = re.sub(r'\_\_key', '', constructed_url)
                            else:
                                constructed_url = re.sub(r'\_\_key', str(unique_key), base_url)
                            store[constructed_url] = {
                                'data': v,
                                'pk': True,
                                'parentName': unique_key,
                                'pkName': response['__key_name'][1:],
                                'position': response['__key_position'],
                                'options': parsed_resp.get('__options', '{}')
                            }
                        has_instances = True
                base_url = re.sub(r'\/?\_\_key', '', base_url)  # if '__key' hasn't already been replaced, remove it
                parsed_resp = ast.literal_eval(detail['response'][0])
                tmp_copy_resp = deepcopy(parsed_resp)
                cleaned_resp = {}
                # Remove meta keys or hidden attributes from cleaned resp
                for k, v in tmp_copy_resp.items():
                    if '__' not in k and '--' not in k:
                        cleaned_resp[k] = v

                store[base_url] = {
                    'data': cleaned_resp,
                    'pk': False,
                    'options': parsed_resp.get('__options', '{}')
                }
        except KeyError:
            # PUT, PATCH, DELETE
            pass
    return store
819515
public boolean getState()
    {
        boolean returnValue = true;
        if (m_objTarget instanceof String)
        {
            String fieldString = this.getString();
            returnValue = m_objTarget.equals(fieldString); // True if == target value
        }
        else
        {
            Object fieldString = this.getData();
            returnValue = m_objTarget.equals(fieldString); // True if == target value
        }
        if (m_bTrueIfMatch)
            return returnValue;
        else
            return !returnValue;
    }
396444
private void prepareInitialState(boolean isNewObject)
    {
        // determine appropriate modification state
        ModificationState initialState;
        if(isNewObject)
        {
            // if object is not already persistent it must be marked as new
            // it must be marked as dirty because it must be stored even if it will not modified during tx
            initialState = StateNewDirty.getInstance();
        }
        else if(isDeleted(oid))
        {
            // if object is already persistent it will be marked as old.
            // it is marked as dirty as it has been deleted during tx and now it is inserted again,
            // possibly with new field values.
            initialState = StateOldDirty.getInstance();
        }
        else
        {
            // if object is already persistent it will be marked as old.
            // it is marked as clean as it has not been modified during tx already
            initialState = StateOldClean.getInstance();
        }
        // remember it:
        modificationState = initialState;
    }
1226426
public void init() {
    waitForHandshake();

    availableServices = buildAvailableServices(getHostInfo());

    connect();

    // We always need a debugger, and it should never be included in the set of required services
    if (OperaDefaults.ENABLE_DEBUGGER &&
        !(requiredServices.contains(ScopeService.ECMASCRIPT) ||
          requiredServices.contains(ScopeService.ECMASCRIPT_DEBUGGER))) {
      if (availableServices.containsKey(ScopeService.ECMASCRIPT)) {
        requiredServices.add(ScopeService.ECMASCRIPT);
      } else {
        requiredServices.add(ScopeService.ECMASCRIPT_DEBUGGER);
      }
    } else {
      debugger = new MockEcmascriptDebugger();
    }

    services = createServices(requiredServices);
    enableServices(services.values());
    initializeServices(services.values());
  }
236695
function loadMockDbQuery (mockData, options) {
    // get stable id for http request data with non-deterministic properites removed
    try {
        var stableId = dbQueryStableId(mockData.data)
    }
    // catch errors if ignore option is set
    catch (ex) {
        if (options.ignoreInvalidMockData) {
            return
        }
        else {
            throw new Error('automock error: invalid mock data')
        }
    }
    // store moduleCall data keyed by stable id
    immutableAutomock.dbQueryMocks[stableId] = mockData.data
}
741165
def init_mock(self, release):
        """"""
        root = '/var/lib/mock/%s' % release['mock']
        if not os.path.isdir(root):
            self.mock_cmd(release, '--init')
            self.log.info('mock chroot initialized')
        else:
            if release.get('mock_clean'):
                self.mock_cmd(release, '--clean')
                self.mock_cmd(release, '--init')
                self.log.info('mock chroot cleaned & initialized')
            else:
                self.mock_cmd(release, '--update')
                self.log.info('mock chroot updated')
900284
function Store() {
            var _this = this;
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                args[_i] = arguments[_i];
            }
            if (!Reflect.hasMetadata(constance_1.STATEX_ACTION_KEY, this))
                return;
            var statexActions = Reflect.getMetadata(constance_1.STATEX_ACTION_KEY, this);
            Object.keys(statexActions).forEach(function (name) { return new statexActions[name]().subscribe(_this[name], _this); });
            return construct(original, args);
        }
612721
function create(requestObj, callback) {

            var i, requestConfig, storage;

            storage = this;

            callback = callback || function(){};

            if ((typeof requestObj) === 'undefined' || requestObj === null) {
                callback(null);
                return this;
            }
            
            requestObj.config = {};
            requestObj.config.url = requestObj.config.url || this.url.post;
            requestObj.config.type = requestObj.config.type || this.constructor.REQUEST_TYPE_POST;

			for (i = 0; i < storage.preprocessors.length; i++) {
                requestObj.data = storage.preprocessors[i](requestObj.data, requestObj);
            }

            this.constructor._sendRequest(requestObj, function(data){
                for (i = 0; i < storage.processors.length; i++) {
                    data = storage.processors[i](data, requestObj);
                }
                callback(data);
            });

            return this;
        }
1043084
public MockRestServiceServer build() {
		if (this.ignoreExpectOrder) {
			this.builder.ignoreExpectOrder(true); // default is false
		}
		MockRestServiceServer server = this.builder.build();
		List<StubMapping> mappings = new ArrayList<>();
		for (String location : this.locations) {
			try {
				for (Resource resource : this.resolver.getResources(pattern(location))) {
					StubMapping mapping = mapping(resource);
					mappings.add(mapping);
				}
			}
			catch (IOException e) {
				throw new IllegalStateException("Cannot load resources for: " + location,
						e);
			}
		}
		if (this.ignoreExpectOrder) {
			Collections.sort(mappings, new StubMappingComparator());
		}
		for (StubMapping mapping : mappings) {
			ResponseActions expect = responseActions(server, mapping);
			expect.andExpect(method(
					HttpMethod.valueOf(mapping.getRequest().getMethod().getName())));
			mapping.getRequest().getBodyPatterns();
			bodyPatterns(expect, mapping.getRequest());
			requestHeaders(expect, mapping.getRequest());
			expect.andRespond(response(mapping.getResponse()));
		}
		return server;
	}
1345174
function mockRequest() {
    return { and_return : function(body, type, status, headers) {
      XMLHttpRequest = MockXMLHttpRequest
      ActiveXObject = false
      status = status || 200
      headers = headers || {}
      headers['content-type'] = type
      JSpec.extend(XMLHttpRequest.prototype, {
        responseText: body,
        responseHeaders: headers,
        status: status,
        statusText: JSpec.statusCodes[status]
      })
    }}
  }
804111
def _init():
    
    # If there is a context and it is initialized to this request,
    # return, otherwise reinitialize the _local_context.
    if (hasattr(_local_context, '_initialized') and
            _local_context._initialized == os.environ.get('REQUEST_ID_HASH')):
        return

    # Used to track the context object stack.
    _local_context.registry = []

    # Used to provide easy access to the currently running Async job.
    _local_context._executing_async_context = None
    _local_context._executing_async = []

    # So that we do not inadvertently reinitialize the local context.
    _local_context._initialized = os.environ.get('REQUEST_ID_HASH')

    return _local_context
12866
function (options, callback) {
    if (this.stopMockServerFunc) {
      this.stopMockServerFunc(options, callback);
    } else if (this.mockServer) {
      this.mockServer.stop(callback);
    } else {
      callback();
    }
  }
898183
def CreateMock(self, class_to_mock):
    

    new_mock = MockObject(class_to_mock)
    self._mock_objects.append(new_mock)
    return new_mock
739287
@Constructed
	public void constructed() {
		Context context = factory.enterContext();
		
		try {
			scope = new ImporterTopLevel(context);
		} finally {
			Context.exit();
		}
		
		Container container = Jaguar.component(Container.class);
		Object store = container.component(container.contexts().get(Application.class)).store();
		
		if (store instanceof ServletContext) {
			org.eiichiro.bootleg.Configuration configuration = new DefaultConfiguration();
			configuration.init((ServletContext) store);
			this.configuration = configuration;
		}
	}
893040
function() {
                    this.constructor.store[this.__get(this.constructor.id)] = this;
                    return can.Map.prototype._bindsetup.apply(this, arguments);
                }
241008
function loadMockData(server, next) {
  // Create REST resources for each employee photo
  var resources = [];
  data.employees.forEach(function(employee) {
    var collectionPath = '/employees/' + employee.username + '/photos';
    resources.push(new swagger.Resource(collectionPath, 'portrait', {path: employee.portrait}));
    resources.push(new swagger.Resource(collectionPath, 'thumbnail', {path: employee.thumbnail}));
  });

  // Save the resources to the mock data store
  server.dataStore.save(resources, next);
}
738365
function mockDB() {
  if (!mocked) {
    defaultController = Parse.CoreManager.getRESTController();
    mocked = true;
    Parse.CoreManager.setRESTController(MockRESTController);
  }
}