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
9b2cc65a792eb850d982653100ac948990904125
Display microseconds in integer decimal
appstats/filters.py
appstats/filters.py
# encoding: utf-8 import json def json_filter(value): return json.dumps(value) def count_filter(value): if value is None: return "" count = float(value) base = 1000 prefixes = [ ('K'), ('M'), ('G'), ('T'), ('P'), ('E'), ('Z'), ...
Python
0.99978
@@ -803,19 +803,17 @@ turn u%22%25 -.1f +d %C2%B5s%22 %25 t
f07a05f6a6edd0ef481dd9a24c1556b345fe7686
Remove attempt to import module that no longer exists
iati/tests/conftest.py
iati/tests/conftest.py
"""Configuration to exist in the global scope for pytest.""" import collections import pytest import iati.default import iati.resources import iati.tests.utilities import iati pytest_plugins = [ # name required by pytest # pylint: disable=invalid-name 'iati.tests.fixtures.comparison', 'iati.tests.fixtures.u...
Python
0.000195
@@ -291,43 +291,8 @@ n',%0A - 'iati.tests.fixtures.utility',%0A
57451e92f368a7150f66ccfd138be8bd6a0c43fa
disable filtering bug
ielex/lexicon/views.py
ielex/lexicon/views.py
from textwrap import dedent import time from django.contrib.auth.decorators import login_required from django.http import HttpResponse # from django.shortcuts import render_to_response from ielex.lexicon.models import * from ielex.shortcuts import render_template from ielex.views import get_sort_order from ielex.views ...
Python
0.000001
@@ -1484,16 +1484,18 @@ s%5D)%0A%0A + # reliabi @@ -1521,17 +1521,17 @@ .getlist -%5B +( %22reliabi @@ -1535,17 +1535,17 @@ ability%22 -%5D +) %0A%0A co @@ -2711,32 +2711,34 @@ ist_id).name%0A + # print%3E%3Eresponse @@ -2772,24 +2772,26 @@ %22.join(%0A + # req
44687242b3c99a08c903ef3d30685814241eb964
add clean up method to remove test images.
imager_images/tests.py
imager_images/tests.py
import factory from django.test import TestCase from imager_images.models import Album, Photo from django.contrib.auth.models import User from django.core.files.uploadedfile import SimpleUploadedFile import datetime import os THE_FILE = SimpleUploadedFile('test.png', 'a photo') class UserFactory(factory.django.Djang...
Python
0
@@ -218,16 +218,28 @@ mport os +%0Aimport glob %0A%0ATHE_FI @@ -283,24 +283,126 @@ a photo')%0A%0A%0A +def clean_up():%0A for file in glob.glob(%22media/imager_images/test*.png%22):%0A os.remove(file)%0A%0A%0A class UserFa @@ -884,32 +884,51 @@ user, user_john) +%0A clean_up() %0A%0A def test_...
0c160c8e787a9019571f358b70633efa13cad466
Support for inbox.util.eas in the /inbox-eas repo; this is where EAS-specific util code would live.
inbox/util/__init__.py
inbox/util/__init__.py
""" Non-server-specific utility modules. These shouldn't depend on any code from the inbox module tree! Don't add new code here! Find the relevant submodule, or use misc.py if there's really no other place. """
Python
0
@@ -217,8 +217,115 @@ ce.%0A%22%22%22%0A +# Allow out-of-tree submodules.%0Afrom pkgutil import extend_path%0A__path__ = extend_path(__path__, __name__)%0A
6c28b693fdcf6a1dc481b486c6c6233ae08d72e1
exclude thread itself from duplicates search when saving edits
askapp/forms.py
askapp/forms.py
from snowpenguin.django.recaptcha2.fields import ReCaptchaField from snowpenguin.django.recaptcha2.widgets import ReCaptchaWidget from registration.forms import RegistrationFormTermsOfService from django.utils.translation import ugettext_lazy as _ from django import forms from .models import Profile, Thread, Post cla...
Python
0
@@ -2602,16 +2602,45 @@ o%5B'id'%5D) +.exclude(id=self.instance.id) %0A
933a082a76c6c9b72aaf275f45f0d155f66eeacf
Fix Python 3.3 calling another virtualenv as a subprocess.
asv/__init__.py
asv/__init__.py
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals)
Python
0.000004
@@ -191,8 +191,289 @@ terals)%0A +%0Aimport sys%0A%0Aif sys.version_info %3E= (3, 3):%0A # OS X framework builds of Python 3.3 can not call other 3.3%0A # virtualenvs as a subprocess because %60__PYENV_LAUNCHER__%60 is%0A # inherited.%0A if os.environ.get('__PYVENV_LAUNCHER__'):%0A os.unsetenv('__PY...
3eddbd56328e245a1f952dccbe38d121657640c3
Add ends_with flag to fabfile if we want it to end early.
auto/fabfile.py
auto/fabfile.py
from fabric.api import * from ssh_util import * from collections import OrderedDict import os, sys, json VERBOSE = False TASKS = [ ('local', ['dump_api']), ('remote', ['parse_api', '-m 8']), ('remote', ['scrape', '-m 8']), ('local', ['download']), ('remote', ['extract']), ('local', ['create_do...
Python
0
@@ -1775,16 +1775,43 @@ ump_api' +, end_with='scrape_dockets' ):%0A t @@ -2240,22 +2240,25 @@ -tasks = TASKS%5B +first_task_idx = %5Bi f @@ -2322,92 +2322,144 @@ %5D%5B0%5D -:%5D # eep! finds the thing to start with, then takes the subset of TASKS from then on +%0A last_task_idx = %5Bi for i in range(l...
6535495c6bbe17122c86eb657243d675300cc382
add visit_Attribute to adjust numpy fns
autodiff/ast.py
autodiff/ast.py
import logging import meta import ast import numpy as np import theano import theano.tensor as T logger = logging.getLogger('pyautodiff') def istensor(x): tensortypes = (theano.tensor.TensorConstant, theano.tensor.TensorVariable) return isinstance(x, tensortypes) def isvar(x): varty...
Python
0
@@ -2270,24 +2270,393 @@ x), sym_x)%0A%0A + def switch_numpy_theano(self, func):%0A # if the function comes from numpy...%0A if ((getattr(func, '__module__', None)%0A and func.__module__.startswith('numpy'))%0A or isinstance(func, np.ufunc)):%0A%0A # try to get the the...
91ef2866d14348971326df39d7868ad5c424b64c
remove the 10 article limit that was used for testing
autoindex_sk.py
autoindex_sk.py
#!/usr/bin/env python3 import sys import csv from bs4 import BeautifulSoup import autoindex from rdflib import Graph, URIRef, Literal from rdflib.namespace import DC, DCTERMS, SKOS, XSD def autoindex_doc(text, url, title, date, author, place): g = Graph() uri = URIRef(url) g.add((uri, DCTERMS.title, Lit...
Python
0
@@ -981,14 +981,8 @@ %7C')%0A -n = 0%0A for @@ -1344,47 +1344,6 @@ nt') -%0A n += 1%0A if n == 10:%0A break %0A%0A
7b1bcc5114f5fcfab9b5a827529a6388389df690
Version bump
aws/__init__.py
aws/__init__.py
__version__ = '0.2.2'
Python
0.000001
@@ -12,11 +12,11 @@ = '0.2. -2 +3 '%0A
5d21942823ea21a3c2eb38e43b4b8b4fa2ec2ac1
Allow mayday.us for CORS
backend/util.py
backend/util.py
"""General utilities.""" import urlparse import logging def ConstantTimeIsEqual(a, b): """Securely compare two strings without leaking timing information.""" if len(a) != len(b): return False acc = 0 for x, y in zip(a, b): acc |= ord(x) ^ ord(y) return acc == 0 # TODO(hjfreyer): Pull into some kin...
Python
0
@@ -642,16 +642,86 @@ one.us') + or%0A netloc == 'mayday.us' or netloc.endswith('.mayday.us') ):%0A
9b94e34352485ad1054a6fc79ea37bc889949b57
print oops
bakthat/sync.py
bakthat/sync.py
# -*- encoding: utf-8 -*- import logging import socket from bakthat.models import Backups, Config from bakthat.conf import config import requests import json log = logging.getLogger(__name__) def bakmanager_hook(conf, backup_data, key=None): """First version of a hook for monitoring periodic backups with BakMana...
Python
0.000039
@@ -764,85 +764,8 @@ p)%7D%0A - print bak_payload%0A print conf.get(%22bakmanager_token%22)%0A @@ -886,35 +886,8 @@ %22))%0A - print r.json()%0A
7e742489017bc444f496b1f4cf6ed391caf49ba2
allow enter to close change note type diag (#651)
aqt/modelchooser.py
aqt/modelchooser.py
# -*- coding: utf-8 -*- # Copyright: Damien Elmes <anki@ichi2.net> # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html from aqt.qt import * from anki.hooks import addHook, remHook, runHook from aqt.utils import shortcut import aqt class ModelChooser(QHBoxLayout): def __init__(self, mw...
Python
0
@@ -1083,32 +1083,74 @@ .onModelChange)%0A + self.models.setAutoDefault(False)%0A self.add
122339c5139b570940d9ed396a066b550965a13a
Add default affiliation to person
dexter/models/person.py
dexter/models/person.py
# -*- coding: utf-8 -*- from itertools import groupby from sqlalchemy import ( Column, DateTime, ForeignKey, Integer, String, func, ) from sqlalchemy.orm import relationship from wtforms import StringField, validators, SelectField, HiddenField from .support import db from ..forms import F...
Python
0.000001
@@ -782,16 +782,84 @@ es.id')) +%0A affiliation_id = Column(Integer, ForeignKey('affiliations.id')) %0A%0A cr @@ -1208,16 +1208,62 @@ y=False) +%0A affiliation = relationship(%22Affiliation%22) %0A%0A de
52873e4238a54cb93f403d509d2bebef8971ec9b
Work around deprecation warning with new cssutils versions.
django_assets/filter/cssutils/__init__.py
django_assets/filter/cssutils/__init__.py
import logging import logging.handlers from django.conf import settings from django_assets.filter import BaseFilter __all__ = ('CSSUtilsFilter',) class CSSUtilsFilter(BaseFilter): """Minifies CSS by removing whitespace, comments etc., using the Python `cssutils <http://cthedot.de/cssutils/>`_ l...
Python
0
@@ -822,24 +822,26 @@ ndler(10))%0D%0A +%0D%0A @@ -848,27 +848,291 @@ -cssutils.log.setlog +# Newer versions of cssutils print a deprecation warning%0D%0A # for 'setlog'.%0D%0A if hasattr(cssutils.log, 'setLog'):%0D%0A func = cssutils.log.setLog%0D%0...
50f880d4f90e1629c57a89508ce930654a176af3
Version bump
bucky/__init__.py
bucky/__init__.py
# -*- coding: utf-8 - # # 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.000001
@@ -620,9 +620,9 @@ 2, -5 +6 )%0A__
52d804aac69bceb9dee9c1b21044551b80bcdfdc
Fix handling default for `--output` option in `people_search` cmd.
linkedin_scraper/commands/people_search.py
linkedin_scraper/commands/people_search.py
from getpass import getpass from scrapy.commands.crawl import Command as BaseCommand def sanitize_query(query): return query.replace(' ', '+') class Command(BaseCommand): def short_desc(self): return "Scrap people from LinkedIn" def syntax(self): return "[options] <query>" def add...
Python
0
@@ -619,95 +619,95 @@ -super().process_options(args, opts)%0A%0A opts.output = opts.output or 'results.csv' +opts.output = opts.output or 'results.csv'%0A%0A super().process_options(args, opts) %0A%0A
6f759be609403aadfa0845f5cdad7869d49f7ebb
add instructions on how to request to join
clans/clans.py
clans/clans.py
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2017 SML 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...
Python
0
@@ -5507,16 +5507,217 @@ ge_url)%0A + em.set_footer(%0A text='If you meet requirements, please request to join in-app. Let us know when you have been accepted so we can update your membership roles.'%0A )%0A
637b3c36e9a5952fc29ceaa705703e94f9f172d3
Update app_settings.py
django_project/wms_client/app_settings.py
django_project/wms_client/app_settings.py
# coding=utf-8 """Settings file for WMS Client. """ from django.conf import settings # Allow base django project to override settings default_leaflet_tiles = ( 'OpenStreetMap', 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', ('© <a hr ef="http://www.openstreetmap.org" target="_parent">OpenStree...
Python
0.000002
@@ -250,19 +250,16 @@ '%C2%A9 %3Ca hr - ef=%22http
cdb4f7088ba49c0e2b590d8b818226e4e59eb45e
Fix tests.
st2client/tests/unit/test_config_parser.py
st2client/tests/unit/test_config_parser.py
# coding=utf-8 # Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you...
Python
0
@@ -3528,12 +3528,11 @@ '%5D, -u'%E6%B5%8B%E8%AF%95 +'%E5%AF%86%E7%A0%81 ')%0A
4071c77a6e598c27f7a8b2195ff5e68332120615
Fix formatting.
st2common/st2common/cmd/validate_config.py
st2common/st2common/cmd/validate_config.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Python
0.000017
@@ -871,25 +871,8 @@ yaml -%0Aimport traceback %0A%0Afr @@ -2371,17 +2371,18 @@ fig: %25s' -, + %25 str(e)) @@ -2386,38 +2386,8 @@ e))%0A - traceback.print_exc()%0A
80f7ec1345ffb971ba2c8de4962e10321543ed93
fix flake8 error.
django_version_viewer/tests/test_views.py
django_version_viewer/tests/test_views.py
import mock from django.test import TestCase import json from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.test import Client class TestVersionViewer(TestCase): url_django_version_viewer = reverse('django_version_viewer') url_django_version_viewer_csv = reve...
Python
0
@@ -3930,32 +3930,53 @@ elf.assertEqual( +%0A self.mock_data%5Bi
1b85f00a162c298970cfbd1dfa4661c60258169e
Mark two svnrdump tests as XFail for ra_svn, ra_serf and ra_neon
subversion/tests/cmdline/svnrdump_tests.py
subversion/tests/cmdline/svnrdump_tests.py
#!/usr/bin/env python # # svnrdump_tests.py: Tests svnrdump's remote repository dumping capabilities. # # Subversion is a tool for revision control. # See http://subversion.apache.org for more information. # # ==================================================================== # Licensed to the Apache Software F...
Python
0
@@ -6237,16 +6237,28 @@ +XFail(XFail( skeleton @@ -6259,24 +6259,104 @@ eleton_load, + svntest.main.is_ra_type_dav),%0A svntest.main.is_ra_type_svn), %0A @@ -6358,16 +6358,28 @@ +XFail(XFail( copy_and @@ -6387,24 +6387,104 @@ modify_load, + svntest.main.is_ra_type_...
d35aed562b3c9eba6f7de7ac4aa7d6ad7723ec0a
Add listnener decos
cogs/cancer.py
cogs/cancer.py
from discord.ext import commands class Cancer(commands.Cog): def __init__(self, bot): self.bot = bot self.ok_list = [198101180180594688, 246291440106340352] async def on_member_join(self, member): if member.guild.id not in self.ok_list: return await member.guild.sy...
Python
0
@@ -13,24 +13,28 @@ .ext - import commands +.commands import Cog %0A%0A%0Ac @@ -49,17 +49,8 @@ cer( -commands. Cog) @@ -168,16 +168,34 @@ 40352%5D%0A%0A + @Cog.listener%0A asyn @@ -362,32 +362,50 @@ ember.mention)%0A%0A + @Cog.listener%0A async def on @@ -569,24 +569,42 @@ r.mention)%0A%0A + @...
1b3c9e5f46f48865882f1087ced0ade168233711
fix formatting and caching
cogs/stonks.py
cogs/stonks.py
import discord import json from datetime import datetime from discord.ext import commands from utils.aiohttp_wrap import aio_get_json class Stonks(commands.Cog): URL = "https://finnhub.io/api/v1/quote" def __init__(self, bot): self.bot = bot self.session = bot.aio_session self.redis...
Python
0.000001
@@ -204,16 +204,34 @@ /quote%22%0A + TTL = 60 * 15%0A def @@ -1456,16 +1456,29 @@ ps(resp) +, ex=self.TTL )%0A @@ -1756,16 +1756,20 @@ esp%5B'c'%5D +:.2f %7D%22)%0A @@ -1828,16 +1828,20 @@ sp%5B'pc'%5D +:.2f %7D%22)%0A @@ -1872,17 +1872,17 @@ Change -t +T oday%22, v @@ -1933,16 +1933,4...
168c936a094a2f726c430f72b1595bae78d80c02
Fix crash on passing -h, -he or any substring of help as an argument. (#244)
src/invoice2data/main.py
src/invoice2data/main.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import shutil import os from os.path import join import logging from .input import pdftotext from .input import pdfminer_wrapper from .input import tesseract from .input import tesseract4 from .input import gvision from invoice2data.extract.loader import ...
Python
0.000001
@@ -3618,23 +3618,26 @@ efault: +%25 %25Y-%25 +%25 m-%25 +%25 d (ISO 8
50e69a0d53dffbc961b865f583ca071dfb49648c
Reformat class
mediacloud/mediawords/util/sql.py
mediacloud/mediawords/util/sql.py
import time import datetime # noinspection PyPackageRequirements import dateutil.parser from mediawords.util.perl import decode_string_from_bytes_if_needed def get_sql_date_from_epoch(epoch: int) -> str: # Returns local date by default, no need to set timezone try: return datetime.datetime.fromtimes...
Python
0
@@ -370,17 +370,16 @@ except -( ValueEr @@ -385,10 +385,8 @@ rror - ) :%0A @@ -393,17 +393,17 @@ # -m +M imic per
94e9eda139234e8b9183ce5462bd7c9a9d97e197
Use global for 2 args
coala_quickstart/coala_quickstart.py
coala_quickstart/coala_quickstart.py
import argparse import logging import os import sys from pyprint.ConsolePrinter import ConsolePrinter from coala_utils.FilePathCompleter import FilePathCompleter from coala_utils.Question import ask_question from coala_quickstart import __version__ from coala_quickstart.interaction.Logo import print_welcome_message ...
Python
0
@@ -2980,24 +2980,78 @@ def main():%0A + global MAX_ARGS_GREEN_MODE, MAX_VALUES_GREEN_MODE%0A arg_pars
b87711d62a1f2c4974f945625312d8a33ba91fb6
convert grp_members into a lambda and add usr_search lambda
code-samples/membersOfDomainGroup.py
code-samples/membersOfDomainGroup.py
#!/usr/bin/env python # print a list of members of a domain group param = { '-f': 'mail', # field name '-s': '\n', # separator } import getopt import ldap import re import sys try: param.update(dict(getopt.getopt(sys.argv[1:], 'g:f:s:')[0])) if '-g' not in param: sys.stderr.write("-g parameter is required\n")...
Python
0.000032
@@ -991,163 +991,61 @@ for -memb +us ers in - LDAP groups and return a nested list of them%0Adef grp_members(gdn):%0A%09return %5Bgrp_members(grp%5B0%5D) for grp in grp_search('memberOf=%25s' %25 gdn)%0A%09%09%5D + +side a given group%0Ausr_search = lambda grpDN: lda @@ -1150,18 +1150,20 @@ s))' %25 g -dn +rpDN ...
f577de1cd1bea44e2db5e8583d1d8edeb1b488e3
Fix in service credential setup to work with front-end.
src/biokbase/narrative/monkeypatch.py
src/biokbase/narrative/monkeypatch.py
""" Module to monkeypatch the parts of the IPython core that we don't/won't rewrite Yes, its nasty. No, we wouldn't use these if there were an alternative We use some code that GvR posted here as helpers: https://mail.python.org/pipermail/python-dev/2008-January/076194.html sychan@lbl.gov """ import os import urll...
Python
0
@@ -1726,16 +1726,52 @@ session%22 +%0A backup_cookie = %22kbase_session%22 %0A%0A if @@ -3925,32 +3925,334 @@ book_manager'))%0A + else if backup_cookie in self.cookies and hasattr(self, 'notebook_manager'):%0A IPython.html.base.handlers.app_log.debug(%22kbase_session = %22 + self.co...
1189a06433d1a38662124d5799eb2610c31d5100
remove commented out code
src/buzzfeed/clean_parsed_colombia.py
src/buzzfeed/clean_parsed_colombia.py
""" Script to clean the Colombia data from BuzzFeed Zika data repository Run this script from the root directory e.g., `~/git/vbi/zika_data_to_cdc' from there you can run `python src/buzfeed/clean_parsed_colombia.py` """ import os import sys import re import pandas as pd sys.path.append(os.getcwd()) import src.help...
Python
0
@@ -1560,24 +1560,8 @@ se)%0A - # break%0A %0A%0Ade @@ -1636,83 +1636,8 @@ ():%0A - # here = os.path.abspath(os.path.dirname(__file__))%0A # print(here)%0A%0A
f47ebbe4dcacdd0ef96799a5d11925e0a8b6d5d5
fix import path
test/test_resultset.py
test/test_resultset.py
from unittest import TestCase from statscraper.base_scraper import ResultSet from pandas.api import types as ptypes class TestResultSet(TestCase): def test_pandas_export(self): result = ResultSet() result.append({'city': "Voi", 'value': 45483}) df = result.pandas self.assertTrue(...
Python
0.000007
@@ -44,21 +44,8 @@ aper -.base_scraper imp
cf5ad85a35824646a30d90de79d72f4068dade50
Fix failing QML test with Qt 5.9 due to assert
tests/QtQml/bug_557.py
tests/QtQml/bug_557.py
############################################################################# ## ## Copyright (C) 2016 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the test suite of PySide2. ## ## $QT_BEGIN_LICENSE:GPL-EXCEPT$ ## Commercial License Usage ## Licensees holding valid commercial ...
Python
0
@@ -1268,16 +1268,51 @@ port sys +%0Afrom helper import adjust_filename %0A%0Afrom P @@ -1634,17 +1634,44 @@ ile( -'foo.qml' +adjust_filename('foo.qml', __file__) ))%0A%0A
0c0ca965004e4753a65a9e2984b723c6c59e74ef
Fix logging format string.
astral/node/base.py
astral/node/base.py
""" astral.node.base ========== Node Base Class. """ import threading import json import astral.api.app from astral.models import Node, session, Event from astral.conf import settings from astral.exceptions import NetworkError from astral.api.client import NodesAPI import logging log = logging.getLogger(__name__) ...
Python
0.000008
@@ -1273,32 +1273,45 @@ + self.node(), self.node().pri
a5b034704b75496cd1357b66f5fe0bbabb27a114
Implement ``plot_tree`` method
astrodendro/plot.py
astrodendro/plot.py
import numpy as np class DendrogramPlotter(object): """ A class to plot a dendrogram object """ def __init__(self, dendrogram): # should we copy to ensure immutability? self.dendrogram = dendrogram self._cached_positions = None self.sort() def sort(self, sort_key...
Python
0.000029
@@ -1782,16 +1782,1274 @@ itions%0A%0A + def plot_tree(self, ax, structure=None, subtree=True, autoscale=True, **kwargs):%0A %22%22%22%0A Plot the dendrogram tree or a substructure%0A%0A Parameters%0A ----------%0A ax : %60matplotlib.axes.Axes%60 instance%0A The Axes in...
4f03cd1ed7412a545da1274c58733a0d6333eca1
Add an option about ridge prior on dropout prob
autoencoder/loss.py
autoencoder/loss.py
import numpy as np import tensorflow as tf from keras import backend as K def _nan2zero(x): return tf.where(tf.is_nan(x), tf.zeros_like(x), x) def _nelem(x): nelem = tf.reduce_sum(tf.cast(~tf.is_nan(x), tf.float32)) return tf.cast(tf.where(tf.equal(nelem, 0.), 1., nelem), x.dtype) def _reduce_mean(x):...
Python
0.013247
@@ -4068,16 +4068,34 @@ elf, pi, + ridge_lambda=0.0, scope=' @@ -4186,16 +4186,57 @@ .pi = pi +%0A self.ridge_lambda = ridge_lambda %0A%0A de @@ -4870,24 +4870,109 @@ se, nb_case) +%0A ridge = self.ridge_lambda*tf.square(self.pi)%0A result += ridge %0A%0A @@ -5304,16 +53...
5392bf25d16166162d53ddc1f063907d72444a92
add in new tests for new functionality
tests/cloudlet_test.py
tests/cloudlet_test.py
from cement.core import handler, hook from cement.utils import test from nepho import cli from nepho.cli.base import Nepho import nose class NephoTestApp(Nepho): class Meta: argv = [] config_files = [] # Test Cloudlet class a_TestNephoCloudlet(test.CementTestCase): app_class = NephoTestApp ...
Python
0
@@ -1173,32 +1173,598 @@ app.close()%0A%0A + def test_nepho_cloudlet_list_directories(self):%0A app = self.make_app(argv=%5B'cloudlet', 'directory-list'%5D)%0A app.setup()%0A app.run()%0A app.close()%0A%0A def test_nepho_cloudlet_add_directories(self):%0A app = self.make_app...
2ddfb4f0f4f2de060399a6e5b519a7f4b788ace5
make it possible to show languages for selected values on a map
autotyp/adapters.py
autotyp/adapters.py
from sqlalchemy.orm import joinedload from clld.interfaces import IParameter, ILanguage, IIndex from clld.db.meta import DBSession from clld.db.models.common import ValueSet from clld.web.adapters.base import Index from clld.web.adapters.geojson import GeoJsonParameter from clld.web.maps import SelectedLanguagesMap ...
Python
0
@@ -73,23 +73,20 @@ meter, I -Languag +Valu e, IInde @@ -845,16 +845,45 @@ = list( +v.valueset.language for v in ctx.get_ @@ -1135,23 +1135,20 @@ pView, I -Languag +Valu e, IInde
4090dac50c958a6a0876033a7d662e30c81b57ed
Fix client having too short a timeout in remote TLS usage
confluent_client/confluent/client.py
confluent_client/confluent/client.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2014 IBM Corporation # Copyright 2015 Lenovo # # 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/LI...
Python
0
@@ -5415,16 +5415,65 @@ ect(sa)%0A + self.connection.settimeout(None)%0A
e3d082588db63690a846007beb8ddd42ebd4144e
Include pages urls into the main url patterns
config/urls.py
config/urls.py
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from django.views import defaults as default_views urlpatterns = [ # Django Admin, use {% url 'admin:index' %} url...
Python
0.000001
@@ -363,21 +363,20 @@ # -To be removed +Custom urls%0A %0A @@ -387,170 +387,51 @@ (r'%5E -$ ', -TemplateView.as_view(template_name='pages/home.html'), name='home'),%0A url(r'%5Eabout/$', TemplateView.as_view(template_name='pages/about.html'), name='about' +include('pages.urls', namespace='pages') ),%0A%0...
2f412d6d98e6b03c1e3997d6acb0d15cace12e28
remove trailing spaces
coopy/utils.py
coopy/utils.py
def method_or_none(instance, name): method = getattr(instance, name) if (name[0:2] == '__' and name[-2,:] == '__') or \ not callable(method) : return None return method def action_check(obj): return (hasattr(obj, '__readonly'), hasattr(obj...
Python
0.999463
@@ -218,23 +218,16 @@ method%0A - %0Adef act @@ -281,17 +281,16 @@ donly'), - %0A @@ -368,17 +368,16 @@ ption')) - %0A%0Adef in
919a4f183e9a09ded7cf6272f9be300f22408c08
fix method or none method name comparison
coopy/utils.py
coopy/utils.py
def method_or_none(instance, name): method = getattr(instance, name) if (name[0:2] == '__' and name[-2,:] == '__') or \ not callable(method) : return None return method def action_check(obj): return (hasattr(obj, '__readonly'), hasattr(obj, '__unl...
Python
0.000002
@@ -103,17 +103,16 @@ name%5B-2 -, :%5D == '_
b59f21ee28cc8eaf56cbc49fd7926e243e92276f
Fix bug for users with Space inside their usernames.
core/models.py
core/models.py
from django.core.exceptions import AppRegistryNotReady from django.core.urlresolvers import reverse_lazy from django.conf import settings from django.db import models from django.db.models.signals import post_save from django.utils.translation import ugettext as _ class Profile(models.Model): about_me = models.Te...
Python
0
@@ -206,16 +206,26 @@ ost_save +, pre_save %0Afrom dj @@ -1447,16 +1447,133 @@ ance)%0A%0A%0A +def slugify_user_username(sender, instance, **kwargs):%0A instance.username = instance.username.replace(' ', '_')%0A%0A%0A try:%0A @@ -1777,8 +1777,61 @@ r=User)%0A +pre_save.connect(slugify_user_username, sender=U...
b1eb69620bbe875d117498ed95e009a019e54fab
Fix vote app URL patterns
votes/urls.py
votes/urls.py
from django.conf.urls import include, url from django.views.generic import TemplateView from votes.views import VoteView, results, system_home urlpatterns = [ url(r'^$', system_home, name="system"), url(r'^(?P<vote_name>[\w-]+)$', VoteView.as_view(), name="vote"), url(r'^(?P<vote_name>[\w-]+)/results$', ...
Python
0.000002
@@ -231,16 +231,17 @@ %3E%5B%5Cw-%5D+) +/ $', Vote @@ -310,16 +310,17 @@ /results +/ $', resu
1d0b114c7e918c87e14d9ea7a7c49cb9120db68b
Bump version (#128)
vt/version.py
vt/version.py
"""Defines VT release version.""" __version__ = '0.17.2'
Python
0
@@ -52,7 +52,7 @@ .17. -2 +3 '%0A
1034699a21dc0cf4862624d076d487deae7df9e2
add NullHandler to avoid "no handlers could be found" error.
Lib/fontTools/__init__.py
Lib/fontTools/__init__.py
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * version = "3.0"
Python
0
@@ -91,16 +91,247 @@ import * +%0Aimport logging%0A%0A# add a do-nothing handler to the libary's top-level logger, to avoid%0A# %22no handlers could be found%22 error if client doesn't configure logging%0Alog = logging.getLogger(__name__)%0Alog.addHandler(logging.NullHandler()) %0A%0Aversio
44620b2fa69500e1cada5622fa96eedd9c931006
Add test for MessageBeep()
Lib/test/test_winsound.py
Lib/test/test_winsound.py
# Ridiculously simple test of the winsound module for Windows. import winsound for i in range(100, 2000, 100): winsound.Beep(i, 75) print "Hopefully you heard some sounds increasing in frequency!"
Python
0
@@ -72,16 +72,22 @@ winsound +, time %0Afor i i @@ -201,8 +201,351 @@ uency!%22%0A +winsound.MessageBeep()%0Atime.sleep(0.5)%0Awinsound.MessageBeep(winsound.MB_OK)%0Atime.sleep(0.5)%0Awinsound.MessageBeep(winsound.MB_ICONASTERISK)%0Atime.sleep(0.5)%0Awinsound.MessageBeep(winsound.MB_ICONEXCLAMATION)%0Atime.sleep(0.5...
df77f4de261e3f21cc95f56fbb4dd738c02a2dd1
Put all test metrics on the same row of the dataframe.
src/graph_world/models/benchmarker.py
src/graph_world/models/benchmarker.py
import json import os from abc import ABC, abstractmethod import apache_beam as beam import gin import pandas as pd class Benchmarker(ABC): def __init__(self): self._model_name = '' def GetModelName(self): return self._model_name # Train and test the model. # Arguments: # * element: output of t...
Python
0
@@ -2118,24 +2118,45 @@ , element):%0A + output_data = %7B%7D%0A # for be @@ -3144,29 +3144,33 @@ .%0A -output_data = +for key, value in benchma @@ -3193,19 +3193,112 @@ etrics'%5D -%0A +.items():%0A + output_data%5B%0A '%25s__%25s' %25 (benchmarker.GetModelName(), key)%5D = value%0...
886105ba5f4a8b53fbf5a39f7cb3dc48ce544a3a
add total days check
cgi-bin/oa-gdd.py
cgi-bin/oa-gdd.py
#!/usr/bin/python """ Produce a OA GDD Plot, dynamically! $Id: $: """ import sys, os sys.path.insert(0, '/mesonet/www/apps/iemwebsite/scripts/lib') os.environ[ 'HOME' ] = '/tmp/' os.environ[ 'USER' ] = 'nobody' import iemplot import cgi import datetime import network import iemdb COOP = iemdb.connect('coop', bypass=Tr...
Python
0.000006
@@ -1407,16 +1407,26 @@ ) as gdd +, count(*) %0A from @@ -1679,16 +1679,46 @@ te(sql)%0A +total_days = (ets - sts).days%0A for row @@ -1785,16 +1785,63 @@ ontinue%0A + if row%5B2%5D %3C (total_days * 0.9):%0A continue%0A lats.a
53a86e2318256e6edcca3d1e4ce2981a29bd8208
Add flask-email configs
web/config.py
web/config.py
import os basedir = os.path.abspath(os.path.dirname(__file__)) class BaseConfiguration(object): DEBUG = False TESTING = False ADMINS = frozenset(['youremail@yourdomain.com']) SECRET_KEY = 'SecretKeyForSessionSigning' THREADS_PER_PAGE = 8 DATABASE = 'app.db' DATABASE_PATH = os.path.join(...
Python
0.000001
@@ -1283,16 +1283,217 @@ T=6379%0A%0A + MAIL_SERVER = %22smtp_server.usgo.org%22%0A MAIL_PORT = 587%0A MAIL_USE_TLS = True%0A MAIL_USERNAME = %22noreply@usgo.org%22%0A MAIL_PASSWORD = %22password%22%0A MAIL_DEFAULT_SENDER = %22noreply@usgo.org%22%0A%0A class De
21c9764f7d747d16e72548f98c73df4c26aa1e95
Optimize iterating samples
src/zephyr/collector.py
src/zephyr/collector.py
import threading import collections import zephyr class EventStream: def __init__(self): self.events = [] self.events_cleaned_up = 0 self.lock = threading.RLock() def __iter__(self): with self.lock: return iter(self.events[:]) def __...
Python
0.000029
@@ -2992,24 +2992,40 @@ samples(self +, skip_samples=0 ):%0D%0A @@ -3216,16 +3216,51 @@ .samples +%5Bskip_samples:%5D, start=skip_samples ):%0D%0A @@ -5239,139 +5239,37 @@ -for local_sample_index, (sample_timestamp, sample) in enumerate(signal_stream.iterate_timed_samples()):%0D%0A ...
2c4a35ca944a342792fb934b17b156a77a090d3c
Add concat to FormattedTextStringFormat
bot/action/util/textformat.py
bot/action/util/textformat.py
from bot.api.domain import Message class FormattedText: def __init__(self, mode="HTML"): self.formatter = TextFormatterFactory.get_for_mode(mode) self.mode = mode self.text = "" def normal(self, text: str): self.text += self._escaped(text) return self def bold(sel...
Python
0.000001
@@ -6322,32 +6322,577 @@ _escaped(text)%0A%0A + def concat(self, *args, **kwargs):%0A %22%22%22%0A :type args: FormattedText%0A :type kwargs: FormattedText%0A %22%22%22%0A for arg in args:%0A assert self.formatted_text._is_compatible(arg), %22Cannot concat text with dif...
ff2958c25812fb9486e8611e44c93ba32b737866
migrate res.company object to new API
l10n_br_stock_account/res_company.py
l10n_br_stock_account/res_company.py
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2011 Renato Lima - Akretion # # ...
Python
0
@@ -1396,20 +1396,16 @@ nerp -.osv import orm, @@ -1400,19 +1400,22 @@ import -orm +models , fields @@ -1427,23 +1427,25 @@ ass -res_c +ResC ompany( -orm +models .Mod @@ -1482,34 +1482,13 @@ ny'%0A +%0A -_columns = %7B%0A ' stoc @@ -1503,34 +1503,34 @@ _category_id -': + = fields. many2o...
5000eea27c511ad036f03b64e2be7dc69bac0845
Add `JSONField`
jacquard/odm/fields.py
jacquard/odm/fields.py
import abc class BaseField(object, metaclass=abc.ABCMeta): def __init__(self, null=False, default=None): self.null = null self.default = default @abc.abstractmethod def transform_to_storage(self, value): raise NotImplementedError() @abc.abstractmethod def transform_from_s...
Python
0
@@ -4,16 +4,28 @@ ort abc%0A +import copy%0A %0A%0Aclass @@ -1598,21 +1598,26 @@ return +str( value +) %0A%0A de @@ -1676,8 +1676,199 @@ n value%0A +%0A%0Aclass JSONField(BaseField):%0A def transform_to_storage(self, value):%0A return copy.deepcopy(value)%0A%0A def transform_from_storage(self, ...
aa3a8ee76f85ef1c3c4c0beb7b6c46a0c69961f1
allow absent of tornado
http2/__init__.py
http2/__init__.py
# -*- coding: utf-8 -*- from tornado import version_info if version_info[0] >= 4: from http2.torando4 import * else: raise NotImplementedError()
Python
0.000096
@@ -18,17 +18,25 @@ -8 -*-%0A%0A -%0A +try:%0A from tor @@ -60,17 +60,55 @@ on_info%0A -%0A +except ImportError:%0A pass%0Aelse:%0A if versi @@ -124,16 +124,20 @@ %5D %3E= 4:%0A + from @@ -165,42 +165,5 @@ t *%0A -else:%0A raise NotImplementedError() %0A
ea1fbd21761b5fbe60f179988114320dcb93cf92
remove unused attr
benchbuild/extensions/base.py
benchbuild/extensions/base.py
""" Extension base-classes for compile-time and run-time experiments. """ import collections as c import logging import typing as tp from abc import ABCMeta import attr from benchbuild.utils import run LOG = logging.getLogger(__name__) class Extension(metaclass=ABCMeta): """An experiment functor to implement c...
Python
0.000018
@@ -155,21 +155,8 @@ ta%0A%0A -import attr%0A%0A from
1484ae176d5bc8ba0afa3e948c8e507b2926a2c7
fix fqbn expansion
build_platform.py
build_platform.py
import sys import glob import time import os import subprocess import collections from clint.textui import colored # add user bin to path! BUILD_DIR = '' # add user bin to path! try: BUILD_DIR = os.environ["TRAVIS_BUILD_DIR"] except KeyError: pass # ok maybe we're on actions? try: BUILD_DIR = os.environ["G...
Python
0
@@ -3811,33 +3811,72 @@ -platforms.extend(platform +for p in platform:%0A platforms.append(ALL_PLATFORMS%5Bp%5D )%0A @@ -3970,60 +3970,8 @@ ms:%0A - #print(%22building%22, platform, %22full name%22, fqbn)%0A
50b7345c1dcb3c2fcc05fa61108fa1649ae17a0c
Add admin filters
django_iceberg/admin.py
django_iceberg/admin.py
# -*- coding: utf-8 -*- from django.contrib import admin from django_iceberg.models import UserIcebergModel class UserIcebergModelAdmin(admin.ModelAdmin): list_display = ('user', 'environment', 'last_updated', 'application_namespace') raw_id_fields = ("user",) admin.site.register(UserIcebergModel, UserIc...
Python
0
@@ -104,16 +104,17 @@ gModel%0A%0A +%0A class Us @@ -169,18 +169,16 @@ display - = ('user @@ -236,16 +236,123 @@ space')%0A + list_filter = ('environment', 'last_updated')%0A search_fields = ('user_username', 'user_first_name')%0A raw_
256017557537bbf40eb593637f1e373cfdbbb1ce
Add macOS SDK version checking Credits to @se4u for the command
buildlib/macos.py
buildlib/macos.py
# ungoogled-chromium: A Google Chromium variant for removing Google integration and # enhancing privacy, control, and transparency # Copyright (C) 2016 Eloston # # This file is part of ungoogled-chromium. # # ungoogled-chromium is free software: you can redistribute it and/or modify # it under the terms of the GNU Gen...
Python
0
@@ -2065,53 +2065,684 @@ -# TODO: Maybe add check for macOS SDK version +self.logger.info(%22Checking macOS SDK version...%22)%0A result = self._run_subprocess(%5B%22xcrun%22, %22--show-sdk-version%22%5D, stdout=subprocess.PIPE,%0A universal_newlines=True)%0A if ...
019a1ab10b71d4bb768e96957e9d485efeb588fc
add admin class for Attachment model --- djangobb_forum/admin.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
djangobb_forum/admin.py
djangobb_forum/admin.py
# -*- coding: utf-8 -*- from django.contrib import admin from django.contrib.auth import admin as auth_admin from django.contrib.auth.models import User from djangobb_forum.models import Category, Forum, Topic, Post, Profile, Reputation,\ Report, Ban class CategoryAdmin(admin.ModelAdmin): list_display = ['na...
Python
0
@@ -231,16 +231,17 @@ utation, + %5C%0A Re @@ -249,16 +249,28 @@ ort, Ban +, Attachment %0A%0A%0Aclass @@ -1960,16 +1960,218 @@ urls()%0A%0A +class AttachmentAdmin(admin.ModelAdmin):%0A list_display = %5B'id', 'name', 'size', 'path', 'hash', %5D%0A search_fields = %5B'name'%5D%0A list_display_links = ...
df4abb113c3d3faa271e5385fec61ef2542c389c
Remove obsolete docstring
djangosaml2/backends.py
djangosaml2/backends.py
# Copyright (C) 2010-2012 Yaco Sistemas (http://www.yaco.es) # Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
Python
0.008334
@@ -956,158 +956,8 @@ nd): -%0A %22%22%22This backend is added automatically by the assertion_consumer_service%0A view.%0A%0A Don't add it to settings.AUTHENTICATION_BACKENDS.%0A %22%22%22 %0A%0A
8a6b88c38b2844fba03b6664fe828ebbd5a08a68
use pkdlog so it passes test for pkdp
tests/pkdebug2_test.py
tests/pkdebug2_test.py
# -*- coding: utf-8 -*- u"""pytest for `pykern.pkdebug` :copyright: Copyright (c) 2015 Bivio Software, Inc. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function def test_format(capsys): from pykern import pkconfig ...
Python
0
@@ -518,17 +518,19 @@ port pkd -p +log %0A%0A de @@ -563,17 +563,19 @@ pkd -p +log ('%7B%7D', v
db4b63ee097116c5be711d1b6a69100065f1a885
update format unicode
weby/utils.py
weby/utils.py
# coding=utf8 from datetime import datetime, date def format_dic(dic): """将 dic 格式化为 JSON,处理日期等特殊格式""" for key, value in dic.iteritems(): dic[key] = format_value(value) return dic def format_value(value): if isinstance(value, dict): return format_dic(value) elif isinstance(valu...
Python
0.000009
@@ -44,16 +44,28 @@ e, date%0A +import json%0A %0A%0Adef fo @@ -236,12 +236,47 @@ alue +, include_fields=%5B%5D, is_compact=True ):%0A -%0A @@ -404,17 +404,16 @@ (value)%0A -%0A elif @@ -475,24 +475,25 @@ ormat()%0A +# elif isinsta @@ -503,20 +503,20 @@ (value, -date +bool ):%0A @@ -522,75...
643cd60fb15157d8568fb9ec211c36c3002f44b6
clarify that this script DOES NOT preserve legacy Sonobat metadata (but it SHOULD)
bin/sb2guano.py
bin/sb2guano.py
#!/usr/bin/env python2 """ Convert files with Sonobat-format metadata to use GUANO metadata. """ import sys import os import os.path import mmap import re import wave from contextlib import closing from datetime import datetime from pprint import pprint from guano import GuanoFile # regex for parsing Sonobat metada...
Python
0
@@ -85,16 +85,47 @@ etadata. +%0A%0Ausage: sb2guano.py WAVFILE... %0A%22%22%22%0A%0Aim @@ -3053,43 +3053,8 @@ data - (but leave the old stuff in place) %22%22%22%0A
28a9b6d744f088fed074e2d7166ed14d78c942a7
Update logging
weibo/core.py
weibo/core.py
# coding=utf-8 import concurrent.futures import itertools import logging import os from colorama import Fore, Style import settings from weibo.api import WeiboApi class Crawler(object): def __init__(self, target_url): """ 初始化 :param target_url: 目标微博主页url """ # 目标数据 ...
Python
0.000001
@@ -304,14 +304,129 @@ -# %E7%9B%AE%E6%A0%87%E6%95%B0%E6%8D%AE +self.logger = logging.getLogger(self.__class__.__name__)%0A%0A # %E7%9B%AE%E6%A0%87%E6%95%B0%E6%8D%AE%0A self.logger.info(Fore.BLUE + target_url) %0A @@ -613,73 +613,8 @@ er() -%0A self.logger = logging.getLogger(self.__clas...
d5d5c342fde657de3e21fbd454bda007f79aa4db
Remove superfluous SSID confirmation messages
cicoclient/cli.py
cicoclient/cli.py
# Copyright 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 by applicable...
Python
0.000008
@@ -3913,98 +3913,8 @@ val) -%0A message = %22SSID for these servers: %25s%5Cn%22 %25 ssid%0A sys.stdout.write(message) %0A%0A @@ -4908,120 +4908,8 @@ sid) -%0A message = %22Released these servers with SSID: %25s%5Cn%22 %25 parsed_args.ssid%0A sys.stdout.write(message) %0A%0A
72df56880ffaf0aba3b6f919d5a7f2add32623dc
Update binary_clock.py
binary_clock.py
binary_clock.py
__author__ = 'tim mcguire' import datetime import math import Tkinter import sys,os def to_binary(dec, width): x = width - 1 answer = "" while x >= 0: current_power = math.pow(2, x) # how many powers of two fit into dec? how_many = int(dec / current_power) answer += str(how...
Python
0.000002
@@ -1492,17 +1492,60 @@ aster)%0A%0A -%0A +time_format = 24%0Aif len(sys.argv) %3E= 2:%0A time_for @@ -1562,16 +1562,17 @@ argv%5B1%5D%0A +%0A start_y @@ -1755,8 +1755,9 @@ inloop() +%0A
36ca52e816a2938c6723e3ec2ed4a350958c78d8
remove comments
binary_clock.py
binary_clock.py
__author__ = 'tim mcguire' import datetime import math import Tkinter def to_binary(dec, width): x = width - 1 answer = "" while x >= 0: current_power = math.pow(2, x) # how many powers of two fit into dec? how_many = int(dec / current_power) answer += str(how_many) ...
Python
0
@@ -484,29 +484,8 @@ up:%0A - #2,4,3,4,3,4%0A
e59d6be5a31dbe775f6481d079f0f4e81a27a9ce
Add import of the re module to the utils module
classyfd/utils.py
classyfd/utils.py
""" Contains utility functions used within this library that are also useful outside of it. """ import os import pwd import string import random # Operating System Functions def determine_if_os_is_posix_compliant(): """ Determine if the operating system is POSIX compliant or not Return Value: ...
Python
0
@@ -141,16 +141,26 @@ random%0A +import re%0A %0A%0A# Oper @@ -2168,24 +2168,27 @@ return random_file_name +%0A%0A%0A
00e865178f8e1762e7cd1ec8d44713d73cc58c47
tidy up of DynTypedNode in python
clast/__init__.py
clast/__init__.py
import _clast from _clast import * ## REPRESENTATIVE CLASSES ONLY def cxxRecordDecl(*args): return _clast._cxxRecordDecl(list(args)) def decl(*args): return _clast._decl(list(args)) def stmt(*args): return _clast._stmt(list(args)) def forStmt(*args): return _clast._forStmt(list(args)) def hasLoopI...
Python
0.000001
@@ -33,455 +33,170 @@ *%0A%0A -## REPRESENTATIVE CLASSES ONLY%0A%0Adef cxxRecordDecl(*args):%0A return _clast._cxxRecordDecl(list(args))%0A%0Adef decl(*args):%0A return _clast._decl(list(args))%0A%0Adef stmt(*args):%0A return _clast._stmt(list(args))%0A%0Adef forStmt(*args):%0A return _clast._forStmt(list...
a3ad232c3f9734e94ed09088b260ff7f6bd722d7
Fix wordExists()
Library.py
Library.py
import dataset import re from Generator import generateWord db = None phonemes = {} allophones = {} declensions = {} categories = {} def transcribePhonemes(word): '''Transcribe from orthographic representation to phonetic representation. ''' for current, new in phonemes.items(): word = re.su...
Python
0.001251
@@ -1793,69 +1793,8 @@ m)%0A%0A - if word is None:%0A raise LookupError%0A else:%0A @@ -1992,69 +1992,8 @@ m)%0A%0A - if word is None:%0A raise LookupError%0A else:%0A @@ -2021,20 +2021,42 @@ dExists( -term +english=None, conlang=None ):%0A ' @@ -2225,11 +2225,30 @@ ...
da1fc79f8eb476f7ed22d7969a1558ab6a1e3f5d
Use a name for the fabricated type that makes clearer it is fabricated
src/zeit/cms/content/add.py
src/zeit/cms/content/add.py
# Copyright (c) 2009 gocept gmbh & co. kg # See also LICENSE.txt import datetime import grokcore.component as grok import urllib import zeit.cms.content.interfaces import zeit.cms.repository.interfaces import zope.browser.interfaces import zope.component import zope.interface class ContentAdder(object): zope.in...
Python
0.000018
@@ -1232,16 +1232,30 @@ = type( +'Provides_' + self.typ
23cafee3069733ec53691409a83ab51024da2c5c
Remove incorrect comment
src/zeit/retresco/update.py
src/zeit/retresco/update.py
import argparse import gocept.runner import grokcore.component as grok import logging import time import zeit.cms.celery import zeit.cms.checkout.interfaces import zeit.cms.content.interfaces import zeit.cms.interfaces import zeit.cms.repository.interfaces import zeit.cms.workingcopy.interfaces import zeit.retresco.int...
Python
0
@@ -3752,222 +3752,8 @@ dy.%0A - # Note: This only works when content is already published in%0A # TMS, but for a large-scale reindex where we don't want to%0A # have to enrich again that's probably fine.%0A
59e64609b78b12447eadb793c24236d150ffc3d4
remove unneeded condition
src/h2/frame_buffer.py
src/h2/frame_buffer.py
# -*- coding: utf-8 -*- """ h2/frame_buffer ~~~~~~~~~~~~~~~ A data structure that provides a way to iterate over a byte buffer in terms of frames. """ from hyperframe.exceptions import InvalidFrameError from hyperframe.frame import ( Frame, HeadersFrame, ContinuationFrame, PushPromiseFrame ) from .exceptions impo...
Python
0
@@ -5688,15 +5688,9 @@ # -Don't t +T ry t @@ -5705,135 +5705,19 @@ the -body if we didn't get a frame we know about:%0A # there's nothing we can do with it anyway.%0A if f is not None:%0A +frame body%0A @@ -5717,36 +5717,32 @@ dy%0A try:%0A - f.pa @@ -5789,28 +578...
a4db65ff4c5b3edd4739b0864f4e1641b37b3b87
Remove wrong comment
setuptools/tests/test_logging.py
setuptools/tests/test_logging.py
import inspect import logging import os import pytest setup_py = """\ from setuptools import setup setup( name="test_logging", version="0.0" ) """ @pytest.mark.parametrize( "flag, expected_level", [("--dry-run", "INFO"), ("--verbose", "DEBUG")] ) def test_verbosity_level(tmp_path, monkeypatch, flag, e...
Python
0
@@ -1301,62 +1301,8 @@ dist - # %3C- load distutils after all the patches take place %0A%0A
ef4e84d2defbf4899f0a1745fce5162e2510c1f7
test "merge-patches --help"
rhcephpkg/tests/test_merge_patches.py
rhcephpkg/tests/test_merge_patches.py
import pytest import subprocess from rhcephpkg import MergePatches from rhcephpkg.tests.util import CallRecorder def git(*args): """ shortcut for shelling out to git """ cmd = ['git'] + list(args) subprocess.check_call(cmd) class TestMergePatches(object): def test_on_debian_branch(self, testpkg, mo...
Python
0.000001
@@ -262,24 +262,306 @@ s(object):%0A%0A + def test_help(self, capsys):%0A mergep = MergePatches(%5B'rhcephpkg', 'merge-patches', '--help'%5D)%0A with pytest.raises(SystemExit):%0A mergep.main()%0A out, _ = capsys.readouterr()%0A assert %22Fetch the latest patches branch that r...
7bccd20523f96728db7a6b5fd23cb339787ecd3a
Bump to 1.1.4
jnius/__init__.py
jnius/__init__.py
''' Pyjnius ======= Accessing Java classes from Python. All the documentation is available at: http://pyjnius.readthedocs.org ''' __version__ = '1.1.4.dev0' from .jnius import * # noqa from .reflect import * # noqa from six import with_metaclass # XXX monkey patch methods that cannot be in cython. # Cython doesn...
Python
0.000084
@@ -150,13 +150,8 @@ .1.4 -.dev0 '%0A%0Af
6a27bd99352e4dc7f38c6f819a8a45b37c1a094c
Remove TODO to add requirements.txt
start-active-players.py
start-active-players.py
""" Start active players for the week Ideas: - Include the names of players who cannot be started - And maybe the full roster on those dates TODO: - Add required packages in requirements.txt """ import requests from bs4 import BeautifulSoup # TODO: Configure this somewhere better (as a direct argument to the sc...
Python
0
@@ -142,59 +142,8 @@ ates -%0A%0ATODO:%0A- Add required packages in requirements.txt %0A%22%22%22
26f9375c45e29dfdfd5b3611cdf86e87ea7f9801
Add reference, fix docstring
statsmodels/regression/dimred.py
statsmodels/regression/dimred.py
import numpy as np from statsmodels.base import model import statsmodels.base.wrapper as wrap import pandas as pd class DimReductionRegression(model.Model): def __init__(self, endog, exog, **kwargs): super(DimReductionRegression, self).__init__(endog, exog, **kwargs) def _prep(self, n_slice): ...
Python
0.000001
@@ -2202,24 +2202,182 @@ ----------%0A + KC Li (1992). On Principal Hessian Directions for Data%0A Visualization and Dimension Reduction: Another application%0A of Stein's lemma. JASA 87:420.%0A %22%22%22%0A%0A @@ -2625,16 +2625,187 @@ : bool%0A + If True, use least squares regression t...
a6390df0f4fb9c9402b1c795d4bf65765b793412
Bump dallinger version
dallinger/version.py
dallinger/version.py
"""Dallinger version number.""" __version__ = "5.0.5"
Python
0
@@ -45,11 +45,11 @@ = %225.0. -5 +6 %22%0A
75d2f1aad9aa88926fce27d49c4e452eb571fc14
Update the lexer
cycli/lexer.py
cycli/lexer.py
import re from pygments.lexer import RegexLexer from pygments.token import Text, Comment, Operator, Keyword, Name, String, Number, Token __all__ = ["CypherLexer"] class CypherLexer(RegexLexer): name = 'Cypher' aliases = ['cypher'] filenames = ['*.cyp', '*.cypher'] flags = re.IGNORECASE tokens = {...
Python
0
@@ -1710,50 +1710,67 @@ (r' ---%3E%7C%3C--%7C%5C%5D-%3E%7C%3C-%5C%5B%7C%5C)-%5C%5B%7C%5C%5D- +%5B-%5C)%5C%5D%5D-%5B%3E%5C(%5D%7C%5B%3C%5C)%5D-%5B-%5C(%5C%5B%5D%7C%5B%5C%5D%5C)%5D-%7C-%5B %5C( -%7C %5C%5B +%5D%7C--%3E%7C%3C-- %7C%5C%5D-%7C +- %5C%5B -%7C%5C%5D ', T @@ -1840,16 +1840,26 @@ (r'%5C(%7C%5C) +%7C%5C%...
a98096f129165be003294eaa5ad3596931c58ae7
Use per-request database connections.
nmhive.py
nmhive.py
#!/usr/bin/env python import json import mailbox import os import tempfile import urllib.request import flask import flask_cors import notmuch app = flask.Flask(__name__) app.config['CORS_HEADERS'] = 'Content-Type' flask_cors.CORS(app) TAG_PREFIX = os.getenv('NMBPREFIX', 'notmuch::') NOTMUCH = None _TAGS = {} @a...
Python
0
@@ -294,16 +294,21 @@ MUCH +_PATH = None%0A _TAG @@ -307,19 +307,8 @@ one%0A -_TAGS = %7B%7D%0A %0A%0A@a @@ -379,24 +379,89 @@ -for t in NOTMUCH +database = notmuch.Database(path=NOTMUCH_PATH)%0A try:%0A for t in database .get @@ -481,16 +481,20 @@ + + if t.sta @@ -522,24 +522,28 @...
0983331773982b2bae6b92a0350a91aefbe6481e
Use the `note` style box. Refs #11725.
contrib/help_guide_version_notice.py
contrib/help_guide_version_notice.py
# -*- coding: utf-8 -*- # # Copyright (C) 2014 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.com/license.html. # # This software consists of vo...
Python
0.000001
@@ -684,20 +684,15 @@ !box -%0A**Note:** t + note%0AT his
ebaa0aec67a7eb64a0d8da52807c2773c89fb6a6
version bump to 0.1.24
contact_form/__init__.py
contact_form/__init__.py
# -*- coding: utf-8 -*- VERSION = (0, 1, 23) def get_version(): """Returns the version as a human-format string.""" return '.'.join([str(i) for i in VERSION]) __author__ = 'dlancer' __docformat__ = 'restructuredtext en' __copyright__ = 'Copyright 2014-2015, dlancer' __license__ = 'BSD' __version__ = get_ver...
Python
0
@@ -40,9 +40,9 @@ 1, 2 -3 +4 )%0A%0A%0A
106c7dedd1c4f2d3ba189b25e124c1879f9f80d8
Print newline when skipping hdf5 backtrace error message
into/backends/tests/test_pytables.py
into/backends/tests/test_pytables.py
from __future__ import absolute_import, division, print_function import numpy as np import datashape as ds import pytest tb = pytest.importorskip('tables') from into import into from into.utils import tmpfile from into.backends.pytables import PyTables, discover import os try: f = tb.open_file('import-tables-te...
Python
0.000001
@@ -524,17 +524,18 @@ , error: - +%5Cn %25s' %25 e)
6320296974895b41ff87a007a73752c816db2a3d
improve one help string
bin/addons/base/ir/ir_cron.py
bin/addons/base/ir/ir_cron.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
Python
0.999936
@@ -2748,17 +2748,16 @@ res.part -e ner'%22),%0A
43b0201573a7bef18347c47f0434444a30edc5b1
Use global parameters for port & fork_server
rosserial_python/nodes/serial_node.py
rosserial_python/nodes/serial_node.py
#!/usr/bin/env python ##################################################################### # Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that th...
Python
0
@@ -2090,17 +2090,41 @@ _param(' -~ +/rosserial_embeddedlinux/ tcp_port @@ -2171,17 +2171,41 @@ _param(' -~ +/rosserial_embeddedlinux/ fork_ser
33d1e3f1d94c7af29742619df42983507e067568
Add VotableModelMixin
board/models.py
board/models.py
import datetime from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import models class UserProfile(models.Model): user = models.OneToOneField(User, related_name='profile') nick = models.CharField(max_length=16) def __str__(self): return str(se...
Python
0
@@ -927,13 +927,324 @@ ass -Post( +VotableModelMixin:%0A @property%0A def votes(self):%0A vd = dict()%0A vd%5B'upvote'%5D = self._votes.filter(vote=Vote.UPVOTE).count()%0A vd%5B'downvote'%5D = self._votes.filter(vote=Vote.DOWNVOTE).count()%0A vd%5B'total'%5D = vd%5B'upvote'%5D - vd%5...
56fee8518b9022b854f0bb300e8e44ec84539a29
Fix callback to send a bogus message which will close the connection
bokeh/client.py
bokeh/client.py
''' ''' from __future__ import absolute_import, print_function import logging import random log = logging.getLogger(__name__) from tornado import gen from tornado.httpclient import HTTPRequest from tornado.ioloop import IOLoop, PeriodicCallback from tornado.websocket import websocket_connect from bokeh.server.exce...
Python
0
@@ -2950,138 +2950,101 @@ log. -warn(%22Deliberately wrong session ID%22)%0A msg = Protocol(%221.0%22).create('SERVER-INFO-REQ', 'wrongsessid')%0A cli.send_message(msg) +info(%22Sending deliberately bogus message%22)%0A cli._client.write_message(b%22xx%22, binary=True)%0A %0A%0Aif
7ed8de3d15941c683ae70c15a6ce50bbe29a6580
remove unused field from books
books/models.py
books/models.py
from django.db import models from wagtail.wagtailcore.models import Page, Orderable from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailadmin.edit_handlers import (FieldPanel, InlinePanel) from wagtail.wagtailimages.edit_handlers import ImageChooserP...
Python
0.000001
@@ -993,36 +993,8 @@ + %5B%0A - FieldPanel('name'),%0A
1a40dd2724a4a6364f0786fc5ac5f93d37daeaa0
add NoTestDataError
judgesite/task.py
judgesite/task.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import io import json import shutil import subprocess import os from config import conf from models import save_result class JudgeTask(object): def __init__(self, message): task = json.loads(message) self.submit_type = task["submit_ty...
Python
0.000001
@@ -177,16 +177,176 @@ esult%0A%0A%0A +class NoTestDataException(Exception):%0A%0A def __init__(self, value=None):%0A self.value = value%0A%0A def __str__(self):%0A return repr(self.value)%0A%0A%0A class Ju @@ -757,16 +757,121 @@ mit%22%5D)%0A%0A + self.result = %22%22%0A self.run_t...
2d34cc4321db36d316007bd394d4e71d39f587e3
fix for mutable keywords list object
InvertedIndex.py
InvertedIndex.py
""" @file InvertedIndex.py @brief creating inverted indexes and manage them for search @author Daniel Schauenberg <schauend@informatik.uni-freiburg.de> @version 0.1 @date 2009-10-24 """ import heapq import FileParser from operator import itemgetter class IndexManager: """ Class for managing the complete index ...
Python
0.000001
@@ -2549,24 +2549,63 @@ ection with%0A + firstkeyword = keywords.pop(0)%0A comp @@ -2633,31 +2633,28 @@ cuments( +first keyword -s.pop(0) )%0A @@ -3019,16 +3019,108 @@ mes%5Bc%5D)%0A + # fix to keep mutable keyword list consistent%0A keywords.append(firstkeyword)%0A
e0b3e23d4890a10f8bca4c699e5a9cd6294fee29
add xpub
keepkey-for-mn.py
keepkey-for-mn.py
#!/usr/bin/env python3 import sys, os sys.path.append( os.path.join( os.path.dirname(__file__), '.' ) ) sys.path.append( os.path.join( os.path.dirname(__file__), '.', 'dashlib' ) ) from config import * from keepkeylib.client import KeepKeyClient from keepkeylib.transport_hid import HidTransport import keepkeylib.ckd...
Python
0
@@ -857,24 +857,25 @@ to use %0A +# print('xpub @@ -873,16 +873,21 @@ nt('xpub +/tpub --%3E ' + @@ -956,16 +956,146 @@ 3587CF)) +%0A print('xpub/tpub --%3E ' + bip32.serialize(client.get_public_node(bip32_path).node, ( 0x0488B21E if MAINNET else 0x043587CF ))) %0A%0A fo
658de49626b6ef8b199bee6502bc62abebaa0803
Use an assert for an error that is concerning developers
sale_condition_template/sale_order.py
sale_condition_template/sale_order.py
# -*- coding: utf-8 -*- # # # Author: Nicolas Bessi # Copyright 2013-2014 Camptocamp SA # # 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 # Licen...
Python
0.000002
@@ -818,46 +818,8 @@ lds%0A -from openerp.tools.translate import _%0A %0A%0Acl @@ -2453,14 +2453,23 @@ _id, + (tuple, list) +) :%0A @@ -2478,18 +2478,22 @@ -if +assert len(ord @@ -2503,195 +2503,53 @@ id) -%3E 1:%0A raise orm.except_osv(%0A _('action_invoice_creat...
8fc26c374cefdb4d5e3a7a5727231c752f384f61
Update event_handlers.py
boiler/user/event_handlers.py
boiler/user/event_handlers.py
from flask import current_app, url_for from boiler.user import events from boiler.di import get_service from flask import has_request_context """ Event handlers A collection of default handlers for events emitted in user service. """ # ----------------------------------------------------------------------------- # Us...
Python
0.000002
@@ -134,16 +134,29 @@ _context +, current_app %0A%0A%22%22%22%0AEv @@ -1787,24 +1787,105 @@ n event %22%22%22%0A + confirm = current_app.di.get_parameter('USER_ACCOUNTS_REQUIRE_CONFIRMATION')%0A base_url @@ -1936,24 +1936,44 @@ ternal=True) + if confirm else ''%0A %0A user_se
6fc68abdb48134f4e647f0a1d69becd374d1147f
add missing Python file encoding
brasilcomvc/accounts/admin.py
brasilcomvc/accounts/admin.py
from django.contrib import admin from .models import User, UserAddress class UserAdmin(admin.ModelAdmin): class UserAddressInline(admin.StackedInline): model = UserAddress list_display = ('email', 'full_name', 'username',) fieldsets = ( ('Informações Pessoais', { 'fields': (...
Python
0.000014
@@ -1,12 +1,68 @@ +# coding: utf8%0Afrom __future__ import unicode_literals%0A%0A from django.
ddb3f3cb33bab10113dbf290c65b9919339fdd72
Update artman version
synthtool/gcp/gapic_generator.py
synthtool/gcp/gapic_generator.py
from pathlib import Path import tempfile import platform from synthtool import _tracked_paths from synthtool import log from synthtool import shell from synthtool.sources import git GOOGLEAPIS_URL: str = 'git@github.com:googleapis/googleapis.git' GOOGLEAPIS_PRIVATE_URL: str = ( 'git@github.com:googleapis/googlea...
Python
0.000002
@@ -177,16 +177,41 @@ rt git%0A%0A +ARTMAN_VERSION = '0.12.0' %0AGOOGLEA @@ -2008,32 +2008,33 @@ ocker', 'pull', +f 'googleapis/artm @@ -2040,14 +2040,22 @@ man: -0.10.1 +ARTMAN_VERSION '%5D)%0A @@ -4136,16 +4136,17 @@ 'pull', +f 'googlea @@ -4160,14 +4160,22 @@ man: -0.11.0 +ARTMAN_VERSION '%5D)%0A
56cbbef7b8bbfa31445dad1561c4014804250fd5
fix test
kyototycoon/test/test_kyototycoon.py
kyototycoon/test/test_kyototycoon.py
# (C) Datadog, Inc. 2010-2017 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib from nose.plugins.attrib import attr # 3p import requests # project from checks import AgentCheck from tests.checks.common import AgentCheckTest config = { 'instances': [{ 'report_url': 'ht...
Python
0.000002
@@ -1691,16 +1691,201 @@ ETRICS:%0A + if mname == 'kyototycoon.records' or 'kyototycoon.size':%0A self.assertMetric(mname, count=1, at_least=0, tags=%5B'optional:tag1', 'db:0'%5D)%0A else:%0A
fab3936bacbb961f2214ea5d1dce913c1635ab2c
Commit inicial de una rama para la versión 7.0. Todos los módulos fueron marcados como no instalables mientras no se compruebe que funcionan o migren, para poder usarlos o probarlos se debería poner el atributo installable de los ficheros __openerp__.py de cada módulo a True
l10n_es_account_asset/__openerp__.py
l10n_es_account_asset/__openerp__.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
Python
0.999886
@@ -1980,11 +1980,12 @@ e%22: -Tru +Fals e,%0A%7D