def toString(self, inObject):
        if isinstance(inObject, decimal.Decimal):
            # Hopefully decimal.Decimal.__str__ actually does what we want.
            return str(inObject)
        raise ValueError(
            "amp.Decimal can only encode instances of decimal.Decimal")
Keeps the given `keys` in the `dictionary` and removes all other.
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/protocols/amp.py/Decimal.toString--crossover with--dataset/ETHPy150Open shellderp/sublime-robot-plugin/lib/robot/libraries/Collections.py/_Dictionary.keep_in_dictionary