replace int in lst
553629
def replaceint(fname, replacewith='%s'):
    """"""
    words = fname.split()
    for i, word in enumerate(words):
        try:
            word = int(word)
            words[i] = replacewith
        except ValueError:
            pass
    return ' '.join(words)
677700
def _irshift(self, n):
        """"""
        assert 0 < n <= self.len
        self._prepend(Bits(n))
        self._truncateend(n)
        return self
1057200
def write_int32(self, value, little_endian=True):
        
        if little_endian:
            endian = "<"
        else:
            endian = ">"
        return self.pack('%si' % endian, value)
907931
def _remove_otiose(lst):
    """"""
    listtype = type([])
    while type(lst) == listtype and len(lst) == 1:
        lst = lst[0]

    return lst
1151984
def _to_int(self, val_str):
        """"""
        val = _integerValue_to_int(val_str)
        if val is None:
            raise ValueError(
                _format("The value-mapped {0} has an invalid integer "
                        "representation in a ValueMap entry: {1!A}",
                        self._element_str(), val_str))
        return val
580849
def str2int(string_with_int):
    
    return int("".join([char for char in string_with_int if char in string.digits]) or 0)
536149
def clean_int(v):
    """"""

    if v is None or not str(v).strip():
        return None

    return int(str(v).replace(',', ''))
1341536
def _replace_nan(a, val):
    
    mask = isnull(a)
    return where_method(val, mask, a), mask
191848
def to_int(x, index=False):
    
    _x = x.index if index else x
    cols = list(map(int, _x))
    error = _x[cols != _x]
    if not error.empty:
        raise ValueError('invalid values `{}`'.format(list(error)))
    if index:
        x.index = cols
        return x
    else:
        return _x
675125
def _nth(lst, n=1):
    
    n = StringValue(n).value
    lst = ListValue(lst).value
    try:
        n = int(float(n)) - 1
        n = n % len(lst)
    except:
        if n.lower() == 'first':
            n = 0
        elif n.lower() == 'last':
            n = -1
    try:
        ret = lst[n]
    except KeyError:
        lst = [v for k, v in sorted(lst.items()) if isinstance(k, int)]
        try:
            ret = lst[n]
        except:
            ret = ''
    return ret.__class__(ret)
1262833
def parse_int_literal(ast, _variables=None):
    """"""
    if isinstance(ast, IntValueNode):
        num = int(ast.value)
        if MIN_INT <= num <= MAX_INT:
            return num
    return INVALID
212835
def as_int(self, val: Tuple[str]) -> int:
        """"""
        res = 0
        try:
            for b in val:
                res += 1 << self.bit[b]
        except KeyError:
            return None
        return res
141435
def ints2str(self, int_values):
    """"""
    if not self._encoder:
      raise ValueError(
          "Text.ints2str is not available because encoder hasn't been defined.")
    return self._encoder.decode(int_values)
91380
def _imul(self, n):
        """"""
        assert n >= 0
        if not n:
            self._clear()
            return self
        m = 1
        old_len = self.len
        while m * 2 < n:
            self._append(self)
            m *= 2
        self._append(self[0:(n - m) * old_len])
        return self
592005
def _ilshift(self, n):
        """"""
        assert 0 < n <= self.len
        self._append(Bits(n))
        self._truncatestart(n)
        return self
149022
def subat(orig, index, replace):
    
    return "".join([(orig[x] if x != index else replace) for x in range(len(orig))])
823384
def parse_int(int_str):
    """"""
    int_str = int_str.replace(',', '')

    factor = __get_factor(int_str)
    if factor != 1:
        int_str = int_str[:-1]

    try:
        return int(int_str.replace(',', '')) * factor
    except ValueError:
        return None