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 |
|---|---|---|---|---|---|---|---|
a58a31a6037babdc607593196da2841f13791bfa | Revert "去掉camelcase和underscore的转换, 直接用三方的" | railguns/utils/text.py | railguns/utils/text.py | Python | 0 | @@ -0,0 +1,942 @@
+%22%22%22%0Ahttps://github.com/tomchristie/django-rest-framework/issues/944%0A%22%22%22%0Aimport re%0A%0A%0Afirst_cap_re = re.compile('(.)(%5BA-Z%5D%5Ba-z%5D+)')%0Aall_cap_re = re.compile('(%5Ba-z0-9%5D)(%5BA-Z%5D)')%0A%0A%0Adef camelcase_to_underscore(name):%0A s1 = first_cap_re.sub(r'%5C1_%5C2',... | |
cd727a5e17cabcc4ee03f2973775f30b7c8b5a26 | add terrible copypasta'd watchdog-using piece of shit for test running | tasks.py | tasks.py | import sys
import time
from invocations.docs import docs, www
from invocations.testing import test, coverage
from invocations.packaging import vendorize, release
from invoke import ctask as task, Collection, Context
@task(help=test.help)
def integration(c, module=None, runner=None, opts=None):
"""
Run the i... | Python | 0 | @@ -1100,16 +1100,21 @@
ef watch
+_docs
(c):%0A
@@ -2712,16 +2712,962 @@
join()%0A%0A
+ %0A@task%0Adef watch_tests(c, module=None):%0A %22%22%22%0A Watch source tree and test tree for changes, rerunning tests as necessary.%0A %22%22%22%0A try:%0A from watchdog.observers import Observer%0A ... |
a723c70a0ae9da0f2207dd9278c619be323bda4a | move test parts to avnav_test | avnav_test/avn_debug.py | avnav_test/avn_debug.py | Python | 0 | @@ -0,0 +1,187 @@
+import sys%0Asys.path.append(r'/home/pi/avnav/pydev')%0Aimport pydevd%0Afrom avnav_server import *%0Apydevd.settrace(host='10.222.10.45',stdoutToServer=True, stderrToServer=True)%0A%0Amain(sys.argv)%0A
| |
aa1b39b455f7145848c287ee9ee85507f5b66de0 | Add Meduza | collector/rss/meduza.py | collector/rss/meduza.py | Python | 0 | @@ -0,0 +1,828 @@
+# coding=utf-8%0Aimport feedparser%0Aimport logging%0A%0Afrom util import date, tags%0A%0ASOURCE_NAME = 'Meduza'%0AFEED_URL = 'https://meduza.io/rss/all'%0A%0Alog = logging.getLogger('app')%0A%0A%0Adef parse():%0A feed = feedparser.parse(FEED_URL)%0A data = %5B%5D%0A%0A for entry in feed%5B'... | |
d50814603217ca9ea47324a0ad516ce7418bc9bf | Add script to generate a standalone timeline view. | build/generate_standalone_timeline_view.py | build/generate_standalone_timeline_view.py | Python | 0.999893 | @@ -0,0 +1,2521 @@
+#!/usr/bin/env python%0A# Copyright (c) 2012 The Chromium Authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0Aimport optparse%0Aimport parse_deps%0Aimport sys%0Aimport os%0A%0Asrcdir = os.path.abspath(os.path.join(... | |
f6ef8e0c31163f95fa0c62873a7195ab51f65cf1 | Add cw_are_they_the_same.py | cw_are_they_the_same.py | cw_are_they_the_same.py | Python | 0.01265 | @@ -0,0 +1,1754 @@
+%22%22%22Codewars: Are they the %22same%22?%0A6 kyu%0A%0AURL: https://www.codewars.com/kata/550498447451fbbd7600041c%0A%0AGiven two arrays a and b write a function comp(a, b) (compSame(a, b) in Clojure)%0Athat checks whether the two arrays have the %22same%22 elements, with the same%0Amultiplicities... | |
64ea416a335d9c1a8946411c2b3b1a67cd450131 | Add first pass at reconstructed targets module. | vizard/targets.py | vizard/targets.py | Python | 0 | @@ -0,0 +1,1621 @@
+import viz%0Aimport vizact%0Aimport vizshape%0A%0Aimport vrlab%0A%0A%0Aclass Target:%0A '''A target is a single cube in the motion-capture space.%0A%0A Subjects are tasked with touching the cubes during the experiment.%0A '''%0A%0A def __init__(self, index, x, y, z):%0A self.cente... | |
f1f57561c4ebb5a374b168cd5e6274cbb854611d | change except lines | wakatime/queue.py | wakatime/queue.py | # -*- coding: utf-8 -*-
"""
wakatime.queue
~~~~~~~~~~~~~~
Queue for offline time logging.
http://wakatime.com
:copyright: (c) 2014 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
import logging
import os
import sqlite3
import traceback
from time import sleep
log = logging.ge... | Python | 0.000137 | @@ -1505,35 +1505,32 @@
pt sqlite3.Error
-, e
:%0A lo
@@ -1541,13 +1541,29 @@
ror(
-s
tr
+aceback.format_exc
(
-e
))%0A%0A
@@ -1711,35 +1711,32 @@
pt sqlite3.Error
-, e
:%0A lo
@@ -3354,35 +3354,32 @@
pt sqlite3.Error
-, e
:%0A
@@ -3539,11 +3539,8 @@
rror
-, e
:%0A
|
58626e757b463f2aec6751e04fbaf0e83cf0adf9 | Create Bigram.py | src/3-trained-classifier/Bigram.py | src/3-trained-classifier/Bigram.py | Python | 0.000001 | @@ -0,0 +1,2090 @@
+__author__ = 'Atef Bellaaj'%0A__author__ = 'Bellaaj'%0Aimport collections%0Aimport nltk.metrics%0Aimport nltk.classify.util%0Afrom nltk.classify import NaiveBayesClassifier%0Afrom nltk.corpus import movie_reviews%0Aneg_ids = movie_reviews.fileids('neg')%0Apos_ids = movie_reviews.fileids('pos')%0A%0A... | |
ad0a1c1404c53f1565ef728a747d5d5f319f1992 | Add tests for Enterprise | auth0/v2/test/authentication/test_enterprise.py | auth0/v2/test/authentication/test_enterprise.py | Python | 0 | @@ -0,0 +1,766 @@
+import unittest%0Aimport mock%0Afrom ...authentication.enterprise import Enterprise%0A%0A%0Aclass TestEnterprise(unittest.TestCase):%0A%0A @mock.patch('auth0.v2.authentication.enterprise.Enterprise.get')%0A def test_saml_metadata(self, mock_get):%0A%0A e = Enterprise('my.domain.com')%0A%... | |
8780243a88f505c06962247fdcc6e4bc4abb2912 | add prototype at python | prototype.py | prototype.py | Python | 0 | @@ -0,0 +1,832 @@
+#!/usr/bin/env python%0Aimport copy%0A%0A%0Aclass Manager:%0A def __init__(self):%0A self.showcase = %7B%7D%0A%0A def register(self, name, obj):%0A self.showcase%5Bname%5D = obj%0A%0A def clone(self, name):%0A return copy.deepcopy(self.showcase%5Bname%5D)%0A%0A%0Aclass M... | |
f675668813df6d4da48dc2b4df4f9be91e808bae | Add ZEROFILL flag to get_ip_subnets | pytos/common/functions/network.py | pytos/common/functions/network.py |
import logging
import netifaces
import platform
import re
import socket
import struct
from functools import lru_cache
import dns
from dns import reversename, resolver, name
import netaddr
from pytos.common.logging.definitions import COMMON_LOGGER_NAME
logger = logging.getLogger(COMMON_LOGGER_NAME)
IPV4_ADDRESS_REGE... | Python | 0 | @@ -4969,16 +4969,40 @@
, end_ip
+, flags=netaddr.ZEROFILL
))%0A
|
c61452cb7358c3000992e593349158a0e24a5f51 | Add migration | allseasons/convert/migrations/0004_message.py | allseasons/convert/migrations/0004_message.py | Python | 0.000002 | @@ -0,0 +1,1030 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.2 on 2017-07-28 14:05%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('convert', '0003... | |
c68d2492b8dcc6fbd7fc91e784994ef9cf43db0f | Create LORA_Repeater_logger.py | LORA_Repeater/LORA_Repeater_logger.py | LORA_Repeater/LORA_Repeater_logger.py | Python | 0 | @@ -0,0 +1,580 @@
+from datetime import datetime%0A%0ANOME_FILE = %22LORA_LOG.txt%22%0A%0Aimport serial%0Aser = serial.Serial('/dev/ttyACM0', 9600)%0A%0Awhile ser.inWaiting()!=0:%0A trash = ser.readline()%0A%0Awhile(True):%0A%0A while ser.inWaiting()!=0:%0A %0A incoming = ser.readline().decode(%22utf-8%22)... | |
399af52c20a5c490471f8e98c4c72aa6e99466df | fix a import typo | src/diamond/handler/mysql.py | src/diamond/handler/mysql.py | # coding=utf-8
"""
Insert the collected values into a mysql table
"""
from handler import Handler
import MySQLdb
class MySQLHandler(Handler):
"""
Implements the abstract Handler class, sending data to a mysql table
"""
conn = None
def __init__(self, config=None):
"""
Create a ne... | Python | 0.999997 | @@ -70,17 +70,17 @@
%22%0A%0Afrom
-h
+H
andler i
|
0fedbb8def5914b36ca09a59e6718d2d6f04a36a | Revert "Update dict, don't iterate it" | src/diamond/utils/classes.py | src/diamond/utils/classes.py | # coding=utf-8
import configobj
import os
import sys
import logging
import inspect
import traceback
from diamond.util import load_class_from_name
from diamond.collector import Collector
from diamond.handler.Handler import Handler
logger = logging.getLogger('diamond')
def load_include_path(paths):
"""
Scan ... | Python | 0 | @@ -5086,26 +5086,25 @@
-collectors.update(
+for name, cls in
get_
@@ -5130,17 +5130,60 @@
ule(mod)
-)
+:%0A collectors%5Bname%5D = cls
%0A%0A #
|
60c10a781501b0a467b55a599d835bdc760c8891 | Add test_utils | tests/test_utils.py | tests/test_utils.py | Python | 0.000006 | @@ -0,0 +1,1614 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A%22%22%22%0Atest_django-watchman%0A------------%0A%0ATests for %60django-watchman%60 decorators module.%0A%22%22%22%0A%0Afrom __future__ import unicode_literals%0A%0Aimport unittest%0A%0Afrom watchman.utils import get_checks%0A%0A%0Aclass TestWatc... | |
52219c4d55c7b80b4a2185887675615c4d427298 | Add is_sequence util function | lib/ansible/module_utils/common/collections.py | lib/ansible/module_utils/common/collections.py | Python | 0.999999 | @@ -0,0 +1,902 @@
+# Copyright (c), Sviatoslav Sydorenko %3Cssydoren@redhat.com%3E 2018%0A# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)%0A%22%22%22Collection of low-level utility functions.%22%22%22%0A%0Afrom __future__ import absolute_import, division, print... | |
973c2098eec88c9656fe858d4815bd7925d532f6 | add Memento pattern | memento/Memento.py | memento/Memento.py | Python | 0.000001 | @@ -0,0 +1,1665 @@
+#%0A# Python Design Patterns: Memento%0A# Author: Jakub Vojvoda %5Bgithub.com/JakubVojvoda%5D%0A# 2016%0A#%0A# Source code is licensed under MIT License%0A# (for more details see LICENSE)%0A# %0A%0Aimport sys%0A%0A#%0A# Memento%0A# stores internal state of the Originator object and protects%0A# agai... | |
cbbf4ec62bc8b8ed2c375e9e60939f932d2034e8 | Create jogovelha.py | src/jogovelha.py | src/jogovelha.py | Python | 0.000002 | @@ -0,0 +1 @@
+%0A
| |
0e12011edc31f964db8ce419d2f64b6d525be641 | Create delete_occurrences_of_an_element_if_it_occurs_more_than_n_times.py | delete_occurrences_of_an_element_if_it_occurs_more_than_n_times.py | delete_occurrences_of_an_element_if_it_occurs_more_than_n_times.py | Python | 0.00002 | @@ -0,0 +1,313 @@
+#Kunal Gautam%0A#Codewars : @Kunalpod%0A#Problem name: Delete occurrences of an element if it occurs more than n times%0A#Problem level: 6 kyu%0A%0Adef delete_nth(order,max_e):%0A i=0%0A while(i%3Clen(order)):%0A if order%5B:i%5D.count(order%5Bi%5D)%3E=max_e:%0A order.pop(i)%0... | |
06451bdb55faaa7fd22f7bac403d00dda0018c5d | Create setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1193 @@
+from distutils.core import setup%0Afrom setuptools import find_packages%0A%0Asetup(%0A name=%22nhlscrapi%22,%0A %0A version=nhlscrapi.__version__,%0A %0A description='NHL Scrapr API for Python',%0A %0A author='Rob Howley',%0A author_email='howley.robert@gmail.com',%0A url=... | |
f1d277c58f80a352b3715c145ce55a4030a4ab6a | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,315 @@
+#!/usr/bin/env python%0Afrom distutils.core import setup%0A%0Afrom setuptools import find_packages%0A%0Asetup(%0A name='Fake Zato',%0A version='0.1.0',%0A description='Fake Zato',%0A author='Zetaops',%0A author_email='aliriza@zetaops.io',%0A url='https://github.com/zetaops/fake_zato... | |
a262aeda8b706848b33d30353a9f269daf3acb0d | Bump version | setup.py | setup.py | # Copyright (C) 2011-2012 Yaco Sistemas <lgs@yaco.es>
#
# 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 | @@ -801,17 +801,17 @@
n='0.13.
-0
+1
',%0A d
|
9eacc3c3b81002c721cb24a1641583bf49bc3a53 | bump version number | setup.py | setup.py | # setup.py inspired by the PyPA sample project:
# https://github.com/pypa/sampleproject/blob/master/setup.py
from setuptools import setup, find_packages
from codecs import open # To use a consistent encoding
from os import path
def get_long_description():
here = path.abspath(path.dirname(__file__))
... | Python | 0.000001 | @@ -467,15 +467,15 @@
'1.
-3
+4
alpha
-3
+0
', #
|
c99b5e564252aff55f14dd63c9cdef1728026561 | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,370 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport twid%0A%0Afrom setuptools import setup, find_packages%0A%0Asetup(%0A name = %22twid%22,%0A version = twid.__version__,%0A description = %22The relevant functions about Taiwan Identification Card system.%22,%0A author = %22Plenty ... | |
f16a21776eafc7fc373b9c43d5db74cea213c897 | Create SoftwareCategory.py | SoftwareCategory.py | SoftwareCategory.py | Python | 0 | @@ -0,0 +1,1248 @@
+from lxml import etree%0A%0A%0Aclass SoftwareCategory:%0A def __init__(self, parent, category, unlock, scan=False):%0A self.software = category%0A self.feature = unlock%0A if not scan:%0A self.create_software_category(parent, category, unlock)%0A%0A @classmethod... | |
c54bd0cf16891bbc8b82dd2cb2af1455795325a2 | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,834 @@
+import os%0Aimport sys%0Afrom setuptools import setup%0A%0Aexec(open('dsplice/version.py').read())%0A%0Asetup(name='dsplice',%0A version=version,%0A packages=%5B'dsplice'%5D,%0A description='Docker image merge tool',%0A author='Bradley Cicenas',%0A author_email='bradley@vekto... | |
5d9ac40273f9dae541ffa20b8767ae289b743b95 | Add loader calls in main | nose2/main.py | nose2/main.py | import os
from nose2.compat import unittest
from nose2 import loader, session
class PluggableTestProgram(unittest.TestProgram):
sessionClass = session.Session
loaderClass = loader.PluggableTestLoader
# XXX override __init__ to warn that testLoader and testRunner are ignored?
def parseArgs(self, arg... | Python | 0.000001 | @@ -2392,35 +2392,62 @@
nt them%0A
-pas
+self.testNames = args.testName
s%0A%0A def loadP
@@ -2612,20 +2612,204 @@
-pass
+if self.testNames is None:%0A self.test = self.testLoader.loadTestsFromModule(self.module)%0A else:%0A self.test = self.testLoader.loadTestsFromNa... |
3f66dbc15cb0564b22d304e09ed3c0b673d59476 | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,133 @@
+from distutils.core import setup%0A%0Asetup(name='fbmq',%0A version='1.0.1',%0A install_requires=%5B'json', 'requests%3E=2.0'%5D%0A )%0A
| |
a1f17cf4b56edf861c9b650ccd18049ecf168e03 | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1491 @@
+import os%0Aimport re%0A%0Atry:%0A from setuptools import setup%0Aexcept ImportError:%0A from distutils.core import setup%0A%0APACKAGE_NAME = %22humanizepy%22%0A%0AHERE = os.path.abspath(os.path.dirname(__file__))%0Awith open(os.path.join(HERE, %22README.md%22)) as fp:%0A README = fp.read()... | |
92138e7ab37e6a69eb3808f9888b52b9e38deaa0 | remove duplicate classifier | setup.py | setup.py | from distutils.core import setup
from require import __version__
version_str = ".".join(str(n) for n in __version__)
setup(
name = "django-require",
version = version_str,
license = "BSD",
description = "A Django staticfiles post-processor for optimizing with RequireJS.",
author = "Dave Hall",
... | Python | 0.999991 | @@ -1041,50 +1041,8 @@
n%22,%0A
- %22Programming Language :: Python%22,%0A
|
a745bfac07e5efb539c33dcdad2652cc240aec3b | Disable deprecation warnings for SDCH | sdch/sdch.gyp | sdch/sdch.gyp | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
'target_name': 'sdch',
'type': 'static_library',
'dependencies': [... | Python | 0.000005 | @@ -2137,24 +2137,163 @@
cts' %5D %7D %5D,%0A
+ # TODO(mark): Remove usage of the deprecated auto_ptr.%0A %5B 'clang == 1', %7B 'cflags': %5B '-Wno-deprecated-declarations' %5D %7D %5D,%0A
%5D,%0A
|
ac94d2cf9b4ab775fb7a125a83abc4fa59d56136 | Add setuptools build | setup.py | setup.py | Python | 0 | @@ -0,0 +1,546 @@
+from setuptools import setup, find_packages%0Aimport os%0A%0Ahere = os.path.abspath(os.path.dirname(__file__))%0A%0Awith open(os.path.join(here, 'README.md')) as f:%0A long_description = f.read()%0A%0Asetup(%0A name='pyshadowcopy',%0A version='0.0.1',%0A description='Python class to work ... | |
edcf0e371ea3430c7d0c515dbf59e39e3522c076 | Add license information to setup.py | setup.py | setup.py | from distutils.core import setup
import loginurl
setup(name='django-loginurl',
version=loginurl.__version__,
description='Allowing an anonymous user to log in by only visiting a URL',
author='Fajran Iman Rusadi',
author_email='fajran@gmail.com',
url='http://github.com/fajran/django-login... | Python | 0 | @@ -320,16 +320,37 @@
nurl/',%0A
+ license='BSD',%0A
do
|
ef53ea9d1754ce5056b7b872ad0b7cd99e4af2bc | Add setup file | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,723 @@
+# -*- coding: utf-8 -*-%0A%0A%0Aimport re%0Afrom distutils.core import setup%0A%0A%0Aversion = re.search(%0A '%5E__version__%5Cs*=%5C*%22(.*)%22',%0A open('bundigo/bundigo.py').read(),%0A re.M%0A ).group(1)%0A%0A%0Awith open('README.md', 'rb') as f:%0A long_descr = f.read().decode('utf... | |
d9b844db2dc0453c073050c6ce7db18c3d48b57c | add setup.py file | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,914 @@
+import setuptools%0A%0Asetuptools.setup(%0A install_requires=%5B'pyyaml'%5D,%0A author = 'Caleb Boylan',%0A name = 'apt-package-mirror',%0A description = 'Python script for running an apt package mirror',%0A author_email = 'calebboylan@gmail.com',%0A url = 'h... | |
ac2f2b72c1f653f15058b300c82060c90adf146b | Update for 1.3.0 release | setup.py | setup.py | # Importing these adds a 'bdist_mpkg' option that allows building binary
# packages on OS X.
try:
import setuptools
import bdist_mpkg
except ImportError:
pass
import os
import numpy.distutils.core as core
# Configure our C modules that are built with f2py.
tridiag = core.Extension(name = 'dadi.tridiag',
... | Python | 0 | @@ -1092,11 +1092,11 @@
='1.
-2.3
+3.0
',%0A
|
916cdddfa1e861b8402bdda935c2a9c46a5b6566 | Bump version to 1.2. | setup.py | setup.py | import glob
import os
import platform
import subprocess
import sys
from setuptools import setup, Command, Extension
from setuptools.command.test import test as TestCommand
def define_extensions(file_ext):
return [Extension("lightfm.lightfm_fast",
['lightfm/lightfm_fast%s' % file_ext],
... | Python | 0 | @@ -2483,17 +2483,17 @@
sion='1.
-1
+2
',%0A d
@@ -2638,17 +2638,17 @@
rball/1.
-1
+2
',%0A p
|
379488ee2980e1b33753d098d88fb1139a69deeb | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,438 @@
+from setuptools import setup, find_packages%0Asetup(%0A name=%22hs-onliner%22,%0A version=%220.0.1%22,%0A author=%22Firemark & Kytes%22,%0A author_email=%22marpiechula@gmail.com%22,%0A description=%22Site to view who will be in hackerspace every week.%22%0A license=%22MIT%22,%0A ... | |
b63a6ababb1a66ed3766399328c5b9c4ac0a7ce3 | Bump version | setup.py | setup.py | from setuptools import setup
setup(
name="funsize",
version="0.28",
description="Funsize Scheduler",
author="Mozilla Release Engineering",
packages=["funsize"],
include_package_data=True,
# Not zip safe because we have data files in the package
zip_safe=False,
entry_points={
... | Python | 0 | @@ -70,9 +70,9 @@
%220.2
-8
+9
%22,%0A
|
a281bad5905da4710314d657943cc145b7d748d4 | add minimal setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,257 @@
+import setuptools%0A%0Asetuptools.setup(%0A name='tvb-hpc',%0A version='0.0',%0A description='HPC code generation for TVB',%0A author='TVB-HPC Contributors',%0A url='https://github.com/the-virtual-brain/tvb-hpc',%0A packages=setuptools.find_packages(),%0A)%0A
| |
b383fadf43d3fb31d1501c780d4436717cc43776 | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1470 @@
+import os%0Afrom setuptools import setup, find_packages%0A%0Aos.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))%0A%0Asetup(%0A name='django-payline-dotir',%0A version='0.1',%0A author='Mahdi Bornazadeh',%0A author_email='Bornazadeh@gmail.com',%0A descriptio... | |
6bc555b93e09ab18a5778487cf3eb47329e83098 | Set version to our own. | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name="python-instagram",
version="0.8.0",
description="Instagram API client",
license="MIT",
install_requires=["simplejson","httplib2"],
author="Instagram, Inc",
author_email="apidevelopers@instagram.com",
... | Python | 0 | @@ -111,16 +111,22 @@
n=%220.8.0
+powll1
%22,%0A
|
68fac699c5506f80ab727a4c569d8797294584bd | Bump the version number. | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name='hapipy',
version='2.9.0',
description="A python wrapper around HubSpot's APIs",
long_description=open('README.md').read(),
author='HubSpot Dev Team',
author_email='devteam+hapi@hubspot.com',
url='https://github.com/HubSpot/hapi... | Python | 0.000002 | @@ -84,25 +84,25 @@
ersion='2.9.
-0
+1
',%0A descr
|
c1c49b0e1718331663ee109f3417aff97fd23b70 | Add minimal setup.py for RTD | setup.py | setup.py | Python | 0 | @@ -0,0 +1,184 @@
+# Minimal setup.py to get readthedocs working, not recommended for real use%0A%0Afrom distutils.core import setup%0A%0Asetup(name=%22h11%22,%0A version=%220.0.0%22,%0A packages=%5B%22h11%22%5D,%0A )%0A
| |
f34dd8ab047275b8d29366599621443a8bc468c9 | Add launcher script for nbconvert | databaker/databaker_nbconvert.py | databaker/databaker_nbconvert.py | Python | 0 | @@ -0,0 +1,992 @@
+#!/usr/bin/env python%0Aimport os%0Aimport subprocess%0Aimport sys%0A%0A%0Adef main(argv):%0A if len(argv) == 0 or len(argv) %3E 2:%0A print(%22Usage: databaker_process.py %3Cnotebook_file%3E %3Cinput_file%3E%22)%0A print()%0A print(%22%3Cinput_file%3E is optional; it replaces... | |
afe216da917c171ff857de122be64a9b2a7d3e9c | migrate doaj client test from harvester | doajtest/unit/test_api_client.py | doajtest/unit/test_api_client.py | Python | 0 | @@ -0,0 +1,1072 @@
+%22%22%22%0AUnit tests for the DOAJ client%0A%22%22%22%0A%0Afrom unittest import TestCase%0A%0Afrom doajtest.fixtures.journals import JournalFixtureFactory%0Afrom portality.api.v1.client import client as doajclient, models%0Afrom portality.lib import dataobj%0A%0Aclass TestDOAJ(TestCase):%0A def ... | |
fc9dd735c96ae21b4a64286e4c9ebcedc0e1fbca | Add script to subset kerning plist. | subsetKerning.py | subsetKerning.py | Python | 0 | @@ -0,0 +1,2052 @@
+import sys%0Afrom plistlib import writePlist%0Afrom defcon import Font%0A%0A%0A__doc__ = '''%0ASubset kerning in UFO given a list of glyphs provided.%0AWill export new plist files that can be swapped into the UFO.%0A%0AUsage:%0Apython subsetKerning.py subsetList font.ufo%0A'''%0A%0A%0Aclass SubsetKe... | |
35258c9b37997801af05875f04f450050a3e5273 | Create tarea5.py | tareas/tarea5.py | tareas/tarea5.py | Python | 0.000001 | @@ -0,0 +1,1238 @@
+#josue de leon %0A#lista de supermercado%0A%0A#una tupla para las opciones, y una lista para la lista%0Aimport os%0Alista = %5B%5D%0Aopciones = (%221. A%C3%B1adir producto a la lista.%22,%222. Borrar el ultimo producto de la lista.%22,%223. Mostrar toda la lista.%22)%0Acontrol = 1%0Aprint(%22%5Cn%5C... | |
0c4d6491fe89e339e9d9505e6e46e8317e78034a | Add telnet testing script | telnet/telnet.py | telnet/telnet.py | Python | 0.000001 | @@ -0,0 +1,581 @@
+#!/usr/bin/env python3%0Aimport pexpect%0Aimport os, sys, time%0A%0Aip = %22127.0.0.1%22%0Aport = %2210000%22%0Ausername = %22nikitapekin@gmail.com%22%0Apassword = %2212345%22%0A%0Aos.remove('../maildir/.lock')%0A%0Achild = pexpect.spawn('telnet '+ ip + ' ' + port)%0A%0Achild.expect('.%5Cn')%0Achild.... | |
945fe81c4a0f970e57ff7c5a13d8c3aa03df5fc6 | Add function to save/restore environment between configuration checks. | numscons/checkers/new/common.py | numscons/checkers/new/common.py | Python | 0 | @@ -0,0 +1,709 @@
+from copy import deepcopy%0A%0Adef save_and_set(env, opts, keys=None):%0A %22%22%22Put informations from option configuration into a scons environment, and%0A returns the savedkeys given as config opts args.%22%22%22%0A saved_keys = %7B%7D%0A if keys is None:%0A keys = opts.keys()%... | |
207f9f1ed34066c0ed00842cd6287eb6907078f8 | fix NameError in stub functions returning 'a' programmatically call all stub functions using inspect | 0mq/stub_server.py | 0mq/stub_server.py | import argparse
import inspect
import re
import operator
import time
import sys
#
import jsonrpc2_zeromq
import jsonrpc2_zeromq.common
class RPCTestServer(jsonrpc2_zeromq.RPCServer):
def handle_initialize_method(self, M_c, M_r, T, i):
X_L = {}
X_D = [[]]
return M_c, M_r, X_L, X_D
def ... | Python | 0 | @@ -1532,33 +1532,33 @@
%0A return
-s
+a
%0A%0A def handle
@@ -1629,33 +1629,33 @@
%0A return
-s
+a
%0A%0A def handle
@@ -1748,17 +1748,17 @@
return
-s
+a
%0A%0Aif __n
@@ -2103,25 +2103,30 @@
gs.lifetime%0A
+ #
%0A
-
endpoint
@@ -2152,24 +2152,30 @@
:%25s%22 %25 port%0A
+ #%0... |
bef94fea3318c835c1474ebdfe74f89d8251baf9 | add test_cover.py | pylayers/gis/test/test_cover.py | pylayers/gis/test/test_cover.py | Python | 0.000003 | @@ -0,0 +1,1536 @@
+import pylayers.gis.ezone as ez%0Afrom pylayers.gis.gisutil import ent,ext2qt%0Aimport matplotlib.pyplot as plt%0Aimport numpy as np%0Aimport seaborn as sns%0Aimport os%0Aimport smopy%0Afrom cartopy import config%0Aimport cartopy.crs as ccrs%0Afig = plt.figure(figsize=(12,12))%0Awhite = np.zeros((10... | |
1a29e182a196e3fc4fbe00c0db6e22c2619473f3 | Add iOSExtractor test | strings2pot/extractors/ios_test.py | strings2pot/extractors/ios_test.py | Python | 0 | @@ -0,0 +1,2440 @@
+# -*- coding: utf-8 -*-%0A%0Aimport os%0Aimport unittest%0Aimport ios%0A%0Aclass iOSExtractorTest(unittest.TestCase):%0A def setUp(self):%0A self.mock_source_file = 'mock_source_ios.strings'%0A self.mock_destination_file = 'mock_destination_ios.pot'%0A def mock_context_id_gen... | |
90642d734fbdcc3a97693106259c35c25f19d38e | Add problem 1 | problem_1.py | problem_1.py | Python | 0.000022 | @@ -0,0 +1,85 @@
+import sys%0A%0Ahex_string = sys.argv%5B1%5D%0Aprint hex_string.decode('hex').encode('base64')%0A
| |
e19e45f7c6ff68599503c3ee0d6712974a8b4e66 | Document current pycurl exception behavior | tests/error_test.py | tests/error_test.py | Python | 0 | @@ -0,0 +1,1901 @@
+#! /usr/bin/env python%0A# -*- coding: iso-8859-1 -*-%0A# vi:ts=4:et%0A%0Aimport pycurl%0Aimport sys%0Aimport unittest%0A%0Aclass ErrorTest(unittest.TestCase):%0A def setUp(self):%0A self.curl = pycurl.Curl()%0A%0A def tearDown(self):%0A self.curl.close()%0A%0A # error origina... | |
b6500cc5ae48212b7cabefc313b417a42273274b | Add test for parsing the man page | tests/test_parse.py | tests/test_parse.py | Python | 0.000001 | @@ -0,0 +1,1347 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Afrom __future__ import absolute_import%0A%0Aimport unittest%0A%0Aimport mock%0A%0Afrom tldr.parser import parse_page%0A%0A%0Aclass TestParse(unittest.TestCase):%0A def test_parse_page(self):%0A mock_config = %7B%0A 'colors': %... | |
38dee68b15e2daf3c9d6ece845dc561500545258 | Create test_plots.py | tests/test_plots.py | tests/test_plots.py | Python | 0.000104 | @@ -0,0 +1,941 @@
+from test_model import test_add_stressmodel%0Afrom pastas.plots import TrackSolve%0A%0Adef test_plot():%0A ml = test_add_stressmodel()%0A ml.plot()%0A %0Adef test_decomposition():%0A ml = test_add_stressmodel()%0A ml.plots.decomposition(min_ylim_diff=0.1)%0A %0Adef test_results():%0... | |
8a573baabee65bfbd348901e0d1c7828cdadd337 | Add tests for stats.normalize | tests/test_stats.py | tests/test_stats.py | Python | 0.000005 | @@ -0,0 +1,1559 @@
+import numpy as np%0Anp.seterr(all='raise')%0A%0Afrom stats import normalize%0A%0A%0Adef check_normalization_constants(arr, axis):%0A sum = np.log(np.sum(arr, axis=axis))%0A z = normalize(np.log(arr), axis=axis)%5B0%5D%0A%0A zdiff = np.abs(sum - z)%0A if not (zdiff %3C 1e-8).all():%0A ... | |
88f6c8c3657cba81c65da34a7161c860c8a23c5f | add RPC test for InvalidateBlock | qa/rpc-tests/invalidateblock.py | qa/rpc-tests/invalidateblock.py | Python | 0 | @@ -0,0 +1,1872 @@
+#!/usr/bin/env python2%0A# Copyright (c) 2014 The Bitcoin Core developers%0A# Distributed under the MIT software license, see the accompanying%0A# file COPYING or http://www.opensource.org/licenses/mit-license.php.%0A%0A#%0A# Test InvalidateBlock code%0A#%0A%0Afrom test_framework import BitcoinTestF... | |
d8b89170d98d200d3538a6435159f561aa888015 | Update forward compatibility horizon to 2018-12-03 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow 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 applica... | Python | 0 | @@ -1320,17 +1320,17 @@
18, 12,
-2
+3
)%0A%0A%0A@tf_
|
fadac460052cb1a778bf8398879e1cb616c26228 | Add new migration for Django 1.8 | propaganda/migrations/0002_auto_20150802_1841.py | propaganda/migrations/0002_auto_20150802_1841.py | Python | 0 | @@ -0,0 +1,434 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('propaganda', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterField(%0A ... | |
9a608da83605d162be891e69db903f581ca9566b | Update forward compatibility horizon to 2018-11-15 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow 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 applica... | Python | 0 | @@ -1143,9 +1143,9 @@
1, 1
-4
+5
)%0A%0A%0A
|
2a0e004358f13d6ebe936ceab1b5e7d147606583 | Update forward compatibility horizon to 2018-11-16 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow 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 applica... | Python | 0 | @@ -1143,9 +1143,9 @@
1, 1
-5
+6
)%0A%0A%0A
|
e853fd96f14b9331a25171fc435eea3ec829e9ef | Update forward compatibility horizon to 2020-04-06 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow 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 applica... | Python | 0.000001 | @@ -1382,17 +1382,17 @@
020, 4,
-5
+6
)%0A_FORWA
|
9747ab1249a159857c5fb7d59fdb6a6225121964 | Remove the '",' that shows up in the install instructions. | tensorflow/tools/docs/generate2.py | tensorflow/tools/docs/generate2.py | # Copyright 2018 The TensorFlow 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 applica... | Python | 0.99994 | @@ -2237,18 +2237,16 @@
version%7D
-%22,
%0A%60%60%60%0A%22%22%22
|
b29417d3b387c8ab62c1e09589c2d93dae905993 | Add skeleton tle.api | tle/api.py | tle/api.py | Python | 0.000069 | @@ -0,0 +1,2394 @@
+import json%0Aimport logging%0Aimport bottle%0Aimport functools%0A%0Afrom paste import httpserver%0Afrom paste.translogger import TransLogger%0A%0Afrom collections import OrderedDict%0A%0Alog = logging.getLogger(__name__)%0A%0Aclass APILogger(TransLogger):%0A def write_log(%0A self,%0A ... | |
b042675463c34340d4d3ae5d6868b243abf9741b | Create Average_sorting.py | Average_sorting.py | Average_sorting.py | Python | 0.000001 | @@ -0,0 +1,1713 @@
+# coding: utf-8%0Aimport rw%0A%0Asuccess_list=%5B%5D #Meet the requirements of the combined group%0Amax_min=%5B%5D #Max ad min volue save var;%5Bfunction_name : max_min_mark%5D%0A%0Adef count(x,y):%0A result=x+y%0A return result%0A%0Adef count_list(x,y):%0A total=count(len(x),len(y))%0A ... | |
4cab21fb6ed217ad4a83c4d6943266845c087d88 | Make tests work with Python 2 | test_seleniumrequests.py | test_seleniumrequests.py | import json
import socket
import threading
from seleniumrequests import Firefox
from seleniumrequests.request import get_unused_port
from six.moves import BaseHTTPServer, http_cookies
import requests
import six
class EchoHeaderRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
# Py... | Python | 0.000878 | @@ -207,16 +207,37 @@
t six%0A%0A%0A
+ENCODING = 'UTF-8'%0A%0A%0A
class Ec
@@ -2219,16 +2219,25 @@
t()%0A%0A
+ thread =
threadi
@@ -2272,22 +2272,146 @@
ests
-, daemon=True)
+)%0A%0A # Set daemon attribute after instantiating thread object to stay compatible%0A # with Python 2%0A thread.daemon = True%... |
1136824ab60dbb8774ba5cb8d011e898f9286e06 | Add a missing file | reviewboard/admin/validation.py | reviewboard/admin/validation.py | Python | 0 | @@ -0,0 +1,1001 @@
+from django import forms%0A%0A%0Adef validate_bug_tracker(input_url):%0A %22%22%22%0A Validates that an issue tracker URI string contains one %60%25s%60 Python format%0A specification type (no other types are supported).%0A %22%22%22%0A try:%0A # Ignore escaped %60%25%60's%0A ... | |
298d3e352193e574e0c8980e37a50d226552109e | Create conf.py | docs/conf.py | docs/conf.py | Python | 0.000001 | @@ -0,0 +1,248 @@
+extensions = %5B%0A 'sphinx.ext.autodoc',%0A 'sphinx.ext.intersphinx',%0A 'sphinx.ext.todo',%0A 'sphinx.ext.coverage',%0A 'sphinx.ext.viewcode',%0A 'repoze.sphinx.autointerface',%0A 'sphinxcontrib.programoutput',%0A 'sphinxcontrib.images',%0A%5D%0A
| |
acdb13c3680b7958f9a1def3e538ef9ebd166922 | add migration for org name + apptext | portal/migrations/versions/9b1bedfa916b_.py | portal/migrations/versions/9b1bedfa916b_.py | Python | 0.000001 | @@ -0,0 +1,1110 @@
+from alembic import op%0Aimport sqlalchemy as sa%0Afrom sqlalchemy.orm import sessionmaker%0A%0Afrom portal.models.app_text import AppText%0Afrom portal.models.organization import Organization%0A%0A%22%22%22empty message%0A%0ARevision ID: 9b1bedfa916b%0ARevises: 441185240f62%0ACreate Date: 2017-10-2... | |
4ce5e57b882ae057fa21d0397925512073447b77 | Add admin interface | chunked_upload/admin.py | chunked_upload/admin.py | Python | 0.000001 | @@ -0,0 +1,302 @@
+from django.contrib import admin%0Afrom .models import ChunkedUpload%0A%0A%0A%0Aclass ChunkedUploadAdmin(admin.ModelAdmin):%0A list_display = ('upload_id', 'file', 'filename', 'user', 'offset',%0A 'created_on', 'status', 'completed_on')%0A%0A%0Aadmin.site.register(ChunkedUpload,... | |
1db74fafd5f281053dc82d2d4ff2d24447db8338 | add initial Nose tests | tests/test_connection.py | tests/test_connection.py | Python | 0.000001 | @@ -0,0 +1,1415 @@
+from nose.tools import raises%0Afrom unittest.case import SkipTest%0Afrom urllib2 import urlopen%0Aimport StringIO%0A%0Aimport mock%0Aimport datetime, md5%0A%0Aimport harvestmedia.api.exceptions%0Aimport harvestmedia.api.config%0Aimport harvestmedia.api.client%0A%0Aapi_key = '12345'%0Awebservice_url... | |
a3deadbc54fad13e4e40da143f25ae4b26cf690b | Add missed travis-ci manage.py. | travis-ci/manage.py | travis-ci/manage.py | Python | 0 | @@ -0,0 +1,252 @@
+#!/usr/bin/env python%0Aimport os%0Aimport sys%0A%0Aif __name__ == %22__main__%22:%0A os.environ.setdefault(%22DJANGO_SETTINGS_MODULE%22, %22travis-ci.settings%22)%0A%0A from django.core.management import execute_from_command_line%0A%0A execute_from_command_line(sys.argv)%0A
| |
58a5257505a4ae9d32cf233d059b4350f9494d86 | Create timer.py | timer.py | timer.py | Python | 0.000003 | @@ -0,0 +1,1251 @@
+#%0A# jasoncg%0A# 2015-02-23%0A#%0A# timer.py%0A#%0A# A simple timer supporting the Python %22with%22 statement%0A#%0Aimport time%0A%0A#%0A# Use in a %22with%22 statement:%0A# with timer.Timer():%0A# %09perform_expensive_calculation()%0A# %0A# May also print the current progress:%0A# with timer.Time... | |
d1e568ab1e238586ed914de35ed44dc2231af3d2 | Create version.py | ngboost/version.py | ngboost/version.py | Python | 0.000001 | @@ -0,0 +1,22 @@
+__version__ = %220.2.0%22%0A
| |
b6a6e6a9bf0254f9c79215c98b392b02db53827b | Add wireless module #305 | cme/modules/wireless.py | cme/modules/wireless.py | Python | 0 | @@ -0,0 +1,633 @@
+class CMEModule:%0A%0A name = 'wireless'%0A description = %22Get key of all wireless interfaces%22%0A supported_protocols = %5B'smb'%5D%0A opsec_safe = True%0A multiple_hosts = True%0A%0A def options(self, context, module_options):%0A '''%0A ''' %0A%0A def on_ad... | |
5ad1170c2515fd799acc43e99e35299bbab9cec1 | Add tests for harmonic in 791628c4df60369583474c07d64f1439bd5c19e0 | tests/test_transforms.py | tests/test_transforms.py | Python | 0.000002 | @@ -0,0 +1,431 @@
+%22%22%22 Test for %60yatsm.regression.transforms%60%0A%22%22%22%0Aimport numpy as np%0Aimport patsy%0Aimport py.test%0A%0Afrom yatsm.regression.transforms import harm%0A%0A%0Adef test_harmonic_transform():%0A x = np.arange(735688, 735688 + 100, 1)%0A design = patsy.dmatrix('0 + harm(x, 1)')%0A... | |
3c37704b3b819bee5d441c75a6fd59a64279a0e8 | use unicode.strip instead of string.strip of the string module for metadata processors | pelican/readers.py | pelican/readers.py | # -*- coding: utf-8 -*-
try:
from docutils import core
# import the directives to have pygments support
from pelican import rstdirectives
except ImportError:
core = False
try:
from markdown import Markdown
except ImportError:
Markdown = False
import re
import string
from pelican.utils import g... | Python | 0.000001 | @@ -274,22 +274,8 @@
t re
-%0Aimport string
%0A%0Afr
@@ -367,22 +367,23 @@
x: map(
-string
+unicode
.strip,
@@ -450,14 +450,15 @@
s':
-string
+unicode
.str
|
2b8afafeda8d576187aee35c19b292febd1cd1cd | use re groups to simplify the patterns | ua2os.py | ua2os.py | """ua to os - from a user agent return operating system, architecture, and browser"""
import sys,splunk.Intersplunk
import re
os_mapping = (
('Windows .. 5.1', 'Windows XP'),
('Windows .. 5.2', 'Windows XP'),
('Windows NT 6.0', 'Windows Vista'),
('Windows 6.0', 'Windows Server 2... | Python | 0 | @@ -380,228 +380,37 @@
10.
-7', 'MAC OS X 10.7.x'),%0A ('OS X 10.6', 'MAC OS X 10.6.x'),%0A ('OS X 10.5', 'MAC OS X 10.5.x'),%0A ('OS X 10.4', 'MAC OS X 10.4.x'),%0A ('OS X 10.3', 'MAC OS X 10.3
+(%5Cd)', 'MAC OS X 10.%25s
.x')
@@ -1249,182 +1249,2... |
0d390edeeb8829c0b8afef090f133d0fee8bce4f | Bump PROVISION_VERSION for latest changes. | version.py | version.py | ZULIP_VERSION = "1.6.0+git"
PROVISION_VERSION = '9.0'
| Python | 0 | @@ -44,11 +44,11 @@
ON = '9.
-0
+1
'%0A
|
59a228312bb3091db8bfb6bf9a75ce4ae47431f4 | Add zero system test to neural net | neuralnets/net_test.py | neuralnets/net_test.py | Python | 0.004377 | @@ -0,0 +1,526 @@
+from net import NeuralNet%0Aimport numpy as np%0A%0A#TODO(Wesley) More tests%0A%0Aclass TestNeuralNet(object):%0A def test_zero_system(self):%0A net = NeuralNet(3, 2, 4, 1, seed=0)%0A net.weights = %5B np.zeros((3,4)),%0A np.zeros((4,4)),%0A ... | |
0a7fb32471fa5ae6e66348527c0ae2f299361211 | Allow to pass extra argument to the Base class initializer | opbeat/handlers/logging.py | opbeat/handlers/logging.py | """
opbeat.handlers.logging
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011-2012 Opbeat
Large portions are
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import datetime
import logging
import sys
import trace... | Python | 0 | @@ -586,19 +586,19 @@
kwargs.
-get
+pop
('client
@@ -665,16 +665,44 @@
args%5B0%5D%0A
+ args = args%5B1:%5D%0A
@@ -1106,17 +1106,21 @@
args
-%5B
+.pop(
'client'
%5D%0A
@@ -1115,17 +1115,17 @@
'client'
-%5D
+)
%0A
@@ -1194,37 +1194,59 @@
-logging.Handler.__init__(self
+super(... |
d97b9f6c508dd24da0f86bc1587ea64708c84a89 | Add parser for the advisory mail recipients. | tools/dist/security/mailinglist.py | tools/dist/security/mailinglist.py | Python | 0.000296 | @@ -0,0 +1,1794 @@
+#%0A# Licensed to the Apache Software Foundation (ASF) under one%0A# or more contributor license agreements. See the NOTICE file%0A# distributed with this work for additional information%0A# regarding copyright ownership. The ASF licenses this file%0A# to you under the Apache License, Version 2.0 ... | |
80a7493e56b1ba6b01bf44f6dd9140de916511a7 | add twisted interface to psycopg2 | pyiem/twistedpg.py | pyiem/twistedpg.py | Python | 0 | @@ -0,0 +1,552 @@
+%22%22%22%0Amodule twistedpg.py%0AAuthor: Federico Di Gregorio%0Ahttp://twistedmatrix.com/pipermail/twisted-python/2006-April/012955.html%0A%22%22%22%0A%0Afrom psycopg2 import *%0Afrom psycopg2 import connect as _2connect%0Afrom psycopg2.extensions import connection as _2connection%0Afrom psycopg2.ex... | |
009182d0c603f9c1f8fa650f6a9771b38a74c6cc | Add a proper validator for disable_builtins | flexget/plugins/plugin_disable_builtins.py | flexget/plugins/plugin_disable_builtins.py | import logging
from flexget import plugin
from flexget.plugin import priority, register_plugin
log = logging.getLogger('builtins')
class PluginDisableBuiltins(object):
"""
Disables all builtin plugins from a feed.
"""
def __init__(self):
self.disabled = []
def validator(self):
... | Python | 0.000064 | @@ -87,16 +87,25 @@
r_plugin
+, plugins
%0A%0Alog =
@@ -136,16 +136,185 @@
ins')%0A%0A%0A
+def all_builtins():%0A %22%22%22Helper function to return an iterator over all builtin plugins.%22%22%22%0A return (plugin for plugin in plugins.itervalues() if plugin.builtin)%0A%0A%0A
class Pl
@@ -349,25 +349,16 @@
... |
98524c4e7c7c4b6e8b51b7fd89501d8ac00e0d8e | generates a hash of the string input | elements/GenerateHashOfString.py | elements/GenerateHashOfString.py | Python | 0.999975 | @@ -0,0 +1,1440 @@
+# coding: utf-8%0Afrom ElementBase import ElementBase%0Afrom ElementParameter import ElementParameter%0Afrom ElementValue import ElementValue%0A%0Aimport hashlib%0A%0Aclass GenerateHashOfString(ElementBase):%0A%09def __init__(self):%0A%09%09self.status = 'running'%0A%09%09self.output = None %0A%09%0... | |
f47482df83a8ab643a55062b12fce11fbd703886 | add 90. The first 100 problems have been solved! Oh~~~~~~~~Yeah | vol2/90.py | vol2/90.py | Python | 0.999935 | @@ -0,0 +1,391 @@
+from itertools import combinations%0A%0Adef valid(c1, c2):%0A return all(x in c1 and y in c2 or x in c2 and y in c1 for x, y in squares)%0A%0Aif __name__ == %22__main__%22:%0A squares = %5B(0,1), (0,4), (0,6), (1,6), (2,5), (3,6), (4,6), (8,1)%5D%0A cube = list(combinations(%5B0,1,2,3,4,5,6,... | |
f4c25b13e2eb1736e47190ad1a2ec66cbe17f2bf | update total_projected_qty in bin.py | erpnext/stock/doctype/bin/bin.py | erpnext/stock/doctype/bin/bin.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, nowdate
import frappe.defaults
from frappe.model.document import Document
class Bin(Document):
def validat... | Python | 0 | @@ -3316,16 +3316,23 @@
d_qty =
+ifnull(
(select
@@ -3381,16 +3381,20 @@
code=%25s)
+, 0)
%0A%09%09where
|
c6cd7d2a310bc0b107e0d2a481260b2e95bac577 | add prime_factors function to utils | utils.py | utils.py | Python | 0.000008 | @@ -0,0 +1,226 @@
+%22Utilities to help solving problems.%22%0A%0Adef prime_factors(num):%0A i = 2%0A while i * i %3C= num:%0A if num %25 i:%0A i += 1%0A else:%0A num //= i%0A yield i%0A if num %3E 1:%0A yield num%0A
| |
6be93bfbaf254234f008e2c714b0aae10434fe68 | add orm | www/orm.py | www/orm.py | Python | 0.000047 | @@ -0,0 +1,1818 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A__author__ = 'Jiayi Li'%0A%0Aimport asyncio, aiomysql, logging%0A%0Adef log(sql, args=()):%0A logging.info('SQL: %25s' %25 sql)%0A%0A# create a connection pool, stored by global variable '__pool'%0Aasync def create_pool(loop, **kw):%0A logg... | |
5b05640a60c66d9d12b9794f2ae55785efe1e099 | Define solidfill. | riot/tags/solidfill.py | riot/tags/solidfill.py | Python | 0.000002 | @@ -0,0 +1,108 @@
+# -*- coding: utf-8 -*-%0A%0Afrom urwid import SolidFill%0A%0Adef parse_tag_from_node(node):%0A return SolidFill()%0A
| |
785f2d3a6d10d8d6ba72712eec29c5be5849f671 | Add build_raw_data.py | fluid/PaddleNLP/text_classification/async_executor/data_generator/build_raw_data.py | fluid/PaddleNLP/text_classification/async_executor/data_generator/build_raw_data.py | Python | 0.000008 | @@ -0,0 +1,1850 @@
+# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LI... | |
f99c8e6e26b85ae7805ff38e4d89978d06e93c97 | Add SQSRequest base class | sqs.py | sqs.py | Python | 0 | @@ -0,0 +1,339 @@
+from tornado.httpclient import AsyncHTTPClient, HTTPRequest, HTTPClient%0Afrom tornado.httputil import url_concat%0Aimport datetime%0Aimport hashlib%0Aimport hmac%0A%0A%0Aclass SQSRequest(HTTPRequest):%0A %22%22%22SQS AWS Adapter for Tornado HTTP request%22%22%22%0A def __init__(self, *args, **... | |
9e2669539c5d7662bb6d6a89877b30235eef1bc2 | Write solution to DEC14 XOR question. | xor.py | xor.py | Python | 0.999905 | @@ -0,0 +1,515 @@
+# http://www.codechef.com/DEC14/problems/XORSUB%0Aimport operator%0Adef f(p):%0A%09if p == %5B%5D:%0A%09%09return 0%0A%09elif len(p) == 1:%0A%09%09return p%5B0%5D%0A%09else:%0A%09%09return reduce(operator.xor, p)%0A%0Adef list_powerset(lst):%0A result = %5B%5B%5D%5D%0A for x in lst:%0A r... | |
135cdb7f16372978774acf06d4da556d0a7a7db7 | add solution template | exercises/error-handling/error_handling.py | exercises/error-handling/error_handling.py | Python | 0.000001 | @@ -0,0 +1,244 @@
+def handle_error_by_throwing_exception():%0A pass%0A%0A%0Adef handle_error_by_returning_none(input_data):%0A pass%0A%0A%0Adef handle_error_by_returning_tuple(input_data):%0A pass%0A%0A%0Adef filelike_objects_are_closed_on_exception(filelike_object):%0A pass%0A
| |
286e996c8dd7a299a5db148e78bbdaa0e1cb1b5c | Add sample base. | samples/sample.py | samples/sample.py | Python | 0 | @@ -0,0 +1,133 @@
+# -*- coding: utf-8 -*-%0A%0A%22%22%22AirWaveAPIClient sample.%22%22%22%0A%0A%0Adef main():%0A %22%22%22Sample main.%22%22%22%0A%0Aif __name__ == %22__main__%22:%0A%0A main()%0A
| |
c1fae9e5ace57320b4f4e69efc941c7fe6266381 | add stft graph writer | write_stft_graph.py | write_stft_graph.py | Python | 0 | @@ -0,0 +1,374 @@
+import pdb%0Aimport tensorflow as tf%0Afrom birdwatcher.generators import compose, stft, amplitude_to_db, read_audio, reshape%0A%0AAUDIO_SHAPE = (44100*3, 1)%0Aclean_samples = compose(reshape, amplitude_to_db, stft, read_audio)%0A%0Ax = tf.placeholder(tf.float32, shape=AUDIO_SHAPE)%0Aout = clean_samp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.