<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dice_check(self, n, d, target, comparator='<='):
 """Roll ``n`` dice with ``d`` sides, sum them, and return whether they are <= ``target``. If ``comparator`` is provided, use it instead of <=. You may use a string like '<' or '>='. """

        from operator import gt, lt, ge, le, eq, ne

        comps = {
            '>': gt,
            '<': lt,
            '>=': ge,
            '<=': le,
            '=': eq,
            '==': eq,
            '!=': ne
        }
        try:
            comparator = comps.get(comparator, comparator)
        except TypeError:
            pass
        return comparator(sum(self.dice(n, d)), target)