

def __getitem__(self, cmd):
    'Returns a `Command` object representing the given program. ``cmd`` can be a string or\n        a :class:`LocalPath <plumbum.path.local.LocalPath>`; if it is a path, a command\n        representing this path will be returned; otherwise, the program name will be looked up\n        in the system\'s ``PATH`` (using ``which``). Usage::\n\n            ls = local["ls"]\n        '
    if isinstance(self, LocalPath):
        return LocalCommand(cmd)
    elif (not isinstance(cmd, RemotePath)):
        if (('/' in cmd) or ('\\' in cmd)):
            return LocalCommand(local.path(cmd))
        else:
            return LocalCommand(self.which(cmd))
    else:
        raise TypeError(('cmd must not be a RemotePath: %r' % (cmd,)))

dataset/ETHPy150Open tomerfiliba/plumbum/plumbum/machines/local.py LocalMachine.__getitem__/VarMisuse@17/165 `cmd`->`self`