# Buggy code
def _validate_units(self, units):
    """
    Validates the astropy unit-information associated with a TimeSeries.
    Should be a dictionary of some form (but not MetaDict) with only
    astropy units for values.
    """

    warnings.simplefilter("always", Warning)
    result = True

    # It must be a dictionary
    if not isinstance(units, dict) or isinstance(units, MetaDict):
        return False

    for key in units:
        if not isinstance(units[key], u.UnitBase):
            # If this is not a unit then this can't be a valid units dict.
            return False

    # Passed all the tests
    return result


# 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 _validate_units(units):
    """
    Validates the astropy unit-information associated with a TimeSeries.
    Should be a dictionary of some form (but not MetaDict) with only
    astropy units for values.
    """

    warnings.simplefilter("always", Warning)
    result = True

    # It must be a dictionary
    if not isinstance(units, dict) or isinstance(units, MetaDict):
        return False

    for key in units:
        if not isinstance(units[key], u.UnitBase):
            # If this is not a unit then this can't be a valid units dict.
            return False

    # Passed all the tests
    return result