Return the params to run the celery task.
338072
def get_run_params(self) -> Dict:
        """"""
        params = {}
        if self.celery_queue:
            params['queue'] = self.celery_queue

        if self.timeout:
            params['soft_time_limit'] = self.timeout
            # We set also a hard time limit that will send sig 9
            # This hard time limit should not happened, as it will set inconsistent state
            params['time_limit'] = self.timeout + settings.CELERY_HARD_TIME_LIMIT_DELAY

        if self.execute_at:
            params['eta'] = self.execute_at

        return params
17094
def get_params(self, *args, **kwargs):
        '''
        
        '''
        kwargs.update(self._data)
        if args and kwargs:
            raise ValueError('Cannot mix positional and named parameters')
        if args:
            return list(args)
        else:
            return kwargs
1041981
def get_all_params(cls):
        
        for task_name, task_cls in six.iteritems(cls._get_reg()):
            if task_cls == cls.AMBIGUOUS_CLASS:
                continue
            for param_name, param_obj in task_cls.get_params():
                yield task_name, (not task_cls.use_cmdline_section), param_name, param_obj
26211
def set_run_params(self, **run_params):
        """"""
        self.run_params.update(run_params)
        self.check_run_params()
        self._backend.set_run_params(**run_params)
201922
def _get_params(self):
        """"""
        return np.hstack((self.varianceU,self.varianceY, self.lengthscaleU,self.lengthscaleY))
157287
def get_connection_params(self):
        """"""
        from django.conf import settings
        settings_dict = self.settings_dict
        options = settings_dict.get('OPTIONS', {})
        autocommit = options.get('autocommit', False)
        conn_params = {
            'server': settings_dict['HOST'],
            'database': settings_dict['NAME'],
            'user': settings_dict['USER'],
            'port': settings_dict.get('PORT', '1433'),
            'password': settings_dict['PASSWORD'],
            'timeout': self.command_timeout,
            'autocommit': autocommit,
            'use_mars': options.get('use_mars', False),
            'load_balancer': options.get('load_balancer', None),
            'failover_partner': options.get('failover_partner', None),
            'use_tz': utc if getattr(settings, 'USE_TZ', False) else None,
         }

        for opt in _SUPPORTED_OPTIONS:
            if opt in options:
                conn_params[opt] = options[opt]

        self.tzinfo_factory = utc_tzinfo_factory if settings.USE_TZ else None

        return conn_params
349169
def get_param(self):
        
        cycle_progress = self.event_index / self.cycle_size
        return self.start_value + ((self.end_value - self.start_value) / 2) * (1 - math.cos(math.pi * cycle_progress))
795703
def celery_task_wrapper(f):
    
    from celery.utils import fun_takes_kwargs

    @wraps(f, assigned=available_attrs(f))
    def newf(*args, **kwargs):
        backend = get_backend()
        was_patched = backend._patched
        get_backend().patch()
        # since this function takes all keyword arguments,
        # we will pass only the ones the function below accepts,
        # just as celery does
        supported_keys = fun_takes_kwargs(f, kwargs)
        new_kwargs = dict((key, val) for key, val in kwargs.items()
                                if key in supported_keys)

        try:
            ret = f(*args, **new_kwargs)
        finally:
            local.clear()
        if not was_patched:
            get_backend().unpatch()
        return ret
    return newf
257648
def _load_parameters(self):
        ""
        parameters = self._get_json('allparam/s')
        data = {}
        for parameter in parameters:    # There is a case-chaos in the DB
            data[parameter['Name'].lower()] = parameter
        self._parameters = ParametersContainer(data)
319439
def get_celery_info():
    
    import celery
    if not getattr(settings, 'USE_CELERY', False):
        log.error("No celery config found. Set USE_CELERY in settings to enable.")
        return {"status": NO_CONFIG}
    start = datetime.now()
    try:
        # pylint: disable=no-member
        app = celery.Celery('tasks')
        app.config_from_object('django.conf:settings', namespace='CELERY')
        # Make sure celery is connected with max_retries=1
        # and not the default of max_retries=None if the connection
        # is made lazily
        app.connection().ensure_connection(max_retries=1)

        celery_stats = celery.task.control.inspect().stats()
        if not celery_stats:
            log.error("No running Celery workers were found.")
            return {"status": DOWN, "message": "No running Celery workers"}
    except Exception as exp:  # pylint: disable=broad-except
        log.error("Error connecting to the backend: %s", exp)
        return {"status": DOWN, "message": "Error connecting to the backend"}
    return {"status": UP, "response_microseconds": (datetime.now() - start).microseconds}
1069250
def get_parameters(self, params, graph=None):
        
        g = graph if graph is not None else self.tf_graph

        with g.as_default():
            with tf.Session() as self.tf_session:
                self.tf_saver.restore(self.tf_session, self.model_path)
                out = {}
                for par in params:
                    if type(params[par]) == list:
                        for i, p in enumerate(params[par]):
                            out[par + '-' + str(i+1)] = p.eval()
                    else:
                        out[par] = params[par].eval()
                return out
153929
def get_params(self):
        ""
        import inspect
        a = inspect.getargspec(self.__init__)[0]
        out = dict()
        for key in a[1:]:
            value = getattr(self, "_%s" % key, None)
            out[key] = value
        return out
977254
def get_params(self):
        
        assert self.binded and self.params_initialized
        self._curr_module._params_dirty = self._params_dirty
        params = self._curr_module.get_params()
        self._params_dirty = False
        return params
1111618
def get_api_params(self):
        
        result = self.params
        if type(result) != dict:
            raise ValueError(
                '{}.params should return dictionary'.format(
                    self.__class__.__name__
                )
            )
        return result
1121187
def _build_list_params(param_name, key, values):
        """"""
        params = {}
        if hasattr(values, '__iter__'):
            index = 0
            for value in values:
                params[str(param_name) + '[' + str(index) + '].' + str(key)] = str(value)
                index += 1
        else:
            params[str(param_name) + '[0].' + str(key)] = str(values)
        return params
76885
def build_params(self, params={}):
        
        z = params.copy()
        z.update({'editId': self.edit_id, 'packageName': self.package_name})
        return z
258304
def get_query_params(self):
        """"""
        params = self.request.query_params.copy()
        params.update(self.request.data)
        return params