def _build_value(data):
    for (prefix, event, value) in data:
        if event in ('string', 'null', 'boolean'):
            return value
        
        elif event == 'number':
            return int(value) if (int(value) == float(value)) else float(value)
        
        elif event == 'start_array':
            return _build_list(data)
        
        elif event == 'start_map':
            return _build_map(data)
        
        else:
            # MOOP.
            raise ValueError((prefix, event, value))
Build a value (number, array, whatever) from an ijson stream.
dataset/ETHPy150Open openaddresses/machine/openaddr/sample.py/_build_value