class_docstr: DataSource describes properties in a benchmark data.
  
  DataSource contains the metadata of a benchmark data including the total
  number of records, the number of partitioned files and a scenario. A scenario
  defines the features used in benchmark with the feature name, tensor spec,
  and Generator used to generate the value. DataSource can be consumed by
  FileWriter to generate the benchmark data descrbied by itself.
docstr: Return the consistent hashed code of the DataSource in hex str.
  
  The hashed code can be used as the path for data source cache.
  
  Returns:
    A hex str generated by hashing algorithm.
docstr_tok: ["Return","the","consistent","hashed","code","of","the","DataSource","in","hex","str",".","The","hashed","code","can","be","used","as","the","path","for","data","source","cache",".","Returns",":","A","hex","str","generated","by","hashing","algorithm","."]
code: def hash_code(self):
      """Return the consistent hashed code of the DataSource in hex str.
  
      The hashed code can be used as the path for data source cache.
  
      Returns:
        A hex str generated by hashing algorithm.
      """
      m = hashlib.sha256()
      # Step 1: hash sorted scenario dict
      for name in sorted(self.scenario):
          generator = self.scenario[name]
          m.update(name.encode())
          m.update(generator.hash_code().encode())
  
      # Step 2: hash num_records and partitions
      m.update(int_to_bytes(self.num_records))
      m.update(int_to_bytes(self.partitions))
  
      # Step 3: return hashed str in hex.
      return m.hexdigest()
  
file_path: io/tests/test_atds_avro/utils/data_source.py
imports: import hashlib
  from tests.test_atds_avro.utils.hash_util import int_to_bytes
label_desc: Use image node_id 5 for calling the DataSource obj's underlying member method code with example usage: obj.hash_code() and returns: m