def SupplyEntropy(entropy, open_=open):
  """Supply entropy to the system RNG.

  Args:
    entropy: str, some string of bytes.
    open_: optional, default open, function with open-like interface
  Raises:
    SupplyEntropyError: when the operations to supply entropy to the system
       fail.
  """
  if not entropy:
    raise SupplyEntropyError('no entropy supplied')

  try:
    f = open_('/dev/random', 'w')
    f.write(entropy)
    f.close()
  except __HOLE__ as e:
    raise SupplyEntropyError(str(e))
dataset/ETHPy150Open google/cauliflowervest/src/cauliflowervest/client/util.py/SupplyEntropy