<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def alloc_data(self, value):
 """ Allocate a piece of data that will be included in the shellcode body. Arguments: string type. Returns: ~pwnypack.types.Offset: The offset used to address the data. """


        if isinstance(value, six.binary_type):
            return self._alloc_data(value)
        elif isinstance(value, six.text_type):
            return self._alloc_data(value.encode('utf-8') + b'\0')
        else:
            raise TypeError('No idea how to encode %s' % repr(value))