<commit_before>__author__ = 'ratcave'

def motive_camera_vislight_configure():
    import motive
    for cam in motive.get_cams():

            # All cameras should have frame rate changed.
            cam.frame_rate = 30

            if 'Prime 13' in cam.name:
                cam.set_settings(videotype=0, exposure=33000, threshold=80, intensity=0)  #check if 480 corresponds to these thousands described in motive
                cam.image_gain = 8  # 8 is the maximum image gain setting
                cam.set_filter_switch(False)
            else:
                cam.set_settings(0, cam.exposure, cam.threshold, cam.intensity)<commit_msg>added a couple utility functions to help reduce boilerplate code<commit_after>__author__ = 'ratcave'
import numpy as np
from .. import graphics


def motive_camera_vislight_configure():
    import motive
    for cam in motive.get_cams():

            # All cameras should have frame rate changed.
            cam.frame_rate = 30

            if 'Prime 13' in cam.name:
                cam.set_settings(videotype=0, exposure=33000, threshold=80, intensity=0)  #check if 480 corresponds to these thousands described in motive
                cam.image_gain = 8  # 8 is the maximum image gain setting
                cam.set_filter_switch(False)
            else:
                cam.set_settings(0, cam.exposure, cam.threshold, cam.intensity)


def correct_orientation(rb, n_attempts=3):
    import motive
    import orienting
    """Reset the orientation to account for between-session arena shifts"""
    for attempt in range(n_attempts):
            rb.reset_orientation()
            motive.update()
    additional_rotation = orienting.rotate_to_var(np.array(rb.point_cloud_markers))
    return additional_rotation


def get_arena_from(file_name=graphics.resources.obj_arena, cubemap=True):
    """Just returns the arena mesh from a .obj file."""
    reader = graphics.WavefrontReader(file_name)
    arena = reader.get_mesh('Arena', lighting=True, centered=False)
    arena.cubemap = cubemap
    return arena
{'fraction_non_alphanumeric': 0.07737226277372262, 'fraction_numerical': 0.01897810218978102, 'mean_word_length': 2.7794117647058822, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '335702', 'n_tokens_mistral': 625, 'n_tokens_neox': 560, 'n_words': 169}