Interface to query status of a migration request
        In this preference order of input parameters :
            migration_rqst_id, block, dataset, user
            (if multi parameters are provided, only the precedence order is followed)
165303
def status(self, migration_rqst_id="", block_name="", dataset="", user=""):
        
        try:
            return self.dbsMigrate.listMigrationRequests(migration_rqst_id,
                block_name, dataset, user)
        except dbsException as de:
            dbsExceptionHandler(de.eCode, de.message, self.logger.exception, de.serverError)
        except Exception as ex:
            sError = "DBSMigrateModle/status. %s\n Exception trace: \n %s." \
                     % (ex, traceback.format_exc() )
	    if hasattr(ex, 'status') and ex.status == 400:
		dbsExceptionHandler('dbsException-invalid-input2', str(ex), self.logger.exception, sError)	
            else:
		dbsExceptionHandler('dbsException-server-error',  str(ex), self.logger.exception, sError)
323974
def _status_query(query, hostname, enumerate=None, service=None):
    '''
    
    '''
    config = _config()

    data = None
    params = {
        'hostname': hostname,
        'query': query,
    }

    ret = {
        'result': False
    }

    if enumerate:
        params['formatoptions'] = 'enumerate'
    if service:
        params['servicedescription'] = service

    if config['username'] and config['password'] is not None:
        auth = (config['username'], config['password'],)
    else:
        auth = None

    try:
        result = salt.utils.http.query(
            config['url'],
            method='GET',
            params=params,
            decode=True,
            data=data,
            text=True,
            status=True,
            header_dict={},
            auth=auth,
            backend='requests',
            opts=__opts__,
        )
    except ValueError:
        ret['error'] = 'Please ensure Nagios is running.'
        ret['result'] = False
        return ret

    if result.get('status', None) == salt.ext.six.moves.http_client.OK:
        try:
            ret['json_data'] = result['dict']
            ret['result'] = True
        except ValueError:
            ret['error'] = 'Please ensure Nagios is running.'
    elif result.get('status', None) == salt.ext.six.moves.http_client.UNAUTHORIZED:
        ret['error'] = 'Authentication failed. Please check the configuration.'
    elif result.get('status', None) == salt.ext.six.moves.http_client.NOT_FOUND:
        ret['error'] = 'URL {0} was not found.'.format(config['url'])
    else:
        ret['error'] = 'Results: {0}'.format(result.text)

    return ret
1200101
def search(self,
               q=None,
               per_page=None,
               page=None,
               bbox=None,
               sort_by="relavance",
               sort_order="asc"):
        
        url = self._url + "/datasets.json"
        param_dict = {
            "sort_by" : sort_by,
            "f" : "json"
        }
        if q is not None:
            param_dict['q'] = q
        if per_page is not None:
            param_dict['per_page'] = per_page
        if page is not None:
            param_dict['page'] = page
        if bbox is not None:
            param_dict['bbox'] = bbox
        if sort_by is not None:
            param_dict['sort_by'] = sort_by
        if sort_order is not None:
            param_dict['sort_order'] = sort_order
        ds_data =  self._get(url=url,
                    param_dict=param_dict,
                    securityHandler=self._securityHandler,
                    additional_headers=[],
                    proxy_url=self._proxy_url,
                    proxy_port=self._proxy_port)
        return ds_data
511543
def backend_status(self, backend='ibmqx4', access_token=None, user_id=None):
        
        if access_token:
            self.req.credential.set_token(access_token)
        if user_id:
            self.req.credential.set_user_id(user_id)
        backend_type = self._check_backend(backend, 'status')
        if not backend_type:
            raise BadBackendError(backend)

        status = self.req.get('/Backends/' + backend_type + '/queue/status',
                              with_token=False)

        ret = {}
        if 'state' in status:
            ret['available'] = bool(status['state'])
        if 'busy' in status:
            ret['busy'] = bool(status['busy'])
        if 'lengthQueue' in status:
            ret['pending_jobs'] = status['lengthQueue']
        
        ret['backend'] = backend_type

        return ret
1209953
public function status()
    {
        $status = $this->getStatus();
        if (!$status) {
            $this->writeln('No migrations found.');

            return;
        }

        $this->writeln(' Ran?    Name ');
        $this->writeln('--------------');

        foreach ($status as $row) {
            if ($row['migrated']) {
                $mark = $this->cli->success('Y');
            } else {
                $mark = $this->cli->error('N');
            }
            $this->writeln(' ' . $mark . '       ' . $row['id']);
        }
    }
