Data can exist without scenarios. This is the mechanism whereby
        single pieces of data can be added without doing it through a scenario.

        A typical use of this would be for setting default values on types.
162309
def add_dataset(data_type, val, unit_id=None, metadata={}, name="", user_id=None, flush=False):
    

    d = Dataset()

    d.type  = data_type
    d.value = val
    d.set_metadata(metadata)

    d.unit_id  = unit_id
    d.name  = name
    d.created_by = user_id
    d.hash  = d.set_hash()

    try:
        existing_dataset = db.DBSession.query(Dataset).filter(Dataset.hash==d.hash).one()
        if existing_dataset.check_user(user_id):
            d = existing_dataset
        else:
            d.set_metadata({'created_at': datetime.datetime.now()})
            d.set_hash()
            db.DBSession.add(d)
    except NoResultFound:
        db.DBSession.add(d)

    if flush == True:
        db.DBSession.flush()
    return d
1206417
def add(type, *data)
      df = DataFrame.new({x: data[0], y: data[1], z: data[2]})
      return add_with_df(df, type, :x, :y, :z)
    end
158528
function createScenario(def) {
  const finalScenario = Object.assign({}, scenarioDefaults, def);
  scenariosArr.push(finalScenario);
}
1007460
def has_data(self, datatype, mode, disp):
        

        # Imports
        from ..error import RepoError

        # Just try to get the data. Simply pass up all exceptions except for
        #  those if the group or data doesn't exist. DO re-raise a non-bound
        #  repo. Initialize value to DATA PRESENT (True) for case where data
        #  is present and the 'try' succeeds.
        retval = True
        try:
            self.get_data(datatype, mode, disp)
        except RepoError as RErr:
            if RErr.tc in (RErr.DATA, RErr.GROUP):
                retval = False
            ## end if
        ## end try

        # Should be good to return
        return retval
342144
def data(self, *args):
        ''''''
        data = self._data
        if not args:
            return data or {}
        result, adding = self._attrdata('data', *args)
        if adding:
            if data is None:
                self._extra['data'] = {}
            add = self._visitor.add_data
            for key, value in result.items():
                add(self, key, value)
            return self
        else:
            return result
405995
function (values, schema, options) {
    var virtualList = find(schema, 'virtual');

    //Set default value for virtual if not exists in values
    if (options && options.query === true) {
    }
    else {
        for (var virtual in virtualList) {

            if (_.isArray(virtualList[virtual])) {

                for (var thisVirtual in virtualList[virtual]) {

                    if (_.isArray(values[virtual])) {
                        for (var thisValue in values[virtual]) {
                            setVirtuals(values[virtual][thisValue], virtualList[virtual][thisVirtual], options);
                        }
                    }
                }
            }
            else {
                if (values[virtual] === undefined && virtualList[virtual] && virtualList[virtual].hasOwnProperty('default') && options && options.partial !== true) {
                    values[virtual] = (virtualList[virtual]).default;
                }
            }
        }
    }

    for (var value in values) {

        if (virtualList[value] && virtualList[value].virtual) {

            var setFunction = virtualList[value].virtual;

            //Check for setter and getter
            if (virtualList[value].virtual.set) {
                setFunction = virtualList[value].virtual.set;
            }

            //Check conditions and apply virtual
            rulesMatch(value, values[value], setFunction, null, function (err, data) {
                if (!err) {
                    if (_.isFunction(setFunction)) {
                        var virtualResult = setFunction(values[value]);
                        if (_.isObject(virtualResult) && !_.isEmpty(virtualResult)) {
                            //Check if virtual values does not exists in given values list. Do not overwrite given
                            for (var vValue in virtualResult) {
                                {
                                    if (vValue == 'this') {
                                        virtualResult[value] = virtualResult[vValue];
                                        delete(virtualResult[vValue]);
                                    }
                                    else {
                                        // Prevent overwrite of given values
                                        if (values[vValue] !== undefined) {
                                            delete(virtualResult[vValue]);
                                        }
                                    }
                                }
                            }
                            values = _.assign(values, virtualResult);
                        }
                    }
                }
            });
        }
    }
    return values;
}
1318097
private void addAncilliaryEntityData(StructAsym asym, int entityId, Entity entity, EntityInfo entityInfo) {
		// Loop through each of the entity types and add the corresponding data
		// We're assuming if data is duplicated between sources it is consistent
		// This is a potentially huge assumption...


		for (EntitySrcGen esg : entitySrcGens) {

			if (! esg.getEntity_id().equals(asym.getEntity_id()))
				continue;

			addInformationFromESG(esg, entityId, entityInfo);

		}

		for (EntitySrcNat esn : entitySrcNats) {
			if (! esn.getEntity_id().equals(asym.getEntity_id()))
				continue;
			addInformationFromESN(esn, entityId, entityInfo);

		}

		for (EntitySrcSyn ess : entitySrcSyns) {
			if (! ess.getEntity_id().equals(asym.getEntity_id()))
				continue;
			addInfoFromESS(ess, entityId, entityInfo);

		}
	}
