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
02e29e6f7904315dec5079a66cd242c1e48330f9
Add filters to separate logging events from non-events
nodeconductor/core/log.py
nodeconductor/core/log.py
from __future__ import absolute_import, unicode_literals import json import logging from logging.handlers import SocketHandler from datetime import datetime class EventLoggerAdapter(logging.LoggerAdapter, object): """ LoggerAdapter """ def __init__(self, logger): super(EventLoggerAdapter, se...
Python
0
@@ -548,22 +548,20 @@ ass -EventLogFilter +RequireEvent (log @@ -629,48 +629,184 @@ ords - that have event=True as extra parameter +.%0A %22%22%22%0A def filter(self, record):%0A return hasattr(record, 'event')%0A%0A%0Aclass RequireNotEvent(logging.Filter):%0A %22%22%22%0A A filter that allows on...
8801038cd56885a4aec79736c4f5ab682166e8b9
Optimize out clear loop
bfcomp.py
bfcomp.py
import sys import os import subprocess OUTPUT=0 INPUT=1 LOOPSTART=2 LOOPEND=3 MOVE=4 ADD=5 def parse(code): code = ''.join(i for i in code if i in '.,[]+-<>') tokens = [] for i in code: if i == '+': tokens.append((ADD, 1)) elif i == '-': tokens.append((ADD, -1)) ...
Python
0.000273
@@ -84,16 +84,22 @@ =4%0AADD=5 +%0ASET=6 %0A%0Adef pa @@ -1175,16 +1175,462 @@ alue))%0A%0A + # Optimize out clear loop%0A i = 0%0A loop = 0%0A while i %3C len(newtokens):%0A if newtokens%5Bi%5D%5B0%5D == LOOPSTART:%0A loop += 1%0A j = i + 1%0A while j %3C len(newt...
e1315bb8ce57ab24419d8db761ac831e12db9b17
Rename _subsequent_partner
l10n_br_fiscal/models/subsequent_document.py
l10n_br_fiscal/models/subsequent_document.py
# Copyright 2018 KMEE INFORMATICA LTDA # Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br> # License AGPL-3 or later (http://www.gnu.org/licenses/agpl) # from __future__ import division, print_function, unicode_literals from odoo import api, fields, models from ..constants.fiscal import ( SITUACAO_EDOC_CANC...
Python
0.000004
@@ -2112,15 +2112,11 @@ part -icipant +ner (sel
04b343ec18c4708f9e873e55510e07a9305835ee
add on_delete
analytics/models.py
analytics/models.py
from django.db import models class Report(models.Model): """ Represents a report. """ SUBACCOUNT_ACTIVITY = "subaccount_activity" TYPE_CHOICES = ( (SUBACCOUNT_ACTIVITY, "SubAccount Activity"), ) report_type = models.CharField(max_length=80, choices=TYPE_CHOICES) started_date = mo...
Python
0.000002
@@ -2724,16 +2724,114 @@ ePeriod, +%0A on_delete=models.CASCADE,%0A db_inde
314a43c52373f1cc8400dddcfa3335e3aadde133
Remove bedtools coverage iobuffer limit
binCov.py
binCov.py
#!/usr/bin/env python # Copyright (c) 2016 Ryan Collins <rcollins@chgr.mgh.harvard.edu> # Distributed under terms of the MIT license. """ Calculates non-duplicate primary-aligned binned coverage of a chromosome from an input BAM file """ #Import libraries import argparse import sys from subprocess import call import...
Python
0
@@ -3942,31 +3942,24 @@ ate -coverage & write to fil +& return coverag e%0A @@ -4117,62 +4117,8 @@ rue, -%0A iobuf='4G', sor
4a179d877ec9499448da4de05fdd03a0bbcf2300
Change meta_updated instead of meta_created at update
collectors/base/record.py
collectors/base/record.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import uuid import scrapy import logging from datetime import datetime from abc import abstractmethod from . import fields logger = logging.getLog...
Python
0
@@ -3256,27 +3256,27 @@ _id', 'meta_ -upd +cre ated'%5D:%0A
c6160abcb4fa716ed595e2d2e420656fef0d66a7
Allow override base port when running tests locally
nginx.bzl
nginx.bzl
# Copyright (C) Endpoints Server Proxy Authors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of condi...
Python
0.000008
@@ -2320,17 +2320,33 @@ %5D = -str( +%22$%7BTEST_PORT:-%25s%7D%22 %25 port -) %0A p
471c17f31e64effb5a55df1c91a96c4d350ca220
remove wilder_scheiss
nodedb.py
nodedb.py
import json from node import Node from link import Link from bs4 import BeautifulSoup from urllib.request import urlopen class NodeDB: def __init__(self): self._nodes = [] self._links = [] # fetch list of links def get_links(self): return [self.map_link(x) for x in self._links] # fetch list of n...
Python
0.999985
@@ -5757,515 +5757,4 @@ %5B1%5D%0A -%0A def find_link(self, i):%0A for link in self._links:%0A if i in link%5B0%5D:%0A return link%0A%0A def wilder_scheiss(self):%0A for node in self._nodes:%0A if node.group == 3 and node.gps:%0A i = self._nodes.index(node)%0A link = self.find_li...
f130dcd0e82e23a5c3d060f35372d6ccb6eb7c87
add rack to formatter
clusto_query/scripts/main.py
clusto_query/scripts/main.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- from __future__ import absolute_import import itertools import logging import optparse import sys import string import clusto import clusto.script_helper from clusto_query.query.objects import RFC1918 from clusto_query.lexer import lex from clusto_query.parser import p...
Python
0
@@ -2295,32 +2295,209 @@ ot in RFC1918)%0A%0A + def rack(self):%0A return ','.join(%0A p.name for p%0A in self.host.parents()%0A if isinstance(p, clusto.drivers.racks.BasicRack)%0A )%0A%0A def __getite
cb216d82508248c531730c7bdc1bd408b7d7f792
fix debug messages
ckanext/ldap/plugin.py
ckanext/ldap/plugin.py
import logging import uuid import ldap from pylons import session import ckan.plugins as p import ckan.lib.helpers as h import ckan.model as model import ckan.logic.schema as schema t = p.toolkit log = logging.getLogger(__name__) def _no_permissions(context, msg): user = context['user'] return {'success':...
Python
0.000044
@@ -2609,16 +2609,28 @@ sername' + %25 ldap_user )%0A @@ -2773,32 +2773,33 @@ log.info( +( 'failed login fo @@ -2816,16 +2816,29 @@ %60%25s%60%5Cn' + %25 ldap_user) + str(e @@ -3072,16 +3072,28 @@ me %60%25s%60' + %25 ldap_user )%0A
e31ee6294121de6795697f23a40b579442d6ca70
Add full url path to prerender logging statements
common/helpers/caching.py
common/helpers/caching.py
from civictechprojects.sitemaps import all_sitemap_paths from common.helpers.constants import FrontEndSection from common.helpers.front_end import section_url from django_seo_js import settings from django_seo_js.helpers import update_cache_for_url, request_should_be_ignored from django_seo_js.backends import SEOBacken...
Python
0
@@ -971,60 +971,8 @@ th:%0A - print('Can prerender ' + full_path)%0A @@ -1610,20 +1610,31 @@ request. +get_full_ path +() )%0A @@ -1985,32 +1985,110 @@ return%0A%0A + print('Prerender: Retrieving prerendered ' + request.get_full_path())%0A url = se
cf2f5b8deb3c93aca80a1067b4ea4190058b188d
Document view.
annotation/views.py
annotation/views.py
# Copyright 2013 Netherlands eScience Center # # 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 t...
Python
0
@@ -4655,32 +4655,100 @@ acker(request):%0A + %22%22%22Returns gps+accel data of tracker in a certain time range%22%22%22%0A cur = reques
628a98f034360bbe48d5a5a7bdaad90165251755
update application
Controller/exp_monitorThroughput.py
Controller/exp_monitorThroughput.py
# Copyright (c) 2011-2013 Peng Sun. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the COPYRIGHT file. # HONE application # monitor the throughputs across hosts of application trafclient from hone_lib import * from math import * import time K = 0.2 def query...
Python
0.000001
@@ -573,17 +573,17 @@ Every( -2 +1 000))%0A @@ -2433,16 +2433,66 @@ put(x):%0A + outputFile = open('logs/throughput.txt', 'a')%0A sumR @@ -2496,24 +2496,24 @@ umRate = %5B%5D%0A - for (hos @@ -2587,41 +2587,37 @@ int -'hostID:%7B0%7D. timestamp:%7B1%7D. data: +%3E%3E outputFile, 'host %7B0%7D %7B...
19f7840b562555fb085bbafa849ebcee521d89cf
Add some comments
whos@home.py
whos@home.py
#!/usr/bin/env python3 print('Loading...') import subprocess, sys, json, time, os # Color class used to print colors class colors: PURPLE = '\033[95m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BOLD = '\033[1m' UNDERLINE = '\033[4m' END = '\033[0m' def print_help(): print(col...
Python
0
@@ -616,17 +616,38 @@ nterface + and file output mode %0A - interfac @@ -1421,16 +1421,97 @@ people%22: +%09%09# Refuse 'people' as filename to avoid conflicts with people.json (config file) %0A%09%09%09%09pri @@ -2563,13 +2563,9 @@ PE)%0A - %0A + def @@ -2875,19 +2875,16 @@ , file)%0A -%09%09%09 %0A%0A#...
1af422fdf5d6ec32e215fecc0caa56331f9a0919
Remove version command.
numsed.py
numsed.py
""" numsed: compiling python to sed """ from __future__ import print_function import argparse import os import webbrowser import common import transformer import opcoder import sedcode import snippet_test VERSION = '0.01' USAGE = ''' %s Version %s Usage numsed.py -h | -H ...
Python
0
@@ -6539,91 +6539,8 @@ if -False: # args.version:%0D%0A print(__doc__)%0D%0A print(VERSION)%0D%0A%0D%0A elif args
619b08b6d19769220d7c2d230797473eb504ba24
Update trns_validate_SBML_FBAModel.py
plugins/scripts/validate/trns_validate_SBML_FBAModel.py
plugins/scripts/validate/trns_validate_SBML_FBAModel.py
#!/usr/bin/python # This code is part of KBase project to validate #the sbml files #PYTHON USE import sys, getopt import os.path import subprocess import json import logging #KBASE USE import biokbase.Transform.script_utils as script_utils desc1 = ''' NAME trns_validate_KBaseFBA.SBML.py -- Validate the fasta f...
Python
0.000001
@@ -648,15 +648,8 @@ = %22 -../bin/ vali
36643e757214ac87a2418c94434e657eaf4adb8c
fix a possible bug in anyconfig.schema.validate that it may return success even if validation failed for some cases
anyconfig/schema.py
anyconfig/schema.py
# # Copyright (C) 2015 Satoru SATOH <ssato redhat.com> # License: MIT # """anyconfig.schema module. """ from __future__ import absolute_import import anyconfig.compat try: import jsonschema except ImportError: pass _SIMPLETYPE_MAP = {list: "array", tuple: "array", bool: "boolean", ...
Python
0.000007
@@ -1628,16 +1628,46 @@ hecker)%0A + return (True, '')%0A @@ -1724,16 +1724,43 @@ emaError +,%0A Exception ) as exc
acdd323b330080795425ab44e3d261cbefbdf78a
Fix representation of actions
ohneio.py
ohneio.py
import collections import functools import inspect import io class Buffer: def __init__(self): self.queue = collections.deque() self.position = 0 def write(self, chunk): self.queue.append(chunk) def _get_queue(self): assert len(self.queue) > 0 or self.position == 0, ("We ...
Python
0.001772
@@ -3684,16 +3684,17 @@ on: %7B!r%7D +%3E '.format @@ -3698,16 +3698,21 @@ mat(self +.name )%0A%0A%0A_get
b31217a1a0ed68e0dfee2fdea87aad569c73573f
update batch timing
clock.py
clock.py
from apscheduler.schedulers.blocking import BlockingScheduler from farmsList.imports import every_night_at_1am from rq import Queue from worker import conn import logging logging.basicConfig() q = Queue(connection=conn) sched = BlockingScheduler() @sched.scheduled_job('cron', hour=21, minute=11)# hour=1) def schedule...
Python
0
@@ -289,17 +289,17 @@ minute=1 -1 +4 )# hour=
a991d462e8b29e6a6622f046df4f1abd29f64b28
update ZippyshareCom
src/pyload/plugins/downloaders/ZippyshareCom.py
src/pyload/plugins/downloaders/ZippyshareCom.py
# -*- coding: utf-8 -*- import re import urllib.parse from bs4 import BeautifulSoup from pyload.core.utils.misc import eval_js from ..anticaptchas.ReCaptcha import ReCaptcha from ..base.simple_downloader import SimpleDownloader class ZippyshareCom(SimpleDownloader): __name__ = "ZippyshareCom" __type__ = "...
Python
0
@@ -348,12 +348,12 @@ = %22 -0.98 +1.00 %22%0A @@ -1293,66 +1293,42 @@ = r' -(?:%3Ctitle%3EZippyshare.com - %7C%22/)(?P%3CN%3E%5B%5E/%5D+)(?:%3C/title%3E%7C +%22/d/%5B%5Cw%5E_%5D+/%22.*%22.*/(?P%3CN%3E%5B%5E/%5D+?) %22; -) '%0A
ba35ca873069ac149e0db3e0831097a95c6149bb
Add docstrings.
orders.py
orders.py
""" Order matching objects. """ import json class _Singleton(type): _instances = {} def __call__(cls, *args, **kwargs): if cls not in cls._instances: cls._instances[cls] = super(_Singleton, cls).__call__(*args, **kwargs) return cls._instances[cls] class Singleton(_Singleton('Sing...
Python
0
@@ -2997,32 +2997,130 @@ t(self, order):%0A + %22%22%22%0A Post the order to appropriate side of order book in sorted order.%0A %22%22%22%0A side = N @@ -3482,32 +3482,109 @@ f orders(self):%0A + %22%22%22%0A Returns a dict containing entire order book.%0A %22%22%22%...
b7ff53128c9c5b7eb9d5750bcc1bf16661e005dc
Check for implemented methods
wutu/util.py
wutu/util.py
import os import inspect import tempfile from flask import Response, request from flask_restful import Api as FlaskAPI from logbook import Logger from contextlib import contextmanager from wutu.module import Module modules = set() from typing import List, Dict, TypeVar, Any, Callable T = TypeVar("T") def get_logger(...
Python
0.000001
@@ -3895,23 +3895,337 @@ def -is_stub(method) +get_implemented_methods(module: Module) -%3E list:%0A %22%22%22%0A Returns implemented methods in module%0A :param module:%0A :return:%0A %22%22%22%0A return %7Bkey.lower(): val for key, val in dict(inspect.getmembers(module.__class__, predicate=inspect...
aed52a30f6a3131d0e5401ef3cb4c9e788fe3979
Use new pull_requests api element
close_pull_requests.py
close_pull_requests.py
#!/usr/bin/env python """ Close PRs on repositories where the master is not on github. Provide a closing comment, and print the lock URL if desired """ import argparse import logging import yaml from client import get_github3_client DEFAULT_MESSAGE = 'We do not use Pull Requests on this repo. Please see ' \...
Python
0
@@ -1043,21 +1043,28 @@ in repo. -issue +pull_request s(state= @@ -1076,44 +1076,8 @@ '):%0A - if pr.pull_request:%0A @@ -1157,33 +1157,32 @@ - organization, re @@ -1203,20 +1203,16 @@ - if close @@ -1225,28 +1225,24 @@ - - pr.create_co @@ -1...
a3d99553baf56876e6ad842f0a55568bc13a6db5
Remove some debug code
LMA/live.py
LMA/live.py
""" This code can be used to display a stream of LiveLMA data, read using the Websocket stream support in lmatools. Example ------- # In an IPython notebook, you can then run: %pylab server="ws://someuniversity.edu:port/path/to/stream" import numpy as np from datetime import datetime today = datetime.now().date() b...
Python
0.001032
@@ -1235,326 +1235,8 @@ nt%0A%0A -def force_debug(func):%0A def wrapped(*args, **kwargs):%0A try:%0A func(*args,**kwargs)%0A except:%0A import sys, traceback%0A exc_type, exc_value, exc_traceback = sys.exc_info()%0A print(exc_value, traceback.extract_tb(exc_...
a34994bb6ae23f04627ab384fa2c2905997925a9
Revert rendering.
web/views.py
web/views.py
import json from django.http import Http404, HttpResponse from django.views.generic import TemplateView from django.shortcuts import redirect, render from django.template.loader import render_to_string from .models import Game, Player from .utils import create_new_game, generate_unique_anonymous_username, calculate_s...
Python
0
@@ -147,60 +147,8 @@ nder -%0Afrom django.template.loader import render_to_string %0A%0Afr @@ -1989,34 +1989,21 @@ urn -render_to_string(request, +HttpResponse( str(
f958ef0179f72adb4b8c7243fc30395de1c31d6b
add authentication now required by https://issues.apache.org/jira
utils/jira.py
utils/jira.py
#!/usr/bin/env python # 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 # "L...
Python
0
@@ -801,90 +801,574 @@ se.%0A - %0Aimport requests%0Aimport json%0Aimport sys%0Aimport pprint%0A %0Afilterid=str(sys.argv%5B1%5D) +%22%22%22jira.py: Output jira issues from https://issues.apache.org/jira into RST format for Apche CloudStack Release-Notes.%0A%0AUsage:%0A jira.py FILTERID -p USERNAME -u PASSWORD%0A ji...
aa5b93993d970a1cca9ed060639e40fc72ebfdb8
Version bump: 1.1.0 -> 1.1.1
iprestrict/__init__.py
iprestrict/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .restrictor import IPRestrictor __all__ = ["IPRestrictor"] __version__ = "1.1.0"
Python
0.000001
@@ -147,7 +147,7 @@ 1.1. -0 +1 %22%0A
afc99f3b6f01a0267c80ebab9f08538da07c9898
Allow https urls for Youtube embeds
MarkdownPP/Modules/YoutubeEmbed.py
MarkdownPP/Modules/YoutubeEmbed.py
# Copyright (C) 2012 Alex Nisnevich # Licensed under the MIT license from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import re import os from MarkdownPP.Module import Module from MarkdownPP.Transform import Transform youtube_url_re = re.compile('^...
Python
0
@@ -323,24 +323,26 @@ IDEO%5Cs+%22http +s? ://www%5C.yout
b631482e00e59224cb32682f6a9d221748368158
Remove os package
fabfile.py
fabfile.py
from datetime import datetime import os from fabric.api import ( cd, env, local, put, run, sudo, task ) PRODUCTION_IP = '54.154.235.243' PROJECT_DIRECTORY = '/home/ubuntu/ztm/' BACKUP_DIRECTORY = '/home/ubuntu/backup/' COMPOSE_FILE = 'compose-production.yml' @task def production(): ...
Python
0.000001
@@ -26,18 +26,8 @@ time -%0Aimport os %0A%0Afr
ea2b67cd016492f1869f50f899360c3151977e79
Fix docstring term
csunplugged/topics/management/commands/_GlossaryTermsLoader.py
csunplugged/topics/management/commands/_GlossaryTermsLoader.py
"""Custom loader for loading glossary terms.""" import os.path from django.db import transaction from utils.BaseLoader import BaseLoader from topics.models import GlossaryTerm class GlossaryTermsLoader(BaseLoader): """Custom loader for loading glossary terms.""" def __init__(self, glossary_folder_path, glo...
Python
0.000017
@@ -404,28 +404,21 @@ ing -programming exercise +glossary term s.%0A%0A
f4feca8d4c76806c4c1f088e606fb9e66e188c89
Update cloudtrail mq plugin mapping
mq/plugins/cloudtrail.py
mq/plugins/cloudtrail.py
# 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 https://mozilla.org/MPL/2.0/. # Copyright (c) 2017 Mozilla Corporation from mozdef_util.utilities.key_exists import key_exists class message(object...
Python
0
@@ -2337,24 +2337,73 @@ ceprofile',%0A + 'details.requestparameters.imageid',%0A @@ -2932,24 +2932,78 @@ edentials',%0A + 'details.responseelements.dbsubnetgroup',%0A
146fd2b574dddea414c5b3523ec472e5af1f9f44
Add note about the fact that Rally won't use testtools' assertions
rally/task/functional.py
rally/task/functional.py
# Copyright 2015: Red Hat, 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 b...
Python
0.000051
@@ -684,16 +684,971 @@ object): +%0A %22%22%22Functional assertions.%0A%0A The Rally core team deliberately decided not to use an existing framework%0A for this such a %60testtools%60.%0A%0A Using 'testtools' would introduce the following problems:%0A - Rally production code works with testing tools cod...
ebbf256bf505bf119c4c961d99c12afd7e6c0ca3
Create memory dynamically (#4938)
pytorch_lightning/trainer/supporters.py
pytorch_lightning/trainer/supporters.py
# Copyright The PyTorch Lightning team. # # 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 i...
Python
0
@@ -1562,39 +1562,12 @@ y = -torch.zeros(self.window_length) +None %0A @@ -2011,32 +2011,133 @@ accumulator.%22%22%22%0A + if self.memory is None:%0A self.memory = torch.zeros(self.window_length, *x.shape)%0A%0A # ensure
f21abdbc675d0271419c78a293267289935de65f
add user and date to scaninfo
irma/common/objects.py
irma/common/objects.py
import re import config.dbconfig as dbconfig from lib.irma.database.objects import DatabaseObject from lib.irma.machine.libvirt_manager import LibVirtMachineManager from lib.irma.common.exceptions import IrmaAdminError class AttributeDictionary(dict): """A dictionnary with object-like accessors""" __getattr__...
Python
0
@@ -3,16 +3,46 @@ port re%0A +from datetime import datetime%0A import c @@ -978,32 +978,92 @@ dbname = dbname%0A + self.user = None%0A self.date = datetime.now()%0A self.oid
179308a7061b2e0b1bb10d5c7757a611196608db
change fabfile
fabfile.py
fabfile.py
from distutils.util import strtobool from fabric.api import local, abort, run, sudo from fabric.context_managers import cd, settings, hide, shell_env from fabric.contrib.console import confirm from getpass import getpass from fabric.utils import puts from fabric.state import env env.control_dir = 'pipecontrol' def w...
Python
0.000001
@@ -1449,25 +1449,20 @@ -with_sudo +pull ()%0A @@ -1464,20 +1464,26 @@ -down +sync_files ()%0A @@ -1477,36 +1477,41 @@ files()%0A -pull +with_sudo ()%0A sync_ @@ -1501,34 +1501,28 @@ o()%0A -sync_files +down ()%0A b
3f4614720d376a8f8caf008f8a6930d97d65db1a
align french
SCT/benchmark_aligner.py
SCT/benchmark_aligner.py
import sys import shutil, os sys.path.insert(0, os.path.expanduser('~/Montreal-Forced-Aligner')) import time import logging import platform import csv import statistics from datetime import datetime from aligner.command_line.train_and_align import align_corpus, align_corpus_no_dict #corpus_dir = '/media/share/datase...
Python
0.999998
@@ -419,23 +419,29 @@ /sorted_ -tagalog +quebec_french '%0A#dict_ @@ -531,20 +531,124 @@ _path = -None +os.path.expanduser('~/Montreal-Forced-Aligner/dist/montreal-forced-aligner/prosodylab.dictionaries/fr.dict') %0A#output @@ -740,23 +740,29 @@ aligned_ -tagalog +quebec_french '%0Aoutput @@ -807,23 +807,29 @@ ...
33fa555cb8657589b47b6533094069e5ddde4000
Rename new companies dataset (no geolocation)
serenata_toolbox/datasets/downloader.py
serenata_toolbox/datasets/downloader.py
import asyncio import os import aiofiles import aiohttp from tqdm import tqdm MAX_REQUESTS = 4 class Downloader: LATEST = ( '2016-08-08-ceap-datasets.md', '2016-08-08-current-year.xz', '2016-08-08-datasets-format.html', '2016-08-08-last-year.xz', '2016-08-08-previous-yea...
Python
0.000081
@@ -1311,24 +1311,39 @@ 21-companies +-no-geolocation .xz'%0A )%0A%0A
3d2b08a971ded9fa4bf3a3d7c69c15e589b6adab
add v0.8.1 (#21798)
var/spack/repos/builtin/packages/py-parso/package.py
var/spack/repos/builtin/packages/py-parso/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyParso(PythonPackage): """Parso is a Python parser that supports error recovery and round...
Python
0
@@ -542,149 +542,503 @@ ('0. -6.1', sha256='56b2105a80e9c4df49de85e125feb6be69f49920e121406f15e7acde6c9dfc57')%0A%0A depends_on('python@2.7:2.8,3.4:', type=('build', 'run') +8.1', sha256='8519430ad07087d4c997fda3a7918f7cfa27cb58972a8c89c2a0295a1c940e9e')%0A version('0.6.1', sha256='56b2105a80e9c4df49de85e125feb6...
deb2bb30b6f584a7a899d7c161605efadee468cf
add optional /geo suffix to /pollingstations
polling_stations/api/pollingstations.py
polling_stations/api/pollingstations.py
from rest_framework.mixins import ListModelMixin from rest_framework.viewsets import GenericViewSet from rest_framework_gis.serializers import GeoFeatureModelSerializer from pollingstations.models import PollingStation class PollingStationSerializer(GeoFeatureModelSerializer): class Meta: model = Polling...
Python
0.000003
@@ -1,28 +1,77 @@ +from rest_framework.decorators import list_route%0A from rest_framework.mixins i @@ -612,16 +612,137 @@ ationSerializer%0A +%0A @list_route(url_path='geo')%0A def geo(self, request, format=None):%0A return self.list(request, format=None)%0A
68f420099f1efc655757ec18097c6e389fa95cfb
fix case where an old subscriber subscribe again. it shouldn't stay flagged as old subscriber
product_subscription/models/invoice.py
product_subscription/models/invoice.py
# -*- coding: utf-8 -*- from datetime import datetime from openerp import models, fields, api class AccountInvoice(models.Model): _inherit = "account.invoice" subscription = fields.Boolean(string="Subscription") product_subscription_request = fields.One2many('product.subscription.request','inv...
Python
0.000001
@@ -1925,28 +1925,24 @@ id%0D%0A - subscriber.w
8ff0c9a996d88b345c15957d7881e61ee8db7014
Update gleu_score.py
nltk/translate/gleu_score.py
nltk/translate/gleu_score.py
# -*- coding: utf-8 -*- # Natural Language Toolkit: GLEU Score # # Copyright (C) 2001-2016 NLTK Project # Authors: # Contributors: # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ GLEU score implementation. """ from __future__ import division from collections import Counter from nltk.util impo...
Python
0.000002
@@ -446,39 +446,32 @@ vel -CHRF (Character n-gram F- +GLEU (Google-BLEU) score -) des
f961c1031285c5852e46f880668b963d27245ace
Rename _table to table
examples/tictactoe-qlearning.py
examples/tictactoe-qlearning.py
import random from capstone.environment import Environment from capstone.game import TicTacToe from capstone.mdp import GameMDP from capstone.player import AlphaBeta, RandPlayer from capstone.util import ZobristHashing class TabularQLearning(object): def __init__(self, env, policy=RandPlayer(), alpha=0.1, gamma=...
Python
0.999999
@@ -495,25 +495,24 @@ self. -_ table = %7B%7D%0A%0A @@ -686,33 +686,32 @@ mp_value = self. -_ table.get((state @@ -1410,25 +1410,24 @@ alue = self. -_ table.get((s @@ -1540,25 +1540,24 @@ self. -_ table%5B(state @@ -1690,17 +1690,16 @@ in self. -_ table.it
dc40793ad27704c83dbbd2e923bf0cbcd7cb00ed
Handle both event instanciation from object and from serialized events
polyaxon/event_manager/event_service.py
polyaxon/event_manager/event_service.py
from libs.services import Service class EventService(Service): __all__ = ('record', 'setup') event_manager = None def can_handle(self, event_type): return isinstance(event_type, str) and self.event_manager.knows(event_type) def get_event(self, event_type, instance, **kwargs): return...
Python
0.000011
@@ -269,32 +269,49 @@ elf, event_type, + event_data=None, instance, **kwa @@ -295,32 +295,37 @@ a=None, instance +=None , **kwargs):%0A @@ -313,32 +313,75 @@ one, **kwargs):%0A + if instance or not event_data:%0A return s @@ -411,24 +411,28 @@ + + event_type,%0A @@ -431,1...
afc0b8cfb34830154b684732d395e68729e3a42f
remove obsolete test
corehq/apps/accounting/tests/test_forms.py
corehq/apps/accounting/tests/test_forms.py
from dateutil.relativedelta import relativedelta import random from corehq.apps.accounting.tasks import generate_invoices from corehq.apps.accounting.forms import AdjustBalanceForm from corehq.apps.accounting.models import ( CreditAdjustmentReason, CreditLine, Invoice, ) from corehq.apps.accounting.tests.t...
Python
0.002319
@@ -3529,1095 +3529,4 @@ ))%0A -%0A def test_transfer_debit_without_credit(self):%0A original_credit_balance = 0%0A CreditLine.add_credit(%0A original_credit_balance,%0A account=self.subscription.account,%0A subscription=self.subscription,%0A )%0A origin...
19e5608b2d8d16e2c80390927658e8f322dd10e6
Add new encodings. (#3292)
speech/google/cloud/speech/encoding.py
speech/google/cloud/speech/encoding.py
# Copyright 2016 Google 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, ...
Python
0
@@ -1028,24 +1028,188 @@ MR_WB encoding type.%22%22%22%0A +%0A OGG_OPUS = 'OGG_OPUS'%0A %22%22%22OGG_OPUS encoding type.%22%22%22%0A%0A SPEEX_WITH_HEADER_BYTE = 'SPEEX_WITH_HEADER_BYTE'%0A %22%22%22SPEEX_WITH_HEADER_BYTE encoding type.%22%22%22%0A
ec33d9bfe95eae4f9eecda86374522291603de70
version 0.0.2
mystarspilot/__init__.py
mystarspilot/__init__.py
""" MyStarsPilot - a CLI tool to search your starred Github repositories. """ __author__ = 'wolfg1969' __version__ = '0.0.1' __license__ = 'MIT'
Python
0.000003
@@ -115,17 +115,17 @@ = '0.0. -1 +2 '%0A__lice
0b82616ca79c9c1fb33ccec8406720160fe053a2
Prepend manga name for starkana
src/parsers/starkana.py
src/parsers/starkana.py
#!/usr/bin/python import re from parsers.base import SiteParserBase from util import getSourceCode class Starkana(SiteParserBase): #re_getPage = re.compile("<option.*?value=\"([^']*?)\"[^>]*>\s*(\d*)</option>") re_getMaxPages = re.compile('</select> of <strong>(\d*)') re_getImage = re.compile('img.*?cla...
Python
0
@@ -1951,48 +1951,8 @@ i)%0A%0A - self.isPrependMangaName = True%0A%0A
b2f2fcd9322837ea096a28ae584c8d236232c5a5
remove jython2.5 compat code
proton-j/src/main/resources/cproton.py
proton-j/src/main/resources/cproton.py
# # 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 # "License"); you may not...
Python
0.000001
@@ -1390,335 +1390,4 @@ t *%0A -%0A# XXX: this is for compatibility, apparently the version of jython we%0A# use doesn't have next, we should remove this when we upgrade%0A%0A_DEF = object()%0A%0Adef next(iter, default=_DEF):%0A try:%0A return iter.next()%0A except StopIteration:%0A if default is _...
511f422d61c97eb4d79b90c1dfe6baee40d1fe39
update srxlo unit test with inactive: term testing
tests/lib/srxlo_test.py
tests/lib/srxlo_test.py
# Copyright 2014 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 a...
Python
0
@@ -1210,16 +1210,117 @@ pt%0A%7D%0A%22%22%22 +%0AGOOD_TERM_3 = %22%22%22%0Aterm good-term-3 %7B%0A protocol:: icmpv6%0A action:: accept%0A option:: inactive%0A%7D%0A%22%22%22 %0A%0ASUPPOR @@ -5501,17 +5501,17 @@ OD_TERM_ -1 +3 , self.n @@ -5656,16 +5656,272 @@ OKENS)%0A%0A + def testInactiveTerm(self):%0A ...
5a71c7b3c98f17da619f630f4fe201da1efbee17
fix indentation of section checks (should be outside of the loop)
rowprocsv.py
rowprocsv.py
""" Module for reading and exporting csv files exported from Concept2 RowPro """ import datetime import tcx class RowProCSV: HEADER_SUMMARY = 'Date,TotalTime,TotalDistance,' FIELDS_SUMMARY = [ 'date', 'total_time', 'total_distance', 'avg_pace', 'unit', 'origin', 'total_cals', 'duty_cycle', 'type', '...
Python
0
@@ -2177,36 +2177,32 @@ break%0A%0A - if not summary_f @@ -2199,36 +2199,32 @@ summary_found:%0A - prin @@ -2274,28 +2274,24 @@ le'%0A - if not sampl @@ -2292,36 +2292,32 @@ samples_found:%0A - prin
f3aa9bc3a58df97d79850cc23011a7b119ddf49f
add get_masks() to environment
reliefparser/environment/environment.py
reliefparser/environment/environment.py
__author__ = 'max' import numpy as np NEGTIVE_REWARD = -1 class Environment(object): def __init__(self, heads, marks): assert heads.ndim == 2 assert marks.ndim == 2 self.__batch_size = heads.shape[0] self.__length = heads.shape[1] self.__sizes = marks.sum(axis=1) ...
Python
0.000002
@@ -1976,32 +1976,90 @@ lefts, rights%0A%0A + def get_masks(self):%0A return self.__marks%0A %0A def get_inde
f47aa8c478db9d6370fa73ae687bedc0e9974f41
Load module data on first access
nemubot/modulecontext.py
nemubot/modulecontext.py
# Nemubot is a smart and modulable IM bot. # Copyright (C) 2012-2015 Mercier Pierre-Olivier # # This program 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 yo...
Python
0
@@ -1718,26 +1718,24 @@ -# Load module +def load_ data +(): %0A @@ -1743,27 +1743,26 @@ -self.data = + return context @@ -3066,16 +3066,49 @@ nemubot%0A + def load_data():%0A @@ -3176,19 +3176,18 @@ -self.data = + return mod @@ -3990,16 +3990,51 @@ .data)...
27354d34f4f9117c0a3167f4af7d3e3c83d51c59
bump version # from 0.6.0 -> 0.7.0
cloudfeaster/__init__.py
cloudfeaster/__init__.py
__version__ = '0.6.0'
Python
0
@@ -14,9 +14,9 @@ '0. -6 +7 .0'%0A
38d298a81aa8fcd85b16b3879c1665085e5450be
Add description where student should add logic
exercises/control_flow/prime.py
exercises/control_flow/prime.py
#!/bin/python def is_prime(integer): """Determines weather integer is prime, returns a boolean value""" for i in range(2, integer): if integer % i == 0: return False return True print("Should be False (0): %r" % is_prime(0)) print("Should be False (1): %r" % is_prime(1)) print("Sho...
Python
0.000086
@@ -103,16 +103,76 @@ alue%22%22%22%0A + # add logic here to make sure number %3C 2 are not prime%0A%0A for
016aa4cccc572555d7d3feb7cde974aa8cb2fe25
Add docstring to snippet
Snippets/compact_gpos.py
Snippets/compact_gpos.py
import argparse from collections import defaultdict import csv import time import sys from pathlib import Path from typing import Any, Iterable, List, Optional, Sequence, Tuple from fontTools.ttLib import TTFont from fontTools.otlLib.optimize import compact MODES = [str(c) for c in range(1, 10)] def main(args: Opti...
Python
0.000001
@@ -1,12 +1,813 @@ +#! /usr/bin/env python3%0A%0A%22%22%22%0ASample script to use the otlLib.optimize.gpos functions to compact GPOS tables%0Aof existing fonts. This script takes one or more TTF files as arguments and%0Awill create compacted copies of the fonts using all available modes of the GPOS%0Acompaction algorit...
d5b326d8d368d2ac75c6e078572df8c28704c163
Use the app string version of foreign keying. It prevents a circular import.
vcs/models.py
vcs/models.py
from django.db import models class Activity(models.Model): group = models.CharField(max_length=4) grouptype = models.TextField() groupdetail = models.TextField() details = models.TextField() disabled = models.BooleanField() time = models.DecimalField(decimal_places=2, max_digits=10) unique_...
Python
0
@@ -410,59 +410,8 @@ l):%0A - from timetracker.tracker.models import Tbluser%0A @@ -453,15 +453,25 @@ +'tracker. Tbluser +' ,%0A
8a4d9d18f29abacbce5216f8b4dad07fa879162e
print explicit << DRY RUN >> in summary
redis-migrate/migrate.py
redis-migrate/migrate.py
#!/usr/bin/env python import os import argparse from urlparse import urlparse import redis from termcolor import cprint DEBUG = os.environ.get("DEBUG") DRY_RUN = os.environ.get("DRY_RUN") CLEAN_UP = os.environ.get("CLEAN_UP") if os.environ.get("REPLACE_DST_KEYS"): REPLACE_DST_KEYS = True else: REPLACE_DST_KE...
Python
0.000004
@@ -2691,32 +2691,46 @@ Migrated %25d keys + %3C%3C DRY RUN %3E%3E %22 %25 (len(keys) -
3b001eac78349e1e3f6235b14def0fa6752f6fba
add more dedup special cases
models/dedup_special_cases.py
models/dedup_special_cases.py
#!/usr/bin/python # -*- coding: utf-8 -*- data = [ { "main_profile": ("Hadley Wickham", "cran:reshape"), "people_to_merge": [ ("Hadley Wickham", "cran:GGally") ] }, { "main_profile": ("Barry Rowlingson", "cran:geonames"), "people_to_merge": [ ("B. S. Rowlingson", "cran:lgcp"), ("Barry Rowlingson"...
Python
0
@@ -759,15 +759,508 @@ %0A%09%09%5D%09%0A%09%7D -%09%09%09%09 +,%09%0A%09%7B%0A%09%09%22main_profile%22: (u%22Daniel M%C3%BCnch%22, %22cran:webchem%22),%0A%09%09%22people_to_merge%22: %5B%0A%09%09%09(%22Daniel Muench%22, %22cran:webchem%22)%0A%09%09%5D%09%0A%09%7D,%09%0A%09%7B%0A%09%09%22main_profile%22: (u%22Zhian N....
7295b55eb2967e87b909891ffee4b8a177a874e6
return 404 if no application exist
expenditure_application/main.py
expenditure_application/main.py
# -*- coding: UTF-8 -*- from __future__ import unicode_literals, print_function, division import time import logging from decimal import Decimal, ROUND_FLOOR import tornado.web import db from collection import DictObject from utils import convert_timestamp_to_utc_datetime, convert_datetime_to_client_timezone, get_curre...
Python
0.002439
@@ -598,32 +598,165 @@ pplication_id):%0A + application = get_application(application_id)%0A if not application:%0A self.send_error(404)%0A else:%0A self.ren @@ -791,20 +791,16 @@ ication= -get_ applicat @@ -802,32 +802,16 @@ lication -(application_id) )%0A%0A%0Aclas @@...
950b99ab173a4e5bf86a6df2dcbcf14e2e28915c
Add function parentheses
clowder/model/project.py
clowder/model/project.py
"""Model representation of clowder.yaml project""" import os from termcolor import colored from clowder.utility.git_utilities import ( git_clone_url_at_path, git_current_sha, git_litter, git_status, git_sync, git_sync_version, git_validate_repo_state ) class Project(object): """Model c...
Python
0.998877
@@ -2390,16 +2390,18 @@ l_prefix +() %0A
7a4819afdb8d4817da59040390c8f8ebc9a2bf3c
Replace messy list comprehensions with list function
conference_scheduler/tests/conftest.py
conference_scheduler/tests/conftest.py
import pytest import numpy as np from conference_scheduler.resources import ( Person, Slot, EventType, Event, Role, ScheduledItem, Shape ) from conference_scheduler import scheduler from conference_scheduler.lp_problem import utils as lpu @pytest.fixture(scope="module") def people(): return { 'alice':...
Python
0.999868
@@ -3070,35 +3070,13 @@ urn -%5B%0A item for item in +list( sche @@ -3104,22 +3104,17 @@ , slots) -%0A %5D +) %0A%0A%0A@pyte @@ -3286,26 +3286,13 @@ urn -%5Bitem for item in +list( sche @@ -3320,17 +3320,17 @@ , slots) -%5D +) %0A%0A%0A@pyte
0c8d6b9ef87edbbd9a6d012b5bed94e20d43d722
Delete the "stolen" BioPython code
vectorPLUS.py
vectorPLUS.py
import textwrap ###### # START IMPORTANT METHODS ###### # Returns a list (see below) of all matching sequences in the given scaffold # with a given initial search length. # [name, (start_index, end_index)] def tryFindStartCodon(scaffold, sequence, initialSearchLength=10): searchLength = initialSearchLength - 1...
Python
0.999484
@@ -1836,18 +1836,41 @@ ######%0A%0A - # +Poor replacement for the BioPyth @@ -1871,18 +1871,16 @@ ioPython -'s generat @@ -1886,82 +1886,23 @@ tor -for fasta files - returns (name, seq)%0A # Call using 'with open(file) as f' +written by Jack %0Adef @@ -1921,35 +1921,49 @@ file +Handle ):%0A -name, seq...
7bf1f8bef973942755cb245d567a34ffac119a3f
Revert "demote boot2docker or else bad stuff happens"
dusty/preflight.py
dusty/preflight.py
"""This module contains checks for system dependencies that are run when Dusty daemon first starts up. Any failed checks should throw an exception which bubbles up to the daemon and causes it to crash.""" from __future__ import absolute_import import os import logging import subprocess import warnings from .config i...
Python
0
@@ -485,30 +485,8 @@ rror -, check_output_demoted %0Afro @@ -2304,32 +2304,43 @@ alled_version = +subprocess. check_output_dem @@ -2335,24 +2335,16 @@ k_output -_demoted (%5B'boot2 @@ -2567,32 +2567,43 @@ alled_version = +subprocess. check_output_dem @@ -2594,32 +2594,24 @@ check_output -_demoted (%5B'docke...
1abbca6200fa3da0a3216b18b1385f3575edb49a
Move import of Django's get_version into django-registration's get_version, to avoid dependency-order problems.
registration/__init__.py
registration/__init__.py
from django.utils.version import get_version as django_get_version VERSION = (0, 9, 0, 'beta', 1) def get_version(): return django_get_version(VERSION) # pragma: no cover
Python
0
@@ -1,8 +1,64 @@ +VERSION = (0, 9, 0, 'beta', 1)%0A%0A%0Adef get_version():%0A from dja @@ -120,62 +120,8 @@ ion%0A -%0A%0AVERSION = (0, 9, 0, 'beta', 1)%0A%0A%0Adef get_version():%0A
db5cb125fb9b0dd4d3b781d0b85250bdc7a52cba
fix error msg
dvc/command/add.py
dvc/command/add.py
from dvc.exceptions import DvcException from dvc.command.common.base import CmdBase class CmdAdd(CmdBase): def run(self): for target in self.args.targets: try: self.project.add(target) except DvcException as ex: self.project.logger.error('Failed to a...
Python
0
@@ -320,11 +320,30 @@ add -%7B%7D' +%5C'%7B%7D%5C''.format(target) , ex
3dd67c1d4fbda2d5006c49a5b49345c550c66091
extend towline backward instead
lib/void/ship.py
lib/void/ship.py
# Copyright (c) 2008 Mikael Lind # # 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, distr...
Python
0
@@ -2931,24 +2931,25 @@ unit = +- box2d.b2Vec2
969b99f02f7db10103eb426e0a31e569998a82ae
fix #2394
module/plugins/hoster/Http.py
module/plugins/hoster/Http.py
# -*- coding: utf-8 -*- import re import urlparse from module.plugins.internal.Hoster import Hoster class Http(Hoster): __name__ = "Http" __type__ = "hoster" __version__ = "0.06" __status__ = "testing" __pattern__ = r'(?:jd|pys?)://.+' __config__ = [("activated", "bool", "Activated"...
Python
0
@@ -706,86 +706,8 @@ oc%0A%0A - link = self.isresource(url)%0A%0A if not link:%0A return%0A%0A @@ -757,20 +757,19 @@ ownload( -link +url , ref=Fa
f91f2c0f355e2d9ae413b0cef30fe80e35dc6be8
fix for issue #1
remote/client/connect.py
remote/client/connect.py
""" connect.py: Authenticate and register on remote server """ __author__ = "Daniel Mazzer" __copyright__ = "Copyright 2016, NORS Project" __credits__ = "" __license__ = "MIT" __maintainer__ = "Daniel Mazzer" __email__ = "dmazzer@gmail.com" import json import requests from norsutils.logmsgs.logger import Logge...
Python
0
@@ -4991,16 +4991,17 @@ TPError: + %22, e.mes @@ -5025,26 +5025,25 @@ -print r.status_cod +return None , Non e%0A @@ -5977,32 +5977,63 @@ , None%0A +%0A return None , None %0A %0A de @@ -6305,29 +6305,30 @@ %0A r -eturn +v, r = self._post_ @@ -6356,16 +6356,49 @@ ...
b5d32a3b1b8e85222497c4736c0c6707003dc848
Fix broken database IO tests.
pybtex/tests/database_test/__init__.py
pybtex/tests/database_test/__init__.py
# Copyright (C) 2009 Andrey Golovizin # # 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 distribut...
Python
0
@@ -1128,15 +1128,8 @@ gin) -.Parser (enc @@ -1209,15 +1209,8 @@ gin) -.Writer (enc
37d01f6088b1cf5673f66f4532dd51c73a0156f1
Fix grammar in login error message
rest_framework/authtoken/serializers.py
rest_framework/authtoken/serializers.py
from django.contrib.auth import authenticate from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers class AuthTokenSerializer(serializers.Serializer): username = serializers.CharField() password = serializers.CharField() def validate(self, attrs): username...
Python
0.000763
@@ -783,16 +783,17 @@ e to log + in with
059090cd945f51ed0281a967e1ba9502d2dc0a40
Fix unittest
pymatgen/apps/borg/tests/test_queen.py
pymatgen/apps/borg/tests/test_queen.py
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals """ Created on Mar 18, 2012 """ __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "S...
Python
0.99804
@@ -910,9 +910,9 @@ a), -6 +7 )%0A%0A
c750435cb79610cce1aa1855b8317858ae2e96bf
Change field name to reflect naming standard
oahapi/ratechecker/models.py
oahapi/ratechecker/models.py
from django.db import models # I'm not fond of how these fields are named, but I tried to balance # Python naming conventions with how the fields are actually referred to # outside this software. class Product(models.Model): """ Loan Product. """ FIXED = 'FIXED' ARM = 'ARM' PAYMENT_TYPE_CHOICES = (...
Python
0
@@ -2531,16 +2531,17 @@ single +_ family =
b25fc29766d5df3567dc92f8d6078a0178e67bd4
Fix unittest.
pymatgen/symmetry/tests/test_groups.py
pymatgen/symmetry/tests/test_groups.py
#!/usr/bin/env python """ TODO: Modify unittest doc. """ from __future__ import division __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Virtual Lab" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "ongsp@ucsd.edu" __date__ = "4/10/14" import unittest import numpy as n...
Python
0.000001
@@ -2665,21 +2665,10 @@ 3,)) -%0A p / -= 100
098219137bdf30d7ac1c321f7973e14bfc82bda4
Add configuration for PyBullet Ant.
agents/scripts/configs.py
agents/scripts/configs.py
# Copyright 2017 The TensorFlow Agents Authors. # # 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
@@ -2950,28 +2950,259 @@ very = 60%0A return locals()%0A +%0A%0Adef bullet_ant():%0A locals().update(default())%0A # Environment%0A import pybullet_envs # noqa pylint: disable=unused-import%0A env = 'AntBulletEnv-v0'%0A max_length = 1000%0A steps = 3e7 # 30M%0A update_every = 60%0A return locals()%0A
e7530150120a542f264acc4c7ba74418c5e2ecdb
Add download_text and extractor train views.
extractor_train/public/views.py
extractor_train/public/views.py
# -*- coding: utf-8 -*- '''Public section, including homepage and signup.''' from flask import (Blueprint, request, render_template, flash, url_for, redirect, session) from flask.ext.login import login_user, login_required, logout_user from extractor_train.extensions import login_manager from extra...
Python
0
@@ -181,16 +181,31 @@ ession)%0A +%0Aimport flask%0A%0A from fla @@ -2071,24 +2071,1314 @@ /about.html%22, form=form) +%0A%0A@blueprint.route(%22/download_text/%3Cint:downloads_id%3E%22)%0Adef download_text( downloads_id ):%0A print 'downloads_id', downloads_id%0A download = get_download( downloads_id )%0A%0A...
8843e1e1d648b387db3197c0f8fec54d6c2d5507
Fix docstrings in vsc.utils.missing to epydoc format
lib/vsc/utils/missing.py
lib/vsc/utils/missing.py
#!/usr/bin/env python ## # Copyright 2012 Ghent University # Copyright 2012 Andy Georges # # This file is part of VSC-tools, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vsce...
Python
0.000014
@@ -1099,16 +1099,17 @@ .%0A##%0A%22%22%22 +%0A Various @@ -1169,16 +1169,18 @@ brary.%0A%0A + - nub(li @@ -1221,16 +1221,18 @@ he list%0A + - find_s @@ -1287,16 +1287,20 @@ he first +%0A occuren @@ -1329,16 +1329,18 @@ he list%0A + - Monoid @@ -1378,16 +1378,18 @@ concept%0A + - Monoid @@ -144...
f9f76e3889e351071eff98374b8419777d474cad
use urlunparse
oauth10a/signing_requests.py
oauth10a/signing_requests.py
""" All Token requests and Protected Resources requests MUST be signed by the Consumer and verified by the Service Provider. The purpose of signing requests is to prevent unauthorized parties from using the Consumer Key and Tokens when making Token requests or Protected Resources requests. The signature process encodes...
Python
0.000024
@@ -2981,21 +2981,36 @@ urn -'%25s://%25s%25s' %25 +urlparse.urlunparse(%0A (pa @@ -3041,16 +3041,35 @@ sed.path +, None, None, None) )%0A%0A%0Aclas
215439b43c27271c95fc208bf683a19619c81b8d
Add 3D slic tests (gray not working yet)
skimage/segmentation/tests/test_slic.py
skimage/segmentation/tests/test_slic.py
import numpy as np from numpy.testing import assert_equal, assert_array_equal from skimage.segmentation import slic def test_color(): rnd = np.random.RandomState(0) img = np.zeros((20, 21, 3)) img[:10, :10, 0] = 1 img[10:, :10, 1] = 1 img[10:, 10:, 2] = 1 img += 0.01 * rnd.normal(size=img.shap...
Python
0
@@ -1,12 +1,35 @@ +import itertools as it%0A import numpy @@ -35,16 +35,16 @@ y as np%0A - from num @@ -148,16 +148,19 @@ st_color +_2d ():%0A @@ -661,16 +661,17 @@ :%5D, 3)%0A%0A +%0A def test @@ -675,16 +675,19 @@ est_gray +_2d ():%0A @@ -1142,32 +1142,32 @@ g%5B:10, 10:%5D, 1)%0A - assert_arra...
52eb6a3d8188c5e8fbabbe4f4822d0c4ececf48b
Add option to see all available ldap attributes via ldapsearch command
pucas/management/commands/ldapsearch.py
pucas/management/commands/ldapsearch.py
from django.conf import settings from django.core.management.base import BaseCommand, CommandError from pucas.ldap import LDAPSearch, LDAPSearchException class Command(BaseCommand): help = 'Look up one or more users in LDAP by netid' def add_arguments(self, parser): parser.add_argument('netid', narg...
Python
0
@@ -319,16 +319,139 @@ rgs='+') +%0A parser.add_argument('--all', '-a', action='store_true',%0A help='Retrieve all available LDAP attributes') %0A%0A de @@ -519,16 +519,46 @@ earch()%0A + print(options%5B'all'%5D)%0A @@ -708,27 +708,249 @@ etid -)%0A # +, all_att...
ea3a390a88c63a566df567d245e22e505f17dcfe
Remove test_TextFile_bad_extension
tests/test_artefacts.py
tests/test_artefacts.py
import pytest from pirec import artefacts def test_Artefact_basename(): """basename() should strip the extension from an artefact filename.""" img = artefacts.Artefact('foo.nii.gz', '.nii.gz', exists=False) assert img.basename == 'foo' def test_Artefact_dirname(): """dirname() should return the path...
Python
0.000005
@@ -1738,141 +1738,8 @@ )%0A%0A%0A -def test_TextFile_bad_extension():%0A with pytest.raises(ValueError):%0A img = artefacts.NiiGzImage('foo.txx', exists=False)%0A%0A%0A def
5799a3b5127e09a0c705f9551deece75e6de321e
Fix docstrings in neurom.geom.transform
neurom/geom/transform.py
neurom/geom/transform.py
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
Python
0.000592
@@ -3925,91 +3925,60 @@ ect -with one of the following types:%0A 'NeuriteType', 'Neuron', 'fst.Neuron' +to be translated. Must implement a transform method. %0A%0A @@ -4342,11 +4342,14 @@ .g. -tre +neurit e, n @@ -4354,16 +4354,64 @@ neuron) +.%0A Must implement a transform method. %0A...
7b27c6aa2c30317c4cbc1510ddf05b6b305209b0
Update objax/functional/core/ops.py
objax/functional/core/ops.py
objax/functional/core/ops.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0
@@ -1660,17 +1660,17 @@ scale: i -m +n t or tup
1834dff2b4af497ea70ad03dd3806086b20bbe82
Introduce a method to help us create VMs (not clones)
virtualbox.py
virtualbox.py
""" A salt cloud provider that lets you use virtualbox on your machine and act as a cloud. For now this will only clone existing VMs. It's best to create a template from which we will clone. Followed https://docs.saltstack.com/en/latest/topics/cloud/cloud.html#non-libcloud-based-modules to create this. Dicts provide...
Python
0
@@ -5677,16 +5677,404 @@ vbox%0A%0A%0A +def vb_create_machine(name=None):%0A vbox = vb_get_manager()%0A log.info(%22Create virtualbox machine %25s %22 %25 (name,))%0A groups = None%0A osTypeId = %22Other%22%0A new_machine = vbox.createMachine(%0A None, # Settings file%0A name,%0A ...
547afc8237b31d8dec9eb4a15fff5d69936b3ed1
Use load_ui from glue
glue_exp/importers/vizier/qt_widget.py
glue_exp/importers/vizier/qt_widget.py
import os from glue.external.qt import QtGui from glue.external.qt.QtCore import Qt # TODO: update to use glue.qt once load_ui has been generalized from PyQt4.uic import loadUi from .vizier_helpers import query_vizier, fetch_vizier_catalog __all__ = ["QtVizierImporter"] UI_MAIN = os.path.join(os.path.dirname(__fil...
Python
0
@@ -82,87 +82,27 @@ Qt%0A -%0A# TODO: update to use glue.qt once load_ui has been generalized%0Afrom PyQt4.uic +from glue.qt.qtutil imp @@ -109,17 +109,18 @@ ort load -U +_u i%0A%0Afrom @@ -412,17 +412,18 @@ i = load -U +_u i(UI_MAI
12b1da21a5c738f28125f130daf11173520bbc16
Add support for kramdown/Jeklly as a flavor for MarkdownTableWriter class
pytablewriter/writer/text/_markdown.py
pytablewriter/writer/text/_markdown.py
import copy from typing import List import dataproperty as dp import typepy from dataproperty import ColumnDataProperty, DataProperty from mbstrdecoder import MultiByteStrDecoder from ...error import EmptyTableDataError from ...style import Align, GFMarkdownStyler, MarkdownStyler, StylerInterface from .._table_writer...
Python
0
@@ -2920,32 +2920,186 @@ return %5B%5D%0A%0A + def _write_header(self) -%3E None:%0A super()._write_header()%0A%0A if self.__flavor in (%22kramdown%22, %22jekyll%22):%0A self._write_line()%0A%0A def write_ta @@ -3392,19 +3392,18 @@ (alias +o f -or %60%60%22gith @@ -3408,16 +...
0226d6dff5bd46c3de1ba55e8b7bb01013be3d2f
Add additional contributions to savings goal
gnu_reporting/reports/savings_goals.py
gnu_reporting/reports/savings_goals.py
from datetime import datetime import time from dateutil.rrule import rrule, MONTHLY from dateutil.relativedelta import relativedelta from gnu_reporting.reports.base import Report from gnu_reporting.wrapper import get_decimal, get_account, get_balance_on_date, account_walker from gnu_reporting.periods import PeriodStart...
Python
0
@@ -560,16 +560,36 @@ rt.today +, contributions=None ):%0A @@ -824,16 +824,208 @@ as_of)%0A%0A + if not contributions:%0A contributions = %5B%5D%0A elif type(contributions) != list:%0A contributions = %5Bcontributions%5D%0A%0A self.contributions = contributions%0A%0A ...
f4dee9c7ef082d17e215f311dadb27fa4c44f6e7
fix regression: typo
src/adhocracy/adhocracy/sheets/pool.py
src/adhocracy/adhocracy/sheets/pool.py
"""Pool Sheet.""" from collections.abc import Iterable from pyramid.traversal import resource_path from substanced.util import find_catalog import colander from adhocracy.interfaces import ISheet from adhocracy.interfaces import SheetToSheet from adhocracy.sheets import GenericResourceSheet from adhocracy.sheets impo...
Python
0.999734
@@ -2315,17 +2315,16 @@ copy.pop -e ('elemen @@ -3860,21 +3860,26 @@ alue in -value +arbitrary_ filters. @@ -4141,66 +4141,8 @@ se.%0A - for name, value in arbitrary_filters.items():%0A
4da3425eb0dbb5d95439584ee485a2fda16f095e
Print maximum work group size for opencl kernel
kernel_tuner/opencl.py
kernel_tuner/opencl.py
"""This module contains all OpenCL specific kernel_tuner functions""" from __future__ import print_function import numpy #embedded in try block to be able to generate documentation try: import pyopencl as cl except ImportError: cl = None class OpenCLFunctions(object): """Class that groups the OpenCL func...
Python
0
@@ -3558,16 +3558,178 @@ l_name)%0A + print(func.get_work_group_info(cl.kernel_work_group_info.WORK_GROUP_SIZE,%0A cl.get_platforms()%5B0%5D.get_devices()%5B0%5D))%0A
8b4981a7cae2c4c916d8671b420e29647bfeaaa9
Remove duplicate import of Decimal
gnu_reporting/reports/savings_goals.py
gnu_reporting/reports/savings_goals.py
from datetime import datetime import time from dateutil.rrule import rrule, MONTHLY from dateutil.relativedelta import relativedelta from gnu_reporting.reports.base import Report from gnu_reporting.wrapper import get_decimal, get_account, get_balance_on_date, account_walker from gnu_reporting.periods import PeriodStart...
Python
0.000287
@@ -3191,40 +3191,8 @@ lize -%0A from decimal import Decimal %0A%0A
cd9a51ab2fe6b99c0665b8f499363a4d557b4a4d
Modify script which split your region in smaller sample
DataWrangling/CaseStudy/sample_file.py
DataWrangling/CaseStudy/sample_file.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.etree.ElementTree as ET # Use cElementTree or lxml if too slow import os OSM_FILE = "san-francisco-bay_california.osm" # Replace this with your osm file SAMPLE_FILE = "sample_sfb.osm" k = 20 # Parameter: take every k-th top level element def get_element(osm...
Python
0
@@ -1190,8 +1190,47 @@ %3C/osm%3E') +%0A%0Aif __name__ == '__main__':%0A main()
cd79441f0c11fbc36f2f0b0098196373006718e4
Update binstar-push.py
continuous-integration/binstar-push.py
continuous-integration/binstar-push.py
import os import glob # import subprocess # import traceback from binstar_client.scripts import cli def get_token(): token = None if os.environ.get('TRAVIS_BRANCH', None) == 'master' or os.environ.get('APPVEYOR_REPO_BRANCH', None) == 'master': token = os.environ.get('BINSTAR_TOKEN', None) return t...
Python
0.000001
@@ -467,16 +467,18 @@ 2'))%0A + # print(c
b7777486ef36a20e148e3a3d81846f2b330e8622
Enable fullpath to be used in get_filenames
octotribble/Get_filenames.py
octotribble/Get_filenames.py
#!/usr/bin/env python # -*- coding: utf8 -*- """Get names of files that match regular expression. Possibly better to use the glob module. """ import fnmatch import os from typing import List # TODO: Try glob.glob def get_filenames(path, regexp, regexp2=None): # type: (str, str, str) -> List[str] """Regexp ...
Python
0
@@ -255,19 +255,35 @@ xp2=None +, fullpath=False ):%0A - # ty @@ -505,24 +505,54 @@ s*'%0A %22%22%22%0A + current_path= os.getcwd()%0A os.chdir @@ -887,24 +887,24 @@ ppend(file)%0A - filelist @@ -911,16 +911,122 @@ .sort()%0A + os.chdir(current_path)%0A if fullpath:%0A filelist = ...
0f0ef471e6bb9d873c890df2f538a00bbcae9637
print removed
viewer/templatetags/custom_tags.py
viewer/templatetags/custom_tags.py
from django import template import markdown import datetime register = template.Library() @register.filter() def custom_date(value): date = datetime.datetime.strptime(value, '%a, %d %b %Y %H:%M:%S %z') return date.strftime('%d, %b %Y') @register.filter() def markdown_data(value): return markdown.markdo...
Python
0.000001
@@ -421,25 +421,8 @@ /%22)%0A - print(value)%0A @@ -429,12 +429,13 @@ return value +%0A
0bac442df6fec974aec8cf6d9e4147a2e75cf139
Switch from VERSION to $VERSION in model migration.
go/vumitools/conversation/migrators.py
go/vumitools/conversation/migrators.py
from vumi.persist.model import ModelMigrator class ConversationMigrator(ModelMigrator): def migrate_from_unversioned(self, mdata): # Copy stuff that hasn't changed between versions mdata.copy_values( 'conversation_type', 'start_timestamp', 'end_timestamp', 'created_at', ...
Python
0
@@ -527,16 +527,17 @@ _value(' +$ VERSION'
fd7348951e46763dcd06cb673a6b01f6894efe4e
Set version as 0.8.8.1
alignak_webui/__init__.py
alignak_webui/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=global-statement # Copyright (c) 2015-2017: # Frederic Mohier, frederic.mohier@alignak.net # """ Alignak - Web User Interface """ # Package name __pkg_name__ = u"alignak_webui" # Checks types for PyPI keywords # Used for: # - PyPI keywords # - dir...
Python
0.001032
@@ -506,16 +506,19 @@ (0, 8, 8 +, 1 )%0A__vers
2ed5c92aabd349337579792b20613854370aa2ac
add log test
kfdda/views/general.py
kfdda/views/general.py
# -*- coding: utf-8 -*- from flask import Blueprint from flask.views import MethodView from ..core import db, logger from ..exceptions import NoError, FormValidationError from ..forms.login import LoginForm from ..models.user import User from ..tasks import add bp = Blueprint('general', __name__) class IndexView(...
Python
0.000001
@@ -1124,16 +1124,241 @@ == 2'%0A%0A +class LoggerView(MethodView):%0A def get(self):%0A logger.debug('log level debug')%0A logger.info('log level info')%0A logger.warn('log level warn')%0A logger.error('log level error')%0A return 'ok'%0A %0Abp.add_ @@ -1716,12 +1716,70 @@ xce...
83a62e80d1b7551f0ccebf4bc95bba27c6bf94bc
Add compound nouns tests
tests/test_compounds.py
tests/test_compounds.py
import inflect p = inflect.engine() def test_compound_1(): assert p.singular_noun("hello-out-there") == "hello-out-there" def test_compound_2(): assert p.singular_noun("hello out there") == "hello out there" def test_compound_3(): assert p.singular_noun("continue-to-operate") == "continue-to-operate"...
Python
0.999995
@@ -2136,28 +2136,842 @@ .plural(singular) == plural%0A +%0A%0Adef test_unit_open_compound_nouns():%0A test_cases = %7B%0A %22high school%22: %22high schools%22,%0A %22master genie%22: %22master genies%22,%0A %22MASTER genie%22: %22MASTER genies%22,%0A %22Blood brother%22: %22Blood broth...
828e75919bd71912baf75a64010efcfcd93d07f1
Update library magic to be recursive
library_magic.py
library_magic.py
import sys import subprocess import shutil executable = sys.argv[1] execfolder = sys.argv[1].rsplit("/",1)[0] libdir = execfolder+"/lib" otool_cmd = ["otool", "-L",executable] # Run otool otool_out = subprocess.check_output(otool_cmd).split("\n\t") # Find all the dylib files for l in otool_out: s = l.split(".dylib"...
Python
0
@@ -41,154 +41,251 @@ il%0A%0A -executable = sys.argv%5B1%5D%0Aexecfolder = sys.argv%5B1%5D.rsplit(%22/%22,1)%5B0%5D%0Alibdir = execfolder+%22/lib%22%0Aotool_cmd = %5B%22otool%22, %22-L%22,executable%5D%0A%0A# Run otool%0A +copied = %5B%5D%0A%0Adef update_libraries(executable):%0A%09%0A%09# Find all the dylib files an...
5558e4af4e0e341b9d92e4f433e2f5cc3d305f11
Fix space in trans string
VocaBot/contentparser.py
VocaBot/contentparser.py
import math from collections import defaultdict from telegram import Emoji from constants import Context, VOCADB_BASE_URL from i18n import _ from util import non_phone from vocadb import voca_db # I'm not exactly proud of this module's code.. but it does the job. def names_text(song): if len(song['names']) > ...
Python
1
@@ -7663,13 +7663,18 @@ t += + ' ' + _(' - on %7B @@ -7736,32 +7736,37 @@ =album%5B'name'%5D,%0A +
b535ad5c396539eb90d30b750e92380fa2a5d688
version inc
src/pymake2/__init__.py
src/pymake2/__init__.py
#--------------------------------------- # DUNDERS #--------------------------------------- __author__ = "Philip Arvidsson <contact@philiparvidsson.com>" __license__ = "MIT (see LICENSE.md)" __version__ = "0.4.2" #--------------------------------------- # IMPORTS #--------------------------------------- from pymake...
Python
0
@@ -205,17 +205,17 @@ = %220.4. -2 +7 %22%0A%0A#----