SAVP - VAE only model.
350688
def next_frame_savp_vae():
  """"""
  hparams = next_frame_savp()
  hparams.use_vae = True
  hparams.use_gan = False
  hparams.latent_loss_multiplier = 1e-3
  hparams.latent_loss_multiplier_schedule = "linear_anneal"
  return hparams
1229590
function makeVirtual(src, target) {
  var this$1 = this;

  var head = createDOMPlaceholder(),
    tail = createDOMPlaceholder(),
    frag = createFrag(),
    sib, el;

  this.root.insertBefore(head, this.root.firstChild);
  this.root.appendChild(tail);

  this.__.head = el = head;
  this.__.tail = tail;

  while (el) {
    sib = el.nextSibling;
    frag.appendChild(el);
    this$1.__.virts.push(el); // hold for unmounting
    el = sib;
  }

  if (target)
    { src.insertBefore(frag, target.__.head); }
  else
    { src.appendChild(frag); }
}
301672
def make_invenio_opener(component=None):
    
    opener = urllib2.build_opener()
    opener.addheaders = [('User-agent', make_user_agent_string(component))]
    return opener
654998
function only(opts) {
        mocha.options.hasOnly = true;
        opts.isOnly = true;
        return this.create(opts);
      }
1249543
function(flvtool, cb) {
        if (flvtool.length) {
          return cb(null, flvtool);
        }

        utils.which('flvmeta', function(err, flvmeta) {
          cb(err, flvmeta);
        });
      }
1219830
def to_model
      vm = value ? value.to_model : nil
      HQMF::SubsetOperator.new(type, vm)
    end
648559
def gaussian_prior_model_for_arguments(self, arguments):
        
        return CollectionPriorModel(
            {
                key: value.gaussian_prior_model_for_arguments(arguments)
                if isinstance(value, AbstractPriorModel)
                else value
                for key, value in self.__dict__.items() if key not in ('component_number', 'item_number', 'id')
            }
        )
563687
def only(self, *fields):
        '''
        
        '''
        s = self._clone()
        if len(fields) == 1 and fields[0] == '__model':
            s._only = '__model'
        else:
            s._only = fields
        return s
778971
def remove_cv(type_):
    """"""

    nake_type = remove_alias(type_)
    if not is_const(nake_type) and not is_volatile(nake_type):
        return type_
    result = nake_type
    if is_const(result):
        result = remove_const(result)
    if is_volatile(result):
        result = remove_volatile(result)
    if is_const(result):
        result = remove_const(result)
    return result
1163591
@Override
	public String createMachine( TargetHandlerParameters parameters ) throws TargetException {

		this.logger.fine( "Creating a new VM @ OCCI." );

		// For IaaS, we only expect root instance names to be passed
		if( InstanceHelpers.countInstances( parameters.getScopedInstancePath()) > 1 )
			throw new TargetException( "Only root instances can be passed in arguments." );

		// Deal with the creation
		try {
			UUID id = UUID.randomUUID();
			Map<String, String> targetProperties = parameters.getTargetProperties();

			String userData = UserDataHelpers.writeUserDataAsString(
					parameters.getMessagingProperties(),
					parameters.getDomain(),
					parameters.getApplicationName(),
					parameters.getScopedInstancePath());

			if("json".equalsIgnoreCase(targetProperties.get(RENDERING))) {
				return OcciVMUtils.createVMJson(targetProperties.get(SERVER_IP_PORT),
					id.toString(),
					targetProperties.get(IMAGE),
					targetProperties.get(TITLE),
					targetProperties.get(SUMMARY),
					userData,
					targetProperties.get(USER),
					targetProperties.get(PASSWORD),
					targetProperties,
					false);
			} else {
				return OcciVMUtils.createVM(targetProperties.get(SERVER_IP_PORT),
						id.toString(),
						targetProperties.get(IMAGE),
						targetProperties.get(TITLE),
						targetProperties.get(SUMMARY),
						userData,
						targetProperties.get(USER),
						targetProperties.get(PASSWORD),
						targetProperties);
			}
		} catch( Exception e ) {
			throw new TargetException(e);
		}
	}
