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

import requests
import json
import sys
import argparse

parser = argparse.ArgumentParser('Queries Monorail to get the services and deployNotes where a list of Pull requests will be deployed')
parser.add_argument('--url', help='URL where Monorail is located')
parser.add_argument('--pr', help='List of pull requests we will ask for')
args = parser.parse_args()

curl_uri = '/deploy-info?pr='

if (args.url):
    if args.url.startswith('http'):
        request_url = args.url+curl_uri
    else:
        request_url = 'http://'+args.url+curl_uri
else:
    print 'We need an URL'
    exit(1)

if (args.pr):
    pull_requests = args.pr.split()
    pull_requests = ",".join(pull_requests)
else:
    print 'A list of PRs is needed'
    exit(1)

try:
    r = requests.get(request_url+pull_requests)
except:
    print 'Something went wrong querying Monorail'
    exit(2)

json_list = r.json()
services=json_list['services']
deploynotes=json_list['deployNotes']
<commit_msg>Print variables for initial testing<commit_after>#!/usr/bin/env python

import requests
import json
import sys
import argparse

parser = argparse.ArgumentParser('Queries Monorail to get the services and deployNotes where a list of Pull requests will be deployed')
parser.add_argument('--url', help='URL where Monorail is located')
parser.add_argument('--pr', help='List of pull requests we will ask for')
args = parser.parse_args()

curl_uri = '/deploy-info?pr='

if (args.url):
    if args.url.startswith('http'):
        request_url = args.url+curl_uri
    else:
        request_url = 'http://'+args.url+curl_uri
else:
    print 'We need an URL'
    exit(1)

if (args.pr):
    pull_requests = args.pr.split()
    pull_requests = ",".join(pull_requests)
else:
    print 'A list of PRs is needed'
    exit(1)

try:
    r = requests.get(request_url+pull_requests)
except:
    print 'Something went wrong querying Monorail'
    exit(2)

json_list = r.json()
services=json_list['services']
deploynotes=json_list['deployNotes']

print 'deploynotes:'
print deploynotes
print '\nservices:'
print services

{'fraction_non_alphanumeric': 0.11946692051404094, 'fraction_numerical': 0.0028557829604950024, 'mean_word_length': 4.190123456790124, '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': '2956094', 'n_tokens_mistral': 696, 'n_tokens_neox': 676, 'n_words': 198}