# Buggy code
def _get_goes_sat_num(self, start, end):
    """Parses the query time to determine which GOES satellite to use."""

    goes_operational = {
        2: TimeRange("1980-01-04", "1983-05-01"),
        5: TimeRange("1983-05-02", "1984-08-01"),
        6: TimeRange("1983-06-01", "1994-08-19"),
        7: TimeRange("1994-01-01", "1996-08-14"),
        8: TimeRange("1996-03-21", "2003-06-19"),
        9: TimeRange("1997-01-01", "1998-09-09"),
        10: TimeRange("1998-07-10", "2009-12-02"),
        11: TimeRange("2006-06-20", "2008-02-16"),
        12: TimeRange("2002-12-13", "2007-05-09"),
        13: TimeRange("2006-08-01", "2006-08-01"),
        14: TimeRange("2009-12-02", "2010-11-05"),
        15: TimeRange("2010-09-01", Time.now()),
    }

    sat_list = []
    for sat_num in goes_operational:
        if (
            start >= goes_operational[sat_num].start
            and start <= goes_operational[sat_num].end
            and (
                end >= goes_operational[sat_num].start
                and end <= goes_operational[sat_num].end
            )
        ):
            # if true then the satellite with sat_num is available
            sat_list.append(sat_num)

    if not sat_list:
        # if no satellites were found then raise an exception
        raise Exception("No operational GOES satellites within time range")
    else:
        return sat_list


# Traceback (ValueError)
In [3]: g = TimeSeries('../flarenet/data/goes/go06860129.fits')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-3-686c02e70652> in <module>()
----> 1 g = TimeSeries('../flarenet/data/goes/go06860129.fits')

~/Projects/sunpydev/sunpy/timeseries/timeseries_factory.py in __call__(self, *args, **kwargs)
442             cls = types[0]
443
--> 444             data_header_unit_tuples.append(cls._parse_hdus(pairs))
445
446         # Loop over each registered type and check to see if WidgetType

~/Projects/sunpydev/sunpy/timeseries/sources/goes.py in _parse_hdus(cls, hdulist)
169             seconds_from_start = hdulist[2].data['TIME'][0]
170         elif 1 <= len(hdulist) <= 3:
--> 171             start_time = parse_time(header['TIMEZERO'])
172             seconds_from_start = hdulist[0].data[0]
173             xrsb = hdulist[0].data[1]

~/Projects/sunpydev/sunpy/time/time.py in parse_time(time_string, format, **kwargs)
291         rt = Time.now()
292     else:
--> 293         rt = convert_time(time_string, format=format, **kwargs)
294
295     return rt

~/.pyenv/versions/3.6.3/lib/python3.6/functools.py in wrapper(*args, **kw)
801
802     def wrapper(*args, **kw):
--> 803         return dispatch(args[0].__class__)(*args, **kw)
804
805     registry[object] = func

~/Projects/sunpydev/sunpy/time/time.py in convert_time(time_string, format, **kwargs)
138 def convert_time(time_string, format=None, **kwargs):
139     # default case when no type matches
--> 140     return Time(time_string, format=format, **kwargs)
141
142

~/.virtualenvs/sunpy-dev/lib/python3.6/site-packages/astropy/time/core.py in __init__(self, val, val2, format, scale, precision, in_subfmt, out_subfmt, location, copy)
397         else:
398             self._init_from_vals(val, val2, format, scale, copy,
--> 399                                  precision, in_subfmt, out_subfmt)
400             self.SCALES = TIME_TYPES[self.scale]
401

~/.virtualenvs/sunpy-dev/lib/python3.6/site-packages/astropy/time/core.py in _init_from_vals(self, val, val2, format, scale, copy, precision, in_subfmt, out_subfmt)
452         # Parse / convert input values into internal jd1, jd2 based on format
453         self._time = self._get_time_fmt(val, val2, format, scale,
--> 454                                         precision, in_subfmt, out_subfmt)
455         self._format = self._time.name
456

~/.virtualenvs/sunpy-dev/lib/python3.6/site-packages/astropy/time/core.py in _get_time_fmt(self, val, val2, format, scale, precision, in_subfmt, out_subfmt)
485                   format.lower() in self.FORMATS):
486             if format is None:
--> 487                 raise ValueError("No time format was given, and the input is "
488                                  "not unique")
489             else:

ValueError: No time format was given, and the input is not unique

# Fixed code
def _get_goes_sat_num(start, end):
    """Parses the query time to determine which GOES satellite to use."""

    goes_operational = {
        2: TimeRange("1980-01-04", "1983-05-01"),
        5: TimeRange("1983-05-02", "1984-08-01"),
        6: TimeRange("1983-06-01", "1994-08-19"),
        7: TimeRange("1994-01-01", "1996-08-14"),
        8: TimeRange("1996-03-21", "2003-06-19"),
        9: TimeRange("1997-01-01", "1998-09-09"),
        10: TimeRange("1998-07-10", "2009-12-02"),
        11: TimeRange("2006-06-20", "2008-02-16"),
        12: TimeRange("2002-12-13", "2007-05-09"),
        13: TimeRange("2006-08-01", "2006-08-01"),
        14: TimeRange("2009-12-02", "2010-11-05"),
        15: TimeRange("2010-09-01", Time.now()),
    }

    sat_list = []
    for sat_num in goes_operational:
        if (
            goes_operational[sat_num].start <= start <= goes_operational[sat_num].end
            and goes_operational[sat_num].start <= end <= goes_operational[sat_num].end
        ):
            # if true then the satellite with sat_num is available
            sat_list.append(sat_num)

    if not sat_list:
        # if no satellites were found then raise an exception
        raise Exception("No operational GOES satellites within time range")
    else:
        return sat_list