code: function updateValidAndInvalidDataSources(dataSourcesToSplit, currentInvalidDataSources) {
    logger.debug("dataSourcesToSplit", dataSourcesToSplit);
    currentInvalidDataSources = currentInvalidDataSources || [];
    var validInvalid = _.partition(dataSourcesToSplit, function(dataSourceUpdateData) {
      if (dataSourceUpdateData) {
        return !dataSourceUpdateData.error;
      }
      return true;
    });
  
    var validDataSources = validInvalid[0];
  
    //Updating any data sources that are no longer valid
    var invalidDataSources = _.union(validInvalid[1], currentInvalidDataSources);
  
    return {
      valid: validDataSources,
      invalid: invalidDataSources
    };
  }
docs: Splitting Data Sources Into Invalid And Valid Data Sources.
  @param dataSourcesToSplit
  @param currentInvalidDataSources
  @returns {{valid, invalid: Array}}