<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _visibility_to_text(self, distance):
 """ Convert observed visibility in metres to text used in forecast """


        if not isinstance(distance, (int, long)):
            raise ValueError("Distance must be an integer not", type(distance))
        if distance < 0:
            raise ValueError("Distance out of bounds, should be 0 or greater")

        if 0 <= distance < 1000:
            return 'VP'
        elif 1000 <= distance < 4000:
            return 'PO'
        elif 4000 <= distance < 10000:
            return 'MO'
        elif 10000 <= distance < 20000:
            return 'GO'
        elif 20000 <= distance < 40000:
            return 'VG'
        else:
            return 'EX'