Skip to content

Instantly share code, notes, and snippets.

View cabateman's full-sized avatar

Chris Bateman cabateman

  • San Francisco, CA
View GitHub Profile
@cabateman
cabateman / bfs-classical
Created December 11, 2010 05:00
classical demonstration of breadth-first
#!/usr/python
#example relationships to graph
"""
A -> B
A -> C
B -> C
B -> D
C -> D
D -> C
E -> F
#!/bin/bash
rootfile=/home/ldap/chris.bates/usph_2011_03_01
file=/home/ldap/chris.bates/usph_isloading
lockfile=$file'.lock'
if [ ! -e $lockfile ]; then
trap "rm -f $lockfile; exit" INT TERM EXIT
touch $lockfile
#/usr/bin/python /home/ldap/chris.bates/gsreports/reports/scripts/queryImpressionTotalsDaily.py > $file
#maxlines=`wc $rootfile | awk '{print $1}'`
maxlines=2000
!/bin/bash
cd /home/hadoop/
sudo apt-get install git
git clone https://github.com/amplab/shark.git -b branch-0.7 shark
#wget http://elasticmapreduce.s3.amazonaws.com/samples/spark/0.7/hive-0.9-bin.tgz
#wget http://elasticmapreduce.s3.amazonaws.com/samples/spark/0.7/shark-0.3-bin.tgz
/leviathan/tracking/click/event/p03r2tnb3ujx?device_os=Android%204.1.2&android_id_raw=c301c4b84f58b361&is_internal_service_call=true&no_redirect=true&mac_address_sha1=a0421291acf67a98c737823602f01e5830ece387&country=DE
/leviathan/tracking/click/event/p03r2tnb3ujx?device_os=Android%202.3.6&android_id_raw=3e39bbeeb9ff29ec&is_internal_service_call=true&no_redirect=true&mac_address_sha1=5e0f0b4e753022aaa4af93a54f2425c94aa4a5d9&country=ES
/leviathan/tracking/click/event/p03r2tnb3ujx?device_os=Android%204.1.2&android_id_raw=99701328edde9869&is_internal_service_call=true&no_redirect=true&mac_address_sha1=3c3c3ee5d407df905d504468ee29b0a387116441&country=AE
/leviathan/tracking/click/event/p03r2tnb3ujx?device_os=Android%204.0.4&android_id_raw=979a5b888468466a&is_internal_service_call=true&no_redirect=true&country=CA
/leviathan/tracking/click/event/p03r2tnb3ujx?device_os=Android%202.3.5&android_id_raw=79a0bd88cd1fdda8&is_internal_service_call=true&no_redirect=true&country=IT
cbates=> SELECT * FROM leviathan.ad_click WHERE date(time_created)>='2013-10-20' and ad_network_id = 61 and REGEXP_LIKE(custom_click_params, '2509fc855b4a671d') LIMIT 5;
time_created | uuid | major_server_tag | minor_server_tag | client_build | client_data_version | server | remote_ip | campaign_id | iphone_udid | entry_source | forward_url | referrer | tracking_url_id | mapi_click_id | utm_source | utm_medium | utm_term | utm_content | utm_campaign | mapi_url_id | user_browser | user_browser_sha1 | ad_network_id | game_id | country_code | idfa | mac_address | android_id | source_id | custom_click_params | idfa_sha1 | idfa_md5 | idfa_raw | mac_address_sha1 | mac_
cbates=> SELECT * FROM leviathan.ad_click WHERE android_id_raw = '2509fc855b4a671d' and date(time_created)>='2013-10-20';
time_created | uuid | major_server_tag | minor_server_tag | client_build | client_data_version | server | remote_ip | campaign_id | iphone_udid | entry_source | forward_url | referrer | tracking_url_id | mapi_click_id | utm_source | utm_medium | utm_term | utm_content | utm_campaign | mapi_url_id | user_browser | user_browser_sha1 | ad_network_id | game_id | country_code | idfa | mac_address | android_id | source_id | custom_click_params | idfa_sha1 | idfa_md5 | idfa_raw | mac_address_sha1 | mac_address_md5 | mac_address_raw | android_id_sha1 | android_id_md5 | android_id_raw | unknown_id | reported_ip |
cbates=> SELECT * FROM leviathan.marketing_api_call_data WHERE android_id = '2509fc855b4a671d' and game_id = 18 and date(time_created)>='2013-10-01';
time_created | uuid | major_server_tag | minor_server_tag | client_build | client_data_version | server | game_id | udid | carrier | device_type | idfa | ip | mac | openudid | os_version | imei | android_id | referrer | is_first_run | data
__author__ = "SpacedOut Engineering"
__copyright__ = "Copyright 2020, Spaced Out, Inc"
from collections import defaultdict
from typing import List, Dict, DefaultDict, Any
import requests
from app_server import create_app
from app_server.agency import mock_agency, current_agency
from app_server.ats.config.helpers.create_relations import SENSE_CORE_API_KEY
from app_server.entity import EntityType
from app_server.entity.attribute.designation import EntityAttributeDesignations