def handle(self, *args, **options):
        if len(args) > 1:
            raise CommandError("extra arguments supplied")
        if len(args) < 1:
            raise CommandError("session_key argument missing")
        key = args[0].lower()
        if not SESSION_RE.match(key):
            raise CommandError("malformed session key")
        try:
            session = Session.objects.get(pk=key)
        except Session.DoesNotExist:
            print "Session Key does not exist. Expired?"
            return

        data = session.get_decoded()
        print 'Session to Expire:', session.expire_date
        print 'Raw Data:', data
        uid = data.get('_auth_user_id', None)
        if uid is None:
            print 'No user associated with session'
            return
        print "User id:", uid
        try:
            user = User.objects.get(pk=uid)
        except User.DoesNotExist:
            print "No user associated with that id."
            return
        for key in ['username', 'email', 'first_name', 'last_name']:
            print key + ': ' + getattr(user, key)
dataset/ETHPy150Open mozilla/inventory/vendor-local/src/django-extensions/build/lib/django_extensions/management/commands/print_user_for_session.py/Command.handle/original