Determine & invoke the proper serializer method

        If data is a list then the serialize_datas method will
        be run otherwise serialize_data.
352918
def serialize(self, data):
        

        super(Serializer, self).serialize(data)

        self.resp.content_type += '; header=present'
        import pprint
        pprint.PrettyPrinter().pprint(data)
1150407
def register_serializers(self, serializers):
        
        for new_serializer in serializers:

            if not isinstance(new_serializer, serializer.Base):
                msg = "registered serializer %s.%s does not inherit from prestans.serializer.Serializer" % (
                    new_serializer.__module__,
                    new_serializer.__class__.__name__
                )
                raise TypeError(msg)

        self._serializers = self._serializers + serializers
396977
def serialize(self):
        

        def _serialize(value):
            if hasattr(value, 'serialize'):
                return value.serialize()
            elif hasattr(value, 'to_dict'):
                return value.to_dict()
            else:
                return value

        return list(map(_serialize, self.items))
1241401
def check_data(self, data):
        
        data_objs = {
            data_src: data.objects.get(data_src) for data_src in data.layer
        }
        self._is_data_loaded = all(data_objs.values())
        return data_objs
194215
def serialize(self):
        

        data = {}
        for k, v in self.iteritems():
            if k.startswith('_'):
                continue

            if isinstance(v, APIModel):
                data[k] = v.serialize()
            elif v and is_seq_not_string(v) and isinstance(v[0], APIModel):
                data[k] = [x.serialize() for x in v]
            else:
                data[k] = v

        return data
1019450
def serialize(self, data):
        

        super(Serializer, self).serialize(data)

        body = {
            'jsonapi': {
                'version': goldman.config.JSONAPI_VERSION,
            },
            'links': {
                'self': self.req.path,
            },
            'meta': {
                'included_count': 0,
                'primary_count': 0,
                'total_primary': self.req.pages.total,
            },
        }

        included = data['included']
        if included:
            body['included'] = self._serialize_datas(included)
            body['meta']['included_count'] = len(included)

        _data = data['data']
        if isinstance(_data, list):
            body.update({'data': self._serialize_datas(_data)})
            body.update({'links': self._serialize_pages()})
            body['meta']['primary_count'] = len(_data)
        elif _data:
            body.update({'data': self._serialize_data(_data)})
            body['meta']['primary_count'] = 1
        else:
            body.update({'data': None})

        self.resp.body = json.dumps(body)
796121
static void deserialize(DataInput in, Serializers serializers)
      throws IOException, ClassNotFoundException {
    int size = in.readInt();
    if (size > 0) {
      StringBuilder msg = new StringBuilder(String.format("Deserialize %d serializer classes:", size));

      if (serializers.serializersArray.length < size) {
        serializers.serializersArray = Arrays.copyOf(serializers.serializersArray, size);
      }

      int max = 0;
      for (int i = 0; i < size; i++) {
        int index = in.readInt();
        max = Math.max(max, index);
        String serializerClassName = in.readUTF();
        try {
          Class<Serializer> serializerClass = (Class<Serializer>) Class.forName(serializerClassName);
          Serializer serializerInstance = serializerClass.newInstance();
          serializers.serializers
              .put(getSerializerType(serializerInstance), new SerializerWrapper(index, serializerInstance));
          serializers.serializersArray[index] = serializerInstance;

          msg.append(String.format("%n  (%d) %s", index, serializerClassName));
        } catch (Exception ex) {
          LOGGER.log(Level.WARNING, (String.format("Can't find the serializer '%s'", serializerClassName)), ex);
        }
      }
      serializers.COUNTER.set(max + 1);

      LOGGER.info(msg.toString());
    }
  }
238793
def _dump_list(list_data, jsonify, stream=sys.stdout):
    '''
    
    '''
    if not jsonify and list_data:
        print >> stream, '\n'.join(list_data)
    else:
        print >> stream, json.dumps(list_data)
1151751
public void serialize(List<T> list, OutputStream os) throws IOException {
        JsonGenerator jsonGenerator = LoganSquare.JSON_FACTORY.createGenerator(os);
        serialize(list, jsonGenerator);
        jsonGenerator.close();
    }
266428
def _pure_data(self, data: Any) -> Any:
        
        if not isinstance(data, dict) and not isinstance(data, list):
            try:
                return dict(data)
            except TypeError:
                ...
        return data
969806
def data(self):
        """"""
        data = super(DynamicListSerializer, self).data
        processed_data = ReturnDict(
            SideloadingProcessor(self, data).data,
            serializer=self
        ) if self.child.envelope else ReturnList(
            data,
            serializer=self
        )
        processed_data = post_process(processed_data)
        return processed_data
802070
public Serializable invoke(Serializable[] args)
   {
      if (args != null)
         return new IllegalArgumentException("Unsupported argument list: " + Arrays.toString(args));

      System.exit(0);

      return null;
   }
