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 |
|---|---|---|---|---|---|---|---|
92ec03ced2160247dd24bcbaacfa149d73df98ce | Refactor the api module | netscalertool/netscalerapi.py | netscalertool/netscalerapi.py | """
Copyright 2014 Tagged Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | Python | 0.000003 | @@ -762,19 +762,20 @@
method,
-url
+path
, payloa
@@ -889,32 +889,82 @@
s.%0A %22%22%22%0A%0A
+ url = %22https://%25s%25s%22 %25 (self.host, path)%0A%0A
headers
@@ -1552,70 +1552,67 @@
-data = json.loads(content)%0A errorcode = 0%0A%0A try:
+if len(content) %3E 0:%0A ... |
001d70a602a5cc7dd43f71c10694bf3cfbfb0e57 | Revert "Mock EC2 metadata: make service persist across reboots" | tools/vagrant/mock-ec2-metadata-service.py | tools/vagrant/mock-ec2-metadata-service.py | #!/usr/bin/env python3
import http.server
import os
import syslog
import subprocess
import random
import re
import sys
import time
import json
import shutil
REGION = 'eu-west-1'
IMAGE_IDS = {
'trusty': 'ami-64b3361d'
}
ACCOUNT_ID = '111111111111'
PRIVATE_NET_IFACE = 'eth1'
class DynamicInstanceIdentity:
def... | Python | 0 | @@ -140,22 +140,8 @@
json
-%0Aimport shutil
%0A%0ARE
@@ -3225,458 +3225,8 @@
)%0A%0A%0A
-def persist():%0A shutil.copy(__file__, '/usr/local/bin/mock-ec2-metadata-service.py')%0A with open('/etc/init/mock-ec2-metadata.conf', 'w') as upstart:%0A upstart.write(str.join(%22%5Cn%22, %5B%0A 'descr... |
6af0cedc4a060d6015f44d90c2f0552957d38a14 | read Niancat Slack config from environment | niancat-slack/niancatslack.py | niancat-slack/niancatslack.py | from slackrest.app import SlackrestApp
from slackrest.command import Visibility, Method
import json
class GetPuzzle:
pattern = '!nian'
url_format = '/puzzle'
visibility = Visibility.Any
body = None
method = Method.GET
class SetPuzzle:
pattern = '!sättnian {nian}'
url_format = '/puzzle'
... | Python | 0 | @@ -93,16 +93,26 @@
rt json%0A
+import os%0A
%0A%0Aclass
@@ -1452,97 +1452,388 @@
)%0A%0A%0A
-if __name__ == %22__main__%22:%0A app = NiancatSlack('http://niancat-chat/v1', '#konsulatet'
+def read_environment_var(name):%0A try:%0A os.environ%5Bname%5D%0A except KeyError:%0A raise OSError(%22M... |
d32dafbe27283e24ea4e6ae9c893740c2530cbc4 | fix typo | config/config.py | config/config.py | from os import environ as env
# dev mode?
DEBUG = env.get('FLASK_ENV', 'development') != 'production'
TEST = env.get('FLASK_ENV') == 'test'
RUN_PERIODIC_TASKS = env.get('RUN_PERIODIC_TASKS') == 'true'
WTF_CSRF_ENABLED = True
SECRET_KEY = env.get('FLASK_SECRET_KEY', "NSTHNSTHaoensutCGSRCGnsthoesucgsrSNTH")
GOOGLE_ANA... | Python | 0.999991 | @@ -1429,16 +1429,17 @@
D_RETRIE
+S
%22, '3'))
|
cd8dd9f6c86892aabcb8b9e5b1bd38409dc8e31c | fix cache | cacao_app/config/production.py | cacao_app/config/production.py | # -*- coding: utf-8 -*-
'''
Production Configurations
- Use djangosecure
- Use Amazon's S3 for storing static files and uploaded media
- Use sendgird to sendemails
- Use MEMCACHIER on Heroku
'''
from configurations import values
# See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
... | Python | 0.000004 | @@ -4065,17 +4065,17 @@
.1:6379/
-1
+2
%22)%0A #
|
393359bbfaf7a49f1944095a8845c865c9d390c5 | improve shortcuts | gdsfactory/klayout/python/kgdsfactory/shortcuts.py | gdsfactory/klayout/python/kgdsfactory/shortcuts.py | """Keybindings inspired by SiEPIC tools.
"""
import pya
def set_shortcuts():
config = pya.Application.instance().get_config("key-bindings")
if config == "":
print("WARNING: get_config(key-bindings) returned null")
mapping = dict()
else:
mapping = dict(item.split(":") for item in c... | Python | 0.000516 | @@ -2724,24 +2724,75 @@
t+Return'%22%0A%0A
+ mapping%5B%22view_menu.show_texts%22%5D = %22'Shift+T'%22%0A%0A
# turn t
|
7c398a0bf41180b799ac8f2d05cd609055f31d3e | Make SSL context code work in Python versions earlier than 2.7.9 | nsone/rest/transport/basic.py | nsone/rest/transport/basic.py | #
# Copyright (c) 2014 NSONE, Inc.
#
# License under The MIT License (MIT). See LICENSE in project root.
#
from __future__ import absolute_import
from nsone.rest.transport.base import TransportBase
from nsone.rest.errors import ResourceException, RateLimitException, \
AuthException
try:
from urllib.request im... | Python | 0.000056 | @@ -541,18 +541,18 @@
import s
+y
s
-l
%0A%0A%0Aclass
@@ -1149,16 +1149,85 @@
data))%0A%0A
+ if sys.version_info %3E= (2, 7, 9):%0A import ssl%0A
@@ -1273,16 +1273,20 @@
+
if not s
@@ -1302,32 +1302,36 @@
fy:%0A
+
+
context.check_ho
@@ -1345,16 +1345,... |
083c555dd73431ce8ff2b2479193807742836c1a | Remove explicit unnecessary variable init | cloudbaseinit/plugins/common/fileexecutils.py | cloudbaseinit/plugins/common/fileexecutils.py | # Copyright 2014 Cloudbase Solutions Srl
#
# 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 l... | Python | 0.999955 | @@ -967,29 +967,8 @@
= 0%0A
- out = err = None%0A
|
78f96421598a561285b9cd5568fd4acabd52585f | Add embed site freeze generator | offenerhaushalt/generators.py | offenerhaushalt/generators.py |
from offenerhaushalt.core import freezer, pages, sites
@freezer.register_generator
def page():
for page in pages:
yield {'path': page.path}
@freezer.register_generator
def site():
for site in sites:
yield {'slug': site.slug} | Python | 0 | @@ -1,9 +1,8 @@
-%0A
from off
@@ -49,16 +49,17 @@
sites%0A%0A
+%0A
@freezer
@@ -86,25 +86,28 @@
def page():%0A
-%09
+
for page in
@@ -109,26 +109,32 @@
e in pages:%0A
-%09%09
+
yield %7B'path
@@ -148,16 +148,17 @@
.path%7D%0A%0A
+%0A
@freezer
@@ -189,17 +189,125 @@
site():%0A
-%09
+ for site ... |
03fb2e830720265f97adff02fac6651ac843be18 | Add doi & pmid to load_csv arguments | oldowan/mtconvert/importer.py | oldowan/mtconvert/importer.py | from oldowan.mtconvert.popset import Sample, Population, PopSet
from oldowan.mtconvert.coverage import Coverage
import csv
# global counter variable for newly-created sample ids
s = 0
def num(x):
if x == '':
return 0
else:
return int(x)
def load_csv(file,
header = 1, ... | Python | 0 | @@ -1462,16 +1462,90 @@
olumns %0A
+ doi = False,%0A pmid = False,%0A
|
5b6ab9ab7ff0a91b43732b89fe65a9adb5af7122 | Comment out everything at the moment to force a decision in word2vec_coherence. | code/python/knub/thesis/word2vec_coherence.py | code/python/knub/thesis/word2vec_coherence.py | import argparse
import codecs
import logging
import os
import sys
from itertools import combinations
from math import factorial
import mkl
from gensim.models.word2vec import Word2Vec
def write_n_most_similar_words_for_each_word(file_name, word2vec, known_words, n):
nr_known_words = len(known_words)
output_ev... | Python | 0 | @@ -4018,24 +4018,26 @@
g_model%0A%0A
+ #
word2vec =
@@ -4105,16 +4105,18 @@
ue)%0A%0A
+ #
calcula
@@ -4223,16 +4223,18 @@
se)%0A%0A
+ #
for i i
@@ -4252,24 +4252,26 @@
10 + 1):%0A
+ #
print %22
@@ -4292,24 +4292,26 @@
+ str(i)%0A
+ #
calcula
|
1836ccc75fde741194f45e6c882915aa9b3a28fd | rename getMemUsage() to getOSMemUsage(); create getTaskMemUsage() | com.vmplacement.manager/VM_Monitor_Utility.py | com.vmplacement.manager/VM_Monitor_Utility.py | #!/usr/bin/python
import time
import subprocess
import pickle
import sys,os
#==============================================================================
# Variables
#==============================================================================
# Some descriptive variables
# This will eventually be passed to the s... | Python | 0.000001 | @@ -1944,16 +1944,24 @@
cpuUsage
+.strip()
%0A%0A%0Adef g
@@ -1962,16 +1962,18 @@
%0Adef get
+OS
MemUsage
@@ -2255,16 +2255,17 @@
+#
memlen =
@@ -2280,32 +2280,33 @@
Usage )%0A
+#
memUsage = memUs
@@ -2344,16 +2344,315 @@
memUsage
+.strip()%0A%0Adef getTaskMemUsage(vmIp):%0A%09cmd = 'ssh -q -o... |
9fda25c0a28f7965c2378dcd4b2106ca034052c3 | Handle missing accounts on HaveIBeenPwned properly. | plumeria/plugins/have_i_been_pwned.py | plumeria/plugins/have_i_been_pwned.py | import plumeria.util.http as http
from plumeria import config
from plumeria.command import commands, CommandError
from plumeria.command.parse import Text
from plumeria.message.mappings import build_mapping
from plumeria.util.collections import SafeStructure
from plumeria.util.ratelimit import rate_limit
@commands.reg... | Python | 0 | @@ -651,24 +651,37 @@
om%0A%0A %22%22%22%0A
+ try:%0A
r = awai
@@ -763,16 +763,20 @@
aders=%5B%0A
+
@@ -852,50 +852,95 @@
)')%0A
+
%5D)%0A
-%0A
-if not len(r.text().strip()):%0A
+except http.BadStatusCodeError as e:%0A if e.http_code == 404:%0A
@@ -998,16 ... |
3f995558f35ec6ce28320c4d1ffda5a4f8507fd6 | Fix broken super call | groundstation/peer_socket.py | groundstation/peer_socket.py | from sockets.socket_closed_exception import SocketClosedException
from sockets.stream_socket import StreamSocket
from groundstation import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class PeerSocket(StreamSocket):
"""Wrapper for a peer who just connected, or one we've con... | Python | 0.000017 | @@ -569,20 +569,16 @@
_init__(
-self
)%0A
|
cc51137aedeee8bdcf6b47e98b195ec750183ab4 | Allow plain values, not just methods | context_variables/__init__.py | context_variables/__init__.py | class context_variable(object):
def __init__(self, func):
self.func = func
self.__doc__ = func.__doc__
def __get__(self, obj, objtype=None):
# Handle case of being called from class instead of an instance
if obj is None:
return self
# Evaluate the property
... | Python | 0.000001 | @@ -280,16 +280,128 @@
rn self%0A
+ # If we got a plain value, return that%0A if not callable(self.func):%0A return self.func%0A
|
11218089bd2739b26e6b22cbb54117e27cba76ac | Fix flake error | channels/apps.py | channels/apps.py | from django.apps import AppConfig
from django.core.exceptions import ImproperlyConfigured
class ChannelsConfig(AppConfig):
name = "channels"
verbose_name = "Channels"
def ready(self):
# Check you're not running 1.10 or above
try:
from django import channels
except Imp... | Python | 0.000004 | @@ -294,16 +294,35 @@
channels
+ # NOQA isort:skip
%0A
|
45c0869e286009306fde3645b3ee6ba07a3a8f2a | Add a multi-line support, first step | powershell_kernel/powershell_proxy.py | powershell_kernel/powershell_proxy.py | import threading
try:
import queue
except ImportError:
import Queue as queue
from threading import Timer
from time import sleep
class ReplReader(threading.Thread):
def __init__(self, repl):
super(ReplReader, self).__init__()
self.repl = repl
self.daemon = True
self.queue = q... | Python | 0.000007 | @@ -1351,24 +1351,25 @@
+ '%5Cn')
+%0A
%0A%0A de
@@ -1356,24 +1356,244 @@
n')%0A
+# for multiline statements we should send 1 extra new line%0A # https://stackoverflow.com/questions/13229066/how-to-end-a-multi-line-command-in-powershell%0A if '%5Cn' in input:%0A self._r... |
ca7bc952727e23b742570aab8bcad3be97ac6739 | fix typo | preprocess/video_persons2extracted.py | preprocess/video_persons2extracted.py | #!/usr/bin/env python
from extract_converter import ExtractConverter
import click
def convert(x):
meta = {
#meta['all'] = [w['item'] for w in x['result']['content']]
'amalia': x['result']['Amalia_Json'])
}
available_data = ['video_persons']
return meta, available_data
@click.command... | Python | 0.999991 | @@ -218,17 +218,16 @@
a_Json'%5D
-)
%0A %7D%0A
|
d814e0a8531e62c305e71e68486eddc3d3f55d0c | Fix typo | contrib/exportOPMLWithTags.py | contrib/exportOPMLWithTags.py | #!/usr/bin/env python3
# this script exports the urls file to OPML, including tags. for that, all feeds must have only one tag
#usage: ./exportOPMLWithTags.py urls > urls.opml
#requeriments (just to get the title from a rss feed if it isn't cached in newsboat):
# pip install feedparser
#input-output example:
#
# $ ... | Python | 0.999999 | @@ -1797,16 +1797,17 @@
t sqlite
+3
.Operati
|
992b999e4511ef1445c14e2147147a595e51a94d | Add -usehd to excluded args in check-doc.py | contrib/devtools/check-doc.py | contrib/devtools/check-doc.py | #!/usr/bin/env python
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
This checks if all command line args are documented.
Return value is 0 to indicate no error.
Author: ... | Python | 0 | @@ -1221,16 +1221,26 @@
mpactdb'
+, '-usehd'
%5D)%0A%0Adef
|
3557e471e158d668b7834cfc1c2e3dae438cb4cd | Add client macs obscure option handling | bat2nodes.py | bat2nodes.py | #!/usr/bin/env python3
import json
import fileinput
import argparse
import os
from batman import batman
from rrd import rrd
from nodedb import NodeDB
from d3mapbuilder import D3MapBuilder
# Force encoding to UTF-8
import locale # Ensures that subsequent open()s
locale.getpreferredenc... | Python | 0 | @@ -786,24 +786,131 @@
nterface')%0A%0A
+parser.add_argument('-o', '--obscure', action='store_true',%0A help='obscure client macs')%0A%0A
parser.add_a
@@ -1539,16 +1539,63 @@
ses)))%0A%0A
+if options%5B'obscure'%5D:%0A db.obscure_clients()%0A%0A
scriptdi
|
8c1492463bf61ed209cbabf60ea87dd7a3350452 | update batch-tmp values | batch-tmp.py | batch-tmp.py | import logging
from config import ACCOUNTING_MAIL_RECIPIENT, LOG_LEVEL, REDIS_URL, TIMEZONE
from datetime import datetime, timedelta
from pytz import timezone
import celery
import redis
from charges import amount_to_charge, charge
from npsp import Opportunity
from util import send_email
zone = timezone(TIMEZONE)
l... | Python | 0.000001 | @@ -1755,16 +1755,21 @@
g batch
+card
job...%22)
@@ -1775,20 +1775,18 @@
)%0A%0A t
-hre
e
+n
_days_ag
@@ -1959,12 +1959,10 @@
in=t
-hre
e
+n
_day
@@ -2179,16 +2179,19 @@
customer
+_id
:%0A
@@ -2337,16 +2337,926 @@
customer
+_id%7D (%7Bopportunity.name%7D)%22%0A )%0A charge(opportunit... |
4fcb825c72bb21edf34f35d652344e9a4ea0aff8 | Add extra comment | opbeat_pyramid/subscribers.py | opbeat_pyramid/subscribers.py | import sys
#
import opbeat
from opbeat.instrumentation import control
from pyramid import events
from pyramid import httpexceptions
CLIENTS = {}
DEFAULT_UNSAFE_SETTINGS_TERMS = 'token,password,passphrase,secret,private,key'
control.instrument()
def opbeat_client_factory(request):
app_id = request.registry.s... | Python | 0 | @@ -2645,32 +2645,92 @@
ls)%0A except:%0A
+ # Exceptions in exception logging should be ignored%0A
pass%0A%0A
|
53a9ef30a8ff343abe5f3805b1f5d5cc2fa32f4d | Fixing the typo | tests/contextfw/orientation/testorientation.py | tests/contextfw/orientation/testorientation.py | #!/usr/bin/env python
##
## Copyright (C) 2009-2010 Nokia Corporation
##
## Contact: Jean-Luc Lamadon <jean-luc.lamadon@nokia.com>
## Matias Muhonen <ext-matias.muhonen@nokia.com>
## Tapio Rantala <ext-tapio.rantala@nokia.com>
## Lihan Guo <lihan.guo@digia.com>
##
## This file is part of Sens... | Python | 0.999999 | @@ -4556,16 +4556,23 @@
0-angle)
+)), 0%5D)
%0A%0A
@@ -4690,32 +4690,25 @@
ng:%22left%22')%0A
-
+%09
self.expectS
|
fe4159bc66c5a728b3d3a8a1ce3e5ca0705b017b | version 1.0.dev | zap/version.py | zap/version.py | # -*- coding: utf-8 -*-
__version__ = '1.0'
__date__ = '2016/01/13'
try:
from ._githash import __githash__, __dev_value__
if '.dev' in __version__:
__version__ += __dev_value__
except Exception:
pass
| Python | 0.000001 | @@ -36,16 +36,20 @@
_ = '1.0
+.dev
'%0A__date
|
02fdfd949af418ebf854feba39fb651c635fde3e | Fix translated pages serializer edge case | molo/core/api/serializers.py | molo/core/api/serializers.py | from collections import OrderedDict
from rest_framework import serializers
from wagtail.api.v2.serializers import PageSerializer
from wagtail.wagtailimages.api.v2.serializers import ImageSerializer
from molo.core.models import TranslatablePageMixinNotRoutable
from molo.core.utils import get_image_hash
class PageCh... | Python | 0 | @@ -1618,16 +1618,182 @@
list.%0A%0A
+ Edge case: a translated version of a page may subsequenly have its%0A language deleted, leaving the page. In this case, the locale field%0A will display None.%0A%0A
Exam
@@ -2741,16 +2741,194 @@
pages:%0A
+ locale = None%0A try:%0A ... |
f41570528173312cbe6ed16bf2a1fb93d8cd5153 | Fix script | packet-dumper/src/main/scripts/rundumperonproc.py | packet-dumper/src/main/scripts/rundumperonproc.py | #!/usr/bin/python
import psutil
import subprocess
import sys, getopt
import re
def main(argv):
kafka_bootstrap_servers = ''
try:
opts, args = getopt.getopt(argv, "h", ["kafka-bootstrap-servers="])
except getopt.GetoptError:
print 'rundumperonproc.py --kafka-bootstrap-servers host:port[,host... | Python | 0.000002 | @@ -345,16 +345,145 @@
exit(2)%0A
+ if len(opts) %3C 1:%0A print 'rundumperonproc.py --kafka-bootstrap-servers host:port%5B,host:port,...%5D'%0A sys.exit(2)%0A
for
|
c6e52e781b0739ab63a3f4c5e49741cd690ddf95 | fix problem with un-escaped backslashes in string | cli/user/src/main/scripts/create-windows-stubs.py | cli/user/src/main/scripts/create-windows-stubs.py | #!/usr/bin/env python
import os
import stat
import glob
import StringIO
input_path='main/python/'
output_path='target/windows/'
stub='''@echo off
python %~dp0..\bin\%~n0 %*
'''
def process_file(file):
output_basename = os.path.basename(file)
output_name = output_basename + ".bat"
output_file = os.path.... | Python | 0.000069 | @@ -129,19 +129,19 @@
'%0A%0Astub=
-'''
+%22%22%22
@echo of
@@ -162,20 +162,22 @@
0..%5C
+%5C
bin%5C
+%5C
%25~n0 %25*%0A
'''%0A
@@ -176,11 +176,11 @@
%25*%0A
-'''
+%22%22%22
%0A%0Ade
|
717ca3e94106ebe00aa8876267d98cddc1c390b5 | fix coveralls | config/local.py | config/local.py | # -*- coding: utf-8 -*-
# secret settings
import os
from mongoengine import connect, register_connection
from sfchat.settings.base import BASE_DIR
DEBUG = True
COMPRESS_ENABLED = False
DEBUG_TOOLBAR_PATCH_SETTINGS = False
# @NOTE: if True then enable 'debug_toolbar.middleware.DebugToolbarMiddleware' also
TEMPLAT... | Python | 0.000001 | @@ -743,33 +743,8 @@
WORD
-,%0A alias='default'
)%0A%0A#
|
0b667ba53351b5a91f88aa6535f49319824a8b0a | send outgoing mail using quoted-printable encoding | outgoing_email.py | outgoing_email.py | # -*- coding: utf-8 -*-
import smtplib
import email
import re
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
class EmailUtils:
email_pattern = re.compile('([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+')
... | Python | 0.000002 | @@ -55,16 +55,42 @@
port re%0A
+from email import charset%0A
from ema
@@ -217,16 +217,74 @@
cation%0A%0A
+charset.add_charset('utf-8',charset.SHORTEST,charset.QP)%0A%0A
class Em
|
8b660c9af350bbba809b2b4323ae3623ea5b3900 | Add a comment about venv check [skip ci] | openquake/baselib/__init__.py | openquake/baselib/__init__.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, o... | Python | 0 | @@ -1400,16 +1400,115 @@
e.cfg')%0A
+# FIXME %60hasattr(sys, 'real_prefix')%60 check can be removed%0A# after the removal of Python 2 support%0A
if (hasa
|
c9eb2d44df7cafde1294123d66445ebef4cfb76d | Disable rgw pollster when aws module not found | ceilometer/objectstore/rgw.py | ceilometer/objectstore/rgw.py | #
# Copyright 2015 Reliance Jio Infocomm Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | Python | 0 | @@ -884,82 +884,8 @@
t _%0A
-from ceilometer.objectstore.rgw_client import RGWAdminClient as rgwclient%0A
from
@@ -3127,30 +3127,125 @@
-rgw_client =
+try:%0A from ceilometer.objectstore.rgw_client import RGWAdminClient%0A
rgw
+_
client
+ = RGWAdminClient
(end
@@ -3281,16 +3281,106 @@
... |
be1d584405b21a45d032b69537a966671e2953d0 | tweak metric names | mint/reports/site_summary.py | mint/reports/site_summary.py | #
# Copyright (c) 2005-2006 rPath, Inc.
# All Rights Reserved
#
import time
from reports import MintReport
from mint import releasetypes
class NewProjectsReport(MintReport):
title = 'Site Summary'
headers = ('Metric', 'Answer')
def getData(self, reportTime = time.time()):
data = []
cu = ... | Python | 0.000002 | @@ -7092,36 +7092,16 @@
ppend(('
-Source commits from
Group Bu
@@ -7105,16 +7105,24 @@
Builder
+ commits
', cu.fe
@@ -7338,29 +7338,9 @@
d(('
-Source commits from c
+C
omma
@@ -7346,16 +7346,24 @@
and line
+ commits
', cu.fe
|
20fd170838a66e2f75ea8dfa60c237c683bdcde4 | Fix bug when overriding transport in query string | ceilometer_riemann/riemann.py | ceilometer_riemann/riemann.py | # -*- encoding: utf-8 -*-
#
# Copyright © 2013 SoftLayer Technologies, an IBM company
#
# Author: Brian Cline <bcline@softlayer.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# h... | Python | 0.000002 | @@ -2688,16 +2688,122 @@
nsport)%0A
+ if not isinstance(self.transport, basestring):%0A self.transport = self.transport.pop()%0A%0A
|
2ebbacc70940f0c176a9f378571e2e904bb02c44 | decrease image in causes serializer | ovp_core/serializers/cause.py | ovp_core/serializers/cause.py | from ovp_core import models
from ovp_core import validators
from rest_framework import serializers
from ovp_uploads.serializers import UploadedImageSerializer
class CauseSerializer(serializers.ModelSerializer):
image = UploadedImageSerializer()
class Meta:
fields = ['id', 'name', 'image']
model = models.Cause
c... | Python | 0.000022 | @@ -95,68 +95,8 @@
zers
-%0Afrom ovp_uploads.serializers import UploadedImageSerializer
%0A%0Acl
@@ -149,43 +149,8 @@
r):%0A
-%09image = UploadedImageSerializer()%0A
%09cla
@@ -186,17 +186,8 @@
ame'
-, 'image'
%5D%0A%09%09
|
34a52883de1a3f49e386ec817115e0e883d9f11c | Be explicit in using UTF-8 | flask_sse.py | flask_sse.py | from sse import Sse as PySse
from redis import StrictRedis
from redis import ConnectionPool as RedisConnectionPool
from flask import json, current_app, Blueprint, request
class ConnectionPool(object):
pool = {}
@classmethod
def key(cls, *args, **kwargs):
return ':'.join(args) + ':'.join('%s=%s' % ... | Python | 0.999542 | @@ -1141,32 +1141,40 @@
yield
-str(
data
+.encode('u8'
)%0A fo
@@ -1419,16 +1419,24 @@
eld
-str(
data
+.encode('u8'
)%0A
|
78ff0b35f3da3b051cfa6a10fd4c39356730d650 | Return forbidden instead of requesting auth. | mint/rest/middleware/auth.py | mint/rest/middleware/auth.py | #
# Copyright (c) 2009 rPath, Inc.
#
# All Rights Reserved
#
import base64
from mod_python import Cookie
from restlib.response import Response
from mint import shimclient
from mint.session import SqlSession
# Decorator for public (unauthenticated) methods/functions
def public(deco):
deco.public = True
retur... | Python | 0 | @@ -4281,32 +4281,73 @@
return
+Response(status=403)%0A #return
Response(status=
@@ -4351,32 +4351,37 @@
us=401,%0A
+ #
headers
|
546d16a0b30ca1738390d2e7a9e9d8e104a49140 | Bump version to 0.3.0 (#706) | cirq/_version.py | cirq/_version.py | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Python | 0 | @@ -717,23 +717,20 @@
__ = %220.
+3.
0.
-2.dev
27%22 # c
@@ -776,15 +776,12 @@
%220.
+3.
0.
-2.dev
35%22%0A
|
7e350d739492ff323f7e304e7da43f8c330d7fca | Revert changes to codecov threshold | tests/integration_tests/build/test_coverage.py | tests/integration_tests/build/test_coverage.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests enforcing code coverage for production code."""
import os
import platform
import re
import shutil
import pytest
from framework import utils
import host_tools.cargo_build as host # pylint: disable... | Python | 0 | @@ -833,17 +833,17 @@
M%22: 82.3
-0
+9
%7D%0Aelse:%0A
@@ -907,10 +907,10 @@
79.
-49
+60
%7D%0A%0AP
|
96db4f0f42058ba9a8917fd4e9a3d8174f91cbd3 | Update licensing info on version file | version_st2.py | version_st2.py |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use t... | Python | 0 | @@ -1,249 +1,55 @@
-%0A
#
-Licensed to the StackStorm, Inc ('StackStorm') under one or more%0A# contributor license agreements. See the NOTICE file distributed with%0A# this work for additional information regarding copyright ownership.%0A# The ASF licenses this file to You
+Copyright 2016 - StackStorm, Inc.%0A#%0A#... |
25b92ff94875afd3ab84e99773c025d8860ff4e9 | Update zero_one_normalization.py | Data_collection_processing/zero_one_normalization.py | Data_collection_processing/zero_one_normalization.py | '''
Linearly scale the expression range of one gene to be between 0 and 1.
If a reference dataset is provided, then the scaling of one gene in the
target dataset in done using the minimun and range of that gene in the
reference dataset.
'''
import sys
import argparse
sys.path.insert(0, 'Data_collection_processing/')
f... | Python | 0.000004 | @@ -1788,32 +1788,33 @@
a_matrix%5Bi, :%5D =
+%5C
%0A (ta
@@ -1948,32 +1948,33 @@
a_matrix%5Bi, :%5D =
+%5C
%0A %5B0
@@ -2066,16 +2066,17 @@
%5Bi, :%5D =
+%5C
%0A
|
9fe566a98d27cdd733e13e55f102134212ff5b17 | Return node instance name in case node name is not defined. This is true for Machine and Orch. | client/src/main/python/slipstream/NodeInstance.py | client/src/main/python/slipstream/NodeInstance.py | """
SlipStream Client
=====
Copyright (C) 2014 SixSq Sarl (sixsq.com)
=====
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required ... | Python | 0 | @@ -4273,32 +4273,51 @@
r.NODE_NAME_KEY)
+ or self.get_name()
%0A%0A def get_ne
|
f09d5c60c7f3f0be8e131326d4ad3352c32dbb3b | fix parsing GDAL version | vfr4ogr/ogr.py | vfr4ogr/ogr.py | import os
import sys
import time
import datetime
from utils import fatal, error, message, warning, download_vfr, last_day_of_month, \
yesterday, remove_option, logger
from vfr import convert_vfr
try:
from osgeo import gdal, ogr
except ImportError, e:
sys.exit('ERROR: Import of ogr from osgeo failed. %s' %... | Python | 0 | @@ -791,11 +791,24 @@
n%5B1%5D
-%5B:2
+.split('.', 1)%5B0
%5D) %3E
|
9653f3d4d3bd859d592542fc011ad7b81a866052 | Make the widget experimental error a real python warning | IPython/html/widgets/__init__.py | IPython/html/widgets/__init__.py | from .widget import Widget, DOMWidget, CallbackDispatcher, register
from .widget_bool import Checkbox, ToggleButton
from .widget_button import Button
from .widget_box import Box, Popup, FlexBox, HBox, VBox
from .widget_float import FloatText, BoundedFloatText, FloatSlider, FloatProgress, FloatRangeSlider
from .widget_... | Python | 0 | @@ -1457,26 +1457,16 @@
rom
-IPython.utils.
warn
+ings
imp
@@ -1538,13 +1538,8 @@
and
-%0A
may
@@ -1549,46 +1549,52 @@
nge
-by
+in
the
-next major release of IPython.%22%22%22
+future.%22%22%22, FutureWarning, stacklevel=2
)%0A
|
a9bf46545502afb9991f7ffd65406797b79d1716 | Correct murano-agent reference to message headers | python-agent/muranoagent/common/messaging/message.py | python-agent/muranoagent/common/messaging/message.py | # Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python | 0.999729 | @@ -925,16 +925,17 @@
e.header
+s
.get('me
|
28129365e9942af5bfbbf91c9ff7625e7caa7c04 | add a normalized_release function | ceph_deploy/hosts/__init__.py | ceph_deploy/hosts/__init__.py | """
We deal (mostly) with remote hosts. To avoid special casing each different
commands (e.g. using `yum` as opposed to `apt`) we can make a one time call to
that remote host and set all the special cases for running commands depending
on the type of distribution/version we are dealing with.
"""
import logging
from cep... | Python | 0 | @@ -2066,32 +2066,93 @@
me(distro_name)%0A
+ module.normalized_release = _normalized_release(release)%0A
module.distr
@@ -3140,8 +3140,1078 @@
distro%0A
+%0A%0Adef _normalized_release(release):%0A %22%22%22%0A A normalizer function to make sense of distro%0A release versions.%0A%0A Returns an obj... |
58b34507553a5956b99b0cb2844a4e274eda9cb4 | Resolve merge conflict in output_filters.py | output_filters.py | output_filters.py | import nltk
from nltk import pos_tag
from nltk.tokenize import wordpunct_tokenize
def filter_length(sentences, wordcount=13):
"""Takes in a list of sentences and returns a reduced list,
that contains only sentences with less than <wordcount> words."""
for sentence in sentences[:]:
if len(sentenc... | Python | 0.000001 | @@ -76,16 +76,134 @@
kenize%0A%0A
+funct_dict = %7B%7D%0A%0A%0Adef add_func_to_dict(func):%0A funct_dict%5Bfunc.__name__%5D = func%0A return func%0A%0A%0A@add_func_to_dict
%0Adef fil
@@ -509,32 +509,50 @@
urn sentences%0A%0A%0A
+@add_func_to_dict%0A
def filter_pos(s
@@ -1041,16 +1041,34 @@
ences%0A%0A%0A
+@a... |
52c01db2efaf3c124695bb182938cf146d02d34c | make tests compaitble with python 2.6 | ceph_deploy/tests/test_cli.py | ceph_deploy/tests/test_cli.py | import pytest
import subprocess
def test_help(tmpdir, cli):
with cli(
args=['ceph-deploy', '--help'],
stdout=subprocess.PIPE,
) as p:
result = p.stdout.read()
assert 'usage: ceph-deploy' in result
assert 'Deploy Ceph' in result
assert 'optional arguments:' i... | Python | 0 | @@ -670,33 +670,33 @@
== 2%0A assert
-%7B
+%5B
p.basename for p
@@ -715,26 +715,23 @@
istdir()
-%7D
+%5D
==
-set()
+%5B%5D
%0A%0A%0Adef t
@@ -1091,9 +1091,9 @@
ert
-%7B
+%5B
p.ba
@@ -1128,15 +1128,12 @@
ir()
-%7D
+%5D
==
-set()
+%5B%5D
%0A
|
1c5e4de1a2ff90ed25d7c58bde61b796f56d4786 | Tidy broadcast models. | models/broadcasted_models.py | models/broadcasted_models.py | import numpy as np
from scipy.interpolate import interp1d
def one_comp_model(wav, model1, gammas):
""" Make 1 component simulations, broadcasting over gamma values.
"""
# Enable single scalar inputs (turn to 1d np.array)
if not hasattr(gammas, "__len__"):
gammas = np.asarray(gammas)[np.newaxis]... | Python | 0 | @@ -52,16 +52,17 @@
terp1d%0A%0A
+%0A
def one_
@@ -319,80 +319,24 @@
is%5D%0A
- # print(len(gammas))%0A%0A m1 = model1%0A # print(model1.shape)%0A
+%0A m1 = model1
%0A
@@ -434,28 +434,8 @@
ift%0A
- print(m1g.shape)
%0A
@@ -1320,32 +1320,8 @@
m2)%0A
- # print(am2.shape)%0A%0A
@@ ... |
a9ea0941445929ae403c49e4883d44574830a011 | apply fix for json parse error | contrib/tools/archive/nntparchive/archiver.py | contrib/tools/archive/nntparchive/archiver.py | #!/usr/bin/env python3.4
import requests
from bs4 import BeautifulSoup as BS
import datetime
import io
import nntplib
import time
import urllib.parse
class Article:
"""
an nntp article
"""
timeFormat = '%a, %d %b %Y %H:%M:%S +0000'
def __init__(self, j, board, site):
"""
constr... | Python | 0 | @@ -3157,16 +3157,37 @@
== 200:%0A
+ try:%0A
@@ -3199,24 +3199,87 @@
= r.json()%0A
+ except:%0A pass%0A else:%0A
@@ -3313,24 +3313,28 @@
+
posts = t%5B'p
@@ -3340,16 +3340,20 @@
posts'%5D%0A
+
@@ -3379,1... |
df78de6a6564f90bad246143f7e2a7bb79d8a45b | Add file conversion module docstring | convert_files.py | convert_files.py | import argparse
import logging
import os
from subprocess import call
from uuid import uuid4
from conversion_calls import get_conversions, get_msxsl_call
from file_checks import append_folder_to_file_name, find_updated_files
from settings import CONVERSIONS, LOGGING_FORMAT
logger = logging.getLogger(__name__)
def a... | Python | 0.000001 | @@ -1,16 +1,171 @@
+%22%22%22%0AConvert metadata using XSL files.%0A%0A%0ALinks%0A-----%0A%0A- https://docs.python.org/3/library/io.html%0A%0A- https://docs.python.org/3/library/subprocess.html%0A%22%22%22%0A%0A
import argparse%0A
|
9b95c126faa93814011b49228d942e0244d546e6 | Use UTF8 encoding | coalib/results/result_actions/OpenEditorAction.py | coalib/results/result_actions/OpenEditorAction.py | import subprocess
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction
EDITOR_ARGS = {
"subl": "--wait",
"gedit": "-s",
"atom": "--wait"
}
GUI_EDITORS = ["kate", "gedit", "subl", "atom"]
class OpenEdit... | Python | 0.000003 | @@ -1364,16 +1364,34 @@
filename
+, encoding='utf-8'
) as fil
|
33bc8b39b1ce307536a63b98629fc2241b0fd29f | add error message when asserting False | tests/twisted/avahi/test-disabled-1-1-tubes.py | tests/twisted/avahi/test-disabled-1-1-tubes.py | """
Test if 1-1 tubes support is properly disabled.
This test should be removed as soon as we re-enable 1-1 tubes support.
"""
from saluttest import exec_test
from avahitest import AvahiAnnouncer, AvahiListener
from avahitest import get_host_name
import avahi
import dbus
import os
import errno
import string
from xmpps... | Python | 0.999828 | @@ -2400,16 +2400,53 @@
rt False
+, %22Should raise NotImplemented error%22
%0A%0Aif __n
|
5ea5d9f97eff6b400b2f867b0b0e36a6ab2b88c5 | Comment the Tumblr part in inspirations/Build-a-photo-booth to make it runnable on our setup | inspirations/Build-a-Photo-Booth/TumblrPhotoBooth.py | inspirations/Build-a-Photo-Booth/TumblrPhotoBooth.py | #import modules
import RPi.GPIO as GPIO
from time import sleep
import os
import picamera
import pytumblr
from fractions import Fraction
#create variables to hold commands
makeVid = "convert -delay 50 image*.jpg animation.gif"
meow3 = "mpg321 sounds/meow3.mp3"
meow2 = "mpg321 sounds/meow2.mp3"
#create variables to ho... | Python | 0 | @@ -82,16 +82,17 @@
icamera%0A
+#
import p
@@ -99,16 +99,16 @@
ytumblr%0A
-
from fra
@@ -454,16 +454,17 @@
er/info%0A
+#
client =
@@ -491,16 +491,18 @@
Client(%0A
+##
'your_
@@ -516,16 +516,18 @@
r_key',%0A
+##
'your_
@@ -544,16 +544,18 @@
ecret',%0A
+##
'your_
@@ -562,16 +562,18 @@
token',%0A
+##
... |
bbd1b14f4620504c062cf769dba4f6e3205796e2 | Return dataframe with raw and adjusted p values | DGEclust/utils/computeGenePosteriorProbabilities.py | DGEclust/utils/computeGenePosteriorProbabilities.py | ## Copyright (C) 2012-2013 Dimitrios V. Vavoulis
## Computational Genomics Group (http://bioinformatics.bris.ac.uk/)
## Department of Computer Science
## University of Bristol
################################################################################
import sys, os
import numpy as np
##########################... | Python | 0 | @@ -284,13 +284,34 @@
mpy
+
as np
+%0Aimport pandas as pd
%0A%0A##
@@ -716,16 +716,238 @@
s += 1%0A%0A
+ ## normalise p and adjust%0A p /= (len(idxs1) * len(idxs2) * nsamples)%0A ii = p.argsort()%0A tmp = p%5Bii%5D.cumsum() / np.arange(1, p.size+1)%0A padj = np.zeros(p.shape)%0... |
85f5f7edb328fe0288c1872569ecae2c6d57872c | fix chainer cannot be imported in Python 3.4 or earlier | chainer/utils/walker_alias.py | chainer/utils/walker_alias.py | import numpy
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import utils
class WalkerAlias(object):
"""Implementation of Walker's alias method.
This method generates a random sample from given probabilities
:math:`p_1, \\dots, p_n` in :math:`O(1)` time.
It ... | Python | 0 | @@ -88,34 +88,8 @@
uda%0A
-from chainer import utils%0A
%0A%0Acl
@@ -3368,16 +3368,24 @@
+chainer.
utils._g
@@ -3527,16 +3527,24 @@
return
+chainer.
utils._g
|
8471fa85be1fb124f16ad03bd410a827876561d6 | Use `encodebytes` instead of `encodestring` (#419) | GeoHealthCheck/plugins/resourceauth/resourceauths.py | GeoHealthCheck/plugins/resourceauth/resourceauths.py | import base64
from GeoHealthCheck.resourceauth import ResourceAuth
class NoAuth(ResourceAuth):
"""
Checks if header exists and has given header value.
See http://docs.python-requests.org/en/master/user/quickstart
"""
NAME = 'None'
DESCRIPTION = 'Default class for no auth'
PARAM_DEFS = {... | Python | 0.000002 | @@ -2443,22 +2443,21 @@
4.encode
-string
+bytes
(%0A
|
8fcb7205dbf36709e27d89734ff33a8cdc9b6968 | Fix docker_events field handling | salt/engines/docker_events.py | salt/engines/docker_events.py | # -*- coding: utf-8 -*-
'''
Send events from Docker events
:Depends: Docker API >= 1.22
'''
# Import Python Libs
from __future__ import absolute_import
import json
import logging
import traceback
import salt.utils
# pylint: disable=import-error
try:
import docker
import docker.utils
HAS_DOCKER_PY = Tr... | Python | 0.999972 | @@ -1812,16 +1812,431 @@
(event)%0A
+ # https://github.com/docker/cli/blob/master/cli/command/system/events.go#L109%0A # https://github.com/docker/engine-api/blob/master/types/events/events.go%0A # Each output includes the event type, actor id, name and action.%0A # status f... |
f8913dce6e08d23682909aa5d0d22338e7667534 | update copyright (#60903) | lib/ansible/modules/storage/netapp/na_ontap_ucadapter.py | lib/ansible/modules/storage/netapp/na_ontap_ucadapter.py | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_... | Python | 0 | @@ -22,16 +22,21 @@
(c) 2018
+-2019
, NetApp
|
6f5d057c92794c8a5fbdd3cca9604bae5788acda | Remove leftover debug printing. | console_exec.py | console_exec.py | # -*- coding: utf-8 -*-
"""
Console Exec
Plugin for Sublime Text 2 to execute a command and redirect its output
into a console window. This is based on the default exec command.
"""
import os
import subprocess
import sublime
import sublime_plugin
try:
from shlex import quote
except ImportError:
from pipes i... | Python | 0 | @@ -1108,79 +1108,8 @@
)%5D%0A%0A
- # debug%0A self.debug_print('reconstructed cmd is', cmd)%0A%0A
@@ -2275,76 +2275,4 @@
ath%0A
-%0A def debug_print (self, *arg):%0A print('Console Exec:', *arg)%0A
|
0a55431d8381d3790f42bd586b81291aa0f8adf1 | Correct invalid example in jenkins_script docs (#46193) | lib/ansible/modules/web_infrastructure/jenkins_script.py | lib/ansible/modules/web_infrastructure/jenkins_script.py | #!/usr/bin/python
# encoding: utf-8
# (c) 2016, James Hogarth <james.hogarth@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | Python | 0 | @@ -2342,12 +2342,16 @@
t%0A
-vars
+set_fact
:%0A
|
37215ba859e393b11187f6a98cb0fd89f4fbbaf4 | Simplify one more tests. | searchengine/tests/evaluation/test_evaluation.py | searchengine/tests/evaluation/test_evaluation.py | import unittest
from unittest import TestCase
from searchengine.evaluation.evaluation import *
from searchengine.search.vectorial_search import vectorial_search
from searchengine.parser import CacmDocument
from searchengine.index.process import Weighting
class TestEvaluation(TestCase):
def test_number_of_relevant... | Python | 0.000001 | @@ -744,20 +744,20 @@
f test_r
-appe
+ecal
l(self):
@@ -789,329 +789,42 @@
t(1,
+
%22tata%22,
+
%5B1,
-2%5D)%0A document1 = CacmDocument(1, %22aujourd %5Cn toto %5Cn tata%22,%22il fait %5Cn tyty%22,%22toto %5Cn tata tyty%22)%0A document2 = CacmDocument(2,%22plouf %5Cn paf%22,%22tata %5Cn toto il ta... |
cdcf6899522f3d768c80684b1f43366513b4a301 | fix version in __init__ | omicexperiment/__init__.py | omicexperiment/__init__.py |
<<<<<<< HEAD
__version__ = '0.01-dev'
=======
__version__ = '0.1.2-dev1'
>>>>>>> 0d1b27e06abfcfcec83d67ebc5842b2954537620
| Python | 0.000001 | @@ -1,124 +1,28 @@
%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A__version__ = '0.01-dev'%0A=======%0A__version__ = '0.1.2-dev1'%0A%3E%3E%3E%3E%3E%3E%3E 0d1b27e06abfcfcec83d67ebc5842b2954537620%0A
+__version__ = '0.1.2-dev1'
%0A
|
f7b8112764a66dbfb394a2584fef354c248de60a | add iphone sim detection macros | needy/platforms/iphonesim.py | needy/platforms/iphonesim.py | from ..platform import Platform
import platform
DEFAULT_MIN_IOS_VERSION = '5.0'
class iPhoneSimulatorPlatform(Platform):
def __init__(self, parameters):
Platform.__init__(self, parameters)
self.__minimum_version = parameters.minimum_ios_version if 'minimum_ios_version' in parameters else DEFAULT... | Python | 0 | @@ -847,32 +847,73 @@
(architecture):%0A
+ if architecture == 'x86_64':%0A
return '
@@ -948,10 +948,150 @@
IMULATOR
-'
+ && __LP64__'%0A elif architecture == 'i386':%0A return 'TARGET_OS_IOS && TARGET_OS_SIMULATOR && !__LP64__'%0A return None
%0A
|
3a3ab4b7410cb9f491b56d785236832b94e6936b | Add tests for Mocking.HistoryItem. | vumi/tests/test_testutils.py | vumi/tests/test_testutils.py | from twisted.trial.unittest import TestCase
from vumi.service import Worker
from vumi.tests.utils import get_stubbed_worker
from vumi.tests.fake_amqp import FakeAMQClient
class ToyWorker(Worker):
def poke(self):
return "poke"
class UtilsTestCase(TestCase):
def test_get_stubbed_worker(self):
... | Python | 0 | @@ -113,24 +113,33 @@
ubbed_worker
+, Mocking
%0Afrom vumi.t
@@ -245,16 +245,470 @@
poke%22%0A%0A%0A
+class MockingHistoryItemTestCase(TestCase):%0A def test_basic_item(self):%0A item = Mocking.HistoryItem((%22a%22, %22b%22), %7B%22c%22: 1%7D)%0A self.assertEqual(item.args, (%22a%22, %22b%22))%0A ... |
73ab7f1164c2ac67dbc496621ffa32400e97711f | Protect a bit better against uninitialized vectors. | test/functionalities/data-formatter/data-formatter-python-synth/StdVectorSynthProvider.py | test/functionalities/data-formatter/data-formatter-python-synth/StdVectorSynthProvider.py | class StdVectorSynthProvider:
def __init__(self, valobj, dict):
self.valobj = valobj;
self.update()
def num_children(self):
start_val = int(self.Mstart.GetValue(),0)
finish_val = int(self.Mfinish.GetValue(),0)
return (finish_val-start_val)/self.data_size
def get_child... | Python | 0.999829 | @@ -23,16 +23,17 @@
ovider:%0A
+%0A
def
@@ -110,24 +110,25 @@
lf.update()%0A
+%0A
def num_
@@ -168,25 +168,24 @@
= int(self.
-M
start.GetVal
@@ -218,25 +218,24 @@
= int(self.
-M
finish.GetVa
@@ -255,52 +255,1147 @@
-return (finish_val-start_val)/self.data_size
+end_val = int(self.end.GetValue(... |
e6e6e6c4cf9be3780f662b0afa3a7fd6c167308b | Allow checking exports even if the exports feature is not set. | opentreemap/exporter/views.py | opentreemap/exporter/views.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.http import Http404
from django.shortcuts import get_object_or_404
from tasks import async_csv_export, async_users_export
from django_tinsel.utils import decorate as do
fr... | Python | 0 | @@ -3300,41 +3300,8 @@
st,%0A
- requires_feature('exports'),%0A
|
210ca4844d37a90da9875b831a8e324c21b61023 | Add missing discount attribute to ShippingMethod | oscar/apps/shipping/models.py | oscar/apps/shipping/models.py | from decimal import Decimal as D
from django.db import models
from django.utils.translation import ugettext_lazy as _
from oscar.apps.shipping import Scales
from oscar.models.fields import AutoSlugField
class ShippingMethod(models.Model):
# Fields from shipping.base.ShippingMethod must be added here manually.
... | Python | 0 | @@ -810,16 +810,41 @@
= False%0A
+ discount = D('0.00')%0A
_bas
|
092150194b5e8194b0e9249c0e3b9fd864b0fa85 | use resnet v2 (#51) | nnvm/tutorials/from_mxnet.py | nnvm/tutorials/from_mxnet.py | """
Compiling MXNet Models with NNVM
================================
**Author**: `Joshua Z. Zhang <https://zhreshold.github.io/>`_
This article is an introductory tutorial to deploy mxnet models with NNVM.
For us to begin with, mxnet module is required to be installed.
A quick solution is
```
pip install mxnet --us... | Python | 0 | @@ -944,17 +944,17 @@
snet18_v
-1
+2
', pretr
@@ -3002,16 +3002,26 @@
m_output
+.asnumpy()
)%0Aprint(
@@ -3722,25 +3722,25 @@
('resnet18_v
-1
+2
', 0, mx_sym
@@ -3776,17 +3776,17 @@
snet18_v
-1
+2
-0000.pa
@@ -3806,17 +3806,17 @@
snet18_v
-1
+2
-symbol.
@@ -4005,17 +4005,17 @@
snet18_v
-1
+2
', 0)%0A#
|
f13c6471320758daa1f988d628c76025fdcedc0a | add "models" module in front of field class name in south field triple | denorm/fields.py | denorm/fields.py | # -*- coding: utf-8 -*-
from django.db import models
# remember all denormalizations.
# this is used to rebuild all denormalized values in the whole DB
alldenorms = []
class Denorm:
"""
Handles the denormalization of one field.
"""
def __init__(self,func):
# ensure self.func is always a list... | Python | 0 | @@ -5842,32 +5842,51 @@
+'.'.join(('models',
DBField.__name__
@@ -5877,32 +5877,34 @@
DBField.__name__
+))
,%0A
|
20d4cf8a4499c9d62b468420bda6a742318cf7ce | Remove "ppapi" from the #include search path for src/trusted/plugin | ppapi/native_client/src/trusted/plugin/plugin.gyp | ppapi/native_client/src/trusted/plugin/plugin.gyp | # -*- python -*-
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'includes': [
'plugin.gypi',
],
'target_defaults': {
'variables': {
'target_base': 'none',
},
'includ... | Python | 0.00001 | @@ -306,61 +306,8 @@
%7D,%0A
- 'include_dirs': %5B%0A '%3C(DEPTH)/ppapi',%0A %5D,%0A
|
f7e74ee51816f53573778f0862bb34570a623334 | add version | program_synthesis/tools/output/streams/s3/base.py | program_synthesis/tools/output/streams/s3/base.py | import time
import boto3
from program_synthesis.tools.output.streams.base import OutputStream
class S3OutputStream(OutputStream):
def __init__(self, name, bucket, prefix, role_name=None):
self._name = name
self._bucket = bucket
self._prefix = prefix
self._role_name = role_name
... | Python | 0.000002 | @@ -127,16 +127,43 @@
tream):%0A
+ __version__ = '0.0.0'%0A%0A
def
|
f1ee5b9b6f5b173895b19fd16b635a570927605d | Use shell=True for windows npm installation of gauge | check_and_install_getgauge.py | check_and_install_getgauge.py | import sys
import json
import pkg_resources
from subprocess import check_output
def get_version():
out = check_output(["gauge", "-v", "--machine-readable"])
data = json.loads(str(out.decode()))
for plugin in data['plugins']:
if plugin['name'] == 'python':
return plugin['version']
r... | Python | 0.000002 | @@ -154,16 +154,27 @@
adable%22%5D
+,shell=True
)%0A da
|
8e275405af5c79f80dbb9870fef1349ad20e619f | Fix missing imports. | server/management/commands/server_maintenance.py | server/management/commands/server_maintenance.py | """Cleans up plugin script submissions and update histories that exceed the retention limit"""
import datetime
import gc
from time import sleep
from django.core.management.base import BaseCommand
from django.conf import settings
from django.db.models import Q
import django.utils.timezone
import server.utils
from se... | Python | 0.000071 | @@ -354,16 +354,50 @@
bmission
+, UpdateHistory, UpdateHistoryItem
%0A%0A%0Aclass
|
c45089b065cfc7c4b9da145de20cd1363f50c904 | Fix failing migration, re #8140 | arches/app/models/migrations/5613_notification_type.py | arches/app/models/migrations/5613_notification_type.py | # Generated by Django 2.2.6 on 2019-12-03 14:15
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("models", "54... | Python | 0 | @@ -2782,14 +2782,8 @@
lds.
-jsonb.
JSON
|
15a0293c45d8b799235b690bd9c4570f388bd4a7 | Fix some abiguities | web-scraper/course_finder.py | web-scraper/course_finder.py | import requests
import http.cookiejar
import time
class CourseFinder:
"""A wrapper for utilizing UofT's Course Finder web service."""
def __init__(self):
self.host = 'http://coursefinder.utoronto.ca'
def search(self, query='', requirements=''):
"""Perform a UofT Course Finder search and ... | Python | 0.999997 | @@ -287,27 +287,8 @@
m a
-UofT Course Finder
sear
@@ -301,16 +301,20 @@
return
+the
data as
|
f8885d1ad7ca487f375a613f8ef26b97fd37697e | Fix broken tests | ci/tsqa/tests/test_chunked.py | ci/tsqa/tests/test_chunked.py | '''
Test chunked request/responses
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, ... | Python | 0.000555 | @@ -7281,32 +7281,101 @@
rmat(self.port)%0A
+ # TODO: better exception catch (seems to be ConnectionError)%0A
with sel
@@ -7393,22 +7393,17 @@
ses(
-socket.timeout
+Exception
):%0A
|
267226978395e30ad9e5e30acb25eb569a67b6b1 | Delete print statements from emailer | ckanext/orgportals/emailer.py | ckanext/orgportals/emailer.py | import logging
import smtplib
from socket import error as socket_error
from email.mime.text import MIMEText
from pylons import config
log = logging.getLogger(__name__)
FROM = config.get('ckanext.orgportals.smtp.mail.from', 'usedata@montroseint.com')
SMTP_SERVER = config.get('ckanext.orgportals.smtp.server', 'localh... | Python | 0.000005 | @@ -699,197 +699,8 @@
o)%0A%0A
- print 'SMTP_SERVER: ', SMTP_SERVER%0A print 'SMTP_USER: ', SMTP_USER%0A print 'SMTP_PASSWORD: ', SMTP_PASSWORD%0A print 'from_: ', from_%0A print 'to: ', to%0A print 'msg: ', msg%0A%0A
|
37a01c66c0b4210c7fc6e36303e9023e30e77659 | Update reply.py changed logger level to info in check_comments() | clashcallerbotreddit/reply.py | clashcallerbotreddit/reply.py | #! python3
# -*- coding: utf-8 -*-
"""Performs cleanup operations.
This module implements functions designed to clean up various data sets:
* Sends and deletes stored messages in the MySQL-compatible database.
* Checks bot's comments and removes comments below a certain threshold.
* TODO: Checks bot's messages for ke... | Python | 0 | @@ -2233,21 +2233,20 @@
logger.
-debug
+info
(f'Skipp
@@ -2372,21 +2372,20 @@
logger.
-debug
+info
(f'Delet
|
80d6c3a5b94a76e81a9f6b21dba2cdffe6e3da6f | add create edit office hour url | web/impact/impact/v1/urls.py | web/impact/impact/v1/urls.py | from django.conf.urls import url
from impact.v1.views import (
AllocateApplicationsView,
AnalyzeJudgingRoundView,
ApplicationDetailView,
ApplicationListView,
CancelOfficeHourReservationView,
CancelOfficeHourSessionView,
CloneCriteriaView,
CreditCodeDetailView,
CreditCodeListView,
... | Python | 0 | @@ -25,16 +25,51 @@
port url
+%0Afrom rest_framework import routers
%0A%0Afrom i
@@ -695,32 +695,55 @@
ceHourListView,%0A
+ OfficeHourViewSet,%0A
Organization
@@ -1134,16 +1134,128 @@
iew,%0A)%0A%0A
+router = routers.SimpleRouter()%0Arouter.register('office_hour', OfficeHourViewSet, OfficeHourViewSet.view_n... |
184a2b7b0fd02e4e392cdf34fb1398ee57fddac6 | remove a couple legacy tests | clastic/tests/test_routing.py | clastic/tests/test_routing.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from nose.tools import raises, eq_, ok_
from werkzeug.test import Client
from werkzeug.wrappers import BaseResponse, Request
from clastic import Application, render_basic
from clastic import GET, POST, PUT, DELETE
from clastic.application import BaseAp... | Python | 0.000001 | @@ -499,78 +499,8 @@
%3E')%0A
- d = rp.match_path('/a/b/1/thing/1/2/3/4/')%0A yield eq_, d, None%0A
@@ -793,70 +793,8 @@
'%5D)%0A
- d = rp.match_path('/a/b/1/thing/')%0A yield eq_, d, None%0A
|
6e909ade6eefa4ab26565df3ea714170218c0265 | update compute_fill_first_cost_fn docstring | nova/scheduler/least_cost.py | nova/scheduler/least_cost.py | # Copyright (c) 2011 OpenStack, LLC.
# 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 requi... | Python | 0.000007 | @@ -2920,18 +2920,18 @@
rvers wi
-ll
+th
less fr
@@ -2959,16 +2959,202 @@
eferred.
+%0A%0A Note: the weight for this function in default configuration%0A is -1.0. With a -1.0 this function runs in reverse, so systems%0A with the most free memory will be preferred.%0A
%22%22%22%0A
|
350030d14ad93b4a2740fc71b84920a5167ea099 | Add Video.info to retrieve information abou specific video | videolog/video.py | videolog/video.py | from datetime import datetime
import json
import os
import logging
import mimetypes
import simplexml
from videolog.core import Videolog, APIError
_logger = logging.getLogger('videolog')
class Video(Videolog):
PUBLIC = "0"
FRIENDS = "1"
PRIVATE = "2"
def search(self, term=None, channel=None, user_id... | Python | 0 | @@ -1538,24 +1538,431 @@
n response%0A%0A
+ def info(self, video_id):%0A content = self._make_request('GET', '/video/%25s.json' %25 video_id)%0A result = json.loads(content)%0A video = result%5B'video'%5D%0A video%5B'criacao'%5D = datetime.strptime(video%5B'criacao'%5D, %22%25Y-%25m-%25d... |
468d964fda4da65f24bc25812987ee0b831ae140 | add include/exclude flags to validate task. Closes #38 | openelex/tasks/validate.py | openelex/tasks/validate.py | import os
import sys
from invoke import task
from .utils import load_module
@task(help={
'state':'Two-letter state-abbreviation, e.g. NY',
})
def list(state):
state_mod = load_module(state, ['validate'])
print "\nAvailable validators:\n"
for name in dir(state_mod.validate):
if name.startswit... | Python | 0.000002 | @@ -13,16 +13,52 @@
port sys
+%0Afrom collections import OrderedDict
%0A%0Afrom i
@@ -106,16 +106,28 @@
d_module
+, split_args
%0A%0A%0A@task
@@ -204,24 +204,83 @@
ist(state):%0A
+ %22%22%22%0A Show available validations for state.%0A%0A %22%22%22%0A
state_mo
@@ -703,23 +703,172 @@
Y',%0A
-%7D)%0Ade... |
db702054797885ef92b6eb3511825a3b597bd6d6 | Document the "".__class__ hack. | jsontraverse/parser.py | jsontraverse/parser.py | from __future__ import unicode_literals
import re
import json
class JsonTraverseParser:
def __init__(self, raw_data, custom_json_impl=None):
if raw_data and not isinstance(raw_data, "".__class__):
raise TypeError("the 'raw_data' argument must be {}, not '{}'".format("".__class__, type(raw_data)... | Python | 0.000063 | @@ -56,16 +56,117 @@
t json%0A%0A
+# This ensures that we use 'str' in Python 3, and 'unicode' in Python 2%0APythonString = %22%22.__class__%0A%0A
class Js
@@ -289,28 +289,28 @@
w_data,
-%22%22.__class__
+PythonString
):%0A
@@ -382,36 +382,36 @@
%7B%7D'%22.format(
-%22%22.__class__
+PythonString
, type(raw_... |
cb4e80a931db0d12791cef4a0ec4b1270e88c19f | correct column styling | corehq/apps/custom_data_fields/edit_entity.py | corehq/apps/custom_data_fields/edit_entity.py | from collections import OrderedDict
from django.urls import reverse
from django.utils.translation import ugettext as _
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Div, HTML, Field
from corehq.apps.style.forms.widgets import Select2MultipleChoice... | Python | 0.000002 | @@ -4407,29 +4407,20 @@
se 'col-
-sm-3 col-md-2
+lg-3
'%0A
@@ -4500,34 +4500,16 @@
se '
-col-sm-9 col-md-8
col-lg-
-6
+9
'%0A%0A
|
1361e18fe95634787e70de5baff60d6a4e6e8aea | fix invalid syntax | oath/google_authenticator.py | oath/google_authenticator.py | '''
Google Authenticator API
------------------------
Google Authenticator is based on HOTP and TOTP. It provides a simple way of
provisionning an OTP generator through a new URL scheme.
This module provides parsing and high-level API over the classic HOTP and TOTP
APIs provided by the oath.hotp and oath.totp modules... | Python | 0.00667 | @@ -376,24 +376,31 @@
ashlib%0A%0A
+from .
import
-.
+_
hotp as
@@ -408,16 +408,23 @@
otp%0A
+from .
import
-.
+_
totp
|
7b03ad236af88b0435a9011cf01ddefbb9a5aaf6 | fix tests | utest/controller/ui/test_treecontroller.py | utest/controller/ui/test_treecontroller.py | # Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Python | 0.000001 | @@ -881,16 +881,70 @@
ctions%0A%0A
+ def register_action(self, action):%0A pass%0A%0A%0A
class Te
@@ -1105,16 +1105,22 @@
cked_ar,
+ None,
None).r
@@ -1413,16 +1413,22 @@
e, None,
+ None,
history
|
84855334bf0a07d8b0d9e9023c980c88a52e2e65 | fix for django<1.6 | allink_frontend_editor/page_extensions/snippets.py | allink_frontend_editor/page_extensions/snippets.py | from __future__ import absolute_import, unicode_literals
from functools import update_wrapper
from django.contrib.admin.util import unquote
from django.http import HttpResponse
from django.shortcuts import render
from feincms import extensions
from ..fields import JSONField
from ..forms import SnippetForm
class E... | Python | 0 | @@ -1630,17 +1630,16 @@
, view)%0A
-%0A
@@ -1683,16 +1683,24 @@
_label,
+getattr(
inner_se
@@ -1713,22 +1713,101 @@
el._meta
-.model
+, 'model_name', inner_self.model._meta.module_name) # django %3C1.6 had this as module
_name%0A%0A
|
75bbeedd249f323e0168cead0ea40bcd16e17ead | Reinstated the FL native progress bar. | Lib/robofab/interface/all/dialogs_fontlab_legacy1.py | Lib/robofab/interface/all/dialogs_fontlab_legacy1.py | """
Dialogs for FontLab < 5.1.
This one should be loaded for various platforms, using dialogKit
http://www.robofab.org/tools/dialogs.html
"""
from FL import *
from dialogKit import ModalDialog, Button, TextBox, EditText
__all__ = [
"AskString",
"AskYesNoCancel",
#"FindGlyph",
"... | Python | 0.999717 | @@ -483,17 +483,16 @@
s%22,%0A
-#
%22Progres
@@ -498,16 +498,16 @@
ssBar%22,%0A
+
%5D%0A%0A%0Adef
@@ -2204,9 +2204,10 @@
iles
-%09
+
(*.*
@@ -3907,16 +3907,17 @@
dError%0A%0A
+%0A
class Pr
@@ -3939,14 +3939,465 @@
t):%0A
- pass
+%0A def __init__(self, title=%22RoboFab...%22, ticks=0, label=%22%22)... |
d34b087048a489e1e3d2a0380028c6aaccfae49f | Remove confusing python-jl --help sentence | julia/python_jl.py | julia/python_jl.py | """
Python interpreter inside a Julia process.
This command line interface mimics a basic subset of Python program so that
Python program involving calls to Julia functions can be run in a *Julia*
process. This avoids the known problem with pre-compilation cache in
Deiban-based distribution such as Ubuntu and Python ... | Python | 0.999979 | @@ -358,165 +358,34 @@
x.%0A%0A
-In Windows and macOS, this CLI is not necessary because those platforms do%0Anot have the pre-compilation issue mentioned above. In fact, this CLI is%0Aknown to
+.. WARNING:: This CLI does
not
@@ -404,22 +404,8 @@
dows
- at the moment
.%0A%0AA
|
54a16964d412f4c7d1c64c482e99122406ed1328 | Test colissimo id lengths, and raise some errors | modules/colissimo/backend.py | modules/colissimo/backend.py | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Florent Fourcot
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | Python | 0 | @@ -790,16 +790,63 @@
, Event%0A
+from weboob.capabilities.base import UserError%0A
from web
@@ -1273,16 +1273,178 @@
, _id):%0A
+ # 13 is the magic length of colissimo tracking ids%0A if len(_id) != 13:%0A raise UserError(u%22Colissimo ID's must have 13 print character%22)%0A
@@ -... |
fa2700a1c6ef8dfb02193fd087a43b1c49730399 | allow all django characters in user profile view | ocl_web/config/users_urls.py | ocl_web/config/users_urls.py | # -*- coding: utf-8 -*-
"""
urls that starts with "users"
"""
from django.conf.urls import patterns, url
from users.views import (UserListView, UserRedirectView, UserDetailView, UserUpdateView)
from apps.sources.views import (SourceDetailView, SourceCreateView, SourceEditView)
from apps.sources.views import (Sourc... | Python | 0 | @@ -4010,32 +4010,37 @@
(?P%3Cusername%3E%5B%5Cw
+@%5C.%5C+
%5C-_%5D+)/$',%0A
@@ -4192,16 +4192,21 @@
name%3E%5B%5Cw
+@%5C.%5C+
%5C-_%5D+)/$
|
8e24fc29e02df68660baee2f2b781771864f0154 | check that label is the same as currently playing | modules/currently_playing.py | modules/currently_playing.py | from flask import jsonify, render_template
import jsonrpclib
import maraschino
from maraschino import app, logger
from maraschino.noneditable import *
from maraschino.tools import *
@app.route('/xhr/currently_playing')
@requires_auth
def xhr_currently_playing():
try:
api_address = server_api_address()
... | Python | 0 | @@ -2644,24 +2644,92 @@
position'%5D:%0A
+ if item%5B'label'%5D == currently_playing%5B'label'%5D:%0A
|
04890b219c34a60c71636bb6509cfd94646b9396 | clean up local files when done with them | bin/get_jobs.py | bin/get_jobs.py | #!/usr/bin/env python
import json
import os
import subprocess
import signal
from sys import argv, exit
import boto
import boto.s3
import boto.sqs
from boto.s3.key import Key
from boto.sqs.message import Message
from extraction_worker.lib.core import timeit, ensure_dirs_exist
from extraction_worker.lib import extra... | Python | 0 | @@ -1340,24 +1340,344 @@
(action))%0A%0A%0A
+# Once the job is done (successful or not), clean up local storage.%0A# Note that this would not be robust to failure of a process if get_jobs.py%0A# were to be handeled by a process manager.%0Adef clean_up(file_names):%0A for file_name in file_names:%0A if os.pat... |
22c31651f0c321be939085d1d1490f31aa50f591 | Altered normalize_people task for performance. | kardboard/tasks.py | kardboard/tasks.py | import datetime
from dateutil import relativedelta
from kardboard.models import Kard, Person
from flask.ext.celery import Celery
from kardboard.app import app
celery = Celery(app)
@celery.task(name="tasks.update_ticket", ignore_result=True)
def update_ticket(card_id):
from kardboard.app import app
threshol... | Python | 0.999563 | @@ -2352,24 +2352,266 @@
get_date)%0A%0A%0A
+def _get_person(name, cache):%0A p = cache.get(name, None)%0A if not p:%0A try:%0A p = Person.objects.get(name=name)%0A except Person.DoesNotExist:%0A p = Person(name=name)%0A cache%5Bname%5D = p%0A return p%0A%0A%0A
@cel... |
1c9882f6c34c120893c71daa07c7f98b1d8a40a0 | version 0.0.6 | kasaya/__init__.py | kasaya/__init__.py | #coding: utf-8
from __future__ import division, absolute_import, print_function, unicode_literals
version = "0.0.5.2"
# kasaya client calls
from kasaya.core.client import sync, async, trans, control
# worker task decorator
from kasaya.core.worker.decorators import *
# worker class
from kasaya.core.worker.worker_daemo... | Python | 0.000002 | @@ -111,11 +111,9 @@
0.0.
-5.2
+6
%22%0A%0A#
|
99b8dac214f489dc3e429b643851c178d9d63ec9 | update urlpatterns to django 1.11 | htmlmin/tests/pico_django.py | htmlmin/tests/pico_django.py | # -*- coding: utf-8 -*-
# Copyright 2013 django-htmlmin authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
'''
File: pico_django.py
Description: Code based on snippet available in the link below.
https://github.com/readevalprint/mini... | Python | 0 | @@ -382,24 +382,19 @@
import
-patterns
+url
%0Afrom dj
@@ -838,16 +838,17 @@
NTENT)%0A%0A
+%0A
urlpatte
@@ -857,44 +857,17 @@
s =
-patterns('',%0A
+%5B%0A url
(r'%5E
@@ -888,35 +888,19 @@
d),%0A
-
+url
(r'%5Eraw$
@@ -912,35 +912,19 @@
w),%0A
- ... |
238e573440c72581a051b16c15f56fcd25bece74 | Deal with sequences with odd characters | rnacentral_pipeline/rnacentral/ftp_export/ensembl.py | rnacentral_pipeline/rnacentral/ftp_export/ensembl.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] 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 | @@ -606,16 +606,26 @@
e.%0A%22%22%22%0A%0A
+import re%0A
import j
@@ -964,16 +964,74 @@
%5D%0A)%0A%0A
+SEQUENCE_PATTERN = re.compile('%5E%5BACGTYRWSKMDVHBNXFI%5D+$')%0A%0A
%0Adef ext
@@ -2106,17 +2106,17 @@
sults =
-%5B
+(
builder(
@@ -2149,16 +2149,97 @@
ler(raw)
+)%0A results = %5Br for r in results if ... |
1401e3e112330664357e4b890c53347369157628 | 処理を簡潔に書き直した. | kenja/committer.py | kenja/committer.py | from __future__ import absolute_import
import os
from copy import deepcopy
from subprocess import check_output
from git.repo import Repo
from git.objects import Blob
from itertools import (chain)
from multiprocessing import (
Pool,
cpu_count
... | Python | 0 | @@ -3616,20 +3616,16 @@
if
-not
isinstan
@@ -3643,54 +3643,12 @@
lob)
-:%0A continue%0A%0A if not
+ and
sel
@@ -3682,29 +3682,8 @@
- continue%0A
@@ -3738,32 +3738,36 @@
th)%0A
+
binsha = self.ad
@@ -3788,16 +3788,20 @@
(entry)%0A
+
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.