>>> print(1072 in convert_table({"а": "a"}))
    True
    >>> print(1073 in convert_table({"а": "a"}))
    False
    >>> print(convert_table({"а": "a"})[1072] == "a")
    True
    >>> print(len(convert_table({"а": "a"}).keys()) == 1)
    True
777531
def convert_table(table):
    

    return dict((ord(k), v) for k, v in table.items())
369275
def print_number_str(self, value, justify_right=True):
        
        # Calculate length of value without decimals.
        length = len(value.translate(None, '.'))
        # Error if value without decimals is longer than 4 characters.
        if length > 4:
            self.print_str('----')
            return
        # Calculcate starting position of digits based on justification.
        pos = (4-length) if justify_right else 0
        # Go through each character and print it on the display.
        for i, ch in enumerate(value):
            if ch == '.':
                # Print decimal points on the previous digit.
                self.set_decimal(pos-1, True)
            else:
                self.set_digit(pos, ch)
                pos += 1
816040
def print_row(self, row, rstrip=True):
        
        line = ''.join(map(str, row))
        print(line.rstrip() if rstrip else line, file=self.table.file)
519980
def print_table(table):
    
    table = [[str(cell) for cell in row] for row in table]
    column_widths = [len(cell) for cell in table[0]]
    for row in table:
        for x, cell in enumerate(row):
            column_widths[x] = max(column_widths[x], len(cell))

    formatters = []
    for width in column_widths:
        formatters.append('{:>' + str(width) + '}')
    formatter = '  '.join(formatters)
    for row in table:
        print(formatter.format(*row))
1197305
def _printed_len(some_string):
  """"""
  return len([x for  x in ANSI_ESC_RE.sub('', some_string)
              if x in string.printable])
695705
def print_dict(d, show_missing=True):
  
  for k, v in sorted(d.items()):
    if (not v) and show_missing:
      # No instances of the key, so print missing symbol.
      print('{} -'.format(k))
    elif isinstance(v, list):
      # Value is a list, so print each item of the list.
      print(k)
      for item in v:
        print('   {}'.format(item))
    elif isinstance(v, dict):
      # Value is a dict, so print each (key, value) pair of the dict.
      print(k)
      for kk, vv in sorted(v.items()):
        print('   {:<20} {}'.format(kk, vv))
289160
def print_table(*args, **kwargs):
    
    t = format_table(*args, **kwargs)
    click.echo(t)
1319950
def _print_bar(self):
        ''''''
        self._print('[')

        for position in range(self._bar_width):
            position_fraction = position / (self._bar_width - 1)
            position_bytes = position_fraction * self.max_value

            if position_bytes < (self.continue_value or 0):
                self._print('+')
            elif position_bytes <= (self.continue_value or 0) + self.current_value:
                self._print('=')
            else:
                self._print(' ')

        self._print(']')
675672
def zset_example():
    
    from uuid import uuid4
    from redis import StrictRedis
    from zato.redis_paginator import ZSetPaginator
    
    conn = StrictRedis()
    key = 'paginator:{}'.format(uuid4().hex)
    
    # 97-114 is 'a' to 'r' in ASCII
    for x in range(1, 18):
        conn.zadd(key, x, chr(96 + x))
        
    p = ZSetPaginator(conn, key, 6)
    
    print(p.count)      # 17
    print(p.num_pages)  # 3
    print(p.page_range) # [1, 2, 3]
    
    page = p.page(3)
    print(page)             # <Page 3 of 3>
    print(page.object_list) # ['m', 'n', 'o', 'p', 'q']
        
    conn.delete(key)
928915
public function print_r($key, $gs, $ge, $ls, $le, $ind = ' ', $max_depth = 6)
    {
        $o = '';
        if (strlen($ind) > $max_depth) {
            return;
        }
        if (is_array($key)) {
            $o = $gs;
            foreach ($key as $a => $b) {
                $o .= $ind.$ls.$a.': '.$this->print_r($b, $gs, $ge, $ls, $le, $ind.' ').$le;
            }
            $o .= $ge;
        } elseif ($key instanceof Closure) {
            $o .= '[closure]';
        } elseif (is_object($key)) {
            $o .= 'object('.get_class($key).'): ';
            if (method_exists($key, '__debugInfo')) {
                $o .= $this->print_r($key->__debugInfo(), $gs, $ge, $ls, $le, $ind.' ').$le;
            }
        } else {
            $o .= $gs ? htmlspecialchars($key) : $key;
        }

        return $o;
    }
