Get the mcmc method kernel data elements. Used by :meth:`_get_mcmc_method_kernel_data`.
509121
def _get_mcmc_method_kernel_data_elements(self):
        """"""
        return {'proposal_stds': Array(self._proposal_stds, 'mot_float_type', mode='rw', ensure_zero_copy=True),
                'x_tmp': LocalMemory('mot_float_type', nmr_items=1 + self._nmr_params)}
1129608
def get_data_for_model(self, args, kwargs):
        
        kwargs_from_invocation = self.get_raw_data()
        args_from_invocation = deque(self.path_args)

        defaults = kwargs
        values = args + list(kwargs.keys())

        output = {}

        raw = False
        for i, field in enumerate(values):
            ## going through each bit of data that the model needs
            ## `field` here is the name of each needed var.

            # the 'default' value that may be defined in the model.
            # this variable might be a string or int or might even be a primitive object.
            # NotImplemented here is used as to preserve if a default value is None.
            # it is used here as a sort of MetaNone.
            default_defined_in_model = defaults.get(field, NotImplemented)
            
            # the value in kwarg arguments such as --values and GET params
            from_data_kwargs = kwargs_from_invocation.get(field, None)

            # The value that will end up being used.
            value_to_use = None

            if default_defined_in_model == RAW_INVOCATION_ARGS:
                # flag that the RAW_INVOCATION_ARGS primitive has been invoked
                # used later to suppress errors for unused program args
                # when this primitive is invoked, all positional args are invalid. 
                raw = True

            if type(default_defined_in_model) == GiottoPrimitive:
                value_to_use = self.get_primitive(default_defined_in_model.name)
            elif from_data_kwargs:
                value_to_use = from_data_kwargs
            elif not raw and args_from_invocation:
                value_to_use = args_from_invocation.popleft()
            elif default_defined_in_model is not NotImplemented:
                value_to_use = default_defined_in_model
            else:
                raise InvalidInvocation("Data Missing For Program. Missing: %s" % field)
            
            output[field] = value_to_use

        if args_from_invocation and not raw:
            msg = "Too many arguments. Program `%s` takes %s arguments, %s given" % (
                self.program.name, len(args) + len(kwargs), len(args_from_invocation)
            )
            raise InvalidInvocation(msg)

        return output
1193845
def get_data(self) -> bytes:
        
        data = {
            "_class_name": self.__class__.__name__,
            "version": 1,
            "segments_bin": SegmentSequence([self.command_seg, self.tan_request]).render_bytes(),
            "resume_method": self.resume_method,
            "tan_request_structured": self.tan_request_structured,
        }
        return compress_datablob(DATA_BLOB_MAGIC_RETRY, 1, data)
559814
def get_context_data(self, **kwargs):
        
        context = super().get_context_data(**kwargs)
        context['topic'] = self.object
        context['forum'] = self.object.forum
        return context
