Creates a new Hessian 2.0 serializer.
348773
public Hessian2StreamingOutput createHessian2StreamingOutput(OutputStream os)
    {
        Hessian2Output out = createHessian2Output(os);

        return new Hessian2StreamingOutput(out);
    }
126458
def json_encoder_to_serializer(encoder_cls: Union[Type[JSONEncoder], Callable[[], Type[JSONEncoder]]]) \
        -> Type[Serializer]:
    
    name = encoder_cls.__name__ if isinstance(encoder_cls, type) else "%sLambdaTypeReturn" % id(encoder_cls)
    return type(
        "%sAsSerializer" % name,
        (_JSONEncoderAsSerializer,),
        {
            "encoder_type": property(lambda self: encoder_cls if isinstance(encoder_cls, type) else encoder_cls())
        }
    )
48248
public Serializer getSerializer(Class cl)
        throws HessianProtocolException
    {
        if (ObjectName.class.equals(cl)) {
            return new StringValueSerializer();
        }

        return null;
    }
249633
public static byte getSerializeTypeByName(String serialization) throws SofaRpcException {
        String sz = serialization.toLowerCase();
        Byte code;
        if (RpcConstants.SERIALIZE_HESSIAN2.equals(sz) || RpcConstants.SERIALIZE_HESSIAN.equals(sz)) {
            code = SerializerFactory.getCodeByAlias(RpcConstants.SERIALIZE_HESSIAN2);
        } else {
            code = SerializerFactory.getCodeByAlias(serialization);
        }
        if (code != null) {
            return code;
        } else {
            throw new SofaRpcException(RpcErrorType.SERVER_DESERIALIZE, "Unsupported serialize type " + serialization
                + " in http protocol.");
        }
    }
383450
public static <T> ArrayJsonSerializer<T> newInstance( JsonSerializer<T> serializer ) {
        return new ArrayJsonSerializer<T>( serializer );
    }
417071
def hessian(self, x, y, amp, sigma_x, sigma_y, center_x = 0, center_y = 0):
        
        f_ = self.function(x, y, amp, sigma_x, sigma_y, center_x, center_y)
        f_xx = f_ * ( (-1./sigma_x**2) + (center_x-x)**2/sigma_x**4 )
        f_yy = f_ * ( (-1./sigma_y**2) + (center_y-y)**2/sigma_y**4 )
        f_xy = f_ * (center_x-x)/sigma_x**2 * (center_y-y)/sigma_y**2
        return f_xx, f_yy, f_xy
746557
public static <T> OptionalJsonSerializer<T> newInstance( JsonSerializer<T> serializer ) {
        return new OptionalJsonSerializer<T>( serializer );
    }
173178
def create_translated_fields_serializer(shared_model, meta=None, related_name=None, **fields):
    
    if not related_name:
        translated_model = shared_model._parler_meta.root_model
    else:
        translated_model = shared_model._parler_meta[related_name].model

    # Define inner Meta class
    if not meta:
        meta = {}
    meta['model'] = translated_model
    meta.setdefault('fields', ['language_code'] + translated_model.get_translated_fields())

    # Define serialize class attributes
    attrs = {}
    attrs.update(fields)
    attrs['Meta'] = type('Meta', (), meta)

    # Dynamically create the serializer class
    return type('{0}Serializer'.format(translated_model.__name__), (serializers.ModelSerializer,), attrs)
245700
public Hessian2Input createHessian2Input(InputStream is)
    {
        Hessian2Input in = _freeHessian2Input.allocate();

        if (in == null) {
            in = new Hessian2Input(is);
            in.setSerializerFactory(getSerializerFactory());
        }
        else {
            in.init(is);
        }

        return in;
    }
712590
def _create_serializer(self) -> JsonObjectSerializer:
        
        if self._serializer_cache is None:
            serializer_cls = type(
                "%sInternalSerializer" % type(self),
                (JsonObjectSerializer,),
                {
                    "_JSON_ENCODER_ARGS": self._args,
                    "_JSON_ENCODER_KWARGS": self._kwargs
                }
            )
            self._serializer_cache = serializer_cls(self._get_property_mappings())
        return self._serializer_cache
