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 |
|---|---|---|---|---|---|---|---|
6565627e44566f1230ea8c3176678d604c020050 | Generate network with bias properly | network_simulator.py | network_simulator.py | import numpy as np
from scipy import stats
def exp_cosh(H, beta=1.0):
return 0.5 * np.exp(beta * H) / np.cosh(beta * H)
def kinetic_ising_model(S, J):
""" Returns probabilities of S[t+1,:] being one.
:param S: numpy.ndarray (T,N)
Binary data where an entry is either 1 ('spike') or -1 ('silence')... | Python | 0.999129 | @@ -890,16 +890,53 @@
as, N))%0A
+ if bias:%0A gamma%5BN, :%5D = 1%0A
norm
|
70021d5df6beb0e8eb5b78a6484cbb650a7a1fb6 | fix docs | cupyx/distributed/__init__.py | cupyx/distributed/__init__.py | from cupyx.distributed._init import init_process_group # NOQA
from cupyx.distributed._nccl_comm import NCCLBackend # NOQA
| Python | 0.000001 | @@ -56,16 +56,68 @@
# NOQA%0A
+from cupyx.distributed._comm import Backend # NOQA%0A
from cup
|
28dc19021a6ecf66c82b799fb7d0711c8cdd0589 | Add parameter dynamic_url | flask_apidoc/apidoc.py | flask_apidoc/apidoc.py | # Copyright 2015 Vinicius Chiele. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | Python | 0.000001 | @@ -911,16 +911,34 @@
th=None,
+ dynamic_url=True,
app=Non
@@ -933,32 +933,32 @@
rue, app=None):%0A
-
%22%22%22%0A
@@ -1028,17 +1028,17 @@
r_path:
-t
+T
he folde
@@ -1141,17 +1141,17 @@
l_path:
-t
+T
he url p
@@ -1208,38 +1208,137 @@
%0A :param
-app: t
+dynamic_url: Set %60True%60 to rep... |
3061affd313aff39f722e6e5846a3191d6592a7d | fix FaqQuestionSitemap URLs | fluent_faq/sitemaps.py | fluent_faq/sitemaps.py | from django.contrib.sitemaps import Sitemap
from django.core.urlresolvers import NoReverseMatch
from fluent_faq.models import FaqCategory, FaqQuestion
from fluent_faq.urlresolvers import faq_reverse
def _url_patterns_installed():
# This module can use normal Django urls.py URLs, or mount the "FaqPage" in the page... | Python | 0.000164 | @@ -892,32 +892,59 @@
ects.published()
+.select_related('category')
%0A%0A def lastmo
@@ -947,32 +947,32 @@
stmod(self,
-category
+question
):%0A %22
@@ -1031,32 +1031,32 @@
return
-category
+question
.modificatio
@@ -1082,32 +1082,32 @@
ation(self,
-category
+question
):%0A %22
@@ -116... |
ac44d2336585147cad815d0f5dbdd46c44ebd788 | Fix deprecation warning in "colour_hdri.recovery.highlights" module. | colour_hdri/recovery/highlights.py | colour_hdri/recovery/highlights.py | # -*- coding: utf-8 -*-
"""
Clipped Highlights Recovery
===========================
Defines the clipped highlights recovery objects:
- :func:`colour_hdri.highlights_recovery_blend`
- :func:`colour_hdri.highlights_recovery_LCHab`
See Also
--------
`Colour - HDRI - Examples: Merge from Raw Files Jupyter Notebook
<... | Python | 0 | @@ -3895,16 +3895,23 @@
urspace.
+matrix_
XYZ_to_R
@@ -3916,13 +3916,6 @@
_RGB
-_matrix
)%0A
|
79e7ef509e4757c29d6fa0bd9161410aadbd305a | fix os.path.expand [sic] typo, and refactor | salt/utils/xdg.py | salt/utils/xdg.py | # -*- coding: utf-8 -*-
'''
Create an XDG function to get the config dir
'''
import os
def xdg_config_dir(config_dir=None):
'''
Check xdg locations for config files
'''
xdg_config = os.getenv('XDG_CONFIG_HOME', os.path.expanduser('~/.config'))
xdg_config_dir = os.path.join(xdg_config, 'salt')
... | Python | 0.000004 | @@ -434,40 +434,26 @@
-return os.path.expanduser(
+config_dir =
'~/.'
-)
%0A
@@ -479,30 +479,21 @@
-return os.path.expand(
+config_dir =
os.p
@@ -519,10 +519,55 @@
fig_dir)
+%0A return os.path.expanduser(config_dir
)%0A
|
cdd491d1b007931425194f29723fa74603fea272 | Fix test: Make new file python3 syntax compatible. | command_line/stills_process_mpi.py | command_line/stills_process_mpi.py | #!/usr/bin/env python
#
# LIBTBX_SET_DISPATCHER_NAME dials.stills_process_mpi
from __future__ import absolute_import, division
import libtbx.load_env
import logging
logger = logging.getLogger(libtbx.env.dispatcher_name)
from libtbx.utils import Abort, Sorry
import os
from time import time
help_message = '''
MPI deri... | Python | 0 | @@ -120,16 +120,32 @@
division
+, print_function
%0Aimport
@@ -1945,17 +1945,17 @@
print
-
+(
diff_phi
@@ -1951,24 +1951,25 @@
nt(diff_phil
+)
%0A impor
@@ -3520,17 +3520,17 @@
print
-
+(
%22DELEGAT
@@ -3587,16 +3587,17 @@
t%5B0:10%5D)
+)
%0A%0A def
|
a88fa5c07a210a67126bb3cc7333c89c95d114cc | Remove mako_middleware_process_request, which doesn't cleanup after itself | common/djangoapps/edxmako/tests.py | common/djangoapps/edxmako/tests.py |
from mock import patch, Mock
import unittest
import ddt
from request_cache.middleware import RequestCache
from django.conf import settings
from django.http import HttpResponse
from django.test import TestCase
from django.test.utils import override_settings
from django.test.client import RequestFactory
from django.cor... | Python | 0 | @@ -6741,285 +6741,4 @@
e))%0A
-%0A%0Adef mako_middleware_process_request(request):%0A %22%22%22%0A Initialize the global RequestContext variable%0A edxmako.middleware.requestcontext using the request object.%0A %22%22%22%0A mako_middleware = edxmako.middleware.MakoMiddleware()%0A mako_middleware.pro... |
c90c66cf735e4ec279859b6db593ed8d2316088d | add SysfsAttributes.get() with optional default | sasutils/sysfs.py | sasutils/sysfs.py | #
# Copyright (C) 2016
# The Board of Trustees of the Leland Stanford Junior University
# Written by Stephane Thiell <sthiell@stanford.edu>
#
# 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 a... | Python | 0.000001 | @@ -3133,200 +3133,18 @@
-if not result:%0A return result%0A #elif printable and all(c in string.printable for c in result):%0A else:%0A return result%0A #else:%0A # return defa
+return res
ult%0A
@@ -4022,27 +4022,19 @@
def
-__
get
-item__
(self, k
@@... |
237fcac11a12a1fb0eba32a4fc516cb449f15577 | Fix bounce test | froide/bounce/tests.py | froide/bounce/tests.py | import os
import unittest
from datetime import datetime, timedelta
from django.test import TestCase
from django.db import connection
from froide.helper.email_utils import EmailParser
from froide.foirequest.tests.factories import UserFactory
from .models import Bounce
from .utils import (
make_bounce_address, add... | Python | 0.000002 | @@ -1543,12 +1543,12 @@
(5,
-0, 0
+5, 3
))%0A
|
e6db95cce0239d9e8ce33aec5cf21aa1bd19df03 | Add __str__ method | imagersite/imager_profile/models.py | imagersite/imager_profile/models.py |
from django.db import models
from django.contrib.auth.models import User
import six
@six.python_2_unicode_compatible
class ImagerProfile(models.Model):
user = models.OneToOneField(User)
fav_camera = models.CharField(max_length=30)
address = models.CharField(max_length=100)
web_url = models.URLField()
... | Python | 0.999825 | @@ -1,20 +1,31 @@
+import six%0A
%0Afrom django.db impo
@@ -78,26 +78,16 @@
rt User%0A
-import six
%0A%0A@six.p
@@ -370,8 +370,89 @@
th=30)%0A%0A
+ def __str__(self):%0A return %22%7B%7D's profile%22.format(self.user.username)%0A%0A
|
e9f986a0ade7d08a56157641efb49366f3c54bcc | Add a create column migration for canonical_bug_link | mysite/search/migrations/0016_add_looks_closed_column.py | mysite/search/migrations/0016_add_looks_closed_column.py |
from south.db import db
from django.db import models
from mysite.search.models import *
class Migration:
def forwards(self, orm):
# Adding field 'Bug.looks_closed'
db.add_column('search_bug', 'looks_closed', orm['search.bug:looks_closed'])
def backwards(self, o... | Python | 0.000001 | @@ -269,16 +269,112 @@
osed'%5D)%0A
+ db.add_column('search_bug', 'canonical_bug_link', orm%5B'search.bug:canonical_bug_link'%5D)%0A
@@ -522,16 +522,77 @@
losed')%0A
+ db.delete_column('search_bug', 'canonical_bug_link')%0A
|
18bb441017c26b850eeb84fda576c613a08238b1 | Fix the case when Paths.CWD is None | sc2/sc2process.py | sc2/sc2process.py | import sys
import signal
import time
import asyncio
import os.path
import shutil
import tempfile
import subprocess
import portpicker
import websockets
import logging
logger = logging.getLogger(__name__)
from .paths import Paths
from .protocol import Protocol
from .controller import Controller
class kill_switch(objec... | Python | 1 | @@ -2019,16 +2019,17 @@
cwd=
+(
str(Path
@@ -2034,16 +2034,40 @@
ths.CWD)
+ if Paths.CWD else None)
,%0A
|
93d75e45a277cbdbc551831d6e0462e3e5c430fb | Set keys public again on S3 caching. | funsize/cache/cache.py | funsize/cache/cache.py | """
funsize.database.cache
~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is currently a stub file that contains function prototypes for the
caching layer core
"""
import os
from boto.s3.connection import S3Connection
import funsize.utils.oddity as oddity
class Cache(object):
""" Class that provides access to cache
... | Python | 0 | @@ -2058,32 +2058,77 @@
fier, category)%0A
+ key.change_storage_class(%22STANDARD%22)%0A
if isfil
@@ -2126,24 +2126,24 @@
if isfile:%0A
-
@@ -2243,16 +2243,51 @@
(string)
+%0A key.set_acl('public-read')
%0A%0A de
@@ -2518,32 +2518,77 @@
fier, category)%0A
+ key.chang... |
37b994f96a7760ae962092e59d603455202f0985 | Document what the interface is for... | usingnamespace/traversal/Archive.py | usingnamespace/traversal/Archive.py | import logging
log = logging.getLogger(__name__)
from zope.interface import Interface
from zope.interface import implementer
from Entry import Entry
class IArchive(Interface):
pass
@implementer(IArchive)
class ArchiveYear(object):
"""ArchiveYear is the context for this years archives"""
def __init__(se... | Python | 0 | @@ -176,20 +176,59 @@
e):%0A
-pass
+%22%22%22Marker interface for archive contexts%22%22%22
%0A%0A@imple
|
f79a998c707f4ae7c6b5b3b1bf3aa730262f7538 | fix csrf | gamechat/chat/views.py | gamechat/chat/views.py | from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
from django.db import IntegrityError
from chat.models import ChatRoom
from gevent import queue
QUEUES = {'Chat Room': {'User... | Python | 0.000001 | @@ -1199,16 +1199,29 @@
= %7B%7D%0A%0A%0A
+@csrf_exempt%0A
def inde
@@ -2090,16 +2090,29 @@
('/')%0A%0A%0A
+@csrf_exempt%0A
@login_r
|
f930a0d8a52ef493098390c38d27622e882a8203 | fix published_by typo | openedx/core/djangoapps/content/course_overviews/connector.py | openedx/core/djangoapps/content/course_overviews/connector.py | import MySQLdb
import logging
from django.conf import settings
logger = logging.getLogger(__name__)
class EdevateDbConnector:
host = settings.EDEVATE_MYSQL_HOST
port = settings.EDEVATE_MYSQL_PORT
user = settings.EDEVATE_MYSQL_USER
passwd = settings.EDEVATE_MYSQL_PASSWD
db = settings.EDEVATE_MYSQ... | Python | 0 | @@ -1583,16 +1583,19 @@
ished_by
+_id
='%7B%7D';%0A
|
d01d12a0cbe286d808c9870b71374b36c0585230 | simplify newline handling | weka_weca/__init__.py | weka_weca/__init__.py |
class Node:
"""Data structure of a single node."""
def __init__(self, start, end, depth=0, indent=' '):
"""
Wrap string initially around string.
Parameters
----------
:param start : string
The start of the if-condition.
:param end : string
... | Python | 0.000147 | @@ -689,16 +689,34 @@
.indent%0A
+ nl = '%5Cn'%0A
@@ -724,20 +724,18 @@
cope =
-'%5Cn'
+nl
.join(%5Bs
@@ -785,20 +785,18 @@
esult =
-'%5Cn'
+nl
.join(%5Bi
|
9a21c446f1236e1b89663c991ea354d8e473b3b9 | Fix a copyright and pep8 issues in lanzano_luzi_2019_test.py | openquake/hazardlib/tests/gsim/lanzano_luzi_2019_test.py | openquake/hazardlib/tests/gsim/lanzano_luzi_2019_test.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2019 GEM Foundation
#
# OpenQuake 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 version 3 of the Licen... | Python | 0.001416 | @@ -83,13 +83,8 @@
(C)
-2015-
2019
@@ -99,16 +99,16 @@
ndation%0A
+
#%0A# Open
@@ -1052,16 +1052,17 @@
hallow,%0A
+
@@ -1129,16 +1129,16 @@
19deep)%0A
-
%0Afrom op
@@ -1251,16 +1251,17 @@
tests%0A%0A
+%0A
class La
@@ -2174,20 +2174,16 @@
AL.csv%22%0A
-
%0A def
|
03ed43d7d8867ba066d9eea3b3fc7cfe557a31d9 | Use C++ | test/setup.py | test/setup.py | from distutils.core import setup, Extension
test_py3c_module = Extension(
'test_py3c',
sources=['test_py3c.c'],
include_dirs=['../include'],
)
setup_args = dict(
name='test_py3c',
version='0.0',
description = '',
ext_modules = [test_py3c_module]
)
if __name__ == '__main__':
setup(**se... | Python | 0.000211 | @@ -147,16 +147,70 @@
lude'%5D,%0A
+ extra_compile_args = %5B'--std=c++0x', '-l mylib'%5D,%0A
)%0A%0Asetup
|
2543709c204f1dd6aca5d012e7c28193631bb74c | Use postgres standard env vars | gargbot_3000/config.py | gargbot_3000/config.py | #! /usr/bin/env python3.6
# coding: utf-8
import os
import datetime as dt
from pathlib import Path
import pytz
from dotenv import load_dotenv
env_path = Path(".") / ".env"
load_dotenv(dotenv_path=env_path)
slack_verification_token = os.environ["slack_verification_token"]
slack_bot_user_token = os.environ["slack_bot... | Python | 0 | @@ -466,23 +466,27 @@
nviron%5B%22
-db_name
+POSTGRES_DB
%22%5D%0Adb_us
@@ -502,23 +502,29 @@
nviron%5B%22
-db_user
+POSTGRES_USER
%22%5D%0Adb_pa
@@ -544,27 +544,33 @@
nviron%5B%22
-db_password
+POSTGRES_PASSWORD
%22%5D%0Adb_ho
@@ -586,23 +586,29 @@
nviron%5B%22
-db_host
+POSTGRES_HOST
%22%5D%0A%0Adrop
|
ac088bae6a09c8d2ee7f9deac3e701126ca5dfa4 | update boost | var/spack/packages/boost/package.py | var/spack/packages/boost/package.py | from spack import *
class Boost(Package):
"""Boost provides free peer-reviewed portable C++ source
libraries, emphasizing libraries that work well with the C++
Standard Library.
Boost libraries are intended to be widely useful, and usable
across a broad spectrum of applications. The Bo... | Python | 0.000001 | @@ -615,16 +615,248 @@
th = 2%0A%0A
+ version('1.59.0', '6aa9a5c6a4ca1016edd0ed1178e3cb87')%0A version('1.58.0', 'b8839650e61e9c1c0a89f371dd475546')%0A version('1.57.0', '1be49befbdd9a5ce9def2983ba3e7b76')%0A version('1.56.0', 'a744cf167b05d72335f27c88115f211d')%0A
vers
|
58e234ad7961e955726152436bcb3c8f270564c4 | fix py33 error in setup.py | vendor.py | vendor.py | import subprocess
import os
from os import path
import re
import traceback
import sys
error_msg = """
This library depends on sources fetched when packaging that failed to be
retrieved.
This means that it will *not* work as expected. Errors encountered:
"""
def run(cmd):
sys.stdout.write('[vendoring] Running c... | Python | 0 | @@ -884,16 +884,20 @@
r.write(
+str(
error_ms
@@ -897,16 +897,17 @@
rror_msg
+)
+'%5Cn')%0A
@@ -946,36 +946,41 @@
ys.stderr.write(
+str(
line
+)
+'%5Cn')%0A for l
@@ -1019,20 +1019,25 @@
r.write(
+str(
line
+)
+'%5Cn')%0A
|
281fd926786186e8f0b1ebc7d8aeb1c362310fc1 | Remove unused variable | viewer.py | viewer.py | import sys
import pygame
import pygame.locals
pygame.init()
size = width, height = 575, 575
screen = pygame.display.set_mode(size)
label_lights = False
def up_row(x_offset):
for i in range(20):
x = x_offset + (i % 2) * 0.5
y = i * 0.5
yield x, y
def down_row(x_offset):
for i in rang... | Python | 0.000015 | @@ -607,27 +607,8 @@
)%7D%0A%0A
-red = (255, 0, 0)%0A%0A
def
|
30088e034e32209e32e65218974ee717c718b1ab | Add start and stop entry points to sims. | wmt/flask/api/sims.py | wmt/flask/api/sims.py | import os
from flask import Blueprint
from flask import json, url_for, current_app
from flask import g, request, abort, send_file
from flask.ext.login import current_user, login_required
from ..utils import as_resource, as_collection
from ..errors import InvalidFieldError, AuthorizationError
from ..services import si... | Python | 0 | @@ -362,16 +362,52 @@
request%0A
+from ..tasks import exec_remote_wmt%0A
%0A%0Asims_p
@@ -2498,23 +2498,21 @@
int:id%3E/
-actions
+start
', metho
@@ -2532,15 +2532,13 @@
def
-actions
+start
(id)
@@ -2547,41 +2547,35 @@
-if request.method == 'POST':%0A
+sim = sims.get_or_404(id)%0A%0A
@@ -2623,147... |
8c026f79c223091c06deb0589dbf0ee342f4f0e5 | Change skeleton #2. | wood_site/settings.py | wood_site/settings.py | """
Django settings for wood_site project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import ... | Python | 0 | @@ -3231,8 +3231,74 @@
tatic/'%0A
+%0ASTATICFILES_DIRS = (%0A os.path.join(BASE_DIR, 'Wood/static'),%0A)
|
04595ae3ceaac9affabb3963e45857d534dfe95f | remove print statement (#1907) | insights/client/collection_rules.py | insights/client/collection_rules.py | """
Rules for data collection
"""
from __future__ import absolute_import
import hashlib
import json
import logging
import six
import shlex
import os
import requests
from six.moves import configparser as ConfigParser
from subprocess import Popen, PIPE, STDOUT
from tempfile import NamedTemporaryFile
from .constants impo... | Python | 0.000857 | @@ -1316,61 +1316,8 @@
on'%0A
- print(self.collection_rules_url)%0A
|
4571b8e6dee3d96073e88534620f6467a901c241 | Update Language_Processing.py | Week3-Case-Studies-Part1/Language-Processing/Language_Processing.py | Week3-Case-Studies-Part1/Language-Processing/Language_Processing.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 28 22:41:26 2017
@author: lamahamadeh
"""
'''
Case Study about Language Processing
'''
#counting words
#---------------
text = "This is a test text. We're keping this text short to keep things manageable." #test text
#Using loops
#-----------
d... | Python | 0.000001 | @@ -4319,18 +4319,18 @@
, %22leng
-h
t
+h
%22 , %22uni
@@ -5479,16 +5479,76 @@
, %22bo%22)%0A
+#OR we can write plt.plot(stats%5B'length'%5D, stats%5B'unique'%5D)%0A
plt.logl
|
2321dd5b0afedb9bb4a6e894149dd636174adf2c | Bump version to 4.0.1 | stix2elevator/version.py | stix2elevator/version.py | __version__ = "4.0.0"
| Python | 0 | @@ -12,11 +12,11 @@
= %224.0.
-0
+1
%22%0A
|
9fe2c266b72d6815c6270cfcc720cd5b1054eff8 | add record_convert_unit due to DRY problem | vnstat.py | vnstat.py | """ python frontend for vnstat cmd/tool """
from subprocess import getoutput
from datetime import datetime
import json
if __name__ == 'vnstat.vnstat':
from . import jalali
else:
import jalali
def read():
""" it return a vnstat as json object """
cmd = 'vnstat --json'
vnstat_out = getoutput(cmd)
... | Python | 0.000001 | @@ -1726,16 +1726,582 @@
ate'))%0A%0A
+def record_convert_unit(record, destination='K'):%0A %22%22%22 convert traffic unit of a record%0A units are in Xib but we just save X in record%0A %22%22%22%0A%0A units = %7B'K':2**10, 'M':2**20, 'G':2**30%7D%0A source = record%5B'unit'%5D%0A # calulating d... |
282ac04e49c6adef237ea30fa4dcae64e6f959d8 | Support for non-blank server roots | stronghold/middleware.py | stronghold/middleware.py | from django.contrib.auth.decorators import login_required
from stronghold import conf
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed in in django s... | Python | 0 | @@ -1072,16 +1072,21 @@
est.path
+_info
):%0A
|
79893a76c0b438ab3885a9c09027842ff92a26d2 | Update multiplier constant / tweak brightness | wakeup.py | wakeup.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# The Pin. Use Broadcom numbers.
BRIGHT_PIN = 17
# User config
START_BRIGHT = 15 # Minutes before alarm to start lighting up
END_BRIGHT = -45 # Minutes after alarm to turn off
MAX_BRIGHT = 255 # Max brightness 1 - 255
# Other constants
BRIGHT_MULTI = 255 / START_BR... | Python | 0 | @@ -299,19 +299,26 @@
MULTI =
-255
+MAX_BRIGHT
/ START
@@ -2060,17 +2060,16 @@
Diff %3E 5
-0
:%0A%09%09%09%09%09b
@@ -2101,33 +2101,33 @@
elif percDiff %3E
-5
+1
:%0A%09%09%09%09%09bright =
|
d425cf99e85367a47eb719bf1a94c9b344f61dec | add log trace when local node is not in address_list | supvisors/initializer.py | supvisors/initializer.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ======================================================================
# Copyright 2016 Julien LE CLEACH
#
# 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 Lice... | Python | 0 | @@ -2517,79 +2517,19 @@
-raise RPCError(Faults.SUPVISORS_CONF_ERROR,%0A
+message = f
'loc
@@ -2563,26 +2563,16 @@
list: %7B
-%7D'.format(
self.opt
@@ -2585,17 +2585,140 @@
ode_list
-)
+%7D'%0A self.logger.critical(f'Supvisors: %7Bmessage%7D')%0A raise RPCError... |
35de4045bc30a1ee0e9aaa17f0b3f370ad95d6c8 | Bump (#16) | swag_client/__about__.py | swag_client/__about__.py | from __future__ import absolute_import, division, print_function
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
__title__ = "swag-client"
__summary__ = ("Cloud multi-account metadata management tool.")
__uri__ = "https://github.co... | Python | 0 | @@ -371,9 +371,9 @@
0.2.
-3
+5
%22%0A%0A_
|
2c2e5bc83bbca3cd3c7ce7649be657293978ddd8 | append _tbl | webapp.py | webapp.py | import cherrypy
import os
import json
import getpass
from collections import OrderedDict
from configparser import ConfigParser
from builtins import input
import mysql.connector
#
# import sys
# import os.path
class DBConfig:
settings = {}
def __init__(self, config_file='..\db.cfg'):
if os.path.isfil... | Python | 0.999691 | @@ -1365,16 +1365,25 @@
ist_name
+ + %22_tbl%22
)%0A%0A%0A
|
67614fb784dca6166b112ddc60254ef5e493541d | Change 9/5 to 1.8 | wfinal.py | wfinal.py | import RPi.GPIO as GPIO
import pywapi
import string
import time
channels = [4, 7, 8, 9, 10, 14, 15, 17, 18, 22, 23, 24, 25]
GPIO.setwarnings(True)
GPIO.setmode(GPIO.BCM)
GPIO.setup(channels, GPIO.OUT)
GPIO.output(channels, 0)
weather = pywapi.get_weather_from_weather_com('33020')
temperature = int(weather['current_... | Python | 0.999999 | @@ -366,15 +366,13 @@
ture
- * (9/5
+*(1.8
)+32
|
5b02f334519964ffae6812df5413fcdae84db6ba | Undo changes to logger config, ie. remove the access_log_file option: decision is to support this through log_config rather tan adding an option. | synapse/config/logger.py | synapse/config/logger.py | # -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -1078,74 +1078,8 @@
ile)
-%0A self.access_log_file = self.abspath(args.access_log_file)
%0A%0A
@@ -1707,181 +1707,8 @@
)
-%0A logging_group.add_argument(%0A '--access-log-file', dest=%22access_log_file%22, default=%22access.log%22,%0A help=%22File to log server access to%2... |
20198ee76393dba0c5bf3ee327b5ed902f4c7d61 | new handlers for 'spiflash' and 'identifier_mem' | generate-zephyr-dts.py | generate-zephyr-dts.py | #!/usr/bin/env python3
# Copyright (c) 2019-2020 Antmicro <www.antmicro.com>
# Copyright (c) 2021 Henk Vergonet <henk.vergonet@gmail.com>
#
# Zephyr DTS & config overlay generator for LiteX SoC.
#
# This script parses LiteX 'csr.json' file and generates DTS and config
# files overlay for Zephyr.
# Changelog:
# - 2021... | Python | 0.999999 | @@ -452,34 +452,130 @@
r%0A#
- fix uart size parameter
+- 2021-07-15 Henk Vergonet %3Chenk.vergonet@gmail.com%3E%0A# added identifier_mem handler as dna0%0A# added spiflash as spi0
%0A#%0A%0A
@@ -2558,24 +2558,171 @@
ETH'%0A %7D,%0A
+ 'spiflash': %7B%0A 'handler': peripheral_handler,%0A ... |
07f8f44fc5f69c71922bb3b85d621867d0df49fa | Support core logger as a property on the main scraper. | scrapekit/core.py | scrapekit/core.py | from scrapekit.config import Config
from scrapekit.tasks import TaskManager, Task
from scrapekit.http import make_session
class Scraper(object):
""" Scraper application object which handles resource management
for a variety of related functions. """
def __init__(self, name, config=None):
self.nam... | Python | 0 | @@ -1,20 +1,124 @@
+from uuid import uuid4%0Afrom time import time%0Afrom datetime import datetime%0Afrom threading import local%0A%0A
from scrapekit.confi
@@ -219,16 +219,55 @@
session%0A
+from scrapekit.logs import make_logger%0A
%0A%0Aclass
@@ -482,71 +482,314 @@
elf.
-config = Config(self, config)%0A se... |
6edd4114c4e715a3a0c440af455fff089a099620 | Clarify comment about Pyhton versions | scrapy/squeues.py | scrapy/squeues.py | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... | Python | 0.000001 | @@ -582,10 +582,12 @@
thon
+
%3C=
+
3.4
@@ -634,20 +634,28 @@
#
+ 3.5 %3C=
Python
-%3E=3.5
+ %3C 3.6
rai
@@ -693,10 +693,12 @@
thon
+
%3E=
+
3.6
|
d6cdf99d87b23cd6bfd8fd7079919d89d6496501 | Complete incomplete sentence | partner_identification/models/res_partner_id_category.py | partner_identification/models/res_partner_id_category.py | # -*- coding: utf-8 -*-
#
# © 2004-2010 Tiny SPRL http://tiny.be
# © 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH
# http://www.camptocamp.at
# © 2015 Antiun Ingenieria, SL (Madrid, Spain)
# http://www.antiun.com
# Antonio Espinosa <antonioea@antiun.com>
# © 2016 ACSONE SA/NV (<http://a... | Python | 0.998694 | @@ -1059,16 +1059,55 @@
True to
+specify that the id number is not valid
.%0A# You
|
573d3a7411a1653f64b901077264ecb98c1f9673 | Use subprocess.check_call replace os.system | script/version.py | script/version.py | import importlib
import os
import sys
here = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def get_version() -> str:
"""
Return version.
"""
sys.path.insert(0, here)
return importlib.import_module("a2wsgi").__version__
os.chdir(here)
os.system(f"poetry version {get_version()}")
os... | Python | 0.000003 | @@ -30,16 +30,34 @@
port sys
+%0Aimport subprocess
%0A%0Ahere =
@@ -284,25 +284,37 @@
r(here)%0A
-os.system
+subprocess.check_call
(f%22poetr
@@ -339,27 +339,51 @@
sion()%7D%22
-)%0Aos.system
+, shell=True)%0Asubprocess.check_call
(%22git ad
@@ -395,9 +395,19 @@
sgi/
-*
+__init__.py
pyp
@@ -418,27 +418,51 @@
... |
cbdee53bc2239277d314b93d09368ab2462ab8d6 | Allow variety of input types | geojsonio/geojsonio.py | geojsonio/geojsonio.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import argparse
import sys
import urllib
import webbrowser
import github3
MAX_URL_LEN = 150e3 # Size threshold above which a gist is created
def display(contents, domain='http://geojson.io/'):
url = geojsonio_url(contents, domain)
webbrowser.open(url)
return... | Python | 0.000016 | @@ -55,16 +55,28 @@
rgparse%0A
+import json%0A
import s
@@ -78,16 +78,16 @@
ort sys%0A
-
import u
@@ -545,24 +545,484 @@
d contents%0A%0A
+ The input contents may be:%0A * string - assumed to be GeoJSON%0A * an object that implements __geo_interface__%0A A FeatureCollection will be constructed with... |
61d07e1ef8b01f80111f24efbbdf9fa02010daff | Handle missing package "imbox" with error message | intelmq/bots/collectors/mail/collector_mail_url.py | intelmq/bots/collectors/mail/collector_mail_url.py | # -*- coding: utf-8 -*-
import re
import sys
import imbox
import requests
from intelmq.lib.bot import Bot
from intelmq.lib.message import Report
class MailURLCollectorBot(Bot):
def process(self):
mailbox = imbox.Imbox(self.parameters.mail_host,
self.parameters.mail_user,
... | Python | 0.000003 | @@ -40,16 +40,25 @@
rt sys%0A%0A
+try:%0A
import i
@@ -62,16 +62,53 @@
t imbox%0A
+except ImportError:%0A imbox = None%0A
import r
@@ -189,16 +189,16 @@
eport%0A%0A%0A
-
class Ma
@@ -222,16 +222,163 @@
(Bot):%0A%0A
+ def init(self):%0A if imbox is None:%0A self.logger.error('Could not... |
a4feb3abb75e9fd686546e877290c191961601e1 | Update trns_validate_Genbank_Genome.py | plugins/scripts/validate/trns_validate_Genbank_Genome.py | plugins/scripts/validate/trns_validate_Genbank_Genome.py | #!/usr/bin/env python
# standard library imports
import sys
import os
import argparse
import logging
import subprocess
# 3rd party imports
# None
# KBase imports
import biokbase.Transform.script_utils as script_utils
def transform(input_file=None,
level=logging.INFO, logger=None):
"""
Validat... | Python | 0.000001 | @@ -789,32 +789,31 @@
ansform/
-GenBankT
+kbase_t
ransform
.jar:$KB
@@ -796,36 +796,37 @@
/kbase_transform
-.jar
+_deps
:$KB_TOP/lib/jar
@@ -1113,24 +1113,23 @@
orm/
-GenBankT
+kbase_t
ransform
.jar
@@ -1124,16 +1124,21 @@
ransform
+_deps
.jar:$KB
|
26355e29197659e6ca080eefa3871015167afa16 | Update deployment script. | scripts/deploy.py | scripts/deploy.py | # Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | Python | 0 | @@ -4181,32 +4181,33 @@
ges', dir_name)%0A
+%0A
if not o
@@ -4387,40 +4387,230 @@
-shutil.copytree(src_dir, dst_dir
+common.ensure_directory_exists(dst_dir)%0A%0A for filename in os.listdir(src_dir):%0A src = os.path.join(src_dir, filename)%0A dst = os.path.join(dst_dir, fil... |
714815fd943207089c1805e01c4f476ddf7c6917 | Add suport for html reports | jasperserver/core/ExportExecutionRequestBuilder.py | jasperserver/core/ExportExecutionRequestBuilder.py | from time import sleep
from resources_mime_type import ResourceFilesMimeType as rmt
import json
class ExportExecutionRequestBuilder(object):
def __init__(self, ReportExecutionRequestBuilder,js_connect, requestId, exportId):
self.rerb = ReportExecutionRequestBuilder
self.requestId = requestId
... | Python | 0 | @@ -616,20 +616,16 @@
-
#exports
@@ -660,24 +660,39 @@
s', %5B%5D)%0A
+ limit = 10%0A
path
@@ -756,28 +756,24 @@
f.exportId)%0A
-
cont
@@ -791,36 +791,33 @@
-
while
-True:%0A
+limit %3E 0:%0A
@@ -879,36 +879,32 @@
nse%0A
-
-
p... |
487f7a2235e8541670fc0e9949dd3c0fb80eb932 | fix formatting | projects/dendrites/permutedMNIST/experiments/__init__.py | projects/dendrites/permutedMNIST/experiments/__init__.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | Python | 0.001459 | @@ -1567,32 +1567,29 @@
FIGS.update(
-CENTROID
+BATCH
)%0ACONFIGS.up
@@ -1597,50 +1597,19 @@
ate(
-HYPERPARAMETERSEARCH)%0ACONFIGS.update(BATCH
+BATCH_MNIST
)%0ACO
@@ -1617,35 +1617,32 @@
FIGS.update(
-BATCH_MNIST
+CENTROID
)%0ACONFIGS.up
@@ -1642,32 +1642,44 @@
FIGS.update(
-CENTROID
+HYPERPARAMETERSEARCH
)%0A... |
8bdc316a6864e364a4d7a54d2d2da69c6855ca7b | Switch cql_major_version from 2 to 3 | cql/connection.py | cql/connection.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 0 | @@ -891,17 +891,17 @@
rsion =
-2
+3
%0A%0A de
|
57ac1c43181d3bd1f5a18a1ed3137c1b997e2533 | Fix lint error | keras_cv/layers/regularization/stochastic_depth.py | keras_cv/layers/regularization/stochastic_depth.py | # Copyright 2022 The KerasCV Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Python | 0.000035 | @@ -1141,33 +1141,8 @@
om %5B
-tensorflow_addons/layers/
stoc
@@ -1158,16 +1158,24 @@
pth.py%5D(
+https://
tinyurl.
@@ -1187,17 +1187,16 @@
r3y2af6)
-.
%0A%0A Ar
|
6fbfa11a6f13f8271687a83fc4de68f62d4a4501 | Fix encrpytion with custom salt | crypto/encrypt.py | crypto/encrypt.py | #!/bin/env python3
"""
Encrypt password with salt for unix
Usage:
encrypt.py [options] [--sha512 | --sha256 | --md5 | --crypt] [<salt>]
Options:
--sha512
--sha256
--md5
--crypt
"""
import sys
import crypt
from getpass import getpass
from docopt import docopt
# docopt(doc, argv=None, help=True, ve... | Python | 0 | @@ -83,16 +83,35 @@
options%5D
+ %5B--rounds %3Ccount%3E%5D
%5B--sha5
@@ -210,16 +210,64 @@
--crypt%0A
+ -r, --rounds %3Ccount%3E rounds%5Bdefault: 1000%5D%0A
%22%22%22%0A%0Aimp
@@ -431,17 +431,16 @@
_flag =
-%7B
%22--sha51
@@ -445,14 +445,8 @@
512%22
-:True%7D
%0A%0Ame
@@ -480,176 +480,445 @@
%22 :
-cr... |
4c2f6372bb5c1db18998626049aa8e53e9889452 | Fix an invalid build dependency. | syzygy/trace/rpc/rpc.gyp | syzygy/trace/rpc/rpc.gyp | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python | 0.999952 | @@ -1492,32 +1492,321 @@
_lib',%0A %5D,%0A
+ 'outputs': %5B%0A '%3C(SHARED_INTERMEDIATE_DIR)/syzygy/trace/rpc/call_trace_rpc.h',%0A '%3C(SHARED_INTERMEDIATE_DIR)/syzygy/trace/rpc/call_trace_rpc_c.cc',%0A '%3C(SHARED_INTERMEDIATE_DIR)/syzygy/trace/rpc/call_trace_rpc_s.cc',%0A %5D,%0A... |
6d174ff58dfef28cfa2ddfe65553bcefe9ae3e6f | Fix exc_info leack | gevent_fastcgi/wsgi.py | gevent_fastcgi/wsgi.py | # Copyright (c) 2011-2013, Alexander Kulakov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | Python | 0.999551 | @@ -2192,16 +2192,37 @@
_info):%0A
+ try:%0A
@@ -2269,25 +2269,24 @@
ailed')%0A
-%0A
def erro
@@ -2281,198 +2281,52 @@
-def error_output(self, environ, start_response):%0A start_response('500 Internal Server Error', %5B%0A ('Content-type', 'text/plai... |
84df8646ba396088e70ca8469b301d11d13d2da7 | Fix wrong query on running tis (#17631) | airflow/api/common/experimental/delete_dag.py | airflow/api/common/experimental/delete_dag.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | Python | 0.000017 | @@ -1698,16 +1698,25 @@
e.state)
+%0A
.filter(
@@ -1739,40 +1739,100 @@
nce.
-state.in_(State.unfinished)).all
+dag_id == dag_id)%0A .filter(models.TaskInstance.state == State.RUNNING)%0A .first
()%0A
|
bf87d7a60f20d9811fe2ff2c579f52b3e77a1ed3 | Remove unneeded print statement. | ctree/c/dotgen.py | ctree/c/dotgen.py | """
DOT generator for C constructs.
"""
from ctree.dotgen import DotGenLabeller
from ctree.types import codegen_type
class CDotGenLabeller(DotGenLabeller):
"""
Manages generation of DOT.
"""
def visit_SymbolRef(self, node):
s = r""
if node._global:
s += r"__global "
... | Python | 0.000005 | @@ -502,33 +502,8 @@
pe)%0A
- print(node.type)%0A
|
742cdc4419449a8190bddd8439c3559a1bf19180 | fix a bug, adding import | alphatwirl/concurrently/TaskPackageDropbox.py | alphatwirl/concurrently/TaskPackageDropbox.py | # Tai Sakuma <tai.sakuma@cern.ch>
import logging
from operator import itemgetter
from .WorkingArea import WorkingArea
##__________________________________________________________________||
class TaskPackageDropbox(object):
"""A drop box for task packages.
It puts task packages in a working area and dispatche... | Python | 0.000001 | @@ -42,16 +42,28 @@
logging%0A
+import time%0A
from ope
|
50861c6d256438afd880aebbb3a19ea360367fac | upgrade IdentityDetailSerializer to DRF3 | api/serializers/identity_detail_serializer.py | api/serializers/identity_detail_serializer.py | from core.models.identity import Identity
from rest_framework import serializers
class IdentityDetailSerializer(serializers.ModelSerializer):
created_by = serializers.CharField(source='creator_name')
quota = serializers.Field(source='get_quota_dict')
provider_id = serializers.Field(source='provider.uuid')... | Python | 0 | @@ -140,16 +140,18 @@
er):%0A
+ #
created
@@ -217,32 +217,40 @@
a = serializers.
+ReadOnly
Field(source='ge
@@ -286,32 +286,40 @@
d = serializers.
+ReadOnly
Field(source='pr
@@ -353,16 +353,24 @@
alizers.
+ReadOnly
Field(so
@@ -436,45 +436,21 @@
-exclude = ('credentials', 'created_by
+fields = ('id
'... |
310dfafe22677fa24524a50dd873c7c871b526e1 | make models ans questions required args | goethe/eval/analogy.py | goethe/eval/analogy.py | import os
import argparse
from collections import defaultdict
import gensim.models.keyedvectors
import pandas as pd
# Names used in output files
CORRECT = 'correct' # correctly answered questions
INCORRECT = 'incorrect' # incorrectly answered questions
ANSWERED = 'answered' # answered questions in total (correct + ... | Python | 0.000002 | @@ -2668,32 +2668,47 @@
ons', nargs='+',
+ required=True,
%0A
@@ -2810,16 +2810,31 @@
rgs='+',
+ required=True,
%0A
|
ef18eb5ce3ed8c65a1cf57c139cd5380f76ef707 | Improve `is_node` error message | graphene/relay/node.py | graphene/relay/node.py | from functools import partial
import six
from graphql_relay import from_global_id, to_global_id
from ..types import ID, Field, Interface, ObjectType
from ..types.interface import InterfaceMeta
def is_node(objecttype):
'''
Check if the given objecttype has Node as an interface
'''
assert issubclass(... | Python | 0.000002 | @@ -392,23 +392,48 @@
terface.
-'%0A )
+ Received %25s'%0A ) %25 objecttype
%0A for
|
af4440512a220a6e91f37b68250aaf5bb111ab15 | Handle tzlocal failures | graphite_api/config.py | graphite_api/config.py | import logging
import os
import structlog
import warnings
import yaml
from tzlocal import get_localzone
from importlib import import_module
from structlog.processors import (format_exc_info, JSONRenderer,
KeyValueRenderer)
from .middleware import CORS, TrailingSlash
from .search impo... | Python | 0.000001 | @@ -1048,16 +1048,127 @@
zone,%0A%7D%0A
+if default_conf%5B'time_zone'%5D == 'local': # tzlocal didn't find anything%0A default_conf%5B'time_zone'%5D = 'UTC'%0A
%0A%0A# attr
|
f21180292db82abfc69272c5c1b9e50c68645eca | fix gdpr form scrub tests in python 3 | corehq/apps/users/management/commands/gdpr_scrub_user_from_forms.py | corehq/apps/users/management/commands/gdpr_scrub_user_from_forms.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from django.core.management.base import BaseCommand
from corehq.apps.users.models import CouchUser
from corehq.form_processor.interfaces.dbaccessors import FormAccessors
from io import StringIO
from lxml... | Python | 0 | @@ -2047,16 +2047,32 @@
rm.xml%22)
+.decode('utf-8')
%0A
@@ -2108,22 +2108,8 @@
gIO(
-six.text_type(
form
@@ -2125,17 +2125,16 @@
nt_xml))
-)
%0A
|
1e4d80c50aaf253fd2bad9a2139737d8bf8dc927 | fix escape sequence DeprecationWarning (#1595) | gym/spaces/discrete.py | gym/spaces/discrete.py | import numpy as np
from .space import Space
class Discrete(Space):
"""A discrete space in :math:`\{ 0, 1, \dots, n-1 \}`.
Example::
>>> Discrete(2)
"""
def __init__(self, n):
assert n >= 0
self.n = n
super(Discrete, self).__init__((), np.int64)
... | Python | 0.000004 | @@ -66,16 +66,17 @@
e):%0A
+r
%22%22%22A dis
@@ -106,16 +106,17 @@
%7B 0, 1,
+%5C
%5Cdots, n
@@ -124,20 +124,16 @@
1 %5C%7D%60. %0A
-
%0A Exa
@@ -139,20 +139,16 @@
ample::%0A
-
%0A
@@ -164,24 +164,16 @@
rete(2)%0A
-
%0A %22%22%22
|
31b842cd0a443eb792d2e5a1c08880523f0239a2 | Improve Session Support | handler/BaseHandler.py | handler/BaseHandler.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
# Powered By KK Studio
# 2017-04-13
import tornado
import os
import time
import json
import hashlib
class BaseHandler(tornado.web.RequestHandler):
# 初始化函数
def initialize(self):
# 当前请求时间
self.time = int(time.time())
self.time_str = time.strftime... | Python | 0 | @@ -134,16 +134,48 @@
hashlib
+%0Afrom app.Session import Session
%0A%0Aclass
@@ -416,46 +416,8 @@
ion%0A
- self.session = None # %E7%94%A8%E6%88%B7%E6%9C%AA%E7%99%BB%E5%BD%95%E6%A0%87%E8%AF%86%0A
@@ -2376,33 +2376,22 @@
-self.session_key
+prefix
= self.
@@ -2412,19 +2412,22 @@
session_
... |
50248c3989624f935a4ff2a80229b997ca77f5c2 | fix generator issue | hazm/SequenceTagger.py | hazm/SequenceTagger.py | # coding: utf8
from __future__ import unicode_literals
from nltk.tag.api import TaggerI
from wapiti import Model
class SequenceTagger(TaggerI):
""" wrapper for [Wapiti](http://wapiti.limsi.fr) sequence tagger
>>> tagger = SequenceTagger(patterns=['*', 'U:word-%x[0,0]'])
>>> tagger.train([[('من', 'PRO'), ('به', '... | Python | 0 | @@ -1071,16 +1071,46 @@
ences):%0A
+%09%09sentences = list(sentences)%0A
%09%09lines
|
7cbc591a0a1c1bee5bdf573c55e12a270591e520 | handle no position in sample | xgds_sample/labels.py | xgds_sample/labels.py | # __BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance... | Python | 0 | @@ -2411,16 +2411,37 @@
nDict()%0A
+ try:%0A
@@ -2459,24 +2459,28 @@
lePosition:%0A
+
@@ -2535,16 +2535,20 @@
'lon'%5D:%0A
+
@@ -2649,16 +2649,57 @@
lon'%5D))%0A
+ except:%0A pass%0A
|
649a70d825d2182e3d5a4f42a83f377b66043e09 | bump version | yandextank/version.py | yandextank/version.py | VERSION = '1.17.1'
| Python | 0.000001 | @@ -9,11 +9,11 @@
= '1.17.
-1
+2
'%0A
|
60d93c3ade6f465e627c6c47c17d9c86e2b52f2a | Handle None challenge | app/grandchallenge/core/context_processors.py | app/grandchallenge/core/context_processors.py | import logging
from django.conf import settings
from guardian.shortcuts import get_perms
from guardian.utils import get_anonymous_user
logger = logging.getLogger(__name__)
def challenge(request):
try:
challenge = request.challenge
except AttributeError:
logger.warning(f"Could not get challen... | Python | 0.000001 | @@ -240,16 +240,70 @@
allenge%0A
+%0A if challenge is None:%0A return %7B%7D%0A%0A
exce
|
1518347c2c1ceb482031ca091d54dcae25eed083 | Refactor flip | zl/indicators/flip.py | zl/indicators/flip.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Jason Koelker
#
# 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 ... | Python | 0 | @@ -743,16 +743,248 @@
Bear'%0A%0A%0A
+def flip(events, field):%0A Yp = events%5B-1%5D%5Bfield%5D%0A Xp = events%5B-2%5D%5Bfield%5D%0A X = events%5B0%5D%5Bfield%5D%0A Y = events%5B1%5D%5Bfield%5D%0A%0A if (Xp %3E X) and (Yp %3C Y):%0A return BEAR%0A if (Xp %3C X) and (Yp %3E Y):%0A retu... |
0be54cb28387c535bea17e6c3a1a277151b9648a | Add the url name for students_info view to gci.views.helper.url_names. | app/soc/modules/gci/views/helper/url_names.py | app/soc/modules/gci/views/helper/url_names.py | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | Python | 0 | @@ -1629,12 +1629,53 @@
ent_id_form'
+%0A%0AGCI_STUDENTS_INFO = 'gci_students_info'
|
65c6c0b5ac47caac71c6c1284d84c1004d348c01 | Fix imports at top of file. | partner_relations/model/__init__.py | partner_relations/model/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | Python | 0 | @@ -979,16 +979,207 @@
######%0A%0A
+from . import res_partner%0Afrom . import res_partner_relation%0Afrom . import res_partner_relation_type%0Afrom . import res_partner_relation_all%0Afrom . import res_partner_relation_type_selection%0A%0A
PADDING
@@ -1434,196 +1434,4 @@
'p'%0A
-%0A%0Afrom . import res_partner%0Af... |
8a926a1894a20d5e9134f3996a31b82b3dcc37e1 | use gz file extension | pipeline/templatetags/compressed.py | pipeline/templatetags/compressed.py | from __future__ import unicode_literals
from django.contrib.staticfiles.storage import staticfiles_storage
from django import template
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from pipeline.conf import settings
from pipeline.packager import Packager, PackageNo... | Python | 0 | @@ -1513,24 +1513,222 @@
templates)%0A%0A
+ def gzip_allowed(self, http_accepts):%0A print http_accepts%0A return 'gzip' in http_accepts and%5C%0A settings.PIPELINE_ENABLED and getattr(settings, 'AWS_IS_GZIPPED', False)%0A%0A
%0Aclass Compr
@@ -1998,24 +1998,178 @@
ame, 'css')%0A
+ ... |
59ce82a3a98be7eb68c6d41117bced6802a84ee1 | fix for latest jwt | pivportal/lib/pivportal/security.py | pivportal/lib/pivportal/security.py | """ Command Line Interface Module """
from flask import Response, request
import json
import re
import jwt
import datetime
from functools import wraps
# Redis "requests" hash
# {"12345678": { "username": X, "client_ip": X, "authorized": False, "time": time.time()}}
# {"dn1": "user1", "dn2": "user2"}
dn_to_username = ... | Python | 0 | @@ -2105,16 +2105,27 @@
ept jwt.
+exceptions.
DecodeEr
@@ -2225,16 +2225,27 @@
ept jwt.
+exceptions.
ExpiredS
|
b1a9ce85686e8ff4a75864bd9a3ae1dc61a1c5ab | change make_result() | plenum/server/ledger_req_handler.py | plenum/server/ledger_req_handler.py | from abc import ABCMeta, abstractmethod
from typing import List
from plenum.common.constants import STATE_PROOF, TXN_TIME, DATA, MULTI_SIGNATURE, PROOF_NODES, ROOT_HASH
from common.exceptions import PlenumValueError, LogicError
from common.serializers.serialization import state_roots_serializer, proof_nodes_serialize... | Python | 0 | @@ -5905,44 +5905,8 @@
ata,
- last_seq_no=None, update_time=None,
pro
|
a056ddc885d7eb333ab323f7552bfffd35635a8a | Add period at end of plug-in description | plugins/ChangeLogPlugin/__init__.py | plugins/ChangeLogPlugin/__init__.py | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import ChangeLog
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "Changelog"),
"author": "Ul... | Python | 0 | @@ -457,16 +457,17 @@
version
+.
%22),%0A
|
9d92862f903b4683f1365e7ae82dd48d60e86d34 | Add new urls, login and register | aeSupernova/urls.py | aeSupernova/urls.py | from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'aeSupernova.views.home', name='home'),
# url(... | Python | 0 | @@ -90,16 +90,86 @@
lateView
+%0Afrom django.contrib import admin%0Afrom login import views%0Aimport login
%0A%0A# Unco
@@ -1359,18 +1359,120 @@
in.urls')),%0A
+ url(r'%5Elogin/', include('login.urls')),%0A url(r'%5Eregister/$', views.register, name='register'),%0A
)%0A
|
1fb2a774765bc46e1bc2474136f135c59006c787 | Return ConversationType in serializer | yunity/conversations/serializers.py | yunity/conversations/serializers.py | from rest_framework import serializers
from rest_framework.fields import CharField, DateTimeField
from rest_framework.relations import PrimaryKeyRelatedField
from yunity.api.serializers import UserSerializer
from yunity.conversations.models import ConversationMessage as MessageModel, ConversationType
from yunity.conver... | Python | 0.000001 | @@ -86,24 +86,47 @@
ateTimeField
+, SerializerMethodField
%0Afrom rest_f
@@ -1282,24 +1282,73 @@
_only=True)%0A
+ type = SerializerMethodField(read_only=True)%0A
particip
@@ -1453,24 +1453,101 @@
only=True)%0A%0A
+ def get_type(self, obj):%0A return ConversationType.name(obj.type)%0A%0A
def c... |
255ddb1a6910e590cb454a0d4e03f51b8d7b2092 | Update setup.py console script to use cli instead of main | {{cookiecutter.repo_name}}/setup.py | {{cookiecutter.repo_name}}/setup.py | import sys
import os
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
... | Python | 0 | @@ -1517,20 +1517,19 @@
_name%7D%7D.
-main
+cli
:main'%0A
|
2a4e5ad6ac5e5400564d0dc9306c2ab30b9dba98 | bump version | pinax_theme_bootstrap/__init__.py | pinax_theme_bootstrap/__init__.py | __version__ = "0.1.3" | Python | 0 | @@ -16,6 +16,6 @@
0.1.
-3
+4
%22
|
2eef6357cad8510163ef769a76e1d8680f16c639 | Fix compat tests | tests/private/compatpatch.py | tests/private/compatpatch.py | import copy
from ..common import ApiTestBase, ClientCompatPatch
class CompatPatchTests(ApiTestBase):
@classmethod
def init_all(cls, api):
return [
{
'name': 'test_compat_media',
'test': CompatPatchTests('test_compat_media', api, media_id='12065735749806900... | Python | 0.000002 | @@ -3184,37 +3184,37 @@
comment_
-patch
+dropp
ed = copy.deepco
@@ -3267,21 +3267,21 @@
comment_
-patch
+dropp
ed, drop
@@ -3327,37 +3327,37 @@
tIsNone(comment_
-patch
+dropp
ed.get('pk'))%0A%0A
@@ -4065,37 +4065,37 @@
)%0A%0A user_
-patch
+dropp
ed = copy.deepco
@@ -4131,37 +4131,37 @@
Patch.u... |
17a53960f069b7908bc1ac9d0815643d360e5d39 | fix a test in test_charts_json.py | tests/py/test_charts_json.py | tests/py/test_charts_json.py | from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
import json
from mock import patch
from aspen.utils import utcnow
from gratipay.billing.payday import Payday
from gratipay.testing import Harness
def today():
return datetime.datetime.utcnow().date().strftime('%Y-... | Python | 0.999832 | @@ -5660,25 +5660,23 @@
('/carl/
-anonymous
+privacy
.json',%0A
@@ -5712,16 +5712,26 @@
ggle': '
+anonymous_
receivin
|
483397df89119bc1967d0e6774375b495347b357 | fix viz routine | ott/utils/otp_utils.py | ott/utils/otp_utils.py | import os
import socket
import urllib2
import logging
log = logging.getLogger(__file__)
from ott.utils import file_utils
from ott.utils import exe_utils
# constants
DEF_NAME = "prod"
DEF_PORT = "55555"
OTP_DOWNLOAD_URL="http://maven.conveyal.com.s3.amazonaws.com/org/opentripplanner/otp/0.19.0/otp-0.19.0-shaded.ja... | Python | 0 | @@ -1703,24 +1703,43 @@
ava_mem=None
+, otp_name=OTP_NAME
):%0A otp_p
|
22fb6e8facd9bb7b22a175dd9ccac98609b2cfaa | fix sorting profiles in clustermanager | IPython/frontend/html/notebook/clustermanager.py | IPython/frontend/html/notebook/clustermanager.py | """Manage IPython.parallel clusters in the notebook.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, d... | Python | 0.000001 | @@ -3095,32 +3095,39 @@
nfo(p) for p in
+sorted(
self.profiles.ke
@@ -3134,31 +3134,10 @@
ys()
-%5D%0A result.sort(
)
+%5D
%0A
|
e428bd3776257030c538e85fe94154686b3e4ff0 | Make gen_fh.py script always use the next available FH number (#151) | scripts/gen_fh.py | scripts/gen_fh.py | # Generate this week's friday hack
# To generate some other FH pass in a number as argument
# e.g python gen_fh.py 1 generates next week's
# e.g python gen_fh.py 3 generates next next next week's
# Please first update data/friday_hacks.yml before running this
import yaml
from datetime import datetime, timedelta
from os... | Python | 0 | @@ -189,16 +189,143 @@
week's%0A
+# As for numbering, it will take the next number%0A# (e.g. if the previous post is FH #1000, the generated one will be FH #1001)%0A
# Please
@@ -1787,16 +1787,72 @@
m += 1%0A%0A
+ # In case you want to skip FH numbers BUT WHYYY!?!?%0A
# Wh
@@ -1869,24 +1869,26 @@
raction?%... |
7faa33c1eff79223252d6a7c4fe5ad033383df6c | Bump version | l10n_ch_payment_slip/__openerp__.py | l10n_ch_payment_slip/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Financial contributors: Hasa SA, Open Net SA,
# Prisme Solutions Informatique SA, Quod SA
#
# This program is free software: you... | Python | 0 | @@ -2212,17 +2212,17 @@
8.0.2.1.
-0
+1
',%0A 'aut
|
79ab477593813641063491f1064e6bc6c2d0c7fb | Add review-dashboard parameter | managesf/model/yamlbkd/resources/project.py | managesf/model/yamlbkd/resources/project.py | #
# Copyright (c) 2016 Red Hat, 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 ... | Python | 0.000001 | @@ -3758,32 +3758,227 @@
ct%22,%0A ),%0A
+ 'review-dashboard': (%0A str,%0A '%5E(%5Ba-zA-Z0-9%5C-_%5D)*$',%0A False,%0A %22%22,%0A True,%0A %22A gerrit dashboard name reference%22,%0A ),%0A
'mailing
|
2e608036c8611026f9fb47a762901700891e284e | use BufferedWriter for gzip files -- 30% faster writing | cutadapt/xopen.py | cutadapt/xopen.py | """
Open compressed files transparently.
"""
import gzip
import sys
import io
__author__ = 'Marcel Martin'
import sys
if sys.version_info[0] >= 3:
basestring = str
from codecs import getreader, getwriter
if sys.version_info < (2, 7):
buffered_reader = lambda x: x
else:
buffered_reader = io.BufferedReader
def ... | Python | 0 | @@ -264,16 +264,47 @@
da x: x%0A
+%09buffered_writer = lambda x: x%0A
else:%0A%09b
@@ -338,16 +338,53 @@
dReader%0A
+%09buffered_writer = io.BufferedWriter%0A
%0A%0Adef xo
@@ -981,16 +981,32 @@
%09return
+buffered_writer(
gzip.ope
@@ -1022,16 +1022,17 @@
e, mode)
+)
%0A%09%09else:
|
3f20f16ac4e5ba04317239a629f319064d331c85 | Change sanity check strategy again | cyder/base/vcs.py | cyder/base/vcs.py | import os
import re
from os.path import dirname, basename
from cyder.base.utils import dict_merge, Logger, run_command
class SanityCheckFailure(Exception):
pass
class ChdirHandler(object):
def __init__(self, path):
self.path = path
def __enter__(self):
self.old_dir = os.getcwd()
... | Python | 0 | @@ -4006,161 +4006,165 @@
-old_line_count = new_line_count = 0%0A%0A old_filenames, _, _ = self._run_command(%0A 'git ls-tree -r --name-only HEAD', ignore_failure=True)
+diff_ignore = (re.compile(r'--- %5CS'), re.compile(r'%5C+%5C+%5C+ %5CS'))%0A%0A output, _, _ = self._run_command('git d... |
fc683685d7df05ee0acc63a216c5b8fd99462219 | use f strings | metaci/plan/templatetags/templatehelpers.py | metaci/plan/templatetags/templatehelpers.py | """
https://simpleisbetterthancomplex.com/snippet/2016/08/22/dealing-with-querystring-parameters.html
"""
from django import template
register = template.Library()
@register.simple_tag
def relative_url(value, field_name, urlencode=None):
url = "?{}={}".format(field_name, value)
if urlencode:
querystr... | Python | 0.020803 | @@ -248,24 +248,12 @@
l =
+f
%22?%7B
-%7D=%7B%7D%22.format(
fiel
@@ -262,16 +262,18 @@
name
-,
+%7D=%7B
value
-)
+%7D%22
%0A
@@ -498,28 +498,17 @@
l =
+f
%22%7B
+url
%7D&%7B
-%7D%22.format(url,
enco
@@ -518,25 +518,26 @@
_querystring
-)
+%7D%22
%0A return
|
01e2be42f93f4e68b79ecee21818881158ecb759 | fix the whitelist + blacklist when neither are specified | environment_kernels/core.py | environment_kernels/core.py | # -*- coding: utf-8 -*-
import os
import glob
import platform
from jupyter_client.kernelspec import KernelSpecManager, KernelSpec, NoSuchKernel
from traitlets import List
__all__ = ['EnvironmentKernelSpecManager']
try:
import conda.config
HAVE_CONDA = True
except ImportError:
HAVE_CONDA = False
class... | Python | 0.000018 | @@ -1568,25 +1568,24 @@
%22%22%22%0A
-%0A
if s
@@ -1820,34 +1820,54 @@
True%0A el
+if self.blacklist_env
s
-e
:%0A re
@@ -1872,24 +1872,62 @@
return False
+%0A else:%0A return True
%0A%0A def _g
|
0430957f2b65ee0e14821027a15cfb956e976c62 | make method static | RatS/tmdb/tmdb_ratings_inserter.py | RatS/tmdb/tmdb_ratings_inserter.py | import time
from RatS.base.base_ratings_uploader import RatingsUploader
from RatS.tmdb.tmdb_site import TMDB
class TMDBRatingsInserter(RatingsUploader):
def __init__(self, args):
super(TMDBRatingsInserter, self).__init__(TMDB(args), args)
self.url_for_csv_file_upload = self._get_url_for_csv_uploa... | Python | 0.000023 | @@ -473,16 +473,34 @@
mit'%5D%22%0A%0A
+ @staticmethod%0A
def
@@ -523,20 +523,16 @@
_upload(
-self
):%0A
|
35a0904506ff51946c9c26a4ca9f61ae2f08b63e | bump to 1.6 | eventdispatcher/__init__.py | eventdispatcher/__init__.py | __author__ = 'Calvin Lobo'
__version__ = '1.5'
from .property import Property
from .dictproperty import DictProperty
from .listproperty import ListProperty
from .unitproperty import UnitProperty
class BindError(Exception):
pass
class EventDispatcher(object):
def __init__(self, **kwargs):
self.event... | Python | 0.000003 | @@ -41,9 +41,9 @@
'1.
-5
+6
'%0A%0Af
|
fe0f2b85af896b91001b39098a1a234399247293 | add `field_pk` for `parameter_name` for custom primary key in model | dal_admin_filters/__init__.py | dal_admin_filters/__init__.py | # -*- encoding: utf-8 -*-
from dal import autocomplete
from django import forms
from django.contrib.admin.filters import SimpleListFilter
from django.core.exceptions import ImproperlyConfigured
from django.forms.widgets import Media, MEDIA_TYPES
class AutocompleteFilter(SimpleListFilter):
template = "dal_admin_fi... | Python | 0 | @@ -376,24 +376,44 @@
d_name = ''%0A
+ field_pk = 'id'%0A
autocomp
@@ -1337,18 +1337,18 @@
= '%7B%7D__
-id
+%7B%7D
__exact'
@@ -1370,16 +1370,31 @@
eld_name
+, self.field_pk
)%0A
|
76f5e98aec0024fb6d015004e1f3f26434a01fc2 | Update _version.py | core/_version.py | core/_version.py | """Version information."""
# The following line *must* be the last in the module, exactly as formatted:
__version__ = "0.5.2"
| Python | 0.000002 | @@ -121,7 +121,7 @@
0.5.
-2
+3
%22%0A
|
8ff56b13178e2c7fa87e4b1bb0c9ecc7359e8775 | Use a func name instead of endpoints (#30204) | dashboard/http_server_head.py | dashboard/http_server_head.py | import asyncio
import errno
import ipaddress
import logging
from math import floor
import os
import sys
import time
try:
from packaging.version import Version
except ImportError:
from distutils.version import LooseVersion as Version
import ray.dashboard.optional_utils as dashboard_optional_utils
import ray.da... | Python | 0.000567 | @@ -4160,24 +4160,25 @@
monotonic()%0A
+%0A
try:
@@ -4589,36 +4589,40 @@
endpoint=
-request.path
+handler.__name__
,%0A
@@ -4922,20 +4922,24 @@
int=
-request.path
+handler.__name__
,%0A
@@ -5303,24 +5303,24 @@
in modules:%0A
-
@@ -5374,16 +5374,17 @@
bind(c)%0A
+%0A
... |
92febbffb91943f13cfac8c00e55103b20645b70 | Update [MediaContainer] children with the correct `section` object | plex/objects/library/container.py | plex/objects/library/container.py | from plex.objects.core.base import Property
from plex.objects.container import Container
from plex.objects.library.section import Section
class MediaContainer(Container):
section = Property(resolver=lambda: MediaContainer.construct_section)
title1 = Property
title2 = Property
identifier = Property
... | Python | 0 | @@ -971,8 +971,157 @@
d=True)%0A
+%0A def __iter__(self):%0A for item in super(MediaContainer, self).__iter__():%0A item.section = self.section%0A%0A yield item%0A
|
d9ddec5e0b6ceabbfc29e662fa8f54f0317ed3bb | set response.from_cache before calling hooks | requests_cache/core.py | requests_cache/core.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
requests_cache.core
~~~~~~~~~~~~~~~~~~~
Core functions for configuring cache and monkey patching ``requests``
"""
from contextlib import contextmanager
from datetime import datetime, timedelta
import requests
from requests import Session as OriginalSession... | Python | 0.000001 | @@ -4100,24 +4100,59 @@
re pickling%0A
+ response.from_cache = True%0A
resp
@@ -4223,43 +4223,8 @@
gs)%0A
- response.from_cache = True%0A
|
d4aa45b39eab5ce4b06d6343344afb05a0bf8582 | Fix pep8. | tryfer/tests/test_formatters.py | tryfer/tests/test_formatters.py | # 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, software
# distributed under th... | Python | 0 | @@ -629,16 +629,17 @@
atters%0A%0A
+%0A
class Te
|
410f65020c3b1ce13563a5019f4b0c49b599cbe0 | Add test for login with incorrect credentials | tests/test_authentication.py | tests/test_authentication.py | import unittest
from flask import json
from api import db
from api.BucketListAPI import app
from instance.config import application_config
class AuthenticationTestCase(unittest.TestCase):
def setUp(self):
app.config.from_object(application_config['TestingEnv'])
self.client = app.test_client()
... | Python | 0 | @@ -3524,32 +3524,512 @@
data.decode())%0A%0A
+ def test_incorrect_login_credentials(self):%0A %22%22%22Should check for valid email%22%22%22%0A%0A # First of all register%0A self.test_successfull_registration()%0A user = json.dumps(%7B%0A 'email': 'incorrect@gmail.com',%0A ... |
35293cecc99a629b3a185e69cf9ed3a339d9d1cf | Remove indentation level for easier review | automat/_introspection.py | automat/_introspection.py | """
Python introspection helpers.
"""
from types import CodeType as code, FunctionType as function
def copycode(template, changes):
if hasattr(code, "replace"):
return template.replace(**{"co_" + k : v for k, v in changes.items()})
else:
names = [
"argcount", "nlocals", "stacksize... | Python | 0.000004 | @@ -244,22 +244,8 @@
)%7D)%0A
- else:%0A
@@ -250,28 +250,24 @@
names = %5B%0A
-
%22arg
@@ -333,20 +333,16 @@
-
%22names%22,
@@ -407,20 +407,16 @@
-
%22freevar
@@ -430,34 +430,26 @@
llvars%22%0A
-
- %5D%0A
+%5D%0A
if hasat
@@ -479,36 +479,32 @@... |
2ff8489dce184d3c9762cc41e0c88b7b178b7555 | fix summary view button | conjureup/controllers/steps/gui.py | conjureup/controllers/steps/gui.py | import os
import os.path as path
from collections import OrderedDict, deque
from functools import partial
import yaml
from conjureup import async, controllers, utils
from conjureup.app_config import app
from conjureup.controllers.steps import common
from conjureup.models.step import StepModel
from conjureup.ui.views.... | Python | 0 | @@ -689,52 +689,8 @@
s)%0A%0A
- self.summary_button_exposed = False%0A
@@ -1556,120 +1556,100 @@
-if len(self.view.steps) == 0 and not self.summary_button_exposed:%0A self.summary_button_exposed = True
+self.n_completed_steps += 1%0A if self.n_completed_steps == len(self.all_step_w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.