<commit_before># -*- coding: utf-8 -*-
u"""SRW execution template.

:copyright: Copyright (c) 2015 RadiaSoft LLC.  All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkcollections
from pykern import pkinspect
from pykern import pkio
from pykern.pkcollections import PKDict
from pykern.pkdebug import pkdc, pkdexc, pkdlog, pkdp
from sirepo import crystal
from sirepo import simulation_db
from sirepo.template import srw_common
from sirepo.template import template_common
import bnlcrl.pkcli.simulate
import copy
import glob
import math
import numpy as np
import os
import py.path
import pykern.pkjson
import re
import sirepo.sim_data
import sirepo.template.srw_fixup
import sirepo.uri_router
import srwl_uti_cryst
import srwl_uti_smp
import srwl_uti_src
import srwlib
import time
import traceback
import uti_math
import uti_plot_com
import werkzeug
import zipfile

_SIM_DATA, SIM_TYPE, _SCHEMA = sirepo.sim_data.template_globals()

WANT_BROWSER_FRAME_CACHE = False

PARSED_DATA_ATTR = 'srwParsedData'

_BRILLIANCE_OUTPUT_FILE = 'res_brilliance.dat'

_MIRROR_OUTPUT_FILE = 'res_mirror.dat'

_DATA_FILE_FOR_MODEL = pkcollections.Dict({
    'coherenceXAnimation': {'filename': 'res_int_pr_me_dcx.dat', 'dimension': 3},
    'coherenceYAnimation': {'filename': 'res_int_pr_me_dcy.dat', 'dimension': 3},
    'fluxAnimation': {'filename': 'res_spec_me.dat', 'dimension': 2},
    'fluxReport': {'filename': 'res_spec_me.dat', 'dimension': 2},
    'initialIntensityReport': {'filename': 'res_int_se.dat', 'dimension': 3},
    'intensityReport': {'filename': 'res_spec_se.dat', 'dimension': 2},
    'mirrorReport': {'filename': _MIRROR_OUTPUT_FILE, 'dimension': 3},
    'multiElectronAnimation': {'filename': 'res_int_pr_me.dat', 'dimension': 3},
    'powerDensityReport': {'filename': 'res_pow.dat', 'dimension': 3},
    'sourceIntensityReport': {'filename': 'res_int_se.dat', 'dimension': 3},
    'brillianceReport': {'filename': _BRILLIANCE_OUTPUT_FILE, 'dimension': 2},
    'trajectoryReport': {'filename': 'res_trj.dat', 'dimension': 2},
    _SIM_DATA.WATCHPOINT_REPORT: {'filename': 'res_int_pr_se.dat', 'dimension': 3},
})

_LOG_DIR = '__srwl_logs__'

_TABULATED_UNDULATOR_DATA_DIR = 'tabulatedUndulator'

_USER_MODEL_LIST_FILENAME = pkcollections.Dict({
    'electronBeam': '_user_beam_list.json',
    'tabulatedUndulator': '_user_undulator_list.json',
})

_IMPORT_PYTHON_POLLS = 15

class MagnMeasZip:
    def __init__(self, archive_name):
        """The class for convenient operation with an archive with the magnetic measurements.

        Args:
            archive_name: the name of the archive.
        """
        self.z = zipfile.ZipFile(archive_name)
        self.index_dir = None
        self.index_file = None
        self.gaps = None
        self.dat_files = None<commit_msg>make it 60 seconds<commit_after># -*- coding: utf-8 -*-
u"""SRW execution template.

:copyright: Copyright (c) 2015 RadiaSoft LLC.  All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkcollections
from pykern import pkinspect
from pykern import pkio
from pykern.pkcollections import PKDict
from pykern.pkdebug import pkdc, pkdexc, pkdlog, pkdp
from sirepo import crystal
from sirepo import simulation_db
from sirepo.template import srw_common
from sirepo.template import template_common
import bnlcrl.pkcli.simulate
import copy
import glob
import math
import numpy as np
import os
import py.path
import pykern.pkjson
import re
import sirepo.sim_data
import sirepo.template.srw_fixup
import sirepo.uri_router
import srwl_uti_cryst
import srwl_uti_smp
import srwl_uti_src
import srwlib
import time
import traceback
import uti_math
import uti_plot_com
import werkzeug
import zipfile

_SIM_DATA, SIM_TYPE, _SCHEMA = sirepo.sim_data.template_globals()

WANT_BROWSER_FRAME_CACHE = False

PARSED_DATA_ATTR = 'srwParsedData'

_BRILLIANCE_OUTPUT_FILE = 'res_brilliance.dat'

_MIRROR_OUTPUT_FILE = 'res_mirror.dat'

_DATA_FILE_FOR_MODEL = pkcollections.Dict({
    'coherenceXAnimation': {'filename': 'res_int_pr_me_dcx.dat', 'dimension': 3},
    'coherenceYAnimation': {'filename': 'res_int_pr_me_dcy.dat', 'dimension': 3},
    'fluxAnimation': {'filename': 'res_spec_me.dat', 'dimension': 2},
    'fluxReport': {'filename': 'res_spec_me.dat', 'dimension': 2},
    'initialIntensityReport': {'filename': 'res_int_se.dat', 'dimension': 3},
    'intensityReport': {'filename': 'res_spec_se.dat', 'dimension': 2},
    'mirrorReport': {'filename': _MIRROR_OUTPUT_FILE, 'dimension': 3},
    'multiElectronAnimation': {'filename': 'res_int_pr_me.dat', 'dimension': 3},
    'powerDensityReport': {'filename': 'res_pow.dat', 'dimension': 3},
    'sourceIntensityReport': {'filename': 'res_int_se.dat', 'dimension': 3},
    'brillianceReport': {'filename': _BRILLIANCE_OUTPUT_FILE, 'dimension': 2},
    'trajectoryReport': {'filename': 'res_trj.dat', 'dimension': 2},
    _SIM_DATA.WATCHPOINT_REPORT: {'filename': 'res_int_pr_se.dat', 'dimension': 3},
})

_LOG_DIR = '__srwl_logs__'

_TABULATED_UNDULATOR_DATA_DIR = 'tabulatedUndulator'

_USER_MODEL_LIST_FILENAME = pkcollections.Dict({
    'electronBeam': '_user_beam_list.json',
    'tabulatedUndulator': '_user_undulator_list.json',
})

_IMPORT_PYTHON_POLLS = 60

class MagnMeasZip:
    def __init__(self, archive_name):
        """The class for convenient operation with an archive with the magnetic measurements.

        Args:
            archive_name: the name of the archive.
        """
        self.z = zipfile.ZipFile(archive_name)
        self.index_dir = None
        self.index_file = None
        self.gaps = None
        self.dat_files = None
{'fraction_non_alphanumeric': 0.11541774332472007, 'fraction_numerical': 0.007924203273040482, 'mean_word_length': 5.2296137339055795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5411742', 'n_tokens_mistral': 2086, 'n_tokens_neox': 1993, 'n_words': 468}