756686
public final void addData(@NonNull Data<?> data) {
        checkNotNull(data, "data");
        // Clear error message now, in case the caller recently replaced them.
        // If they did, they'd expect the error message to be gone, because the
        // view visibility state is reset.
        if (mDatas.isEmpty()) {
            mErrorMessage = null;
        }
        mDatas.add(data);
        mDataWatcher.setDatas(mDatas);
        updateViews();
    }
367502
public boolean add(SpdData data) {
        if (data == null)
            return false;
        if (data instanceof SpdStat) {
            return super.add(data);
        } else {
            return false;
        }
    }
1349614
def _values_exist(table):
        
        try:
            for var, data in table["columns"].items():
                if "values" in data:
                    return True
        except KeyError as e:
            logger_lpd_noaa.warn("values_exist: KeyError: {}".format(e))
        except Exception as e:
            logger_lpd_noaa.warn("values_exist: Excpetion: {}".format(e))
        return False
1157211
function instance(schema, defaults, options) {
  const name = 'instance'
  const type = `instance<${schema.name}>`
  const validate = (value = resolveDefaults(defaults)) => {
    return value instanceof schema
      ? [undefined, value]
      : [{ data: value, path: [], value, type }]
  }

  return new Kind(name, type, validate)
}
1284037
def unique_field_data_types(self):
        
        data_type_names = set()
        for field in self.fields:
            if not is_void_type(field.data_type):
                if field.data_type.name in data_type_names:
                    return False
                else:
                    data_type_names.add(field.data_type.name)
        else:
            return True
245408
public boolean isDataValid() {
    boolean valid = false;
    for (Object value : values.values()) {
      if (value instanceof String) {
        String tt = (String) value;
        if (Strings.isNotBlank(tt)) {
          valid = true;
          break;
        }
      } else {
        if (null != value) {
          valid = true;
          break;
        }
      }
    }
    return valid;
  }
239291
static BinaryStorage defaultConfig() {
        // By default binaries are not stored on disk
        EditableDocument binaries = Schematic.newDocument();
        binaries.set(RepositoryConfiguration.FieldName.TYPE, RepositoryConfiguration.FieldValue.BINARY_STORAGE_TYPE_TRANSIENT);
        return new BinaryStorage(binaries);
    }
584444
static Scenario scenario(String text) {
        reset();
        final Scenario scenario = new Scenario(text);
        sRoot = scenario;
        return scenario;
    }
213038
function(options, jsonData) {

            //console.log(jsonData);
            var self = this;
            // remove the existing one.
            $('#' + self.attrId).empty();

            // need merge the options with default options.
            self.options = $.extend({}, defaultOptions, options);
            self.jsonData = jsonData;
            self.init();
        }
760427
public ValidationData save(ValidationData data) {
        if (data.getParamType() == null || data.getUrl() == null || data.getMethod() == null || data.getType() == null || data.getTypeClass() == null) {
            throw new ValidationLibException("mandatory field is null ", HttpStatus.BAD_REQUEST);
        }

        ValidationData existData = this.findById(data.getId());

        if (existData == null) {
            return this.addData(data);
        } else {
            existData.setValidationRules(data.getValidationRules());
            return existData;
        }
    }