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 |
|---|---|---|---|---|---|---|---|
22096e9037bee89296bc45964e4384fdf20bce82 | refactor tensor_raster | tensortools/neuro/plots.py | tensortools/neuro/plots.py | import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap, colorConverter
import numpy as np
def tensor_raster(data, axes=None, column=0, ncols=1, colors=None, title=None, background='dark', interpolation='none', **subplots_kw):
"""
Generates spike rasters with each neuron stacked o... | Python | 0.999537 | @@ -137,42 +137,16 @@
ter(
-data, axes=None, column=0, ncols=1
+*tensors
, co
@@ -160,17 +160,21 @@
ne,
-title=Non
+share_cax=Tru
e, b
@@ -194,30 +194,8 @@
rk',
- interpolation='none',
**s
@@ -1220,16 +1220,45 @@
shape%5B0%5D
+%0A n_tensors = len(tensors)
%0A%0A #
@@ -1495,33 +1495,8 @@
xes%0A
- if... |
2fac5416468269df246c1f676838797f8326b427 | Prepare 1.3.0 release | main/cloudfoundry_client/__init__.py | main/cloudfoundry_client/__init__.py | """
This module provides a client library for cloudfoundry_client v2.
"""
__version__ = "1.2.0"
| Python | 0 | @@ -89,13 +89,13 @@
__ = %221.
-2
+3
.0%22%0A
|
ff2837c53d3f43256b9d22b130eb044ac0f56949 | Update common.py | common.py | common.py | def checkPellSolution(x,y,n):
return x*x - n*y*y == 1
def getContinuedFraction(val):
a = [ int(val) ]
x = [ val - a[0] ]
yield a[0]
while True:
a.append(int(1/x[-1]))
xx.append(1/x[-1]-a[-1])
yield a[-1]
| Python | 0 | @@ -175,17 +175,16 @@
-1%5D))%0A%09%09
-x
x.append
|
ae4c182edcc992b3748d90f39ad7dc23cffd981d | Use psmove API constants for battery level table. | common.py | common.py | import psmove
import colorsys
import time
import enum
color_range = 255
#Human speeds[slow, mid, fast]
SLOW_WARNING = [0.1, 0.15, 0.28]
SLOW_MAX = [0.5, 0.8, 1]
FAST_WARNING = [0.5, 0.6, 0.8]
FAST_MAX = [1, 1.4, 1.8]
WERE_SLOW_WARNING = [0.2, 0.3, 0.4]
WERE_SLOW_MAX = [0.7, 0.9, 1.1]
WERE_FAST_WARNING = [0.6, 0.7, 0... | Python | 0 | @@ -2665,117 +2665,305 @@
-0: %22Low%22,%0A 1: %2220%25%22,%0A 2: %2240%25%22,%0A 3: %2260%25%22,%0A 4: %2280%25%22,%0A 5: %22100%25%22,%0A 238: %22Charging%22,%0A 239
+psmove.Batt_MIN: %22Low%22,%0A psmove.Batt_20Percent: %2220%25%22,%0A psmove.Batt_40Percent: %2240%2... |
2cf37282b2675c27b3c7b4f4702b2c3ad57e785c | convert dbus.Struct to tuple. | common.py | common.py | #!/usr/bin/env python
# coding=utf-8
from functools import wraps
import dbus
MPRIS_NAME_PREFIX = "org.mpris.MediaPlayer2"
MPRIS_OBJECT_PATH = "/org/mpris/MediaPlayer2"
IROOT = "org.mpris.MediaPlayer2"
IPLAYER = IROOT + ".Player"
ITRACKLIST = IROOT + ".TrackList"
IPLAYLISTS = IROOT + ".PlayLists"
IPROPERTIES = "org.fr... | Python | 0.000003 | @@ -437,24 +437,140 @@
ignature%22%22%22%0A
+ if len(signature) == 2 and signature.startswith('a'):%0A return dbus.Array(value, signature=signature%5B-1%5D)%0A
type_map
@@ -1645,16 +1645,103 @@
tems()%7D%0A
+ if isinstance(dbus_obj, dbus.Struct):%0A return tuple(map(convert, dbus_obj))%0A
%0... |
0ff86d24dadef8542b4df2b22cdb7b8fc0191789 | Update sudoku-solver.py | Python/sudoku-solver.py | Python/sudoku-solver.py | # Time: ((9!)^9)
# Space: (1)
#
# Write a program to solve a Sudoku puzzle by filling the empty cells.
#
# Empty cells are indicated by the character '.'.
#
# You may assume that there will be only one unique solution.
#
class Solution:
# @param board, a 9x9 2D array
# Solve the Sudoku by modifying the inpu... | Python | 0.000001 | @@ -408,249 +408,12 @@
-for i in xrange(len(board)):%0A for j in xrange(len(board%5B0%5D)):%0A if(board%5Bi%5D%5Bj%5D == '.'):%0A for k in xrange(9):%0A board%5Bi%5D%5Bj%5D = chr(ord('1') + k)%0A if self.
+def
isVa
@@ -42... |
bd0ea7bd2d5666bf3c682f6fcc486749ec1a2060 | Move docker ES defaults to defaults | microcosm_elasticsearch/factories.py | microcosm_elasticsearch/factories.py | """
Factory that configures Elasticsearch client.
"""
from distutils.util import strtobool
from functools import partial
from os import environ
from boto3 import Session
from elasticsearch import Elasticsearch, RequestsHttpConnection
from microcosm.api import defaults
from requests_aws4auth import AWS4Auth
from micr... | Python | 0.000001 | @@ -581,21 +581,187 @@
-username=None
+# NB: these are the defaults shipped with the ES docker distribution.%0A # We want testing to %22just work%22; no sane production application should use these.%0A username=%22elastic%22
,%0A
@@ -771,20 +771,26 @@
assword=
-None
+%22changeme%22
,%0A us
@@ -1978,... |
fa9aea2e3f4301dd8bdb8bb4680c6c3c669a8efb | Update adapter_16mers.py | select_random_subset/adapter_16mers.py | select_random_subset/adapter_16mers.py |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 21 14:15:18 2017
@author: nikka.keivanfar
"""
#see also: adapters.fa
P5 = 'AATGATACGGCGACCACCGA'
P7 = 'CAAGCAGAAGACGGCATACGAGAT'
read1 = 'GATCTACACTCTTTCCCTACACGACGCTC'
read2 = 'GTGACTGGAGTTCAGACGTGT'
adapters = [P5, P7, read1, read2] #to do: s... | Python | 0.000001 | @@ -118,29 +118,29 @@
%22%0A%0A#
-see also: adapters.fa
+to do: fasta as input
%0A%0AP5
|
c4809f9f43129d092235738127b90dc62f593fb8 | Remove some commented out code | steinie/app.py | steinie/app.py | from werkzeug import routing
from werkzeug import serving
from werkzeug import wrappers
from . import routes
class Steinie(routes.Router):
def __init__(self, host="127.0.0.1", port=5151, debug=False):
self.host = host
self.port = port
self.debug = debug
super(Steinie, self).__init... | Python | 0 | @@ -763,73 +763,8 @@
r):%0A
- # if not route.endswith('/'):%0A # route += '/'%0A
@@ -1095,44 +1095,4 @@
nt)%0A
- # import ipdb; ipdb.set_trace()%0A
|
1e931e9aac18f393de786894d9e26ecccc251135 | Fix girder_work script bug: PEP 263 is not compatible with exec | server/models/_generate_superpixels.py | server/models/_generate_superpixels.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | Python | 0 | @@ -1,51 +1,4 @@
-#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A
####
|
49cd6b9175ef529cbf0994117a25928f33a8b73e | Read simple_script | config.py | config.py | import ConfigParser
class Config:
''' Read in the config and set up the vars with the correct type.
'''
def __init__(self, configfile, name):
# "name" argument no longer used
c = ConfigParser.ConfigParser()
c.read(configfile)
self.database_name = c.get('database', 'name')
... | Python | 0.000002 | @@ -735,24 +735,85 @@
ui', 'url')%0A
+ self.simple_script = c.get('webui', 'simple_script')%0A
self
|
9d0ffbe216296fac2bec6f28147431fec607d8b1 | Fix require_admin | config.py | config.py | # coding: utf-8
import json
from redis_wrap import get_hash, get_list
__config__ = 'config.json'
with open(__config__, 'r') as cfr:
config = json.loads(cfr.read())
PATH = '/%s' % '/'.join(config.get('server').replace('https://', '').replace('http://', '').split('/')[1:])
TOKEN = config.get('token')
SERVER = con... | Python | 0.000001 | @@ -824,16 +824,23 @@
wrapper(
+*args,
**kwargs
@@ -879,16 +879,47 @@
', None)
+ if len(args) == 0 else args%5B0%5D
%0A
@@ -1066,16 +1066,23 @@
rn func(
+*args,
**kwargs
|
5db9297ced5dd310899fd3b5072c670339cffd37 | fix with syntax | config.py | config.py | import json
import utils.metro
with f as open("config.json"):
config = json.load(f)
redis_info = {"host": config["REDIS_HOST"], "password": config["REDIS_PASSWORD"]}
wmata = utils.metro.MetroApi(config["API_KEY"], **redis_info)
| Python | 0.000304 | @@ -28,18 +28,14 @@
tro%0A
+%0A
with
-f as
open
@@ -49,16 +49,21 @@
g.json%22)
+ as f
:%0A co
|
3532b43e44e0d4bb67663f618ced2258ce418279 | use bow | config.py | config.py | import numpy as np
class BabiConfig(object):
"""
Configuration for bAbI
"""
def __init__(self, train_story, train_questions, dictionary):
# init dict with pre-trained vectors, e.g. from fastText
self.dictionary = dictionary
self.batch_size = 32
self.nhops ... | Python | 0.000018 | @@ -830,36 +830,35 @@
se_bow =
-Fals
+Tru
e # use Bag-of-
|
69ff6726b6a25b585f9f9631408bd2191d98d36f | add some docstrings | config.py | config.py | import os.path
API_AI_TOKEN = 'caca38e8d99d4ea6bd9ffa9a8be15ff9'
API_AI_SESSION_ID = 'dd60fde7-c6ab-4f38-9487-7300c42b4916'
# this is where yoda's config will be stored
YODA_CONFIG_FILE_PATH = os.path.join(os.path.expanduser('~'), '.yodaconfig')
DEFAULT_CONFIG_PATH = os.path.join(os.path.expanduser('~'), '.yoda')
... | Python | 0.000022 | @@ -347,16 +347,186 @@
_path):%0A
+ '''Updates the path where the config files are stored.%0A This is done by changing the contents of YODA_CONFIG_FILE_PATH with new_path%0A of user's config.%0A '''%0A
if l
@@ -728,16 +728,135 @@
aths():%0A
+ '''Get the absolute config file paths of user%0A con... |
685f6e63062fcac3b7cefec40aa661c1c6fcb88a | set mongodb uri to env var | config.py | config.py | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = os.environ['SECRET_KEY']
class ProductionConfig(Config):
DEBUG = False
class StagingConfig(Config):
DEVELOPMENT = True
DEBUG = True
clas... | Python | 0.000004 | @@ -184,16 +184,64 @@
T_KEY'%5D%0A
+ MONGOLAB_DB_URI = os.environ%5B'MONGODB_URI'%5D%0A
%0A%0Aclass
|
dee622f86ec8184ad5cc00f9564eee34ee8626e6 | Add color, cursor hiding. Ugly! | conway.py | conway.py | #!/usr/bin/env python
from itertools import chain
from sys import stdout
from time import sleep
from blessings import Terminal
def main():
"""Play Conway's Game of Life on the terminal."""
def die((x, y)):
if (x < 0 or x >= term.width or
y < 0 or y >= term.height):
return None... | Python | 0 | @@ -15,16 +15,30 @@
python%0A
+import atexit%0A
from ite
@@ -383,20 +383,45 @@
board =
-set(
+dict(((x, y), 1) for x, y in
%5B(10, 10
@@ -468,31 +468,171 @@
)%5D)%0A
- for i in range(50):
+%0A # Hide the cursor, but show it on exit:%0A atexit.register(stdout.write, term.cnorm)%0A print term.civis,%0... |
caa575a8b564518e553d803b5dfeea0995a21d7a | Add lists property to Lists | derpibooru/Lists.py | derpibooru/Lists.py |
class Lists(object)
def __init__(self, page=1, last="", comments=False, fav=False, key=""):
self.__parameters = {}
@property
def hostname()
return("https://derpiboo.ru")
@property
def parameters(self):
return(self.__parameters)
@property
def page(self):
return(self.parameters["page"])... | Python | 0.000001 | @@ -31,24 +31,31 @@
init__(self,
+ lists,
page=1, las
@@ -96,16 +96,16 @@
ey=%22%22):%0A
-
self
@@ -255,16 +255,187 @@
eters)%0A%0A
+ @property%0A def lists():%0A lists = %7B%0A 0: %22index%22,%0A 1: %22scoring_scoring%22,%0A 2: %22all_time_top_scoring%22,%0A 3: %22top_commented%22%0A... |
763fb4ffb4931d969b3a324c8bd4dfb52d751a8d | Validate sqlite table names, fixes #717 | services/ingest-file/ingestors/tabular/sqlite.py | services/ingest-file/ingestors/tabular/sqlite.py | import logging
import sqlite3
from followthemoney import model
from collections import OrderedDict
from ingestors.ingestor import Ingestor
from ingestors.support.table import TableSupport
from ingestors.exc import ProcessingException
log = logging.getLogger(__name__)
class SQLiteIngestor(Ingestor, TableSupport):
... | Python | 0.000001 | @@ -1,12 +1,22 @@
+import re%0A
import loggi
@@ -18,16 +18,16 @@
logging%0A
-
import s
@@ -321,16 +321,68 @@
pport):%0A
+ VALID_TABLE = re.compile(r'%5B%5Cw%5Cd%5C_%5C-%5D%7B2,4096%7D')%0A
MIME
@@ -753,16 +753,65 @@
hall():%0A
+ if self.VALID_TABLE.match(name):%0A
|
1492ffcbd839c1ca2e6ea52879d81fb2e66d82e1 | change to --get_rnapuzzle_ready | yapdb_parser.py | yapdb_parser.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import os
import time
from pdb_parser_lib import *
def add_header():
now = time.strftime("%c")
print 'HEADER Generated with yapdb_parser, version: %s (https://github.com/m4rx9/rna-pdb-tools) %s' % (version, now)
if __name__ == '__main__':
version... | Python | 0.000001 | @@ -1036,16 +1036,17 @@
t('--get
+_
rnapuzzl
@@ -1046,16 +1046,22 @@
napuzzle
+_ready
', help=
@@ -1160,33 +1160,56 @@
('--
-get_simrna_ready', help='
+nohr', help='do not insert the header into files
',%0A
@@ -1284,56 +1284,33 @@
('--
-nohr', help='do not insert the header into files
+get_simrna_ready', help='... |
3cfbe8e35119ad544f1ecc693172ae57531fa4b1 | use Event instead of Button for _animate in run_and_animate_panel | simphony_mayavi/plugins/run_and_animate_panel.py | simphony_mayavi/plugins/run_and_animate_panel.py | from pyface.api import MessageDialog
from traits.api import Float, Int, Button, Bool, HasTraits, Instance
from traitsui.api import View, VGroup, HGroup, Item
from simphony.core.cuba import CUBA
from simphony.cuds.abc_modeling_engine import ABCModelingEngine
from .run_and_animate import RunAndAnimate
class RunAndAni... | Python | 0.000001 | @@ -68,16 +68,8 @@
Int,
- Button,
Boo
@@ -90,16 +90,23 @@
Instance
+, Event
%0Afrom tr
@@ -149,16 +149,30 @@
up, Item
+, ButtonEditor
%0A%0Afrom s
@@ -1518,25 +1518,13 @@
e =
-Button(%22Animate%22)
+Event
%0A
@@ -1832,16 +1832,125 @@
el=False
+,%0A enabled_when=%22engine%22,%0A ... |
d39e320b9e74b494e988e46a1f62337174e32653 | Fix update on cert_expiry startup (#27137) | homeassistant/components/cert_expiry/sensor.py | homeassistant/components/cert_expiry/sensor.py | """Counter for the days until an HTTPS (TLS) certificate will expire."""
import logging
import socket
import ssl
from datetime import datetime, timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.components.s... | Python | 0 | @@ -454,16 +454,56 @@
TART,%0A)%0A
+from homeassistant.core import callback%0A
from hom
@@ -1062,24 +1062,126 @@
sensor.%22%22%22%0A
+%0A @callback%0A def do_import(_):%0A %22%22%22Process YAML import after HA is fully started.%22%22%22%0A
hass.asy
@@ -1200,24 +1200,28 @@
sk(%0A
+ ... |
af2443fb10b8e028d705701eb5623a1f1b6daa86 | Fix account link version check (#28770) | homeassistant/components/cloud/account_link.py | homeassistant/components/cloud/account_link.py | """Account linking via the cloud."""
import asyncio
import logging
from typing import Any
from hass_nabucasa import account_link
from homeassistant.const import MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import event, config_entry_oaut... | Python | 0 | @@ -420,57 +420,8 @@
600%0A
-PATCH_VERSION = int(PATCH_VERSION.split(%22.%22)%5B0%5D)%0A
_LOG
@@ -1328,24 +1328,284 @@
turn False%0A%0A
+ patch_number_str = %22%22%0A%0A for char in PATCH_VERSION:%0A if char.isnumeric():%0A patch_number_str += char%0A else:%0A break%0A%0A ... |
ef3ff26c309cfe7f529b673dbf7c10ea2148b38d | fix error when vdscli call fails | ovirt_hosted_engine_ha/broker/submonitor_util.py | ovirt_hosted_engine_ha/broker/submonitor_util.py | #
# ovirt-hosted-engine-ha -- ovirt hosted engine high availability
# Copyright (C) 2013 Red Hat, Inc.
#
# This library 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 2.1 of the Licens... | Python | 0.000001 | @@ -2060,16 +2060,36 @@
try = 0%0A
+ response = None%0A
whil
@@ -2473,16 +2473,29 @@
%0A if
+response and
response
|
73dd6a57dfc2355695bc368b354b3aaf143e2e97 | Fix bug with expect_multi causing it to miss some Datagrams. | test/common.py | test/common.py | import subprocess
import tempfile
import struct
import socket
import time
import os
__all__ = ['Daemon', 'Datagram', 'MDConnection']
class Daemon(object):
DAEMON_PATH = './openotpd'
def __init__(self, config):
self.config = config
self.daemon = None
self.config_file = None
def s... | Python | 0 | @@ -5139,17 +5139,16 @@
gs yet!%0A
-%0A
@@ -5156,28 +5156,37 @@
d
-atagrams = %5Bd
+g = D
atagram
+(dg)%0A%0A
for
@@ -5207,19 +5207,17 @@
atagrams
- if
+:
%0A
@@ -5229,20 +5229,10 @@
- not
+if
dat
@@ -5254,22 +5254,85 @@
_of(
-Datagram(dg))%5D
+dg):%0A ... |
4de128ef1cd91276d4447bc08fcafedf8694f156 | Fix typo | mindbender/tools/cbloader/widgets.py | mindbender/tools/cbloader/widgets.py | from ...vendor.Qt import QtWidgets, QtCore, QtGui
from ... import io
from ... import api
from .model import SubsetsModel
from .delegates import PrettyTimeDelegate, VersionDelegate
from .lib import iter_loaders, run_loader
def _get_representations(version_id):
"""Return available representations representations f... | Python | 0.999999 | @@ -3664,20 +3664,38 @@
.format(
+representation%5B'
name
+'%5D
)%0A%0A
|
e9367d536923e879aebc7a052d346ca37d3fe171 | use own track_utc_time_change to poll every 5 seconds | homeassistant/components/media_player/sonos.py | homeassistant/components/media_player/sonos.py | """
homeassistant.components.media_player.sonos
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides an interface to Sonos players (via SoCo)
Configuration:
To use SoCo, add something like this to your configuration:
media_player:
platform: sonos
"""
import logging
import datetime
REQUIREMENTS = ['SoCo==0.11.1']... | Python | 0 | @@ -531,16 +531,78 @@
MUSIC)%0A%0A
+from homeassistant.helpers.event import track_utc_time_change%0A
from hom
@@ -623,24 +623,24 @@
st import (%0A
-
STATE_ID
@@ -1055,16 +1055,22 @@
sDevice(
+hass,
p) for p
@@ -1373,16 +1373,22 @@
__(self,
+ hass,
player)
@@ -1482,24 +1482,132 @@
f.update()%0A%0A
+ ... |
690da2431e4d3abcdff6b62f269f0355da46c57d | Update rasmachine tests | models/rasmachine/test_rasmachine.py | models/rasmachine/test_rasmachine.py | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from os.path import join, abspath, dirname
from rasmachine import make_status_message
from rasmachine import _increment_ndex_ver, get_email_pmids
import gmail_client
stats = {}
stats['new_abstracts'] = 0
stats['new_... | Python | 0 | @@ -405,23 +405,74 @@
%0Astats%5B'
-new_top
+orig_likely'%5D = 10%0Astats%5B'new_top'%5D = 10%0Astats%5B'new_likely
'%5D = 10%0A
@@ -567,24 +567,183 @@
gmail.txt')%0A
+ with open(cred_file, 'rt') as fh:%0A un, pw = %5Bl.strip() for l in fh.readlines()%5D%0A config = %7B%7D%0A config%5B'user'%5D = un%... |
b9ca6e20d44b6bbe95c7becc566b351b3f39c1e6 | Fix create_connection in python 2.5 | module/plugins/hooks/ClickAndLoad.py | module/plugins/hooks/ClickAndLoad.py | # -*- coding: utf-8 -*-
import socket
from threading import Thread, Lock
from time import sleep
from module.plugins.Hook import Hook, threaded
def forward(source, destination):
string = ' '
while string:
string = source.recv(1024)
if string:
destination.sendall(string)
e... | Python | 0.000001 | @@ -463,61 +463,17 @@
out=
-socket._GLOBAL_DEFAULT_TIMEOUT,%0A
+object(),
sou
@@ -552,17 +552,160 @@
ess,
- timeout,
+%0A socket._GLOBAL_DEFAULT_TIMEOUT if type(timeout) == object else timeout,%0A
sou
@@ -1684,53 +1... |
8930bf1dc4e3915c46b413d5d61868dabf7d24d3 | Update UnSkipOnFail.py | module/plugins/hooks/UnSkipOnFail.py | module/plugins/hooks/UnSkipOnFail.py | # -*- coding: utf-8 -*-
from module.PyFile import PyFile
from module.plugins.Hook import Hook
class UnSkipOnFail(Hook):
__name__ = "UnSkipOnFail"
__type__ = "hook"
__version__ = "0.03"
__config__ = [("activated", "bool", "Activated", True)]
__description__ = """Queue skipped duplicates wh... | Python | 0.000001 | @@ -1598,16 +1598,17 @@
))%0A%0A%0A
+
def find
|
8db9873245e9a4c5f2181fb683b8e8903089e5a6 | Add test that allocates slightly more than a full arena | test/test_bump_allocate.py | test/test_bump_allocate.py | import unittest
from support import lib, ffi
from qcgc_test import QCGCTest
class BumpAllocatorTest(QCGCTest):
def test_bump_allocator_internals(self):
arena = lib.qcgc_arena_create()
first_cell = lib.arena_cells(arena)[lib.qcgc_arena_first_cell_index]
size = lib.qcgc_arena_cells_count - li... | Python | 0 | @@ -968,24 +968,518 @@
g_cells())%0A%0A
+ def test_alloc_full_arena(self):%0A size = 16 * (lib.qcgc_arena_cells_count - lib.qcgc_arena_first_cell_index)%0A i = 0%0A while (size %3E 2**lib.QCGC_LARGE_ALLOC_THRESHOLD_EXP):%0A i = (i + 16) %25 (2**lib.QCGC_LARGE_ALLOC_THRESHOLD_EXP)%0A ... |
7c419c1e0b34169e02d47653655a00c74cedecf1 | add a comment to test_documentation.py | test/test_documentation.py | test/test_documentation.py | import os
import unittest
from fnmatch import fnmatch
from sys import path
path.append('../')
class TestDocumentation(unittest.TestCase):
APP_ROOT = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
EXCLUDES = set(open('../.gitignore').read().split('\n') + ['.git'])
README = 'README.md'
def tes... | Python | 0 | @@ -499,16 +499,95 @@
_ROOT):%0A
+ # Ignore all subdirectories of directories that match the EXCLUDES%0A
@@ -702,16 +702,17 @@
LUDES)%5D%0A
+%0A
|
718e707b1f1a8748b959ea6adc36cefad789d82e | Indicate which measure is "usual" | src/SALib/analyze/pawn.py | src/SALib/analyze/pawn.py | from typing import Dict
import numpy as np
from scipy.stats import ks_2samp
from . import common_args
from ..util import (read_param_file, ResultDict,
extract_group_names, _check_groups)
def analyze(problem: Dict, X: np.ndarray, Y: np.ndarray, S: int = 10,
print_to_console: bool = Fa... | Python | 0.999999 | @@ -1622,18 +1622,72 @@
%60CV%60%60).
-As
+The median value is the typically reported value. As%0A
the %60%60C
@@ -1722,23 +1722,18 @@
mean),
-and%0A
+it
indicat
@@ -1747,16 +1747,20 @@
level of
+%0A
variabi
@@ -1804,20 +1804,16 @@
loser to
-%0A
zero in
@@ -1826,16 +1826,20 @@
ng lower
+%0A ... |
2d747ae15ad59b3d5c8c311e6f965f45188e8155 | Fix sqlalchemy models so they work with MySQL backend | monitoring/ciwatch/ciwatch/models.py | monitoring/ciwatch/ciwatch/models.py | # Copyright (c) 2015 Tintri. 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 app... | Python | 0.000445 | @@ -943,32 +943,37 @@
= Column(String
+(128)
, unique=True)%0A%0A
@@ -963,32 +963,32 @@
), unique=True)%0A
-
%0A def __repr_
@@ -1195,32 +1195,36 @@
= Column(String
+(64)
, unique=True)%0A
@@ -1245,16 +1245,20 @@
n(String
+(64)
) # Why
@@ -1420,24 +1420,30 @@
olumn(String
+(4096)
)%0A%0A proje
@@ -1... |
4ba44a884413631e8245afd654860310f7742e27 | add logging | mozy/apps/mosaic/backends/k_means.py | mozy/apps/mosaic/backends/k_means.py | import collections
import itertools
import operator
import functools
import excavator
from django.utils.functional import SimpleLazyObject
from mozy.apps.mosaic.models import (
StockImageTile,
Generation,
)
from mozy.apps.mosaic.utils import (
cast_image_data_to_numpy_array,
)
from mozy.apps.mosaic.simil... | Python | 0.000001 | @@ -61,16 +61,63 @@
unctools
+%0Aimport logging%0A%0Afrom contexttimer import Timer
%0A%0Aimport
@@ -567,24 +567,63 @@
ackend,%0A)%0A%0A%0A
+logger = logging.getLogger(__file__)%0A%0A%0A
def find_k_m
@@ -3552,24 +3552,55 @@
oup_data():%0A
+ with Timer() as timer:%0A
generati
@@ -3653,24 +3653,28 @@
IO... |
b898b50394c09b1091f1692573d527640472f9d4 | Update authentication.py | source/jormungandr/jormungandr/authentication.py | source/jormungandr/jormungandr/authentication.py | # encoding: utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobilit... | Python | 0.000001 | @@ -6008,16 +6008,125 @@
vitia.io
+ or contact your support if you%E2%80%99re using the opensource version of Navitia https://github.com/CanalTP/navitia
')%0A
|
dea38fdb88e4e5e8a9349c8ec4a189a047b6f107 | set old public val in teardown | source/jormungandr/tests/authentication_tests.py | source/jormungandr/tests/authentication_tests.py | # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | Python | 0.000001 | @@ -2448,32 +2448,83 @@
ef setUp(self):%0A
+ self.old_public_val = app.config%5B'PUBLIC'%5D%0A
app.conf
@@ -3155,8 +3155,83 @@
_code)%0A%0A
+ def tearDown(self):%0A app.config%5B'PUBLIC'%5D = self.old_public_val
|
d08c6b849d19549df9d1a179f187f44370c572a8 | bump version to 1.0.3 | doubles/__init__.py | doubles/__init__.py | __version__ = '1.0.2'
from doubles.class_double import ClassDouble # noqa
from doubles.instance_double import InstanceDouble # noqa
from doubles.object_double import ObjectDouble # noqa
from doubles.targets.allowance_target import allow # noqa
from doubles.targets.expectation_target import expect # noqa
from doub... | Python | 0 | @@ -16,9 +16,9 @@
1.0.
-2
+3
'%0A%0Af
|
d5ea3693336a1dda330894ec7e5c9e7172d7d5ae | Delete custom os environ after successful test | src/cltkv1/utils/utils.py | src/cltkv1/utils/utils.py | """Module for commonly reused classes and functions."""
import os
import sys
from contextlib import contextmanager
from typing import Any, Dict, List, Optional
def file_exists(file_path: str, is_dir: bool = False) -> bool:
"""Try to expand `~/` and check if a file or dir exists.
Optionally check if it's a di... | Python | 0 | @@ -4259,16 +4259,52 @@
om_dir'%0A
+ %3E%3E%3E del os.environ%5B%22CLTK_DATA%22%5D%0A
%22%22%22%0A
|
b4791205d6dd596235cc7c2806a0f1c8133789aa | Improve annotation upload. | girder_annotation/girder_large_image_annotation/handlers.py | girder_annotation/girder_large_image_annotation/handlers.py | import json
import uuid
import cachetools
import orjson
from girder import logger
from girder.constants import AccessType
from girder.models.file import File
from girder.models.item import Item
from girder.models.user import User
from .models.annotation import Annotation
_recentIdentifiers = cachetools.TTLCache(max... | Python | 0 | @@ -4878,16 +4878,103 @@
%5Bdata%5D%0A
+ data = %5Bentry%5B'annotation'%5D if 'annotation' in entry else entry for entry in data%5D%0A
# Ch
|
a79a3f7c42c858ae42c618479654cd7589de05b9 | Remove unused tests for hash map | zeeko/utils/tests/test_hmap.py | zeeko/utils/tests/test_hmap.py | # -*- coding: utf-8 -*-
import pytest
from ..hmap import HashMap
@pytest.fixture(params=[0,1,5,9])
def n(request):
"""Number of items"""
return request.param
@pytest.fixture
def items(n):
"""A list of strings."""
return ["item{0:d}".format(i) for i in range(n)]
@pytest.mark.skip
def test_hmap(items)... | Python | 0 | @@ -279,524 +279,5 @@
)%5D%0A%0A
-@pytest.mark.skip%0Adef test_hmap(items):%0A %22%22%22docstring for test%22%22%22%0A h = HashMap(10)%0A if len(items):%0A with pytest.raises(KeyError):%0A h%5Bitems%5B0%5D%5D%0A %0A for item in items:%0A h.add(item)%0A assert len(h) == len(it... |
7fe186b8382f9121ec19dde2c95fd401daa4c17e | Delete container references in the execution objects when containers are terminated | zoe_scheduler/state/manager.py | zoe_scheduler/state/manager.py | # Copyright (c) 2016, Daniele Venzano
#
# 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 w... | Python | 0.000001 | @@ -6586,24 +6586,142 @@
r(obj_id))%0A%0A
+ if what == 'container':%0A c = self.containers%5Bobj_id%5D%0A c.execution.containers.remove(c)%0A%0A
if o
|
c013574941af8e2c3761dcbf7843485f4f7ff15d | Disable get_handler test due to GIOChannel issue in python | tests/GIR/test_007_blob.py | tests/GIR/test_007_blob.py | # coding=utf-8
import sys
import struct
import unittest
from test_000_config import TestConfig
from test_001_connection import TestConnection
from gi.repository import Midgard, GObject, GLib
from gi import _gobject
class TestBlob(unittest.TestCase):
mgd = None
attachment = None
def setUp(self):
if self.mg... | Python | 0 | @@ -2451,16 +2451,168 @@
ENT)%0A
+ # There seems to be an issue with GIOChannel which is expected to be a boxed type.%0A # python-gobject doesn't set channel as boxed type derived%0A #
valid_h
@@ -2646,24 +2646,26 @@
ler(%22w%22)%0A
+ #
self.assert
|
c7f4424cdf17d47b3eeca92619b5cf8cde573217 | add apt repo examples to conf stub | ceph_deploy/conf/cephdeploy.py | ceph_deploy/conf/cephdeploy.py | from ConfigParser import SafeConfigParser, NoSectionError, NoOptionError
import os
from os import path
import re
cd_conf_template = """
#
# ceph-deploy configuration file
#
[ceph-deploy-global]
# Overrides for some of ceph-deploy's global flags, like verbosity or cluster
# name
[ceph-deploy-install]
# Overrides for... | Python | 0 | @@ -415,16 +415,29 @@
tion%0A#%0A%0A
+# yum repos:%0A
# %5Bmyrep
@@ -826,16 +826,352 @@
uild.asc
+%0A%0A# apt repos:%0A# %5Bmyrepo%5D%0A# baseurl = https://user:pass@example.org/%0A# gpgurl = https://example.org/keys/release.asc%0A# default = True%0A# extra-repos = cephrepo # will install the cephrepo file too%0A#%... |
7b30a1036f67ef6bc41b1c65cd610346080aecff | Fix identation | nodeconductor/core/authentication.py | nodeconductor/core/authentication.py | from __future__ import unicode_literals
from django.conf import settings
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
import rest_framework.authentication
from rest_framework import exceptions
import nodeconductor.logging.middleware
TOKEN_KEY = settings.NODECONDUCTOR.get... | Python | 0.001406 | @@ -1413,24 +1413,25 @@
%0A
+
token.create
@@ -1449,16 +1449,17 @@
e.now()%0A
+
|
9d797a9a0ad6e3e552d4cdbb385b7521c38327fe | update the example | example/myeventbus.py | example/myeventbus.py | __author__ = 'Xsank'
import time
from eventbus.eventbus import EventBus
from myevent import GreetEvent
from myevent import ByeEvent
from mylistener import MyListener
if __name__=="__main__":
eventbus=EventBus()
eventbus.register(MyListener())
ge=GreetEvent('world')
be=ByeEvent('world')
eventbus.a... | Python | 0.000128 | @@ -386,28 +386,51 @@
bus.unregister(MyListener())
+%0A eventbus.destroy()
|
ee954e6c221f4d78a2dcaf6607837fa62892ae37 | Add more tests | openfisca_core/tests/test_periods.py | openfisca_core/tests/test_periods.py | # -*- coding: utf-8 -*-
from nose.tools import assert_equal, raises
from openfisca_core.periods import Period, Instant, YEAR, MONTH, period
first_jan = Instant((2014, 1, 1))
first_march = Instant((2014, 3, 1))
# Test Period -> String
def test_year():
assert_equal(unicode(Period((YEAR, first_jan, 1))), u'2014'... | Python | 0 | @@ -2122,8 +2122,190 @@
iod(%7B%7D)%0A
+%0A%0A@raises(TypeError)%0Adef test_wrong_argument_1():%0A period(%5B%5D)%0A%0A%0A@raises(TypeError)%0Adef test_none():%0A period(None)%0A%0A%0A@raises(ValueError)%0Adef test_empty_string():%0A period('')%0A
|
ae833f3d8d876586825c501c2b1f618ca723c2f2 | Modified the generator output for get_annual_occurrence_rates of MultiMFD | openquake/hazardlib/mfd/multi_mfd.py | openquake/hazardlib/mfd/multi_mfd.py | # The Hazard Library
# Copyright (C) 2017 GEM Foundation
#
# This program 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 your option) any later version.
#
# Th... | Python | 0.999927 | @@ -5026,20 +5026,13 @@
-for rates in
+yield
mfd
@@ -5065,37 +5065,8 @@
es()
-:%0A yield rates
%0A%0A
|
fa42e6b47672a5948ceb161e450f7781dde81483 | Update output during polling and increase polling interval after 10 polling attempts | ci/push/push_request_status.py | ci/push/push_request_status.py | import os
import sys
import csv
import time
from push_api import SalesforcePushApi
# Force UTF8 output
reload(sys)
sys.setdefaultencoding('UTF8')
if __name__ == '__main__':
try:
username = os.environ.get('SF_USERNAME')
password = os.environ.get('SF_PASSWORD')
serverurl = os.enviro... | Python | 0 | @@ -141,16 +141,73 @@
UTF8')%0A%0A
+completed_statuses = %5B'Succeeded','Failed','Cancelled'%5D%0A%0A
if __nam
@@ -928,13 +928,10 @@
-while
+if
pus
@@ -958,48 +958,151 @@
in
-%5B'Succeeded','Failed','Cancelled'%5D:%0A
+completed_statuses:%0A print 'Push request is not yet complete. Polling ... |
8481002f71c3d51d4550841d49a02d85062aabc4 | Fix examples (#357) | examples/plot_pair.py | examples/plot_pair.py | """
Pair Plot
=========
_thumb: .2, .5
"""
import arviz as az
az.style.use('arviz-darkgrid')
centered = az.load_arviz_data('centered_eight')
coords = {'school': ['Choate', 'Deerfield']}
az.plot_pair(data, var_names=['theta', 'mu', 'tau'], coords=coords, divergences=True, textsize=22)
| Python | 0 | @@ -196,20 +196,24 @@
ot_pair(
-data
+centered
, var_na
|
faec4094389551b159b73df377a99c42df822c0d | Fix another Python 3 issue | staff_toolbar/items.py | staff_toolbar/items.py | """
These are the items that can be added to the staff toolbar.
"""
from django.contrib.admin.templatetags.admin_urls import admin_urlname
from django.core.urlresolvers import reverse, reverse_lazy
from django.utils.encoding import force_text
from django.utils.html import format_html
from django.utils.safestring import... | Python | 0.000168 | @@ -61,16 +61,28 @@
ar.%0A%22%22%22%0A
+import sys%0A%0A
from dja
@@ -393,16 +393,68 @@
y as _%0A%0A
+if sys.version_info%5B0%5D %3E= 3:%0A basestring = str%0A%0A%0A
__all__
|
5f193bb791947fe1195e2aebf00eb3d127247d10 | Document why title tag is omitted | src/elm_doc/tasks/html.py | src/elm_doc/tasks/html.py | import json
import html
from pathlib import Path
from elm_doc.utils import Namespace
PAGE_TEMPLATE = '''
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" size="16x16, 32x32, 48x48, 64x64, 128x128, 256x256" href="{mount_point}/assets/favicon.ico">
<link rel="stylesheet" hre... | Python | 0.000043 | @@ -81,16 +81,102 @@
space%0A%0A%0A
+# Note: title tag is omitted, as the Elm app sets the title after%0A# it's initialized.%0A
PAGE_TEM
|
10d4dba251e8ead23f283b5299458025fcd5d932 | Use 'con', not '/dev/tty', as the Trace() default on Windows. | src/engine/SCons/Debug.py | src/engine/SCons/Debug.py | """SCons.Debug
Code for debugging SCons internal things. Not everything here is
guaranteed to work all the way back to Python 1.5.2, and shouldn't be
needed by most users.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documen... | Python | 0.000152 | @@ -4688,16 +4688,79 @@
FP = %7B%7D%0A
+if sys.platform == 'win32':%0A TraceDefault = 'con'%0Aelse:%0A
TraceDef
@@ -4810,17 +4810,17 @@
, mode='
-a
+w
'):%0A
@@ -4836,18 +4836,16 @@
a trace
-a
message
|
d14210e6db6229948c9a501caf5452dde226d430 | Fix a missed name change of TimeStamp => TimeStampDefault. | src/engine/SCons/Debug.py | src/engine/SCons/Debug.py | """SCons.Debug
Code for debugging SCons internal things. Not everything here is
guaranteed to work all the way back to Python 1.5.2, and shouldn't be
needed by most users.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documen... | Python | 0.000001 | @@ -6269,24 +6269,31 @@
al TimeStamp
+Default
%0A global
|
7fabc03b95e8e3aae55d5a6afe86b24081039462 | deltas should be milliseconds not seconds | rewot/clients/zmud.py | rewot/clients/zmud.py | # -*- coding: utf-8 -*-
"""
ZMud Parser
~~~~~~~~~~~
ZMud client module to parse lines.
"""
import datetime
import re
from ansi2html import Ansi2HTMLConverter
class ZMud:
""" This ZMud class will, given a raw input line from the log, break it
down into the necessary components and process it. The goal of proc... | Python | 0.999999 | @@ -2214,16 +2214,51 @@
conds()%0A
+%09%09%09%09d%5B%22delta%22%5D = d%5B%22delta%22%5D * 1000%0A
%09%09%09self.
|
f2e8b406cd1296bf156bbb2963474c6dd7674260 | Remove host preparation that is not needed anymore. | tests/acceptance/common.py | tests/acceptance/common.py | #!/usr/bin/python
# Copyright 2016 Mender Software AS
#
# 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 ... | Python | 0 | @@ -937,16 +937,123 @@
-qemu%22)%0A
+ # Make sure we are connected.%0A execute(run_after_connect, %22true%22, hosts = conftest.current_hosts())%0A
exec
@@ -4475,395 +4475,92 @@
#
-TODO: It is unknown why this is needed. %22/u-boot%22 with %22auto%22%0A # attribute is in fstab already... This should b... |
4951b6fdb9702d6b13ce58d91ebdfebe2d7f232f | Make tests pass | tests/tests.py | tests/tests.py | import logging
logger = logging.getLogger('datapipe')
logger.setLevel(logging.WARN)
from datapipe import *
from datapipe.targets.mock import *
class TestTask(Task):
inp = Input()
def outputs(self):
outs = []
for i, elem in enumerate(self.inp):
outs.append(MockTarget('out_{}'.forma... | Python | 0.000033 | @@ -1247,244 +1247,8 @@
un()
-%0A assert hash(TestTask(%5Btarget%5D)) == hash(TestTask(%5Btarget%5D))%0A assert TestTask(%5Btarget%5D) == TestTask(%5Btarget%5D)%0A assert hash(MockTarget('test1')) == hash(MockTarget('test1'))%0A assert MockTarget('test1') == MockTarget('test1')
%0A%0Ade
|
171e8864534700a68ea946eb5a1f9fed6aa123c7 | Test fixed. | tests/tests.py | tests/tests.py | import os
import unittest
from selenium import webdriver
BASE_PROJECT_DIR = os.path.abspath(os.path.normpath('..'))
class TestTasksApp(unittest.TestCase):
def setUp(self):
self.main_page = os.path.join(BASE_PROJECT_DIR, "index.html")
self.browser = webdriver.Chrome()
self.browser.impli... | Python | 0 | @@ -3723,26 +3723,16 @@
k_btn, '
-New Task 1
')%0A%0A
@@ -3797,32 +3797,33 @@
e('task-entry')%0A
+%0A
self.ass
|
0d315dddbda1e88f9085ff717f20b2032fbb97c8 | revert default workers to 20 | 11_realtime/create_traindata.py | 11_realtime/create_traindata.py | #!/usr/bin/env python3
# Copyright 2021 Google 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 o... | Python | 0 | @@ -1880,10 +1880,10 @@
ers=
-66
+20
',%0A
|
319b4ebf24b12c12881688ca837ae6ccd897df0e | Removing a match to \w{2,3}\d+ that matches things like HK97 | PhiSpyModules/protein_functions.py | PhiSpyModules/protein_functions.py | import re
import os
def is_phage_func(func):
func = func.lower()
func = func.replace('-', ' ')
func = func.replace(',', ' ')
func = func.replace('/', ' ')
a = re.split(' ', func)
if (
'integrase' in a or
'phage' in a or
'lysin' in a or
... | Python | 0.998935 | @@ -3930,69 +3930,8 @@
, x)
- or%0A re.match('%5Ba-z%5D%7B2,3%7D%5Cd+%5B%5E:%5C+%5C-0-9%5D', x_lower)
%0A
|
2af686c117ce4ced82809b08457122abf7626144 | Use resolution=None | examples/warpimage.py | examples/warpimage.py | import pylab as P
import Image as I
from matplotlib.toolkits.basemap import Basemap
# shows how to warp an image from one map projection to another.
# Uses PIL.
# Download image from
# http://www.space-graphics.com/earth_topo-bathy.htm,
# convert from jpg to png.
# read in png image to rgba array of normalized floats.... | Python | 0.000039 | @@ -878,16 +878,73 @@
merica.%0A
+# resolution=None means don't bother with boundary data.%0A
m = Base
@@ -1110,29 +1110,12 @@
ion=
-'l',area_thresh=1000.
+None
,pro
|
faeba554cc62b80687b4fd1a7c00fcee2933ecf4 | use logger instead of logging (#14) | fuocore/dispatch.py | fuocore/dispatch.py | # -*- coding: utf-8 -*-
import weakref
import logging
try:
from weakref import WeakMethod
except ImportError:
from fuocore.backports.weakref import WeakMethod
class Signal(object):
def __init__(self, name='', *sig):
self.sig = sig
self.receivers = set()
def emit(self, *args):
... | Python | 0 | @@ -49,25 +49,16 @@
ogging%0A%0A
-try:%0A
from wea
@@ -84,80 +84,46 @@
hod%0A
-except ImportError:%0A from fuocore.backports.weakref import WeakMethod
+%0A%0Alogger = logging.getLogger(__name__)
%0A%0A%0Ac
@@ -405,19 +405,18 @@
logg
-ing
+er
.excepti
|
311a858ecbe7d34f9f68a18a3735db9da8b0e692 | Fix global test driver initialization | tests/utils.py | tests/utils.py | import atexit
import tempfile
import sys
import mock
from selenium import webdriver
import os
def build_mock_mapping(name):
mock_driver = mock.Mock()
browser_mapping = {name: mock_driver}
mock_driver.return_value.name = name
return browser_mapping
test_driver = None
def get_driver():
global te... | Python | 0.00001 | @@ -440,22 +440,27 @@
-chrome
+test_driver
= webdr
@@ -523,31 +523,41 @@
ter(
-chrome.quit)%0A chrome
+test_driver.quit)%0A test_driver
.del
@@ -578,22 +578,27 @@
s()%0A
-chrome
+test_driver
.switch_
@@ -629,22 +629,27 @@
return
-chrome
+test_driver
%0A%0A%0Adef m
|
dbe5a1b99f64b463e51963f0d3296dff5034f168 | Fix predict_proba bugs (python 2.7) | tffm/models.py | tffm/models.py | """Implementation of an arbitrary order Factorization Machines."""
import os
import numpy as np
import tensorflow as tf
import shutil
from tqdm import tqdm
from .core import TFFMCore
from .base import TFFMBaseModel
from .utils import loss_logistic, loss_mse
class TFFMClassifier(TFFMBaseModel):
"""Factorizatio... | Python | 0.000013 | @@ -253,16 +253,25 @@
loss_mse
+, sigmoid
%0A%0A%0A%0Aclas
@@ -1943,14 +1943,8 @@
e =
-utils.
sigm
@@ -2023,19 +2023,14 @@
np.
-concatenate
+vstack
((pr
@@ -2041,16 +2041,18 @@
negative
+.T
, probs_
@@ -2063,17 +2063,11 @@
tive
-), axis=1
+.T)
)%0A
@@ -2084,16 +2084,18 @@
rn probs
+.T
%0A%0A%0Aclass
|
e83d8edc6c90fd91e68fc4251e7f0532b06ad6fb | Add docstring for ClusterAbstraction | pygraphc/clustering/ClusterAbstraction.py | pygraphc/clustering/ClusterAbstraction.py |
class ClusterAbstraction(object):
@staticmethod
def dp_lcs(graph, clusters):
abstraction = {}
for cluster_id, nodes in clusters.iteritems():
data = []
for node_id in nodes:
data.append(graph.node[node_id]['preprocessed_event'])
abstraction[clu... | Python | 0 | @@ -36,54 +36,787 @@
-@staticmethod%0A def dp_lcs(graph, clusters):
+%22%22%22Get cluster abstraction based on longest common substring.%0A%0A References%0A ----------%0A .. %5B1%5D jtjacques, Longest common substring from more than two strings - Python.%0A http://stackoverflow.com/questions... |
395c0a9cbeceb512972b71199dd46661af7fcce2 | Update pcl-reference-assemblies.py | packages/pcl-reference-assemblies.py | packages/pcl-reference-assemblies.py | import glob
import os
import shutil
class PCLReferenceAssembliesPackage(Package):
def __init__(self):
Package.__init__(self,
name='PortableReferenceAssemblies',
version='2013-09-10',
sources=['http://last-hope.baulig.net/misc/mono-... | Python | 0 | @@ -1020,101 +1020,8 @@
))%0A%0A
- # Remove v4.6 until we support it%0A shutil.rmtree(os.path.join(dest, %22v4.6%22))%0A%0A
PCLR
|
019a4d0d4b3a634cc0dd24fa33f420ee322ea36c | Mark purge_index as a private method | pyjobs_web/pyjobsweb/commands/purge_es.py | pyjobs_web/pyjobsweb/commands/purge_es.py | # -*- coding: utf-8 -*-
import elasticsearch.exceptions
import elasticsearch_dsl
import transaction
import logging
from pyjobsweb.commands import AppContextCommand
from pyjobsweb import model
class PurgeESCommand(AppContextCommand):
def get_parser(self, prog_name):
parser = super(PurgeESCommand, self).ge... | Python | 0.000001 | @@ -1000,24 +1000,25 @@
hod%0A def
+_
purge_index(
@@ -1954,32 +1954,33 @@
):%0A self.
+_
purge_index('job
@@ -2666,24 +2666,25 @@
self.
+_
purge_index(
|
de0bb3543d68b65cc61f9449a3c44d48b3920e49 | add flagged and timestamp to admin view | gatekeeper/admin.py | gatekeeper/admin.py | from django.contrib import admin
from gatekeeper.models import ModeratedObject
class ModeratedObjectAdmin(admin.ModelAdmin):
list_display = ('object_name', 'moderation_status',)
list_editable = ('moderation_status',)
list_filter = ['moderation_status','flagged','content_type']
def object_name(self, ob... | Python | 0 | @@ -153,16 +153,29 @@
t_name',
+ 'timestamp',
'modera
@@ -179,32 +179,42 @@
eration_status',
+ 'flagged'
)%0A list_edita
@@ -240,16 +240,25 @@
status',
+'flagged'
)%0A li
|
b15a79e311c45cd25181b79d9657eedcf5ac3785 | Set version to v6.11.1 | thinc/about.py | thinc/about.py | # inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
__name__ = 'thinc'
__version__ = '6.11.1.dev20'
__summary__ = "Practical Machine Learning for NLP"
__uri__ = 'https://github.com/explosion/thin... | Python | 0.000001 | @@ -214,14 +214,8 @@
11.1
-.dev20
'%0A__
@@ -432,10 +432,9 @@
_ =
-Fals
+Tru
e%0A
|
2cebca596f9e24f165b7db64993622c1e49a5ddd | add slot names for item-containing tile entities | entity.py | entity.py | '''
Created on Jul 23, 2011
@author: Rio
'''
#from mclevelbase import *
from nbt import *
import nbt
from copy import deepcopy
__all__ = "Entity, TileEntity".split(", ")
id = "id"
Motion = "Motion"
Pos = "Pos"
Rotation = "Rotation"
class TileEntity(object):
baseStructures = {
"Furnace": (
(... | Python | 0 | @@ -1269,24 +1269,283 @@
%22: 4,%0A %7D%0A
+ slotNames = %7B%0A %22Furnace%22: %7B%0A 0: %22Raw%22,%0A 1: %22Fuel%22,%0A 2: %22Product%22%0A %7D,%0A %22Cauldron%22: %7B%0A 0: %22Potion%22,%0A 1: %22Potion%22,%0A 2: %22Potion%2... |
245c1f5105c7aa0884905f3ca8a8093b511ecf40 | Add $ to Url.encode_url() to fix loading images with $ in the path. Fixes #570 | thumbor/url.py | thumbor/url.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
import re
from urllib import quote
class Url(object):
unsafe_o... | Python | 0 | @@ -5279,11 +5279,12 @@
&()~%22,%5C'
+$
')%0A
|
692584f8cfeb5d75a6d38529ed1029286188a3a9 | Add features_masks array in mock model | phy/cluster/manual/tests/conftest.py | phy/cluster/manual/tests/conftest.py | # -*- coding: utf-8 -*-
"""Test fixtures."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
from pytest import yield_fixture
from phy.electrode.mea import staggered_positions
from phy.io.array ... | Python | 0.000001 | @@ -211,16 +211,35 @@
------%0A%0A
+import numpy as np%0A
from pyt
@@ -2144,16 +2144,188 @@
atures)%0A
+%0A # features_masks array%0A f = model.features.reshape((n_spikes, -1))%0A m = np.repeat(model.masks, n_features, axis=1)%0A model.features_masks = np.dstack((f, m))%0A%0A
mode
|
cfe0ec75e791fcdc5d32c182ae5d3f324567dc58 | remove print | gfwlist2pac/main.py | gfwlist2pac/main.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pkgutil
import urlparse
import json
import logging
import urllib2
from argparse import ArgumentParser
__all__ = ['main']
gfwlist_url = 'https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt'
def parse_args():
parser = ArgumentParser()
parser.add_ar... | Python | 0.000793 | @@ -2061,27 +2061,8 @@
st:%0A
- print line%0A
|
2717dbb7a133776adeb63a2b7ab9fb7203973e54 | fix docstring | fields.py | fields.py | # -*- coding: utf-8 -*-
from validators import ValidationError
from converters import ConversionError, unicode_converter
class RequiredError(BaseException):
pass
class MissingDefault(BaseException):
pass
class BaseField(object):
"""Basic field validators and converter set.
usage:
>>... | Python | 0.000018 | @@ -146,32 +146,102 @@
BaseException):%0A
+ %22%22%22%60required%60 flag is True and missing input value in %60field%60.%22%22%22%0A
pass%0A%0Aclass
@@ -390,170 +390,352 @@
%3E%3E f
-ield = BaseField(required=True, validators=Equal('x'))%0A %3E%3E%3E value = field(None)%0A RequiredError%0A ... |
bdfcc0cfbcea0adcbdbe31a55a44a97e2ea45726 | convert to gzip based read | ghost_pathfinder.py | ghost_pathfinder.py | #!/bin/env python
'''
ghost whirlwind
this application will attempt to parse a log file and play back the log
messages as they occurred. meaning that it will read the date stamp from each
log line and attempt to calculcate the time difference and sleep between
sends. it will send the lines to a port specified on the c... | Python | 0.999987 | @@ -525,16 +525,28 @@
atetime%0A
+import gzip%0A
import j
@@ -549,16 +549,16 @@
rt json%0A
-
import o
@@ -1003,24 +1003,15 @@
try(
-logfile, filesiz
+nextlin
e):%0A
@@ -1820,24 +1820,26 @@
estamp)%0A%0A
+ #
nextline =
@@ -3120,12 +3120,21 @@
e =
-open
+gzip.GzipFile
(arg
@@ -3145,24 +3145,26 @@
le, 'r'... |
ca03e4c1862bb306ca389a5a3ba648d287133917 | Verify pdf before showing link | readthedocs/restapi/views/footer_views.py | readthedocs/restapi/views/footer_views.py | from django.shortcuts import get_object_or_404
from django.template import Context, loader as template_loader
from django.conf import settings
from django.core.context_processors import csrf
from rest_framework import decorators, permissions
from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAP... | Python | 0 | @@ -2304,16 +2304,58 @@
== 'tag'
+ and version.project.has_pdf(version.slug)
:%0A
|
e50501756e4b4c6ad8f98cf28d3d50f56f1f3fe9 | Allow disabling promo on projects | readthedocs/restapi/views/footer_views.py | readthedocs/restapi/views/footer_views.py | from django.shortcuts import get_object_or_404
from django.template import Context, loader as template_loader
from django.conf import settings
from django.core.context_processors import csrf
from rest_framework import decorators, permissions
from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAP... | Python | 0 | @@ -2735,16 +2735,115 @@
= False
+%0A if project.slug in getattr(settings, 'DISABLE_PROMO_PROJECTS', %5B%5D):%0A show_promo = False
%0A%0A co
|
c2054c2fb0e5af75ffa1ac1305b3fa805f73ae4a | enable persistent cache also on Windows | recipe_modules/infra_paths/path_config.py | recipe_modules/infra_paths/path_config.py | # Copyright 2016 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.
import DEPS
CONFIG_CTX = DEPS['path'].CONFIG_CTX
@CONFIG_CTX()
def infra_common(c):
c.dynamic_paths['checkout'] = None
@CONFIG_CTX(includes=['infra_com... | Python | 0 | @@ -1075,196 +1075,100 @@
es.%0A
+%0A
-# TODO(phajdan.jr): set persistent cache path for remaining platforms.%0A # NOTE: do not use /b/swarm_slave here - it gets deleted on bot redeploy,%0A # and may happen even after a reboot.
+b_dir = c.CURRENT_WORKING_DIR%0A while b_dir and b_dir%5B-1%5D != 'b':%0A b_dir ... |
2da1efbd5c901490eb19809cd0bbcf92a15ce6df | remove dummy module from pypi setup | tools/setup.py | tools/setup.py | from sys import executable
setuptools_import_error_message = """setuptools is not installed for """ + executable + """
Please follow this link for installing instructions :
https://pypi.python.org/pypi/setuptools
make sure you use \"""" + executable + """\" during the installation"""
try:
from setuptools import s... | Python | 0 | @@ -319,22 +319,25 @@
setup,
-Extens
+Distribut
ion%0Aexce
@@ -773,216 +773,95 @@
()%0A%0A
-dummy_module = Extension('dummy_ortools_dependency',%0A sources = %5B'dummy/dummy_ortools_dependency.cc'%5D,%0ADELETEUNIX extra_link_args=%5B'/MANIFEST'%5D,%0A )
... |
023ed0a8018dc6787538d88e776681def9cc3695 | Make set_hashes method work with path-like url | resolwe/storage/connectors/s3connector.py | resolwe/storage/connectors/s3connector.py | """Amazon S3 storage connector."""
import json
import logging
import mimetypes
import os
from pathlib import Path
import boto3
import botocore
from .baseconnector import BaseStorageConnector, validate_url, validate_urls
logger = logging.getLogger(__name__)
class AwsS3Connector(BaseStorageConnector):
"""Amazon ... | Python | 0.000013 | @@ -6834,19 +6834,30 @@
%22Key%22:
+os.fspath(
url
+)
,%0A
@@ -6953,19 +6953,30 @@
+os.fspath(
url
+)
,%0A
|
c4de6387b90ab222bd76d208d999ce54ede558bd | Fix TypeError exception. | ftpush.py | ftpush.py | #!/usr/bin/env python
'''
ftpush.py - Copyright 2010, Ton van den Heuvel, Ecomation
'''
import ftplib, getpass, optparse, os, re, threading
import pyinotify
class Monitor(pyinotify.ProcessEvent):
def __init__(self, url, username, path, ignore):
self.path = os.path.abspath(path)
self.url = url
... | Python | 0.000002 | @@ -4018,26 +4018,16 @@
athname)
-, filesize
)%0A%0A @
|
525725fd1578479a4629677bee3eab20e6170839 | Remove documented code | github.py | github.py | import requests
import constants
# payload = "{\"query\": \"query($repository: String!) {repository(owner: \\\"talk-to\\\",name: $repository) " \
# "{refs(last: 10,refPrefix:\\\"refs/tags/\\\") {edges {node{name}}}}}\"," \
# "\"variables\": \"{\\\"repository\\\": \\\"Knock\\\"}\"\n\t\n}\n\n"
#
# re... | Python | 0.000003 | @@ -31,390 +31,8 @@
ts%0A%0A
-# payload = %22%7B%5C%22query%5C%22: %5C%22query($repository: String!) %7Brepository(owner: %5C%5C%5C%22talk-to%5C%5C%5C%22,name: $repository) %22 %5C%0A# %22%7Brefs(last: 10,refPrefix:%5C%5C%5C%22refs/tags/%5C%5C%5C%22) %7Bedges %7Bnode%7Bname%7D%7D%7D%7D%7D%5C%22,%22 %5C%0A# ... |
66cf5ca096c8b327e6facf6bb71b59efe633c1d0 | Fix tests | tests/imap/test_actions.py | tests/imap/test_actions.py | # flake8: noqa: F401, F811
# -*- coding: utf-8 -*-
import mock
import pytest
from flanker import mime
from inbox.actions.base import (change_labels, save_draft, update_draft,
delete_draft, create_folder, update_folder,
delete_folder, create_label, update_l... | Python | 0.000003 | @@ -2744,60 +2744,8 @@
%7D)%0A%0A
- fix(lint): Whitespace autopep8 lint changes%0A
|
874058d757f5f334700fd7e9b353a9469b65f00b | remove daemon runner import, as it is done by `common` lib now | client/compass/agent_daemon.py | client/compass/agent_daemon.py | # Copyright 2016 Network Intelligence Research Center,
# Beijing University of Posts and Telecommunications
#
# 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/licen... | Python | 0 | @@ -887,34 +887,8 @@
ibs%0A
-from daemon import runner%0A
impo
|
64438380a33b8d4cbb7b8d726ed3d9007192f5f6 | remove old comemnt | custom/enikshay/nikshay_datamigration/models.py | custom/enikshay/nikshay_datamigration/models.py | from django.db import models
class PatientDetail(models.Model):
PregId = models.CharField(max_length=255, primary_key=True) # need to remove trailing whitespace in Excel
scode = models.CharField(max_length=255, null=True)
Dtocode = models.CharField(max_length=255, null=True)
Tbunitcode = models.Intege... | Python | 0.000142 | @@ -4488,74 +4488,8 @@
ail)
- # requires trimming whitespace in excel and moving to end of CSV
%0A
|
69b00eb259a7eeffc86313ec1bf9eebd268ab127 | add missing import | tests/load/siege-server.py | tests/load/siege-server.py | #! /usr/bin/env python
from json import loads
from shutil import copyfileobj
from subprocess import Popen
from sys import argv, exit
from tempfile import mkstemp
from time import sleep, time
from urllib2 import Request, urlopen
print 'Starting siege driver'
print 'Requires the siege load test program'
print 'See http... | Python | 0.000042 | @@ -185,16 +185,48 @@
p, time%0A
+from traceback import print_exc%0A
from url
|
ffe55eca7cc58a13f8dd1b9c2da9e8fa05c9f9e5 | add comment | google.py | google.py | #!/usr/bin/env python3
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from datetime import datetime
from os import path
import settings
class GoogleSheet:
"""
Use Google Sheet as online database.
Connection is recreated for each sheet access to avoid timeout issues.
... | Python | 0 | @@ -360,16 +360,120 @@
memory.%0A
+ All values are read at object creation.%0A It takes 1 minute to obtain 20k rows on Raspberry Pi 3.%0A
%22%22%22%0A
|
dfa365c6a4667218b0b18a739f087ca941afad3e | Simplify simplerandom.random class BPF (bits-per-float) calcs. | python/python2/simplerandom/random/_random_py.py | python/python2/simplerandom/random/_random_py.py |
# Standard Python library
import random
from numbers import Integral as _Integral
from os import urandom as _urandom
from binascii import hexlify as _hexlify
from math import log
import simplerandom.iterators as sri
class _StandardRandomTemplate(random.Random):
BPF = random.BPF
RECIP_BPF = random.RECIP_BPF
... | Python | 0 | @@ -920,30 +920,24 @@
-self._
bpf = self.B
@@ -943,162 +943,8 @@
BPF%0A
- self._recip_bpf = self.RECIP_BPF%0A self._rng_n = int((self._bpf + self.RNG_RANGE_BITS - 1) / self.RNG_RANGE_BITS)%0A else:%0A
@@ -2439,111 +2439,31 @@
lf._
-recip_bpf = 1./(1 %3C%3C bpf)%0A... |
8f9f00cb405142447ddcfd5eb80d5668d55512ab | revert some code | scout/server/blueprints/variants/forms.py | scout/server/blueprints/variants/forms.py | # -*- coding: utf-8 -*-
import decimal
import logging
from flask_wtf import FlaskForm
from wtforms import (
BooleanField,
DecimalField,
Field,
TextField,
SelectMultipleField,
SelectField,
HiddenField,
StringField,
IntegerField,
SubmitField,
validators,
)
from wtforms.widgets... | Python | 0.000005 | @@ -3748,67 +3748,8 @@
t%22)%0A
- clinical_filter = SubmitField(label=%22Clinical filter%22)%0A
%0A%0Acl
@@ -4043,17 +4043,16 @@
HOICES)%0A
-%0A
loca
@@ -4096,16 +4096,75 @@
hive)%22)%0A
+ clinical_filter = SubmitField(label=%22Clinical filter%22)%0A
%0A%0Aclass
@@ -5345,12 +5345,71 @@
weGen obs%22)%0... |
b5ab85ed4d1b6d87906c0bd6b1d37e083e76d3b0 | fix the order of columns | scripts/extract_episodes_from_subjects.py | scripts/extract_episodes_from_subjects.py | import argparse
import os
import sys
from mimic3benchmark.subject import read_stays, read_diagnoses, read_events, get_events_for_stay, add_hours_elpased_to_events
from mimic3benchmark.subject import convert_events_to_timeseries, get_first_valid_from_timeseries
from mimic3benchmark.preprocessing import read_itemid_to_... | Python | 1 | @@ -3437,16 +3437,182 @@
ustay')%0A
+ columns = list(episode.columns)%0A columns_sorted = sorted(columns, key=(lambda x: %22%22 if x == %22Hours%22 else x))%0A episode = episode%5Bcolumns_sorted%5D%0A
|
867cfa6fac0054e4543aaf5e3e9bd47df5ea5900 | Migrate node logs as well | scripts/osfstorage/migrate_from_oldels.py | scripts/osfstorage/migrate_from_oldels.py | import copy
import logging
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from framework.mongo import database
from framework.transactions.context import TokuTransaction
from scripts import utils as scripts_utils
from website.app import init_app
from website.addons.osfstorage import model... | Python | 0 | @@ -1361,47 +1361,986 @@
ate_
-download_counts(node, old, new, dry=dry
+log(node, old, new, dry=dry)%0A migrate_download_counts(node, old, new, dry=dry)%0A%0A%0Adef migrate_log(node, old, new, dry=True):%0A res = NodeLog.find(%0A (%0A Q('params.node', 'eq', node._id) %7C%0A Q('params... |
c3dde3479bc65d1f819e4deeb03ee0ec0d20eac1 | Rename variable | coalib/misc/StringConverter.py | coalib/misc/StringConverter.py | """
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, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT... | Python | 0.000001 | @@ -1403,37 +1403,37 @@
self.__
-value_changed
+recreate_list
= True%0A%0A
@@ -2497,29 +2497,29 @@
self.__
-value_changed
+recreate_list
:%0A
@@ -2888,29 +2888,29 @@
self.__
-value_changed
+recreate_list
= False
@@ -3153,21 +3153,21 @@
f.__
-value_changed
+recreate_list
= T
|
2a8c57bcb4fad794dd1bc8f10ec6952b6789a5b2 | Fix get all zones | scripts/sprinkler/zone_control_helpers.py | scripts/sprinkler/zone_control_helpers.py | import RPi.GPIO as GPIO
import sys
import time
import json
from tqdm import tqdm
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
# GPIO/BOARD | Relay IN | Rotors | Zone
# 22/15 | R2 IN2 | 1 | B
# 18/12 | R1 IN2 | 2 | A
# 23/16 | R1 IN3 | 3 | D
# 17/11 | R1 IN4 | 4 | C... | Python | 0.000001 | @@ -2034,25 +2034,22 @@
e))%0A
- print
+return
get_all
@@ -2055,21 +2055,16 @@
l_zones(
-zones
)%0A%0A%0Adef
|
7e4dfdae04af881408ce623c330b7b30f9a63498 | make flake8 happy | server/liveblog/syndication/exceptions.py | server/liveblog/syndication/exceptions.py | class APIConnectionError(Exception):
pass
class ProducerAPIError(APIConnectionError):
pass
class ConsumerAPIError(APIConnectionError):
pass | Python | 0 | @@ -128,28 +128,29 @@
PIConnectionError):%0A pass
+%0A
|
c22ae8b38b2843f9a8c3504c9b89593908a343aa | Fix #267 (#269) | server/plugins/cryptstatus/cryptstatus.py | server/plugins/cryptstatus/cryptstatus.py | import requests
from collections import defaultdict
from requests.exceptions import RequestException
from django.conf import settings
from django.utils.dateparse import parse_datetime
import sal.plugin
import server.utils as utils
class CryptStatus(sal.plugin.DetailPlugin):
description = 'FileVault Escrow Stat... | Python | 0.000003 | @@ -560,16 +560,72 @@
', None)
+%0A if crypt_url:%0A crypt_url = crypt_url
.rstrip(
|
24dd28f4b1db8e67ea11936a02c231d672d4bf15 | Fix settings import clash in go.billing.forms (@jerith). | go/billing/forms.py | go/billing/forms.py | from decimal import Decimal, Context, Inexact
from django.conf import settings
from django import forms
from django.forms import ModelForm
from django.forms.models import BaseModelFormSet
from go.vumitools.api import VumiApi
from go.billing import settings
from go.billing.models import Account, TagPool, MessageCost,... | Python | 0 | @@ -248,24 +248,40 @@
ort settings
+ as app_settings
%0Afrom go.bil
@@ -979,16 +979,20 @@
+app_
settings
@@ -1098,16 +1098,37 @@
uantize(
+%0A app_
settings
@@ -1154,55 +1154,8 @@
ENT,
-%0A
con
|
e8da41193238a7c677ec7ff8339095ec3e71be3b | Fix formatting, show total and sort | track_count.py | track_count.py | from report import *
def show_track_count(S):
print "Track Count\t\tSubmission Count"
for (track, count) in S.track_count().items():
if track:
print "%s\t\t%s" % (track.ljust(20), count)
if __name__ == "__main__":
# S = ALL.standard().vote_cutoff(4.0)
S = ALL.standard().filter(... | Python | 0.000003 | @@ -62,16 +62,31 @@
ck Count
+%22.ljust(40) + %22
%5Ct%5CtSubm
@@ -108,16 +108,71 @@
%0A
+items = S.track_count().items()%0A total = sum(%5Bcount
for (tra
@@ -185,38 +185,136 @@
unt) in
-S.
+items%5D)%0A for (
track
-_
+,
count
-().items(
+) in sorted(items, cmp=lambda (a_track, a_count), (b_trac... |
0f9f8dfe459ca98f4ea75d4358724cab3c0559bf | add minimal python version for naoth package to setup.py | Utils/py/naoth/setup.py | Utils/py/naoth/setup.py | #!/usr/bin/python
from setuptools import setup, find_packages
setup(name='naoth',
version='0.3',
author='NaoTH Berlin United',
author_email='nao-team@informatik.hu-berlin.de',
description='Python utils for the NaoTH toolchain',
packages=find_packages(),
zip_safe=False,
setup_... | Python | 0 | @@ -395,10 +395,51 @@
%0A %5D
+,%0A python_requires='%3E=3.6.9',%0A
)%0A
|
e7c7dbf948fdcb59054298d0e2b163ca5916dc8e | Set content_type, accepts | Tests/scripts/wait_until_server_ready.py | Tests/scripts/wait_until_server_ready.py | """Wait for server to be ready for tests"""
import sys
import json
import argparse
from time import sleep
import datetime
import demisto_client.demisto_api
from demisto_client.demisto_api.rest import ApiException
from typing import List, AnyStr
import urllib3.util
# Disable insecure warnings
urllib3.disable_warnings(... | Python | 0.000004 | @@ -1959,16 +1959,76 @@
d='POST'
+, accept='application/json', content_type='application/json'
)%0A
|
8ce5388565925dbd72698ff632b7219e4d375406 | Fix test_adhoc_result error message | tests/test_adhoc_result.py | tests/test_adhoc_result.py | import pytest
from types import GeneratorType
from pytest_ansible.results import ModuleResult
from conftest import ALL_HOSTS
invalid_hosts = ['none', 'all', '*', 'local*']
@pytest.fixture()
def adhoc_result(hosts):
return hosts.all.ping()
def test_len(adhoc_result):
assert len(adhoc_result) == len(ALL_HOS... | Python | 0.000016 | @@ -4029,13 +4029,18 @@
sg'%5D
- == u
+.contains(
'Fai
@@ -4077,7 +4077,7 @@
ssh
-.
'
+)
%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.