<commit_before>#!/usr/bin/python
import sys
import os

commandLineArguments = sys.argv

# Checks whether the library is being run within the SciServer-Compute environment. Returns True if the library is being run within the SciServer-Compute environment, and False if not.
def isSciServerComputeEnvironment():
    """
    Checks whether the library is being run within the SciServer-Compute environment. Returns True if the library is being run within the SciServer-Compute environment, and False if not.
    """
    if os.path.isfile("/home/idies/keystone.token"):
        return True
    else:
        return False



os.system('printf "\n---1) Updating local Git repository...\n\n"')
os.system("git tag -d $(git tag)") #deletes local tags
os.system("git fetch --all") #fetches all remotes into local repo, including tags.
os.system("git checkout master")
os.system("git reset --hard origin/master") #resets the local master branch to what was just fetched.
os.system("git clean -df") #removes all untracked files

os.system("cp Install.py ../") #copies the install file one level up, so that if the commit checked out in step 2) does not have it, then we can copy it back in there.


if len(commandLineArguments) <= 1:
    os.system('printf "\n---2) Checking out latest SciScript code from local master branch...\n\n"')
    os.system("git checkout master")
else:
    sciserverTag = commandLineArguments[1]
    os.system('printf "\n---2) Checking out latest SciScript code tagged as \"" + sciserverTag + "\"...\n\n"')
    os.system("git checkout tags/" + sciserverTag)

os.system("mv ../Install.py ./") #copies the install file one level up, so that if the commit checked out in step 2) does not have it, then we can copy it back in there.

os.chdir("./py2")

os.system('printf "\n---3) Building the SciServer package for Python 2...\n\n"')

if isSciServerComputeEnvironment():
  os.system("source activate py27 ; python setup.py install ; source activate root") # activating python = python2 in anaconda, and then changing back to the anaconda default of python = python3
else:
  os.system("python2 setup.py install")

os.chdir("../py3")

os.system('printf "\n---4) Building the SciServer package for Python 3...\n\n"')

if isSciServerComputeEnvironment():
  os.system("python setup.py install")# In anaconda, the default is python = python3
else:
  os.system("python3 setup.py install")


<commit_msg>Updated Install script<commit_after>#!/usr/bin/python
import sys
import os

commandLineArguments = sys.argv

# Checks whether the library is being run within the SciServer-Compute environment. Returns True if the library is being run within the SciServer-Compute environment, and False if not.
def isSciServerComputeEnvironment():
    """
    Checks whether the library is being run within the SciServer-Compute environment. Returns True if the library is being run within the SciServer-Compute environment, and False if not.
    """
    if os.path.isfile("/home/idies/keystone.token"):
        return True
    else:
        return False



os.system('printf "\n---1) Updating local Git repository...\n\n"')
os.system("git tag -d $(git tag)") #deletes local tags
os.system("git fetch --all") #fetches all remotes into local repo, including tags.
os.system("git checkout master")
os.system("git reset --hard origin/master") #resets the local master branch to what was just fetched.
os.system("git clean -df") #removes all untracked files

os.system("cp -f Install.py ../Install_IntermediateCopy5551234.py") #copies the install file one level up, so that if the commit checked out in step 2) does not have it, then we can copy it back in there.

if len(commandLineArguments) <= 1:
    os.system('printf "\n---2) Checking out latest SciScript code from local master branch...\n\n"')
    os.system("git checkout master")
else:
    sciserverTag = commandLineArguments[1]
    os.system('printf "\n---2) Checking out latest SciScript code tagged as \"" + sciserverTag + "\"...\n\n"')
    os.system("git checkout tags/" + sciserverTag)


hasInstallFile = os.popen("ls Install.py").read().split("\n")
if len(hasInstallFile) > 0: 
  os.system("rm -f ../Install_IntermediateCopy5551234.py") #removes the copy of the install file one level up
else
  os.system("mv -f ../Install_IntermediateCopy5551234.py ./Install.py") #copies the install file back from one level up.

os.chdir("./py2")

os.system('printf "\n---3) Building the SciServer package for Python 2...\n\n"')

if isSciServerComputeEnvironment():
  os.system("source activate py27 ; python setup.py install ; source activate root") # activating python = python2 in anaconda, and then changing back to the anaconda default of python = python3
else:
  os.system("python2 setup.py install")

os.chdir("../py3")

os.system('printf "\n---4) Building the SciServer package for Python 3...\n\n"')

if isSciServerComputeEnvironment():
  os.system("python setup.py install")# In anaconda, the default is python = python3
else:
  os.system("python3 setup.py install")



{'fraction_non_alphanumeric': 0.11968880909634949, 'fraction_numerical': 0.012168362258128866, 'mean_word_length': 3.9012707722385143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '6130476', 'n_tokens_mistral': 1518, 'n_tokens_neox': 1466, 'n_words': 572}