<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def stage_redis(self, variable, data):
 """Stage data in Redis. Args: variable (str):
 The Redis variable name. data (dict|list|str):
 The data to store in Redis. """

        if isinstance(data, int):
            data = str(data)
        # handle binary
        if variable.endswith('Binary'):
            try:
                data = base64.b64decode(data)
            except binascii.Error:
                msg = 'The Binary staging data for variable {} is not properly base64 encoded.'
                msg = msg.format(variable)
                sys.exit(msg)
        elif variable.endswith('BinaryArray'):
            if isinstance(data, string_types):
                data = json.loads(data)

            try:
                # loop through each entry
                decoded_data = []
                for d in data:
                    d_decoded = base64.b64decode(d)
                    decoded_data.append(d_decoded)
                data = decoded_data
            except binascii.Error:
                msg = 'The BinaryArray staging data for variable {} is not properly base64 encoded.'
                msg = msg.format(variable)
                sys.exit(msg)
        self.log.info(u'[stage] Creating variable {}'.format(variable))
        self.tcex.playbook.create(variable, data)