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

"""
galaxy-fuse.py will mount Galaxy datasets for direct read access using FUSE.

To do this you will need your Galaxy API key, found by logging into Galaxy and
selecting the menu option User -> API Keys. You can mount your Galaxy datasets
using a command like

    python galaxy-fuse.py <api-key> &

This puts the galaxy-fuse process into the background. Galaxy Datasets will then
appear as read-only files, organised by History, under the directory galaxy_files.

galaxy-fuse was written by Dr <NAME> and began life at
https://github.com/drpowell/galaxy-fuse .

Modified December 2016 by <NAME>.
"""

from errno import ENOENT
from stat import S_IFDIR, S_IFREG, S_IFLNK
from sys import argv, exit
import re
import time
import os
import argparse

from fuse import FUSE, FuseOSError, Operations, LoggingMixIn, fuse_get_context

from bioblend import galaxy

# number of seconds to cache history/dataset lookups
CACHE_TIME = 3

# Split a path into hash of components
def path_type(path):
    parts = filter(lambda x: len(x)>0, path.split('/'))
    if path=='/':
        return ('root',dict())
    elif path=='/histories':
        return ('histories',dict())
    elif len(parts)==2 and parts[0]=='histories':
        return ('datasets',dict(h_name=unesc_filename(parts[1])))
    elif len(parts)==3 and parts[0]=='histories':
        # Path: histories/<history_name>/<data_name><commit_msg>Increased cache time to try and improve performance.<commit_after>#!/usr/bin/env python

"""
galaxy-fuse.py will mount Galaxy datasets for direct read access using FUSE.

To do this you will need your Galaxy API key, found by logging into Galaxy and
selecting the menu option User -> API Keys. You can mount your Galaxy datasets
using a command like

    python galaxy-fuse.py <api-key> &

This puts the galaxy-fuse process into the background. Galaxy Datasets will then
appear as read-only files, organised by History, under the directory galaxy_files.

galaxy-fuse was written by Dr <NAME> and began life at
https://github.com/drpowell/galaxy-fuse .

Modified December 2016 by <NAME>.
"""

from errno import ENOENT
from stat import S_IFDIR, S_IFREG, S_IFLNK
from sys import argv, exit
import re
import time
import os
import argparse

from fuse import FUSE, FuseOSError, Operations, LoggingMixIn, fuse_get_context

from bioblend import galaxy

# number of seconds to cache history/dataset lookups
CACHE_TIME = 30

# Split a path into hash of components
def path_type(path):
    parts = filter(lambda x: len(x)>0, path.split('/'))
    if path=='/':
        return ('root',dict())
    elif path=='/histories':
        return ('histories',dict())
    elif len(parts)==2 and parts[0]=='histories':
        return ('datasets',dict(h_name=unesc_filename(parts[1])))
    elif len(parts)==3 and parts[0]=='histories':
        # Path: histories/<history_name>/<data_name>
{'fraction_non_alphanumeric': 0.09944559944559944, 'fraction_numerical': 0.00796950796950797, 'mean_word_length': 4.2018018018018015, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 2, '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': '3103035', 'n_tokens_mistral': 906, 'n_tokens_neox': 861, 'n_words': 338}