code: def createRecordSensor(network, name, dataSource):
    
  
    # Specific type of region. Possible options can be found in /nupic/regions/
    regionType = "py.RecordSensor"
  
    # Creates a json from specified dictionary.
    regionParams = json.dumps({"verbosity": _VERBOSITY})
    network.addRegion(name, regionType, regionParams)
  
    # getSelf returns the actual region, instead of a region wrapper
    sensorRegion = network.regions[name].getSelf()
  
    # Specify how RecordSensor encodes input values
    sensorRegion.encoder = createEncoder()
  
    # Specify which sub-encoder should be used for "actValueOut"
    network.regions[name].setParameter("predictedField", "consumption")
  
    # Specify the dataSource as a file record stream instance
    sensorRegion.dataSource = dataSource
    return sensorRegion
docs: Creates a RecordSensor region that allows us to specify a file record
    stream as the input source.