268091
def do_ls(self, table=None):
        
        if table is None:
            fields = OrderedDict(
                [
                    ("Name", "name"),
                    ("Status", "status"),
                    ("Read", "total_read_throughput"),
                    ("Write", "total_write_throughput"),
                ]
            )
            tables = self.engine.describe_all()
            # Calculate max width of all items for each column
            sizes = [
                1 + max([len(str(getattr(t, f))) for t in tables] + [len(title)])
                for title, f in iteritems(fields)
            ]
            # Print the header
            for size, title in zip(sizes, fields):
                print(title.ljust(size), end="")
            print()
            # Print each table row
            for row_table in tables:
                for size, field in zip(sizes, fields.values()):
                    print(str(getattr(row_table, field)).ljust(size), end="")
                print()
        else:
            print(self.engine.describe(table, refresh=True, metrics=True).pformat())
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))
515390
@Override
    public int print(
        ChronoDisplay formattable,
        Appendable buffer,
        AttributeQuery attributes,
        Set<ElementPosition> positions, // optional
        boolean quickPath
    ) throws IOException {

        BigDecimal value =
            formattable.get(this.element).setScale(
                this.scale,
                RoundingMode.FLOOR);
        String digits = value.toPlainString();
        int p = 0;
        int s = 0;
        int separator = -1;
        int n = digits.length();

        for (int i = 0; i < n; i++) {
            char c = digits.charAt(i);
            if (c == '.') {
                separator = i;
            } else if (separator >= 0) {
                s++;
            } else {
                p++;
            }
        }

        int delta = this.precision - this.scale - p;

        if (delta < 0) {
            throw new IllegalArgumentException(
                "Integer part of element value exceeds fixed format width: "
                + digits);
        }

        StringBuilder sb = new StringBuilder(this.precision + 1);

        for (int i = 0; i < delta; i++) {
            sb.append('0');
        }

        for (int i = 0; i < p; i++) {
            sb.append(digits.charAt(i));
        }

        this.decimalSeparator.print(formattable, sb, attributes, positions, quickPath);

        for (int i = 0; i < s; i++) {
            sb.append(digits.charAt(p + 1 + i));
        }

        for (int i = 0; i < this.scale - s; i++) {
            sb.append('0');
        }

        digits = sb.toString();

        char zeroChar = (
            quickPath
                ? this.zeroDigit
                : attributes.get(Attributes.ZERO_DIGIT, Character.valueOf('0')).charValue());

        if (zeroChar != '0') {
            int diff = zeroChar - '0';
            char[] characters = digits.toCharArray();

            for (int i = 0; i < characters.length; i++) {
                char c = characters[i];
                if ((c >= '0') && (c <= '9')) {
                    characters[i] = (char) (c + diff);
                }
            }

            digits = new String(characters);
        }

        int start = -1;
        int printed = digits.length();

        if (buffer instanceof CharSequence) {
            start = ((CharSequence) buffer).length();
        }

        buffer.append(digits);

        if (
            (start != -1)
            && (printed > 0)
            && (positions != null)
        ) {
            positions.add(new ElementPosition(this.element, start, start + printed));
        }

        return printed;

    }
609843
def custom_print(data_structure, indent):
    
    for key, value in data_structure.items():
        print("\n%s%s:" % (' ' * attribute_indent * indent, str(key)), end=' ')
        if isinstance(value, OrderedDict):
            custom_print(value, indent + 1)
        elif isinstance(value, dict):
            custom_print(value, indent + 1)
        else:
            print("%s" % (str(value)), end=' ')
1343691
def print_sorted_counter(counter, tab=1):
    """"""
    for key, count in sorted(counter.items(), key=itemgetter(1), reverse=True):
        print "{0}{1} - {2}".format('\t'*tab, key, count)
572806
def printer(self):
        """"""
        for key in self.statediag:
            if key.trans is not None and len(key.trans) > 0:
                print '****** ' + repr(key.id) + '(' + repr(key.type)\
                      + ' on sym ' + repr(key.sym) + ') ******'
                print key.trans
763437
def print_subkey_and_value(key, value)
      print_label key
      value.each do |subkey, val|
        if val.is_a? Hash
          print_inner_subkey subkey
          inspect_inner_hash val
        elsif val.is_a? Array
          print_inner_subkey subkey
          extract_hashes_and_print val
        elsif val.is_a? String
          print_hash subkey, val
        end
      end
    end