<commit_before>Remote Runner
=============
Transfer a local script file to a remote host and execute it.


Requirements
============
- Python 2.7 and Python 3 are supported.
- Paramiko 1.10 or higher.


Install
=======
::

    pip install remrunner


Synopsis
========
::

    from remrunner import runner
    r = runner.Runner(host, username)
    
    rval, stdout, stderr = r.run('/path/to/local/script.py')
    if rval:
        print(stderr)
    else:
        print(stdout)
 
    r.close()
  

Details
=======
Named scripts are copied to a temp location (./.remrunner/[PID]/) on the remote 
host, permissions are set to 0700, and script is then executed.

On cleanup, the [PID] directory and all contents are removed before closing
the connections.


API
===

Class Runner
------------

init(host, user, **kwargs)
  *host* : Required.
  *user* : Optional. Defaults to current running user on local machine.
  
  keyword-args:
  *auto_add* : (Boolean) Defaults to True. Set Paramiko Client.AutoAddPolicy.
  
  
run(script, sudo, timeout, opts)
  Run the named local script on remote host.
  
  *script* : Path to script on local machine
  *sudo* : (Boolean) Defaults to False. When true, the execution command on 
  remote machine will be prefaced with "sudo "
  *timeout* : (seconds, optional) Defaults to 10
  *opts* : optional command-line arguments that will be passed to remote script.
  
*Examples:
- Run remote script with sudo::

    r.run(script, True)
    
- Run remote script and specify a 60 second timeout::

    r.run(script, False, 60)
     
- Run remote script with timeout and optional arguments::

    r.run(script, False, 15, "--verbose --interval=4")


close()      
  Clean up temporary directories on remote host and close SSH and SFTP sessions.
  

Known Issues<commit_msg>readme doc updates<commit_after>Remote Runner
=============
Transfer a local script file to a remote host and execute it.


Requirements
============
- Python 2.7 and Python 3 are supported.
- Paramiko 1.10 or higher.


Install
=======
::

    pip install remrunner


Synopsis
========
::

    from remrunner import runner
    r = runner.Runner(host, username)
    
    rval, stdout, stderr = r.run('/path/to/local/script.py')
    if rval:
        print(stderr)
    else:
        print(stdout)
 
    r.close()
  

Details
=======
Named scripts are copied to a temp location (./.remrunner/[PID]/) on the remote 
host, permissions are set to 0700, and script is then executed.

On cleanup, the [PID] directory and all contents are removed before closing
the connections.


API
===

Class Runner
------------

init(host, user, **kwargs)
  *host* : Required.
  *user* : Optional. Defaults to current running user on local machine.
  
  keyword-args:
  *auto_add* : (Boolean) Defaults to True. Set Paramiko Client.AutoAddPolicy.
  
  
run(script, sudo, timeout, opts)
  Run the named local script on remote host.
  
  *script* : Path to script on local machine
  *sudo* : (Boolean) Defaults to False. When true, the execution command on 
  remote machine will be prefaced with "sudo "
  *timeout* : (seconds, optional) Defaults to 10
  *opts* : optional command-line arguments that will be passed to remote script.
  
*Examples*

- Run remote script with sudo::

    r.run(script, True)
    
- Run remote script and specify a 60 second timeout::

    r.run(script, False, 60)
     
- Run remote script with timeout and optional arguments::

    r.run(script, False, 15, "--verbose --interval=4")


close()      
  Clean up temporary directories on remote host and close SSH and SFTP sessions.
  

Known Issues
{'fraction_non_alphanumeric': 0.11604664075513603, 'fraction_numerical': 0.010549694614103275, 'mean_word_length': 3.07579185520362, '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': '1237765', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1040, 'n_words': 433}