Apply the groups of strategy rules to the dataset passed in.

@param dataArr The list of data set
@return The list of new generated data set
497336
public ArrayList<HashMap<String, Object>> applyStg(ArrayList<HashMap<String, Object>> dataArr) {

        ArrayList<HashMap<String, Object>> results = new ArrayList();

        // Check if there is generator command group left
        if (hasMoreGenRules()) {
            if (genRules != null && !genRules.isEmpty()) {
                // Apply non-generator rules to each entry of data
                for (HashMap<String, Object> data : dataArr) {
                    ArrayList<HashMap<String, Object>> arr = new ArrayList();
                    for (int i = 0; i < genRules.size() - 1; i++) {
                        HashMap<String, String> rule = genRules.get(i);
                        applyRule(data, rule);
                    }
                }
                // Apply generator rules to whole data set
                HashMap<String, String> gemRule = genRules.get(genRules.size() - 1);
                if (!gemRule.isEmpty()) {
                    generators.add(gemRule);
                    results = runGenerators(dataArr, cur != genGroups.size());
                    generators.clear();
                } else {
                    results = dataArr;
                }
            }

            // Try yo apply next group of genertators
            results = applyStg(results);
        } else {
            // Finish recursion
            results = dataArr;
            // Remove reference
            boolean wthRefFlg = !keysToExtractFinal.contains("weather");
            boolean soilRefFlg = !keysToExtractFinal.contains("soil");
            for (HashMap result : results) {
                if (wthRefFlg) {
                    result.remove("weather");
                }
                if (soilRefFlg) {
                    result.remove("soil");
                }
            }
        }

        return results;
    }
250967
public void apply(HashMap<String, Object> data) {
        for (HashMap<String, String> rule : rules) {
            if (!isSWExtracted || (!isSoilRules(rule) && !isWthRules(rule))) {
                applyRule(data, rule);
            }
        }
    }
1113990
@Override
  public List<HivePartitionDataset> findDatasets()
      throws IOException {
    List<HivePartitionDataset> list = new ArrayList<>();
    for (HiveDataset hiveDataset : this.hiveDatasets) {
      for (Partition partition : hiveDataset.getPartitionsFromDataset()) {
        list.add(new HivePartitionDataset(partition));
      }
    }
    String selectionPolicyString = this.state.getProp(ComplianceConfigurationKeys.DATASET_SELECTION_POLICY_CLASS,
        ComplianceConfigurationKeys.DEFAULT_DATASET_SELECTION_POLICY_CLASS);
    Policy<HivePartitionDataset> selectionPolicy =
        GobblinConstructorUtils.invokeConstructor(Policy.class, selectionPolicyString);
    return selectionPolicy.selectedList(list);
  }
1216137
public void setRuleGroups(java.util.Collection<SubscribedRuleGroupSummary> ruleGroups) {
        if (ruleGroups == null) {
            this.ruleGroups = null;
            return;
        }

        this.ruleGroups = new java.util.ArrayList<SubscribedRuleGroupSummary>(ruleGroups);
    }
812436
@POST
  @Path("/{dataSourceName}")
  @Consumes(MediaType.APPLICATION_JSON)
  @ResourceFilters(RulesResourceFilter.class)
  public Response setDatasourceRules(
      @PathParam("dataSourceName") final String dataSourceName,
      final List<Rule> rules,
      @HeaderParam(AuditManager.X_DRUID_AUTHOR) @DefaultValue("") final String author,
      @HeaderParam(AuditManager.X_DRUID_COMMENT) @DefaultValue("") final String comment,
      @Context HttpServletRequest req
  )
  {
    if (databaseRuleManager.overrideRule(
        dataSourceName,
        rules,
        new AuditInfo(author, comment, req.getRemoteAddr())
    )) {
      return Response.ok().build();
    }
    return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
  }
59157
public ColumnMajorMatrixIterator columnMajorIterator() {
        return new ColumnMajorMatrixIterator(rows, columns) {
            private long limit = (long) rows * columns;
            private int i = -1;

            @Override
            public int rowIndex() {
                return i - columnIndex() * rows;
            }

            @Override
            public int columnIndex() {
                return i / rows;
            }

            @Override
            public double get() {
                return Matrix.this.get(rowIndex(), columnIndex());
            }

            @Override
            public void set(double value) {
                Matrix.this.set(rowIndex(), columnIndex(), value);
            }

            @Override
            public boolean hasNext() {
                return i + 1 < limit;
            }

            @Override
            public Double next() {
                if(!hasNext()) {
                    throw new NoSuchElementException();
                }
                i++;
                return get();
            }
        };
    }
