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 |
|---|---|---|---|---|---|---|---|
69102f560eced438838f0377fe351adc7b542c1e | Change version. | yubico/__init__.py | yubico/__init__.py | __version__ = (1, 6, 3, 'dev')
| Python | 0 | @@ -19,13 +19,6 @@
6, 3
-, 'dev'
)%0A
|
9de9c50ee2c166efd42f88a730973c7ebd9b108b | add csv | TP3/RiskAI/Main.py | TP3/RiskAI/Main.py | import signal
from Controller import *
from RandomAI import *
from CarreRougeAi import CarreRougeAI
finish = False
def signal_handler(signal, frame):
global finish
print "Arret demande"
finish = True
signal.signal(signal.SIGINT, signal_handler)
ai1 = RandomAI() # agent adverse sans apprentissage machine
... | Python | 0.000042 | @@ -94,16 +94,28 @@
ougeAI%0A%0A
+import csv%0A%0A
finish =
@@ -386,16 +386,44 @@
AI2 = 0%0A
+winRate = %5B%5D%0AlastTenWin = 0%0A
for i in
@@ -433,16 +433,18 @@
ange(100
+00
):%0A i
@@ -638,18 +638,185 @@
= 1%0A
-%0Aai2.save(
+ lastTenWin += 1%0A%0A if i%2510 == 0:%0A winRate.append(lastTenW... |
47671cfcf7900d66fc320c24772f73888b777a95 | update to remove old whitenoise setup | project/wsgi.py | project/wsgi.py | """
WSGI config for project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | Python | 0 | @@ -351,87 +351,22 @@
%22)%0A%0A
-from whitenoise.django import DjangoWhiteNoise%0A%0Aapplication = DjangoWhiteNoise(
+application =
get_
@@ -383,10 +383,9 @@
cation()
-)
%0A
|
1e75a7bd42f2236018bdae7d203c92545bee3e4d | Remove offset from VariableILValue | il_gen.py | il_gen.py | """Objects used for the AST -> IL phase of the compiler."""
from errors import CompilerError
class CType:
"""Represents a C type, like `int` or `double` or a struct.
size (int) - The result of sizeof on this type.
signed (bool) - Whether this type is signed.
"""
def __init__(self, size, signed... | Python | 0.000001 | @@ -4220,85 +4220,8 @@
%22%22%0A%0A
- # TODO: why does this have an offset? shouldn't offset be ASM specific?%0A%0A
@@ -4248,16 +4248,8 @@
type
-, offset
):%0A
@@ -4345,37 +4345,8 @@
pe)%0A
- self.offset = offset%0A
%0A%0Acl
@@ -6040,45 +6040,8 @@
1%5D:%0A
- # TODO: use real offsets%0A... |
3c81852b3278d8c72c70ef32d2b83f2356a02fad | generate command | tools/train_by_parameter.py | tools/train_by_parameter.py | """
Train CJ-GLO model by different parameters, then test the result.
"""
def main():
pass
if __name__ == '__main__':
main() | Python | 1 | @@ -76,28 +76,825 @@
%22%22%0A%0A
-def main():%0A pass
+import os%0A%0Adef fill_bi_cooccur_command(sentence_rate, cjglo, output_filename):%0A cmd = %22build/bi_cooccur -verbose 0%22%0A cmd += %22 -corpus-file-1 data/train.zh_parsed%22%0A cmd += %22 -corpus-file-2 data/train.ja_parsed%22%0A cmd += %22 -v... |
554572f327e4b9c920f65b416bfc6a3a5b549846 | Reset the num threads to the env variable, not the default | numba/tests/npyufunc/test_parallel_env_variable.py | numba/tests/npyufunc/test_parallel_env_variable.py | from numba.np.ufunc.parallel import get_thread_count
from os import environ as env
from numba.core import config
import unittest
class TestParallelEnvVariable(unittest.TestCase):
"""
Tests environment variables related to the underlying "parallel"
functions for npyufuncs.
"""
_numba_parallel_test... | Python | 0.000001 | @@ -550,16 +550,8 @@
MBA_
-DEFAULT_
NUM_
|
fd66105dca7e94a964cd92bb1e74e1d262fa54eb | Remove unused function | zc_common/email.py | zc_common/email.py | from datetime import date
import time
import uuid
import boto
from boto.s3.key import Key
from django.conf import settings
from raven.contrib.django.raven_compat.models import client
from zc_common.events.emit import emit_microservice_event
S3_BUCKET_NAME = 'zc-mp-email'
EMAIL_EVENT_TYPE = 'send_email'
ATTACHMENT_PR... | Python | 0.000004 | @@ -393,106 +393,8 @@
s%0A%0A%0A
-def send_error_to_sentry():%0A try:%0A client.captureException()%0A except:%0A pass%0A%0A%0A
def
|
73e23b1dba784480a9b3aafbbccd351117a4b6e6 | Normalize line endings in SilverCity output to LF. Closes #1649. Thanks to Shun-ichi Goto for the patch. | trac/mimeview/silvercity.py | trac/mimeview/silvercity.py | # -*- coding: iso8859-1 -*-
#
# Copyright (C) 2004 Edgewall Software
# Copyright (C) 2004 Daniel Lundin <daniel@edgewall.com>
#
# Trac is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# ... | Python | 0.000019 | @@ -3001,16 +3001,301 @@
n, err%0A%0A
+ # SilverCity generates extra empty line against some types of%0A # the line such as comment or #include with CRLF. So we%0A # standardize to LF end-of-line style before call.%0A cr_re = re.compile('%5Cr$', re.MULTILINE)%0A content = crlf_re.sub... |
d01a17efe90abda6328856e6d9a9ceef84811e3b | Fix skia_revision in Chrome Canary | slave/skia_slave_scripts/utils/sync_skia_in_chrome.py | slave/skia_slave_scripts/utils/sync_skia_in_chrome.py | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Create (if needed) and sync a nested checkout of Skia inside of Chrome. """
import gclient_utils
from optparse import OptionP... | Python | 0.001131 | @@ -1781,16 +1781,53 @@
ision!')
+%0A skia_revision = str(skia_revision)
%0A%0A # Ru
|
4ebc539f77f7b0dc0d32b79edb34c651cf5e5b97 | Update index path | generate-from-model.py | generate-from-model.py | import sys
import numpy
import pickle
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import LSTM
from keras.callbacks import ModelCheckpoint
from keras.utils import np_utils
from scipy.misc import logsumexp
# create mapping of unique chars to inte... | Python | 0.000001 | @@ -377,18 +377,25 @@
en(%22
-char_indic
+index/char_to_int
.jso
@@ -440,18 +440,25 @@
pen(%22ind
-ic
+ex/int_to
_char.js
|
c1d98d1643b43cee76950bb92b4d272dc067dbf8 | add calss docstring | mergefile/filebuf.py | mergefile/filebuf.py | # -*- coding: utf-8 -*-
r"""
# .---. .-----------
# / \ __ / ------
# / / \( )/ ----- (`-') _ _(`-') <-. (`-')_
# ////// '\/ ` --- ( OO).-/( (OO ).-> .-> \( OO) ) .->
# //// / // : : --- (,------. \ .'_ (`-')----. ,... | Python | 0.000017 | @@ -2821,41 +2821,255 @@
-def __init__(self, file1, file2):
+%22%22%22%0A FILEBUF: class to write the each different lines into buffer file named %60tmp%60.%0A %22%22%22%0A def __init__(self, file1, file2):%0A %22%22%22%0A Initialize the instance attributes: %5Bfile1, file2, file1_line_num,... |
564cf9903059a987947e03b9c2fd00a2993a3a93 | return queryset | corehq/sql_db/models.py | corehq/sql_db/models.py | from corehq.util.exceptions import AccessRestricted
from django.db import models, connections
from django.db.models.query import RawQuerySet
def raise_access_restricted(queryset):
if not queryset._db and 'partition_value' not in queryset._hints and 'using' not in queryset._hints:
raise AccessRestricted("T... | Python | 0.000235 | @@ -2255,16 +2255,31 @@
alias%7D)
+.get_queryset()
%0A%0A de
|
a425898865166813c8d64311ec10b23ac8625882 | add validation for validating than file is ignored file | tpl/tpl.py | tpl/tpl.py | # -*- coding:utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import jinja2
from tpl import path
from tpl import errors
class Template(object):
IGNORE_FILES = [
'construct.sh',
'construct.py'
]
def __init__(self, tpl_dir):
... | Python | 0.000001 | @@ -393,13 +393,127 @@
-pass
+file_name = file.split('/')%5B-1%5D%0A if file_name in self.IGNORE_FILES:%0A return True%0A return False
%0A%0A
|
18f2db88d8f8e36e5e86ffac5a09a8aa927ca68b | add logger | api_managers/apis/recast.py | api_managers/apis/recast.py | # -*- coding: utf-8 -*-
# https://man.recast.ai/
from api import ApiManager
import requests
class RecastManager(ApiManager):
def __init__(self, user_slug, bot_slug, token, language, fallback_name, strictness=50):
ApiManager.__init__(self, fallback_name)
self._base_url = 'https://api.recast.ai/v... | Python | 0.000002 | @@ -79,24 +79,79 @@
%0Aimport
-requests
+logging%0Aimport requests%0A%0A%0Alogger = logging.getLogger(__name__)%0A
%0A%0A%0Aclass
@@ -1751,17 +1751,95 @@
try=0):%0A
+ logger.debug(u'Create intent %7B0%7D for lang %7B1%7D'.format(name, language))
%0A
-
@@ -2776,17 +2776,79 @@
_slug):%0A
+ l... |
cb52303c74a76bfaf8f3017b9be78f3620b00483 | Add pragma: no cover to migration data unload | ovp_core/migrations/0004_load_skills_and_causes.py | ovp_core/migrations/0004_load_skills_and_causes.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-25 01:14
from __future__ import unicode_literals
from django.db import migrations
skills = ['Arts/Handcrafting', 'Communication', 'Dance/Music', 'Law', 'Education', 'Sports', 'Cooking', 'Management', 'Idioms', 'Computers/Technology', 'Health', 'Others']
... | Python | 0.000008 | @@ -849,32 +849,50 @@
schema_editor):
+ #pragma: no cover
%0A Skill = apps.
|
9829a23e82c55e26529848a28ae71fe3c92758af | Update tests with new redirect after login | accounts/tests/test_acceptance.py | accounts/tests/test_acceptance.py | import pytest
from model_mommy import mommy
@pytest.mark.django_db
def test_login_form(client, user):
response = client.get('/accounts/login/')
assert response.status_code == 200
assert response.context['request'].user.is_authenticated() is False
response = client.post('/accounts/login/', {'login': u... | Python | 0 | @@ -3140,32 +3140,42 @@
tp://testserver/
+my-courses
'%0A%0A%0A@pytest.mark
@@ -4507,32 +4507,42 @@
tp://testserver/
+my-courses
'%0A%0A%0A@pytest.mark
@@ -4775,16 +4775,26 @@
tserver/
+my-courses
'%0A%0A%0A@pyt
|
fbc749de0b9c9f0fa2360d01d48c537939d67d4e | Stop using deprecated sequence adder kwargs. | acme/agents/jax/impala/builder.py | acme/agents/jax/impala/builder.py | # python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | Python | 0.000004 | @@ -4970,78 +4970,8 @@
th,%0A
- pad_end_of_episode=False,%0A break_end_of_episode=False,%0A
|
35a0a42b4311828ded6d4d614cc50d4da6a60b8c | Use context with file | src/utils/playbook.py | src/utils/playbook.py | from django.conf import settings
from ansible.models import Playbook
import os
def content_loader(pk, slug):
playbook = Playbook.query_set.get(pk=pk)
playbook_dir = playbook.directory
# TODO: for now assume without validation
playbook_file = os.path.join(playbook_dir, slug + '.yml')
return playboo... | Python | 0.000002 | @@ -299,19 +299,23 @@
l')%0A
+%0A
-return
+with open(
play
@@ -323,9 +323,68 @@
ook_file
+, 'r') as f:%0A content = f.read()%0A%0A return content
%0A
|
3ae6787d1e5fdfc746f1ec92409a75b397d702e9 | Bump version to 2.1.1-dev | indico/__init__.py | indico/__init__.py | # This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | Python | 0 | @@ -801,16 +801,22 @@
_ = '2.1
+.1-dev
'%0A%0Aregis
|
b3d91644856d19f6eb65373542d5552291a8f7ad | update argparser names | PyAnalysisTools/base/__init__.py | PyAnalysisTools/base/__init__.py | import ROOT
ROOT.PyConfig.IgnoreCommandLineOptions = True
from Logger import Logger
import argparse
class InvalidInputError(ValueError):
pass
_logger = Logger().retrieve_logger()
"""
Setting memory policy to avoid graphics objects getting deleted once drawn to canvas and canvas passing around.
"""
ROOT.SetMemor... | Python | 0.000001 | @@ -1111,22 +1111,22 @@
(%22--
-dataset
+xs
_config
+_file
%22, %22
@@ -1225,16 +1225,21 @@
s_config
+_file
s%22, %22-pr
|
f57fc2abd861e7eb9f1ce698c05b87b66cd0e408 | Update UploadedTo.py | module/plugins/accounts/UploadedTo.py | module/plugins/accounts/UploadedTo.py | # -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in... | Python | 0 | @@ -854,17 +854,17 @@
_ = %220.2
-3
+4
%22%0A __
@@ -1676,16 +1676,21 @@
%22(%5Cd+) (
+Week%7C
weeks%7Cda
@@ -1838,16 +1838,29 @@
t(n) * %7B
+%22Week%22: 168,
%22weeks%22:
|
886e70314cb6a99e622a8446bdc55db38b1a3aa4 | Add SOFT as a possible section to exclude from counter list. | tools/test/hwpmc/pmctest.py | tools/test/hwpmc/pmctest.py | #!/usr/bin/env python
# Copyright (c) 2012, Neville-Neil Consulting
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# t... | Python | 0 | @@ -2257,16 +2257,25 @@
%22, %22UCP%22
+, %22SOFT%22
%5D%0A%0Adef m
|
c0373486e307b8ec736268fe5d68146c371ca64f | Add script functionality. | indra/db/belief.py | indra/db/belief.py | import logging
logger = logging.getLogger('db_belief')
from indra.belief import BeliefEngine
class LoadError(Exception):
pass
class MockStatement(object):
"""A class to imitate real INDRA Statements for calculating belief."""
def __init__(self, mk_hash, evidence=None, supports=None, supported_by=None)... | Python | 0 | @@ -7,16 +7,67 @@
logging
+%0Aimport pickle%0A%0Afrom indra.db import get_primary_db
%0A%0Alogger
@@ -3671,24 +3671,269 @@
.belief for s in stmts%7D%0A
+%0A%0Adef run():%0A db = get_primary_db()%0A stmts = load_mock_statements(db)%0A return calculate_belief(stmts)%0A%0A%0Aif __name__ == '__main__':%0A b... |
f76a911d676880599d2f4a325b788a3dc0c5023b | assume utf-8 for strings from hg | pushes/utils.py | pushes/utils.py | from datetime import datetime
import os.path
try:
import json
except ImportError:
import simplejson as json
from mercurial.hg import repository
from mercurial.ui import ui as _ui
from mercurial.commands import pull, update, clone
from pushes.models import Push, Changeset, File
from django.conf import settings... | Python | 0.999644 | @@ -1981,16 +1981,43 @@
x.user()
+.decode('utf-8', 'replace')
%0A
@@ -2059,16 +2059,43 @@
iption()
+.decode('utf-8', 'replace')
%0A
|
4b5dd61607c9692bb330f89545d5f76d7a1ed221 | Fix linkage in the RSS feed | puzzle/feeds.py | puzzle/feeds.py | """
Generate an RSS feed of published crosswords from staff users.
Uses the built-in feed framework. There's no attempt to send the actual
crossword, it's just a message indicating that a new one is available.
"""
from django.contrib.syndication.views import Feed
from django.urls import reverse
from django.utils impo... | Python | 0.000006 | @@ -1029,26 +1029,68 @@
e',
+kw
args=
-%5Bitem.number%5D
+%7B'author': item.user.username, 'number': item.number%7D
)%0A%0A
|
e45bc40f062b58e5f9ce89a0c3af2f6762ccfcb9 | Change tokenizer from NLTK's default to WordPunctTokenizer. | tcflib/examples/nltk_tokenizer.py | tcflib/examples/nltk_tokenizer.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Frederik Elwert <frederik.elwert@web.de>
#
# 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... | Python | 0 | @@ -1325,17 +1325,64 @@
tokenize
-,
+%0Afrom nltk.tokenize import wordpunct_tokenize as
word_to
@@ -1605,20 +1605,16 @@
lists.%0A
-
%0A Exa
@@ -1720,20 +1720,16 @@
%5B'd'%5D%5D%0A
-
%0A %22%22%22
|
56cb3716a1d80c17b62870c15bb9b9e25206f936 | add flag for profiling | experiments/tf_trainer/common/model_trainer.py | experiments/tf_trainer/common/model_trainer.py | """The Model Trainer class.
This provides an abstraction of Keras and TF.Estimator, and is intended for use
in text classification models (although it may generalize to other kinds of
problems).
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import jso... | Python | 0 | @@ -1299,16 +1299,132 @@
sults.')
+%0Atf.app.flags.DEFINE_bool('enable_profiling', True,%0A 'Enable profiler hook in estimator.')
%0A%0Atf.app
@@ -3542,24 +3542,71 @@
-profiler_
+hooks = None%0A if FLAGS.enable_profiling:%0A
hook
+s
=
+%5B
tf.t
@@ -3638,16 +3638,47 @@... |
8f3b57fade88a596aa5fec95342e074c00367997 | remove test code | tchannel/messages/call_request.py | tchannel/messages/call_request.py | from __future__ import absolute_import
from .base import BaseMessage
from .types import Types
from .. import rw
from . import common
class CallRequestMessage(BaseMessage):
"""Initiate an RPC call."""
message_type = Types.CALL_REQ
__slots__ = (
'flags',
'ttl',
'tracing',
... | Python | 0.000873 | @@ -850,19 +850,8 @@
se %7B
-%22as%22:%22http%22
%7D%0A
|
be08bbd5249e31345dc42140558a3a3f4720e71d | add coverage sanitizer option (#6171) | infra/constants.py | infra/constants.py | # Copyright 2021 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, ... | Python | 0.000007 | @@ -1038,16 +1038,21 @@
ZERS = %5B
+%0A
'address
@@ -1105,16 +1105,29 @@
'thread'
+, 'coverage'%0A
%5D%0AARCHIT
|
4b49e77f6fb94e68121d5851b942ef8a1744119f | change revel urls | tehbot/plugins/challenge/revel.py | tehbot/plugins/challenge/revel.py | from tehbot.plugins.challenge import *
import urllib2
import urllib
import urlparse
import lxml.html
import re
class Site(BaseSite):
def prefix(self):
return u"[Revolution Elite]"
def siteurl(self):
return "https://revolutionelite.co.uk"
def userstats(self, user):
#url = "https://... | Python | 0.000001 | @@ -226,32 +226,36 @@
return %22https://
+www.
revolutionelite.
@@ -261,16 +261,16 @@
.co.uk%22%0A
-
%0A def
@@ -293,33 +293,32 @@
user):%0A
-#
url = %22https://r
@@ -308,32 +308,36 @@
url = %22https://
+www.
revolutionelite.
@@ -381,103 +381,8 @@
%25s%22%0A
- url = %22https://www.sabrefilm... |
3ca822a4e9797bb82c7bf37e9c6bb4670913c6cf | Fix BUg | ui/menu_usuario.py | ui/menu_usuario.py | from logica import usuario
from logica import historico
def menu_adicionar():
print("\nAdicionar Usuário \n")
cpf = int(input("CPF: "))
nome = str(input("Nome: "))
email = str(input("Email: "))
senha = str(input("Senha: "))
usuario.adicionar_usuario(cpf,nome,email,senha)
def impri... | Python | 0.000013 | @@ -1281,23 +1281,90 @@
s(cpf)%0D%0A
+%0D%0A
if
+u == None:%0D%0A print(%22%5CnUsu%C3%A1rio n%C3%A3o encontrado.%22)%0D%0A elif
hist ==
|
ad617461780272b1a3504e5083758960c0047757 | Work around Revel problems | tehbot/plugins/challenge/revel.py | tehbot/plugins/challenge/revel.py | from tehbot.plugins.challenge import *
import urllib2
import urllib
import urlparse
import lxml.html
import re
class Site(BaseSite):
def prefix(self):
return u"[Revolution Elite]"
def siteurl(self):
return "https://www.revolutionelite.co.uk"
@staticmethod
def challurl():
retur... | Python | 0 | @@ -5213,24 +5213,84 @@
t%5C)', page)%0A
+ cnt, solvers = 0, %5B%5D%0A%0A if match:%0A
@@ -5315,16 +5315,20 @@
oup(1))%0A
+
|
74c0a930c1562365a3ed403f472c5a0852e81a9e | Fix for chi2 test. | utils/test_sims.py | utils/test_sims.py | """
This module contains test suites for simulations
in `sims.py` that can be runned using
`py.test`.
"""
import pytest
from pytest import mark
import random
import math
from utils.sims import InvalidInput, CoinSim, NeedleSim, CoinPhysicsSim
TRIALS = 10000 # number of trials to run per test case
NUM_TESTS = 5 # numb... | Python | 0 | @@ -836,15 +836,30 @@
e #
-settled
+this definitely passes
%0A%0A
@@ -2609,35 +2609,24 @@
)
- %3C MAX_STAT
%0A%0Aclass Test
@@ -4166,35 +4166,24 @@
)
- %3C MAX_STAT
%0A%0Aclass Test
@@ -6254,32 +6254,32 @@
TRIALS%0A
+
) %3C
@@ -6275,27 +6275,16 @@
)
- %3C M... |
39bc5d9f4d860f432ca3e93c887cc725e7d5a7e4 | Fix issue with temp files in tecombine tests | tellurium/tests/test_tecombine.py | tellurium/tests/test_tecombine.py | """
Testing tecombine.
"""
from __future__ import print_function
import unittest
import tellurium as te
import tellurium.tephrasedml as tephrasedml
import tempfile
import os
import shutil
@unittest.skipIf(tephrasedml.phrasedml is None, "only run tests if phrasedml is available")
class teCombineTestCase(unittest.TestCa... | Python | 0 | @@ -1487,25 +1487,16 @@
timony%22%0A
- %0A
@@ -1534,16 +1534,41 @@
timony)%0A
+ self.clearTest()%0A
%0A
@@ -1625,17 +1625,16 @@
asedml%22%0A
-%0A
@@ -1743,32 +1743,57 @@
phrasedml.xml%22)%0A
+ self.clearTest()%0A
%0A def
@@ -1920,24 +1920,49 @@
ne(sbmlst... |
852349276fcd1aa79ba1a31ab77637db64d9ddae | Mark safe statics | selectize/templatetags/selectize_tags.py | selectize/templatetags/selectize_tags.py | from django import template
# from django.templatetags.static import static
# see stackoverflow :http://stackoverflow.com/questions/11721818
from django.contrib.staticfiles.templatetags.staticfiles import static
register = template.Library()
@register.simple_tag
def selectize_tags_media(media_type='css',name=''):
"... | Python | 0.000004 | @@ -204,17 +204,62 @@
t static
-
+%0Afrom django.utils.safestring import mark_safe
%0A%0Aregist
@@ -815,20 +815,31 @@
%09return
+mark_safe(
html
+)
%0A%0A%09if na
@@ -920,16 +920,26 @@
%09return
+mark_safe(
'%3Clink r
@@ -994,8 +994,9 @@
(fpath))
+)
|
ceaa14a9e7d98e16c4d78791edf40c17cab24de7 | Remove signature file along with executed command file | client/collect.py | client/collect.py | #!/usr/bin/env python3
# There's no error-handling here. If anything fails, the whole script will
# fail. In the short term, at least, that's acceptable. If something fails,
# we'll log into the box, look at the exception, figure out why it's failing,
# and fix it. This isn't code we're going to ship, it's code for in... | Python | 0 | @@ -580,16 +580,22 @@
ort
+(%0A
top_dir,
col
@@ -590,16 +590,20 @@
top_dir,
+%0A
collect
@@ -609,16 +609,20 @@
ted_dir,
+%0A
plugins
@@ -626,16 +626,20 @@
ins_dir,
+%0A
command
@@ -648,16 +648,40 @@
dir,
+%0A signatures_dir,%0A
set_gpg
%0Afro
@@ -676,16 +676,19 @@
set_gpg
+,%0A)
... |
ee214c1be54af5a1e7ae0892dba8f2569a79828e | Fix logging.conf loading | script/isovar-variant-sequences.py | script/isovar-variant-sequences.py | #!/usr/bin/env python
# Copyright (c) 2016. Mount Sinai School of Medicine
#
# 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 requi... | Python | 0.000002 | @@ -926,24 +926,28 @@
ilename(
-__name__
+'isovar.cli'
, 'loggi
|
65c071930efc6df2878eaf655eca8c78228a08cd | use the stow logic for unfolding & basic stow | dploy/__init__.py | dploy/__init__.py | """
dploy script is an attempt at creating a clone of GNU stow that will work on
Windows as well as *nix
"""
import sys
assert sys.version_info >= (3, 3), 'Requires Python 3.3 or Greater'
import os
import pathlib
from dploy.util import resolve_abs_path
def stow(source, dest):
"""
sub command stow
"""
... | Python | 0 | @@ -1832,120 +1832,261 @@
-files = zip(src_files, src_files_relative, stow_paths)%0A%0A for src_file, src_file_relative, stow_path in files:
+_stow_files(src_files, src_files_relative, dest)%0A%0A%0Adef _stow_files(src_files, src_files_relative, dest):%0A files = zip(src_files, src_files_relative)%0A%0A ... |
affcd80a80512f49b1a051932a56eb89dd694d4e | Fix timeout during upload from slow resource | glance_store/driver.py | glance_store/driver.py | # Copyright 2011 OpenStack Foundation
# Copyright 2012 RedHat Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/L... | Python | 0 | @@ -1084,18 +1084,17 @@
KSIZE =
-16
+4
* units
@@ -1104,10 +1104,9 @@
#
-16
+4
M%0A
|
4ee9ac8056a6b0d3eb1552cdebf664099a999d64 | Add an endpoint for Wikipedia search | dragonfire/api.py | dragonfire/api.py | from __future__ import print_function
import collections # Imported to support ordered dictionaries in Python
import hug
from hug_middleware_cors import CORSMiddleware
import waitress
from threading import Thread
import json
from dragonfire.omniscient import Engine
from dragonfire.conversational import DeepConversatio... | Python | 0.000215 | @@ -314,16 +314,43 @@
ersation
+%0Aimport wikipedia%0Aimport re
%0A%0Anlp =
@@ -3391,16 +3391,751 @@
ent=4)%0A%0A
+@hug.post('/wiki', requires=token_authentication)%0Adef wiki(query, gender_prefix):%0A response = %22%22%0A url = %22%22%0A wikiresult = wikipedia.search(query)%0A if len(wikiresult) == 0:%... |
37a85a8fdac4a08400ff4859a52647a8513dd591 | Allow no collections... | scripts/concatenate_collections.py | scripts/concatenate_collections.py | #!/usr/bin/env python
from peyotl import concatenate_collections, read_as_json, write_as_json
if __name__ == '__main__':
import argparse
import sys
import os
description = 'Takes a list of collections and writes a collection that is a concatenation of their decisions'
parser = argparse.ArgumentPars... | Python | 0 | @@ -692,9 +692,9 @@
gs=%22
-+
+*
%22,%0A
|
0a7eeffd5632032630ae1c1ed99c105f7700fde4 | fix TypeError url = '\r\n'.join([url]) | etc/hello.py | etc/hello.py |
CONFIG = {
'mode': 'wsgi',
'working_dir': '/path/to/my/app',
'python': '/usr/bin/python',
'args': (
'--bind=127.0.0.1:8080',
'--workers=16',
'--timeout=60',
'app.module',
),
}
def application(env, start_response):
# url = []
start_response('200 OK', [('Conten... | Python | 0.000448 | @@ -458,27 +458,153 @@
-url = str(
+datastr=str(url)%0A datastr=' '.join(map(str,
url)
+)
%0A
+datastr='%5Cn'.join(map(str, data)).replace(%22'%22, '').replace(%22%5B%22,'').replace(%22%5D%22,'')%0A #
url
|
86263496d5e541876f4b1f10525b4318a4fa6798 | Remove unnecessary code from treeview | frappe/desk/treeview.py | frappe/desk/treeview.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
@frappe.whitelist()
def get_all_nodes(doctype, parent, tree_method, **filters):
'''Recursively gets all data from t... | Python | 0.000002 | @@ -1589,95 +1589,8 @@
s)%0A%0A
-%09if args.doctype == %22Sales Person%22:%0A%09%09doc.employee = frappe.form_dict.get('employee')%0A%0A
%09doc
|
6be8b5a4f5c64ba3548f5130dfaa92ae7ecd5721 | Revert "clean up" | facilities/serializers/facility_serializers.py | facilities/serializers/facility_serializers.py | from rest_framework import serializers
from common.serializers import AbstractFieldsMixin
from ..models import (
OwnerType,
Owner,
JobTitle,
Officer,
OfficerContact,
FacilityStatus,
FacilityType,
RegulatingBody,
RegulationStatus,
Facility,
FacilityRegulationStatus,
Faci... | Python | 0 | @@ -5240,47 +5240,8 @@
eld(
-%0A read_only=True, required=False
)%0A
|
37ad49da3cb06ddb0f589c4bb536602aa7bbd4fe | Deal with issues in sorting None | rnacentral_pipeline/databases/ensembl/metadata/coordinate_systems.py | rnacentral_pipeline/databases/ensembl/metadata/coordinate_systems.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by... | Python | 0.000136 | @@ -1791,16 +1791,133 @@
else:%0A
+ def sort_key(items):%0A if items%5B4%5D is None:%0A return ''%0A return items%5B4%5D%0A%0A
@@ -2064,41 +2064,19 @@
key=
-op.itemgetter(4)) + %5C%0A
+sort_key) +
sor
@@ -2096,24 +2096,16 @@
key=
-op.itemgetter(4)
... |
0c1e2b8261415227bf4c0ffa61e8e1fa62317620 | Update __init__.py | tensorflow_similarity/__init__.py | tensorflow_similarity/__init__.py | """Tensorflow Similarity

TensorFlow Similiarity, as visible in the diagram above, offers the following
components to help research, train, evaluate and serve metric models:
- **`SimilarityModel()`**: This class subclasses the `tf.keras.model` cla... | Python | 0.000072 | @@ -2757,11 +2757,11 @@
'0.13.1
-1
+2
'%0A
|
f1a3aeb97486c1e02906d1e96b758ed58d1bb252 | fix typo in write_cache | pyckle/cache.py | pyckle/cache.py | # caching support for pyckle
#
# ... based on pickle
#
import errno
import imp
import os
import pickle
import tokenize
from py_compile import wr_long
from . import load
MAGIC=b'pyckle\x00\x00'
def cache_path(filename):
if hasattr(imp, "cache_from_source"):
return imp.cache_from_source(filename) + "kle... | Python | 0.000224 | @@ -987,20 +987,16 @@
ath(file
-name
)%0A%0A t
@@ -1483,13 +1483,12 @@
return None%0A
-%0A
|
95d3c1151d84a6b8c4770881e75ebbd7dfe111dd | correct issue with version. | pydf/version.py | pydf/version.py | from distutils.version import StrictVersion
VERSION = StrictVersion('0.3.0')
| Python | 0 | @@ -66,13 +66,14 @@
ion('0.3
+0
.0')%0A
|
e5c328ca00c3008f476f6e2baa3541a01c874dab | Make app executable | pygame_maker.py | pygame_maker.py | #!/usr/bin/python -Wall
# implement a "game maker" app using pygame
import pg_template
class PyGameMaker:
RESOURCE_TYPES=[
"sprites",
"sounds",
"backgrounds",
"paths",
"scripts",
"shaders",
"fonts",
"timelines",
"objects",
"rooms",
... | Python | 0.002507 | |
d216289244ae608fd5eed6f0303bde4a3cfa4d61 | Rename header to raw_header to avoid name clash with header instance variable. | pygit/object.py | pygit/object.py | import zlib
import hashlib
def sort_by_values(d):
"""Sort a dict from its values."""
return sorted(_TYPES_TO_ID.items(), key=lambda x: x[1])
# XXX: do we need to use integers ? The point of integer is to avoid string
# comparison when getting the type, but that may well be premature optimization
# -- most of ... | Python | 0 | @@ -1267,24 +1267,28 @@
otpstr%0A%0Adef
+raw_
header(conte
@@ -2419,16 +2419,20 @@
def
+raw_
header(s
@@ -2452,16 +2452,20 @@
return
+raw_
header(s
@@ -2570,16 +2570,20 @@
%25 (self.
+raw_
header()
|
a0ceb84519d1bf735979b3afdfdb8b17621d308b | Fix overwriting resolution with empty text | froide/problem/admin.py | froide/problem/admin.py | from django.contrib import admin
from django.utils.html import format_html
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from froide.helper.admin_utils import make_nullfilter
from .models import ProblemReport
class ProblemReportAdmin(admin.ModelAdmin):
date_hierarchy = '... | Python | 0.000183 | @@ -1232,16 +1232,43 @@
est.user
+, resolution=obj.resolution
)%0A
|
c759e88518c4447f99b7192618fa3d3d4f03da84 | Abort fwupdate --full if any step fails along the way | cxmanage/commands/fw.py | cxmanage/commands/fw.py | # Copyright (c) 2012, Calxeda Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | Python | 0 | @@ -2152,33 +2152,32 @@
args.priority)%0A
-%0A
if e
@@ -2467,36 +2467,123 @@
ty)%0A
-%0A return bool(errors)
+ if errors:%0A print %22ERROR: Firmware update failed.%22%0A return True%0A%0A return False
%0A%0A
@@ -2797,16 +2797,135 @@
rsions%22)
+%0A ... |
fa5e6ac80a224e7dc76aeb42086317a22bdf1dc7 | Use weighted summary for visualization | ipbes-visualize.py | ipbes-visualize.py | #!/usr/bin/env python3
import io
import re
from bokeh.io import output_file, show, save
from bokeh.layouts import gridplot
from bokeh.models import Range1d, ColumnDataSource, HoverTool, CrosshairTool
from bokeh.palettes import Category20, brewer, viridis
from bokeh.plotting import figure
import click
import joblib
i... | Python | 0 | @@ -2647,16 +2647,78 @@
'2014'%0A
+ weight = 'npp' if indicator == 'BIIAb' else 'vsr'%0A
@@ -2758,16 +2758,24 @@
ndicator
+, weight
)%0A
|
57dc66d43f6b9afe1729b326ac5bd7587c276a85 | add flag to disable cdep website encoding hack | mptracker/scraper/common.py | mptracker/scraper/common.py | from urllib.parse import urlencode, urlparse, parse_qs
from path import path
import requests
from pyquery import PyQuery as pq
project_root = path(__file__).abspath().parent.parent.parent
class Scraper(object):
def __init__(self, session=None):
self.session = session or requests.Session()
def fetc... | Python | 0 | @@ -240,27 +240,49 @@
session=None
+, use_cdep_opener=True
):%0A
-
self
@@ -321,16 +321,63 @@
ession()
+%0A self.use_cdep_opener = use_cdep_opener
%0A%0A de
@@ -592,16 +592,89 @@
e(args)%0A
+ kwargs = %7B'parser': 'html'%7D%0A if self.use_cdep_opener:%0A
@@ -702,16 +7... |
d9926294568c7c21cb91633b93faecf73ed54b0b | Handle 404 error in check_version | APITaxi/__init__.py | APITaxi/__init__.py | # -*- coding: utf-8 -*-
VERSION = (0, 1, 0)
__author__ = 'Vincent Lara'
__contact__ = "vincent.lara@data.gouv.fr"
__homepage__ = "https://github.com/"
__version__ = ".".join(map(str, VERSION))
from flask import Flask, request_started, request, request_finished, g
from flask_bootstrap import Bootstrap
import os
from f... | Python | 0.000001 | @@ -1399,16 +1399,44 @@
%0A if
+request.url_rule is None or
request.
|
65eee46f0c0067faa8315e316970df5ec98a7336 | convert page.get(get_redirect=True) to page.text, | scripts/maintenance/compat2core.py | scripts/maintenance/compat2core.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This is a helper script to convert compat 1.0 scripts to the new core 2.0
framework.
NOTE: Please be aware that this script is not be able to convert your codes
completely. It may support you with some automatic replacements and it gives
some warnings and hints for conver... | Python | 0.000474 | @@ -2719,16 +2719,25 @@
s%0A ('
+(?%3C!site)
%5C.encodi
@@ -2768,24 +2768,107 @@
coding()'),%0A
+ # new core methods%0A ('%5C.get%5Cs*%5C(%5Cs*get_redirect%5Cs*=%5Cs*True%5Cs*%5C)', '.text'),%0A
# stopme
|
7859ddb9b7cec2cab4bf3d155b54315cae2b8f9b | Fix Typo (#627) | cltk/stop/marathi/stops.py | cltk/stop/marathi/stops.py | """This list is composed from 100 most frequently occuring words in mrathi corpus in CLTK.
"""
STOP_LIST =["न",
"तरी",
"तो",
"हें",
"तें",
"कां",
"आणि",
"जें",
"जे",
"मग",
"ते",
"मी",
... | Python | 0 | @@ -61,17 +61,18 @@
ords in
-m
+Ma
rathi co
@@ -1989,8 +1989,9 @@
%22%E0%A4%95%E0%A5%80%E0%A4%B0%22,%5D
+%0A
|
6ce05346f02dfacb858e12793fa1e380d1605dee | Fix local operation parser | gpm/utils/operation.py | gpm/utils/operation.py | from subprocess import Popen, PIPE
import shlex
import re
import os
from gpm.utils.console import puts
from gpm.utils.log import Log
from gpm.settings.status import Status
from gpm.utils.string import decode as str_decode
class LocalOperation(object):
@classmethod
def mkdir(cls, paths, *args, **kwargs):
... | Python | 0.021053 | @@ -2568,75 +2568,28 @@
-process.wait(3000)%0A code = process.poll()%0A print(code
+code = process.poll(
)%0A
|
a913e480e77fbf112c02120d4e53e65201c7da9a | Add licensing to descriptor | graffiti/descriptor.py | graffiti/descriptor.py | from graffiti import util
def schema(v):
if hasattr(v, "_schema"):
return v._schema
if not callable(v):
v = lambda: v
return util.fninfo(v)
def dependencies(g):
deps = {}
for k, v in g.iteritems():
deps[k] = set(v["required"])
return deps
def transitive(deps):
def ... | Python | 0 | @@ -1,29 +1,1188 @@
-from graffiti import util
+#!/usr/bin/env python%0A%0A# Copyright (c) 2014 Michael-Keith Bernard%0A%0A# Permission is hereby granted, free of charge, to any person obtaining a copy of%0A# this software and associated documentation files (the %22Software%22), to deal in%0A# the Software without rest... |
e7de900f1bef572394e670de040a2d86b8d14126 | Add shortcut methods for get_chain_properties() | grapheneapi/aio/api.py | grapheneapi/aio/api.py | # -*- coding: utf-8 -*-
import asyncio
import logging
from grapheneapi.exceptions import NumRetriesReached
from grapheneapi.api import Api as OriginalApi
from .websocket import Websocket
from .http import Http
log = logging.getLogger(__name__)
class Api(OriginalApi):
def __init__(self, *args, **kwargs):
... | Python | 0 | @@ -779,16 +779,188 @@
ons!%22)%0A%0A
+ @property%0A async def chain_params(self):%0A return await self.get_network()%0A%0A async def get_network(self):%0A return await self.get_chain_properties()%0A%0A
asyn
|
9e78b3bd36c0fcc2bded2f2d8fa230b3bd393bd1 | include '_' prefixed keys in `__contains__` | metadatastore/doc.py | metadatastore/doc.py | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import collections
from functools import reduce
_HTML_TEMPLATE = """
<table>
{% for key, value in document | dictsort recursive %}
<tr>
<th> {{ key }} </th>
<td>
{% if value.items %}
... | Python | 0.000008 | @@ -1811,184 +1811,8 @@
))%0A%0A
- def __contains__(self, k):%0A if isinstance(k, six.string_types) and k.startswith('_'):%0A return False%0A return super(Document, self).__contains__(k)%0A%0A
|
3a7882efd30b0f2ff1dad09417444a17c2bd87b7 | add control for room is selected | trunk/editor/roommanager.py | trunk/editor/roommanager.py | #!/usr/bin/env python
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from structdata.room import Room
from structdata.project import g_project
class RoomManager(QWidget):
def __init__(self, selected_room=None, parent=None):
super(RoomManager, self).__init__(parent)
self.selected_room = se... | Python | 0 | @@ -967,54 +967,30 @@
-self.rooms_list.setAlternatingRowColors(True)%0A
+if selected_room:%0A
@@ -1048,32 +1048,36 @@
():%0A
+
+
room_item = QLis
@@ -1104,16 +1104,20 @@
ixmap.%5C%0A
+
@@ -1224,16 +1224,20 @@
+
value.id
@@ -1242,32 +1242,36 @@
id)%0A ... |
fae2daae4dde028bdd8ed8d4c201341818c1ac6f | Remove test print | pyroma/tests.py | pyroma/tests.py | import unittest
import os
from pyroma import projectdata, distributiondata
from pyroma.ratings import rate
from pkg_resources import resource_filename, resource_string
COMPLETE = {'name': 'complete',
'version': '1.0',
'description': 'This is a test package for pyroma.',
'long_descri... | Python | 0.000001 | @@ -3568,45 +3568,8 @@
'):%0A
- print filename, %22OK%22%0A
|
ad8f5e4e0edc44d4ef91f643401b363fa3d508dd | Implement exceptions | bloomsky_api/bloomsky_api.py | bloomsky_api/bloomsky_api.py | import os
import requests
from datetime import datetime
from dateutil import tz
from .exceptions import APIKeyMissing
BLOOMSKY_API_KEY_VARIABLE = 'BLOOMSKY_API_KEY'
DEFAULT_API_URL = 'https://api.bloomsky.com/api/skydata/'
class BloomSkyAPIResponse(object):
field_mapping = [
('ALT', 'altitude'),
... | Python | 0.004057 | @@ -111,16 +111,67 @@
yMissing
+, APIKeyInvalid, BloomSkyConnection, NoDevicesFound
%0A%0ABLOOMS
@@ -4008,16 +4008,34 @@
'intl'%0A
+%0A try:%0A
@@ -4104,32 +4104,36 @@
params)%0A
+
response.raise_f
@@ -4144,16 +4144,337 @@
tatus()%0A
+ except requests.exceptions.Connection... |
43ea286bc1b123a55c85058549c921f383981e97 | Enable username to be email | accounts/models.py | accounts/models.py | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core import validators
from django.core.mail import send_mail
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager, Group
from djan... | Python | 0.999441 | @@ -487,16 +487,17 @@
'%5E%5B%5Cw.+-
+@
%5D+$')%0A
|
ab1131dfab47f6aa7955f4905c0673824bb0c566 | Update supported Python versions [skip ci] | python/setup.py | python/setup.py | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.absp... | Python | 0 | @@ -4744,16 +4744,114 @@
: 3.6',%0A
+ 'Programming Language :: Python :: 3.7',%0A 'Programming Language :: Python :: 3.8',%0A
%5D,%0A%0A
|
412e3c6616a02f0ea61901cc67d22592b8522f53 | Remove inlines for now | bluebottle/segments/admin.py | bluebottle/segments/admin.py | from django.contrib import admin
from django import forms
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django_better_admin_arrayfield.admin.mixins import DynamicArrayMixin
from django.utils.html import format_html
from django_summernote.widgets import SummernoteWidget
fr... | Python | 0 | @@ -375,103 +375,8 @@
ent%0A
-from bluebottle.activities.models import Activity%0Afrom bluebottle.members.models import Member%0A
%0A%0Acl
@@ -723,976 +723,8 @@
%7D%0A%0A%0A
-class SegmentActivityInline(admin.TabularInline):%0A model = Activity.segments.through%0A fields = ('link', )%0A readonly_fields = ('... |
14c11c9a5c34db08cd797a1a13833974d96ac888 | Remove preceedig newlines (unneeded) | coalib/misc/Annotations.py | coalib/misc/Annotations.py |
def typechain(*args):
"""
Returns function which applies the first transformation it can from args
and returns transformed value, or the value itself if it is in args.
>>> function = typechain(int, 'a', ord, None)
>>> function("10")
10
>>> function("b")
98
>>> function("a")
'a... | Python | 0 | @@ -1,10 +1,8 @@
-%0A%0A
def type
|
2844643bd51f567743e1f621f2cbb9cc0147cab7 | Update windowmanager.py | src/Selenium2Library/locators/windowmanager.py | src/Selenium2Library/locators/windowmanager.py | from types import *
from robot import utils
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.common.exceptions import NoSuchWindowException
class WindowManager(object):
def __init__(self):
self._strategies = {
'title': self._select_by_title,
'name': self._sel... | Python | 0.000001 | @@ -3231,21 +3231,10 @@
or(%22
-Unable to get
+No
new
@@ -3241,20 +3241,18 @@
window
-from
+at
last in
@@ -3337,16 +3337,28 @@
%7C $%7Bex%7D'
+ to find it.
%22)%0A
|
39e7857e39562e8cce9d89971fd479b685d3769c | bump package version to 1.1.2 | python/setup.py | python/setup.py | #!/usr/bin/env python
from __future__ import print_function
import os
import shutil
import subprocess
import platform
from distutils.command.build import build
from setuptools.command.build_ext import build_ext
from setuptools import Extension, find_packages, setup
class build_ext_subclass(build_ext):
def finali... | Python | 0.00002 | @@ -3100,17 +3100,17 @@
on='1.1.
-1
+2
',%0A d
|
768bb4d974b1483d5ee9647d800e4bfd578f406a | Fix admin module permissions | shoop/campaigns/admin_module/__init__.py | shoop/campaigns/admin_module/__init__.py | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.utils.translation impor... | Python | 0 | @@ -609,30 +609,14 @@
ort
-(%0A BasketCampaign,
+Basket
Camp
@@ -645,18 +645,16 @@
Coupon%0A
-)%0A
%0A%0Aclass
@@ -2637,50 +2637,8 @@
s())
- %7C get_default_model_permissions(Campaign)
%0A%0A
|
dd2399f057043c4066fda5eabb2199b3cf4ce9b9 | fix imports in test_solver | mybuild/test/test_solver.py | mybuild/test/test_solver.py | import unittest
from unittest import TestCase
from mybuild.dsl.pyfile import module
from mybuild.context import Context
from mybuild.solver import solve
class PdagDtreeTestCase(TestCase):
def test_simple_solution(self):
context = Context()
@module
def conf(self):
self._constr... | Python | 0.000004 | @@ -57,18 +57,21 @@
ild.
-dsl.pyfile
+binding.pydsl
imp
@@ -155,23 +155,21 @@
ve%0A%0A
+%0A
class
-PdagDtree
+Solver
Test
|
1171ade137c54c778a284ef32fdbdcd9e5c1d828 | Add __repr__() and __str__() to Result | runcommands/runners/result.py | runcommands/runners/result.py | from ..util import cached_property
class Result:
def __init__(self, return_code, stdout_data, stderr_data, encoding):
self.return_code = return_code
self.stdout_data = stdout_data
self.stderr_data = stderr_data
self.encoding = encoding
self.succeeded = self.return_code == ... | Python | 0.002361 | @@ -1083,24 +1083,133 @@
return self.succeeded%0A
+%0A def __str__(self):%0A return self.stdout%0A%0A def __repr__(self):%0A return repr(self.stdout)%0A
|
34ad33bfcb67dcb972670ea8453b734851528e44 | fix in reconciliation patch | patches/january_2013/stock_reconciliation_patch.py | patches/january_2013/stock_reconciliation_patch.py | import webnotes
def execute():
webnotes.reload_doc("stock", "doctype", "stock_ledger_entry")
rename_fields()
move_remarks_to_comments()
store_stock_reco_json()
def rename_fields():
args = [["Stock Ledger Entry", "bin_aqat", "qty_after_transaction"],
["Stock Ledger Entry", "fcfs_stack", "stock_queue"]]
for... | Python | 0 | @@ -2256,16 +2256,16 @@
n_json,
-name
+reco
))%0A%09
|
cf44965ab0743e358817255cc4c6714cbb550223 | use asyncio.subprocess in shell cmd | ext/admin.py | ext/admin.py | import traceback
import subprocess
import logging
from discord.ext import commands
from .common import Cog
log = logging.getLogger(__name__)
class Admin(Cog):
@commands.command(hidden=True)
@commands.is_owner()
async def shutdown(self, ctx):
await ctx.send("dude rip")
#await self.bot.s... | Python | 0.000001 | @@ -17,26 +17,23 @@
%0Aimport
-subprocess
+asyncio
%0Aimport
@@ -1803,116 +1803,248 @@
-out = subprocess.check_output(command, shell=True, %5C%0A stderr=subprocess.STDOUT)%0A res = out
+p = await asyncio.create_subprocess_shell(command,%0A stderr=asyncio.subprocess.PIPE%0A ... |
0dbbb0cb70208a8f0cab62b5e96fd867db880899 | Prepare release number for 18.2.0 | mycroft/version/__init__.py | mycroft/version/__init__.py | # Copyright 2017 Mycroft AI 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 writin... | Python | 0.000004 | @@ -767,17 +767,18 @@
MAJOR =
-0
+18
%0ACORE_VE
@@ -791,17 +791,17 @@
MINOR =
-9
+2
%0ACORE_VE
@@ -818,10 +818,10 @@
D =
+-
1
-9
%0A# E
|
7de3c5999001c1acd60df193f3bd0029a40af963 | Declare dependency on Tensorflow>=2.0.0a0. It is already available on PyPI (2.0.0 is not available yet). | python/setup.py | python/setup.py | # Copyright 2019 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, ... | Python | 0.000003 | @@ -627,36 +627,8 @@
ools
-%0Afrom setuptools import dist
%0A%0Awi
@@ -703,44 +703,29 @@
ass
-BinaryDistribution(dist.Distribution
+FakeNonEmptyList(list
):%0A
@@ -791,34 +791,228 @@
els.
-%22%22%22
%0A%0A
-def has_ext_modules
+Trick setuptools into thinking that we have an extension module. We do have%0A ex... |
1c4ee9f8e1117e391dbd559fd3c8f8d69b8a7ac9 | Fix test partial | common/tests/test_excel_renderer.py | common/tests/test_excel_renderer.py | import os
from django.conf import settings
from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase
from .test_views import LoginMixin
from rest_framework.exceptions import ValidationError
from common.models import County
from model_mommy import mommy
from common.renderers import _wri... | Python | 0.000001 | @@ -3329,28 +3329,1113 @@
(os.path.exists(file_path))%0A
+%0A def test_nested_empty_list_in_excel_renderer(self):%0A data = %7B%0A %22results%22: %5B%0A %7B%0A %22key_a%22: %22data%22,%0A %22key_b%22: %22data%22%0A ... |
54a47c67172bfaf0f01168d7ffa5d113fe1291d2 | Make executable | uniname.py | uniname.py | import sys, unicodedata
for ch in sys.argv[1]: print(ascii(ch), unicodedata.name(ch))
| Python | 0.001806 | @@ -1,8 +1,31 @@
+#!/usr/bin/env python3%0A
import s
|
56611198e486bde21e4eff954b8c16f00713d8fc | add spacing around operators | skimage/detection/tests/test_template.py | skimage/detection/tests/test_template.py | import numpy as np
from skimage.detection import match_template
from numpy.random import randn
def test_template():
size = 100
image = np.zeros((400, 400), dtype=np.float32)
target = np.tri(size) + np.tri(size)[::-1]
target = target.astype(np.float32)
target_positions = [(50, 50), (200, 200)]
f... | Python | 0.000003 | @@ -359,17 +359,19 @@
mage%5Bx:x
-+
+ +
size, y:
@@ -371,17 +371,19 @@
ize, y:y
-+
+ +
size%5D =
@@ -417,17 +417,19 @@
00, 400)
-*
+ *
2%0A%0A f
|
7a2088687e274ad779525cdf44a526ee72702b9e | Fix printing for merged trees. | mousestyles/behavior/behavior_tree.py | mousestyles/behavior/behavior_tree.py | from __future__ import print_function, absolute_import, division
from collections import defaultdict
import copy
class BehaviorTree():
"""
Object representing a decomposed tree of behavior. Behaves much like
a dictionary, with an additional representation of the tree structure
of the data.
Param... | Python | 0 | @@ -3020,16 +3020,228 @@
n = %5B%5D%0A%0A
+ if isinstance(self%5Broot%5D, list):%0A formatted_value = %22 %22 .join(%0A %5B%22%7B:.6f%7D%22.format(v) for v in self%5Broot%5D%5D)%0A else:%0A formatted_value = %22%7B:.6f%7D%22.format(self%5Broot%5D)%0A
@@ -329... |
f044a7baec91922ee85de91c0a6fe4d475ea49ae | fix TypeError | planetstack/observer/steps/sync_external_routes.py | planetstack/observer/steps/sync_external_routes.py | import os
import base64
from planetstack.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
class SyncExternalRoutes(OpenStackSyncStep):
# XXX what does this provide?
provides=[]
requested_interval = 86400 # This step is slow like a pig. Let's run it infrequently
def __init_... | Python | 0.000002 | @@ -302,46 +302,8 @@
ly%0A%0A
- def __init__(self):%0A pass%0A%0A
|
1234ea843c7280e4cc9e3d238955531920ba2559 | Remove WIP garbage. | admin/test/test_vagrant.py | admin/test/test_vagrant.py | """
Tests for :module:`admin.vagrant`.
"""
from twisted.trial.unittest import SynchronousTestCase
from twisted.python.filepath import FilePath
from twisted.python.usage import UsageError
from admin.vagrant import (
box_metadata, build_box, BuildOptions)
from flocker import __version__ as flocker_version
class ... | Python | 0 | @@ -231,19 +231,8 @@
ata,
- build_box,
Bui
@@ -346,45 +346,8 @@
):%0A%0A
- def flakey():%0A build_box%0A%0A
|
f5c0fe578f344078d5fbedd6338734d5251048d7 | Return _marshal_json as bytes | minio/post_policy.py | minio/post_policy.py | # -*- coding: utf-8 -*-
# Minio Python Library for Amazon S3 Compatible Cloud Storage, (C) 2015 Minio, 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/licen... | Python | 0.999999 | @@ -2788,16 +2788,26 @@
return
+bytearray(
return_s
@@ -2804,24 +2804,25 @@
y(return_str
+)
%0A%0A def ba
@@ -2865,26 +2865,16 @@
_base64(
-bytearray(
self._ma
@@ -2886,17 +2886,16 @@
_json())
-)
%0A%0A de
|
c33addf039dab34d1fdb1a8c0c16213f5f7c384e | consolidate does who knows what? | extractor.py | extractor.py | from extraction.core import ExtractionRunner
from extraction.runnables import Extractor, RunnableError, Filter
import extraction.utils as utils
import subprocess32 as subprocess
import os
import requests
import re
class GrobidExtractor(Extractor):
def extract(self, data, dep_results):
files = {'input': data}... | Python | 0.000007 | @@ -332,24 +332,8 @@
= %7B
-'consolidate': 1
%7D%0A
|
948c96f56fed61643ffed41a621766e0f37ab5cf | Fix for register.object using name kwarg | coffin/template/library.py | coffin/template/library.py | from django.template import Library as DjangoLibrary, InvalidTemplateLibrary
from jinja2.ext import Extension as Jinja2Extension
from coffin.interop import (
DJANGO, JINJA2,
guess_filter_type, jinja2_filter_to_django, django_filter_to_jinja2)
__all__ = ['Library']
class Library(DjangoLibrary):
"""Versi... | Python | 0 | @@ -3250,33 +3250,8 @@
func
-, jinja2_only=jinja2_only
)%0A
|
8a6c1395870733decdfc7a20bae007cf0eeffeb2 | output path is optional | exxo/exxo.py | exxo/exxo.py | import os
import sys
import argparse
import subprocess
import zipapp
import shutil
import configparser
from pathlib import Path
from .bootstrap import PYTHON_VERSION_MAP
from .venv import ACTIVATE_SCRIPT, PIP_SCRIPT
def create_binary(dst_path, pyrun, zip_file, compress_pyrun):
if compress_pyrun:
pyrun_upx... | Python | 0.999114 | @@ -805,16 +805,113 @@
run_upx%0A
+ basedir = dst_path.parent%0A if basedir:%0A basedir.mkdir(parents=True, exist_ok=True)%0A
with
@@ -4298,16 +4298,97 @@
_path%5D)%0A
+ dst_bin = Path(args.output or (Path(source_path) / 'target' / project_name))%0A
zipa
@@ -4470,27 +4470,15 @@
ary(
-Path(a... |
38f01ab7e63e40f3c2f6abe5747e89e9f3d13330 | Add pallette test code | Source/Scm/Experiment/palette.py | Source/Scm/Experiment/palette.py | import sys
from PyQt5 import QtWidgets
from PyQt5 import QtCore
app = QtWidgets.QApplication(sys.argv)
palette = app.palette()
def colorAsString( brush ):
color = brush.color()
grey = (color.redF() * 0.3) + (color.greenF() * 0.59) + (color.blueF() * 0.11)
return '%.2f,%.2f,%.2f,%.2f %.2f %.2f' % (color.... | Python | 0 | @@ -103,30 +103,124 @@
v)%0A%0A
-palette = app.palette(
+#app.setStyle('fusion')%0A%0Apalette = app.palette()%0A%0Aprint( 'desktopSettingsAware: %25r' %25 (app.desktopSettingsAware(),)
)%0A%0Ad
|
cd255429916f0050caafd1df2918d5c3b5cd612a | add verbose, disable buffers | s64da_benchmark_toolkit/db.py | s64da_benchmark_toolkit/db.py |
import json
import logging
import time
from collections import namedtuple
from enum import Enum
from urllib.parse import urlparse
from .dbconn import DBConn
import psycopg2
LOG = logging.getLogger()
Timing = namedtuple('Timing', ['start', 'stop', 'status'])
class Status(Enum):
OK = 0
TIMEOUT = 1
ERRO... | Python | 0.000001 | @@ -2446,32 +2446,78 @@
analyze': 'on',%0A
+ 'auto_explain.log_verbose': 'on',%0A
'aut
@@ -2538,25 +2538,26 @@
buffers': 'o
-n
+ff
',%0A
|
c1f8706f76a9683c3aceaf6b17d0c0a9774b75ac | Fix json decode | examining.py | examining.py | import json
import logging
import requests
import userinfo
SSL_VERIFY = True
SERVER = 'https://appserver.zhihuishu.com/app-web-service'
AUTO_SUBMIT = True
if __name__ == '__main__':
user = userinfo.USER
logging.basicConfig(format='%(asctime)s %(name)-8s %(levelname)-8s %(message)s', level=logging.DEBUG)
... | Python | 0.999868 | @@ -3283,39 +3283,87 @@
FY)%0A d =
-r.
json
-(
+.loads(r.text.replace('%22%7B', '%7B').replace('%7D%22', '%7D')
)%5B'rt'%5D%0A
|
053402cf60463fa35b75fefd9967ca58f021627c | fix post lsdmap | src/radical/ensemblemd/kernel_plugins/md/post_lsdmap.py | src/radical/ensemblemd/kernel_plugins/md/post_lsdmap.py | #!/usr/bin/env python
"""A kernel that creates a new ASCII file with a given size and name.
"""
__author__ = "Vivek <vivek.balasubramanian@rutgers.edu>"
__copyright__ = "Copyright 2014, http://radical.rutgers.edu"
__license__ = "MIT"
from copy import deepcopy
from radical.ensemblemd.exceptions import ArgumentE... | Python | 0 | @@ -2306,25 +2306,24 @@
load python%22
-%5D
,%0A
@@ -2324,17 +2324,16 @@
-#
%22export
@@ -2401,32 +2401,45 @@
es:$PYTHONPATH%22,
+%0A
%22export PYTHONPA
@@ -2517,16 +2517,29 @@
ONPATH%22,
+%0A
%22export
|
2add283a22a9c54c042c369dbed6ba4ce80de8a4 | Remove obsolete gather_representative parameters. | ueberwachungspaket/views.py | ueberwachungspaket/views.py | from flask import render_template, abort, url_for
import twilio.twiml
from . import app, reps
@app.route("/")
def root():
return render_template("index.html")
@app.route("/abgeordnete/")
def representatives():
return render_template("representatives.html", reps=reps.representatives)
@app.route("/a/<prettynam... | Python | 0 | @@ -1231,20 +1231,16 @@
ntative(
-resp
):%0A r
|
2e61d61ce267fc9e4e2faa1040d072bdde5ea16e | Update setting timestamp | src/amberdriver/drive_support/drive_support.py | src/amberdriver/drive_support/drive_support.py | import logging
import logging.config
import time
import os
from amberclient.common.listener import Listener
from ambercommon.common import runtime
from amberdriver.drive_support import drive_support_logic
from amberdriver.tools import config
__author__ = 'paoolo'
pwd = os.path.dirname(os.path.abspath(__file__))
lo... | Python | 0.000002 | @@ -2070,24 +2070,28 @@
motion_ts =
+int(
time.time()%0A
@@ -2089,16 +2089,26 @@
e.time()
+ * 1000.0)
%0A%0A de
@@ -2610,24 +2610,28 @@
easure_ts =
+int(
time.time()%0A
@@ -2621,32 +2621,42 @@
int(time.time()
+ * 1000.0)
%0A tim
|
f3238755741a1f1297d3a9496e81a3b55410a6f1 | Replace a pint of sed with a pinch of salt | salt/modules/netbsdservice.py | salt/modules/netbsdservice.py | # -*- coding: utf-8 -*-
'''
The service module for NetBSD
'''
# Import python libs
import os
import glob
__func_alias__ = {
'reload_': 'reload'
}
# Define the module's virtual name
__virtualname__ = 'service'
def __virtual__():
'''
Only work on NetBSD
'''
if __grains__['os'] == 'NetBSD' and os.... | Python | 0.999928 | @@ -4406,181 +4406,32 @@
-# NetBSD sed does not support -i flag, call sed by hand%0A cmd = 'cp -f %7B0%7D %7B0%7D.bak && sed -E -e s/%7B1%7D/%7B2%7D/g %7B0%7D.bak %3E %7B0%7D'%0A ret = __salt__%5B'cmd.run'%5D(cmd.format
+__salt__%5B'file.replace'%5D
(rcc
@@ -4453,17 +4453,16 @@
wstatus)
-)
%0A ... |
c1d0c605dc5d0a5f72c7e19198b9eda4b78617e5 | Fix tree commit. | ellen/git/tree.py | ellen/git/tree.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# TODO: refactor this..
import urlparse
from StringIO import StringIO
# NOTICE: this module changed name to `configparser` in python 3.x
from ConfigParser import RawConfigParser
from pygit2 import GIT_OBJ_TAG
from pygit2 import GIT_OBJ_BLOB
from pygit2 import GIT_OBJ_TRE... | Python | 0 | @@ -5064,27 +5064,8 @@
if
-type == 'blob' and
len(
@@ -6302,9 +6302,8 @@
bmodule%0A
-%0A
|
6abcf430d026fec949a08f2059448e357d3491d9 | Increase serialized_project performance | akvo/rest/cache.py | akvo/rest/cache.py | #!/usr/bin/env python3
from akvo.cache import cache_with_key, delete_cache_data
from akvo.rest.serializers import ProjectDirectorySerializer
from akvo.rsr.models.project import Project, project_directory_cache_key
PROJECT_DIRECTORY_CACHE = 'database'
# NOTE: The data doesn't timeout, since we expect the data to be ... | Python | 0 | @@ -686,28 +686,162 @@
'
-primary_location__id
+current_image',%0A 'project_plan_summary',%0A 'primary_location__id',%0A 'primary_location__latitude',%0A 'primary_location__longitude
',%0A
|
46419ca263624c136729b516f549712da377dc9f | Organize corresponding data | guildford_challenge.py | guildford_challenge.py | import os, re
from glob import glob
from urllib.request import urlopen, urlretrieve
from time import time
from zipfile import ZipFile
from itertools import combinations
def update_tsv_export(reporthook=None):
"""If export is missing or not current, download the current one. Returns True iff the export was updated.... | Python | 0.999999 | @@ -161,16 +161,52 @@
inations
+%0Afrom collections import defaultdict
%0A%0Adef up
@@ -1344,16 +1344,20 @@
global
+all_
persons,
@@ -1370,31 +1370,27 @@
_names,
+all_
average
-_ranking
s%0A%0A w
@@ -2081,16 +2081,20 @@
+all_
persons
@@ -2091,27 +2091,27 @@
l_persons =
-dic
+lis
t((id, name,... |
2bccad88152272af36c13973098695efd52a6bdd | Fix incorrect matcher test | spacy/tests/regression/test_issue1450.py | spacy/tests/regression/test_issue1450.py | from __future__ import unicode_literals
import pytest
from ...matcher import Matcher
from ...tokens import Doc
from ...vocab import Vocab
@pytest.mark.parametrize(
'string,start,end',
[
('a', 0, 1),
('a b', 0, 2),
('a c', 0, 1),
('a b c', 0, 2),
('a b b c', 0, 2),
... | Python | 0.998396 | @@ -297,33 +297,33 @@
('a b b c', 0,
-2
+3
),%0A ('a b
@@ -326,25 +326,25 @@
'a b b', 0,
-2
+3
),%0A %5D%0A)%0Ad
@@ -1313,24 +1313,43 @@
== %5B%5D%0A %0A
+ print(matches)%0A
assert m
|
ff8ccdb81616517b42b537daeb6b28bd4004e2ac | Fix lark v0.8.0 backwards incompatibility. | commentjson/commentjson.py | commentjson/commentjson.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Add JavaScript or Python style comments in JSON.
commentjson (Comment JSON) is a Python package that helps you create JSON files
with Python and JavaScript style inline comments. Its API is very similar to
the Python standard library’s json module.
"""
from __future__... | Python | 0 | @@ -1239,16 +1239,42 @@
MENT%0A'''
+, maybe_placeholders=False
)%0A%0Aseria
|
f172df0a255d49a4a0d389089e4a1f7cc16b7a29 | Configure logging of output so that it is tied with the debug flag | exec_proc.py | exec_proc.py | #!/usr/bin/env python
# Copyright 2014 Boundary, 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 o... | Python | 0.000001 | @@ -1083,42 +1083,8 @@
ror%0A
- # Remove Carriage Returns%0A
@@ -1120,16 +1120,16 @@
ommand)%0A
+
@@ -1265,16 +1265,51 @@
icate()%0A
+ if self.debug == True:%0A
@@ -1384,31 +1384,113 @@
-o = replace(o,%22%5Cr%22,%22%22)%0A
+# Remove carriage returns from output%0A ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.