def createRecordSensor(network, name, dataSource):
 regionType = 'py.RecordSensor'
 regionParams = json.dumps({'verbosity': _VERBOSITY})
 network.addRegion(name, regionType, regionParams)
 sensorRegion = network.regions[name].getSelf()
 sensorRegion.encoder = createEncoder()
 sensorRegion.dataSource = dataSource
 return sensorRegion

def createRecordSensor ( network , name , dataSource ) : regionType = 'py.RecordSensor' regionParams = json . dumps ( { 'verbosity' : _VERBOSITY } ) network . addRegion ( name , regionType , regionParams ) sensorRegion = network . regions [ name ] . getSelf ( ) sensorRegion . encoder = createEncoder ( ) sensorRegion . dataSource = dataSource return sensorRegion
creates a recordsensor region that allows us to specify a file record stream as the input source .