'checks so that object is an instantiated command and not, say
a cmdclass. If it is, instantiate it.  Other types, like
strings, are passed through.
Args:
cmd (any): Entity to analyze.
Returns:
result (any): An instantiated Command or the input unmodified.'

def _instantiate(self, cmd):

    try:
        return cmd()
    except TypeError:
        return cmd
