def grep_file(self, path, pattern, encoding='UTF-8'):
        """Returns the lines of the specified file that match the `pattern`.

        This keyword reads a file from the file system using the defined
        `path` and `encoding` similarly as `Get File`. A difference is
        that only the lines that match the given `pattern` are returned.
        Lines are returned as a single string catenated back together with
        newlines and the number of matched lines is automatically logged.
        Possible trailing newline is never returned.

        A line matches if it contains the `pattern` anywhere in it and
        it *does not need to match the pattern fully*. The pattern
        matching syntax is explained in `introduction`, and in this
        case matching is case-sensitive.

        Examples:
        | ${errors} = | Grep File | /var/log/myapp.log | ERROR |
        | ${ret} = | Grep File | ${CURDIR}/file.txt | [Ww]ildc??d ex*ple |

        If more complex pattern matching is needed, it is possible to use
        `Get File` in combination with String library keywords like `Get
        Lines Matching Regexp`.
        """
        pattern = pattern % '*%s*'
        orig = self.get_file(path, encoding).splitlines()
        lines = [line for line in orig if fnmatch.fnmatchcase(line, pattern)]
        self._info('%d out of %d lines matched' % (len(lines), len(orig)))
        return '\n'.join(lines)
dataset/ETHPy150Open shellderp/sublime-robot-plugin/lib/robot/libraries/OperatingSystem.py/OperatingSystem.grep_file/swapped operands of `%`