# Path: gwsumm/html/static.py
# def get_css():
#     """Return a `dict` of CSS files to link in the HTML <head>
#     """
#     return CSS
# 
# def get_js():
#     """Return a `dict` of javascript files to link in the HTML <head>
#     """
#     return JS
# 
# Path: gwsumm/utils.py
# WARNC = r'\033[93m'
# ERRC = r'\033[91m'
# ENDC = r'\033[0m'
# UNSAFE_EVAL_STRS = [r'os\.(?![$\'\" ])', 'shutil', r'\.rm', r'\.mv']
# UNSAFE_EVAL = re.compile(r'(%s)' % '|'.join(UNSAFE_EVAL_STRS))
# OBSERVATORY_MAP = {
#     'G1': 'GEO',
#     'H1': 'LIGO Hanford',
#     'K1': 'KAGRA',
#     'L1': 'LIGO Livingston',
#     'V1': 'Virgo',
# }
# def elapsed_time():
# def vprint(message, verbose=True, stream=sys.stdout, profile=True):
# def mkdir(*paths):
# def nat_sorted(iterable, key=None):
#     def convert(text):
#     def alphanum_key(key):
# def get_odc_bitmask(odcchannel):
# def safe_eval(val, strict=False, globals_=None, locals_=None):
# def get_default_ifo(fqdn=getfqdn()):


import configparser
import os
import re
import sys
import math  # noqa: F401
import numpy  # noqa: F401
from collections import OrderedDict
from importlib import import_module
from io import StringIO
from http.client import HTTPException
from matplotlib import rcParams
from astropy import units
from gwpy.detector import (Channel, ChannelList)
from gwpy.time import tconvert
from .channels import (get_channels, split as split_channels,
                       update_channel_params)
from .html import (get_css, get_js)
from .utils import (nat_sorted, re_cchar, re_quote, safe_eval, OBSERVATORY_MAP)
            from lal import GPSLeapSeconds as leap_seconds
        from .state import (register_state, SummaryState,
                            ALLSTATE, generate_all_state, get_state)
                continue
            else:
                if not m['ifo']:
                    continue
            if m['trend']:
                trend.add(section)
            else:
                raw.add(section)

        channels = ChannelList()
        for group in [raw, trend]:
            try:
                newchannels = get_channels(group)
            except HTTPException:
                newchannels = []

            # read custom channel definitions
            for channel, section in zip(newchannels, group):
                for key, val in nat_sorted(self.nditems(section),
                                           key=lambda x: x[0]):
                    key = re_cchar.sub('_', key.rstrip())
                    if key.isdigit():
                        if not hasattr(channel, 'bits'):
                            channel.bits = []
                        while len(channel.bits) < int(key):
                            channel.bits.append(None)
                        if val.startswith('r"') or val.startswith('r\''):
                            val = eval(val)
                        channel.bits.append(str(val))
                    else:

# Path: gwsumm/html/static.py
# def get_css():
#     """Return a `dict` of CSS files to link in the HTML <head>
#     """
#     return CSS
# 
# def get_js():
#     """Return a `dict` of javascript files to link in the HTML <head>
#     """
#     return JS
# 
# Path: gwsumm/utils.py
# WARNC = r'\033[93m'
# ERRC = r'\033[91m'
# ENDC = r'\033[0m'
# UNSAFE_EVAL_STRS = [r'os\.(?![$\'\" ])', 'shutil', r'\.rm', r'\.mv']
# UNSAFE_EVAL = re.compile(r'(%s)' % '|'.join(UNSAFE_EVAL_STRS))
# OBSERVATORY_MAP = {
#     'G1': 'GEO',
#     'H1': 'LIGO Hanford',
#     'K1': 'KAGRA',
#     'L1': 'LIGO Livingston',
#     'V1': 'Virgo',
# }
# def elapsed_time():
# def vprint(message, verbose=True, stream=sys.stdout, profile=True):
# def mkdir(*paths):
# def nat_sorted(iterable, key=None):
#     def convert(text):
#     def alphanum_key(key):
# def get_odc_bitmask(odcchannel):
# def safe_eval(val, strict=False, globals_=None, locals_=None):
# def get_default_ifo(fqdn=getfqdn()):


# Path: gwsumm/config.py
import configparser
import os
import re
import sys
import math  # noqa: F401
import numpy  # noqa: F401
from collections import OrderedDict
from importlib import import_module
from io import StringIO
from http.client import HTTPException
from matplotlib import rcParams
from astropy import units
from gwpy.detector import (Channel, ChannelList)
from gwpy.time import tconvert
from .channels import (get_channels, split as split_channels,
                       update_channel_params)
from .html import (get_css, get_js)
from .utils import (nat_sorted, re_cchar, re_quote, safe_eval, OBSERVATORY_MAP)
            from lal import GPSLeapSeconds as leap_seconds
        from .state import (register_state, SummaryState,
                            ALLSTATE, generate_all_state, get_state)

                continue
            else:
                if not m['ifo']:
                    continue
            if m['trend']:
                trend.add(section)
            else:
                raw.add(section)

        channels = ChannelList()
        for group in [raw, trend]:
            try:
                newchannels = get_channels(group)
            except HTTPException:
                newchannels = []

            # read custom channel definitions
            for channel, section in zip(newchannels, group):
                for key, val in nat_sorted(self.nditems(section),
                                           key=lambda x: x[0]):
                    key = re_cchar.sub('_', key.rstrip())
                    if key.isdigit():
                        if not hasattr(channel, 'bits'):
                            channel.bits = []
                        while len(channel.bits) < int(key):
                            channel.bits.append(None)
                        if val.startswith('r"') or val.startswith('r\''):
                            val = eval(val)
                        channel.bits.append(str(val))
                    else:

                        setattr(channel, key, safe_eval(val.rstrip()))