This file contains hidden or 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
TASK [dev_server : plenv rehash] *********************************************** | |
changed: [t1-perl-dev] | |
TASK [dev_server : set default perl version] *********************************** | |
ok: [t1-perl-dev] | |
TASK [dev_server : perl Makefile.PL] ******************************************* | |
changed: [t1-perl-dev] | |
TASK [dev_server : install shared library dependencies] ************************ |
This file contains hidden or 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
# Using database adama_test_20252_1633 | |
Updating template database... | |
No patches to apply. | |
Database upgrade successful. | |
not ok 1 - t21_dsp_permissions_matrix died (insert() - DBD::Pg::st execute failed: ERROR: null value in column "first_name" violates not-null constraint | |
# DETAIL: Failing row contains (3, 0, t, null, null, null, null, f, null, null, null, null, null, null, null, null, null, null, null, f, f, f, null, 2017-01-31 20:29:36.036922+00, 2017-01-31 20:29:36.036922+00, f, null, f, f, f, f, f, f, f). at /home/dev/src/adama/t/lib/Adama/Test/DB/WithTestObject.pm line 47. | |
# at /home/dev/src/adama/t/lib/Adama/Test/Advertisers.pm line 553.) | |
# Failed test 't21_dsp_permissions_matrix died (insert() - DBD::Pg::st execute failed: ERROR: null value in column "first_name" violates not-null constraint | |
# DETAIL: Failing row contains (3, 0, t, null, null, null, null, f, null, null, null, null, null, null, null, null, null, null, null, f, f, f, null, 2017-01-31 20:29:36.036922+00, 2017-01-31 20:29:36.036922+0 |
This file contains hidden or 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
my $user = Adama::DB::Object::User->get_test_object( | |
username => $username, | |
password => $password, | |
type => 'INTERNAL', | |
role => 'ADMIN', | |
scope => 'GLOBAL', | |
); | |
# ... declare a bunch of scenarios ... |
This file contains hidden or 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
@pytest.fixture() | |
def unique_parameterized_campaign(request): | |
def make_campaign(start_date=None, end_date=None): | |
campaign_parameters = { | |
'name': 'campaign foo', | |
'goal_type': 'spend', | |
'goal_value': 1.00, | |
'start_date': start_date, | |
'end_date': end_date, | |
} |
This file contains hidden or 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
# Reservation grant | |
# Used to keep track of the status of a given message | |
reservation_grant = [ | |
"unprocessed", | |
"reserved-{timestamp}-{process_id}-{thread_id}", # used by a worker to acquire messages for itself | |
"processed", | |
] | |
# Batch ids | |
# can be used for creating a digest of the same notification type recorded over a time interval |
This file contains hidden or 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
{ | |
'matched_fields': { | |
'field_1': { | |
'field_value': 'foobar baz', | |
'matches': [ | |
{'matched_value': 'foo', 'match_offsets': [(0, 3)]}, | |
{'matched_value': 'bar', 'match_offsets': [(3, 6)]}, | |
{'matched_value': 'ba', 'match_offsets': [(3, 5), (7,9)]}, | |
] | |
}, |
This file contains hidden or 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
def integer_to_bit_string(integer): | |
return bin(integer)[2:] | |
def pad_bit_strings(bit_string_1, bit_string_2): | |
difference = len(bit_string_1) - len(bit_string_2) | |
if difference < 0: | |
bit_string_1 = '0' * abs(difference) + bit_string_1 | |
else: | |
bit_string_2 = '0' * abs(difference) + bit_string_2 | |
return (bit_string_1, bit_string_2) |
This file contains hidden or 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 smtplib | |
from email.MIMEMultipart import MIMEMultipart | |
from email.MIMEText import MIMEText | |
def send(recipient, subject, msg): | |
return GmailHandler().send(recipient) | |
This file contains hidden or 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
#!/bin/sh | |
function usage | |
{ | |
echo "usage: ./delete_stale_branches.sh [--help] [--branches [<branch_names>]]" | |
} | |
function delete_branch | |
{ | |
branch_name=$1 |
This file contains hidden or 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
def find_two_tuple_permutations(n, k): | |
n = set(n) | |
valid_pairs = [] | |
for i in n: | |
delta = k - i | |
if delta in n: | |
valid_pairs.append((i, delta)) | |
return valid_pairs | |