Creates all prepared statemenst
559740
protected function createPreparedStatements()
  {
    if ($this->prepared_statements_created == false)
    {
      $this->preparedInsertStatement = $this->PDO->prepare("INSERT INTO document_infos (document_info) VALUES (?);");
      $this->preparedSelectStatement = $this->PDO->prepare("SELECT * FROM document_infos limit 1;");
      
      $this->prepared_statements_created = true;
    }
  }
243231
def prepare(self):
		""""""
		self.scope = 0
		self.mapping = deque([0])
		self._handler = [i() for i in sorted(self.handlers, key=lambda handler: handler.priority)]
77820
def PushState(self, **unused_kwargs):
    """"""
    logging.debug('Storing state {0:s}'.format(repr(self.state)))
    self.state_stack.append(self.state)
795458
def set_show_all(self, state):
        """"""
        if state:
            self.fsmodel.setNameFilters([])
        else:
            self.fsmodel.setNameFilters(self.name_filters)
275905
function prepare ( data, useQs ) {
	var ret;
	if ( !('FormData' in global) || useQs ) {
		ret = qs(data);
	} else {
		ret = new FormData();
		for ( var prop in data ) {
			if ( data.hasOwnProperty(prop) ) {
				ret.append(prop, data[prop]);
			}
		}
	}
	return ret;
}
820335
protected function prepare()
    {
        $active = app('antares.memory')->get("extensions.active");
        $memory = app('antares.memory')->make('tests');
        $tests  = $memory->all();
        $return = [];
        foreach ($tests as $index => $data) {
            if (!isset($data['executor'])) {
                $memory->forget($index);
                continue;
            }
            try {
                $reflection = new ReflectionClass($data['executor']);
                if (!$reflection->hasMethod('addTestButton')) {
                    throw new Exception('Form Configuration is invalid. Form with test must contains Testable Trait.');
                }
            } catch (Exception $e) {
                Log::emergency($e);
                $memory->forget($index);
                continue;
            }
            $name                                     = $data['component'];
            $fullName                                 = isset($active[$name]) ? $active[$name]['full_name'] : 'Foundation';
            $return[$fullName][$data['name']][$index] = $data;
        }
        $memory->finish();
        return $return;
    }
1294563
def prepare_stateseries(self, ramflag: bool = True) -> None:
        """"""
        for element in printtools.progressbar(self):
            element.prepare_stateseries(ramflag)
199954
function createSessionState(responseData)
{
  var currentRole             = responseData.finalRoleName;
  var currentWarehouse        = responseData.finalWarehouseName;
  var currentDatabaseProvider = responseData.databaseProvider;
  var currentDatabase         = responseData.finalDatabaseName;
  var currentSchema           = responseData.finalSchemaName;

  return {
    getCurrentRole: function()
    {
      return currentRole;
    },
    getCurrentWarehouse: function()
    {
      return currentWarehouse;
    },
    getCurrentDatabaseProvider: function()
    {
      return currentDatabaseProvider;
    },
    getCurrentDatabase: function()
    {
      return currentDatabase;
    },
    getCurrentSchema: function()
    {
      return currentSchema;
    }
  };
}
131150
protected function createState(array $state_definition)
    {
        $state_implementor = isset($state_definition['class']) ? $state_definition['class'] : State::CLASS;
        $this->loadStateImplementor($state_implementor);

        $state = $this->service_locator->make(
            $state_implementor,
            [
                ':name' => $state_definition['name'],
                ':type' => $state_definition['type'],
                ':options' => $state_definition['options'],
            ]
        );

        if (!$state instanceof StateInterface) {
            throw new RuntimeError(
                sprintf(
                    'Configured implementor "%s" for state "%s" must implement: %s',
                    $state_implementor,
                    $state_definition['name'],
                    StateInterface::CLASS
                )
            );
        }

        return $state;
    }
1099933
protected void createAllRuntimes() {
    ListRuntimesArg.Builder selection = ListRuntimesArg.newBuilder();
    selection.setCreate(true);
    Response response = executeMessage(EcmascriptMessage.LIST_RUNTIMES, selection);

    runtimesList.clear();
    RuntimeList.Builder builder = RuntimeList.newBuilder();
    buildPayload(response, builder);
    List<Runtime> allRuntimes = builder.build().getRuntimeListList();

    for (Runtime info : allRuntimes) {
      runtimesList.put(info.getRuntimeID(), info);
    }
  }
662895
def _setup_states(state_definitions, prev=()):
    """"""
    states = list(prev)
    for state_def in state_definitions:
        if len(state_def) != 2:
            raise TypeError(
                "The 'state' attribute of a workflow should be "
                "a two-tuple of strings; got %r instead." % (state_def,)
            )
        name, title = state_def
        state = State(name, title)
        if any(st.name == name for st in states):
            # Replacing an existing state
            states = [state if st.name == name else st for st in states]
        else:
            states.append(state)
    return StateList(states)
537278
def generate(self, state):
        """"""
        if self.count >= random.randint(DharmaConst.VARIABLE_MIN, DharmaConst.VARIABLE_MAX):
            return "%s%d" % (self.var, random.randint(1, self.count))
        var = random.choice(self)
        prefix = self.eval(var[0], state)
        suffix = self.eval(var[1], state)
        self.count += 1
        element_name = "%s%d" % (self.var, self.count)
        self.default += "%s%s%s\n" % (prefix, element_name, suffix)
        return element_name