879956
def m_c(mcmc, scale, f, alphasMZ=0.1185, loop=3):
    """
    if scale == mcmc:
        return mcmc  # nothing to do
    _sane(scale, f)
    crd = rundec.CRunDec()
    alphas_mc = alpha_s(mcmc, 4, alphasMZ=alphasMZ, loop=loop)
    if f == 4:
        alphas_scale = alpha_s(scale, f, alphasMZ=alphasMZ, loop=loop)
        return crd.mMS2mMS(mcmc, alphas_mc, alphas_scale, f, loop)
    elif f == 3:
        crd.nfMmu.Mth = 1.3
        crd.nfMmu.muth = 1.3
        crd.nfMmu.nf = 4
        return crd.mH2mL(mcmc, alphas_mc, mcmc, crd.nfMmu, scale, loop)
    elif f == 5:
        crd.nfMmu.Mth = 4.8
        crd.nfMmu.muth = 4.8
        crd.nfMmu.nf = 5
        return crd.mL2mH(mcmc, alphas_mc, mcmc, crd.nfMmu, scale, loop)
    else:
        raise ValueError("Invalid input: f={}, scale={}".format(f, scale))
1266772
def _get_stddevs(self, C, rup, shape, stddev_types):
        
        weight = self._compute_weight_std(C, rup.mag)
        std_intra = weight * C["sd1"] * np.ones(shape)
        std_inter = weight * C["sd2"] * np.ones(shape)
        
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                stddevs.append(np.sqrt(std_intra ** 2. + std_inter ** 2.))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(std_intra)
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(std_inter)
        return stddevs
486550
def kernelparams():
    '''
    
    '''
    if salt.utils.platform.is_windows():
        # TODO: add grains using `bcdedit /enum {current}`
        return {}
    else:
        try:
            with salt.utils.files.fopen('/proc/cmdline', 'r') as fhr:
                cmdline = fhr.read()
                grains = {'kernelparams': []}
                for data in [item.split('=') for item in salt.utils.args.shlex_split(cmdline)]:
                    value = None
                    if len(data) == 2:
                        value = data[1].strip('"')

                    grains['kernelparams'] += [(data[0], value)]
        except IOError as exc:
            grains = {}
            log.debug('Failed to read /proc/cmdline: %s', exc)

        return grains
1231098
def imm_values(imm):
    '''
    
    '''
    return {p: getattr(imm, p) for p in six.iterkeys(_imm_value_data(imm))}
211124
def getmeths(method_type):
    
    meths = []
    if method_type == 'GM':
        meths.append('GM-PMAG-APWP')
        meths.append('GM-ARAR')
        meths.append('GM-ARAR-AP')
        meths.append('GM-ARAR-II')
        meths.append('GM-ARAR-NI')
        meths.append('GM-ARAR-TF')
        meths.append('GM-CC-ARCH')
        meths.append('GM-CC-ARCHMAG')
        meths.append('GM-C14')
        meths.append('GM-FOSSIL')
        meths.append('GM-FT')
        meths.append('GM-INT-L')
        meths.append('GM-INT-S')
        meths.append('GM-ISO')
        meths.append('GM-KAR')
        meths.append('GM-PMAG-ANOM')
        meths.append('GM-PMAG-POL')
        meths.append('GM-PBPB')
        meths.append('GM-RATH')
        meths.append('GM-RBSR')
        meths.append('GM-RBSR-I')
        meths.append('GM-RBSR-MA')
        meths.append('GM-SMND')
        meths.append('GM-SMND-I')
        meths.append('GM-SMND-MA')
        meths.append('GM-CC-STRAT')
        meths.append('GM-LUM-TH')
        meths.append('GM-UPA')
        meths.append('GM-UPB')
        meths.append('GM-UTH')
        meths.append('GM-UTHHE')
    else:
        pass
    return meths
479903
def get_context(self):
        
        if not self.context:
            return
        else:
            assert isinstance(self.context, tuple), 'Expected a Tuple not {0}'.format(type(self.context))
        for model in self.context:
            model_cls = utils.get_model_class(model)
            key = utils.camel_to_snake(model_cls.__name__)
            self.context_data[key] = self.get_instance_of(model_cls)
353763
def get_dict(self):
        """"""
        data = self.data_dict.copy()

        data.update({
            "class": self.classification,
            "tags": self.tags,
            "key_value_data": self.key_value_dict,
            "crumbs": self.crumb_list if len(self.crumb_list) > 0 else None,
            "media": [
                mediafile.filename
                if mediafile.filename is not None
                else mediafile.uri
                for mediafile in self.media_list
            ] if len(self.media_list) > 0 else None,
            "uri": self.uri,
            "dumped": datetime.utcnow().isoformat(),
        })

        return data
273034
def get_ar_data(self):
        
        for obj in self.get_objects():
            info = self.get_base_info(obj)
            info.update({
                "analyses": self.get_analysis_data_for(obj),
                "sampletype": self.get_base_info(obj.getSampleType()),
                "number_of_partitions": self.get_number_of_partitions_for(obj),
                "template": self.get_template_data_for(obj),
            })
            yield info
84922
def GetMethodCalls(self, method):
        '''
        '''
        return [(row[0], row[2]) for row in self.call_log if row[1] == method]
831081
def get_model(PARAMS):
    ''''''
    model_dict = {
        'LinearRegression': LinearRegression(),
        'SVR': SVR(),
        'KNeighborsRegressor': KNeighborsRegressor(),
        'DecisionTreeRegressor': DecisionTreeRegressor()
    }
    if not model_dict.get(PARAMS['model_name']):
        LOG.exception('Not supported model!')
        exit(1)
    
    model = model_dict[PARAMS['model_name']]
    
    try:
        if PARAMS['model_name'] == 'SVR':
            model.kernel = PARAMS['svr_kernel']
        elif PARAMS['model_name'] == 'KNeighborsRegressor':
            model.weights = PARAMS['knr_weights']
    except Exception as exception:
        LOG.exception(exception)
        raise
    return model
1205470
def get_registered_names(mcs):
        
        return [k for k, v in six.iteritems(mcs._base_classes_hash) if v]
535765
def get_methods(self):
        
        if self.__cache_all_methods is None:
            self.__cache_all_methods = []
            for i in self.get_classes():
                for j in i.get_methods():
                    self.__cache_all_methods.append(j)
        return self.__cache_all_methods
446669
def _get_stddevs(self, C, stddev_types, rup, imt, num_sites):
        
        stddevs = []
        for stddev_type in stddev_types:
            sigma_mean = self._compute_standard_dev(rup, imt, C)
            sigma_tot = np.sqrt((sigma_mean ** 2) + (C['SigmaReg'] ** 2))
            sigma_tot = np.log10(np.exp(sigma_tot))
            stddevs.append(sigma_tot + np.zeros(num_sites))
        return stddevs