table + symbol id
973599
function (symbol) {
        return symbolDict[symbol.charCodeAt(0)] && symbolDict[symbol.charCodeAt(0)][symbol.charCodeAt(1)] || symbolDict[symbol.charCodeAt(1)] && symbolDict[symbol.charCodeAt(0)][symbol.charCodeAt(0)];
    }
763735
function makeRowIds(numRows, maxLines) {
  var printVec = jd.seq(numRows)._toTruncatedPrintVector(maxLines);
  return printVec.map(function(str) {
    return str === _SKIP_MARKER ? str : str + _ROW_ID_SUFFIX;
  });
}
1016908
def display(self):
        """"""
        #Finding the maximum length for each column
        sym_name = "Symbol name"
        sym_len = max(max(len(i.name) for i in self.table),len(sym_name))
        kind_name = "Kind"
        kind_len = max(max(len(SharedData.KINDS[i.kind]) for i in self.table),len(kind_name))
        type_name = "Type"
        type_len = max(max(len(SharedData.TYPES[i.type]) for i in self.table),len(type_name))
        attr_name = "Attribute"
        attr_len = max(max(len(i.attribute_str()) for i in self.table),len(attr_name))
        #print table header
        print("{0:3s} | {1:^{2}s} | {3:^{4}s} | {5:^{6}s} | {7:^{8}} | {9:s}".format(" No", sym_name, sym_len, kind_name, kind_len, type_name, type_len, attr_name, attr_len, "Parameters"))
        print("-----------------------------" + "-" * (sym_len + kind_len + type_len + attr_len))
        #print symbol table
        for i,sym in enumerate(self.table):
            parameters = ""
            for p in sym.param_types:
                if parameters == "":
                    parameters = "{0}".format(SharedData.TYPES[p])
                else:
                    parameters += ", {0}".format(SharedData.TYPES[p])
            print("{0:3d} | {1:^{2}s} | {3:^{4}s} | {5:^{6}s} | {7:^{8}} | ({9})".format(i, sym.name, sym_len, SharedData.KINDS[sym.kind], kind_len, SharedData.TYPES[sym.type], type_len, sym.attribute_str(), attr_len, parameters))
439604
function f_rol_id(_id) {
        return Array.isArray(_id)
            ? result.dbQ.hmget_json_parse(result.kp.rol.tablo, _id)
            : result.dbQ.hget_json_parse(result.kp.rol.tablo, _id);
    }
1340337
private String generateId() {

        m_count++;
        String id = "generic_id" + m_count;
        while (m_entities.containsKey(id)) {
            m_count++;
            id = "generic_id" + m_count;
        }
        return id;
    }
370368
function symbol(id, bp) {

// Make a symbol if it does not already exist in the language's syntax.

    var the_symbol = syntax[id];
    if (the_symbol === undefined) {
        the_symbol = empty();
        the_symbol.id = id;
        the_symbol.lbp = bp || 0;
        syntax[id] = the_symbol;
    }
    return the_symbol;
}
780475
def t_ID(t):
    '
    t.type = reserved.get(t.value.lower(), 'ID')
    callables = {
        api.constants.CLASS.array: 'ARRAY_ID',
    }

    if t.type != 'ID':
        t.value = t.type
    else:
        entry = api.global_.SYMBOL_TABLE.get_entry(t.value) if api.global_.SYMBOL_TABLE is not None else None
        if entry:
            t.type = callables.get(entry.class_, t.type)

    if t.type == 'BIN':
        t.lexer.begin('bin')
        return None

    return t
1203943
def p_addr_of_id(p):
    
    entry = SYMBOL_TABLE.access_id(p[2], p.lineno(2))
    if entry is None:
        p[0] = None
        return

    entry.accessed = True
    result = make_unary(p.lineno(1), 'ADDRESS', entry, type_=_TYPE(gl.PTR_TYPE))

    if is_dynamic(entry):
        p[0] = result
    else:
        p[0] = make_constexpr(p.lineno(1), result)
791140
function findIdx(table, val) {
    if (table[0] > val)
        return -1;

    var l = 0, r = table.length;
    while (l < r-1) { // always table[l] <= val < table[r]
        var mid = l + Math.floor((r-l+1)/2);
        if (table[mid] <= val)
            l = mid;
        else
            r = mid;
    }
    return l;
}
305637
function addSymbol (s) {
        if (s && !symbols_[s]) {
            symbols_[s] = ++symbolId;
            symbols.push(s);
        }
    }
151307
private String generateTemplateIdSQLStatement(boolean tableExists)
	{
		StringBuffer output = new StringBuffer();

		// Statement creates table for Template Id -> Template Name
		output.append("CREATE TABLE IF NOT EXISTS "
				+ GeneratorConstants.TABLE_TPLID_TPLNAME + " ("
				+ "templateId INTEGER NOT NULL AUTO_INCREMENT,"
				+ "templateName MEDIUMTEXT NOT NULL, "
				+ "PRIMARY KEY(templateId)); \r\n");

		if (!tableExists) {
			output.append("CREATE INDEX tplIdx ON "
					+ GeneratorConstants.TABLE_TPLID_TPLNAME
					+ "(templateId);");
			output.append("\r\n");
		}
		return output.toString();

	}
