Compose a table with the specified entry name of values not explicitly defined.
770726
def not_explicitly_defined(table, name, is_bytes=False):
    """"""

    all_chars = ALL_ASCII if is_bytes else ALL_CHARS
    s = set()
    for k, v in table.items():
        s.update(v)
    if name in table:
        table[name] = list(set(table[name]) | (all_chars - s))
    else:
        table[name] = list(all_chars - s)
823478
def _Insert(cursor, table, values):
  
  precondition.AssertIterableType(values, dict)

  if not values:  # Nothing can be INSERTed with empty `values` list.
    return

  column_names = list(sorted(values[0]))
  for value_dict in values:
    if set(column_names) != set(value_dict):
      raise ValueError("Given value dictionaries must have identical keys. "
                       "Expecting columns {!r}, but got value {!r}".format(
                           column_names, value_dict))

  query = "INSERT IGNORE INTO %s {cols} VALUES {vals}" % table
  query = query.format(
      cols=mysql_utils.Columns(column_names),
      vals=mysql_utils.Placeholders(num=len(column_names), values=len(values)))

  values_list = []
  for values_dict in values:
    values_list.extend(values_dict[column] for column in column_names)

  cursor.execute(query, values_list)
461307
def putcolslice(self, value, blc, trc, inc=[], startrow=0, nrow=-1, rowincr=1):
        """"""
        return self._table.putcolslice(self._column, value, blc, trc, inc, startrow, nrow, rowincr)
213855
def _ids_and_column_names(names, force_lower_case=False):
        """"""
        fixed = OrderedDict()
        for name in names:
            identifier = RowWrapper._make_identifier(name)
            if force_lower_case:
                identifier = identifier.lower()
            while identifier in fixed:
                identifier = RowWrapper._increment_numeric_suffix(identifier)
            fixed[identifier] = name
        return fixed
1173631
private Collection<String> filter(Collection<String> scripts)
   {
      String JCR_ITEM_PRIMARY_KEY = "CONSTRAINT JCR_PK_" + itemTableSuffix + " PRIMARY KEY(ID)";
      String JCR_ITEM_FOREIGN_KEY =
         "CONSTRAINT JCR_FK_" + itemTableSuffix + "_PARENT FOREIGN KEY(PARENT_ID) REFERENCES " + itemTableName + "(ID)";

      String JCR_VALUE_PRIMARY_KEY = "CONSTRAINT JCR_PK_" + valueTableSuffix + " PRIMARY KEY(ID)";
      String JCR_VALUE_FOREIGN_KEY =
         "CONSTRAINT JCR_FK_" + valueTableSuffix + "_PROPERTY FOREIGN KEY(PROPERTY_ID) REFERENCES " + itemTableName
            + "(ID)";

      Collection<String> filteredScripts = new ArrayList<String>();

      for (String script : scripts)
      {
         if (script.contains(JCR_ITEM_PRIMARY_KEY + ","))
         {
            script = script.replace(JCR_ITEM_PRIMARY_KEY + ",", JCR_ITEM_PRIMARY_KEY);
            script = script.replace(JCR_ITEM_FOREIGN_KEY, "");
         }
         else if (script.contains(JCR_VALUE_PRIMARY_KEY + ","))
         {
            script = script.replace(JCR_VALUE_PRIMARY_KEY + ",", JCR_VALUE_PRIMARY_KEY);
            script = script.replace(JCR_VALUE_FOREIGN_KEY, "");
         }

         filteredScripts.add(script);
      }

      return filteredScripts;
   }
288376
def requiredUnlessTable(col_name, arg, dm, df, con=None):
    
    table_name = arg
    if col_name in df.columns:
        return None
    elif not con:
        return None
    elif table_name in con.tables:
        return None
    else:
        return "{} column is required unless table {} is present".format(col_name, table_name)
484758
private void addShardedLinkValues(TableDefinition tableDef, DBObject dbObj) {
        for (FieldDefinition fieldDef : tableDef.getFieldDefinitions()) {
            if (fieldDef.isLinkField() && fieldDef.isSharded()) {
                TableDefinition extentTableDef = tableDef.getLinkExtentTableDef(fieldDef);
                Set<Integer> shardNums = getShards(extentTableDef).keySet();
                Set<String> values = getShardedLinkValues(dbObj.getObjectID(), fieldDef, shardNums);
                dbObj.addFieldValues(fieldDef.getName(), values);
            }
        }
    }
883325
def _replace_missing_values_table(values, mv):
    

    for idx, column in enumerate(values):
        values[idx] = _replace_missing_values_column(column, mv)

    return values
1006643
def _columns_for_table(table_name):
    
    return {cname: col
            for (tname, cname), col in _COLUMNS.items()
            if tname == table_name}
133315
def _try_lookup(table, value, default = ""):
    
    try:
        string = table[ value ]
    except KeyError:
        string = default
    return string
885131
def generic_find_fk_constraint_names(table, columns, referenced, insp):
    """"""
    names = set()

    for fk in insp.get_foreign_keys(table):
        if fk['referred_table'] == referenced and set(fk['referred_columns']) == columns:
            names.add(fk['name'])

    return names
388205
def putkeyword(self, keyword, value, makesubrecord=False):
        """"""
        return self._table.putcolkeyword(self._column, keyword, value, makesubrecord)
1234646
private void composeAndAdd(HashMap entity, CqlMetadata cqlMetadata, Object thriftColumnValue,
            String thriftColumnName)
    {
        byte[] columnName = thriftColumnName.getBytes();

        Map<ByteBuffer, String> schemaTypes = this.clientBase.getCqlMetadata().getValue_types();
        AbstractType<?> type = null;
        try
        {
            type = TypeParser.parse(schemaTypes.get(ByteBuffer.wrap((byte[]) columnName)));
        }
        catch (SyntaxException | ConfigurationException e)
        {
            log.error(e.getMessage());
            throw new KunderaException("Error while parsing CQL Type " + e);
        }

        entity.put(thriftColumnName, type.compose(ByteBuffer.wrap((byte[]) thriftColumnValue)));
    }
1047967
def AddTableColumns(self, table, columns):
    """"""
    table_columns = self._table_columns.setdefault(table, [])
    for attr in columns:
      if attr not in table_columns:
        table_columns.append(attr)
1032120
def _assemble_flowtable(self, values):
        
        values = map(lambda x: [] if x is None else x, values)
        src = values[0] + values[1]
        dst = values[2] + values[3]

        thistable = dict()
        for s in src:
            thistable[s] = dst
        return thistable
197511
def insert(table, columns, values)
      puts "attempting to insert values into #{table}..."
        begin
          nvalues = []
          values.each do |v|
            if v.is_a? String
              nvalues << "\"" + v + "\"" 
            else
              nvalues << v
            end
          end
          tt = @dbr.prepare("INSERT INTO #{table}(" + columns.join(", ") + ") VALUES(" + nvalues.join(", ") + ");")
          ee = tt.execute
          puts "values correctly added!".green
        rescue
          puts "error while inserting values".red
        end
    end
1166148
def convert_compound_entry(self, compound):
        """"""
        d = OrderedDict()
        d['id'] = compound.id

        order = {
            key: i for i, key in enumerate(
                ['name', 'formula', 'formula_neutral', 'charge', 'kegg',
                 'cas'])}
        prop_keys = (
            set(compound.properties) - {'boundary', 'compartment'})
        for prop in sorted(prop_keys,
                           key=lambda x: (order.get(x, 1000), x)):
            if compound.properties[prop] is not None:
                d[prop] = compound.properties[prop]

        return d