<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def command(cls, command, stdin=None, shell=False):
 """ Runs specified command. The command can be fed with data on stdin with parameter ``stdin``. The command can also be treated as a shell command with parameter ``shell``. Please refer to subprocess.Popen on how does this stuff work :returns: Run() instance with resulting data """

        if not shell and isinstance(command, str):
            command = cls.shlex.split(command)
        collate_original = None
        try:
            collate_original = cls.os.environ['LC_ALL']
        except KeyError:
            pass
        cls.os.environ['LC_ALL'] = "C"  # Because of my czech locale, YUCK! :)
        try:
            process = cls.subprocess.Popen(command,
                                           stdout=cls.subprocess.PIPE,
                                           stderr=cls.subprocess.PIPE,
                                           stdin=cls.subprocess.PIPE,
                                           shell=shell)
            (stdout, stderr) = process.communicate(stdin)
        finally:
            if collate_original:
                cls.os.environ['LC_ALL'] = collate_original
            else:
                del cls.os.environ['LC_ALL']
        return cls(stdout, stderr, stdin, process.returncode, command)