Returns the matching table report entries for a report ID and query parameters.
506687
@Override
    public Iterable<TableReportEntry> getReportEntries(String reportId, final AllTablesReportQuery query) {
        checkNotNull(reportId, "reportId");

        final String reportTable = getTableName(reportId);

        // Set up several filters based on the query attributes

        final Predicate<String> placementFilter = query.getPlacements().isEmpty()
                ? Predicates.<String>alwaysTrue()
                : Predicates.in(query.getPlacements());

        final Predicate<Boolean> droppedFilter = query.isIncludeDropped()
                ? Predicates.<Boolean>alwaysTrue()
                : Predicates.equalTo(false);

        final Predicate<Boolean> facadeFilter = query.isIncludeFacades()
                ? Predicates.<Boolean>alwaysTrue()
                : Predicates.equalTo(false);

        return new Iterable<TableReportEntry>() {
            @Override
            public Iterator<TableReportEntry> iterator() {
                return Iterators.limit(
                        Iterators.filter(
                                Iterators.transform(
                                        queryDataStoreForTableReportResults(reportTable, query),
                                        new Function<Map<String, Object>, TableReportEntry>() {
                                            @Nullable
                                            @Override
                                            public TableReportEntry apply(Map<String, Object> map) {
                                                if (Intrinsic.getId(map).startsWith("~")) {
                                                    // Skip this row, it's the metadata
                                                    return null;
                                                }
                                                return convertToTableReportEntry(
                                                        map, placementFilter, droppedFilter, facadeFilter);
                                            }
                                        }),
                                Predicates.notNull()
                        ),
                        query.getLimit()
                );
            }
        };
    }
1129281
def _find(self, ctx, table_name, column_values):
        
        result = []
        for ovsrec_row in ctx.idl.tables[table_name].rows.values():
            LOG.debug('ovsrec_row %s', ovsrec_row_to_string(ovsrec_row))
            if all(self._check_value(ovsrec_row, column_value)
                   for column_value in column_values):
                result.append(ovsrec_row)

        return result
741652
def query_record_report_this(comID):
    
    # retrieve nb_abuse_reports
    query1 = """SELECT nb_abuse_reports FROM "cmtRECORDCOMMENT" WHERE id=%s"""
    params1 = (comID,)
    res1 = run_sql(query1, params1)
    if len(res1) == 0:
        return (-2, 0)

    #increment and update
    nb_abuse_reports = int(res1[0][0]) + 1
    query2 = """UPDATE "cmtRECORDCOMMENT" SET nb_abuse_reports=%s WHERE id=%s"""
    params2 = (nb_abuse_reports, comID)
    res2 = run_sql(query2, params2)
    return (int(res2), nb_abuse_reports)
449471
def generate_query_report(self, db_uri, parsed_query, db_name, collection_name):
        """"""
        index_analysis = None
        recommendation = None
        namespace = parsed_query['ns']
        indexStatus = "unknown"

        index_cache_entry = self._ensure_index_cache(db_uri,
                                                     db_name,
                                                     collection_name)


        query_analysis = self._generate_query_analysis(parsed_query,
                                                       db_name,
                                                       collection_name)
        if ((query_analysis['analyzedFields'] != []) and
             query_analysis['supported']):
            index_analysis = self._generate_index_analysis(query_analysis,
                                                           index_cache_entry['indexes'])
            indexStatus = index_analysis['indexStatus']
            if index_analysis['indexStatus'] != 'full':
                recommendation = self._generate_recommendation(query_analysis,
                                                               db_name,
                                                               collection_name)
                # a temporary fix to suppress faulty parsing of $regexes.
                # if the recommendation cannot be re-parsed into yaml, we assume
                # it is invalid.
                if not validate_yaml(recommendation['index']):
                    recommendation = None
                    query_analysis['supported'] = False


        # QUERY REPORT
        return OrderedDict({
            'queryMask': parsed_query['queryMask'],
            'indexStatus': indexStatus,
            'parsed': parsed_query,
            'namespace': namespace,
            'queryAnalysis': query_analysis,
            'indexAnalysis': index_analysis,
            'recommendation': recommendation
        })
1330811
public Map<String, Serializable> getReportUserParametersForEdit(Report report) throws Exception {
        Map<String, Serializable> result = new LinkedHashMap<String, Serializable>();
        JasperReport jr = getJasperReport(report);
        Map<String, Serializable> map = JasperReportsUtil.getJasperReportUserParameters(jr);
        for (String key : map.keySet()) {
            JasperParameter jp = (JasperParameter) map.get(key);            
            JasperParameterSource sp = getParameterSources(report, jp);
            // this parameter is not defined inside the file
            if (sp == null) {
                sp = new JasperParameterSource(jp.getName());
                sp.setValueClassName(JasperReportsUtil.getValueClassName(storageService, report.getDataSource(), jp));
            }
            result.put(sp.getName(), sp);
        }
        return result;
    }
4484
private String getTableQuery(IdSourceKey idSourceKey) {
		String query = queryCache.get( idSourceKey.getTable() );
		if ( query == null ) {
			query = "MATCH (n" + labels( idSourceKey.getTable(), NodeLabel.TABLE_BASED_SEQUENCE.name() ) + ") WHERE n." + idSourceKey.getMetadata().getKeyColumnName() + " = {"
						+ SEQUENCE_NAME_QUERY_PARAM + "} RETURN n";
			String cached = queryCache.putIfAbsent( idSourceKey.getTable(), query );
			if ( cached != null ) {
				query = cached;
			}
		}
		return query;
	}
