def METHOD_NAME(self):
    if isinstance(self.dst, str):
        if self.dst.endswith(".bz2"):
            self.output = bz2.open(self.dst, "wt")
        else:
            self.output = open(self.dst, "w")
    else:
        self.output = self.dst
    return self.output