old_contents: # Make ophyd listen to pyepics.
  from ophyd import setup_ophyd
  setup_ophyd()
  
  # Set up a RunEngine and use metadata backed by a sqlite file.
  from bluesky import RunEngine
  from bluesky.utils import get_history
  RE = RunEngine(get_history())
  
  # Set up a Broker.
  from databroker import Broker
  db = Broker.named('chx')
  
  # Subscribe metadatastore to documents.
  # If this is removed, data is not saved to metadatastore.
  RE.subscribe(db.insert)
  
  # Set up SupplementalData.
  from bluesky import SupplementalData
  sd = SupplementalData()
  RE.preprocessors.append(sd)
  
  # Add a progress bar.
  from bluesky.utils import ProgressBarManager
  pbar_manager = ProgressBarManager()
  RE.waiting_hook = pbar_manager
  
  # Register bluesky IPython magics.
  from bluesky.magics import BlueskyMagics
  get_ipython().register_magics(BlueskyMagics)
  
  # Set up the BestEffortCallback.
  from bluesky.callbacks.best_effort import BestEffortCallback
  bec = BestEffortCallback()
  RE.subscribe(bec)
  peaks = bec.peaks  # just as alias for less typing
  
  # At the end of every run, verify that files were saved and
  # print a confirmation message.
  from bluesky.callbacks.broker import verify_files_saved
  # RE.subscribe(post_run(verify_files_saved), 'stop')
  
  # Import matplotlib and put it in interactive mode.
  import matplotlib.pyplot as plt
  plt.ion()
  
  # Make plots update live while scans run.
  from bluesky.utils import install_qt_kicker
  install_qt_kicker()
  
  # Optional: set any metadata that rarely changes.
  # RE.md['beamline_id'] = 'YOUR_BEAMLINE_HERE'
  
  # convenience imports
  from bluesky.callbacks import *
  from bluesky.callbacks.broker import *
  from bluesky.simulators import *
  from bluesky.plans import *
  import numpy as np
  
  from pyOlog.ophyd_tools import *
  
  # Uncomment the following lines to turn on verbose messages for
  # debugging.
  # import logging
  # ophyd.logger.setLevel(logging.DEBUG)
  # logging.basicConfig(level=logging.DEBUG)
  
  # Add a callback that prints scan IDs at the start of each scan.
  def print_scan_ids(name, start_doc):
      print("Transient Scan ID: {0} @ {1}".format(start_doc['scan_id'],time.strftime("%Y/%m/%d %H:%M:%S")))
      print("Persistent Unique Scan ID: '{0}'".format(start_doc['uid']))
  
  RE.subscribe(print_scan_ids, 'start')
  
  
  from chxtools import attfuncs as att
  from chxtools import xfuncs as xf
  from chxtools.bpm_stability import bpm_read
  from chxtools import transfuncs as trans  
  from chxtools import bpm_stability as bpmst
  
new_contents: # Make ophyd listen to pyepics.
  from ophyd import setup_ophyd
  setup_ophyd()
  
  # Set up a RunEngine and use metadata backed by a sqlite file.
  from bluesky import RunEngine
  from bluesky.utils import get_history
  RE = RunEngine(get_history())
  
  # Set up a Broker.
  from databroker import Broker
  db = Broker.named('chx')
  
  # Subscribe metadatastore to documents.
  # If this is removed, data is not saved to metadatastore.
  RE.subscribe(db.insert)
  
  # Set up SupplementalData.
  from bluesky import SupplementalData
  sd = SupplementalData()
  RE.preprocessors.append(sd)
  
  # Add a progress bar.
  from bluesky.utils import ProgressBarManager
  pbar_manager = ProgressBarManager()
  RE.waiting_hook = pbar_manager
  
  # Register bluesky IPython magics.
  from bluesky.magics import BlueskyMagics
  get_ipython().register_magics(BlueskyMagics)
  
  # Set up the BestEffortCallback.
  from bluesky.callbacks.best_effort import BestEffortCallback
  bec = BestEffortCallback()
  RE.subscribe(bec)
  peaks = bec.peaks  # just as alias for less typing
  
  # At the end of every run, verify that files were saved and
  # print a confirmation message.
  from bluesky.callbacks.broker import verify_files_saved
  # RE.subscribe(post_run(verify_files_saved), 'stop')
  
  # Import matplotlib and put it in interactive mode.
  import matplotlib.pyplot as plt
  plt.ion()
  
  # Make plots update live while scans run.
  from bluesky.utils import install_qt_kicker
  install_qt_kicker()
  
  # Optional: set any metadata that rarely changes.
  # RE.md['beamline_id'] = 'YOUR_BEAMLINE_HERE'
  
  # convenience imports
  from bluesky.callbacks import *
  from bluesky.callbacks.broker import *
  from bluesky.simulators import *
  from bluesky.plans import *
  import numpy as np
  
  from pyOlog.ophyd_tools import *
  
  # Uncomment the following lines to turn on verbose messages for
  # debugging.
  # import logging
  # ophyd.logger.setLevel(logging.DEBUG)
  # logging.basicConfig(level=logging.DEBUG)
  
  # Add a callback that prints scan IDs at the start of each scan.
  def print_scan_ids(name, start_doc):
      print("Transient Scan ID: {0} @ {1}".format(start_doc['scan_id'],time.strftime("%Y/%m/%d %H:%M:%S")))
      print("Persistent Unique Scan ID: '{0}'".format(start_doc['uid']))
  
  RE.subscribe(print_scan_ids, 'start')
  
  
  from chxtools import attfuncs as att
  from chxtools import attfuncs2 as att2
  from chxtools import xfuncs as xf
  from chxtools.bpm_stability import bpm_read
  from chxtools import transfuncs as trans  
  from chxtools import bpm_stability as bpmst
  
subject: Add att2 package