# Buggy code
def __call__(self, *args, **kwargs):
    """Method for running the factory. Takes arbitrary arguments and
    keyword arguments and passes them to a sequence of pre-registered types
    to determine which is the correct TimeSeries source type to build.

    Arguments args and kwargs are passed through to the validation
    function and to the constructor for the final type.  For TimeSeries
    types, validation function must take a data-header pair as an argument.

    Parameters
    ----------

    silence_errors : `bool`, optional
        If set, ignore data-header pairs which cause an exception.

    Notes
    -----
    Extra keyword arguments are passed through to `sunpy.io.read_file` such
    as `memmap` for FITS files.
    """

    # Hack to get around Python 2.x not backporting PEP 3102.
    silence_errors = kwargs.pop("silence_errors", False)

    (data_header_unit_tuples, data_header_pairs, already_timeseries, filepaths) = (
        self._parse_args(*args, **kwargs)
    )

    new_timeseries = list()

    # The filepaths for unreadable files
    for filepath in filepaths:
        try:
            new_ts = self._check_registered_widgets(filepath=filepath, **kwargs)
        except (NoMatchError, MultipleMatchError, ValidationFunctionError):
            if not silence_errors:
                raise
        except Exception:
            raise

        new_timeseries.append(new_ts)

    # data_header_pairs is a list of HDUs as read by sunpy.io
    # For each set of HDus find the matching class and read the
    # data_header_unit_tuples by calling the _parse_hdus method
    # of the class.
    for pairs in data_header_pairs:
        # Pairs may be x long where x is the number of HDUs in the file.
        headers = [pair.header for pair in pairs]

        types = []
        for header in headers:
            try:
                match = self._get_matching_widget(meta=header, **kwargs)
                if not match == GenericTimeSeries:
                    types.append(match)
            except (MultipleMatchError, NoMatchError):
                continue

        if not types:
            # If no specific classes have been found we can read the data
            # if we only have one data header pair:
            if len(pairs) == 1:
                already_timeseries.append(
                    GenericTimeSeries(pairs[0].data, pairs[0].header)
                )
            else:
                raise NoMatchError(
                    "Input read by sunpy.io can not find a "
                    "matching class for reading multiple HDUs"
                )
        if len(set(types)) > 1:
            raise MultipleMatchError("Multiple HDUs return multiple matching classes.")

        cls = types[0]

        data_header_unit_tuples.append(cls._parse_hdus(pairs))

    # Loop over each registered type and check to see if WidgetType
    # matches the arguments.  If it does, use that type
    for triple in data_header_unit_tuples:
        data, header, units = triple
        # Make a MetaDict from various input types
        meta = header
        if isinstance(meta, astropy.io.fits.header.Header):
            meta = sunpy.io.header.FileHeader(meta)
        meta = MetaDict(meta)

        try:
            new_ts = self._check_registered_widgets(
                data=data, meta=meta, units=units, **kwargs
            )
        except (NoMatchError, MultipleMatchError, ValidationFunctionError):
            if not silence_errors:
                raise
        except Exception:
            raise

        new_timeseries.append(new_ts)

    new_timeseries += already_timeseries

    # Concatenate the timeseries into one if specified.
    concatenate = kwargs.get("concatenate", False)
    if concatenate:
        # Merge all these timeseries into one.
        full_timeseries = new_timeseries.pop(0)
        for timeseries in new_timeseries:
            full_timeseries = full_timeseries.concatenate(timeseries)

        new_timeseries = [full_timeseries]

    # Sanitize any units OrderedDict details
    for timeseries in new_timeseries:
        timeseries._sanitize_units()

    # Only return single time series, not in a list if we only have one.
    if len(new_timeseries) == 1:
        return new_timeseries[0]
    return new_timeseries


# 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 __call__(self, *args, **kwargs):
    """Method for running the factory. Takes arbitrary arguments and
    keyword arguments and passes them to a sequence of pre-registered types
    to determine which is the correct TimeSeries source type to build.

    Arguments args and kwargs are passed through to the validation
    function and to the constructor for the final type.  For TimeSeries
    types, validation function must take a data-header pair as an argument.

    Parameters
    ----------

    silence_errors : `bool`, optional
        If set, ignore data-header pairs which cause an exception.

    Notes
    -----
    Extra keyword arguments are passed through to `sunpy.io.read_file` such
    as `memmap` for FITS files.
    """

    # Hack to get around Python 2.x not backporting PEP 3102.
    silence_errors = kwargs.pop("silence_errors", False)

    (data_header_unit_tuples, data_header_pairs, already_timeseries, filepaths) = (
        self._parse_args(*args, **kwargs)
    )

    new_timeseries = list()

    # The filepaths for unreadable files
    for filepath in filepaths:
        try:
            new_ts = self._check_registered_widgets(filepath=filepath, **kwargs)
            new_timeseries.append(new_ts)
        except (NoMatchError, MultipleMatchError, ValidationFunctionError):
            if not silence_errors:
                raise
        except Exception:
            raise

    # data_header_pairs is a list of HDUs as read by sunpy.io
    # For each set of HDus find the matching class and read the
    # data_header_unit_tuples by calling the _parse_hdus method
    # of the class.
    for pairs in data_header_pairs:
        # Pairs may be x long where x is the number of HDUs in the file.
        headers = [pair.header for pair in pairs]

        types = []
        for header in headers:
            try:
                match = self._get_matching_widget(meta=header, **kwargs)
                if not match == GenericTimeSeries:
                    types.append(match)
            except (MultipleMatchError, NoMatchError):
                continue

        if not types:
            # If no specific classes have been found we can read the data
            # if we only have one data header pair:
            if len(pairs) == 1:
                already_timeseries.append(
                    GenericTimeSeries(pairs[0].data, pairs[0].header)
                )
            else:
                raise NoMatchError(
                    "Input read by sunpy.io can not find a "
                    "matching class for reading multiple HDUs"
                )
        if len(set(types)) > 1:
            raise MultipleMatchError("Multiple HDUs return multiple matching classes.")

        cls = types[0]

        data_header_unit_tuples.append(cls._parse_hdus(pairs))

    # Loop over each registered type and check to see if WidgetType
    # matches the arguments.  If it does, use that type
    for triple in data_header_unit_tuples:
        data, header, units = triple
        # Make a MetaDict from various input types
        meta = header
        if isinstance(meta, astropy.io.fits.header.Header):
            meta = sunpy.io.header.FileHeader(meta)
        meta = MetaDict(meta)

        try:
            new_ts = self._check_registered_widgets(
                data=data, meta=meta, units=units, **kwargs
            )
            new_timeseries.append(new_ts)
        except (NoMatchError, MultipleMatchError, ValidationFunctionError):
            if not silence_errors:
                raise
        except Exception:
            raise

    new_timeseries += already_timeseries

    # Concatenate the timeseries into one if specified.
    concatenate = kwargs.get("concatenate", False)
    if concatenate:
        # Merge all these timeseries into one.
        full_timeseries = new_timeseries.pop(0)
        for timeseries in new_timeseries:
            full_timeseries = full_timeseries.concatenate(timeseries)

        new_timeseries = [full_timeseries]

    # Sanitize any units OrderedDict details
    for timeseries in new_timeseries:
        timeseries._sanitize_units()

    # Only return single time series, not in a list if we only have one.
    if len(new_timeseries) == 1:
        return new_timeseries[0]
    return new_timeseries