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 |
|---|---|---|---|---|---|---|---|
aac66567519ce3c00414df091e828fd461abff3f | Cleaned up unneccessary text | McSIAB-Client.py | McSIAB-Client.py | #!/usr/bin/python
import os
import urllib
import zipfile
from sys import executable
import yaml
import platform
server_url = "http://bearpi.no-ip.org"
authserver = "http://www.berboe.co.uk"
def main():
print "Welcome to McSIAB, the Minecraft Server In A Box app."
get_system_info()
print "setup.py must be run befo... | Python | 0.999994 | @@ -1532,31 +1532,8 @@
e'%5D%0A
-%09%09%09print currentServer%0A
%09%09se
|
d8e0fb484693a9ae48568ff653509da734240b3f | Set working directory in python_version_compat_test.py | python_version_compat_test.py | python_version_compat_test.py | #!/usr/bin/env python
import subprocess
import unittest
class TestPy2Py3Compat(unittest.TestCase):
"""We need to be compatible with both python2 and 3.
Test that we can at least import runlint.py under both.
"""
def test_python2_compat(self):
subprocess.check_call(['python2', '-c', 'import ... | Python | 0.003642 | @@ -16,16 +16,26 @@
python%0A%0A
+import os%0A
import s
@@ -258,32 +258,393 @@
2_compat(self):%0A
+ # If we're running this test from an external directory (e.g., from%0A # webapp), take care to set the working directory for the subprocess%0A # call. Note that if we're running this test from wit... |
664258c825a68ac46c8305cb09350a7be0ae8d1c | Update __init__.py | pytorch_lightning/__init__.py | pytorch_lightning/__init__.py | """Root package info."""
__version__ = '0.9.0rc10'
__author__ = 'William Falcon et al.'
__author_email__ = 'waf2107@columbia.edu'
__license__ = 'Apache-2.0'
__copyright__ = 'Copyright (c) 2018-2020, %s.' % __author__
__homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning'
# this has to be simple string,... | Python | 0.000072 | @@ -42,17 +42,17 @@
0.9.0rc1
-0
+1
'%0A__auth
|
6118fb7d9b6efc55482798439d1b4860e92ab7cb | Add methods to query and update the latest iou | raiden/network/pathfinding.py | raiden/network/pathfinding.py | import requests
from raiden.constants import DEFAULT_HTTP_REQUEST_TIMEOUT
from raiden.exceptions import ServiceRequestFailed
from raiden.utils import typing
from raiden_contracts.utils.proofs import sign_one_to_n_iou
def get_pfs_info(url: str) -> typing.Optional[typing.Dict]:
try:
return requests.get(f'{... | Python | 0 | @@ -448,16 +448,524 @@
None%0A%0A%0A
+def get_pfs_iou(%0A url: str,%0A token_network_address: typing.Union%5Btyping.TokenNetworkAddress, typing.TokenNetworkID%5D,%0A **kwargs,%0A) -%3E typing.Optional%5Btyping.Dict%5D:%0A try:%0A return requests.get(%0A f'%7Burl%7D/api/v1/%7B... |
1e87d8714414209d6527458ca79a69292a4c68e8 | Update compare.py | Numpy/compare.py | Numpy/compare.py | import time
size_of_vec = 1000
def pure_python_version():
t1 = time.time()
X = range(size_of_vec)
Y = range(size_of_vec)
Z = []
for i in range(len(X)):
Z.append(X[i] + Y[i])
return time.time() - t1
def numpy_version():
t1 = time.time()
X = np.arange(size_of_vec)
Y = np.aran... | Python | 0.000001 | @@ -5,16 +5,36 @@
rt time%0A
+import numpy as np%0A%0A
size_of_
@@ -43,16 +43,17 @@
c = 1000
+0
%0A%0Adef pu
@@ -467,20 +467,8 @@
nt(%22
-Numpy is in
this
@@ -476,16 +476,25 @@
example
+Numpy is
%22 + str(
|
61966ebfdb45c5a4de67270cec7d04bdc26ce3b4 | add load command | rawdisk/modes/cli/cli_mode.py | rawdisk/modes/cli/cli_mode.py | import logging
import os
from rawdisk.session import Session
from rawdisk.modes.mode import Mode
from tabulate import tabulate
from cmd import Cmd
class CliMode(Mode):
@staticmethod
def entry(args=None):
cli = CliShell()
cli.initialize()
cli.cmdloop()
class CliShell(Cmd):
def __i... | Python | 0.000007 | @@ -1066,16 +1066,217 @@
table)%0A%0A
+ def do_load(self, filename):%0A %22%22%22Load disk image for analysis%22%22%22%0A try:%0A self.session.load(filename)%0A except IOError as e:%0A self.logger.error(e.strerror)%0A%0A
def
|
fa56c04858dd1744e196aca6f4bf82a53b8f681e | Fix post NoneType error. | util/post.py | util/post.py | from db import session
import model
def to_json(post, user_id, last_visit=None, last_visit_filled=False):
if user_id:
if not last_visit_filled:
last_visit = session.query(model.ThreadVisit).\
filter(model.ThreadVisit.user == user_id, model.ThreadVisit.thread == post.thread, model.ThreadVisit.last_last_visit.... | Python | 0 | @@ -353,20 +353,17 @@
True if
-not
+(
last_vis
@@ -368,12 +368,22 @@
isit
+ is None)
or
+(
last
@@ -412,16 +412,17 @@
is None
+)
else la
|
7bfd248746bfb3ce255298eb67ca3ea65292d872 | Index the slug, not the project repr (#2797) | readthedocs/donate/signals.py | readthedocs/donate/signals.py | import random
import logging
from django.dispatch import receiver
from django.conf import settings
from django.core.cache import cache
import redis
from readthedocs.restapi.signals import footer_response
from readthedocs.donate.models import SupporterPromo
from readthedocs.donate.constants import INCLUDE, EXCLUDE
fr... | Python | 0 | @@ -7098,24 +7098,29 @@
eme, project
+.slug
)%0A except
|
2ed07ca6bfe21551a65770639e36f0ca6a03cb99 | Add dry_run argument running method | subprocrunner/_subprocess_runner.py | subprocrunner/_subprocess_runner.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import platform
import subprocess
import logbook
from mbstrdecoder import MultiByteStrDecoder
import typepy
from ._error import InvalidCommandEr... | Python | 0.000002 | @@ -2258,32 +2258,46 @@
def run(self
+, dry_run=None
):%0A self.
@@ -2319,37 +2319,96 @@
d()%0A%0A if
-self.
+dry_run is None:%0A dry_run = self.dry_run%0A%0A if
dry_run:%0A
@@ -3683,24 +3683,38 @@
environ=None
+, dry_run=None
):%0A s
@@ -3748,21 +3748,80 @@
... |
e7d6e1b3a04307e2a88ebf84ca28ed40332e015d | version mismatch hotpatch | substance/driver/virtualbox/vbox.py | substance/driver/virtualbox/vbox.py | import re
from substance.shell import Shell
from substance.monads import *
from substance.logs import *
from exceptions import *
from substance.exceptions import *
VBOX_VERSION_MIN = (5,0,10)
VBOX_VERSION_CHECKED = None
def vboxManager(cmd, params=""):
'''
Invoke the VirtualBoxManager
'''
return assertVirtua... | Python | 0.000001 | @@ -183,17 +183,16 @@
= (5,0,
-1
0)%0AVBOX_
|
407fe142647cf5ddf4217667434b306d5e33a2cd | Fix uploading on windows (fix #107) | svir/thread_worker/upload_worker.py | svir/thread_worker/upload_worker.py | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Irmt
A QGIS plugin
OpenQuake Integrated Risk Modelling Toolkit
-------------------
begin : 2013-10-24
copyright ... | Python | 0 | @@ -4259,16 +4259,17 @@
stem, 'r
+b
'),%0A
|
c734d4eb5277b134f8099c2322c1ef21b3293872 | Convert message received to lowercase | sris/messenger.py | sris/messenger.py | class Messenger:
"""
Generates messages to send to a patient.
"""
def __init__(self, config):
"""
Populate attributes on initialisation.
Args:
config (json): Client specific configuration file that contains
the questions to send to the user.
"""
... | Python | 0.005278 | @@ -1513,16 +1513,125 @@
ology()%0A
+ # Words in the sentence appear in the ontology regardless of case.%0A message = message.lower()%0A
|
f79b3942327096f6ebf8c0986a6b5abc431adca1 | append the implementation of getLatestProxys(). | ProxyipGetter.py | ProxyipGetter.py | from bs4 import BeautifulSoup
import requests, re, pdb
PROXY_IP_SOURCE_URL = "http://ip84.com"
class proxy(object):
def __init__(self, ip_address: str, port: str, location: str, anonymous: str, https: str, speed: str):
if proxy.isValidIpFormat(ip_address) == False:
raise ValueError()
... | Python | 0 | @@ -982,24 +982,155 @@
rn False%0D%0A%0D%0A
+ '''def pingBing(self):%0D%0A r = requests.get(%22http://cn.bing.com/%22, proxies=str(self))%0D%0A return r.status_code'''%0D%0A%0D%0A
@classme
@@ -1963,16 +1963,34 @@
st = %5B%5D%0D
+%0A proxies = %7B%7D%0D
%0A%0D%0A L
@@ -2309,19 +2309,25 @@
... |
93be56b1e462a990f668369d4fa887d783a7bae4 | Remove unused imports | urls.py | urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
import autocomplete_light
from web.views import home, wip, about, project, support, members, contact, faq, report
autocomplete_light.autodiscover()
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', home... | Python | 0.000001 | @@ -82,34 +82,8 @@
min%0A
-import autocomplete_light%0A
from
@@ -170,42 +170,8 @@
ort%0A
-autocomplete_light.autodiscover()%0A
admi
|
3a840ceafddc480e58693dcfe552db0be7b6104c | fix url rewriting | urls.py | urls.py | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^gobelins_project/', include('gobelins_project.foo.urls')),
# Uncommen... | Python | 0.000822 | @@ -713,19 +713,35 @@
%0A (r'
-',
+%5Esurvey/', include(
'gobelin
@@ -773,50 +773,28 @@
vey.
-views.index'),%0D%0A (r'%5Esurvey/', include(
+urls')),%0D%0A (r'',
'gob
@@ -822,25 +822,31 @@
tion.survey.
-urls')
+views.index'
),%0D%0A)%0D%0A
|
2fd237c164a2f2133dbba6a93671a9de633ab7fe | Fix sample usage of learn.utils.gc: re.escape() the base_dir before matching. | tensorflow/contrib/learn/python/learn/utils/gc.py | tensorflow/contrib/learn/python/learn/utils/gc.py | # Copyright 2016 The TensorFlow 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 applica... | Python | 0.000021 | @@ -1300,25 +1300,25 @@
%22/tmp%22%0A #
-c
+C
reate the di
@@ -1326,16 +1326,17 @@
ectories
+.
%0A for e
@@ -1401,17 +1401,17 @@
5)%0A%0A #
-c
+C
reate a
@@ -1472,16 +1472,71 @@
irectory
+.%0A path_regex = %22%5E%22 + re.escape(base_dir) + %22/(%5C%5Cd+)$%22
%0A def p
@@ -1573,35 +1573,18 @@
tch(
-%22... |
3eb969baa756d930b2f3bba4914714751e189c86 | rename single-document search url to be more resource-oriented | findingaids/fa/urls.py | findingaids/fa/urls.py | from django.conf.urls.defaults import *
TITLE_LETTERS = '[a-zA-Z]'
title_urlpatterns = patterns('findingaids.fa.views',
url('^$', 'browse_titles', name='browse-titles'),
url(r'^(?P<letter>%s)$' % TITLE_LETTERS, 'titles_by_letter', name='titles-by-letter')
)
# patterns for ead document id and series id
# defi... | Python | 0.000136 | @@ -1066,22 +1066,21 @@
url(r'%5E
-search
+items
/$', 'do
|
11168caca7b28bf8d7f00d3aa3506d1ad3880bd7 | add message | cluster_setup/coreos_do_setup.py | cluster_setup/coreos_do_setup.py | """ShutIt module. See http://shutit.tk
"""
from shutit_module import ShutItModule
import string
class digital_ocean(ShutItModule):
def is_installed(self, shutit):
return False
def build(self, shutit):
# https://www.digitalocean.com/community/tutorials/how-to-set-up-a-coreos-cluster-on-digitalocean
# NEED: an... | Python | 0.000001 | @@ -2371,16 +2371,145 @@
ss%22''')%0A
+%09%09%09ip = shutit.get_output()%0A%09%09%09shutit.cfg%5B'build'%5D%5B'report_user_messages'%5D += '%5Cndroplet_id: ' droplet_id + ': ip address: '+ ip%0A
%09%09return
@@ -2854,17 +2854,17 @@
hines','
-3
+1
')%0A%09%09ret
|
eff06862c52af4ae03cf51373469e7eaa6c7a168 | Verify params is not None | cobaltuoft/endpoints/__init__.py | cobaltuoft/endpoints/__init__.py | from collections import OrderedDict
class Endpoints:
host = 'http://cobalt.qas.im/api/1.0'
@staticmethod
def run(api, get, endpoint=None, params=None, map=None):
endpoint = Endpoints._parse_endpoint(endpoint)
url, params = Endpoints._parse_url(api, endpoint, params), \
Endpoi... | Python | 0.999999 | @@ -1221,24 +1221,35 @@
%0A if
+params and
endpoint ==
|
5714bb2115664aa9ce60163ce0f37b6941283dc4 | add an email_verified field | wiki.py | wiki.py | #!/usr/bin/env python3
import hmac
import os.path as path
from base64 import b64encode
from hashlib import sha256
from os import urandom
import pygit2 as git
import scrypt
import sqlalchemy as sql
from bottle import get, post, request, run, static_file
from docutils.core import publish_file
engine = sql.create_engin... | Python | 0.000002 | @@ -554,24 +554,149 @@
e = False),%0A
+ sql.Column(%22email_verified%22, sql.Boolean, nullable = False,%0A default = False),%0A
|
3cf617c6fe2387e5b3b9ab5141614f40e8ec65d7 | use the username for the commits | wiki.py | wiki.py | #!/usr/bin/env python3
import hmac
import os.path as path
from base64 import b64encode
from hashlib import sha256
from os import urandom
import pygit2 as git
import scrypt
import sqlalchemy as sql
from bottle import request, route, run, static_file
from docutils.core import publish_file
engine = sql.create_engine("s... | Python | 0.000005 | @@ -669,121 +669,124 @@
e)%0A%0A
-author = git.Signature('wiki', 'danielmicay@gmail.com')%0A%0Aif 'refs/heads/master' not in repo.listall_references():
+if 'refs/heads/master' not in repo.listall_references():%0A author = git.Signature('wiki', 'danielmicay@gmail.com')
%0A
@@ -2127,18 +2127,26 @@
e):%0A
-if... |
1271ea5365d9693722066f05f2fea226a3de6ed5 | Use isinstance so that all subclasses of list and str are supported | flask_elasticsearch.py | flask_elasticsearch.py | from elasticsearch import Elasticsearch
# Find the stack on which we want to store the database connection.
# Starting with Flask 0.9, the _app_ctx_stack is the correct one,
# before that we need to use the _request_ctx_stack.
try:
from flask import _app_ctx_stack as stack
except ImportError:
from flask impor... | Python | 0 | @@ -1169,19 +1169,25 @@
if
-typ
+isinstanc
e(ctx.ap
@@ -1224,16 +1224,14 @@
ST')
-) is
+,
str
+)
:%0A
@@ -1324,11 +1324,17 @@
lif
-typ
+isinstanc
e(ct
@@ -1375,17 +1375,15 @@
ST')
-) is
+,
list
+)
:%0A
|
d67bd1637d353a6d96d856037142876869bb6f61 | comment updated in val_run1c.py | val_run1c.py | val_run1c.py | '''
This script implements a full-data run of the ftrl-proximal model using
data pulled by avito2_io.join_with_ads(), with validation (no test).
This only runs one epoch (~200M rows).
author: David Thaler
date: July 2015
'''
import avito2_io
from hash_features import hash_features
from ftrl_proximal import ftrl_proxi... | Python | 0 | @@ -13,175 +13,300 @@
ipt
-implements a full-data run of the ftrl-proximal model using %0Adata pulled by avito2_io.join_with_ads(), with validation (no test).%0AThis only runs one epoch (~200M rows)
+tests out downsampling of the negative rows and compensating%0Ain the predictions by adjusting the offset. It does thi... |
a6abc19c5d154fd4f06cc7e1af7e67a2b1048fa4 | Change default value for attr_list | flask_table/columns.py | flask_table/columns.py | from __future__ import unicode_literals
from flask import Markup, url_for
from babel.dates import format_date, format_datetime
def _single_get(item, key):
# First, try to lookup the key as if the item were a dict. If
# that fails, lookup the key as an atrribute of an item.
try:
val = item[key]
... | Python | 0 | @@ -1748,18 +1748,20 @@
tr_list=
-%5B%5D
+None
,%0A
|
7686ce67ae643ca4e556c2238c91580555917d3f | add doctests | fmriprep/utils/misc.py | fmriprep/utils/misc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Miscelaneous utilities
"""
def fix_multi_T1w_source_name(in_files):
"""
Make up a generic source name when there are multiple T1s
"""
impo... | Python | 0 | @@ -297,16 +297,195 @@
ple T1s%0A
+%0A %3E%3E%3E fix_multi_T1w_source_name(%5B%0A ... '/path/to/sub-045_ses-test_T1w.nii.gz',%0A ... '/path/to/sub-045_ses-retest_T1w.nii.gz'%5D)%0A '/path/to/sub-045_T1w.nii.gz'%0A%0A
%22%22%22%0A
@@ -860,16 +860,193 @@
prefix%0A
+%0A %3E%3E%3E add_suffix(... |
a2863cdb3770a91620868810292d5706b77a178f | Update models.py | fngs/explore/models.py | fngs/explore/models.py | from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.core.urlresolvers import reverse_lazy
from django.conf import settings
import os.path as op
import os
import uuid
def get_creds_file_path(instance, filename):
return os.path.join("/".join(["cr... | Python | 0 | @@ -575,16 +575,43 @@
_CHOICES
+, default=None, blank=False
)%0A%09jobdi
@@ -649,27 +649,28 @@
=100, blank=
-Tru
+Fals
e)%0A%09creds_fi
@@ -739,19 +739,20 @@
, blank=
-Tru
+Fals
e)%0A%0A%09def
|
9a7ec9ae3e0084f24ac39e6923d3f219ab7605af | Handle unconnected buildings | foe/models/building.py | foe/models/building.py |
"""
"""
# Native
import time
import pprint
# 3rd-Party
from sqlalchemy import Column, Integer, String, Float, Boolean, ForeignKey
from sqlalchemy.orm import relationship, backref
#
from request import Request
from models.model import Model
#from models.building_state import BuildingState
class Building(Model):
... | Python | 0.000316 | @@ -2361,32 +2361,124 @@
ection_time = 0%0A
+ elif self.state == 'UnconnectedState':%0A self.collection_time = 0%0A
else
@@ -2471,32 +2471,32 @@
else:%0A
-
@@ -2832,16 +2832,36 @@
onState'
+, 'UnconnectedState'
%5D:%0A
@@ -3213,32 +3213,32 @@
... |
4ca4c8805fa823b7eb686cd5134fcf836e672350 | Fix typo | defcon/defcon.py | defcon/defcon.py | import datetime
import re
import pywikibot
TEMPLATE_NAME = "Template:Vandalism information"
COMMENT = "[[Wikipedia:Bots/Requests for approval/APersonBot 5|Bot]] updating vandalism level to %d RPM"
TEMPLATE_PATH = "/data/project/apersonbot/bot/defcon/template.txt"
site = pywikibot.Site("en", "wikipedia")
site.login()
... | Python | 0.9997 | @@ -829,22 +829,19 @@
current_
-defcon
+rpm
_match.g
|
04772c97308c8c0bed513913e12db8d562e8fa7c | Add populous to the demo apps | demo/settings.py | demo/settings.py | """
Django settings for demo project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths ins... | Python | 0.00001 | @@ -1063,16 +1063,59 @@
'demo
+.demo',%0A 'populous.django.PopulousConfig
'%0A)%0A%0AMID
|
8c8705db387f3f74874a9e18ed00a3256c54f2eb | Update mkwrapper_mm.py | configs/sim/axis/mkwrapper_mm.py | configs/sim/axis/mkwrapper_mm.py | #!/usr/bin/python
import sys
import os
import subprocess
import importlib
from machinekit import launcher
from time import *
launcher.register_exit_handler()
launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))
try:
launcher.check_installation() # ... | Python | 0.000001 | @@ -567,557 +567,102 @@
-# launcher.install_comp('gantry.comp') # install a comp HAL component of not already installed%0A # launcher.start_process(%22configserver ../Machineface ../Cetus/%22) # start the configserver%0A # launcher.start_process(%22configserver /home/ysli/proj/r... |
70163f88d2d9e5ca8bcd0c3340609edd61463dfc | add "fixed OpenWebCommand | yohe.py | yohe.py | import sublime
import sublime_plugin
import re
import webbrowser
import os
import subprocess
class YoheCommand():
def get_path(self, paths):
if paths:
return paths[0].replace('\\', '/')
# DEV: On ST3, there is always an active view.
# Be sure to check that it's a file with a ... | Python | 0.000045 | @@ -2540,24 +2540,31 @@
%0A
+ path =
os.path.dir
|
89142344de117e5dd9dcd6f2d51c91fedfe67c33 | Add stdin, stdout, stderr to ignored export list | contrib/devtools/symbol-check.py | contrib/devtools/symbol-check.py | #!/usr/bin/env python3
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that the (Linux) executables produced by gitian only contain
allowed gcc, glibc and libstdc+... | Python | 0.000001 | @@ -2044,16 +2044,45 @@
in_used'
+, 'stdin', 'stdout', 'stderr'
%0A%7D%0AREADE
|
71a1c09010a22a6b8b15390dd6e5cc43c18e6721 | Update zoom.py | zoom.py | zoom.py | ################
# RUNTIME
################
def init(w,h):
'''Initializes zoom, resizing the backbuffer to the given width and height.
'''
def run():
'''Returns the number of seconds since the last frame or false if game has ended.
'''
################
# Resources
################
def loadresources(filenam... | Python | 0 | @@ -168,77 +168,162 @@
ns t
-he number of seconds since the last frame or false if game has ended.
+rue if game is running, false if game has ended.%0A '''%0A%0A%0Adef time():%0A '''Returns the number of seconds between the beginning of the last frame and this.
%0A '
|
a77b60ce23ab0c4676235f37ffc8110894a7a5e4 | Correct header implementation | cogs/twitter.py | cogs/twitter.py | from io import BytesIO
import re
import aiohttp
from lxml import etree
import yaml
from discord.ext import commands
from discord import File
from utils.contextmanagers import get as _get
class Twitter:
"""Contains the capability to link images from tweets and other social media"""
twit_url_expr = re.compile... | Python | 0.000002 | @@ -1792,70 +1792,8 @@
s):%0A
- kwargs.setdefault('headers', %7B%7D).update(self.headers)%0A
|
ef8594bbe551c50b2b290c27cfda49128048dd11 | Fix sorting of empty rooms | functions/eitu/main.py | functions/eitu/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, re, sys, logging
import pytz, requests
from datetime import datetime, timedelta
from jinja2 import Environment, FileSystemLoader
import ics_parser
URL_STUDY_ACTIVITIES = 'https://dk.timeedit.net/web/itu/db1/public/ri6Q7Z6QQw0Z5gQ9f50on7Xx5YY00ZQ1ZYQycZw.ics'
UR... | Python | 0.000003 | @@ -3169,21 +3169,26 @@
%5D =
-timedelta.min
+NOW - event%5B'end'%5D
%0A
|
e4ba4bac9efd78de6a4a87ae8a42160cd378105b | Simplify and generalize core search | fusesoc/coremanager.py | fusesoc/coremanager.py | import collections
import logging
import os
from fusesoc.config import Config
from fusesoc.core import Core
logger = logging.getLogger(__name__)
class DependencyError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class CoreManager(object... | Python | 0.000518 | @@ -1151,393 +1151,208 @@
for
-d in os.listdir(path):%0A f = os.path.join(path, d, d+'.core')%0A if os.path.isfile(f) == False:%0A core_dir = os.path.join(path, d)%0A if not os.path.isdir(core_dir):%0A continue%0A for core_subdir in... |
f86a47b6431e374ae1797061511b49fe6bf22daf | make # after alpha/beta optional (#540) | gapic/schema/naming.py | gapic/schema/naming.py | # Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -3843,17 +3843,17 @@
ta)%5B0-9%5D
-+
+*
)?)'%0A
|
451ef4645abc807bece4481489a97b45d2c88313 | Check that materials have the correct lenght | simphony/material_relations/material_relation.py | simphony/material_relations/material_relation.py | from simphony.material_relations.abc_material_relation import (
ABCMaterialRelation)
import simphony.core.data_container as dc
class MaterialRelation(ABCMaterialRelation):
""" MaterialRelation provides a general interface for describing the
(physics/chemistry) relations between different materials
At... | Python | 0.000001 | @@ -2625,32 +2625,331 @@
s(self, value):%0A
+ if(len(materials) not in self._num_materials):%0A error_str = %22Incorrect number of materials, expected: %7B%7D%22%0A raise ValueError(%0A error_str.format(%0A materials.size(),%0A self._num... |
e37eba5f9430cfa3c3cf081066e7079e5c564e95 | Improve templatetag to use either prefix or ... | generic_scaffold/templatetags/generic_scaffold_tags.py | generic_scaffold/templatetags/generic_scaffold_tags.py | from django import template
from django.conf import settings
from generic_scaffold import get_url_names
register = template.Library()
@register.simple_tag
def get_url_for_action(prefix, action):
url = get_url_names(prefix)[action]
return url
@register.assignment_tag
def set_url_for_action(prefix, action):
... | Python | 0 | @@ -144,14 +144,18 @@
ter.
-simple
+assignment
_tag
@@ -163,162 +163,63 @@
def
-g
+s
et_url
+s
_for_
-action(prefix, action):%0A url = get_url_names(prefix)%5Baction%5D%0A return url%0A%0A@register.assignment_tag%0Adef set_url_for_action(prefix, acti
+scaffold(app=None, model=None, prefix=N
on
+e
):%0A
@... |
7a170e2a1c31834608aa9401f9605d274396d92c | Fix Python 3.4.x bytes string formatting | devp2p/utils.py | devp2p/utils.py | import struct
import rlp
from rlp.utils import encode_hex, decode_hex, str_to_bytes
import collections
ienc = int_to_big_endian = rlp.sedes.big_endian_int.serialize
def big_endian_to_int(s):
return rlp.sedes.big_endian_int.deserialize(s.lstrip(b'\x00'))
idec = big_endian_to_int
def int_to_big_endian4(integer)... | Python | 0.999998 | @@ -850,31 +850,33 @@
-return b'%25s%25s@%25s:%25d' %25
+uri = '%7B%7D%7B%7D@%7B%7D:%7B%7D'.format
(nod
@@ -936,16 +936,42 @@
+
+ host, port)%0A return
str_to_b
@@ -979,19 +979,11 @@
tes(
-host), port
+uri
)%0A%0A%0A
|
13cc50de197333482569475a57ff74eb3e1fa686 | fix wifimitmcli module doc | wifimitmcli.py | wifimitmcli.py | #!/usr/bin/env python3
"""
sandbox file for testing available functionality
Automatization of MitM Attack on WiFi Networks
Bachelor's Thesis UIFS FIT VUT
Martin Vondracek
2016
"""
__version__ = '0.1'
import argparse
import logging
import sys
import tempfile
import time
import warnings
from typing import Optional, Se... | Python | 0.000001 | @@ -24,56 +24,59 @@
%22%22%22%0A
-sandbox file for testing available functionality
+WiFi Machine-in-the-Middle - command line interface
%0A%0AAu
|
44394ef787ed1cb469a17d3a62dd947ca94a2f5f | Fix order_by call in ExportManager | diary/models.py | diary/models.py | import random, sys, codecs
from datetime import date, timedelta
from django.db import models
from django.utils import timezone
from django.template import loader, Context, Template
from django.core.mail import send_mail
from django.conf import settings
from django.contrib import sites
from django.core.management.base i... | Python | 0 | @@ -5745,23 +5745,11 @@
user
-_id').order_by(
+',
'wee
|
de8d1ec6cd031f31ca932e740dfed410cee8f7c8 | Fix execute for python 2.6 | lib/ansiblereview/utils/__init__.py | lib/ansiblereview/utils/__init__.py | from __future__ import print_function
try:
from ansible.utils.color import stringc
except ImportError:
from ansible.color import stringc
import ansiblereview
from ansiblereview.version import __version__
import ansiblelint.version
import ConfigParser
from distutils.version import LooseVersion
import importlib
... | Python | 0.000052 | @@ -5591,34 +5591,12 @@
-try:%0A result.output
+proc
= s
@@ -5609,20 +5609,13 @@
ess.
-check_output
+Popen
(cmd
@@ -5619,19 +5619,19 @@
cmd, std
-err
+out
=subproc
@@ -5638,15 +5638,13 @@
ess.
-STDOUT)
+PIPE,
%0A
@@ -5652,132 +5652,127 @@
-result.rc = 0%0A except subprocess.CalledProces... |
5410c5cc15d94001715ee48745c76caf35db55dc | Upgrade to TBB/2019_U1@conan/stable | conanfile.py | conanfile.py | from conans import ConanFile, CMake
class CausalDynamicalTriangulations(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = "boost/1.68.0@conan/stable", "catch2/2.4.1@bincrafters/stable", "TBB/2018_U6@conan/stable",\
"eigen/3.3.5@conan/stable", "docopt/0.6.2@conan/stable",\
... | Python | 0 | @@ -223,12 +223,12 @@
/201
-8_U6
+9_U1
@con
|
c2d3723449364d02464dbab5415a7abac19f6a5b | Use system build tools | conanfile.py | conanfile.py | import os
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout
from conan.tools import files
from conans import tools
from conan.errors import ConanInvalidConfiguration
from conans.errors import ConanException
required_conan_version = ">=1.47.0"
class CuraEngineCo... | Python | 0 | @@ -2004,102 +2004,8 @@
f):%0A
- self.tool_requires(%22ninja/%5B%3E=1.10.0%5D%22)%0A self.tool_requires(%22cmake/%5B%3E=3.23.0%5D%22)%0A
|
0fcb955f02f2e59367612c56641a3588c20e628f | Update Catch 2.13.9 | conanfile.py | conanfile.py | import re
import os
from conans import ConanFile, CMake, tools
class ScopeguardConan(ConanFile):
name = "scope-guard"
license = "MIT"
author = "offa <offa@github>"
url = "https://github.com.offa/scope-guard"
description = "Implementation of Scoped Guards and Unique Resource as proposed in P0052."
... | Python | 0 | @@ -902,9 +902,9 @@
.13.
-8
+9
%22,%0A
|
d7a7cf9271767d072764d66d5907109a956f6f05 | Build one of shared libraries or static libraries | conanfile.py | conanfile.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from conans import ConanFile, tools, AutoToolsBuildEnvironment, CMake
from conans.model.version import Version
from conans.errors import ConanInvalidConfiguration
class LibpqxxRecipe(ConanFile):
name = "libpqxx"
version = "6.3.1"
settings = "os", "c... | Python | 0 | @@ -3370,24 +3370,198 @@
CMake(self)%0A
+ cmake.definitions%5B%22SKIP_PQXX_STATIC%22%5D = %22ON%22 if self.options.shared else %22OFF%22%0A cmake.definitions%5B%22SKIP_PQXX_SHARED%22%5D = %22OFF%22 if self.options.shared else %22ON%22%0A
cmak
|
d5317cc5d199904ca2684161a8a1026ce0e55943 | Support fPIC option | conanfile.py | conanfile.py | from conans import ConanFile, CMake, tools
import os
class IlmBaseConan(ConanFile):
name = "IlmBase"
version = "2.2.0"
license = "BSD"
url = "https://github.com/Mikayex/conan-ilmbase.git"
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "namespace_versionin... | Python | 0 | @@ -319,24 +319,47 @@
ing%22: %5BTrue,
+ False%5D, %22fPIC%22: %5BTrue,
False%5D%7D%0A
@@ -419,16 +419,30 @@
ng=True%22
+, %22fPIC=False%22
%0A gen
@@ -523,16 +523,258 @@
cmake%22%0A%0A
+ def config_options(self):%0A if self.settings.os == %22Windows%22:%0A self.options.remove(%22fPIC%2... |
cf766372264996cba55cd79986d5e411480b771f | add a note about argument promotion in variadic calls | topaz/modules/ffi/variadic_invoker.py | topaz/modules/ffi/variadic_invoker.py | from topaz.module import ClassDef
from topaz.objects.objectobject import W_Object
from topaz.modules.ffi.type import type_object, ffi_types, W_TypeObject, VOID
from topaz.modules.ffi.dynamic_library import coerce_dl_symbol
from topaz.modules.ffi.function import W_FunctionObject
from rpython.rlib import clibffi
from rp... | Python | 0 | @@ -1564,32 +1564,227 @@
in arg_types_w%5D%0A
+ # XXX we are missing argument promotion for the variadic arguments here%0A # see%0A # http://stackoverflow.com/questions/1255775/default-argument-promotions-in-c-function-calls%0A
w_ret_ty
|
dc308c524eef7dbd8ea65712a690eaa6660d9b86 | Load config on read | configman.py | configman.py | import os
import json
class ConfigMan:
def __init__(self, conftype):
self.configpath = os.path.join(os.path.dirname(__file__), "configs" + os.sep + conftype + ".json")
# if global.json, ensure the required values are present
if conftype == "global":
self.load()
try:... | Python | 0.000001 | @@ -893,24 +893,44 @@
Temp=True):%0A
+ self.load()%0A
if a
|
47cdb89f97e382fec6e06e629fa14e6b2dcfa2f4 | Add multi-line support for plugins | core/main.py | core/main.py | import re
import thread
import traceback
thread.stack_size(1024 * 512) # reduce vm size
class Input(dict):
def __init__(self, conn, raw, prefix, command, params,
nick, user, host, paraml, msg):
chan = paraml[0].lower()
if chan == conn.nick.lower(): # is a PM
chan... | Python | 0 | @@ -2245,32 +2245,159 @@
ut is not None:%0A
+ if hasattr(out, %22__iter__%22):%0A for line in out:%0A input.reply(unicode(line))%0A else:%0A
input.re
|
937019cea7e3e9e303a33a37a30db9a52a5d0093 | simplify logging in parse_config | crewchief.py | crewchief.py | # Copyright 2013 Carl George
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0.000007 | @@ -1905,33 +1905,38 @@
-cfgmsg =
+syslog.syslog(
'%7BOPTION%7D: i
@@ -2004,24 +2004,25 @@
OPTION=each)
+)
%0A
@@ -2118,146 +2118,8 @@
lue%0A
- cfgmsg = '%7BOPTION%7D: set to %7BVALUE%7D'.format(%0A OPTION=each,%0A VALUE=valu... |
ef3ba990143e643a56e3c900f9537aa0a13c490e | use UserWarning (the default) | cs/_async.py | cs/_async.py | import asyncio
import ssl
import warnings
import aiohttp
from . import CloudStack, CloudStackException
from .client import transform
class AIOCloudStack(CloudStack):
def __getattr__(self, command):
def handler(**kwargs):
return self._request(command, **kwargs)
return handler
asy... | Python | 0 | @@ -683,54 +683,8 @@
rue%22
-,%0A DeprecationWarning
)%0A
|
86efa3dfdc4d140463e7881f2cceb39652b7f84b | fix : minor edit in signature function | csv2LaTeX.py | csv2LaTeX.py | import os
from params import *
import sys
def line(number,char="-"):
response=""
for i in range(number):
response=response+char
return response
def signature(frame=41)
sign = ""
for i in range(frame)
sign = sign + "%"
sign = sign + "\n"
Sign = sign + "%\ csv2LaTex project\n ... | Python | 0 | @@ -181,16 +181,17 @@
rame=41)
+:
%0A sig
@@ -195,65 +195,29 @@
sign
- = %22%22%0A for i in range(frame)%0A sign = sign +
+=line(frame,char=
%22%25%22
+)
%0A
@@ -244,9 +244,9 @@
-S
+s
ign
@@ -255,19 +255,16 @@
sign + %22
-%25%5C
csv2LaTe
@@ -278,11 +278,8 @@
ct%5Cn
- %25%5C
for
@@ -3... |
b280a3d4b5b2d4aaf5c18f5c57bf9d111487ac18 | change same var bug | ctf/views.py | ctf/views.py | from django.shortcuts import render
from django.views import generic
from django.http import HttpResponseForbidden
from .forms import FlagForm
from .models import Ctf, Flag
# Create your views here.
import datetime
import logging
logger = logging.getLogger('date')
class IndexView(generic.ListView):
template_nam... | Python | 0.000018 | @@ -1267,16 +1267,20 @@
for
+ctf_
flag in
@@ -1297,24 +1297,28 @@
%0A if
+ctf_
flag.solver
@@ -1337,16 +1337,20 @@
user ==
+ctf_
flag.sol
|
71850c1eb56d25cd71197af77b275955baa436ae | fix small guessdriver bug | db/config.py | db/config.py | ###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | Python | 0.000002 | @@ -3851,16 +3851,14 @@
-driver =
+return
%22Ea
|
82f95d7f14d4af5d3827af980028c16ffa7a608d | Update job lifecycle add scheduled | polyaxon/constants/jobs.py | polyaxon/constants/jobs.py | from constants.statuses import BaseStatuses
from constants.unknown import UNKNOWN
class JobLifeCycle(BaseStatuses):
"""Experiment lifecycle
Props:
* CREATED: created.
* BUILDING: This includes time before being bound to a node,
as well as time spent pulling images onto the... | Python | 0.000001 | @@ -1033,24 +1033,52 @@
'Building'%0A
+ SCHEDULED = 'Scheduler'%0A
RUNNING
@@ -1256,24 +1256,56 @@
BUILDING),%0A
+ (SCHEDULED, SCHEDULED),%0A
(RUN
@@ -1474,32 +1474,43 @@
EATED, BUILDING,
+ SCHEDULED,
RUNNING, SUCCEE
@@ -1615,24 +1615,35 @@
= %7BBUILDING,
+ SCHEDULED,
RUNNING%7D%0A
... |
98a36c63b297c2a419c9c3b919b19e01a8ec6ce9 | Fix attribute name | perfrunner/tests/__init__.py | perfrunner/tests/__init__.py | import time
from typing import Callable
from logger import logger
from perfrunner.helpers.cbmonitor import CbAgent
from perfrunner.helpers.memcached import MemcachedHelper
from perfrunner.helpers.metrics import MetricHelper
from perfrunner.helpers.misc import pretty_dict
from perfrunner.helpers.monitor import Monitor... | Python | 0 | @@ -6612,17 +6612,16 @@
ngs.time
-r
, False)
|
9ea68b38ddc417b62ad2a5d83b80b3c1d3185f7d | bump version | aldryn_faq/__init__.py | aldryn_faq/__init__.py | __version__ = '0.1.11'
request_faq_category_identifier = 'aldryn_faq_current_category'
request_faq_question_identifier = 'aldryn_faq_current_question' | Python | 0 | @@ -14,12 +14,11 @@
'0.
-1.11
+2.0
'%0Are
|
65417d86b3e286296ca7e2cf546c723c9e98cb60 | Annotate initialization of PerfTest | perfrunner/tests/__init__.py | perfrunner/tests/__init__.py | import time
from typing import Callable
from logger import logger
from perfrunner.helpers.cbmonitor import CbAgent
from perfrunner.helpers.memcached import MemcachedHelper
from perfrunner.helpers.metrics import MetricHelper
from perfrunner.helpers.misc import pretty_dict
from perfrunner.helpers.monitor import Monitor... | Python | 0 | @@ -615,37 +615,83 @@
ort
-TargetIterator, PhaseSettings
+(%0A ClusterSpec,%0A PhaseSettings,%0A TargetIterator,%0A TestConfig,%0A)
%0A%0A%0Ac
@@ -815,43 +815,119 @@
elf,
- cluster_spec, test_config,
+%0A cluster_spec: ClusterSpec,%0A test_config: TestConfig,%0A ... |
4bbaa9b479aa5c71b0379e82016cf956a2d331d8 | Use the queryset to check if there's spelling suggestions | aldryn_search/views.py | aldryn_search/views.py | # -*- coding: utf-8 -*-
from django.utils.translation import get_language_from_request
from django.views.generic import ListView
from django.views.generic.edit import FormMixin
from haystack.forms import ModelSearchForm
from haystack.query import SearchQuerySet
from aldryn_common.paginator import DiggPaginator
from ... | Python | 0.000005 | @@ -2606,101 +2606,27 @@
-results = context%5B'object_list'%5D%0A if results and hasattr(results, 'query') and results
+if self.object_list
.que
|
831948d42cd8f0ef1e9d0002b72fc96ec4d30bb0 | Restructure test to not run afoul of swig destructor issues | perses/tests/test_storage.py | perses/tests/test_storage.py | """
Test storage layer.
"""
__author__ = 'John D. Chodera'
################################################################################
# IMPORTS
################################################################################
from simtk import openmm, unit
from simtk.openmm import app
import os, os.path
import... | Python | 0 | @@ -4514,24 +4514,25 @@
e=filename)%0A
+%0A
# Te
@@ -4726,28 +4726,16 @@
-f = partial(
mcmc_sam
@@ -4734,34 +4734,33 @@
mcmc_sampler.run
-,
+(
niterations)%0A
@@ -4760,125 +4760,8 @@
ns)%0A
- f.description = %22Testing MCMC sampler with %25s '%25s'%22 %25 (testsystem_name, environ... |
c2e18d42358754a11ccb56a58473c78b85c7aaa5 | set up django log rotation | swat4tracker/settings/production.py | swat4tracker/settings/production.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from .common import *
ALLOWED_HOSTS = ['swat4tracker.com', 'swat4stats.com']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': '127.0.0.1',
'PORT': '5432',
'NAME':... | Python | 0.000001 | @@ -522,32 +522,49 @@
lass': 'logging.
+handlers.Rotating
FileHandler',%0A
@@ -646,24 +646,83 @@
: 'simple',%0A
+ 'maxBytes': 1024*1024*5,%0A 'backupCount': 5,%0A
%7D,%0A '
@@ -783,16 +783,33 @@
logging.
+handlers.Rotating
FileHand
@@ -868,24 +868,85 @@
ream.log'),%0A
+ 'maxBytes': ... |
7b2e30e610bd8ad951c0dbd0ce3c55753a5ed36f | Remove obsolete code. | phoxpy/messages/directory.py | phoxpy/messages/directory.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from phoxpy import xml
from phoxpy.messages import PhoxRequest
from phoxpy.mapping import Mapping, Obje... | Python | 0.000119 | @@ -214,31 +214,8 @@
%0A#%0A%0A
-from phoxpy import xml%0A
from
@@ -250,16 +250,16 @@
Request%0A
+
from pho
@@ -550,611 +550,8 @@
'%5D%0A%0A
-class DirectoryRequestNewMixIn(PhoxRequest):%0A %22%22%22MixIn to generate XML output in required format.%22%22%22%0A def unwrap(self):%0A root = xml.Element('p... |
d06ca864475b6f0c840b4a3f8b6bf030ae75b547 | use standard way of clearing default filters | testapps/test_pillowtop/tests/test_user_pillow.py | testapps/test_pillowtop/tests/test_user_pillow.py | from django.conf import settings
from django.test import TestCase
from corehq.apps.change_feed import data_sources
from corehq.apps.change_feed import document_types
from corehq.apps.change_feed.document_types import change_meta_from_doc
from corehq.apps.change_feed.producer import producer
from corehq.apps.change_feed... | Python | 0 | @@ -4994,42 +4994,9 @@
-user_es = UserES()%0A # hack:
+#
cle
@@ -5055,89 +5055,34 @@
-# todo: find a better way to do this.%0A user_es._default_filters = ESQuery.
+user_es = UserES().remove_
defa
@@ -5092,16 +5092,18 @@
_filters
+()
%0A
|
20b957d16e45a9c8f2a4f3eb6262325dd85113f3 | Fix typo | anovaModules/qqPlot.py | anovaModules/qqPlot.py | #Add-on packages
import matplotlib
matplotlib.use('Agg')
import numpy as np
import pandas as pd
import statsmodels.api as sm
from matplotlib.backends.backend_pdf import PdfPages
#graphing packages
import module_box as box
import module_hist as hist
import module_lines as lines
import module_scatter as scatter
from man... | Python | 0.999999 | @@ -2472,17 +2472,16 @@
ized Res
-s
iduals%22,
|
605fab847797679fa961bde98be893d09fd4f89b | Add the remaining tests to testall. | postgresql/test/testall.py | postgresql/test/testall.py | ##
# copyright 2009, James William Pye
# http://python.projects.postgresql.org
##
import sys
import os
import unittest
from postgresql.test.test_iri import *
from postgresql.test.test_protocol import *
from postgresql.test.test_exceptions import *
if __name__ == '__main__':
from types import ModuleType
this = Modul... | Python | 0 | @@ -116,255 +116,523 @@
est%0A
-%0Afrom postgresql.test.test_iri import *%0Afrom postgresql.test.test_protocol import *%0Afrom postgresql.test.test_exceptions import *%0A%0Aif __name__ == '__main__':%0A%09from types import ModuleType%0A%09this = ModuleType(%22this%22)%0A%09this.__dict__.update(globals())
+import warni... |
dd41eacf8e1517c90664c956de93bf7d63c47caf | Add users set() to base channel objects | system/protocols/generic/channel.py | system/protocols/generic/channel.py | __author__ = 'Sean'
from system.translations import Translations
_ = Translations().get()
class Channel(object):
name = ""
def __init__(self, name, protocol=None):
self.name = name
self.protocol = protocol
def respond(self, message):
raise NotImplementedError(_("This method mus... | Python | 0.000001 | @@ -1,25 +1,4 @@
-__author__ = 'Sean'%0A%0A
from
@@ -38,16 +38,38 @@
lations%0A
+%0A__author__ = 'Sean'%0A%0A
_ = Tran
@@ -124,16 +124,34 @@
ame = %22%22
+%0A users = set()
%0A%0A de
@@ -246,16 +246,43 @@
protocol
+%0A self.users = set()
%0A%0A de
|
9910cbc746380dba2c8dc5f89120f0f48a74ced7 | Remove unused import library | tackerclient/tacker/v1_0/vm/vnfd.py | tackerclient/tacker/v1_0/vm/vnfd.py | #
# Copyright 2013 Intel Corporation
# All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python | 0.000001 | @@ -634,47 +634,8 @@
e.%0A%0A
-from __future__ import print_function%0A%0A
from
|
eec37fb717ed913533f377a4c1f5780efd8b4721 | add pages option | visio2img.py | visio2img.py | import win32com.client
from win32com.client import constants
from os import path, chdir, getcwd
from sys import argv, exit
def get_dispatch_format(extension):
if extension == 'vsd':
return 'Visio.Application'
if extension == 'vsdx':
pass # What?
if __name__ == '__main__':
# if len... | Python | 0.000001 | @@ -109,18 +109,46 @@
ort
-argv, exit
+exit%0Afrom optparse import OptionParser
%0A%0A%0Ad
@@ -300,40 +300,656 @@
at?%0A
- %0A%0Aif __name__ == '__main__':
+%0Adef get_pages(app, page_num=None):%0A %22%22%22%0A app -%3E page%0A if page_num is None, return all pages.%0A if page_num is int object, retu... |
3bd88e56d9e4f6b9b4ba8d4efc4773e6a6e8ed64 | Fix fuse tests. | plugin_tests/fuse_on_test.py | plugin_tests/fuse_on_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#############################################################################
# Copyright Kitware 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 th... | Python | 0 | @@ -2230,16 +2230,539 @@
rDown()%0A
+ # Even if we close all of our references, we aren't guaranteed that%0A # all files are released immediately. At this point, the data.process%0A # thread (regardless of whether it is synchronous or asynchronous)%0A # still has a reference to the source ... |
1076e1e3dc7788429333578f9cf57be1a9d6c70d | Clean up. | targetinteractionfinder/__init__.py | targetinteractionfinder/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from target_interaction_finder import TargetInteractionFinder
def main():
parser = argparse.ArgumentParser(description='Extract subgraph(s) from XGMML network(s).')
parser.add_argument('ids',
type=str,
... | Python | 0.000001 | @@ -750,16 +750,17 @@
se XGMML
+
(default
@@ -1289,16 +1289,34 @@
messages
+ (default = False)
')%0A a
|
b7861f04de8975d519f1032868bc0f698a75aa25 | fix email_requests plugin | plugins/email_requests/qt.py | plugins/email_requests/qt.py | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | Python | 0.000004 | @@ -4659,16 +4659,24 @@
e_signal
+.connect
(self.ne
|
822235500f7147cfdc564120eeacddeaa3453daa | include post body on api digest if method is PATCH | tastypie_hmacauth/authentication.py | tastypie_hmacauth/authentication.py | from __future__ import unicode_literals
import hmac
import hashlib
import time
from datetime import datetime
from django.conf import settings
from tastypie.http import HttpUnauthorized
from tastypie.compat import get_user_model
from tastypie.authentication import Authentication
from tastypie.exceptions import Immediat... | Python | 0.000001 | @@ -2559,16 +2559,45 @@
== 'PUT'
+ or request.method == 'PATCH'
:%0A
|
2aad9bc4d8d244c04aec232ade26376073ee87af | rewrite api root view | djoser/views.py | djoser/views.py | from django.contrib.auth import get_user_model
from rest_framework import generics, permissions, status, response
from rest_framework.decorators import api_view
from rest_framework.authtoken.models import Token
from rest_framework.response import Response
from rest_framework.reverse import reverse
from django.contrib.a... | Python | 0.000001 | @@ -3072,32 +3072,87 @@
token).%0A %22%22%22%0A
+ serializer_class = serializers.UserLoginSerializer%0A
permission_c
|
9f63bdee0502f29c4a97a24a984e99f4dbc00a37 | Remove comment | api/teamfinder/urls.py | api/teamfinder/urls.py | from django.conf import settings
from django.urls import include, path
from django.conf.urls.static import static
from django.contrib import admin
from rest_framework import routers
from common.api import views as common_views
from feedback.api import views as feedback_views
from players.api import views as player_vie... | Python | 0 | @@ -554,86 +554,8 @@
et)%0A
-# router.register(r'account', tf_auth_views.AccountView, base_name=%22account%22)%0A
rout
|
738cf7b93814c4bd66d0cd62baf91c5ed2f2fdce | Increase sleep between wait loops | dmaws/deploy.py | dmaws/deploy.py | import os
import tempfile
import time
from datetime import datetime, timedelta
import boto.beanstalk
import boto.s3
import boto.exception
from . import build
class Deploy(object):
def __init__(self, eb_application, eb_environment, repo_path, region,
logger=None, profile_name=None):
self... | Python | 0 | @@ -6326,17 +6326,17 @@
e.sleep(
-1
+5
)%0A%0A d
|
bd7a721cbd16b926cfdc97790fe0d1ae6ede3ce2 | Bump version 33 | terroroftinytown/client/__init__.py | terroroftinytown/client/__init__.py | VERSION = 32 # Please update this whenever .client or .services changes
# Please update MIN_VERSION_OVERRIDE and MIN_CLIENT_VERSION_OVERRIDE as needed
| Python | 0 | @@ -8,9 +8,9 @@
= 3
-2
+3
#
|
c69f8d9ed42da8eef1730ee59e838f905a5e6ef3 | Bump version 16. | terroroftinytown/client/__init__.py | terroroftinytown/client/__init__.py | VERSION = 15 # Please update this whenever .client or .services changes
# Please update MIN_VERSION_OVERRIDE and MIN_CLIENT_VERSION_OVERRIDE as needed
| Python | 0 | @@ -8,9 +8,9 @@
= 1
-5
+6
#
|
a21388dbcb1467df016360debbd8ac43f856f051 | Make config_settings_spec more future proof against new settings | test/config/config_settings_spec.py | test/config/config_settings_spec.py | import logging
from mamba import describe, it, context
from unittest.mock import MagicMock
from random import shuffle
from test_utils.anki import mock_anki_modules
mock_anki_modules()
from aqt import mw
from crowd_anki.config.config_settings import ConfigSettings, NoteSortingMethods
with describe(ConfigSettings) ... | Python | 0 | @@ -1,60 +1,4 @@
-import logging%0A%0Afrom mamba import describe, it, context%0A
from
@@ -33,34 +33,84 @@
ock%0A
+%0A
from
-random import shuffle
+expects import expect, contain%0Afrom mamba import describe, it, context
%0A%0Afr
@@ -276,17 +276,16 @@
ethods%0A%0A
-%0A
with des
@@ -3237,53 +3237,40 @@
ager
-=add... |
58fba2dc91819efec600b3e514c2d54d933c6e80 | Update gyro angles when the robot moves, add vector drive | lib/pyfrc/physics/core.py | lib/pyfrc/physics/core.py |
'''
TODO: a better way to implement this is have something track all of
the input values, and have that in a data structure, while also
providing the override capability.
'''
import inspect
import math
import threading
def _create_wrapper(cls, fname, new_fn, old_fn):
setattr(cls, fname, lambda s, *ar... | Python | 0 | @@ -1198,24 +1198,62 @@
port wpilib%0A
+ self.gyro_class = wpilib.Gyro%0A
%0A
@@ -5718,32 +5718,1100 @@
= angle%0A
+ %0A self._update_gyros()%0A %0A def vector_drive(self, vx, vy, vw, tm_diff):%0A '''Call this from your update_sim function. Will update the... |
36cf43649a58e0388118f89b867b011c5b436f75 | remove duplicated column in model | contrib/gn_module_validation/backend/gn_module_validation/models.py | contrib/gn_module_validation/backend/gn_module_validation/models.py | from sqlalchemy import ForeignKey
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import column_property
from sqlalchemy.sql import exists
from geonature.core.gn_commons.models import TMedias
from utils_flask_sqla.serializers import serializable
from utils_flask_sqla_geo.serializers import geoseria... | Python | 0 | @@ -3128,66 +3128,8 @@
er)%0A
- id_nomenclature_source_status = DB.Column(DB.Integer)%0A
|
18f6aeee01faf7ab8d819bdae6503a5b88c832d8 | put endpoint inside for now | put_repo_requests_in_db.py | put_repo_requests_in_db.py | import csv
import os
import json
import gspread
import datetime
import re
import unicodecsv as csv
from oauth2client.service_account import ServiceAccountCredentials
from app import db
from util import safe_commit
from endpoint import Endpoint
from repository import Repository
from repo_request import RepoRequest
from... | Python | 0 | @@ -212,38 +212,8 @@
mit%0A
-from endpoint import Endpoint%0A
from
@@ -2404,16 +2404,50 @@
equest):
+%0A from endpoint import Endpoint
%0A%0A if
@@ -5095,16 +5095,51 @@
ain__%22:%0A
+ from endpoint import Endpoint%0A%0A
# ro
|
8f42a1f5e0225e7e457bcaec01969ec0716d7c7e | use 'is' to compare to None | pychecker2/ReturnChecks.py | pychecker2/ReturnChecks.py | from pychecker2.Check import Check
from pychecker2.Check import Warning
from pychecker2.util import BaseVisitor, type_filter
from pychecker2 import symbols
from compiler import ast, walk
class Returns(BaseVisitor):
def __init__(self):
self.result = []
def visitReturn(self, node):
self.result... | Python | 0.999997 | @@ -548,10 +548,10 @@
lue
-==
+is
Non
|
f8d980de69607e73f207fea808c3b0558a4159c0 | Add date and social media fields to proposal | pyconcz_2016/cfp/models.py | pyconcz_2016/cfp/models.py | from django.db import models
from pyconcz_2016.conferences.models import Conference
class Cfp(models.Model):
conference = models.ForeignKey(Conference, related_name="cfps")
title = models.CharField(max_length=200)
date_start = models.DateTimeField()
date_end = models.DateTimeField()
class Meta:... | Python | 0 | @@ -21,16 +21,54 @@
t models
+%0Afrom django.utils.timezone import now
%0A%0Afrom p
@@ -1113,28 +1113,73 @@
note = models.TextField()%0A
+ date = models.DateTimeField(default=now)%0A
|
7191919a62ef380231afe3ffa964e3b9b7b80aad | Fix coding style and add a file header. | pygments/lexers/pypylog.py | pygments/lexers/pypylog.py | from pygments.lexer import RegexLexer, bygroups, include
from pygments.token import (Text, Keyword, Number, Comment, Punctuation, Name,
String, Literal)
__all__ = [
"PyPyLogLexer",
]
class PyPyLogLexer(RegexLexer):
"""
Lexer for PyPy log files.
*New in Pygments 1.5.*
"""
name = "PyPy Log... | Python | 0 | @@ -1,20 +1,256 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0A pygments.lexers.pypylog%0A ~~~~~~~~~~~~~~~~~~~~~~~%0A%0A Lexer for pypy log files.%0A%0A :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.%0A :license: BSD, see LICENSE for details.%0A%22%22%22%0A%0A
from pygments.lexer
@@ -313... |
f91a77351443aeb1990b188b77f96a0128f7cddb | Use sys.platform rather than platform.platform(), as joerick RTFM for me :) | pyinstrument/middleware.py | pyinstrument/middleware.py | from django.http import HttpResponse
from django.conf import settings
from pyinstrument import Profiler
import platform
import time
import os
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
class ProfilerMiddleware(MiddlewareMixin):
def process_reques... | Python | 0 | @@ -104,24 +104,19 @@
%0Aimport
-platform
+sys
%0Aimport
@@ -1272,24 +1272,19 @@
if
-platform
+sys
.platfor
@@ -1288,32 +1288,31 @@
form
-().startswith('Windows')
+ in %5B'win32', 'cygwin'%5D
:%0A
|
8fcfeb68715076715f11aa93205b579cccaaed57 | add add_fallback to public names | pylons/i18n/translation.py | pylons/i18n/translation.py | """Translation/Localization functions.
Provides ``gettext`` translation functions via an app's ``pylons.translator``
and get/set_lang for changing the language translated to.
"""
import os
from gettext import NullTranslations, translation
import pylons
__all__ = ['_', 'get_lang', 'gettext', 'gettext_noop', 'lazy_get... | Python | 0 | @@ -264,16 +264,32 @@
= %5B'_',
+ 'add_fallback',
'get_la
@@ -323,24 +323,8 @@
op',
- 'lazy_gettext',
%0A
@@ -330,16 +330,32 @@
+ 'lazy_gettext',
'lazy_n
@@ -402,20 +402,8 @@
xt',
- 'ngettext',
%0A
@@ -409,16 +409,28 @@
+ 'ngettext',
'set_la
@@ -475,16 +475,27 @@
eError',
+%0A ... |
449045900c015ba837825c728c088a503088f2a5 | fix File.exists() for S3 folders. | pysparkling/fileio/file.py | pysparkling/fileio/file.py | from __future__ import absolute_import
import os
import boto
import fnmatch
import logging
from ..utils import Tokenizer
log = logging.getLogger(__name__)
class File(object):
_s3_conn = None
def __init__(self):
"""This is an abstract class. Use WholeFile or any other future
implementation.... | Python | 0 | @@ -2902,21 +2902,34 @@
-next(
+any(True for _ in
bucket.l
@@ -2956,19 +2956,8 @@
'/')
-.__iter__()
))%0A
|
ab8b489581de6a73cfd2045c0251cc9aa9718aa4 | add deletetone | pythainlp/util/__init__.py | pythainlp/util/__init__.py | # -*- coding: utf-8 -*-
import re
import six
from nltk.util import ngrams as ngramsdata
def ngrams(token,num):
'''
ngrams สร้าง ngrams
ngrams(token,num)
- token คือ list
- num คือ จำนวน ngrams
'''
return ngramsdata(token,int(num))
def bigrams(sequence):
"""
bigrams ใน Python
bigrams(sequence)
"""
return ng... | Python | 0.000001 | @@ -1757,12 +1757,307 @@
return text
+%0Adef deletetone(data):%0A%09'''%E0%B9%82%E0%B8%84%E0%B9%89%E0%B8%94%E0%B8%AA%E0%B9%88%E0%B8%A7%E0%B8%99%E0%B8%95%E0%B8%B1%E0%B8%94%E0%B8%A7%E0%B8%A3%E0%B8%A3%E0%B8%93%E0%B8%A2%E0%B8%B8%E0%B8%81%E0%B8%95%E0%B9%8C%E0%B8%AD%E0%B8%AD%E0%B8%81'''%0A%09for tone in %5B'%E0%B9%88','%E0... |
715b999a0527a717da3032f7ce8ae5d3115174bb | Update version.py | python/baseline/version.py | python/baseline/version.py | __version__ = "1.4.3"
| Python | 0.000001 | @@ -16,7 +16,7 @@
1.4.
-3
+4
%22%0A
|
01c54e91f40c02346e74f1d0d6aecbfbd0bed1b4 | bump version to 1.3.1 | python/lazperf/__init__.py | python/lazperf/__init__.py | __version__='1.3.0'
from .pylazperfapi import PyDecompressor as Decompressor
from .pylazperfapi import PyCompressor as Compressor
from .pylazperfapi import PyVLRDecompressor as VLRDecompressor
from .pylazperfapi import PyVLRCompressor as VLRCompressor
from .pylazperfapi import PyRecordSchema as RecordSchema
from .pylaz... | Python | 0 | @@ -14,9 +14,9 @@
1.3.
-0
+1
'%0Afr
|
2ff480b8d38e74224ff70f2633dbc519753e967a | Remove redundant import. | python/matasano/set1/c8.py | python/matasano/set1/c8.py | from matasano.util.converters import hex_to_bytestr
if __name__ == "__main__":
chal_file = open("matasano/data/c8.txt", 'r')
coll_count = {}
for idx, line in enumerate(chal_file):
count = 0
ct = line[:-1]
for i in range(0, len(ct), 32):
for j in range(i+32, len(ct), 32... | Python | 0.000003 | @@ -1,57 +1,4 @@
-from matasano.util.converters import hex_to_bytestr%0A%0A
if _
|
0630242522ba8ac73addd564224a5f21b1b81963 | Use isinstance for type-checking keys of tags for metrics (#11202) | python/ray/util/metrics.py | python/ray/util/metrics.py | import logging
from typing import Dict, Any, List, Optional, Tuple
from ray._raylet import (
Count as CythonCount,
Histogram as CythonHistogram,
Gauge as CythonGauge,
) # noqa: E402
logger = logging.getLogger(__name__)
class Metric:
"""The parent class of custom metrics.
Ray's custom metrics ... | Python | 0 | @@ -1130,19 +1130,29 @@
if
-typ
+not isinstanc
e(self._
@@ -1163,18 +1163,16 @@
keys
-) !=
+,
tuple
+)
:%0A
@@ -1198,33 +1198,16 @@
ueError(
-%0A
%22tag_key
@@ -1232,18 +1232,25 @@
e type,
-%22%0A
+got: %22%0A
@@ -1261,14 +1261,21 @@
-f%22but
+ f%22
%7Btyp... |
41eeea9a854747aa7e9715aa8186218d7d66fb46 | rename unused var to _ | pywincffi/ws2_32/events.py | pywincffi/ws2_32/events.py | """
Events
------
A module containing Windows functions for working with events.
"""
from six import integer_types
from pywincffi.core import dist
from pywincffi.core.checks import input_check, error_check
from pywincffi.exceptions import WindowsAPIError
from pywincffi.wintypes import HANDLE, SOCKET, wintype_to_cdat... | Python | 0.000007 | @@ -1843,27 +1843,25 @@
%22%22%22%0A
-ffi
+_
, library =
|
e7af90f38259206efb1b77d45d93fadd1b1594bf | Update torch code | qanta/guesser/torch/dan.py | qanta/guesser/torch/dan.py | from typing import List, Tuple, Optional
import time
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from qanta import logging
from qanta.guesser.abstract import AbstractGuesser
from qanta.datasets.abstract import TrainingData, Answer, QuestionText
from qanta.preprocess impor... | Python | 0 | @@ -5954,36 +5954,115 @@
ne:%0A
-pass
+self.embeddings.weight = nn.Parameter(torch.from_numpy(initial_embeddings).float())
%0A%0A def forwar
|
460c58c84d768ff411ada354f72cc73518815fc9 | Use new_investigation_type from the GUI | qiita_ware/dispatchable.py | qiita_ware/dispatchable.py | from os.path import join
from tempfile import mkdtemp
from gzip import open as gzopen
from .processing_pipeline import StudyPreprocessor
from .analysis_pipeline import RunAnalysis
from qiita_core.qiita_settings import qiita_config
from qiita_ware.commands import submit_EBI_from_files
from qiita_ware.demux import to_pe... | Python | 0 | @@ -366,16 +366,56 @@
en_file%0A
+from qiita_db.util import convert_to_id%0A
from qii
@@ -439,16 +439,16 @@
t Study%0A
-
from qii
@@ -598,16 +598,55 @@
RawData%0A
+from qiita_db.ontology import Ontology%0A
%0A%0Adef pr
@@ -1437,67 +1437,443 @@
-investigation_type = RawData(raw_data_id).investigation_typ
+# ... |
72bd9c2d6d7050b8a35e3c0203558d01cc832e79 | Fix in sparql output | quepy/sparql_generation.py | quepy/sparql_generation.py | # -*- coding: utf-8 -*-
"""
Sparql generation code.
"""
from quepy import settings
from quepy.expression import isnode
from quepy.encodingpolicy import assert_valid_encoding
from quepy.intermediate_representation import IsRelatedTo
_indent = u" "
def adapt(x):
if isnode(x):
x = u"?x{}".format(x)
... | Python | 0.000166 | @@ -651,20 +651,16 @@
u%22
-
%7Bexpress
|
40720e89384dcf221376d4bc8fb6f988db2ebf7c | Make pixel set view pixels_limit configurable | apps/explorer/views.py | apps/explorer/views.py | from django.db.models import Q
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponse, HttpResponseRedirect
from django.urls.base import reverse
from django.utils import timezone
from django.views.generic import DetailView, FormView, ListView
f... | Python | 0.000009 | @@ -4163,24 +4163,47 @@
detail.html'
+%0A pixels_limit = 100
%0A%0A def ge
@@ -4293,35 +4293,8 @@
s)%0A%0A
- pixels_limit = 100%0A
@@ -4390,16 +4390,21 @@
)%5B:
+self.
pixels_l
@@ -4465,16 +4465,16 @@
pixels,%0A
-
@@ -4493,16 +4493,21 @@
limit':
+self.
pixels_l
|
7999ec125fc31428ed6879bf01bb013483daf704 | Fix bos token id default (#17441) | src/transformers/models/opt/configuration_opt.py | src/transformers/models/opt/configuration_opt.py | # coding=utf-8
# Copyright 2022 The Metaseq Authors and The HuggingFace Inc. team. 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/... | Python | 0 | @@ -5557,17 +5557,17 @@
oken_id=
-0
+2
,%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.