def extend(self, *args, **kwargs):
        if len(args) > 1:
            raise TypeError("extend() takes at most 1 positional "
                            "arguments ({0} given)".format(len(args)))
        other = args[0] if len(args) >= 1 else ()

        if isinstance(other, HTTPHeaderDict):
            for key, val in other.iteritems():
                self.add(key, val)
        elif isinstance(other, Mapping):
            for key in other:
                self.add(key, other[key])
        elif hasattr(other, "keys"):
            for key in other.keys():
                self.add(key, other[key])
        else:
            for key, value in other:
                self.add(key, value)

        for key, value in kwargs.items():
            self.add(key, value)
requires : REQUIRES expr opt_semi
dataset/ETHPy150Open sigmavirus24/betamax/betamax/headers.py/HTTPHeaderDict.extend--crossover with--dataset/ETHPy150Open Microsoft/ivy/src/ivy/ivy_dafny_grammar.py/p_requires_requires_expr