Inputting a value for the first time
190060
def make_valid_string(self, string=''):
        
        if not self.is_valid_str(string):
            if string in self.val_map and not self.allow_dups:
                raise IndexError("Value {} has already been given to the sanitizer".format(string))
            internal_name = super(_NameSanitizer, self).make_valid_string()
            self.val_map[string] = internal_name
            return internal_name
        else:
            if self.map_valid:
                self.val_map[string] = string
            return string
145116
def get_input(input_func, input_str):
    
    val = input_func("Please enter your {0}: ".format(input_str))
    while not val or not len(val.strip()):
        val = input_func("You didn't enter a valid {0}, please try again: ".format(input_str))
    return val
1109406
function doRenderValueInput(value, onChange) {
        return _react2.default.createElement(_TextField.TextField, { value: value, onChanged: function onChanged(val) {
                return onChange(val);
            } });
    }
306585
function getInput()
    {

        if ($this->getValue()) {
            $value = is_numeric($this->getValue()) ? $this->getValue() : strtotime($this->getValue());
        } else {
            $value = time();
        }

        $this->inputClass .= ' datetimeinput';

        $format = str_replace(['Y', 'm', 'd'], ['yy', 'mm', 'dd'], $this->format);
        $this->htmlOptions['class'] = (isset($this->htmlOptions['class']) ? $this->htmlOptions['class'] . ' ' : '') . $this->inputClass . ' datetime-date';
        $r = Form::get()->date('', date($this->format, $value), $format, $this->htmlOptions);

        $hours = range(0, 23);
        $seconds = $minutes = range(0, 59);
        if ($this->hour)
            $r .= Form::get()->select('', $hours, date('H', $value), ['class' => $this->inputClass . ' datetime-hour']);
        else
            $r .= Form::get()->hiddenInput('', (int)date('H', $value), ['class' => 'datetime-hour']);

        if ($this->minute)
            $r .= Form::get()->select('', $minutes, date('i', $value), ['class' => $this->inputClass . ' datetime-minute']);
        else
            $r .= Form::get()->hiddenInput('', (int)date('i', $value), ['class' => 'datetime-minute']);

        if ($this->second)
            $r .= Form::get()->select('', $seconds, date('s', $value), ['class' => $this->inputClass . ' datetime-second']);
        else
            $r .= Form::get()->hiddenInput('', (int)date('s', $value), ['class' => 'datetime-second']);

        return $r . Form::get()->hiddenInput($this->getName(), date($this->format . ' H:i:s', $value), ['class' => 'datetime-value']);
    }
1225645
function default_value() {
  start_pos = input.pointer();
  value = parse_balanced(/\[/, /\]/, /[^\[\]]*/);
  if (look(/\]/)) {
    return value;
  }
  else {
    input.setPointer(start_pos);
    return match(/[^\]]*/);
  }
}
313153
def set_input_by_number(self, number, value):
        

        sel = XpathSelector(self.form)
        elem = sel.select('.//input[@type="text"]')[number].node()
        return self.set_input(elem.get('name'), value)
1147381
private void beforeValue() throws JSONException {
        if (stack.isEmpty()) {
            return;
        }

        Scope context = peek();
        if (context == Scope.EMPTY_ARRAY) { // first in array
            replaceTop(Scope.NONEMPTY_ARRAY);
            newline();
        } else if (context == Scope.NONEMPTY_ARRAY) { // another in array
            out.append(',');
            newline();
        } else if (context == Scope.DANGLING_KEY) { // value for key
            out.append(indent == null ? ":" : ": ");
            replaceTop(Scope.NONEMPTY_OBJECT);
        } else if (context != Scope.NULL) {
            throw new JSONException("Nesting problem");
        }
    }
547548
function(value) {
            this.$input.prop('checked', false);
            if($.isArray(value) && value.length) {
               this.$input.each(function(i, el) {
                   var $el = $(el);
                   // cannot use $.inArray as it performs strict comparison
                   $.each(value, function(j, val){
                       /*jslint eqeq: true*/
                       if($el.val() == val) {
                       /*jslint eqeq: false*/                           
                           $el.prop('checked', true);
                       }
                   });
               }); 
            }  
        }
1291704
def insert_first(self, val):
        

        self.head = Node(val, next_node=self.head)
        return True
980940
private void prependValueLength(int value, int index) {
    int initialValue = toIntUnsigned(getValue(index));
    int length = toIntUnsigned(getLength(index));
    setValue(index, (short) value);
    setLength(index, (short) (initialValue - value + length));
  }
975647
function () {
                this.$InputElement.initWidget.call(this);

                var bindings = this._cfg.bind;
                if (bindings.value) {
                    var newValue = this._transform(bindings.value.transform, bindings.value.inside[bindings.value.to], "toWidget");
                    if (newValue != null) {
                        this._domElt.value = newValue;
                    }
                } else {
                    this.$logWarn(this.BINDING_NEEDED, [this.$class, "value"]);
                }
                this._setPlaceholder();
            }
410518
function(link, first_time) {
		var char = (link.href.indexOf('?')>-1) ? '&' : '?';
		link.href += (first_time === true) ? (char+(new Date()).getTime()) : char;
	}
893463
def _user_input() -> str:
    

    lines = []
    try:
        while True:
            line = input()
            if line != '':
                lines.append(line)
            else:
                break
    except (EOFError, KeyboardInterrupt):
        return '\n'.join(lines)
486542
function setCheckbox (input, value) {
  if (!value || value === "true" || value === "on") {
    value = "yes";
  }
  input.val([value]);
}
90301
function(str, num) {
    if (isUndefined(num)) num = 1;
    var start = str.length - num < 0 ? 0 : str.length - num;
    return str.substr(start);
  }
519166
def prompt(name, default):
    
    value = raw_input('%s [%s]: ' %(name, default))
    if not value:
        value = default
    return value
1327304
def _on_entry(self, event):
        
        contents = self._entry.get()
        if contents == "":
            return
        try:
            value = self._variable.set(int(contents))
        except ValueError:
            value = None
        if not value:
            self._on_scale(None)