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 |
|---|---|---|---|---|---|---|---|
40fc5d12d93d9c258e615b6001070b4fbd04f119 | Add sharding checks | cogs/utils/checks.py | cogs/utils/checks.py | import discord
from discord.ext import commands
# noinspection PyUnresolvedReferences
import __main__
def owner_check(ctx):
return str(ctx.message.author.id) in __main__.liara.owners
def is_owner():
return commands.check(owner_check)
def is_bot_account():
def predicate(ctx):
return ctx.bot.use... | Python | 0 | @@ -713,24 +713,517 @@
redicate)%0A%0A%0A
+def is_main_shard():%0A def predicate(ctx):%0A if ctx.bot.shard_id is None:%0A return True%0A elif ctx.bot.shard_id == 0:%0A return True%0A else:%0A return False%0A return commands.check(predicate)%0A%0A%0Adef is_not... |
4dedbc15c835d02ccde99fb9fad00ed9a590c69e | Add private field to posts | blog/models.py | blog/models.py | import hashlib, random
from datetime import datetime
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import UserMixin, AnonymousUserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from geoalchemy2 import Geometry
db = SQLAlchemy()
class User(db.Model, UserMixin):
__... | Python | 0 | @@ -2042,16 +2042,81 @@
=False)%0A
+ private = db.Column(db.Boolean, default=False, nullable=False)%0A
author
|
76092902023d0d29d0702f2c9bb1cfefb8d0e42c | add ordering to links and make description optional | blog/models.py | blog/models.py | from datetime import timedelta
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.utils.timezone import localtime
from django.db.models import Count
import markdown
from mptt.models import MPTTModel, TreeForeignKey
from taggit.managers import TaggableManage... | Python | 0 | @@ -6617,25 +6617,96 @@
s.TextField(
-)
+null=True, blank=True)%0A %0A class Meta:%0A ordering = %5B'title'%5D
%0A %0A de
|
a54c30063efbd55ebcbfdb1f4b2158673a7dc8a9 | change the id so we can get the archive url correct | blogear/bot.py | blogear/bot.py | # bot.py
#
# Pubsub Client Bot - Listens to pubsub events for new blog entries.
#
import time
import datetime
from twisted.python import log
from twisted.internet import defer, task, reactor
from twisted.words.xish import domish, xpath
from wokkel.pubsub import PubSubClient, Item
from wokkel import disco
from twisted.w... | Python | 0 | @@ -3616,32 +3616,66 @@
# push on queue%0A
+ entries%5B'id'%5D = file_name%0A
self.ato
@@ -3832,32 +3832,66 @@
d.split(%22:%22, 1)%0A
+ entries%5B'id'%5D = file_name%0A
# push o
|
0b452dca8c517b180df037fafc52f6e2b09811c1 | fix class name | books/forms.py | books/forms.py | from django.forms import ModelForm
from .models import BookReader, User
class UserForm(ModelForm):
class Meta:
model = User
class BookReader(ModelForm):
class Meta:
model = BookReader
excluse = ['user']
| Python | 0.999994 | @@ -150,16 +150,20 @@
okReader
+Form
(ModelFo
|
77d26064694e89d30ea4d62a7a9de9fb7d4038a0 | Fix typo secounds => seconds (#743) | common/util/debug.py | common/util/debug.py | import functools
import json
import pprint as _pprint
import sublime
from contextlib import contextmanager
_log = []
enabled = False
ENCODING_NOT_UTF8 = "{} was sent as binaries and we dont know the encoding, not utf-8"
def start_logging():
global _log
global enabled
_log = []
enabled = True
def s... | Python | 0.000001 | @@ -675,17 +675,16 @@
rr, seco
-u
nds):%0A
@@ -837,17 +837,16 @@
%22seco
-u
nds%22: se
@@ -847,17 +847,16 @@
s%22: seco
-u
nds%0A
|
c20fc022f1de734876821a65771e1ca500a3d8d4 | Fix to 2d MB dist generator | brownian_tools.py | brownian_tools.py | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 23 10:40:16 2016
Library of common functions for Brownian code
@author: William Jones and Luc Moseley
History:
23/11/2016: WJ - created, imported functions from animate.py
23/11/2016: WJ - started work on t_wall; new general wall collision code
24/11/2016: WJ -... | Python | 0.000004 | @@ -686,19 +686,8 @@
(1 -
- (m/T)**2 *
p_i
|
396a217ad725e25c8761edf3678dea349d06e023 | Reorganize imports | setuptools/__init__.py | setuptools/__init__.py | """Extensions to the 'distutils' for large or complex distributions"""
from setuptools.extension import Extension
from setuptools.dist import Distribution, Feature, _get_unpatched
import distutils.core
from setuptools.depends import Require
from distutils.core import Command as _Command
from distutils.util import conve... | Python | 0.000001 | @@ -68,175 +68,49 @@
%22%22%22%0A
-from setuptools.extension import Extension%0Afrom setuptools.dist import Distribution, Feature, _get_unpatched%0Aimport distutils.core%0Afrom setuptools.depends import Requi
+%0Aimport os%0Aimport sys%0Aimport distutils.co
re%0Af
@@ -195,36 +195,85 @@
rt_path%0A
+%0A
import
-os%0... |
b95aaa571669d2a5277bd4d9e18d9d1b81e3bcab | Decrypt post test | BunqAPI/tests.py | BunqAPI/tests.py | from django.test import TestCase, RequestFactory
from BunqAPI.installation import installation
from django.contrib.auth.models import User
from BunqAPI.encryption import AESCipher
import json
import base64
from BunqAPI import views
from django.contrib.auth import authenticate
from faker import Faker
# from pprint impor... | Python | 0.000007 | @@ -4411,28 +4411,324 @@
,%0A 200%0A )%0A
+%0A def test_decrypt_post(self):%0A data = %7B%0A 'Nothing': 'Nothing',%0A %7D%0A request = self.factory.post('/decrypt', data=data)%0A request.user = self.user%0A%0A self.assertEqual(%0A views.... |
4bea54dade5e6d3e1940ba596a08cf076c2df5b6 | Assertion was always true | akvo/rsr/management/commands/fix_orphaned_periods.py | akvo/rsr/management/commands/fix_orphaned_periods.py | # -*- coding: utf-8 -*-
# Akvo Reporting is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
import sys
from django.core.man... | Python | 0.999997 | @@ -2486,179 +2486,181 @@
sert
- (%0A child_indicator.result.parent_result == parent_indicator.result,%0A '%7B%7D cannot be a parent of %7B%7D'.format(parent_id, child_id)%0A )
+ion_message = '%7B%7D cannot be a parent of %7B%7D'.format(parent_id, child_id)%0A assert... |
390bcb4be27012794ceb927e3ab2e384c2909daf | Add retries | conf/celeryconfig.py | conf/celeryconfig.py | from datetime import timedelta
import os
from ast import literal_eval
from celery.schedules import crontab
from kombu import Queue
CLUSTER_NAME = os.getenv('CLUSTER_NAME', 'local')
MESSAGES_TTL = 7200
# Broker and Queue Settings
BROKER_URL = os.getenv('BROKER_URL',
'amqp://guest:guest@localho... | Python | 0.000539 | @@ -334,60 +334,205 @@
KER_
-HEARTBEAT = int(os.getenv('BROKER_HEARTBEAT', '20'))
+CONNECTION_TIMEOUT = int(os.getenv('BROKER_CONNECTION_TIMEOUT', '20'))%0ABROKER_HEARTBEAT = int(os.getenv('BROKER_HEARTBEAT', '20'))%0ABROKER_CONNECTION_RETRY = True%0ABROKER_CONNECTION_MAX_RETRIES = 100
%0ACEL
|
f78ef9ff6094b23316a170cf8ae33056ba358aae | Remove a TODO | feedreader/handlers.py | feedreader/handlers.py | """APIRequestHandler subclasses for API endpoints."""
from tornado.web import HTTPError
from feedreader.api_request_handler import APIRequestHandler
class MainHandler(APIRequestHandler):
def get(self):
username = self.require_auth()
self.write({"message": "Hello world!"})
class UsersHandler(A... | Python | 0.998852 | @@ -662,76 +662,8 @@
%7D)%0A
- # TODO: handle username already being taken, empty password%0A
|
cd37746924a6b6b94afd044688c4a2554d0f50d1 | fix variable name for id | import.py | import.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from app import app, db, Request
from glob import glob
from sqlalchemy.exc import IntegrityError
from OpenSSL import crypto
from datetime import datetime
for path in glob("{}/freifunk_*.crt".format(app.config['DIRECTORY'])):
with open(path) as certfile:
print(... | Python | 0.999789 | @@ -1163,32 +1163,37 @@
ted %7B%7D.%22.format(
+cert_
id))%0A exc
@@ -1258,16 +1258,21 @@
.format(
+cert_
id))%0A
|
d4da07688c0b1244bad24c26483a0f1b94a8fab0 | remove that filtering option | src/apps/calendar/schema.py | src/apps/calendar/schema.py | from graphene import relay, AbstractType, String
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from .models import Calendar, Day
class CalendarNode(DjangoObjectType):
"""
how does this work?
"""
class Meta:
model = Calendar
... | Python | 0.000045 | @@ -382,43 +382,8 @@
%7D%0A
- filter_order_by = %5B'uuid'%5D%0A
|
f859752e1b2f5e3ad16b0220199375dd130c184b | Use namespace only to look up a symbol, not environment. | src/libeeyore/values.py | src/libeeyore/values.py | from abc import ABCMeta, abstractmethod
from all_known import all_known
from eeyinterface import implements_interface
from usererrorexception import EeyUserErrorException
# -- Base class and global methods ---
class EeyValue( object ):
__metaclass__ = ABCMeta
def __init__( self ):
self.cached_eval ... | Python | 0 | @@ -1543,35 +1543,41 @@
_lookup( self,
-env
+namespace
):%0A if s
@@ -1599,20 +1599,16 @@
not in
-env.
namespac
@@ -1781,20 +1781,16 @@
return
-env.
namespac
@@ -2049,32 +2049,42 @@
elf._lookup( env
+.namespace
).evaluate( env
@@ -2564,16 +2564,26 @@
kup( env
+.namespace
).is_kn
@@ -2663,16 +2... |
4a30762680fd3ee9b95795f39e10e15faf4279e8 | remove language intolerance | src/boarbot/modules/echo.py | src/boarbot/modules/echo.py | import discord
from boarbot.common.botmodule import BotModule
from boarbot.common.events import EventType
class EchoModule(BotModule):
async def handle_event(self, event_type, args):
if event_type == EventType.MESSAGE:
await self.echo(args[0])
async def echo(self, message: discord.Message... | Python | 0.999939 | @@ -554,112 +554,8 @@
%5B1%5D%0A
- if 'shit' in echo:%0A raise ValueError('Your language is bad and you should feel bad')%0A
|
e8d0c7f678689c15049186360c08922be493587a | Remove non-existant flask.current_app.debug doc ref. | flask_nav/renderers.py | flask_nav/renderers.py | from flask import current_app
from dominate import tags
from visitor import Visitor
class Renderer(Visitor):
"""Base interface for navigation renderers.
Visiting a node should return a string or an object that converts to a
string containing HTML."""
def visit_object(self, node):
"""Fallbac... | Python | 0 | @@ -404,14 +404,9 @@
(
-:attr:
+%60
%60fla
@@ -426,16 +426,17 @@
p.debug%60
+%60
is %60%60Tr
|
8972cf13c7f3460a5f9f85e8a5a23bfa6f53006d | Update mongo | flask_restler/mongo.py | flask_restler/mongo.py | import bson
import marshmallow as ma
from .filters import Filter as VanilaFilter, Filters
from .resource import ResourceOptions, Resource, APIError, logger
class ObjectId(ma.fields.Field):
def _deserialize(self, value, attr, data):
try:
return bson.ObjectId(value)
except:
... | Python | 0.000001 | @@ -5250,39 +5250,39 @@
%5B%7B'$
-limit': limit%7D, %7B'$skip': offse
+skip': offset%7D, %7B'$limit': limi
t%7D%5D%0A
@@ -6538,16 +6538,228 @@
orting%7D%0A
+ if self.meta.aggregate:%0A pipeline = %5Bp for p in self.meta.aggregate if '$sort' not in p%5D%0A pipeline.append(%7B'$sort': sort... |
f6df8c05d247650f4899d1101c553230a60ccc70 | Improve registration response messages | fogeybot/cogs/users.py | fogeybot/cogs/users.py | from discord.ext.commands import command
class UserCommands(object):
def __init__(self, bot, api, db):
self.bot = bot
self.api = api
self.db = db
@command(description="Registers/updates your battle tag", pass_context=True)
async def register(self, ctx, battletag: str):
if '... | Python | 0.000002 | @@ -464,66 +464,834 @@
-# TODO verify with hotslogs (account for private profiles)
+try:%0A info = await self.api.get_mmr(battletag)%0A%0A if info.present:%0A msg = %22Registration successful%5Cn%22%0A msg += %22**Note**: MMR lookup requires that your HotsLog pr... |
46749e9d6ef3eca8ca0d9eae25829ef88d31f5b4 | Exit if no events are received | broadcaster.py | broadcaster.py | from threading import Thread
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
from multiprocessing.pool import ThreadPool
import datetime
import base64
import logging
import os
import re
import redis
import requests
import signal
import sys
import time
import uuid
import multip... | Python | 0 | @@ -5473,18 +5473,18 @@
minute.
-
%22
+)
%0A
@@ -5496,176 +5496,140 @@
- %22Unfinished tasks: %25d%22 %25 observer.event_queue.unfinished_tasks)%0A assert observer.is_alive()%0A event_handler.last_event = now
+# Sometimes watchdog stops receiving events.%0A ... |
4240cc0e6fb552d3ca91082fe3173cb26b273ac0 | support for dplay.dk and it.dplay.com | lib/svtplay_dl/service/dplay.py | lib/svtplay_dl/service/dplay.py | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
import re
import copy
import json
import time
import os
from svtplay_dl.service import Service
from svtplay_dl.fetcher.hds import hdsparse
from svtplay_dl.fetcher.hls import hlsparse
from svt... | Python | 0 | @@ -559,16 +559,44 @@
play.se'
+, 'dplay.dk', %22it.dplay.com%22
%5D%0A%0A d
|
be4ac92b1729ec67e417fc114ca0195f4424aed1 | Remove stray utf-8 | libcloudcore/serializers/xml.py | libcloudcore/serializers/xml.py | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | Python | 0.000001 | @@ -3556,9 +3556,9 @@
00.0
-%E2%80%99
+'
%0A
|
a26c10f9358c51e291e8493463f3836c8bed01e2 | Fix level command: Admins (level 1000+) can no longer promote other admins who are the same levels as them | pajbot/modules/basic/admincommands.py | pajbot/modules/basic/admincommands.py | import logging
import pajbot.models
from pajbot.managers.adminlog import AdminLogManager
from pajbot.modules import BaseModule
from pajbot.modules import ModuleType
from pajbot.modules.basic import BasicCommandsModule
log = logging.getLogger(__name__)
class AdminCommandsModule(BaseModule):
ID = __name__.split('... | Python | 0.000001 | @@ -3064,32 +3064,338 @@
rname) as user:%0A
+ if user.level %3E= source.level:%0A bot.whisper(source.username, 'You cannot change the level of someone who is the same or higher level than you. You are level %7B%7D, and %7B%7D is level %7B%7D'.format(source.level, username, use... |
db711fe24ffff78d21db3af8e437dc2f2f1b48a7 | Add space at top of class bruteforce_ssh_pyes | alerts/bruteforce_ssh_pyes.py | alerts/bruteforce_ssh_pyes.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
#
# Contributors:
# Anthony Verez averez@mozilla.com
# Je... | Python | 0.000003 | @@ -380,17 +380,16 @@
ertTask%0A
-%0A
from que
@@ -454,16 +454,17 @@
sMatch%0A%0A
+%0A
class Al
|
dfe531a481e2e753e755f8877bc747147deb7840 | Set optional port as proper Channel attribute. (#1163) | parsl/channels/oauth_ssh/oauth_ssh.py | parsl/channels/oauth_ssh/oauth_ssh.py | import logging
import paramiko
import socket
from parsl.errors import OptionalModuleMissing
from parsl.channels.ssh.ssh import SSHChannel
try:
from oauth_ssh.ssh_service import SSHService
from oauth_ssh.oauth_ssh_token import find_access_token
_oauth_ssh_enabled = True
except (ImportError, NameError):
... | Python | 0 | @@ -1545,16 +1545,40 @@
ipt_dir%0A
+ self.port = port
%0A
|
455522eb6f626579350e3b26807a6b47501e80d3 | Change ftp site url to "ftp.igs.org" | fetch_site_logs_from_ftp_sites.py | fetch_site_logs_from_ftp_sites.py | """
Fetch updated site log files from remote FTP sites and upload them to GWS incoming site log bucket.
"""
import logging
import datetime
import ftplib
import os
import re
import shutil
import tempfile
import boto3
import dateutil.parser
import requests
logger = logging.getLogger(__name__) # pylint: disable=invalid... | Python | 0 | @@ -551,26 +551,19 @@
ce('
-igscb.jpl.nasa.gov
+ftp.igs.org
', '
|
b1b33a778d7abca2aa29e9612b6a75ff4aa7d64f | add UnboundError to actionAngle | galpy/actionAngle_src/actionAngle.py | galpy/actionAngle_src/actionAngle.py | import math as m
class actionAngle:
"""Top-level class for actionAngle classes"""
def __init__(self,*args,**kwargs):
"""
NAME:
__init__
PURPOSE:
initialize an actionAngle object
INPUT:
OUTPUT:
HISTORY:
2010-07-11 - Written - Bovy (... | Python | 0.000001 | @@ -1446,8 +1446,153 @@
rn None%0A
+%0Aclass UnboundError(Exception):%0A def __init__(self, value):%0A self.value = value%0A def __str__(self):%0A return repr(self.value)%0A
|
400788fac8b91206521feaea800e37dd183c2f4f | Make sure coverage is at 100% for ref_validator_test.py | tests/swagger20_validator/ref_validator_test.py | tests/swagger20_validator/ref_validator_test.py | import pytest
from jsonschema.validators import Draft4Validator
from jsonschema.validators import RefResolver
from mock import Mock, MagicMock
from bravado_core.swagger20_validator import ref_validator
@pytest.fixture
def address_target():
return {
'type': 'object',
'properties': {
's... | Python | 0 | @@ -1448,16 +1448,22 @@
alue = %5B
+Mock()
%5D%0A re
|
0662ab1773b835b447dd71ad53fa595f490cbcc8 | Add proper encoding support to ftp_list | flexget/plugins/input/ftp_list.py | flexget/plugins/input/ftp_list.py | import logging
import ftplib
import os
from flexget import plugin
from flexget.event import event
from flexget.entry import Entry
log = logging.getLogger('ftp_list')
class InputFtpList(object):
"""
Generate entries from a ftp listing
Configuration:
ftp_list:
config:
use-ssl: no
... | Python | 0.000001 | @@ -1064,32 +1064,78 @@
required=True)%0A
+ config.accept('text', key='encoding')%0A
config.a
@@ -1239,16 +1239,26 @@
config
+%5B'config'%5D
.setdefa
@@ -1279,16 +1279,72 @@
False)%0A
+ config%5B'config'%5D.setdefault('encoding', 'auto')%0A
@@ -1733,17 +1733,16 @@
try:
-
... |
31e0b14e21cdbd346a7814c161178f5533d25215 | use int as long if python 3 and above | any_urlfield/models/values.py | any_urlfield/models/values.py | """
Custom data objects
"""
from __future__ import unicode_literals
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.loading import get_model
from django.utils.encoding import python_2_unicode_compatible
import logging
from any_urlfield.cache import get_url... | Python | 0.000003 | @@ -510,16 +510,44 @@
string%0A%0A
+if six.PY3:%0A long = int%0A%0A
%0Alogger
|
a0af5dc1478fe8b639cc5a37898ad180f1f20a89 | Add --midi option to CLI | src/twelve_tone/cli.py | src/twelve_tone/cli.py | """
Module that contains the command line app.
Why does this file exist, and why not put this in __main__?
You might be tempted to import things from __main__ later, but that will cause
problems: the code will get executed twice:
- When you run `python -mtwelve_tone` python will execute
``__main__.py`` as ... | Python | 0 | @@ -700,16 +700,71 @@
mmand()%0A
+@click.option('--midi', '-m', help='MIDI output file')%0A
def main
@@ -764,16 +764,20 @@
ef main(
+midi
):%0A c
@@ -837,8 +837,69 @@
lody())%0A
+ if midi is not None:%0A c.save_to_midi(filename=midi)%0A
|
910b1cc171de18cc844abe912130541234b23c7f | Add auth support. | flamyngo/views.py | flamyngo/views.py | import json
import re
import os
from pymongo import MongoClient
from monty.serialization import loadfn
from monty.json import jsanitize
from flask import render_template, request, make_response
from flamyngo import app
module_path = os.path.dirname(os.path.abspath(__file__))
SETTINGS = loadfn(os.environ["FLAMYNG... | Python | 0 | @@ -189,16 +189,26 @@
response
+, Response
%0A%0Afrom f
@@ -227,16 +227,81 @@
rt app%0A%0A
+from functools import wraps%0Afrom flask import request, Response%0A%0A
module_p
@@ -721,16 +721,935 @@
ions%22%5D%7D%0A
+AUTH_USER = SETTINGS.get(%22AUTH_USER%22, None)%0AAUTH_PASSWD = SETTINGS.get(%22AUTH_PASSWD%22, None)... |
ea0b81ad1e56935e14429e3b064300b679c61ce1 | version 0.4.365 | src/you_get/version.py | src/you_get/version.py | #!/usr/bin/env python
script_name = 'you-get'
__version__ = '0.4.350'
| Python | 0.000001 | @@ -64,8 +64,8 @@
.4.3
+6
5
-0
'%0A
|
81612e20e327b4b4eabb4c77201dd6b8d2d21e93 | Add get_default getter to config. | law/config.py | law/config.py | # -*- coding: utf-8 -*-
"""
law Config interface.
"""
__all__ = ["Config"]
import os
import tempfile
import six
from six.moves.configparser import ConfigParser
class Config(ConfigParser):
_instance = None
_default_config = {
"core": {
"db_file": os.environ.get("LAW_DB_FILE", os.pat... | Python | 0 | @@ -1487,16 +1487,206 @@
option%0A%0A
+ def get_default(self, section, option, default=None):%0A if self.has_option(section, option):%0A return self.get(section, option)%0A else:%0A return default%0A%0A
def
|
67444868b1c7c50da6d490893d72991b65b2aa7b | Add superlance supervisord plugin | frontend/setup.py | frontend/setup.py | import sys
from setuptools import setup, find_packages
requires = (
'flask',
'Flask-Script',
'flask_sockets',
'gunicorn',
'cassandra-driver',
'google-api-python-client',
'ecdsa',
'daemonize',
'websocket-client',
'pyzmq',
'fabric',
'pyyaml',
'supervisor',
'pexpect... | Python | 0 | @@ -327,16 +327,34 @@
'blist'
+,%0A 'superlance'
%0A)%0A%0Asetu
|
5ffbad954dfe588bdfcfa7b6fb20057fdd186e34 | Use a real favicon | leapreader.py | leapreader.py | from os.path import join, dirname
import random
from itty import get, run_itty
import itty
from jinja2 import Environment, FileSystemLoader
import typd
env = Environment(loader=FileSystemLoader(join(dirname(__file__), 'templates')))
settings = {}
t = typd.TypePad(endpoint='http://api.typepad.com/')
cache = dict()... | Python | 0.000137 | @@ -1243,24 +1243,131 @@
uss(0, 3)%0A%0A%0A
+@get('/favicon.ico')%0Adef favicon(request):%0A raise itty.Redirect('http://www.typepad.com/favicon.ico')%0A%0A%0A
@get('/stati
|
ce5777bd6c803b3841b2ebbb36fd148f3178bda9 | Change method for stdout/stderr. | src/vcstools/common.py | src/vcstools/common.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2010, Willow Garage, Inc.
# 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... | Python | 0 | @@ -5952,34 +5952,67 @@
-while True
+for line in iter(proc.stdout.readline, b'')
:%0A
@@ -6028,30 +6028,12 @@
e =
-proc.stdout.read
line
-()
.dec
@@ -6433,18 +6433,51 @@
-while True
+for line in iter(proc.stderr.readline, b'')
:%0A
@@ -6501,30 +6501,12 @@
e =
-proc.stderr.read
l... |
a16cda69c2ec0e96bf5b5a558e288d22b353f28f | change work folder before build | build/build.py | build/build.py | #!/usr/bin/env python2.7
# coding=utf-8
import subprocess
import platform
import os
import sys
def build(platform):
print("[Start Build] Target Platform: " + platform)
build_script = ""
if platform == "windows":
build_script = "make_win_with_2015_static.bat"
subprocess.Popen(["cmd.exe","/C"... | Python | 0 | @@ -89,16 +89,17 @@
ort sys%0A
+%0A
def buil
@@ -163,24 +163,135 @@
+ platform)%0A
+ build_folder = os.path.split(os.path.realpath(__file__))%5B0%5D%0A #change folder%0A os.chdir(build_folder)%0A%0A
build_sc
@@ -389,75 +389,8 @@
at%22%0A
- subprocess.Popen(%5B%22cmd.exe%22,%22/C%22,build_script... |
8d20d419435b3e2d1b7bf5a5a88c58d5f5477187 | Add docstring for is_template method. | folio/__init__.py | folio/__init__.py | # -*- coding: utf-8 -*-
"""
Folio is an static website generator using jinja2 template engine.
"""
import os
import shutil
import fnmatch
import logging
from jinja2 import Environment, FileSystemLoader
__all__ = ['Folio']
__version__ = '0.1-dev'
class Folio(object):
"""
:param name: Projects's name.
... | Python | 0 | @@ -4832,24 +4832,268 @@
filename):%0A
+ %22%22%22Return true if a file is considered a template. The default%0A behaviour is to ignore all hidden files and the ones that start with%0A and underscore.%0A%0A :param filename: The (possible) template filename.%0A %22%22%22%0A
... |
e4b9463dcbe5700c5a9089188e1f3caca5a206ab | Add hierarchy walker | avalon/tools/cbsceneinventory/lib.py | avalon/tools/cbsceneinventory/lib.py | from avalon import io, api
def switch_item(container,
asset_name=None,
subset_name=None,
representation_name=None):
"""Switch container asset, subset or representation of a container by name.
It'll always switch to the latest version - of course a different
... | Python | 0.000008 | @@ -2509,24 +2509,262 @@
return representation%0A
+%0A%0Adef walk_hierarchy(node):%0A %22%22%22Recursively yield group node%0A %22%22%22%0A for child in node.children():%0A if child.get(%22isGroupNode%22):%0A yield child%0A%0A for _child in walk_hierarchy(child):%0A yield... |
6c004827c642c3aee4166dd8689dc40104be6346 | Stop hard-coding satellites, and make the tester easy to run on any notebook path. Allow specifying output and error files as args rather than just on command line. | src/verify_notebook.py | src/verify_notebook.py | # -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# 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/LICENS... | Python | 0 | @@ -724,188 +724,117 @@
err(
-):%0A output = None%0A if len(sys.argv) == 3:%0A with open(sys.argv%5B1%5D, 'r') as out:%0A output = out.read()%0A with open(sys.argv%5B2%5D, 'r') as err:%0A error = err.read()%0A els
+notebook_path=None, outfile=None, errfile=None):%0A output = None%0A error = None%0... |
a9f6432288f74b9f590a91649de1e475ed523806 | Correct data format | restclients/test/library/mylibinfo.py | restclients/test/library/mylibinfo.py | from datetime import date
from django.test import TestCase
from django.conf import settings
from restclients.library.mylibinfo import get_account, get_account_html
from restclients.exceptions import DataFailureException
class MyLibInfoTest(TestCase):
def test_get_account(self):
with self.settings(
... | Python | 0.999995 | @@ -761,20 +761,19 @@
), %22
+Tue,
May 27
-, 2014
%22)%0A
|
ec2c0701382e09009c3bc25456bf672fa06f4b92 | Remove DynamicModel | simple_model/models.py | simple_model/models.py | import inspect
from typing import Any, Iterable, Iterator, Tuple, Union
from .exceptions import ValidationError
from .fields import ModelField
class BaseModel(type):
_field_class = ModelField
def __new__(cls, name, bases, attrs, **kwargs):
super_new = super().__new__
# do not perform initia... | Python | 0.000001 | @@ -1,19 +1,4 @@
-import inspect%0A
from
@@ -3650,37 +3650,55 @@
ne:%0A for
-field
+name, value, descriptor
in self._get_fi
@@ -3721,20 +3721,50 @@
-field.clean(
+clean_value = descriptor.clean(self, value
)%0A
@@ -3791,26 +3791,20 @@
lf,
-field.name, field.
+name, clean_
valu
@@ -3892,21 +3892,... |
b70d3c2c75befe747079697a66b1bb417749e786 | Update Workflow: add abstract method .on_failure() | simpleflow/workflow.py | simpleflow/workflow.py | from __future__ import absolute_import
class Workflow(object):
"""
Main interface to define a workflow by submitting tasks for asynchronous
execution.
The actual behavior depends on the executor backend.
"""
def __init__(self, executor):
self._executor = executor
def submit(self... | Python | 0.000002 | @@ -1967,8 +1967,189 @@
edError%0A
+%0A def on_failure(self, history, reason, details=None):%0A %22%22%22%0A The executor calls this method when the workflow fails.%0A%0A %22%22%22%0A raise NotImplementedError%0A
|
6a67c22a9843517ece1ee5e890ea38873b44648b | Teste html_to_latex. | libretto/templatetags/extras.py | libretto/templatetags/extras.py | # coding: utf-8
from __future__ import unicode_literals
import re
from bs4 import BeautifulSoup, Comment
from django.template import Library
from django.utils.encoding import smart_text
from ..utils import abbreviate as abbreviate_func
register = Library()
@register.filter
def stripchars(text):
return smart_te... | Python | 0 | @@ -1449,24 +1449,25 @@
(text):%0A
+r
%22%22%22%0A Perm
@@ -1639,16 +1639,330 @@
pr%C3%A9cis.
+%0A%0A %3E%3E%3E print(html_to_latex('%3Ch1%3EBonjour %C3%A0 tous%3C/h1%3E'))%0A %5Cpart*%7BBonjour %C3%A0 tous%7D%0A %3E%3E%3E print(html_to_latex('%3Cspan style=%22font-series: bold; font-variant: small-... |
cd72e710a74625fec34486329fa21310827f9f09 | validate downloaded image | apps/bplan/serializers.py | apps/bplan/serializers.py | import os
from urllib import request
from urllib.parse import urlparse
from django.apps import apps
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from rest_framework import serializers
fro... | Python | 0.000001 | @@ -3,17 +3,16 @@
port os%0A
-%0A
from url
@@ -172,16 +172,114 @@
rt Site%0A
+from django.core.exceptions import ValidationError%0Afrom django.core.files.images import ImageFile%0A
from dja
@@ -407,16 +407,72 @@
lizers%0A%0A
+from adhocracy4.images.validators import validate_image%0A
from adh
@@ -2217,29 +2217,8 ... |
268c577acd07bce4eb7e63bab6a38a7b436bc2e5 | Include request ip in monitored data | frappe/monitor.py | frappe/monitor.py | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from datetime import datetime
import json
import traceback
import frappe
import os
import uuid
MONITOR_REDIS_KEY = "monitor-transactions"
def start(tr... | Python | 0 | @@ -1061,16 +1061,54 @@
eaders)%0A
+%09%09%09%09self.ip = frappe.local.request_ip%0A
%09%09%09%09self
@@ -1754,16 +1754,36 @@
eaders,%0A
+%09%09%09%09%09%22ip%22: self.ip,%0A
%09%09%09%09%09%22me
|
7a5cb953f64dce841d88b9c8b45be7719c617ba2 | Fix games init file | games/__init__.py | games/__init__.py | __all__ = ['Game', 'Mancala', 'Player', 'TicTacToe'] | Python | 0.000001 | @@ -1,45 +1,52 @@
-__all__ = %5B'Game', 'Mancala', 'Player', '
+import Game%0Aimport Mancala%0Aimport Player%0Aimport
TicT
@@ -54,6 +54,4 @@
cToe
-'%5D
|
5dec04a8d06f5ea96d96b7a551c5ad9959e4c9e7 | Properly specify dns in network_metadata | playbooks/library/network_metadata.py | playbooks/library/network_metadata.py | #!/usr/bin/env python
# coding: utf-8 -*-
# (c) 2015, Hewlett-Packard Development Company, L.P.
#
# 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 the License, or
# (at your o... | Python | 0.999961 | @@ -4317,32 +4317,236 @@
%7D)%0A%0A
+ services = %5B%5D%0A if module.params%5B'ipv4_nameserver'%5D:%0A services.append(%7B%0A 'type': 'dns',%0A 'address': module.params%5B'ipv4_nameserver'%5D%0A %7D)%0A%0A
network_
@@ -4618,16 +4618... |
147c85aff3e93ebb39d984a05cec970b3dc7edc0 | Add expires_at field to jwt that was removed accidentally (#242) | frontstage/jwt.py | frontstage/jwt.py | """
Module to create jwt token.
"""
from datetime import datetime, timedelta
from jose import jwt
from frontstage import app
def timestamp_token(token):
"""Time stamp the expires_in argument of the OAuth2 token. And replace with an expires_in UTC timestamp"""
current_time = datetime.now()
expires_in = ... | Python | 0 | @@ -487,32 +487,78 @@
access_token'%5D,%0A
+ %22expires_at%22: expires_in.timestamp(),%0A
%22role%22:
|
a23e385d5de4ae3c36eb7e5e37b7bfcc6ed5d129 | Add bat file suffix for invoking dart2js. | site/try/build_try.gyp | site/try/build_try.gyp | # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE
{
'targets': [
{
'target_name': 'try_site',
'type': 'none',
'dependencies': [
'.... | Python | 0.005184 | @@ -203,16 +203,181 @@
ENSE%0A%0A%7B%0A
+ 'variables' : %7B%0A 'script_suffix%25': '',%0A %7D,%0A 'conditions' : %5B%0A %5B'OS==%22win%22', %7B%0A 'variables' : %7B%0A 'script_suffix': '.bat',%0A %7D,%0A %7D%5D,%0A %5D,%0A
'targe
@@ -2756,16 +2756,32 @@
/dart2js
+%3C(script_suffix)
'... |
2c870ee5b3d4df5a2f628350b7d4897f301c34de | Delete commented out urlparams code | badger/helpers.py | badger/helpers.py | import hashlib
import urllib
import urlparse
from django.conf import settings
from django.contrib.auth.models import SiteProfileNotAvailable
from django.core.exceptions import ObjectDoesNotExist
from django.utils.html import conditional_escape
try:
from commons.urlresolvers import reverse
except ImportError, e:
... | Python | 0 | @@ -2542,1286 +2542,4 @@
se)%0A
-%0A%0A# FIXME - This code is broken because smart_str doesn't exist in the namespace%0A# Since it's not used anywhere in django-badger and I'm not sure whether%0A# deleting it is ok or not, I'm commenting it out.%0A#%0A# @register.filter%0A# def urlparams(url_, hash=None, **query):%0A#... |
e8b49384d3e9e23485199ef131f0cb8f818a2a02 | edit default port | get-image-part.py | get-image-part.py | import tornado.ioloop
import tornado.web
import tornado.wsgi
import io
import time
import random
import os
from PIL import Image
N = 20
class MainHandler(tornado.web.RequestHandler):
def get(self):
n = int(random.uniform(0,N))
img = int(self.get_argument("img"))
fn = os.path.join(os.path.d... | Python | 0.000001 | @@ -1172,11 +1172,11 @@
'',
-800
+459
0, a
|
37e1eb093eb29044930cb90a049f471aa2caad8b | Update publicip.py | apps/tinyosGW/publicip.py | apps/tinyosGW/publicip.py |
#!/usr/bin/python
# Author : jeonghoonkang, https://github.com/jeonghoonkang
#-*- coding: utf-8 -*-
from __future__ import print_function
from subprocess import *
from types import *
import platform
import sys
import os
def run_cmd(cmd):
p = Popen(cmd, shell=True, stdout=PIPE)
output = p.communicate()[0]
... | Python | 0.000001 | @@ -1,8 +1,30 @@
+#-*- coding: utf-8 -*-
%0A#!/usr/
@@ -96,31 +96,8 @@
kang
-%0A#-*- coding: utf-8 -*-
%0A%0Afr
|
5cda2208ada4c521c0c452f4eb8987633454b44b | Update userpass.py | hvac/api/auth_methods/userpass.py | hvac/api/auth_methods/userpass.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""USERPASS methods module."""
from hvac.api.vault_api_base import VaultApiBase
DEFAULT_MOUNT_POINT = 'userpass'
class Userpass(VaultApiBase):
"""USERPASS Auth Method (API).
Reference: https://www.vaultproject.io/api/auth/userpass/index.html
"""
def crea... | Python | 0.000001 | @@ -70,16 +70,39 @@
ule.%22%22%22%0A
+from hvac import utils%0A
from hva
|
996474b241d72a475b4ee111a2b7b5fd8c504c27 | Fix of var name mistake in register_to_payment | getpaid/models.py | getpaid/models.py | import sys
from datetime import datetime
from django.apps import apps
from django.db import models
from django.utils import six
from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from .abstract_mixin import Abstrac... | Python | 0.000096 | @@ -5520,19 +5520,18 @@
ame, mod
-ul
e
+l
)%0A re
|
9786a1d0f3baa1b0034cc1f48c611305bd05cd43 | Define _display_name method for Response that refer to Audit. | src/ggrc/models/response.py | src/ggrc/models/response.py | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: vraj@reciprocitylabs.com
from ggrc import db
from .mixins import deferred, BusinessObject
from .relationsh... | Python | 0 | @@ -1108,32 +1108,169 @@
ml = %5B%0A %5D%0A%0A
+ def _display_name(self):%0A return u'Response with id=%7B0%7D for Audit %22%7B1%7D%22'.format(%0A self.id, self.request.audit.display_name)%0A%0A
@classmethod%0A
|
3e33a94580d386be71298bcc7fb2d4a4bc19dd34 | apply only the unified diff instead of the whole file | gitmagic/fixup.py | gitmagic/fixup.py | import gitmagic
def fixup(repo, destination_picker, change_finder, args={}):
repo.index.reset()
for change in change_finder(repo):
_apply_change(repo, change)
destination_commits = destination_picker.pick(change)
if not destination_commits:
repo.index.commit( message = "WARN... | Python | 0.000001 | @@ -8,16 +8,71 @@
gitmagic
+%0Afrom git.cmd import Git%0Afrom io import import StringIO
%0A%0Adef fi
@@ -821,77 +821,113 @@
-#todo: apply unified diff only%0A repo.index.add(%5Bchange.a_file_name%5D
+git = Git(repo.working_dir)%0A git.execute(%5B'git', 'apply', '-'%5D, istream=StringIO(change.unified_diff... |
d645eb7d70f76c9974da51d4517c77c1cc2c575a | version 0.4.1347 | src/you_get/version.py | src/you_get/version.py | #!/usr/bin/env python
script_name = 'you-get'
__version__ = '0.4.1328'
| Python | 0.000001 | @@ -65,8 +65,8 @@
4.13
-28
+47
'%0A
|
648487b9a256ffa1d9ba91758e0c8afe8409fb9b | version 0.4.1328 | src/you_get/version.py | src/you_get/version.py | #!/usr/bin/env python
script_name = 'you-get'
__version__ = '0.4.1314'
| Python | 0.000001 | @@ -65,8 +65,8 @@
4.13
-14
+28
'%0A
|
eb642e63cd32b972ccdec4f487b9a7e2e7cb17b5 | make product_change_type template filter work with hidden plans | billing/templatetags/billing_tags.py | billing/templatetags/billing_tags.py | from django import template
import billing.loading
from pricing.products import Product
register = template.Library()
@register.filter
def product_change_type(product, user):
upc = user.billing_account.get_current_product_class()
if isinstance(product, Product):
product = type(product)
if upc:
... | Python | 0 | @@ -359,16 +359,27 @@
roducts(
+hidden=True
)%0A
|
58c685aa03c51a96a25af9dd7d6792035b1f167e | fix update_firebase_installation | plugins/tff_backend/bizz/dashboard.py | plugins/tff_backend/bizz/dashboard.py | # -*- coding: utf-8 -*-
# Copyright 2018 GIG Technology NV
#
# 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.000001 | @@ -3088,18 +3088,17 @@
ns.json'
- %25
+,
%7Binstal
|
0c7702333355b185027f8bdc06b6e31d3968712e | Update live.py | fxcmminer_v1.0/live.py | fxcmminer_v1.0/live.py | from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.executors.pool import ThreadPoolExecutor, ProcessPoolExecutor
from db_manager import DatabaseManager
import time
import datetime
import forexconnect as fx
import settings as s
from event import LiveDataEvent
import re
class LiveDataMine... | Python | 0.000001 | @@ -387,20 +387,16 @@
M data.%0A
-
%0A Inf
|
dca5bd7d16866c0badf6c9d4ae69335aacef9f6d | Add sleep-and-try-again when getting MB info | audio_pipeline/util/MBInfo.py | audio_pipeline/util/MBInfo.py | __author__ = 'cephalopodblue'
import musicbrainzngs as ngs
from . import Util
class MBInfo():
default_server = ngs.hostname
def __init__(self, server=None, backup_server=None, useragent=("hidat_audio_pipeline", "0.1")):
if server is not None and server != self.default_server:
ngs.set_host... | Python | 0 | @@ -71,16 +71,28 @@
rt Util%0A
+import time%0A
%0A%0Aclass
@@ -1104,44 +1104,310 @@
r -
-if we have a local, try hitting it?%0A
+wait 10 seconds and try again%0A time.sleep(10)%0A try: %0A mb_release = ngs.get_release_by_id(release_id, includes=include)%5B'release'%... |
bf188dfae49ab23c8f5dd7eeb105951f6c068b7f | Add filtering by is_circle to Role admin. | backend/feedbag/role/admin.py | backend/feedbag/role/admin.py | from django.contrib import admin
from .models import Role
@admin.register(Role)
class RoleAdmin(admin.ModelAdmin):
list_display = ('name',
'is_circle',
'parent',
'purpose',
'archived',
)
list_filter = ('archiv... | Python | 0 | @@ -30,86 +30,419 @@
min%0A
-%0Afrom .models import Role%0A%0A%0A@admin.register(Role)%0Aclass RoleAdmin(admin.M
+from django.utils.translation import ugettext as _%0A%0Afrom .models import Role%0A%0A%0Aclass IsCircleListFilter(admin.SimpleListFilter):%0A # Human-readable title which will be displayed in the%0A ... |
0fac23c22307ca598e0cc6712280903c2a7d559d | Improve auto battle module | gbf_bot/auto_battle.py | gbf_bot/auto_battle.py | import logging
import random
import time
import pyautogui
from . import auto_battle_config as config
from .components import Button
logger = logging.getLogger(__name__)
attack = Button('attack.png', config['attack'])
auto = Button('auto.png', config['auto'])
def activate(battle_time):
pyautogui.PAUSE = 1.3
... | Python | 0.000001 | @@ -51,16 +51,52 @@
autogui%0A
+from . import top_left, window_size%0A
from . i
@@ -130,16 +130,38 @@
config%0A
+from . import utility%0A
from .co
@@ -222,16 +222,17 @@
ame__)%0A%0A
+%0A
attack =
@@ -372,50 +372,300 @@
1.3%0A
- time.sleep(5 + random.random() * 0.25)
+%0A # wait before battle start%0A w... |
d37c2328a8ed58778f4c39091add317878831b4e | increment version | grizli/version.py | grizli/version.py | # git describe --tags
__version__ = "0.7.0-41-g39ad8ff"
| Python | 0.000004 | @@ -41,16 +41,16 @@
.0-4
-1-g39ad8ff
+7-g6450ea1
%22%0A
|
d30d10a477f0b46fa73da76cb1b010e1376c3ff2 | Update version for a new PYPI package. | gtable/version.py | gtable/version.py | __version__ = '0.6.2'
| Python | 0 | @@ -14,9 +14,7 @@
'0.
-6.2
+7
'%0A
|
311be8c11b513fd2b3d2bb4427b5bc0b43c2539c | Move reverse along with geometry | caminae/core/forms.py | caminae/core/forms.py | from math import isnan
from django.forms import ModelForm
from django.contrib.gis.geos import LineString
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
import floppyforms as forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, F... | Python | 0.000001 | @@ -630,24 +630,20 @@
Reverse
-geometry
+path
%22),%0A
@@ -672,16 +672,12 @@
The
-geometry
+path
wil
@@ -1063,23 +1063,8 @@
-'reverse_geom',
%0A
@@ -1122,16 +1122,44 @@
'geom',%0A
+ 'reverse_geom',%0A
|
f9dadd363d9f370d884c0b127e1f63df8916f3c8 | Rename some functions | calculation.py | calculation.py | """Calculation functions."""
from __future__ import division
import numpy as np
from scipy.signal import butter, freqz
def deconv_process(excitation, system_response, fs):
"""Deconvolution.
It is a necessity to zeropadd the excitation signal
to avoid zircular artifacts, if the system response is longer
... | Python | 0.00292 | @@ -73,16 +73,71 @@
y as np%0A
+from . import plotting%0Aimport matplotlib.pyplot as plt%0A
from sci
@@ -402,195 +402,8 @@
nal.
- Therfore, the excitation signal has%0A been extended for freely chosen 5 seconds as default. If you want%0A to simulate the 'Cologne Cathedral', feel free to zeropadd%0A more sec... |
88f36912de48a84e4e3778889948f85655ba9064 | Remove token logging | canis/oauth.py | canis/oauth.py | from os import environ
from urllib import urlencode
from datetime import datetime, timedelta
from flask import Flask, request, redirect
import requests
app = Flask(__name__)
SPOTIFY_CLIENT_ID = environ['CANIS_SPOTIFY_API_CLIENT_ID']
SPOTIFY_SECRET = environ['CANIS_SPOTIFY_API_SECRET']
SPOTIFY_CALLBACK = environ.get(... | Python | 0.000001 | @@ -1892,60 +1892,8 @@
'%5D))
-%0A print (access_token, refresh_token, expiration)
%0A%0Ade
|
a6a95a5eec833c512d08f962b22c4c177d6021b0 | Fix Resource leak on ASyncStaticFiles (#588) | apistar/server/staticfiles.py | apistar/server/staticfiles.py | import os
import typing
from http import HTTPStatus
from importlib.util import find_spec
from apistar import exceptions
from apistar.compat import aiofiles, whitenoise
class BaseStaticFiles():
def __call__(self, environ, start_response):
raise NotImplementedError()
class StaticFiles(BaseStaticFiles):
... | Python | 0.000072 | @@ -3180,32 +3180,53 @@
)%0A else:%0A
+ try:%0A
chun
@@ -3255,32 +3255,36 @@
92)%0A
+
more_body = True
@@ -3281,24 +3281,28 @@
ody = True%0A%0A
+
@@ -3334,16 +3334,20 @@
+
next_chu
@@ -3381,32 +3381,36 @@
+
mo... |
59f765b8f383ae915131b9588d5867fc42dabde7 | fix sshpass command in test | cappat/jobs.py | cappat/jobs.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Utilities: Agave wrapper for sherlock
"""
import os
from os import path as op
from errno import EEXIST
import socket
from subprocess import check_output
im... | Python | 0.000004 | @@ -4615,16 +4615,17 @@
'ssh'
+,
'-p', '
|
4556add4d9c3645559e51005129dcc65bd0b00ca | __VERSION__ changed | stop_words/__init__.py | stop_words/__init__.py | import json
import os
__VERSION__ = (2015, 2, 21)
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
STOP_WORDS_DIR = os.path.join(CURRENT_DIR, 'stop-words')
STOP_WORDS_CACHE = {}
with open(os.path.join(STOP_WORDS_DIR, 'languages.json'), 'rb') as map_file:
buffer = map_file.read()
buffer = buffer.decod... | Python | 0.999994 | @@ -41,17 +41,17 @@
15, 2, 2
-1
+3
)%0ACURREN
|
94702fdf121bf82be7e9dbd11a5b271e0e9077b8 | Fix fixtures logging. Serves me right for not testing | cozify/test/fixtures.py | cozify/test/fixtures.py | #!/usr/bin/env python3
import os, pytest, tempfile, datetime
from cozify import conftest, config, hub, cloud
from . import fixtures_devices as dev
@pytest.fixture
def default_hub():
barehub = lambda:0
config.setStatePath() # reset to default config
config.dump_state()
barehub.hub_id = hub.default()
... | Python | 0 | @@ -54,16 +54,25 @@
datetime
+, logging
%0A%0Afrom c
@@ -1248,32 +1248,36 @@
ote:%0A log
+ging
.debug('Livehub
@@ -1361,16 +1361,20 @@
log
+ging
.debug('
@@ -2674,36 +2674,31 @@
-debug.
logg
-er
+ing
.error(%22%25s,
@@ -3972,20 +3972,15 @@
-debug.
logg
-er
+ing
.err
|
1391dd0b084f2c26fd5d0afceb81ffb5daab5dcf | Remove path and user filter from admin | rest_framework_tracking/admin.py | rest_framework_tracking/admin.py | from django.contrib import admin
from .models import APIRequestLog
class APIRequestLogAdmin(admin.ModelAdmin):
date_hierarchy = 'requested_at'
list_display = ('id', 'requested_at', 'response_ms', 'status_code',
'user', 'method',
'path', 'remote_addr', 'host',
... | Python | 0 | @@ -362,24 +362,8 @@
= (
-'user', 'path',
'met
|
6051ef3a68db15b220e939240f7bfcb34db1c7c8 | Check if cache value is not None, not truthy | tunigo/api.py | tunigo/api.py | from __future__ import unicode_literals
import time
import requests
from tunigo.cache import Cache
from tunigo.genre import Genre, SubGenre
from tunigo.playlist import Playlist
from tunigo.release import Release
BASE_URL = 'https://api.tunigo.com/v3/space'
BASE_QUERY = 'locale=en&product=premium&version=6.38.31&pl... | Python | 0 | @@ -1412,32 +1412,44 @@
if cache_value
+ is not None
:%0A re
@@ -2135,32 +2135,44 @@
if cache_value
+ is not None
:%0A re
@@ -3208,16 +3208,28 @@
he_value
+ is not None
:%0A
|
379f0a70425f171dc3046e32277b27e2bd9f55dc | Add multilabel param to cv_train and fix fetching labels | revscoring/utilities/cv_train.py | revscoring/utilities/cv_train.py | """
``revscoring cv_train -h``
::
Performs a cross-validation of a scorer model strategy across folds of
a dataset and then trains a final model on the entire set of data. Note
that either --labels or --pop-rates must be specified for classifiers.
Usage:
cv_train -h | --help
cv_train ... | Python | 0 | @@ -381,24 +381,64 @@
s=%3Clabels%3E%5D%0A
+ %5B--labels-config=%3Clc%3E%5D%0A
@@ -779,16 +779,48 @@
-scale%5D%0A
+ %5B--multilabel%5D%0A
@@ -1446,16 +1446,202 @@
model.%0A
+ --labels-config=%3Clc%3E Path to a file containing labels and its%0A ... |
a4cb47b928f6cd7f62780eb620e66a9494b17302 | Generate a full graph and a graph without age restricted content | generate_graph.py | generate_graph.py | from graphviz import Digraph
import math
import pymongo
def main():
client = pymongo.MongoClient()
db = client.reddit
related_subs = {}
subscribers = {}
adult = {}
subreddits = db.subreddits.find({'type': 'subreddit'})
if subreddits:
for subreddit in subreddits:
title ... | Python | 0.998926 | @@ -627,74 +627,1638 @@
ate_
-adult_graph(related_subs, subscribers, adult, min_subscribers=100)
+full_graph(related_subs, subscribers, adult, min_subscribers=0)%0A generate_censored_graph(related_subs, subscribers, adult, min_subscribers=100)%0A generate_adult_graph(related_subs, subscribers, adult, min_subscri... |
ad4b5ccf7c89fa67e69d065c47edaa9e18c009ee | add docstrings add if __name__ == '__main__': to make pydoc work | src/hal/user_comps/pyvcp.py | src/hal/user_comps/pyvcp.py | #!/usr/bin/env python
# This is a component of emc
# Copyright 2007 Anders Wallin <anders.wallin@helsinki.fi>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of... | Python | 0.000254 | @@ -845,16 +845,515 @@
7 USA%0A%0A
+%0A%22%22%22 Python Virtual Control Panel for EMC%0A%0A A virtual control panel (VCP) is used to display and control%0A HAL pins, which are either BIT or FLOAT valued.%0A%0A Usage: pyvcp -c compname myfile.xml%0A%0A compname is the name of the HAL component to be create... |
c3b681e5fbe157ea70167da1e67c740e8339af6f | Use plac annotations for arguments and add n_iter | examples/training/train_new_entity_type.py | examples/training/train_new_entity_type.py | #!/usr/bin/env python
# coding: utf8
"""
Example of training an additional entity type
This script shows how to add a new entity type to an existing pre-trained NER
model. To keep the example short and simple, only four sentences are provided
as examples. In practice, you'll need many more — a few hundred would be a
g... | Python | 0 | @@ -1337,16 +1337,28 @@
nction%0A%0A
+import plac%0A
import r
@@ -1363,16 +1363,16 @@
random%0A
-
from pat
@@ -1953,415 +1953,358 @@
%5D%0A%0A%0A
-def main(model=None, new_m
+@plac.annotations(%0A model=(%22M
odel
-_
+
name
-='animal', output_dir=None):%0A %22%22%22Set up the pipeline and entity recogniz... |
edca360431f28be2d67f7193a9d53be0460169a1 | fix test | biopandas/pdb/tests/test_read_pdb.py | biopandas/pdb/tests/test_read_pdb.py | # BioPandas
# Author: Sebastian Raschka <mail@sebastianraschka.com>
# License: BSD 3 clause
# Project Website: http://rasbt.github.io/biopandas/
# Code Repository: https://github.com/rasbt/biopandas
from biopandas.pdb import PandasPdb
import os
import numpy as np
import pandas as pd
from nose.tools import raises
from... | Python | 0.000002 | @@ -6181,11 +6181,11 @@
== (
-473
+857
, 21
|
214b1882a0eaf00bdd5dedbb02a28bba7f8d247b | update version to 1.1.7 | cartoview/__init__.py | cartoview/__init__.py | __version__ = (1, 1, 5, 'alpha', 0)
| Python | 0 | @@ -18,9 +18,9 @@
1,
-5
+7
, 'a
|
74a25caa15d0ab32d83355bc90cc415f5ff8cd1b | Remove unused imports. | exp/viroscopy/model/HIVEpidemicModelABC.py | exp/viroscopy/model/HIVEpidemicModelABC.py | """
A script to estimate the HIV epidemic model parameters using ABC.
"""
from apgl.graph.SparseGraph import SparseGraph
from apgl.graph.GraphStatistics import GraphStatistics
from apgl.util import *
from exp.viroscopy.model.HIVGraph import HIVGraph
from exp.viroscopy.model.HIVABCParameters import HIVABCParameters
from... | Python | 0 | @@ -71,109 +71,8 @@
%22%22%22%0A
-from apgl.graph.SparseGraph import SparseGraph%0Afrom apgl.graph.GraphStatistics import GraphStatistics
%0Afro
@@ -494,57 +494,8 @@
CSMC
-%0Afrom apgl.util.ProfileUtils import ProfileUtils
%0A%0Aim
@@ -557,28 +557,8 @@
sing
-%0Aimport scipy.stats
%0A%0AFO
|
eb5ab4abdc18f56ac21524225d5c1168ece35def | allow for category based link | generic/models.py | generic/models.py | from django.core.urlresolvers import reverse, Resolver404
from django.db import models
from preferences.models import Preferences
from snippetscream import resolve_to_name
class Link(models.Model):
title = models.CharField(
max_length=256,
help_text='A short descriptive title.',
)
view_n... | Python | 0 | @@ -453,19 +453,251 @@
ce over
-url
+Category and URL fields below.%22,%0A blank=True,%0A null=True,%0A )%0A category = models.ForeignKey(%0A 'category.Category',%0A help_text=%22Category to which this link will redirect. This takes %5C%0Aprecedence over URL
field b
@@ -971,19 +971... |
696521f33f397b6fa31183da182b8b41fb8d7808 | Move colon match to @bot only | slackbot/dispatcher.py | slackbot/dispatcher.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import re
import time
import traceback
from functools import wraps
import six
from slackbot.manager import PluginsManager
from slackbot.utils import WorkerPool
from slackbot import settings
logger = logging.getLogger(__name__)
class Mess... | Python | 0 | @@ -824,13 +824,13 @@
+)%5C%3E
+:?
%7B%7D)
-:?
?(?
|
455e1fe93b612c7049059cf217652862c995fe97 | Replace dict(<list_comprehension>) pattern with dict comprehension | import_export/instance_loaders.py | import_export/instance_loaders.py | from __future__ import unicode_literals
class BaseInstanceLoader(object):
"""
Base abstract implementation of instance loader.
"""
def __init__(self, resource, dataset=None):
self.resource = resource
self.dataset = dataset
def get_instance(self, row):
raise NotImplemented... | Python | 0.000003 | @@ -1649,14 +1649,9 @@
s =
-dict(%5B
+%7B
%0A
@@ -1659,17 +1659,16 @@
-(
self.pk_
@@ -1692,17 +1692,17 @@
nstance)
-,
+:
instanc
@@ -1702,17 +1702,16 @@
instance
-)
%0A
@@ -1737,10 +1737,18 @@
n qs
-%5D)
+%0A %7D
%0A%0A
|
ac8c1b6849c490c776636e3771e80344e6b0fb2e | Update github3.search.user for consistency | github3/search/user.py | github3/search/user.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .. import users
from ..models import GitHubCore
class UserSearchResult(GitHubCore):
def _update_attributes(self, data):
result = data.copy()
#: Score of the result
self.score = self._get_attribute(result, 'score')
... | Python | 0 | @@ -157,86 +157,155 @@
-def _update_attributes(self, data):%0A result = data.copy()%0A%0A #: S
+%22%22%22Representation of a search result for a user.%0A%0A This object has the following attributes:%0A%0A .. attribute:: score%0A%0A The confidence s
core
@@ -314,74 +314,52 @@
f th
-e
+... |
b15f401fe270b69e46fb3009c4d55c917736fb27 | Bump version | guild/__init__.py | guild/__init__.py | # Copyright 2017 TensorHub, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -694,17 +694,17 @@
.3.0.dev
-7
+8
%22%0A%0A__req
|
156817ee4e11c6a363511d915a9ea5cf96e41fb5 | add statistics tracking | benchbuild/experiments/mse.py | benchbuild/experiments/mse.py | """
Test Maximal Static Expansion.
This tests the maximal static expansion implementation by
Nicholas Bonfante (implemented in LLVM/Polly).
"""
from benchbuild.experiment import RuntimeExperiment
from benchbuild.extensions import RunWithTime, RuntimeExtension
from benchbuild.settings import CFG
class PollyMSE(Runtim... | Python | 0.000005 | @@ -138,16 +138,70 @@
y).%0A%22%22%22%0A
+from benchbuild.extensions import ExtractCompileStats%0A
from ben
@@ -632,40 +632,8 @@
r%22,%0A
- %22-mllvm%22, %22-stats%22,%0A
@@ -869,16 +869,88 @@
%5D%0A
+ project.compiler_extension = ExtractCompileStats(project, self)%0A
|
8a178f1249b968e315b8492ed15c033aca119033 | Reset closed site property | bluebottle/clients/tests/test_api.py | bluebottle/clients/tests/test_api.py | from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from rest_framework import status
from bluebottle.clients import properties
from bluebottle.test.utils import BluebottleTestCase
class ClientSettingsTestCase(BluebottleTestCase):
def setUp(self):
super(ClientSet... | Python | 0 | @@ -1462,28 +1462,79 @@
'topSecret', response.data)%0A
+%0A setattr(properties, 'CLOSED_SITE', False)%0A
|
e469163c5b103483b294f9c1f37c918177e7dbce | Make prsync.py really useful | admin/prsync.py | admin/prsync.py | #!/usr/bin/env python
import os
import sys
import subprocess
import urlparse
import pygithub3
try:
import angr
angr_dir = os.path.realpath(os.path.join(os.path.dirname(angr.__file__), '../..'))
except ImportError:
print 'Please run this script in the angr virtualenv!'
sys.exit(1)
def main(branch_nam... | Python | 0.000006 | @@ -319,16 +319,31 @@
ame=None
+, do_push=False
):%0A p
@@ -1049,12 +1049,18 @@
'pr/
-' +
+%25s-%25d' %25 (
prs%5B
@@ -1092,16 +1092,32 @@
':','/')
+, prs%5B0%5D.number)
%0A%0A fo
@@ -1563,32 +1563,56 @@
cwd=repo_path)%0A
+ if do_push:%0A
print '%5C
@@ -1676,32 +1676,36 @@
name, '%5C... |
9f32fee9da5ccffec9a86f62ab9a55625eb65ff7 | Fix menu user input | admin/wakeup.py | admin/wakeup.py | #!/bin/env python3
from pathlib import Path
import subprocess
def main():
main.path = Path(".config/wol.cfg")
main.path = main.path.home().joinpath(main.path)
# iterate wake on lan list, wollist
menu = generate_menulist(main.path)
if display_menu(menu):
hostname, hwadress = menu[main.user_c... | Python | 0.002013 | @@ -59,43 +59,86 @@
ess%0A
-%0Adef main():%0A main.
+import logging%0Aimport sys%0Alogger = logging.getLogger(__name__)%0A%0Awol_
path =
-Path(%22
+%22~/
.con
@@ -153,61 +153,130 @@
cfg%22
-)%0A main.path = main.path.home().joinpath(main.path
+%0A# TODO query list from database when available%0A%0Adef main()... |
3a3a8217bd5ff63c77eb4d386bda042cfd7a1196 | delete the depency to sale_order_extend | sale_order_report/__openerp__.py | sale_order_report/__openerp__.py | # -*- coding: utf-8 -*-
# © 2016 ClearCorp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Sale Order Report',
'summary': 'Sale order report in Qweb',
'version': '8.0.1.0',
'category': 'Sales',
'website': 'http://clearcorp.cr',
'author': 'ClearCorp',
'license'... | Python | 0.000001 | @@ -475,39 +475,8 @@
t',%0A
- 'sale_order_extended',%0A
|
7700e8b9a5a62fce875156482170c4fbc4cae902 | Update shortcut template | swjblog/polls/views.py | swjblog/polls/views.py | from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
# Create your views here.
from .models import Question
def index(request):
latest_question_list = Question.objects.order_by('-pub_date')[:5]
template = loader.get_template('polls/index.html')
cont... | Python | 0.000001 | @@ -1,40 +1,4 @@
-from django.shortcuts import render%0A
from
@@ -65,16 +65,71 @@
loader%0A
+from django.shortcuts import get_object_or_404, render%0A
%0A%0A# Crea
@@ -179,16 +179,18 @@
stion%0A%0A%0A
+#
def inde
@@ -201,16 +201,18 @@
quest):%0A
+#
late
@@ -273,20 +273,22 @@
e')%5B:5%5D%0A
+#
+
t... |
0e780569b8d40f3b9599df4f7d4a457f23b3f54f | Make uploader work | stoneridge_uploader.py | stoneridge_uploader.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import human_curl as requests
import stoneridge
class StoneRidgeUploader(o... | Python | 0.000035 | @@ -248,22 +248,8 @@
ort
-human_curl as
requ
@@ -644,55 +644,16 @@
f
-or upload in upload_files:%0A fname
+iles
=
+%7B
os.p
@@ -669,117 +669,176 @@
ame(
-upload)%0A with file(upload, 'rb') as f:%0A requests.post(self.url, files=((fname, f),)
+fname): open(fname, 'rb')%0... |
00216fef47b24c7c4d371cb350db7305d85e7d7b | fix link to numpy func | cupy/random/__init__.py | cupy/random/__init__.py | import numpy as _numpy
def bytes(length):
"""Returns random bytes.
.. note:: This function is just a wrapper for :meth:`numpy.random.bytes`.
The resulting bytes are generated on the host (NumPy), not GPU.
.. seealso:: :meth:`numpy.random.bytes
<numpy.random.mtrand.RandomState.by... | Python | 0 | @@ -118,20 +118,19 @@
er for :
-meth
+obj
:%60numpy.
|
3e784305acba4cc067d6f639032cacd97e1e3496 | Update N0bot.py | snapchat_bots/N0bot.py | snapchat_bots/N0bot.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
n0Bot - A bot for me, my friends and the world
Copyright (C) 2014 N07070
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of... | Python | 0 | @@ -1096,22 +1096,22 @@
*
-FbStoryBot V3*
+n0bot V3.1 *
|
5b1790664ad5268a1d1764b81d1fa7e8fea5aabe | Bump version number. | stormtracks/version.py | stormtracks/version.py | VERSION = (0, 5, 0, 5, 'alpha')
def get_version(form='short'):
if form == 'short':
return '.'.join([str(v) for v in VERSION[:4]])
elif form == 'long':
return '.'.join([str(v) for v in VERSION][:4]) + '-' + VERSION[4]
else:
raise ValueError('unrecognised form specifier: {0}'.format(... | Python | 0 | @@ -13,17 +13,17 @@
, 5, 0,
-5
+6
, 'alpha
|
f39720535c8b5814d01536623fc75f14cb84673d | Update comments | src/pycrunchbase/pycrunchbase.py | src/pycrunchbase/pycrunchbase.py | import requests
import six
from .resource import (
Acquisition,
FundingRound,
Organization,
Page,
Person,
Product,
)
@six.python_2_unicode_compatible
class CrunchBase(object):
"""Class that manages talking to CrunchBase API"""
BASE_URL = 'https://api.crunchbase.com/v/2/'
ORGANIZAT... | Python | 0 | @@ -621,30 +621,50 @@
rns
-details of first match
+the first%0A :class:%60Page%60 of results
%0A%0A
@@ -686,36 +686,28 @@
-Organization
+Page
or None%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.