<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_header(self, key, value, **params):
 """ Add a header to the collection, including potential parameters. Args: key (str):
 The name of the header value (str):
 The value to store under that key params: Option parameters to be appended to the value, automatically formatting them in a standard way """


        key = self.escape(key)
        ci_key = key.casefold()

        def quoted_params(items):
            for p in items:
                param_name = self.escape(p[0])
                param_val = self.de_quote(self.escape(p[1]))
                yield param_name, param_val

        sorted_items = sorted(params.items())

        quoted_iter = ('%s="%s"' % p for p in quoted_params(sorted_items))
        param_str = ' '.join(quoted_iter)

        if param_str:
            value = "%s; %s" % (value, param_str)

        self._header_data[ci_key] = (key, value)