if an array is passed, set serializer to many
163900
def get_serializer(self, *args, **kwargs):
        
        if isinstance(kwargs.get('data', {}), list):
            kwargs['many'] = True
        return super().get_serializer(*args, **kwargs)
407771
def serialize(params)
      params.each do |key, value|
        send("#{key}=", value) if respond_to?(key)
      end    
    end
668195
function createSerializer(serializer) {
  var applyFn = function serializationWrapper(v, cb) {
    try {
      return cb ? serializer(v, cb) : serializer(v);
    } catch (e) {
      var modifiedError = new Error('Could not serialize value: ' + e.message);
      modifiedError.value = v;
      modifiedError.serializer = serializer;
      throw modifiedError;
    }
  };

  // We can check how many parameters the function has and activate the asynchronous
  // operation if the number of parameters the function accepts is > 1
  return {
    apply: applyFn,
    async: serializer.length > 1
  };
}
178689
function(options) {

        Configurable.call(this);

        this._resources = [];
        this._serializer = require(__dirname + '/lib/Serializer');

        this.setAll( _.extend({}, defaults, options) );

        // List of IDs used to find duplicate handlers fast
        this._ids = {
            // id: handler
        };

        // List of names for handlers set by the user
        this._names = {
            // name: handler
        };
    }
394210
def register_serializer(name, serializer):
    '''
'''
    if not isclass(serializer):
        serializer = serializer.__class__
    _serializers[name] = serializer
360832
function serialize(obj) {
  var params = [],
    encodedBrackets = encodeURIComponent('[]');

  _.forOwn(obj, function(value, key) {
    if (typeof value === 'string' ||
      typeof value === 'number' ||
      typeof value === 'boolean') {
      params.push(key + '=' + encodeURIComponent(value));
    } else if (typeof value === 'object' && Array.isArray(value)) {
      params.push(value.map(function(param) {
        return key + encodedBrackets + '=' + encodeURIComponent(param);
      }).join('&'));
    }
  });

  return params.join('&');
}
482946
public function unserialize($serialized)
    {
        $results = (array)(unserialize($serialized) ?: []);
        $this->_results = SplFixedArray::fromArray($results);
        $this->_useBuffering = true;
        $this->_count = $this->_results->count();
    }
950114
function serialize(queryParams) {
  return Object.keys(queryParams)
    .filter(key => queryParams[key] !== undefined)
    .map(key => arrayToStr(key, queryParams[key]))
    .join('&');
}
475383
def serializable(wrapped):
    

    @wraps(wrapped)
    def wrapper(*args, **kwargs):
        should_serialize = kwargs.pop('serialize', False)
        result = wrapped(*args, **kwargs)

        return serialize(result) if should_serialize else result

    if hasattr(wrapped, 'decorators'):
        wrapper.decorators = wrapped.decorators
        wrapper.decorators.append('serializable')
    else:
        wrapper.decorators = ['serializable']

    return wrapper
776218
def to_internal_value(self, data):
        """"""
        if self.kwargs['many']:
            serializer = self.serializer.child
            if not isinstance(data, list):
                raise ParseError("'%s' value must be a list" % self.field_name)
            return [
                self.to_internal_value_single(
                    instance,
                    serializer
                ) for instance in data
            ]
        return self.to_internal_value_single(data, self.serializer)
1372579
@Override
	public void serialize(BinderContext context, SerializerWrapper serializerWrapper, E object) throws Exception {
		serialize(context, object, serializerWrapper, true);
	}
588041
private Object serializeCollection(Collection pArg) {
        JSONArray array = new JSONArray();
        for (Object value : ((Collection) pArg)) {
            array.add(serializeArgumentToJson(value));
        }
        return array;
    }
837822
def dumps(self, value):
    ''''''
    for serializer in self:
      value = serializer.dumps(value)
    return value
965949
def serialize(self, value, **kwargs):
        
        if self._serialize is not None:
            return self._serialize(value, **kwargs)
        else:
            return value
822447
public function toArray()
    {
        list($rawData, $rawIncludedData) = $this->executeResourceTransformers();

        $serializer = $this->manager->getSerializer();

        $data = $this->serializeResource($serializer, $rawData);

        // If the serializer wants the includes to be side-loaded then we'll
        // serialize the included data and merge it with the data.
        if ($serializer->sideloadIncludes()) {
            //Filter out any relation that wasn't requested
            $rawIncludedData = array_map(array($this, 'filterFieldsets'), $rawIncludedData);

            $includedData = $serializer->includedData($this->resource, $rawIncludedData);

            // If the serializer wants to inject additional information
            // about the included resources, it can do so now.
            $data = $serializer->injectData($data, $rawIncludedData);

            if ($this->isRootScope()) {
                // If the serializer wants to have a final word about all
                // the objects that are sideloaded, it can do so now.
                $includedData = $serializer->filterIncludes(
                    $includedData,
                    $data
                );
            }

            $data = $data + $includedData;
        }

        if ($this->resource instanceof Collection) {
            if ($this->resource->hasCursor()) {
                $pagination = $serializer->cursor($this->resource->getCursor());
            } elseif ($this->resource->hasPaginator()) {
                $pagination = $serializer->paginator($this->resource->getPaginator());
            }

            if (! empty($pagination)) {
                $this->resource->setMetaValue(key($pagination), current($pagination));
            }
        }

        // Pull out all of OUR metadata and any custom meta data to merge with the main level data
        $meta = $serializer->meta($this->resource->getMeta());

        // in case of returning NullResource we should return null and not to go with array_merge
        if (is_null($data)) {
            if (!empty($meta)) {
                return $meta;
            }
            return null;
        }

        return $data + $meta;
    }
1258603
public function unserialize($serialized)
    {
        $identifier = __CLASS__ . '@';

        if (substr($serialized, 0, strlen($identifier)) !== $identifier) {
            $message = sprintf('Serialized value doesn\'t represents an instance.of "%s".', __CLASS__);
            throw new Exception\InvalidArgumentException($message);
        }

        $collection = unserialize(substr($serialized, strlen($identifier)));

        if (!is_array($collection)) {
            $type = is_object($collection) ? get_class($collection) : gettype($collection);
            $message = sprintf('Unserialized value in "%s" must be an array; "%s" was given.', __METHOD__, $type);
            throw new Exception\InvalidArgumentException($message);
        }

        $this->collection = $collection;
        return $this;
    }
602429
function (serializeArray) {

            var out = [],
                self = this,
                scheme,
                hostname,
                path,
                port,
                fragment,
                query,
                userInfo;

            if (scheme = self.scheme) {
                out.push(encodeSpecialChars(scheme, reDisallowedInSchemeOrUserInfo));
                out.push(':');
            }

            if (hostname = self.hostname) {
                out.push('//');
                if (userInfo = self.userInfo) {
                    out.push(encodeSpecialChars(userInfo, reDisallowedInSchemeOrUserInfo));
                    out.push('@');
                }

                out.push(encodeURIComponent(hostname));

                if (port = self.port) {
                    out.push(':');
                    out.push(port);
                }
            }

            if (path = self.path) {
                if (hostname && !S.startsWith(path, '/')) {
                    path = '/' + path;
                }
                path = Path.normalize(path);
                out.push(encodeSpecialChars(path, reDisallowedInPathName));
            }

            if (query = ( self.query.toString.call(self.query, serializeArray))) {
                out.push('?');
                out.push(query);
            }

            if (fragment = self.fragment) {
                out.push('#');
                out.push(encodeSpecialChars(fragment, reDisallowedInFragment))
            }

            return out.join('');
        }