1185207
def _call_marginalizevlos(self,o,**kwargs):
        """"""
        #Get d, l, vperp
        l= o.ll(obs=[1.,0.,0.],ro=1.)*_DEGTORAD
        vperp= o.vll(ro=1.,vo=1.,obs=[1.,0.,0.,0.,0.,0.])
        R= o.R(use_physical=False)
        phi= o.phi(use_physical=False)
        #Get local circular velocity, projected onto the perpendicular 
        #direction
        vcirc= R**self._beta
        vcircperp= vcirc*math.cos(phi+l)
        #Marginalize
        alphaperp= math.pi/2.+phi+l
        if not 'nsigma' in kwargs or ('nsigma' in kwargs and \
                                          kwargs['nsigma'] is None):
            nsigma= _NSIGMA
        else:
            nsigma= kwargs['nsigma']
        kwargs.pop('nsigma',None)
        sigmaR2= self.targetSigma2(R,use_physical=False)
        sigmaR1= sc.sqrt(sigmaR2)
        #Use the asymmetric drift equation to estimate va
        va= sigmaR2/2./R**self._beta*(1./self._gamma**2.-1.
                                      -R*self._surfaceSigmaProfile.surfacemassDerivative(R,log=True)
                                      -R*self._surfaceSigmaProfile.sigma2Derivative(R,log=True))
        if math.fabs(va) > sigmaR1: va = 0. #To avoid craziness near the center
        if math.fabs(math.sin(alphaperp)) < math.sqrt(1./2.):
            cosalphaperp= math.cos(alphaperp)
            tanalphaperp= math.tan(alphaperp)
            #we can reuse the VperpIntegrand, since it is just another angle
            return integrate.quad(_marginalizeVperpIntegrandSinAlphaSmall,
                                  -self._gamma*va/sigmaR1-nsigma,
                                  -self._gamma*va/sigmaR1+nsigma,
                                  args=(self,R,cosalphaperp,tanalphaperp,
                                        vperp-vcircperp,vcirc,
                                        sigmaR1/self._gamma),
                                  **kwargs)[0]/math.fabs(cosalphaperp)\
                                  *sigmaR1/self._gamma
        else:
            sinalphaperp= math.sin(alphaperp)
            cotalphaperp= 1./math.tan(alphaperp)
            #we can reuse the VperpIntegrand, since it is just another angle
            return integrate.quad(_marginalizeVperpIntegrandSinAlphaLarge,
                                  -nsigma,nsigma,
                                  args=(self,R,sinalphaperp,cotalphaperp,
                                        vperp-vcircperp,vcirc,sigmaR1),
                                  **kwargs)[0]/math.fabs(sinalphaperp)*sigmaR1
1229696
def _poll_vq_single(self, dname, use_devmode, ddresp):
        
        vname = None
        query = None
        v_mr = ddresp.get('views', {})
        v_spatial = ddresp.get('spatial', {})
        if v_mr:
            vname = single_dict_key(v_mr)
            query = Query()
        elif v_spatial:
            vname = single_dict_key(v_spatial)
            query = SpatialQuery()

        if not vname:
            return False

        query.stale = STALE_OK
        query.limit = 1

        for r in self._cb.query(dname, vname, use_devmode=use_devmode,
                                query=query):
            pass
        return True
461210
def xmoe2_v1_l4k_global_only():
  """"""
  hparams = xmoe2_v1_l4k()
  hparams.decoder_layers = [
      "att" if l == "local_att" else l for l in hparams.decoder_layers]
  return hparams
1213241
def next_frame_sv2p_tiny():
  """"""
  hparams = next_frame_sv2p_atari_softmax()
  hparams.batch_size = 2
  hparams.tiny_mode = True
  hparams.num_masks = 1
  hparams.video_modality_loss_cutoff = 0.4
  hparams.video_num_input_frames = 4
  hparams.video_num_target_frames = 4
  return hparams
800640
def rbeta(alpha, beta, size=None):
    
    from scipy.stats.distributions import beta as sbeta
    return sbeta.ppf(np.random.random(size), alpha, beta)
486785
def v1(self):
        """"""
        Vm = self.system.dae.y[self.v]
        Va = self.system.dae.y[self.a]
        return polar(Vm[self.a1], Va[self.a1])
611629
def only_self(self):
        """"""
        others, self.others = self.others, []
        try:
            yield
        finally:
            self.others = others + self.others