def _pd_read_hdf(path, key, lock, kwargs):
 if lock:
  lock.acquire()
 try:
  result = pd.read_hdf(path, key, **kwargs)
 finally:
  if lock:
   lock.release()
 return result

def _pd_read_hdf ( path , key , lock , kwargs ) : if lock : lock . acquire ( ) try : result = pd . read_hdf ( path , key , ** kwargs ) finally : if lock : lock . release ( ) return result
read from hdf5 file with a lock .