def detect(stream):
    """Returns True if given stream is valid JSON."""
    try:
        json.loads(stream)
        return True
    except __HOLE__:
        return False
dataset/ETHPy150Open kennethreitz/tablib/tablib/formats/_json.py/detect