# Buggy code
def __init__(self, *args):
    """
    Creates a new MetaDict instance.
    """
    # Store all keys as lower-case to allow for case-insensitive indexing
    # OrderedDict can be instantiated from a list of lists or a tuple of tuples
    tags = dict()
    if args:
        args = list(args)
        adict = args[0]
        if isinstance(adict, list) or isinstance(adict, tuple):
            items = adict
        elif isinstance(adict, dict):
            items = adict.items()
        else:
            raise TypeError(
                f"Can not create a MetaDict from this input of type {type(adict)}"
            )

        self._check_str_keys(items)
        tags = OrderedDict((k.lower(), v) for k, v in items)
        args[0] = tags

    super().__init__(*args)

    # Use `copy=True` to avoid mutating the caller's keycomments
    # dictionary (if they provided one).
    self._prune_keycomments(copy=True)


# Traceback (TypeError)
In [1]: from astropy.io import fits
...: from sunpy.map.sources import SUVIMap
...: hdu = fits.open('dr_suvi-l2-ci195_g16_s20200220T180000Z_e20200220T180400Z_v1-0-0.fits')
...: suvimap = SUVIMap(hdu[1].data, hdu[1].header)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-777075e1d3d8> in <module>
2 from sunpy.map.sources import SUVIMap
3 hdu = fits.open('dr_suvi-l2-ci195_g16_s20200220T180000Z_e20200220T180400Z_v1-0-0.fits')
----> 4 suvimap = SUVIMap(hdu[1].data, hdu[1].header)

~/opt/anaconda3/lib/python3.7/site-packages/sunpy/map/sources/suvi.py in __init__(self, data, header, **kwargs)
72     def __init__(self, data, header, **kwargs):
73
---> 74         super().__init__(data, header, **kwargs)
75
76         # Fill in some missing info

~/opt/anaconda3/lib/python3.7/site-packages/sunpy/map/mapbase.py in __init__(self, data, header, plot_settings, **kwargs)
187                           "Data will be truncated to the first two dimensions.", SunpyUserWarning)
188
--> 189         super().__init__(data, meta=MetaDict(header), **kwargs)
190
191         # Correct possibly missing meta keywords

~/opt/anaconda3/lib/python3.7/site-packages/sunpy/util/metadata.py in __init__(self, *args)
38                 items = adict.items()
39             else:
---> 40                 raise TypeError("Can not create a MetaDict from this type input")
41
42             self._check_str_keys(items)

TypeError: Can not create a MetaDict from this type input

# Fixed code
def __init__(self, *args):
    """
    Creates a new MetaDict instance.
    """
    # Store all keys as lower-case to allow for case-insensitive indexing
    # OrderedDict can be instantiated from a list of lists or a tuple of tuples
    tags = dict()
    if args:
        args = list(args)
        adict = args[0]
        if isinstance(adict, list) or isinstance(adict, tuple):
            items = adict
        elif isinstance(adict, Mapping):
            # Cast to a dict here, since a Mapping doesn't have to define
            # a .items() method (but has enough methods to be converted to
            # a dict)
            items = dict(adict).items()
        else:
            raise TypeError(
                f"Can not create a MetaDict from this input of type {type(adict)}"
            )

        self._check_str_keys(items)
        tags = OrderedDict((k.lower(), v) for k, v in items)
        args[0] = tags

    super().__init__(*args)

    # Use `copy=True` to avoid mutating the caller's keycomments
    # dictionary (if they provided one).
    self._prune_keycomments(copy=True)