commit stringlengths 40 40 | subject stringlengths 1 3.25k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | old_contents stringlengths 0 26.3k | lang stringclasses 3
values | proba float64 0 1 | diff stringlengths 0 7.82k |
|---|---|---|---|---|---|---|---|
0c5373b53161167347e6a5ca72cffb75eaeb5e47 | Fix horrible escaping | hieretikz.py | hieretikz.py | from constructive_hierarchy import *
compose = lambda f: lambda g: lambda *a, **k: f(g(*a, **k))
@compose('\n'.join)
def string_node_layout_to_tikz(formula_layout):
formulae = formula_layout.split()
fmt = r'\node ({}) at ({}, {}) {{{}}};'
for row_num, row in enumerate(formula_layout.split('\n')):
... | Python | 0.000435 | @@ -1651,20 +1651,16 @@
mpose('%5C
-%5C%5C%5C%5C
n'.join)
@@ -1882,16 +1882,17 @@
yield
+r
'%7B:8s%7D $
@@ -1915,16 +1915,18 @@
%5Cquad %7B%7D
+%5C%5C
'.format
|
a2b1addd08c82162d7554aff2636d370cee68922 | Update 0008.py | renzongxian/0008/0008.py | renzongxian/0008/0008.py | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-12-20
# Python 3.4
"""
第 0008 题:一个HTML文件,找出里面的正文。
"""
import urllib.request
import re
def get_body(url):
html_content = urllib.request.urlopen(url).read()
r = re.compile('<p>(?:<.[^>]*>)?(.*?)(?:<.[^>]*>)?</p>')... | Python | 0 | @@ -363,16 +363,32 @@
e('GBK')
+.encode('utf-8')
)%0A re
|
bf7e1adfc9f228eed0d576d7d5c0c8086d14a0b9 | Fix flaky test corehq.motech.tests.test_public_only_session | corehq/motech/tests/test_public_only_session.py | corehq/motech/tests/test_public_only_session.py | from contextlib import contextmanager
from functools import wraps
import requests
from testil import assert_raises, eq
from corehq.motech.auth import make_session_public_only
from corehq.util.urlvalidate.urlvalidate import PossibleSSRFAttempt
def test_public_only_session__simple_success():
session = _set_up_ses... | Python | 0.000119 | @@ -316,24 +316,181 @@
p_session()%0A
+ with _patch_session_with_hard_coded_response(session, 'https://example.com/',%0A _get_200_response()):%0A
response
@@ -524,24 +524,28 @@
mple.com/')%0A
+
eq(respo
@@ -1011,32 +1011,42 @@
sion()%0A with
+(... |
c32e163e3a5ea5ed9f8b3c95df7ad94c7c90bf80 | add missing import | lib/simulator.py | lib/simulator.py | from rgbmatrix import RGBMatrix
from rgbmatrix import graphics
from field import Field
from color import Color
from ant import Ant
Matrix = RGBMatrix(32, 2, 1)
Matrix.pwmBits = 11
Matrix.brightness = 50
def colorize(foods, base, ants):
for food in foods:
Matrix.SetPixel(food[0], food[1], 0, ... | Python | 0.000042 | @@ -129,16 +129,29 @@
rt Ant%0D%0A
+import time%0D%0A
%0D%0A%0D%0AMatr
|
157fc261b3eb219baaf4041999c94761a763c8f0 | Allow for multiple BASEs | reportlab/lib/attrmap.py | reportlab/lib/attrmap.py | #copyright ReportLab Inc. 2000
#see license.txt for license details
#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/lib/attrmap.py?cvsroot=reportlab
#$Header: /tmp/reportlab/reportlab/lib/attrmap.py,v 1.6 2002/07/24 19:56:37 andy_robinson Exp $
__version__=''' $Id: attrmap.py,v 1.6 2002/07/24 19:56:37 ... | Python | 0.000001 | @@ -205,33 +205,33 @@
/attrmap.py,v 1.
-6
+7
2002/07/24 19:5
@@ -227,33 +227,28 @@
/07/
-24 19:56:37 andy_robinson
+31 12:45:49 rgbecker
Exp
@@ -286,17 +286,17 @@
.py,v 1.
-6
+7
2002/07
@@ -300,33 +300,28 @@
/07/
-24 19:56:37 andy_robinson
+31 12:45:49 rgbecker
Exp
@@ -1394,32 +1394,50 @@
ANTED=%5B%5D,**kw... |
59f6a67dd7457da92f0ab1ff8a78e672dfdb1bdc | Remove help from `argparse` to use as parent. | plotter/plotn.py | plotter/plotn.py | """existing plotting script to test with."""
import argparse
def parse_arguments():
print __doc__
parser = argparse.ArgumentParser(description=__doc__.split('\n',1)[0])
parser.add_argument('-s', '--start', action='store', type=int, default=0,
help='the number of the first iteration ... | Python | 0 | @@ -169,16 +169,31 @@
n',1)%5B0%5D
+,add_help=False
)%0A pa
|
c73629e09f2b8cf7e2f874098f84f248f9ea331b | Add history plotter | bird/visualizer.py | bird/visualizer.py | from matplotlib import pyplot as plt
import glob
import tqdm
import numpy as np
from bird import utils
def compute_and_save_spectrograms_for_files(files):
progress = tqdm.tqdm(range(len(files)))
for (f, p) in zip(files, progress):
img_log_spectrogram_from_wave_file(f)
img_spectrogram_from_wav... | Python | 0.000001 | @@ -31,16 +31,30 @@
as plt%0A%0A
+import pickle%0A
import g
@@ -1247,24 +1247,736 @@
lt.close()%0A%0A
+def plot_history_to_image_file(pickle_path):%0A with open(pickle_path, 'rb') as input:%0A trainLoss = pickle.load(input)%0A validLoss = pickle.load(input)%0A trainAcc = pickle.load(input)%0A... |
b3c1f07300af72e91fe49af2471d4b2e30ae132b | Tag -> string | controlhost/__init__.py | controlhost/__init__.py | # coding=utf-8
# Filename: __init__.py
"""
A set of classes and tools wich uses the ControlHost protocol.
"""
from __future__ import absolute_import
from controlhost.__version__ import version
import socket
import struct
import re
try:
from km3pipe.logger import logging
except ImportError:
pass
else:
lo... | Python | 0.000001 | @@ -1960,16 +1960,20 @@
g.match(
+str(
prefix.t
@@ -1975,16 +1975,17 @@
fix.tag)
+)
is None
|
261711415e971062bdb6ce495cfe5024faf75abc | Improve loadAccountInfo | module/plugins/internal/XFSPAccount.py | module/plugins/internal/XFSPAccount.py | # -*- coding: utf-8 -*-
import re
from urlparse import urljoin
from time import mktime, strptime
from module.plugins.Account import Account
from module.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies
from module.utils import parseFileSize
class XFSPAccount(Account):
__name__ = "XFSPAccount"
... | Python | 0 | @@ -357,17 +357,17 @@
_ = %220.0
-8
+9
%22%0A%0A _
@@ -761,32 +761,37 @@
le today:.*?%3Cb%3E(
+?P%3CS%3E
.+?)%3C/b%3E'%0A LO
@@ -853,16 +853,18 @@
r%3C)'%0A
+ #
PREMIUM
@@ -1038,16 +1038,29 @@
duntil =
+ None%0A
traffic
@@ -1084,24 +1084,97 @@
premium =
+ None%0A%0A if hasattr(self,... |
bf55358444ac120759d04ae4e5f60577deba8674 | fix for python3 | dj_database_url.py | dj_database_url.py | # -*- coding: utf-8 -*-
import os
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
# Register database schemes in URLs.
urlparse.uses_netloc.append('postgres')
urlparse.uses_netloc.append('postgresql')
urlparse.uses_netloc.append('pgsql')
urlparse.uses_netloc.append('postgis')
urlpar... | Python | 0.000003 | @@ -3046,12 +3046,8 @@
qs.
-iter
item
|
61d7cf374f9ce0843eae57af7995a906bbfead8f | version bump 1.0.8 | copywriting/__init__.py | copywriting/__init__.py | __version__ = "0.1.7"
| Python | 0.000001 | @@ -16,7 +16,7 @@
0.1.
-7
+8
%22%0A
|
ab2e26f388e174d7d66ba659430f7b772e5c2199 | Update dump_ast.py | src/dump_ast.py | src/dump_ast.py | #!/usr/bin/python
# vim: set fileencoding=utf-8
import clang.cindex
import asciitree
import sys
def node_children(node):
return (c for c in node.get_children() if c.location.file.name == sys.argv[1])
def print_node(node):
text = node.spelling or node.displayname
kind = str(node.kind)[str(node.kind).index(... | Python | 0 | @@ -77,16 +77,38 @@
sciitree
+ # must be version 0.2
%0Aimport
|
9fb5c703069e086eb710f1bf601a046188f07880 | Put filter bank code in its own function for MFCC. | scikits/talkbox/features/mfcc.py | scikits/talkbox/features/mfcc.py | import numpy as np
from scipy.io import loadmat
from scipy.signal import lfilter, hamming
from scipy.fftpack import fft
from scipy.fftpack.realtransforms import dct2
from scikits.talkbox import segment_axis
from mel import hz2mel
def mfcc(input, nwin=256, nfft=512, fs=16000, nceps=13):
# MFCC parameters: taken ... | Python | 0 | @@ -235,299 +235,161 @@
def
-mfcc(input, nwin=256, nfft=512, fs=16000, nceps=13):%0A # MFCC parameters: taken from auditory toolbox%0A over = nwin - 160%0A prefac = 0.97%0A%0A #lowfreq = 400 / 3.%0A lowfreq = 133.33%0A #highfreq = 6855.4976%0A linsc = 200/3.%0A logsc = 1.0711703%0A%0A nlinf... |
d4d386e4c5da90ccfe21385db81ba315c391cd58 | fix introspections for Django 1.8 | djangoql/schema.py | djangoql/schema.py | import inspect
from collections import OrderedDict
from django.db.models import AutoField, BooleanField, CharField, DateField, \
DateTimeField, DecimalField, FloatField, IntegerField, Model, \
NullBooleanField, TextField
from .exceptions import DjangoQLSchemaError
class DjangoQLSchema(object):
include =... | Python | 0.000003 | @@ -187,19 +187,48 @@
d, M
-odel, %5C%0A
+anyToOneRel, %5C%0A ManyToManyRel, Model,
Nul
@@ -2867,24 +2867,252 @@
ptions = %5B%5D%0A
+ if isinstance(field, (ManyToOneRel, ManyToManyRel)):%0A # Django 1.8 doesn't have .null attribute for these fields%0A nullable = True%0... |
5e7699f3a73010fdc8e17bc02dc44751de0b7e12 | Move the output bucket.json to another directory. | joby/settings.py | joby/settings.py | # -*- coding: utf-8 -*-
# Scrapy settings for joby project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/to... | Python | 0 | @@ -446,17 +446,8 @@
port
- dirname,
joi
@@ -456,16 +456,28 @@
abspath
+, expanduser
%0A%0A%0ABOT_N
@@ -614,30 +614,47 @@
oin(
-dirname(__file__), '..
+expanduser('~'), 'output', 'job-spiders
', '
@@ -751,16 +751,17 @@
-agent%0A#
+
USER_AGE
@@ -877,16 +877,17 @@
t: 16)%0A#
+
CONCURRE
@@ -1094,16 +1094,17 ... |
5e250460bd98281ad2709b26cebc64b23f0828cb | Replace M2Crypto usage in print_log_list.py with cryptography.io | python/utilities/log_list/print_log_list.py | python/utilities/log_list/print_log_list.py | #!/usr/bin/env python
"""Parse and print the list of logs, after validating signature."""
import base64
import hashlib
import json
import os
import sys
import time
from absl import flags as gflags
import jsonschema
import M2Crypto
from cpp_generator import generate_cpp_header
from java_generator import generate_java... | Python | 0.000001 | @@ -192,16 +192,196 @@
gflags%0A
+from cryptography.exceptions import InvalidSignature%0Afrom cryptography.hazmat.primitives import hashes, serialization%0Afrom cryptography.hazmat.primitives.asymmetric import padding%0A
import j
@@ -393,24 +393,8 @@
hema
-%0Aimport M2Crypto
%0A%0Afr
@@ -2032,305 +2032,327 @@
... |
3f718e66f659ce8e6019d1e8f9d78df6402a1cff | Order list test waits for picotable | shuup_tests/browser/admin/test_order_list.py | shuup_tests/browser/admin/test_order_list.py | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import os
import pytest
import time
from django.core.urlresolvers import re... | Python | 0.000002 | @@ -251,22 +251,8 @@
os%0A
-import pytest%0A
impo
@@ -259,16 +259,16 @@
rt time%0A
+
%0Afrom dj
@@ -306,16 +306,30 @@
everse%0A%0A
+import pytest%0A
from shu
@@ -369,16 +369,76 @@
rStatus%0A
+from shuup.testing.browser_utils import wait_until_appeared%0A
from shu
@@ -502,16 +502,16 @@
lt_shop%0A
+
from shu
@... |
a61a4887be4a162fa296509f134b9428193a324e | fix test to not import from compat shim. | test/test_metadata.py | test/test_metadata.py | #!/usr/bin/env python
import json
import logging
import unittest
import rgwadmin
from rgwadmin.compat import quote
from rgwadmin.utils import get_environment_creds, id_generator
from . import create_bucket
logging.basicConfig(level=logging.WARNING)
class MetadataTest(unittest.TestCase):
def setUp(self):
... | Python | 0 | @@ -63,58 +63,55 @@
est%0A
-%0Aimport rgwadmin%0Afrom rgwadmin.compat import quote
+from urllib.parse import quote%0A%0Aimport rgwadmin
%0Afro
|
84d734fe0df15c9968222346b13c6f06530a96b6 | fix command line argument parsing test | test/test_plumbing.py | test/test_plumbing.py | def setUp(self):
pass
def test_cli_arg_parsing(self):
tests = [
("abc", ("abc", [], {})),
("ab:c", ("ab", ['c'], {})),
("a:b=c", ('a', [], {'b':'c'})),
("a:b=c,d", ('a', ['d'], {'b':'c'})),
("a:b=c,d=e", ('a', [], {'b':'c','d':'e'})),
]
for cli, output in tests:
... | Python | 0.000001 | @@ -91,24 +91,28 @@
abc%22, %5B%5D, %7B%7D
+, %5B%5D
)),%0A
@@ -136,16 +136,20 @@
'c'%5D, %7B%7D
+, %5B%5D
)),%0A
@@ -173,32 +173,36 @@
', %5B%5D, %7B'b':'c'%7D
+, %5B%5D
)),%0A (%22a:
@@ -231,16 +231,20 @@
'b':'c'%7D
+, %5B%5D
)),%0A
@@ -288,16 +288,20 @@
'd':'e'%7D
+, %5B%5D
)),%0A ... |
29d3aa6bf6a7a670b24ff423cb687a0c6d862208 | Remove outdated comment | tests/test_exports.py | tests/test_exports.py | from __future__ import absolute_import, unicode_literals
import json
import os
import unittest
from draftjs_exporter.constants import BLOCK_TYPES, ENTITY_TYPES, INLINE_STYLES
from draftjs_exporter.defaults import BLOCK_MAP
from draftjs_exporter.html import HTML
from tests.test_entities import Image, Link
fixtures_pa... | Python | 0 | @@ -439,39 +439,8 @@
))%0A%0A
-# TODO Move this to JSON file.%0A
conf
|
da954862019e3f836952d746b04bbb1f7d3035bc | update version to 0.7.1 | dlstats/version.py | dlstats/version.py | VERSION = (0, 7, 0)
def version_str():
if len(VERSION) == 3:
return "%s.%s.%s" % VERSION
elif len(VERSION) == 4:
return "%s.%s.%s-%s" % VERSION
else:
raise IndexError("Incorrect format for the VERSION tuple")
| Python | 0.000001 | @@ -10,17 +10,17 @@
(0, 7,
-0
+1
)%0A%0Adef v
|
440d1e5a578dc79e55d4bd3b399134948650beb9 | test errors | tests/test_extruct.py | tests/test_extruct.py | # -*- coding: utf-8 -*-
import json
import unittest
import pytest
import extruct
from tests import get_testdata, jsonize_dict, replace_node_ref_with_node_id
class TestGeneric(unittest.TestCase):
maxDiff = None
def test_all(self):
body = get_testdata('songkick', 'elysianfields.html')
expect... | Python | 0.00001 | @@ -2017,8 +2017,411 @@
xpected%0A
+%0A def test_errors(self):%0A body = ''%0A%0A # raise exceptions%0A with pytest.raises(Exception):%0A data = extruct.extract(body)%0A%0A # ignore exceptions%0A expected = %7B%7D%0A data = extruct.extract(body, errors='ignore')%... |
513b5aecf1e34e775d98f12c41c9bd526a8504a5 | Improve compiler configuration in otf2 package | var/spack/packages/otf2/package.py | var/spack/packages/otf2/package.py | # FIXME: Add copyright
from spack import *
import os
class Otf2(Package):
"""The Open Trace Format 2 is a highly scalable, memory efficient event
trace data format plus support library."""
homepage = "http://www.vi-hps.org/score-p"
url = "http://www.vi-hps.org/upload/packages/otf2/otf2-1.4.ta... | Python | 0.000001 | @@ -37,16 +37,47 @@
mport *%0A
+from contextlib import closing%0A
import o
@@ -761,16 +761,375 @@
r.gz%22)%0A%0A
+ backend_user_provided = %22%22%22%5C%0ACC=cc%0ACXX=c++%0AF77=f77%0AFC=f90%0ACFLAGS=-fPIC%0ACXXFLAGS=-fPIC%0A%22%22%22%0A frontend_user_provided = %22%22%22%5C%0ACC_FOR_BUILD=cc%0ACXX_FOR_BUILD=c++... |
bcad44ba03708a05cfbd86608c1d52e79c1394b5 | Remove broken import | deepchem/models/tf_new_models/graph_topology.py | deepchem/models/tf_new_models/graph_topology.py | """Manages Placeholders for Graph convolution networks.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
__author__ = "Han Altae-Tran and Bharath Ramsundar"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"
import warnings
import... | Python | 0.000001 | @@ -354,43 +354,8 @@
tf%0A
-from deepchem.nn.copy import Input%0A
from
|
560c462138990103fd9c83c58dd4b7c4b3b1a582 | Fix exportAggCubes | tutorials/tutorial2.py | tutorials/tutorial2.py | #
# Cubify Tutorial Part 2
#
# This tutorial shows you how to use CubeSets
#
from cubify import Cubify
import json
# Instantiate Cubify
cubify= Cubify()
#
# Do cleanup from previous runs of this tutorial
#
cubify.deleteCubeSet('purchasesCubeSet')
cubify.deleteCubeSet('purchasesCubeSet2')
# Create a cube set called... | Python | 0.000001 | @@ -1598,32 +1598,33 @@
fy.exportAggCube
+s
ToCsv(cubeSet, '
@@ -1631,203 +1631,8 @@
/tmp
-/purchasesCubeSet-aggregated-by-CustomerState-ProductId.csv', 'CustomerState-ProductId')%0Acubify.exportAggCubeToCsv(cubeSet, '/tmp/purchasesCubeSet-aggregated-by-CustomerState.csv', 'CustomerState
')%0A%0A
|
f159b7e88c991516f20a5bef1c18068fe191e4e4 | Add manual document create to postgres | scrapi/processing/postgres.py | scrapi/processing/postgres.py | from __future__ import absolute_import
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import copy
import logging
from collections import namedtuple
import django
from api.webview.models import HarvesterResponse, Document
from scrapi import events
from scrapi.linter import RawDocument... | Python | 0 | @@ -1656,24 +1656,296 @@
c.delete()%0A%0A
+ def document_create(self, attributes):%0A Document.objects.create(%0A source=attributes%5B'source'%5D,%0A docID=attributes%5B'docID'%5D,%0A providerUpdatedDateTime=None,%0A raw=attributes,%0A normalized=None%0A... |
e9a30627897bd0eb00c10d5fe758c9673eae87fd | update function in case more than one uri present | scrapi/harvesters/addis_ababa.py | scrapi/harvesters/addis_ababa.py | '''
Harvester for the Addis Ababa University Institutional Repository for the SHARE project
Example API call: http://etd.aau.edu.et/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
from scrapi.base import helpers
def oai_process_uris... | Python | 0 | @@ -534,16 +534,19 @@
for
+ i,
uri in
pote
@@ -541,16 +541,26 @@
uri in
+enumerate(
potentia
@@ -565,16 +565,17 @@
ial_uris
+)
:%0A
@@ -626,52 +626,8 @@
ri:%0A
- ind = potential_uris.index(uri)%0A
@@ -659,18 +659,16 @@
l_uris%5Bi
-nd
%5D.replac
@@ -737,18 +737,16 @@
l_uris%5Bi
-nd... |
69accde57ef219bec1e7086988b29f22385a8671 | Convert test_filters to pytest | tests/test_filters.py | tests/test_filters.py | from unittest import mock, TestCase
from framewirc import filters
from framewirc.message import ReceivedMessage
class TestDeny(TestCase):
def setUp(self):
self.client = object()
self.handler = mock.Mock()
def test_correct_list(self):
"""Un-blacklisted commands should be allowed."""
... | Python | 0.999999 | @@ -22,18 +22,8 @@
mock
-, TestCase
%0A%0Afr
@@ -112,26 +112,16 @@
TestDeny
-(TestCase)
:%0A de
@@ -117,39 +117,54 @@
eny:%0A def set
-Up(self
+up_method(self, method
):%0A self.
@@ -840,33 +840,23 @@
-self.
assert
-False(
+
self.han
@@ -858,33 +858,41 @@
f.handler.called
-)
+ is False
... |
0728964b7799845723a110328a46bc9c6d4c8614 | Fix examples/python3-urllib/run.py | examples/python3-urllib/run.py | examples/python3-urllib/run.py | import sys
import ssl
import urllib.error
import urllib.request
host = sys.argv[1]
port = sys.argv[2]
cafile = sys.argv[3] if len(sys.argv) > 3 else None
try:
urllib.request.urlopen("https://" + host + ":" + port, cafile=cafile)
except urllib.error.URLError as exc:
if not isinstance(exc.reason, ssl.SSLError):... | Python | 0.002067 | @@ -228,16 +228,63 @@
cafile)%0A
+except ssl.CertificateError:%0A print(%22FAIL%22)%0A
except u
|
f7b351a43d99a6063c49dfdf8db60c654fd89b74 | Add django setup for some initialization | scrapi/processing/postgres.py | scrapi/processing/postgres.py | from __future__ import absolute_import
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webview.settings")
import logging
from api.webview.models import Document
from scrapi import events
from scrapi.processing.base import BaseProcessor
logger = logging.getLogger(__name__)
class PostgresProcessor(BasePr... | Python | 0.000001 | @@ -112,16 +112,30 @@
ings%22)%0A%0A
+import django%0A
import l
@@ -258,16 +258,32 @@
cessor%0A%0A
+django.setup()%0A%0A
logger =
|
8df261cb9183e5933f49c441f3af8940f8449059 | Improve finders code coverage, fix tests not running due to inheretince approach with __init__ | tests/test_finders.py | tests/test_finders.py | from unittest.mock import patch
from isort import finders, settings
from isort.finders import FindersManager
class TestFindersManager:
def test_init(self):
assert FindersManager(settings.DEFAULT_CONFIG)
class ExceptionOnInit(finders.BaseFinder):
def __init__(*args, **kwargs):
... | Python | 0 | @@ -26,16 +26,31 @@
patch%0A%0A
+import pytest%0A%0A
from iso
@@ -1130,25 +1130,44 @@
-def __init__(self
+@classmethod%0A def setup_class(cls
):%0A
@@ -1165,36 +1165,35 @@
s(cls):%0A
-self
+cls
.instance = self
@@ -1188,20 +1188,19 @@
tance =
-self
+cls
.kind(se
@@ -1362,16 +1362,47 @@
isort... |
8ad1fd6a0fedac16e3bf475d1009fe54864528b0 | Prepare for the new install implementation | src/tue_get/__init__.py | src/tue_get/__init__.py | #!/usr/bin/env python
from __future__ import print_function
import errno
import logging
import os
from argparse import Namespace
from rosdep2 import RosdepLookup, create_default_installer_context, get_default_installer
from rosdep2.main import rosdep_main
from rosdep2.rospkg_loader import DEFAULT_VIEW_KEY
from rosdis... | Python | 0 | @@ -1838,86 +1838,60 @@
-walker = SourceDependencyWalker(distro)%0A packages = set()%0A
+# which repo should this package be in?
%0A
-for
package
in p
@@ -1890,238 +1890,188 @@
age
-in
+=
pkgs
-:
+%5B0%5D
%0A
- packages %7C= walker.get_recursive_depends(package, %5B'buildtool', 'build', 'r... |
b13e07568d9b37c882249bb9aafa35b31d80742f | add qc flag to collect_processedlibraries method in dbify processing module | bripipetools/dbify/processing.py | bripipetools/dbify/processing.py | """
Class for importing data from a processing batch into GenLIMS as new objects.
"""
import logging
logger = logging.getLogger(__name__)
import os
from .. import util
from .. import genlims
from .. import annotation
class ProcessingImporter(object):
"""
Collects WorkflowBatch and ProcessedLibrary objects fro... | Python | 0 | @@ -1984,16 +1984,23 @@
braries(
+qc=True
)%0A%0A d
|
0ea1153438c1d98232a921c8d14d401a541e95fd | Fix regex example, the model must not be a unicode string. | examples/regex/regex_parser.py | examples/regex/regex_parser.py | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from parser_base import RegexParser
import model
class RegexSemantics(object):
def __init__(self):
super(RegexSemantics, self).__init__()
self._count = 0
def START(self, ast):
re... | Python | 0.000096 | @@ -985,9 +985,25 @@
render()
+.encode(%22ascii%22)
%0A
|
bb86870b4494d6f001d82a824f85b31de5912bd5 | Update session.py | HexChat/session.py | HexChat/session.py | from __future__ import print_function
import xchat as hexchat
__module_name__ = "session"
__module_author__ = "TingPing"
__module_version__ = "1"
__module_description__ = "Saves current session for next start"
# To use just disable auto-connect and start using 'Quit and Save' from the menu.
def load_session():
for p... | Python | 0.000001 | @@ -42,17 +42,8 @@
ort
-xchat as
hexc
|
c253598bc5334dd874dd51c15f68b5ee42df795c | Update youtube_utils.py | server/youtube_utils.py | server/youtube_utils.py |
from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2client.tools import argparser
DEVELOPER_KEY = "AIzaSyAPLpQrMuQj6EO4R1XwjwS2g47dqpFXW3Y"
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"
def search(query):
youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API... | Python | 0.000001 | @@ -141,40 +141,40 @@
aSyA
-PLpQrMuQj6EO4R1XwjwS2g47dqpFXW3Y
+zOQrWd7Hh-wP9Sp4Bt1w7i33IwQbVT58
%22%0AYO
|
3973911447c902094c27eec5fd475c7b9d7849a9 | Update binary-tree-inorder-traversal.py | Python/binary-tree-inorder-traversal.py | Python/binary-tree-inorder-traversal.py | # Time: O(n)
# Space: O(1)
#
# Given a binary tree, return the inorder traversal of its nodes' values.
#
# For example:
# Given binary tree {1,#,2,3},
# 1
# \
# 2
# /
# 3
# return [1,3,2].
#
# Note: Recursive solution is trivial, could you do it iteratively?
#
# Definition for a binary tree node
class ... | Python | 0.000001 | @@ -1848,16 +1848,17 @@
raversed
+
= stack.
|
cf55b0e0bb1c14949983c8ae9670984c17fa59bc | update hooks | reactive/nginx.py | reactive/nginx.py | from charms.reactive import (
when,
when_not,
set_state,
remove_state,
is_state,
hook
)
from charmhelpers.core import hookenv, host
from charmhelpers.fetch import apt_install
from charmhelpers.core.templating import render
import toml
# HELPERS ------------------------------------------------... | Python | 0 | @@ -1415,17 +1415,17 @@
%0A%0A#
-HOOKS ---
+REACTORS
----
@@ -1541,36 +1541,13 @@
all
-dependencies for application
+nginx
%0A
@@ -1609,16 +1609,17 @@
NGINX')%0A
+%0A
# In
@@ -1724,46 +1724,8 @@
%5D)%0A%0A
- # Perform our application install%0A
@@ -1827,24 +1827,25 @@
nv.config()%0A
+%0A
... |
fb234bec2308357a315307983baf57bb8fb382fe | add set anchors | nets/mobilenetdet.py | nets/mobilenetdet.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from configs import kitti_config as configs
def encode_annos(image, labels, bboxes):
"""Encode annotations for losses computations.
Args:
image: 3-D with shape `[H, W, C]`.
... | Python | 0.000002 | @@ -127,16 +127,35 @@
w as tf%0A
+import numpy as np%0A
from con
@@ -792,24 +792,1121 @@
ut%0A pass%0A%0A%0A
+def set_anchors(img_shape, fea_shape):%0A %22%22%22Set anchors.%0A%0A Args:%0A img_shape: 1-D list with shape %60%5B2%5D%60.%0A fea_shape: 1-D list with shape %60%5B2%5D%60.%0A%0A Returns:%0A an... |
0da74f42f7d7311859a340b0e72c1b8902287d5c | Allow for local run of example and demos installed with tool. | Python/tigre/utilities/sample_loader.py | Python/tigre/utilities/sample_loader.py | from __future__ import division
import os
import numpy as np
import scipy.io
import scipy.ndimage.interpolation
def load_head_phantom(number_of_voxels=None):
if number_of_voxels is None:
number_of_voxels = np.array((128, 128, 128))
dirname = os.path.dirname(__file__)
dirname = os.path.join(dirname... | Python | 0 | @@ -347,16 +347,160 @@
d.mat')%0A
+ if not os.path.isfile(dirname):%0A dirname = os.path.dirname(__file__)%0A dirname = os.path.join(dirname,'./../../data/head.mat')%0A
test
|
06027c03165b8a442abc4f5672a95d755c67b219 | add cache settings example | onadata/settings/production_example.py | onadata/settings/production_example.py | from common import * # nopep8
# this setting file will not work on "runserver" -- it needs a server for
# static files
DEBUG = False
# override to set the actual location for the production static and media
# directories
MEDIA_ROOT = '/var/formhub-media'
STATIC_ROOT = "/srv/formhub-static"
STATICFILES_DIRS = (
o... | Python | 0 | @@ -2399,8 +2399,84 @@
ware',)%0A
+%0ACACHE_MIDDLEWARE_SECONDS = 3600 # 1 hour%0ACACHE_MIDDLEWARE_KEY_PREFIX = ''%0A
|
eb7e89f8c4ce1ef928dafee160f28966818db669 | Add TxT import (#2643) | pyzoo/zoo/models/recommendation/__init__.py | pyzoo/zoo/models/recommendation/__init__.py | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | Python | 0 | @@ -679,28 +679,47 @@
ession_recommender import *%0A
+from .txt import *%0A
|
9e2b77ac809f7256254191111338f88be04ae940 | Add alias support to database | netsecus/database.py | netsecus/database.py | from __future__ import unicode_literals
import logging
import sqlite3
from .sheet import Sheet
from .submission import Submission
from .task import Task
class Database(object):
def __init__(self, config):
databasePath = config("database_path")
self.database = sqlite3.connect(databasePath)
... | Python | 0 | @@ -1440,16 +1440,179 @@
)%22%22%22)
+%0A self.cursor.execute(%0A %22%22%22CREATE TABLE IF NOT EXISTS %60alias%60 (%0A %60alias%60 text,%0A %60identifier%60 text%0A )%22%22%22)
%0A%0A de
@@ -2004,32 +2004,500 @@
return result%0A%0A
+ def getStudent... |
db16e4cc0264d0f355802b8d4834f832c715d1e4 | Enable range filter for product SKU | shuup/admin/modules/products/views/list.py | shuup/admin/modules/products/views/list.py | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.contrib.static... | Python | 0 | @@ -519,16 +519,29 @@
xtFilter
+, RangeFilter
%0Afrom sh
@@ -1163,31 +1163,16 @@
y=%22sku%22,
-%0A
filter_
@@ -1182,52 +1182,20 @@
fig=
-Text
+Range
Filter(
-placeholder=_(%22Filter by SKU...%22)
), o
|
cef6c095681f478ad1a04691573ec308bd15143c | fix import for HQPillow | corehq/pillows/group.py | corehq/pillows/group.py | from corehq.apps.groups.models import Group
from corehq.pillows.mappings.group_mapping import GROUP_INDEX, GROUP_MAPPING
from dimagi.utils.decorators.memoized import memoized
from pillowtop.listener import AliasedElasticPillow
from django.conf import settings
class GroupPillow(HQPillow):
"""
Simple/Common Cas... | Python | 0 | @@ -1,20 +1,54 @@
+from django.conf import settings%0A%0A
from corehq.apps.gro
@@ -75,85 +75,8 @@
oup%0A
-from corehq.pillows.mappings.group_mapping import GROUP_INDEX, GROUP_MAPPING%0A
from
@@ -181,41 +181,98 @@
low%0A
+%0A
from
-django.conf import settings%0A
+.mappings.group_mapping import GROUP_INDEX, GROUP_M... |
ff7ce0ca2a8019e67d512b47a4a340f176d96adf | update example to reflect current API | doc/simple_glue.py | doc/simple_glue.py | from glue.core.message import DataMessage, SubsetMessage
from glue.core import Hub, HubListener, Data, DataCollection
class MyClient(HubListener):
def register_to_hub(self, hub):
""" Sign up to receive DataMessages from the hub """
hub.subscribe(self, # subscribing object
... | Python | 0 | @@ -75,13 +75,8 @@
port
- Hub,
Hub
@@ -603,20 +603,8 @@
cts%0A
-hub = Hub()%0A
clie
@@ -725,16 +725,22 @@
h other%0A
+hub =
data_col
@@ -751,20 +751,11 @@
ion.
-append(data)
+hub
%0Adat
@@ -767,35 +767,27 @@
lection.
-register_to_hub(hub
+append(data
)%0Aclient
|
70af3e5bad5236a8c9c78f25afe37da4507de0c4 | Fix 500 error when doing /v1 | qonos/api/middleware/version_negotiation.py | qonos/api/middleware/version_negotiation.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | Python | 0.000006 | @@ -2367,16 +2367,23 @@
ath_info
+ or '/'
))%0A
|
919846ad3e6994a8a954128b170a6bbaa1884509 | Add --debug option | nmhive.py | nmhive.py | #!/usr/bin/env python
"""Serve a JSON API for getting/setting notmuch tags with nmbug commits."""
import json
import mailbox
import os
import tempfile
import urllib.request
import flask
import flask_cors
import nmbug
import notmuch
app = flask.Flask(__name__)
app.config['CORS_HEADERS'] = 'Content-Type'
flask_cors.... | Python | 0.004323 | @@ -3485,16 +3485,152 @@
en on.')
+%0A parser.add_argument(%0A '-d', '--debug', type=bool, default=False,%0A help='Run Flask in debug mode (e.g. show errors).')
%0A%0A ar
@@ -3655,16 +3655,43 @@
args()%0A%0A
+ app.debug = args.debug%0A
app.
|
b74f1e3902bc824b11e4493b3d9e88b9b3523663 | Add graph parameter where missing | dag/__init__.py | dag/__init__.py | from copy import copy, deepcopy
class DAGValidationError(Exception):
pass
class DAG(object):
""" Directed acyclic graph implementation. """
def __init__(self):
""" Construct a new DAG with no nodes or edges. """
self.graph = {}
def add_node(self, node_name, graph=None):
""" ... | Python | 0 | @@ -1576,16 +1576,28 @@
dep_node
+, graph=None
):%0A
@@ -1905,16 +1905,28 @@
ask_name
+, graph=None
):%0A
|
7f56b7806c9c35117066332387e50c71e15d4b76 | Update get_all_expected_es_indices() to use authoritative index collection | corehq/pillows/utils.py | corehq/pillows/utils.py | from couchdbkit.exceptions import ResourceNotFound
from jsonobject.exceptions import WrappingAttributeError
from corehq.apps.commtrack.const import COMMTRACK_USERNAME
from corehq.apps.users.models import CouchUser
from corehq.apps.users.util import SYSTEM_USER_ID, DEMO_USER_ID
from corehq.const import ONE_DAY
from cor... | Python | 0 | @@ -337,675 +337,39 @@
ings
-.app_mapping import APP_INDEX_INFO%0Afrom corehq.pillows.mappings.case_mapping import CASE_INDEX_INFO%0Afrom corehq.pillows.mappings.case_search_mapping import CASE_SEARCH_INDEX_INFO%0Afrom corehq.pillows.mappings.domain_mapping import DOMAIN_INDEX_INFO%0Afrom corehq.pillows.mappings.group... |
52eef06d6ab50f5287949ab8b33f145a58f1cb44 | bump version 0.1.4 -> 0.1.5 | neuprint/__init__.py | neuprint/__init__.py | __version__ = (0, 1, 4)
__verstr__ = "0.1.4"
from .client import Client
from .fetch import *
| Python | 0.000001 | @@ -14,17 +14,17 @@
(0, 1,
-4
+5
)%0A__vers
@@ -39,9 +39,9 @@
0.1.
-4
+5
%22%0A%0Af
|
7ebfd6ca59b167ae4b9cf582c20f517bd5500f24 | fix final 2.6 test issue | rollbar/test/__init__.py | rollbar/test/__init__.py | import difflib
import pprint
import unittest
# from http://hg.python.org/cpython/file/67ada6ab7fe2/Lib/unittest/util.py
# for Python 2.6 support
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(res... | Python | 0.000001 | @@ -1849,28 +1849,422 @@
atMessage(msg, standardMsg))
+%0A%0A def assertNotIn(self, member, container, msg=None):%0A %22%22%22Just like self.assertTrue(a not in b), but with a nicer default message.%22%22%22%0A if member in container:%0A standardMsg = '%25s unexpectedly found in %25s' %25 (... |
fcd85a1b15ca8b82f892bba171c21f9a1b4f6e4a | Correct URI and list categories | SOAPpy/tests/alanbushTest.py | SOAPpy/tests/alanbushTest.py | #!/usr/bin/env python
# Copyright (c) 2001 actzero, inc. All rights reserved.
import sys
sys.path.insert (1, '..')
import SOAP
ident = '$Id$'
SoapEndpointURL = 'http://www.alanbushtrust.org.uk/soap/compositions.asp'
MethodNamespaceURI = 'urn:alanbushtrust-org-uk:soap:methods'
SoapAction = MethodNamespaceURI + ... | Python | 0.999965 | @@ -268,17 +268,17 @@
-uk:soap
-:
+.
methods'
@@ -314,17 +314,17 @@
eURI + %22
-#
+.
GetCateg
@@ -431,31 +431,23 @@
n )%0A
-print %22server level%3E%3E%22,
+for category in
ser
@@ -465,9 +465,28 @@
gories()
+:%0A print category
%0A
|
39825d5504c164d43c79364fcfcf758e39c7af4b | fix tests for xformindexing | corehq/pillows/xform.py | corehq/pillows/xform.py | import copy
from casexml.apps.case.xform import extract_case_blocks
from corehq.pillows.case import UNKNOWN_DOMAIN, UNKNOWN_TYPE
from corehq.pillows.core import DATE_FORMATS_ARR
from corehq.pillows.mappings.xform_mapping import XFORM_MAPPING, XFORM_INDEX
from dimagi.utils.decorators.memoized import memoized
from .base ... | Python | 0 | @@ -2572,17 +2572,21 @@
ase_dict
-%5B
+.pop(
date_mod
@@ -2594,24 +2594,17 @@
fied_key
-%5D = None
+)
%0A%0A
|
4e87b4318e9ddd9d09caaba06ffa3f57368562e5 | Order by submitted_at to get first submission instead of last submission | openedx/features/assessment/helpers.py | openedx/features/assessment/helpers.py | import hashlib
from datetime import datetime
from logging import getLogger
from django.conf import settings
from django.contrib.auth.models import User
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from openassessment.assessment.models import Assessment, AssessmentPart
from openassessment.assessment.se... | Python | 0 | @@ -1183,16 +1183,46 @@
id=block
+%0A ).order_by('submitted_at'
).first(
@@ -2799,16 +2799,41 @@
YPE%0A
+).order_by('submitted_at'
).first(
|
5e2d8aad2771122da26507b67630c055e2f13de3 | make reindent. | external/markdown-processor.py | external/markdown-processor.py | # -*- coding: utf-8 -*-
"""
The Pygments Markdown Preprocessor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This fragment is a Markdown_ preprocessor that renders source code
to HTML via Pygments. To use it, invoke Markdown like so::
from markdown import Markdown
md = Markdown()
md.pre... | Python | 0.000004 | @@ -1895,9 +1895,8 @@
t('%5Cn')%0A
-%0A
|
fa9cd5db6a27fe32375479d02cc3137a491c7fdd | Support more locales | KerbalStuff/app.py | KerbalStuff/app.py | from flask import Flask, render_template, request, g, Response, redirect, session, abort, send_file, url_for
from flask.ext.login import LoginManager, current_user
from flaskext.markdown import Markdown
from jinja2 import FileSystemLoader, ChoiceLoader
from werkzeug.utils import secure_filename
from datetime import dat... | Python | 0 | @@ -1987,16 +1987,25 @@
t(api)%0A%0A
+try:%0A
locale.s
@@ -2036,16 +2036,114 @@
'en_US')
+%0Aexcept:%0A try:%0A locale.setlocale(locale.LC_ALL, 'en')%0A except:%0A pass # give up
%0A%0Aif not
|
8eea44b0f9582154429cb56e79789b9724b9d641 | Fix of test_create_frame_rand1.py Part 2: Also disallow factors = 0, 1. Categoricals are defined by having >=2 different levels! | py/testdir_single_jvm/test_create_frame_rand1.py | py/testdir_single_jvm/test_create_frame_rand1.py | import unittest, random, sys
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_util, h2o_hosts, h2o_import as h2i
DO_DOWNLOAD = False
DO_INSPECT = False
paramDict = {
'rows': [1,100,1000],
'cols': [1,10,100], # Number of data columns (in addition to the first response column)
'seed': [None, 1234],... | Python | 0 | @@ -620,20 +620,21 @@
%5BNone,
-0
+5
, 1
+7
%5D, # Fac
|
4b4a329b86e8bbf33c555a7525071bf5bf7666f4 | Update conf.py | doc/source/conf.py | doc/source/conf.py | # -*- coding: utf-8 -*-
#
# SimPhoNy-Mayavi documentation build configuration file
#
def mock_modules():
import sys
from mock import MagicMock
try:
import numpy # noqa
except ImportError:
MOCK_MODULES = ['numpy']
else:
MOCK_MODULES = []
try:
import simphony ... | Python | 0.000001 | @@ -386,16 +386,118 @@
hony')%0A%0A
+ try:%0A import mayavi # noqa%0A except ImportError:%0A MOCK_MODULES.append('mayavi')%0A%0A
clas
|
02b8210034f61c92058c15dccb361d23fab8a75b | fix arg parser bug | random_bonus/unet_segmentation/argparser.py | random_bonus/unet_segmentation/argparser.py | import os
import argparse
def parse_param_file(filepath):
with open(filepath, 'r') as f:
kw_exprs = [x.strip() for x in f.readlines() if x.strip()]
return eval('dict({})'.format(','.join(kw_exprs)))
def parse_args():
parser = argparse.ArgumentParser(
description='Simple Demo of Image Seg... | Python | 0.000002 | @@ -650,16 +650,102 @@
mages')%0A
+ parser.add_argument('config',%0A help='Path to config file')%0A
pars
@@ -1001,163 +1001,8 @@
')%0A%0A
- # train options%0A parser.add_argument('--config',%0A help='Path to config file',%0A type=str, ... |
9eb440774a7fba22fbafcb9958a185cec8461649 | Fix #722: aggregate_coverage.py does not aggregate the coverage reports of the same tracked lines | scripts/aggregate_coverage.py | scripts/aggregate_coverage.py | #!/usr/bin/env python
"""Simple script to concatenate coverage reports.
"""
import os
import sys
import argparse
import fnmatch
def main(arguments):
parser = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_arg... | Python | 0.000004 | @@ -821,16 +821,31 @@
output.%0A
+ lines = %7B%7D%0A
args
@@ -877,16 +877,16 @@
mic%5Cn')%0A
-
for
@@ -1081,16 +1081,41 @@
'mode:')
+ and %22vendor%22 not in line
:%0A
@@ -1116,32 +1116,541 @@
+ (position, stmt, count) = line.split(%22 %22)%0A stmt... |
bc2c0395b3374c0f6abfb7bead9a9e5acd468263 | Update expedia.py | Selenium/exercices/solutions/expedia.py | Selenium/exercices/solutions/expedia.py | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
# Configure the baseURL
baseUrl = "https://www.expedia.es"
# Create a webDriver instance and maximize window
driver = webdriver.Firefox()
driver.maximize_window()
# Navigage to URL and put ... | Python | 0 | @@ -890,17 +890,17 @@
3/11/201
-7
+8
%22%0Adepart
@@ -1009,25 +1009,25 @@
s(%2223/11/201
-7
+8
%22)%0A%0A# Find d
@@ -1059,17 +1059,17 @@
0/11/201
-7
+8
%22%0Areturn
@@ -1186,9 +1186,9 @@
/201
-7
+8
%22)%0A%0A
|
46b3cd3b0483405c0257d496c3dbc4c04a42fb87 | Add save/load method to mnist example | example/mnist/mnist.py | example/mnist/mnist.py | #!/usr/bin/env python
"""Chainer example: train a multi-layer perceptron on MNIST
This is a minimal example to write a feed-forward net. It requires scikit-learn
to load MNIST dataset.
"""
import numpy as np
import six
import chainer
from chainer import cuda, FunctionSet
import chainer.functions as F
from chainer i... | Python | 0 | @@ -2509,8 +2509,186 @@
f.model%0A
+%0A def save(self):%0A return bytearray(six.moves.cPickle.dumps(self.model))%0A%0A def load(self, model_data):%0A self.model = six.moves.cPickle.loads(str(model_data))%0A
|
084b2f161ec6a3f8ed5ba891d7acd34a85a416e5 | Test if we can send test message | hotels/fb.py | hotels/fb.py | import os
import logging
class FB(object):
"""
Create Facebook Responses
"""
def __init__ (self):
logging.basicConfig(level=logging.INFO)
self.logger = logging.getLogger("Facebook")
self.logger.info("Initialized Facebook Class")
def textMessage(self, messages, text, speech... | Python | 0 | @@ -710,36 +710,38 @@
%22
-text
+speech
%22: text%0A
|
c6954896581d9ae4f545db7b0d55cf76e1dc3bb5 | Add test_db | src/ims/store/mysql/test/test_store_core.py | src/ims/store/mysql/test/test_store_core.py | ##
# See the file COPYRIGHT for copyright information.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Python | 0.000002 | @@ -1085,16 +1085,44 @@
ataStore
+, ReconnectingConnectionPool
%0A%0A%0A__all
@@ -7602,8 +7602,273 @@
ersion)%0A
+%0A @asyncAsDeferred%0A async def test_db(self) -%3E None:%0A %22%22%22%0A :meth:%60DataStore._db%60 returns a :class:%60ReconnectingConnectionPool%60.%0A %22%22%22%0A s... |
a38fb7b02997b2fa51fbff5114b91782266338ce | remove gcutils __main__ block | boltons/gcutils.py | boltons/gcutils.py | # -*- coding: utf-8 -*-
"""The Python Garbage Collector (`GC`_) doesn't usually get too much
attention, probably because:
- Python's `reference counting`_ effectively handles the vast majority of
unused objects
- People are slowly learning to avoid implementing `object.__del__()`_
- The collection itself str... | Python | 0.999389 | @@ -4783,616 +4783,4 @@
%22%22%22%0A
-%0A%0Aif __name__ == '__main__':%0A class TestType(object):%0A pass%0A%0A tt = TestType()%0A%0A def _test_main():%0A print('TestTypes:', len(get_all(TestType)))%0A print('bools:', len(get_all(bool)))%0A import pdb;pdb.set_trace()%0A%0A def _... |
da9b08ed88e8771769919c9b690345b5b3d0137a | Allow passing extra env files to package update command | rdomanager_oscplugin/v1/overcloud_update.py | rdomanager_oscplugin/v1/overcloud_update.py | # Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | Python | 0 | @@ -2003,16 +2003,369 @@
)%0A
+ parser.add_argument(%0A '-e', '--environment-file', metavar='%3CHEAT ENVIRONMENT FILE%3E',%0A action='append', dest='environment_files',%0A help='Environment files to be passed to the heat stack-create '%0A 'or heat stack-u... |
ac071d442f75c4f7993580b44b64c2a4d97f14b7 | Fix allura sitemap script failure. | scripts/create-allura-sitemap.py | scripts/create-allura-sitemap.py | """
Generate Allura sitemap xml files.
This takes a while to run on a prod-sized data set. There are a couple of
things that would make it faster, if we need/want to.
1. Monkeypatch forgetracker.model.ticket.Globals.bin_count to skip the
refresh (Solr search) and just return zero for everything, since we don't
... | Python | 0 | @@ -3137,18 +3137,26 @@
+M.main_orm_
session
-(p)
.cle
|
963e8ab6eb57525346c80acf70e58cde76cf4786 | Revert "added my changes back" | soccer/gameplay/tactics/positions/coach.py | soccer/gameplay/tactics/positions/coach.py | import robocup
import constants
import single_robot_composite_behavior
import enum
import behavior
import main
import skills.move
import subprocess
## Motivates, encourages, and directs the team.
class Coach(single_robot_composite_behavior.SingleRobotCompositeBehavior):
MaxSpinAngle = 360
SpinPerTick = 1
... | Python | 0 | @@ -5708,17 +5708,17 @@
ght was
-D
+d
elicious
|
5dfb71c2e93f4d11f38868b335796fb6a7eab37c | version bump to 0.0.7 | contact_form/__init__.py | contact_form/__init__.py | # -*- coding: utf-8 -*-
VERSION = (0, 0, 6)
def get_version():
"""Returns the version as a human-format string."""
return '.'.join([str(i) for i in VERSION])
__author__ = 'dlancer'
__docformat__ = 'restructuredtext en'
__copyright__ = 'Copyright 2014, dlancer'
__license__ = 'BSD'
__version__ = get_version()... | Python | 0.000001 | @@ -39,9 +39,9 @@
0,
-6
+7
)%0A%0A%0A
|
280f5d77c1affd2e243579ebf4db3180b45dcb4d | Update timebomb.py | timebomb.py | timebomb.py | from utils import add_cmd
import utils
import threading
import random
name = "timebomb"
cmds = ["timebomb", "cut"]
def main(irc):
if not "name" in irc.plugins.keys():
irc.plugins["timebomb"] = {"exempts": []}
def kick(irc, target, channel, noRemove=False):
prepare_nicks = []
reason = "BOOM"
n... | Python | 0.000221 | @@ -5163,17 +5163,17 @@
with(%22$a
-:
+%22
):%0A
@@ -5222,16 +5222,17 @@
ccount =
+=
irc.sta
|
a5bdbf4a296cc26819e4a1f3cc2c628c22314feb | Fix check_config_usage script | scripts/check_config_usage.py | scripts/check_config_usage.py | #!/usr/bin/env python
# Copyright 2018 Arm Limited.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | Python | 0.000012 | @@ -705,19 +705,8 @@
tch%0A
-import sys%0A
impo
@@ -721,16 +721,27 @@
port re%0A
+import sys%0A
%0A%0Aclass
@@ -2875,32 +2875,33 @@
ok for all occur
+r
ences of defined
@@ -3042,16 +3042,18 @@
mpile(r%22
+%5Cb
(%22 + key
@@ -3059,16 +3059,18 @@
yre + %22)
+%5Cb
%22)%0A f
@@ -3557,16 +3557,17 @@
ll occur
... |
9091035443e06beeea359e373e4809f4965c7ffe | Add Events::EventBusPolicy (#1386) | troposphere/events.py | troposphere/events.py | # Copyright (c) 2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
class EcsParameters(AWSProperty):
props = {
"TaskCount": (int, False),
"TaskDefinitionArn": (basestring, True),
}
class InputTransformer(AWSProp... | Python | 0 | @@ -16,9 +16,14 @@
201
-3
+2-2019
, Ma
@@ -109,16 +109,17 @@
cense.%0A%0A
+%0A
from . i
@@ -137,21 +137,498 @@
ject
-, AWSProperty
+%0Afrom . import AWSProperty%0Afrom .validators import integer%0A%0A%0Aclass Condition(AWSProperty):%0A props = %7B%0A 'Key': (basestring, False),%0A 'Type': (basest... |
3316b1d85a10fa4819b624a06842db8af377d004 | verify that the AHPS stage gleaner still works | scripts/hads/process_ahps_xml.py | scripts/hads/process_ahps_xml.py | """
Ingest the rich metadata found within the AHPS2 website!
"""
from twisted.words.xish import xpath, domish
import urllib2
import psycopg2
import sys
mesosite = psycopg2.connect(database='mesosite', host='iemdb')
mcursor = mesosite.cursor()
from pyiem.network import Table as NetworkTable
def process_site( nwsli, ne... | Python | 0 | @@ -1,13 +1,11 @@
%22%22%22
-%0A
Ingest t
@@ -144,16 +144,65 @@
ort sys%0A
+from pyiem.network import Table as NetworkTable%0A%0A
mesosite
@@ -288,55 +288,8 @@
r()%0A
-from pyiem.network import Table as NetworkTable
%0A%0Ade
@@ -303,17 +303,16 @@
ss_site(
-
nwsli, n
@@ -321,16 +321,11 @@
work
-
):%0A
- ... |
73aa6990f75b6152cf983a59a81e7966fcba4a32 | Add __all__ to __init.py__ | botbot/__init__.py | botbot/__init__.py | __version__ = '0.0.1'
| Python | 0.996877 | @@ -15,8 +15,42 @@
'0.0.1'%0A
+__all__ = %5B%22checker%22, %22problems%22%5D%0A
|
27c635b0ee68336a4da8a5d1e21ce4530adc8ac0 | Use SystemRandom correctly | unsubscribe.py | unsubscribe.py | #!/usr/bin/env python
import string
from passlib.hash import sha1_crypt
from random import SystemRandom
from sqlalchemy import MetaData, Table, Column, String, ForeignKey, create_engine, Integer
from sqlalchemy.orm import mapper, relationship, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from s... | Python | 0.000001 | @@ -1511,58 +1511,8 @@
)()%0A
- hash_count = self.session.query(Hash).count()%0A
@@ -1585,24 +1585,8 @@
ash(
-hash_count + 1,
salt
@@ -1714,16 +1714,18 @@
emRandom
+()
.choice(
|
fe88f37559e93c9357f116ff51324a2201c68b82 | Change stringly type to classly typed - preparation for DirectoryController | src/robotide/ui/images.py | src/robotide/ui/images.py | # Copyright 2008-2009 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Python | 0 | @@ -660,16 +660,301 @@
ariable%0A
+from robotide.controller.settingcontrollers import VariableController%0Afrom robotide.controller.macrocontrollers import TestCaseController, UserKeywordController%0Afrom robotide.controller.filecontrollers import TestDataDirectoryController, TestCaseFileController, ResourceFileContro... |
112f351d4beffc44ca579f65e3bbef47d9a90a4c | Test json generation against parsing | tests/test_paledoc.py | tests/test_paledoc.py | import unittest
from pale.doc import generate_doc_dict, generate_json_docs
class PaleDocDictTests(unittest.TestCase):
def setUp(self):
super(PaleDocDictTests, self).setUp()
from tests import example_app
self.doc_dict = generate_doc_dict(example_app)
def test_doc_dict_root_structure(s... | Python | 0 | @@ -1,12 +1,24 @@
+import json%0A
import unitt
@@ -91,28 +91,24 @@
lass PaleDoc
-Dict
Tests(unitte
@@ -167,12 +167,8 @@
eDoc
-Dict
Test
@@ -218,24 +218,63 @@
example_app%0A
+ self.example_app = example_app%0A
self
@@ -609,24 +609,209 @@
%5D, list))%0A%0A%0A
+ def test_doc_json(self):%0A ... |
f3a2fed93dee9186688e379bf4975d6f0e94aed8 | version 1.0.0 | userdocker/__init__.py | userdocker/__init__.py | # -*- coding: utf-8 -*-
"""
userdocker allows admins to grant restricted docker command access to users.
Feedback welcome:
https://github.com/joernhees/userdocker
"""
__version__ = '1.0.0-dev8'
| Python | 0.000002 | @@ -187,11 +187,6 @@
.0.0
--dev8
'%0A
|
987eb7af67e2086bcab59d15e84372b24d9fea02 | fix failing tests | tests/test_pipreqs.py | tests/test_pipreqs.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_pipreqs
----------------------------------
Tests for `pipreqs` module.
"""
import unittest
import os
import requests
from pipreqs import pipreqs
class TestPipreqs(unittest.TestCase):
def setUp(self):
self.modules = ['flask', 'requests', 'sqlalche... | Python | 0.000223 | @@ -2562,17 +2562,17 @@
info), 1
-0
+1
)%0A
@@ -4333,20 +4333,18 @@
.split(%22
-
==
-
%22)%0A
|
f398dc8564e89f5957c311c0649724a846a8dc7e | bump release version in sphinx conf | doc/source/conf.py | doc/source/conf.py | # -*- coding: utf-8 -*-
#
# linop documentation build configuration file, inspired from Pykrylov
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're r... | Python | 0 | @@ -1796,16 +1796,18 @@
e = '0.8
+.2
'%0A%0A# The
|
30b9073d68b07003b89641ca5764305b8a7b1250 | fix not existing UnsupportedOSError | dlstats/configuration.py | dlstats/configuration.py | import configobj
import validate
import os
def _get_filename():
"""Return the configuration file path."""
appname = 'dlstats'
if os.name == 'posix':
if "HOME" in os.environ:
if os.path.isfile(os.environ["HOME"]+'/.'+appname+'/main.conf'):
return os.environ["HOME"]+'/.'+a... | Python | 0.00272 | @@ -817,10 +817,23 @@
ise
-Un
+Exception(%22Not
supp
@@ -841,16 +841,19 @@
rted
+
OS
-Error(
+: %25s%22 %25
os.n
|
4f489a5bc629183d1944cdb9c4c2bce436ee3a08 | Revert "Listen on all interfaces." | LinkMarks.py | LinkMarks.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import cherrypy
from cherrypy.process.plugins import PIDFile
import os
import sys
import model
import templates as t
def safe_access(fn):
@cherrypy.expose
def wrapped(*args, **kwargs):
try:
if "token" in kwargs:
token = kwarg... | Python | 0 | @@ -2176,44 +2176,8 @@
80,%0A
- %22server.socket_host%22: %220.0.0.0%22%0A
%7D)%0A%0A
|
5cb7371eb3d12d72886d0a911803754f76655abb | Make sure that the latest version is more recent than (not just different from) the current version. | lib/repository.py | lib/repository.py | import os
import sys
import urllib
import wx
from dbtk import REPOSITORY, VERSION
def download_from_repository(filepath):
filename = filepath.split('/')[-1]
if os.path.isfile(filename):
os.remove(filename)
latest = urllib.urlopen(REPOSITORY + filepath, 'rb')
file_size = latest.info()['Content-... | Python | 0 | @@ -76,16 +76,44 @@
ERSION%0A%0A
+global abort%0Aabort = False%0A%0A
%0Adef dow
@@ -661,16 +661,338 @@
ose()%0A%0A%0A
+def more_recent(latest, current):%0A latest_parts = latest.split('.')%0A current_parts = current.split('.')%0A for n in range(len(latest_parts)):%0A l = int(latest_parts%5Bn%5D)%0A ... |
c624f0e5099669e863592d2261108cf29e5fbaf2 | update test | src/rez/tests/test_plugin_manager.py | src/rez/tests/test_plugin_manager.py | """
test rezplugins manager behaviors
"""
from rez.tests.util import TestBase, TempdirMixin, restore_sys_path
from rez.plugin_managers import plugin_manager, uncache_sys_module_paths
from rez.package_repository import package_repository_manager
import os
import sys
import unittest
class TestPluginManagers(TestBase, T... | Python | 0.000001 | @@ -242,18 +242,8 @@
ger%0A
-import os%0A
impo
@@ -1532,67 +1532,8 @@
%22%22%22%0A
- path = os.path.realpath(os.path.dirname(__file__))%0A
@@ -1592,35 +1592,23 @@
th=%5B
-os.path.join(path, %22data%22,
+self.data_path(
%22ext
@@ -1886,67 +1886,8 @@
%22%22%22%0A
- path = os.path.realpath(os.pa... |
a4cd7bf2979f489a2b010936ed31803d79eba7c1 | Bump version for development | kafka/version.py | kafka/version.py | __version__ = '1.2.5'
| Python | 0 | @@ -16,7 +16,11 @@
1.2.
-5
+6.dev
'%0A
|
1062b6b1a82e0916f81a1544b0df92dbd03d6185 | update event handler test py file | terraform/modules/fourkeys-images/files/event_handler/event_handler_test.py | terraform/modules/fourkeys-images/files/event_handler/event_handler_test.py | # Copyright 2020 Google, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -815,59 +815,91 @@
-with pytest.raises(Exception) as e:%0A
+r = client.post(%22/%22, data=%22Hello%22)%0A assert r.status_code == 403%0A%0A
-
+r =
client.
post
@@ -898,155 +898,108 @@
ent.
-pos
+ge
t(%22/%22
-)%0A%0A assert %22Source not authorized%22 in str(e.value)%0A%0A%0Adef test_missin... |
83ed2c948db0df6ebf63f78a748834abbd30e344 | read files as unicode | openstep_parser/openstep_parser.py | openstep_parser/openstep_parser.py | # Copyright (c) 2015, Ignacio Calderon
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and ... | Python | 0.00005 | @@ -1719,16 +1719,32 @@
p.read()
+.decode('UTF-8')
)%0A%0A @
|
7c38cb34c4c5a35bcee69a14d3a7d7316ec09d4b | add tests for updating the recipe name | tests/test_recipes.py | tests/test_recipes.py | from unittest import TestCase
from classes.categories import Categories
class TestRecipes(TestCase):
"""This class will handle all the functions to test for the recipe name"""
def setUp(self):
"""This method defines the test fixture for all test to be undertaken"""
self.new_category = Categor... | Python | 0 | @@ -400,10 +400,33 @@
nces
+ when creating a recipe
.%0A
-
@@ -490,31 +490,62 @@
est
-if recipe name is empty
+on the messge poped upon registering empty recipe name
%22%22%22%0A
@@ -742,32 +742,338 @@
recipe name.%22)%0A%0A
+ def test_empty_procedure(self):%0A %22%22%22Test on the messge poped up... |
ded146dde5727b3600cf78b163b1be1a5975af74 | Update update_bulk_preloaded.py to account for subdomain entries | scripts/update_bulk_preloaded.py | scripts/update_bulk_preloaded.py | import base64
import json
import re
import requests
import sys
def log(s):
sys.stderr.write(s)
class State:
BeforeLegacy18WeekBulkEntries, \
DuringLegacy18WeekBulkEntries, \
AfterLegacy18WeekBulkEntries, \
During18WeekBulkEntries, \
After18WeekBulkEntries, \
During1YearBulkEntries, \
After1YearBulkEnt... | Python | 0 | @@ -317,16 +317,89 @@
kEntries
+, %5C%0A During1YearBulkSubdomainEntries, %5C%0A After1YearBulkSubdomainEntries
= range
@@ -403,9 +403,9 @@
nge(
-7
+9
)%0A%0Ad
@@ -1956,22 +1956,439 @@
if %22
-BULK%22 in line:
+START OF 1-YEAR BULK SUBDOMAIN HSTS ENTRIES%22 in line:%0A state = State.During1YearBulkSubdom... |
63c162b52e23ea5c847a7fa1751fdff770f93c55 | Add system_dns helper destination | salt/_states/firewall.py | salt/_states/firewall.py | from collections import defaultdict
import atexit
import difflib
import jinja2
import json
import os
import subprocess
RULES_TEMPLATE = jinja2.Template('''
{% if nat_rules %}
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
{% for chain in nat_chains|default([]) -%}
:{{ ... | Python | 0 | @@ -1789,24 +1789,636 @@
r', 'nat')%0A%0A
+ destination = kwargs.get('destination')%0A # Some convenience utilities for destinations here, first we allow specifying that the%0A # intended destination is the system dns servers, which will figure out which those are%0A # and add the correct IPs, but allow al... |
d5f5033d0700f90625089e1a84112b19acf4912c | Improve search query performance | scuevals_api/resources/search.py | scuevals_api/resources/search.py | from flask_jwt_extended import jwt_required, get_jwt_identity
from flask_restful import Resource
from marshmallow import fields
from sqlalchemy import func
from sqlalchemy.orm import subqueryload
from scuevals_api.models import Role, Course, Department, School, Professor
from scuevals_api.roles import role_required
fr... | Python | 0.00039 | @@ -820,41 +820,12 @@
ery.
-options(%0A subqueryload
+join
(Cou
@@ -835,24 +835,32 @@
.department)
+.filter(
%0A ).j
@@ -860,15 +860,12 @@
-).join(
+
Cour
@@ -877,18 +877,21 @@
partment
-,
+.has(
Departme
@@ -899,38 +899,21 @@
t.school
-).filter(%0A
+.has(
School.u
@@ -... |
2b2fd2fa6180bb42e24237823326bef46648fddd | version increment | SAGA/version.py | SAGA/version.py | """
SAGA package version
"""
__version__ = "0.26.0"
| Python | 0.000002 | @@ -42,11 +42,11 @@
= %220.26.
-0
+1
%22%0A
|
c5970991ed2d3285e6a3ef9badb6e73756ff876b | Fix `assert_called` usage for Python 3.5 build | tests/test_session.py | tests/test_session.py | # Local imports
from uplink import session
def test_base_url(uplink_builder_mock):
# Setup
uplink_builder_mock.base_url = "https://api.github.com"
sess = session.Session(uplink_builder_mock)
# Run & Verify
assert uplink_builder_mock.base_url == sess.base_url
def test_headers(uplink_builder_mock... | Python | 0.000009 | @@ -431,32 +431,39 @@
# Verify%0A
+assert
uplink_builder_m
@@ -471,39 +471,30 @@
ck.add_hook.
-assert_
called
-()
%0A assert
|
df71bbfd2d33ef76393fcd03355eefce023f9897 | replace deprecated get_model | resturo/models.py | resturo/models.py | from django.db import models
from django.conf import settings
from django.db.models import get_model
from django.core.exceptions import ImproperlyConfigured
class ModelResolver(object):
def __call__(self, name):
model_path = getattr(self, name)
try:
app_label, model_class_name = mode... | Python | 0.000002 | @@ -72,16 +72,11 @@
ngo.
-db.model
+app
s im
@@ -80,25 +80,20 @@
import
-get_model
+apps
%0Afrom dj
@@ -484,16 +484,21 @@
model =
+apps.
get_mode
|
56716020f42ddd1abaed1d387f1ab76c4bd9ff73 | add unit test for reset method | tests/unit/anchore_engine/services/policy_engine/engine/policy/test_gate.py | tests/unit/anchore_engine/services/policy_engine/engine/policy/test_gate.py | import pytest
from anchore_engine.services.policy_engine.engine.policy.gates import PackageCheckGate
from anchore_engine.services.policy_engine.engine.policy.gates.dockerfile import (
EffectiveUserTrigger,
)
from anchore_engine.services.policy_engine.engine.policy.gates.npms import (
PkgMatchTrigger,
)
from an... | Python | 0 | @@ -78,16 +78,22 @@
import
+(%0A
PackageC
@@ -100,16 +100,36 @@
heckGate
+,%0A BaseTrigger,%0A)
%0Afrom an
@@ -2259,8 +2259,198 @@
= value%0A
+%0A def test_reset(self):%0A trigger = BaseTrigger(PackageCheckGate)%0A trigger._fired_instances = %5B1, 2, 3%5D%0A trigger.reset()%0A ... |
216bbaf8cdcf37acba56b9045a4c9967869d195f | make test_tracker safe to run in parallel | tests/test_tracker.py | tests/test_tracker.py | # Unit tests related to 'Trackers' (https://www.easypost.com/docs/api#tracking).
import easypost
def test_tracker():
# Create a tracker and then retrieve it. We assert on created and retrieved tracker's values.
tracker = easypost.Tracker.create(
tracking_code="EZ2000000002",
carrier="USPS"
... | Python | 0.000001 | @@ -86,38 +86,908 @@
ort
-easypost%0A%0A%0Adef test_tracker():
+datetime%0Aimport random%0A%0Aimport easypost%0A%0A%0Adef test_tracker_values():%0A%0A for code, status in (%0A ('EZ1000000001', 'pre_transit'),%0A ('EZ2000000002', 'in_transit'),%0A ('EZ3000000003', 'out_for_delivery'),%0A ... |
7959c651b227a56997b29a98186f82a73192e904 | correct example in comment | salt/modules/rabbitmq.py | salt/modules/rabbitmq.py | '''
Module to provide RabbitMQ compatibility to Salt.
Todo: A lot, need to add cluster support, logging, and minion configuration
data.
'''
# Import salt libs
from salt import exceptions, utils
# Import python libs
import logging
log = logging.getLogger(__name__)
def __virtual__():
'''Verify RabbitMQ is instal... | Python | 0.000004 | @@ -5923,34 +5923,35 @@
'*' rabbitmq.st
-op
+art
_app%0A '''%0A
@@ -6165,32 +6165,29 @@
*' rabbitmq.
-stop_app
+reset
%0A '''%0A
@@ -6414,32 +6414,35 @@
*' rabbitmq.
-stop_app
+force_reset
%0A '''%0A
|
ad1ce131d37deb179314f00e23eca9bfcbad0be4 | add pre_dispatcher command | command_line/spot_counts_per_image.py | command_line/spot_counts_per_image.py | from dials.util.options import OptionParser
from dials.util.options import flatten_reflections, flatten_datablocks
from dials.algorithms.peak_finding import per_image_analysis
import iotbx.phil
phil_scope = iotbx.phil.parse("""\
plot=None
.type = path
individual_plots=False
.type = bool
id = None
.type = int(val... | Python | 0.000001 | @@ -1,28 +1,131 @@
+from __future__ import division%0A# LIBTBX_PRE_DISPATCHER_INCLUDE_SH export BOOST_ADAPTBX_FPE_DEFAULT=1%0A%0A
from dials.util.options impo
|
5022d93059581e110cec34854653e285aaebf3f9 | Fix wipeicat.py: must restore data only if status is ARCHIVED, must sleep to give the IDS server some time to do the restore. | doc/examples/wipeicat.py | doc/examples/wipeicat.py | #! /usr/bin/python
#
# Delete all content from an ICAT.
#
# This script uses the JPQL syntax for searching in the ICAT. It thus
# requires ICAT version 4.3.0 or greater.
#
import time
import logging
import icat
from icat.ids import DataSelection
import icat.config
logging.basicConfig(level=logging.INFO)
#logging.get... | Python | 0 | @@ -2999,31 +2999,8 @@
ue:%0A
- action = False%0A
@@ -3140,51 +3140,49 @@
s://
-code.google
+github
.com/
-p/
icat
--data-
+project/ids.
serv
-ic
e
+r
/issues/
deta
@@ -3181,18 +3181,8 @@
ues/
-detail?id=
14%0A
@@ -3465,34 +3465,8 @@
on)%0A
- action = True%0A
@@ -3570,16 +3570,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.