<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run(self, *args):
 """Export data from the registry. By default, it writes the data to the standard output. If a positional argument is given, it will write the data on that file. """

        params = self.parser.parse_args(args)

        with params.outfile as outfile:
            if params.identities:
                code = self.export_identities(outfile, params.source)
            elif params.orgs:
                code = self.export_organizations(outfile)
            else:
                # The running proccess never should reach this section
                raise RuntimeError("Unexpected export option")

        return code