r""" makes a string from an integer bounding box
355472
def bbox_str(bbox, pad=4, sep=', '):
     """
    if bbox is None:
        return 'None'
    fmtstr = sep.join(['%' + six.text_type(pad) + 'd'] * 4)
    return '(' + fmtstr % tuple(bbox) + ')'
1333730
function string (str, index){
    var str = String(typeof str == 'object' && str.text ? str.text : str)
      , length = utils.strlen(str)
      , width = colWidths[index]
          - (style['padding-left'] || 0)
          - (style['padding-right'] || 0)
      , align = options.colAligns[index] || 'left';

    return repeat(' ', style['padding-left'] || 0)
         + (length == width ? str :
             (length < width
              ? pad(str, ( width + (str.length - length) ), ' ', align == 'left' ? 'right' :
                  (align == 'middle' ? 'both' : 'left'))
              : (truncater ? truncate(str, width, truncater) : str))
           )
         + repeat(' ', style['padding-right'] || 0);
  }
133536
private String makeBoundary() {
        StringBuffer s = new StringBuffer();
        int length = 32;
        int base = 97; //a..z
        int range = 26;
        while (length-- > 0) {
            char c = (char) (int) (Math.random() * range + base);
            s.append(c);
        }
        return s.toString();
    }
1262963
def _get_string(data, position, obj_end, dummy):
    """"""
    length = _UNPACK_INT(data[position:position + 4])[0]
    position += 4
    if length < 1 or obj_end - position < length:
        raise InvalidBSON("invalid string length")
    end = position + length - 1
    if data[end:end + 1] != b"\x00":
        raise InvalidBSON("invalid end of string")
    return _utf_8_decode(data[position:end], None, True)[0], end + 1
1310048
def from_int(cls, integer):
        
        bin_string = bin(integer)

        return cls(
            text=len(bin_string) >= 1 and bin_string[-1] == "1",
            comment=len(bin_string) >= 2 and bin_string[-2] == "1",
            user=len(bin_string) >= 3 and bin_string[-3] == "1",
            restricted=len(bin_string) >= 4 and bin_string[-4] == "1"
        )
580849
def str2int(string_with_int):
    
    return int("".join([char for char in string_with_int if char in string.digits]) or 0)
787178
def get_output_str(item, detect_numerics, precision, sign_value):
    """"""
    if detect_numerics:
        item = _convert_to_numeric(item)
    if isinstance(item, float):
        item = round(item, precision)
    try:
        item = '{:{sign}}'.format(item, sign=sign_value)
    except (ValueError, TypeError):
        pass
    return to_unicode(item)
407526
def _parse_bounding_box(bounding_box):
        '''
        
        '''
        coordinates = json.loads(bounding_box)["coordinates"]
        x_coords = [x for x, y in coordinates[0]]
        y_coords = [y for x, y in coordinates[0]]
        return min(x_coords), min(y_coords), max(x_coords), max(y_coords)
128621
function fromString(str, unsigned, radix) {
    if (str.length === 0)
        throw Error('empty string');
    if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity")
        return ZERO;
    if (typeof unsigned === 'number') {
        // For goog.math.long compatibility
        radix = unsigned,
        unsigned = false;
    } else {
        unsigned = !! unsigned;
    }
    radix = radix || 10;
    if (radix < 2 || 36 < radix)
        throw RangeError('radix');

    var p;
    if ((p = str.indexOf('-')) > 0)
        throw Error('interior hyphen');
    else if (p === 0) {
        return fromString(str.substring(1), unsigned, radix).neg();
    }

    // Do several (8) digits each time through the loop, so as to
    // minimize the calls to the very expensive emulated div.
    var radixToPower = fromNumber(pow_dbl(radix, 8));

    var result = ZERO;
    for (var i = 0; i < str.length; i += 8) {
        var size = Math.min(8, str.length - i),
            value = parseInt(str.substring(i, i + size), radix);
        if (size < 8) {
            var power = fromNumber(pow_dbl(radix, size));
            result = result.mul(power).add(fromNumber(value));
        } else {
            result = result.mul(radixToPower);
            result = result.add(fromNumber(value));
        }
    }
    result.unsigned = unsigned;
    return result;
}
455777
def _fromstring(value):
        ''''''
        # NOTE: Is this even possible ?
        if value is None:
            return None

        # FIXME: In XML, booleans are either 0/false or 1/true (lower-case !)
        if value.lower() == 'true':
            return True
        elif value.lower() == 'false':
            return False

        # FIXME: Using int() or float() is eating whitespaces unintendedly here
        try:
            return int(value)
        except ValueError:
            pass

        try:
            # Test for infinity and NaN values
            if float('-inf') < float(value) < float('inf'):
                return float(value)
        except ValueError:
            pass

        return value
603251
def get_bounding_box(self, crs):
        """"""
        return self.from_bounds(*self.get_bounds(crs), crs=crs)
939507
def _VarintBytes(value):
  """"""

  pieces = []
  _EncodeVarint(pieces.append, value)
  return b"".join(pieces)
901243
def truncate_to_string(num, precision=0):
        """"""
        if precision > 0:
            parts = ('{0:.%df}' % precision).format(Decimal(num)).split('.')
            decimal_digits = parts[1][:precision].rstrip('0')
            decimal_digits = decimal_digits if len(decimal_digits) else '0'
            return parts[0] + '.' + decimal_digits
        return ('%d' % num)
411777
function (len, min, chars) {
      len = len || 10;
      if (min != undefined) {
        len = publicRuleMethods._num(len, min);
      }
      var i;
      var str = '';
      chars = chars || ALPHA_NUMERIC_CHARS;
      var charsCount = chars.length;
      for (i = 0; i < len; i++) {
        str += chars[Math.floor(Math.random() * charsCount)];
      }
      return str;
    }
1348587
def fromRoman(strng):
    """"""
    if not strng:
        raise TypeError('Input can not be blank')
    if not romanNumeralPattern.search(strng):
        raise ValueError('Invalid Roman numeral: %s', strng)

    result = 0
    index = 0
    for numeral, integer in romanNumeralMap:
        while strng[index:index+len(numeral)] == numeral:
            result += integer
            index += len(numeral)
    return result
433844
def ints_to_string(ints):
    
    if not isinstance(ints, list):
        return six.u(str(ints))

    return '|'.join(six.u(str(l)) for l in ints)
630924
def int_or_str(v: Optional[str]) -> Union[None, int, str]:
    """"""
    if v is None:
        return
    try:
        return int(v)
    except ValueError:
        return v