Change the input structure.
198657
def _change_structure(self, new_structure):
        """"""
        # Compare new and old structure for logging purpose.
        # TODO: Write method of structure to compare self and other and return a dictionary
        old_structure = self.input.structure
        old_lattice = old_structure.lattice

        abc_diff = np.array(new_structure.lattice.abc) - np.array(old_lattice.abc)
        angles_diff = np.array(new_structure.lattice.angles) - np.array(old_lattice.angles)
        cart_diff = new_structure.cart_coords - old_structure.cart_coords
        displs = np.array([np.sqrt(np.dot(v, v)) for v in cart_diff])

        recs, tol_angle, tol_length = [], 10**-2, 10**-5

        if np.any(np.abs(angles_diff) > tol_angle):
            recs.append("new_agles - old_angles = %s" % angles_diff)

        if np.any(np.abs(abc_diff) > tol_length):
            recs.append("new_abc - old_abc = %s" % abc_diff)

        if np.any(np.abs(displs) > tol_length):
            min_pos, max_pos = displs.argmin(), displs.argmax()
            recs.append("Mean displ: %.2E, Max_displ: %.2E (site %d), min_displ: %.2E (site %d)" %
                (displs.mean(), displs[max_pos], max_pos, displs[min_pos], min_pos))

        self.history.info("Changing structure (only significant diffs are shown):")
        if not recs:
            self.history.info("Input and output structure seems to be equal within the given tolerances")
        else:
            for rec in recs:
                self.history.info(rec)

        self.input.set_structure(new_structure)
841502
public function change()
    {
        $table = $this->table('calendar_events');
        $table->addIndex(['calendar_id']);
        $table->addIndex(['is_recurring']);
        $table->addIndex(['start_date']);
        $table->addIndex(['end_date']);
        $table->update();
    }
819696
def _standardize(structure):
    '''
    
    '''
    def mutating_helper(structure):
        if isinstance(structure, list):
            structure.sort(key=_id_or_key)
            for each in structure:
                mutating_helper(each)
        elif isinstance(structure, dict):
            structure = dict(structure)
            for k, v in six.iteritems(structure):
                mutating_helper(k)
                mutating_helper(v)

    new_structure = copy.deepcopy(structure)
    mutating_helper(new_structure)
    return new_structure
1261106
public function change() {
		$table = $this->table('queue_processes');

		$table->changeColumn('pid', 'string', [
			'length' => 40,
			'null' => false,
			'default' => null,
			'encoding' => 'utf8mb4',
			'collation' => 'utf8mb4_unicode_ci',
		]);

		$table->save();
	}
457550
private function setInput()
    {
        $this->input = file_get_contents("php://input");
        if (!empty($this->input)) {
            $this->input = gzinflate($this->input);
            $this->input = json_decode($this->input, true);
        }
    }
245850
def replaceWith(self, param):
        """"""
        i = self.parent().children().index(self)
        # TODO: transfer the children:
        p = self.parent()
        self.parent().removeChild(self)
        p.insertChild(i, param)
        self = param
181524
function resetInput() {
  var $modal = getModal();
  var $input = getInput();

  _removeClass$getTopMargin$fadeIn$show$addClass.removeClass($modal, 'show-input');
  $input.value = '';
  $input.setAttribute('type', _defaultParams2['default'].inputType);
  $input.setAttribute('placeholder', _defaultParams2['default'].inputPlaceholder);

  resetInputError();
}
1058480
def set_renamed_input_fields(self, renamed_input_fields):
        
        if not (isinstance(renamed_input_fields, basestring) or
                isinstance(renamed_input_fields, ListType)):
            raise ValueError("renamed_input_fields must be a string or a list")
        self.renamed_input_fields = renamed_input_fields
        return self
969223
def alter(data, system):
    """"""
    device = data[0]
    action = data[1]
    if data[2] == '*':
        data[2] = '.*'
    regex = re.compile(data[2])
    prop = data[3]
    value = float(data[4])
    if action == 'MUL':
        for item in range(system.__dict__[device].n):
            if regex.search(system.__dict__[device].name[item]):
                system.__dict__[device].__dict__[prop][item] *= value
    elif action == 'REP':
        for item in range(system.__dict__[device].n):
            if regex.search(system.__dict__[device].name[item]):
                system.__dict__[device].__dict__[prop][item] = value
    elif action == 'DIV':
        if not value:
            return
        for item in range(system.__dict__[device].n):
            if regex.search(system.__dict__[device].name[item]):
                system.__dict__[device].__dict__[prop][item] /= value
    elif action == 'SUM':
        for item in range(system.__dict__[device].n):
            if regex.search(system.__dict__[device].name[item]):
                system.__dict__[device].__dict__[prop][item] += value
    elif action == 'SUB':
        for item in range(system.__dict__[device].n):
            if regex.search(system.__dict__[device].name[item]):
                system.__dict__[device].__dict__[prop][item] -= value
    elif action == 'POW':
        for item in range(system.__dict__[device].n):
            if regex.search(system.__dict__[device].name[item]):
                system.__dict__[device].__dict__[prop][item] **= value
    else:
        print('ALTER action <%s> is not defined', action)
768546
def input_(data, field_path):
    """"""
    data_obj = Data.objects.get(id=data['__id'])

    inputs = copy.deepcopy(data_obj.input)
    # XXX: Optimize by hydrating only the required field (major refactoring).
    hydrate_input_references(inputs, data_obj.process.input_schema)
    hydrate_input_uploads(inputs, data_obj.process.input_schema)

    return dict_dot(inputs, field_path)
577516
def modify(self, **kwargs):
        """"""
        for key, val in kwargs.items():
            setattr(self, key, val)
        return self
143655
def change_octave(self, diff):
        """"""
        self.octave += diff
        if self.octave < 0:
            self.octave = 0
751776
def replace(self, new_node):
        """"""
        cur_node = self.cur_node
        nodestack = self.nodestack
        cur = nodestack.pop()
        prev = nodestack[-1]
        index = prev[-1] - 1
        oldnode, name = prev[-2][index]
        assert cur[0] is cur_node is oldnode, (cur[0], cur_node, prev[-2],
                                               index)
        parent = prev[0]
        if isinstance(parent, list):
            parent[index] = new_node
        else:
            setattr(parent, name, new_node)
252782
def transform(self, attrs):
        """"""
        self.collect(attrs)
        self.add_missing_implementations()
        self.fill_attrs(attrs)
298625
public function change()
    {
        $table = $this->table('languages');
        $table->addColumn('is_rtl', 'boolean', [
            'default' => false,
            'null' => false,
        ]);
        $table->addColumn('trashed', 'datetime', [
            'default' => null,
            'null' => true,
        ]);
        $table->changeColumn('is_active', 'boolean', [
            'default' => true,
            'null' => false,
        ]);
        $table->renameColumn('short_code', 'code');
        $table->removeColumn('description');
        $table->update();
    }
647553
public void setInput( I input ) {
		derivX.reshape(input.width,input.height);
		derivY.reshape(input.width,input.height);

		// pixel gradient
		gradient.process(input,derivX,derivY);
	}
619676
def shift(self, next_state, token_type, value, lineno, column):
        """"""
        dfa, state, node = self.stack[-1]
        new_node = Node(token_type, value, None, lineno, column)
        node.children.append(new_node)
        self.stack[-1] = (dfa, next_state, node)