<commit_before>import numpy as np
from ..custom_feature_tools import *

@myFeature(requires=["t","m"], provides=['period','avg_mag'])
def test_feature(t,m):
    print("test_feature executing.")
    return {'avg_mag': np.average(m), 'period':0}


@myFeature(requires=["t","m","e","period"], provides=['a','b','c'])
def test_feature2(t,m,e,period):
    print("test_feature2 executing.")
    return {'a': 0, 'b':0, 'c':0}


@myFeature(requires=["period","c"], provides=['d','w','f'])
def test_feature3(period,c):
    print("test_feature3 executing.")
    return {'d': 0, 'w':0, 'f':0}


@myFeature(requires=["t","m","e"], provides=['g','h','i'])
def test_feature4(t,m,e):
    print("test_feature4 executing.")
    return {'g': 0, 'h':0, 'i':0}


@myFeature(requires=["f"], provides=['j','k','l'])
def test_feature5(f):
    print("test_feature5 executing.")
    return {'j': 0, 'k':0, 'l':0}


@myFeature(requires=["e"], provides=['q','n','o'])
def test_feature6(e):
    print("test_feature6 executing.")
    return {'q': 0, 'n':0, 'o':0}


if __name__=="__main__":
    #from . import lc_tools
    #tmestr = lc_tools.dotAstro_to_csv(215156)
    #all_lines = tmestr[0].strip().split("\n")
    #t,m,e=[[],[],[]]
    #for line in all_lines:
    #    ti,mi,ei = line.split(",")
    #    t.append(float(ti)); m.append(float(mi)); e.append(float(ei))
    #print(feature(t=t,m=m,e=e))
    print("testfeature1.py called.")
<commit_msg>Fix import errors and clean up<commit_after>import numpy as np
try:
    from ..custom_feature_tools import *
except:
    import sys
    import os
    sys.path.append(os.path.dirname(__file__))
    sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
    from mltsp.custom_feature_tools import *

@myFeature(requires=["t","m"], provides=['period','avg_mag'])
def test_feature(t,m):
    print("test_feature executing.")
    return {'avg_mag': np.average(m), 'period':0}


@myFeature(requires=["t","m","e","period"], provides=['a','b','c'])
def test_feature2(t,m,e,period):
    print("test_feature2 executing.")
    return {'a': 0, 'b':0, 'c':0}


@myFeature(requires=["period","c"], provides=['d','w','f'])
def test_feature3(period,c):
    print("test_feature3 executing.")
    return {'d': 0, 'w':0, 'f':0}


@myFeature(requires=["t","m","e"], provides=['g','h','i'])
def test_feature4(t,m,e):
    print("test_feature4 executing.")
    return {'g': 0, 'h':0, 'i':0}


@myFeature(requires=["f"], provides=['j','k','l'])
def test_feature5(f):
    print("test_feature5 executing.")
    return {'j': 0, 'k':0, 'l':0}


@myFeature(requires=["e"], provides=['q','n','o'])
def test_feature6(e):
    print("test_feature6 executing.")
    return {'q': 0, 'n':0, 'o':0}


if __name__ == "__main__":
    print("testfeature1.py called.")

{'fraction_non_alphanumeric': 0.24386724386724387, 'fraction_numerical': 0.022005772005772004, 'mean_word_length': 5.389400921658986, 'pattern_counts': {'":': 2, '<': 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': '2341106', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1050, 'n_words': 187}