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 |
|---|---|---|---|---|---|---|---|
a26ed666b657286ecbd619631ce19c3cacf43c2b | Update docs | src/psd_tools/user_api/shape.py | src/psd_tools/user_api/shape.py | # -*- coding: utf-8 -*-
"""Shape layer API."""
from __future__ import absolute_import
import logging
from psd_tools.debug import pretty_namedtuple
from psd_tools.constants import TaggedBlock, PathResource
logger = logging.getLogger(__name__)
class StrokeStyle(object):
"""StrokeStyle contains decorative infromat... | Python | 0.000001 | @@ -198,16 +198,64 @@
Resource
+%0Afrom psd_tools.decoder.actions import UnitFloat
%0A%0Alogger
@@ -1426,32 +1426,68 @@
width in float.
+%0A%0A :rtype: UnitFloat%0A
%22%22%22%0A retu
@@ -1526,13 +1526,34 @@
th',
+ UnitFloat('PIXELS',
1.0)
+)
%0A%0A
@@ -1637,22 +1637,73 @@
list of
- fl... |
cdf7dfc01cca8472c517d2a93d89e97e1f838103 | Add metanode to degree_df functionality | hetio/stats.py | hetio/stats.py | import pandas
import matplotlib
import matplotlib.backends.backend_pdf
import seaborn
def get_degrees_for_metanode(graph, metanode):
"""
Return a dataframe that reports the degree of each metaedge for
each node of kind metanode.
"""
metanode_to_nodes = graph.get_metanode_to_nodes()
nodes = meta... | Python | 0 | @@ -466,17 +466,23 @@
nd((
-str(node)
+node.identifier
, no
@@ -606,16 +606,16 @@
gree'%5D)%0A
-
retu
@@ -660,16 +660,1031 @@
dge'%5D)%0A%0A
+def get_metanode_to_degree_df(graph):%0A %22%22%22%0A Return a dictionary of metanode to degree_df, where degree_df is a%0A wide-format dataframe of node degree... |
e5e23fd278051c12bd3fea0de6f0e46791f97b65 | add a test for issue57 which currently needs to be fixed on py-trunk though | testing/test_remote.py | testing/test_remote.py | import py
py.test.importorskip("execnet")
from xdist.remote import LooponfailingSession, LoopState, RemoteControl
class TestRemoteControl:
def test_nofailures(self, testdir):
item = testdir.getitem("def test_func(): pass\n")
control = RemoteControl(item.config)
control.setup()
fail... | Python | 0 | @@ -4618,8 +4618,409 @@
ll(15)%0A%0A
+ def test_looponfail_xfail_passes(self, testdir):%0A p = testdir.makepyfile(%22%22%22%0A import py%0A @py.test.mark.xfail%0A def test_one():%0A pass%0A %22%22%22)%0A child = testdir.spawn_pytest(%22-f %25s%22 ... |
b21ada1cb1b0fc1be4dc10bd72aaabcc3a72389e | Beer+python=fail | etcdocker/util.py | etcdocker/util.py | import ast
import docker
import etcd
import logging
LOG = logging.getLogger("etcdocker")
def _get_docker_client():
# Assume docker is local
return docker.Client()
def _get_etcd_client():
# Assume docker is local
return etcd.Client()
def get_containers():
client = _get_docker_client()
ret... | Python | 0.999974 | @@ -3778,20 +3778,22 @@
ker_
+s
im
-age_lat
+ilar_imag
es
-t
(ima
|
3846907435da720c075ab89579b970da5019b49f | Add Tapastic/AmpleTime | dosagelib/plugins/tapastic.py | dosagelib/plugins/tapastic.py | # SPDX-License-Identifier: MIT
# Copyright (C) 2019-2020 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
import json
import re
from ..scraper import _ParserScraper
from ..helpers import indirectStarter
class Tapastic(_ParserScraper):
baseUrl = 'https://tapas.io/'
imageSearch = '//article[contains(@... | Python | 0.000001 | @@ -1499,16 +1499,60 @@
comics%0A
+ cls('AmpleTime', 'Ample-Time'),%0A
|
531d4d02db38e6b42266303d680d6289352bf8a5 | Revert "Update pendulum.py (#2444)" (#2475) | gym/envs/classic_control/pendulum.py | gym/envs/classic_control/pendulum.py | import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
from os import path
class PendulumEnv(gym.Env):
"""
Description:
The inverted pendulum swingup problem is a classic
problem in the control literature. In this version of the
problem, the pendulum starts ... | Python | 0 | @@ -130,690 +130,8 @@
v):%0A
- %22%22%22%0A Description:%0A The inverted pendulum swingup problem is a classic%0A problem in the control literature. In this version of the%0A problem, the pendulum starts in a random position, and the%0A goal is to swing it up so it stays upright.%0A ... |
62314491b148c51e7c27e13aded283a0622c47f4 | improve h5py config check | hpat/config.py | hpat/config.py | try:
from .io import _hdf5
except ImportError:
_has_h5py = False
else:
_has_h5py = True
try:
import pyarrow
except ImportError:
_has_pyarrow = False
else:
_has_pyarrow = True
try:
from . import ros_cpp
except ImportError:
_has_ros = False
else:
_has_ros = True
try:
from . impo... | Python | 0 | @@ -24,16 +24,82 @@
t _hdf5%0A
+ import h5py%0A # TODO: make sure h5py/hdf5 supports parallel%0A
except I
|
75729e3e06c560892f0bf285fdd8a15f9f58b7d5 | Delete local file with no signature, without trying reget | lib/oelite/fetch/url.py | lib/oelite/fetch/url.py | import oelite.fetch
import bb.utils
import os
import urlgrabber
import hashlib
class UrlFetcher():
SUPPORTED_SCHEMES = ("http", "https", "ftp")
def __init__(self, uri, d):
if not uri.scheme in self.SUPPORTED_SCHEMES:
raise Exception(
"Scheme %s not supported by oelite.fetc... | Python | 0 | @@ -2411,65 +2411,34 @@
-f = self.grab(url, reget=%22simple%22)%0A else:%0A
+os.unlink(self.localpath)%0A
|
ae7a5bef1e3ee0216651dc4aeef3abcbab3cf76e | update code | Strings/alternating-characters.py | Strings/alternating-characters.py | # Alternating Characters
# Developer: Murillo Grubler
# Link: https://www.hackerrank.com/challenges/alternating-characters/problem
def alternatingCharacters(s):
sumChars = 0
for i in range(len(s)):
if i == 0 or tempChar != s[i]:
tempChar = s[i]
continue
if tempChar == s[... | Python | 0 | @@ -125,16 +125,40 @@
roblem%0A%0A
+# Time complexity: O(n)%0A
def alte
|
11f1005653fff98025bb9a7b20d59bd85563c5eb | test for shape problem | test/tst_fancyslicing.py | test/tst_fancyslicing.py | from netCDF4 import Dataset
from numpy.random import seed, randint
from numpy.testing import assert_array_equal, assert_equal
import tempfile, unittest, os, random
import numpy as np
file_name = tempfile.mktemp(".nc")
xdim=9; ydim=10; zdim=11
i = np.array([2,5,7],'i4')
ib = np.zeros(ydim,dtype=np.bool)
ib[2] = True; i... | Python | 0.00001 | @@ -3529,32 +3529,71 @@
%5B:,:,0%5D%0A
+print vu.shape # This is OK%0A #
assert_array_equ
@@ -3621,32 +3621,41 @@
:,:1%5D)%0A %0A
+ %0A
vu%5B:,:,1
@@ -3659,24 +3659,27 @@
:,1:%5D = data
+%5B:%5D
%0A ass
@@ -3667,32 +3667,131 @@
data%5B:%5D%0A
+print data%5B:%... |
222ae0b817f7b5304b9c199428bf82709c3bb6af | change error msg on version check | dashlib/mnb_explorer.py | dashlib/mnb_explorer.py | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
# use block explorer to check balance, block height to check fork
import requests
from config import *
from mnb_misc import *
import simplejson as json
def make_request(url):
USERAGET = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_... | Python | 0 | @@ -1650,24 +1650,27 @@
ror
-t
o
+n
check
+ing
version
use
@@ -1665,16 +1665,17 @@
version
+,
use -k
|
09275166c9652171e191100c4d5cd0f600077da0 | Fix typo in settings.py. Refs #1010 | seattlegeni/website/settings.py | seattlegeni/website/settings.py | """
These are the django settings for the seattlegeni project. See the README.txt
file for details on what needs to be set in this file. At a minimum for
development, it will be the database connection info and the SECRET_KEY value.
For public deployment, see the README.txt file for information about which
additional ... | Python | 0.000983 | @@ -937,17 +937,16 @@
CLEARING
-_
HOUSE_LO
|
44fbc835354b7612d5d203250255a323c8759b64 | fix log %(levelname)-8s to align | torequests/logs.py | torequests/logs.py | #! coding:utf-8
import logging
dummy_logger = logging.getLogger('torequests.dummy')
main_logger = logging.getLogger('torequests.main')
def init_logger(name='', handler_path_levels=None,
level=logging.INFO, formatter=None,
formatter_str=None, datefmt="%Y-%m-%d %H:%M:%S"):
"""Args:
... | Python | 0.000001 | @@ -545,33 +545,33 @@
'%25(levelname)-
-6
+8
s %25(asctime)s
@@ -681,33 +681,33 @@
= '%25(levelname)-
-6
+8
s %25(asctime)s
@@ -1341,9 +1341,9 @@
me)-
-6
+8
s %25
|
db47a651e380709c33c54c86f9a3861187772406 | Add metrics to MNIST | eva/examples/mnist.py | eva/examples/mnist.py | #%% Setup.
from collections import namedtuple
import numpy as np
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.optimizers import Nadam
from keras.layers.adva... | Python | 0.000019 | @@ -1812,8 +1812,9 @@
cnn.h5')
+%0A
|
034d25f22253d19a8020b7d88a93a1305c57c1da | Fix pretty print response test | eve/tests/response.py | eve/tests/response.py | # -*- coding: utf-8 -*-
from ast import literal_eval
from eve.tests import TestBase
import simplejson as json
import eve
import os
class TestResponse(TestBase):
def setUp(self):
super(TestResponse, self).setUp()
self.r = self.test_client.get('/%s/' % self.empty_resource)
def test_response_d... | Python | 0.00086 | @@ -1418,134 +1418,8 @@
00)%0A
- # python2 and python3 compatible (check for unicode or str)%0A self.assertTrue(isinstance(response, basestring))%0A
%0A%0Acl
|
df12bb251bbb6ab1b7efc1e955eb87faa73c6c15 | Add message for correct orfik answer | events/orfik/views.py | events/orfik/views.py | from django.shortcuts import render, redirect, get_object_or_404
from events.orfik import models
from django.utils import timezone
from django.contrib.auth.decorators import login_required
from django.contrib.auth import get_user_model
from general import models as generalmodels
from django.contrib import messages
de... | Python | 0.000093 | @@ -3493,32 +3493,94 @@
player.save()%0A
+ messages.info(request, 'Corrent answer!')%0A
|
6269cc65f12edea301952907a928d554fb40d632 | update tests | test/tests.py | test/tests.py | #!/usr/bin/python3
# namespace shenanigans
import sys, os
sys.path.insert(1, os.path.join(sys.path[0], '..') + '/lib')
import ostrich
import unittest
class OstrichTests(unittest.TestCase):
def setUp(self):
self.program = ostrich.Ostrich()
def expect(self, code, result):
self.assertEqual(se... | Python | 0.000001 | @@ -3783,111 +3783,264 @@
ter_
-p(self):%0A pass # TODO%0A%0A def test_letter_q(self):%0A pass # TODO%0A%0A def test_letter_v
+B(self):%0A pass # TODO%0A%0A def test_letter_E(self):%0A pass # TODO%0A%0A def test_letter_G(self):%0A pass # TODO%0A%0A def test_letter... |
f6672fd0074052ba71bc1266590f0ef0db8f14d0 | fix import. | blackgate/cli.py | blackgate/cli.py | # -*- coding: utf-8 -*-
import click
from blackgate.core import component
from blackgate.server importrun
@click.group()
def main():
# README CONFIG
component.install_from_config(config)
@main.command()
def start():
run(config.get('port', 9654))
if __name__ == '__main__':
main()
| Python | 0 | @@ -97,16 +97,17 @@
r import
+
run%0A%0A@cl
|
41d7d1e2c87945d8101702d405b8b777f8f3908f | fix accuracy claculator | problems/performance_review/evaluation.py | problems/performance_review/evaluation.py |
def calculate(counts,result):
n1 = 0.0
n2 = 0.0
a = 0.0
c = 0.0
for f1,f2,d in counts:
f1f2 = max(f1+f2-1,0)
nf1f2 = max(-f1+f2,0)
n1 += f1f2
n2 += nf1f2
if d[0]:
a+= max(f1f2 - d[1],0)
c+= max(nf1f2 - d[1],0)
else:
... | Python | 0.000001 | @@ -3139,17 +3139,17 @@
, score_
-A
+B
%0A%0Adef ac
|
1f72dcbc02b122aece83cb33d5440938e0ad8a18 | Update urlize.py | markdown/extensions/urlize.py | markdown/extensions/urlize.py | # From https://github.com/r0wb0t/markdown-urlize/blob/master/urlize.py
"""A more liberal autolinker
Inspired by Django's urlize function.
Positive examples:
>>> import markdown
>>> md = markdown.Markdown(extensions=['urlize'])
>>> md.convert('http://example.com/')
u'<p><a href="http://example.com/">htt... | Python | 0.000001 | @@ -1137,18 +1137,16 @@
IZE_RE =
- =
ur'(%5E%7C(
|
325f680099ec2498c0c98f5ecba5f571b607df4c | remove trends and reduce api calls for new limit | marketWatch/papirus_ticker.py | marketWatch/papirus_ticker.py | #!/usr/bin/env python3
import config
import requests
try:
from papirus import PapirusTextPos
display = True
except ImportError:
display = False
thing1 = {'name': 'ETSY', 'type': 'security', 'price': 0, 'last_daily_price': 0, 'daily_trend': 'U'}
thing2 = {'name': 'BTC', 'type': 'currency', 'price': 0, 'las... | Python | 0 | @@ -2505,32 +2505,99 @@
or i in things:%0A
+ text.AddText(i%5B'name'%5D + %22: %22 + str(i%5B'price'%5D), 10, pos)%0A#
text.Add
@@ -2756,32 +2756,83 @@
or i in things:%0A
+ print(i%5B'name'%5D + %22: %22 + str(i%5B'price'%5D))%0A#
print(i%5B
@@ -3017,32 +3017,33 @@
rice(i%5B'name'%5D)... |
1c9a16a0896cd39aca2b44c0ef5c4eb155d1dab7 | Add a test for 2 framgnets case. | server/kcaa/manipulator_util_test.py | server/kcaa/manipulator_util_test.py | #!/usr/bin/env python
import pytest
import manipulator_util
class TestManipulatorManager(object):
def pytest_funcarg__manager(self, request):
return manipulator_util.ManipulatorManager(None, {}, 0)
def test_in_schedule_fragment(self):
in_schedule_fragment = (
manipulator_util.M... | Python | 0.000001 | @@ -1267,16 +1267,590 @@
(5400)%0A%0A
+ def test_are_auto_manipulator_scheduled_two_fragments(self, manager):%0A manager.set_auto_manipulator_schedules(True, %5B%5B0, 3600%5D,%0A %5B7200, 10800%5D%5D)%0A assert manager.are_auto_manipulator_scheduled... |
147d1afb9bbef3444396dce57be4b03f94666a10 | Add simple calculation of query formulation times | session.py | session.py | from data_record import DataRecord
from has_actions import HasActions
class Session(DataRecord, HasActions):
no_delays_filter = lambda session: session.condition.record_id == str(6)
query_delay_filter = lambda session: session.condition.record_id == str(7)
document_delay_filter = lambda session: session.condit... | Python | 0.000785 | @@ -3422,24 +3422,322 @@
ead_times)%0A%0A
+ def average_query_formulation_time_in_seconds(self):%0A query_start_actions = self.actions_by_type( 'QUERY_FOCUS' )%0A querying_durations = %5Bself.action_duration_in_seconds_for( idx, action ) for idx, action in query_start_actions%5D%0A return sum(querying_durati... |
5e307aff39f448c6e57d7fa4b0195bfccfe7794f | Fix the version detection | blues/mongodb.py | blues/mongodb.py | """
MongoDB Blueprint
=================
**Fabric environment:**
.. code-block:: yaml
blueprints:
- blues.mongodb
settings:
mongodb:
# bind: 0.0.0.0 # Set the bind address specifically (Default: 127.0.0.1)
replSet: webscale
keyfile: 'mongodb-keyfile'
admin:
... | Python | 0.000253 | @@ -1441,16 +1441,22 @@
return
+tuple(
map(int,
@@ -1469,16 +1469,21 @@
it('.'))
+%5B:2%5D)
%0A%0A%0Adef u
|
e791616c161cb7bea222098ac90235b402e62ffa | fix saving with bootloader | boards/PUCKJS.py | boards/PUCKJS.py | #!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at h... | Python | 0.000001 | @@ -1519,17 +1519,17 @@
' : ((12
-8
+2
- 3) *
@@ -1534,16 +1534,49 @@
* 4096),
+ # Bootloader takes pages 122-127
%0A 'pa
|
3bd383a15902d8367097a4348de64c929732767b | Fix Test | tests/NewsParser_Test.py | tests/NewsParser_Test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: balicanta
# @Date: 2014-10-25 09:57:26
# @Last Modified by: bustta
# @Last Modified time: 2014-10-27 23:22:08
from NewsParser import NewsParser
from requests.utils import get_encodings_from_content
test_fixtures = [
{"url": "http://udn.com/NEWS/NATIONAL... | Python | 0.000001 | @@ -119,11 +119,14 @@
b
-ust
+alican
ta%0A#
@@ -165,13 +165,13 @@
23:
-22:08
+44:57
%0A%0Afr
@@ -379,16 +379,39 @@
%22: %22%E5%91%82%E6%80%9D%E9%80%B8%22
+,%22content%22:%22%E6%98%AF%E7%94%B1%E9%99%B3%E8%80%81%E9%97%86%E6%89%B9%E4%BA%86%E6%A3%89%E8%8A%B1%E6%A3%92%22
%7D,%0A %7B
@@ -483,16 +483,29 @@
%22%E... |
97478d2bb38b94a5effbbc74db3ae1a0360f9a19 | remove vm.id usage in exeption message | vmpool/endpoint.py | vmpool/endpoint.py | # coding: utf-8
from core.utils import generator_wait_for
from core.logger import log_pool
from core.config import config
from core.exceptions import PlatformException, NoSuchEndpoint, \
CreationException
from vmpool.virtual_machines_pool import pool
from vmpool.platforms import Platforms
from vmpool.vmqueue impo... | Python | 0 | @@ -1909,10 +1909,12 @@
.vm.
-id
+name
, pl
|
01bb6723b2bc7ab7a7fb6629e304f5ed42f40af4 | Add GSM characters test case for a unicode message. | tests/clockwork_tests.py | tests/clockwork_tests.py | import unittest
import clockwork
import clockwork_exceptions
class ApiTests(unittest.TestCase):
api_key = "YOUR_API_KEY_HERE"
def test_should_send_single_message(self):
"""Sending a single SMS with the minimum detail and no errors should work"""
api = clockwork.API(self.api_key)
sms = clockwork.SMS(to="44123... | Python | 0 | @@ -1,12 +1,37 @@
+# -*- coding: utf-8 -*-%0A%0A
import unitt
@@ -438,32 +438,849 @@
ponse.success)%0A%0A
+%09def test_should_send_single_unicode_message(self):%0A%09%09%22%22%22Sending a single SMS with the full GSM character set (apart from ESC and form feed) should work%22%22%22%0A%09%09api = clockwork.API(self.ap... |
5270f88f4c19b68f31092db8395adeb2e7028065 | Use .succeeded when checking for an already existing settings.php file. | drupal/AdjustConfiguration.py | drupal/AdjustConfiguration.py | from fabric.api import *
from fabric.contrib.files import *
import Revert
# Adjust settings.php. Copy the relevant file based on the branch, delete the rest.
@task
@roles('app_all')
def adjust_settings_php(repo, branch, build, buildtype, alias, site):
# In some cases it seems jenkins loses write permissions to the... | Python | 0 | @@ -721,16 +721,26 @@
, site))
+.succeeded
:%0A
|
4548b24c17caf6149b741c7f8a8f743f4ff431b4 | Remove partitions | 2011/candy_splitting.py | 2011/candy_splitting.py | #!/usr/bin/env python
from __future__ import print_function
from functools import reduce
def split_candies(candies):
assert isinstance(candies, list)
partitions = sorted_k_partitions(candies, 2)
print(partitions)
max_candy = 0
for partition in partitions:
xor0 = reduce(lambda x, y: x ^ y... | Python | 0.000011 | @@ -153,352 +153,54 @@
st)%0A
-%0A
-partitions = sorted_k_partitions(candies, 2)%0A print(partitions)%0A%0A max_candy = 0%0A for partition in partitions:%0A xor0 = reduce(lambda x, y: x %5E y, partition%5B0%5D)%0A sum0 = sum(partition%5B0%5D)%0A xor1 = reduce(lambda x, y: x %5E y, p... |
9ac43293dc133bf4b9b55d39fc6502b65c265843 | Remove hardcoded value | tests/api/test_core.py | tests/api/test_core.py | from unittest.mock import Mock
import graphene
from django.utils import timezone
from tests.api.utils import (
_get_graphql_content_from_response, get_graphql_content)
from saleor.graphql.core.types import ReportingPeriod
from saleor.graphql.core.utils import clean_seo_fields, snake_to_camel_case
from saleor.grap... | Python | 0.023907 | @@ -430,16 +430,58 @@
to_date%0A
+from saleor.product.models import Product%0A
%0A%0Adef te
@@ -4304,14 +4304,36 @@
lCount'%5D ==
-1
+Product.objects.count()
%0A
|
a90ba7efb5b7d2cef7aa86b1c741d5d582ae5574 | Fix SDK log output setting | senlin/drivers/openstack/sdk.py | senlin/drivers/openstack/sdk.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | Python | 0.002074 | @@ -796,24 +796,37 @@
import utils
+ as sdk_utils
%0Afrom oslo_s
@@ -1020,16 +1020,21 @@
name__)%0A
+%0Asdk_
utils.en
@@ -1056,11 +1056,12 @@
bug=
-Tru
+Fals
e, s
|
08125322609e97e868c5c712df9e35e4c556434d | Use enumerate() instead of managing an index variable. | httparchive.py | httparchive.py | #!/usr/bin/env python
# Copyright 2010 Google Inc. 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... | Python | 0.999997 | @@ -1518,38 +1518,43 @@
e):%0A
-i = 0%0A
for
+i, (
k, v
+)
in
+enumerate(
self.hea
@@ -1549,32 +1549,33 @@
ate(self.headers
+)
:%0A if key =
@@ -1633,32 +1633,16 @@
return%0A
- i = i + 1%0A
self
@@ -1708,26 +1708,16 @@
y):%0A
- i = 0%0A
for
k, v
@@ -1708,32 +1708,47 @@
y):... |
d5482b10a712863c36a59d8ce82f3958ec41e78b | Add CORS on /swagger.json | APITaxi/api/__init__.py | APITaxi/api/__init__.py | # -*- coding: utf-8 -*-
from flask.ext.restplus import apidoc, Api
from flask import Blueprint, render_template
api_blueprint = Blueprint('api', __name__)
api = Api(api_blueprint, doc=False, catch_all_404s=True,
title='API version 2.0')
ns_administrative = api.namespace('administrative',
description="... | Python | 0.000001 | @@ -104,16 +104,52 @@
template
+%0Afrom flask_cors import cross_origin
%0A%0Aapi_bl
@@ -657,16 +657,36 @@
specs')%0A
+ @cross_origin()%0A
def
|
d16b57f3edca478622b84f56dfee7b2eea1f7498 | Add basic reporting | botbot/report.py | botbot/report.py | """Generate a report about file errors"""
import os
import sys
import math
from pkg_resources import resource_exists, resource_filename
from jinja2 import Environment, FileSystemLoader
from . import problems
_DEFAULT_RES_PATH = os.path.join('resources', 'templates')
_GENERIC_REPORT_NAME = 'generic.txt'
_ENV_REPORT_... | Python | 0 | @@ -2061,24 +2061,26 @@
s'):%0A
+ #
print(self.
@@ -2092,16 +2092,301 @@
checked)
+%0A for user, probs in self.chkr.checked.items():%0A if probs:%0A print(user.pw_gecos)%0A for prob, files in probs.items():%0A print('%5Ct' + prob)%0A ... |
6e525872537cd31a80cb791d6594a1f6800c61b4 | add invers option, add args-parsing | i2c/PCF8574.py | i2c/PCF8574.py | #!/usr/bin/python
import sys
import smbus
import time
# Reads data from PCF8574 and prints the state of each port
def readPCF8574(busnumber,address):
address = int(address,16)
busnumber = int(1)
bus = smbus.SMBus(busnumber)
state = bus.read_byte(address);
for i in range(0,8):
port = "port... | Python | 0.000002 | @@ -46,16 +46,32 @@
ort time
+%0Aimport argparse
%0A%0A# Read
@@ -124,17 +124,16 @@
ch port%0A
-%0A
def read
@@ -210,17 +210,25 @@
r = int(
-1
+busnumber
)%0A bu
@@ -290,17 +290,16 @@
dress);%0A
-%0A
for
@@ -431,152 +431,813 @@
%0A%0A
-%0A%0Aif len(sys.argv) != 3:%0A print %22Usage: python PCF8574... |
9cc436d1abec0d4c31fd52b0f2ff1f30ab889fb1 | Change Record blocks from list to tuple | ehrcorral/herd.py | ehrcorral/herd.py | # -*- coding: utf-8 -*-
"""Contains core classes and functions for defining populations and acting upon
them.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
import sys
from collections import namedtuple
import je... | Python | 0.000001 | @@ -3704,20 +3704,21 @@
locks =
-list
+tuple
(set(blo
@@ -5037,23 +5037,22 @@
def
-explode
+corral
(self, b
@@ -5074,16 +5074,200 @@
hone'):%0A
+ if blocking not in PHONEMES:%0A raise ValueError(%22Blocking must be be one of %7B%7D.%22.format(PHONEMES))%0A self._explode(blocking)%0A%... |
7cca2fab9fe697fe0e31be0ea6dcd43e29028bfb | better example output | example/shapes.py | example/shapes.py | from rdc.etl.status.console import ConsoleStatus
from rdc.etl.transform.util import Log
from rdc.etl.transform.extract import Extract
from rdc.etl.harness.threaded2 import ThreadedHarness as ThreadedHarness2
from rdc.etl.harness.threaded import ThreadedHarness
def build_producer(name):
return Extract(({'producer':... | Python | 0.999999 | @@ -1,52 +1,17 @@
-from rdc.etl.status.console import ConsoleStatus
+import pprint
%0Afro
@@ -326,16 +326,57 @@
: 2%7D))%0A%0A
+print '%3E%3E%3E Test of simple linear shape'%0A%0A
for Harn
@@ -430,156 +430,45 @@
rint
-%0A print %22-------------------------------%22%0A print %22With %25r%22 %25 Harness%0A p... |
229a0db6574f75acf94cad6612dd39351fa6656a | Use absolute import. (Should this go into 2.5?) | Lib/test/test_cpickle.py | Lib/test/test_cpickle.py | import cPickle
import unittest
from cStringIO import StringIO
from pickletester import AbstractPickleTests, AbstractPickleModuleTests
from test import test_support
class cPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
def setUp(self):
self.dumps = cPickle.dumps
self.loads = cPickle.l... | Python | 0 | @@ -60,16 +60,21 @@
IO%0Afrom
+test.
picklete
|
c888e52788ec37641f97f761d2052902db20582a | Add missing dates | erpnext/accounts/dashboard.py | erpnext/accounts/dashboard.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from itertools import groupby
from operator import itemgetter
import frappe
from frappe.utils import add_to_date
from erpnext.accounts.report.general_le... | Python | 0.000043 | @@ -273,17 +273,46 @@
_to_date
+, date_diff, getdate, nowdate
%0A
-
from erp
@@ -1148,24 +1148,86 @@
d_results%5D%0A%0A
+ results = add_missing_dates(results, from_date, to_date)%0A%0A
return %7B
@@ -1766,16 +1766,16 @@
s=days,%0A
-
@@ -1808,8 +1808,540 @@
e=True)%0A
+%0Adef add_missing_dates(in... |
dca8dce24e0bea671b52d456909c35e43c4f5929 | move exchange endpoint into consumer urlspace | example/urls.py | example/urls.py | from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from django.contrib import admin
from .views import ConsumerView, ConsumerExchangeView
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$', TemplateView.as_view(template_name='example/home.html'), name='ho... | Python | 0.000002 | @@ -156,16 +156,19 @@
merView,
+
Consume
@@ -333,16 +333,25 @@
url(r'%5E
+consumer/
exchange
|
dcc472a6c8e15e7fc105277332681b38e40640df | Revert open_file_dialog example | examples/open_file_dialog.py | examples/open_file_dialog.py | import webview
import threading
"""
This example demonstrates creating an open file dialog.
"""
def open_file_dialog():
import time
time.sleep(5)
print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=False))
if __name__ == '__main__':
t = threading.Thread(target=open_file_dialog)
... | Python | 0 | @@ -226,12 +226,11 @@
ple=
-Fals
+Tru
e))%0A
@@ -403,8 +403,9 @@
.com%22)%0A%0A
+%0A
|
ef0e9f59ee1df18a5c37a559e78d0350d9e0a624 | Use `import_by_path`/`import_string` instead of manually `__import__`ing things | enumfields/fields.py | enumfields/fields.py | from django.core.exceptions import ValidationError
from django.db import models
from enum import Enum
import six
from django.db.models.fields import NOT_PROVIDED
class EnumFieldMixin(six.with_metaclass(models.SubfieldBase)):
def __init__(self, enum, **options):
if isinstance(enum, six.string_types):
... | Python | 0.000003 | @@ -156,16 +156,176 @@
OVIDED%0A%0A
+try:%0A from django.utils.module_loading import import_string%0Aexcept ImportError:%0A from django.utils.module_loading import import_by_path as import_string%0A%0A
%0Aclass E
@@ -484,184 +484,38 @@
-module_name, class_name = enum.rsplit('.', 1)%0A module
+s... |
965236870ce5bf6dcbe9398b444b977c796b096e | set the right keyword to the close function | simphony_paraview/tests/test_show.py | simphony_paraview/tests/test_show.py | import unittest
from hypothesis import given
from paraview import servermanager
from paraview.simple import Disconnect
from simphony_paraview.show import show
from simphony_paraview.core.testing import cuds_containers
class TestShow(unittest.TestCase):
def setUp(self):
if servermanager.ActiveConnection... | Python | 0.000021 | @@ -775,16 +775,24 @@
w(cuds,
+testing=
close)%0A%0A
|
c0358584f2b5a05947ebb558c6d10293cc969a1a | Fix tests | tests/test_dependenpy.py | tests/test_dependenpy.py | # -*- coding: utf-8 -*-
"""Main test script."""
from dependenpy.cli import main
def test_main():
"""Main test method."""
main('dependenpy')
| Python | 0.000003 | @@ -131,16 +131,24 @@
main(
+%5B'-lm',
'depende
@@ -151,10 +151,11 @@
endenpy'
+%5D
)%0A
|
437e01df9f8582256aaa5ab1a5cd4c0fc1aef373 | Use self.course_id rather than hard code when removing lab assistants from enrollment tests | tests/test_enrollment.py | tests/test_enrollment.py | from tests import OkTestCase
from server.models import db, Enrollment, User
from server.forms import EnrollmentForm, BatchEnrollmentForm
from server.constants import STUDENT_ROLE, LAB_ASSISTANT_ROLE
class TestEnrollment(OkTestCase):
def setUp(self):
super().setUp()
self.studentA = {
... | Python | 0 | @@ -4841,17 +4841,30 @@
se_id =
-1
+self.course_id
)%0A
|
f6debd39f929616ca72763682c25a52bc01b536b | Update test_filterbank.py | tests/test_filterbank.py | tests/test_filterbank.py | from blimpy import Filterbank, read_header, fix_header
import pylab as plt
import numpy as np
import os
from pprint import pprint
def test_voyager():
filename = '/workdata/bl/data/voyager_f1032192_t300_v2.fil'
fb = Filterbank(filename)
fb.info()
fb.plot_spectrum()
plt.show()
fb = Filterbank(f... | Python | 0.000001 | @@ -2478,16 +2478,17 @@
r()%0A
+#
test_fil
@@ -2501,8 +2501,18 @@
k_gen()%0A
+ %0A %0A
|
dbf520bb4050c5e393a4de3be9c136fef1cd88f2 | break test | tests/test_functional.py | tests/test_functional.py | # -*- coding: utf-8 -*-
"""Functional tests using WebTest.
See: http://webtest.readthedocs.org/
"""
import pytest
from flask import url_for
from foobar.user.models import User
from .factories import UserFactory
class TestLoggingIn:
def test_can_log_in_returns_200(self, user, testapp):
# Goes to homepa... | Python | 0.000005 | @@ -596,17 +596,17 @@
code ==
-2
+3
00%0A%0A
|
a6435a8713985464b8c37a438ac035d65f66b4cd | Add more user mapfiles and validate | tests/test_large_file.py | tests/test_large_file.py | import logging
import cProfile
from mappyfile.parser import Parser
from mappyfile.pprint import PrettyPrinter
from mappyfile.transformer import MapfileToDict
def output(fn):
"""
Parse, transform, and pretty print
the result
"""
p = Parser()
m = MapfileToDict()
ast = p.parse_file(fn)
... | Python | 0 | @@ -19,17 +19,67 @@
ort
-cProfile%0A
+os%0Aimport cProfile%0Aimport glob%0Aimport json%0Aimport mappyfile
%0Afro
@@ -202,16 +202,58 @@
eToDict%0A
+from mappyfile.validator import Validator%0A
%0A%0Adef ou
@@ -347,16 +347,37 @@
Parser(
+expand_includes=False
)%0A m
@@ -393,16 +393,36 @@
ToDict()
+%0A v =... |
2a816cbb29488861fe8897a6af9359db254018c1 | Fix up test_paraboloid accuracy | tests/test_paraboloid.py | tests/test_paraboloid.py | import jtrace
def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)
def test_properties():
import random
for i in range(100):
A = random.gauss(0.7, 0.8)
B = random.gauss(0.8, 1.2)
para = jtrace.Paraboloid(A, B)
asser... | Python | 0.999279 | @@ -781,21 +781,23 @@
gauss(0.
-2
+05
, 0.
+0
1)%0A
@@ -1632,18 +1632,16 @@
, y, -10
-00
), v, 0)
@@ -1912,11 +1912,99 @@
_tol=1e-
-3
+6)%0A%0A%0Aif __name__ == '__main__':%0A test_properties()%0A test_call()%0A test_intersect(
)%0A
|
5e642c912ff7be5424e78e3dfe356c9579a39320 | fix typo in get_networks function | web_frontend/cloudscheduler/csv2/utils.py | web_frontend/cloudscheduler/csv2/utils.py | from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from sqlalchemy.ext.automap import automap_base
import config
'''
dev code
= db_session.query(Cloud).filter(Cloud.cloud_type=="openstack")
db_session.merge(new_flav)
db_session.commit()
'''
def get_quotas(filter=None):
engine = create_engi... | Python | 0.000948 | @@ -1981,29 +1981,31 @@
asses.cloud_
-quota
+network
s%0A networ
|
ddf311b4dc7c08f3f08516c702531053f8919720 | Tidy imports | tests/test_validation.py | tests/test_validation.py | import json
from django.conf import settings
from django.test import TestCase, override_settings
from django_slack.exceptions import ChannelNotFound, MsgTooLong
from django_slack.backends import Backend
class TestOverride(TestCase):
def test_ok_result(self):
backend = Backend()
backend.validate('... | Python | 0 | @@ -9,40 +9,8 @@
son%0A
-from django.conf import settings
%0Afro
@@ -42,27 +42,8 @@
Case
-, override_settings
%0A%0Afr
|
1ee39cd3174b487038b62a3a6a66bac46571775a | Test that symlinks are properly created in bin_dir | tests/test_virtualenv.py | tests/test_virtualenv.py | import virtualenv
import optparse
from mock import patch, Mock
def test_version():
"""Should have a version string"""
assert virtualenv.virtualenv_version, "Should have version"
@patch('os.path.exists')
def test_resolve_interpreter_with_absolute_path(mock_exists):
"""Should return absolute path if given... | Python | 0.000001 | @@ -27,16 +27,67 @@
ptparse%0A
+import os%0Aimport shutil%0Aimport sys%0Aimport tempfile%0A
from moc
@@ -3249,8 +3249,952 @@
es': 0%7D%0A
+%0Adef test_install_python_symlinks():%0A %22%22%22Should create the right symlinks in bin_dir%22%22%22%0A tmp_virtualenv = tempfile.mkdtemp()%0A try:%0A home_dir... |
0b1f6d7c5ff91bb6b1d0902c5cc5fcc1ab927c4e | Test that none on cli merged into the watchmaker config | tests/test_watchmaker.py | tests/test_watchmaker.py | # -*- coding: utf-8 -*-
"""Watchmaker main test module."""
from __future__ import (absolute_import, division, print_function,
unicode_literals, with_statement)
import os
import pytest
import yaml
import watchmaker
from watchmaker import static
@pytest.fixture
def watchmaker_arguments():
... | Python | 0 | @@ -1887,16 +1887,204 @@
s None%0A%0A
+ watchmaker_client = watchmaker.Client(watchmaker_arguments)%0A%0A assert 'salt_states' in watchmaker_client.worker_args%0A assert watchmaker_client.worker_args%5B'salt_states'%5D is None%0A%0A
%0Adef tes
|
50b6c9a9e55a22dc1893fcaf6f8800015992d41d | Make import more specific | iatidq/util.py | iatidq/util.py |
# IATI Data Quality, tools for Data QA on IATI-formatted publications
# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith
#
# Copyright (C) 2013 Publish What You Fund
#
# This programme is free software; you may redistribute and/or modify
# it under the terms of the GNU Affero General Public License v3... | Python | 0 | @@ -317,16 +317,32 @@
e v3.0%0A%0A
+from contextlib
import c
@@ -347,19 +347,23 @@
context
-lib
+manager
%0Aimport
@@ -541,19 +541,8 @@
%7D%0A%0A@
-contextlib.
cont
|
a8389e913b417dc37e23f9cfc1f52ab63802c8a4 | movie title encode to support multiple language | demo/indexMlTmdb.py | demo/indexMlTmdb.py | import json
def enrich(movie):
""" Enrich for search purposes """
if 'title' in movie:
movie['title_sent'] = 'SENTINEL_BEGIN ' + movie['title']
def reindex(es, analysisSettings={}, mappingSettings={}, movieDict={}, index='tmdb'):
import elasticsearch.helpers
settings = {
"settings": {
... | Python | 0.999999 | @@ -1085,16 +1085,32 @@
'title'%5D
+.encode('utf-8')
, index)
|
351cbae9cd3695002e613162981c13a06a19d803 | Handle contents files in iso-8859-1 encoding | dep11/iconfinder.py | dep11/iconfinder.py | #!/usr/bin/env python
#
# Copyright (c) 2014-2015 Matthias Klumpp <mak@debian.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3.0 of the License, or (at your optio... | Python | 0 | @@ -1291,16 +1291,144 @@
pass%0A%0A%0A
+def _decode_contents_line(line):%0A try:%0A return str(line, 'utf-8')%0A except:%0A return str(line, 'iso-8859-1')%0A%0A
class Co
@@ -2608,33 +2608,42 @@
line =
-str(line, 'utf-8'
+_decode_contents_line(line
)%0A
|
e4c92b7d8cdd808b2415c2edf11576a87264f7f3 | Remove context_stack_on_request_context() | frasco/ctx.py | frasco/ctx.py | from flask import has_request_context, _request_ctx_stack
from frasco.utils import unknown_value
from werkzeug.local import LocalProxy, LocalStack
from contextlib import contextmanager
import functools
class ContextStack(LocalStack):
def __init__(self, top=None, default_item=None, allow_nested=True, ignore_nested... | Python | 0.000001 | @@ -1851,326 +1851,8 @@
)%0A%0A%0A
-def context_stack_on_request_context(name, cls=ContextStack):%0A def _get_object():%0A if has_request_context() and not hasattr(_request_ctx_stack.top, name):%0A setattr(_request_ctx_stack.top, name, cls())%0A return getattr(_request_ctx_stack.top, name, ... |
1c116355e91ebed668620f8f84d9d4331de4adab | include first 3 sentences only | cogs/wiki.py | cogs/wiki.py | import discord
from discord.ext import commands
from bs4 import BeautifulSoup
from urllib.parse import quote_plus
from dateutil.parser import isoparse
from utils import aiohttp_wrap as aw
class Wiki(commands.Cog):
SUMMARY_URI = "https://en.wikipedia.org/api/rest_v1/page/summary/{}?redirect=true"
SEARCH_URI ... | Python | 0.000072 | @@ -1871,16 +1871,25 @@
ption =
+' '.join(
article_
@@ -1906,16 +1906,33 @@
xtract%22%5D
+.split('. ')%5B:3%5D)
%0A
|
4f8429e9cd17f207ef429bdf21508cfac4200c4c | improve display | examples/admin.py | examples/admin.py | # -*- coding: utf-8 -*-
#
# django-granadilla
# Copyright (C) 2009 Bolloré telecom
# See AUTHORS file for a full list of contributors.
#
# 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 ... | Python | 0.000001 | @@ -1104,16 +1104,52 @@
ername',
+ 'first_name', 'last_name', 'email',
'uid'%5D%0A
|
f978372d8345bd0ab1c9dc1a9739d0d5852a1780 | add FIXMEs / TODOs | exportiphoto.py | exportiphoto.py | #!/usr/bin/env python
__version__ = "0.5"
import datetime
import os
import re
import shutil
import stat
import sys
from optparse import OptionParser
from xml.dom.minidom import parse, Node
def main(albumDataXml, targetDir, copyImg=True, useEvents=True):
print "Parsing..."
try:
albumDataDom = parse... | Python | 0 | @@ -187,16 +187,78 @@
, Node%0A%0A
+# FIXME: use SAX so we don't have to load XML all into memory%0A
%0Adef mai
@@ -1818,17 +1818,18 @@
#
-w
+ W
alk thro
@@ -3120,17 +3120,17 @@
#
-s
+S
kip unch
@@ -3522,32 +3522,32 @@
if copyImg:%0A
-
@@ -3556,16 +3556,81 @@
int msg%0A
+ ... |
cbc8632a74f32415b2819b678340b6e4f0944dba | Use build_context factory | tests/unit/tools/list.py | tests/unit/tools/list.py | # encoding: UTF-8
import unittest
from tml.tools.list import List
from tml.tools.template import Template
from tests.mock import Client
from tml import Context
class list(unittest.TestCase):
def setUp(self):
self.context = Context(client = Client.read_all(), locale = 'ru')
def test_render(self):
... | Python | 0.000001 | @@ -145,17 +145,23 @@
import
-C
+build_c
ontext%0A%0A
@@ -167,18 +167,22 @@
%0A%0Aclass
-li
+ListTe
st(unitt
@@ -241,17 +241,23 @@
ntext =
-C
+build_c
ontext(c
|
c6c79df5dc0cae569e24e86e92a44421d855c815 | Remove some unused functions | entropy/engine.py | entropy/engine.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 Yahoo! Inc. 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.apach... | Python | 0.000024 | @@ -2106,97 +2106,8 @@
()%0A%0A
- def register_audit(self):%0A pass%0A%0A def register_repair(self):%0A pass%0A%0A
@@ -2193,17 +2193,16 @@
n later%0A
-%0A
def
|
d75fc1e49076aeb17a4d956fd02e091f195aabf3 | Remove extra bracket for indexing causing error | example/initialize.py | example/initialize.py | #!/usr/bin/env python
"""An example script to initialize audio lists and speaker configurations.
Usage: initialize.py SOURCE TARGET SAMPLING_RATE
Options:
-h, --help Show the help
"""
from __future__ import division # , unicode_literals
from __future__ import absolute_import, print_function
import os
import... | Python | 0 | @@ -4698,21 +4698,16 @@
ES%5Bpart%5D
-%5Buse%5D
,%0A
|
dbce79102efa8fee233af95939f1ff0b9d060b00 | Update example workflow to show you can use classes | examples/basic.py | examples/basic.py | import time
from simpleflow import (
activity,
Workflow,
futures,
)
@activity.with_attributes(task_list='quickstart', version='example')
def increment(x):
return x + 1
@activity.with_attributes(task_list='quickstart', version='example')
def double(x):
return x * 2
@activity.with_attributes(ta... | Python | 0 | @@ -284,16 +284,153 @@
x * 2%0A%0A
+# A simpleflow activity can be any callable, so a function works, but a class%0A# will also work given the processing happens in __init__()
%0A@activi
@@ -495,25 +495,63 @@
e')%0A
-def delay(
+class Delay(object):%0A def __init__(self,
t, x):%0A
+
@@ -564,16 +564,2... |
9308152c67bc2ad2150a76e7897c8fd2568bf590 | Bump version: 0.0.4 -> 0.0.5 | conanfile.py | conanfile.py | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.4"
class IWYUCTargetCmakeConan(ConanFile):
name = "iwyu-target-cmake"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cmake... | Python | 0 | @@ -93,9 +93,9 @@
0.0.
-4
+5
%22%0A%0A%0A
|
948d85e7d30fb7f8e4dff4b01f759b971420e9aa | Set OpenSSL:shared=False | conanfile.py | conanfile.py | from conans import ConanFile, CMake
import os
import shutil
class ImageFlowConan(ConanFile):
name = "imageflow"
version = "0.1.0"
license = "AGPLv3"
settings = "os", "compiler", "build_type", "arch"
requires = "littlecms/2.7@lasote/stable", "libpng/1.6.21@lasote/stable", "libjpeg-turbo/1.4.2@imazen... | Python | 0.999997 | @@ -583,19 +583,20 @@
:shared=
-Tru
+Fals
e%22, %5C%0A
|
09ab8f6290e3c5bf33e01857d11b124444a4c990 | add sendaddr support to isotp | examples/isotp.py | examples/isotp.py | DEBUG = False
def msg(x):
if DEBUG:
print "S:",x.encode("hex")
if len(x) <= 7:
ret = chr(len(x)) + x
else:
assert False
return ret.ljust(8, "\x00")
def isotp_send(panda, x, addr, bus=0):
if len(x) <= 7:
panda.can_send(addr, msg(x), bus)
else:
ss = chr(0x10 + (len(x)>>8)) + chr(len(x)&0... | Python | 0 | @@ -1004,24 +1004,39 @@
addr, bus=0
+, sendaddr=None
):%0A msg = r
@@ -1064,16 +1064,67 @@
us)%5B0%5D%0A%0A
+ if sendaddr is None:%0A sendaddr = addr-8%0A %0A%0A
if ord
@@ -1302,22 +1302,24 @@
an_send(
+send
addr
--8
, CONTIN
|
ba1186c47e5f3466faeea9f2d5bf96948d5f7183 | Add --strict flag to raise exception on undefined variables | confuzzle.py | confuzzle.py | import sys
import argparse
import yaml
from jinja2 import Template
def render(template_string, context_dict):
template = Template(template_string)
return template.render(**context_dict)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('template', nargs='?', type=argparse.FileType(... | Python | 0 | @@ -36,35 +36,21 @@
aml%0A
-from jinja2 import Template
+import jinja2
%0A%0A%0Ad
@@ -88,16 +88,30 @@
ext_dict
+, strict=False
):%0A t
@@ -120,16 +120,23 @@
plate =
+jinja2.
Template
@@ -153,16 +153,95 @@
string)%0A
+ if strict:%0A template.environment.undefined = jinja2.StrictUndefined%0A
ret... |
e7eab3521d80e83a5a360c6b196cd0b1f914ca08 | add URL encoding to meme params | examples/leona.py | examples/leona.py | import sys
import json
import random
import requests
from fbchat.models import ThreadType, MessageReaction
from googletrans import Translator
from bot import Bot
import strings
# THREAD_ID is only used for readding admins. Leona will work in any chat she's
# added to.
THREAD_ID = "1261018777320723"
class LeonaBot(... | Python | 0 | @@ -29,16 +29,30 @@
t random
+%0Aimport urllib
%0A%0Aimport
@@ -3219,16 +3219,72 @@
, '~h')%0A
+ s = s.replace('/', '~s').replace('%22', %22''%22)%0A
@@ -3710,16 +3710,71 @@
ext%5B0%5D)%0A
+ top_text = urllib.quote(top_text, safe=%22%22)%0A
@@ -3850,16 +3850,81 @@
ext%5B1%... |
bfd1e90365446fe1a7c1e5ae710dbf497cc405fb | Fix test with newline problems in Windows | utest/writer/test_filewriters.py | utest/writer/test_filewriters.py | from __future__ import with_statement
import unittest
from StringIO import StringIO
from robot.parsing import TestCaseFile
from robot.parsing.model import TestCaseTable
from robot.utils.asserts import assert_equals
from robot.utils import ET, ETSource
def create_test_case_file():
data = TestCaseFile(source='foo.... | Python | 0.000001 | @@ -1973,21 +1973,16 @@
als(
-repr(
expected
), r
@@ -1981,22 +1981,41 @@
cted
-), repr(actual
+.splitlines(), actual.splitlines(
))%0A%0A
|
237b1f889b060019f61c79ee1dd49a0c6993fa46 | fix rest fixture | tests/rest_fixtures.py | tests/rest_fixtures.py | import json
import aiohttp
import pytest
from aiohttp import web
from yarl import URL
from aiohttp_admin.utils import jsonify
class RestClientError(Exception):
"""Base exception class for RESTClient"""
@property
def status_code(self):
return self.args[0]
class PlainRestError(RestClientError):... | Python | 0 | @@ -2654,16 +2654,17 @@
a=data,
+*
*kw)%0A
|
b336e83a63722b3a3e4d3f1779686149d5cef8d1 | Add compatibility for Python 2 | setuptools/tests/test_setopt.py | setuptools/tests/test_setopt.py | # coding: utf-8
from __future__ import unicode_literals
import io
import six
from setuptools.command import setopt
from setuptools.extern.six.moves import configparser
class TestEdit:
@staticmethod
def parse_config(filename):
parser = configparser.ConfigParser()
with io.open(filename, enco... | Python | 0.00002 | @@ -810,22 +810,27 @@
te_text(
+str(
config
+)
, '%5Bname
@@ -993,26 +993,30 @@
rser
-%5B
+.get(
'names'
-%5D%5B
+,
'jaraco'
%5D ==
@@ -1011,17 +1011,17 @@
'jaraco'
-%5D
+)
== '%D0%B9%D0%B0%D1%80
@@ -1050,26 +1050,30 @@
rser
-%5B
+.get(
'names'
-%5D%5B
+,
'other'
-%5D
+)
==
|
982641bd913466d8ff45352b85bac8e9e1112ea1 | Remove workaround not needed since before intake 0.5.2. | databroker/in_memory.py | databroker/in_memory.py | import copy
import event_model
import intake
import intake.catalog
import intake.catalog.local
import intake.source.base
from mongoquery import Query
from .core import parse_handler_registry, discover_handlers, Entry
from .v2 import Broker
class SafeLocalCatalogEntry(intake.catalog.local.LocalCatalogEntry):
# F... | Python | 0 | @@ -241,275 +241,8 @@
r%0A%0A%0A
-class SafeLocalCatalogEntry(intake.catalog.local.LocalCatalogEntry):%0A # For compat with intake 0.5.1.%0A # Not necessary after https://github.com/intake/intake/pull/362%0A # is released.%0A def describe(self):%0A return copy.deepcopy(super().describe())%0A%0A%0A
... |
70ccca895892fc81eb07c4d0b4b7cefe17554b77 | Fix typo | src/checker/plugin/links_finder_plugin.py | src/checker/plugin/links_finder_plugin.py | from bs4 import BeautifulSoup
from yapsy.IPlugin import IPlugin
from requests.exceptions import InvalidSchema
from requests.exceptions import ConnectionError
from requests.exceptions import MissingSchema
import requests
import urlparse
import urllib
import marisa_trie
class LinksFinder(IPlugin):
def __init__(self... | Python | 0.999999 | @@ -2904,17 +2904,17 @@
('utf-8'
-(
+)
))%0A
|
71f67f02dd26e29002ced50298b245c6114ece3b | Update mathfunctions.py | Python/Math/mathfunctions.py | Python/Math/mathfunctions.py | # File with the functions which will be used in math script
# Number to the power of
def po (number, pof):
b = number
for _ in range(pof - 1):
b = int(b) * int(number)
return b
# Factors of a number
def factors (number):
current, ao, nums = 0, 0, []
while current < number:
ao = ao... | Python | 0.000003 | @@ -656,24 +656,715 @@
Found%22%0A
+%0A%0A# Linear Patern Solver %0Adef lseq (ls1, ls2, ls3, ls4):%0A if int(ls2) - int(ls1) == int(ls4) - int(ls3):%0A lsd1 = int(ls2) - int(ls1) # common difference%0A lsc = int(lsd1) - int(ls1) # constant e.g. Tn = xn + c%0A lsc = int(lsc) * -1%0A ... |
4befff8ccefad76d0d846e73b499e7229df9482d | Configure django-dbbackup | fat/settings.py | fat/settings.py | """
Django settings for fat project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
URL_S... | Python | 0.000003 | @@ -1361,24 +1361,40 @@
p.default',%0A
+ 'dbbackup',%0A
'fat',%0A%5D
@@ -5110,8 +5110,177 @@
n Tool%22%0A
+%0A# Backup%0ADBBACKUP_STORAGE = 'django.core.files.storage.FileSystemStorage'%0ADBBACKUP_STORAGE_OPTIONS = %7B%0A 'location': os.path.join(BASE_DIR, 'backups'),%0A %7D%0A
|
634199544667f0a78711e540de493d1dbffae795 | update index views | develop/settings.py | develop/settings.py | """
Django settings for develop project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os... | Python | 0 | @@ -809,12 +809,11 @@
G =
-Fals
+Tru
e%0A%0AA
|
1d3eb0bafd46f3e9cfb7d6395ad1a100052ff821 | Clean up parameter types (#52527) | lib/ansible/plugins/doc_fragments/online.py | lib/ansible/plugins/doc_fragments/online.py | # -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard documentation fragment
DOCUMENTATION = '''
options:
api_token:
description:
- Online OAuth token.
aliases: ['oauth_token']
api_url... | Python | 0 | @@ -17,16 +17,17 @@
f-8 -*-%0A
+%0A
# GNU Ge
@@ -205,16 +205,17 @@
ATION =
+r
'''%0Aopti
@@ -277,16 +277,30 @@
token.%0A
+ type: str%0A
alia
@@ -305,17 +305,17 @@
iases: %5B
-'
+
oauth_to
@@ -317,17 +317,17 @@
th_token
-'
+
%5D%0A api_
@@ -371,16 +371,30 @@
API URL%0A
+ type: str%0A
defa
... |
eb3f93ac64953eacecdd48e2cb8d5ca80554a95b | Update search-for-a-range.py | Python/search-for-a-range.py | Python/search-for-a-range.py | # Time: O(logn)
# Space: O(1)
#
# Given a sorted array of integers, find the starting and ending position of a given target value.
#
# Your algorithm's runtime complexity must be in the order of O(log n).
#
# If the target is not found in the array, return [-1, -1].
#
# For example,
# Given [5, 7, 7, 8, 8, 10] and ... | Python | 0 | @@ -625,17 +625,17 @@
x, y: x
-%3C
+%3E
= y, num
@@ -832,17 +832,17 @@
x, y: x
-%3C
+%3E
y, nums
@@ -1066,32 +1066,24 @@
if compare(
-target,
nums%5Bmid%5D):%0A
@@ -1071,32 +1071,40 @@
ompare(nums%5Bmid%5D
+, target
):%0A
@@ -1371,32 +1371,24 @@
if compare(
-target,
nums%5Bmid%5D):%0A
@@ -... |
8831fb698e6ce4c263b1b3f02eba09744b46d64b | Remove unused variable (via yapf) | basis_set_exchange/curate/readers/cfour.py | basis_set_exchange/curate/readers/cfour.py | from ... import lut
from ..skel import create_skel
def read_cfour(basis_lines, fname):
'''Reads gbasis-formatted file data and converts it to a dictionary with the
usual BSE fields
Note that the gbasis format does not store all the fields we
have, so some fields are left blank
'''
s... | Python | 0 | @@ -2306,45 +2306,8 @@
E')%0A
- lsplt = line.split()%0A
@@ -2659,49 +2659,8 @@
E')%0A
- lsplt = line.split()%0A
|
946b3867f464d96e85056b60d94593346a39cc51 | add map to tweet list | index.py | index.py | import os
import time
import TwitterAPI
import src.art.fluid
import src.art.gas
# Configuration
twitterAPI = TwitterAPI.TwitterAPI(
consumer_key=os.environ["CONSUMER_KEY"],
consumer_secret=os.environ["CONSUMER_SECRET"],
access_token_key=os.environ["ACCESS_TOKEN_KEY"],
access_token_secret=os.environ["AC... | Python | 0.000002 | @@ -72,16 +72,35 @@
.art.gas
+%0Aimport src.art.map
%0A%0A# Conf
@@ -401,16 +401,29 @@
.art.gas
+, src.art.map
%5D%0AtotalT
|
8db77ca35504dcfcb42dbc072e3dc0e7690f9b41 | concat the strings properly for the combined first body chunk | feather/http.py | feather/http.py | import BaseHTTPServer
import httplib
import itertools
import socket
import traceback
import urlparse
from feather import connections, requests
__all__ = ["InputFile", "HTTPError", "HTTPRequest", "HTTPRequestHandler",
"HTTPConnection"]
responses = BaseHTTPServer.BaseHTTPRequestHandler.responses
class HTTPRe... | Python | 0.998431 | @@ -2509,17 +2509,18 @@
in((head
-,
+ +
first_c
@@ -2523,16 +2523,17 @@
st_chunk
+,
), body)
|
34adb8bb30860eb7748188a7d1a9345a09c4519f | Implement punctuation filtering | index.py | index.py | from nltk.tokenize import word_tokenize, sent_tokenize
import getopt
import sys
import os
import io
def build_dict(docs):
dictionary = set()
for doc_id, doc in docs.items():
dictionary.update(doc)
dictionary = list(dictionary)
dictionary.sort()
return dictionary
def build_postings(dictionary):
postings = {}... | Python | 0.999999 | @@ -92,16 +92,30 @@
mport io
+%0Aimport string
%0A%0Adef bu
@@ -775,16 +775,56 @@
(docs):%0A
+%09punctuations = set(string.punctuation)%0A
%09process
@@ -928,16 +928,73 @@
ower()))
+%0A%09%09processed_docs%5Bdoc_id%5D.difference_update(punctuations)
%0A%0A%09retur
|
e320c8558646233b78760e1c84c5334a3a743d6d | Fix test_ensemble on Python 3.5 | tests/test_ensemble.py | tests/test_ensemble.py | import pytest
from rasa_core.policies import Policy
from rasa_core.policies.ensemble import PolicyEnsemble
class WorkingPolicy(Policy):
@classmethod
def load(cls, path):
return WorkingPolicy()
def persist(self, path):
pass
def train(self, training_trackers, domain, **kwargs):
... | Python | 0.998424 | @@ -515,17 +515,16 @@
mpdir):%0A
-%0A
orig
@@ -658,31 +658,36 @@
ble.persist(
+str(
tmpdir)
+)
%0A%0A loaded
@@ -725,23 +725,28 @@
le.load(
+str(
tmpdir)
+)
%0A ass
@@ -1309,39 +1309,44 @@
nsemble.persist(
+str(
tmpdir)
+)
%0A%0A with pytes
@@ -1394,23 +1394,28 @@
le.load(
+str(
tmpdir)
+)
%0... |
ed410e81af61699a16c34c1edbbaa18a80bcdcfe | use global DocSimServer instance in views | docsim/documents/views.py | docsim/documents/views.py | from ujson import dumps
from django.http import HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from rest_framework.generics import ListAPIView, RetrieveAPIView
from .docsimserver import DocSimServer
from .models import Cl... | Python | 0 | @@ -388,16 +388,37 @@
D = 202%0A
+DSS = DocSimServer()%0A
%0A%0A@csrf_
@@ -1237,33 +1237,8 @@
xt)%0A
- dss = DocSimServer()%0A
@@ -1273,19 +1273,19 @@
milar =
-dss
+DSS
.find_si
@@ -1429,11 +1429,11 @@
-dss
+DSS
.ser
|
5e336b92c43d9111072e877ac4dd1362ce833740 | Fix query parameter quoting | euca2ools/nc/auth.py | euca2ools/nc/auth.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source ... | Python | 0.000005 | @@ -6686,17 +6686,16 @@
, safe='
-/
~'))%0A
|
f78e7eac7e604d9206372afa86a2fc96a049e7e6 | PATCH bugfix | eve/methods/patch.py | eve/methods/patch.py | # -*- coding: utf-8 -*-
"""
eve.methods.patch
~~~~~~~~~~~~~~~~~
This module imlements the PATCH method.
:copyright: (c) 2014 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
"""
from flask import current_app as app, abort
from werkzeug import exceptions
from datetime import dateti... | Python | 0.000001 | @@ -3896,44 +3896,8 @@
py()
-%0A updated.update(updates)
%0A%0A
@@ -4056,32 +4056,69 @@
tes, original)%0A%0A
+ updated.update(updates)%0A%0A
app.
|
46310abfba94fbdc1ecb402de2d2991baaa2765b | fix comments typo | genomat_func/__main__.py | genomat_func/__main__.py | # -*- coding: utf-8 -*-
#########################
# __MAIN__ #
#########################
"""
Pure functionnal incomplete implementation of PRJ project.
Gene KO and mutations are not implemented.
Computation of viability for a genome is not really implemented, but works…
Its just for playing and teaching.
... | Python | 0.000071 | @@ -920,16 +920,17 @@
0 become
+s
1 and %3C
@@ -937,16 +937,17 @@
0 become
+s
-1%0A
@@ -1410,16 +1410,17 @@
hat link
+s
a gene
@@ -1463,17 +1463,16 @@
ction of
-
%0A gen
@@ -2502,17 +2502,16 @@
TION:%5Cn'
-
%0A
@@ -2835,17 +2835,16 @@
sed from
-
%0A one
@@ -3951,17 +3951,16 @@
_viab... |
70723aff7a947d00f4f5632cfd7d1fe4d52c79be | Remove the friend from the mapping dict. | shell/view/frame/friendstray.py | shell/view/frame/friendstray.py | # Copyright (C) 2006-2007 Red Hat, Inc.
#
# 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 2 of the License, or
# (at your option) any later version.
#
# This program is distribute... | Python | 0 | @@ -2621,16 +2621,59 @@
ps.key%5D)
+%0A del self._buddies%5Bbuddy.props.key%5D
%0A%0A de
|
829d68f842c5076be7a8b2c3963c032977fe2f47 | Bump to 4.4-dp2. | pebble_tool/version.py | pebble_tool/version.py | version_base = (4, 4, 0)
version_suffix = 'dp1'
if version_suffix is None:
__version_info__ = version_base
else:
__version_info__ = version_base + (version_suffix,)
__version__ = '{}.{}'.format(*version_base)
if version_base[2] != 0:
__version__ += '.{}'.format(version_base[2])
if version_suffix is not N... | Python | 0.000001 | @@ -42,9 +42,9 @@
'dp
-1
+2
'%0A%0Ai
|
bc91c7abdc5754917642614930ad24d5db169c9a | simplify settings | shotglass/shotglass/settings.py | shotglass/shotglass/settings.py | # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
# SECURITY WARNING: keep the... | Python | 0.00049 | @@ -1,428 +1,13 @@
-# Build paths inside the project like this: os.path.join(BASE_DIR, ...)%0Aimport os%0A%0ABASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))%0A%0A%0A# Quick-start development settings - unsuitable for production%0A# See https://docs.djangoproject.com/en/1.8/howto/deployment/checkl... |
752132f83cacb15273625f819eed1dab1d558e97 | Make sure all relevant fields are shown in the admin interface | dictionary/admin.py | dictionary/admin.py | from daisyproducer.dictionary.models import Word
from django.contrib import admin
class WordAdmin(admin.ModelAdmin):
list_display = ('untranslated', 'grade1', 'grade2', 'type', 'isConfirmed')
ordering = ('untranslated',)
search_fields = ('untranslated',)
admin.site.register(Word, WordAdmin)
| Python | 0 | @@ -188,16 +188,27 @@
nfirmed'
+, 'isLocal'
)%0A or
|
e1a5c622287f889ca3f38cffba391528e2fce5ba | Version 0.1.5 | gevent_tasks/__init__.py | gevent_tasks/__init__.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# >>
# gevent-tasks, 2017
# <<
__author__ = 'Blake VandeMerwe'
__version__ = '0.1.4'
__license__ = 'MIT'
__contact__ = 'blakev@null.net'
__url__ = 'https://github.com/blakev/gevent-tasks'
from gevent_tasks.manager import TaskManager
from gevent_tasks.tasks import *
... | Python | 0.000001 | @@ -131,9 +131,9 @@
0.1.
-4
+5
'%0A__
|
e60efc7bebbea465154feb26879b27830e0e4a11 | Update docstrings. | dqutils/database/field.py | dqutils/database/field.py | # -*- coding: utf-8 -*-
"""dqutils.database.field -- Define field classes.
"""
from abc import ABCMeta
from abc import abstractmethod
from dqutils.bit import get_bits
from dqutils.bit import get_int
class AbstractField(metaclass=ABCMeta):
"""This class represents a member data or field in a data structure.
At... | Python | 0 | @@ -428,23 +428,37 @@
he b
-ase alignment (
+eginning of the array (given
in b
@@ -495,19 +495,26 @@
k value
-for
+if this is
a bit f
@@ -557,25 +557,15 @@
ntf%60
- style
format
-ting
str
@@ -1736,21 +1736,22 @@
rmatted
-value
+string
.%0A
|
4abea7bafa80547548488cf5445b42b3fccf7939 | Version bump for development | discord/__init__.py | discord/__init__.py | """
Discord API Wrapper
~~~~~~~~~~~~~~~~~~~
A basic wrapper for the Discord API.
:copyright: (c) 2015-present Rapptz
:license: MIT, see LICENSE for more details.
"""
__title__ = 'discord'
__author__ = 'Rapptz'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015-present Rapptz'
__version__ = '2.0.0'
__path__ = __im... | Python | 0 | @@ -296,11 +296,12 @@
'2.
-0
+1
.0
+a
'%0A%0A_
@@ -1726,17 +1726,17 @@
, minor=
-0
+1
, micro=
@@ -1752,21 +1752,21 @@
elevel='
-final
+alpha
', seria
|
bda269c5b745703cf517222e004caf0233b40699 | refactor p4io to io | tests/test_get_data.py | tests/test_get_data.py | from planet4 import p4io
import datetime as dt
def test_get_numbers_from_date_from_fname():
fname1 = '/a/b/c/2014-06-02_some_name.h5'
assert p4io.split_date_from_fname(fname1) == [2014, 6, 2]
def test_get_datetime_object_from_fname():
fname1 = '/a/b/c/2014-06-02_some_name.h5'
dt_obj = dt.datetime(20... | Python | 0.999999 | @@ -17,13 +17,11 @@
ort
-p4
io%0A
+
impo
@@ -142,18 +142,16 @@
assert
-p4
io.split
@@ -340,18 +340,16 @@
_obj ==
-p4
io.get_d
@@ -645,16 +645,16 @@
rn)%0A
+
x =
p4io
@@ -653,10 +653,8 @@
x =
-p4
io.g
|
1a8ddc44a026919e404c23fe7f2d7b1ee8bac63e | Implement unit tests for write invalid type jsondict issue. | tests/test_jsondict.py | tests/test_jsondict.py | # Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
import os
import unittest
import uuid
from signac.core.jsondict import JSONDict
from signac.common import six
if six.PY2:
from tempdir import TemporaryDirectory
else:
... | Python | 0 | @@ -4965,16 +4965,470 @@
y%5D, d)%0A%0A
+ def test_write_invalid_type(self):%0A class Foo(object):%0A pass%0A%0A jsd = self.get_json_dict()%0A key = 'write_invalid_type'%0A d = self.get_testdata()%0A jsd%5Bkey%5D = d%0A self.assertEqual(len(jsd), 1)%0A sel... |
9b06a061a4bc439ea96761ead0a1397470cfff56 | update tests | tests/test_labeling.py | tests/test_labeling.py | from __future__ import print_function
from builtins import zip
from builtins import object
from usaddress import parse, GROUP_LABEL
from parserator.training import readTrainingData
import unittest
class TestSimpleAddresses(object) : # for test generators, must inherit from object
def test_simple_addresses(self):
... | Python | 0.000001 | @@ -2193,16 +2193,95 @@
umber')%0A
+ elif label == ('Null') :%0A fuzzy_labels.append('NotAddress')%0A
|
ab574b6c40b6e58f396c9522be864a78478617c1 | Remove TestMainLoop.test_concurrency | tests/test_mainloop.py | tests/test_mainloop.py | # -*- Mode: Python -*-
import os
import sys
import select
import signal
import time
import unittest
try:
from _thread import start_new_thread
start_new_thread # pyflakes
except ImportError:
# Python 2
from thread import start_new_thread
from gi.repository import GLib
from compathelper import _bytes
... | Python | 0.013365 | @@ -99,162 +99,8 @@
st%0A%0A
-try:%0A from _thread import start_new_thread%0A start_new_thread # pyflakes%0Aexcept ImportError:%0A # Python 2%0A from thread import start_new_thread%0A
from
@@ -1441,759 +1441,8 @@
n)%0A%0A
- @unittest.skipUnless(hasattr(signal, %22SIGUSR1%22), %22no SIGUSR1%22)%0A ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.