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 |
|---|---|---|---|---|---|---|---|
4c2c86f77c457611d40b39ba36637f70974977f0 | fix flake8 | build.py | build.py | import shutil
from codecs import open
import json
__author__ = 'Samuel Gratzl'
def _git_head(cwd):
import subprocess
try:
output = subprocess.check_output(['git', 'rev-parse', '--verify', 'HEAD'], cwd=cwd)
return output.strip()
except subprocess.CalledProcessError:
return 'error'
def _resolve_plu... | Python | 0 | @@ -1323,16 +1323,17 @@
ce/'
+
+ name +
'/bu
@@ -1328,16 +1328,17 @@
+ name +
+
'/buildI
|
d828a83dba0f658daea485cddbe7352152eccd9d | fix synthese when using custom id | source/jormungandr/jormungandr/realtime_schedule/synthese.py | source/jormungandr/jormungandr/realtime_schedule/synthese.py | # coding=utf-8
# Copyright (c) 2001-2016, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility an... | Python | 0.000001 | @@ -4459,36 +4459,37 @@
top_id(self.
-rt_system_id
+object_id_tag
))%0A r
@@ -4534,28 +4534,29 @@
id(self.
-rt_system_id
+object_id_tag
))%0A
|
1542ae1382e03ffd9e21c0b2fa42588f3cd7353d | Implement queue.push which adds a runnable task to the queue | src/queue.py | src/queue.py | import psycopg2
import task
sql_template = """
CREATE TABLE IF NOT EXISTS pgtq_{1}_scheduled (
key INTEGER PRIMARY KEY,
not_before TIMESTAMP WITHOUT TIME ZONE,
task JSON,
retried INTEGER
);
CREATE INDEX CONCURRENTLY IF NOT EXISTS
ix_pgtq_{1}_scheduled_not_before ON pgtq_{1}_scheduled (not_before);
CREATE T... | Python | 0.000002 | @@ -401,32 +401,42 @@
retried INTEGER
+ DEFAULT 0
%0A);%0A%0ACREATE TABL
@@ -2309,30 +2309,458 @@
-raise NotImplementedError
+sql_template = %22%22%22%0A INSERT INTO pgtq_%7B1%7D_runnable (task) VALUES (%25s);%0A %22%22%22%0A sql = sql_template.format(self.name)%0A seralised_taks... |
2380d968273a45d5b8419a68a04622a67e15e24d | use context manager | pprof/experiments/papi.py | pprof/experiments/papi.py | """
PAPI based experiments.
These types of experiments (papi & papi-std) need to instrument the
project with libpprof support to work.
"""
from os import path
from pprof.experiment import (RuntimeExperiment, step, substep)
from pprof.experiments.raw import run_with_time
from pprof.utils.run import partial
from pprof.... | Python | 0.000051 | @@ -951,24 +951,28 @@
of.utils
+.run
import
run as r
@@ -967,16 +967,34 @@
ort
-run as r
+guarded_exec, handle_stdin
%0A
@@ -1204,55 +1204,13 @@
-run, session, retcode, _, stderr = %5C%0A r.
+with
guar
@@ -1232,21 +1232,16 @@
project
-.name
, experi
@@ -1248,31 +1248,35 @@
ment
-.name, pro... |
4a2144ce2c01c5675a7389d5600af4d96462e6d7 | edit ... | cache.py | cache.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Cache abstraction.
#
# Liang Wang @ Computer Lab, Cambridge University
# 2015.06.15
import time
from config import conf, logger
class Cache():
def __init__(self):
"""Init the cache."""
self._root = conf['image_dir']
self._quota = conf['... | Python | 0 | @@ -546,16 +546,64 @@
0 # fix%0A
+ self._cache%5Bsid%5D%5B'path'%5D = '' # fix%0A
|
97f53c98a2371d4d4d93b946868f3396a124a737 | bump 0.1.103 | djes/__init__.py | djes/__init__.py | import djes.signals # noqa
__version__ = "0.1.102"
default_app_config = "djes.apps.DJESConfig"
| Python | 0.000003 | @@ -47,9 +47,9 @@
1.10
-2
+3
%22%0A%0Ad
|
9e65c0715f7f202ec85d3da2f8416764fb47884e | send progressbar to stderr | progressbar.py | progressbar.py | #!/usr/bin/env python
"""
ASCII Progress Bar that work in IPython notebooks.
Code take from examples shown at:
<http://nbviewer.ipython.org/github/ipython/ipython/blob/3607712653c66d63e0d7f13f073bde8c0f209ba8/docs/examples/notebooks/Animations_and_Progress.ipynb>
Modified to include a timer and added an iterator tha... | Python | 0 | @@ -1046,16 +1046,33 @@
, end=''
+, file=sys.stderr
)%0A
@@ -1080,19 +1080,19 @@
sys.std
-out
+err
.flush()
@@ -1692,16 +1692,156 @@
%22 * 60))
+%0A print(%22%5Cr %5B COMPLETED %25d ITERATIONS IN %25.1f SECS %5D %25s%22 %25%0A (self.iterations, delta, %22 %22 * 60), file=sys.stde... |
ad78461fdd68349de1c44391a3ae10a45b6ba145 | Add a save feature | pyogi/plot.py | pyogi/plot.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from matplotlib import gridspec
csa_to_code = {
'OU': 1, 'HI': 2, 'KA': 3, 'KI': 4, 'GI': 5,
'KE': 6, 'KY': 7, 'FU': 8, 'RY': 22, 'UM': 23,
'NG': 24, 'NK': 26, 'NY': 27, 'TO': 28
}
... | Python | 0.000001 | @@ -361,30 +361,24 @@
a_list,
+save
path
-_materials
):%0A%0A
@@ -2503,16 +2503,64 @@
s_gote%0A%0A
+ if savepath:%0A plt.savefig(savepath)%0A%0A
plt.
@@ -2594,30 +2594,29 @@
(board,
-path_materials
+savepath=None
):%0A '
@@ -3210,25 +3210,19 @@
a_list,
+save
path
-_materials
)%0A%0A
|
f0e0ee6f4f8e34cf22213e827ba5993a1b3b91cb | Rename cli description | pypiup/cli.py | pypiup/cli.py | import os
import click
from pypiup.requirements import Requirements
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@click.command()
@click.option('--requirement', '-r', default='requirements.txt', type=click.STRING, help='Specify the path of the requirements file. Defaults to "requirements.t... | Python | 0.000006 | @@ -485,19 +485,10 @@
PyPI
- Up-to-date
+up
%5Cn%0A
|
dadf88fb3f0bb8398786b8b21ef19e2417871bf7 | Fix the AST definition for Empty | pypred/ast.py | pypred/ast.py | """
This module provides the AST nodes that are used to
represent and later, evaluate a predicate.
"""
class Node(object):
"Root object in the AST tree"
def __init__(self):
return
def pre(self, func):
"""
Performs a pre-order traversal of the
tree, and invokes a callback fo... | Python | 0.999999 | @@ -2410,19 +2410,21 @@
return%0A%0A
-def
+class
Empty(N
|
56c760c9c38c0acf40435d52396dcde9222ab4c7 | fix all sections are below the threshold case | pyvad/trim.py | pyvad/trim.py |
import numpy as np
from .vad import vad
def trim(data, fs, fs_vad=16000, hoplength=30, vad_mode=0, thr = 0.015):
""" Voice activity detection.
Trim leading and trailing silence from an audio signal by using vad.
Parameters
----------
data : ndarray
numpy array of mono (1 ch) speech data.
... | Python | 0.003874 | @@ -1689,24 +1689,29 @@
n(vact)-1))%0A
+ %0A
thr_ind=
@@ -1713,17 +1713,16 @@
_ind=%5B%5D%0A
-%0A
for
@@ -1863,16 +1863,64 @@
pend(i)%0A
+%0A if len(thr_ind) == 0:%0A return None%0A%0A
sec
|
22fb4ef3dedc05271038bdce3946b90c8c43238f | Improve selenium testcase abstraction | dimagi/utils/django/test.py | dimagi/utils/django/test.py | from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.remote.webelement import WebElement
from selenium.common.exceptions import (NoSuchElementException,
ElementNotVisibleException... | Python | 0.000521 | @@ -324,19 +324,67 @@
rom
-django.
+functools import wraps%0Aimport time%0A%0Atry:%0A from unit
test
+2
imp
@@ -400,63 +400,106 @@
ase%0A
-from django.conf import settings%0A
+except ImportError:%0A import sys%0A if sys.version_info %3E= (2.7):%0A
from
-f
un
-ctools
+ittest
import
wrap
@@ ... |
f1cfd5eb6fd7478f3ac3cdce0d4efd85013a400f | Migrate to TF | src/main/python/example/tensorflow_mnist.py | src/main/python/example/tensorflow_mnist.py | import io
import numpy as np
import tensorflow as tf
import collections
hidden_dim = 200
input_size = 28 * 28
output_size = 10
train_data_file = "/home/harper/dataset/mnist/"
train_label_file = "/home/harper/dataset/mnist/"
test_data_file = "/home/harper/dataset/mnist/"
test_label_file = "/home/harper/dataset/mnist/... | Python | 0.00005 | @@ -371,16 +371,17 @@
'train',
+
'test'%5D)
@@ -382,16 +382,17 @@
est'%5D)%0A%0A
+%0A
class Da
@@ -406,17 +406,16 @@
bject):%0A
-%0A
def
@@ -455,71 +455,358 @@
-pass%0A%0A def next_batch(self, batch_size):%0A return None
+self.data = data%0A self.label = label%0A perm = np.rand... |
8747219974bce5efbe1976910ce4860ada919343 | set default lines to blank strings | src/postal/models.py | src/postal/models.py | """
Model of Postal Address, could possibly use some ideas from
http://www.djangosnippets.org/snippets/912/ in the future
"""
# django imports
from django.db import models
from django.utils.translation import ugettext_lazy as _
# other imports
from countries.models import Country
class PostalAddress(models.Model):
... | Python | 0.000011 | @@ -360,32 +360,45 @@
max_length=100,
+ default=u'',
blank=True, nul
@@ -454,32 +454,45 @@
max_length=100,
+ default=u'',
blank=True, nul
@@ -548,32 +548,45 @@
max_length=100,
+ default=u'',
blank=True, nul
@@ -642,32 +642,45 @@
max_length=100,
+ default=u'',
blank=True, nul
@@ -744,16 +744,29 @@
gth=1... |
749daa5d86ce63bed61d1ef97db3a0971624bc91 | Make EventLoop more robust. | pydle/async.py | pydle/async.py | ## async.py
# Light wrapper around whatever async library pydle uses.
import functools
import tornado.concurrent
import tornado.ioloop
import tornado.gen
class Future(tornado.concurrent.TracebackFuture):
""" A future. """
def blocking(func):
""" Decorator for coroutine functions that need to block. """
r... | Python | 0 | @@ -3291,32 +3291,49 @@
ents(self, fd):%0A
+ try:%0A
self.io_
@@ -3351,24 +3351,120 @@
_handler(fd)
+%0A except KeyError:%0A # It's okay if there are no handlers yet.%0A pass
%0A%0A ev
@@ -4143,143 +4143,29 @@
ial(
-self._do_on_future, _callback, _args, _kwarg... |
dcd4919958840c2629625d4c36ef25f0c8657e07 | Fix tenant deletion | src/nodeconductor_saltstack/exchange/handlers.py | src/nodeconductor_saltstack/exchange/handlers.py | def increase_exchange_storage_usage_on_tenant_creation(sender, instance=None, created=False, **kwargs):
if created:
add_quota = instance.service_project_link.add_quota_usage
add_quota(instance.service_project_link.Quotas.exchange_storage, instance.mailbox_size * instance.max_users)
def decrease_ex... | Python | 0.000001 | @@ -1,20 +1,68 @@
+from nodeconductor.quotas.models import Quota%0A%0A%0A
def increase_exchang
@@ -431,24 +431,37 @@
**kwargs):%0A
+ try:%0A
add_quot
@@ -506,24 +506,28 @@
quota_usage%0A
+
add_quot
@@ -624,24 +624,134 @@
.max_users)%0A
+ except Quota.DoesNotExist:%0A # in case of cas... |
3f98dd6558ede25c425532e2cbe0c04125d1a6aa | Add api_key as param | pymdb/pymdb.py | pymdb/pymdb.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File : pymdb.py
# Author : Kaushik S Kalmady
# Date : 07.11.2015
# Last Modified Date: 07.11.2017
# Last Modified By : Kaushik S Kalmady
from __future__ import print_function
import json
import string
try:
from urllib.request imp... | Python | 0 | @@ -2394,24 +2394,33 @@
init__(self,
+ api_key,
title, year
@@ -2806,32 +2806,39 @@
com/?apikey=
-eed67065
+' + api_key + '
&'%0A u
|
173187577b4f7b8350083c4de84c6bded128fb0b | add testdroid_findDevice to chrome example | appium/sample-scripts/python/testdroid_chrome.py | appium/sample-scripts/python/testdroid_chrome.py | ##
## For help on setting up your machine and configuring this TestScript go to
## http://docs.testdroid.com/appium/
##
import os
import unittest
from appium import webdriver
from device_finder import DeviceFinder
from testdroid_utils import TDUtils
class TestdroidAndroid(unittest.TestCase):
def setUp(self):
... | Python | 0 | @@ -1128,16 +1128,97 @@
or '600'
+%0A testdroid_find_device = os.environ.get('TESTDROID_FINDDEVICE') or %22true%22
%0A%0A
@@ -2880,16 +2880,99 @@
_timeout
+%0A desired_capabilities_cloud%5B'testdroid_findDevice'%5D = testdroid_find_device
%0A%0A
|
5c809c1b2607e00e49d472be54e14a672c62d022 | Fix python import | python/test.py | python/test.py | #!/usr/bin/env python
from rgbmatrix import RGBMatrix
from random import randInt
import time
rows = 16
chains = 1
parallel = 1
ledMatrix = RGBMatrix(rows, chains, parallel)
height = ledMatrix.height
width = ledMatrix.width
for i in range(100):
ledMatrix.setPixel(randInt(0, width), randInt(0, height), randInt(0, 255),... | Python | 0.999815 | @@ -70,17 +70,17 @@
ort rand
-I
+i
nt%0Aimpor
@@ -258,25 +258,25 @@
etPixel(rand
-I
+i
nt(0, width)
@@ -277,25 +277,25 @@
width), rand
-I
+i
nt(0, height
@@ -297,25 +297,25 @@
eight), rand
-I
+i
nt(0, 255),
@@ -310,33 +310,33 @@
nt(0, 255), rand
-I
+i
nt(0, 255), rand
@@ -339,9 +339,9 @@
rand
-I
+i
nt(0
|
07767f689215582cc20de54aca0a829312bf9af6 | remove vestigal s3_client | pywren/wait.py | pywren/wait.py | from __future__ import absolute_import
try:
from six.moves import cPickle as pickle
except:
import pickle
from tblib import pickling_support
import time
from multiprocessing.pool import ThreadPool
pickling_support.install()
from pywren.future import JobState
import pywren.storage as storage
import pywren.wren... | Python | 0 | @@ -466,32 +466,16 @@
UR_SEC=5
-, s3_client=None
):%0A %22
@@ -1299,72 +1299,8 @@
SIZE
-, %0A s3_client=s3_client
)%0A
@@ -1872,24 +1872,8 @@
SIZE
-, s3_client=None
):%0A
|
c71ebaea73d89230dd3b7b029528eb29cf826c8d | Add embed plugins in ckeditor | qc/settings.py | qc/settings.py | # Django settings for qc project.
import os
import dj_database_url
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse_lazy
def get_env_variable(var_name):
""" Get the environment variable or return exception """
try:
return os.environ[var_name]
ex... | Python | 0 | @@ -6465,16 +6465,70 @@
olink',%0A
+ 'autoembed',%0A 'embed',%0A
|
94b9b82b62d20e4f5df5043d4ac4a479cbe03ab6 | Implement the revisions method | waterbutler/s3/provider.py | waterbutler/s3/provider.py | import os
import asyncio
import hashlib
from lxml import objectify
from boto.s3.connection import S3Connection
from waterbutler.core import streams
from waterbutler.core import provider
from waterbutler.core import exceptions
from waterbutler.s3 import settings
from waterbutler.s3.metadata import S3FileMetadata
from... | Python | 0.000467 | @@ -258,16 +258,63 @@
ettings%0A
+from waterbutler.s3.metadata import S3Revision%0A
from wat
@@ -5657,8 +5657,731 @@
de=404)%0A
+%0A @asyncio.coroutine%0A def revisions(self, path, **kwargs):%0A %22%22%22Get past versions of the requested key%0A :param str path: The path to a key%0A :rtype... |
30fd242c2f2cb5d7d53a7f486237c329df5739c9 | Fix print errors | queen/queen.py | queen/queen.py | """Queen
Creates the majestic queen bot.
"All your drones are belong to her".
Arguments
None
"""
import time
import communication as comms
import helpers
import multiprocessing
class SwarmState(object):
"""Swarm State
Represents the current state of the swarm. Used to make decisions and must be passed to an... | Python | 0.740916 | @@ -1260,34 +1260,47 @@
)%0A%09%09%09print '
-Processing
+Dispatching routing for
drone ID %25s
@@ -1305,9 +1305,9 @@
%25s'
-&
+%25
(dr
@@ -1659,22 +1659,28 @@
%09print '
-Reciev
+Sending queu
ed messa
|
9f72be39536ca121b61be32b8d2b168d970327f9 | add destructor for bus class | src/bus.py | src/bus.py | # -*- python -*-
'''
MIT/X Consortium License
Copyright © 2015 Mattias Andrée <maandree@member.fsf.org>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without lim... | Python | 0 | @@ -1852,32 +1852,129 @@
None%0A %0A %0A
+ def __del__(self):%0A '''%0A Destructor%0A '''%0A self.close()%0A %0A %0A
def create(s
|
3d861bf5d3b9b558757eee9bcc2df17002716b61 | correct routing | Contents/Code/interface/menu.py | Contents/Code/interface/menu.py | # coding=utf-8
from subzero import restart, intent
from subzero.constants import TITLE, ART, ICON, PREFIX, PLUGIN_IDENTIFIER
from support.config import config
from support.helpers import pad_title, encode_message, decode_message
from support.storage import resetStorage
from support.items import getRecentlyAddedItems, ... | Python | 0.000032 | @@ -1009,24 +1009,36 @@
OnDeckMenu(
+message=None
):%0A retur
@@ -1134,16 +1134,33 @@
on_deck%22
+, message=message
)%0A%0A@rout
@@ -1199,24 +1199,36 @@
lyAddedMenu(
+message=None
):%0A retur
@@ -1337,16 +1337,33 @@
/recent%22
+, message=message
)%0A%0Adef m
@@ -1415,24 +1415,38 @@
me_from=None
+, messa... |
33fe14b5d49e262fa00cdeb73ceed37a00232f22 | Remove old commented code | dockci/server.py | dockci/server.py | """
Functions for setting up and starting the DockCI application server
"""
import logging
import mimetypes
import os
from contextlib import contextmanager
import click
import pika
import redis
import rollbar
from .util import project_root
class Config(object): # pylint:disable=too-many-instance-attributes
""... | Python | 0.000001 | @@ -1303,34 +1303,8 @@
%22%22%22%0A
- # app_init_rollbar()%0A%0A
|
d02b834f511c6dfddfcd12686ac89f0af2503b66 | Fix repr method | raco/scheme.py | raco/scheme.py | import boolean
from collections import OrderedDict
import expression
class DummyScheme:
"""Dummy scheme used to generate plans in the absence of catalog info."""
def __len__(self):
return 0
def __repr__(self):
return "DummyScheme"
class Scheme:
'''
Add an attribute to the scheme
Type is a function th... | Python | 0.000002 | @@ -238,16 +238,18 @@
myScheme
+()
%22%0A%0Aclass
|
3b5fcb0340fa93d24001b35152d48601cd3c13fb | rm is a synonym of uninstall | yotta/main.py | yotta/main.py | # standard library modules, , ,
import argparse
import logging
import sys
import pkg_resources
# subcommand modules, , add subcommands, internal
from . import version
from . import link
from . import link_target
from . import install
from . import update
from . import target
from . import build
from . import init
from... | Python | 0.999982 | @@ -3475,16 +3475,65 @@
nstall'%5D
+,%0A 'rm':subparser.choices%5B'uninstall'%5D
%0A %7D)%0A
|
b2c53260ae73b01b21452852b932e1febda66746 | Improve Bluetooth serial reliability. | libpebble2/communication/transports/serial.py | libpebble2/communication/transports/serial.py | from __future__ import absolute_import
__author__ = 'katharine'
import serial
import struct
from . import BaseTransport, MessageTargetWatch
from libpebble2.exceptions import ConnectionError
class SerialTransport(BaseTransport):
"""
Represents a direct connection to a physical Pebble paired to the computer v... | Python | 0 | @@ -58,16 +58,29 @@
arine'%0A%0A
+import errno%0A
import s
@@ -906,32 +906,49 @@
connect(self):%0A
+ try:%0A
self.con
@@ -994,19 +994,146 @@
5200
-, timeout=5
+)%0A except OSError as e:%0A if e.errno == errno.EBUSY:%0A raise ConnectionError(%22Could not connect ... |
5d4a2707a956525d18d6ac14fb02ca02adfdfcaa | Fix task to pull the correct user | sso/tasks.py | sso/tasks.py | from celery.decorators import task
from eve_api.models import EVEAccount, EVEPlayerCorporation, EVEPlayerAlliance
from sso.models import ServiceAccount
from django.contrib.auth.models import User
from django.db.models import signals
# Signals that the tasks need to listen for
def eveapi_deleted(sender, instance, **kwa... | Python | 0.01801 | @@ -580,16 +580,54 @@
ps %22%22%22%0A%0A
+ user = User.objects.get(id=user)%0A%0A
# Cr
|
23a86b3b3941e5336844168ad8c9ba7e995392de | Handle bytes output of python3 subprocess.check_output. | starforge/packaging/setup.py | starforge/packaging/setup.py | """ setuptools/distutils hackery
"""
import json
import sys
from os import (
getcwd,
rename
)
from os.path import (
exists,
join
)
from subprocess import check_output, CalledProcessError
from ..io import (
debug,
error,
warn
)
IMPORT_INTERFACE_WHEEL = 'import starforge.interface.wheel'
IM... | Python | 0 | @@ -2504,22 +2504,21 @@
d))%0A
-return
+out =
check_o
@@ -2537,8 +2537,90 @@
wd=cwd)%0A
+ if sys.version_info %3E= (3,):%0A out = out.decode('UTF-8')%0A return out%0A
|
254ea51140c1c7ede701f4844bc8c297edabab84 | Add linked list class | linked-list/reverse-linked-list.py | linked-list/reverse-linked-list.py | # reverse singly linked list
class Node(object): # define constructor
def __init__(self, data):
self.data = data
self.next = None
| Python | 0.000001 | @@ -129,8 +129,86 @@
= None%0A
+%0Aclass LinkedList(object):%0A%09def __init__(self, head=None):%0A%09%09self.head = head%0A
|
400add8a3e80cd82df9bd9b5af7173c975c3d1eb | Version 0.6.0 | livinglots_usercontent/__init__.py | livinglots_usercontent/__init__.py | # -*- coding: utf-8 -*-
__version__ = '0.5.0'
| Python | 0.000001 | @@ -38,9 +38,9 @@
'0.
-5
+6
.0'%0A
|
f319d20d6ddb07131d15034698197e0d284ae0e3 | Fix publishing for access control experiment | lms/djangoapps/courseware/rules.py | lms/djangoapps/courseware/rules.py | """
django-rules and Bridgekeeper rules for courseware related features
"""
from __future__ import absolute_import
import logging
import laboratory
import rules
from bridgekeeper.rules import Rule, EMPTY
from course_modes.models import CourseMode
from django.conf import settings
from django.db.models import Q
from op... | Python | 0.000001 | @@ -123,16 +123,33 @@
logging
+%0Aimport traceback
%0A%0Aimport
@@ -2098,16 +2098,22 @@
(control
+.value
) == can
@@ -2118,16 +2118,22 @@
andidate
+.value
%0A%0A de
@@ -2186,16 +2186,17 @@
.match:%0A
+%0A
@@ -2277,16 +2277,20 @@
idate=%25r
+%5Cn%25s
%22,%0A
@@ -2374,21 +2374,49 @@
-exc... |
58adb6fb5e626fc0e054ee2dba3dc78a05a6cabe | Fix EmergingThreats_MalwareInfo data type check | analyzers/EmergingThreats/emergingthreats_analyzer.py | analyzers/EmergingThreats/emergingthreats_analyzer.py | #!/usr/bin/env python
# encoding: utf-8
from cortexutils.analyzer import Analyzer
import requests
import time
RED_CATEGORIES = [
"Blackhole", "Bot", "Brute_Forcer", "CnC",
"Compromised", "DDoSAttacker", "DDoSTarget",
"DriveBySrc", "Drop", "EXE_Source",
"FakeAV", "Mobile_CnC", "Mobile_Spyware_CnC",
... | Python | 0 | @@ -2565,23 +2565,20 @@
ype == '
-malware
+hash
':%0A
|
f7bbe462b7b1c1eb61848829ac870b6a936bc8c9 | Fix creation of Triples -- supply the query param. | marry-fuck-kill/triple_handlers.py | marry-fuck-kill/triple_handlers.py | #!/usr/bin/env python
#
# Copyright 2010 Hunter Freyer and Michael Kelly
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Python | 0 | @@ -3258,24 +3258,73 @@
ties%5B0%5D%5B'u'%5D
+,%0A entities%5B0%5D%5B'q'%5D
)%0A tw
@@ -3374,24 +3374,73 @@
ties%5B1%5D%5B'u'%5D
+,%0A entities%5B0%5D%5B'q'%5D
)%0A th
@@ -3496,16 +3496,67 @@
%5B2%5D%5B'u'%5D
+,%0A ... |
ab0f5f71ff5a5e89b6eb511fedca8aa51389ea6f | grep question ok, grep tags ok, todo: grep answers | stackof.py | stackof.py | import re
import goslate
import requests
from collections import deque
from urllib.request import Request, urlopen
page_list = deque()
visited = set()
for i in range(1, 2):
url = str.format("http://stackoverflow.com/questions?page={0}&sort=newest", i)
page_list.append(url)
def judge_cur_link(link, visited)... | Python | 0.999999 | @@ -279,16 +279,139 @@
d(url)%0A%0A
+page_list = %5B%22http://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array%22%5D%0A
%0Adef jud
@@ -1263,17 +1263,16 @@
se.text%0A
-%0A
html
@@ -1359,25 +1359,24 @@
'%3C/td%3E')%5B0%5D%0A
-%0A
question
@@ -1482,17 +1482,... |
b52ff68324bef3883d8c6e176ccd646d65c62b46 | Add repo score calculation | score_repo.py | score_repo.py | #!/usr/bin/env python3
import argparse
import importlib
import json
import sys
def loadAttributePlugins(attributes):
for attribute in attributes:
try:
attribute['implementation'] = importlib.import_module("attributes.{0}.main".format(attribute['name']))
except ImportError:
print("Failed to load ... | Python | 0.000001 | @@ -1197,16 +1197,28 @@
butes)%0A%0A
+ score = 0%0A
for at
@@ -1306,23 +1306,16 @@
o_path,
-config%5B
attribut
@@ -1315,17 +1315,16 @@
ttribute
-%5D
%5B'option
@@ -1327,16 +1327,58 @@
tions'%5D)
+%0A score += result * attribute%5B'weight'%5D
%0A%0Aif __n
|
4858af4e946919b80de6e67204f5a2925bc85800 | Fix backward compatible functions in scrapy.log | scrapy/log.py | scrapy/log.py | """
This module is kept to provide a helpful warning about its removal.
"""
import logging
import warnings
from twisted.python.failure import Failure
from scrapy.exceptions import ScrapyDeprecationWarning
logger = logging.getLogger(__name__)
warnings.warn("Module `scrapy.log` has been deprecated, Scrapy now relies... | Python | 0.000002 | @@ -717,16 +717,21 @@
(message
+=None
, _level
@@ -744,32 +744,32 @@
ng.INFO, **kw):%0A
-
warnings.war
@@ -968,16 +968,269 @@
_level)%0A
+ message = kw.pop('format', message)%0A # NOTE: logger.log doesn't handle well passing empty dictionaries with format%0A # arguments because of some weird use-case:... |
7d30d2a75eae1fe462b91d441f812d0d3c2870c5 | Fix a bug of image summary | nn/conv.py | nn/conv.py | import functools
import tensorflow as tf
from .util import funcname_scope, static_rank, static_shape
from .variable import variable
from .assertion import is_natural_num, is_natural_num_sequence
from .random import sample_crop
from .summary import image_summary, num_of_summary_images
@funcname_scope
def multi_conv_... | Python | 0.000126 | @@ -797,16 +797,25 @@
anspose(
+%0A
sample_c
@@ -824,16 +824,19 @@
p(h, 1)%5B
+0,
:, :, :n
@@ -858,39 +858,16 @@
mages%5D,%0A
-
|
24dee6bb5025b24cfe6d95555fd85e392bb4f412 | Remove what i was using as a refrence for the gl calls. | cubix/core/opengl/pgl.py | cubix/core/opengl/pgl.py | import ctypes as ct
from cubix.core.pycompat import *
from cubix.core.opengl import gl
from cubix.core.opengl import typeutils
from cubix.core.opengl.typeutils import conv_list_2d, is_sequence
from cubix.core.opengl.typeutils import conv_list, cast_ptr
'''
Python GL Wrapper for opengl for cleaner access.
Similar to P... | Python | 0 | @@ -3448,85 +3448,4 @@
rams
-%0A%0AGLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
|
7a242b49ef3c18a166299e64f0f283a333d8c583 | Bump to 3.0.13 dev. | reviewboard/__init__.py | reviewboard/__init__.py | """Review Board version and package information.
These variables and functions can be used to identify the version of
Review Board. They're largely used for packaging purposes.
"""
from __future__ import unicode_literals
#: The version of Review Board.
#:
#: This is in the format of:
#:
#: (Major, Minor, Micro, Pat... | Python | 0 | @@ -389,29 +389,30 @@
0, 1
-2
+3
, 0, '
-final
+alpha
', 0,
-Tru
+Fals
e)%0A%0A
|
975b1f2cb1be68d542f1f03f126451d6f8d6929e | Optimise AbstractXmlWriter _escape performance .. seems to improve robot run time by 3-4% | src/robot/utils/abstractxmlwriter.py | src/robot/utils/abstractxmlwriter.py | # Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# 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... | Python | 0.000001 | @@ -597,16 +597,26 @@
License.
+%0Aimport re
%0A%0Afrom u
@@ -795,16 +795,89 @@
%5Cufffe'%0A
+_ILLEGAL_CHARS_IN_XML_PATTERN = re.compile('%5B'+_ILLEGAL_CHARS_IN_XML+'%5D')
%0A%0Aclass
@@ -1305,55 +1305,8 @@
nt)%0A
- for char in _ILLEGAL_CHARS_IN_XML:%0A
@@ -1379,106 +1379,60 @@
- if char... |
f30418372436421c7ee44e90f65e97d8e80b1f33 | add missing include | ribolands/crnwrapper.py | ribolands/crnwrapper.py | #
# Coded by: Stefan Badelt <stef@tbi.univie.ac.at>
# University of Vienna, Department of Theoretical Chemistry
#
# -*- Style -*-
# Use double quotes or '#' for comments, such that single quotes are available
# for uncommenting large parts during testing
#
# *) do not exceed 80 characters per line
# *) indents:... | Python | 0.000003 | @@ -493,16 +493,55 @@
essError
+%0Afrom crnsimulator import ReactionGraph
%0A%0Adef Di
|
bde5ad6bc6eb139d287ea7831ba3b54706d2bc38 | Fix interrupt name if not listed. | plugins/dstat_top_int.py | plugins/dstat_top_int.py | ### Author: Dag Wieers <dag@wieers.com>
class dstat_plugin(dstat):
"""
Top interrupt
Displays the name of the most frequent interrupt
"""
def __init__(self):
self.name = 'most frequent'
self.vars = ('interrupts',)
self.type = 's'
self.width = 20
self.scale =... | Python | 0 | @@ -1281,47 +1281,180 @@
-self.val%5B'name'%5D = self.names%5Bstr(i+1)%5D
+if str(i+1) in self.names.keys():%0A self.val%5B'name'%5D = self.names%5Bstr(i+1)%5D%0A else:%0A self.val%5B'name'%5D = 'int ' + str(i+1)
%0A
|
4be389ad8d1c6a06483b81aa20eca4be62bfbc12 | Enable debug output of foreman inside builder pod | shipyard2/shipyard2/builders/build.py | shipyard2/shipyard2/builders/build.py | __all__ = [
'cmd_build',
]
import contextlib
import json
import logging
import tempfile
from pathlib import Path
import foreman
import g1.containers.bases
import g1.containers.images
import g1.containers.pods
from g1.bases import argparses
from g1.bases.assertions import ASSERT
from shipyard2 import builders
L... | Python | 0 | @@ -4589,16 +4589,19 @@
%22 build
+%25s
%25s' %25 (%0A
@@ -4652,16 +4652,74 @@
.get(),%0A
+ '--debug' if builders.is_debug() else '',%0A
|
6b9b9fa0089882b22739b08e241a71a9d1870927 | Add missing return in error condition (movies) | plugins/movies/plugin.py | plugins/movies/plugin.py | import logging
import re
from urllib.parse import urlparse
from twisted.internet import defer
from twisted.internet.threads import deferToThread
import requests
from cardinal.decorators import command, event, help
from cardinal.exceptions import EventRejectedMessage
from cardinal.util import F
def format_data_short... | Python | 0.000002 | @@ -4416,16 +4416,39 @@
str(e))%0A
+ return%0A
@@ -4539,16 +4539,39 @@
rching%22)
+%0A return
%0A%0A
|
4a97f824e48b54d4633a3c3291c61fc6e5f3fafc | Allow multi-profile style files with just a single profile | pocean/dsg/profile/om.py | pocean/dsg/profile/om.py | #!python
# coding=utf-8
import six
from copy import copy
from collections import OrderedDict
import numpy as np
import pandas as pd
from pocean.utils import (
generic_masked,
get_default_axes,
get_mapped_axes_variables,
get_masked_datetime_array,
normalize_array,
normalize_countable_array,
)
f... | Python | 0 | @@ -1708,120 +1708,8 @@
2%0A%0A
- ps = normalize_array(pvar)%0A is_single = isinstance(ps, six.string_types) or ps.size == 1%0A
%0A
@@ -1928,16 +1928,158 @@
ns%5B0%5D%5D%0A%0A
+ ps = normalize_array(pvar)%0A is_single = isinstance(ps, six.string_types) or (ps.size == 1... |
606f151e2909d16436d5f2480dccf7a61fd3428f | add first_name and last_name to profile | podhub/website/models.py | podhub/website/models.py | from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.func import now
import sqlalchemy
import uuid
from . import db
class Base(db.Model):
id = db.Column(UUID, default=lambda: str(uuid.uuid4()), primary_key=True)
created_at = db.Column(db.DateTime(), default=now())
updated_at = db.Column(
... | Python | 0.000001 | @@ -892,24 +892,131 @@
nique=True)%0A
+ first_name = db.Column(db.String(80), index=True)%0A last_name = db.Column(db.String(80), index=True)%0A
user_id
@@ -1099,16 +1099,66 @@
, email,
+ first_name=None, last_name=None,%0A
display
@@ -1355,12 +1355,84 @@
isplay_name%0A
+ self.fi... |
e0f9c113956078577e3dca420358a203c7f3ed95 | Remove the __main__ function in the script since its in the cli now | ponytools/cli/sortVCF.py | ponytools/cli/sortVCF.py | #!/usr/bin/env python3
import sys
import tempfile
from optparse import OptionParser
def log(message,*formatting):
print(message.format(*formatting),file=sys.stderr)
def sortVCF(args):
import sys,os
vcf_file = args.vcf
fasta_file = args.fasta
temp_dir="/tmp"
out = args.out
headers = list(... | Python | 0.000002 | @@ -1800,413 +1800,4 @@
e()%0A
-%0Adef main(args):%0A parser=OptionParser()%0A parser.add_option('--vcf',help='unsorted VCF file')%0A parser.add_option('--fasta',help='fasta file')%0A parser.add_option('--out',default='sorted.vcf',help='output name %5Bdefault: sorted.vcf%5D')%0A%0A options,args = parser... |
b1b3504b561a9b4f45664b7c4a69e9604600817e | Fix migration | softdelete/migrations/0001_initial.py | softdelete/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
migrations.CreateModel(
... | Python | 0.000006 | @@ -224,34 +224,17 @@
'000
-2_remove_content_type_name
+1_initial
'),%0A
@@ -585,37 +585,40 @@
models.
-PositiveIntegerField(
+CharField(max_length=100
)),%0A
@@ -1060,29 +1060,32 @@
els.
-PositiveIntegerField(
+CharField(max_length=100
)),%0A
|
27c9da3129c6fbdd8d54276cf054c1f46e665aaf | Remove trailing slashes, add origin url to responses | flask_app.py | flask_app.py | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
import slack
app = Flask(__name__)
cache = Cache(app, config={"CACHE_TYPE": "simple"})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
app.register_blueprint(slack.blueprint, url_prefix="/api/slack")... | Python | 0 | @@ -1,48 +1,23 @@
-from flask
import
-F
+f
lask
-, abort, jsonify%0Afrom
+%0Aimport
fla
@@ -30,49 +30,26 @@
hing
-
+%0A
import
-Cache%0Afrom flask_cors import CORS
+flask_cors
%0A%0Aim
@@ -78,16 +78,22 @@
%0A%0Aapp =
+flask.
Flask(__
@@ -108,16 +108,30 @@
cache =
+flask_caching.
Cache(ap
@@ -173,16 +17... |
20a338cee6ba47ba10d7f9f3672f894c2b6e3a11 | replace directly accessed profile parameters with the getters for failing tests | corehq/apps/app_manager/suite_xml/generator.py | corehq/apps/app_manager/suite_xml/generator.py | from distutils.version import LooseVersion
from django.urls import reverse
import six.moves.urllib.error
import six.moves.urllib.parse
import six.moves.urllib.request
from corehq.apps.app_manager import id_strings
from corehq.apps.app_manager.exceptions import MediaResourceError
from corehq.apps.app_manager.suite_xm... | Python | 0 | @@ -5832,34 +5832,54 @@
lse%0A
-if
+lazy_load_preference =
self.app.profil
@@ -5879,17 +5879,21 @@
.profile
-%5B
+.get(
'propert
@@ -5900,10 +5900,18 @@
ies'
-%5D%5B
+, %7B%7D).get(
'laz
@@ -5934,17 +5934,78 @@
a-files'
-%5D
+)%0A if lazy_load_preference and lazy_load_preference
== 'tru... |
5064a88a5a2d783c07e2b97ca5d9b4b5ad9f3d9b | disable standalone mode | server/app.py | server/app.py | from bottle import route, request, error, abort, static_file
from bottle import template, jinja2_view
import bottle, waitress, os, glob, string, pprint
cache = dict()
def find_file(type, name):
""" searches file within directory by name, ignoring extension and case """
assert type.isalpha() and name.replace('-', ... | Python | 0.000001 | @@ -2727,82 +2727,8 @@
')%0A%0A
-if __name__ == '__main__':%0A waitress.serve(bottle.default_app())%0Aelse:%0A
wait
|
321315ace07f569263711de207b19a0926492962 | Fix typo | server/env.py | server/env.py | # Copyright (c) 2016, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
'''Class for handling environment configuration and defaults.'''
import resource
from collections import namedtuple
from ipaddress import ip_address
from os... | Python | 0.999999 | @@ -5813,20 +5813,16 @@
if not
-tor_
host.end
|
de1e7f254d76e3ac7b3d547b35541eea3d83b74a | define main() | footInput.py | footInput.py | #!/usr/bin/env python
'''
v0.2 2016 Apr 23
- change interval to 10 msec base for UDP comm
v0.1 2016 Apr 23
- can check 5 GPIO input
'''
import RPi.GPIO as GPIO
import time
import os
GPIO.setmode(GPIO.BOARD)
ins = [40, 38, 36, 32, 26]
for idx in range(5):
GPIO.setup(ins[idx], GPIO.IN, pull_up_down=GPIO.PUD_UP... | Python | 0.000003 | @@ -33,24 +33,42 @@
2016 Apr 23%0A
+ - define main()%0A
- change i
@@ -200,16 +200,32 @@
ort os%0A%0A
+def main():%0A
GPIO.set
@@ -241,16 +241,20 @@
.BOARD)%0A
+
ins = %5B4
@@ -272,16 +272,20 @@
32, 26%5D%0A
+
for idx
@@ -293,24 +293,28 @@
n range(5):%0A
+
GPIO.set
@@ -362,16 +362,20 @... |
546515803f8f3667b98eed4b3e72fbc074c0e6ec | Fix managed installs.py | app/modules/managedinstalls/scripts/managedinstalls.py | app/modules/managedinstalls/scripts/managedinstalls.py | #!/usr/bin/python
"""
Filter the result of /Library/Managed Installs/ManagedInstallReport.plist
to only the parts that represent the installed items
"""
import plistlib
import sys
import os
DEBUG = False
MANAGED_INSTALL_REPORT = '/Library/Managed Installs/ManagedInstallReport.plist'
# Skip manual check
if len(sys.ar... | Python | 0.000001 | @@ -1292,19 +1292,11 @@
list
-, status
):%0A
+
@@ -1422,22 +1422,25 @@
tatus':
-status
+'removed'
,%0A
@@ -1834,32 +1834,32 @@
'%0A else:%0A
-
inst
@@ -1911,16 +1911,398 @@
_failed'
+%0A %0A # Sometimes an item is only in RemovalResults, so we have to add%0A ... |
5cc2962024117deb84a29301f57be791c9fed5e9 | add report | datahub/tests/functional/test_rule_detector.py | datahub/tests/functional/test_rule_detector.py | # -*- coding: utf-8 -*-
# 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, softw... | Python | 0 | @@ -1019,12 +1019,8 @@
ase.
-Base
Test
@@ -2950,117 +2950,1092 @@
-for out in outs:%0A LOG.info('==============')%0A LOG.info(str(out)
+total = 0%0A title = 0%0A date = 0%0A content = 0%0A a... |
d089f15e16b2a938163f91a29ebaaf77213303bb | Remove unused constant | g2sd/g2sd.py | g2sd/g2sd.py | from typing import Iterable, NamedTuple, List
from re import compile
from collections import namedtuple
from subprocess import getoutput
from pathlib import Path
from sys import exit
import logging
import click
PREFIX = 'test'
SUFFIX = "g2sd"
RC_PARSE_ERR = 1
NAME_RE = compile("menuentry '(?P<name>[\w\d\W\D]*)' -")... | Python | 0.000045 | @@ -211,24 +211,8 @@
k%0A%0A%0A
-PREFIX = 'test'%0A
SUFF
|
6e26667c65c619601eadfec487d203ea0e47f83b | Remove unnecessary checks and round() the quantity | gf-export.py | gf-export.py | from Robinhood import Robinhood
import getpass
import collections
import argparse
import ast
logged_in = False
# hard code your credentials here to avoid entering them each time you run the script
username = ""
password = ""
parser = argparse.ArgumentParser(description='Export Robinhood trades to a CSV file')
parser... | Python | 0.000005 | @@ -4601,103 +4601,8 @@
ys:%0A
- if str(fields%5Brow%5D%5B%22state%22%5D) == %22filled%22 and str(fields%5Brow%5D%5B%22cancel%22%5D) == %22None%22:%0A
@@ -4606,28 +4606,24 @@
try:%0A
-
@@ -4632,105 +4632,53 @@
key
-!=%22state%22 and key!=%22cancel%22:%0A ... |
c04ef32ca687e8a941716c078788c45b55c42f7e | Add temporary functions for testing | ggd/utils.py | ggd/utils.py | from __future__ import print_function
import os
import sys
import glob
from git import Repo
LOCAL_REPO_DIR = os.getenv("GGD_LOCAL", os.path.expanduser("~/.config/"))
RECIPE_REPO_DIR = os.path.join(LOCAL_REPO_DIR, "ggd-recipes")
GITHUB_URL = "https://github.com/gogetdata/ggd-recipes.git"
def get_species():
update... | Python | 0 | @@ -422,16 +422,81 @@
s_dir)%0A%0A
+'''**************%0ATODO:%0AHard Coded%0ANEED TO FIX%0A**************'''%0A
## Recip
@@ -793,16 +793,429 @@
e_dir)%0A%0A
+'''**************%0ATODO:%0AHard Coded%0ANEED TO FIX%0A**************'''%0Adef get_channel_data(ggd_channel):%0A%09update_local_repo()%0A%09#channeldata_path =... |
576877b8dfd3e93e9aed88d7ba969afdc52e9980 | Add param bind IP | go_samba4.py | go_samba4.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
https://realpython.com/introduction-to-flask-part-1-setting-up-a-static-site/
https://www.digitalocean.com/community/tutorials/how-to-structure-large-flask-applications
https://github.com/stgraber/samba4-manager
https://github.com/baboons/samba4-gaps
pyinstaller -F -... | Python | 0.000001 | @@ -2762,16 +2762,153 @@
e SSL%22)%0A
+ parser.add_option(%22--host%22, action=%22store%22, type=%22string%22,%0A dest=%22HOST%22, default=%220.0.0.0%22, help=%22Host IP Bind%22)
%0A%0A op
@@ -3065,16 +3065,35 @@
er_prod(
+host=options.HOST,
ssl=opti
@@ -3147,16 +3147,35 @@
ver_dev(
+ho... |
8b264f35d82c5378cc9c0ea9b63cc02a165d5251 | Fix the inversed Y coordinate of a point. | graph-gui.py | graph-gui.py | #!/usr/bin/python3
import sys
from collections import namedtuple
from PyQt5.QtWidgets import (QApplication, QWidget, QDesktopWidget,
QFrame, QPushButton)
from PyQt5.QtGui import QPainter, QColor, QPen
from PyQt5.QtCore import Qt, QPoint
class Grapher(QWidget):
def __init__(self):
super().__... | Python | 0.003218 | @@ -1353,17 +1353,16 @@
0, 7))%0A%0A
-%0A
def
@@ -1711,33 +1711,33 @@
f.axis_midpoint
-+
+-
self.grid_scale
|
f7545f2b33e46a8ee450948835013c819e582e66 | Add missing json import. | haas/http.py | haas/http.py | """Module http handles all of the http-related logic for the HaaS.
HaaS is a wsgi application built on top of werkzeug. the function `wsgi_handler`
is the wsgi entry point to the app.
The decorator `rest_call` and the class `APIError` are the main things of
interest in this module.
"""
import logging
import inspect
f... | Python | 0 | @@ -312,16 +312,28 @@
inspect%0A
+import json%0A
from fun
|
0d422891c62a5e876b6ed2dea55addaf13f0f41f | Update make.py | hack/make.py | hack/make.py | #!/usr/bin/env python
# http://stackoverflow.com/a/14050282
def check_antipackage():
from sys import version_info
sys_version = version_info[:2]
found = True
if sys_version < (3, 0):
# 'python 2'
from pkgutil import find_loader
found = find_loader('antipackage') is not None
... | Python | 0.000001 | @@ -1475,16 +1475,25 @@
'amd64'
+, 'arm64'
%5D%0A
|
46e8002729b758639a0b1c1e9da59f380ca567db | Fix typo 'localtion' -> 'location' | test_elasticsearch_dsl/test_integration/test_examples/test_parent_child.py | test_elasticsearch_dsl/test_integration/test_examples/test_parent_child.py | from datetime import datetime
from pytest import fixture
from elasticsearch_dsl import Q
from .parent_child import User, Question, Answer, setup, Comment
honza = User(id=42, signed_up=datetime(2013, 4, 3), username='honzakral',
email='honza@elastic.co', localtion='Prague')
nick = User(id=47, signed_up=... | Python | 0.999999 | @@ -263,25 +263,24 @@
ic.co', loca
-l
tion='Prague
@@ -400,17 +400,16 @@
o', loca
-l
tion='Co
|
bde7fab3f96933b3edced442046aa016add459b3 | use netaddr to lookup mac address | src/opnsense/scripts/interfaces/list_arp.py | src/opnsense/scripts/interfaces/list_arp.py | #!/usr/local/bin/python2.7
"""
Copyright (c) 2016 Ad Schellevis
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright not... | Python | 0 | @@ -1527,16 +1527,38 @@
t ujson%0A
+from netaddr import *%0A
%0Aif __na
@@ -1595,326 +1595,8 @@
= %5B
-%5D%0A%0A # import mac manufacturer mac address table (index by mac prefix)%0A mac_table = %7B%7D%0A if os.path.isfile('/usr/local/share/nmap/nmap-mac-prefixes'):%0A for mac in open('/usr/local/sha... |
d37a9d8de4a6c9cc40ddf3a3987baf3e0306563e | remove temproral anomaly | dipper/utils/DipperUtil.py | dipper/utils/DipperUtil.py | import logging
import unicodedata
import requests
__author__ = 'nlw'
LOG = logging.getLogger(__name__)
SESSION = requests.Session()
ADAPTER = requests.adapters.HTTPAdapter(max_retries=3)
SESSION.mount('https://', ADAPTER)
SESSION.mount('http://', ADAPTER)
EUTIL = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils'
ESEAR... | Python | 0.000008 | @@ -3596,1551 +3596,8 @@
gs%0A%0A
- @staticmethod%0A def is_omim_disease(gene_id):%0A %22%22%22%0A This function suffers from a causality violation%0A whereby the future is overwritten by the past.%0A It will be nuked from orbit.%0A%0A Process omim equivalencies by examining th... |
80433322e1987fbc86b711ee9bca3234c550644b | Return 404 for bad open address post | director/director/views.py | director/director/views.py | import re
from django.http import Http404, JsonResponse, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.conf import settings
from django.contrib.auth import logout
from django.contrib.auth.models import User
from django.views.generic import View, TemplateView, ListView, Detail... | Python | 0.000313 | @@ -2324,16 +2324,33 @@
riables%0A
+ try:%0A
@@ -2391,32 +2391,74 @@
ovider(address)%0A
+ except:%0A raise Http404%0A
form = s
@@ -2577,16 +2577,38 @@
dress())
+%0A raise Http404
%0A%0Aclass
|
25a802137470f9cce75d779326dba75a2c0cad34 | Move the signal connection to the init | discover_jenkins/runner.py | discover_jenkins/runner.py | import inspect
from optparse import make_option
from django.utils import unittest
from django.utils.importlib import import_module
try:
# Django 1.6
from django.test.runner import DiscoverRunner
except ImportError:
# Fallback to third-party app on Django 1.5
from discover_runner.runner import Discove... | Python | 0.000002 | @@ -1937,281 +1937,8 @@
e)%0A%0A
- def setup_test_environment(self, **kwargs):%0A super(DiscoverCIRunner, self).setup_test_environment(**kwargs)%0A if self.jenkins:%0A signals.setup_test_environment.send(sender=self)%0A%0A def run_suite(self, suite, **kwargs):%0A if self.jenkins:%... |
37b4e1bbcbde573a174180fff05e10136d2ed05c | add dependent setting for gtest include directory that was missed when creating base_tests.gyp. Same as https://code.google.com/p/webrtc/source/browse/trunk/talk/libjingle_tests.gyp?r=6484#39 | webrtc/base/base_tests.gyp | webrtc/base/base_tests.gyp | # Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | Python | 0.000031 | @@ -1049,24 +1049,114 @@
',%0A %5D,%0A
+ 'export_dependent_settings': %5B%0A '%3C(DEPTH)/testing/gtest.gyp:gtest',%0A %5D,%0A
%7D,%0A %7B
|
20d8ecb26fc8c90ec6f55e7f074b5e474db283d9 | fix a missing fake logging method | remoto/connection.py | remoto/connection.py | from .lib import execnet
#
# Connection Object
#
class Connection(object):
def __init__(self, hostname, logger=None, sudo=False):
self.hostname = hostname
self.gateway = execnet.makegateway('ssh=%s' % hostname)
self.logger = logger or FakeRemoteLogger()
self.sudo = sudo
def ... | Python | 0.003341 | @@ -545,28 +545,72 @@
lf, *a, **kw):%0A pass%0A
+%0A def info(self, *a, **kw):%0A pass%0A
|
84865482174286a034d438facc0e291a270f5d64 | add healthcheck | webservice/openalpr_web.py | webservice/openalpr_web.py | from openalpr import Alpr
from PIL import Image
import zbar
import tornado.ioloop
import tornado.web
import tornado.options
tornado.options.parse_command_line()
import sys
from sys import argv
sys.path.append('/usr/local/lib/python2.7/site-packages')
import os
import io
import json
import logging
country_code = os.... | Python | 0.000001 | @@ -698,16 +698,208 @@
able')%0A%0A
+class HealthHandler(tornado.web.RequestHandler):%0A def get(self):%0A logging.info('Executing GET')%0A %0A results = %7B%22status%22: %22ok%22%7D%0A self.finish(json.dumps(results))%0A%0A
class Al
@@ -2586,13 +2586,47 @@
ler)
+,%0A (r%22/health%2... |
09019094afcfc258194d70cbc115c35233a08d80 | Fix mailchimp feature flag | website/mailchimp_utils.py | website/mailchimp_utils.py | import mailchimp
from website import settings
from framework.tasks import app
from framework.auth.core import User
from framework.auth.signals import user_confirmed
def get_mailchimp_api():
if not settings.MAILCHIMP_API_KEY:
raise RuntimeError("An API key is required to connect to Mailchimp.")
return ... | Python | 0 | @@ -2018,36 +2018,32 @@
irmation%0A if
-not
settings.ENABLE_
|
49008c9863e32ebb22038cc9a2c67c48ecae81b3 | Add missing descriptions of exception parameters. | retdec/exceptions.py | retdec/exceptions.py | #
# Project: retdec-python
# Copyright: (c) 2015-2016 by Petr Zemek <s3rvac@gmail.com> and contributors
# License: MIT, see the LICENSE file for more details
#
"""Custom exceptions raised by the library."""
class RetdecError(Exception):
"""Base class of all custom exceptions raised by the library."""
class... | Python | 0 | @@ -675,20 +675,78 @@
not set.
+%0A%0A :param str name: Name of the missing parameter.%0A
%22%22%22%0A
-
%0A def
@@ -957,16 +957,126 @@
d value.
+%0A%0A :param str name: Name of the parameter whose value is invalid.%0A :param value: The invalid value.%0A
%22%22%22%0A%0A
@@ -1578,16 +1578,86 ... |
a90d514faac89e2351ede174e0275ac279e4083b | Drop Py2 and six on salt/beacons/load.py | salt/beacons/load.py | salt/beacons/load.py | # -*- coding: utf-8 -*-
"""
Beacon to emit system load averages
"""
# Import Python libs
from __future__ import absolute_import, unicode_literals
import logging
import os
# Import Salt libs
import salt.utils.platform
# Import Py3 compat
from salt.ext.six.moves import map, zip
log = logging.getLogger(__name__)
__v... | Python | 0 | @@ -1,28 +1,4 @@
-# -*- coding: utf-8 -*-%0A
%22%22%22%0A
@@ -41,88 +41,8 @@
%22%22%22%0A
-%0A# Import Python libs%0Afrom __future__ import absolute_import, unicode_literals%0A%0A
impo
@@ -67,27 +67,8 @@
os%0A%0A
-# Import Salt libs%0A
impo
@@ -95,69 +95,8 @@
rm%0A%0A
-# Import Py3 compat%0Afrom salt.ext.six.move... |
7974ff7264f145722eaf554a10abfbca26c6778f | load grains for salt.cmd runner | salt/runners/salt.py | salt/runners/salt.py | # -*- coding: utf-8 -*-
'''
This runner makes Salt's
execution modules available
on the salt master.
.. versionadded:: 2016.11.0
.. _salt_salt_runner:
Salt's execution modules are normally available
on the salt minion. Use this runner to call
execution modules on the salt master.
Salt :ref:`execution modules <writin... | Python | 0 | @@ -844,16 +844,28 @@
unction%0A
+import copy%0A
import l
@@ -910,20 +910,22 @@
.client%0A
-from
+import
salt.lo
@@ -932,34 +932,8 @@
ader
- import minion_mods, utils
%0Afro
@@ -1734,76 +1734,190 @@
-return minion_mods(%0A __
+opts = copy.deepcopy(__opts__)%0A opts%5B'grains'%5D = salt.loader.gra... |
f412ad8f9a821e39b4ed030c77a88631341dbe22 | Version = 2.0.1 | sargasso/__init__.py | sargasso/__init__.py | __version__ = "2.0"
| Python | 0.008467 | @@ -11,10 +11,12 @@
_ = %222.0
+.1
%22%0A
|
b7c831756825cfeffcb97387294435511ed9c811 | bump version to 1.0.0rc1 | satsearch/version.py | satsearch/version.py | __version__ = '1.0.0b12'
| Python | 0 | @@ -17,9 +17,9 @@
.0.0
-b12
+rc1
'%0A
|
af363ab33a56031e7e0bbbb295c0987b1f6b076a | add warning to log.py | remoto/log.py | remoto/log.py |
def reporting(conn, result, timeout=None):
timeout = timeout or conn.global_timeout # -1 a.k.a. wait for ever
log_map = {'debug': conn.logger.debug, 'error': conn.logger.error}
while True:
try:
received = result.receive(timeout)
level_received, message = list(received.items... | Python | 0.000001 | @@ -124,16 +124,25 @@
_map = %7B
+%0A
'debug':
@@ -160,16 +160,24 @@
r.debug,
+%0A
'error'
@@ -199,9 +199,55 @@
rror
-%7D
+,%0A 'warning': conn.logger.warning%0A %7D%0A
%0A
|
52c6cabc06c835ef3741ba873a5ff58fbedcfbc7 | remove override dep for app-on-ws-init | examples/app-on-ws-init.py | examples/app-on-ws-init.py | #!/usr/bin/env python3
# https://faq.i3wm.org/question/3699/how-can-i-open-an-application-when-i-open-a-certain-workspace-for-the-first-time/
from argparse import ArgumentParser
from gi.repository import i3ipc
i3 = i3ipc.Connection()
parser = ArgumentParser(description='Open an application on a given workspace when... | Python | 0 | @@ -204,16 +204,22 @@
rt i3ipc
+, GLib
%0A%0Ai3 = i
@@ -603,16 +603,22 @@
current.
+props.
name ==
@@ -762,14 +762,26 @@
e)%0A%0A
-i3.mai
+GLib.MainLoop().ru
n()%0A
|
5a293d02b5d6e3905dcd6659b1e2c96fa89d8ba8 | Create succ.py | succ/succ.py | succ/succ.py | import discord
from discord.ext import commands
from random import choice as rndchoice
from .utils.dataIO import fileIO
from .utils import checks
import os
class Succ:
"""Succ command."""
def __init__(self, bot):
self.bot = bot
@commands.group(pass_context=True, invoke_without_command=True)
... | Python | 0.000012 | @@ -84,41 +84,8 @@
ice%0A
-from .utils.dataIO import fileIO%0A
from
|
99ca5945dc82d1223dd0ac9452010baadebddb17 | change output file name convention for python script | scripts/capture.py | scripts/capture.py | '''
Created on Aug 31, 2015
@author: marcin
'''
import subprocess
from time import sleep
import time
import re
import urllib
import requests
import logging
logging.basicConfig(filename='capture.log',level=logging.INFO)
# logging.basicConfig(level=logging.DEBUG)
STATS = {}
VLC_CMD = '/usr/bin/cvlc'
MITSU_CMD = '/hom... | Python | 0.000001 | @@ -270,16 +270,119 @@
S = %7B%7D%0A%0A
+#http://stackoverflow.com/questions/10459338/save-continuous-rtsp-stream-to-5-10-minute-long-mp4-files%0A
VLC_CMD
@@ -511,16 +511,28 @@
/tmp/%7B0%7D
+_%7B1%7D_%7B2%7D_%7B3%7D
.mp4'%0A%0AR
@@ -580,10 +580,11 @@
DTH=
-72
+128
0%0AHE
@@ -592,11 +592,11 @@
GHT=
-576
+720
%0... |
8fd93c12c4c0737d993cc8e28b399871d78b9b02 | Remove mfc-sac and mfc-bc147 from printerStatus | scripts/snmpGet.py | scripts/snmpGet.py | #!/usr/bin/env python
## Created by Phinehas Bynum on 10/1/14.
## Ported to Python by Hawken Rives on 10/12/14
from __future__ import print_function
from subprocess import check_output
import data_helpers
awk = '| awk \'NF>1{print $NF}\''
printerNames = [
'mfc-bc110', 'mfc-bc147', 'mfc-casualreading',
'mfc-crossro... | Python | 0.000001 | @@ -269,21 +269,8 @@
10',
- 'mfc-bc147',
'mf
@@ -640,20 +640,8 @@
58',
-%0A%09'mfc-sac',
'mf
|
473a019ed49961ccb8b65a64f9c393f3c9432bbc | Change migration retroactively to take account of identifier truncation | migrations/versions/1210_add_outcome_model.py | migrations/versions/1210_add_outcome_model.py | """Add Outcome model
Revision ID: 1200
Revises: 1210
Create Date: 2018-05-10 17:22:50.773017
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1210'
down_revision = '1200'
def upgrade():
op.create_unique_constraint('uq_brief_responses_id_brief_id', 'brief... | Python | 0.000517 | @@ -443,36 +443,32 @@
service_id_searc
-h_id
',%0A 'dire
@@ -5430,28 +5430,24 @@
ice_id_searc
-h_id
',%0A '
|
a1af72b2fe9ed79370bd24a8e7e643a8a6a3c83e | Add the get() method to SPConfig objects. | storpool/spconfig.py | storpool/spconfig.py | #
#-
# Copyright (c) 2013, 2014 StorPool.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | Python | 0 | @@ -22,14 +22,15 @@
2013
-,
+ -
201
-4
+5
St
@@ -2851,16 +2851,92 @@
t%5Bkey%5D%0A%0A
+ def get(self, key, defval):%0A return self._dict.get(key, defval)%0A%0A
def
|
1ddd7bc6ce771ab7dad5218f205461e411bdd196 | Load to charity database | alchemy.py | alchemy.py | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 25 17:56:25 2017
@author: colmc
"""
import requests
from bs4 import BeautifulSoup
from datetime import datetime
import pandas as pd
from sqlalchemy import Table, MetaData, bindparam, create_engine
import os
source_url = 'https://api.likecharity.com/charities/'
source_co... | Python | 0 | @@ -2175,353 +2175,35 @@
#
-update existing tables%0A query = charity.update().%5C%0A where(charity.c.name == bindparam('name')).%5C%0A values(donation_options=bindparam('donation_options'), category=bindparam('category'))%0A conn.execute(query, %5Bcharities%5... |
01cb43835154bfa031b9bfdb586baab1e96509ba | Update quotes | analyse.py | analyse.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import sys
import pandas as pd
from ggplot import *
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('-d', '-data', dest='dataPaths', nargs='+', help='chat log data files (pickle ... | Python | 0.000001 | @@ -243,16 +243,17 @@
'-d', '-
+-
data', d
@@ -261,17 +261,18 @@
st='data
-P
+_p
aths', n
@@ -391,22 +391,24 @@
ent(
-%22
+'-
-plot
-D
+-d
ensity
-%22
+'
, de
@@ -471,17 +471,17 @@
help=
-%22
+'
plots th
@@ -528,17 +528,17 @@
ir count
-%22
+'
)%0A pa
@@ -559,30 +559,32 @@
ent(
-%22-n%22, %22
+'-n', '... |
a846fb18eb265caeca8b88d6cbf2ee1d6657b9dc | Fix lint errors | stylo/shapes/base.py | stylo/shapes/base.py | import inspect
from stylo.math import StyName
SHAPE_DOCSTRING = """\
I am a shape :)
"""
def _set_params(default, override):
"""Return a dictionary based on the given default dictionary, but with
particular overrides."""
params = dict(default)
for key, value in override.items():
if key n... | Python | 0.000396 | @@ -1420,18 +1420,8 @@
main
- arguments
%0A
@@ -1433,16 +1433,26 @@
+arguments
to the s
@@ -1855,16 +1855,32 @@
shape's
+%0A
paramet
|
f6088cda2541342280bfb284f5bea65a77763aea | Fix an issue that caused reprocessing to encounter IntegrityErrors | src/sentry/models/processingissue.py | src/sentry/models/processingissue.py | """
sentry.models.processingissue
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2017 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from hashlib import sha1
from django.db import models
from django.db.models.aggregates imp... | Python | 0.000001 | @@ -2826,24 +2826,38 @@
+defaults=dict(
data=data%0A
@@ -2853,16 +2853,18 @@
ata=data
+),
%0A
|
a9abb2749f230978ba4490f9926ccc55e08614b0 | clear error message when traversal fails | rollbar/lib/traverse.py | rollbar/lib/traverse.py | import collections
import logging
from rollbar.lib import binary_type, iteritems, string_types, circular_reference_label
CIRCULAR = -1
DEFAULT = 0
MAPPING = 1
TUPLE = 2
NAMEDTUPLE = 3
LIST = 4
SET = 5
STRING = 6
log = logging.getLogger(__name__)
def _noop_circular(a, **kw):
return circular_reference_label(a, r... | Python | 0.000001 | @@ -3828,17 +3828,13 @@
log.
-exception
+debug
(%22Ex
@@ -3851,63 +3851,88 @@
ile
-processing Rollbar Item. %22%0A %22Using
+traversing object using type-specific %22%0A %22handler. Switching to
def
@@ -3945,16 +3945,31 @@
andler.%22
+, exc_info=True
)%0A%0A r
|
772e094ba31d1d64f22408724f712fcdccce3444 | Add developer secret key | app/app.py | app/app.py | from flask import Flask
app = Flask('CloneTube')
| Python | 0.000001 | @@ -43,8 +43,42 @@
eTube')%0A
+app.secret_key = 'DEV_SECRET_KEY'%0A
|
45b6ecc09628ca4004e801715cd205a4fdf81a1b | Add new drawing function | src/shepherd_disp/src/simple_disp.py | src/shepherd_disp/src/simple_disp.py | #!/usr/bin/env python
import rospy
from shepherd_msg.msg import SailboatPose
from shepherd_msg.msg import WorldInfo
from std_msgs.msg import Float64MultiArray
import matplotlib.pyplot as plt
import numpy as np
def draw_triangle():
global cx, cy
pt1x = cx + 50 * np.cos(1 * 2 * np.pi/3);
pt1y = cy + 50 * n... | Python | 0.000001 | @@ -1819,16 +1819,146 @@
t%5B0%5D)%0A%0A%0A
+def draw_buoy(xb=0,yb=0):%0A angle = np.arange(0,3*np.pi,np.pi/10)%0A buoy = %5Bxb+np.cos(buoy),yb+np.sin(buoy)%5D%0A return buoy%0A%0A
# Initia
|
2992b77a9bb2585c008fd9fe93e357b3239d705a | Update the build volume based on machine | PrinterApplication.py | PrinterApplication.py | from UM.Qt.QtApplication import QtApplication
from UM.Scene.SceneNode import SceneNode
from UM.Scene.Camera import Camera
from UM.Scene.Platform import Platform
from UM.Math.Vector import Vector
from UM.Math.Matrix import Matrix
from UM.Resources import Resources
from UM.Scene.BoxRenderer import BoxRenderer
from UM.Sc... | Python | 0 | @@ -465,16 +465,47 @@
ot, QUrl
+%0Afrom PyQt5.QtGui import QColor
%0A%0Aimport
@@ -770,16 +770,116 @@
= None%0A
+ self._volume = None%0A self.activeMachineChanged.connect(self._onActiveMachineChanged)%0A
%0A
@@ -1811,24 +1811,30 @@
t)%0A%0A
+self._
volume = Bui
@@ -1848,24 +1848,25 @... |
2af5600296a09a7d9d72b9089404eaca73cd34a7 | Fix line length. | django_mailer/management/commands/send_mail.py | django_mailer/management/commands/send_mail.py | from django.conf import settings
from django.core.management.base import NoArgsCommand
from django_mailer.engine import send_all
from optparse import make_option
import logging
# Provide a way of temporarily pausing the sending of mail.
PAUSE_SEND = getattr(settings, "MAILER_PAUSE_SEND", False)
LOGGING_LEVEL = {'0': ... | Python | 0.000285 | @@ -909,16 +909,44 @@
bosity%5D,
+%0A
format=
|
3a2853007ad002687d4dda7066b2c50d82f3cc3c | Update 0002_auto_20180627_1121 migration | djstripe/migrations/0002_auto_20180627_1121.py | djstripe/migrations/0002_auto_20180627_1121.py | # Generated by Django 2.0.6 on 2018-06-27 08:21
from django.db import migrations
import djstripe.fields
class Migration(migrations.Migration):
dependencies = [
("djstripe", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="account",
name="busi... | Python | 0 | @@ -1626,18 +1626,127 @@
%0A ),%0A
+ migrations.RemoveField(%0A model_name=%22charge%22,%0A name=%22receipt_sent%22,%0A ),%0A
%5D%0A
|
cee75a15786cff9fabf257783d7b147d0b93890b | Remove expensive requests from admin | project/apps/api/admin.py | project/apps/api/admin.py | # import logging
# log = logging.getLogger(__name__)
from django.contrib import admin
from django_object_actions import (
DjangoObjectActions,
takes_instance_or_queryset,
)
from easy_select2 import select2_modelform
from .models import (
Convention,
Contest,
Contestant,
Group,
Performanc... | Python | 0 | @@ -880,32 +880,34 @@
strict',%0A
+ #
'tenor',%0A
@@ -899,32 +899,34 @@
'tenor',%0A
+ #
'lead',%0A
@@ -917,32 +917,34 @@
'lead',%0A
+ #
'baritone',%0A
@@ -939,32 +939,34 @@
ritone',%0A
+ #
'bass',%0A
|
cde384df70f65b9e560b93d4b2438d4968f2e1e3 | Add song to admin | project/apps/api/admin.py | project/apps/api/admin.py | # import logging
# log = logging.getLogger(__name__)
from django.contrib import admin
from django_object_actions import (
DjangoObjectActions,
takes_instance_or_queryset,
)
from easy_select2 import select2_modelform
from .models import (
Convention,
Contest,
Contestant,
Group,
Performanc... | Python | 0 | @@ -377,16 +377,26 @@
Judge,%0A
+ Song,%0A
)%0A%0A%0Aclas
@@ -5846,32 +5846,236 @@
'text',%0A )%0A%0A%0A
+@admin.register(Song)%0Aclass SongAdmin(admin.ModelAdmin):%0A form = select2_modelform(%0A Song,%0A attrs=%7B'width': '250px'%7D,%0A )%0A%0A save_on_top = True%0A fields = (%0A ... |
9b05a6169d56dc042a14f2908dfd6ab0cae85252 | remove cloud storage archive_info error. | catapult_base/dependency_manager/cloud_storage_info.py | catapult_base/dependency_manager/cloud_storage_info.py | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import errno
import logging
import os
import stat
from catapult_base import cloud_storage
from catapult_base.dependency_manager import exceptions
class Cl... | Python | 0 | @@ -173,23 +173,8 @@
rno%0A
-import logging%0A
impo
@@ -3081,69 +3081,8 @@
h)%0A%0A
- logging.error('has archive_info %25s', self._archive_info)%0A
|
6e16eaec078f18f0a098861afa4bd0bd94cb205f | Fix ROOT_URLCONF and remove WSGI_APP from settings | discuss/discuss/settings.py | discuss/discuss/settings.py | """
Django settings for discuss project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
import os
# Determine some important file locations
SETTINGS_DIR = os.pa... | Python | 0 | @@ -2140,59 +2140,20 @@
uss.
-urls'%0A%0AWSGI_APPLICATION = 'discuss.wsgi.application
+discuss.urls
'%0A%0A%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.