code: def _encode(self, value):
          "Return a bytestring representation of the value. Taken from redis-py connection.py"
          if isinstance(value, bytes):
              return value
          elif isinstance(value, (int, long)):
              value = str(value).encode('utf-8')
          elif isinstance(value, float):
              value = repr(value).encode('utf-8')
          elif not isinstance(value, basestring):
              value = str(value).encode('utf-8')
          else:
              value = value.encode('utf-8', 'strict')
          return valuf _encode(self, value):
          "Return a bytestring representation of the value. Taken from redis-py connection.py"
          if isinstance(value, bytes):
              return value
          elif isinstance(value, (int, long)):
              value = str(value).encode('utf-8')
          elif isinstance(value, float):
              value = repr(value).encode('utf-8')
          elif not isinstance(value, basestring):
              value = str(value).encode('utf-8')
          else:
              value = value.encode('utf-8', 'strict')
          return value
docs: Return a bytestring representation of the value. Taken from redis-py connection.py