33953
function status(req, res, next) {
  var params = {
    submission: {
      submissionId: req.params.id
    }
  };

  logger.debug("Middleware Submission status ", {params: params});

  forms.getSubmissionStatus(_.extend(params, req.connectionOptions), submissionsHandler(constants.resultTypes.submissions, req, next));
}
33542
def remove(self):
        
        body = request.body.read()
        indata = cjson.decode(body)
        try:
            indata = validateJSONInputNoCopy("migration_rqst", indata)
            return self.dbsMigrate.removeMigrationRequest(indata)
        except dbsException as he:
            dbsExceptionHandler(he.eCode, he.message, self.logger.exception, he.message)
        except Exception as e:
            if e.code == 400:
                dbsExceptionHandler('dbsException-invalid-input2', str(e), self.logger.exception, str(e))    
            else:
                dbsExceptionHandler('dbsException-server-error', dbsExceptionCode['dbsException-server-error'], self.logger.exception, str(e))
463828
def q(cls, **kwargs):
        '''  '''
        redis = cls.get_redis()

        return QuerySet(cls, redis.sscan_iter(cls.members_key()))
1176299
def runSearchRnaQuantificationSets(self, request):
        
        return self.runSearchRequest(
            request, protocol.SearchRnaQuantificationSetsRequest,
            protocol.SearchRnaQuantificationSetsResponse,
            self.rnaQuantificationSetsGenerator)
18240
def do_batch_status(args):
    
    rest_client = RestClient(args.url, args.user)
    batch_ids = args.batch_ids.split(',')

    if args.wait and args.wait > 0:
        statuses = rest_client.get_statuses(batch_ids, args.wait)
    else:
        statuses = rest_client.get_statuses(batch_ids)

    if args.format == 'yaml':
        fmt.print_yaml(statuses)
    elif args.format == 'json':
        fmt.print_json(statuses)
    else:
        raise AssertionError('Missing handler: {}'.format(args.format))
897032
def queryset(self, request, queryset):
        
        if self.value():
            parent = Question.objects.get(slug=self.value())
            return Choice.objects.child_of(parent).order_by('-id')
        return queryset
1261425
def list_migration_issues_groups(self, group_id, content_migration_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - group_id
        """ID"""
        path["group_id"] = group_id

        # REQUIRED - PATH - content_migration_id
        """ID"""
        path["content_migration_id"] = content_migration_id

        self.logger.debug("GET /api/v1/groups/{group_id}/content_migrations/{content_migration_id}/migration_issues with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/groups/{group_id}/content_migrations/{content_migration_id}/migration_issues".format(**path), data=data, params=params, all_pages=True)
670112
function (tryReload, options) {                                        // 139
  tryReload = tryReload || function () {};                                                 // 140
  options = options || {};                                                                 // 141
                                                                                           // 142
  var migrationData = {};                                                                  // 143
  var remaining = _.clone(providers);                                                      // 144
  var allReady = true;                                                                     // 145
  while (remaining.length) {                                                               // 146
    var p = remaining.shift();                                                             // 147
    var status = p.callback(tryReload, options);                                           // 148
    if (!status[0])                                                                        // 149
      allReady = false;                                                                    // 150
    if (status.length > 1 && p.name)                                                       // 151
      migrationData[p.name] = status[1];                                                   // 152
  };                                                                                       // 153
  if (allReady || options.immediateMigration)                                              // 154
    return migrationData;                                                                  // 155
  else                                                                                     // 156
    return null;                                                                           // 157
}
313894
def get_ordering(self, request, queryset, view):
        
        params = view.get_request_feature(view.SORT)
        if params:
            fields = [param.strip() for param in params]
            valid_ordering, invalid_ordering = self.remove_invalid_fields(
                queryset, fields, view
            )

            # if any of the sort fields are invalid, throw an error.
            # else return the ordering
            if invalid_ordering:
                raise ValidationError(
                    "Invalid filter field: %s" % invalid_ordering
                )
            else:
                return valid_ordering

        # No sorting was included
        return self.get_default_ordering(view)
1047960
def get_status(self):
        
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url,
            headers={
                "Accept": Consts.mediaTypeMigrationPreview
            }
        )
        self._useAttributes(data)
        return self.state