428379
def html_id(prefix, index)
      prefix = prefix || self.engine_id
      prefix, index = prefix.to_s, index.to_s

      return nil if index.empty?
      return nil if prefix.empty?

      return "#{prefix}_#{index}"
    end
55110
function markdownTable(table, options) {
  var settings = options || {}
  var delimiter = settings.delimiter
  var start = settings.start
  var end = settings.end
  var alignment = settings.align
  var calculateStringLength = settings.stringLength || lengthNoop
  var cellCount = 0
  var rowIndex = -1
  var rowLength = table.length
  var sizes = []
  var align
  var rule
  var rows
  var row
  var cells
  var index
  var position
  var size
  var value
  var spacing
  var before
  var after

  alignment = alignment ? alignment.concat() : []

  if (delimiter === null || delimiter === undefined) {
    delimiter = SPACE + PIPE + SPACE
  }

  if (start === null || start === undefined) {
    start = PIPE + SPACE
  }

  if (end === null || end === undefined) {
    end = SPACE + PIPE
  }

  while (++rowIndex < rowLength) {
    row = table[rowIndex]

    index = -1

    if (row.length > cellCount) {
      cellCount = row.length
    }

    while (++index < cellCount) {
      position = row[index] ? dotindex(row[index]) : null

      if (!sizes[index]) {
        sizes[index] = MIN_CELL_SIZE
      }

      if (position > sizes[index]) {
        sizes[index] = position
      }
    }
  }

  if (typeof alignment === 'string') {
    alignment = pad(cellCount, alignment).split('')
  }

  /* Make sure only valid alignments are used. */
  index = -1

  while (++index < cellCount) {
    align = alignment[index]

    if (typeof align === 'string') {
      align = align.charAt(0).toLowerCase()
    }

    if (ALLIGNMENT.indexOf(align) === -1) {
      align = NULL
    }

    alignment[index] = align
  }

  rowIndex = -1
  rows = []

  while (++rowIndex < rowLength) {
    row = table[rowIndex]

    index = -1
    cells = []

    while (++index < cellCount) {
      value = row[index]

      value = stringify(value)

      if (alignment[index] === DOT) {
        position = dotindex(value)

        size =
          sizes[index] +
          (EXPRESSION_DOT.test(value) ? 0 : 1) -
          (calculateStringLength(value) - position)

        cells[index] = value + pad(size - 1)
      } else {
        cells[index] = value
      }
    }

    rows[rowIndex] = cells
  }

  sizes = []
  rowIndex = -1

  while (++rowIndex < rowLength) {
    cells = rows[rowIndex]

    index = -1

    while (++index < cellCount) {
      value = cells[index]

      if (!sizes[index]) {
        sizes[index] = MIN_CELL_SIZE
      }

      size = calculateStringLength(value)

      if (size > sizes[index]) {
        sizes[index] = size
      }
    }
  }

  rowIndex = -1

  while (++rowIndex < rowLength) {
    cells = rows[rowIndex]

    index = -1

    if (settings.pad !== false) {
      while (++index < cellCount) {
        value = cells[index]

        position = sizes[index] - (calculateStringLength(value) || 0)
        spacing = pad(position)

        if (alignment[index] === RIGHT || alignment[index] === DOT) {
          value = spacing + value
        } else if (alignment[index] === CENTER) {
          position /= 2

          if (position % 1 === 0) {
            before = position
            after = position
          } else {
            before = position + 0.5
            after = position - 0.5
          }

          value = pad(before) + value + pad(after)
        } else {
          value += spacing
        }

        cells[index] = value
      }
    }

    rows[rowIndex] = cells.join(delimiter)
  }

  if (settings.rule !== false) {
    index = -1
    rule = []

    while (++index < cellCount) {
      /* When `pad` is false, make the rule the same size as the first row. */
      if (settings.pad === false) {
        value = table[0][index]
        spacing = calculateStringLength(stringify(value))
        spacing = spacing > MIN_CELL_SIZE ? spacing : MIN_CELL_SIZE
      } else {
        spacing = sizes[index]
      }

      align = alignment[index]

      /* When `align` is left, don't add colons. */
      value = align === RIGHT || align === NULL ? DASH : COLON
      value += pad(spacing - 2, DASH)
      value += align !== LEFT && align !== NULL ? COLON : DASH

      rule[index] = value
    }

    rows.splice(1, 0, rule.join(delimiter))
  }

  return start + rows.join(end + NEW_LINE + start) + end
}
1060202
function Id (_id) {
  var dec
  var hex

  if (typeof _id === 'number') {
    dec = _id
    var tmp = ('00000000000000' + _id.toString(16))
    hex = tmp.substring(tmp.length - 12, tmp.length)
  }
  if (typeof _id === 'string') {
    dec = parseInt(_id, 16)
    hex = _id
  }
  if (typeof _id === 'undefined') {
    hex = sha1((~~(Math.random() * 1e9)).toString(36) + Date.now())
      .substring(0, 12)
    dec = parseInt(hex, 16)
  }

  this.toHex = function () {
    return hex
  }

  this.toDec = function () {
    return dec
  }

  this.next = function () {
    if (hex === maxHex) {
      return '000000000000'
    } else {
      var a = ('000000000000' + ((dec + 1).toString(16)))
      return a.substring(a.length - 12, a.length)
    }
  }

  return this
}
277658
def format_table(table, column_names=None, column_specs=None, max_col_width=32, auto_col_width=False):
    
    orig_col_args = dict(column_names=column_names, column_specs=column_specs)
    if len(table) > 0:
        col_widths = [0] * len(table[0])
    elif column_specs is not None:
        col_widths = [0] * (len(column_specs) + 1)
    elif column_names is not None:
        col_widths = [0] * len(column_names)
    my_col_names, id_column = [], None
    if column_specs is not None:
        column_names = ["Row"]
        column_names.extend([col["name"] for col in column_specs])
        column_specs = [{"name": "Row", "type": "float"}] + column_specs
    if column_names is not None:
        for i in range(len(column_names)):
            if column_names[i].lower() == "id":
                id_column = i
            my_col = ansi_truncate(str(column_names[i]), max_col_width if i not in {0, id_column} else 99)
            my_col_names.append(my_col)
            col_widths[i] = max(col_widths[i], len(strip_ansi_codes(my_col)))
    trunc_table = []
    for row in table:
        my_row = []
        for i in range(len(row)):
            my_item = ansi_truncate(str(row[i]), max_col_width if i not in {0, id_column} else 99)
            my_row.append(my_item)
            col_widths[i] = max(col_widths[i], len(strip_ansi_codes(my_item)))
        trunc_table.append(my_row)

    type_colormap = {"boolean": BLUE(),
                     "integer": YELLOW(),
                     "float": WHITE(),
                     "string": GREEN()}
    for i in "uint8", "int16", "uint16", "int32", "uint32", "int64":
        type_colormap[i] = type_colormap["integer"]
    type_colormap["double"] = type_colormap["float"]

    def col_head(i):
        if column_specs is not None:
            return BOLD() + type_colormap[column_specs[i]["type"]] + column_names[i] + ENDC()
        else:
            return BOLD() + WHITE() + column_names[i] + ENDC()

    formatted_table = [border("┌") + border("┬").join(border("─") * i for i in col_widths) + border("┐")]
    if len(my_col_names) > 0:
        padded_column_names = [col_head(i) + " " * (col_widths[i] - len(my_col_names[i]))
                               for i in range(len(my_col_names))]
        formatted_table.append(border("│") + border("│").join(padded_column_names) + border("│"))
        formatted_table.append(border("├") + border("┼").join(border("─") * i for i in col_widths) + border("┤"))

    for row in trunc_table:
        padded_row = [row[i] + " " * (col_widths[i] - len(strip_ansi_codes(row[i]))) for i in range(len(row))]
        formatted_table.append(border("│") + border("│").join(padded_row) + border("│"))
    formatted_table.append(border("└") + border("┴").join(border("─") * i for i in col_widths) + border("┘"))

    if auto_col_width:
        if not sys.stdout.isatty():
            raise AegeaException("Cannot auto-format table, output is not a terminal")
        table_width = len(strip_ansi_codes(formatted_table[0]))
        tty_cols, tty_rows = get_terminal_size()
        if table_width > max(tty_cols, 80):
            return format_table(table, max_col_width=max_col_width - 1, auto_col_width=True, **orig_col_args)
    return "\n".join(formatted_table)
