<commit_before>import numpy as np
import fitsio
import os
from astrometry.util.ttime import Time

import logging
logger = logging.getLogger('legacypipe.outliers')
def info(*args):
    from legacypipe.utils import log_info
    log_info(logger, args)
def debug(*args):
    from legacypipe.utils import log_debug
    log_debug(logger, args)


OUTLIER_POS = 1
OUTLIER_NEG = 2

def read_outlier_mask_file(survey, tims, brickname):
    from legacypipe.image import CP_DQ_BITS
    fn = survey.find_file('outliers_mask', brick=brickname, output=True)
    if not os.path.exists(fn):
        return False
    F = fitsio.FITS(fn)
    for tim in tims:
        extname = '%s-%s-%s' % (tim.imobj.camera, tim.imobj.expnum, tim.imobj.ccdname)
        if not extname in F:
            print('WARNING: Did not find extension', extname, 'in outlier-mask file', fn)<commit_msg>remove unneeded import<commit_after>import numpy as np
import fitsio
import os

import logging
logger = logging.getLogger('legacypipe.outliers')
def info(*args):
    from legacypipe.utils import log_info
    log_info(logger, args)
def debug(*args):
    from legacypipe.utils import log_debug
    log_debug(logger, args)


OUTLIER_POS = 1
OUTLIER_NEG = 2

def read_outlier_mask_file(survey, tims, brickname):
    from legacypipe.image import CP_DQ_BITS
    fn = survey.find_file('outliers_mask', brick=brickname, output=True)
    if not os.path.exists(fn):
        return False
    F = fitsio.FITS(fn)
    for tim in tims:
        extname = '%s-%s-%s' % (tim.imobj.camera, tim.imobj.expnum, tim.imobj.ccdname)
        if not extname in F:
            print('WARNING: Did not find extension', extname, 'in outlier-mask file', fn)
{'fraction_non_alphanumeric': 0.1021377672209026, 'fraction_numerical': 0.0023752969121140144, 'mean_word_length': 3.6935933147632314, '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': '87871', 'n_tokens_mistral': 599, 'n_tokens_neox': 566, 'n_words': 155}