<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_instance(name, parent=None, checkexists=True):
 """Try to guess and create the appropriate command instance Given a command name (encountered by the parser), construct the associated class name and, if known, return a new instance. If the command is not known or has not been loaded using require, an UnknownCommand exception is raised. :param name: the command's name :param parent: the eventual parent command :return: a new class instance """

    cname = "%sCommand" % name.lower().capitalize()
    gl = globals()
    condition = (
        cname not in gl or
        (checkexists and gl[cname].extension and
         gl[cname].extension not in RequireCommand.loaded_extensions)
    )
    if condition:
        raise UnknownCommand(name)
    return gl[cname](parent)