docs: def _marshall_value(value):
      """
      Recursively transform `value` into an AttributeValue `dict`
  
      :param mixed value: The value to encode
      :rtype: dict
      :raises ValueError: for unsupported types
  
      Return the value as dict indicating the data type and transform or
      recursively process the value if required.
  
      """
      if PYTHON3 and isinstance(value, bytes):
          return {'B': base64.b64encode(value).decode('ascii')}
      elif PYTHON3 and isinstance(value, str):
          return {'S': value}
      elif not PYTHON3 and isinstance(value, str):
          if is_binary(value):
              return {'B':  base64.b64encode(value).decode('ascii')}
          return {'S': value}
      elif not PYTHON3 and isinstance(value, unicode):
          return {'S': value.encode('utf-8')}
      elif isinstance(value, dict):
          return {'M': marshall(value)}
      elif isinstance(value, bool):
          return {'BOOL': value}
      elif isinstance(value, (int, float)):
          return {'N': str(value)}
      elif isinstance(value, datetime.datetime):
          return {'S': value.isoformat()}
      elif isinstance(value, uuid.UUID):
          return {'S': str(value)}
      elif isinstance(value, list):
          return {'L': [_marshall_value(v) for v in value]}
      elif isinstance(value, set):
          if PYTHON3 and all([isinstance(v, bytes) for v in value]):
              return {'BS': _encode_binary_set(value)}
          elif PYTHON3 and all([isinstance(v, str) for v in value]):
              return {'SS': sorted(list(value))}
          elif all([isinstance(v, (int, float)) for v in value]):
              return {'NS': sorted([str(v) for v in value])}
          elif not PYTHON3 and all([isinstance(v, str) for v in value]) and \
                  all([is_binary(v) for v in value]):
              return {'BS': _encode_binary_set(value)}
          elif not PYTHON3 and all([isinstance(v, str) for v in value]) and \
                  all([is_binary(v) is False for v in value]):
              return {'SS': sorted(list(value))}
          else:
              raise ValueError('Can not mix types in a set')
      elif value is None:
          return {'NULL': True}
      raise ValueError('Unsupported type: %s' % type(value))