<commit_before>#!/usr/bin/env python

from nodes import Node
import datetime
import time

class Time(Node):
    char = "C"
    args = 0
    results = 0
    default_arg = 0
    datetime_attrs = ["second",
                      "minute",
                      "hour",
                      "day",
                      "month",
                      "year",
                      "2dyear"]
    date_attrs = ["weekday"]

    months = ["PADDING",
              "January",
              "February",
              "March",
              "April",
              "May",
              "June",
              "July",
              "August",
              "September",
              "October",
              "November",
              "December"]
    
    contents = ["Monday",
                "Tuesday",
                "Wednesday",
                "Thursday",
                "Friday",
                "Saturday",
                "Sunday"]
    
    def __init__(self, methods: Node.NumericLiteral):
        self.methods = [int(i)for i in str(methods)]
        self.results = len(self.methods)
        
    
    def func(self):
        date_time = datetime.datetime.now()
        rtn = []
        for meth in self.methods:
            added = False
            if meth == 0:
                added = True
                print(time.time())
                rtn.append(time.time())
            meth -= 1
            if not added and meth < len(self.date_attrs):
                added = True
                rtn.append(getattr(date_time.date(), self.date_attrs[meth])())
            meth -= len(self.date_attrs)
            if not added and meth < len(self.datetime_attrs):
                added = True
                if self.datetime_attrs[meth] == "2dyear":
                    rtn.append(date_time.year%100)
                else:
                    rtn.append(getattr(date_time, self.datetime_attrs[meth]))
            
            if not added:
                rtn.append(self.months)
        return rtn<commit_msg>Update clock - default to return milliseconds past epoch Add isocalender output to clock<commit_after>#!/usr/bin/env python

from nodes import Node
import datetime
import time

class Time(Node):
    char = "C"
    args = 0
    results = 0
    default_arg = -1
    datetime_attrs = ["second",
                      "minute",
                      "hour",
                      "day",
                      "month",
                      "year",
                      "2dyear"]
    date_attrs = ["weekday",
                  "isocalendar"]

    months = ["PADDING",
              "January",
              "February",
              "March",
              "April",
              "May",
              "June",
              "July",
              "August",
              "September",
              "October",
              "November",
              "December"]
    
    contents = ["Monday",
                "Tuesday",
                "Wednesday",
                "Thursday",
                "Friday",
                "Saturday",
                "Sunday"]
    
    def __init__(self, methods: Node.NumericLiteral):
        if methods == -1:
            self.func = lambda: time.time()
            self.results = 1
        else:
            self.methods = [int(i)for i in str(methods)]
            self.results = len(self.methods)
        
    
    def func(self):
        date_time = datetime.datetime.now()
        rtn = []
        for meth in self.methods:
            added = False
            if not added and meth < len(self.date_attrs):
                added = True
                rtn.append(getattr(date_time.date(), self.date_attrs[meth])())
            meth -= len(self.date_attrs)
            if not added and meth < len(self.datetime_attrs):
                added = True
                if self.datetime_attrs[meth] == "2dyear":
                    rtn.append(date_time.year%100)
                else:
                    rtn.append(getattr(date_time, self.datetime_attrs[meth]))
            
            if not added:
                rtn.append(self.months)
        return rtn
{'fraction_non_alphanumeric': 0.10695056289769946, 'fraction_numerical': 0.004894762604013705, 'mean_word_length': 1.1209133367929425, 'pattern_counts': {'":': 2, '<': 7, '<?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': '3655465', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1030, 'n_words': 244}