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 |
|---|---|---|---|---|---|---|---|
b94bfcbc579af9e08c4ac42466cd0c33a6d8a529 | add textCNN model to __init__.py (#1421) | tensor2tensor/models/__init__.py | tensor2tensor/models/__init__.py | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | Python | 0.000139 | @@ -1573,24 +1573,66 @@
rt slicenet%0A
+from tensor2tensor.models import text_cnn%0A
from tensor2
|
251a91c1bf245b3674c2612149382a0f1e18dc98 | Add tests for getrpcinfo | test/functional/interface_rpc.py | test/functional/interface_rpc.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests some generic aspects of the RPC interface."""
from test_framework.test_framework import BitcoinTestFr... | Python | 0 | @@ -365,16 +365,46 @@
rt_equal
+, assert_greater_than_or_equal
%0A%0Aclass
@@ -540,16 +540,353 @@
= True%0A%0A
+ def test_getrpcinfo(self):%0A self.log.info(%22Testing getrpcinfo...%22)%0A%0A info = self.nodes%5B0%5D.getrpcinfo()%0A assert_equal(len(info%5B'active_commands'%5D), 1)%0A%0A ... |
46c09fd75c6f45d68cd722cd3a12b88d04257083 | Add tests for getrpcinfo | test/functional/interface_rpc.py | test/functional/interface_rpc.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests some generic aspects of the RPC interface."""
from test_framework.test_framework import BitcoinTestFr... | Python | 0 | @@ -365,16 +365,46 @@
rt_equal
+, assert_greater_than_or_equal
%0A%0Aclass
@@ -540,16 +540,353 @@
= True%0A%0A
+ def test_getrpcinfo(self):%0A self.log.info(%22Testing getrpcinfo...%22)%0A%0A info = self.nodes%5B0%5D.getrpcinfo()%0A assert_equal(len(info%5B'active_commands'%5D), 1)%0A%0A ... |
d8dc3f2f2972aa03781f4ff4044ac40fbf6b05ab | modify p2p_feefilter test to catch rounding error | test/functional/p2p_feefilter.py | test/functional/p2p_feefilter.py | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test processing of feefilter messages."""
from decimal import Decimal
import time
from test_framework... | Python | 0 | @@ -1332,16 +1332,411 @@
odes = 2
+%0A # We lower the various required feerates for this test%0A # to catch a corner-case where feefilter used to slightly undercut%0A # mempool and wallet feerate calculation based on GetFee%0A # rounding down 3 places, leading to stranded transactions.%0A ... |
e3aceabfe36c57f439c5db39f41ce00f079c71ed | Add test for too-large wallet output groups | test/functional/wallet_groups.py | test/functional/wallet_groups.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test wallet group functionality."""
from test_framework.test_framework import BitcoinTestFramework
from tes... | Python | 0 | @@ -305,16 +305,116 @@
amework%0A
+from test_framework.mininode import FromHex, ToHex%0Afrom test_framework.messages import CTransaction%0A
from tes
@@ -2677,16 +2677,1131 @@
.0001)%0A%0A
+ # Empty out node2's wallet%0A self.nodes%5B2%5D.sendtoaddress(address=self.nodes%5B0%5D.getnewaddress(), amount=s... |
28e78b51ff7f198a21b3d46d66d8ab6399d96a53 | increase led brightness | led_controller.py | led_controller.py | #!/usr/bin/env python
import time
import _rpi_ws281x as ws
class Led:
def __init__(self):
# LED configuration
self.LED_CHANNEL = 0
self.LED_COUNT = 64 # LEDs to light
self.LED_FREQ_HZ = 800000 # Frequency of LED signal (800khz | 400khz)
self.LED_DMA_NUM = 5 # DMA channel to use (0 - 1... | Python | 0.000001 | @@ -412,11 +412,11 @@
%09=
-128
+200
%09%09#
|
35cf00b5f05f4b1df8b40b7edc3aac76534c8903 | enable some reduction tests | test/python/tests/test_reduce.py | test/python/tests/test_reduce.py | import util
class tes1t_reduce_views:
""" Test reduction of all kind of views"""
def init(self):
for cmd, ndim in util.gen_random_arrays("R", 4, dtype="np.float32"):
cmd = "R = bh.random.RandomState(42); a = %s; " % cmd
for i in range(ndim):
yield (cmd, i)
... | Python | 0.000036 | @@ -8,33 +8,32 @@
util%0A%0A%0Aclass tes
-1
t_reduce_views:%0A
@@ -499,17 +499,16 @@
lass tes
-1
t_reduce
|
b2266a2640d542fa6f9734fa9565a7521d06f1b0 | Bump again | bulbs/__init__.py | bulbs/__init__.py | __version__ = "0.11.3"
| Python | 0 | @@ -17,7 +17,7 @@
.11.
-3
+4
%22%0A
|
04118d072a65df7df2b0feba87797c7228bdcc84 | Fix app registry not ready | cacheops/utils.py | cacheops/utils.py | # -*- coding: utf-8 -*-
import re
import json
import inspect
from funcy import memoize, compose, wraps, any, any_fn, select_values, make_lookuper
from funcy.py3 import lmapcat
from .cross import md5hex
from django.apps import apps
from django.db import models
from django.http import HttpRequest
from django.db.migratio... | Python | 0.000001 | @@ -293,68 +293,8 @@
uest
-%0Afrom django.db.migrations.recorder import MigrationRecorder
%0A%0Afr
@@ -1210,16 +1210,80 @@
=True)%7D%0A
+ from django.db.migrations.recorder import MigrationRecorder%0A
d%5B'd
|
aee41bac296eece9c30565c5824db9a019833ee0 | Add decorator docs | calm/decorator.py | calm/decorator.py |
def produces(resource_type):
def decor(func):
if getattr(func, 'handler_def', None):
func.handler_def.produces = resource_type
else:
func.produces = resource_type
return func
return decor
def consumes(resource_type):
def decor(func):
if getattr(f... | Python | 0.000001 | @@ -1,303 +1,1415 @@
-%0A%0Adef produces(resource_type):%0A def decor(func):%0A if getattr(func, 'handler_def', None):%0A func.handler_def.produces = resource_type%0A else:%0A func.produces = resource_type%0A%0A return func%0A%0A return decor%0A%0A%0Adef consumes(resourc... |
6f0b75f0561563926afc37dca8451f886e2e2d4f | Handle unicode data like cdbdump | cdblib/cdbdump.py | cdblib/cdbdump.py | from __future__ import print_function
import argparse
import sys
import six
import cdblib
def cdbdump(parsed_args, **kwargs):
# Read binary data from stdin by default
stdin = kwargs.get('stdin')
if stdin is None:
stdin = sys.stdin if six.PY2 else sys.stdin.buffer
# Print text data to stdou... | Python | 0.999719 | @@ -362,85 +362,94 @@
out'
-, sys.stdout)%0A encoding = kwargs.get('encoding', sys.getdefaultencoding())
+)%0A if stdout is None:%0A stdout = sys.stdout if six.PY2 else sys.stdout.buffer
%0A%0A
@@ -735,39 +735,27 @@
m =
-'+%7B:d%7D,%7B:d%7D:%7B:s%7D-%3E%7B:s%7D'.format(
+(%0A b'+',
%0A ... |
9e22b82b9f5848ae3bfc8def66fe7b3d23c8f5b8 | Change Alfred date of posting to be iso8601 compatible. | jobs/spiders/alfred.py | jobs/spiders/alfred.py | import json
import urlparse
import scrapy
from jobs.items import JobsItem
from jobs.spiders.visir import decode_date_string
class AlfredSpider(scrapy.Spider):
name = "alfred"
start_urls = ['https://api.alfred.is/api/v3/web/open/jobs?cat=0&limit=100&page=0']
def parse(self, response):
# we're us... | Python | 0 | @@ -22,16 +22,39 @@
lparse%0A%0A
+import dateutil.parser%0A
import s
@@ -96,58 +96,8 @@
tem%0A
-from jobs.spiders.visir import decode_date_string%0A
%0A%0Acl
@@ -1553,25 +1553,28 @@
= d
-ecode_date_string
+ateutil.parser.parse
(job
@@ -1586,16 +1586,28 @@
dline'%5D)
+.isoformat()
%0A
|
4b1ba931091448b4e5d980cb0695b4a8aa85b459 | Use markets.ft.com instead of fixer.io | bumblebee/modules/currency.py | bumblebee/modules/currency.py | # -*- coding: UTF-8 -*-
# pylint: disable=C0111,R0903
"""Displays currency exchange rates. Currently, displays currency between GBP and USD/EUR only.
Requires the following python packages:
* requests
Parameters:
* currency.interval: Interval in minutes between updates, default is 1.
* currency.source: S... | Python | 0 | @@ -824,19 +824,26 @@
http
+s
://
-fixer.io
+markets.ft.com
%0A%22%22%22
@@ -1103,16 +1103,114 @@
u%22$%22%0A%7D%0A%0A
+API_URL = %22https://markets.ft.com/data/currencies/ajax/conversion?baseCurrency=%7B%7D&comparison=%7B%7D%22%0A%0A
class Mo
@@ -1598,24 +1598,35 @@
, %22USD,EUR%22)
+.split(%22,%22)
%0A ... |
210c2cf58c246c3733542b8fee7c3eb9fe5d860d | bump version | callisto/delivery/__init__.py | callisto/delivery/__init__.py | __version__ = '0.4.0'
| Python | 0 | @@ -12,11 +12,11 @@
= '0.4.
-0
+1
'%0A
|
b0245dc4e109a6e381a84a9d3f56ad77425185b8 | add missing : | cavedb/docgen_entrance_csv.py | cavedb/docgen_entrance_csv.py | # Copyright 2016-2017 Brian Masney <masneyb@onstation.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | Python | 0.000027 | @@ -2253,16 +2253,17 @@
else
+:
%0A
|
623ce2d8624a1a04156a35ae762d29a19fbc7b52 | fix broken docstring | ceph_deploy/util/templates.py | ceph_deploy/util/templates.py |
ceph_repo = """
[ceph]
name=Ceph packages for $basearch
baseurl={repo_url}/$basearch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey={gpg_url}
[ceph-noarch]
name=Ceph noarch packages
baseurl={repo_url}/noarch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey={gpg_url}
[ceph-source]
name=Ceph source packages
baseurl={repo_url}/SRPMS
... | Python | 0 | @@ -1042,20 +1042,16 @@
m_repo =
- %22%22%22
%0A
@@ -1235,20 +1235,8 @@
oxy%7D
-%0A %22%22%22
%0A%0A
|
f4b8246aead0657e0f997773efed5fbc2147cce7 | add '# noqa' to imports to make flake8 happy | ceph_medic/remote/__init__.py | ceph_medic/remote/__init__.py | import mon
import osd
import common
import functions
import commands
| Python | 0 | @@ -3,16 +3,24 @@
port mon
+ # noqa
%0Aimport
@@ -22,16 +22,24 @@
port osd
+ # noqa
%0Aimport
@@ -44,16 +44,24 @@
t common
+ # noqa
%0Aimport
@@ -69,16 +69,24 @@
unctions
+ # noqa
%0Aimport
@@ -93,9 +93,17 @@
commands
+ # noqa
%0A
|
69a9ba2fed2ab95f15b0292b796e317df00446a9 | Use type hint in _chainerx.py | chainer/backends/_chainerx.py | chainer/backends/_chainerx.py | import numpy
import chainer
from chainer import _backend
from chainer.backends import _cpu
from chainer.backends import cuda
from chainer.backends import intel64
import chainerx
class ChainerxDevice(_backend.Device):
"""Device for ChainerX backend"""
xp = chainerx
supported_array_types = (chainerx.ndar... | Python | 0.000001 | @@ -394,28 +394,11 @@
vice
-):%0A # type: (
+: '
chai
@@ -408,16 +408,17 @@
x.Device
+'
) -%3E Non
@@ -414,25 +414,25 @@
ce') -%3E None
-%0A
+:
%0A ass
|
20e8ef6bd68100a70b9d50013630ff71d8b7ec94 | Support wildcard matches on coverage/junit results | changes/artifacts/__init__.py | changes/artifacts/__init__.py | from __future__ import absolute_import, print_function
from .manager import Manager
from .coverage import CoverageHandler
from .xunit import XunitHandler
manager = Manager()
manager.register(CoverageHandler, ['coverage.xml'])
manager.register(XunitHandler, ['xunit.xml', 'junit.xml'])
| Python | 0 | @@ -219,16 +219,34 @@
age.xml'
+, '*.coverage.xml'
%5D)%0Amanag
@@ -292,15 +292,45 @@
'junit.xml'
+, '*.xunit.xml', '*.junit.xml'
%5D)%0A
|
3109b98d8f8befdb927828908bd213000cf9ae51 | Handle empty result for previous runs/test failures in origin finder | changes/utils/originfinder.py | changes/utils/originfinder.py | from __future__ import absolute_import
from collections import defaultdict
from changes.constants import Result, Status
from changes.models import Job, TestGroup
def first(key, iterable):
for x in iterable:
if key(x):
return x
return None
def find_failure_origins(job, test_failures):
... | Python | 0 | @@ -460,16 +460,61 @@
roject%0A%0A
+ if not test_failures:%0A return %7B%7D%0A%0A
# fi
@@ -1560,16 +1560,61 @@
%5B:100%5D%0A%0A
+ if not previous_runs:%0A return %7B%7D%0A%0A
# we
|
0bf6441863433575aebcbd0b238d27d95830c015 | Fix .iob converter (closes #3620) | spacy/cli/converters/iob2json.py | spacy/cli/converters/iob2json.py | # coding: utf8
from __future__ import unicode_literals
import re
from ...gold import iob_to_biluo
from ...util import minibatch
def iob2json(input_data, n_sents=10, *args, **kwargs):
"""
Convert IOB files into JSON format for use with train cli.
"""
docs = []
for group in minibatch(docs, n_sents... | Python | 0 | @@ -58,16 +58,50 @@
mport re
+%0Afrom cytoolz import partition_all
%0A%0Afrom .
@@ -131,38 +131,8 @@
luo%0A
-from ...util import minibatch%0A
%0A%0Ade
@@ -271,295 +271,98 @@
-docs = %5B%5D%0A for group in minibatch(docs, n_sents):%0A group =
+sentences = read_iob(input_data.sp
li
-s
t(
-group
+%2... |
f190916a828ab4b8ecf16cc6a82ebf3cf8f821e1 | Add a test for executing specs with tags | spec/execution_with_tags_spec.py | spec/execution_with_tags_spec.py | from mamba import description, before, context, it
from doublex import Spy
from expects import expect, be_true, be_false
from mamba import reporter, runnable
from mamba.example import Example
from mamba.example_group import ExampleGroup
from spec.object_mother import an_example_group
TAGS = ['any_tag']
with descri... | Python | 0 | @@ -489,32 +489,42 @@
self.example
+_with_tags
= Example(lambd
@@ -522,32 +522,73 @@
ple(lambda x: x,
+%0A
parent=self.exa
@@ -599,16 +599,26 @@
_group,%0A
+
@@ -844,24 +844,34 @@
self.example
+_with_tags
.execute(sel
@@ -874,32 +874,42 @@
(self.... |
cb1912234a058dd95c20cd765771552e76224c7a | fix c3 settings | chipyprj/chipyprj/settings.py | chipyprj/chipyprj/settings.py | """
Django settings for chipyprj project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pat... | Python | 0.000002 | @@ -2791,16 +2791,21 @@
'/static
+-root
/'%0A%0ASTAT
|
aca08449ad9b382b71a191d23874c31b83d4c44b | Fix retrieval of value | spectral_cube/tests/test_dask.py | spectral_cube/tests/test_dask.py | # Tests specific to the dask class
import pytest
from numpy.testing import assert_allclose
from astropy.tests.helper import assert_quantity_allclose
from astropy import units as u
from spectral_cube import DaskSpectralCube
from .test_casafuncs import make_casa_testimage
try:
import casatools
from casatools ... | Python | 0.000008 | @@ -3331,24 +3331,153 @@
ts:%0A
+if isinstance(stats%5Bkey%5D, u.Quantity):%0A value = stats%5Bkey%5D.value%0A else:%0A value = stats%5Bkey%5D%0A
assert_allcl
@@ -3480,27 +3480,16 @@
llclose(
-stats%5Bkey%5D.
value, s
|
4cea85888411aef213fc69a80efdff5e2e25e8c6 | Extend error message | sqlobject/tests/test_datetime.py | sqlobject/tests/test_datetime.py | import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
########################################
## Date/time columns
########################################
from sqlobject import col
col.default_datetime_implementation = DATETIME_IMPLEMENTATION
from datetime import datetime, date, time
class Da... | Python | 0.000002 | @@ -1361,16 +1361,29 @@
st.skip(
+%0A
%22The dat
@@ -1418,16 +1418,31 @@
econds;
+%22%0A %22
microsec
@@ -1490,21 +1490,33 @@
on 5.3.0
- and
+, %22%0A %22
by MySQL
@@ -1535,16 +1535,66 @@
on 5.6.4
+, %22%0A %22by MSSQL since MS SQL Server 2008
.%22)%0A%0A
|
01e69c34ca8a7873e5fc990508464393fa3184bd | Implement port accessors | stoqdrivers/devices/base.py | stoqdrivers/devices/base.py | # -*- Mode: Python; coding: iso-8859-1 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Stoqdrivers
## Copyright (C) 2006 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as publishe... | Python | 0.000001 | @@ -4887,16 +4887,147 @@
cond))%0A%0A
+ def set_port(self, port):%0A self._driver.set_port(port)%0A%0A def get_port(self):%0A return self._driver.get_port()%0A%0A
def
|
04686df17ae26f86484965365d12039161d8ee2d | Add comment | synapse/handlers/profile.py | synapse/handlers/profile.py | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# 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 applicab... | Python | 0 | @@ -7340,16 +7340,64 @@
t=False,
+ # Try to hide that these events aren't atomic.
%0A
|
887bba729cd4f4f7391ac6f08ab7601976bcd1ca | Update __init__.py | templated_email/__init__.py | templated_email/__init__.py | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from templated_email.backends.vanilla_django import TemplateBackend
import warnings
warnings.filterwarnings('error', 'django.utils.importlib')
try:
# Django <= 1.7
from django.utils.importlib import import_module
except:
... | Python | 0.000072 | @@ -151,16 +151,27 @@
ackend%0A%0A
+import six%0A
import w
@@ -389,20 +389,8 @@
le%0A%0A
-import six%0A%0A
%0Adef
|
d57fb3ca8c1f4329c8ac90cb785b27123d98aee5 | Bump the version to 0.3.1 | backlog/__init__.py | backlog/__init__.py | """A Simple Note Manager"""
from __future__ import absolute_import
from backlog.backlog import Backlog
__version__ = '0.3.0'
| Python | 0.999999 | @@ -117,11 +117,11 @@
= '0.3.
-0
+1
'%0A
|
eef0663675b741d32f399bdbca1a95b943a1fb68 | Create a script that uses an autoencoder to extract bow | bag-of-words/bow.py | bag-of-words/bow.py | #!/usr/bin/env python
"""This module contains function and classes relevant with the computation of
a bag of words model. At start we suppose that suitable descriptors for our
dataset are already extracted. Subsequently we procceed to the second step of
quantization, in this step we use a clustering algorithm such as K... | Python | 0.000001 | @@ -1459,16 +1459,274 @@
)%0A%0A
+ @property%0A def centroids(self):%0A %22%22%22The centroids of the encoding%22%22%22%0A return self._clusterer.cluster_centers_.copy()%0A%0A @centroids.setter%0A def centroids(self, centroids):%0A self._clusterer.cluster_centers_ = centroids.copy... |
f33de839f7eaf4c983a542ccfb82f2f7d304c905 | remove debug | bd_elk/ip/common.py | bd_elk/ip/common.py | from elasticsearch_dsl import DocType
from bd_elk.common_es import CommonEs
from ultis.commons import ComFunc
class CommonIp(DocType, CommonEs):
# todo should use pandas to do json format
"""
基于Ip 数据公用的类
"""
# 指定的类型(src,dst...)
_type = None
@classmethod
def get_total_s... | Python | 0.000002 | @@ -501,21 +501,8 @@
_key
-, update=True
)%0D%0A%0D
@@ -888,16 +888,18 @@
+ #
cls.deb
|
ffe61046f8fa2052a7ef75bae7da4b5aaafc24ef | check for label in label info from MB (fixes #254) | beets/autotag/mb.py | beets/autotag/mb.py | # This file is part of beets.
# Copyright 2011, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | Python | 0 | @@ -3999,16 +3999,21 @@
label
+_info
= relea
@@ -4036,16 +4036,79 @@
ist'%5D%5B0%5D
+%0A if label_info%5B'label'%5D:%0A label = label_info
%5B'label'
@@ -4109,32 +4109,36 @@
label'%5D%5B'name'%5D%0A
+
if label
@@ -4155,16 +4155,20 @@
abel%5D':%0A
+
|
dee0b795e38118813da9a04fe725a8a40ccbf44b | Fix bug that ignore to completed tasks over 50 on daily report | chalicelib/api.py | chalicelib/api.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from owlmixin.owlcollections import TList
from typing import Text
import json
import uuid
from pytz import utc
import requests
from datetime import datetime
from chalicelib.models import *
from fn import _
USERNAME_DEFAULT = "TINA"
TOGGL_API_URL = 'ht... | Python | 0 | @@ -1870,22 +1870,112 @@
e):%0A
-return
+def fetch_all():%0A offset = 0%0A max_limit = 50%0A%0A while True:%0A rs =
TList(r
@@ -2025,32 +2025,40 @@
et_all', data=%7B%0A
+
%22token%22:
@@ -2073,32 +2073,40 @@
_token,%0A
+
+
%22since%22: since.a
@... |
176a7571a2151db466d83db20f3f5efe1dc8dce9 | fix king me | checkers/board.py | checkers/board.py | import enums
from tkinter import *
from piece import Piece
root = Tk()
board = [[[0 for x in range(8)]for y in range(8)] for z in range(2)]
global_x = -1
global_y = -1
def compress(x,y):
board[1][y][x] = board[1][global_y][global_x]
board[1][global_y][global_x] = 0
create_piece(y,x)
board[0][global_y][... | Python | 0.000001 | @@ -337,16 +337,32 @@
(%22all%22)%0A
+ return True%0A
def jump
|
0f782215e58eba53b72667bffde667f4d03a0d4a | Update version. | client/version.py | client/version.py | __version__ = '0.1.9'
| Python | 0 | @@ -14,9 +14,9 @@
'0.
-1.9
+2.0
'%0A
|
6749060a7546b7dee3c6e643c7dfad4db7934061 | package for release | cliez/__init__.py | cliez/__init__.py | # -*- coding: utf-8 -*-
version = "1.6.9"
version_info = (1, 6, 9)
| Python | 0 | @@ -33,17 +33,18 @@
= %221.6.
-9
+10
%22%0Aversio
@@ -63,9 +63,10 @@
6,
-9
+10
)%0A%0A%0A
|
9b77b62a687359ff9a7f35f50b13ec78b6cb8ae8 | Clean up recursive data handling | cliff/complete.py | cliff/complete.py |
"""Bash completion for the CLI.
"""
import logging
from cliff import command
class CompleteDictionary:
"""dictionary for bash completion
"""
def __init__(self):
self._dictionary = {}
def add_command(self, command, actions):
optstr = ' '.join(opt for action in actions
... | Python | 0.000319 | @@ -47,16 +47,27 @@
ogging%0A%0A
+import six%0A
from cli
@@ -773,84 +773,8 @@
-if path == %22%22:%0A name = cmd%0A else:%0A
name
@@ -788,16 +788,33 @@
+ %22_%22 +
+ cmd if path else
cmd%0A
@@ -880,18 +880,31 @@
value, s
-tr
+ix.string_types
):%0A
|
27c7270a170a8eb3c2720390ab6e95d6bf16f8e3 | fix option name to driver (#24) | cligj/__init__.py | cligj/__init__.py | # cligj
# Shared arguments and options.
import click
from .features import normalize_feature_inputs
# Arguments.
# Multiple input files.
files_in_arg = click.argument(
'files',
nargs=-1,
type=click.Path(resolve_path=True),
required=True,
metavar="INPUTS...")
# Multiple files, last of which is... | Python | 0 | @@ -1039,16 +1039,26 @@
driver',
+ 'driver',
%0A def
|
05f45992e871dc0d98613fb31269c43e21869414 | Add envy help command | cloudenvy/main.py | cloudenvy/main.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
import argparse
import logging
from cloudenvy.config import EnvyConfig
from cloudenvy.commands.envy_up import EnvyUp
from cloudenvy.commands.envy_list import EnvyList
from cloudenvy.commands.envy_provision import EnvyProvision
from cloudenvy.commands.envy_snapshot import E... | Python | 0.999924 | @@ -1374,16 +1374,433 @@
rsers)%0A%0A
+ def find_command_help(config, args):%0A if args.command:%0A subparsers.choices%5Bargs.command%5D.print_help()%0A else:%0A parser.print_help()%0A%0A help_subparser = subparsers.add_parser('help',%0A help='Display help informati... |
0cad35e80a75a31a81937fb9afe2d19261a2c077 | Add method for returning live node metrics | cloudkick/base.py | cloudkick/base.py | # Licensed to Cloudkick, Inc ('Cloudkick') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# Cloudkick licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this f... | Python | 0.000001 | @@ -3563,16 +3563,252 @@
checks%0A%0A
+ def live_data(self, node_id, check_name = 'mem'):%0A if not check_name in %5B'mem', 'disk', 'cpu'%5D:%0A return False%0A%0A live_data = self._request_json(%22query/node/%25s/check/%25s%22 %25 (node_id,%0A check_name), %7B%7D)%0A return live_data%0A%0A
def da... |
1130f5822576cf79c90c525d46723af9ff2c065b | Stop sending redundant DMs for unknown command | cogbot/cog_bot.py | cogbot/cog_bot.py | import logging
from discord.ext import commands
from discord.ext.commands import Context
from discord.ext.commands.errors import *
from cogbot.cog_bot_config import CogBotConfig
log = logging.getLogger(__name__)
class CogBot(commands.Bot):
def __init__(self, config: CogBotConfig, **options):
super().__... | Python | 0 | @@ -2825,74 +2825,8 @@
d):%0A
- await self.send_error(ctx, ctx.message.author, error)%0A
|
fabcd790578e904b3bff34fdf6e91edb4906a4e2 | Add missing comma in compat.gyp | compat/compat.gyp | compat/compat.gyp | # Copyright 2014 The Crashpad Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | Python | 0.000001 | @@ -834,16 +834,17 @@
ource.h'
+,
%0A
|
79cd3dc227ff1d13faa9581b6f22caa176db2360 | Mark Document.to_archive as abstract | c2corg_api/models/document.py | c2corg_api/models/document.py | from sqlalchemy import (
Column,
Integer,
Boolean,
String,
ForeignKey,
Enum
)
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
from c2corg_api.models import Base, schema
from utils import copy_attributes
quality_types = [
'stub',
'medium'... | Python | 0.001214 | @@ -191,16 +191,27 @@
tionship
+%0Aimport abc
%0A%0Afrom c
@@ -1572,34 +1572,353 @@
-def to_archive(self, doc):
+@abc.abstractmethod%0A def to_archive(self):%0A %22%22%22Create an %60Archive*%60 instance with the same attributes.%0A This method is supposed to be implemented by child classes.%0A... |
41bb51f7f0aa1fda927af51498ec1acbf9eeddcc | fix history links | leaguebot/services/alerters/slack.py | leaguebot/services/alerters/slack.py | from leaguebot import app
import leaguebot.models.map as screepmap
import leaguebot.services.screeps as screeps
import leaguebot.services.slack as slack
import re
def sendBattleMessage(battleinfo):
message = getBattleMessageText(battleinfo)
sendToSlack(message)
def getBattleMessageText(battleinfo):
room... | Python | 0 | @@ -494,14 +494,25 @@
ory/
-E53N64
+' + room_name + '
?t='
|
2c9a0f9783c72af122d7c728a7760c8a2027d45f | Fix remove debug print | tests/resolver_test.py | tests/resolver_test.py | from gnr.core.gnrbag import Bag, BagCbResolver
def hello(x=''):
return 'i say : %s ' % x
b = Bag()
b.setCallBackItem('say_hello', hello, x='hello')
b.setCallBackItem('say_muu', hello, x='muu')
b.setCallBackItem('say_buzbuz', hello, x='buzbuz')
resolver = BagCbResolver(hello, x='fatto da resolver e non da setCallB... | Python | 0.000019 | @@ -362,91 +362,4 @@
ver)
-%0A%0Aprint b%5B'say_hello'%5D%0Aprint b%5B'say_muu'%5D%0Aprint b%5B'say_buzbuz'%5D%0Aprint b%5B'say_resolver'%5D
|
539c11706d91db92e36f49694603f2ed668d8cbb | Add a __unicode__ method to the Book model. Will show book title in admin instead of "Book object". | test_environment/books/models.py | test_environment/books/models.py | from dockit.schema import Document, Schema, ModelReferenceField, \
TextField, DictField, SchemaField, FileField, IntegerField, \
ReferenceField, ListField, GenericSchemaField, CharField, DateField
from django.contrib.auth.models import User
class Author(Document):
user = ModelReferenceField(User)
inte... | Python | 0 | @@ -1100,24 +1100,82 @@
=True)%0A %0A
+ def __unicode__(self):%0A return self.title%0A %0A
class Me
|
d88013450d5e3ec62a3cb8b4fcfa2afbc173338b | remove from there as well | tests/safety/common.py | tests/safety/common.py | from panda.tests.safety import libpandasafety_py
MAX_WRONG_COUNTERS = 5
class UNSAFE_MODE:
DEFAULT = 0
DISABLE_DISENGAGE_ON_GAS = 1
DISABLE_STOCK_AEB = 2
ENABLE_WEAK_STEERING_WHILE_NOT_ENGAGED = 4
RAISE_LONGITUDINAL_LIMITS_TO_ISO_MAX = 8
def make_msg(bus, addr, length=8):
to_send = libpandasafety_py.ffi.... | Python | 0 | @@ -159,53 +159,8 @@
= 2%0A
- ENABLE_WEAK_STEERING_WHILE_NOT_ENGAGED = 4%0A
RA
|
9f40c3942a543375012aae0a2f03ca223b9fd612 | fix a bug, mnemonic passphrase works | stellar_base/keypair.py | stellar_base/keypair.py | # coding:utf-8
import base64
import os
from .base58 import b58decode_check, b58encode_check
from .stellarxdr import Xdr
from .utils import XdrLengthError, decode_check, encode_check, StellarMnemonic
# noinspection PyBroadException
try:
# noinspection PyUnresolvedReferences
from pure25519 import ed25519_oop as... | Python | 0.000032 | @@ -1027,18 +1027,26 @@
sphrase=
-''
+passphrase
)%0A
|
bfb048d9a1ac34cd07e0fc8d94c0e97d901ee096 | fix simple_parser | tests/simple_parser.py | tests/simple_parser.py | from test_parser import *
import sys
os.chdir("..")
import parser
if __name__ == "__main__":
x = ""
if len(sys.argv) > 1:
x = sys.argv[1]
else:
x = "x"
p = parser.HTMLParser()
document = p.parse(StringIO.StringIO(x))
print convertTreeDump(document.printTree())
| Python | 0 | @@ -1,8 +1,10 @@
+%0D%0A
from tes
@@ -32,16 +32,20 @@
port sys
+, os
%0D%0Aos.chd
@@ -51,12 +51,98 @@
dir(
-%22..%22
+os.path.split(os.path.abspath(__file__))%5B0%5D)%0Asys.path.insert(0, os.path.abspath(os.pardir)
)%0Aim
|
c682c5fa044cc4b4f0c0ede7d2e23e8de670969a | Use the _id function in full_format | bot/action/util/format.py | bot/action/util/format.py | import datetime
import time
from bot.action.standard.userinfo import UserStorageHandler
class DateFormatter:
@classmethod
def format(cls, timestamp):
return cls._format("%d %b %H:%M", timestamp)
@classmethod
def format_full(cls, timestamp):
return cls._format("%d %b %Y %H:%M:%S", tim... | Python | 0.001969 | @@ -2317,37 +2317,18 @@
r =
-%22%3C%22 + str(self.user.id) + %22%3E%22
+self._id()
%0A
|
24b02f5added52ac572ba24a90ef0c74c3fb7cd7 | use api.craft.ai for runtime url | local_demo.py | local_demo.py | #!/usr/bin/python
import os
import requests
import json
import subprocess
import time
def userInput(config):
def defaultValue(config, key):
return config[key] if key in config else ""
res = {}
invalid = {}
res['user_name'] = raw_input("your GitHub username (default = " + defaultValue(config, 'user_name') + "): "... | Python | 0 | @@ -2717,11 +2717,11 @@
s://
-hub
+api
.cra
|
a80646e0891dc5345caffd0acd12a073a0b47187 | add missing test | tests/testLimitator.py | tests/testLimitator.py | # -*- coding: utf-8 -*-
from tools.limitator import *
import unittest
import time
class TestLimitator(unittest.TestCase):
USER1 = {"id":1}
USER2 = {"id":2}
def test_1(self):
l = Limitator(5, 2)
for i in range(5):
l.next(self.USER1)
try:
l.next(self.USER1)
... | Python | 0.000288 | @@ -2012,28 +2012,279 @@
rLimitted:%0A pass%0A
+%0A def test_6(self):%0A l = Limitator(5, 2, True)%0A l.next(self.USER1, 3)%0A try:%0A l.next(self.USER1, 3)%0A self.fail(%22must crash%22)%0A except LimitatorLimitted:%0A pass%0A l.next(se... |
88c9facf33771ecfccf9c3b8f6d3e37b3a2b648c | Revert the first 'speedup' | chainerrl/misc/collections.py | chainerrl/misc/collections.py | import itertools
import numpy as np
class RandomAccessQueue(object):
"""FIFO queue with fast indexing
Operations getitem, setitem, append, popleft, and len
are amortized O(1)-time, if this data structure is used ephemerally.
"""
def __init__(self, *args, **kwargs):
self.maxlen = kwargs.p... | Python | 0.000002 | @@ -21,19 +21,25 @@
ort
-numpy as np
+random%0Aimport six
%0A%0A%0Ac
@@ -3257,34 +3257,48 @@
or i in
-np.
random.
-choic
+sample(six.moves.rang
e(n
+)
, k)%5D%0A%0A
@@ -3438,26 +3438,40 @@
in
-np.
random.
-choic
+sample(six.moves.rang
e(n
+)
, k)
|
4f34ea2d83e9e437f7934a6f8b88147db5ec4ee0 | Add metric reporting for job step timeouts. | changes/jobs/sync_job_step.py | changes/jobs/sync_job_step.py | from __future__ import absolute_import, print_function
from datetime import datetime
from flask import current_app
from sqlalchemy import or_
from sqlalchemy.sql import func
from changes.constants import Status, Result
from changes.config import db
from changes.db.utils import try_create
from changes.models import (
... | Python | 0.000001 | @@ -243,16 +243,31 @@
mport db
+, statsreporter
%0Afrom ch
@@ -4647,16 +4647,77 @@
flush()%0A
+ statsreporter.stats().incr('job_step_timed_out')%0A
|
6c463135561796a3d26709d0498f300717ceba83 | edit se.py to account for non-O3CPU workloads | configs/example/se.py | configs/example/se.py | # Copyright (c) 2006-2008 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... | Python | 0 | @@ -3620,16 +3620,102 @@
errout%0A%0A
+%0A# By default, set workload to path of user-specified binary%0Aworkloads = options.cmd%0A%0A
if optio
|
f47085e1472a19a4647f671f1dc08db0c8e0835c | fix and last try on flaky test | tests/test_cmd_auto.py | tests/test_cmd_auto.py | import time
from multiprocessing import Process
import pytest
from doit.cmdparse import DefaultUpdate
from doit.exceptions import InvalidCommand
from doit.task import Task
from doit.cmd_base import TaskLoader
from doit import cmd_auto
class TestFindFileDeps(object):
def find_deps(self, sel_tasks):
task... | Python | 0 | @@ -2301,20 +2301,21 @@
print
-
+(
got
+)
%0A
@@ -2410,15 +2410,16 @@
rint
-
+(
'busy'
+)
%0A
@@ -3016,34 +3016,33 @@
_wait_proc.join(
-.5
+1
)%0A if
|
ae8f9c39cd75d837a4cb5a4cea4d3d11fd1cabed | Add additional test case for comments | tests/test_comments.py | tests/test_comments.py | from hypothesis_auto import auto_pytest_magic
from isort import comments
auto_pytest_magic(comments.parse)
auto_pytest_magic(comments.add_to_line)
| Python | 0 | @@ -142,8 +142,131 @@
o_line)%0A
+%0A%0Adef test_add_to_line():%0A assert comments.add_to_line(%5B%5D, %22import os # comment%22, removed=True).strip() == %22import os%22%0A
|
aa1008691e3433f8350d3f3a5e5d03d9c629a45c | Test for getting parameters back from ideal observer | tests/test_idealobs.py | tests/test_idealobs.py | import pytest
import scipy.io as sio
from pambox import idealobs
import numpy as np
@pytest.fixture
def data():
return np.array([0.28032187, 1.07108181, 3.35513227, 8.66774961,
18.61914334, 33.63172026, 51.87228063, 69.72236134,
83.79127082, 92.72205919, 97.287... | Python | 0 | @@ -1592,8 +1592,142 @@
l=1e-4)%0A
+%0A%0Adef test_get_params():%0A p = %7B'k':1, 'q':2, 'sigma_s':0.5, 'm':800%7D%0A c = idealobs.IdealObs(**p)%0A assert p == c.get_params()%0A
|
28e049dfc0a784c9c47ef671286e39e13825c6c5 | Remove useless import | tests/test_multival.py | tests/test_multival.py | # test_multival.py
"""Test suite for MultiValue class"""
# Copyright (c) 2012 Darcy Mason
# This file is part of pydicom, relased under an MIT-style license.
# See the file license.txt included with this distribution, also
# available at https://github.com/darcymason/pydicom
import unittest
from datetime import ... | Python | 0.000004 | @@ -417,12 +417,8 @@
, IS
-, DA
%0Afro
@@ -444,53 +444,8 @@
nfig
- # don't import datetime_conversion directly
%0A%0Aim
|
2fdb9d17b2c033370d663b4e72d71c1c7e105a84 | fix test for python 3 | tests/test_pipeline.py | tests/test_pipeline.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
from nose.tools import eq_
from redis_shard.shard import RedisShardAPI
from redis_shard._compat import b
from .config import settings
class TestShard(unittest.TestCase):
def setUp(self):
self.client = RedisShardAPI(**settings)
self.clear_d... | Python | 0.000105 | @@ -839,16 +839,17 @@
test'),
+b
'2')%0A
@@ -1245,16 +1245,17 @@
test'),
+b
'3')%0A
|
ab4c02c1f5f5cf3ba46b4924c48693d028dc23db | Split pipeline tests | tests/test_pipeline.py | tests/test_pipeline.py | from valohai_yaml.objs import Config, DeploymentNode
def test_pipeline(pipeline_config: Config):
lr = pipeline_config.lint()
assert lr.is_valid()
assert any(
(
edge.source_node == "batch1"
and edge.source_type == "parameter"
and edge.source_key == "aspect-ratio"... | Python | 0.000001 | @@ -65,16 +65,22 @@
pipeline
+_valid
(pipelin
@@ -106,12 +106,14 @@
-lr =
+assert
pip
@@ -135,33 +135,72 @@
nt()
-%0A assert lr.is_valid()
+.is_valid()%0A%0A%0Adef test_little_pipeline(pipeline_config: Config):
%0A
@@ -595,16 +595,133 @@
%0A )%0A%0A
+%0Adef test_deployment_pipeline(pipeline_config... |
9e57e467ab508cd0e5fab2862a2c9b651eaa7838 | rename tag basisofRecords to BASISOFRECORDS | bin/aggregate_metrics.py | bin/aggregate_metrics.py | import sys
import os
import json
SRC_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '/src'
sys.path.append(SRC_DIR)
from aggregator import ReportAggregator, CartoDBWriter
def check_arguments():
if len(sys.argv) != 3:
print 'usage: aggregate_metrics.py <data directory> <settings.json>\... | Python | 0.000001 | @@ -1352,22 +1352,22 @@
t%5D%5B'
-basisofRecords
+BASISOFRECORDS
'%5D%0A
|
77c0ad615c7f0270c0425866f06edde8856892b9 | Add Augur Unit Tests For parseIntelXML() | build/tests/test_augur.py | build/tests/test_augur.py | #!/usr/bin/python3
"""
test_augur.py
APP: Inquisition
DESC: Unit test for Augur library
CREATION_DATE: 2017-11-25
"""
# MODULES
# | Native
import configparser
import unittest
# | Third-Party
from bs4 import BeautifulSoup as BSoup
# | Custom
from lib.destiny.Augur import Augur
# METADATA
__author__ = 'Joshua Carl... | Python | 0 | @@ -1666,16 +1666,252 @@
(True)%0A%0A
+ def test_parseIntelXML(self):%0A responseData = self.augur.getXMLSrcData(url='https://isc.sans.edu/api/openiocsources/')%0A parsedData = self.augur.parseIntelXML(responseData)%0A%0A self.assertNotEqual(parsedData, %7B%7D)%0A%0A
if __nam
|
5c2141610c40c1879400a88c82ac055081bb7451 | Let the final table have any number of periods per day | main/views.py | main/views.py | import sys
from string import ascii_uppercase
import itertools
from typing import Dict, List
from openpyxl import Workbook
from terminaltables import AsciiTable
from main import models
from main import solver
Timetable = Dict[models.Subject, List[int]]
def timetable_to_workbook(timetable: Timetable, sheet_name: st... | Python | 0.997706 | @@ -940,17 +940,31 @@
riod //
-4
+periods_per_day
%0A
@@ -993,17 +993,31 @@
eriod %25
-4
+periods_per_day
%0A%0A
|
b6572ec32295365862947845a8c916eae428700f | Clean up temporary files on 'nt'. | makemodule.py | makemodule.py | #!/bin/env python
"""
makemodule
Module generation tool
Copyright (c) 2015 Sam Saint-Pettersen.
Released under the MIT/X11 License.
"""
import sys
import os
import xml.dom.minidom as xml
class makemodule:
def __init__(self, args):
if len(args) == 1:
self.displayUsage()
else:
... | Python | 0 | @@ -1661,16 +1661,64 @@
lose()%0A%0A
+ if os.name == 'nt': os.remove('a.tmp')%0A%0A
makemodu
|
9aae92fb0e22c97f559b6e3ee895d9959e010e05 | Add missing import | tests_tf/test_model.py | tests_tf/test_model.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
from cleverhans.model import Model
class TestModelClass(unittest.TestCase):
def test_get_layer(self):
# Define empty model
model = ... | Python | 0.000466 | @@ -194,16 +194,38 @@
rt Model
+, CallableModelWrapper
%0A%0A%0Aclass
|
cd4e412b4e92ba10eaadacd55fb39b9f2d5f1a70 | Check the permissions of the clone dest directory | king_phisher/client/dialogs/clone_page.py | king_phisher/client/dialogs/clone_page.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/dialogs/page_clone.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# ... | Python | 0 | @@ -1587,16 +1587,27 @@
AGE.%0A#%0A%0A
+import os%0A%0A
from kin
@@ -3591,16 +3591,225 @@
ontinue%0A
+%09%09%09if not os.access(dest_dir, os.W_OK):%0A%09%09%09%09gui_utilities.show_dialog_error('Invalid Directory', self.dialog, 'Can not write to the specified directory.')%0A%09%09%09%09self.set_status('Invalid Direc... |
4646e7c682ba9a0291815a5d0de98674a9de3410 | Fix RemoteCapture definition | src/pyshark/capture/remote_capture.py | src/pyshark/capture/remote_capture.py | from pyshark import LiveCapture
class RemoteCapture(LiveCapture):
"""
A capture which is performed on a remote machine which has an rpcapd service running.
"""
def __init__(self, remote_host, remote_interface, remote_port=2002, bpf_filter=None):
"""
Creates a new remote capture which ... | Python | 0.000001 | @@ -858,16 +858,17 @@
.e.
+%5C
%5CDevice%5C
NPF_
@@ -863,16 +863,17 @@
%5CDevice%5C
+%5C
NPF_..).
|
1a9f0320b3a8aecc50cfee6335c3b6e8dc81c233 | Make this tool less hacky. | tools/commit-impact.py | tools/commit-impact.py | #!/usr/bin/env python
#
# See the impact of a Futhark commit compared to the previous one we
# have benchmarking for.
import sys
import subprocess
from urllib.request import urlopen
from urllib.error import HTTPError
import json
def url_for(backend, system, commit):
return 'https://futhark-lang.org/benchmark-resu... | Python | 0 | @@ -222,16 +222,42 @@
ort json
+%0Aimport tempfile%0Aimport os
%0A%0Adef ur
@@ -832,92 +832,43 @@
es%0A%0A
-if __name__ == '__main__':%0A backend, system, commit = sys.argv%5B1:%5D%0A%0A commits =
+def find_commits(start):%0A return
sub
@@ -908,21 +908,20 @@
-list',
-commi
+star
t%5D).deco
@@ -946,16 +... |
0fa1e147fc7d2522a4352c0bbc60e4da67380257 | add a missing statement | landlab/utils/tests/test_stream_length.py | landlab/utils/tests/test_stream_length.py | from landlab import RasterModelGrid, FieldError
from landlab.components import FlowAccumulator, FastscapeEroder, FlowDirectorSteepest
import numpy as np
from landlab.utils.stream_length import calculate_stream_length
from nose.tools import assert_equal, assert_true, assert_false, assert_raises
def test_no_flow_reciev... | Python | 1 | @@ -853,65 +853,8 @@
70)%0A
- z = mg.add_zeros('topographic__elevation', at='node')
%0A
|
fedc14b2cba840d9ce4937252277c5643fea55c4 | Revert "Skip pro directories when doing license check." | tools/licensescheck.py | tools/licensescheck.py | import os, sys, re
prunelist = ('hsqldb19b3',
'hsqldb',
'proj_gen',
'jni_md.h',
'jni.h',
'org_voltdb_jni_ExecutionEngine.h',
'org_voltdb_utils_DBBPool.h',
'org_voltdb_utils_DBBPool_DBBContainer.h',
'org_voltdb_utils... | Python | 0 | @@ -431,71 +431,8 @@
')%0A%0A
-# pro directories to skip%0Aprolist = ('org/voltdb/management')%0A%0A
def
@@ -3300,102 +3300,8 @@
n):%0A
- # Skip files in pro%0A for p in prolist:%0A if d.endswith(p):%0A return 0%0A%0A
|
3c7b421bf2069236a11292e677aff74ee53641dd | Use new Twitch.tv utility function | command.py | command.py | #!/usr/bin/env python3
# vim:fileencoding=utf-8:ts=8:et:sw=4:sts=4:tw=79
"""
command.py
Handle commands received on IRC.
Copyright (c) 2015 Twisted Pear <pear at twistedpear dot at>
See the file LICENSE for copying permission.
"""
import aiohttp
import asyncio
import bs4
import functools
import logging
PATREON_URL... | Python | 0 | @@ -300,16 +300,30 @@
logging
+%0Aimport twitch
%0A%0APATREO
@@ -375,133 +375,8 @@
un%22%0A
-BROADCAST_URL = (%22https://api.twitch.tv/kraken/channels/%22%0A %22loadingreadyrun/videos?limit=1&broadcasts=true%22)%0A
%0A%0Acl
@@ -3917,20 +3917,16 @@
roadcast
-_req
= yield
@@ -3935,189 +3935,50 @@
... |
85ee5f5e6d7a5937b67c9d11ae127709749f7490 | Bump to version 0.4.1 | cmsplugin_cascade/__init__.py | cmsplugin_cascade/__init__.py | __version__ = "0.4.0"
| Python | 0 | @@ -12,11 +12,11 @@
= %220.4.
-0
+1
%22%0A
|
59b8ae5f17e556c09ef8592723f9c684843c7dcc | update function and comment | code/utils/outlierfunction.py | code/utils/outlierfunction.py |
# find outliers based on DVARS and FD
def outlier(data, bound):
'''
Input:
data: array of values
bound: threshold for outliers
Output:
indices of outliers
'''
outlier = []
# set outlier values to 0
for i in data:
if i <= bound:
outlier.appen... | Python | 0 | @@ -226,16 +226,19 @@
# set
+non
outlier
@@ -248,16 +248,37 @@
ues to 0
+, outliers to nonzero
%0A for
|
b0f7e70e29783de6980006be92bc105287b3b5c3 | Remove dependency on not-yet-added [] library Change on 2014/01/24 by mgainer <mgainer@google.com> ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=60226626 | coursebuilder/main.py | coursebuilder/main.py | # Copyright 2013 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 by applicable law or ... | Python | 0 | @@ -1196,50 +1196,8 @@
ard%0A
-import modules.mapreduce.mapreduce_module%0A
impo
@@ -1894,70 +1894,8 @@
e()%0A
-modules.mapreduce.mapreduce_module.register_module().enable()%0A
modu
|
81286b8912f2061a8a7e98d2ac87379e5237cb20 | Fix chdir argument to be 'path' | lib/ansible/modules/extras/system/make.py | lib/ansible/modules/extras/system/make.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Linus Unnebäck <linus@folkdatorn.se>
#
# This file is part of Ansible
#
# This module 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 ... | Python | 0.013779 | @@ -2856,35 +2856,36 @@
ult=None, type='
-str
+path
'),%0A ),%0A
|
270c8ca68357f92999474fbf110fed7b01cdfdf2 | Use proper way to access package resources. | cqlengine/__init__.py | cqlengine/__init__.py | import os
from cqlengine.columns import *
from cqlengine.functions import *
from cqlengine.models import Model
from cqlengine.query import BatchQuery
__cqlengine_version_path__ = os.path.realpath(__file__ + '/../VERSION')
__version__ = open(__cqlengine_version_path__, 'r').readline().strip()
# compaction
SizeTieredC... | Python | 0 | @@ -2,16 +2,37 @@
mport os
+%0Aimport pkg_resources
%0A%0Afrom c
@@ -166,16 +166,17 @@
hQuery%0A%0A
+%0A
__cqleng
@@ -200,41 +200,115 @@
_ =
-os.path.realpath(__file__ + '/../
+pkg_resources.resource_filename('cqlengine',%0A '
VERS
|
5584ec8c6aa8e6567b3ddd286c1c7305fad070a3 | fix init | cryptotik/__init__.py | cryptotik/__init__.py |
from cryptotik.poloniex import Poloniex
from cryptotik.bittrex import Bittrex
from cryptotik.btce import Btce
from cryptotik.therock import TheRock
from cryptotik.livecoin import Livecoin
<<<<<<< HEAD
from cryptotik.okcoin import OKcoin
=======
from cryptotik.hitbtc import Hitbtc
>>>>>>> 7e948ea7ab42a9ad57d9ec12595399... | Python | 0.024288 | @@ -186,21 +186,8 @@
oin%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A
from
@@ -222,16 +222,8 @@
oin%0A
-=======%0A
from
@@ -258,53 +258,4 @@
btc%0A
-%3E%3E%3E%3E%3E%3E%3E 7e948ea7ab42a9ad57d9ec1259539995ff34fb34%0A
|
35cc2bce4e5fb62083ec1a44bda85c2da064d119 | Remove debug print statements | cs251tk/specs/load.py | cs251tk/specs/load.py | from logging import warning
from glob import iglob
import json
import os
import shutil
import sys
from .cache import cache_specs
from .dirs import get_specs_dir
def load_all_specs(*, basedir=get_specs_dir()):
os.makedirs(basedir, exist_ok=True)
# the repo has a /specs folder
basedir = os.path.join(based... | Python | 0.000003 | @@ -83,19 +83,8 @@
util
-%0Aimport sys
%0A%0Afr
@@ -1552,16 +1552,77 @@
ment'%5D%0A%0A
+ # Ask if user wants to re-cache specs to fix discrepancy%0A
if n
@@ -1739,81 +1739,8 @@
e))%0A
- # warning(%22Re-caching specs%5Cn%22)%0A # print(file=sys.stderr)%0A
|
096d3c44a60c83820410a85cd6a56f20b13b9ccd | 更新 API Infor, 使用新格式改寫 users_total_count API 的回應 | commonrepo/infor_api/views.py | commonrepo/infor_api/views.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from rest_framework import permissions
from rest_framework import renderers
from rest_framework import status
from rest_framework import viewsets
f... | Python | 0 | @@ -1218,20 +1218,16 @@
REQUEST)
-
%0A%0A# User
@@ -1341,119 +1341,429 @@
e(%7B%22
-total_users%22: User.objects.all().count() %7D, status=status.HTTP_202_ACCEPTED)%0A else:%0A return Response(
+code%22: 202, %0A %22status%22: %22ok%22,%0A %22result%22: %... |
98e52a8c603346a03b2e5a6197ce2cb49af86f2c | Cut uselessness codes | complexism/multimodel/mmrt.py | complexism/multimodel/mmrt.py | import networkx as nx
from complexism.misc.counter import count
from complexism.mcore import *
from .entries import RelationEntry
__author__ = 'TimeWz667'
__all__ = ['ObsMultiModel', 'MultiModel']
class ObsMultiModel(Observer):
def __init__(self):
Observer.__init__(self)
self.ObservingModels = l... | Python | 0 | @@ -2827,307 +2827,12 @@
-for k, model in self.all_models().items():%0A for req in model.Next:%0A self.Requests.append_request(req.up_scale(self.Name))%0A self.Requests.append_event(req.Event, k, self.Name)%0A# self.Requests.append_requests(%5Breq.up_scale(k) fo... |
6e35e4f5af341bbcda050434d86fd7e4712ebd0f | Update JGit to get PackInserter fix | lib/jgit/jgit.bzl | lib/jgit/jgit.bzl | load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_LOCAL", "MAVEN_CENTRAL", "maven_jar")
_JGIT_VERS = "4.9.2.201712150930-r"
_DOC_VERS = _JGIT_VERS # Set to _JGIT_VERS unless using a snapshot
JGIT_DOC_URL = "http://download.eclipse.org/jgit/site/" + _DOC_VERS + "/apidocs"
_JGIT_REPO = MAVEN_CENTRAL # Leave here e... | Python | 0 | @@ -117,16 +117,29 @@
150930-r
+.3-g43ef5dabf
%22%0A%0A_DOC_
@@ -145,26 +145,38 @@
_VERS =
-_JGIT_VERS
+%224.9.2.201712150930-r%22
# Set
@@ -309,29 +309,22 @@
_REPO =
-MAVEN_CENTRAL
+GERRIT
# Leav
@@ -800,111 +800,111 @@
= %22
-a3a2d1df793245ebfc7322db3c2b9828ee184850%22,%0A src_sha1 = %22afa9a25e... |
8ec01cf71db0431c5da5283775e96b73614be8df | test ip | config/settings/production.py | config/settings/production.py | # -*- coding: utf-8 -*-
'''
Production Configurations
- Use djangosecure
- Use Amazon's S3 for storing static files and uploaded media
- Use mailgun to send emails
- Use Redis on Heroku
'''
from __future__ import absolute_import, unicode_literals
from boto.s3.connection import OrdinaryCallingFormat
from django.utils... | Python | 0.000009 | @@ -2022,14 +2022,15 @@
199.
-158.90
+253.141
'%5D%0A#
|
eaefc28fc4b3af73163fb5c93c8a83121758e36a | test disable whitenoise storage | config/settings/production.py | config/settings/production.py | # -*- coding: utf-8 -*-
'''
Production Configurations
- Use djangosecure
- Use Amazon's S3 for storing static files and uploaded media
- Use mailgun to send emails
- Use Redis on Heroku
'''
from __future__ import absolute_import, unicode_literals
import os
import json
from urllib.parse import urlparse
from boto.s3.c... | Python | 0 | @@ -2703,16 +2703,17 @@
-------%0A
+#
STATICFI
|
6a5729d566a6e75c97b67a544dd7aed9c857e6de | update attachment attributes | data_center/models.py | data_center/models.py | # -*- coding: utf-8 -*-
from datetime import datetime
from django.db import models
class Course(models.Model):
"""Course database schema"""
no = models.CharField(max_length=20, blank=True)
code = models.CharField(max_length=20, blank=True)
eng_title = models.CharField(max_length=200, blank=True)
... | Python | 0.000001 | @@ -77,16 +77,162 @@
models%0A
+from django.utils.http import urlquote%0A%0Aattachment_url_format = 'https://www.ccxp.nthu.edu.tw/ccxp/INQUIRE/JH/output/6_6.1_6.1.12/%25s.pdf' # noqa%0A
%0A%0Aclass
@@ -1201,54 +1201,223 @@
ext%0A
-%0A def __str__(self):%0A return self.no
+ has_attachment = models.Boo... |
00dec661c39437e2fd031328431ab59ca428aaf3 | Fix deprecation warning regarding BaseException.message | linkedin/utils.py | linkedin/utils.py | # -*- coding: utf-8 -*-
import requests
from .exceptions import LinkedInError, get_exception_for_error_code
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
import simplejson as json
except ImportError:
try:
from django.utils import simplejson as json
... | Python | 0.000013 | @@ -1698,29 +1698,26 @@
error',
+str(
error
-.message
+)
),%0A
|
7210d1d7840fb9190d616e1a59af6e9619f93835 | Add VoiceCloseReasons | litecord/enums.py | litecord/enums.py | """
enums.py - Various Enums used by litecord
"""
class OP:
"""Gateway OP codes."""
DISPATCH = 0
HEARTBEAT = 1
IDENTIFY = 2
STATUS_UPDATE = 3
VOICE_STATE_UPDATE = 4
VOICE_SERVER_PING = 5
RESUME = 6
RECONNECT = 7
REQUEST_GUILD_MEMBERS = 8
INVALID_SESSION = 9
HELLO = 10
... | Python | 0.000001 | @@ -1835,16 +1835,710 @@
= 4016%0A%0A
+VoiceCloseReasons = %7B%0A VoiceWSCloseCodes.UNKNOWN_OP: 'Unknown OP code sent',%0A VoiceWSCloseCodes.NOT_AUTH: 'Not authenticated..',%0A VoiceWSCloseCodes.AUTH_FAILED: 'Authentication failed',%0A VoiceWSCloseCodes.ALREADY_AUTH: 'Already Authenticated',%0A VoiceWSC... |
17028a6ae567e9d67dbaa99b86a956fefdd3e792 | fix pynotify | livereload/app.py | livereload/app.py | import os
import logging
import tornado.web
import tornado.options
import tornado.ioloop
from tornado import escape
from tornado import websocket
from tornado.util import ObjectDict
from livereload.task import Task
ROOT = os.path.abspath(os.path.dirname(__file__))
STATIC_PATH = os.path.join(ROOT, 'static')
NOTIFIER ... | Python | 0.000031 | @@ -932,16 +932,35 @@
fy.init(
+'Python LiveReload'
)%0A re
|
004c9c11441f59590121a5428fce29ccde3f7694 | Fix error with keyword argument | mesh_utils.py | mesh_utils.py | # ##### BEGIN GPL LICENSE BLOCK #####
#
# Booltron super add-on for super fast booleans.
# Copyright (C) 2014-2019 Mikhail Rachinskiy
#
# 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, eith... | Python | 0.000017 | @@ -2738,17 +2738,28 @@
_method=
-3
+%22SHORT_EDGE%22
)%0A%0A
|
36e8335bc146e4eda6801b2c148410c3ea620ae5 | Update scipy.py | wigs/scipy.py | wigs/scipy.py | class scipy(PythonWig):
tarball_uri = 'https://github.com/scipy/scipy/releases/download/v$RELEASE_VERSION$/scipy-$RELEASE_VERSION$.tar.gz'
last_release_version = 'v0.18.1'
git_uri = 'https://github.com/scipy/scipy'
dependencies = ['numpy']
| Python | 0.000002 | @@ -237,8 +237,580 @@
numpy'%5D%0A
+%0A%09optional_dependencies = %5B'openblas'%5D%0A%09supported_features = %5B'openblas'%5D%0A%09default_features = %5B'+openblas'%5D%0A%0A%09def setup(self):%0A%09%09self.site_cfg = %5B%5D%0A%0A%09def switch_openblas_on(self):%0A%09%09self.require('openblas')%0A%09%09include_dirs = m... |
374c386a6b2dd1ad1ba75ba70009de6c7ee3c3fc | Add process_request method to Application | restalchemy/api/applications.py | restalchemy/api/applications.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2014 Eugene Frolov <eugene@frolov.net.ru>
#
# 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
#
# ... | Python | 0.000002 | @@ -1096,16 +1096,95 @@
lass))%0A%0A
+ def process_request(self, req):%0A return self._main_route(req).do()%0A%0A
@dec
@@ -1240,36 +1240,35 @@
rn self.
-_main_route(req).do(
+process_request(req
)%0A%0A%0AAppl
|
846f9bbb0214d2dadea5be233189b3384e8c2ee4 | set app_label on models | restclients/models/wheniwork.py | restclients/models/wheniwork.py | from django.db import models
from datetime import time
class Account(models.Model):
id = models.PositiveIntegerField(primary_key=True)
master = models.ForeignKey('self')
company = models.CharField(max_length=500)
class Meta:
db_table = "restclients_wheniwork_account"
class User(models.Model... | Python | 0.000001 | @@ -288,16 +288,50 @@
ccount%22%0A
+ app_label = 'restclients'%0A
%0A%0Aclass
@@ -711,16 +711,50 @@
k_user%22%0A
+ app_label = 'restclients'%0A
%0A%0Aclass
@@ -999,24 +999,58 @@
k_location%22%0A
+ app_label = 'restclients'%0A
%0A%0Aclass Posi
@@ -1248,16 +1248,50 @@
sition%22%0A
+ a... |
b7e8af6ef92c0244bd5121c528e3e85441b0d835 | Disable test/mac/gyptest-objc-gc.py when using Xcode 5.1 | test/mac/gyptest-objc-gc.py | test/mac/gyptest-objc-gc.py | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that GC objc settings are handled correctly.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
# set |match| to i... | Python | 0.00004 | @@ -250,16 +250,31 @@
TestGyp
+%0Aimport TestMac
%0A%0Aimport
@@ -469,16 +469,167 @@
True)%0A%0A
+ # Xcode 5.1 removed support for garbage-collection:%0A # error: garbage collection is no longer supported%0A if TestMac.Xcode.Version() %3C '0510':%0A%0A
CHDIR
@@ -642,16 +642,18 @@
c-gc'%0A
+
+
test... |
197f8e77257dda2a21fd401ad1dc4a3073586434 | Allow to use an environment variable if hue not found | installCGSapps.py | installCGSapps.py | #!/usr/bin/python
__author__ = 'CGS'
import os, shutil, sys, distutils.core, subprocess
# Some configuration needed for this file
apps_directory = ""
apps = {"calculator": "apps/calculator"}
# TODO: better management of errors
# Some basic checks
if not 'SUDO_UID' in os.environ.keys():
sys.exit("This program req... | Python | 0.000003 | @@ -1092,16 +1092,137 @@
b/hue%22%0A%0A
+if not os.path.exists(hue_directory) and %22HUE_DIRECTORY%22 in os.environ:%0A hue_directory = os.environ%5B%22HUE_DIRECTORY%22%5D%0A%0A
if os.pa
@@ -1612,21 +1612,16 @@
the hue
-apps
director
@@ -1634,86 +1634,64 @@
ase
-edit the variable 'hue_directory'%22%0A ... |
da557b0b26d144095988a8809a97b83791077f20 | fix number | biblioteca/views.py | biblioteca/views.py | from django.shortcuts import render
from .models import Temas, Biblioteca
from django.shortcuts import get_object_or_404
from django.db.models import Q
# Create your views here.
def index(request,template='biblioteca/index.html',slug=None):
temas = Temas.objects.all()
ultimas_guias = Biblioteca.objects.filter(tipo_d... | Python | 0.000047 | @@ -349,9 +349,10 @@
')%5B:
-6
+12
%5D%0A%0A%09
|
1412c1a15f4b8b09beb4b7eb4b3245eaeb343a14 | Bump sleep time for Github API reader | src/api_readers/github_daemon.py | src/api_readers/github_daemon.py | from api_reader_daemon import APIReaderDaemon
import datetime
import time
from models import GithubRepo
from models import GithubRepoEvent
from github import Github
class GithubReaderDaemon(APIReaderDaemon):
def __init__(self, **kwargs):
# neh. don't need it.
pass
def start(self):
whi... | Python | 0 | @@ -1210,17 +1210,18 @@
e.sleep(
-6
+12
0)%0A%0A
|
d01430e40d923fdced0d753822a1f62fe69a916e | add analytics folder to path | bigbang/__init__.py | bigbang/__init__.py | Python | 0.000001 | @@ -0,0 +1,23 @@
+from . import analysis%0A
| |
17147f02abdb50f6df6398c8c3c750d858c1c758 | fix docs | doc/ext/nova_autodoc.py | doc/ext/nova_autodoc.py | import gettext
import os
gettext.install('nova')
from nova import utils
def setup(app):
rootdir = os.path.abspath(app.srcdir + '/..')
print "**Autodocumenting from %s" % rootdir
rv = utils.execute('cd %s && ./generate_autodoc_index.sh' % rootdir)
print rv[0]
| Python | 0.000008 | @@ -182,16 +182,38 @@
rootdir%0A
+ os.chdir(rootdir)%0A
rv =
@@ -232,17 +232,8 @@
te('
-cd %25s &&
./ge
@@ -256,26 +256,16 @@
ndex.sh'
- %25 rootdir
)%0A pr
|
d72a1dde759e4993f7c75764fd36668192b387e5 | Clean up middleware code | middleware.py | middleware.py | from mixcloud.speedbar.modules.base import RequestTrace
from django.utils.encoding import smart_unicode, smart_str
from django.utils.html import escapejs
from django.core.urlresolvers import reverse
from gargoyle import gargoyle
import re
HTML_TYPES = ('text/html', 'application/xhtml+xml')
METRIC_PLACEHOLDER_RE = ... | Python | 0.001611 | @@ -682,91 +682,8 @@
e()%0A
-%0A def sanitize(string):%0A return string.title().replace(' ','-')%0A%0A
@@ -779,24 +779,25 @@
tems())%0A
+%0A
for modu
@@ -792,195 +792,52 @@
-for module, module_values in metrics.items():%0A for key, value in module_values.items():%0A... |
231358916869a2986696a7bbcf08530404d655e7 | Prepend account IDs to generate user configs | euca2ools/commands/iam/createaccesskey.py | euca2ools/commands/iam/createaccesskey.py | # Copyright 2009-2015 Eucalyptus Systems, Inc.
#
# 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 code must retain the above copyright notice,
# this list of conditions ... | Python | 0 | @@ -3912,32 +3912,39 @@
+region_
section = 'regio
@@ -4015,32 +4015,39 @@
ile.add_section(
+region_
section)%0A
@@ -4328,32 +4328,39 @@
configfile.set(
+region_
section, '%7B0%7D-ur
@@ -4382,14 +4382,50 @@
ce),
+%0A
url)%0A
+%0A
@@ -4436,36 +4436... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.