517322
function __serializeData(type, data, options=DEFAULT_OPTIONS) {
	let buffers = [];
	if (type === DATA_TYPE.NULL) {
		buffers = __serializeNull();
	}
	else if (type === DATA_TYPE.FALSE || type === DATA_TYPE.TRUE) {
		buffers = __serializeBoolean();
	}
	else if (type === DATA_TYPE.UINT8) {
		buffers = [data._ab];
	}
	else if (type === DATA_TYPE.UINT16) {
		buffers = [data._ab];
	}
	else if (type === DATA_TYPE.UINT32) {
		buffers = [data._ab];
	}
	else if (type === DATA_TYPE.INT8) {
		buffers = [data._ab];
	}
	else if (type === DATA_TYPE.INT16) {
		buffers = [data._ab];
	}
	else if (type === DATA_TYPE.INT32) {
		buffers = [data._ab];
	}
	else if (type === DATA_TYPE.INT64) {
		buffers = __serializeInt64(data);
	}
	else if (type === DATA_TYPE.INT128) {
		buffers = __serializeInt128(data);
	}
	else if (type === DATA_TYPE.INT256) {
		buffers = __serializeInt256(data);
	}
	else if (type === DATA_TYPE.INT512) {
		buffers = __serializeInt512(data);
	}
	else if (type === DATA_TYPE.INTVAR) {
		buffers = __serializeIntVar(data);
	}
	else if (type === DATA_TYPE.UINT64) {
		buffers = __serializeUInt64(data);
	}
	else if (type === DATA_TYPE.UINT128) {
		buffers = __serializeUInt128(data);
	}
	else if (type === DATA_TYPE.UINT256) {
		buffers = __serializeUInt256(data);
	}
	else if (type === DATA_TYPE.UINT512) {
		buffers = __serializeUInt512(data);
	}
	else if (type === DATA_TYPE.UINTVAR) {
		buffers = __serializeUIntVar(data);
	}
	else if (type === DATA_TYPE.FLOAT64) {
		buffers = __serializeDouble(data);
	}
	else if (type === DATA_TYPE.STRING) {
		buffers = __serializeString(data);
	}
	else if (type === DATA_TYPE.ARRAY) {
		buffers = __serializeArray(data, options);
	}
	else if (type === DATA_TYPE.ARRAY_START) {
		buffers = __serializeArrayStreaming(data, options);
	}
	else if (type === DATA_TYPE.OBJECT) {
		buffers = __serializeObject(data, options);
	}
	else if (type === DATA_TYPE.OBJECT_START) {
		buffers = __serializeObjectStreaming(data, options);
	}
	else if (type === DATA_TYPE.DATE) {
		buffers = __serializeDate(data);
	}
	else if (type === DATA_TYPE.OBJECTID) {
		buffers = __serializeObjectId(data);
	}
	else if (type === DATA_TYPE.BINARY) {
		buffers = __serializeArrayBuffer(data.toBytes());
	}
	else if (type === DATA_TYPE.ARRAY_BUFFER) {
		buffers = __serializeArrayBuffer(data);
	}
	else if (type === DATA_TYPE.DATA_VIEW) {
		buffers = __serializeArrayBuffer(data.buffer);
	}
	else if (type === DATA_TYPE.UINT8_ARRAY) {
		buffers = __serializeArrayBuffer(data.buffer);
	}
	else if (type === DATA_TYPE.INT8_ARRAY) {
		buffers = __serializeArrayBuffer(data.buffer);
	}
	else if (type === DATA_TYPE.UINT16_ARRAY) {
		buffers = __serializeArrayBuffer(data.buffer);
	}
	else if (type === DATA_TYPE.INT16_ARRAY) {
		buffers = __serializeArrayBuffer(data.buffer);
	}
	else if (type === DATA_TYPE.UINT32_ARRAY) {
		buffers = __serializeArrayBuffer(data.buffer);
	}
	else if (type === DATA_TYPE.INT32_ARRAY) {
		buffers = __serializeArrayBuffer(data.buffer);
	}
	else if (type === DATA_TYPE.FLOAT32_ARRAY) {
		buffers = __serializeArrayBuffer(data.buffer);
	}
	else if (type === DATA_TYPE.FLOAT64_ARRAY) {
		buffers = __serializeArrayBuffer(data.buffer);
	}
	else if (HAS_NODE_BUFFER && type === DATA_TYPE.SPECIAL_BUFFER) {
		let buff = Buffer.alloc(data.length);
		data.copy(buff, 0);
		buffers = __serializeArrayBuffer(buff.buffer);
	}
	
	return buffers;
}
524478
public String serializeDataActionList(List<DataAction> list) {
        ObjectMapper om = getObjectMapper();
        try {
            return om.writeValueAsString(new ListWrappers.DataActionList(list));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
213194
def map(lst, serialize_func):
    
    if not isinstance(lst, list):
        return lst
    return [serialize_func(e) for e in lst]
1372579
@Override
	public void serialize(BinderContext context, SerializerWrapper serializerWrapper, E object) throws Exception {
		serialize(context, object, serializerWrapper, true);
	}
1306590
public String serializeReducerList(List<IAssociativeReducer> list) {
        ObjectMapper om = getObjectMapper();
        try {
            return om.writeValueAsString(new ListWrappers.ReducerList(list));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }