add dthe datasource values if needed.
497014
private void addDatasourceIfNeeded(ServletRequest req)
            throws JspException
    {
        if (_match == null)
            return;

        for (int i = 0; i < _match.length; i++) {
            if (!_optionList.contains(_match[i])) {
                if (!_match[i].equals(NULL_VALUE))
                    addOption(req, _match[i], _match[i]);
            }
        }
    }
1201022
public DataSource createDataSource(Properties props) throws SQLException {
        if (props == null) {
            props = new Properties();
        }

        DataSource dataSource = newDataSource();
        setBeanProperties(dataSource, props);
        return dataSource;
    }
793149
public function addDataSource(HTML_QuickForm2_DataSource $datasource)
    {
        $this->getSessionContainer()->storeDatasources(
            array_merge($this->getSessionContainer()->getDatasources(),
                        array($datasource))
        );
    }
1212926
def save_dependencies(self, instance, schema):
        """"""
        def add_dependency(value):
            """Add parent Data dependency."""
            try:
                DataDependency.objects.update_or_create(
                    parent=Data.objects.get(pk=value),
                    child=self,
                    defaults={'kind': DataDependency.KIND_IO},
                )
            except Data.DoesNotExist:
                pass

        for field_schema, fields in iterate_fields(instance, schema):
            name = field_schema['name']
            value = fields[name]

            if field_schema.get('type', '').startswith('data:'):
                add_dependency(value)
            elif field_schema.get('type', '').startswith('list:data:'):
                for data in value:
                    add_dependency(data)
737144
def add(self, value):
    """"""
    if self._disposed:
      raise ValueError(
          'Cannot add value: this _WatchStore instance is already disposed')
    self._data.append(value)
    if hasattr(value, 'nbytes'):
      self._in_mem_bytes += value.nbytes
      self._ensure_bytes_limits()
178942
def _SetHeader(self, values):
    """"""
    if self._values and len(values) != len(self._values):
      raise ValueError('Header values not equal to existing data width.')
    if not self._values:
      for _ in range(len(values)):
        self._values.append(None)
    self._keys = list(values)
    self._BuildIndex()
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
162079
def extend(self, values):
        """"""
        if self.asserted:
            raise RuntimeError("Fact already asserted")

        self._multifield.extend(values)
399036
function addMetaData(dep, datasource, lookupName) {
  if (!dep) {
    return;
  }
  const depName = lookupName ? lookupName.toLowerCase() : null;
  if (
    manualChangelogUrls[datasource] &&
    manualChangelogUrls[datasource][depName]
  ) {
    dep.changelogUrl = manualChangelogUrls[datasource][depName];
  }
  if (manualSourceUrls[datasource] && manualSourceUrls[datasource][depName]) {
    dep.sourceUrl = manualSourceUrls[datasource][depName];
  }
  if (dep.sourceUrl && dep.sourceUrl.includes('github.com')) {
    dep.sourceUrl = parse(dep.sourceUrl);
  }
  if (
    !dep.sourceUrl &&
    dep.changelogUrl &&
    dep.changelogUrl.startsWith('https://github.com/')
  ) {
    dep.sourceUrl = dep.changelogUrl
      .split('/')
      .slice(0, 5)
      .join('/');
  }
  // Clean up any empty urls
  const urls = ['homepage', 'sourceUrl', 'changelogUrl'];
  for (const url of urls) {
    if (is.nonEmptyString(dep[url])) {
      dep[url] = dep[url].trim();
    } else {
      delete dep[url];
    }
  }
}
1245746
private void addSource() {

    	// TODO this should be shared between here and IDLReader
    	File generatedSources = new File(getBaseDir(), generatedSourceDir);

        this.getProject().addCompileSourceRoot( generatedSources.getAbsolutePath() );
        this.getLog().debug( "Source directory " + generatedSources + " added." );
	}
1012118
public void add(String[] types, OsgiModelSource<?> source) {
        for (String resourceType : types) {
            this.typeNameToModelSourcesMap.put(resourceType, source);
        }
        clearLookupCaches();
    }
321706
def addDataset(self):
        
        self._openRepo()
        dataset = datasets.Dataset(self._args.datasetName)
        dataset.setDescription(self._args.description)
        dataset.setAttributes(json.loads(self._args.attributes))
        self._updateRepo(self._repo.insertDataset, dataset)
78186
def add_data(self, request, pk=None):
        """"""
        # add data to entity
        resp = super().add_data(request, pk)

        # add data to collections in which entity is
        entity = self.get_object()
        for collection in entity.collections.all():
            collection.data.add(*request.data['ids'])

        return resp
1283197
private void initializeDataSource()
   {
      final String jdbcUrl = config.getJdbcUrl();
      final String username = config.getUsername();
      final String password = config.getPassword();
      final String dsClassName = config.getDataSourceClassName();
      final String driverClassName = config.getDriverClassName();
      final String dataSourceJNDI = config.getDataSourceJNDI();
      final Properties dataSourceProperties = config.getDataSourceProperties();

      DataSource ds = config.getDataSource();
      if (dsClassName != null && ds == null) {
         ds = createInstance(dsClassName, DataSource.class);
         PropertyElf.setTargetFromProperties(ds, dataSourceProperties);
      }
      else if (jdbcUrl != null && ds == null) {
         ds = new DriverDataSource(jdbcUrl, driverClassName, dataSourceProperties, username, password);
      }
      else if (dataSourceJNDI != null && ds == null) {
         try {
            InitialContext ic = new InitialContext();
            ds = (DataSource) ic.lookup(dataSourceJNDI);
         } catch (NamingException e) {
            throw new PoolInitializationException(e);
         }
      }

      if (ds != null) {
         setLoginTimeout(ds);
         createNetworkTimeoutExecutor(ds, dsClassName, jdbcUrl);
      }

      this.dataSource = ds;
   }
1079905
public MetadataBuilder addDataSource(@NotNull InputStream dataSource, String path) {
    addDataSource(dataSource, path, true);
    return this;
  }
1212419
def add_source(self, name, location, schedule='Daily', op=''):
        
        if op == '':
            op = name + '.log'
        self.data_sources.append([name, location, schedule, op])
373046
def add_datatype(self, name: str, datatype: DT):
        
        self._datatypes[name] = datatype