<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ToVM(self):
 """ Used for turning a ContractParameter item into somethnig consumable by the VM Returns: """

        if self.Type == ContractParameterType.String:
            return str(self.Value).encode('utf-8').hex()
        elif self.Type == ContractParameterType.Integer and isinstance(self.Value, int):
            return BigInteger(self.Value)
        return self.Value