import operator


def PointInBox(box_min, box_max, sample):
  """Computes a sample point inside a box with arbitrary number of dimensions.

  Args:
    box_min: A list of floats representing the lower bounds of the box.
    box_max: A list of floats representing the upper bounds of the box.
    sample: A list of floats in the range [0.0, 1.0] representing the
      relative sample position in the box.

  Returns:
    A list of floats, representing the absolute position of the sample in
    the box.
  """
  delta = map(operator.sub, box_max, box_min)
  offset = map(operator.mul, delta, sample)
  position = map(operator.add, box_min, offset)
  return position