182746
def check_request_parameters(self, parameters: dict = dict):
        
        # -- SEMANTIC QUERY ---------------------------------------------------
        li_args = parameters.get("q").split()
        logging.debug(li_args)

        # Unicity
        li_filters = [i.split(":")[0] for i in li_args]
        filters_count = Counter(li_filters)
        li_filters_must_be_unique = ("coordinate-system", "format", "owner", "type")
        for i in filters_count:
            if i in li_filters_must_be_unique and filters_count.get(i) > 1:
                raise ValueError(
                    "This query filter must be unique: {}"
                    " and it occured {} times.".format(i, filters_count.get(i))
                )

        # dict
        dico_query = FILTER_KEYS.copy()
        for i in li_args:
            if i.startswith("action"):
                dico_query["action"].append(i.split(":")[1:][0])
                continue
            elif i.startswith("catalog"):
                dico_query["catalog"].append(i.split(":")[1:][0])
                continue
            elif i.startswith("contact") and i.split(":")[1] == "group":
                dico_query["contact:group"].append(i.split(":")[1:][1])
                continue
            elif i.startswith("contact"):
                dico_query["contact:isogeo"].append(i.split(":", 1)[1])
                continue
            elif i.startswith("coordinate-system"):
                dico_query["coordinate-system"].append(i.split(":")[1:][0])
                continue
            elif i.startswith("data-source"):
                dico_query["data-source"].append(i.split(":")[1:][0])
                continue
            elif i.startswith("format"):
                dico_query["format"].append(i.split(":")[1:][0])
                continue
            elif i.startswith("has-no"):
                dico_query["has-no"].append(i.split(":")[1:][0])
                continue
            elif i.startswith("keyword:isogeo"):
                dico_query["keyword:isogeo"].append(i.split(":")[1:][1])
                continue
            elif i.startswith("keyword:inspire-theme"):
                dico_query["keyword:inspire-theme"].append(i.split(":")[1:][1])
                continue
            elif i.startswith("license:isogeo"):
                dico_query["license:isogeo"].append(i.split(":")[1:][1:])
                continue
            elif i.startswith("license"):
                dico_query["license:group"].append(i.split(":", 1)[1:][0:])
                continue
            elif i.startswith("owner"):
                dico_query["owner"].append(i.split(":")[1:][0])
                continue
            elif i.startswith("provider"):
                dico_query["provider"].append(i.split(":")[1:][0])
                continue
            elif i.startswith("share"):
                dico_query["share"].append(i.split(":")[1:][0])
                continue
            elif i.startswith("type"):
                dico_query["type"].append(i.split(":")[1:][0])
                continue
            else:
                # logging.debug(i.split(":")[1], i.split(":")[1].isdigit())
                dico_query["text"].append(i)
                continue

        # Values
        dico_filters = {i.split(":")[0]: i.split(":")[1:] for i in li_args}
        if dico_filters.get("type", ("dataset",))[0].lower() not in FILTER_TYPES:
            raise ValueError(
                "type value must be one of: {}".format(" | ".join(FILTER_TYPES))
            )
        elif dico_filters.get("action", ("download",))[0].lower() not in FILTER_ACTIONS:
            raise ValueError(
                "action value must be one of: {}".format(" | ".join(FILTER_ACTIONS))
            )
        elif (
            dico_filters.get("provider", ("manual",))[0].lower() not in FILTER_PROVIDERS
        ):
            raise ValueError(
                "provider value must be one of: {}".format(" | ".join(FILTER_PROVIDERS))
            )
        else:
            logging.debug(dico_filters)

        # -- GEOGRAPHIC -------------------------------------------------------
        in_box = parameters.get("box")
        in_geo = parameters.get("geo")
        # geometric relation
        in_rel = parameters.get("rel")
        if in_rel and in_box is None and in_geo is None:
            raise ValueError("'rel' should'nt be used without box or geo.")
        elif in_rel not in GEORELATIONS and in_rel is not None:
            raise ValueError(
                "{} is not a correct value for 'georel'."
                " Must be one of: {}.".format(in_rel, " | ".join(GEORELATIONS))
            )
558100
def get_queryset(self, request):
        
        if request.GET.get(ShowHistoryFilter.parameter_name) == '1':
            queryset = self.model.objects.with_active_flag()
        else:
            # Show only the most recent row for each key.
            queryset = self.model.objects.current_set()
        ordering = self.get_ordering(request)
        if ordering:
            return queryset.order_by(*ordering)
        return queryset