<commit_before># Copyright 2013-2016 <NAME>, MIT license
"""
obspyh5
=======
HDF5 write/read support for obspy
---------------------------------

Welcome!

Writes and reads ObsPy streams to/from HDF5 files.
Stats attributes are preserved if they are numbers, strings,
UTCDateTime objects or numpy arrays.
Its best used as a plugin to obspy.

For some examples have a look at the README.rst_.

.. _README.rst: https://github.com/trichter/obspyh5

"""
import json
from os.path import splitext
from warnings import warn

import numpy as np
from obspy.core import Trace, Stream, UTCDateTime as UTC
from obspy.core.util import AttribDict
try:
    import h5py
except ImportError:
    pass

__version__ = '0.6.0'

_IGNORE = ('endtime', 'sampling_rate', 'npts', '_format')

_INDEXES = {
    'standard': (
        'waveforms/{trc_num:03d}_{id}_'
        '{starttime.datetime:%Y-%m-%dT%H:%M:%S}_{duration:.1f}s'),
    'flat': (
        'waveforms/{id}_'
        '{starttime.datetime:%Y-%m-%dT%H:%M:%S}_{duration:.1f}s'),
    'nested': (
        'waveforms/{network}.{station}/{location}.{channel}/'
        '{starttime.datetime:%Y-%m-%dT%H:%M:%S}_{duration:.1f}s'),
    'xcorr': (
        'waveforms/{network1}.{station1}-{network2}.{station2}/'
        '{location1}.{channel1}-{location2}.{channel2}/'
        '{starttime.datetime:%Y-%m-%dT%H:%M:%S}_{duration:.1f}s')}

_INDEX = _INDEXES['standard']

_NOT_SERIALIZABLE = '<not serializable>'


def _is_utc(utc):
    utc = str(utc)
    return len(utc) == 27 and utc.endswith('Z')


class _FlexibleEncoder(json.JSONEncoder):
    def default(self, obj):<commit_msg>raise version number<commit_after># Copyright 2013-2016 <NAME>, MIT license
"""
obspyh5
=======
HDF5 write/read support for obspy
---------------------------------

Welcome!

Writes and reads ObsPy streams to/from HDF5 files.
Stats attributes are preserved if they are numbers, strings,
UTCDateTime objects or numpy arrays.
Its best used as a plugin to obspy.

For some examples have a look at the README.rst_.

.. _README.rst: https://github.com/trichter/obspyh5

"""
import json
from os.path import splitext
from warnings import warn

import numpy as np
from obspy.core import Trace, Stream, UTCDateTime as UTC
from obspy.core.util import AttribDict
try:
    import h5py
except ImportError:
    pass

__version__ = '0.6.1-dev'

_IGNORE = ('endtime', 'sampling_rate', 'npts', '_format')

_INDEXES = {
    'standard': (
        'waveforms/{trc_num:03d}_{id}_'
        '{starttime.datetime:%Y-%m-%dT%H:%M:%S}_{duration:.1f}s'),
    'flat': (
        'waveforms/{id}_'
        '{starttime.datetime:%Y-%m-%dT%H:%M:%S}_{duration:.1f}s'),
    'nested': (
        'waveforms/{network}.{station}/{location}.{channel}/'
        '{starttime.datetime:%Y-%m-%dT%H:%M:%S}_{duration:.1f}s'),
    'xcorr': (
        'waveforms/{network1}.{station1}-{network2}.{station2}/'
        '{location1}.{channel1}-{location2}.{channel2}/'
        '{starttime.datetime:%Y-%m-%dT%H:%M:%S}_{duration:.1f}s')}

_INDEX = _INDEXES['standard']

_NOT_SERIALIZABLE = '<not serializable>'


def _is_utc(utc):
    utc = str(utc)
    return len(utc) == 27 and utc.endswith('Z')


class _FlexibleEncoder(json.JSONEncoder):
    def default(self, obj):
{'fraction_non_alphanumeric': 0.18495492695057508, 'fraction_numerical': 0.019894311470313956, 'mean_word_length': 3.519662921348315, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '1291223', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1146, 'n_words': 253}