# Path: monty/operator.py
# def operator_from_str(op):
#     """
#     Return the operator associated to the given string `op`.
# 
#     raises:
#         `KeyError` if invalid string.
#     """
#     d = {
#         "==": operator.eq,
#         "!=": operator.ne,
#         ">": operator.gt,
#         ">=": operator.ge,
#         "<": operator.lt,
#         "<=": operator.le,
#         "+": operator.add,
#         "-": operator.sub,
#         "*": operator.mul,
#         "%": operator.mod,
#         "^": operator.xor,
#     }
# 
#     try:
#         d["/"] = operator.truediv
#     except AttributeError:
#         pass
# 
#     return d[op]


import unittest
from monty.operator import operator_from_str


class OperatorTestCase(unittest.TestCase):
    def test_something(self):
        assert operator_from_str("==")(1, 1) and operator_from_str("+")(1, 1) == 2



# Path: monty/operator.py
# def operator_from_str(op):
#     """
#     Return the operator associated to the given string `op`.
# 
#     raises:
#         `KeyError` if invalid string.
#     """
#     d = {
#         "==": operator.eq,
#         "!=": operator.ne,
#         ">": operator.gt,
#         ">=": operator.ge,
#         "<": operator.lt,
#         "<=": operator.le,
#         "+": operator.add,
#         "-": operator.sub,
#         "*": operator.mul,
#         "%": operator.mod,
#         "^": operator.xor,
#     }
# 
#     try:
#         d["/"] = operator.truediv
#     except AttributeError:
#         pass
# 
#     return d[op]


# Path: tests/test_operator.py
import unittest
from monty.operator import operator_from_str



class OperatorTestCase(unittest.TestCase):
    def test_something(self):
        assert operator_from_str("==")(1, 1) and operator_from_str("+")(1, 1) == 2



if __name__ == "__main__":