<s> from django . contrib . auth . models import User <EOL> from django . core . management . base import BaseCommand , CommandError <EOL> from core . models import DataSet , ExtendedGroup <EOL> class Command ( BaseCommand ) : <EOL> args = "<STR_LIT>" <EOL> help = "<STR_LIT>" <EOL> def handle ( self , * args , ** options ) : <EOL> try : <EOL> user = User . objects . get ( username = args [ <NUM_LIT:0> ] ) <EOL> except User . DoesNotExist : <EOL> raise CommandError ( "<STR_LIT>" % args [ <NUM_LIT:0> ] ) <EOL> except IndexError : <EOL> raise CommandError ( "<STR_LIT>" ) <EOL> public_group = ExtendedGroup . objects . public_group ( ) <EOL> for data_set in DataSet . objects . all ( ) : <EOL> if user == data_set . get_owner ( ) : <EOL> self . stdout . write ( <EOL> "<STR_LIT>" % data_set . name ) <EOL> data_set . share ( public_group ) </s>