959025
def getIds(self, query='*:*', fq=None, start=0, rows=1000):
        
        params = {'q': query, 'start': str(start), 'rows': str(rows), 'wt': 'python'}
        if fq is not None:
            params['fq'] = fq
        request = urllib.parse.urlencode(params, doseq=True)
        data = None
        response = {'matches': 0, 'start': start, 'failed': True, 'ids': []}
        try:
            rsp = self.doPost(self.solrBase + '', request, self.formheaders)
            data = eval(rsp.read())
        except Exception:
            pass
        if data is None:
            return response
        response['failed'] = False
        response['matches'] = data['response']['numFound']
        for doc in data['response']['docs']:
            response['ids'].append(doc['id'][0])
        return response
567750
def get_ids(self, request_data, parameter_name='ids'):
        """"""
        if parameter_name not in request_data:
            raise ParseError("`{}` parameter is required".format(parameter_name))

        ids = request_data.get(parameter_name)
        if not isinstance(ids, list):
            raise ParseError("`{}` parameter not a list".format(parameter_name))

        if not ids:
            raise ParseError("`{}` parameter is empty".format(parameter_name))

        if any(map(lambda id: not isinstance(id, int), ids)):
            raise ParseError("`{}` parameter contains non-integers".format(parameter_name))

        return ids
142806
private OJBIterator getReportQueryIteratorFromQuery(Query query, ClassDescriptor cld) throws PersistenceBrokerException
    {
        RsIteratorFactory factory = ReportRsIteratorFactoryImpl.getInstance();
        OJBIterator result = getRsIteratorFromQuery(query, cld, factory);

        if (query.usePaging())
        {
            result = new PagingIterator(result, query.getStartAtIndex(), query.getEndAtIndex());
        }

        return result;
    }
1175065
def get_matching_indices pattern
      matches = []
      @obj.content.each_with_index { |e,i| 
        # convert to string for tables
        e = e.to_s unless e.is_a? String
        if e  =~ /#{pattern}/
          matches << i
        end
      }
      return matches
    end
525518
public static String getSql(Report report) {
		String sql;
		if (report.getSql() != null) {
			sql = report.getSql();
		} else {
			sql = report.getQuery().toString();
		}
		return sql;
	}
908905
public Query getCountQuery(Query aQuery)
    {
        if(aQuery instanceof QueryBySQL)
        {
            return getQueryBySqlCount((QueryBySQL) aQuery);
        }
        else if(aQuery instanceof ReportQueryByCriteria)
        {
            return getReportQueryByCriteriaCount((ReportQueryByCriteria) aQuery);
        }
        else
        {
            return getQueryByCriteriaCount((QueryByCriteria) aQuery);
        }
    }
1172468
def __find_reports(self, report_type, usage_page, usage_id = 0):
        ""
        if not self.is_opened():
            raise HIDError("Device must be opened")
        #
        results = list()
        if usage_page:
            for report_id in self.report_set.get( report_type, set() ):
                #build report object, gathering usages matching report_id
                report_obj = HidReport(self, report_type, report_id)
                if get_full_usage_id(usage_page, usage_id) in report_obj:
                    results.append( report_obj )
        else:
            #all (any one)
            for report_id in self.report_set.get(report_type, set()):
                report_obj = HidReport(self, report_type, report_id)
                results.append( report_obj )
        return results
908810
def start_report(self, report, account_id, _parameters=None):
        
        path = {}
        data = {}
        params = {}

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

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

        # OPTIONAL - [parameters]
        """The parameters will vary for each report"""
        if _parameters is not None:
            data["[parameters]"] = _parameters

        self.logger.debug("POST /api/v1/accounts/{account_id}/reports/{report} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/accounts/{account_id}/reports/{report}".format(**path), data=data, params=params, single_item=True)
264931
def get(self, test_id):
        '''
        
        '''
        self.select('*', 'test_id=?', [test_id])
        row = self._cursor.fetchone()
        if not row:
            raise KeyError('No report with test id %s in the DB' % test_id)

        values = self.row_to_dict(row)
        content = self._deserialize_dict(values['content'])
        return Report.from_dict(content)
872218
def get_report(self, report_id, **params):
        """"""
        response = self._get('v2', 'reports', report_id, data=params)
        return self._make_api_object(response, Report)
95647
def _get_download_table_ids(self):
        
        all_table_names = []  # matching per-date table names
        logger.info('Querying for all tables in dataset')
        tables = self.service.tables()
        request = tables.list(projectId=self._PROJECT_ID,
                              datasetId=self._DATASET_ID)
        while request is not None:
            response = request.execute()
            # if the number of results is evenly divisible by the page size,
            # we may end up with a last response that has no 'tables' key,
            # and is empty.
            if 'tables' not in response:
                response['tables'] = []
            for table in response['tables']:
                if table['type'] != 'TABLE':
                    logger.debug('Skipping %s (type=%s)',
                                 table['tableReference']['tableId'],
                                 table['type'])
                    continue
                if not self._table_re.match(table['tableReference']['tableId']):
                    logger.debug('Skipping table with non-matching name: %s',
                                 table['tableReference']['tableId'])
                    continue
                all_table_names.append(table['tableReference']['tableId'])
            request = tables.list_next(previous_request=request,
                                       previous_response=response)
        return sorted(all_table_names)