14018
protected ExpectState prepareClosure(int pairIndex, String buffer) {
        ExpectState state;
        Map<String, Object> prevMap = null;
        if (g_state != null) {
            prevMap = g_state.getVars();
        }

        state = new ExpectState(pairIndex, buffer, prevMap);

        return state;
    }
844580
def create_blueprint(state):
    
    blueprint = Blueprint(
        'invenio_jsonschemas',
        __name__,
    )

    @blueprint.route('/<path:schema_path>')
    def get_schema(schema_path):
        """Retrieve a schema."""
        try:
            schema_dir = state.get_schema_dir(schema_path)
        except JSONSchemaNotFound:
            abort(404)

        resolved = request.args.get(
            'resolved',
            current_app.config.get('JSONSCHEMAS_RESOLVE_SCHEMA'),
            type=int
        )

        with_refs = request.args.get(
            'refs',
            current_app.config.get('JSONSCHEMAS_REPLACE_REFS'),
            type=int
        ) or resolved

        if resolved or with_refs:
            schema = state.get_schema(
                schema_path,
                with_refs=with_refs,
                resolved=resolved
            )
            return jsonify(schema)
        else:
            return send_from_directory(schema_dir, schema_path)

    return blueprint
606147
def prepare_state_m_for_insert_as(state_m_to_insert, previous_state_size):
    """"""
    # TODO check how much code is duplicated or could be reused for library fit functionality meta data helper
    # TODO DO REFACTORING !!! and move maybe the hole method to meta data and rename it
    if isinstance(state_m_to_insert, AbstractStateModel) and \
            not gui_helper_meta_data.model_has_empty_meta(state_m_to_insert):

        if isinstance(state_m_to_insert, ContainerStateModel):
            # print("TARGET1", state_m_to_insert.state.state_element_attrs)
            models_dict = {'state': state_m_to_insert}

            for state_element_key in state_m_to_insert.state.state_element_attrs:
                state_element_list = getattr(state_m_to_insert, state_element_key)
                # Some models are hold in a gtkmvc3.support.wrappers.ObsListWrapper, not a list
                if hasattr(state_element_list, 'keys'):
                    state_element_list = state_element_list.values()
                models_dict[state_element_key] = {elem.core_element.core_element_id: elem for elem in state_element_list}

            resize_factor = gui_helper_meta_data.scale_meta_data_according_state(models_dict, as_template=True)
            gui_helper_meta_data.resize_income_of_state_m(state_m_to_insert, resize_factor)

        elif isinstance(state_m_to_insert, StateModel):
            # print("TARGET2", state_m_to_insert.state.state_element_attrs)

            if previous_state_size:
                current_size = state_m_to_insert.get_meta_data_editor()['size']
                factor = gui_helper_meta_data.divide_two_vectors(current_size, previous_state_size)
                state_m_to_insert.set_meta_data_editor('size', previous_state_size)
                factor = (min(*factor), min(*factor))
                gui_helper_meta_data.resize_state_meta(state_m_to_insert, factor)
            else:
                logger.debug("For insert as template of {0} no resize of state meta data is performed because "
                             "the meta data has empty fields.".format(state_m_to_insert))

        # library state is not resize because its ports became resized indirectly -> see was resized flag
        elif not isinstance(state_m_to_insert, LibraryStateModel):
            raise TypeError("For insert as template of {0} no resize of state meta data is performed because "
                            "state model type is not ContainerStateModel or StateModel".format(state_m_to_insert))
    else:
        logger.info("For insert as template of {0} no resize of state meta data is performed because the meta data has "
                    "empty fields.".format(state_m_to_insert))
355429
function createAgentState (appname, moduleName, state, parentUrl) {
  createTemplate(appname, path.join('generated', 'agents', 'agentController.js'), {
    moduleName: moduleName,
    state: state,
    parentUrl: parentUrl
  })

  var oldControllerPath = path.join(appname, 'generated', 'agents', 'agentController.js'),
    newControllerPath = path.join(appname, 'generated', 'agents', moduleName, 'controllers', state.name + '.js')

  fs.renameSync(oldControllerPath, newControllerPath)
  if (state.elements) {
    for (childState in state.elements) {
      createAgentChildState(appname, moduleName, state.elements[childState], state.name, parentUrl)
    }
  }

  createTemplate(appname, path.join('generated', 'agents', 'agent.html'), {
    moduleName: moduleName,
    state: state,
    parentUrl: parentUrl
  })

  var oldHtmlPath = path.join(appname, 'generated', 'agents', 'agent.html'),
    newHtmlPath = path.join(appname, 'generated', 'partials', 'agents', moduleName, state.name + '.html')
  fs.renameSync(oldHtmlPath, newHtmlPath)
}
1256042
function PossibleStates(...allStates) {
  if (!allStates.length === 0) {
    throw Error('No values passed when constructing a new PossibleStates')
  }

  const containsData = typeDefinition => typeDefinition.match(/<.*>/)

  if (allStates[0].match(/<.*>/)) {
    throw Error('The initial state cannot contain data')
  }

  const parsedStates = allStates.map(state => {
    if (!containsData(state)) {
      return {name: state, data: []}
    }

    const [name, typeDefs] = state.match(/^(.*)<(.*)>$/).slice(1)

    return {name, data: typeDefs.split(',').map(def => def.trim())}
  })

  return PossibleStatesContainer({current: parsedStates[0], allStates: parsedStates})
}