<commit_before>#!/bin/env python
#
# glidein_gdb.py
#
# Description:
#   Execute a ls command on a condor job working directory
#
# Usage:
#  glidein_gdb.py <cluster>.<process> <pid> [<command>] [-name <schedd_name>] [-pool <pool_name> ] [-timeout <nr secs>]
#
# Supported gdb commands:
#  watch (default)
#
# Author:
#   <NAME> (June 2007)
#
# License:
#  Fermitools
#

import sys,os.path
sys.path.append(os.path.join(sys.path[0],"lib"))
sys.path.append(os.path.join(sys.path[0],"../lib"))

import glideinCmd

def argv_gdb(argv):
    if len(argv)==0:
        raise RuntimeError, "Missing PID"
    pid=argv[0]
    
    # parse args to get the command
    gdb_cmd="watch"
    if len(argv)>1:
        if argv[1]=="watch":
            gdb_cmd="watch"
        else:
            raise RuntimeError, "Unexpected command %s found!\nOnly watch supported."%argv[1]

    # select the lines
    gdbcommand="gdb.command"

    script_lines=[]
    script_lines.append('cat > %s <<EOF'%gdbcommand)
    script_lines.append('set height 0')
    script_lines.append(gdb_cmd)
    script_lines.append('quit')
    script_lines.append('EOF')
    script_lines.append('gdb -command %s'%Gdbcommand) 
    script_lines.append('res=$?')
    script_lines.append('rm -f %s'%gdbcommand)
    script_lines.append('exit $res')

    return script_lines


glideinCmd.exe_cmd_script(argv_gdb)<commit_msg>Fix typo<commit_after>#!/bin/env python
#
# glidein_gdb.py
#
# Description:
#   Execute a ls command on a condor job working directory
#
# Usage:
#  glidein_gdb.py <cluster>.<process> <pid> [<command>] [-name <schedd_name>] [-pool <pool_name> ] [-timeout <nr secs>]
#
# Supported gdb commands:
#  watch (default)
#
# Author:
#   <NAME> (June 2007)
#
# License:
#  Fermitools
#

import sys,os.path
sys.path.append(os.path.join(sys.path[0],"lib"))
sys.path.append(os.path.join(sys.path[0],"../lib"))

import glideinCmd

def argv_gdb(argv):
    if len(argv)==0:
        raise RuntimeError, "Missing PID"
    pid=argv[0]
    
    # parse args to get the command
    gdb_cmd="watch"
    if len(argv)>1:
        if argv[1]=="watch":
            gdb_cmd="watch"
        else:
            raise RuntimeError, "Unexpected command %s found!\nOnly watch supported."%argv[1]

    # select the lines
    gdbcommand="gdb.command"

    script_lines=[]
    script_lines.append('cat > %s <<EOF'%gdbcommand)
    script_lines.append('set height 0')
    script_lines.append(gdb_cmd)
    script_lines.append('quit')
    script_lines.append('EOF')
    script_lines.append('gdb -command %s'%gdbcommand) 
    script_lines.append('res=$?')
    script_lines.append('rm -f %s'%gdbcommand)
    script_lines.append('exit $res')

    return script_lines


glideinCmd.exe_cmd_script(argv_gdb)
{'fraction_non_alphanumeric': 0.1532819948661533, 'fraction_numerical': 0.0088008800880088, 'mean_word_length': 3.5618729096989967, 'pattern_counts': {'":': 2, '<': 23, '<?xml version=': 0, '>': 23, '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': '6471448', 'n_tokens_mistral': 1039, 'n_tokens_neox': 995, 'n_words': 198}