code: function prepareDataSources(attrNode, context) {
      Object.keys(attrNode.dataSources).forEach(dataSourceName => {
          const dataSource = attrNode.dataSources[dataSourceName];
  
          // DataSources with inherit="true" may have no type - so no prepare here:
          if (!dataSource.type) return;
  
          let dataSourceAttributes = context.dataSourceAttributes[dataSourceName];
          const dataSourceInstance = context.dataSources[dataSource.type];
  
          if (!dataSourceInstance) {
              throw new ImplementationError('Invalid DataSource type "' + dataSource.type + '"' + context.errorContext);
          }
  
          if (dataSource.joinParentKey && dataSource.joinChildKey) {
              const errorContext = context.errorContext;
              context.errorContext = ' in joinParentKey' + errorContext;
              dataSource.resolvedJoinParentKey = resolveKey(
                  dataSource.joinParentKey,
                  attrNode,
                  {
                      neededDataSources: [dataSourceName],
                      allowMultiValued: false
                  },
                  context
              );
              dataSource.resolvedJoinParentKey = dataSource.resolvedJoinParentKey[dataSourceName];
  
              context.errorContext = ' in joinChildKey' + errorContext;
              dataSource.resolvedJoinChildKey = resolveKey(
                  dataSource.joinChildKey,
                  attrNode,
                  {
                      neededDataSources: [dataSourceName],
                      allowMultiValued: false
                  },
                  context
              );
              dataSource.resolvedJoinChildKey = dataSource.resolvedJoinChildKey[dataSourceName];
              context.errorContext = errorContext;
          }
  
          // make attributes unique:
          dataSourceAttributes = dataSourceAttributes.filter((value, index, self) => self.indexOf(value) === index);
  
          try {
              dataSourceInstance.prepare(dataSource, dataSourceAttributes);
          } catch (err) {
              err.message += context.errorContext;
              throw err;
          }
      });
  }
docs: Call prepare() on all DataSources and pass them all collected possible attributes.
  
  @private