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 |
|---|---|---|---|---|---|---|---|
0903a60041c9215d835f35f400e0175c43014636 | Comment on versioning method in nose2._version | nose2/_version.py | nose2/_version.py | """version information"""
# taken from http://stackoverflow.com/a/17626524/1836144
# The following line *must* be the last in the module, exactly as formatted:
__version__ = '0.7.0'
| Python | 0 | @@ -154,16 +154,116 @@
matted:%0A
+# could also use advice from%0A# https://packaging.python.org/guides/single-sourcing-package-version/%0A
__versio
|
e28b703b7cf262dff6d288e6048461201a53d65c | remove json file extension | examples/strategies/marketrecorder.py | examples/strategies/marketrecorder.py | import os
import json
import time
import logging
import zipfile
import boto3
from boto3.s3.transfer import S3Transfer, TransferConfig
from botocore.exceptions import BotoCoreError
from flumine import BaseStrategy
from flumine.utils import create_short_uuid, file_line_count
logger = logging.getLogger(__name__)
class... | Python | 0.000001 | @@ -7151,26 +7151,8 @@
-%22%7B0%7D.json%22.format(
mark
@@ -7163,17 +7163,16 @@
arket_id
-)
,%0A
|
3c62341a30553a231c79cd165c148331dc2f9291 | Remove unused import. | scoreboard/views.py | scoreboard/views.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | Python | 0 | @@ -741,37 +741,8 @@
dels
-%0Afrom scoreboard import utils
%0A%0Aap
|
13f7a5adf60d7e51938dc7efcfc475b9703a4859 | Add a "missing column message" | scorify/datafile.py | scorify/datafile.py | # -*- coding: utf-8 -*-
# Part of the scorify package
# Copyright 2014 Board of Regents of the University of Wisconsin System
"""
Reads data files (or CSV objects) into datafile objects.
Datafiles are iterable and indexable by column name. When reading, you pass
in a scoresheet.LayoutSection, which tells you where da... | Python | 0.986041 | @@ -1766,16 +1766,173 @@
w_data%0A%0A
+ def missing_column_message(self, column):%0A return %22Can't find column %7B0%7D%5CnKnown columns: %7B1%7D%22.format(%0A column, %22, %22.join(self.header))%0A
%0A def
|
96247e0132592325bcada961e02d46ecbed98c8e | Fix check for hosted domain. | oauthenticator.py | oauthenticator.py | """
Custom Authenticator to use Google OAuth with JupyterHub.
Derived from GitHub OAuth authenticator,
https://github.com/jupyter/oauthenticator
"""
import os
import binascii
import json
from tornado import gen
from tornado.auth import GoogleOAuth2Mixin
from tornado.escape import to_unicode
fro... | Python | 0 | @@ -3434,16 +3434,20 @@
name or
+not
username
|
9e31055b38d0eef5363ad0df172d5eb38513d0ed | Insert physnet1 in ml2_flat_allocations | octane/util/db.py | octane/util/db.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Python | 0.000036 | @@ -3921,16 +3921,279 @@
orks);%22%0A
+ insert_physnet1 = %5C%0A %22INSERT INTO ml2_flat_allocations %22 %5C%0A %22SELECT b.* FROM (SELECT 'physnet1') AS b %22 %5C%0A %22WHERE NOT EXISTS (%22 %5C%0A %22SELECT 1 FROM ml2_flat_allocations %22 %5C%0A %22WHERE physical_network = 'phys... |
f654cb58a2a609e3d16a723e9114448c8a17ab62 | clean up script a little | scripts/check_po.py | scripts/check_po.py | #!/usr/bin/env python
import os, os.path
import re
placeholder_pat = re.compile("%\((.+?)\)(\w)")
def extract_placeholders(s):
return set(placeholder_pat.findall(s))
def check_file(fn):
msgid = ''
msgstr = ''
workingon = 'msgid'
mismatches = []
for line in open(fn):
if line.startswith(... | Python | 0.000004 | @@ -45,16 +45,29 @@
ort re%0A%0A
+import sys%0A%0A%0A
placehol
@@ -355,24 +355,53 @@
text = ''%0A
+ line = line.rstrip()%0A
if l
@@ -543,16 +543,44 @@
d msgstr
+ and len(msgstr.strip()) %3E 0
:%0A
@@ -907,28 +907,24 @@
-
msgid = msgs
@@ -1354,17 +1354,133 @@
print%0A%0A%... |
e8dff75f6ac946fbb6fd3afe4877107db7406ae6 | Update CI tests | apps/domain/tests/test_routes/test_requests.py | apps/domain/tests/test_routes/test_requests.py | from json import dumps, loads
import jwt
import pytest
from flask import current_app as app
from src.main.core.database import *
import time
owner_role = ("Owner", True, True, True, True, True, True, True)
user1 = (
"tech@gibberish.com",
"BDEB6E8EE39B6C70835993486C9E65DC",
"]GBF[R>GX[9Cmk@DthFT!mhloUc%[... | Python | 0 | @@ -781,16 +781,74 @@
ack()%0A%0A%0A
+@pytest.mark.skip(reason=%22This test need to be updated!%22)%0A
def test
@@ -4124,16 +4124,80 @@
onse%5D%0A%0A%0A
+@pytest.mark.skip(reason=%22Should be made in integration tests%22)%0A
def test
@@ -5358,24 +5358,88 @@
accepted%22%0A%0A%0A
+@pytest.mark.skip(reason=%22Should ... |
5057763f3e6163723d8c78faaa9ec9b47814ecac | Add returns section | astropy/coordinates/builtin_frames/__init__.py | astropy/coordinates/builtin_frames/__init__.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains the coordinate frames actually implemented by astropy.
Users shouldn't use this module directly, but rather import from the
`astropy.coordinates` module. While it is likely to exist for the long-term,
the... | Python | 0.000001 | @@ -3045,16 +3045,159 @@
rmGraph%60
+%0A%0A Returns%0A -------%0A docstring : str%0A A string that can be added to the end of a docstring to show the%0A transform graph.
%0A %22%22%22
|
4d34632fafe2f0bb8fcd67bb0964315eeb5c4fa9 | Simplify SlackWebhookHook code and change docstring (#4696) | airflow/contrib/hooks/slack_webhook_hook.py | airflow/contrib/hooks/slack_webhook_hook.py | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | Python | 0 | @@ -2733,49 +2733,8 @@
gs)%0A
- self.http_conn_id = http_conn_id%0A
@@ -3232,24 +3232,49 @@
vided token%0A
+ :type token: str%0A
:par
@@ -3276,16 +3276,21 @@
:param
+http_
conn_id:
@@ -3311,16 +3311,48 @@
rovided%0A
+ :type http_conn_id: str%0A
@@ -4532,128 +4532,8 @... |
d6bffed0af8c8a318edff93cf664eff566d0edff | Update twitter_stream.py | streamScript/twitter_stream.py | streamScript/twitter_stream.py | import time
import json
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
from header import consumer_key, consumer_secret, access_token, access_token_secret
from send_data import _build_save_tweet_sql, execute_query
req_tok_url = 'https://api.twitter.com/oauth/req... | Python | 0.000002 | @@ -716,28 +716,18 @@
ord=
-9BBewrkivHctaesd12N7
+%3Cpassword%3E
%22)%0A#
|
08df25b8c8a2a714b2a3210f55e64c78a62018c4 | add an option to the PU data importer to not expect wards | pombola/nigeria/management/commands/nigeria_add_polling_units_to_mapit.py | pombola/nigeria/management/commands/nigeria_add_polling_units_to_mapit.py | #!/usr/bin/env python
import csv
from os.path import dirname, join
import re
from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand
from mapit import models
class Command(BaseCommand):
help = "Add polling unit codes from a CSV file to MapIt areas"
def ha... | Python | 0 | @@ -27,16 +27,49 @@
ort csv%0A
+from optparse import make_option%0A
from os.
@@ -94,16 +94,16 @@
e, join%0A
-
import r
@@ -336,16 +336,230 @@
areas%22%0A%0A
+ option_list = BaseCommand.option_list + (%0A make_option(%0A '--ignore-wards',%0A action='store_true',%0A default... |
48b85421ecb963d33c2d8eae93340e9e1c57c6ff | fix smoke_test_plugins.py: install the .zip under releases, not the .jar | dev-tools/smoke_test_plugins.py | dev-tools/smoke_test_plugins.py | # Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | Python | 0.000001 | @@ -3564,16 +3564,25 @@
/target/
+releases/
elastics
@@ -3609,11 +3609,11 @@
HOT.
-jar
+zip
' %25
|
ef8f5c19ddd590952c14ea80693b886326e443d3 | Change the FILE_RETRIEVAL_ERROR code to 221. | reviewboard/webapi/errors.py | reviewboard/webapi/errors.py | from djblets.webapi.errors import WebAPIError
#
# Standard error messages
#
UNSPECIFIED_DIFF_REVISION = WebAPIError(200, "Diff revision not specified",
http_status=400) # 400 Bad Request)
INVALID_DIFF_REVISION = WebAPIError(201, "Invalid diff revision",
... | Python | 0 | @@ -4508,10 +4508,10 @@
or(2
+2
1
-9
, %22T
|
820139ea7cc49f51dbffcd312b348defa549aaf5 | Fix label_index_map initialization | revscoring/scoring/labels.py | revscoring/scoring/labels.py | from itertools import chain
from .. import errors
class Normalizer:
def check_consistency_and_normalize(self, labels):
self.check_label_consistency(labels)
return [self.normalize(l) for l in labels]
def normalize(self, label):
raise NotImplementedError()
def denormalize(self, n... | Python | 0.000062 | @@ -1522,16 +1522,143 @@
e_labels
+%0A if possible_labels:%0A self.label_index_map = %5C%0A %7Bl: i for i, l in enumerate(possible_labels)%7D
%0A%0A de
@@ -1827,16 +1827,26 @@
ization,
+%0A #
infer f
|
4328bc2fe5c2d4d7c22cf292cd6f977cde44c374 | fix <img> handling | rinoh/frontend/epub/nodes.py | rinoh/frontend/epub/nodes.py | # This file is part of RinohType, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
import re
from ... import styleds
from ...annotation im... | Python | 0 | @@ -1130,24 +1130,56 @@
ed_text(self
+, strip_leading_whitespace=False
):%0A r
|
153d9d4dcb20c3e0946fbf18c24b5ff8dc5d6c74 | Add help messages | imports.py | imports.py | from collections import defaultdict
from pathlib import Path
import sys
import dis
import pip
import re
EXCLUDED_IMPORTS = ['pip', 'setuptools']
def _list_installed_packages():
packages = ["{}".format(i.key) for i in pip.get_installed_distributions()]
return set(packages)
def _list_dependencies(packages_... | Python | 0 | @@ -2402,15 +2402,60 @@
dir%7D
-:
+.
%5Cn')%0A%0A
+ print('%5CtDependencies not being used:')%0A%0A
@@ -2536,32 +2536,33 @@
print(f'%5Ct
+
- %7Bu%7D')%0A
@@ -2674,16 +2674,17 @@
nt(f'%5Ct
+
- %7Bu%7D')%0A
@@ -2710,75 +2710,128 @@
NG:
-Remove listed libraries or your dependencies it's a... |
69ae422eba52004fe2421b85af75d7941c0b8b84 | Make comments a little briefer | sale_customer_specific/models/sale.py | sale_customer_specific/models/sale.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Customer-specific products
# Copyright (C) 2016 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License... | Python | 0.000002 | @@ -1346,199 +1346,53 @@
#
-User changes customer during initial creation of sale order,%0A # having already added some products that can be sold to the original customer but%0A # cannot be sold to the new one
+Get product ids for order lines being created
%0A
@@ -1572,61 +1572,61 @@
duct
-s that... |
2eb4744ccc0f68ee76b1150c7696b036bbd16441 | Update mongo_future_return.py | salt/returners/mongo_future_return.py | salt/returners/mongo_future_return.py | # -*- coding: utf-8 -*-
'''
Return data to a mongodb server
Required python modules: pymongo
This returner will send data from the minions to a MongoDB server. To
configure the settings for your MongoDB server, add the following lines
to the minion config files:
.. code-block:: yaml
mongo.db: <database name>
... | Python | 0 | @@ -1806,24 +1806,71 @@
ngo.version%0A
+ version = '.'.join(version.split('.')%5B:2%5D)%0A
HAS_PYMO
|
1433af5561db083709d73fbf0734df73b10813ea | fix to commit (r586) | scrapy/trunk/scrapy/spider/manager.py | scrapy/trunk/scrapy/spider/manager.py | """
SpiderManager is the class which locates and manages all website-specific
spiders
"""
import sys
import os
import urlparse
from twisted.plugin import getCache
from scrapy.spider.models import ISpider
from scrapy import log
from scrapy.conf import settings
from scrapy.utils.url import url_is_from_spider
from scrap... | Python | 0 | @@ -2846,16 +2846,20 @@
_spiders
+_set
= self.
@@ -3322,16 +3322,20 @@
_spiders
+_set
:%0A
|
99e70405b226463f5c675fd88670b35aa6eac7aa | Should be "is not" | rx/linq/observable/sample.py | rx/linq/observable/sample.py | from rx.observable import Observable
from rx.anonymousobservable import AnonymousObservable
from rx.disposables import CompositeDisposable
from rx.concurrency import timeout_scheduler
from rx.internal import extensionmethod
def sample_observable(source, sampler):
def subscribe(observer):
at_end = [None]
... | Python | 0.999874 | @@ -1740,12 +1740,8 @@
if
-not
inte
@@ -1748,16 +1748,20 @@
rval is
+not
None:%0A
@@ -1894,9 +1894,8 @@
ampler)%0A
-%0A
|
76f61245e4b3e6bbcac624fe436d1655384660a8 | remove .cur as image type | ursa2/proxy.py | ursa2/proxy.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
'''
proxy.py
changelog
2013-12-11[17:23:52]:created
@info yinyong,osx-x64,Undefined,10.129.164.77,py,/Volumes/yinyong/ursa2/src
@author yanni4night@gmail.com
@version 0.0.1
@since 0.0.1
'''
import requests as R
from urlparse import urlparse
#import mimetypes
import ... | Python | 0.000001 | @@ -577,218 +577,46 @@
-#mime = mimetypes.guess_type(parsed_url.path,False)%0A #content_type = mime%5B0%5D or 'text/plain'%0A if utils.isBinary(parsed_url.path):#re.match( utils.BINARY_CONTENT_TYPE_KEYWORDS , content_type,re.IGNORECASE
+%0A if utils.isBinary(parsed_url.path
):%0A
|
2d613ce7b1c1d6f910c362887123a5e81e1e9cff | Add maint to the flo packge imports | salt/daemons/flo/__init__.py | salt/daemons/flo/__init__.py | # -*- coding: utf-8 -*-
'''
Package for ioflo and raet based daemons and associated ioflo behaviors
To use set
opts['transport'] ='raet'
master minion config
transport: raet
See salt.config.py for relevant defaults
opts['raet_port']
opts['master_floscript']
opts['minion_floscript']
opts['ioflo_period']
opts['ioflo_r... | Python | 0 | @@ -435,16 +435,25 @@
'worker'
+, 'maint'
%5D%0A%0A# Imp
|
dce885abf44f3a747c32f5a1a8528c67e0ed8f65 | Update namecheap_ns.py | salt/modules/namecheap_ns.py | salt/modules/namecheap_ns.py | # -*- coding: utf-8 -*-
"""
Namecheap management
General Notes
-------------
Use this module to manage nameservers through the namecheap
api. The Namecheap settings will be set in grains.
Installation Prerequisites
--------------------------
- This module uses the following python libraries to communicate ... | Python | 0.000005 | @@ -981,16 +981,18 @@
se%0A%0A%22%22%22%0A
+%0A%0A
CAN_USE_
@@ -1008,16 +1008,18 @@
= True%0A
+%0A%0A
try:%0A
@@ -1098,16 +1098,17 @@
False%0A%0A
+%0A
__virtua
@@ -1141,16 +1141,17 @@
ns_ns'%0A%0A
+%0A
def __vi
|
3fe775b6e9a3a96a0c2b71334867a4f4f34b8095 | modify first_boot to account for new massive swap on tmp partitions. | salvus/scripts/first_boot.py | salvus/scripts/first_boot.py | #!/usr/bin/env python
# This script is run by /etc/rc.local when booting up. It does special configuration
# depending on what images are mounted, etc.
import os
if os.path.exists('/mnt/home/'):
# Compute machine
if not os.path.exists('/mnt/home/aquota.group'):
os.system("quotacheck -cug /mnt/home")... | Python | 0 | @@ -157,16 +157,292 @@
mport os
+, socket%0A%0A# If hostname isn't %22salvus-base%22, then setup /tmp and swap.%0A%0Aif socket.gethostname() != %22salvus-base%22:%0A # Enable swap%0A os.system(%22swapon /dev/salvus-base/swap%22)%0A # Mount tmp%0A os.system(%22mount /dev/salvus-base/tmp /tmp; chmod +t /tmp;... |
90480fff4e2ad72efec8f2c97f01b3793b8dde42 | Fix pylint warnings | script/upload-windows-pdb.py | script/upload-windows-pdb.py | #!/usr/bin/env python
import os
import glob
from lib.util import execute, rm_rf, safe_mkdir, s3put, s3_config
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SYMBOLS_DIR = 'dist\\symbols'
PDB_LIST = [
'out\\Release\\atom.exe.pdb',
'vendor\\brightray\\vendor\\download\\libchromiumconten... | Python | 0.000016 | @@ -215,54 +215,22 @@
ls'%0A
-PDB_LIST = %5B%0A 'out%5C%5CRelease%5C%5Catom.exe.pdb',%0A
+DOWNLOAD_DIR =
've
@@ -282,16 +282,81 @@
mcontent
+'%0APDB_LIST = %5B%0A 'out%5C%5CRelease%5C%5Catom.exe.pdb',%0A DOWNLOAD_DIR + '
%5C%5CReleas
@@ -986,16 +986,24 @@
ymbols',
+%0A
files)%0A
|
0968180fdbb91708115fcbc3187eef93943a912d | Fix crasher | astrobin_apps_platesolving/templatetags/astrobin_apps_platesolving_tags.py | astrobin_apps_platesolving/templatetags/astrobin_apps_platesolving_tags.py | # Django
from django.contrib.contenttypes.models import ContentType
from django.template import Library, Node
# This app
from astrobin_apps_platesolving.solver import Solver
register = Library()
@register.inclusion_tag(
'astrobin_apps_platesolving/inclusion_tags/platesolving_machinery.html',
takes_context ... | Python | 0.000002 | @@ -634,16 +634,42 @@
n.status
+ if target.solution else 0
,%0A %7D%0A
|
a2de3371b63654ea205af35314c46b5eb48921a9 | update rules_proto digest to 5c8e443 (#1235) | repositories.bzl | repositories.bzl | load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def gapic_generator_typescript_repositories():
maybe(
http_archive,
name = "build_bazel_rules_nodejs",
sha256 = "c911b5bd8aee8b0498cc387cacdb5f917098ce477fb4182db07b0ef8a9e0... | Python | 0 | @@ -512,148 +512,148 @@
= %220
-8af5f34b61c12feae75e6d8b54e961953d057da462620cf629d67ddbe4ef06e%22,%0A strip_prefix = %22rules_proto-066581b14bcbf87206c89ff5fcdd6f9915fd30fb
+e97e44782814000c3942645174d5b081dacfa3e70d51886a0c21f7a47992e89%22,%0A strip_prefix = %22rules_proto-5c8e443b53d02012375585cabb85fd940... |
3ef9d52d653c6601589e2beecb59c2a447141130 | Remove r_name | matchmaker/engine.py | matchmaker/engine.py | #!/usr/bin/env python
import sys
import random
from math import log
from collections import defaultdict
from pprint import pprint
class Engine:
def __init__(self, database):
"""Constructor
"""
self.database = database
self.recommended = defaultdict(list)
self.process()
... | Python | 0.001059 | @@ -1804,214 +1804,8 @@
))%0A%0A
- # find others by name%0A if r in r_info:%0A name = r_info%5Br%5D%5B1%5D%0A for r1 in r_name%5Bname%5D:%0A scores%5Br1%5D += 1 / log(2 + len(u_watching%5Br1%5D))%0A%0A
|
407784fd00cdab3b9c09e56f89406955110438a9 | solve the dependency in datasets and embedding | matchzoo/__init__.py | matchzoo/__init__.py | from pathlib import Path
USER_DIR = Path.expanduser(Path('~')).joinpath('.matchzoo')
if not USER_DIR.exists():
USER_DIR.mkdir()
USER_DATA_DIR = USER_DIR.joinpath('datasets')
if not USER_DATA_DIR.exists():
USER_DATA_DIR.mkdir()
from .logger import logger
from .version import __version__
from . import processo... | Python | 0.000009 | @@ -773,24 +773,25 @@
import
-datasets
+embedding
%0Afrom .
@@ -797,25 +797,24 @@
import
-embedding
+datasets
%0A%0Afrom .
|
7533811d069cdf8449a0522666d43fcfe02e3594 | fix test | socorro/unittest/cron/jobs/test_fetch_adi_from_hive.py | socorro/unittest/cron/jobs/test_fetch_adi_from_hive.py | # -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
from mock import patch
from nose.plugins.attrib import attr
from nose.tools impo... | Python | 0.000002 | @@ -1358,16 +1358,17 @@
Much', '
+%7B
webapprt
@@ -1379,16 +1379,17 @@
illa.org
+%7D
'%0A
|
0a734a1a937f485b37ddb34b2d755bb3f1a634ab | version 0.11.1 | pyDatalog/version.py | pyDatalog/version.py | __version__ = "0.11" | Python | 0.000001 | @@ -12,9 +12,11 @@
= %220.11
+.1
%22
|
c9746393cd784c4b61d7d3cf3bb69888c3b8427e | fix pybb/subscription.py | pybb/subscription.py | pybb/subscription.py | from django.core.mail import EmailMultiAlternatives
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django.utils import translation
from pybb import settings as pybb_settings
from pybb.util import absolute_url
# i18n features disabl... | Python | 0.000002 | @@ -2526,100 +2526,9 @@
ang%0A
- try:%0A mb = MessageBox.objects.get(message=pm, user=pm.dst_user, read=False)%0A%0A
+%0A
@@ -2571,28 +2571,24 @@
r you')%0A
-
-
to_email = p
@@ -2600,28 +2600,24 @@
_user.email%0A
-
text_con
@@ -2649,16 +2649,18 @@
TEMPLATE
+()
%25 %7B%0A
@... |
84ad932d4f7536dce6618de8a034880da389a3c0 | Add missing docstring | pa1/inversions.py | pa1/inversions.py | #!/usr/bin/env python3
"""
"""
import argparse
def read_file(filename):
with open(filename) as f:
return [int(line) for line in f]
def _merge_sort(A, B, begin, end):
if end - begin < 2:
return
middle = begin + (end - begin)//2
_merge_sort(A, B, begin, middle)
_merge_sort(A, B, mi... | Python | 0.005217 | @@ -21,16 +21,125 @@
n3%0A%0A%22%22%22%0A
+Implementation of the Merge Sort algorithm in order to%0Acount the number of inversions in a list of integers.%0A
%22%22%22%0A%0Aimp
@@ -1014,18 +1014,66 @@
me',
- type=str,
+%0A type=str,%0A
hel
@@ -1256,8 +1256,9 @@
ersions... |
9d39802ab6db8d4d65688aff7ed6af01ceb0cb07 | Make pydocstyle happy | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Hardy Jones
# Copyright (c) 2013
#
# License: MIT
#
"""This module exports the Hlint plugin class."""
from SublimeLinter.lint import Linter
class Hlint(Linter):
"""Provides an interface to hlint."""
synt... | Python | 0.000007 | @@ -261,17 +261,16 @@
inter):%0A
-%0A
%22%22%22P
|
aaaaa6858485962f1cfd52357b2d5f3964a368ad | Refactor tests with setUp | falcom/decorators/test_try_forever.py | falcom/decorators/test_try_forever.py | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest import *
import unittest
from ..test.hamcrest import ComposedMatcher, evaluates_to, a_method
from .try_forever import try_forev... | Python | 0 | @@ -979,16 +979,28 @@
%0A%0Aclass
+GivenDefault
TryForev
@@ -1005,17 +1005,17 @@
ever
-ClassTest
+Decorator
(un
@@ -1025,32 +1025,93 @@
est.TestCase):%0A%0A
+ def setUp (self):%0A self.decorator = TryForever()%0A%0A
def test_try
@@ -1154,50 +1154,34 @@
-obj = TryForever()%0A assert_th... |
f86f0ce876c40e28480baf1da1f51c5f7cc5c74d | apply sorting before serialization of mscale collection | mds_website/views.py | mds_website/views.py | from django.views.generic.base import TemplateView
from apps.muni_scales.api import MscaleResource
from apps.auth.api import UserResource
class HomeView(TemplateView):
template_name = "index.html"
def get_context_data(self, **kwargs):
context = super(HomeView, self).get_context_data(**kwargs)
... | Python | 0 | @@ -671,23 +671,22 @@
-queryse
+obj_ls
t = res.
@@ -714,16 +714,61 @@
bundle)%0A
+ obj_lst = res.apply_sorting(obj_lst)%0A
%0A
@@ -809,15 +809,14 @@
in
-queryse
+obj_ls
t:%0A
|
c6e392b724853c59684ec317da7063486a209c94 | Change 'tempfile_suffix' and remove filename check. | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Bruno JJE
# Copyright (c) 2015 Bruno JJE
#
# License: MIT
#
"""This module exports the Xvhdl plugin class."""
from SublimeLinter.lint import Linter
class Xvhdl(Linter):
"""Provides an interface to xvhdl (from... | Python | 0 | @@ -543,17 +543,19 @@
ffix = '
--
+vhd
'%0A%0A #
@@ -1135,190 +1135,8 @@
h)%0A%0A
- # Not sure the filename check is required, but we do it%0A # anyway just in case...%0A if match and match.group('path') != self.filename:%0A match = None%0A%0A
|
565af2f6fdc9fbdd28bcb2edfac29ddbdcd043a8 | fix #190 lower case vue component | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by roadhump
# Copyright (c) 2014 roadhump
#
# License: MIT
#
"""This module exports the ESLint plugin class."""
import sublime
import os
import re
from SublimeLinter.lint import NodeLinter
class ESLint(NodeLinter):
... | Python | 0.00009 | @@ -507,13 +507,13 @@
', '
-Vue C
+vue c
ompo
|
953a90243b35641829775f5e263cabcd0dfa9b2d | add SDSS-II names to sentinel ignore list. | scripts/sentinel.py | scripts/sentinel.py | #!/usr/local/bin/python3.5
import gzip
import json
import os
from collections import OrderedDict
import ads
from astrocats.catalog.utils import tprint, tq
from astrocats.supernovae.scripts.repos import repo_file_list
sentinel = OrderedDict()
outdir = 'astrocats/supernovae/output/'
path = 'astrocats/supernovae/out... | Python | 0 | @@ -2299,16 +2299,29 @@
ases = %5B
+%0A
x%5B'value
@@ -2346,23 +2346,16 @@
alias'%5D%0A
-
@@ -2409,27 +2409,31 @@
', 'SNR'
-%5D%5D)%0A
+, 'SDSS-II'%5D%5D)%0A
|
f72dd1264e18249359f8d273ab5bfe08e5292795 | indent on the internal help message | click_repl/__init__.py | click_repl/__init__.py | from collections import defaultdict
from prompt_toolkit.completion import Completer, Completion
from prompt_toolkit.history import InMemoryHistory
from prompt_toolkit.shortcuts import prompt
import click
import click._bashcomplete
import click.parser
import os
import shlex
import sys
import six
from .exceptions import... | Python | 0.000001 | @@ -1234,24 +1234,47 @@
repl help')%0A
+ formatter.indent()%0A
with for
|
fe81118aa0443d75be0e3ddcab5165b294b55aa1 | Create table-summary.txt | scripts/upstream.py | scripts/upstream.py | #!/usr/bin/env python
import sys
import json
import logging
from glob import glob
from os.path import join
from qcli import qcli_system_call
from biom import load_table
from skbio.util import create_dir
from qiime.util import guess_even_sampling_depth
def system_call(cmd, shell=True):
"""Simple wrapper around ... | Python | 0.000001 | @@ -1924,1107 +1924,195 @@
i
-f spreadsheet_key:%0A mapping_fp = join(base, 'mapping-file.txt')%0A cmd = (%22load_remote_mapping_file.py %22%0A %22-k %7Bspreadsheet_key%7D -o %7Bmapping_fp%7D%22)%0A params = %7B'spreadsheet_key': spreadsheet_key, 'mapping_fp': mapping_fp%7D%0A%0A ... |
b0abdac90c7e6aef444368781bcc3df24f69cab0 | Use regex grouping to extract the version | scripts/versions.py | scripts/versions.py | import operator
import re
from collections import namedtuple
import requests
base_url = 'https://download.docker.com/linux/static/{0}/x86_64/'
categories = [
'edge',
'stable',
'test'
]
STAGES = ['tp', 'beta', 'rc']
class Version(namedtuple('_Version', 'major minor patch stage edition')):
@classmet... | Python | 0.999359 | @@ -1826,29 +1826,16 @@
ions = %5B
-%0A
Version.
@@ -1844,101 +1844,9 @@
rse(
-%0A v.strip('%22').lstrip('docker-').rstrip('.tgz').rstrip('-x86_64')%0A
+v
) fo
@@ -1890,16 +1890,17 @@
%22docker-
+(
%5B0-9%5D+%5C.
@@ -1913,16 +1913,17 @@
%5C.%5B0-9%5D+
+)
-?.*tgz%22
@@ -194... |
d0844ca2a80a29241c6f25b3400c02fc64bb4395 | send sensible pixel data | pixel_table/pixel_grid.py | pixel_table/pixel_grid.py |
from collections import OrderedDict
import math
import glob
import sys
from time import time
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty
from kivy.graphics import Color, Rectangle
import numpy as np
from serial import Serial
from serial.serialutil import SerialException
class Ardui... | Python | 0 | @@ -1388,17 +1388,17 @@
print(%22%25
-c
+s
%22 %25 self
|
486d5845ad8e3988db16a738cc624fb73a694659 | use backwards compatile exception args instead of message | flatcontent/tests/test_flatcontent.py | flatcontent/tests/test_flatcontent.py | from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.template import TemplateSyntaxError
from django.test import TestCase
from django.utils import translation
from mock import patch
from nose.tools import eq_
from flatcontent.models import FlatContent
from .basefactory ... | Python | 0 | @@ -3696,39 +3696,39 @@
tse.exception.
-message
+args%5B0%5D
,%0A %22T
@@ -3991,39 +3991,39 @@
tse.exception.
-message
+args%5B0%5D
,%0A %22Y
@@ -4281,23 +4281,23 @@
ception.
-message
+args%5B0%5D
,%0A
@@ -4557,15 +4557,15 @@
ion.
-message
+args%5B0%5D
, %22B
|
cb6a340ba2d0385ae3c406540eaf934c2cd6f454 | Format string. | mmmpaste/filters.py | mmmpaste/filters.py | from flask import make_response
from functools import update_wrapper, wraps
from time import time as now
from mmmpaste import app
def runtime(f):
"""
Add a header that shows the runtime of the route.
"""
@wraps(f)
def wrapper(*args, **kwargs):
start = now()
response = make_response... | Python | 0.000022 | @@ -399,18 +399,20 @@
= %22
-%25ss%22 %25 str
+%7B0%7Ds%22.format
(end
|
d4f6639a5afe207208721732374dca0f655ddc7c | version goes into path | powerstripflocker/adapter.py | powerstripflocker/adapter.py | """
A Powerstrip adapter which integrates Docker with Flocker to enable portable
volumes without wrapping Docker.
See:
* https://github.com/clusterhq/powerstrip
* https://github.com/clusterhq/flocker
"""
from twisted.internet import reactor, defer
from twisted.web import server, resource
from twisted.python import lo... | Python | 0.000001 | @@ -1446,195 +1446,8 @@
sed%0A
- if json_parsed%5B%22DockerVolumesExtensionVersion%22%5D != 1:%0A raise Exception(%22unsupported docker volume extension version for request: %25s%22 %25%0A (json_parsed,))%0A%0A
@@ -7158,42 +7158,8 @@
= %7B
-%22DockerVolumesExtensionVersion%22: ... |
fbf6d007f356185d64daecf69932a21db962dbf4 | Fix MC answers | supersurvey/surveyapp/views.py | supersurvey/surveyapp/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render_to_response, redirect
from .models import Question, Answer, Session
fr... | Python | 0.999689 | @@ -4026,17 +4026,97 @@
ion%5B
-2%5D.answer
+1%5D.variants%5Bint(question%5B2%5D.answer)%5D if question%5B1%5D.type == 'MC' else question%5B2%5D.answer
%7D)%0A
|
ac427b4cc3e9e946b41863c5654acb0d2c1aa724 | remove unneeded imports | vmpoolstate.py | vmpoolstate.py | #!/usr/bin/python
from copy import deepcopy
import sys
from types import *
from vm import VM
from vmhost import VMhost
from dijkstra import VMPoolShortestPathFinder
from migrationpath2 import VMPoolPathFinder
from vmpoolpath import VMPoolPath
from vmpoolstateerrors import *
class VMPoolState:
"""
This class ... | Python | 0.000001 | @@ -118,132 +118,8 @@
ost%0A
-from dijkstra import VMPoolShortestPathFinder%0Afrom migrationpath2 import VMPoolPathFinder%0Afrom vmpoolpath import VMPoolPath%0A
from
|
e7efef7ac0a335e80d8f8a8c28eb203971eb99be | Move trigger events helper back from superclass | mopidy_alsamixer/mixer.py | mopidy_alsamixer/mixer.py | from __future__ import unicode_literals
import logging
import select
import threading
import alsaaudio
from mopidy import exceptions, mixer
import pykka
logger = logging.getLogger(__name__)
class AlsaMixer(pykka.ThreadingActor, mixer.Mixer):
name = 'alsamixer'
def __init__(self, config):
super... | Python | 0 | @@ -1755,18 +1755,21 @@
for_
-any_
change
+d_value
s)%0A
@@ -2822,16 +2822,575 @@
n True%0A%0A
+ def trigger_events_for_changed_values(self):%0A if not hasattr(self, '_last_volume'):%0A self._last_volume = None%0A if not hasattr(self, '_last_mute'):%0A self._last_mute = None%... |
2c9539b47d490bddc3f8c69b7a3be436b54220b0 | Use mopidy-youtube API key | mopidy_youtube/backend.py | mopidy_youtube/backend.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from urllib import quote
from urlparse import urlparse, parse_qs
from mopidy import backend
from mopidy.models import SearchResult, Track, Album
import pykka
import pafy
import requests
from mopidy_youtube import logger
yt_api_endpoint = 'https://www.goo... | Python | 0 | @@ -358,41 +358,41 @@
zaSy
-Cwu6_2lo16AVcNLnGZ34h0AGJyKwJCucc
+Al1Xq9DwdE_KD4AtPaE4EJl3WZe2zCqg4
'%0A%0Ad
|
73c84345cbedb9e743ef9689b8f430638cb498bb | Fix issues raised by jgama | program_indicator/program.py | program_indicator/program.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Savoir-faire Linux (<www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the t... | Python | 0 | @@ -1097,16 +1097,17 @@
port _%0A%0A
+%0A
class pr
@@ -3567,62 +3567,8 @@
%7B%7D%0A%0A
- result_pool = self.pool.get('program.result')%0A
|
8822532c858c67ae8b51b16e806226edef7ec041 | make standard | nalaf/learning/taggers.py | nalaf/learning/taggers.py | import abc
from nalaf.structures.data import Relation
from nalaf.features import get_spacy_nlp_english
from nalaf.preprocessing.spliters import GenericSplitter, NLTK_SPLITTER
from nalaf.preprocessing.tokenizers import GenericTokenizer, NLTK_TOKENIZER
from nalaf.preprocessing.edges import SentenceDistanceEdgeGenerator
... | Python | 0.001301 | @@ -6311,32 +6311,62 @@
s, relation_type
+, use_gold=True, use_pred=True
):%0A edge_
@@ -6465,16 +6465,54 @@
nce=None
+, use_gold=use_gold, use_pred=use_pred
)%0A
|
49df4cc72a5e424d3fad45b1679d4519b04e5916 | Update models.py | vote/models.py | vote/models.py | from django.db import models
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
try:
from django.contrib.contenttypes.fields import GenericForeignKey
except ImportError:
from django.contrib.contenttypes.generic import GenericForeignKey
from .compat import AU... | Python | 0.000002 | @@ -416,23 +416,8 @@
if
-kwargs.has_key(
'con
@@ -428,17 +428,26 @@
_object'
-)
+ in kwargs
:%0A
|
ce9aa9cc4e7f3a92cc776d525bc37118f48635a5 | Fix comment typo error | neutron/objects/router.py | neutron/objects/router.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Python | 0 | @@ -1026,32 +1026,33 @@
Version 1.0: In
+i
tial version%0A
@@ -2255,16 +2255,17 @@
1.0: In
+i
tial ver
|
6bccabc3840438b6d9524a3bcbd097459171cc1b | Handle KeyboardInterrupt as nose does. | noseprogressive/runner.py | noseprogressive/runner.py | from time import time
import nose.core
from noseprogressive.result import ProgressiveResult
class ProgressiveRunner(nose.core.TextTestRunner):
"""Test runner that makes a lot less noise than TextTestRunner"""
def __init__(self, cwd, totalTests, stream, **kwargs):
super(ProgressiveRunner, self).__in... | Python | 0 | @@ -1400,19 +1400,87 @@
t
-est(result)
+ry:%0A test(result)%0A except KeyboardInterrupt:%0A pass
%0A
|
4db781033c9c9d325d32cc481d752ba4d7a86624 | Add other test | plugins/station_master.py | plugins/station_master.py | import asyncio
import random
from ircbot.persist import Persistent
from ircbot.text import parse_time
from ircbot.plugin import BotPlugin
from .helpers import public_api, mkurl, protect, full_pamela, spaceapi
from datetime import datetime, timedelta
from datetime import time as dtime
from operator import itemgetter
fro... | Python | 0.000014 | @@ -974,24 +974,121 @@
: range(7)%7D%0A
+ %5D,%0A %22other_test%22: %5B%0A %7B%22hour%22: range(24), %22minute%22: range(60), %22weekday%22: range(7)%7D%0A
%5D%0A%7D%0A%0A%0Ade
@@ -2549,16 +2549,82 @@
int(a)%0A%0A
+ def run_other_test(self):%0A print(%22Inside other test%22)%0A%0A
def... |
e6b80e478eb137f824c9bbc050ba363e24b48707 | Improve twitter URL detection | plugins/twitter/plugin.py | plugins/twitter/plugin.py | import re
from urllib.parse import urlparse
import requests
import twitter
from twisted.internet import defer
from twisted.internet.threads import deferToThread
from cardinal.decorators import event
from cardinal.exceptions import EventRejectedMessage
class TwitterPlugin:
def __init__(self, config):
con... | Python | 0.000027 | @@ -1531,19 +1531,20 @@
.netloc
-==
+in (
'twitter
@@ -1548,16 +1548,39 @@
ter.com'
+, 'mobile.twitter.com')
%5C%0A
|
ed0d7a3ea806b72dfad3152aac44c08b55e85289 | Add course_key and map_into_course to AsideUsageKey | opaque_keys/edx/asides.py | opaque_keys/edx/asides.py | """
This file provides implementations of :class:`.AsideDefinitionKey` and :class:`.AsideUsageKey`.
:class:`.AsideUsageKeyV1` stores a :class:`.UsageKey` and an `aside_type`, and serializes as
`<usage_key>::<aside_type>`.
Likewise, :class:`.AsideDefinitionKeyV1` stores a :class:`.DefinitionKey` and an `aside_type',
a... | Python | 0.000003 | @@ -3249,16 +3249,717 @@
on_key%0A%0A
+ @property%0A def course_key(self):%0A %22%22%22%0A Return the :class:%60CourseKey%60 for the course containing this usage.%0A %22%22%22%0A return self.usage_key.course_key%0A%0A def map_into_course(self, course_key):%0A %22%22%22%0A ... |
8dc813d2000901851abd2357b204a94a74b8c31d | Create Finders on tab creation. | porcupine/plugins/find.py | porcupine/plugins/find.py | """Find/replace widget."""
import re
import tkinter as tk
import weakref
import porcupine
from porcupine import utils
find_widgets = weakref.WeakKeyDictionary()
class Finder(tk.Frame):
"""A widget for finding and replacing text.
Use the pack geometry manager with this widget.
"""
def __init__(self... | Python | 0 | @@ -5446,35 +5446,35 @@
find():%0A
-tab_manager
+current_tab
= porcupine
@@ -5495,80 +5495,127 @@
er()
-%0A tab = tab_manager.current_tab%0A%0A
+.current_tab%0A find_widgets%5Bcurrent_tab%5D.pack(fill='x')%0A%0A%0Adef on_new_tab(event):%0A
-if
tab
-not in find_widgets:%0A
+= event.widget.curr... |
1c708b1174bf42113adc90ca95a0d961c107489c | Revert whitespace change. | portal/views/procedure.py | portal/views/procedure.py | from flask import abort, jsonify, Blueprint, request
from ..audit import auditable_event
from ..extensions import db, oauth
from ..models.audit import Audit
from ..models.user import current_user, get_user
from ..models.procedure import Procedure
procedure_api = Blueprint('procedure_api', __name__, url_prefix='/api'... | Python | 0 | @@ -3172,16 +3172,17 @@
r parse%0A
+%0A
if n
|
a2874a61698c1ceaf2362e02f94d3b20d9232e16 | Simplified the work to work as in oq-lite | openquake/engine/views.py | openquake/engine/views.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2015, GEM Foundation
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | Python | 0.999966 | @@ -2685,142 +2685,81 @@
-for loss in losses:%0A row = %5Bloss%5B'asset_ref'%5D%5D + %5Bloss%5Blt%5D for lt in names%5B1:%5D%5D%0A rows.append(row)%0A else:%0A
+ins_losses = numpy.empty_like(losses)%0A ins_losses.fill(numpy.nan)%0A
@@ -2810,20 +2810,16 @@
-
-... |
9d0dd9394df3e50b9bfe1a2ec05b8dba22d102c4 | Add language to StringResource. | ppp_datamodel/resource.py | ppp_datamodel/resource.py | """Contains the class representing a resource leaf."""
import logging
from .abstractnode import register, AbstractNode
EXTRA_ATTRIBUTES = {
'string': ('language',),
'boolean': (),
'time': ('calendar',),
}
VALUE_TYPE_TO_CLASS = {}
def register_valuetype(cls):
VALUE_TYPE_TO_CLASS[cl... | Python | 0.000003 | @@ -587,30 +587,31 @@
lue_type = '
-string
+unknown
'%0A _possi
@@ -1646,33 +1646,159 @@
d%0A%0A
-StringResource = Resource
+@register_valuetype%0Aclass StringResource(Resource):%0A _value_type = 'string'%0A _possible_attributes = Resource._possible_attributes + ('language',)
%0A%0A@r
|
a08c995b8228928fea456ec8486ea32ce1a0671c | Add FRnn to layers. | praxis/layers/__init__.py | praxis/layers/__init__.py | # coding=utf-8
# Copyright 2022 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 ... | Python | 0.000035 | @@ -2914,32 +2914,68 @@
tionalEmbedding%0A
+from praxis.layers.frnn import FRnn%0A
from praxis.laye
|
12201418dbb8bab53ffc070138d8206af5044218 | Fix version if not found, set to ? | sequana/sphinxext/sequana_pipeline.py | sequana/sphinxext/sequana_pipeline.py | # coding: utf-8 -*-
"""snakemakerule
Defines a docutils directive for inserting simple docstring extracting from
a snakemake rule (from sequana project).
::
.. snakemakerule: dag
The name must be a valid sequana rule in the rules directory accesible via the
:class:`sequana.snaketools.Module` class
"""
import ... | Python | 0 | @@ -701,16 +701,29 @@
utf8%22)%0A%0A
+ try:%0A
from
@@ -741,24 +741,28 @@
port Module%0A
+
m = Modu
@@ -770,16 +770,77 @@
e(name)%0A
+ version = m.version%0A except:%0A version = %22?%22
%0A%0A do
@@ -887,18 +887,16 @@
.format(
-m.
version,
|
9a7ec6ae67ed5007aa186399c5a12bc7bf24693f | fix rights on file | examples/inverse/plot_psf_ctf_vertices_lcmv.py | examples/inverse/plot_psf_ctf_vertices_lcmv.py | # -*- coding: utf-8 -*-
"""
=================================================
Compute cross-talk functions for LCMV beamformers
=================================================
Visualise cross-talk functions at one vertex for LCMV beamformers computed
with different data covariance matrices, which affects their cross... | Python | 0 | |
e0ddbe8fc468b6bc03455ce5b519bcdc940aa438 | Handle GenericForeignKey fields when translating queries | osf_models/modm_compat.py | osf_models/modm_compat.py | # -*- coding: utf-8 -*-
from operator import and_, or_
from django.db.models import Q as DjangoQ
from modularodm import Q as MODMQ
from modularodm.query import query, QueryGroup
class BaseQ(object):
def __or__(self, other):
return OrQ(self, other)
def __and__(self, other):
return AndQ(self... | Python | 0 | @@ -2161,18 +2161,179 @@
-if
+# NOTE: GenericForeignKey does not implement get_internal_type%0A if (%0A hasattr(field, 'get_internal_type') and%0A
field.g
@@ -2370,16 +2370,36 @@
eld' and
+%0A
query.o
@@ -2413,16 +2413,34 @@
== 'eq... |
08bd685fd7174c6e96f10eb517b9aa1e8916385a | add u24 keyword to rammbocklibrary | proto/src/RammbockLibrary.py | proto/src/RammbockLibrary.py | from Rammbock import Rammbock
from robot.libraries.BuiltIn import BuiltIn
class RammbockLibrary(Rammbock):
def u8(self, name, value=None, align=None):
self.uint(1, name, value, align)
def u16(self, name, value=None, align=None):
self.uint(2, name, value, align)
def u32(self, name, value... | Python | 0 | @@ -276,32 +276,123 @@
value, align)%0A%0A
+ def u24(self, name, value=None, align=None):%0A self.uint(3, name, value, align)%0A%0A
def u32(self
|
7f1933f9cae7cbb9b0be140671046c0b8919bd10 | fix type | shot_detector/filters/slice_filter.py | shot_detector/filters/slice_filter.py | # -*- coding: utf8 -*-
from __future__ import absolute_import, division, print_function
import itertools
import logging
from shot_detector.filters import Filter
class SliceFilter(Filter):
"""
Slice filter.
"""
__logger = logging.getLogger(__name__)
def filter_objects(self,
... | Python | 0.000003 | @@ -659,17 +659,16 @@
-i
sliced_s
@@ -812,17 +812,16 @@
return
-i
sliced_s
|
afc51d93271e48ed817400b03f43ae5a55ed7334 | Delete excessive table counting | simplesqlite/loader/html/formatter.py | simplesqlite/loader/html/formatter.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import bs4
import dataproperty
from ..constant import TableNameTemplate as tnt
from ..data import TableData
from ..error import InvalidDataError
from ..formatter import TableFormatter
class Htm... | Python | 0.000003 | @@ -817,51 +817,8 @@
ble)
-%0A self._loader.inc_table_count()
%0A%0A
|
b4de1dd09888fb1d61436cd0bbf011f928bac10c | support ability to send all unread notifications in digests | common/djangoapps/student/management/commands/force_send_notification_digest.py | common/djangoapps/student/management/commands/force_send_notification_digest.py | """
Django management command to force-send the daily/weekly digest emails
"""
import logging
import logging.config
import sys
# Have all logging go to stdout with management commands
# this must be up at the top otherwise the
# configuration does not appear to take affect
import datetime
import pytz
from django.conf... | Python | 0 | @@ -1895,32 +1895,92 @@
st.%0A %22%22%22%0A
+ if const.NOTIFICATION_DIGEST_SEND_TIMEFILTERED:%0A
from_tim
@@ -2049,16 +2049,65 @@
days=1)%0A
+ else:%0A from_timestamp = None%0A%0A
@@ -2812,32 +2812,93 @@
st.%0A %22%22%22%0A
+%0A if const.NOTIFICATI... |
90d934e848beb3fd02979022a78b8326826e7801 | put infra change behind feature flag | custom/icds_reports/utils/aggregation_helpers/distributed/awc_infrastructure.py | custom/icds_reports/utils/aggregation_helpers/distributed/awc_infrastructure.py | from dateutil.relativedelta import relativedelta
from custom.icds_reports.const import AGG_INFRASTRUCTURE_TABLE
from custom.icds_reports.utils.aggregation_helpers import month_formatter, get_prev_agg_tablename
from custom.icds_reports.utils.aggregation_helpers.distributed.base import (
StateBasedAggregationPartiti... | Python | 0 | @@ -43,16 +43,75 @@
edelta%0A%0A
+from corehq.toggles import ICDS_LOCATION_REASSIGNMENT_AGG%0A%0A
from cus
@@ -1255,38 +1255,174 @@
-return get_prev_agg_tablename(
+if ICDS_LOCATION_REASSIGNMENT_AGG.enabled(self.domain):%0A return get_prev_agg_tablename(self.ucr_data_source_id)%0A return get_t... |
df6de0eb5185ec88b828c5f08a93c697525a2c6a | add pin numbers for motor | TankController/tank.py | TankController/tank.py | import motor
class tank(object):
def __init__(self):
self.left_motor = motor.motor(11,15)
self.right_motor = motor.motor(13,12)
self.actions = {'forward':False, 'reverse':False, 'left':False, 'right':False, 'stop':True}
def forward(self):
if not self.actions['forward']:
self.left_motor.posi... | Python | 0.000001 | @@ -88,13 +88,12 @@
tor(
+7,
11
-,15
)%0A
@@ -130,12 +130,12 @@
or(1
-3,12
+2,13
)%0A
|
7951c48adb68089fbe2bbdfd8c8a3179129acafc | Add initial version of a waterpoint service schema | taarifa_waterpoints/schemas.py | taarifa_waterpoints/schemas.py | date_field = {'type': 'datetime'}
string_field = {'type': 'string'}
float_field = {'type': 'float'}
waterpoint_schema = {
'date_recorded': date_field,
'company': string_field,
'region': string_field,
'district': string_field,
'lga_name': string_field,
'ward': string_field,
'village': string... | Python | 0 | @@ -1995,8 +1995,1027 @@
oints%22%7D%0A
+%0Aservice_schema = %7B%0A %22service_name%22: %22Communal Water Point%22,%0A %22attributes%22: %5B%0A %7B%22variable%22: True,%0A %22code%22: %22waterpoint_id%22,%0A %22datatype%22: %22string%22,%0A %22required%22: True,%0A %22datat... |
7e49448019f8e47d773a86a5ad8b6d3e04a73884 | Fix for sessions getting used up | telephony/podcast/rss_agent.py | telephony/podcast/rss_agent.py | import threading
from time import sleep
from rootio.config import DefaultConfig
from rootio.content.models import ContentPodcast
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from rss_downloader import RSSDownloader
class RSSAgent:
def __init__(self, logger):
self.__logger... | Python | 0 | @@ -399,16 +399,76 @@
ASE_URI)
+%0A self.__session = sessionmaker(bind=self.__engine)()
%0A%0A de
@@ -497,32 +497,33 @@
(self):%0A
+#
session = None%0A
@@ -542,24 +542,25 @@
+#
session = se
@@ -922,16 +922,42 @@
+pass%0A #
session.
|
71e0c540b970205eb144a47259f6e939d14699a5 | Remove extra calls to get_downtime | Alerters/nma.py | Alerters/nma.py | import requests
from util import format_datetime
from .alerter import Alerter
class NMAAlerter(Alerter):
"""Send Push alerts using NMA service.
Subscription required, see http://www.notifymyandroid.com/"""
def __init__(self, config_options):
Alerter.__init__(self, config_options)
self.... | Python | 0 | @@ -1169,77 +1169,8 @@
p%22:%0A
- (days, hours, minutes, seconds) = monitor.get_downtime()%0A
@@ -1790,77 +1790,8 @@
e%22:%0A
- (days, hours, minutes, seconds) = monitor.get_downtime()%0A
|
b4c8544617528576dfa1eae3c045735b0bbccfad | Fix darwin detecting | bzt/__init__.py | bzt/__init__.py | """
Copyright 2015 BlazeMeter 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... | Python | 0.000411 | @@ -1862,16 +1862,18 @@
m.system
+()
== 'Dar
|
c3d0577b4b6a486d6cc416d362787a836d5ddc08 | fix case where song has no metadata | mpdstatus.py | mpdstatus.py | import mpd
class MpdStatusWidget(object):
def __init__(self, server, timeout=10):
self.server = server
self.client = mpd.MPDClient()
self.client.timeout = timeout
self.client.connect(server, 6600)
def output(self):
song = self.client.currentsong()
if song:
... | Python | 0 | @@ -4,16 +4,31 @@
ort mpd%0A
+import os.path%0A
%0A%0Aclass
@@ -266,16 +266,33 @@
(self):%0A
+ try:%0A
@@ -336,16 +336,235 @@
-if song:
+except:%0A pass%0A%0A if song:%0A if 'artist' in song and 'title' in song:%0A text = %22%7Bartist%7D - %7Bti... |
fc9681f6d5f126617c01d6dd8b349750d353c811 | fix import loop | capa/helpers.py | capa/helpers.py | # Copyright (C) 2020 Mandiant, 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: [package root]/LICENSE.txt
# Unless required by applicable law or agreed to in writing... | Python | 0.000005 | @@ -749,67 +749,8 @@
NOWN
-%0Afrom capa.features.extractors.common import extract_format
%0A%0AEX
@@ -1946,24 +1946,133 @@
tr) -%3E str:%0A
+ # imported locally to avoid import cycle%0A from capa.features.extractors.common import extract_format%0A%0A
with ope
|
78c85e07f50b990b90e93cf8280ee47671d2f7e0 | configure cronjob to run on the hour every hour | celeryconfig.py | celeryconfig.py | from datetime import timedelta
from celery.schedules import crontab
from django.conf import settings
CELERY_ANNOTATIONS = {
'bluebottle.analytics.tasks.queue_analytics_record': {'rate_limit': '50/s'}
}
CELERYBEAT_SCHEDULE = {
'set_status_realised': {
'task': 'bluebottle.projects.tasks.set_status_rea... | Python | 0.000001 | @@ -820,9 +820,9 @@
ute=
-7
+0
),%0A
|
c9a76fc63c1606b3e6a5c502a6a69b4e5317bec3 | Make input file required. "-" can be used to read from stdin. | centerpoints.py | centerpoints.py | import argparse
import sys
import csv
def parse_arguments(argv):
"""
Initialize the CLI and parse the given argument.
argv must not contain the filename in argv[0]
:param argv:
"""
# TODO: Tests
parser = argparse.ArgumentParser(description="Calculate centerpoints in higher-dimensions.")... | Python | 0.000009 | @@ -974,114 +974,35 @@
s%22,
-nargs=%22?%22,%0A #type=argparse.FileType('r'),%0A default=sys.stdin
+type=argparse.FileType('r')
, me
@@ -1751,17 +1751,16 @@
gs.csv%0A%0A
-%0A
retu
@@ -2974,22 +2974,14 @@
urn
-Points(
points
-)
%0A%0A%0Ad
|
e61a341ecad77ddeba25b6556ca452bffd13a5bb | Update default filename for alexa-top-10000 | namebench.py | namebench.py | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Python | 0 | @@ -3131,16 +3131,22 @@
t='data/
+alexa-
top-1000
@@ -3146,16 +3146,23 @@
op-10000
+-global
.txt',%0A
|
7ec88507c39288bad482b63108bc046d48b9ecf6 | bump to 0.7.0 | namebench.py | namebench.py | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Python | 0.000007 | @@ -1111,11 +1111,11 @@
'0.
-6.9
+7.0
'%0A%0A#
|
f509034ffbd4c218afbf62df9ec894bd01a20964 | Remove commented pdb | chart/models.py | chart/models.py | from datetime import datetime
from django.core.urlresolvers import reverse
from django.db import models
from django.utils import timezone
from preferences.models import Preferences
from jmbo.models import ModelBase
from music.models import Track
class Chart(ModelBase):
@property
def chartentries_permitted(... | Python | 0 | @@ -324,44 +324,8 @@
f):%0A
- #import pdb;pdb.set_trace()%0A
|
dd6b6b4feff15fb79e23734e01e34217c3fb77c0 | Fix pep8 | bluebottle/payouts_dorado/tests/test_api.py | bluebottle/payouts_dorado/tests/test_api.py | from django.contrib.auth.models import Group
from django.core.urlresolvers import reverse
from django.utils.timezone import now
from rest_framework import status
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.test.factory_models.projects import ProjectFactory
from bluebottle... | Python | 0.000001 | @@ -1716,17 +1716,16 @@
00_OK)%0A%0A
-%0A
def
@@ -1985,17 +1985,16 @@
eated'%7D,
-
token=s
@@ -2222,17 +2222,16 @@
ccess'%7D,
-
token=s
|
a010849aa20e7aa58e5251745bed43218c5c57a0 | Fix sslscan function | checkheaders.py | checkheaders.py | """
Module to perform SSLscan for a URL, check HSTS
, clickjacking headers & check server version
& check HTTP methods using options.
"""
import requests
import subprocess
import argparse
import sys
import re
def check_clickjacking(url):
"""
check if x-frame-options headers are implemented
"""
response... | Python | 0.000337 | @@ -1574,19 +1574,16 @@
scan_url
-%5B0%5D
%5D)%0A e
|
7883b95433a35b0b4bfa3354454626473986b2a5 | bump version number | temporal_sqlalchemy/version.py | temporal_sqlalchemy/version.py | """Version information."""
__version__ = '0.1.0'
| Python | 0.000004 | @@ -41,9 +41,9 @@
'0.
-1
+2
.0'%0A
|
0eb37be31890682874390e7bbf4922825a811442 | Fix test pass criterion. | tensorforce/tests/base_test.py | tensorforce/tests/base_test.py | # Copyright 2017 reinforce.io. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python | 0.000003 | @@ -2705,27 +2705,153 @@
if a
-gent.episode %3C 3000
+ll(rw / ln %3E= self.__class__.pass_threshold%0A for rw, ln in zip(runner.episode_rewards%5B-100:%5D, runner.episode_timesteps%5B-100:%5D))
:%0A
|
b61ca1f64b4ea8b1ed62e85a3fc0f9cfa878e4dd | Use TestSCons facility to get shared object suffix. | test/Fortran/SHFORTRANFLAGS.py | test/Fortran/SHFORTRANFLAGS.py | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | Python | 0 | @@ -1245,158 +1245,33 @@
on_%0A
-%0Aif sys.platform == 'win32':%0A _obj = '.obj'%0Aelse:%0A if string.find(sys.platform, 'irix') %3E -1:%0A _obj = '.o'%0A else:%0A _obj = '.os'
+_obj = TestSCons._shobj
%0A%0Ate
|
2ecaf44c0bc5117744ecda7bd0f8df2627e9a527 | Change order of the tests | ci_tests/all.py | ci_tests/all.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import random
from subprocess import Popen, PIPE
import os
system_test = '/home/ipol/ipolDevel/ci_tests/system.py'
archive_test = '/home/ipol/ipolDevel/ipol_demo/modules/archive/test.py'
blobs_test = '/home/ipol/ipolDevel/ipol_demo/modules/blobs/test.py'
demoinfo_... | Python | 0.000003 | @@ -741,21 +741,8 @@
= %5B
-system_test,
demo
@@ -810,16 +810,29 @@
ner_test
+, system_test
%5D%0A%0A%0Adef
|
ede17ac8fac348b6d2329ce05cc7b10f09ca8715 | Version is 1.6dev0 | shapely/__init__.py | shapely/__init__.py | __version__ = "1.5.11"
| Python | 0.000309 | @@ -14,10 +14,11 @@
%221.
-5.11
+6dev0
%22%0A
|
658bbb15ee7091c8159b7e3503af6b5473f97092 | Add a little help string | siebenapp/manage.py | siebenapp/manage.py | from argparse import ArgumentParser
from html import escape
from os import path
from siebenapp.cli import IO, ConsoleIO
from siebenapp.domain import EdgeType, Graph
from siebenapp.goaltree import Goals, GoalsData, EdgesData, OptionsData
from siebenapp.layers import get_root, persistent_layers
from siebenapp.open_view i... | Python | 0.999999 | @@ -1713,32 +1713,72 @@
dd_argument(%22db%22
+, help=%22An existing file with goaltree.%22
)%0A parser_dot
@@ -1898,16 +1898,56 @@
ent(%22db%22
+, help=%22An existing file with goaltree.%22
)%0A pa
|
bc972c9a550a333c0ab681268518cb1ef15d24cd | Clean Entropy class | pymsascoring/impl/entropy.py | pymsascoring/impl/entropy.py | """
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 the hope that it will be use... | Python | 0 | @@ -1085,20 +1085,16 @@
-
using th
@@ -1120,16 +1120,176 @@
ormula.%0A
+%0A Args:%0A msa - MSA list of tuples%0A%0A Returns:%0A score - Total score of MSA after calculating Minimum Entropy for each column%0A%0A
@@ -1495,18 +1495,20 @@
s
-um
+core
=... |
ec2418705733d79eeaea5d1f044b0b30e4661e85 | add admin filters to page model list | simplesite/admin.py | simplesite/admin.py | # -*- coding:utf8 -*-
from django import forms
from django.contrib import admin
from simplesite.models import (
Page, PageImage, SocialNetwork
)
class PageImageInline(admin.TabularInline):
"""
Stack inline choice items to be displayed in Page Admin Panel
"""
model = PageImage
ex... | Python | 0 | @@ -1109,16 +1109,54 @@
public',
+ 'creation_date', 'last_modification',
)%0A se
|
76b047fcb2c80d8abad0b275710b8e01459daadd | Bump version to 0.20.4 | pytablereader/__version__.py | pytablereader/__version__.py | # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.20.3"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| Python | 0 | @@ -209,9 +209,9 @@
.20.
-3
+4
%22%0A__
|
948ccdf2864988f1463f901c6024a5a3df09fdba | Bump version to 0.30.0 | pytablewriter/__version__.py | pytablewriter/__version__.py | # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.29.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| Python | 0 | @@ -206,10 +206,10 @@
%220.
-29
+30
.0%22%0A
|
3c2a426553072149710d976938918d837cd6c9ff | fix pos | pythainlp/postaggers/text.py | pythainlp/postaggers/text.py | from __future__ import absolute_import,division,print_function
from nine import nimport,str
from pythainlp.segment import segment
import pythainlp
import os
json= nimport('json')
import nltk.tag, nltk.data
templates_dir = os.path.join(os.path.dirname(pythainlp.__file__), 'corpus')
template_file = os.path.join(templates... | Python | 0.00011 | @@ -154,30 +154,8 @@
os%0A
-json= nimport('json')%0A
impo
@@ -177,16 +177,99 @@
tk.data%0A
+json= nimport('json')%0Acodecs= nimport('codecs')%0Areader = codecs.getreader(%22utf-8%22)%0A
template
@@ -400,92 +400,32 @@
n')%0A
-#default_tagger = nltk.data.load(nltk.tag._POS_TAGGER)%0Adef data():%0A%09return json.loa... |
40adc641638e3efcf8e4e5af898deda9e40da161 | Use NTP terms. Add comments. | ntpclient.py | ntpclient.py | #!/usr/bin/env python3
# file: ntpclient.py
# vim:fileencoding=utf-8:fdm=marker:ft=python
#
# Author: R.F. Smith <rsmith@xs4all.nl>
# Created: 2017-11-16 19:33:50 +0100
# Last modified: 2018-05-13T12:15:28+0200
"""Simple NTP query program."""
from contextlib import closing
from datetime import datetime
from socket imp... | Python | 0 | @@ -189,21 +189,21 @@
18-0
-5-13T12:15:28
+9-09T14:10:52
+020
@@ -382,16 +382,349 @@
t time%0A%0A
+# See e.g. # https://www.cisco.com/c/en/us/about/press/internet-protocol-journal/back-issues/table-contents-58/154-ntp.html%0A# From left to right:%0A# * No leap second adjustment = 0 (2 bits)%0A# * protocol version 3 ... |
2a4d78be3df2d068431fe007b6f2d73956dc23d4 | Use feeds instead of rss | sitecontent/urls.py | sitecontent/urls.py | from django.conf.urls import patterns, url
from sitecontent import views
urlpatterns = patterns('',
url("^rss/(?P<format>.*)$",
"sitecontent.views.blog_post_feed_richtext_filters", name="blog_post_feed_richtext_filters"),
)
| Python | 0 | @@ -106,18 +106,20 @@
url(%22%5E
-rs
+feed
s/(?P%3Cfo
|
8d9e5b612e5ff204eb8dbed269a0dafeb9e98323 | Revert "Fix indentation of if else statement." | ooni/deck.py | ooni/deck.py | #-*- coding: utf-8 -*-
from ooni.nettest import NetTestLoader
from ooni.settings import config
from ooni.utils import log
from ooni import errors as e
from twisted.internet import reactor, defer
import os
import re
import yaml
import json
from hashlib import sha256
class InputFile(object):
def __init__(self, in... | Python | 0.00002 | @@ -4287,30 +4287,22 @@
-
else:%0A
-
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.