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 |
|---|---|---|---|---|---|---|---|
1396f52bb0aae7f6b50c3c41b66ac56c1afa0006 | Fix tweeton bug | notifiers/TwitterNotifier.py | notifiers/TwitterNotifier.py | from NotifierClass import Notifier
import twitter
from datetime import datetime, timedelta
import time
import threading
class TwitterNotifier(Notifier):
def __init__(self,cfgParser,insec):
self.header = insec
try:
self.screenname = cfgParser.get(insec,"username").strip()
except:
self.screenname = ''
s... | Python | 0.000003 | @@ -1622,24 +1622,62 @@
lf.losstext%0A
+%09%09%09%09%09else:%0A%09%09%09%09%09%09restext = %22TIE GAME%22%0A
%09%09%09%09%09%0A%09%09%09%09%09i
@@ -1937,24 +1937,72 @@
nal%22%5D%0A%09%09%09%09%09%0A
+%09%09%09%09%09if (finalDict%5B%22result%22%5D in self.tweeton):%0A%09
%09%09%09%09%09self._t
|
b0e3e75f254c487800c383ea7652f77e32ab3473 | Add default behavior of _is_instance method and _is_valid_after_convert method at base class | dataproperty/_type_checker.py | dataproperty/_type_checker.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import abc
import six
from .converter import NoneConverterCreator
from .converter import IntegerConverterCreator
from .converter import FloatConverterCreator
from .converter import DateTimeConver... | Python | 0.000002 | @@ -1323,32 +1323,8 @@
ue%0A%0A
- @abc.abstractmethod%0A
@@ -1347,36 +1347,44 @@
(self):%0A
-pass
+return False
%0A%0A @abc.abstr
@@ -1551,32 +1551,8 @@
()%0A%0A
- @abc.abstractmethod%0A
@@ -1586,36 +1586,43 @@
(self):%0A
-pass
+return True
%0A%0A%0Aclass NoneTyp
@@ -1809,32 +... |
4718ee6ecd3fffea2f314d2929fc18dea86fc370 | add cython_anchor | libs/boxes/__init__.py | libs/boxes/__init__.py | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
from . import cython_nms
from . import cython_bbox
import nms
import tim... | Python | 0.00004 | @@ -417,28 +417,56 @@
rom .roi import roi_cropping
+%0Afrom . import cython_anchor
|
2ba017b14dc86bf40c109e36c8c2a1d1482b30cb | add tests for adaptation of multivaluated fields | scrapy/trunk/scrapy/tests/test_itemadaptor.py | scrapy/trunk/scrapy/tests/test_itemadaptor.py | import unittest
import string
from scrapy.contrib_exp.newitem.adaptors import adaptor, ItemAdaptor
from scrapy.contrib_exp.newitem import Item, StringField
class BaseItem(Item):
name = StringField()
class TestItem(BaseItem):
url = StringField()
summary = StringField()
class BaseAdaptor(ItemAdaptor):
... | Python | 0 | @@ -135,25 +135,10 @@
ort
-Item, StringField
+*
%0A%0A%0Ac
@@ -470,16 +470,17 @@
itle()%0A%0A
+%0A
class In
@@ -529,16 +529,217 @@
pass%0A%0A%0A
+class MultiValuedTestItem(Item):%0A names = MultiValuedField(StringField)%0A%0A%0Aclass MultiValuedItemAdaptor(ItemAdaptor):%0A item_class = MultiValuedTestItem... |
69358c5dce13f4a031b51d254824b6b3d4355847 | Move some code from typesystem.__init__ | numba/typesystem/__init__.py | numba/typesystem/__init__.py | from basetypes import *
from exttypes import *
from closuretypes import *
from ssatypes import *
from templatetypes import *
from typemapper import *
__all__ = minitypes.__all__ + [
'O', 'b1', 'i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8',
'f4', 'f8', 'f16', 'c8', 'c16', 'c32', 'template',
]
#---------------... | Python | 0.000008 | @@ -144,16 +144,42 @@
port *%0A%0A
+from shorthands import *%0A%0A
__all__
@@ -324,1229 +324,6 @@
e',%0A
+
%5D%0A
-%0A#------------------------------------------------------------------------%0A# Utilities%0A#------------------------------------------------------------------------%0A%0Adef is_obj(type):%0A retu... |
3ac9c53ffc6feb926ebde8dfe930f9235b2b6817 | Use explicit status | rhetoric/config/rendering.py | rhetoric/config/rendering.py | from django.http import HttpResponse
from django.core.serializers.json import DjangoJSONEncoder
from django.shortcuts import render
json_encode = DjangoJSONEncoder().encode
class JsonRendererFactory(object):
def __init__(self, name):
self.name = name
def __call__(self, request, view_response):
... | Python | 0.000001 | @@ -510,16 +510,44 @@
content,
+%0A
content
@@ -573,16 +573,102 @@
ent_type
+,%0A status=response.status_code%0A
)%0A%0A%0Aclas
|
8b90343deb066df5173e860796f6eb399f3a9ffb | Update tests to version 1.1.0 | exercises/rotational-cipher/rotational_cipher_test.py | exercises/rotational-cipher/rotational_cipher_test.py | import unittest
import rotational_cipher
# test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0
class RotationalCipher(unittest.TestCase):
def test_rotate_a_by_1(self):
self.assertEqual(rotational_cipher.rotate('a', 1), 'b')
def test_rotate_a_by_26(self):
self.assertEqua... | Python | 0.000663 | @@ -43,17 +43,12 @@
%0A%0A#
-t
+T
est
- case
s ad
@@ -63,16 +63,30 @@
om %60
-x-comm
+problem-specificati
on
+s
//ca
@@ -111,19 +111,11 @@
@ v
-ersion:
1.
-0
+1
.0%0A%0A
@@ -157,16 +157,115 @@
tCase):%0A
+ def test_rotate_a_by_0(self):%0A self.assertEqual(rotational_cipher.rotate('a', 0), 'a')%0A... |
4a2b4b60aff02455641778d7acc2637126c00fca | Fix HTTP headers | runtime/python-threaded/quark_threaded_runtime.py | runtime/python-threaded/quark_threaded_runtime.py | # Quark's Twisted Runtime and associated
__version__ = "0.1.0"
import threading
import time
import urllib2
from Queue import Queue, Empty
class _EventProcessor(threading.Thread):
QUIT = ("QUIT",)
def __init__(self, runtime):
super(_EventProcessor, self).__init__()
self.runtime = runtime
... | Python | 0.999818 | @@ -1612,17 +1612,16 @@
tf-8%22):
-%5B
str(valu
@@ -1638,17 +1638,16 @@
%22utf-8%22)
-%5D
for key
@@ -1810,17 +1810,16 @@
gth%22%5D =
-%5B
str(len(
@@ -1829,17 +1829,16 @@
yBytes))
-%5D
%0A
|
6bdcd8df3ca419cc9dcadc9d234e33133f489778 | Add test for find-qca-path. | tests/qca_test.py | tests/qca_test.py | import json
import unittest
import requests
from ndex.beta.path_scoring import PathScoring
from bioagents.qca import QCA
# BELOW ARE OLD QCA TESTS
def test_improved_path_ranking():
qca = QCA()
sources = ["E2F1"]
targets = ["PTEN"]
qca_results2 = qca.find_causal_path(targets, sources)
print(qca_re... | Python | 0 | @@ -114,16 +114,137 @@
ort QCA%0A
+from kqml.kqml_list import KQMLList%0Afrom tests.util import ekb_from_text%0Afrom bioagents.qca.qca_module import QCA_Module%0A
%0A%0A# BELO
@@ -1846,16 +1846,505 @@
list)%0A%0A%0A
+def test_find_qca_path():%0A content = KQMLList('FIND-QCA-PATH')%0A content.sets('target', ekb... |
d4ca8cc2a8d823f184eb62c6581d049423d1ba7c | Make required arguments optional. | ctutlz/scripts/decompose_cert.py | ctutlz/scripts/decompose_cert.py | '''Decompose an ASN.1 certificate into its components tbsCertificate in DER
format, signatureAlgorithm in DER format, and signatureValue as bytes according
to https://tools.ietf.org/html/rfc5280#section-4.1
'''
import argparse
import base64
import pyasn1_modules.rfc5280
from pyasn1.codec.der.decoder import decode as ... | Python | 0.000001 | @@ -383,16 +383,37 @@
_encoder
+%0Afrom utlz import flo
%0A%0Afrom c
@@ -1104,23 +1104,27 @@
ormat')%0A
+%0A
-req
+parser
.add_arg
@@ -1155,32 +1155,35 @@
+
+
metavar='%3Cfilena
@@ -1180,32 +1180,35 @@
r='%3Cfilename%3E',%0A
+
@@ -1249,32 +1249,37 @@
... |
3fb07d4d9d2adfcee4ed9550750b7c474e5b8ccc | fix sql migrations not being committed | pajbot/migration/db.py | pajbot/migration/db.py | from contextlib import contextmanager
class DatabaseMigratable:
def __init__(self, conn):
self.conn = conn
@contextmanager
def create_resource(self):
with self.conn.cursor() as cursor:
# begins a transaction automatically
cursor.execute("CREATE TABLE IF NOT EXISTS... | Python | 0.000002 | @@ -225,46 +225,17 @@
-# begins a transaction automatically%0A%0A
+try:%0A
@@ -328,17 +328,20 @@
NULL)%22)%0A
-%0A
+
@@ -356,16 +356,142 @@
d cursor
+%0A cursor.execute(%22COMMIT%22)%0A except:%0A cursor.execute(%22ROLLBACK%22)%0A r... |
293101edfd5226a4804c9b01360acb5c6dca4342 | Bump version | radar/__init__.py | radar/__init__.py | __version__ = '2.45.2'
| Python | 0 | @@ -13,11 +13,11 @@
= '2.45.
-2
+3
'%0A
|
3188a6668ad768c2107a4f3fd9bcc4e77aff3120 | Remove extra blank line at end of file | tt/tests/unit/trees/test_tree_init.py | tt/tests/unit/trees/test_tree_init.py | """Tests for the initialization of expression trees."""
import unittest
from tt.trees import BooleanExpressionTree as bet
class TestExpressionTreeInit(unittest.TestCase):
def test_is_cnf_single_operand(self):
"""Test cnf determination for single operand trees."""
for postfix_tokens in (['0'], [... | Python | 0.000002 | @@ -2761,29 +2761,28 @@
'and', 'and'%5D).is_cnf)%0A
-%0A
|
5e20ea0dc09ab2f5f1f1278d763626a3b30a0c0c | update community api to released ver | misp_modules/modules/expansion/greynoise.py | misp_modules/modules/expansion/greynoise.py | import requests
import json
misperrors = {"error": "Error"}
mispattributes = {"input": ["ip-dst", "ip-src"], "output": ["text"]}
moduleinfo = {
"version": "1.0",
"author": "Brad Chiappetta <brad@greynoise.io>",
"description": "Module to access GreyNoise.io API.",
"module-type": ["hover"],
}
moduleconfi... | Python | 0 | @@ -1628,12 +1628,8 @@
api.
-dev.
grey
|
70e7344ce874016cf792144888ccc3a09bc7b009 | Remove deprecated oslo_db.sqlalchemy.test_base | octavia/tests/functional/db/base.py | octavia/tests/functional/db/base.py | # Copyright 2014 Rackspace
#
# 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 agree... | Python | 0.000651 | @@ -747,37 +747,35 @@
rom oslo
-_db.sqlalchemy import
+test import base as
test_ba
@@ -979,34 +979,36 @@
tBase(test_base.
-Db
+Base
TestCase):%0A%0A
|
704b10469628c9432c030ada3e8126594f8cf774 | Bump version | radar/__init__.py | radar/__init__.py | __version__ = '2.45.0'
| Python | 0 | @@ -17,7 +17,7 @@
.45.
-0
+1
'%0A
|
327d623334566ef0311183db8752ba2a4dd5c025 | Add soyutils_idom.js to Closure Rules | closure/templates/closure_js_template_library.bzl | closure/templates/closure_js_template_library.bzl | # Copyright 2016 The Closure Rules Authors. 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/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 0.000001 | @@ -5009,32 +5009,41 @@
deps = deps + %5B
+%0A
str(Label(%22//thi
@@ -5080,16 +5080,22 @@
l_dom%22))
+,%0A
%5D%0A%0A clo
|
a6ed415e887930322e821ba646e43755e15ac157 | add attribute accuracy to semantic_segmentation_loss | chainercv/links/loss/semantic_segmentation_loss.py | chainercv/links/loss/semantic_segmentation_loss.py | import chainer
from chainer import cuda
import chainer.functions as F
from chainer import reporter
import numpy as np
from chainercv.evaluations import eval_semantic_segmentation
class PixelwiseSoftmaxClassifier(chainer.Chain):
def __init__(self, model, ignore_label=-1, class_weight=None,
comp... | Python | 0.000002 | @@ -1328,32 +1328,62 @@
elf.loss%7D, self)
+%0A%0A self.accuracy = None
%0A if self
@@ -1473,51 +1473,23 @@
-pas, mpas, mious, fwious =%5C%0A
+self.accuracy =
eva
@@ -1512,16 +1512,33 @@
ntation(
+%0A
label, t
@@ -1635,19 +1635,32 @@
xp.mean(
-pas
+self.accuracy... |
ad04cf539a689af9609d8c7eea925e2fcbc0fa70 | Add limit and where options to rebuild_text_index | cityhallmonitor/management/commands/rebuild_text_index.py | cityhallmonitor/management/commands/rebuild_text_index.py | import logging
from django.core.management.base import BaseCommand
from cityhallmonitor.models import Document
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'For each document, force an update of its related fields and its postgres text index'
logger.info('Rebuilding text index')
... | Python | 0.000002 | @@ -278,141 +278,684 @@
-logger.info('Rebuilding text index')%0A %0A def handle(self, *args, **options):%0A for i,d in enumerate(Document.objects.all()
+def add_arguments(self, parser):%0A parser.add_argument('--limit', type=int, %0A help='Process up to LIMIT documents')%0A p... |
dca4357f0ef91125378f5a576fb18b4ef2202b8e | update cloudcare urls | corehq/apps/cloudcare/urls.py | corehq/apps/cloudcare/urls.py | from django.conf.urls import patterns, url, include
from corehq.apps.cloudcare.views import (
EditCloudcareUserPermissionsView,
CloudcareMain,
)
app_urls = patterns('corehq.apps.cloudcare.views',
url(r'^view/(?P<app_id>[\w-]+)/modules-(?P<module_id>[\w-]+)/forms-(?P<form_id>[\w-]+)/context/$',
'fo... | Python | 0 | @@ -145,16 +145,191 @@
reMain,%0A
+ form_context, get_cases, filter_cases, get_apps_api, get_app_api,%0A get_fixtures, get_sessions, get_session_context, get_ledgers, render_form,%0A sync_db_api, default,%0A
)%0A%0Aapp_u
@@ -485,17 +485,16 @@
-'
form_con
@@ -489,33 +489,32 @@
form_context
-'
... |
0480867b7ba9ae519d7ef7ab37bfb9c9a1553287 | Bump version | radar/__init__.py | radar/__init__.py | __version__ = '2.5.0'
| Python | 0 | @@ -16,7 +16,7 @@
2.5.
-0
+1
'%0A
|
84d0140f25dec5ed9c30d696e859921fb3a866cd | Fix package directory path | data/gen_json.py | data/gen_json.py | #!/usr/bin/env python3
import json
import os
import subprocess
import sys
import re
def main():
base_offset = 41
go_version_raw = subprocess.Popen("go version",
shell=True,
stdout=subprocess.PIPE
).stdout.rea... | Python | 0 | @@ -1838,16 +1838,60 @@
t_dir)%0A%0A
+ libdir = str(pkg).rsplit('/', 1)%5B0%5D%0A
@@ -1926,24 +1926,14 @@
ir,
-''.join(library)
+libdir
)%0A
|
169d4f2d39c0fb24bc3f17d374ee6dfa88563a82 | add detailed message to assert (#54) | scripts/release/create_binarydeb_task_generator.py | scripts/release/create_binarydeb_task_generator.py | #!/usr/bin/env python3
from __future__ import print_function
import argparse
import os
import sys
from rosdistro import get_distribution_file
from rosdistro import get_index
from apt import Cache
from ros_buildfarm.argument import add_argument_arch
from ros_buildfarm.argument import add_argument_binarydeb_dir
from ... | Python | 0 | @@ -4702,16 +4702,306 @@
es) == 1
+, %5C%0A 'The binarydeb job could not find the .dsc file. ' %5C%0A 'If a new version of the package has been released recently (within 15 minutes) ' %5C%0A 'the new sourcedeb might not have been generated yet and ' %5C%0A 'the next automatically scheduled ... |
66795b04e27a6de4f0d0ed4d52064cd3ba6e76b5 | Bump version | radar/__init__.py | radar/__init__.py | __version__ = '2.11.2'
| Python | 0 | @@ -13,11 +13,11 @@
= '2.11.
-2
+3
'%0A
|
c5cec60bc6b4c3e785bd616bcb5d5cff5770e408 | Add PPV tests along all LOS; correct lwidth comparisons | turbustat/simulator/tests/test_ppv.py | turbustat/simulator/tests/test_ppv.py |
from ..make_cube import make_ppv
from ..gen_field import make_3dfield
import pytest
import numpy as np
import numpy.testing as npt
import astropy.units as u
try:
from spectral_cube import SpectralCube
SPECCUBE_INSTALL = True
except ImportError:
SPECCUBE_INSTALL = False
@pytest.mark.skipif("not SPECCUBE... | Python | 0 | @@ -151,16 +151,46 @@
its as u
+%0Aimport astropy.constants as c
%0A%0Atry:%0A
@@ -354,16 +354,100 @@
STALL%22)%0A
+@pytest.mark.parametrize('axis', %5B0, 1, 2%5D)%0A# @pytest.mark.parametrize('axis', %5B0%5D)%0A
def test
@@ -451,16 +451,20 @@
est_ppv(
+axis
):%0A '
@@ -551,16 +551,243 @@
'''%0A%0A
+ #... |
61c1c5eb2bf62fe41dde2643356731cbf6b1b435 | Add TODO to file_verification() | convenience/file_convenience/file_verification.py | convenience/file_convenience/file_verification.py | import hashlib
def file_verification(file, v_type, v_val):
v_types = {"md5": hashlib.md5,
"sha1": hashlib.sha1,
"sha256": hashlib.sha256,
"sha512": hashlib.sha512
}
with open(file, 'rb') as fileObj:
content = fileObj.read()
hash = v_types[... | Python | 0 | @@ -53,16 +53,64 @@
v_val):%0A
+ # TODO: do dummy proofing for input values.%0A
v_ty
|
bb46136c70f63f6a34ac36b418f4984b62dae0c2 | Bring in json_safe_payload method (#3643) | parlai/core/message.py | parlai/core/message.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
File for Message object and associated functions.
The Message object's key function is to prevent users from editing... | Python | 0 | @@ -411,16 +411,75 @@
tations%0A
+from typing import Any, Dict%0A%0A%0AUNSAFE_FIELDS = %7B'metrics'%7D%0A
%0A%0Aclass
@@ -1477,8 +1477,407 @@
ding'))%0A
+%0A def json_safe_payload(self) -%3E Dict%5Bstr, Any%5D:%0A %22%22%22%0A Prepare a Message for delivery to a client via json.%0A%0A Useful... |
640c35f0861983adb0474cfbc9330ee463d74744 | Convert password to bytes | corehq/motech/dhis2/forms.py | corehq/motech/dhis2/forms.py | import bz2
import logging
from base64 import b64encode
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from crispy_forms import bootstrap as twbscrispy
from crispy_forms import layout as crispy
from crispy_forms.helper import FormHelp... | Python | 0.999999 | @@ -2924,16 +2924,89 @@
intext.%0A
+ plaintext = self.cleaned_data%5B'password'%5D.encode('utf8')%0A
@@ -3062,37 +3062,17 @@
ess(
-self.cleaned_data%5B'password'%5D
+plaintext
))%0A
|
c970cab38d846c4774aee52e52c23ed2452af96a | Remove unused and buggy import | openfisca_france_data/tests/base.py | openfisca_france_data/tests/base.py | # -*- coding: utf-8 -*-
from openfisca_core.tools import assert_near
from openfisca_france.tests.base import get_cached_composed_reform, get_cached_reform
from .. import france_data_tax_benefit_system, FranceDataTaxBenefitSystem
__all__ = [
'assert_near',
'france_data_tax_benefit_system',
'FranceDataT... | Python | 0 | @@ -201,36 +201,8 @@
stem
-, FranceDataTaxBenefitSystem
%0A%0A%0A_
@@ -273,42 +273,8 @@
m',%0A
- 'FranceDataTaxBenefitSystem',%0A
|
c3629f15477cd1e49d7e63fae2e0f43f7e4f1fe3 | fix tabs | course_grader/test/dao/term.py | course_grader/test/dao/term.py | from django.test import TestCase
from uw_sws.util import fdao_sws_override
from course_grader.dao.term import *
from course_grader.exceptions import InvalidTerm
@fdao_sws_override
class TermDAOFunctionsTest(TestCase):
def test_submission_deadline_warning(self):
term = term_from_param('2013-autumn')
... | Python | 0.000001 | @@ -772,17 +772,24 @@
(self):%0A
-%09
+
term = t
@@ -1670,17 +1670,24 @@
(self):%0A
-%09
+
with sel
@@ -2690,11 +2690,20 @@
=2,%0A
-%09%09%09
+
C
@@ -2751,17 +2751,24 @@
0:00'):%0A
-%09
+
term
@@ -2796,9 +2796,16 @@
s()%0A
-%09
+
@@ -2953,16 +2953,16 @@
... |
78df33ee8ecb167f3d88ef326be1b5f501b8eb00 | fix doc | chainercv/utils/testing/generate_random_bbox.py | chainercv/utils/testing/generate_random_bbox.py | import numpy as np
def generate_random_bbox(n, img_size, min_length, max_length):
"""Generate valid bounding boxes with random position and shape.
Args:
n (int): The number of bounding boxes.
img_size (tuple): A tuple of length 2. The width and the height
of the image on which bou... | Python | 0.000001 | @@ -345,34 +345,36 @@
min_length (
-in
+floa
t): The minimum
@@ -428,18 +428,20 @@
length (
-in
+floa
t): The
@@ -668,39 +668,48 @@
ns :
-obj
+math
:%60x_
+%7B
min
+%7D
, y_
+%7B
min
+%7D
, x_
+%7B
max
+%7D
, y_
+%7B
max
+%7D
%60,%0A
@@ -724,34 +724,46 @@
here
- :obj
+%0A :math
:%60x_
+%7B... |
fd3f5334f8614fdc7ea581fffd7626aa32e974f7 | Bump version to 0.7.1 | pdfplumber/_version.py | pdfplumber/_version.py | version_info = (0, 7, 0)
__version__ = ".".join(map(str, version_info))
| Python | 0 | @@ -15,17 +15,17 @@
(0, 7,
-0
+1
)%0A__vers
|
5099a83b2351adb0c6568b5ee40e0cfa2babcb7b | Add docstring | server_env_magentoerpconnect/magento_model.py | server_env_magentoerpconnect/magento_model.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | Python | 0.000005 | @@ -1872,32 +1872,194 @@
v_fields(self):%0A
+ %22%22%22Return the list of fields that are concerned%0A by the environment setup%0A%0A :return: a list of field name%0A :rtype: list%0A %22%22%22%0A%0A
return %5B
@@ -2147,32 +2147,96 @@
_by_name(self):%0A
+ %22%22%22Com... |
02edaec8eae6a67cb24a1948d2de3b40d3922b50 | Fix syntax error | deployment/cosmosdb.py | deployment/cosmosdb.py | import logging
from azure.cosmos.cosmos_client import CosmosClient
from azure.cosmos.errors import HTTPFailure
from config import Mongo
log = logging.getLogger(__name__)
def configure_database_with_shared_throughput(db_name, master_key, url_connection):
client = CosmosClient(url_connection=url_connection, auth={"... | Python | 0.000585 | @@ -337,17 +337,16 @@
er_key%7D)
-)
%0A db =
|
a7e385fa27474b26fe1c0572147aa838eb1398f8 | check if spassword plugin is enabled before use their SQL tables | keystone_spassword/contrib/spassword/backends/sql.py | keystone_spassword/contrib/spassword/backends/sql.py | #
# Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... | Python | 0 | @@ -3409,16 +3409,55 @@
r_ref):%0A
+ if CONF.spassword.enabled:%0A
@@ -3493,32 +3493,36 @@
expired%0A
+
session = sql.ge
@@ -3533,32 +3533,36 @@
ssion()%0A
+
+
spassword_ref =
@@ -3614,24 +3614,28 @@
'%5D)%0A
+
if not (spas
@@ -3658,32 +3658,36 @@
e):%0A... |
5752eabe46a43693f46e7f4cf12a188649cf2f4d | test ok! | usecases/test_install/test_install.py | usecases/test_install/test_install.py | # -*- coding: utf-8 -*-
"""
Testing the Python numpy, pystruct, AD3, libxml2, cvxopt installation - takes about 30 seconds
Copyright Xerox(C) 2016 JL. Meunier
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publi... | Python | 0 | @@ -2987,24 +2987,160 @@
Dir, lDir)%0D%0A
+ if False:%0D%0A #you can also test the prediction, but it will generate a file %227749_du.mpxml%22 in trnskrbs_3820/col%0D%0A
doer
|
d8377a8143a0ee20d2e90cefa5d60f48991d0e6b | Fix SpiHardwareLightBank.py | code/python/echomesh/light/SpiHardwareLightBank.py | code/python/echomesh/light/SpiHardwareLightBank.py | from __future__ import absolute_import, division, print_function, unicode_literals
from echomesh.base import Config
from echomesh.light import SetupDebianSpiLights
from echomesh.light.SpiLightBank import SpiLightBank
from echomesh.util import Log
LOGGER = Log.logger(__name__)
_LATCH_BYTE_COUNT = 3
_LATCH = bytearray... | Python | 0.000001 | @@ -801,16 +801,27 @@
getattr(
+SpiHardware
LightBan
|
bfe091d7646c739f5f589fc91d0584f1d8baa8a2 | Update databroker/v2.py | databroker/v2.py | databroker/v2.py | import event_model
import tempfile
from .core import parse_handler_registry, discover_handlers, parse_transforms
from intake.catalog import Catalog
from event_model import DuplicateHandler
from functools import partial
from pathlib import Path
class Broker(Catalog):
"""
This is a thin wrapper around intake.C... | Python | 0 | @@ -1812,17 +1812,16 @@
ansforms
-
: dict%0A
|
98c8cd033b61ac67c57d0eb2f6f96cfa395159ea | Drop ClusterGroup.__repr__ | devito/ir/clusters/cluster.py | devito/ir/clusters/cluster.py | from itertools import chain
import numpy as np
from cached_property import cached_property
from frozendict import frozendict
from devito.ir.equations import ClusterizedEq
from devito.ir.support import IterationSpace, DataSpace, Scope, detect_io
from devito.symbolics import estimate_cost
from devito.tools import as_tu... | Python | 0 | @@ -6323,104 +6323,8 @@
bj%0A%0A
- def __repr__(self):%0A return %22ClusterGroup(%5B%25s%5D)%22 %25 ','.join('%25s' %25 c for c in self)%0A%0A
|
94b2a014b04d860c579b21506b2f12a6325c3040 | move more stuff to use core.api | lib/neuroimaging/algorithms/statistics/regression.py | lib/neuroimaging/algorithms/statistics/regression.py | """
This module provides various regression analysis techniques to model the
relationship between the dependent and independent variables.
"""
__docformat__ = 'restructuredtext'
import os
import numpy as N
from neuroimaging.core.image.image import Image
class LinearModelIterator(object):
def __init__(self, it... | Python | 0 | @@ -230,19 +230,11 @@
ore.
-image.image
+api
imp
|
1f6db6ae815b3a62a91971f07ddd8eb3890e20bd | remove unused imports | lib/neuroimaging/algorithms/statistics/regression.py | lib/neuroimaging/algorithms/statistics/regression.py | """
This module provides various regression analysis techniques to model the
relationship between the dependent and independent variables.
"""
import gc
import numpy as N
import numpy.linalg as L
from neuroimaging import traits
from scipy.sandbox.models.regression import OLSModel, WLSModel, ARModel, Results
class Li... | Python | 0.000001 | @@ -170,33 +170,8 @@
s N%0A
-import numpy.linalg as L%0A
from
@@ -201,89 +201,8 @@
aits
-%0Afrom scipy.sandbox.models.regression import OLSModel, WLSModel, ARModel, Results
%0A%0Acl
|
588597837a07c4bfb4e700e65a127642833f56a9 | Add MangaDex/HowToOpenATriangularRiceball | dosagelib/plugins/mangadex.py | dosagelib/plugins/mangadex.py | # SPDX-License-Identifier: MIT
# Copyright (C) 2019-2020 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
import json
from ..scraper import _ParserScraper
class MangaDex(_ParserScraper):
imageSearch = '//img[contains(@class, "_images")]/@data-url'
prevSearch = '//a[contains(@class, "_prevEpisode")]'... | Python | 0 | @@ -3032,24 +3032,80 @@
ya', 6770),%0A
+ cls('HowToOpenATriangularRiceball', 19305),%0A
|
929a409f4e6e6396835460964f5f7c3e5a150d68 | Fix coordinates for face drawing | code/webcam-emotion-recognition/faceRecognition.py | code/webcam-emotion-recognition/faceRecognition.py | import cv2
import numpy as np
# Create window for image display
CASCADE_FN = "haarcascade_frontalface_default.xml"
# The scale used for face recognition.
# It is important as the face recognition algorithm works better on small images
# Also helps with removing faces that are too far away
RESIZE_SCALE = 3
RECTANGE_CO... | Python | 0.000019 | @@ -2199,17 +2199,17 @@
dinates%5B
-2
+1
%5D))%0A
|
db4dfd147e258d64f4ca970ab5ba6ac3e6c975d2 | Change css locator for Course Outline page in acceptance test | cms/djangoapps/contentstore/features/checklists.py | cms/djangoapps/contentstore/features/checklists.py | #pylint: disable=C0111
#pylint: disable=W0621
from lettuce import world, step
from nose.tools import assert_true, assert_equal, assert_in # pylint: disable=E0611
from terrain.steps import reload_the_page
from selenium.common.exceptions import StaleElementReferenceException
############### ACTIONS ##################... | Python | 0 | @@ -124,19 +124,8 @@
qual
-, assert_in
#
@@ -2166,69 +2166,49 @@
sert
-_in('Course Outline',
world.
+is_
css_
-text('.outline .page-header')
+present('body.view-outline'
)%0A
|
aa0bdae2a88a509ade87326f8d0a18d3ab63e66b | clear the bit | contrib/TACC/clear_stack_execute_bit/xalt_db_clear_bit.py | contrib/TACC/clear_stack_execute_bit/xalt_db_clear_bit.py |
from __future__ import print_function
import os, sys, base64
import MySQLdb, argparse
import time, subprocess
from operator import itemgetter
from datetime import datetime, timedelta
try:
import configparser
except:
import ConfigParser as configparser
dirNm, execName = os.path.split(os.path.realpath(sys.argv[0]))... | Python | 0.000003 | @@ -1469,55 +1469,8 @@
link
- %5C%0A where build_user = 'mclay'
%22%0A
|
9c206ca3ee8502a70c7817d5bc7edfd88c4a8e9a | Add check of first request to indicator logic | detectem/core.py | detectem/core.py | import logging
from detectem.utils import (
extract_version, extract_name, extract_from_headers,
get_most_complete_version, check_presence
)
from detectem.plugin import get_plugin_by_name
from detectem.settings import VERSION_TYPE, INDICATOR_TYPE, HINT_TYPE
logger = logging.getLogger('detectem')
class Resul... | Python | 0 | @@ -6265,16 +6265,138 @@
cators')
+%0A if not self._is_first_request(entry) and 'header' in grouped_matchers:%0A del grouped_matchers%5B'header'%5D
%0A%0A
|
c0bce3314f27ab89b19f8a05c3e3eeb7f137591f | add member count on guild create | rowboat/plugins/influx.py | rowboat/plugins/influx.py | from gevent.lock import Semaphore
from datetime import datetime
from influxdb import InfluxDBClient
from rowboat import RowboatPlugin as Plugin
class InfluxPlugin(Plugin):
def load(self, ctx):
super(InfluxPlugin, self).load(ctx)
self.influx = InfluxDBClient(database='rowboat')
self.influx... | Python | 0 | @@ -3286,32 +3286,281 @@
uild.members))%0A%0A
+ @Plugin.listen('GuildCreate')%0A def on_guild_create(self, event):%0A if event.guild.member_count:%0A self.write_point('guild.members.count', %7B%0A 'guild_id': event.guild.id,%0A %7D, event.guild.member_count)%0A%0A
... |
0d0ff4b40bfe89044c890c4da377a7f712647cd5 | fix regression | rqalpha/data/converter.py | rqalpha/data/converter.py | # -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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 ... | Python | 0.000001 | @@ -1634,33 +1634,33 @@
4, 1 / 10000.0,
-2
+3
),%0A 'close':
@@ -1678,33 +1678,33 @@
4, 1 / 10000.0,
-2
+3
),%0A 'high': R
@@ -1721,33 +1721,33 @@
4, 1 / 10000.0,
-2
+3
),%0A 'low': Ru
@@ -1763,33 +1763,33 @@
4, 1 / 10000.0,
-2
+3
),%0A 'limit_up
@@ -1810,33 +1810,33 @@
4, 1 / 10000.0,
-2
+3
... |
dc7ff32c803539910d7539c02682fd4c845fb271 | Fix FactoryHandler: hasattr instead of getattr (which raises an AttributeError) | common/src/gosa/common/components/jsonrpc_utils.py | common/src/gosa/common/components/jsonrpc_utils.py | # This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import datetime
import json
import pkg_resources
import inspect
import base64
json_handlers = {}
... | Python | 0 | @@ -3126,19 +3126,19 @@
if
-get
+has
attr(bas
|
0a06cd3036ee5044de0aa267735a3209c9a028ed | Test if theta2D from fit matches given in PowerSpectrum | turbustat/tests/test_pspec.py | turbustat/tests/test_pspec.py | # Licensed under an MIT open source license - see LICENSE
from __future__ import print_function, absolute_import, division
import pytest
import numpy.testing as npt
import astropy.units as u
from astropy.io import fits
from ..statistics import PowerSpectrum, PSpec_Distance
from ._testing_data import (dataset1, datase... | Python | 0 | @@ -131,16 +131,35 @@
pytest%0A
+import numpy as np%0A
import n
@@ -3621,28 +3621,897 @@
1.07 * plaw, - 0.93 * plaw)%0A
+%0A%0A@pytest.mark.parametrize('theta',%0A %5B0., np.pi / 4., np.pi / 2., 7 * np.pi / 8.%5D)%0Adef test_pspec_fit2D(theta):%0A '''%0A Since test_elliplaw tests every... |
ef4d5abc8c664d349bfd791bb6763b23cb0b920e | Correct mistakes in androidServer.py | androidServer.py | androidServer.py |
import socket
import sys
import threading
class Server:
def __init__(self, port, relay):
self.port = port
self.running = False
self.thread = threading.Thread(target = self.__startServer)
self.thread.setDaemon(True) # dies with main thread
self.sock = socket.socket(socket.... | Python | 0.000317 | @@ -570,18 +570,17 @@
ted to %22
- +
+,
addr%0A
@@ -767,16 +767,21 @@
+self.
relay.sw
@@ -928,10 +928,9 @@
om %22
- +
+,
add
|
16bc8c8b27012867224fe472a53cbe23c6824c58 | test `Video.to_json()` with actual data | vidscraper/tests/unit/test_video.py | vidscraper/tests/unit/test_video.py | # Copyright 2012 - Participatory Culture Foundation
#
# This file is part of vidscraper.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notic... | Python | 0.000001 | @@ -1344,16 +1344,89 @@
t json%0A%0A
+from vidscraper.tests.unit.test_youtube import CARAMELL_DANSEN_ATOM_DATA%0A
from vid
@@ -2274,43 +2274,446 @@
4%22)%0A
-%0A data_json = video.to_json(
+ # we load the video data this way to avoid depending on the network%0A video_data = CARAMELL_DANSEN_ATOM_... |
449e9773112e752d776eb7c4b1bf018372353e45 | update style | jtssql/storage.py | jtssql/storage.py | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import six
from jsontableschema.model import SchemaModel
from sqlalchemy import (
Table, Column, MetaData,
Text, Integer, Float, B... | Python | 0.000001 | @@ -4477,24 +4477,25 @@
%22%22%22%0A
+%0A
# Pr
|
25fa54fa570d279cc215e1bbde73534349647236 | fix minor error | code/python/seizures/submission/SubmissionFile.py | code/python/seizures/submission/SubmissionFile.py | import os
from pandas import DataFrame, read_csv
from pandas.DataFrame import to_csv
from seizures.features.FeatureExtractBase import FeatureExtractBase
from seizures.prediction.PredictorBase import PredictorBase
class SubmissionFile():
"""
Class to generate submission files
@author Heiko
"""
... | Python | 0.000005 | @@ -2226,49 +2226,4 @@
lt)%0A
- %0Aif __name__ == %22__main__%22:%0A %0A
|
db4ccaf78f98a761308ccbf76d8e533380b422c4 | add __all__ to fields.py in newitem | scrapy/trunk/scrapy/contrib_exp/newitem/fields.py | scrapy/trunk/scrapy/contrib_exp/newitem/fields.py | import datetime
import decimal
import re
class ItemFieldValueError(Exception):
pass
class ItemField(object):
def __init__(self, required=False, default=None):
self.required = required
self._default = default
def assign(self, value):
if hasattr(value, '__iter__'):
ret... | Python | 0.000003 | @@ -36,16 +36,154 @@
rt re%0A%0A%0A
+__all__ = %5B'BooleanItemField', 'DateItemField', 'DecimalItemField',%0A 'FloatItemField', 'IntegerItemField', 'StringItemField'%5D%0A%0A%0A
class It
|
3027a30c7b4eff28c5a52a8e42f69cc117d7a551 | Use copy_permissions in workflow | resolwe/flow/execution_engines/workflow/__init__.py | resolwe/flow/execution_engines/workflow/__init__.py | """An execution engine that supports workflow specifications."""
from __future__ import absolute_import, division, print_function, unicode_literals
import collections
from six import string_types
from django.contrib.contenttypes.models import ContentType
from django.db import transaction
from guardian.models import... | Python | 0 | @@ -645,16 +645,71 @@
Process%0A
+from resolwe.permissions.utils import copy_permissions%0A
%0A%0Aclass
@@ -4328,414 +4328,29 @@
-data_ctype = ContentType.objects.get_for_model(data)%0A for perm in UserObjectPermission.objects.filter(object_pk=data.id, content_type=data_ctype):%0A ass... |
3a2003f05ade8316bd2ff7d98f679d66740bf009 | Add API test for node recover action | senlin/tests/tempest/api/nodes/test_node_action.py | senlin/tests/tempest/api/nodes/test_node_action.py | # 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, software
# distributed under t... | Python | 0.000001 | @@ -682,16 +682,21 @@
deAction
+Check
(base.Ba
@@ -760,16 +760,21 @@
deAction
+Check
, self).
@@ -1124,64 +1124,1033 @@
ion_
-trigger(self
+Check(self):%0A params = %7B%0A 'check': %7B%0A %7D%0A %7D%0A # Trigger node action%0A res = self.client.trigger_action('node... |
1bf98e80b828af508cbd73efabc1eaa6b75b19c5 | Remove unused imports | d4s2_api_v2/tests_serializers.py | d4s2_api_v2/tests_serializers.py | from django.test import TestCase
from d4s2_api_v2.models import DDSDeliveryPreview
from d4s2_api_v2.serializers import DDSDeliveryPreviewSerializer
from mock import MagicMock
class DeliveryPreviewSerializerTestCase(TestCase):
def setUp(self):
self.data = {
'project_id': 'project-1234',
... | Python | 0.000001 | @@ -30,58 +30,8 @@
ase%0A
-from d4s2_api_v2.models import DDSDeliveryPreview%0A
from
@@ -95,35 +95,8 @@
zer%0A
-from mock import MagicMock%0A
%0A%0Acl
|
624470b088b5bd06e95f77757a2fdd5f53a7b605 | allow modifying standard theme in migrate | frappe/website/doctype/website_theme/website_theme.py | frappe/website/doctype/website_theme/website_theme.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from os.path import join as join_path, exists as path_exists
class WebsiteTheme(D... | Python | 0 | @@ -818,16 +818,43 @@
.in_test
+ or frappe.flags.in_migrate
))%0A%0A%09def
|
56bd9a8214c9b7869d19923576e8c34140fb252b | fix typo clean()->_clean() | daemonize/test/test_daemonize.py | daemonize/test/test_daemonize.py | #!/usr/bin/env python2
# coding: utf-8
import os
import subprocess
import time
import unittest
import daemonize
this_base = os.path.dirname(__file__)
def subproc(script):
subproc = subprocess.Popen(['sh'],
close_fds=True,
stdin=subprocess.PIPE,
... | Python | 0.99972 | @@ -1542,32 +1542,33 @@
):%0A self.
+_
clean()%0A%0A def
@@ -1597,16 +1597,17 @@
self.
+_
clean()%0A
|
4c682fc01b7e405b1ae084b6c0645a7ea2738ece | correct class and ng-click | aot/board/svg.py | aot/board/svg.py | from lxml import etree
from aot.board import get_colors_disposition
class SvgBoardCreator:
#: XML namespace. Required to use xpath to search the DOM.
NS = {'ns': 'http://www.w3.org/2000/svg'}
_SQUARE_ID_TEMPLATE = 'square-{}-{}'
_ROTATE_TEMPLATE = 'rotate({} {} {})'
_NG_PLAY_ATTR_TEMPLATE = "play... | Python | 0 | @@ -4516,16 +4516,89 @@
width))%0A
+ self._set_ng_click_attr(element, current_xid, self._yid)%0A
@@ -5081,18 +5081,19 @@
r =
-str(
color
-)
+.value
.low
|
bd9b3ce8fe22e039554f5e86744aa4828d3c5ed8 | set default auto field | tests/settings.py | tests/settings.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
HELPER_SETTINGS = {
'INSTALLED_APPS': [
'easy_thumbnails',
'filer',
'mptt',
],
'ALLOWED_HOSTS': ['localhost'],
'CMS_LANGUAGES': {
1: [{
'code': 'en',
'name': 'English',
}]
},
'LANGUAGE_... | Python | 0.000001 | @@ -322,24 +322,80 @@
ODE': 'en',%0A
+ 'DEFAULT_AUTO_FIELD': 'django.db.models.AutoField',%0A
'SECRET_
|
ff36aed9a9f707e476869ec33f918859b039c709 | Fix failing test | custom/enikshay/tests/test_historical_adherence_report.py | custom/enikshay/tests/test_historical_adherence_report.py | import datetime
import uuid
import pytz
from django.test import override_settings, TestCase, RequestFactory
from mock import MagicMock
from corehq.form_processor.tests.utils import FormProcessorTestUtils
from custom.enikshay.const import ENIKSHAY_TIMEZONE
from custom.enikshay.reports import HistoricalAdherenceReport
... | Python | 0.000209 | @@ -6321,16 +6321,18 @@
ase'%5D, %22
+IP
%22)%0A
|
d20f902eed8882469954feac5435adb4e9bac167 | Check if themefile url exists (#9608) | frappe/website/doctype/website_theme/website_theme.py | frappe/website/doctype/website_theme/website_theme.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from os.path import join as join_path, exists as path_exists
class WebsiteTheme(D... | Python | 0 | @@ -2829,16 +2829,38 @@
_path()%0A
+%09%09if self.theme_url:%0A%09
%09%09theme_
@@ -2919,16 +2919,17 @@
%5B1:%5D)%0A%09%09
+%09
if not p
@@ -2952,16 +2952,60 @@
_path):%0A
+%09%09%09%09self.generate_bootstrap_theme()%0A%09%09else:%0A
%09%09%09self.
|
e0b9ab8cd745c9f43fb1d7a484a2649b30e4b8e6 | include auth | tests/settings.py | tests/settings.py | SECRET_KEY = '1234'
INSTALLED_APPS = (
'django.contrib.contenttypes',
'tests.testapp',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
ROOT_URLCONF = "tests.urls"
| Python | 0.999875 | @@ -67,16 +67,43 @@
types',%0A
+ 'django.contrib.auth',%0A
'tes
|
bcda52191b504e7157e1439c6ee1cc3a1ddf7fca | Add __all__ and license in __init__.py | derpibooru/__init__.py | derpibooru/__init__.py | from .search import Search
from .lists import Lists
| Python | 0.000158 | @@ -1,52 +1,1831 @@
-from .search import Search%0Afrom .lists import Lists
+# Copyright (c) 2014, Joshua Stone%0A# All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions are met:%0A#%0A# * Redistributions of ... |
977cde91584952588b4d365ffbb44afc9033ff31 | Update code, comments | FocusStack.py | FocusStack.py | """
Simple Focus Stacker
Author: Charles McGuinness (charles@mcguinness.us)
Copyright: Copyright 2015 Charles McGuinness
License: Apache License 2.0
This code will take a series of images and merge them so that each
pixel is taken from the image with the sharpest focus at that location.
The log... | Python | 0 | @@ -1674,24 +1674,182 @@
ges(images):
+%0A%0A # SIFT generally produces better results, but it is not FOSS, so chose the feature detector%0A # that suits the needs of your project. ORB does OK
%0A use_sif
@@ -1856,12 +1856,11 @@
t =
-Fals
+Tru
e%0A%0A
@@ -3253,111 +3253,350 @@
ge)%0A
-%0A%0A%0A
+ ... |
8691c1fc3ef0382ae6aa1cc2777017874c4113f1 | Create email_lib.py | email_lib.py | email_lib.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##This file contains functions to interact with the customer with email in the main.py file##
import geocode
from email.mime.text import MIMEText
from smtplib import SMTP
import os
#For security reasons we storage all the private information in Heroku server as s... | Python | 0.000015 | @@ -887,32 +887,76 @@
message = %0D%0A
+ subject = %22SIM state change alert%22%0D%0A
elif event =
@@ -1473,16 +1473,55 @@
iccid)%0D%0A
+ subject = %22IMEI change alert%22%0D%0A
elif
@@ -1560,24 +1560,64 @@
message = %0D%0A
+ subject = %22Data limit achived%22%0D%0A
elif eve
@... |
34bfc972b783d8a7035d43b3d14d128f01375982 | Add Print filter. | penchy/jobs/filters.py | penchy/jobs/filters.py | """
This module provides filters.
"""
from penchy.jobs.elements import Filter
class Tamiflex(Filter):
pass
class HProf(Filter):
pass
class Dacapo(Filter):
pass
class Send(Filter):
pass
class Receive(Filter):
pass
class Print(Filter):
pass | Python | 0 | @@ -248,24 +248,124 @@
Print(Filter):%0A
-pas
+%22%22%22%0A Prints everything fed to it on stdout.%0A %22%22%22%0A def run(self, **kwargs):%0A print kwarg
s
|
a72e6ef1aab06aab38bed83c39929b9d389cb5b2 | Modify test_service_manage_report_cleanup | senlin/tests/unit/engine/test_engine_startstop.py | senlin/tests/unit/engine/test_engine_startstop.py | # 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, software
# distributed unde... | Python | 0.000109 | @@ -6142,23 +6142,16 @@
_manage_
-report_
cleanup(
|
a14235508163cf3bf9ca37616826f31eeb385a69 | Use new setup api for membranes | membrane.py | membrane.py | import uuid
from contextlib import contextmanager
from rt import Actor, initial_behavior, Wait
from example import Printer
class Membrane(Actor):
# args: uid_to_proxy = {uid:actor}, proxy_to_uid = {proxy:uid},
# transport = {protocol: tcp|udp|http|...,
# ...data to connect...}
... | Python | 0 | @@ -157,76 +157,8 @@
rgs:
- uid_to_proxy = %7Buid:actor%7D, proxy_to_uid = %7Bproxy:uid%7D,%0A #
tra
@@ -244,16 +244,140 @@
ct...%7D%0A%0A
+ def setup(self):%0A self.uid_to_proxy = %7B%7D # %7Buid: actor%7D%0A self.proxy_to_uid = %7B%7D # %7Bproxy: uid%7D%0A %0A
@ini
|
f2700febc193353a8c88ce365cbd58b152fe64b2 | Create email_lib.py | email_lib.py | email_lib.py | # -*- coding: utf-8 -*-
from email.mime.text import MIMEText
from smtplib import SMTP
sender_email = os.environ.get('MAIL_USER', None)
sender_pass = os.environ.get('MAIL_PASS', None)
server_email = os.environ.get('MAIL_SERVER', None)
port_email = os.environ.get('MAIL_PORT', None)
SSL_email = os.environ.get('MA... | Python | 0.000015 | @@ -377,2110 +377,8 @@
%0D%0A%0D%0A
-def email_alert(recipient, iccid, customer):%0D%0A message = %22%3Cbr%3EHola %25s,%3Cbr%3E%3Cbr%3E Se ha detectado una alerta de seguridad de cambio de IMEI en la SIM con iccid = %25s%3Cbr%3E%3Cbr%3E Si este cambio de IMEI ha sido voluntario, por favor, ignore este mensaje. De l... |
9b1ca7f1c893245a6a53792c344e39077a917370 | use os.path.join to join pathnames | contrib/plugins/comments/xmlrpcplugins/pingback.py | contrib/plugins/comments/xmlrpcplugins/pingback.py | from config import py
from libs.pyblosxom import PyBlosxom
from libs.Request import Request
from libs import tools
import cgi, os, re, sgmllib, time, urllib
class parser(sgmllib.SGMLParser):
""" Shamelessly grabbed from Sam Ruby
from http://www.intertwingly.net/code/mombo/pingback.py
"""
""" extract t... | Python | 0.000001 | @@ -3627,20 +3627,29 @@
ig,
+os.path.join(
datadir
-+'/'+
+,
targ
@@ -3662,16 +3662,17 @@
e+'.txt'
+)
, datadi
|
151599602b9d626ebcfe5ae6960ea216b767fec2 | Update distutils patch to monkeypatch all paths from sys.path to ensure that distutils is never imported except from the same path as setuptools. Assert that 'distutils' is not already in sys.modules. | setuptools/distutils_patch.py | setuptools/distutils_patch.py | """
Ensure that the local copy of distutils is preferred over stdlib.
See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401
for more motivation.
"""
import sys
import importlib
from os.path import dirname
sys.path.insert(0, dirname(dirname(__file__)))
importlib.import_module('distutils')
sys.path... | Python | 0 | @@ -191,16 +191,34 @@
portlib%0A
+import contextlib%0A
from os.
@@ -243,55 +243,324 @@
e%0A%0A%0A
+@contextlib.contextmanager%0Adef patch_
sys
-.
+_
path
-.insert(0, dirname(dirname(__file__)))%0A
+():%0A orig = sys.path%5B:%5D%0A sys.path%5B:%5D = %5Bdirname(dirname(__file__))%5D%0A try:%0A yield%... |
9d1abf3a7d91826f9e499b2fc1490d2656a45d18 | add rest 接口测试 | api/test_user.py | api/test_user.py | from hypothesis import given, example
from hypothesis.strategies import tuples, booleans, lists, text, integers
import random
import string
from app import app
from model import user
def test_user_model():
username = ''.join(random.sample('abcdefghijklmnopqrstuvwxyz', 6))
email = username + '@' + 'qq.com'
... | Python | 0.000001 | @@ -176,16 +176,39 @@
rt user%0A
+from flask import json%0A
%0A%0Adef te
@@ -894,13 +894,9 @@
ord%0A
-
%0A
+
@@ -953,37 +953,8 @@
l%0A%0A%0A
-# def test_get_user():%0A#
test
@@ -976,18 +976,39 @@
lient()%0A
-#
+%0A%0Adef test_get_user():%0A
resp
@@ -1042,10 +1042,8 @@
r')%0A
-#
@@ -1... |
b5d1e9f209d143169195514f80b74e1350799b03 | FIX quickshift nosetest with different xyz color conversion | skimage/segmentation/tests/test_quickshift.py | skimage/segmentation/tests/test_quickshift.py | import numpy as np
from numpy.testing import assert_equal, assert_array_equal
from nose.tools import assert_true
from skimage._shared.testing import assert_greater
from skimage.segmentation import quickshift
def test_grey():
rnd = np.random.RandomState(0)
img = np.zeros((20, 21))
img[:10, 10:] = 0.2
i... | Python | 0 | @@ -1195,17 +1195,17 @@
, :10%5D,
-0
+1
)%0A as
@@ -1236,17 +1236,17 @@
, :10%5D,
-3
+2
)%0A as
@@ -1277,17 +1277,17 @@
, 10:%5D,
-1
+0
)%0A as
@@ -1318,17 +1318,17 @@
, 10:%5D,
-2
+3
)%0A%0A s
|
81b69ed9fe844c4313badc8335fb2751d3800aef | Remove requests parameter | performance/routine.py | performance/routine.py | from performance import web
class Tool:
def __init__(self, config):
if not isinstance(config, Config):
raise TypeError('No performance.routine.Config object')
self.config = config
def run(self):
pass
class Config:
def __init__(self, host, requests=None, requests_per_... | Python | 0.000001 | @@ -288,23 +288,8 @@
ost,
- requests=None,
req
@@ -364,110 +364,26 @@
-if requests is None:%0A self.requests = %5B%5D%0A else:%0A self.requests = requests
+self.requests = %5B%5D
%0A
|
90188224e13cf8bcaf234be4da107bf1b0bb45ac | Update micro benchmark: generator; Add more loop variant instruction to the hot loop | graal/edu.uci.python.benchmark/src/micro/generator.py | graal/edu.uci.python.benchmark/src/micro/generator.py | # zwei 12/17/13
# subscribe simple generator
import time
def gen(n):
for i in range(n):
yield i
def call_generator(num, iteration):
for t in range(iteration):
for i in gen(num):
item = i
return item
def measure():
print("Start timing...")
start = time.time()
num = 1000
last_item = call_generator(nu... | Python | 0 | @@ -58,21 +58,27 @@
%0Adef gen
+erator
(n):%0A
-
%09for i i
@@ -98,16 +98,20 @@
%09yield i
+ * 2
%0A%0Adef ca
@@ -140,17 +140,26 @@
ation):%0A
+%09item = 0
%0A
-
%09for t i
@@ -178,16 +178,31 @@
ation):%0A
+%09%09num += t %25 5%0A
%09%09for i
@@ -207,16 +207,22 @@
i in gen
+erator
(num):%0A%09
@@ -231,16 +... |
aa2fd434b7e06f363337463351667f4035e6513d | Remove semicolons | acstis/Selenium.py | acstis/Selenium.py | # -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2017 Tijme Gommers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# ... | Python | 0.999999 | @@ -1461,17 +1461,16 @@
command)
-;
%0A
@@ -3355,12 +3355,13 @@
river_win32%22
+%0A
|
f8e5ca9041949748602afda3e0ff5ec359a05c35 | Add in some delays to pull from xqueue | controller/management/commands/pull_from_xqueue.py | controller/management/commands/pull_from_xqueue.py | #Tests for this module are in tests.py in the controller app
from django.core.management.base import NoArgsCommand
from django.conf import settings
from django.utils import timezone
#from http://jamesmckay.net/2009/03/django-custom-managepy-commands-not-committing-transactions/
#Fix issue where db data in manage.py c... | Python | 0 | @@ -1831,24 +1831,214 @@
t_message)%0A%0A
+ #Sleep for some time to allow other pull_from_xqueue processes to get behind/ahead%0A time_sleep_value = random.uniform(0, .1)%0A time.sleep(time_sleep_value)%0A%0A
@@ -2155,16 +2155,17 @@
naged()%0A
+%0A
|
811506dfea67d95fc6b7ee3b0081918d26ff77d6 | Allow converting hex/octal ints. | curious/commands/converters.py | curious/commands/converters.py | # This file is part of curious.
#
# curious is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# curious is distributed in the ho... | Python | 0 | @@ -3294,24 +3294,27 @@
turn int(arg
+, 0
)%0A except
|
23ea5d3c8d8ab464b492c0e424c0c740de1c1842 | Test with shadow module | corehq/apps/app_manager/tests/test_build_errors.py | corehq/apps/app_manager/tests/test_build_errors.py | import json
from django.test import SimpleTestCase
import os
from corehq.apps.app_manager.models import Application
from corehq.apps.app_manager.tests.app_factory import AppFactory
class BuildErrorsTest(SimpleTestCase):
def test_subcase_errors(self):
with open(os.path.join(os.path.dirname(__file__), 'data... | Python | 0 | @@ -1405,32 +1405,37 @@
tory.app%0A
+ m1 =
factory.new_bas
@@ -1454,32 +1454,49 @@
egister', 'case'
+, with_form=False
)%0A factor
@@ -1537,77 +1537,91 @@
ase'
-)%0A app.modules%5B0%5D.forms = %5B%5D%0A app.modules%5B1%5D.forms = %5B%5D
+, with_form=False)%0A factory.new_shadow_... |
9028deadf3ebf6146ada17afdf71de68953206b0 | Fix plugin issue | services/inserter/plugins/categories_extractor.py | services/inserter/plugins/categories_extractor.py | from nltk import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
import string
def tokenize(sentence):
sentence = sentence.lower()
tokens = word_tokenize(sentence)
blacklisted_words = stopwords.words('english') + list(string.punctuation)
return [word for word in ... | Python | 0 | @@ -496,21 +496,8 @@
m):%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A
@@ -590,102 +590,8 @@
True
-%0A=======%0A return len(item.categories) == 0%0A%3E%3E%3E%3E%3E%3E%3E 59d396b6571e17f7fda201e23c4481cde3f83914
%0A%0A#D
|
cefe5ed7d425ac1448f5cdd2e0786730738ef639 | Fix unittests | tests/test_api.py | tests/test_api.py | # -*- coding: utf-8 -*-
import unittest
from .fixtures import Api, Websocket, Http, exceptions
urls = ["wss://node.bitshares.eu", "https://eu.nodes.bitshares.ws"]
class Testcases(unittest.TestCase):
def test_apiInit(self):
api = Api(urls)
self.assertEqual(len(api._url_counter), 2)
api_sin... | Python | 0.000005 | @@ -100,28 +100,32 @@
s = %5B%22wss://
+eu.
node
+s
.bitshares.e
@@ -123,18 +123,18 @@
tshares.
-eu
+ws
%22, %22http
@@ -1766,16 +1766,17 @@
)%0A%0A #
+
def test
@@ -2156,33 +2156,15 @@
m%22,
-%22wss://node.bitshares.eu%22
+urls%5B0%5D
%5D)%0A
|
744fd29b2fb8f7201305037817c6c15aa07fb330 | Handle function-based middleware in null_technical_500_response | django_extensions/management/technical_response.py | django_extensions/management/technical_response.py | # -*- coding: utf-8 -*-
import threading
import six
from django.core.handlers.wsgi import WSGIHandler
tld = threading.local()
tld.wsgi_tb = None
def null_technical_500_response(request, exc_type, exc_value, tb, status_code=500):
"""Function to override django.views.debug.technical_500_response.
Django's co... | Python | 0.000027 | @@ -427,17 +427,16 @@
s. If an
-d
uncaugh
@@ -1358,16 +1358,20 @@
cals
-%5B
+.get(
'self'
-%5D
+)
, WS
|
a5c8aff34b64cf2c29b66c6b473d026bc716a5e6 | Remove unused variable in pdisk class | core/src/main/python/stratuslab/PersistentDisk.py | core/src/main/python/stratuslab/PersistentDisk.py | #!/usr/bin/env python
#
# Created as part of the StratusLab project (http://stratuslab.eu),
# co-funded by the European Commission under the Grant Agreement
# INFSO-RI-261552."
#
# Copyright (c) 2010, Centre National de la Recherche Scientifique (CNRS)
#
# Licensed under the Apache License, Version 2.0 (the "License");... | Python | 0 | @@ -1018,86 +1018,8 @@
t):%0A
- REQUEST_SUCCESS = '1'%0A REQUEST_FAILLED = '0'%0A USAGE_SEPARATOR = '#'%0A
|
e8c1f00fff23317c5b790acecb7931958570b84d | rename to bill.subject | opencivicdata/models/bill.py | opencivicdata/models/bill.py | from django.db import models
from djorm_pgarray.fields import ArrayField
from .base import CommonBase, LinkBase
from .people_orgs import Organization, Person
from .jurisdiction import JurisdictionSession
class Bill(CommonBase):
id = models.CharField(max_length=100, primary_key=True)
session = models.ForeignK... | Python | 0.999313 | @@ -583,17 +583,16 @@
subject
-s
= Array
|
3fed5c11b0dfecb028e12ff7d08fec8480904b53 | rename action.description to action.text | opencivicdata/models/bill.py | opencivicdata/models/bill.py | from django.db import models
from djorm_pgarray.fields import ArrayField
from .base import OCDBase, LinkBase, OCDIDField, RelatedBase, RelatedEntityBase, MimetypeLinkBase
from .people_orgs import Organization, Person
from .jurisdiction import JurisdictionSession
from .. import common
class Bill(OCDBase):
id = OC... | Python | 0.999569 | @@ -1477,19 +1477,12 @@
-description
+text
= m
|
85c35064ec1786055cbc741a126fa581493acbe1 | Simplify `pack_frames_prelude` (#3961) | distributed/protocol/utils.py | distributed/protocol/utils.py | import struct
import msgpack
from ..utils import nbytes
BIG_BYTES_SHARD_SIZE = 2 ** 26
msgpack_opts = {
("max_%s_len" % x): 2 ** 31 - 1 for x in ["str", "bin", "array", "map", "ext"]
}
msgpack_opts["strict_map_key"] = False
try:
msgpack.loads(msgpack.dumps(""), raw=False, **msgpack_opts)
msgpack_opts["... | Python | 0 | @@ -2416,119 +2416,69 @@
-lengths = %5Bstruct.pack(%22Q%22, len(frames))%5D + %5B%0A struct.pack(%22Q%22,
+nframes = len(frames)%0A
nbytes
-(
+_
frame
-)) for frame in
+s = map(nbytes,
frames
-%0A %5D
+)
%0A
@@ -2489,23 +2489,58 @@
urn
-b%22%22.join(length
+struct.pack(f%22Q%7Bnframes%7DQ%... |
de23099e04d0a5823d6917f6f991d66e25b9002b | Add support for rendering with a URL prefix | django_medusa/management/commands/staticsitegen.py | django_medusa/management/commands/staticsitegen.py | from django.core.management.base import BaseCommand
from django_medusa.renderers import StaticSiteRenderer
from django_medusa.utils import get_static_renderers
class Command(BaseCommand):
can_import_settings = True
help = 'Looks for \'renderers.py\' in each INSTALLED_APP, which defines '\
'a class... | Python | 0 | @@ -1,16 +1,49 @@
+from django.conf import settings%0A
from django.core
@@ -78,16 +78,71 @@
Command%0A
+from django.core.urlresolvers import set_script_prefix%0A
from dja
@@ -544,24 +544,162 @@
e_output()%0A%0A
+ url_prefix = getattr(settings, 'MEDUSA_URL_PREFIX')%0A if url_prefix is not None:%0A ... |
9ec79f738b1fcd5002590b5fc31a302b241561e2 | implement option to disable interactive mode | run_scripts/print_cutflow.py | run_scripts/print_cutflow.py | #!/usr/bin/env python
import ROOT
ROOT.PyConfig.IgnoreCommandLineOptions = True
import os
import sys
from PyAnalysisTools.AnalysisTools.CutFlowAnalyser import CutflowAnalyser as ca
from PyAnalysisTools.AnalysisTools.CutFlowAnalyser import ExtendedCutFlowAnalyser as eca
from PyAnalysisTools.base import *
try:
from ... | Python | 0 | @@ -1441,16 +1441,238 @@
ciency')
+%0A parser.add_argument('-disable_interactive', '-di', action='store_true', default=False, help=%22Disable interactive%22%0A %22mode%22)
%0A%0A ar
|
73155fb149f63c0d72ad9968ebdc7c2fb04981d4 | fix long line | corehq/apps/app_manager/templatetags/url_extras.py | corehq/apps/app_manager/templatetags/url_extras.py | from __future__ import absolute_import
from django import template
import urllib
register = template.Library()
@register.tag
def urlencode(parser, token):
tokens = list(reversed(token.split_contents()))
tag_name = tokens.pop()
try:
path_var = tokens.pop()
params_var = tokens.pop()
exc... | Python | 0.671454 | @@ -1060,32 +1060,49 @@
lateSyntaxError(
+%0A
%22%25r tag found '%25
@@ -1157,16 +1157,29 @@
me, cmd)
+%0A
)%0A%0A r
|
a3d24859d23ef9d299c75fe5ebdfcf187451041b | make sure it works, well sort of... | meso_afd.py | meso_afd.py | # Process special AFD for BMX
import sys, re
import traceback
import StringIO
import secret
from pyIEM import nws_text
from pyxmpp.jid import JID
from pyxmpp.jabber.simple import send_message
errors = StringIO.StringIO()
raw = sys.stdin.read()
import pg
postgisdb = pg.connect(secret.dbname, secret.dbhost, user=sec... | Python | 0 | @@ -347,51 +347,8 @@
l):%0A
- if (not HAVE_POSTGIS):%0A return%0A%0A
@@ -344,32 +344,32 @@
(sql):%0A try:%0A
+
postgisd
@@ -556,54 +556,8 @@
l):%0A
- if (not HAVE_POSTGIS):%0A return %5B%5D%0A%0A
@@ -828,52 +828,120 @@
JID(
-jabber_from_jid)%0A recpt=JID(jabber_to_jid
... |
b335460cc76f8b7341705daf83cf8d41fdff3b21 | Remove config_models from settings | django/bookmarker/settings.py | django/bookmarker/settings.py | """
Django settings for bookmarker project.
Generated by 'django-admin startproject' using Django 1.10.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import... | Python | 0.000001 | @@ -1355,29 +1355,8 @@
e',%0A
- 'config_models',%0A
|
d1034b11fb4a0f54a3e3ce6fdf0c47462cc64af3 | Add feature to add shows | messages.py | messages.py | import alfachat as ac
import config
import inspect
import os
import requests
import sys
import bs4
class SmsMessage(object):
"""@bot sms <user> <text>
- SMS mit <text> an <user> versenden"""
def __init__(self, user, message_string):
self.message_string = message_string
... | Python | 0 | @@ -4081,24 +4081,571 @@
t shows%22)%0A%0A%0A
+class AddShowMessage(object):%0A %22%22%22@bot addshow - Neue Show hinzuf%C3%BCgen (dd.mm.yyyy bands datum location)%22%22%22%0A%0A def __init__(self, user, message_string):%0A self.show = %22 %22.join(message_string.split()%5B2:%5D)%0A self.message = ... |
c4f3df9f8d25d9f01e6876b42fb48380e32ffb6c | fix method overload | weboob/backends/transilien/browser.py | weboob/backends/transilien/browser.py | # -*- coding: utf-8 -*-
"""
Copyright(C) 2010 Julien Hébert, Romain Bignon
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it... | Python | 0.000003 | @@ -1819,32 +1819,42 @@
parse(self, data
+, encoding
):%0A self.
|
2717aec0bd9679d098b4383eb54a610c446882c2 | Switch to txt mode since it is now a text file. | custodian/ansible/actions.py | custodian/ansible/actions.py | #!/usr/bin/env python
"""
This module defines various classes of supported actions. All actions are
implemented as static methods, but are defined using classes (as opposed to
modules) so that a set of well-defined actions can be namespaced easily.
"""
from __future__ import division
__author__ = "Shyue Ping Ong"
__... | Python | 0 | @@ -5236,17 +5236,16 @@
name, 'w
-b
') as f:
|
c52f50f08a069c536bd8a7eb5d3a81761c54cead | make the selenium cloudcare tests more robust | corehq/apps/cloudcare/tests/selenium/testcases.py | corehq/apps/cloudcare/tests/selenium/testcases.py | from dimagi.utils.django.test import SeleniumWrapper
from corehq.apps.selenium.testcases import MobileWorkerTestCase
from selenium.common.exceptions import NoSuchElementException
from corehq.apps import selenium
DEFAULT_OPEN_FORM_WAIT_TIME = 10
DEFAULT_SUBMIT_FORM_WAIT_TIME = 5
class CloudCareQuestion(object):
"... | Python | 0.000001 | @@ -171,16 +171,48 @@
xception
+, StaleElementReferenceException
%0Afrom co
@@ -3650,32 +3650,48 @@
ick work%0A
+ submit_button =
cls.driver.find
@@ -3718,100 +3718,241 @@
it')
-.click()%0A cls.driver.sleep(1)%0A cls.driver.find_element_by_id('submit').click()
+%0A submit_button.click(... |
a64730f712b9b7e2285293e898126877122e95e5 | Create mode and is_master properties | dbaas/workflow/steps/util/fox.py | dbaas/workflow/steps/util/fox.py | from time import sleep
from dbaas_foxha.dbaas_api import DatabaseAsAServiceApi
from dbaas_foxha.provider import FoxHAProvider
from dbaas_credentials.models import CredentialType
from util import get_credentials_for
from base import BaseInstanceStep
from physical.models import Vip
CHECK_ATTEMPTS = 20
CHECK_SECONDS = 3... | Python | 0 | @@ -3407,48 +3407,203 @@
-def do(self):%0A mode = 'read_only'
+@property%0A def is_master(self):%0A return False%0A%0A @property%0A def mode(self):%0A if self.is_master:%0A return 'read_write'%0A return 'read_only'%0A%0A def do(self):
%0A%0A
@@ -3723,32 +3723,... |
4d11d9d55410954b0a0fcbcb66581d2c490d5a2a | update device meta for submissions | corehq/ex-submodules/pillowtop/processors/form.py | corehq/ex-submodules/pillowtop/processors/form.py | from __future__ import absolute_import
from datetime import timedelta
from django.http import Http404
from dimagi.utils.parsing import string_to_utc_datetime
from corehq.apps.app_manager.dbaccessors import get_app
from corehq.apps.users.models import CouchUser, LastSubmission
from corehq.pillows.utils import format_f... | Python | 0 | @@ -96,16 +96,69 @@
ttp404%0A%0A
+from corehq.apps.ota.utils import update_device_meta%0A
from dim
@@ -324,16 +324,31 @@
bmission
+, DeviceAppMeta
%0Afrom co
@@ -4410,32 +4410,16 @@
-last_submission.
device_i
@@ -4443,24 +4443,70 @@
'deviceID')%0A
+ last_submission.device_id = device_id%0A
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.