def interpret_number(bb, context=None):
    """Convert a raw Number value to the integer it represents.

    This is a little more lenient than the SGF spec: it permits arbitrary
    leading and trailing whitespace, and ignores spaces anywhere inside the
    data.

    From Python 3.6 on, it also permits 'grouping' underscores between
    numerals.

    """
    return int(bb.replace(b' ', b''), 10)
