def handle(self, *args, **options):
        if User.objects.filter(username=options['username']).exists():
            self.stdout.write(
                'User <%s> already exists' % options['username'],
                ending='\n'
            )
            u = User.objects.get(username=options['username'])
        else:
            self.stdout.write(
                'Creating user <%s>, password <%s> ...' % (
                    options['username'], options['password']
                ), ending=' '
            )
            u = User.objects.create_superuser(
                options['username'],
                options['username'],
                options['password']
            )
            self.stdout.write('Created!', ending='\n')

        org, created = Organization.objects.get_or_create(
            name=options['organization'])
        if created:
            self.stdout.write(
                'Creating org <%s> ... Created!' % options['organization'],
                ending='\n'
            )
        else:
            self.stdout.write(
                'Org <%s> aleady exists' % options['organization'], ending='\n'
            )

        self.stdout.write(
            'Creating org user ...', ending=' '
        )
        OrganizationUser.objects.create(user=u, organization=org)
        self.stdout.write('Created!', ending='\n')
dataset/ETHPy150Open buildingenergy/buildingenergy-platform/BE/management/commands/create_default_user.py/Command.handle/original