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 |
|---|---|---|---|---|---|---|---|
f2de502608833dda82908a6bb4f639645f785c06 | Change to support PEP Varible naming scheme | boundary/hostgroup_update.py | boundary/hostgroup_update.py | #
# Copyright 2015 BMC Software, 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 to in ... | Python | 0 | @@ -1678,22 +1678,24 @@
rgs.host
-G
+_g
roup
-I
+_i
d is not
@@ -1722,22 +1722,24 @@
elf.host
-G
+_g
roup
-I
+_i
d = self
@@ -1748,22 +1748,24 @@
rgs.host
-G
+_g
roup
-I
+_i
d%0A%0A
@@ -1814,14 +1814,16 @@
host
-G
+_g
roup
-I
+_i
d)%0A%0A
|
9670454dbb7b2ec4ef61d60080a1bb798c3ace74 | use integer amounts for payment capture | boxoffice/extapi/razorpay.py | boxoffice/extapi/razorpay.py | # -*- coding: utf-8 -*-
import requests
from coaster.utils import LabeledEnum
from baseframe import __
from boxoffice import app
# Don't use a trailing slash
base_url = 'https://api.razorpay.com/v1/payments'
__all__ = ['RAZORPAY_PAYMENT_STATUS', 'capture_payment']
class RAZORPAY_PAYMENT_STATUS(LabeledEnum):
""... | Python | 0.000001 | @@ -963,16 +963,36 @@
in paisa
+ and of type integer
%0A res
@@ -1030,16 +1030,20 @@
mount':
+int(
amount*1
@@ -1044,16 +1044,17 @@
ount*100
+)
%7D,%0A
|
c08493d92bef7428f900c9efded9f2e4999c8966 | Support RSA, DSS and ECDSA key #11 | brorig/connectivity.py | brorig/connectivity.py | #!/usr/bin/env python
# coding: utf-8
from __future__ import absolute_import, division, print_function
import base64
import subprocess
import os
import pymysql
import paramiko
import uuid
import brorig.log as log
import brorig.config as config
def db_connect_start():
dbconn = pymysql.connect(host=config.confi... | Python | 0 | @@ -918,104 +918,23 @@
elf.
-p
key
- = None%0A if pkey_path:%0A self.pkey = paramiko.RSAKey.from_private_key_file(
+_filename =
pkey
@@ -934,25 +934,24 @@
= pkey_path
-)
%0A%0A def op
@@ -1193,332 +1193,319 @@
ost,
- port=22, username=self.username, password=self.passwd, pkey=self.pkey, tim... |
365c5a085d9fb877c76857741ea98a6a1294da0f | Disable spaceport for linux/android | tools/perf/benchmarks/spaceport.py | tools/perf/benchmarks/spaceport.py | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs spaceport.io's PerfMarks benchmark."""
import logging
import os
from core import perf_benchmark
from telemetry import benchmark
from telemetry.cor... | Python | 0 | @@ -3964,17 +3964,76 @@
', 'win'
-)
+,%0A 'linux', 'android') # crbug.com/525112
%0Aclass S
|
2dc2ca7a24f9ba5ad7370901f02310725d4756a2 | Fix the dhcp checks on centos | playbooks/roles/bifrost-test-dhcp/files/test-dhcp.py | playbooks/roles/bifrost-test-dhcp/files/test-dhcp.py | #!/usr/bin/env python
#
# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company LP
#
# 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.... | Python | 0.00016 | @@ -2329,24 +2329,94 @@
q.leases'):%0A
+ if not os.path.exists('/var/lib/dnsmasq/dnsmasq.leases'):%0A
prin
@@ -2470,32 +2470,36 @@
rated')%0A
+
+
sys.exit(1)%0A%0A
@@ -2494,31 +2494,116 @@
exit(1)%0A
-%0A with open(
+ else:%0A dns_path = '/var/lib/dnsmasq/dnsm... |
f8944c0ac5a80d72852d9b2ea1dc1fc7d79a1891 | Add test for deserialising | plugins/data/enumerated/test/test_enumerated_type.py | plugins/data/enumerated/test/test_enumerated_type.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | Python | 0 | @@ -1475,16 +1475,612 @@
.%0A%09%22%22%22%0A%0A
+%09@luna.tests.parametrise(%7B%0A%09%09%22custom%22: %7B%0A%09%09%09%22serialised%22: b%22enumerated.test.Animal.CAT%22%0A%09%09%7D,%0A%09%09%22custom2%22: %7B%0A%09%09%09%22serialised%22: b%22enumerated.test.Animal.BIRD%22%0A%09%09%7D,%0A%09%09%22builtins%22: %7B%0A%09... |
9686b8165e0fcda8f64c6c6eadcc786c04d07803 | make sure lsf post exec command sends exit code back | flow/shell_command/lsf/commands/post_exec.py | flow/shell_command/lsf/commands/post_exec.py | from flow import exit_codes
from flow.commands.base import CommandBase
from flow.configuration.inject.broker import BrokerConfiguration
from flow.configuration.inject.orchestrator import OrchestratorConfiguration
from flow.configuration.settings.injector import setting
from flow.util.exit import exit_process
from injec... | Python | 0 | @@ -1616,16 +1616,23 @@
signal
+_number
= stat
@@ -1636,16 +1636,145 @@
at & 255
+%0A token_data = %7B%0A 'exit_code': exit_code,%0A 'signal_number': signal_number,%0A %7D
%0A%0A
@@ -1872,16 +1872,23 @@
, signal
+_number
)%0A
@@ -2096,32 +2096,32... |
c7cea0167f8de6b6619c323a363b2ec1a9a5d65f | fix alembic foreign key naming | invenio_accounts/alembic/9848d0149abd_create_accounts_tables.py | invenio_accounts/alembic/9848d0149abd_create_accounts_tables.py | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio 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; either version 2 of the
# License, or (at your option) any later... | Python | 0 | @@ -3685,80 +3685,23 @@
Key(
-%0A 'accounts_user.id', name='fk_transaction_accounts_user_
+'accounts_user.
id')
|
2be23846aabae5307ef817561661783b44c43160 | Move error-message logic into exception class | falcom/table.py | falcom/table.py | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
class Table:
class InputStrContainsCarriageReturn (RuntimeError):
pass
class InconsistentColumnCounts (RuntimeError):
... | Python | 0.000006 | @@ -312,28 +312,288 @@
r):%0A
-pass
+def __init__ (self, expected_len, row):%0A self.expected_len = expected_len%0A self.row = row%0A%0A def __str__ (self):%0A return %22Expected every row to have len=%7B:d%7D: %7B%7D%22.format(%0A self.expected_len, r... |
4ce117b65d4a6f18d327f00866eaa4383f908094 | Revert "meter import path." | faucet/meter.py | faucet/meter.py | """Configure meters."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2017 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except ... | Python | 0 | @@ -883,23 +883,16 @@
from
-faucet.
valve_of
|
db8b991600ab0a812e1d9af1a6e4bb7be25b5bd4 | fix apply_tote_contents_hint | jsk_2016_01_baxter_apc/node_scripts/apply_tote_contents_hint.py | jsk_2016_01_baxter_apc/node_scripts/apply_tote_contents_hint.py | #!/usr/bin/env python
import numpy as np
from jsk_2015_05_baxter_apc.msg import ObjectRecognition
import jsk_apc2016_common
from jsk_recognition_msgs.msg import ClassificationResult
from jsk_topic_tools import ConnectionBasedTransport
from jsk_topic_tools.log_utils import jsk_logwarn
import rospy
class ApplyToteCon... | Python | 0.000002 | @@ -974,16 +974,32 @@
idates =
+ %5B'no_object'%5D +
self.to
@@ -1014,47 +1014,8 @@
nts%0A
- candidates.append('no_object')%0A
|
6654d6956982c31bbfe6eb22aae557049ea613ba | Fix incorrect formatting call in azure module (#33561) | lib/ansible/modules/cloud/azure/azure_rm_resourcegroup_facts.py | lib/ansible/modules/cloud/azure/azure_rm_resourcegroup_facts.py | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANS... | Python | 0 | @@ -3712,17 +3712,17 @@
tems - %7B
-1
+0
%7D%22.forma
|
02efde47b5cf20b7385eacaa3f21454ffa636ad7 | Update CodeStarConnections::Connection per 2020-07-23 update | troposphere/codestarconnections.py | troposphere/codestarconnections.py | # Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if conne... | Python | 0 | @@ -687,32 +687,72 @@
estring, True),%0A
+ 'HostArn': (basestring, False),%0A
'Provide
|
f89869e095bc6c5d99c59042f815b82b1dcd19dc | Update two_armed_bandit.py | twoarmedbandit/two_armed_bandit.py | twoarmedbandit/two_armed_bandit.py | #!/usr/bin/env python
# =============================================================================
# Two armed bandit
#
# @description: Program for computing the greedy choice, optimal reward,
# optimal choice or greedy reward for a two-armed bandit
# @author: Elisha Lai
# ===================================... | Python | 0.000001 | @@ -106,24 +106,24 @@
Two
-
+-
armed
-b
+B
andit%0A#%0A
# @
@@ -118,16 +118,39 @@
andit%0A#%0A
+# @author: Elisha Lai%0A
# @desc
@@ -280,34 +280,39 @@
dit%0A# @
-author: Elisha Lai
+version: 1.0 30/10/2016
%0A# =====
|
c86d689e3593b6221b8b9120f6af16b32c2211d9 | Add __all__ and __version__ to __init__.py. | src/pu/__init__.py | src/pu/__init__.py | Python | 0.000107 | @@ -0,0 +1,48 @@
+__all__ = 'utils'.split()%0A__version__ = '1.0.0'%0A
| |
92469456222a8d5c00595ca34ea21c66042a5040 | modify main loop | parser/main.py | parser/main.py | import config
import parse
pipeout = open(config.PIPE_NAME, 'r')
while True:
input_record = pipeout.readline()
if input_record.split(',')[0] == '$GYRO':
gyro = input_record
accel = pipeout.readline()
magnet = pipeout.readline()
pressure = pipeout.readline()
parse.parse_... | Python | 0.000003 | @@ -188,125 +188,293 @@
ord%0A
- accel = pipeout.readline()%0A magnet = pipeout.readline()%0A pressure = pipeout.readline()%0A
+%09if input_record.split(',')%5B0%5D == '$ACCEL':%0A accel = pipeout.readline()%0A%09if input_record.split(',')%5B0%5D == '$MAGNET':%0A magnet = pip... |
39e5defbb12da62fc132e89437b1ce408b85ec6b | Fix parsertests script exit code. | parsertests.py | parsertests.py | #!/usr/bin/env python
import sys
import os
import os.path as path
import glob
import subprocess as sp
from collections import namedtuple
from multiprocessing import Pool
# TODO: remove this silly script and write the tests in scala/gradle.
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = ... | Python | 0 | @@ -1278,27 +1278,47 @@
():%0A n_
-not_passing
+total = 0%0A n_pass = 0%0A n_fail
= 0%0A p
@@ -1433,16 +1433,33 @@
r(f)%5D):%0A
+ n_total += 1%0A
stat
@@ -1559,29 +1559,58 @@
:%0A
-n_not_passing
+if result.status == 'FAIL':%0A n_fail
+= 1%0A
@@ -1691,16 +1691,34 @@
else:%0A
+ n... |
400f5531ff1edb41a0958b741de85a1040212274 | match timezone to Amsterdam | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Paul Salden'
SITENAME = u'paulsalden.com'
SITEURL = 'http://paulsalden.com'
PATH = 'content'
TIMEZONE = 'Europe/Paris'
DEFAULT_LANG = u'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = Non... | Python | 0.999947 | @@ -211,13 +211,17 @@
ope/
-Paris
+Amsterdam
'%0A%0AD
|
a9b7f92edb7b3a73a2b38a45c5ad6a0deee18e19 | Add GA tracking | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'keyan'
SITENAME = u'keyan pishdadian'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'America/Detroit'
DEFAULT_LANG = u'en'
THEME = "themes/flasky"
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None... | Python | 0 | @@ -236,16 +236,77 @@
lasky%22%0A%0A
+# Site analytics%0AGOOGLE_ANALYTICS_ACCOUNT = %22UA-93664476-1%22%0A%0A
# Feed g
|
c8a1b3a7475d3e964814cb9be2a82d00bba745d0 | Update settings | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Yann Baumgartner'
SITENAME = u'Histoires de briques'
SITESUBTITLE = 'Un site dédié aux LEGO®'
SITEURL = ''
GITHUB_URL = 'https://github.com/yannbaumgartner/histoires-de-briques.git'
PATH = 'content'
PAGE_PATHS = ['pages... | Python | 0.000001 | @@ -924,16 +924,53 @@
rch'))%0A%0A
+DISPLAY_ARTICLE_INFO_ON_INDEX = True%0A
DISPLAY_
|
0a6e486a27a48c59e48f458ce1217848ed73ff24 | Fix time zone config | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Eric, Etan, Fred, Genny, and Steve'
SITENAME = u'The Nest'
SITEURL = ''
TIMEZONE = 'Europe/Paris'
DEFAULT_LANG = u'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM =... | Python | 0.00004 | @@ -182,20 +182,11 @@
= '
-Europe/Paris
+PST
'%0A%0AD
|
c08e28a23778280e577793156ce5b455ba80f92f | Tag new release: 2.3.0 | floo/version.py | floo/version.py | PLUGIN_VERSION = '2.2.13'
# The line above is auto-generated by tag_release.py. Do not change it manually.
try:
from .common import shared as G
assert G
except ImportError:
from common import shared as G
G.__VERSION__ = '0.03'
G.__PLUGIN_VERSION__ = PLUGIN_VERSION
| Python | 0 | @@ -17,12 +17,11 @@
'2.
-2.13
+3.0
'%0A#
|
fcc77ac1557ab7f5c3d5605240ea505b8b61b321 | Update utils.py | follow/utils.py | follow/utils.py | from django.core.urlresolvers import reverse
from django.db.models.fields.related import ManyToManyField, ForeignKey
from follow.models import Follow
from follow.registry import registry, model_map
from django import VERSION as DjangoVersion
if float('%s.%s' % DjangoVersion[:2]) > 1.7:
module_name = 'model_name'
el... | Python | 0.000001 | @@ -274,16 +274,17 @@
n%5B:2%5D) %3E
+=
1.7:%0A
|
af40b5e9e172cd7cead22fabe364d60955378fff | modify test agent host from 0.0.0.0 to localhost | uitester/test_manager/tests_cli.py | uitester/test_manager/tests_cli.py | from uitester.test_manager import rpc_server, rpc_agent
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('Tester')
PORT = 11800
selected_device_id = None
test_server = None
commands = {}
agents = {}
def start_agent(device_id):
_agent = rpc_agent.get_test_agent(device_id)
a... | Python | 0.000001 | @@ -361,15 +361,17 @@
rt('
-0.0.0.0
+localhost
', P
|
f875e5d1bbb3ca08d597164213dd4905ea631a05 | Add a config option to control ParlayX starting and stopping the notification service. | vumi/transports/parlayx/parlayx.py | vumi/transports/parlayx/parlayx.py | # -*- test-case-name: vumi.transports.parlayx.tests.test_parlayx -*-
from twisted.internet.defer import inlineCallbacks, returnValue
from vumi import log
from vumi.config import ConfigText, ConfigInt
from vumi.transports.base import Transport
from vumi.transports.failures import TemporaryFailure, PermanentFailure
from... | Python | 0 | @@ -193,16 +193,28 @@
onfigInt
+, ConfigBool
%0Afrom vu
@@ -1324,16 +1324,129 @@
c=True)%0A
+ start_notifications = ConfigBool(%0A 'Start (and stop) the ParlayX notification service?', static=True)%0A
%0A%0Aclass
@@ -2331,16 +2331,59 @@
config)%0A
+ if config.start_notifications:%0A
... |
64ab6b412ab98a753166b8d9ab3545b2cf30f49c | Replace deprecated assertRaisesRegexp | cloudkittyclient/tests/functional/v2/test_dataframes.py | cloudkittyclient/tests/functional/v2/test_dataframes.py | # Copyright 2019 Objectif Libre
#
# 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 agr... | Python | 0.998335 | @@ -4821,17 +4821,16 @@
sesRegex
-p
(%0A
|
56a1b400b791b2fa98ff03ea9e9709a5f04f7e80 | correct gitlab authenticator when checking group membership of admins | oauthenticator/gitlab.py | oauthenticator/gitlab.py | """
Custom Authenticator to use GitLab OAuth with JupyterHub
Modified for GitLab by Laszlo Dobos (@dobos)
based on the GitHub plugin by Kyle Kelley (@rgbkrk)
"""
import json
import os
import sys
from tornado.auth import OAuth2Mixin
from tornado import gen, web
import requests
from tornado.escape import url_escape
... | Python | 0.000002 | @@ -4860,32 +4860,51 @@
client.fetch(req
+, raise_error=False
)%0A
|
55fb57316f51dc984e35516d0cceb62432da0fe9 | Make 0-arity nodes act like ignored nodes when hashed or passed-through. This might need changing | ocradmin/plugins/node.py | ocradmin/plugins/node.py | """
Base class for OCR nodes.
"""
import logging
FORMAT = '%(levelname)-5s %(name)s: %(message)s'
logging.basicConfig(format=FORMAT)
LOGGER = logging.getLogger("Node")
LOGGER.setLevel(logging.DEBUG)
import cache
class NodeError(Exception):
def __init__(self, node, msg):
super(NodeError, self).__init__(msg... | Python | 0.000002 | @@ -4713,32 +4713,51 @@
nput%0A if
+self.arity %3E 0 and
self.ignored:%0A
@@ -5657,62 +5657,39 @@
if
-not
self.
-ignored:%0A return self%0A else
+arity %3E 0 and self.ignored
:%0A
@@ -5750,16 +5750,36 @@
active()
+%0A return self
%0A%0A de
|
2191f877270fc984d5a8e7cc2ffe9ab8c1630101 | fix style | apps/smeuhoverride/views.py | apps/smeuhoverride/views.py | # Create your views here.
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.models import User
from django.http import Http404, HttpResponse
from d... | Python | 0.000001 | @@ -638,17 +638,21 @@
count,
-_
+*args
):%0A
@@ -766,30 +766,19 @@
l%22,
-min_size=0, limit=1000
+*args, **kw
):%0A
|
9e909ae8988168de5ad65e01b2231b4fb81088e7 | Check if the fqdn is localhost.localdomain. If yes, raise Exception | dbaas/workflow/steps/mysql/deploy/config_vms_foreman.py | dbaas/workflow/steps/mysql/deploy/config_vms_foreman.py | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import get_credentials_for
from util import exec_remote_command
from dbaas_foreman import get_foreman_provider
from dbaas_credentials.models import CredentialType
from dbaas_cloudstack.models import HostAttr
from ...util.base import BaseStep
f... | Python | 0.998786 | @@ -1787,24 +1787,235 @@
0%5D.strip()%0A%0A
+ if fqdn == %22localhost.localdomain%22:%0A errormsg = %22The fqdn %7B%7D is not valid.%22.format(fqdn)%0A LOG.error(errormsg)%0A raise Exception(errormsg)%0A%0A
@@ -2036,16 +2036,17 @@
C... |
b9c474d1877190ef73e295c46ac8b7ae58a803cf | put pytest skip marker after imports | borg/testsuite/convert.py | borg/testsuite/convert.py | import os
import shutil
import tempfile
import pytest
try:
import attic.repository
import attic.key
import attic.helpers
except ImportError:
attic = None
pytestmark = pytest.mark.skipif(attic is None,
reason='cannot find an attic install')
from ..converter import Attic... | Python | 0 | @@ -168,126 +168,8 @@
None
-%0Apytestmark = pytest.mark.skipif(attic is None,%0A reason='cannot find an attic install')
%0A%0Afr
@@ -367,16 +367,135 @@
stCase%0A%0A
+pytestmark = pytest.mark.skipif(attic is None,%0A reason='cannot find an attic install')%... |
7750aaaea4115007a2cd39bad0277e81c2d4a031 | Use the correct parameter for Google API key | omgeo/services/google.py | omgeo/services/google.py | import logging
from .base import GeocodeService
from omgeo.places import Candidate
from omgeo.preprocessors import ComposeSingleLine
logger = logging.getLogger(__name__)
class Google(GeocodeService):
"""
Class to geocode using Google's geocoding API.
"""
_endpoint = 'https://maps.googleapis.com/maps... | Python | 0.000006 | @@ -839,20 +839,16 @@
'
-api_
key': se
|
1ca331975ab91cf619c3c785ead5b352af47963a | Use local thread storage. | modoboa/lib/middleware.py | modoboa/lib/middleware.py | # coding: utf-8
"""Custom middlewares."""
from django.http import HttpResponseRedirect
from modoboa.lib.exceptions import ModoboaException
from modoboa.lib.signals import request_accessor
from modoboa.lib.web_utils import (
_render_error, ajax_response, render_to_json_response
)
from . import singleton
class ... | Python | 0 | @@ -37,16 +37,45 @@
es.%22%22%22%0A%0A
+from threading import local%0A%0A
from dja
@@ -314,31 +314,30 @@
%0A)%0A%0A
-from . import singleton
+_local_store = local()
%0A%0A%0Ac
@@ -1306,27 +1306,14 @@
are(
-singleton.Singleton
+object
):%0A
@@ -1369,254 +1369,8 @@
est.
-%0A%0A FIXME: the Singleton hack is use... |
70ce7627b11bf804660bc66a60910f66f8f106bd | Reformat code | boundary/metric_delete.py | boundary/metric_delete.py | #
# Copyright 2014-2015 Boundary, 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 to in... | Python | 0 | @@ -803,16 +803,17 @@
ic%0A%22%22%22%0A%0A
+%0A
class Me
@@ -822,17 +822,16 @@
icDelete
-
(ApiCli)
@@ -832,22 +832,16 @@
piCli):%0A
- %0A
def
@@ -948,25 +948,17 @@
= None%0A
-
%0A
+
def
@@ -1085,16 +1085,17 @@
icName',
+
action='
@@ -1101,16 +1101,17 @@
'store',
+
required
@@ -111... |
b628e466f86bc27cbe45ec27a02d4774a0efd3bb | Clean out dist and build before building | semantic_release/pypi.py | semantic_release/pypi.py | """PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:pa... | Python | 0 | @@ -815,16 +815,45 @@
ading')%0A
+ run('rm -rf build dist')%0A
run(
|
cc981e1d8d58a9e8337d530370355a96cdf41e71 | Remove the pesky underscore | robot/robot/src/common/autonomous_helper.py | robot/robot/src/common/autonomous_helper.py |
#
# Add this to robotpy as the autonomous toolbox?
#
#
# Or distribute it separately?
#
#
# Interesting. Could implement commands and such in python using decorators
# and other neat madness?
#
try:
import wpilib
except ImportError:
from pyfrc import wpilib
import functools
import inspect
#
# Decorators:
... | Python | 0.999999 | @@ -2575,17 +2575,17 @@
me = '%25s
-_
+
%25s' %25 (s
|
71b1cfbd375907f19e6f6eb587bd539fbaf3242c | Fix #167: Error when trying to append to sys.path from main sketch file | runtime/src/jycessing/detect_sketch_mode.py | runtime/src/jycessing/detect_sketch_mode.py | import ast
import re
from jycessing import MixedModeError
"""
Determines the sketch mode, namely:
"ACTIVE" if the sketch uses draw() and/or setup() functions;
"STATIC" otherise.
"MIXED" if the user seems to have erroneously both declared a draw()
function and called drawing functions outside draw().
"""
# If you... | Python | 0 | @@ -1976,16 +1976,37 @@
if
+hasattr(f, 'id') and
illegalA
|
b80aa5999de7167745243bf9ae4d83b63a4e56c5 | Rename Runner attr `form_document` to `form_controls` which is the proper name. | orbeon_xml_api/runner.py | orbeon_xml_api/runner.py | from builder import Builder
from utils import generate_xml_root
from controls import StringControl, DateControl, TimeControl, DateTimeControl, \
BooleanControl, AnyURIControl, EmailControl, DecimalControl, \
Select1Control, OpenSelect1Control, SelectControl
class Runner:
def __init__(self, xml, builder=... | Python | 0 | @@ -1205,16 +1205,25 @@
document
+_controls
= %7B%7D%0A%0A
@@ -1987,16 +1987,20 @@
_control
+_obj
= form_
@@ -2100,16 +2100,20 @@
_control
+_obj
is not
@@ -2159,16 +2159,20 @@
_control
+_obj
.init_ru
@@ -2225,24 +2225,33 @@
orm_document
+_controls
%5Bname%5D = for
@@ -2268,16 +2268,20 @@
_control
+_obj
... |
f6cad1777023ceb53db8599bc2e74bf0ab2aa0a7 | Prepare for next dev release | orchestrator/__init__.py | orchestrator/__init__.py | from __future__ import absolute_import
from celery.signals import setup_logging
import orchestrator.logger
__version__ = '0.5.1'
__author__ = 'sukrit'
orchestrator.logger.init_logging()
setup_logging.connect(orchestrator.logger.init_celery_logging)
| Python | 0 | @@ -124,9 +124,9 @@
0.5.
-1
+2
'%0A__
|
dceb30b96b2eb53f24ea69b9591f48b204dc9773 | Add some debugging around the fas cache lock. | fedmsg_meta_fedora_infrastructure/fasshim.py | fedmsg_meta_fedora_infrastructure/fasshim.py | import threading
import urllib
import socket
from hashlib import sha256, md5
_fas_cache = {}
_fas_cache_lock = threading.Lock()
import logging
log = logging.getLogger("moksha.hub")
def avatar_url(username, size=64, default='retro'):
openid = "http://%s.id.fedoraproject.org/" % username
return avatar_url_fro... | Python | 0 | @@ -3429,37 +3429,151 @@
g):%0A
-with _fas_cache_lock:
+log.debug(%22Acquiring _fas_cache_lock for nicknames.%22)%0A with _fas_cache_lock:%0A log.debug(%22Got _fas_cache_lock for nicknames.%22)
%0A
@@ -3612,36 +3612,38 @@
nfig)%0A re
-turn
+sult =
fas_cache.get(n
@@ -3665,67 +3665,250 @... |
569c056e016131ec4325185ee9fe814018d5e1fe | Fix problem on no-longer existing bands that are still as logged in session available | server/bands/__init__.py | server/bands/__init__.py | from flask import session, redirect, url_for, g, jsonify, Response
from flask.views import MethodView
from server.models import Band
class RestrictedBandPage(MethodView):
def dispatch_request(self, *args, **kwargs):
if not 'bandId' in session:
return redirect(url_for('bands.session.index'))
... | Python | 0.000001 | @@ -413,16 +413,54 @@
f.band:%0A
+ del session%5B'bandId'%5D%0A
|
08c25e4ff96765c057397582327a36a6a1d3b7cb | fix caching unicode error | ourcup/util/filecache.py | ourcup/util/filecache.py | import hashlib, os, codecs, logging
'''
Super basic file-based cache (utf-8 friendly). Helpful if you're developing a
webpage scraper and want to be a bit more polite to the server you're scraping
while developing. The idea is that it caches content in files, each named by the
key you pass in (use the md5_key help... | Python | 0.000002 | @@ -568,16 +568,32 @@
e(string
+.encode('utf-8')
)%0A re
|
05d6a420f7644eef197aa33aa83f4f3dcd6dd246 | Add assertion to debug CI failure. | prjxray/tile_segbits.py | prjxray/tile_segbits.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
from collections import namedtuple
fr... | Python | 0.000001 | @@ -990,16 +990,75 @@
28, 05%0A
+ parts = val.split('_')%0A assert len(parts) == 2, val%0A
seg_
@@ -1083,30 +1083,21 @@
bit_n =
-val.split('_')
+parts
%0A%0A re
|
94788d01acb2b44bfdc4e621769e58f9c17b4d69 | Add manifest filename to Application class | progression/__init__.py | progression/__init__.py | from .__version__ import __version__
import os.path
class Metadata(dict):
"""Metadata can be accessed using both dictionary and attribute syntax.
Provides basic valiation of input fields, with different requirements for
the testing and comparison steps.
"""
_compare_requires = []
_testing_req... | Python | 0.000001 | @@ -2050,16 +2050,158 @@
%0A %5D%0A%0A
+ def __init__(self, *args, **kwargs):%0A super(Test, self).__init__(*args, **kwargs)%0A self%5B'manifest_file'%5D = 'manifest.json'%0A%0A
%0Aclass T
|
f236c451fb49087dbf3d4a75f94ad879ce0896fd | Fix quartet officer updater | project/bhs/managers.py | project/bhs/managers.py | from django.db.models import Manager
from django.apps import apps
import django_rq
class HumanManager(Manager):
def update_persons(self, cursor=None, active_only=True, *args, **kwargs):
# Get base
humans = self.all()
# Filter if cursored
if active_only:
humans = humans.... | Python | 0 | @@ -6902,32 +6902,46 @@
',%0A '
+subscription__
human',%0A
|
a3353e1b4c3e181958a877c8e2485c2c7eed4201 | Update pd_utils for python3 | projections/pd_utils.py | projections/pd_utils.py | import numpy.lib
import numpy as np
import pandas as pd
import _pickle as pickle
def save_pandas(fname, data):
'''Save DataFrame or Series
Parameters
----------
fname : str
filename to use
data: Pandas DataFrame or Series
'''
np.save(open(fname, 'w'), data)
if len(data.shape) =... | Python | 0 | @@ -279,16 +279,17 @@
name, 'w
+b
'), data
@@ -286,24 +286,24 @@
wb'), data)%0A
-
if len(d
@@ -345,16 +345,17 @@
a.index,
+
data.col
@@ -519,24 +519,57 @@
s(meta)%0A
+import pdb; pdb.set_trace()%0A #
s = s.encode
@@ -609,16 +609,17 @@
name, 'a
+b
') as f:
@@ -637,17 +637,27 @@
seek(0,
-2
+os.SEE... |
fda311fe04e913875fd39d071e6468e1b32875a5 | Mark other clients of bw-compat feature | src/zeit/content/author/author.py | src/zeit/content/author/author.py | from zeit.cms.content.property import ObjectPathProperty
from zeit.cms.i18n import MessageFactory as _
from zeit.content.author.interfaces import IAuthor
import UserDict
import grokcore.component as grok
import lxml.objectify
import zeit.cms.content.interfaces
import zeit.cms.content.property
import zeit.cms.content.re... | Python | 0 | @@ -3227,16 +3227,34 @@
eded by
+the publisher and
zeit.vgw
@@ -3272,16 +3272,75 @@
others.%0A
+# Publisher only indexes the freetext field at the moment.%0A
# zeit.v
|
006eff6a9376c65e0632efe79ec6d39cbc50f80b | remove UI element namespaces | docs/tutorial/tuthello.py | docs/tutorial/tuthello.py | # Licensed CC0 Public Domain: http://creativecommons.org/publicdomain/zero/1.0
# [HelloRapicorn-EXAMPLE]
# Load and import a versioned Rapicorn module into the 'Rapicorn' namespace
import Rapicorn1307 as Rapicorn
# Setup the application object, unsing a unique application name.
app = Rapicorn.app_init ("Hello Rapicorn... | Python | 0.000001 | @@ -855,25 +855,8 @@
ng (
-%22HelloRapicorn%22,
hell
@@ -974,22 +974,8 @@
w (%22
-HelloRapicorn:
hell
|
8936ba626c4bc3114ecb9d2efc75136f4122e37a | Initialized LSS texture recognizer example | examples/linear_separator/texture_recognizer/Texture.py | examples/linear_separator/texture_recognizer/Texture.py | from classes.solver import LinearSeparator
class Texture:
def __init__(self, neighborhoods, colors, textures=2):
self.dimensions = neighborhoods * (colors) * (colors) + 1
self.colors = colors
self.neighborhoods = neighborhoods
self.__separator = LinearSeparator(self.dimensions, cl... | Python | 0.999995 | @@ -166,13 +166,11 @@
lors
-)
*
-(
colo
|
240e33bcdd3734f43ea9d58814f8571c2023cf24 | Fix typo | webhookdb/tasks/repository_hook.py | webhookdb/tasks/repository_hook.py | # coding=utf-8
from __future__ import unicode_literals, print_function
from datetime import datetime
from iso8601 import parse_date
from celery import group
from webhookdb import db
from webhookdb.process import process_repository_hook
from webhookdb.models import RepositoryHook, Repository, Mutex
from webhookdb.excep... | Python | 0.999999 | @@ -2661,18 +2661,20 @@
_at%0A
-p
r
+epo
.hooks_l
|
11efe2d85dc50b60ddcfa00b31e223ff3ac62ea1 | add **kwargs to manage extra args in xpath and cssselect | weboob/tools/parsers/lxmlparser.py | weboob/tools/parsers/lxmlparser.py | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Christophe Benz
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... | Python | 0 | @@ -1835,16 +1835,26 @@
sselect'
+, **kwargs
):%0A
@@ -2560,32 +2560,42 @@
sselect(selector
+, **kwargs
)%0A elif m
@@ -2648,32 +2648,42 @@
t.xpath(selector
+, **kwargs
)%0A else:%0A
|
f3cb0175ec32be75df70172fbf5629125a8c8381 | Update docstring for BIDSReport. | bids/reports/report.py | bids/reports/report.py | """Generate publication-quality data acquisition methods section from BIDS
dataset.
"""
from __future__ import print_function
import json
from os.path import dirname
from os.path import abspath
from os.path import join as pathjoin
from collections import Counter
from bids.reports import utils
from bids.reports import ... | Python | 0 | @@ -2372,16 +2372,284 @@
ccurred.
+ In cases%0A where all subjects underwent the same protocol, the most common%0A pattern is most likely the most complete. In cases where the%0A dataset contains multiple protocols, each pattern will need to be%0A inspected manually.
%0A%0A... |
ec2456eac36a96c9819920bf8b4176e6a37ad9a5 | Rename productclass made during migration | saleor/product/migrations/0020_attribute_data_to_class.py | saleor/product/migrations/0020_attribute_data_to_class.py | from __future__ import unicode_literals
from django.db import migrations, models
def move_data(apps, schema_editor):
Product = apps.get_model('product', 'Product')
ProductClass = apps.get_model('product', 'ProductClass')
for product in Product.objects.all():
attributes = product.attributes.all()... | Python | 0 | @@ -667,30 +667,28 @@
me='
-Migrated P
+Unnamed p
roduct
-Class
+type
',%0A
|
f31e8215838e40960abff6c86be8c66cbf113c95 | Make the endpoint return geojson as opposed to wkt geometry | server/rest/twofishes.py | server/rest/twofishes.py | import requests
from girder.api import access
from girder.api.describe import Description
from girder.api.rest import Resource
class TwoFishes(Resource):
def __init__(self):
self.resourceName = 'minerva_geocoder'
self.route('GET', (), self.geocode)
self.route('GET', ('autocomplete',), sel... | Python | 0.99978 | @@ -8,16 +8,83 @@
requests
+%0Afrom shapely.wkt import loads%0Afrom shapely.geometry import mapping
%0A%0Afrom g
@@ -633,22 +633,21 @@
-return
+wkt =
r.json(
@@ -647,16 +647,111 @@
r.json()
+%5B'interpretations'%5D%5B0%5D%5B'feature'%5D%5B'geometry'%5D%5B'wktGeometry'%5D%0A return mapping(loads(wk... |
76fc2cb8ff45f0a004f876966d8e18f5f0fc13e5 | return valid User object and move existence checking to make_user function | server/sessionmanager.py | server/sessionmanager.py | import crispin
import uuid
import logging as log
import datetime
import traceback
import google_oauth
from models import db_session, User, UserSession
# Memory cache for currently open crispin instances
email_address_to_crispins = {}
def log_ignored(exc):
log.error('Ignoring error: %s\nOuter stack:\n%s%s'
... | Python | 0.000001 | @@ -1004,41 +1004,118 @@
dict
-, existing=None):%0A if existing
+):%0A user_obj = db_session.query(User).filter_by(g_email=access_token_dict%5B'email'%5D).first()%0A if user_obj
is
@@ -1175,24 +1175,24 @@
_user =
-existing
+user_obj
%0A # n
@@ -2002,27 +2002,16 @@
span%0A
- new_user =
db_sess
@... |
8465b0af6504844e8a7cb7cb35b7a8b20c356696 | fix the channel names | plugins/tay.py | plugins/tay.py | from rtmbot.core import Plugin, Job
import os
import random
bot_id = 'U3MSN806S'
header = '<@{}> '.format(bot_id)
responses = {
'hi': 'Nice to meet you, where you been?',
'who should i vote for?': 'Me, of course',
'who are you': '@swiftonsecurity',
}
directory = os.path.realpath(
os.path.join(os.getc... | Python | 0.99939 | @@ -961,36 +961,37 @@
nel%5B'name'%5D == '
-aoeu
+emoji
':%0A
@@ -1439,12 +1439,14 @@
== '
-aoeu
+random
':%0A
|
8fb5b379d99d29fdee6fca86d944687268ba8101 | Format currency conversion using embeds. Also include a thousands separator in the value and add an emoji flag. | plugins/web.py | plugins/web.py | """ Plugin for web commands
Commands:
define
"""
import discord
from datetime import datetime
from pcbot import Annotate, utils
import plugins
client = plugins.client # type: discord.Client
# Create exchange rate cache and keep track of when we last reset it
exchange_rate_cache = dict(reset=client.time_starte... | Python | 0 | @@ -2813,26 +2813,9 @@
ge,
-%22**%7B%7D**%22.format(e)
+e
)%0A
@@ -2834,48 +2834,104 @@
-await client.say(message, %22**
+flag = utils.text_to_emoji(currency_to%5B:2%5D)%0A e = discord.Embed(description=%22%7B%7D
%7B:
+,
.2f%7D %7B%7D
-**
%22.fo
@@ -2935,16 +2935,22 @@
.format(
+flag,
value *
... |
7baecddc4884b20f12107242f73b8722aa413006 | Fix repeat number and seed selection. | plume/plume.py | plume/plume.py | #!/usr/bin/env python
import argparse
import logging
import os.path
import sys
import pexpect
from qrsim.tcpclient import UAVControls
import tables
import behaviors
from config import load_config
from client import TaskPlumeClient
import prediction
from recorder import ControlsRecorder, TargetsRecorder, TaskPlumeRec... | Python | 0 | @@ -1582,33 +1582,37 @@
_simulation_run(
-i
+trial
, output_filenam
@@ -1887,16 +1887,29 @@
teArray(
+%0A
'/', 're
@@ -1916,17 +1916,21 @@
peat', %5B
-i
+trial
%5D, title
@@ -2568,17 +2568,21 @@
dlist'%5D%5B
-i
+trial
%5D)%0A%0A
|
e8ffa23f83d13de6ef3e4fe61b5e481c5e6c1d5b | Add reference to bug report | setuptools/__init__.py | setuptools/__init__.py | """Extensions to the 'distutils' for large or complex distributions"""
import os
import distutils.core
import distutils.filelist
from distutils.core import Command as _Command
from distutils.util import convert_path
from fnmatch import fnmatchcase
import setuptools.version
from setuptools.extension import Extension
f... | Python | 0 | @@ -5155,17 +5155,52 @@
istutils
-.
+ (http://bugs.python.org/issue12885)
%0Adistuti
|
93240501a79f93b2efc20c8de24193697316fdb3 | add noise & drag | simulator/num_model.py | simulator/num_model.py | import numpy as np
class Drone:
def __init__(self):
self.dt = 1E-5
self.time = 0.0
self.g = 9.80
self.gvec = np.array([0, 0, -self.g])
self.M = 1.250
self.R = 0.23
self.Iz = 0.25 * self.M * self.R**2
self.Ixy = self.Iz * 0.5
self.I = np.diag([... | Python | 0 | @@ -394,16 +394,105 @@
AG_K = 0
+%0A self.DRAG_B = 0.5%0A%0A self.noise_acc = 0.07%0A self.noise_omega = 0.02
%0A%0A
@@ -1908,16 +1908,41 @@
elf.gvec
+ - self.DRAG_B * self.vel
%0A
@@ -2555,30 +2555,29 @@
f):%0A
-return
+acc =
self.acc_se
@@ -2584,55 +2584,180 @@
nsor
-... |
9ece50e71d2c5eab7b97edc5b8bbdfb410ce64bf | edit admin.py | polls/admin.py | polls/admin.py | from django.contrib import admin
from polls.models import Choice, Question
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 3
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information', {'fields': ['pub_date'... | Python | 0 | @@ -377,16 +377,65 @@
eInline%5D
+%0A list_display = ('question_text', 'pub_date')
%0A%0Aadmin.
|
5b63950cb3fa018b63ccb0be3faeceef684f9299 | Add persistent storage | ipinfo.py | ipinfo.py | from ipaddress import ip_address, ip_network
from ipwhois import IPWhois
known_networks = {}
def updateIpInfo(ip):
info = IPWhois(ip).lookup()
# these two lines might break on some input
net = info['nets'][0]
networks = net['cidr'].split(', ')
for network in networks:
network = ip_network... | Python | 0.000003 | @@ -37,16 +37,30 @@
_network
+%0Aimport shelve
%0A%0Afrom i
@@ -86,27 +86,100 @@
is%0A%0A
-known_networks = %7B%7D
+ip_whois_shelve_filename = 'ip_whois'%0Aknown_networks = shelve.open(ip_whois_shelve_filename)
%0A%0Ade
@@ -394,27 +394,15 @@
k =
-ip_
network
-(network)
%0A
@@ -555,23 +555,35 @@
f ip in
+ip... |
8f6c73238b5b52bdd7feb63fc1f1f28ed12e7e3e | Update render method implementation in MultiCurve and MultiSurface classes | geomdl/Multi.py | geomdl/Multi.py | """
.. module:: Multi
:platform: Unix, Windows
:synopsis: Container module for storage and visualization of curves and surfaces
.. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com>
"""
from . import warnings
from . import Abstract
from . import utilities
class MultiCurve(Abstract.Multi):
""" Contain... | Python | 0 | @@ -711,32 +711,42 @@
def render(self
+, **kwargs
):%0A %22%22%22 R
@@ -913,138 +913,427 @@
od.%0A
- %22%22%22%0A if not self._vis_component:%0A warnings.warn(%22No visualization component has set%22)%0A return
+%0A Keyword Arguments:%0A%0A * %60%60cpcolor%60... |
e0e23391d0ec035926644cfb7d1e7b1f43f35cf7 | Avoid the key error | get_timeline.py | get_timeline.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from configparser import ConfigParser
import datetime
import json
import os
import sys
from requests_oauthlib import OAuth1Session
from logging import FileHandler, Formatter, getLogger, DEBUG
config = ConfigParser()
config.read(os.path.abspath(os.path.dirname(__file__))... | Python | 0.999999 | @@ -2522,27 +2522,80 @@
l
-imit = req.headers%5B
+ogger.info('Number of tweets: %7B0%7D'.format(tweets_count))%0A if
'x-r
@@ -2614,18 +2614,35 @@
maining'
-%5D%0A
+ in req.headers:%0A
@@ -2645,20 +2645,22 @@
-rese
+ limi
t = req.
@@ -2683,19 +2683,23 @@
limit-re
-set
+maining
... |
f63ddd4c4e98322fcff651aefb298f7724dc9bff | Add help text, rename 'history' to graph | basil.py | basil.py | import subprocess
import time
import tempfile
last_watered = 0
COOLDOWN = 60
def basilcmd(cmds):
output = subprocess.check_output(['ssh', 'rrpi', './basilbot/cli.py', *cmds], stderr=subprocess.STDOUT)
return output
def moisture():
output = basilcmd(['moisture'])
return 'Soil moisture content: ' + ... | Python | 0.999822 | @@ -72,17 +72,50 @@
WN = 60%0A
-%0A
+WATER_MAX_SECS = 60%0A%0AHELPTEXT = %7B%7D
%0A%0Adef ba
@@ -255,16 +255,85 @@
output%0A%0A
+HELPTEXT%5B'moisture'%5D = 'Check the instantaneous moisture of the pot'%0A
def mois
@@ -446,16 +446,101 @@
+ '%25'%0A%0A
+HELPTEXT%5B'history %5BN%5D'%5D = 'Print %5BN%5D of the automa... |
6fc945ba01ec4a99cef3b2e1491646095e506f72 | debug output | autobahn/autobahn/wamp/router.py | autobahn/autobahn/wamp/router.py | ###############################################################################
##
## Copyright (C) 2013-2014 Tavendo GmbH
##
## 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
##
## h... | Python | 0.000011 | @@ -1658,32 +1658,56 @@
ons%60.%0A %22%22%22%0A
+ self.debug = True%0A
self.facto
@@ -2613,24 +2613,84 @@
%60%0A %22%22%22%0A
+ if self.debug:%0A print(%22Router.process%22, msg)%0A%0A
## Bro
|
4118f51ade43d3748bc71f8502de0c43a8c3e39e | disable router debug | autobahn/autobahn/wamp/router.py | autobahn/autobahn/wamp/router.py | ###############################################################################
##
## Copyright (C) 2013-2014 Tavendo GmbH
##
## 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
##
## h... | Python | 0 | @@ -1689,11 +1689,12 @@
g =
-Tru
+Fals
e%0A
|
6c3ba0617575d2d178c2f1a2632cea5f5ba09d5f | Revert "Updated License" | grabLocation.py | grabLocation.py | from geopy.geocoders import GoogleV3
from geopy.exc import GeocoderTimedOut
import time # For rate limiting purposes
# Using Geopy copyright 2006-2016 geopy authors
# Geopy available at https://github.com/geopy/geopy
# This program is copyright 2017 Joseph Johaneman
# And is released under the MIT License
# What ... | Python | 0 | @@ -297,11 +297,20 @@
the
-MIT
+3 Clause BSD
Lic
|
1cb55e4feec981efdf629b01ed7508f825b6c2c0 | add comment TODO | StockIndicators/StockIndicators.py | StockIndicators/StockIndicators.py | #!flask/bin/python
from flask import Blueprint, jsonify
api_si = Blueprint('api_si', __name__)
@api_si.route("/stock_indicators")
def get_stock_indicators():
return jsonify(stock_indicators=[
{"username": "alice", "user_id": 1},
{"username": "bob", "user_id": 2}
])
| Python | 0 | @@ -90,16 +90,75 @@
ame__)%0A%0A
+#TODO: probar a meter token de seguridad a ver se funciona%0A
@api_si.
|
2a15c18b5d29672fc309a17fd5440cb02619f0c6 | Change the method's docstring to actually fit the code. | uniformdh.py | uniformdh.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module implements a class to deal with Uniform Diffie-Hellman handshakes.
The class `UniformDH' is used by the server as well as by the client to handle
the Uniform Diffie-Hellman handshake used by ScrambleSuit.
"""
import const
import random
import util
import... | Python | 0 | @@ -4578,144 +4578,90 @@
If
-%60publicKey' is not given (which%0A is the case for the client), a new public key is created using the%0A Diffie-Hellman object
+a UniformDH object has not been%0A initialised yet, a new instance is created
.%0A
|
13a5e797bf3c268ae42dda79c75959ca0602096f | Update unit tests script. | unit_test.py | unit_test.py | #!/usr/bin/python3
import glob
import re
import subprocess
import os
import os.path
def atoi(text):
return int(text) if text.isdigit() else text
def natural_keys(text):
'''
alist.sort(key=natural_keys) sorts in human order
http://nedbatchelder.com/blog/200712/human_sorting.html
(See Toothy's impl... | Python | 0 | @@ -617,17 +617,20 @@
beta):%0A
-%09
+
output =
@@ -732,17 +732,59 @@
%22.exr%22)%0A
-%09
+%0A if not os.path.exists(output):%0A
command
@@ -932,17 +932,23 @@
batch%22%5D%0A
-%09
+
print(%22
@@ -964,17 +964,23 @@
mmand))%0A
-%09
+
subproce
@@ -1025,17 +1025,20 @@
_cases:%0A
-%09
... |
7ccb8d443fe3dda236d05ff4ed13e067a6893872 | create a changeset against local before changing local; we'll use this later | updatecmd.py | updatecmd.py | #
# Copyright (c) 2004 Specifix, Inc.
# All rights reserved
#
import changeset
import os
import sys
import util
import versions
def doUpdate(repos, db, cfg, pkg, versionStr = None):
cs = None
if not os.path.exists(cfg.root):
util.mkdirChain(cfg.root)
if os.path.exists(pkg):
# there is ... | Python | 0 | @@ -809,16 +809,95 @@
newcs%0A%0A
+%09 list = %5B%5D%0A%09 list = map(lambda x: list.append(x), cs.getPackageList())%0A%0A
if n
@@ -2011,16 +2011,257 @@
(list)%0A%0A
+%09# permute the list into a list of just package names%0A%09list = map(lambda x: x%5B0%5D, list)%0A%0A # create a change set between wh... |
e28b900e1a9ac407f7a32af9983daace7b225758 | Fix typing in get_processors helper (FieldABC instance, not BaseField) | aiohttp_json_api/helpers.py | aiohttp_json_api/helpers.py | """Helpers."""
import inspect
from collections import Iterable, Mapping
from typing import Optional
from aiohttp import web
from .fields.base import BaseField
from .fields.decorators import Tag
from .typings import Callee
from .common import JSONAPI
def is_generator(obj):
"""Return True if ``obj`` is a generat... | Python | 0 | @@ -129,28 +129,26 @@
rom
+.abc
.field
-s.base
import
Base
@@ -143,25 +143,24 @@
import
-Base
Field
+ABC
%0Afrom .f
@@ -4013,17 +4013,16 @@
ld:
-Base
Field
+ABC
,%0A
|
7d92b89d7a9e0c950bde96632447d7cd0486f933 | Update api to use backend datastore | utils/api.py | utils/api.py | #!/usr/bin/env python
'''
THIS APP IS NOT PRODUCTION READY!! DO NOT USE!
Flask app that provides a RESTful API to
the multiscanner.
Proposed supported operations:
GET / ---> Test functionality. {'Message': 'True'}
GET /api/v1/tasks/list ---> Receive list of tasks in multiscanner
GET /api/v1/tasks/list/<task_id> --->... | Python | 0 | @@ -1065,16 +1065,44 @@
atabase%0A
+from storage import Storage%0A
%0A%0ATASK_N
@@ -1368,16 +1368,48 @@
abase()%0A
+db_store = Storage.get_storage()
%0A%0A@app.e
@@ -3655,64 +3655,28 @@
t =
-%5Breport for report in REPORTS if report%5B'report_id'%5D ==
+db_store.get_report(
repo
@@ -3676,33 +3676,33 @@
rt(repo... |
6aea68d6c1de498583c42839a3a31ef25f51e17e | Complete alg_breadth_first_search.py | alg_breadth_first_search.py | alg_breadth_first_search.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def bfs():
pass
def main():
# Small word ladder graph.
graph_adj_d = {
'fool': {'cool', 'pool', 'foil', 'foul'},
'foul': {'fool', 'foil'},
'foil': {'fool', 'foul', 'fail'}... | Python | 0.99995 | @@ -107,28 +107,507 @@
on%0A%0A
-%0Adef bfs():%0A pass
+import numpy as np%0A%0Adef bfs(graph_adj_d, start_vertex):%0A visit_queue = %5B%5D%0A visit_queue.insert(0, start_vertex)%0A distance_d = %7Bv: np.inf for v in graph_adj_d.keys()%7D%0A distance_d%5Bstart_vertex%5D = 0%0A while visit_queue:%0A ... |
649029d2ad04eb5afd618b40ccd62993d69e389f | Complete alg_percentile_selection.py | alg_percentile_selection.py | alg_percentile_selection.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def select_percentile(a_list, k):
"""Select list's kth percentile.
Just select the kth element, without caring about
the relative ordering of the rest of them.
"""
pass
def main():
pass
if __na... | Python | 0.998978 | @@ -103,16 +103,31 @@
nction%0A%0A
+import random%0A%0A
%0Adef sel
@@ -145,14 +145,10 @@
ile(
-a_list
+ls
, k)
@@ -157,36 +157,42 @@
%09%22%22%22
-Select list's kth percentile
+Kth percentile selection algorithm
.%0A%0A
@@ -295,38 +295,931 @@
em.%0A
-%09%22%22%22%0A%09pass%0A%0A%0Adef main():%0A%09pass
+%0A ... |
7de37a5ba8164b757a6a8ed64f80ee379ff7a3ad | fix some bugs | scripts/extract_computer_and_accessories.py | scripts/extract_computer_and_accessories.py | from scripts.rake import *
import json
# get review texts aggregated by asin id
def get_rdd(base, input, num_part):
base_dir = os.path.join(base)
input_path = os.path.join(input)
file_name = os.path.join(base_dir, input_path)
# load data
... | Python | 0.000008 | @@ -859,17 +859,17 @@
ateg.fla
-p
+t
MapValue
@@ -900,17 +900,16 @@
= categ
-_
.filter(
@@ -980,17 +980,16 @@
= prods
-_
.join(co
@@ -1002,16 +1002,17 @@
s)%0Aprods
+_
.cache()
@@ -1607,18 +1607,18 @@
wk.cache
-()
+%0A%0A
%0Aitems_n
@@ -1849,16 +1849,18 @@
)%0A
+%0A%0A
items_np
|
f4f9c524838b5bc30bc993cc6ffe3392495dff2d | Make sure we patch webbrowser | glue/plugins/exporters/plotly/qt/tests/test_exporter.py | glue/plugins/exporters/plotly/qt/tests/test_exporter.py | from __future__ import absolute_import, division, print_function
import json
import mock
import pytest
import plotly
from plotly.exceptions import PlotlyError
from mock import patch
from glue.tests.helpers import requires_plotly
from glue.core import Data, DataCollection
from glue.app.qt import GlueApplication
from ... | Python | 0 | @@ -5210,16 +5210,91 @@
ock()):%0A
+ with patch('webbrowser.open_new_tab') as open_new_tab:%0A
@@ -5340,32 +5340,36 @@
+
exporter.accept(
@@ -5362,32 +5362,36 @@
porter.accept()%0A
+
@@ -6223,32 +6223,107 @@
y.plot', plot):%0A
+ ... |
ab533cf55e87571e757f545d5eaad6f8f62cc31f | Make worker resource plot responsive | distributed/diagnostics/worker_monitor.py | distributed/diagnostics/worker_monitor.py | from __future__ import print_function, division, absolute_import
from collections import defaultdict
from itertools import chain
from toolz import pluck
from ..utils import ignoring
with ignoring(ImportError):
from bokeh.models import ColumnDataSource, DataRange1d, Range1d
from bokeh.palettes import Spectra... | Python | 0.000002 | @@ -698,16 +698,33 @@
+ responsive=True,
tools='
@@ -923,16 +923,20 @@
legend='
+Avg
Memory U
@@ -1056,16 +1056,20 @@
legend='
+Avg
CPU Usag
|
b90927f3aa8b3178eabdf75ab68cf11df1c08835 | Resolve #8 and modify output | portscanner.py | portscanner.py | #!/usr/bin/python
import socket
import sys
import os
import argparse
def main():
parser = argparse.ArgumentParser(description = "Test a specified ip/host for open ports.")
mutex = parser.add_mutually_exclusive_group(required=True)
parser.add_argument('ip', metavar='IP', help='The ip/host to be scanned for open por... | Python | 0 | @@ -64,16 +64,154 @@
gparse%0A%0A
+class colors:%0A%09HOST='%5C033%5B32m'%0A%09PORT='%5C033%5B36m'%0A%09TYPE='%5C033%5B33m'%0A%09SERVICE='%5C033%5B35m'%0A%09WARNING='%5C033%5B31m'%0A%09INFO='%5C033%5B34m'%0A%09END='%5C033%5B0m'%0A%0A
def main
@@ -1182,47 +1182,122 @@
xit(
-'%5B!%5D Invalid ip-address/hostname!%5Cn%5... |
6e65bf0ce5334e2242fee0c36886cfda29a1f4a4 | Make build.py baseimage pulling optional | build.py | build.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -*- mode: python; -*-
import logging
import subprocess
import sys
import time
from common import get_sys_args, yield_dockerfiles
from common import run_cmd, init_logger
def build_image(repo_path, repo_name):
for dockerfile, image in yield_dockerfiles(repo_path, re... | Python | 0 | @@ -119,16 +119,26 @@
ort time
+%0Aimport os
%0A%0Afrom c
@@ -362,16 +362,20 @@
-run
+build
_cmd
-(
+ =
%5B'do
@@ -393,18 +393,8 @@
ld',
- '--pull',
'-t
@@ -431,16 +431,151 @@
po_path%5D
+%0A if os.environ.get('PULL_BASEIMAGES', '0') == '1':%0A build_cmd.append('--pull')%0A ... |
2454b864670ba2138361edbdb9e66afccdf31010 | fix a bug creating valid zip files | build.py | build.py | """\
Build the current project as a Factorio mod.
Not required, but handy for work on the mod. The basic process is this:
1. If the git status isn't clean, throw the current stuff into the stash
2. Get the current version from info.json for the zip name
3. Zip the current working directory into name_version.zip, i... | Python | 0 | @@ -2484,16 +2484,17 @@
path, 'w
+b
') as fp
@@ -3708,24 +3708,137 @@
filepath)%0A%09%0A
+%09if failed is None:%0A%09%09with file(path, 'rb') as fp:%0A%09%09%09with ZipFile(fp, 'r') as zip:%0A%09%09%09%09failed = zip.testzip()%0A%09%0A
%09if failed i
@@ -3952,16 +3952,116 @@
ve(path)
+%0A%09%09print %3E%3E sys.std... |
bc09d332e7f473cd9d212b2f1aab81498b8b09e2 | Add global vars to generated class | objects/function.py | objects/function.py | from objects.file import File
class Function(object):
"""
Represents a .func file
text - text passed into the constructor
get_name() - the name of the function, as it will be used in the .auto file
get_constructors() - a list containing 2 strings that are inserted into C++
... | Python | 0 | @@ -2276,35 +2276,35 @@
))%0A%0A for
+v
ar
-g
in self.get_arg
@@ -2292,37 +2292,60 @@
var in self.get_
-args(
+section(%22global%22).split(%22%5Cn%22
):%0A c
@@ -2380,45 +2380,21 @@
s%22,
-%22%7B0%7D %7B1%7D = 0;%22.format(arg%5B0%5D, arg%5B1%5D)
+var + %22 = 0;%22
)%0A%0A
|
35a708ccdd1aa7b3e52c9ebd52044c033bff2ff4 | Update countfile.py | bin/count/countfile.py | bin/count/countfile.py | #!/usr/bin/python
import gzip
import numpy as np
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import common
import config as cfg
def fileToDictionary(inputFile, indexColumn):
input = open(inputFil... | Python | 0.000001 | @@ -41,16 +41,40 @@
py as np
+%0Aimport sys, os, inspect
%0A%0Acurren
|
72f6ecc97d26a61e4c39963a8d88897e58a5a47d | Make dependency script detect need for git-fetch more reliably | build.py | build.py | #!/usr/bin/env python
import argparse
import multiprocessing
import os
import shutil
import string
import subprocess
import sys
ROOT_DIR = os.path.realpath(os.path.dirname(__file__))
DEPS_DIR = os.path.join(ROOT_DIR, 'deps')
def execute(cmd, cwd=DEPS_DIR, env=os.environ, err=None, err_expr=['error:', 'fatal:']):
... | Python | 0.000002 | @@ -1657,41 +1657,56 @@
-target = self._rev_parse(
+res = execute(%5B'git', 'cat-file', '-t',
self.ref
)%0A
@@ -1697,24 +1697,25 @@
t', self.ref
+%5D
)%0A exce
@@ -1724,24 +1724,55 @@
Exception:%0A
+ pass%0A if not res:%0A
sys.
|
1aec16ffc5d5781562775de7faa76238d55b91b1 | Improve sound loop set config validation | mpfmc/config_collections/sound_loop_set.py | mpfmc/config_collections/sound_loop_set.py | from typing import TYPE_CHECKING, Union
from mpf.core.randomizer import Randomizer
from mpfmc.core.config_collection import ConfigCollection
from mpfmc.core.audio.audio_exception import AudioException
if TYPE_CHECKING:
from mpfmc.core.mc import MpfMc
class SoundLoopSetCollection(ConfigCollection):
config_se... | Python | 0.000001 | @@ -37,51 +37,8 @@
ion%0A
-from mpf.core.randomizer import Randomizer%0A
from
@@ -1921,24 +1921,336 @@
', config)%0A%0A
+ # Clamp volume between 0 and 1%0A if 'volume' in config and config%5B'volume'%5D:%0A if config%5B'volume'%5D %3C 0:%0A config%5B'volume'%5D = 0%0A ... |
04d59394657e420025f8cc15c51732a68ae8cc03 | Add the new boolean fields to the right model. | site/roaster/models.py | site/roaster/models.py | import re
from django.core.urlresolvers import reverse
from django.db import models
from django.template.defaultfilters import slugify
WEEKDAY_CHOICES = (
(0, 'Monday'),
(1, 'Tuesday'),
(2, 'Wednesday'),
(3, 'Thursday'),
(4, 'Friday'),
(5, 'Saturday'),
(6, 'Sunday'),
)
def format_phone_nu... | Python | 0 | @@ -2976,24 +2976,189 @@
lank=True,)%0A
+ online_only = models.BooleanField()%0A order_online = models.BooleanField()%0A cafe_on_site = models.BooleanField()%0A open_to_public = models.BooleanField()%0A
photo_ur
@@ -3678,134 +3678,8 @@
',)%0A
- order_online = models.BooleanField()%0A cafe_on_si... |
b68669f07aba05a4e96f900df71d6179382cd6f1 | bump version | build.py | build.py | from pybuilder.core import use_plugin, init, Author, task
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.integrationtest")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("python.coverage")
use_plugin("python.distutils")
use_plugin('copy_resources')
use_plug... | Python | 0 | @@ -493,9 +493,9 @@
0.8.
-2
+4
%22%0A%0Aa
|
0fe151d07f1f77bec1e8b7827823bf7197b52408 | Fix string interpolation to delayed by logging | murano/common/plugins/extensions_loader.py | murano/common/plugins/extensions_loader.py | # Copyright (c) 2015 Mirantis, 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 to in writin... | Python | 0.99955 | @@ -5442,16 +5442,17 @@
loader%22
+,
%0A
@@ -5470,11 +5470,8 @@
-%25 (
clas
@@ -5498,25 +5498,24 @@
nition.name)
-)
%0A
|
83b12f568ba8843ac6bff4c5179d8200d88505b0 | Fix an issue where the .VERSION file output from build.py had multiple commit hashes | build.py | build.py | #/*******************************************************************************
# * Copyright (c) 2016 Synopsys, Inc
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available ... | Python | 0.000021 | @@ -1058,15 +1058,30 @@
%0A%09#
-Grep gi
+git log for the curren
t co
@@ -1087,16 +1087,21 @@
ommit id
+ hash
%0A%09output
@@ -1135,50 +1135,31 @@
g --
-name-status HEAD%5E..HEAD %7C grep %5C%22commit*%5C%22
+pretty=format:'%25H' -n 1
%22, s
@@ -1200,16 +1200,19 @@
%0A%09commit
+_id
= outpu
@@ -1231,160 +1231... |
fe55a3e5ba9f4a368d39fcc3316a471df547d714 | Bump version to 0.8.1+dev | h11/_version.py | h11/_version.py | # This file must be kept very simple, because it is consumed from several
# places -- it is imported by h11/__init__.py, execfile'd by setup.py, etc.
# We use a simple scheme:
# 1.0.0 -> 1.0.0+dev -> 1.1.0 -> 1.1.0+dev
# where the +dev versions are never released into the wild, they're just what
# we stick into the ... | Python | 0 | @@ -676,10 +676,14 @@
= %220.8.1
++dev
%22%0A
|
14753d1d445f876910ae181530082fe7952a9b10 | Add some sanity checks to the search adder, and don't hit renamed docs over and over again. | regscrape/regs_common/commands/add_to_search.py | regscrape/regs_common/commands/add_to_search.py | GEVENT = False
from optparse import OptionParser
arg_parser = OptionParser()
arg_parser.add_option("-a", "--agency", dest="agency", action="store", type="string", default=None, help="Specify an agency to which to limit the dump.")
arg_parser.add_option("-d", "--docket", dest="docket", action="store", type="string", de... | Python | 0 | @@ -1436,32 +1436,94 @@
enamed', doc.id%0A
+ doc.in_search_index = True%0A doc.save()%0A
cont
@@ -2260,16 +2260,55 @@
dd views
+ (max of 5 to avoid pathological cases)
%0A
@@ -2325,24 +2325,28 @@
in doc.views
+%5B:5%5D
:%0A
@@ -2748,16 +2748,56 @@
achments
+ (ma... |
f4d09f956a2408d38ba0bd8a108a6f27a9fc6639 | Remove special support for celery from sitecustomize (#799) | opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py | opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py | # Copyright The OpenTelemetry 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 in ... | Python | 0 | @@ -582,19 +582,8 @@
e.%0A%0A
-import sys%0A
from
@@ -630,22 +630,16 @@
environ
-, path
%0Afrom os
@@ -4426,318 +4426,8 @@
)%0A%0A%0A
-if (%0A hasattr(sys, %22argv%22)%0A and sys.argv%5B0%5D.split(path.sep)%5B-1%5D == %22celery%22%0A and %22worker%22 in sys.argv%5B1:%5D%0A):%0A from celery.signals imp... |
0e3e9028598c8ebe49c3aec98fbfb584e8f5223b | Check both category_links and resource_link | myuw/management/commands/check_reslinks.py | myuw/management/commands/check_reslinks.py | """
Test all the links in the CSV for non-200 status codes (after redirects).
"""
import logging
import sys
import urllib3
from django.core.mail import send_mail
from django.core.management.base import BaseCommand, CommandError
from myuw.dao.category_links import Res_Links
from myuw.util.settings import get_cronjob_re... | Python | 0.000001 | @@ -267,17 +267,33 @@
es_Links
+, Resource_Links
%0A
-
from myu
@@ -804,16 +804,510 @@
+messages.append(Res_Links.csv_filename)%0A verify_links(links, messages)%0A%0A links = Resource_Links.get_all_links()%0A messages.append(%22%5Cn%5Cn%7B%7D%22.format(Resource_Links.csv_filename))%0A ... |
d242870d99634edc4b077b045fe5489039a3c821 | add shebang to targetselection script | bin/targetselection.py | bin/targetselection.py | import numpy
from desitarget.io import read_tractor, write_targets
from desitarget.cuts import LRG, ELG, BGS, QSO
from desitarget import targetmask
from argparse import ArgumentParser
ap = ArgumentParser()
ap.add_argument("--type", choices=["tractor"], default="tractor", help="Assume a type for src files")
ap.add_ar... | Python | 0 | @@ -1,12 +1,35 @@
+#!/usr/bin/env python%0A%0A
import numpy
|
22a76a55c373af8f64717b10542b7230e63e9583 | update person caches to 1hr | sis_provisioner/cache.py | sis_provisioner/cache.py | from restclients.cache_implementation import TimedCache
import re
class RestClientsCache(TimedCache):
""" A custom cache implementation for Canvas """
url_policies = {}
url_policies["sws"] = (
(re.compile(r"^/student/v5/term/"), 60 * 60 * 10),
(re.compile(r"^/student/v5/course/"), 60 * 5)... | Python | 0 | @@ -395,37 +395,32 @@
rson/%22), 60 * 60
- * 10
),%0A (re.c
@@ -456,29 +456,24 @@
/%22), 60 * 60
- * 10
),%0A )%0A
|
f409fb8c7243558ab6ad956904f5ab40e18c2734 | Add flask management command for printing config values | manage.py | manage.py | """ Defines a series of scripts for running server and maintenance
FLASK_APP=manage.py flask --help
"""
import os
import click
import redis
import alembic.config
from flask_migrate import Migrate
from portal.factories.app import create_app
from portal.extensions import db
from portal.models.i18n import smartling_up... | Python | 0 | @@ -122,16 +122,28 @@
t click%0A
+import json%0A
import r
@@ -5848,8 +5848,429 @@
nguage)%0A
+%0A@click.option('--config_key', '-c', help='Return only a single config value')%0A@app.cli.command()%0Adef config(config_key):%0A %22%22%22List current flask configuration values in JSON%22%22%22%0A%0A if config_key:... |
909b14f4d4b82c72e8f3987c1ef82cc075520cb1 | add @ | botpi.py | botpi.py | import re
re_pi = re.compile(r'(?:^|\s)(((P|p)i)|(π)|(3(\.|,)14\d*))').search
message = "{name}, eigentlich is π ja 3.1415926535897932384626433832795028841971693\
9937510582097494... aber rechne lieber mit 3, das ist wesentlich einfacher!"
def check_pi(bot_stuff):
match = re_pi(bot_stuff['message'])
print(m... | Python | 0 | @@ -84,16 +84,17 @@
sage = %22
+@
%7Bname%7D,
|
d43fecb6f645dabf1740cd42aaf25191353a1b77 | add curriculum to cache policy | sis_provisioner/cache.py | sis_provisioner/cache.py | from django.conf import settings
from memcached_clients import RestclientPymemcacheClient
from uw_kws import ENCRYPTION_KEY_URL, ENCRYPTION_CURRENT_KEY_URL
import re
ONE_MINUTE = 60
ONE_HOUR = 60 * 60
ONE_DAY = 60 * 60 * 24
ONE_WEEK = 60 * 60 * 24 * 7
ONE_MONTH = 60 * 60 * 24 * 30
NONPERSONAL_NETID_EXCEPTION_GROUP = g... | Python | 0 | @@ -640,32 +640,49 @@
if re.match(
+%0A
r'%5E/student/v%5Cd/
@@ -714,16 +714,27 @@
ent%7C
+curriculum%7C
term)',%0A
@@ -729,20 +729,16 @@
term)',%0A
-
@@ -782,25 +782,19 @@
urn ONE_
-HOUR * 10
+DAY
%0A%0A
|
9bb76df67c436d091d85d75c6968ede89d9194b7 | add testing framework | statistics/test.py | statistics/test.py | from numberOfPublicMethods import *
def headersIsClass():
return headers()[0] == "class.h"
def propertiesIs4():
return parseFile("class.h") == ObjectiveCClass(publicMethods=4, className="TestClass")
if __name__ == "__main__":
print(headersIsClass())
print(propertiesIs4())
print(calculateAveragePu... | Python | 0.000001 | @@ -1,8 +1,24 @@
+import unittest%0A
from num
@@ -46,20 +46,495 @@
port *%0A%0A
-def
+class Tests(unittest.TestCase):%0A%0A @staticmethod%0A def listOfOCClasses():%0A return %5B%0A ObjectiveCClass(publicMethods=4, className=%22TestClass4%22),%0A ObjectiveCClass(publicMethod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.