734950
public static DataSource createDataSource(
            final Map<String, DataSource> dataSourceMap, final ShardingRuleConfiguration shardingRuleConfig, final Properties props) throws SQLException {
        return new ShardingDataSource(dataSourceMap, new ShardingRule(shardingRuleConfig, dataSourceMap.keySet()), props);
    }
378093
private void processDataProvider(final DataProvider<RI> dataProvider) {
        // Get rules matching the data provider
        final List<Rule<RI, RO>> mappedRules = dataProvidersToRules.get(dataProvider);
        if ((mappedRules == null) || mappedRules.isEmpty()) {
            LOGGER.warn("No matching rule in mappable validator for data provider: " + dataProvider);
        } else {
            // Get data to be validated
            final RI data = dataProvider.getData();

            // Process all matching rules
            for (final Rule<RI, RO> rule : mappedRules) {
                processRule(rule, data);
            }
        }
    }
238969
public static Map<DataSourceWrapper, List<ShardRouteInfo>> groupRouteInfosByDataSource(DDRDataSource ddrDataSource,
                                                                                           boolean readOnly,
                                                                                           List<ShardRouteInfo> routeInfos) {
        if (routeInfos == null || routeInfos.isEmpty()) {
            return Collections.EMPTY_MAP;
        }
        Map<DataSourceWrapper, List<ShardRouteInfo>> result = new LinkedHashMap<>();
        Map<String, DataSourceWrapper> dataSourceWrapperMap = new HashMap<>();
        for (ShardRouteInfo routeInfo : routeInfos) {
            DataSourceWrapper dataSourceWrapper = dataSourceWrapperMap.get(routeInfo.getScName());
            if (dataSourceWrapper == null) {
                DataSourceParam param = new DataSourceParam();
                Set<String> schemas = new HashSet<>();
                schemas.add(routeInfo.getScName());
                param.setScNames(schemas);
                param.setReadOnly(readOnly);
                dataSourceWrapper = ddrDataSource.getDataSource(param);
                for (String scName : dataSourceWrapper.getSchemas()) {
                    Object preValue = dataSourceWrapperMap.put(scName, dataSourceWrapper);
                    if (preValue != null) {
                        throw new IllegalStateException("Duplicate dataSource binding on schema: " + scName);
                    }
                }
            }
            List<ShardRouteInfo> list = result.get(dataSourceWrapper);
            if (list == null) {
                list = new ArrayList<>();
                result.put(dataSourceWrapper, list);
            }
            list.add(routeInfo);
        }
        return result;
    }
1332230
public void setDatasets(java.util.Collection<Dataset> datasets) {
        if (datasets == null) {
            this.datasets = null;
            return;
        }

        this.datasets = new com.amazonaws.internal.SdkInternalList<Dataset>(datasets);
    }
53511
public void setDatasetSummaries(java.util.Collection<DatasetSummary> datasetSummaries) {
        if (datasetSummaries == null) {
            this.datasetSummaries = null;
            return;
        }

        this.datasetSummaries = new java.util.ArrayList<DatasetSummary>(datasetSummaries);
    }
921402
def dataset_walker(datasets):
    
    for dataset in datasets:
        yield dataset, None
        for anc_ds in dataset.attrs.get('ancillary_variables', []):
            try:
                anc_ds.attrs
                yield anc_ds, dataset
            except AttributeError:
                continue
865023
public List<DistinctQueryResult> divide() {
        return Lists.newArrayList(Iterators.transform(resultData, new Function<QueryRow, DistinctQueryResult>() {
            
            @Override
            public DistinctQueryResult apply(final QueryRow row) {
                Set<QueryRow> resultData = new LinkedHashSet<>();
                resultData.add(row);
                return new DistinctQueryResult(columnLabelAndIndexMap, resultData.iterator());
            }
        }));
    }
754787
@Deprecated
   public DataContainerConfigurationBuilder dataContainer(DataContainer dataContainer) {
      attributes.attribute(DATA_CONTAINER).set(dataContainer);
      return this;
   }
1216821
public final Map<String, Object> applyFilters(
            final Map<String, Object> row) {
        Map<String, Object> filteringRow = new LinkedHashMap<>(row);
        assertFilterListExists();
        for (IDataFilter filter : getFilters()) {
            filteringRow = filter.apply(filteringRow);
        }

        return filteringRow;
    }
545542
public static DataSet copyOf(DataSet data) {
    if (data == null) {
      throw new InvalidOperationException("Null data set");
    }
    DataSet r = new DataSet(data.getSource());
    r.getRows().addAll(data.getRows());
    return r;
  }
173174
protected final MapDelta<K, V> genValues(final Map<K, ? extends V> entries) {
        return entries.isEmpty() ? Nop.instance() : new Values<>(entries);

    }