<commit_before>#!/usr/bin/env python
import argparse
from bioblend import galaxy

def main():
    """
        This script uses bioblend to import .ga workflow files into a running instance of Galaxy
    """
    parser = argparse.ArgumentParser()
    parser.add_argument("-w", "--workflow_path", help='Path to workflow file')
    parser.add_argument("-g", "--galaxy",
                        dest="galaxy_url",
                        help="Target Galaxy instance URL/IP address (required "
                             "if not defined in the tools list file)",)
    parser.add_argument("-a", "--apikey",
                        dest="api_key",
                        help="Galaxy admin user API key (required if not "
                             "defined in the tools list file)",)
    args = parser.parse_args()
    gi = galaxy.GalaxyInstance(url=args.galaxy_url, key=args.api_key)
    gi.workflows.import_workflow_from_local_path(args.workflow_path)

if __name__ == '__main__':
    main()<commit_msg>Adds UUID checking to avoid duplicate installs<commit_after>#!/usr/bin/env python
import argparse
from bioblend import galaxy
import json
import os

def main():
    """
        This script uses bioblend to import .ga workflow files into a running instance of Galaxy
    """
    parser = argparse.ArgumentParser()
    parser.add_argument('workflow_path', help='The path to the workflow file')
    args = parser.parse_args()
    
    import_uuid = json.load(open(args.workflow_path, 'r'))['uuid']
    gi = galaxy.GalaxyInstance(url='http://127.0.0.1:8080', email='<EMAIL>', password='<PASSWORD>')
    existing_uuids = [d['latest_workflow_uuid'] for d in gi.workflows.get_workflows()]
    if import_uuid not in existing_uuids:
        gi.workflows.import_workflow_from_local_path(args.workflow_path)

if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.11419249592169657, 'fraction_numerical': 0.005437737901033171, 'mean_word_length': 2.890063424947146, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6782463', 'n_tokens_mistral': 559, 'n_tokens_neox': 541, 'n_words': 145}