<commit_before># ===============================================================================
# Copyright 2015 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===============================================================================

# ============= enthought library imports =======================
from __future__ import absolute_import

from traits.api import HasTraits, List, Bool, Any, Set, Str, Dict


def get_detector_set(ans):
    return {iso.detector for ai in ans for iso in ai.itervalues()}
    # return {iso.detector for ai in ans if ai.isotopes for iso in six.itervalues(ai.isotopes)}


def get_isotope_set(ans):
    return {iso.name for ai in ans for iso in ai.itervalues()}


class EngineState(HasTraits):
    unknowns = List
    references = List
    flux_monitors = List
    unknown_positions = List
    decay_constants = Dict

    tables = List
    editors = List
    append_references = Bool
    # has_references = Bool
    has_flux_monitors = Bool
    saveable_keys = List
    saveable_fits = List
    saveable_irradiation_positions = List
    # user_review = Bool
    veto = Any
    canceled = Bool
    run_groups = Dict
    # udetectors = Property(depends_on='unknowns[]')
    # rdetectors = Property(depends_on='references[]')
    # union_detectors = Property(depends_on='udetectors, rdetectors')
    iso_evo_results = List

    modified_projects = Set
    modified = False
    dbmodified = False

    geometry = List
    level = Str
    irradiation = Str

    report_path = None

    mdd_workspace = None
    # @cached_property
    # def _get_udetectors(self):
    #     return get_detector_set(self.unknowns)
    #
    # @cached_property
    # def _get_rdetectors(self):
    #     return get_detector_set(self.references)
    #
    # @cached_property
    # def _get_union_detectors(self):
    #     x = set(self.udetectors).union(self.rdetectors)
    #     return sort_isotopes(x)

# ============= EOF =============================================<commit_msg>fixed csv export for multihop data<commit_after># ===============================================================================
# Copyright 2015 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===============================================================================

# ============= enthought library imports =======================
from __future__ import absolute_import

from traits.api import HasTraits, List, Bool, Any, Set, Str, Dict


def get_detector_set(ans):
    return {iso.detector for ai in ans for iso in ai.itervalues()}


def get_isotope_set(ans):
    return {k for ai in ans for k in ai.isotope_keys}


class EngineState(HasTraits):
    unknowns = List
    references = List
    flux_monitors = List
    unknown_positions = List
    decay_constants = Dict

    tables = List
    editors = List
    append_references = Bool
    has_flux_monitors = Bool
    saveable_keys = List
    saveable_fits = List
    saveable_irradiation_positions = List
    veto = Any
    canceled = Bool
    run_groups = Dict

    iso_evo_results = List

    modified_projects = Set
    modified = False
    dbmodified = False

    geometry = List
    level = Str
    irradiation = Str

    report_path = None

    mdd_workspace = None


# ============= EOF =============================================
{'fraction_non_alphanumeric': 0.1803812180381218, 'fraction_numerical': 0.003719200371920037, 'mean_word_length': 3.9121004566210047, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1748767', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1167, 'n_words': 393}