<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_command_class(self, cmd):
 """ Returns command class from the registry for a given ``cmd``. :param cmd: command to run (key at the registry) """

        try:
            cmdpath = self.registry[cmd]
        except KeyError:
            raise CommandError("No such command %r" % cmd)
        if isinstance(cmdpath, basestring):
            Command = import_class(cmdpath)
        else:
            Command = cmdpath
        return Command