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 |
|---|---|---|---|---|---|---|---|
b92d9e3b05f975ad34f8c62a462eee93377e8435 | Update wrappers.py | gym_minigrid/wrappers.py | gym_minigrid/wrappers.py | import math
import operator
from functools import reduce
import numpy as np
import gym
from gym import error, spaces, utils
class ActionBonus(gym.core.Wrapper):
"""
Wrapper which adds an exploration bonus.
This is a reward to encourage exploration of less
visited (state,action) pairs.
"""
de... | Python | 0.000001 | @@ -1773,11 +1773,11 @@
Use
-rgb
+the
ima
@@ -1809,16 +1809,38 @@
n output
+, no language/mission.
%0A %22%22%22
|
31caf3d6366cdc3669eb72007a1a6a45bffe2ce3 | Update at 2017-07-23 11-30-32 | plot.py | plot.py | from sys import argv
from pathlib import Path
import matplotlib as mpl
mpl.use('Agg')
import seaborn as sns
sns.set_style("darkgrid")
import matplotlib.pyplot as plt
import pandas as pd
# from keras.utils import plot_model
# plot_model(model, to_file='model.png', show_shapes=True, show_layer_names=False)
def plot_s... | Python | 0 | @@ -513,32 +513,37 @@
ax = df%5Bkeys%5D
+%5B:22%5D
.plot(kind='line
@@ -723,16 +723,21 @@
df%5Bkeys%5D
+%5B:22%5D
.plot(ki
|
c78f864c41d85762a307ced808d6a220a0893805 | [middleware] convert path to unicode | webnotes/middlewares.py | webnotes/middlewares.py | from __future__ import unicode_literals
import webnotes
import os
from werkzeug.wsgi import SharedDataMiddleware
from webnotes.utils import get_site_name, get_site_path, get_site_base_path, get_path
class StaticDataMiddleware(SharedDataMiddleware):
def __call__(self, environ, start_response):
self.environ = envir... | Python | 0.999999 | @@ -193,16 +193,22 @@
get_path
+, cstr
%0A%0Aclass
@@ -479,16 +479,37 @@
rt conf%0A
+%09%09%09path = cstr(path)%0A
%09%09%09fail
|
e2330caffae04bc31376a2e0f66f0e86ebf92532 | Add my own K-nearest-neighbor algorithm | kNearestNeighbors/howItWorksKNearestNeighbors.py | kNearestNeighbors/howItWorksKNearestNeighbors.py | Python | 0.000008 | @@ -0,0 +1,2606 @@
+# -*- coding: utf-8 -*-%0A%22%22%22K Nearest Neighbors classification for machine learning.%0A%0AThis file demonstrate knowledge of K Nearest Neighbors classification. By%0Abuilding the algorithm from scratch.%0AThe idea of K Nearest Neighbors classification is to best divide and separate%0Athe data... | |
5286417cf60742528cbf63d620f7696abdab927f | Fix TMAO recipients | reporter/reporter/__init__.py | reporter/reporter/__init__.py | #!/usr/bin/env python3
import pymssql
import smtplib
import markdown
import os
import logging
from enum import Enum
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from mimetypes import guess_type
from email.encoders import encode_base64
from email.mime.text import MIMET... | Python | 0.000016 | @@ -1988,36 +1988,36 @@
ER = 'RECIPIENT_
-SCAD
+TMAO
_MANAGER'%0D%0ARECIP
@@ -2037,36 +2037,36 @@
IN = 'RECIPIENT_
-SCAD
+TMAO
_ADMIN'%0D%0ARECIPIE
|
2f8ebebce8374b42a2e7c9963a35fe908439468a | fix error on different result | l10n_it_sale/wizard/stock_partial_picking.py | l10n_it_sale/wizard/stock_partial_picking.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-2014 Didotech (<http://www.didotech.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | Python | 0.000002 | @@ -3239,32 +3239,115 @@
if vals:%0A
+ if result.get('res_id', False) or context.get('active_id', False):%0A
self
@@ -3394,17 +3394,21 @@
sult
-%5B
+.get(
'res_id'
%5D, v
@@ -3403,17 +3403,59 @@
'res_id'
-%5D
+, False) or context.get('active_id', False)
, vals,
|
1d2d19a464f5e8c407e1d63130b852faf4799c70 | Fix bug when workspace contains special characters (#536) | catkin_tools/verbs/catkin_config/cli.py | catkin_tools/verbs/catkin_config/cli.py | # Copyright 2014 Open Source Robotics Foundation, 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... | Python | 0 | @@ -880,16 +880,26 @@
orMapper
+, sanitize
%0A%0Acolor_
@@ -7350,16 +7350,25 @@
s%60@%7C' %25
+sanitize(
context.
@@ -7378,16 +7378,17 @@
kspace))
+)
%0A%0A
|
43bbf64879ad0567805b0bab2fac123cfbc9c5f2 | Add scenario image endpoint | cea/interfaces/dashboard/api/project.py | cea/interfaces/dashboard/api/project.py | from flask_restplus import Namespace, Resource, fields, abort
import cea.config
import os
import re
api = Namespace('Project', description='Current project for CEA')
# PATH_REGEX = r'(^[a-zA-Z]:\\[\\\S|*\S]?.*$)|(^(/[^/ ]*)+/?$)'
PROJECT_PATH_MODEL = api.model('Project Path', {
'path': fields.String(descriptio... | Python | 0.000042 | @@ -1,8 +1,36 @@
+import os%0A%0Aimport geopandas%0A
from fla
@@ -87,46 +87,174 @@
ort%0A
-%0Aimport cea.config%0Aimport os%0Aimport re
+from staticmap import StaticMap, Polygon%0A%0Aimport cea.config%0Aimport cea.inputlocator%0Afrom cea.utilities.standardize_coordinates import get_geographic_coordinate_system
%0A%0... |
c5bf44204d1c9e53686053d45006782e77305fab | Fix mysql_engine option type | ceilometer/storage/sqlalchemy/models.py | ceilometer/storage/sqlalchemy/models.py | # -*- encoding: utf-8 -*-
#
# Author: John Tran <jhtran@att.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | Python | 0.000016 | @@ -1064,19 +1064,19 @@
cfg.
-Int
+Str
Opt('mys
|
72a633793b30a87b6affa528459185d46fc37007 | Update getJob signature | shared/api.py | shared/api.py | from __future__ import print_function
import boto3
import json
import os
import btr3baseball
jobTable = os.environ['JOB_TABLE']
jobQueue = os.environ['JOB_QUEUE']
repo = btr3baseball.JobRepository(jobTable)
queue = boto3.resource('sqs').get_queue_by_name(QueueName=jobQueue)
def submitJob(event, context):
# Put i... | Python | 0 | @@ -608,13 +608,23 @@
tJob
-Info(
+(event, context
):%0A
|
5692bb1c893182e5aac7271161e64fa9d1a03f2f | Remove test for backend.is_successful | celery/tests/test_backends/test_base.py | celery/tests/test_backends/test_base.py | import sys
import types
import unittest2 as unittest
from celery.serialization import subclass_exception
from celery.serialization import find_nearest_pickleable_exception as fnpe
from celery.serialization import UnpickleableExceptionWrapper
from celery.serialization import get_pickleable_exception as gpe
from celery... | Python | 0.000152 | @@ -923,21 +923,18 @@
b.
-is_successful
+get_status
, %22S
|
50c30f51925f40a7579e36e0ede59d4a584339ae | Fix lint in subunit to junit tools script (#6614) | tools/subunit_to_junit.py | tools/subunit_to_junit.py | #!/usr/bin/env python3
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any ... | Python | 0 | @@ -683,16 +683,122 @@
iably.%0A%0A
+%22%22%22Script to convert subunit stream returned by stestr to junitxml for processing by azure-pipelines.%22%22%22%0A%0A
import a
@@ -852,16 +852,48 @@
mlResult
+ # pylint: disable=import-error
%0Afrom su
@@ -1214,32 +1214,41 @@
lt.%0A%0A :param
+callable
result_factor... |
e6f63a90292f0c38ea91032741869d9036b542df | Disable autoescape for template rendering | mods/email.py | mods/email.py | #!/usr/bin/env python3
#
# Copyright 2016 Red Hat, Inc.
#
# Authors:
# Fam Zheng <famz@redhat.com>
#
# This work is licensed under the MIT License. Please see the LICENSE file or
# http://opensource.org/licenses/MIT.
from django.conf.urls import url
from django.http import HttpResponse, Http404
from django.core.u... | Python | 0 | @@ -7361,16 +7361,34 @@
t(params
+, autoescape=False
)%0A%0A
|
06d0287a8fef0679b281296e6ed76e0b6c803acb | Improve management command to clear or clean kvstore | sorl/thumbnail/management/commands/thumbnail.py | sorl/thumbnail/management/commands/thumbnail.py | from django.core.management.base import BaseCommand, CommandError
from sorl.thumbnail.conf import settings
from sorl.thumbnail import default
class Command(BaseCommand):
help = (
u'Handles thumbnails and key value store'
)
args = '[cleanup, clear]'
option_list = BaseCommand.option_list
de... | Python | 0 | @@ -1,12 +1,23 @@
+import sys%0A
from django.
@@ -74,49 +74,8 @@
ror%0A
-from sorl.thumbnail.conf import settings%0A
from
@@ -369,16 +369,116 @@
sity'))%0A
+%0A if not labels:%0A print self.print_help('thumbnail', '')%0A sys.exit(1)%0A%0A
@@ -824,24 +824,40 @@
bnails ... %22
... |
a8805982ff5b92a59d25a28e2acd63af3c210f65 | Add brute force sol | lc0945_minimum_increment_to_make_array_unique.py | lc0945_minimum_increment_to_make_array_unique.py | """Leetcode 945. Minimum Increment to Make Array Unique
Medium
URL: https://leetcode.com/problems/minimum-increment-to-make-array-unique/
Given an array of integers A, a move consists of choosing any A[i], and
incrementing it by 1.
Return the least number of moves to make every value in A unique.
Example 1:
Input: ... | Python | 0.99996 | @@ -655,16 +655,1197 @@
00%0A%22%22%22%0A%0A
+class SolutionBruteForce(object):%0A def minIncrementForUnique(self, A):%0A %22%22%22%0A :type A: List%5Bint%5D%0A :rtype: int%0A%0A Note: Time limit exceeded.%0A%0A Time complexity: O(n%5E2), where n is A's length.%0A Space com... |
435dd1ce0b2b53bcc2287e811aed8ed76db03011 | Add missing assignment to netid | shrunk/app.py | shrunk/app.py | """ shRUnk - Rutgers University URL Shortener
Sets up a Flask application for shRUnk.
"""
from flask import Flask, render_template, request, redirect, g
from flask_login import LoginManager, login_required, current_user, logout_user
from flask_auth import Auth
from shrunk.client import ShrunkCursor
from shrunk.forms ... | Python | 0 | @@ -2343,16 +2343,37 @@
etid%22):%0A
+ netid = None%0A
@@ -2475,16 +2475,51 @@
_admin:%0A
+ netid = current_user.netid%0A
|
b3a0178f0f6a2eadc823bacd91545c5ee861b25b | stop collecting the unmerged commits from unmerged branches | lib/markdownify.py | lib/markdownify.py | #!/usr/bin/env python3
import sys
import os
from os.path import exists as path_exists, join as path_join
from textwrap import indent
from .flatten import flatten
from .run import run_command as run
from .find_unmerged_branches import find_unmerged_branches_in_cwd
def indent4(string):
return indent(string, ' '... | Python | 0 | @@ -4370,154 +4370,16 @@
-_, commits = run(%5B'git', 'cherry', '-v', 'master', b%5D)%0A commits = %5Bc.strip() for c in commits.split('%5Cn') if c.strip()%5D%0A branch_msg
+result +
= '
@@ -4385,18 +4385,16 @@
%7B%7D%5Cn
-%7B%7D
'.format
@@ -4399,90 +4399,9 @@
at(b
-, '%5Cn'.join(%5B' ... |
ca3b1c09705d65307851711dca71714915e4525a | Fix the formatting of log message | ipaqe_provision_hosts/__main__.py | ipaqe_provision_hosts/__main__.py | #!/usr/bin/env python
from __future__ import print_function
import argparse
import logging
import sys
from ipaqe_provision_hosts.runner import create, delete
from ipaqe_provision_hosts.errors import IPAQEProvisionerError
CONFIG_HELP_MSG = (
'Configuration file for the topology. Must contain core configuration ... | Python | 0.999999 | @@ -1799,19 +1799,13 @@
to
-%7B%7D'.format(
+%25s',
logg
@@ -1831,17 +1831,16 @@
glevel))
-)
%0A%0A tr
|
0a524042190bed746cd4805d7868a9e5efbae20b | Add validator wsdl to service | sii/server.py | sii/server.py | # -*- coding: UTF-8 -*-
from sii.resource import SII
from zeep import Client
from requests import Session
from zeep.transports import Transport
wsdl_files = {
'emitted_invoice': 'http://www.agenciatributaria.es/static_files/AEAT/Contenidos_Comunes/La_Agencia_Tributaria/Modelos_y_formularios/Suministro_inmediato_i... | Python | 0 | @@ -606,16 +606,157 @@
.wsdl',%0A
+ 'ids_validator': 'https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/burt/jdit/ws/VNifV1.wsdl',%0A
%7D%0A%0A%0Adef
|
551c33b0f366d6df1fc6752f79f6ef68fc818851 | Fix default dict construction | python/smqtk/web/nearestneighbor_service/__init__.py | python/smqtk/web/nearestneighbor_service/__init__.py | import mimetypes
import multiprocessing
import os
import flask
import requests
from smqtk.algorithms.descriptor_generator import get_descriptor_generator_impls
from smqtk.algorithms.nn_index import NearestNeighborsIndex, get_nn_index_impls
from smqtk.representation import DescriptorElementFactory
from smqtk.represent... | Python | 0.000001 | @@ -1899,18 +1899,16 @@
erator%22:
- %7B
%0A
@@ -1966,30 +1966,16 @@
r_impls)
-%0A %7D
,%0A
|
d3c068ea7e240326235f3ac567354708246881de | Remove UnicodeWriter. | pybossa/exporter/csv_export.py | pybossa/exporter/csv_export.py | # -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2015 Scifabric LTD.
#
# PYBOSSA 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 License, or
# (at your op... | Python | 0.000001 | @@ -1030,47 +1030,8 @@
Run%0A
-from pybossa.util import UnicodeWriter%0A
from
|
01afa5bdbdf1900b5d67ffb6b0bb880d257a1869 | Update server.py | src/server.py | src/server.py | """Server for http-server echo assignment."""
import socket # pragma: no cover
import sys # pragma: no cover
from email.utils import formatdate
def server(): # pragma: no cover
"""
Open the server, waits for input from client.
Closes connection on completed message.
Closes server with Ctrl-C
"... | Python | 0.000001 | @@ -1233,24 +1233,31 @@
%22Send a
+200 OK
response
OK.%22%22%22%0A
@@ -1248,19 +1248,16 @@
response
- OK
.%22%22%22%0A
@@ -1287,29 +1287,8 @@
K%5Cr%5C
-nMessage recieved.%5Cr%5C
n'%0A
@@ -1417,24 +1417,41 @@
%22Send a
+500 server error
response
erorr.%22
@@ -1446,14 +1446,8 @@
onse
- erorr
.%22%22... |
5c97b9911a2dafde5fd1e4c40cda4e84974eb855 | Allow keys to be set (in anticipation of write commands). Better object __repr__() for spaces and tickets. | assembla/lib.py | assembla/lib.py | from functools import wraps
class AssemblaObject(object):
"""
Proxies getitem calls (eg: `instance['id']`) to a dictionary `instance.data['id']`.
"""
def __init__(self, data):
self.data = data
def __getitem__(self, key):
return self.data[key]
def keys(self):
return se... | Python | 0 | @@ -276,16 +276,87 @@
a%5Bkey%5D%0A%0A
+ def __setitem__(self, key, value):%0A self.data%5Bkey%5D = value%0A%0A
def
@@ -540,16 +540,370 @@
wargs)%0A%0A
+ def __repr__(self):%0A if 'name' in self.data:%0A return %22%3C%25s: %25s%3E%22 %25 (type(self).__name__, self.data%5B'name'%5D... |
d9db8ff917cabe6bdddbd4bb52cd7965d3e91d50 | Fix indentation of last commit | pyglet/media/drivers/silent.py | pyglet/media/drivers/silent.py | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import time
from pyglet.media import AbstractAudioPlayer, AbstractAudioDriver, \
MediaThread, MediaEvent
import pyglet
_debug = pyglet.options['debug_media']
class SilentAudioPacket(object):
def __in... | Python | 0.000182 | @@ -4694,24 +4694,28 @@
+
del events%5B0
|
e0d5c5b7b27d47f6a771634a0f36e9b30234f0a6 | add more duplicate code | pygmsh/opencascade/geometry.py | pygmsh/opencascade/geometry.py | import gmsh
from .. import common
from .ball import Ball
from .boolean import Boolean
from .box import Box
from .cone import Cone
from .cylinder import Cylinder
from .disk import Disk
from .rectangle import Rectangle
from .torus import Torus
from .wedge import Wedge
class Geometry(common.CommonGeometry):
def __i... | Python | 0.000001 | @@ -5409,441 +5409,8 @@
%22)%0A%0A
- def add_physical(self, entities, label=None):%0A if not isinstance(entities, list):%0A entities = %5Bentities%5D%0A%0A dim = entities%5B0%5D.dimension%0A for e in entities:%0A assert e.dimension == dim%0A%0A tag = gmsh.model.addP... |
d013f50b92e968258b14b67ebea9e70b4c35dcb0 | Fix completion | pylibs/ropemode/environment.py | pylibs/ropemode/environment.py | class Environment(object):
def ask(self, prompt, default=None, starting=None):
pass
def ask_values(self, prompt, values, default=None, starting=None):
pass
def ask_directory(self, prompt, default=None, starting=None):
pass
def ask_completion(self, prompt, values, starting=Non... | Python | 0.00144 | @@ -1840,16 +1840,34 @@
sal.name
+.partition(':')%5B0%5D
%0A%0A de
|
1563c35f10ac4419d6c732e0e25c3d2d62fcd3fd | send all available output to client if are multiple lines available | hey/server.py | hey/server.py | from twisted.internet import protocol, reactor
from twisted.internet.endpoints import TCP4ServerEndpoint
try:
from Queue import Queue, Empty
except ImportError:
# python 3.x
from queue import Queue, Empty
class HeyQueueFactory(protocol.Factory, object):
def __init__(self, outQueue, *args, **kwargs):
... | Python | 0 | @@ -970,32 +970,76 @@
whatsup(self):%0A
+ output = %22%22%0A while True:%0A
try:%0A
@@ -1047,23 +1047,28 @@
+
output
++
= self.o
@@ -1096,16 +1096,20 @@
+
+
except E
@@ -1114,16 +1114,57 @@
Empty:%0A
+ if output == %22%22:%0A
... |
bd8c4ce81340901cd7322f84cd1911581ce910dd | Use OptionParser for win32 build script. | tools/win32build/build.py | tools/win32build/build.py | """Python script to build windows binaries to be fed to the "superpack".
The script is pretty dumb: it assumes python executables are installed the
standard way, and the location for blas/lapack/atlas is harcoded."""
# TODO:
# - integrate the x86analysis script to check built binaries
# - make the config con... | Python | 0 | @@ -392,16 +392,77 @@
shutil%0D
+%0Afrom os.path import join as pjoin, split as psplit, dirname%0D
%0A%0D%0APYEXE
@@ -2949,195 +2949,399 @@
%0D%0A%0D%0A
-USAGE = %22%22%22build.py ARCH PYTHON_VERSION%0D%0A%0D%0AExample: build.py sse2 2.4.%22%22%22%0D%0A%0D%0Aif __name__ == '__main__':%0D%0A if len(sys.argv) %3C ... |
0dce50c77963ef0d2cdb168f85c2588d62f43220 | Remove duplicate import | yunity/stores/models.py | yunity/stores/models.py | from django.db import models
from config import settings
from yunity.base.base_models import BaseModel
from django.db import models
class PickupDate(BaseModel):
date = models.DateTimeField()
collectors = models.ManyToManyField(settings.AUTH_USER_MODEL)
store = models.ForeignKey('stores.store', related_nam... | Python | 0.000008 | @@ -1,33 +1,4 @@
-from django.db import models%0A
from
|
f55182fc2b3e05b154e82ae904cc1a6079b1c4a0 | Add (empty) unit tests for the OmicsUnitType model | apps/core/tests/test_models.py | apps/core/tests/test_models.py | import datetime
from django.core.exceptions import ValidationError
from django.db import IntegrityError, transaction
from django.test import TestCase
from apps.data.factories import EntryFactory
from .. import models
class SpeciesTestCase(TestCase):
def test_can_create_species(self):
name = 'Saccharom... | Python | 0 | @@ -3343,28 +3343,367 @@
.assertEqual(qs.count(), 1)%0A
+%0A%0Aclass OmicsUnitTypeTestCase(TestCase):%0A%0A def test_can_create_omics_unit_type(self):%0A # TODO%0A # raise NotImplementedError('You have work to do @thomasdenecker!')%0A pass%0A%0A def test_model_representation(self):%0A ... |
bc63b8f19742277ad96c2427405f1430687430d1 | expire jwt in 1 day | hbapi/settings/heroku.py | hbapi/settings/heroku.py | import dj_database_url
import os
from .base import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = [('znotdead', 'zhirafchik@gmail.com')]
DATABASES['default'] = dj_database_url.config()
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STAT... | Python | 0.000001 | @@ -548,8 +548,80 @@
= True%0A
+%0AJWT_AUTH = %7B%0A 'JWT_EXPIRATION_DELTA': datetime.timedelta(days=1),%0A%7D%0A
|
0d7cab10d66fb13d5ea9ddd4fd048ff29def5ba2 | Fix F811 redefinition of unused '_ast_py3' | astroid/_ast.py | astroid/_ast.py | import ast
import sys
from collections import namedtuple
from functools import partial
from typing import Optional
import astroid
_ast_py3 = None
try:
import typed_ast.ast3 as _ast_py3
except ImportError:
pass
PY38 = sys.version_info[:2] >= (3, 8)
if PY38:
# On Python 3.8, typed_ast was merged back into... | Python | 0.000008 | @@ -129,24 +129,8 @@
id%0A%0A
-_ast_py3 = None%0A
try:
@@ -196,12 +196,23 @@
-pass
+_ast_py3 = None
%0A%0A%0AP
|
cee2368dac250ef9655a3df9af3188b8abd095dc | Disable slow test. Not intended to run. | spec/puzzle/examples/gph/a_basic_puzzle_spec.py | spec/puzzle/examples/gph/a_basic_puzzle_spec.py | from data import warehouse
from puzzle.examples.gph import a_basic_puzzle
from puzzle.problems import number_problem
from puzzle.puzzlepedia import prod_config
from spec.mamba import *
with description('a_basic_puzzle'):
with before.all:
warehouse.save()
prod_config.init()
self.subject = a_basic_puzzle.g... | Python | 0 | @@ -184,16 +184,17 @@
*%0A%0Awith
+_
descript
|
fccfdbcdae7af60ae0773ad03f6a52f367e6cd48 | Add switch to disable datastore writes | hn-archive.py | hn-archive.py | import functools
import logging
import os
from google.appengine.api import memcache
from google.appengine.api import taskqueue
from google.appengine.ext import deferred
from google.appengine.ext import ndb
import jinja2
import webapp2
from webapp2_extras import routes
import models
IS_LOCAL_DEV_SERVER = os.environ.g... | Python | 0.000001 | @@ -279,16 +279,48 @@
models%0A%0A
+ENABLE_DATASTORE_WRITES = True%0A%0A
IS_LOCAL
@@ -1697,24 +1697,135 @@
, time=600)%0A
+ if not ENABLE_DATASTORE_WRITES:%0A logging.info(%22Datastore writes disabled, sleeping%22)%0A return%0A
last_ret
@@ -3497,32 +3497,155 @@
def get(self):%0A
+ if n... |
fe6ba23a7c27ca7e82b73f17602ae0239db16584 | Update views.py | vio/vio/swagger/views/volume/views.py | vio/vio/swagger/views/volume/views.py | # Copyright (c) 2017 VMware, 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 w... | Python | 0 | @@ -2960,63 +2960,8 @@
nfo)
-%0A image_op = OperateImage.OperateImage(vim_info)
%0A%0A
@@ -3542,16 +3542,75 @@
00_OK)%0A%0A
+ image_op = OperateImage.OperateImage(vim_info)%0A
@@ -4154,32 +4154,32 @@
rror': str(e)%7D,%0A
-
@@ -4215,28 +4215,29 @@
P_500_INTERNAL_SERVE... |
e1f808c4c854d92c8a37f0a75ce49a26398ddc52 | Fix an error in the encode/decode functions for PKCS#1 DSA public keys | asyncssh/dsa.py | asyncssh/dsa.py | # Copyright (c) 2013-2014 by Ron Frederick <ronf@timeheart.net>.
# All rights reserved.
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License v1.0 which accompanies this
# distribution and is available at:
#
# http://www.eclipse.org/legal/epl-v10.html
#
#... | Python | 0.998915 | @@ -1605,9 +1605,9 @@
==
-5
+4
and
@@ -1637,37 +1637,16 @@
ey_data)
- and key_data%5B0%5D == 0
):%0A
@@ -1644,33 +1644,33 @@
)):%0A
-_
+y
, p, q, g, y = k
@@ -1662,19 +1662,16 @@
p, q, g
-, y
= key_d
@@ -3385,33 +3385,43 @@
return (
-0
+self._key.y
, self._key.p, s
@@ -3443,29 +3... |
3066f8f64f185624fe95a696d7fcef102dc61921 | add galery models | helena/content/models.py | helena/content/models.py | from django.db import models
from helpers.service import image_path
class Genres(models.Model):
""" class with genres model """
def get_image_path(instace, filename):
return image_path(instace, filename, directory='genres')
title = models.CharField(verbose_name='Заголовок', max_length=200)
... | Python | 0.000001 | @@ -74,14 +74,20 @@
ass
-Genres
+ImgWithDescr
(mod
@@ -136,16 +136,38 @@
el %22%22%22%0A%0A
+ directory = None%0A%0A
def
@@ -260,16 +260,22 @@
ory=
-'genres'
+self.directory
)%0A%0A
@@ -342,16 +342,31 @@
ngth=200
+, required=True
)%0A de
@@ -478,15 +478,8 @@
%D0%B5%D0%BD%D0%B8%D0%B5
- %D0%BF%D1%80... |
3d19af590505edc572d9ea990ccc9bfe63393643 | Fix landing page in DocGen presubmit (#1140) | docgen/docgen.py | docgen/docgen.py | #!/usr/bin/env python3
#
# Copyright 2021 The Bazel 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 ... | Python | 0 | @@ -2204,32 +2204,16 @@
g_page=%22
-versions/master/
bazel-ov
|
a1d3304f993702460077d7f6c70607131aff874b | add fix keyword | libs/player.py | libs/player.py | # @Time : 2016/11/11 11:01
# @Author : lixintong
from keywords import keyword, var_cache
@keyword('current_activity')
def current_activity(acticity_desc):
"""
:param acticity_desc:video_player or topic_player or live or vr_live or pic_player or local_player
:return:
"""
return var_cache['proxy... | Python | 0 | @@ -492,35 +492,24 @@
or live or
-vr_live or
pic_player o
|
04d0bb5a32b3e1b66c6ac1e27df656aed607c3cb | Test suite: Fix re_util doctest on PyPy | python/phonenumbers/re_util.py | python/phonenumbers/re_util.py | """Additional regular expression utilities, to make it easier to sync up
with Java regular expression code.
>>> import re
>>> from .re_util import fullmatch
>>> from .util import u
>>> string = 'abcd'
>>> r1 = re.compile('abcd')
>>> r2 = re.compile('bc')
>>> r3 = re.compile('abc')
>>> fullmatch(r1, string) # doctest:... | Python | 0 | @@ -329,12 +329,10 @@
IS%0A%3C
-_sre
+..
.SRE
|
f373638885a9dbd599117f782613203f251e3bfb | add example code to try out the LinearFilter | lib/neuroimaging/algorithms/kernel_smooth.py | lib/neuroimaging/algorithms/kernel_smooth.py | import gc
import numpy as N
import numpy.fft as fft
import numpy.linalg as NL
from neuroimaging.core.image.image import Image
from neuroimaging.algorithms.utils import fwhm2sigma
from neuroimaging.core.reference.mapping import Affine
class LinearFilter(object):
'''
A class to implement some FFT smoothers for... | Python | 0 | @@ -314,17 +314,16 @@
ers for
-V
Image ob
@@ -3621,8 +3621,509 @@
buffer)%0A
+%0Aif __name__ == '__main__':%0A from neuroimaging.core.image.image import Image%0A from pylab import plot, show, imshow, subplot%0A a = 100*N.random.random((100, 100, 100))%0A img = Image(a)%0A filt = LinearFilter(img.grid... |
28b856dfe7ba9860b6f0e826f9e6e56a2b0d5c45 | Tidy up clean module | dotbriefs/clean.py | dotbriefs/clean.py | import re
import sys
import yaml
from collections import OrderedDict
from textsub import Textsub
from util import warning
keyword_dict = {
'(?#QuotedString)' : r'("[^"\\]*(?:\\.[^"\\]*)*"|\'[^\'\\]*(?:\\.[^\'\\]*)*\')',
'(?#QuotedOrSingleWord)' : r'("[^"\\]*(?:\\.[^"\\]*)*"|\'[^\'\\]*(?:\\.[^\'... | Python | 0 | @@ -14,10 +14,9 @@
ort
-sy
+o
s%0Aim
@@ -117,16 +117,296 @@
rning%0A%0A%0A
+# Configuration file for templates%0ACONFIG_FILE = '.dotbriefs.yaml'%0ACONFIG_PATH = '.dotfiles'%0A%0A# Tag used in regex substitution for secret keys%0ATAG_SECRET_KEY = '(?#Key)'%0A%0A# Used to tag secrets in dot files%0ATAG_SECRET_START =... |
f44b5758f2320021fa607891e97a6f4e438b47a2 | Add command line flag for tail end cutoff for specificity score experiments | train_bert_keras_model.py | train_bert_keras_model.py | """
Copyright 2020 Google LLC.
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
dis... | Python | 0 | @@ -1842,24 +1842,90 @@
, type=str)%0A
+ parser.add_argument('--tail-cutoff', default=0.5, type=float)%0A
args = p
@@ -2302,16 +2302,20 @@
UTOFF =
+int(
df.shape
@@ -2322,12 +2322,27 @@
%5B0%5D
-// 2
+* args.tail_cutoff)
%0A
@@ -2365,16 +2365,17 @@
df = df%5B
+-
CUTOFF:%5D
|
7fcfe4ece5d7b792b2f38b9b0115f590d3fe0e60 | Fix glu.py for windows | autoconf/glu.py | autoconf/glu.py | from _external import *
from gl import *
if windows:
glu = LibWithHeaderChecker('GLU32', ['windows.h','GL/glu.h'], 'c', dependencies=[gl])
if macos:
glu = LibWithHeaderChecker('OpenGL', ['OpenGL/glu.h'], 'c', name='glu')
else :
glu = LibWithHeaderChecker('GLU', ['GL/glu.h'], 'c', dependencies=[gl])
| Python | 0.000002 | @@ -140,16 +140,18 @@
gl%5D) %0A
+el
if macos
|
33017d1266b36635a5f29db5ae6883e1bf97e76e | Add fullPath to folders in box metadata | waterbutler/providers/box/metadata.py | waterbutler/providers/box/metadata.py | import os
from waterbutler.core import metadata
class BaseBoxMetadata(metadata.BaseMetadata):
def __init__(self, raw, folder):
super().__init__(raw)
self.folder = folder
@property
def provider(self):
return 'box'
class BoxFolderMetadata(BaseBoxMetadata, metadata.BaseFolderMeta... | Python | 0.000001 | @@ -248,16 +248,494 @@
'box'%0A%0A
+ @property%0A def full_path(self):%0A if 'path_collection' not in self.raw:%0A return None%0A%0A path = %5B%5D%0A for entry in reversed(self.raw%5B'path_collection'%5D%5B'entries'%5D):%0A if self.folder == entry%5B'id'%5D:%0A ... |
ce9d25400bff704c87038a77ea1a3290e680f8f3 | Update EN_background_check.py | qctests/EN_background_check.py | qctests/EN_background_check.py | """
Implements the background check on reported levels from the EN quality control
system, http://www.metoffice.gov.uk/hadobs/en3/OQCpaper.pdf
"""
import EN_spike_and_step_check
import numpy as np
import util.obs_utils as outils
def test(p, *args, **kwargs):
"""
Runs the quality control check on profile p ... | Python | 0 | @@ -1267,25 +1267,20 @@
ilon %3C
-len(grid)
+nlon
, 'Longi
@@ -1353,25 +1353,20 @@
ilat %3C
-len(grid)
+nlat
, 'Latit
|
2e3d31dd20936574d238fc61c1d43983d8b9ff1c | Add out_path input. | qipipe/interfaces/fix_dicom.py | qipipe/interfaces/fix_dicom.py | from nipype.interfaces.base import (BaseInterface,
BaseInterfaceInputSpec, traits, Directory, TraitedSpec)
import os
from qipipe.staging.fix_dicom import fix_dicom_headers
class FixDicomInputSpec(BaseInterfaceInputSpec):
source = Directory(exists=True, desc='The input patient directory', mandatory=True)
de... | Python | 0 | @@ -421,24 +421,20 @@
c):%0A
-out_path
+dest
= Direc
@@ -457,24 +457,31 @@
, desc=%22The
+target
output patie
@@ -818,16 +818,12 @@
ts%5B'
-out_path
+dest
'%5D =
|
61da0b379efefa5dbbc4341c8fd653cf1411040f | fix wenjuan question is checkbox | apps/wenjuan/serializer/report.py | apps/wenjuan/serializer/report.py | # -*- coding:utf-8 -*-
from rest_framework import serializers
from wenjuan.models.question import Job, Report, Answer
# from wenjuan.serializer.question import JobModelSerializer
from wenjuan.serializer.answer import AnswerDetailSerializer
class ReportModelSerializer(serializers.ModelSerializer):
"""
Report ... | Python | 0.999999 | @@ -2148,16 +2148,25 @@
field =
+%22,%22.join(
field_va
@@ -2168,25 +2168,16 @@
ld_value
-.join(%22,%22
)%0A
@@ -2646,16 +2646,25 @@
field =
+%22,%22.join(
answer_f
@@ -2676,17 +2676,8 @@
list
-.join(%22,%22
)%0A
|
9d3d541faaf993665040d39a5cacb52d7a096cde | Add in a model concept for settings | drupdates/utils.py | drupdates/utils.py | import datetime
import requests
import os
from os.path import expanduser
import yaml
def nextFriday():
# Get the data string for the following Friday
today = datetime.date.today()
if datetime.datetime.today().weekday() == 4:
friday = str(today + datetime.timedelta( (3-today.weekday())%7+1 ))
else:
frid... | Python | 0.000001 | @@ -1825,16 +1825,60 @@
(self):%0A
+ self.__settings = %7B%7D%0A self.__model()%0A
curr
@@ -2226,17 +2226,16 @@
= dict(
-
self.__s
@@ -2241,16 +2241,24 @@
settings
+.items()
+ self.
@@ -2275,16 +2275,178 @@
ems())%0A%0A
+ def __model(self):%0A model = %7B%7D%0A model%5B'default'%5D = ''%0A ... |
3972594787f4ed33d656ff0c097fdb3633a96b14 | add testcase for #1 | tsstats/tests/test_log.py | tsstats/tests/test_log.py | import pytest
from tsstats.exceptions import InvalidLog
from tsstats.log import parse_log, parse_logs
@pytest.fixture
def clients():
return parse_log('tsstats/tests/res/test.log')
def test_log_client_count(clients):
assert len(clients) == 3
def test_log_onlinetime(clients):
assert clients['1'].online... | Python | 0.000001 | @@ -1,16 +1,40 @@
+from time import sleep%0A%0A
import pytest%0A%0Af
@@ -931,8 +931,267 @@
.log'))%0A
+%0A%0A@pytest.mark.slowtest%0Adef test_log_client_online():%0A clients = parse_log('tsstats/tests/res/test.log')%0A assert clients%5B'1'%5D.onlinetime == 402%0A sleep(2)%0A clients = parse_log('tsstats/t... |
07f86c47c58d6266bd4b42c81521001aca072ff1 | Add some more rubbish to example string | jsonconfigparser/test/__init__.py | jsonconfigparser/test/__init__.py | import unittest
from jsonconfigparser import JSONConfigParser
class JSONConfigTestCase(unittest.TestCase):
def test_init(self):
JSONConfigParser()
def test_read_string(self):
string = '[section]\n' + \
'foo = "bar"\n'
cf = JSONConfigParser()
cf.read_string(s... | Python | 0.000173 | @@ -245,22 +245,165 @@
'
-foo = %22bar%22%5Cn'
+# comment comment%5Cn' + %5C%0A 'foo = %22bar%22%5Cn' + %5C%0A '%5Cn' + %5C%0A '%5Bsection2%5D%5Cn' + %5C%0A 'bar = %22baz%22%5Cn'%0A
%0A%0A
|
39da3725f9b8e6842f06954c562873d0a8ff731a | fix silly request header error | dvc/remote/http.py | dvc/remote/http.py | from __future__ import unicode_literals
from dvc.scheme import Schemes
from dvc.utils import LARGE_FILE_SIZE
from dvc.utils.compat import open
import requests
import logging
from dvc.progress import Tqdm
from dvc.exceptions import DvcException
from dvc.config import Config
from dvc.remote.base import RemoteBASE
log... | Python | 0.000004 | @@ -875,23 +875,25 @@
_length(
-request
+from_info
)%0A%0A
|
6215aea4723192bd69632781b43535d846bbfb69 | Fix delete option | solrbackup.py | solrbackup.py | #!/usr/bin/env python
#
# Solr 4 remote backup tool
#
# URL: https://github.com/nla/solrbackup
# Author: Alex Osborne <aosborne@nla.gov.au>
# License: MIT
#
import json, time, os, struct, zlib, sys, errno
from urllib import urlencode
from urllib2 import urlopen
from contextlib import closing
from optparse import Option... | Python | 0.000005 | @@ -4282,16 +4282,43 @@
files%5D)%0A
+ if options.delete:%0A
for
@@ -4351,16 +4351,20 @@
+
+
if file
@@ -4376,16 +4376,20 @@
n keep:%0A
+
@@ -4435,16 +4435,20 @@
', file%0A
+
@@ -5796,38 +5796,37 @@
re_true%22, dest=%22
-verbos
+delet
e%22, default=Fals
|
546368705e132fcc462f63e40f89eb431c54ec65 | Remove XMLField (removed from django 1.4) | dynamo/settings.py | dynamo/settings.py |
# django imports
from django.conf import settings
# Delete database column after field has been deleted
DYNAMO_DELETE_COLUMNS = getattr(settings,'DYNAMO_DELETE_COLUMNS',True)
# Delete database table after model has been deleted
DYNAMO_DELETE_TABLES = getattr(settings,'DYNAMO_DELETE_TABLES',True)
# Default app to ... | Python | 0 | @@ -1427,54 +1427,8 @@
d),%0A
- ('XMLField', models.XMLField),%0A
@@ -2602,44 +2602,8 @@
d',%0A
- 'XMLField',%0A
@@ -3582,44 +3582,8 @@
d',%0A
- 'XMLField',%0A
|
49ff951100b35c63d6b04f4c18f8123240fabec1 | Check for datetime present in event start and end date. | economicpy/gcal.py | economicpy/gcal.py | import gflags
import httplib2
from apiclient.discovery import build
from oauth2client.file import Storage
from oauth2client.client import OAuth2WebServerFlow
from oauth2client.tools import run
class Calendar(object):
def __init__(self, client_id, client_secret, ignore_events, src_path):
self.user_agent =... | Python | 0 | @@ -2259,16 +2259,106 @@
e_events
+ %5C%0A and 'dateTime' in event%5B'start'%5D and 'dateTime' in event%5B'end'%5D
:%0A
|
60039cd74693982ef38808a63366aa1454b50bd1 | Bump version to 13.3.2 | recipe_scrapers/__version__.py | recipe_scrapers/__version__.py | __version__ = "13.3.1"
| Python | 0 | @@ -13,11 +13,11 @@
= %2213.3.
-1
+2
%22%0A
|
6c293419d490f217a520e6c9fc696b39a46a172c | Fix excludes | froide_campaign/providers/amenity.py | froide_campaign/providers/amenity.py | from django.template.defaultfilters import slugify
from django_amenities.models import Amenity
from froide.publicbody.models import PublicBody
from froide.georegion.models import GeoRegion
from ..models import InformationObject
from .base import BaseProvider, first
class AmenityProvider(BaseProvider):
CREATE_... | Python | 0.000006 | @@ -1,16 +1,47 @@
+from django.db.models import Q%0A
from django.temp
@@ -814,17 +814,16 @@
c', '')%5D
-,
%0A
@@ -837,16 +837,18 @@
ude(
+Q(
name='')
.exc
@@ -843,24 +843,20 @@
name='')
-.exclude
+ %7C Q
(osm_id_
@@ -867,16 +867,17 @@
osm_ids)
+)
%0A%0A de
|
87a720dc526efe9732fd1b4633e773ef4a11352a | Use earliest consultation if legal date is unavailable | mainapp/management/commands/fix-sort-date.py | mainapp/management/commands/fix-sort-date.py | import datetime
from django.core.management.base import BaseCommand
from django.db.models import F
from mainapp.models import Paper, File
class Command(BaseCommand):
help = "After the initial import, this command guesses the sort_date-Attribute of papers and files"
def add_arguments(self, parser):
... | Python | 0 | @@ -10,16 +10,40 @@
tetime%0A%0A
+from dateutil import tz%0A
from dja
@@ -116,16 +116,39 @@
import F
+, Subquery, OuterRef, Q
%0A%0Afrom m
@@ -179,16 +179,30 @@
er, File
+, Consultation
%0A%0A%0Aclass
@@ -980,32 +980,61 @@
%25M:%25S%22%0A )
+.replace(tzinfo=tz.tzlocal())
%0A fallbac
@@ -1069,16 +1... |
f243a972c320292b68923a37b386b1681eee280c | fix for pull_request check | fuelweb_test/tests/base_test_case.py | fuelweb_test/tests/base_test_case.py | # Copyright 2013 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 ... | Python | 0.000001 | @@ -1570,43 +1570,32 @@
ame
-!= %22%22 and snapshot_name is not None
+and not UPLOAD_MANIFESTS
:%0A
|
df255b635517ed1dbcbbf06841a7b7971edd26b5 | fix import of User | registration_couchdb/models.py | registration_couchdb/models.py | import datetime
import random
import re
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.hashcompat import sha_constructor
from couchdbkit.ext.django.schema import *
from django_couchdb_utils.auth import User
SHA1_RE = re.compile('^[a-f0-9]{40}$')
def activate... | Python | 0.000006 | @@ -245,16 +245,23 @@
ils.auth
+.models
import
|
5320f9bd74aeab70849cf288d5da4a94bd98cccd | store labels in a separate text field | load_corpus.py | load_corpus.py | #!/usr/bin/env python
from elasticsearch import Elasticsearch
from elasticsearch.client import IndicesClient
import os
es = Elasticsearch()
index = IndicesClient(es)
if index.exists('yso'):
index.delete('yso')
indexconf = {
'mappings': {
'concept': {
'properties': {
'text... | Python | 0.000001 | @@ -288,24 +288,151 @@
perties': %7B%0A
+ 'labels': %7B%0A 'type': 'string',%0A 'analyzer': 'finnish'%0A %7D,%0A
@@ -966,14 +966,63 @@
-text =
+labels = f.readline().strip()%0A text = labels + %22 %22 +
%22%22.
@@ -1080,16 +10... |
0c5310374e7eaeb39fcc3c184b60afa096abf364 | Add missing methods from ItemWrapper | gaphor/core/modeling/presentation.py | gaphor/core/modeling/presentation.py | """
Base code for presentation elements
"""
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Callable,
Dict,
Generator,
Generic,
List,
Optional,
TypeVar,
)
from gaphor.core.modeling import Element
from gaphor.core.modeling.properties import association, attribute... | Python | 0 | @@ -190,16 +190,30 @@
tional,%0A
+ Sequence,%0A
Type
@@ -977,16 +977,135 @@
e None%0A%0A
+ def attribute(self, name: str) -%3E str:%0A return %22%22%0A%0A def state(self) -%3E Sequence%5Bstr%5D:%0A return ()%0A%0A
%0Aclass S
|
4a719e275c3639b2a2186711d9d616ce9435d614 | Update agent for environment | reinforcement-learning/play.py | reinforcement-learning/play.py | """This is the agent which currently takes the action with highest immediate reward."""
import pandas as pd
import numpy as np
import env
actions = ["left", "right", "stay"]
left = {x: [0]*(env.screen_width - 1) for x in range(2)}
right = {x: [0]*(env.screen_width - 1) for x in range(2)}
table = pd.DataFrame(left)
... | Python | 0 | @@ -93,491 +93,28 @@
ort
-pandas as pd%0Aimport numpy as np%0Aimport env%0A%0Aactions = %5B%22left%22, %22right%22, %22stay%22%5D%0A%0Aleft = %7Bx: %5B0%5D*(env.screen_width - 1) for x in range(2)%7D%0Aright = %7Bx: %5B0%5D*(env.screen_width - 1) for x in range(2)%7D%0Atable = pd.DataFrame(left)%0A%0Adef max(list):%0... |
2a2ab3f758facfafe3604325ecec08cfcfa2b6e9 | Update tests.py | image_space_app/tests.py | image_space_app/tests.py | import datetime
import unittest
from django.utils import timezone
from django.test import TestCase
class ImageSpaceTests(unittest.TestCase):
def setUp(self):
self.url="http://localhost:8000"
self.email="John@doe.com"
self.password="password"
def tearDown(self):
del self.ur... | Python | 0.000001 | @@ -1447,16 +1447,19 @@
+At
sign up
@@ -1686,16 +1686,226 @@
quired%22%0A
+ self.assertNotEqual(self.email,%22Johndoe%22)%0A print %22At the sign up page if the user enter email address to sign up without @something.com then prompt error to enter the valid email address with @%22%0A
%0A%0A%... |
74a7e32f9ca2376fbc2e987f3bedc75570dc8b1d | Use name instead of uid in validation error message when trying to pair the same parent a second time | kpi/serializers/v2/paired_data.py | kpi/serializers/v2/paired_data.py | # coding: utf-8
import os
import re
from django.utils.translation import gettext as _
from formpack import FormPack
from rest_framework import serializers
from rest_framework.reverse import reverse
from kpi.constants import (
ASSET_TYPE_SURVEY,
PERM_PARTIAL_SUBMISSIONS,
PERM_VIEW_SUBMISSIONS,
)
from kpi.f... | Python | 0 | @@ -7015,28 +7015,24 @@
ent %60%7Bparent
-_uid
%7D%60 is alread
@@ -7064,36 +7064,32 @@
ormat(parent
-_uid
=parent.
uid))%0A%0A
@@ -7068,35 +7068,36 @@
t(parent=parent.
-uid
+name
))%0A%0A retu
|
7fb829cf17b8274ca67f98356e2d47abedc2df5b | Add type information to component registry | gaphor/services/componentregistry.py | gaphor/services/componentregistry.py | """
A registry for components (e.g. services) and event handling.
"""
from typing import Set, Tuple
from gaphor.abc import Service
from gaphor.application import ComponentLookupError
class ComponentRegistry(Service):
"""
The ComponentRegistry provides a home for application wide components.
"""
def ... | Python | 0 | @@ -87,18 +87,43 @@
ort
-Set, Tuple
+Iterator, Set, Tuple, Type, TypeVar
%0Afro
@@ -204,16 +204,50 @@
Error%0A%0A%0A
+T = TypeVar(%22T%22, bound=Service)%0A%0A%0A
class Co
@@ -382,24 +382,32 @@
init__(self)
+ -%3E None
:%0A se
@@ -471,16 +471,24 @@
wn(self)
+ -%3E None
:%0A
@@ -521,25 +521,41 @@
... |
907165cf323d2492ee2fc2f837a0aff2fec8ef77 | Update utils.py | banpei/utils.py | banpei/utils.py | import numpy as np
def power_method(A, iter_num=1):
"""
Calculate the first singular vector/value of a target matrix based on the power method.
Parameters
----------
A : numpy array
Target matrix
iter_num : int
Number of iterations
Returns
-------
u : numpy ... | Python | 0 | @@ -759,8 +759,1693 @@
u, s, v%0A
+%0A%0Adef _rolling_window(a, window):%0A %22%22%22%0A Usage:%0A a = np.random.rand(30, 5)%0A for 2d array:%0A roll aling axis=0: rolling_window(a.T, 3).transpose(1, 2, 0)%0A roll along axis=1: rolling_window(a, 3).transpose(1, 0, 2)%0A for 3d array:%0A ... |
c793401befa1efed0b5ad1eb77809c23f6855372 | Fix ES thread mapping. | inbox/search/mappings.py | inbox/search/mappings.py | # TODO[k]: participants as nested, tags too.
THREAD_MAPPING = {
'properties': {
'namespace_id': {'type': 'string'},
'tags': {'type': 'string'},
'last_message_timestamp': {'type': 'date', 'format': 'dateOptionalTime'},
'object': {'type': 'string'},
'message_ids': {'type': 'str... | Python | 0 | @@ -38,16 +38,127 @@
gs too.%0A
+# first/last_message_timestamp as %7B'type': 'date', 'format': 'dateOptionalTime'%7D%0A# for range filters and such?%0A
THREAD_M
@@ -316,42 +316,14 @@
': '
-date', 'format': 'dateOptionalTime
+string
'%7D,%0A
@@ -535,42 +535,14 @@
': '
-date', 'format': 'dateOptionalTime
+string
'... |
e0dac0a621cbeed615553e5c3544f9c49de96eb2 | Subtract 1 from model end_year | metadata/FrostNumberModel/hooks/pre-stage.py | metadata/FrostNumberModel/hooks/pre-stage.py | """A hook for modifying parameter values read from the WMT client."""
import os
import shutil
from wmt.utils.hook import find_simulation_input_file
from topoflow_utils.hook import assign_parameters
file_list = []
def execute(env):
"""Perform pre-stage tasks for running a component.
Parameters
-------... | Python | 0 | @@ -142,16 +142,27 @@
put_file
+, yaml_dump
%0Afrom to
@@ -479,17 +479,21 @@
ation'%5D)
+ - 1
%0A
-
env%5B
@@ -577,16 +577,17 @@
e_list)%0A
+%0A
for
@@ -659,16 +659,16 @@
fname%5D)%0A
-
@@ -695,8 +695,41 @@
curdir)%0A
+%0A yaml_dump('_env.yaml', env)%0A
|
be7ee0ba4cdfab1ef03b0d58913cddb00c572c0f | Revise descriptive comments | lc0131_palindrome_partitioning.py | lc0131_palindrome_partitioning.py | """Leetcode 131. Palindrome Partitioning
Medium
URL: https://leetcode.com/problems/palindrome-partitioning/
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
Example:
Input: "aab"
Output:
[
["aa","b"],
["a","a","b"]
]
"""
... | Python | 0.000001 | @@ -143,16 +143,17 @@
ch that
+%0A
every su
@@ -315,17 +315,16 @@
%0A%5D%0A%22%22%22%0A%0A
-%0A
class So
@@ -365,33 +365,32 @@
(self, result, t
-e
mps, s, start):%0A
@@ -413,24 +413,143 @@
== len(s):%0A
+ # Check partial string with start len(s): empty string ''.%0A # Palindrom partition ... |
797ce2ce387a8b95a1a20e9c09400a6755d3be66 | Use the settings on the package #49 | base_command.py | base_command.py | import sublime
import sublime_plugin
import os.path
is_sublime_text_3 = int(sublime.version()) >= 3000
if is_sublime_text_3:
from .progress_notifier import ProgressNotifier
from .cross_platform_codecs import CrossPlaformCodecs
else:
from progress_notifier import ProgressNotifier
from cross_platform_co... | Python | 0 | @@ -164,32 +164,67 @@
rogressNotifier%0A
+ from .settings import Settings%0A
from .cross_
@@ -314,32 +314,66 @@
rogressNotifier%0A
+ from settings import Settings%0A
from cross_p
@@ -1094,53 +1094,17 @@
s =
-sublime.load_settings(%22Gulp.sublime-settings%22
+Settings(
)%0A
|
9d29061f8520506d798ad75aa296be8dc838aaf7 | Remove leftover print call in paginator | resolwe/elastic/pagination.py | resolwe/elastic/pagination.py | """.. Ignore pydocstyle D400.
==================
Elastic Paginators
==================
Paginator classes used in Elastic app.
.. autoclass:: resolwe.elastic.pagination.LimitOffsetPostPagination
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from rest_framework.pagination im... | Python | 0 | @@ -1041,80 +1041,8 @@
ry:%0A
- print(get_query_param(request, self.limit_query_param))%0A
|
f7abcfa295565fc1742dccda8ec28f34917320ff | Allow server socket reuse | soco/events.py | soco/events.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Classes to handle Sonos UPnP Events
"""
try: # python 3
from http.server import SimpleHTTPRequestHandler
from urllib.request import urlopen
from urllib.error import URLError
import socketserver
from queue import Queue
except Im... | Python | 0.000003 | @@ -772,28 +772,50 @@
ead %22%22%22%0A
-pass
+allow_reuse_address = True
%0A%0A%0Aclass Eve
@@ -5035,28 +5035,29 @@
= event_listener.event_queue
+%0A
|
9971f0d54ccf2046957a86a2cd9c0d104243a607 | Add option to rebuild test modules before running | script/test.py | script/test.py | #!/usr/bin/env python
import argparse
import os
import shutil
import subprocess
import sys
from lib.util import electron_gyp, rm_rf
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
PROJECT_NAME = electron_gyp()['project_name%']
PRODUCT_NAME = electron_gyp()['product_name%']
def main():
... | Python | 0 | @@ -99,39 +99,188 @@
lib.
-util import electron_gyp, rm_rf
+config import PLATFORM, enable_verbose_mode, get_target_arch%0Afrom lib.util import electron_gyp, execute, get_electron_version, rm_rf, %5C%0A update_electron_modules
%0A%0A%0AS
@@ -539,16 +539,309 @@
ration%0A%0A
+ if args.verbose:%0A ... |
7e42c10472dd8c97649d523bb00c13f952698c46 | Fix versions | myvcs/main.py | myvcs/main.py | #!/usr/bin/env python
import os
from os.path import exists, isdir, join
import shutil
import sys
META_DIR = '.myvcs'
def backup(path):
backup_dir = join(path, META_DIR)
if exists(backup_dir):
shutil.rmtree(backup_dir)
def is_backup_dir(src, names):
if src == path:
return [META... | Python | 0.000001 | @@ -44,16 +44,26 @@
h import
+ basename,
exists,
@@ -89,16 +89,30 @@
shutil%0A
+import string%0A
import s
@@ -718,19 +718,41 @@
name
- != 'stash'
+.startswith(tuple(string.digits))
%0A
@@ -889,23 +889,21 @@
))%0A%0Adef
-snapsho
+commi
t(path,
@@ -1156,16 +1156,89 @@
ersions)
+%0A print versions%0... |
1dcea652d825c86fb6f69a736a81a9ddce056804 | Remove raven and whitenoise from settings.py | resource_tracking/settings.py | resource_tracking/settings.py | from dbca_utils.utils import env
import dj_database_url
import os
from pathlib import Path
# Project paths
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = str(Path(__file__).resolve().parents[1])
# Application definition
DEBUG = env('DEBUG', False)
SECRET_KEY = env('SECRET_KEY', 'Pl... | Python | 0.000003 | @@ -1591,49 +1591,8 @@
s',%0A
- 'raven.contrib.django.raven_compat',%0A
@@ -1776,58 +1776,8 @@
e',%0A
- 'whitenoise.middleware.WhiteNoiseMiddleware',%0A
@@ -3797,152 +3797,8 @@
%7D,%0A
- 'sentry': %7B%0A 'level': 'WARNING',%0A 'class': 'raven.contrib.django.raven_compa... |
ee1effb3a91bca7fcf1c590955f45e5b631a0598 | Revise documentation | hanlp/pretrained/ner.py | hanlp/pretrained/ner.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-30 20:07
from hanlp_common.constant import HANLP_URL
MSRA_NER_BERT_BASE_ZH = HANLP_URL + 'ner/ner_bert_base_msra_20200104_185735.zip'
'BERT model (:cite:`devlin-etal-2019-bert`) trained on MSRA with 3 entity types.'
MSRA_NER_ALBERT_BASE_ZH = HANLP_URL + 'ner/ner_... | Python | 0.000001 | @@ -582,33 +582,34 @@
ed on MSRA with
-3
+26
entity types. F
|
6df071a84e4c1c75e93c33e6e8676cf4b618e2a6 | Add __version__ and remove testing hack | bes/__init__.py | bes/__init__.py | """
Log actions to Elastic Search (via UDP)
"""
import datetime as _datetime
import json as _json
import logging as _logging
import socket as _socket
LOG = _logging.getLogger(__name__)
DEFAULT = {
'host': 'localhost',
'port': 9700,
'protocol': 'UDP',
'index': 'log',
'datestamp_index': False,
... | Python | 0.000017 | @@ -146,16 +146,37 @@
ocket%0A%0A%0A
+__version__ = '0.1'%0A%0A
LOG = _l
@@ -3372,199 +3372,4 @@
ge)%0A
-%0A%0Aif __name__ == '__main__':%0A LOG.addHandler(_logging.StreamHandler())%0A LOG.setLevel(_logging.DEBUG)%0A%0A for i in range(3):%0A log(who='somebody', what='Did something %25sx times' %25 i)... |
5a7e191f7b2751ede70606c06393cbfbf9f18ec6 | Fix Python 3 incompatibility | skimage/color/colorlabel.py | skimage/color/colorlabel.py | import warnings
import itertools
import numpy as np
from skimage import img_as_float
from skimage._shared import six
from skimage._shared.six.moves import zip
from .colorconv import rgb2gray, gray2rgb
from . import rgb_colors
__all__ = ['color_dict', 'label2rgb', 'DEFAULT_COLORS']
DEFAULT_COLORS = ('red', 'blue',... | Python | 0.99992 | @@ -456,16 +456,30 @@
k, v in
+six.iteritems(
rgb_colo
@@ -489,27 +489,16 @@
__dict__
-.iteritems(
)%0A
|
fc1789315811c38e0acf2f34ce00c3eee222dd5e | Fix cleanup | hassio/dock/__init__.py | hassio/dock/__init__.py | """Init file for HassIO docker object."""
import asyncio
from contextlib import suppress
import logging
import docker
from ..tools import get_version_from_env
_LOGGER = logging.getLogger(__name__)
class DockerBase(object):
"""Docker hassio wrapper."""
def __init__(self, config, loop, dock, image=None):
... | Python | 0.000007 | @@ -5861,46 +5861,107 @@
-image = %22%7B%7D:latest%22.format(self.image)
+_LOGGER.info(%22Remove docker %25s with latest and %25s%22,%0A self.image, self.version)%0A
%0A
@@ -6143,16 +6143,21 @@
-%3E %25s%22,
+self.
image, e
|
c78b0e71bdf2095f4e4a7793615980b5cec1b73c | remove auth token from debug log. but it can be uncommented for testing. | src/biokbase/narrative/handlers/authhandlers.py | src/biokbase/narrative/handlers/authhandlers.py | from tornado.escape import url_escape
from notebook.base.handlers import IPythonHandler
from traitlets.config import Application
from notebook.auth.login import LoginHandler
from notebook.auth.logout import LogoutHandler
from biokbase.narrative.common.kblogging import (
get_logger, log_event
)
from biokbase.narrati... | Python | 0 | @@ -1896,24 +1896,83 @@
%0A
+ # re-enable if token logging info is needed.%0A #
if app_log.
@@ -2003,32 +2003,34 @@
UG):%0A
+ #
app_log.deb
@@ -2075,32 +2075,34 @@
al))%0A
+ #
app_log.deb
@@ -2158,32 +2158,34 @@
ok%7D%22%0A
+ #
@... |
cb24a839d39ca606c23869c04112975aca7d0dab | Update arch type for 64bits support | misc/sampleapp-android-tests/sampleapp/comm.py | misc/sampleapp-android-tests/sampleapp/comm.py | #!/usr/bin/env python
# coding=utf-8
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of c... | Python | 0 | @@ -2090,18 +2090,22 @@
r')%0A
-if
+ARCH =
fp.read
@@ -2124,70 +2124,8 @@
%5Ct%22)
- != %22x86%22:%0A ARCH = %22arm%22%0A else:%0A ARCH = %22x86%22
%0A
@@ -2191,18 +2191,22 @@
r')%0A
-if
+MODE =
mode.re
@@ -2227,81 +2227,8 @@
%5Ct%22)
- != %22shared%22:%0A MODE = %22embedded%... |
b0df73b995a1020aa43a8e9ad85e7bf197744578 | fix formating | updatebot/lib/xobjects.py | updatebot/lib/xobjects.py | #
# Copyright (c) 2009 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... | Python | 0.000039 | @@ -4652,16 +4652,17 @@
lavor)%0A%0A
+%0A
class XP
|
ca66caa2081a518bb3487775c67cf84e6ae27afa | Add auth_enabled=False to a cron trigger test | mistral/tests/unit/engine/test_cron_trigger.py | mistral/tests/unit/engine/test_cron_trigger.py | # Copyright 2015 Alcatel-Lucent, 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 a... | Python | 0.000017 | @@ -3495,16 +3495,83 @@
_mock):%0A
+ cfg.CONF.set_default('auth_enable', False, group='pecan')%0A%0A
|
1692c2df3c744c6cfd79d78777ab6d9d421d06cd | Fix get_lang_class parsing | spacy/util.py | spacy/util.py | import os
import io
import json
import re
import os.path
import six
import sputnik
from sputnik.dir_package import DirPackage
from sputnik.package_list import (PackageNotFoundException,
CompatiblePackageNotFoundException)
from . import about
from .attrs import TAG, HEAD, DEP, ENT_IOB... | Python | 0.000001 | @@ -474,21 +474,9 @@
it('
-%5B%5Ea-zA-Z0-9_%5D
+_
', n
|
31f2f3671b803e3b08dbfdd33bc58a59beabcb5c | Add simple logging config. | src/project/settings.py | src/project/settings.py | """
Django settings for project 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/
"""
import os
#... | Python | 0 | @@ -807,16 +807,95 @@
= True%0A%0A
+ADMINS = (%0A # ('Your Name', 'your_email@example.com'),%0A)%0AMANAGERS = ADMINS%0A%0A
# ALLOWE
@@ -3990,8 +3990,392 @@
t Name'%0A
+%0ALOGGING = %7B%0A 'version': 1,%0A 'disable_existing_loggers': False,%0A 'handlers': %7B%0A 'mail_admins': %7B%0A 'le... |
26c175cbe77eb2f27f01418e0d52381b12e8d33f | Add additional supported platforms to Subject (close #172) | snowplow_tracker/subject.py | snowplow_tracker/subject.py | """
subject.py
Copyright (c) 2013-2014 Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Apache License Version 2.0,
and you may not use this file except in compliance with the Apache License
Version 2.0. You may obtain a copy of the Apache License Version 2.0 ... | Python | 0 | @@ -984,16 +984,37 @@
%22, %22iot%22
+, %22web%22, %22srv%22, %22app%22
%5D)%0ADEFAU
@@ -1536,16 +1536,37 @@
%22, %22iot%22
+, %22web%22, %22srv%22, %22app%22
%5D%0A
|
a5d3c78295d951fd29f00fc8d8480c2a518fd615 | set srid explicit | utm_zone_info/viewsets.py | utm_zone_info/viewsets.py | from rest_framework import status, viewsets
from rest_framework.response import Response
from utm_zone_info.coordinate_reference_system import utm_zones_for_representing
from utm_zone_info.serializers import GeometrySerializer
class UTMZoneInfoViewSet(viewsets.ViewSet):
"""
A simple ViewSet for posting Point... | Python | 0.000002 | @@ -584,50 +584,8 @@
m'%5D%0A
- if geometry.srid is None:%0A
|
b62423f6ccb47a6f4074ec8e95d9861a3bb06874 | Change error message | ckanext/requestdata/logic/validators.py | ckanext/requestdata/logic/validators.py | from email_validator import validate_email
from ckan.plugins.toolkit import _
from ckan.plugins.toolkit import get_action
def email_validator(key, data, errors, context):
email = data[key]
try:
validate_email(email)
except Exception:
message = _('Please provide a valid email address.')
... | Python | 0.000001 | @@ -1854,36 +1854,31 @@
l %22%7B0%7D%22
-i
+doe
s not
-part of this
+exist.
'%0A
@@ -1891,39 +1891,24 @@
-'organization.'
.format(emai
|
6427e4fd0175fd39e70337e12cc662f5f38cb9b5 | Add more information on the context for the email | lowfat/mail.py | lowfat/mail.py | """
Send email for some views.
"""
from constance import config
from django.contrib.flatpages.models import FlatPage
from django.core.mail import send_mail, mail_admins
from django.core.urlresolvers import reverse
from django.template import Context, Template
from .models import *
from .settings import DEFAULT_FROM_EM... | Python | 0.000723 | @@ -737,24 +737,112 @@
=admin_url)%0A
+ template = Template(flatemail.content)%0A context = Context(admin_context)%0A
mail
@@ -895,41 +895,24 @@
-flatemail.content.format(**admin_
+template.render(
cont
@@ -948,17 +948,16 @@
ly=False
-,
%0A
@@ -1082,24 +1082,111 @@
l=user_url)%0... |
840bbdff4245d39317f8ad64f48999bdf288683f | version name/code and wifi timestamp | webserver/opentrain/analysis/logic.py | webserver/opentrain/analysis/logic.py | import models
import json
import reports.models
import common.ot_utils
from django.conf import settings
def analyze_raw_reports(clean=True):
if clean:
delete_all_reports()
COUNT = 20
offset = 0
while True:
cont = analyze_raw_reports_subset(offset,COUNT)
offset += COUNT
... | Python | 0.000003 | @@ -1013,24 +1013,132 @@
return None%0A
+ m.app_version_name = item.get('app_version_name')%0A m.app_version_code = item.get('app_version_code')%0A
m.save()
@@ -1138,16 +1138,16 @@
.save()%0A
-
item
@@ -1654,24 +1654,188 @@
em%5B'wifi'%5D:%0A
+ if wifi.get('timestamp'):%0A ts = comm... |
46f651c7336e4c517c9f4ee19753ec8461757ce8 | decompose algorithm | bin/Flaws_generators/Generator.py | bin/Flaws_generators/Generator.py | import shutil
from Classes.Manifest import Manifest
from .Input import InputSample
from .Filtering import FilteringSample
from .Sink import SinkSample
from .ExecQuery import ExecQuerySample
from Classes.FileManager import FileManager
from Classes.File import File
import xml.etree.ElementTree as ET
class Generator():
... | Python | 0.999875 | @@ -383,16 +383,51 @@
# TODO
+ readd this for manifest generation
%0A
@@ -1338,16 +1338,49 @@
s = None
+%0A self.current_code = None
%0A%0A de
@@ -2568,17 +2568,16 @@
ties()%0A%0A
-%0A
# fo
@@ -3150,124 +3150,352 @@
-def compose(self):%0A print(%22#########################%22)%... |
09e8dd8ed521105aedeb9d35234998d7fa82bb4d | Format max line length to 79. | sqlcop/cli.py | sqlcop/cli.py | from __future__ import print_function
import sys
import sqlparse
import optparse
from sqlcop.checks.cross_join import CrossJoinCheck
from sqlcop.checks.order_by_count import OrderByCountCheck
def parse_file(filename):
try:
return open(filename, 'r').readlines()
except UnicodeDecodeError:
# It'... | Python | 0.000351 | @@ -373,16 +373,26 @@
he ascii
+%0A #
encodin
@@ -429,26 +429,16 @@
se utf-8
-%0A #
on exce
|
26c45d7885d0bc0e31624942ad64b76a6c7ca0cf | add default class | mpcontribs-client/mpcontribs/client/__init__.py | mpcontribs-client/mpcontribs/client/__init__.py | # -*- coding: utf-8 -*-
import os
import fido
import warnings
import pandas as pd
from pyisemail import is_email
from pyisemail.diagnosis import BaseDiagnosis
from swagger_spec_validator.common import SwaggerValidationError
from bravado_core.formatter import SwaggerFormat
from bravado.client import SwaggerClient
from ... | Python | 0.000003 | @@ -2077,18 +2077,31 @@
, attrs=
-%22%22
+'class=%22table%22'
):%0A
|
51257ca1ebb61d48b8c8dd5b1562fdc73e4ecc99 | Load .solv file from testdata | bindings/python/tests/relation.py | bindings/python/tests/relation.py | #
# test Relation
#
# Relations are the primary means to specify dependencies.
# Relations combine names and version through an operator.
# Relations can be compared (<=> operator) or matched (=~ operator)
#
# The following operators are defined:
# REL_GT: greater than
# REL_EQ: equals
# REL_GE: greater equal
# ... | Python | 0 | @@ -882,16 +882,31 @@
_solv( %22
+../../testdata/
os11-bia
|
ec235941919c184641f9ab30f2df13ab7fea0414 | add sni support to LiveConnection.change_server | libmproxy/protocol/primitives.py | libmproxy/protocol/primitives.py | from __future__ import absolute_import
import copy
import uuid
import netlib.tcp
from .. import stateobject, utils, version
from ..proxy.connection import ClientConnection, ServerConnection
KILL = 0 # const for killed requests
class Error(stateobject.StateObject):
"""
An Error.
This is distinc... | Python | 0 | @@ -5207,16 +5207,26 @@
sl=None,
+ sni=None,
force=F
@@ -5549,16 +5549,29 @@
atch = (
+%0A
ssl is n
@@ -5581,16 +5581,46 @@
None and
+%0A (%0A
ssl !=
@@ -5653,16 +5653,114 @@
ablished
+%0A or%0A (sni is not None and sni != self.c.sni)%0A ... |
aa663a2483c119e3fe6fb6e2f0a160489b63b12b | create a course provisioning report method | restclients/canvas/reports.py | restclients/canvas/reports.py | from django.conf import settings
from restclients.canvas import Canvas
from restclients.dao import Canvas_DAO
from restclients.exceptions import DataFailureException
from restclients.models.canvas import Report, ReportType, Attachment
from urllib3 import PoolManager
import json
class Reports(Canvas):
def get_avai... | Python | 0.000007 | @@ -2599,32 +2599,342 @@
esponse.data))%0A%0A
+ def create_course_provisioning_report(self, term_id=None, params=%7B%7D)%0A %22%22%22%0A Convenience method for create_report, for creating a course-based%0A provisioning report.%0A %22%22%22%0A params%5B%22courses%22%5D = True%0A ... |
e64d922a7e7c64921c90d81c44014f7287ba83fa | disable logging in travis | .travis/localsettings.py | .travis/localsettings.py | import os
####### Configuration for CommCareHQ Running on Travis-CI #####
from docker.dockersettings import *
USE_PARTITIONED_DATABASE = os.environ.get('USE_PARTITIONED_DATABASE', 'no') == 'yes'
PARTITION_DATABASE_CONFIG = get_partitioned_database_config(USE_PARTITIONED_DATABASE)
BASE_ADDRESS = '{}:8000'.format(os.... | Python | 0 | @@ -1312,58 +1312,33 @@
g%0ALO
-GGING = %7B%0A 'version': 1,%0A 'handlers': %7B%0A
+CAL_LOGGING_HANDLERS = %7B%0A
@@ -1343,28 +1343,24 @@
'null': %7B%0A
-
'lev
@@ -1373,20 +1373,16 @@
DEBUG',%0A
-
@@ -1430,43 +1430,40 @@
- %7D,%0A %7D,%0A 'loggers': %7B%0A ... |
5c4870204f5ca14ee4d47541d14532dbe42528b2 | Version 2.2 - Not really bugs so much as my being an idiot | twitch_irc.py | twitch_irc.py | from twisted.internet import protocol, reactor
from collections import defaultdict
import sys, json
import socketio
import eventlet
from flask import Flask, render_template
from threading import Thread
import bot
import time
import logging
import logging.config
logging.config.fileConfig('logging.conf')
global sio
gl... | Python | 0 | @@ -1538,16 +1538,42 @@
tchBot%0A%0A
+ protocol.revlostart()%0A
tags
@@ -2199,39 +2199,8 @@
t()%0A
- bot.TwitchBot.revlostart()%0A
|
a150520c9fd49a3e6cb6b4396694371797de8440 | make plot tool skip invalid files | modules/tools/plot_trace/plot_planning_result.py | modules/tools/plot_trace/plot_planning_result.py | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo 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 ... | Python | 0.000001 | @@ -1271,16 +1271,29 @@
_file):%0A
+ try:%0A
fhan
@@ -1331,22 +1331,14 @@
-if not fhandle
+except
:%0A
@@ -1388,24 +1388,39 @@
nning_file)%0A
+ return%0A
planning
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.