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 |
|---|---|---|---|---|---|---|---|
a8791229ee7e54224f112f2bbdf529a20bafbafb | Fix automatic author list generation for Read The Docs | docs/conf.py | docs/conf.py | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | Python | 0.000001 | @@ -804,16 +804,24 @@
summary%22
+, %22HEAD%22
%5D,%0A
|
63803a449d519c2bdc817574539322293b05c6ef | fix cape breton post_id | ca_ns_cape_breton/people.py | ca_ns_cape_breton/people.py | from pupa.scrape import Scraper, Legislator
from utils import lxmlize
import re
COUNCIL_PAGE = 'http://www.cbrm.ns.ca/councillors.html'
class CapeBretonPersonScraper(Scraper):
# @todo Need to scrape Mayor
def get_people(self):
page = lxmlize(COUNCIL_PAGE)
councillors = page.xpath('//table[@class="tab... | Python | 0 | @@ -446,16 +446,32 @@
strict =
+ 'District %25s' %25
council
|
6dd8bf424d997288bc583eb1e73b791b467f7e4b | override (de)selection commands instead of the core method | toggleselection/__init__.py | toggleselection/__init__.py | # Override toggle_selection() core method to automatically
# compute and instantly display combined filesize for selected files
from fman import DirectoryPaneCommand, load_json
import json
from statusbarextended import StatusBarExtended
class _CorePaneCommand(DirectoryPaneCommand):
def toggle_selection(self):
... | Python | 0.999271 | @@ -8,38 +8,43 @@
ide
-toggle_selection() core method
+commands that toggle item selection
to
@@ -60,10 +60,8 @@
ally
-%0A#
com
@@ -86,16 +86,18 @@
display
+%0A#
combine
@@ -125,16 +125,57 @@
ed files
+ and the number of selected folders/files
%0A%0Afrom f
@@ -198,23 +198,24 @@
toryPane
-Command
+Listene... |
c79cedf826a3b6ee89e6186954185ef3217dd901 | Add the minimum scalar value to the result of the InvertOperator | tomviz/python/InvertData.py | tomviz/python/InvertData.py | import tomviz.operators
NUMBER_OF_CHUNKS = 10
class InvertOperator(tomviz.operators.CancelableOperator):
def transform_scalars(self, dataset):
from tomviz import utils
import numpy as np
self.progress.maximum = NUMBER_OF_CHUNKS
scalars = utils.get_scalars(dataset)
if sca... | Python | 0.000227 | @@ -409,32 +409,63 @@
loat32(scalars)%0A
+ min = np.amin(scalars)%0A
max = np
@@ -646,16 +646,22 @@
- chunk
+ + min
%0A
|
4978f7ad6b87672d7fc1df7a836e2b8931bca1c9 | Fix missing relations pool for new proposals | src/adhocracy_core/adhocracy_core/resources/proposal.py | src/adhocracy_core/adhocracy_core/resources/proposal.py | """Proposal resource types."""
from adhocracy_core.interfaces import IItem
from adhocracy_core.interfaces import IItemVersion
from adhocracy_core.resources import add_resource_type_to_registry
from adhocracy_core.resources.badge import add_badge_assignments_service
from adhocracy_core.resources.comment import add_comme... | Python | 0.000223 | @@ -493,32 +493,99 @@
dd_ratesservice%0A
+from adhocracy_core.resources.relation import add_relationsservice%0A
from adhocracy_c
@@ -1875,16 +1875,42 @@
ervice,%0A
+ add_relationsservice,%0A
))%0A%0A%0Acla
|
c23e7c71b83db5b13f42cc72722e3e0527ed8032 | Drop design rows if they don't have columns in wide dataset. | interface.py | interface.py | #!/usr/bin/env python
# Built-in packages
import re
# Add-on packages
import pandas as pd
class wideToDesign:
""" Class to handle generic data in a wide format with an associated design file. """
def __init__(self, wide, design, uniqID, group=False, clean_string=False):
""" Import and set-up data.
... | Python | 0 | @@ -3468,16 +3468,160 @@
sample)%0A
+%0A # Drop design rows that are not in the wide dataset%0A self.design = self.design%5Bself.design.index.isin(self.sampleIDs)%5D%0A%0A
|
ea3ff403ef98f730a5509d735e5e4ab699bff2c0 | change the time to 2 minutes | ScheduleAddData.py | ScheduleAddData.py | __author__ = 'chuqiao'
from apscheduler.schedulers.blocking import BlockingScheduler
import EventsPortal
import sys
import logging
def logger():
"""
Function that initialises logging system
"""
global logger
# create logger with 'syncsolr'
logger = logging.getLogger('scheduleAddData')
... | Python | 0.999999 | @@ -1294,10 +1294,9 @@
es=
-60
+2
, ar
@@ -1848,16 +1848,18 @@
+ #
%22139.16
@@ -1892,16 +1892,75 @@
ortal/%22%0A
+ %22localhost:8983/solr/event_portal%22%0A%0A
)%0A%0A
|
99d9269d7b695b11c799436e651b21945c73b257 | Fix use_up_to keyword for VGG16 | python/src/nnabla/models/imagenet/vgg.py | python/src/nnabla/models/imagenet/vgg.py | # Copyright (c) 2017 Sony Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | Python | 0.000001 | @@ -2194,16 +2194,64 @@
stconv':
+ 'VGG16/Convolution_13' if num_layers == 16 else
'VGG%7B%7D/
@@ -2314,16 +2314,57 @@
v+relu':
+ 'VGG16/ReLU_13' if num_layers == 16 else
'VGG%7B%7D/
|
119fb170094c6f36e9fcfa9d30f3d4daf7bcb43a | fix tests | tests/t_express_checkout.py | tests/t_express_checkout.py | # coding=utf-8
import unittest
import interface_factory
import api_details
interface = interface_factory.get_interface_obj()
# TODO: implement the paypal account log-in as web-based? somehow implement with
# a bare-bones python web client so it's programmable?
class TestExpressCheckout(unittest.TestCase):
def s... | Python | 0.000001 | @@ -1272,24 +1272,30 @@
etails(token
+=token
)%0A %0A
@@ -2774,8 +2774,9 @@
t.main()
+%0A
|
6f92cd5a34864c7cb70624d65e2ba07ab754eeb7 | Convert variable value to bytes before replacing request body in the secure process code | src/wirecloud/proxy/processors.py | src/wirecloud/proxy/processors.py | # -*- coding: utf-8 -*-
# Copyright (c) 2011-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either v... | Python | 0.000026 | @@ -3877,15 +3877,22 @@
tr,
+bytes(
value))
+)
%0A%0A
|
c8a27443a9463b72ffe441c3baba7df2f9f157e4 | quit if we cannot find city for given INSEE | tools/batimap/postgis_db.py | tools/batimap/postgis_db.py | import psycopg2
from bbox import Bbox
class PostgisDb(object):
def __init__(self, log, host, port, user, passw, db):
self.log = log
self.connection = psycopg2.connect(
database=db, user=user, password=passw, port=port, host=host)
self.cursor = self.connection.cursor()
de... | Python | 0.000012 | @@ -708,32 +708,33 @@
.fetchall()%0A
+%0A
assert(len(r
@@ -713,39 +713,35 @@
hall()%0A%0A
-assert(
+if
len(results) %3C=
@@ -729,38 +729,139 @@
if len(results)
-%3C
+=
=
+0:%0A self.log.critical(%22Cannot found city with INSEE %7B%7D.%22.format(insee))%0A exit(
1)%0A
+... |
491b1ce982ccfe7aac352d794b7d882efbaa0c1d | Update reconstruct-itinerary.py | Python/reconstruct-itinerary.py | Python/reconstruct-itinerary.py | # Time: O(n!)
# Space: O(1)
# Given a list of airline tickets represented by pairs of departure
# and arrival airports [from, to], reconstruct the itinerary in order.
# All of the tickets belong to a man who departs from JFK.
# Thus, the itinerary must begin with JFK.
#
# Note:
# If there are multiple valid itinerari... | Python | 0.000001 | @@ -8,11 +8,118 @@
O(
-n!)
+t! / (n1! * n2! * ... nk!)), t is the total number of tickets, ni is the number of ticket which from is node i
%0A# S
@@ -126,17 +126,17 @@
pace: O(
-1
+t
)%0A%0A# Giv
|
dfb39c8c9e5483383cb5121ec5f3b954de0d06ea | Switch to MSBuild 14.0. | buildlib.py | buildlib.py | from functools import reduce
import os.path
import shutil
from subprocess import check_call
import xml.dom.minidom
class Project:
def _abspath(self, path):
return os.path.abspath(os.path.join(self.root_dir, path))
# ====== Constructor ====== #
"""
Creates a new instance of th... | Python | 0 | @@ -3002,17 +3002,17 @@
Build%5C%5C1
-2
+4
.0%5C%5CBin%5C
@@ -3030,26 +3030,26 @@
e'%0D%0A
-if
+IF
not propert
|
8a5ec29540e8b4620553af5d2ce4d1fbd4b3f985 | Store object hash as binary in sqlite (inventory) | src/storage/sqlite.py | src/storage/sqlite.py | import collections
from threading import current_thread, enumerate as threadingEnumerate, RLock
import Queue
import sqlite3
import time
from helper_sql import *
from storage import InventoryStorage, InventoryItem
class SqliteInventory(InventoryStorage):
def __init__(self):
super(self.__class__, self).__in... | Python | 0 | @@ -1205,14 +1205,30 @@
?',
+sqlite3.Binary(
hash))
+)
%0A%0A
@@ -1485,21 +1485,37 @@
ash=?',
+sqlite3.Binary(
hash)
+)
%0A
@@ -3001,16 +3001,20 @@
+=
+(str
(payload
for
@@ -3009,16 +3009,17 @@
(payload
+)
for pay
@@ -3486,16 +3486,31 @@
?, ?)',
+sqlite3.Binary(
objectHa
@@ -3511,16 +3511,1... |
78bb6f689a29017a19b4197024fe1ec78031063b | Add missing executable option to DummyCommand. | tests/test_build_scripts.py | tests/test_build_scripts.py | """Tests for distutils.command.build_scripts."""
import os
import unittest
from distutils.command.build_scripts import build_scripts
from distutils.core import Distribution
from distutils.tests import support
class BuildScriptsTestCase(support.TempdirManager,
support.LoggingSilencer,
... | Python | 0 | @@ -1183,16 +1183,35 @@
ripts):%0A
+ import sys%0A
@@ -1374,16 +1374,55 @@
force=1
+,%0A executable=sys.executable
%0A
|
80ad455420517d30a2f22fa997f0147acbbe1df5 | Add param "options" to require.deb.package | fabtools/require/deb.py | fabtools/require/deb.py | """
Debian packages
===============
This module provides high-level tools for managing Debian/Ubuntu packages
and repositories.
"""
from fabric.utils import puts
from fabtools.deb import (
add_apt_key,
apt_key_exists,
install,
is_installed,
uninstall,
update_index,
last_update_time,
)
fr... | Python | 0.000004 | @@ -3095,16 +3095,30 @@
e=False,
+ options=None,
version
@@ -3486,16 +3486,33 @@
=update,
+ options=options,
version
|
814812a676b94d87fefc5a4a826e3dff10295b53 | Fix security group rules referencing other security groups | touchdown/aws/vpc/security_group.py | touchdown/aws/vpc/security_group.py | # Copyright 2014 Isotoma Limited
#
# 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.000001 | @@ -1980,16 +1980,20 @@
if
+not
runner.g
|
a5715b3ac9e9bc4dfc35921effa558ee4867657a | use group in figure file name | plot_results.py | plot_results.py | #!/usr/bin/env python
import sys
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
from analyses.logs import read_logs
from groups import read_group_info, map_group_names, get_datasets_of_group
def get_fig_size(nx):
fig_size = (np.clip(int(8 * nx / 20.), 8, 32), 6)
de = 0.1 / (fig_size... | Python | 0 | @@ -3768,16 +3768,33 @@
s = None
+%0A group = None
%0A%0Aplt.cl
@@ -3928,16 +3928,82 @@
x=True)%0A
+ esuffix = suffix if group is None else '_%25s' %25 group + suffix%0A
fig.
@@ -4046,16 +4046,17 @@
%25 nc +
+e
suffix))
|
38ea9f7ec5aaaf4175602f353a6ec551e133b8f3 | move the constraint from a comment to executable code | src/zeit/cms/relation/relation.py | src/zeit/cms/relation/relation.py | # Copyright (c) 2008-2009 gocept gmbh & co. kg
# See also LICENSE.txt
import BTrees
import persistent
import zc.relation.catalog
import zc.relation.interfaces
import zeit.cms.relation.interfaces
import zope.interface
class Relations(persistent.Persistent):
"""Handles relations between content."""
zope.inter... | Python | 0.000001 | @@ -2167,135 +2167,181 @@
-# require a name since unnamed adapters would cause configuration%0A # conflicts%0A if not name:%0A continue
+if not name:%0A raise ValueError(%0A 'IReferenceProvider %25r is registered without a name,'%0A ' this will cau... |
7072fdefea7c2ec3e712e648ce4f160875ea86fa | Add SWAG_UI_ROOT config | flask_swag/__init__.py | flask_swag/__init__.py | """
flask_swag
==========
Flask extension that extracts swagger spec from flask app & provides
Swagger UI.
"""
import os
import urllib.parse
from flask import Flask, Blueprint, current_app, jsonify, \
send_from_directory, url_for, request
from . import core
from .extractor import Extractor, MarkExtractor
from .... | Python | 0 | @@ -674,36 +674,32 @@
tions.%0A%0A
-
* SWAG_TITLE%0A%0A
@@ -698,20 +698,16 @@
_TITLE%0A%0A
-
@@ -739,28 +739,24 @@
o.%0A%0A
-
* SWAG_API
@@ -777,20 +777,16 @@
-
-
API vers
@@ -849,16 +849,115 @@
them.%0A%0A
+ And you can use another version of swagger-u... |
5f43f876342e5ef3723355cb6f7325c128dfd41f | fix syntax error | tests/test_computer_dais.py | tests/test_computer_dais.py | import unittest
from OnStage.computer_dais import *
class ComputerTestCase(unittest.TestCase):
def setUp(self):
self.hal = Computer(1)
self.hollow_board = [1,10,0, 0,0,0, 10,1,0]
self.center_board = [10,0,0, 0,1,0, 10,0,1]
self.diagon_board = [10,0,1, 1,1,10, 10,0,1]
self.... | Python | 0.000003 | @@ -1594,10 +1594,10 @@
f.ca
-dd
+tt
y_co
|
457a3ff74c37b641b53261f8eecbc4aee0d30f04 | Return all breakers to API | src/syntax/breaker.py | src/syntax/breaker.py | __author__ = 's7a'
# All imports
from appositions import Appositions
from relative_clauses import RelativeClauses
from prefix_subordination import PrefixSubordination
from infix_subordination import InfixSubordination
from infix_coordination import InfixCoordination
# Constructor for the breaker class
class Breaker:... | Python | 0.998919 | @@ -691,32 +691,52 @@
, tree):%0A
+ apposition_result =
self.apposition
@@ -753,32 +753,57 @@
ee(tree)%0A
+ relative_clause_result =
self.relative_c
@@ -825,32 +825,62 @@
ee(tree)%0A
+ prefix_subordination_result =
self.prefix_sub
@@ -906,32 +906,61 @@
ee(tree)%0A
+ infix_subordina... |
dafe6b9ba0d809142d09a6aa44b696700b97a281 | Set PATH for Appveyor on Windows | srt_tools/tests/test_srt_tools.py | srt_tools/tests/test_srt_tools.py | #!/usr/bin/env python
import os
import subprocess
import tempfile
from nose.tools import assert_true
from nose_parameterized import parameterized
try:
from shlex import quote
except ImportError: # <3.3 fallback
from shellescape import quote
if os.name == 'nt':
# Sigh, shlex.quote quotes incorrectly on ... | Python | 0 | @@ -247,16 +247,97 @@
quote%0A%0A%0A
+sample_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'files')%0A%0A
if os.na
@@ -431,87 +431,276 @@
x%0A%0A
-sample_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'files')
+ # Comes from appveyor%0A cur_path = os.environ%5B'PATH'%5D%0A ... |
898fe6057e6381c23fa75d2a707e709ab93ffe53 | add demo about reference count of object | reading-notes/PythonRef/src/ch03/main.py | reading-notes/PythonRef/src/ch03/main.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2015 ASMlover. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright... | Python | 0 | @@ -2221,16 +2221,280 @@
type')%0A%0A
+def object_reference_count():%0A import sys%0A def add(a, b):%0A return a + b%0A%0A a = 33%0A b = 44%0A print ('%25d + %25d = %25d %3Ca.ref_count=%3E%25d, b.ref_count=%3E%25d%3E' %25 %0A (a, b, add(a, b), sys.getrefcount(a), sys.getrefcount(b)))%0... |
4820fe864b7e0c627ee157e0718bd854dc3dbabe | Implement the is_subject_type function | src/task_presenter.py | src/task_presenter.py | # -*- coding: utf-8 -*-
#
# This module is part of the GeoTag-X project validator tool.
# It contains validators for various components of a task presenter configuration.
#
# Author: Jeremy Othieno (j.othieno@gmail.com)
#
# Copyright (c) 2016-2017 UNITAR/UNOSAT
#
# The MIT License (MIT)
# Permission is hereby granted, ... | Python | 0.999999 | @@ -5209,28 +5209,944 @@
raise NotImplementedError()%0A
+%0A%0Adef is_subject_type(subject_type):%0A %22%22%22Validates the specified subject type.%0A%0A Args:%0A subject_type (str): A subject type to validate.%0A%0A Returns:%0A %3Cbool, str%7CNone%3E: A pair containing the value True if the spe... |
84af30f33664c2962512c58ea72314d7e667a99b | Rename Traceback.to_dict to as_dict to be consistent with other api (to_dict still kept as alias for now). This is also consistent with stdlib (lots of stuff use .as_something). | src/tblib/__init__.py | src/tblib/__init__.py | import re
import sys
from types import CodeType
from types import TracebackType
try:
from __pypy__ import tproxy
except ImportError:
tproxy = None
try:
from .cpython import tb_set_next
except ImportError:
tb_set_next = None
if not tb_set_next and not tproxy:
raise ImportError("Cannot use tblib. Ru... | Python | 0 | @@ -4519,18 +4519,18 @@
def
-to
+as
_dict(se
@@ -5098,16 +5098,38 @@
%7D
+%0A to_dict = as_dict
%0A%0A @c
|
ff54f23f00377aca92e49b5343fa2d15edc95786 | version 0.1.14 release | fastprogress/version.py | fastprogress/version.py | __all__ = ['__version__']
__version__ = '0.1.13'
| Python | 0 | @@ -43,7 +43,7 @@
.1.1
-3
+4
'%0A
|
d25d3f089128e6d1a2da4074a4db9221375cdbd8 | fix typo | jauxiliar.py | jauxiliar.py | #!/usr/bin/env python3
'''
jauxiliar.py - Auxiliar stuff for Jose modules
'''
import asyncio
import josecommon as jcommon
import jcoin.josecoin as jcoin
import joseerror as je
import json
import aiohttp
import decimal
RICH_TAX = decimal.Decimal(0.1)
class Auxiliar(jcommon.Extension):
'''
Auxiliar - auxiliar... | Python | 0.999998 | @@ -1830,17 +1830,17 @@
ndex
-%5B
+(
authorid
%5D%0A
@@ -1835,17 +1835,17 @@
authorid
-%5D
+)
%0A
|
42a7afd5add5f89c37743c763f185c905c11e62c | add configuration to settings for not displaying reminders on certain URLs | reminders/templatetags/reminders_tags.py | reminders/templatetags/reminders_tags.py | from datetime import timedelta
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.utils.importlib import import_module
from django.utils.safestring import mark_safe
from reminders.models import Dismissal
register = t... | Python | 0 | @@ -331,16 +331,87 @@
brary()%0A
+REMINDERS_IGNORE_URLS = getattr(settings, 'REMINDERS_IGNORE_URLS', %5B%5D)%0A
%0A%0Adef lo
@@ -1792,16 +1792,152 @@
= None%0A%0A
+ ignore_url = False%0A for s in REMINDERS_IGNORE_URLS:%0A if s in request.path:%0A ignore_url = True%0A%0A
... |
afe526d0193ee82d74e41acac26baacdc1aabc62 | Update ratio2circos.py | tools/freec/ratio2circos.py | tools/freec/ratio2circos.py | import math
import sys
ploidy = int(sys.argv[1])
with open("./output/sample.bam_ratio.BedGraph") as bed:
with open("./output/sample.bam_ratio_log2_circos.txt", "a") as olog2r:
for line in bed.readlines():
ls = line.split()
if ls[0] != "track" and float(ls[3]) > 0:
l... | Python | 0.000001 | @@ -156,25 +156,26 @@
rcos.txt%22, %22
-a
+w+
%22) as olog2r
@@ -534,17 +534,18 @@
.txt%22, %22
-a
+w+
%22) as oc
|
056da5e34bf08514e852ace124577dc830d8adbb | fix execfile py2-py3 compatibility | tests/test_flux_analysis.py | tests/test_flux_analysis.py | # Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU.
# 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 ... | Python | 0.000001 | @@ -612,46 +612,8 @@
se.%0A
-from __future__ import print_function%0A
impo
@@ -696,16 +696,160 @@
, imat%0A%0A
+import six%0A%0Aif six.PY3:%0A def execfile(path, locals, globals):%0A exec(compile(open(path, %22rb%22).read(), path, 'exec'), locals, globals)%0A%0A
CUR_DIR
|
50d659520c485ea10bd49af6b7104fcf5456885d | use TemporaryDirectory ctx manager in test_render_unicode_cwd | IPython/core/tests/test_prompts.py | IPython/core/tests/test_prompts.py | # -*- coding: utf-8
"""Tests for prompt generation."""
import tempfile
import unittest
import os
import nose.tools as nt
from IPython.testing import tools as tt, decorators as dec
from IPython.core.prompts import PromptManager
from IPython.testing.globalipapp import get_ipython
ip = get_ipython()
class PromptTest... | Python | 0.000001 | @@ -53,24 +53,8 @@
%22%22%0A%0A
-import tempfile%0A
impo
@@ -258,16 +258,69 @@
_ipython
+%0Afrom IPython.utils.tempdir import TemporaryDirectory
%0A%0Aip = g
@@ -2048,16 +2048,20 @@
_unicode
+_cwd
(self):%0A
@@ -2072,70 +2072,83 @@
-td = tempfile.mkdtemp(u'%C3%BCnic%C3%B8d%C3%A9')%0A save = os.getcwd... |
8b26f53f4760fb4088d4d825a5491e3b61473460 | Add TODOs | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
#
# Asset Platform documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 19 20:24:09 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | Python | 0.000001 | @@ -1253,16 +1253,43 @@
code'%5D%0A%0A
+todo_include_todos = True%0A%0A
# Add an
|
e71004bda4a11bda44006bc52d9a1c6c85e56966 | Bring back directory rather than files within | reconstruction/pax_process.py | reconstruction/pax_process.py | #!/usr/bin/env python
import argparse
import csv
import glob
import math
import os
import sys
import time
path_translations = {'/project/lgrandi/xenon100/archive/data/': '/stash/project/@xenon1t/xenon100/archive/data/'}
submit_template_preamble = '''
executable = run_pax.sh
universe = vanilla
Error = lo... | Python | 0 | @@ -673,17 +673,18 @@
iles
-=
+ =
results
-/
%0Awhe
|
53aa9e61087b909a55d6ce2d7b16381e14c8304f | Add functions coloring | redactor/coloring/Coloring.py | redactor/coloring/Coloring.py | import re
from coloring.config_tags import config_tags
class Coloring:
def __init__(self, text_editor, language):
self.root = text_editor.get_root()
self.text_widget = text_editor.get_text_panel()
self.keywords = config_tags(self.text_widget, language)
self.pattern = r"\w+"
d... | Python | 0.000002 | @@ -305,16 +305,22 @@
= r%22%5Cw+
+%5C(%7C%5Cw+
%22%0A%0A d
@@ -697,32 +697,431 @@
remove(k, f, l)%0A
+ pos = word.find('(')%0A if pos %3E 0:%0A fs = f.split('.')%0A self.text_widget.tag_remove('blank', f, l)%0A self.text_widg... |
7d29f36db1735f830e881d4f6d4e7777c2afd3bd | Change to use all CPUs | main/gen_features.py | main/gen_features.py | __author__ = 'sharvey'
import multiprocessing
from corpus.mysql.reddit import RedditMySQLCorpus
from feature import ngram
from feature import lexical
import cred
import pprint
def gen_feature(atuple):
aset = set()
bngram = ngram.get_byte_ngrams(atuple['text'])
for n in bngram['ngram_byte']:
for ... | Python | 0.000001 | @@ -1287,12 +1287,8 @@
ool(
-1) #
mult
|
369f8f0b323f8d326f6a4b66af427364f805ffb5 | fix a bug in scale | chainercv/transforms/image/scale.py | chainercv/transforms/image/scale.py | from chainercv.transforms import resize
def scale(img, size, fit_short=True):
"""Rescales the input image to the given "size".
When :obj:`fit_short == True`, the input image will be resized so that
the shorter edge will be scaled to length :obj:`size` after
resizing. For example, if the height of the... | Python | 0.000004 | @@ -1011,16 +1011,17 @@
ort and
+(
(H %3C= W
@@ -1052,32 +1052,33 @@
H and W == size)
+)
:%0A return
@@ -1107,16 +1107,17 @@
ort and
+(
(H %3E= W
@@ -1156,16 +1156,17 @@
== size)
+)
:%0A
|
bc48992f2e7d8fc21895a088d962b4ab3d2fe47f | Fix start gap offset bug | carbonate/fill.py | carbonate/fill.py | # original work: https://github.com/graphite-project/whisper/issues/22
# whisper-fill: unlike whisper-merge, don't overwrite data that's
# already present in the target file, but instead, only add the missing
# data (e.g. where the gaps in the target file are). Because no values
# are overwritten, no data or precisio... | Python | 0.000001 | @@ -3120,32 +3120,39 @@
c, dst, gapstart
+ - step
, start)%0A
@@ -3266,16 +3266,23 @@
gapstart
+ - step
, start)
|
f4b997984519103ca8cd14edae6b393cd6536f27 | converted print statements to app.debug | maproulette/oauth.py | maproulette/oauth.py | #!/usr/bin/python
import json
from maproulette import app, models
from flask_oauth import OAuth
from flask import request, url_for, redirect, session
from flask.ext.sqlalchemy import SQLAlchemy
from maproulette.database import db
# instantite OAuth object
oauth = OAuth()
osm = oauth.remote_app(
'osm',
base_ur... | Python | 0.99976 | @@ -23,17 +23,16 @@
rt json%0A
-%0A
from map
@@ -2239,16 +2239,55 @@
t data:%0A
+ # FIXME this requires handling%0A
@@ -2382,17 +2382,16 @@
b%5B'id'%5D%0A
-%0A
@@ -2987,21 +2987,32 @@
-print
+app.logger.debug
('no hom
@@ -3110,13 +3110,24 @@
-print
+app.logger.debug
('us... |
19dd9465efa0cde5efcd41f895a3ecd9e2e60174 | comment autodoc typehints | docs/conf.py | docs/conf.py | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | Python | 0 | @@ -1204,16 +1204,88 @@
cessary%0A
+# TODO: Re-enable %22sphinx_autodoc_typehints%22, which fails on RTD builds%0A
#%0Aextens
@@ -1371,24 +1371,26 @@
poleon%22,%0A
+ #
%22sphinx_aut
|
e98ed15ba3a94d5a39609a6f78918982ca0db1ea | add columns width check | matchzoo/datapack.py | matchzoo/datapack.py | """Matchzoo DataPack, paiir-wise tuple (feature) and context as input."""
import typing
import pandas as pd
class DataPack(pd.DataFrame):
"""
Matchzoo DataPack data structure, store dataframe and context.
Example:
>>> # features, context generate by processors.
>>> features = [([1,3], [2... | Python | 0 | @@ -18,17 +18,16 @@
ack, pai
-i
r-wise t
@@ -1299,16 +1299,105 @@
y=copy)%0A
+ if self.shape%5B1%5D != 2:%0A raise ValueError(%22Pair-wise input expected.%22)%0A
|
537b7346d61f673990467f27fab4f9600f5f7372 | bchreader is gettersetter | femagtools/moproblem.py | femagtools/moproblem.py | """
femagtools.moproblem
~~~~~~~~~~~~~~~~~~~~
Creating and managing multi-objective problems
"""
from .moo.problem import Problem
import femagtools.magnet
import femagtools.bch
import logging
logger = logging.getLogger(__name__)
class FemagMoProblem(Problem):
"""
A multi-objective optimizatio... | Python | 0.999852 | @@ -2506,16 +2506,25 @@
ols.
-bch.Read
+getset.GetterSett
er):
@@ -2582,17 +2582,16 @@
tems()%7D%0A
-%0A
|
a2b664c89e60985a0c67db5d1f18bc20b34ad5c6 | remove unused command | cfg/bubblesub/scripts/cc.py | cfg/bubblesub/scripts/cc.py | import re
from PyQt5 import QtWidgets
from bubblesub.api.cmd import BaseCommand
from bubblesub.cfg.menu import MenuCommand
from bubblesub.fmt.ass.event import AssEvent
from bubblesub.ui.util import load_dialog
try:
import pysubs2
except ImportError as ex:
raise CommandUnavailable(f"{ex.name} is not installed... | Python | 0.000002 | @@ -1144,1102 +1144,8 @@
)%0A%0A%0A
-class CleanClosedCaptionsCommand(BaseCommand):%0A names = %5B%22clean-cc%22%5D%0A help_text = (%0A %22Cleans common closed caption punctuation from the selected events.%22%0A )%0A%0A async def run(self):%0A with self.api.undo.capture():%0A for l... |
725f019451f827e7d565d721001ef31d40254b2e | Exclude README documents in _themes folder | docs/conf.py | docs/conf.py | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | Python | 0.000004 | @@ -1436,16 +1436,63 @@
S_Store'
+, '_themes/README.rst', '_themes/f6/README.rst'
%5D%0A%0Amaste
|
fb6916dc971da5949eb28deeea5743234d378951 | Set the user's name after we search for their smokes in the DB, otherwise we won't find any smokes. | remysmoke/controllers/root.py | remysmoke/controllers/root.py | # -*- coding: utf-8 -*-
"""Main Controller"""
from datetime import datetime, timedelta
from time import mktime
from tg import expose, flash, require, url, request, redirect, validate
from tg.i18n import ugettext as _, lazy_ugettext as l_
from remysmoke import model
from repoze.what import predicates
from remysmoke.co... | Python | 0 | @@ -2490,97 +2490,8 @@
rs:%0A
- (user,) = DBSession.query(User.display_name).filter_by(user_name=user).one()%0A
@@ -2604,32 +2604,121 @@
%3E= past).all()%0A
+ (user,) = DBSession.query(User.display_name).filter_by(user_name=user).one()%0A
freq
@@ -2763,16 +2763,18 @@
a(days=... |
f587d8c840304edaf8bd9621617b1577d282d995 | use same error message as before, simplify get_prep_lookup | fernet_fields/fields.py | fernet_fields/fields.py | from cryptography.fernet import Fernet, MultiFernet
from django.conf import settings
from django.core.exceptions import FieldError, ImproperlyConfigured
from django.db import models
from django.utils.encoding import force_bytes, force_text
from django.utils.functional import cached_property
from . import hkdf
__all_... | Python | 0.00001 | @@ -2980,115 +2980,134 @@
%22%22%22
-Handles lookups for EncryptedField fields%22%22%22%0A if self.lookup_name == 'isnull':%0A return super(self
+Raise errors for unsupported lookups%22%22%22%0A raise FieldError(%22%7B%7D '%7B%7D' does not support lookups%22.format(%0A self.lhs.field
.__c
@@ -311... |
9464ec2a2133258ecb0e99f2ec45b179597e30d0 | Add a check for extras-centos7.3 (#120) | chroma-bundles/include/find_deps.py | chroma-bundles/include/find_deps.py | # Copyright (c) 2017 Intel Corporation. All rights reserved.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
import os
import sys
import yum
class YumDepFinder(object):
__req2pkgs = {}
all_deps = []
missing_deps = []
all_pkg_names = []
def _... | Python | 0 | @@ -3259,16 +3259,57 @@
%22extras%22
+ and repo.id != %22extras-centos7.3-x86_64%22
and %5C%0A
|
3f25d1181ce7306f7be20fde8e2217ffe376009f | Use typehints | docs/conf.py | docs/conf.py | import os
import sys
import alagitpull
# Get the project root dir, which is the parent dir of this
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext")))
# package data
about = {}
with open("../unihan_d... | Python | 0 | @@ -407,16 +407,48 @@
todoc',%0A
+ 'sphinx_autodoc_typehints',%0A
'sph
|
001ba693dda4f11a3b7bff4634a0336b8905728f | Support list in conversion | jps/utils.py | jps/utils.py | import json
from .publisher import Publisher
from .common import DEFAULT_PUB_PORT
from .common import DEFAULT_HOST
from .env import get_master_host
class JsonMultiplePublisher(object):
'''publish multiple topics by one json message
Example:
>>> p = JsonMultiplePublisher()
>>> p.publish('{"topic1":... | Python | 0 | @@ -1546,17 +1546,16 @@
else b)%0A
-%0A
json
@@ -1573,24 +1573,104 @@
.loads(msg)%0A
+ if isinstance(json_obj, (list)):%0A return %5B_obj(x) for x in json_obj%5D%0A
return _
|
fa4aed5e4f41e2c356b87adad3816c7936bc7dd4 | Resolve merging conflict | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | Python | 0.000002 | @@ -1579,18 +1579,16 @@
cument.%0A
-#
master_d
@@ -1603,33 +1603,8 @@
dex'
-%0Amaster_doc = '../README'
%0A%0A#
|
6ca05236778669649104686c58b0c0292ba3095a | raise a 404 instead of a 500 if news doesn’t exist | aldryn_news/views.py | aldryn_news/views.py | # -*- coding: utf-8 -*-
import datetime
from django.views.generic.dates import ArchiveIndexView
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.shortcuts import get_object_or_404
from aldryn_news import request_news_identifier
from aldryn_news.models impor... | Python | 0 | @@ -234,16 +234,48 @@
t_or_404
+%0Afrom django.http import Http404
%0A%0Afrom a
@@ -3230,24 +3230,78 @@
gs%5B'slug'%5D)%0A
+ if not qs.exists():%0A raise Http404%0A
news
|
8b2304c7e8455c8f113bdc3c56706d471edc8181 | Fix typos | chainer/training/updater.py | chainer/training/updater.py | import six
from chainer.dataset import iterator as iterator_module
from chainer.dataset import convert
from chainer import optimizer as optimizer_module
from chainer import variable
class Updater(object):
"""Interface of updater objects for trainers.
TODO(beam2d): document it.
"""
def finalize(sel... | Python | 0.999999 | @@ -5592,16 +5592,17 @@
opt
+i
mizer.se
@@ -6273,33 +6273,32 @@
ptimizer.update(
-_
loss_func, *in_v
@@ -6477,33 +6477,32 @@
ptimizer.update(
-_
loss_func, **in_
@@ -6600,17 +6600,16 @@
.update(
-_
loss_fun
|
d4941b50679e13b2adc4f90590c17accd4d3b9a0 | use get_dataset_directory | chainercv/utils/download.py | chainercv/utils/download.py | from __future__ import print_function
import hashlib
import os
import shutil
import tarfile
import tempfile
import zipfile
import filelock
from six.moves.urllib import request
import sys
import time
from chainer.dataset.download import get_dataset_directory
_dataset_root = os.environ.get('CHAINER_DATASET_ROOT',
... | Python | 0.000008 | @@ -260,138 +260,8 @@
y%0A%0A%0A
-_dataset_root = os.environ.get('CHAINER_DATASET_ROOT',%0A os.path.expanduser('~/.chainer/dataset'))%0A%0A%0A
def
@@ -1391,36 +1391,30 @@
t =
-os.path.join(_dataset_root,
+get_dataset_directory(
'_dl
|
d76c7d0367ff95194bcd6a26125c2b2bf03d9819 | Update docs copyright | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
#
# Pykka documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 28 19:42:04 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | Python | 0 | @@ -1461,16 +1461,21 @@
= u'2010
+-2011
, Stein
|
610086333a7a76d76ec73977a82a978c98551053 | Use Accept-Language to find user language | ccvpn/__init__.py | ccvpn/__init__.py | import logging
from pyramid.config import Configurator
from sqlalchemy import engine_from_config
from pyramid_beaker import session_factory_from_settings
from ccvpn import views
from ccvpn import methods
from .models import DBSession, Base, get_user, User
logger = logging.getLogger(__name__)
class AuthenticationPol... | Python | 0.000009 | @@ -3977,16 +3977,328 @@
ocale%0A%0A%0A
+ settings = request.registry.settings%0A default_l = settings.get('pyramid.default_locale_name', 'en')%0A available_l = settings.get('available_languages', default_l).split()%0A%0A accept = request.accept_language%0A if not accept:%0A return None%0A ret... |
6ce0d0353c8684871ae51c206d945310932e11ae | Add states app to project | config/settings/base.py | config/settings/base.py | """
Django settings for scuole project.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
from __future__ import absolute_import, unicode_literals
from os import env... | Python | 0 | @@ -1639,14 +1639,13 @@
ole.
-region
+state
s',%0A
|
d73bc854c5cf34f57916ebfd4b1d51c21701d48a | Update paths for TravisCI | tests/unit_test_xmile2py.py | tests/unit_test_xmile2py.py | import os
import unittest
import tempfile
from io import StringIO
from pysd.py_backend.xmile.xmile2py import translate_xmile
class TestXmileConversion(unittest.TestCase):
def test_python_file_creation(self):
with open('tests/test-models/tests/game/test_game.stmx', 'r') as stmx:
contents = s... | Python | 0 | @@ -121,16 +121,76 @@
xmile%0A%0A%0A
+TARGET_STMX_FILE = 'test-models/tests/game/test_game.stmx'%0A%0A
%0Aclass T
@@ -292,53 +292,24 @@
pen(
-'tests/test-models/tests/game/test_game.stmx'
+TARGET_STMX_FILE
, 'r
@@ -1292,53 +1292,24 @@
pen(
-'tests/test-models/tests/game/test_game.stmx'
+TARGET_STMX_FILE
, 'r
|
47053a42b9053755aad052159dac845b34195297 | Use common testHarness in derived projects | config/test/__init__.py | config/test/__init__.py | from SCons.Script import *
def run_tests(env):
import shlex
import subprocess
import sys
cmd = shlex.split(env.get('TEST_COMMAND'))
print('Executing:', cmd)
sys.exit(subprocess.call(cmd))
def generate(env):
import os
import distutils.spawn
python = distutils.spawn.find_executab... | Python | 0.000001 | @@ -20,16 +20,31 @@
mport *%0A
+import inspect%0A
%0A%0Adef ru
@@ -594,16 +594,129 @@
%5C%5C%5C%5C')%0A%0A
+ path = inspect.getfile(inspect.currentframe())%0A home = os.path.dirname(os.path.abspath(path)) + '/../..'%0A%0A
cmd
@@ -728,16 +728,29 @@
hon + '
+' + home + '/
tests/te
@@ -782,16 +782,29 @@
... |
3ddc3e759183b85026690ba2c284bd62de2d6e3e | Include git-based version in conf.py (#173) | docs/conf.py | docs/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# serpentTools documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 10 20:03:11 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this... | Python | 0 | @@ -702,16 +702,90 @@
ort sys%0A
+%0Asys.path.append(os.path.abspath('.'))%0Afrom _version import get_versions%0A%0A
from uni
@@ -1734,93 +1734,61 @@
s.%0A%0A
-version = '0.5.0'%0Arelease = '0.5.0'%0A# Comment the following lines for
+release = get_versions()%5B'version'%5D%0A
version
+ =
release
s%0A#r
@@ -178... |
1d66d86d289784350de1b94dd9381852d56f0e5d | Update conf.py | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | Python | 0.000001 | @@ -5472,83 +5472,8 @@
', %7B
-%0A 'enable_eval_rst': True,%0A 'enable_auto_doc_ref': True,%0A
%7D, T
|
c131f22fb338dc959a5bc87587d2babc2e6b373c | Version bump | agile_analytics/__init__.py | agile_analytics/__init__.py | """Pulls data from agile systems and analyzes it."""
from .fetchers import (
JIRAFetcher,
convert_jira_issue
)
from .analyzers import (
DateAnalyzer,
)
from .reporters import (
ThroughputReporter,
LeadTimeDistributionReporter,
)
from .writers import (
CSVWriter,
GSheetWriter
)
assert Da... | Python | 0.000001 | @@ -479,10 +479,10 @@
(0,
-3, 2
+4, 0
)%0A
|
49fd23a3ee0269e2b974648f4a823c1d0b6c12ec | change parameter in post requests. | airflow/hooks/druid_hook.py | airflow/hooks/druid_hook.py | # -*- coding: utf-8 -*-
#
# 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
#... | Python | 0 | @@ -2409,12 +2409,12 @@
rl,
-data
+json
=jso
|
c2ffe1f52ad339ce5cfd435404debac0181d16a5 | Print exceptions during logging (#3620) | angr/misc/loggers.py | angr/misc/loggers.py | import logging
import zlib
from .ansi import Color, BackgroundColor, color, clear
from .testing import is_testing
from ..utils.formatting import ansi_color_enabled
class Loggers:
"""
Implements a loggers manager for angr.
"""
__slots__ = ('default_level', '_loggers', 'profiling_enabled', 'handler',... | Python | 0 | @@ -1,16 +1,33 @@
+import traceback%0A
import logging%0Ai
@@ -3483,32 +3483,63 @@
+ name + clear%0A
+ # Finalize log message%0A
name = n
@@ -3637,22 +3637,27 @@
-return
+body: str =
f%22%7Bleve
@@ -3729,16 +3729,150 @@
ssage%7D%22%0A
+ if record.exc_info:%0A body += %22... |
9fefd5d862d09652d1200a169330ae51519b1146 | add unittest for get_all_entries. | pymatgen/apps/battery/tests/test_insertion_battery.py | pymatgen/apps/battery/tests/test_insertion_battery.py | #!/usr/bin/env python
'''
Created on Jan 25, 2012
'''
__author__ = "Anubhav Jain"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Anubhav Jain"
__email__ = "ajain@lbl.gov"
__date__ = "Jan 25, 2012"
import unittest
import os
import json
from pymatgen.entries.computed_ent... | Python | 0.000434 | @@ -2425,16 +2425,91 @@
)), 2)%0A%0A
+ def test_get_all_entries(self):%0A self.ie_LTO.get_all_entries()%0A%0A
def
|
5075fc57126ccec2ae7e993705e323fc5c75e965 | fix module babymonitoringcontroller | modules/baby_monitoring_controller/local_module.py | modules/baby_monitoring_controller/local_module.py | import module
from module import use_module
import fields
class BabyMonitoringController(module.Base):
update_rate = 10
sound_sensor = use_module('SoundSensor')
alarm_actuator = use_module('AlarmActuator')
class controller(fields.Base):
def __init__(self):
self.decibel_value = 97 ... | Python | 0 | @@ -50,16 +50,31 @@
t fields
+%0Aimport logging
%0A%0Aclass
@@ -476,190 +476,381 @@
-#
print
-'sound = %25s' %25 self.module.sound_sensor.sound()%5B1%5D%0A #print 'decibel_limit = %25s' %25 self.decibel_value%0A %0A if self.module.sound_sensor.sound()%5B1%5D
+%22testons%22%0A... |
343c840835f688ae109093ea61357302cd78d9bf | Use relative import | chartflo/views.py | chartflo/views.py | # -*- coding: utf-8 -*-
from django.views.generic import TemplateView
from chartflo.factory import ChartDataPack
class ChartsView(TemplateView):
template_name = 'chartflo/charts.html'
chart_type = "pie"
title = ""
engine = "amcharts"
def get_data(self):
return {}
def get_context_dat... | Python | 0 | @@ -69,24 +69,16 @@
ew%0Afrom
-chartflo
.factory
|
9f739e0e8b7ca32b6134731a69251bcd650742d8 | remove a debug print that slipped through | plugins/push.py | plugins/push.py | from plugins import Plugin
from events import ServerEvent
from twisted.internet import reactor
from twisted.internet.defer import Deferred, DeferredList
from twisted.mail import smtp, relaymanager
from twisted.web.client import getPage
from cStringIO import StringIO
from email.mime.text import MIMEText
from urllib im... | Python | 0 | @@ -6444,37 +6444,8 @@
n%22)%0A
- print self.endpoints%0A
|
37831f549eddc014ab89cc7dba3616a133c774a2 | Add create_app method to __init__.py | api/BucketListAPI.py | api/BucketListAPI.py | from flask import Flask, jsonify
from modals.modals import User, Bucket, Item
from api.__init__ import app, db
@app.errorhandler(404)
def page_not_found(e):
response = jsonify({'error': 'The request can not be completed'})
response.status_code = 404
return response
if __name__ == '__main__':
app.run... | Python | 0.000274 | @@ -100,15 +100,58 @@
ort
-app, db
+create_app, db%0A%0Aapp = create_app('DevelopmentEnv')
%0A%0A%0A@
|
2e56e03cd689495899d8675ee97a65f672274cb9 | fix most recent city council | chicago/models.py | chicago/models.py | from django.conf import settings
from django.db import models
from django.utils.html import mark_safe
from councilmatic_core.models import Bill, Event
from datetime import datetime
import pytz
from .helpers import topic_classifier
import re
from urllib.parse import quote
app_timezone = pytz.timezone(settings.TIME_ZONE... | Python | 0.999984 | @@ -6158,15 +6158,12 @@
us='
-confirm
+pass
ed')
|
ee86319b8b817514e55f5c9cfd5d8a25b3a04b3f | add term | testNat.py | testNat.py | from alchemyapi import AlchemyAPI
import reddit
import twitter
import wiki
import Introduction
def process_text(query=""):
alchemyapi = AlchemyAPI()
response2 = alchemyapi.sentiment("text", query)
# term list for natural language keyword analysis
jokes_term_list = ["jokes", "joke", "tell me a joke", "f... | Python | 0.999996 | @@ -823,24 +823,39 @@
, %22what are
+you%22, %22who are
you%22%5D%0A sa
|
844950d022f528e26b88324f16857291a6444617 | test butters | testbot.py | testbot.py | # -*- coding: utf-8 -*-
from bot import Tofbot
import unittest
from collections import namedtuple
from httpretty import HTTPretty, httprettified
from plugins.euler import EulerEvent
from plugins.jokes import TofadeEvent
def print_resp(msg):
print (" -> %s" % msg)
class TestTofbot(Tofbot):
def __init__(sel... | Python | 0.000002 | @@ -1433,16 +1433,21 @@
+self.
origin =
@@ -1516,24 +1516,29 @@
name, chan,
+self.
origin)%0A
@@ -1636,23 +1636,58 @@
ispatch(
+self.
origin,
+%0A
%5Bcmd, '
@@ -5810,12 +5810,182 @@
' %25 cmd, 1)%0A
+%0A def test_jokes_butters(self):%0A self.assertOutput(%22... |
061ebe64e96966149d66ee2e61792980dccbfe92 | test set and get | testbot.py | testbot.py | from bot import Tofbot
import unittest
def print_resp(msg):
print (" -> %s" % msg)
class TestTofbot(Tofbot):
def __init__(self, nick, name, chan, origin):
chans = [chan]
Tofbot.__init__(self, nick, name, chans, debug=False)
self.chan = chan
self.origin = origin
self.... | Python | 0 | @@ -32,16 +32,51 @@
nittest%0A
+from collections import namedtuple%0A
%0A%0Adef pr
@@ -353,26 +353,47 @@
lf.cb =
-print_resp
+None%0A self.joined = True
%0A%0A de
@@ -573,56 +573,8 @@
sg)%0A
- saved_cb = self.cb%0A self.cb = cb%0A
@@ -637,244 +637,866 @@
n%5D)%0A
- self.cb = ... |
d5ba9fd8e4965760d0d660e7ec18b8ebe0070a76 | Allow for extending the basic kinethetic interaction class | hlpr_kinesthetic_interaction/src/hlpr_kinesthetic_interaction/basic_kinesthetic_interaction.py | hlpr_kinesthetic_interaction/src/hlpr_kinesthetic_interaction/basic_kinesthetic_interaction.py | #!/usr/bin/env python
# Copyright (c) 2016, Diligent Droids
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... | Python | 0 | @@ -2196,18 +2196,177 @@
t__(self
-):
+, spin=True, node_name=None):%0A%0A if(node_name):%0A self.node_name = node_name%0A else:%0A self.node_name = %22kinesthetic_interaction%22
%0A%0A
@@ -2417,33 +2417,22 @@
ode(
-%22kinesthetic_interaction%22
+self.node_name
, an
@@ -262... |
6b36bdff8393834cfb9890b88fa03ab5ba3acb6e | Support JSON and arrays in JavaScript action in Mistral | mistral/utils/javascript.py | mistral/utils/javascript.py | # Copyright 2015 - Mirantis, 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 ag... | Python | 0 | @@ -1325,20 +1325,22 @@
re
-turn
+sult =
ctx.eva
@@ -1348,16 +1348,57 @@
(script)
+%0A return _PYV8.convert(result)
%0A%0A# TODO
|
ad3a7ddb3e2796ef266b638f3e95b865b0bdfedc | make a better exception than NotImplemented for unsupported Memory methods | md/stm/interfaces.py | md/stm/interfaces.py | from __future__ import absolute_import
from abc import ABCMeta, abstractproperty, abstractmethod
from collections import namedtuple, Iterable, Container
__all__ = (
'CannotCommit', 'Abort',
'Cursor', 'Static', 'Journal', 'Memory', 'Change', 'Log'
)
class CannotCommit(RuntimeError): pass
class Abort(Exception)... | Python | 0 | @@ -187,16 +187,36 @@
'Abort',
+ 'NeedsTransaction',
%0A 'Cu
@@ -339,16 +339,56 @@
n): pass
+%0Aclass NeedsTransaction(Exception): pass
%0A%0Aclass
@@ -2477,26 +2477,23 @@
se N
-otImplementedError
+eedsTransaction
(%0A
|
353643c612414e4292d419f373c551029af93b90 | add tests for default serve behavior for new static application | clastic/tests/test_serve.py | clastic/tests/test_serve.py | from __future__ import unicode_literals
from nose.tools import ok_
from clastic import Application, default_response
from clastic.session import CookieSessionMiddleware
from common import session_hello_world
def test_serve():
cookie_session = CookieSessionMiddleware()
app = Application([('/', session_hello_... | Python | 0 | @@ -59,16 +59,65 @@
port ok_
+, eq_%0A%0Aimport os%0Afrom werkzeug.test import Client
%0A%0Afrom c
@@ -159,16 +159,26 @@
response
+, Response
%0Afrom cl
@@ -264,16 +264,72 @@
world%0A%0A%0A
+_CUR_DIR = os.path.dirname(os.path.abspath(__file__))%0A%0A%0A
def test
@@ -583,16 +583,17 @@
ssion%5D)%0A
+%0A
yiel
... |
6a5004b6a96088255a6904564ddae02960d27501 | Update list of V8 try bots. | PRESUBMIT.py | PRESUBMIT.py | # Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | Python | 0.000008 | @@ -4358,16 +4358,61 @@
.v8': %7B%0A
+ 'v8_linux_rel': set(%5B'defaulttests'%5D),%0A
'v
|
ffa8f79fe15621081acbb220a2a4dfd3d4d6d500 | Correct env_key input argument default value | galton/utils/logger.py | galton/utils/logger.py | # -*- coding: utf-8 -*-
import os
import os.path as op
import yaml
import logging.config
from .text_files import read
from ..config import LOG_LEVEL
MODULE_NAME = __name__.split('.')[0]
def setup_logging(log_config_file=op.join(op.dirname(__file__), 'logger.yml'),
log_default_level=LOG_LEVEL,
... | Python | 0.000004 | @@ -346,16 +346,24 @@
ULE_NAME
+.upper()
+ '_LOG
|
55b9dd187ae84c288f7f2115a5debfe172d1e277 | Fix Maven download filenames (#346) | downloads.py | downloads.py | import json
import logging
import os
import re
import subprocess
import sys
import tempfile
import zipfile
from distutils.version import StrictVersion
import jsonschema
import requests
base_dir = os.path.dirname(os.path.abspath(__file__))
repo_dir = os.path.join(base_dir, "site", "dat", "repo")
dest_dir = os.path.joi... | Python | 0 | @@ -1826,46 +1826,111 @@
-remote_filename = re.findall(%22
+# handle optional quotes around filename:%0A remote_filename = re.sub('.*filename=(%22)?(?P%3C
filename
=(.+
@@ -1929,13 +1929,39 @@
name
-=(
+%3E
.+)
+(?(1)%22%7C$).*', %22%5Cg%3Cfilename%3E
%22, r
@@ -1999,11 +1999,8 @@
n'%5D)
-%5B0%5D
%0... |
42789e83c67f264ae81e43a82cd73b961fe9c589 | fix get_or_create on Identifier (see also Annotation) | identify/models.py | identify/models.py | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
class Identifier(models.Model):
name = models.CharField(max_length=255)
slug = models.SlugField()
authority = models.ForeignKey('Authority', blank=True, null=... | Python | 0 | @@ -130,16 +130,320 @@
eneric%0A%0A
+class IdentifierManager(models.Manager):%0A # Default implementation of get_or_create doesn't work well with generics%0A def get_or_create(self, **kwargs):%0A try:%0A return self.get(**kwargs), False%0A except self.model.DoesNotExist:%0A re... |
64b4e175d59f3f7c06ef009c0e0ff2cbf07e8e1e | fix flake8 | revscoring/datasources/meta/tests/test_vectorizers.py | revscoring/datasources/meta/tests/test_vectorizers.py | import numpy as np
from .. import vectorizers
from revscoring.datasources import revision_oriented as ro
from revscoring.dependencies import solve
from revscoring.features import wikitext
test_vectors = {'a': [1]*200,
'b': [1]*200,
'c': [1]*200}
def test_vectorize():
wv = vectori... | Python | 0 | @@ -1,23 +1,4 @@
-import numpy as np%0A
%0Afro
@@ -184,25 +184,27 @@
= %7B'a': %5B1%5D
-*
+ *
200,%0A
@@ -220,17 +220,19 @@
'b': %5B1%5D
-*
+ *
200,%0A
@@ -252,17 +252,19 @@
'c': %5B1%5D
-*
+ *
200%7D%0A%0A%0Ad
|
aa348d76f6bd8279c0fd79f3a17b8fc0176a82ce | fix issue #12 | imagekit/models.py | imagekit/models.py | import os
from datetime import datetime
from django.conf import settings
from django.core.files.base import ContentFile
from django.db import models
from django.db.models.base import ModelBase
from django.db.models.signals import post_delete
from django.utils.html import conditional_escape as escape
from django.utils.t... | Python | 0 | @@ -3912,59 +3912,8 @@
s):%0A
- is_new_object = self._get_pk_val() is None%0A
@@ -3962,26 +3962,24 @@
kwargs)%0A
-
+%0A
-if
is_new_
@@ -3989,26 +3989,61 @@
ect
-and
+=
self._
-imgfield
+get_pk_val() is None%0A if is_new_object
:%0A
@@ -4071,16 +4071,44 @@
= False
+%0A%0A ... |
995cf16cd8644ac134a15a8eb7d6eebcd2f02ea2 | These should have been identified as armor | duel_item.py | duel_item.py | # the duel_item class, which represents an item to help one duel
from random import choice
# Define a common item here.
# Current guidelines for rarity are:
# Any item with more than 4 duels in duration is RARE.
# Any item with a modifier greater than 2 damage or 4 life is RARE.
# The key is the id of the item
# ... | Python | 0.999999 | @@ -1591,27 +1591,33 @@
Copper Plate
+ Armor
%22,%0A
-
%22t
@@ -1776,24 +1776,30 @@
Bronze Plate
+ Armor
%22,%0A
@@ -1931,24 +1931,24 @@
o duels.%22%7D,%0A
-
%225%22: %7B%22n
@@ -1957,32 +1957,38 @@
e%22: %22Steel Plate
+ Armor
%22,%0A %22ty
@@ -2508,16 +2508,22 @@
el Plate
+ A... |
f99e5970df7394ebe290c39dc3580bcbd6923688 | Disable the admin panel, as it is not needed in this service. | editor_backend/editor_backend/settings/base.py | editor_backend/editor_backend/settings/base.py | """
Django settings for editor_backend project.
Generated by 'django-admin startproject' using Django 1.9.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
impor... | Python | 0 | @@ -733,16 +733,37 @@
TS = %5B%5D%0A
+ADMIN_ENABLED = False
%0A%0A# Appl
|
1eb809e15347b89d61077a4f4be9a3d0d005bc77 | 修改BUG:创建的用户都是超级用户 | api/views/account.py | api/views/account.py | from django.shortcuts import render, HttpResponse
from api.libs.base import CoreView
from account.models import UserProfile
from django.contrib.auth.models import User
# Create your views here.
class Account(CoreView):
"""
用户相关接口
"""
def get_list(self):
"""
获取用户列表接口
:return:
... | Python | 0 | @@ -882,16 +882,26 @@
eruser')
+ == 'true'
else Fa
|
b3cbc33e9cd43e22500a484599010146fbb7f012 | add missing description field to PolicyForm | src/ekklesia_portal/concepts/policy/policy_contracts.py | src/ekklesia_portal/concepts/policy/policy_contracts.py | from colander import Length
from deform.widget import SelectWidget
from ekklesia_portal.enums import Majority, VotingSystem
from ekklesia_portal.helper.contract import Schema, Form, decimal_property, int_property, string_property, enum_property
from ekklesia_portal.helper.translation import _
class PolicySchema(Schem... | Python | 0.000001 | @@ -59,16 +59,32 @@
ctWidget
+, TextAreaWidget
%0Afrom ek
@@ -403,16 +403,114 @@
ax=64))%0A
+ description = string_property(title=_('description'), validator=Length(max=4000), missing='')%0A
majo
@@ -1525,16 +1525,67 @@
ets = %7B%0A
+ 'description': TextAreaWidget(rows=8),%0A
|
618ad9ef667dfe269fd4d9bf926e4b7e22913d18 | Update russianroulette.py | russianroulette/russianroulette.py | russianroulette/russianroulette.py | import discord
from discord.ext import commands
import os
from .utils.dataIO import dataIO
import time
import asyncio
class Russianroulette:
"""Russian Roulette"""
def __init__(self, bot):
self.bot = bot
self.file_path = "data/russianroulette/russianroulette.json"
self.json_data = ... | Python | 0.000001 | @@ -356,112 +356,8 @@
%0A
- def betAmount():%0A bet = await self.bot.wait_for_message(timeout=60, author=user, check=check)
%0A
@@ -1060,26 +1060,130 @@
-%0A%0A
+ %0A %0Adef betAmount():%0A bet = await self.bot.wait_for_message(timeout=60, author=user, check=check)
... |
86b3e67c507cbc0360a93776b61b177dd201e48e | Read JSOn data attempt 2 | russianroulette/russianroulette.py | russianroulette/russianroulette.py | import discord
from discord.ext import commands
import os
from .utils.dataIO import dataIO
import time
import asyncio
class Russianroulette:
"""Russian Roulette"""
def __init__(self, bot):
self.bot = bot
self.file_path = "data/russianroulette/russianroulette.json"
self.json_data = ... | Python | 0 | @@ -681,16 +681,21 @@
if
+self.
json_dat
|
40c0ff8e5215d223b4c99e0271a550bde1484934 | 修改上传接口默认用户id是3 | app/api_1_0/posts.py | app/api_1_0/posts.py | from flask import jsonify, request, g, abort, url_for, current_app
from .. import db
from ..models import Post, Permission
from . import api
from .decorators import permission_required
from .errors import forbidden
import os, time, hashlib
@api.route('/posts/')
def get_posts():
"""推荐的接口"""
page = request.args.... | Python | 0 | @@ -4594,17 +4594,17 @@
or_id =
-1
+3
%0A
|
7df447bf561ca5148c9397d1621f81f4de6da5ad | Remove hello command | populous/cli.py | populous/cli.py | import click
@click.group()
@click.version_option()
def cli():
pass
@cli.command()
def hello():
click.echo("Hello World!")
| Python | 0.999999 | @@ -71,65 +71,4 @@
ass%0A
-%0A%0A@cli.command()%0Adef hello():%0A click.echo(%22Hello World!%22)%0A
|
1e14627edfa727b522f9a53654d0e4e8448749a0 | print() is a function in Python 3 | samples/storage_sample/downloads_test.py | samples/storage_sample/downloads_test.py | #
# Copyright 2015 Google 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.999999 | @@ -6672,17 +6672,17 @@
print
-
+(
'Progres
@@ -6713,16 +6713,17 @@
progress
+)
%0A%0A
|
b28e67a541e39b687a6484ea71a40efdbb4ebbf3 | Bump to 0.9.5 | aldryn_newsblog/__init__.py | aldryn_newsblog/__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.9.4.1'
| Python | 0.000168 | @@ -82,9 +82,7 @@
0.9.
-4.1
+5
'%0A
|
4e143659cea5c6b4160bf8b3f36cbf354fdd90e0 | return instead of exiting, in do_upload | edxStudio.py | edxStudio.py | #!/usr/bin/python
#
# File: edxStudio.py
# Date: 12-Mar-14
# Author: I. Chuang <ichuang@mit.edu>
#
# upload / download course .tar.gz files to/from edX Studio
#
# usage:
#
# python edxStudio.py course_id tar_file_name
#
# Put username and passsword in config.py; eg
# username = "me"
# password = "my passwor... | Python | 0.000001 | @@ -3755,19 +3755,14 @@
-sys.exit(0)
+return
%0A
|
17512f76cd1521a6308cbde20b3359f730d7939e | fix copy paste error | dpkt/tftp.py | dpkt/tftp.py | # $Id$
"""Trivial File Transfer Protocol."""
import struct
import dpkt
# Opcodes
OP_RRQ = 1 # read request
OP_WRQ = 2 # write request
OP_DATA = 3 # data packet
OP_ACK = 4 # acknowledgment
OP_ERR = 5 # error code
OP_OACK = 6 # option acknowledgment
# Error codes
EUNDEF = 0... | Python | 0 | @@ -1998,17 +1998,28 @@
item in
-d
+self.options
.items()
|
848530a53838a6ce47b0023670444e6773bf3e27 | Make the transaction admin a bit more usable | dps/admin.py | dps/admin.py | from dps.models import Transaction
from django.contrib import admin
from django.contrib.contenttypes import generic
class TransactionAdmin(admin.ModelAdmin):
pass
class TransactionInlineAdmin(generic.GenericTabularInline):
model = Transaction
def has_add_permission(self, request):
return False
... | Python | 0.000001 | @@ -160,12 +160,147 @@
-pass
+list_display = ('amount', 'status', 'transaction_type', 'content_object', %0A 'created',)%0A search_fields = ('secret', )
%0A%0A%0Ac
|
bab5a9c6e6d1ceead96e33b9a48618c29c14ed3e | Remove yocto forward in status | unicornclient/routines/status.py | unicornclient/routines/status.py | from unicornclient import spy
from unicornclient import routine
from unicornclient import message
class Routine(routine.Routine):
def __init__(self):
routine.Routine.__init__(self)
def process(self, data):
self.send_status()
def send_status(self):
status = self.get_status()
... | Python | 0 | @@ -399,50 +399,8 @@
%7D%0A
- self.manager.forward('yocto', %7B%7D)%0A
|
eaa85e7a65ce1ca954f83f4faaa3ab228fc0c60d | Add missing option from default config. | sansguiframe/src/sans/guiframe/config.py | sansguiframe/src/sans/guiframe/config.py | """
Application settings
"""
import os
import time
from sans.guiframe.gui_style import GUIFRAME
# Version of the application
__appname__ = "DummyView"
__version__ = '0.1.0'
__download_page__ = 'http://danse.chem.utk.edu'
# Debug message flag
__EVT_DEBUG__ = True
# Flag for automated testing
__TEST__ ... | Python | 0 | @@ -481,16 +481,37 @@
= True%0D%0A
+_do_tutorial = True%0D%0A
_acknowl
|
23f1d2d005f2529e37a41f2b6fa691db7a42ad86 | Update clashcallerbot_database.py fixed table creation | clashcallerbot_database.py | clashcallerbot_database.py | #! python3
# -*- coding: utf-8 -*-
"""Setup the MySQL-compatible database.
This module provides various functions for managing the MySQL-compatible database.
The database and tables can be created. Table data and properties can also be viewed.
"""
import mysql.connector as mysql
import configparser
import logging.co... | Python | 0.000001 | @@ -1839,95 +1839,8 @@
d)%0A%0A
- cmd = 'ALTER TABLE message_date AUTO_INCREMENT=1;'%0A cursor.execute(cmd)%0A
@@ -2132,16 +2132,31 @@
NOT NULL
+ AUTO_INCREMENT
, list V
@@ -2167,24 +2167,24 @@
AR(35), ' %5C%0A
-
@@ -2238,126 +2238,8 @@
d)%0A%0A
- cmd = 'INSERT INTO comment... |
b3ccb1d6a8525f2fe699c07e1d7c20bf10974522 | Remove unused var | every_election/apps/elections/query_helpers.py | every_election/apps/elections/query_helpers.py | import requests
from django.contrib.gis.geos import Point
class PostcodeError(Exception):
pass
class BasePostcodeLookup:
def __init__(self, postcode):
self.postcode = postcode.replace(' ', '')
@property
def point(self):
raise NotImplementedError
class MaPitPostcodeLookup(BasePost... | Python | 0.000001 | @@ -1630,25 +1630,8 @@
e):%0A
- point = None%0A
|
b0cf9547c1875a6d7d403300a5eb9b15d9a4d3cb | Fix problem with need update when tex is generated and not the pdf | survey/exporter/tex/survey2tex.py | survey/exporter/tex/survey2tex.py | # -*- coding: utf-8 -*-
import logging
import os
from pydoc import locate
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from survey.exporter.survey2x import Survey2X
from survey.exporter.tex.latex_file import LatexFile
from survey.exporter.tex.question2tex import Question2Te... | Python | 0 | @@ -43,16 +43,71 @@
port os%0A
+from datetime import datetime%0Afrom pathlib import Path%0A
from pyd
@@ -124,16 +124,28 @@
locate%0A%0A
+import pytz%0A
from dja
@@ -148,20 +148,26 @@
django.
-conf
+utils.text
import
@@ -171,15 +171,14 @@
rt s
-ettings
+lugify
%0Afro
@@ -4247,24 +4247,563 @@
directory)%0A%0A... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.