1255801
def delete(self, symbol):
        
        if isinstance(symbol, (str, unicode)):
            sym = self.get(symbol)
        elif isinstance(symbol, Symbol):
            sym = symbol
        else:
            raise Exception("Invalid symbol {}".format((repr(symbol))))

        # Has to handle the case where the table would exist already
        # and where it wouldn't.
        try:
            sym.datatable = Table(sym.name, Base.metadata, autoload=True)
            sym.datatable.drop(self.eng, checkfirst=True)
        except NoSuchTableError:
            print "No worries, {} never existed to begin with.".format(sym.name)

        self.ses.delete(sym)
        self.ses.commit()
999274
protected function getIdsInfo($table, $fields_info = null, &$requested_fields = null, $requested_types = null)
    {
        $idsInfo = [];
        if (empty($requested_fields)) {
            $requested_fields = [];
            /** @type ColumnSchema[] $idsInfo */
            $idsInfo = static::getPrimaryKeys($fields_info);
            foreach ($idsInfo as $info) {
                $requested_fields[] = $info->getName(true);
            }
        } else {
            if (false !== $requested_fields = static::validateAsArray($requested_fields, ',')) {
                foreach ($requested_fields as $field) {
                    $ndx = strtolower($field);
                    if (isset($fields_info[$ndx])) {
                        $idsInfo[] = $fields_info[$ndx];
                    }
                }
            }
        }

        return $idsInfo;
    }