beam.py