def save(self, target=None):
target = target or getattr(self, '<STR_LIT:filename>', None)<EOL>if isinstance(target, six.string_types):<EOL><INDENT>self.filename = target<EOL>target = open(target, '<STR_LIT:wb>')<EOL><DEDENT>if target is None:<EOL><INDENT>msg = (<EOL>"<STR_LIT>"<EOL>% self.__class__.__name__<EOL>)<EOL>raise ValueError(msg)<EOL><DEDENT>self._store(target)<EOL>
Save this package to target, which should be a filename or open
file stream. If target is not supplied, and this package has a
filename attribute (such as when this package was created from
an existing file), it will be used.