<commit_before>"""
 -----------------------------------------------
 Some simple python code to be easily imported from python
 -----------------------------------------------
 """
import pynbody
SimArray = pynbody.array.SimArray

import copy
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate as interp
import warnings
import glob
import os
import datetime

self_dir = os.path.dirname(os.path.realpath(__file__))
print os.path.realpath(__file__)


def walltime(filename):
    """
    Reads walltime information from a ChaNGa .log file.
    
    ** ARGUMENTS **
    
    filename : str
        Filename of the .log file to load
        
    ** RETURNS **
    
    wall_per_step : array
        Wall time per step in seconds
    """
    
    log_file = np.genfromtxt(filename, comments='#', delimiter=' ')<commit_msg>Added function findfiles to recursively find files<commit_after>"""
 -----------------------------------------------
 Some simple python code to be easily imported from python
 -----------------------------------------------
 """
import pynbody
SimArray = pynbody.array.SimArray

import copy
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate as interp
import warnings
import glob
import os
import datetime
import fnmatch

self_dir = os.path.dirname(os.path.realpath(__file__))
print os.path.realpath(__file__)

def findfiles(filefilter='*', basedir='.'):
    """
    Recursively find files according to filefilter
    
    ** ARGUMENTS **
    
    filefilter : str
        Filter for finding files.  ie, '*.jpg' or 'file.txt'
    
    basedir : str
        Base directory to search.  Default is the current directory
        
    ** RETURNS **
    
    files : list
        A list of the full path to all files matching filefilter
    
    """
    
    matches = []
    
    for root, dirnames, filenames in os.walk(basedir):
        
        for filename in fnmatch.filter(filenames, filefilter):
            fname = os.path.join(root, filename)
            fname = os.path.realpath(fname)
            
            matches.append(fname)
            
    return matches


def walltime(filename):
    """
    Reads walltime information from a ChaNGa .log file.
    
    ** ARGUMENTS **
    
    filename : str
        Filename of the .log file to load
        
    ** RETURNS **
    
    wall_per_step : array
        Wall time per step in seconds
    """
    
    log_file = np.genfromtxt(filename, comments='#', delimiter=' ')
{'fraction_non_alphanumeric': 0.14980237154150197, 'fraction_numerical': 0.0, 'mean_word_length': 1.9464493597206054, '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': '4371388', 'n_tokens_mistral': 701, 'n_tokens_neox': 698, 'n_words': 225}