<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def behaviors(behaviors_dir=None):
 """Return list of JS behaviors loaded from YAML file. :param behaviors_dir: Directory containing `behaviors.yaml` and `js-templates/`. Defaults to brozzler dir. """

    import os, yaml, string
    global _behaviors
    if _behaviors is None:
        d = behaviors_dir or os.path.dirname(__file__)
        behaviors_yaml = os.path.join(d, 'behaviors.yaml')
        with open(behaviors_yaml) as fin:
            _behaviors = yaml.safe_load(fin)
    return _behaviors