96761
public static <I extends ImageGray<I>, D extends ImageGray<D>>
	GeneralFeatureIntensity<I,D> hessian(HessianBlobIntensity.Type type, Class<D> derivType) {
		return new WrapperHessianBlobIntensity<>(type, derivType);
	}
246146
def hessian(self, x, y, amp, sigma, center_x=0, center_y=0):
        
        x_ = x - center_x
        y_ = y - center_y
        r = np.sqrt(x_**2 + y_**2)
        sigma_x, sigma_y = sigma, sigma
        if isinstance(r, int) or isinstance(r, float):
            r = max(r, self.ds)
        else:
            r[r <= self.ds] = self.ds
        d_alpha_dr = -self.d_alpha_dr(r, amp, sigma_x, sigma_y)
        alpha = self.alpha_abs(r, amp, sigma)

        f_xx = -(d_alpha_dr/r + alpha/r**2) * x_**2/r + alpha/r
        f_yy = -(d_alpha_dr/r + alpha/r**2) * y_**2/r + alpha/r
        f_xy = -(d_alpha_dr/r + alpha/r**2) * x_*y_/r
        return f_xx, f_yy, f_xy
125647
public Deserializer getCustomDeserializer(Class cl)
    {
        Deserializer deserializer = _customDeserializerMap.get(cl.getName());

        if (deserializer == AbstractDeserializer.NULL)
            return null;
        else if (deserializer != null)
            return deserializer;

        try {
            Class serClass = Class.forName(cl.getName() + "HessianDeserializer",
                false, cl.getClassLoader());

            Deserializer ser = (Deserializer) serClass.newInstance();

            _customDeserializerMap.put(cl.getName(), ser);

            return ser;
        } catch (ClassNotFoundException e) {
            log.log(Level.ALL, e.toString(), e);
        } catch (Exception e) {
            throw new HessianException(e);
        }

        _customDeserializerMap.put(cl.getName(), AbstractDeserializer.NULL);

        return null;
    }
121132
private static function createGenericNormalizers() {
		return new WURFL_Request_UserAgentNormalizer(array(
			new WURFL_Request_UserAgentNormalizer_Generic_UCWEB(),
			new WURFL_Request_UserAgentNormalizer_Generic_UPLink(),
			new WURFL_Request_UserAgentNormalizer_Generic_SerialNumbers(),
			new WURFL_Request_UserAgentNormalizer_Generic_LocaleRemover(),
			new WURFL_Request_UserAgentNormalizer_Generic_BlackBerry(),
			new WURFL_Request_UserAgentNormalizer_Generic_YesWAP(),
			new WURFL_Request_UserAgentNormalizer_Generic_BabelFish(),
			new WURFL_Request_UserAgentNormalizer_Generic_NovarraGoogleTranslator(),
			new WURFL_Request_UserAgentNormalizer_Generic_TransferEncoding(),
		));
	}
677721
def create(model, trust_region, entropy_coefficient, q_coefficient, max_grad_norm, discount_factor,
           rho_cap=10.0, retrace_rho_cap=1.0, average_model_alpha=0.99, trust_region_delta=1.0):
    
    return AcerPolicyGradient(
        trust_region=trust_region,
        model_factory=model,
        entropy_coefficient=entropy_coefficient,
        q_coefficient=q_coefficient,
        rho_cap=rho_cap,
        retrace_rho_cap=retrace_rho_cap,
        max_grad_norm=max_grad_norm,
        discount_factor=discount_factor,
        average_model_alpha=average_model_alpha,
        trust_region_delta=trust_region_delta
    )
464208
function factory(options) {
    assert.optionalObject(options, 'options');

    var opts = _.assign({
        topLevelFields: false
    }, options);

    var serializer = new ErrorSerializer(opts);
    // rebind the serialize function since this will be lost when we export it
    // as a POJO
    serializer.serialize = serializer.serialize.bind(serializer);

    return serializer;
}
297605
public static <E extends Enum<E>> EnumMultisetJsonDeserializer<E> newInstance( EnumJsonDeserializer<E> deserializer ) {
        return new EnumMultisetJsonDeserializer<E>( deserializer );
    }