def recv_arrays(socket):
 headers = socket.recv_json()
 if ('stop' in headers):
  raise StopIteration
 arrays = []
 for header in headers:
  data = socket.recv()
  buf = buffer_(data)
  array = numpy.frombuffer(buf, dtype=numpy.dtype(header['descr']))
  array.shape = header['shape']
  if header['fortran_order']:
   array.shape = header['shape'][::(-1)]
   array = array.transpose()
  arrays.append(array)
 return arrays

def recv_arrays ( socket ) : headers = socket . recv_json ( ) if ( 'stop' in headers ) : raise StopIteration arrays = [ ] for header in headers : data = socket . recv ( ) buf = buffer_ ( data ) array = numpy . frombuffer ( buf , dtype = numpy . dtype ( header [ 'descr' ] ) ) array . shape = header [ 'shape' ] if header [ 'fortran_order' ] : array . shape = header [ 'shape' ] [ : : ( - 1 ) ] array = array . transpose ( ) arrays . append ( array ) return arrays
receive a list of numpy arrays .