This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create subcontract info | |
// handling null fields from http://stackoverflow.com/questions/37081842/cant-merge-with-null-values-cannot-merge-node-using-null-property-value-in-n | |
USING PERIODIC COMMIT 100 | |
LOAD CSV WITH HEADERS FROM "file:///subaward3.csv" AS row | |
MERGE (p:Primary {name: row.prime_awardee_parent_contractor_name, awardeeParentContractorName: row.prime_awardee_parent_contractor_name}) | |
ON CREATE SET p.awardeeParentDUNS = row.prime_awardee_parent_duns | |
ON MATCH SET p.awardeeParentDUNS = row.prime_awardee_parent_duns | |
ON CREATE SET p.awardPrincipalNAICSCode = row.prime_award_principal_naics_code | |
ON MATCH SET p.awardPrincipalNAICSCode = row.prime_award_principal_naics_code | |
MERGE (s:Subaward {name: row.subawardee_name, DUNS: row.subawardee_dunsnumber, amount: row.subaward_amount}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import sys | |
import ijson | |
import csv | |
import argparse | |
def extract_to_csv(json_filename, new_json_filename, csv_filename): | |
# ijson's parser chokes on NaNs, so let's get rid of them | |
# NaN containing fields not needed for Adam's analysis? | |
# if Circularity and Pixel area are NaN, we're in trouble!!! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import ast | |
import pandas as pd | |
from datetime import datetime | |
from distutils.util import strtobool | |
from typing import Dict, List, Union | |
def convert_to_dict_list(string: str) -> Union[List[Dict], None]: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
import subprocess | |
def query_github_graphql(url: str, api_token: str, owner: str, service: str, pull_request: int): | |
headers = {'Authorization': 'bearer {}'.format(api_token), 'Content-Type': 'application/json'} | |
payload = {'query': '{repository(owner:\"%s\", name: \"%s\"){pullRequest(number: %d){headRefName,baseRefName}}}' % (owner, service, pull_request)} | |
response = requests.post(url=url, json=payload, headers=headers) | |
print(response.text) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer