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
39c47e823c1a4fdf2f5af7ce973e6af6d74a116c
Use casefold instead of lower, as the pydoc seems to suggest that it is the right thing to do
code/helper/dictionaries.py
code/helper/dictionaries.py
#! /usr/bin/env python3 from helper.easierlife import BASE_DIR # Load an example dictionary # First column is doc id, second is sentence id, third is entity def load_examples_dictionary(filename): examples = set() with open(filename, 'rt') as examples_dict_file: for line in examples_dict_file: ...
Python
0.000003
@@ -855,16 +855,27 @@ if sym +.casefold() not in @@ -934,16 +934,27 @@ dict%5Bsym +.casefold() %5D = %5B%5D%0A @@ -989,16 +989,27 @@ dict%5Bsym +.casefold() %5D.append @@ -2354,21 +2354,24 @@ variant. -lower +casefold ()%5D = na @@ -2856,21 +2856,24 @@ d(entry. -lower +casefold ())%0A
5563eab0ab244910c40fe31cfa9e74b88b1b4c47
Change how urls are loaded from settings.
my_globals.py
my_globals.py
# This file contains the global variables used in smartsettia import json version= "0.1.0" # Note to concatonate dictionaries # z = x.copy() # z.update(y) # Set domain being used DOMAIN_INDEX = 2 # choose which domain. 0-2 DOMAIN = ["https://smartsettia.com/", "https://smartsettia-backburn.c9users.i...
Python
0
@@ -1615,75 +1615,8 @@ ess%0A - %22server_addr%22: %22https://smartsettia.com/api/ping%22,%0A @@ -3046,24 +3046,25 @@ ttings%0A # + print settin @@ -3081,24 +3081,24 @@ # debugger%0A - try:%0A @@ -3421,16 +3421,17 @@ f)%0A # + except F @@ -3649,16 +3649,17 @@ # + pr...
11df171acffe33f19c74afc8845063fccca3df33
Fix typo
pasync/connection.py
pasync/connection.py
# -*- coding: utf-8 -*- import socket import os import sys import threading from pasync._compat import Empty, Full, iteritems from pasync.q import LifoQueue, Queue from pasync.exceptions import ( TimeoutError, ConnectionError, SocketQueueError, SocketRecvQueueFullError, SocketRecvQueueEmptyError )...
Python
0.999999
@@ -4546,16 +4546,18 @@ ue.qsize +() %3C self.
780002f5df7278776a26bb65b4b0f3dce84537a1
Allow unit tests to run on iOS. (filesystem restriction)
pentai/db/test_db.py
pentai/db/test_db.py
import os import logging def init(): """ TODO: Call this setUp """ global initialised try: if initialised: return except: init_logging() import zodb_dict as z_m z_m.set_db("test.db") initialised = True def init_logging(): logger = logging.getLog...
Python
0
@@ -220,19 +220,229 @@ -z_m.set_db( +# Use kivy's user_data_dir so we're guaranteed write access%0A os.environ%5B'KIVY_NO_CONSOLELOG'%5D = ''%0A from kivy.app import App%0A a = App()%0A d = a.user_data_dir%0A%0A z_m.set_db(os.path.join(d, %22tes @@ -447,16 +447,17 @@ est.db%2...
19fbb3649b71228cc0498c24443f22dd95430f7c
improve csv export
src/knesset/laws/management/commands/export_votes.py
src/knesset/laws/management/commands/export_votes.py
import os, csv from operator import attrgetter from django.core.management.base import NoArgsCommand from django.conf import settings from tagging.models import Tag, TaggedItem from knesset.mks.models import Member,Party from knesset.laws.models import Vote,VoteAction,Bill class Command(NoArgsCommand): def hand...
Python
0.000006
@@ -431,16 +431,34 @@ __name') +%5C%0A .values( @@ -483,16 +483,22 @@ nt_party +__name ')%0A @@ -584,32 +584,62 @@ r = csv.writer(f +, quoting=csv.QUOTE_NONNUMERIC )%0A for mk @@ -680,54 +680,128 @@ '%5D, -mk%5B'name'%5D.encode('utf8'), mk%5B'current_party'%5D +%0A ...
c7dbbfff233f5b04cc1f99120a0f602daa8683a7
load c functions on demand
pgi/gitypes/_util.py
pgi/gitypes/_util.py
# Copyright 2012 Christoph Reiter # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. _dll_cache = {} _so_mapping = { "glib-2.0": "libglib-2.0.so.0", "gobject-2.0": "libgobject-...
Python
0.000001
@@ -218,23 +218,33 @@ n.%0A%0A -_dll_cache = %7B%7D +from ctypes import CDLL%0A%0A %0A_so @@ -393,423 +393,193 @@ %0A%7D%0A%0A -%0Adef load(name):%0A global _dll_cache, _so_mapping%0A if name not in _dll_cache:%0A from ctypes import CDLL%0A _dll_cache%5Bname%5D = CDLL(_so_mapping%5Bname%5D)%0A ...
6e7a0ca18051bb51b8d1b06a9b15a26a4d0cb5f7
Add UpdateConfig to EKS::Nodegroup (#1980)
troposphere/eks.py
troposphere/eks.py
# Copyright (c) 2012-2018, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags from .validators import boolean, double VALID_TAINT_EFFECT = ["NO_EXECUTE", "NO_SCHEDULE", "PREFER_NO_SCHEDULE"] def validate_taint_effect(taint_effect): ...
Python
0
@@ -3803,32 +3803,183 @@ False),%0A %7D%0A%0A%0A +class UpdateConfig(AWSProperty):%0A props = %7B%0A %22MaxUnavailable%22: (double, False),%0A %22MaxUnavailablePercentage%22: (double, False),%0A %7D%0A%0A%0A class LaunchTemp @@ -5030,32 +5030,79 @@ Taint%5D, False),%0A + %22UpdateConfig...
9a23d4ed119327d3b823ec223aaead90964bac58
Fix --no-cache-dir
pip/basecommand.py
pip/basecommand.py
"""Base Command class, and related routines""" import os import sys import tempfile import traceback import time import optparse from pip import cmdoptions from pip.locations import running_under_virtualenv from pip.log import logger from pip.download import PipSession from pip.exceptions import (BadCommand, Installa...
Python
0.000007
@@ -1641,16 +1641,34 @@ cache= +(%0A normaliz @@ -1714,16 +1714,77 @@ %22http%22)) +%0A if options.cache_dir else None%0A ) ,%0A
fc92545e29ea25a6c2e8b22e3a7b73b1083857fd
Update order of context keys to match other view
wagtailmedia/views/chooser.py
wagtailmedia/views/chooser.py
from django.shortcuts import get_object_or_404, render from django.urls import reverse from wagtail import VERSION as WAGTAIL_VERSION from wagtail.admin.modal_workflow import render_modal_workflow from wagtail.core import hooks from wagtail.core.models import Collection from wagtail.search.backends import get_search_b...
Python
0
@@ -5348,70 +5348,8 @@ es,%0A - 'uploadform': form,%0A 'media_type': media_type,%0A @@ -5370,32 +5370,32 @@ m': searchform,%0A + 'collect @@ -5406,32 +5406,60 @@ ': collections,%0A + 'uploadform': form,%0A 'is_sear @@ -5465,32 +5465,32 @@ rching': False,%0A - 'p...
c423a1198eb94866062fa88cc6e7bf0e83543291
bump version to 2.2.6
wagtailmodeladmin/__init__.py
wagtailmodeladmin/__init__.py
__version__ = '2.2.5'
Python
0
@@ -16,7 +16,7 @@ 2.2. -5 +6 '%0A
bbf24b7a1ce2e91eab57d1b8524d398822a1ddd1
use scrapy.utils.python.get_func_args
scrapy/spiders/crawl.py
scrapy/spiders/crawl.py
""" This modules implements the CrawlSpider which is the recommended spider to use for scraping typical web sites that requires crawling pages. See documentation in docs/topics/spiders.rst """ import copy import six from scrapy.http import Request, HtmlResponse from scrapy.utils.spider import iterate_spider_output f...
Python
0.000116
@@ -312,16 +312,62 @@ _output%0A +from scrapy.utils.python import get_func_args%0A from scr @@ -1171,24 +1171,25 @@ arg +_ count = self.pro @@ -1184,139 +1184,48 @@ t = -self.process_request.__code__.co_argcount%0A if hasattr(self.process_request, '__self__'):%0A argcount = argcount - 1 +...
96f5e8f494650ccf22472910cda52eb2c8d216d0
renaming pyjampiler bootstrap command to pyjscompile. pyjscompile _is_ pyjampiler
bootstrap.py
bootstrap.py
#!/usr/bin/python """ simple creation of three commands, customised for your specific system. windows users get a corresponding batch file. yippeeyaiyay. """ version = '0.7~pre1' import os import sys pyjsbuild = """#!%(exec)s pyjsversion = r'%(ver)s' pyjspth = r'%(pyjspth)s' import os import sys sys.path[0:0]...
Python
0.992483
@@ -684,429 +684,8 @@ pile - = %22%22%22#!%25(exec)s%0A%0Apyjsversion = r'%25(ver)s'%0Apyjspth = r'%25(pyjspth)s'%0A%0Aimport os%0Aimport sys%0Asys.path%5B0:0%5D = %5Br'%25(pth)s'%5D%0Asys.path.append(os.path.join(pyjspth, 'pgen'))%0A%0Aimport pyjs.translator%0Apyjs.pyjspth = pyjspth%0Apyjs.path += %5Bos.path.join(pyj...
447b3d9d8133da0448cba871314df01887b645d7
Fix documentation typo: accesible → accessible (#4033)
scrapy/utils/request.py
scrapy/utils/request.py
""" This module provides some useful functions for working with scrapy.http.Request objects """ from __future__ import print_function import hashlib import weakref from six.moves.urllib.parse import urlunparse from w3lib.http import basic_auth_header from scrapy.utils.python import to_bytes, to_native_str from w3lib...
Python
0.000002
@@ -1034,16 +1034,17 @@ ly acces +s ible to
c026de1bb6275dfe92cba55c2ec05ddf05656411
update thread local set / get for bootstrap version
corehq/apps/style/utils.py
corehq/apps/style/utils.py
from thread import _local BOOTSTRAP_2 = 'bootstrap-2' BOOTSTRAP_3 = 'bootstrap-3' def get_bootstrap_version(): bootstrap_version = _local.BOOTSTRAP_VERSION if bootstrap_version is None: bootstrap_version = BOOTSTRAP_2 return bootstrap_version def set_bootstrap_version3(): _local.BOOTSTRAP_V...
Python
0
@@ -1,29 +1,55 @@ -from +import thread - import _local +ing%0A%0A_thread_local = threading.local() %0A%0ABO @@ -129,24 +129,37 @@ _version():%0A + try:%0A bootstra @@ -170,16 +170,23 @@ rsion = +_thread _local.B @@ -210,36 +210,29 @@ -if bootstrap_version is None +except AttributeError :%0A ...
ed546ff2b659f7679b43e7ef5f5e70ab526891c6
Change param origin description
coalib/results/Result.py
coalib/results/Result.py
import uuid from os.path import relpath from coala_utils.decorators import ( enforce_signature, generate_ordering, generate_repr, get_public_members) from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY from coalib.results.SourceRange import SourceRange # Omit additional info, debug message and diffs for b...
Python
0
@@ -1302,67 +1302,29 @@ or c -lass of the creator of this%0A +reator object of this obj
cac0bb7e02da304462c30c317cb5d315e06ef01e
version bump
pgmagick/_version.py
pgmagick/_version.py
__version__ = '0.5.8'
Python
0.000001
@@ -16,7 +16,7 @@ 0.5. -8 +9 '%0A
4efa9c87264eabb6712f4fb787ab0de42be18de6
Move places urlpatterns to Django 2.0 preferred method
places/urls.py
places/urls.py
from django.conf.urls import url from . import views app_name = 'places' urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^(?P<slug>[-\w]+)/$', views.PlaceView.as_view(), name='place'), ]
Python
0.000003
@@ -9,13 +9,8 @@ ngo. -conf. urls @@ -17,19 +17,29 @@ import -url +include, path %0A%0Afrom . @@ -97,16 +97,14 @@ -url(r'%5E$ +path(' ', v @@ -152,33 +152,26 @@ -url(r'%5E(?P%3Cslug%3E%5B-%5Cw%5D+)/$ +path('%3Cslug:slug%3E/ ', v
4a540bb86aa9e1ef45358adc453f636f177efcfb
Remove print
bugsnag/django/__init__.py
bugsnag/django/__init__.py
from django.conf import settings import bugsnag def configure(): # Ignore django 404s by default print "Configuring!" bugsnag.configuration.ignore_classes.append("django.http.Http404") # Import Bugsnag settings from settings.py django_bugsnag_settings = getattr(settings, 'BUGSNAG', {}) bugsna...
Python
0.000016
@@ -100,33 +100,8 @@ ult%0A - print %22Configuring!%22%0A
daa8001b817decea34a14d1b8d58e9595cbcc154
Fix XRv for new common
xrv/docker/launch.py
xrv/docker/launch.py
#!/usr/bin/env python3 import datetime import logging import os import random import re import signal import sys import telnetlib import time import vrnetlab def handle_SIGCHLD(signal, frame): os.waitpid(-1, os.WNOHANG) def handle_SIGTERM(signal, frame): sys.exit(0) signal.signal(signal.SIGINT, handle_SIGT...
Python
0
@@ -823,31 +823,18 @@ password -)%0A self. +, disk_ima @@ -835,19 +835,17 @@ sk_image - = += %22/xrv.vm @@ -847,16 +847,44 @@ rv.vmdk%22 +)%0A self.num_nics = 20 %0A
3901e5475e07a4419af2b1262e5fcb0c0342379b
Remove useless import of sys
towerslack.py
towerslack.py
# coding: utf-8 import sys import json import requests from werkzeug.wrappers import BaseRequest try: import gevent except ImportError: gevent = None HOMEPAGE = 'https://github.com/lepture/tower-slack' TOWER_ICON = ( 'https://tower.im/assets/mobile/icon/' 'icon@512-84fa5f6ced2a1bd53a409013f739b7ba.p...
Python
0.000004
@@ -14,19 +14,8 @@ -8%0A%0A -import sys%0A impo
04df083f6e064cbd9d8f2319c3652459c27a3da8
fix an issue where the CLI was ignoring env var or other default api_key
solvebio/cli/main.py
solvebio/cli/main.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import os import sys import argparse import solvebio from . import auth from . import data from .tutorial import print_tutorial from .ipython import launch_ipython_shell from ..utils.validators import validate_api_host_url class So...
Python
0.000001
@@ -7859,17 +7859,135 @@ key%0A +%0A -else: +if not solvebio.api_key:%0A # If nothing is set (via command line or environment)%0A # look in local credentials %0A
ce0a013ad70362f6bdd52165d5b6c61a1bc82ba2
Update bubble_sort.py (#535)
sorts/bubble_sort.py
sorts/bubble_sort.py
from __future__ import print_function def bubble_sort(collection): """Pure implementation of bubble sort algorithm in Python :param collection: some mutable ordered collection with heterogeneous comparable items inside :return: the same collection ordered by ascending Examples: >>> bubble_so...
Python
0
@@ -439,16 +439,78 @@ -5, -2%5D%0A + %0A %3E%3E%3E bubble_sort(%5B-23,0,6,-4,34%5D)%0A %5B-23,-4,0,6,34%5D%0A %22%22%22%0A
db35694acbd94b060fdfa05e8221d1eb3485c75a
make the printing of files faster
cs251tk/lib/markdownify.py
cs251tk/lib/markdownify.py
import os import shlex from glob import glob from collections import OrderedDict from os.path import exists, join as path_join from .find_unmerged_branches_in_cwd import find_unmerged_branches_in_cwd from .run import run from .helpers import flatten def unicode_truncate(string, length, encoding='utf-8'): encoded ...
Python
0.000001
@@ -1567,24 +1567,217 @@ _for_cmd)%0A%0A%0A +def cat(filename):%0A try:%0A with open(filename, 'r', encoding='utf-8') as infile:%0A return ('success', infile.read())%0A except Exception:%0A return ('failure', None)%0A%0A%0A def process_ @@ -2268,30 +2268,150 @@ s = -run(%5B'cat', file...
00aa6bd37a6a134ea44be7d2073ecac3148495a5
support for yaml added
yahoo_oauth/utils.py
yahoo_oauth/utils.py
from __future__ import absolute_import, unicode_literals import json from rauth import OAuth1Service, OAuth2Service services = { 'oauth1': dict( SERVICE = OAuth1Service, REQUEST_TOKEN_URL = "https://api.login.yahoo.com/oauth/v2/get_request_token", ACCESS_TOKEN_URL = "https://api.login.yaho...
Python
0
@@ -63,16 +63,28 @@ rt json%0A +import yaml%0A from rau @@ -1095,9 +1095,409 @@ False%0A%0A +def yaml_get_data(filename):%0A %22%22%22Get data from .yml file%0A %22%22%22%0A with open(filename, 'rb') as fd:%0A yaml_data = yaml.load(fd)%0A return yaml_data%0A return False%0A%0Adef yaml_writ...
c3426ba34635c13c6d7aad95acf4507b97b0b256
update website
pos_mobile_restaurant/__manifest__.py
pos_mobile_restaurant/__manifest__.py
{ "name": """POS Mobile UI for Waiters""", "summary": """Your Restaurant in the Mobile Version""", "category": "Point of Sale", "live_test_url": "http://apps.it-projects.info/shop/product/pos-mobile-ui?version=11.0", "images": ["images/pos_mobile_restaurant.png"], "version": "12.0.1.2.6", "a...
Python
0
@@ -451,43 +451,62 @@ s:// -it-projects.info/team/GabbasovDinar +apps.odoo.com/apps/modules/12.0/pos_mobile_restaurant/ %22,%0A
f844ed58a84a33a640ae749599a6a8ebdfe67010
Add an additional test case for the no-quote-selector scenario
tests/bouncer/util_test.py
tests/bouncer/util_test.py
import pytest from bouncer import util def test_parse_document_raises_if_annotated_deleted(): # When an annotation is deleted in h it isn't immediately removed from the # search index. Its Elasticsearch document is temporarily updated to just # {'deleted': True}. with pytest.raises(util.DeletedAnnota...
Python
0
@@ -1753,91 +1753,433 @@ %22%0A%0A%0A -def test_parse_document_returns_boilerplate_quote_when_no_quote(es_annotation_doc): +@pytest.mark.parametrize('selector', %5B%0A # No selector (ie. a page note).%0A None,%0A%0A # No quote selector. Allowed by the service even though a quote is required%0A # to anchor ...
baf36a6b7bfbe149eeefde774be2b01d4b2f7167
Add cookie sharing
codebook/settingslive.py
codebook/settingslive.py
import dj_database_url from .settings import * DEBUG = False # Honor the 'X-Forwarded-Proto' header for request.is_secure() SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') # Allow all host headers ALLOWED_HOSTS = ['*'] # Static asset configuration BASE_DIR = os.path.dirname(os.path.abspath(__file__)...
Python
0
@@ -786,16 +786,94 @@ orage'%0A%0A +# Set session cookie to work on subdomains%0ASESSION_COOKIE_DOMAIN = '.snc.io'%0A%0A # Use ca
5c2e19150e4de1d7f5e7f43061223f5b0bce1008
clean up clm sampling a bit
ctc_fast/clm/sample_clm.py
ctc_fast/clm/sample_clm.py
import numpy as np from srilm import LM from decoder_config import LM_ARPA_FILE, SPACE ''' Sample text from character language model ''' def sample_continuation(s, lm, order): n = lm.vocab.max_interned() probs = np.empty(n, dtype=np.float64) for k in range(1, n + 1): probs[k-1] = 10 ** lm.logprob...
Python
0
@@ -79,16 +79,26 @@ E, SPACE +, LM_ORDER %0A%0A'''%0ASa @@ -179,18 +179,91 @@ m, order -): +, alpha=1.0):%0A # Higher alpha -%3E more and more like most likely sequence %0A n = @@ -359,16 +359,45 @@ n + 1):%0A + # NOTE Assumes log10%0A @@ -409,16 +409,17 @@ %5Bk-1%5D = +( 10 ** lm @@ -462...
75e41b1b6e07bd14e1fd042d42b2450942fecad1
Add in simple OtherNames admin
tx_people/admin.py
tx_people/admin.py
from django.contrib import admin from django.db.models import Count from django.utils.translation import ugettext_lazy as _ from . import models class ParentOrganizationFilter(admin.SimpleListFilter): title = _('Parent Organization') parameter_name = 'parent' def lookups(self, request, model_admin): ...
Python
0
@@ -1695,24 +1695,153 @@ 'name', )%0A%0A%0A +class OtherNameAdmin(admin.ModelAdmin):%0A list_display = ('name', 'start_date', 'end_date', )%0A search_fields = ('name', )%0A%0A%0A class People @@ -2466,24 +2466,79 @@ ationAdmin)%0A +admin.site.register(models.OtherNames, OtherNameAdmin)%0A admin.site.r
a9dc245f99e5c29f3b11cadc77dcfa0f44274b74
Add login_required decorator to protected sites
ctfbackend/backend/urls.py
ctfbackend/backend/urls.py
from django.conf.urls import url, include from django.http import HttpResponseRedirect from django.conf import settings from django.contrib.auth import views as auth_views from . import views urlpatterns = [ # Authentication ## Override logout next_page url(r'^accounts/logout/$', auth_views.logout, {'next_...
Python
0
@@ -51,65 +51,62 @@ ngo. -http import HttpResponseRedirect%0Afrom django.conf +contrib.auth import views as auth_views%0Afrom . import sett @@ -105,15 +105,12 @@ ort -setting +view s%0Afr @@ -135,55 +135,41 @@ auth - import views as auth_views%0Afrom . import views +.decorators import login_required %0A%0Aur ...
0cc1122ca03a8809dce407556adb82a51a3f41b1
remove unused modules
vmcasterpub/uploader.py
vmcasterpub/uploader.py
import types import uploader_dcap as uploaderDcap import uploader_egiappdb as uploaderEgiAppDb from uploader_scp import uploaderScp from uploader_local import uploaderLocal import re import sys import logging def Property(func): return property(**func()) class Error(Exception): """Base class for ex...
Python
0.000001
@@ -1,22 +1,4 @@ - %0Aimport types%0A impo @@ -171,20 +171,8 @@ re%0A -import sys%0A%0A impo
c621495de901918c433eee7d7f4517c85df9c09b
change default
pim/commands/init.py
pim/commands/init.py
import os import click import getpass from clint.textui import puts, colored, indent, prompt, validators from ..utils import write, retrieve @click.command('init', short_help='initialize a project', options_metavar='<options>') @click.option('--force/--no-force', default=False, help='Force overwrite existing files.') ...
Python
0.000002
@@ -1423,29 +1423,21 @@ default= -d%5B'name'%5D + ' +'main .py')%0A
3f6bb41423ebf6937ea23edf9ffc7b55ec8e538e
Add CachedAdapterFactory to trait.api
traits/api.py
traits/api.py
#------------------------------------------------------------------------------ # # Copyright (c) 2005, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions d...
Python
0.000001
@@ -3666,16 +3666,84 @@ provides +%0Afrom .adaptation.cached_adapter_factory import CachedAdapterFactory %0A%0Afrom .
5d08e677ccb72e8af84e8618600af85946add546
Fix interpretation
yargy/interpretation/interpretator.py
yargy/interpretation/interpretator.py
# coding: utf-8 from __future__ import unicode_literals from inspect import isclass from yargy.utils import ( Record, assert_type, assert_subclass, flatten ) from yargy.token import ( Token, NormalizedToken ) from .attribute import ( FactAttributeBase, MorphFactAttribute, CustomFac...
Python
0.000008
@@ -782,32 +782,89 @@ .value = value%0A%0A + def __iter__(self):%0A return iter(self.items)%0A%0A def flatten( @@ -2292,32 +2292,133 @@ _(self, items):%0A + items = %5B%0A (_.value if is_wrapper(_) else _)%0A for _ in items%0A %5D%0A items =
a31459a3612e616e21d1d484f6757b29cdb6a21c
Add comments to the demo views.
django_socketio/example_project/chat/views.py
django_socketio/example_project/chat/views.py
from django.shortcuts import get_object_or_404, render, redirect from django.utils.html import strip_tags from django_socketio import events from chat.models import ChatRoom, ChatUser @events.on_message(channel="^room-") def message(request, socket, context, message): message = message[0] room = get_object_...
Python
0
@@ -266,16 +266,158 @@ ssage):%0A + %22%22%22%0A Event handler for a room receiving a message. First validates a%0A joining user's name and sends them the list of users.%0A %22%22%22%0A mess @@ -1490,24 +1490,157 @@ , context):%0A + %22%22%22%0A Event handler for a socket session ending in a ro...
7de8c6673c109e67cd401cba7ad04a871f39e492
Add a proper module docstring.
Hipshot.py
Hipshot.py
#!/usr/bin/env python2 # Copyright 2013, Mansour Moufid <mansourmoufid@gmail.com> import cv try: from os import EX_DATAERR as _EX_DATAERR from os import EX_NOINPUT as _EX_NOINPUT from os import EX_USAGE as _EX_USAGE except ImportError: _EX_DATAERR, _EX_NOINPUT, _EX_USAGE = 1, 2, 3 from os.path import e...
Python
0.000001
@@ -20,66 +20,146 @@ on2%0A -# Copyright 2013, Mansour Moufid %3Cmansourmoufid@gmail.com%3E +%0A'''Simulate long-exposure photography%0A%0AHipshot converts a video file into a single image file simulating%0Aa long-exposure photograph.%0A'''%0A %0A%0Aim
b89d763de9aa2499b512cfe69bbeb07696e51084
Version bump.
web/dispatch/route/release.py
web/dispatch/route/release.py
# encoding: utf-8 """Release information about WebCore.""" from __future__ import unicode_literals import sys from collections import namedtuple version_info = namedtuple('version_info', ('major', 'minor', 'micro', 'releaselevel', 'serial'))(1, 0, 0, 'alpha', 1) version = ".".join([str(i) for i in version_info[:3]...
Python
0
@@ -254,17 +254,17 @@ 0, ' -alpha', 1 +final', 0 )%0Ave
6512d329231b86e425f451da2d73ada395d33117
Fix docstring
cupy/creation/from_data.py
cupy/creation/from_data.py
from cupy import core def array(obj, dtype=None, copy=True, ndmin=0): """Creates an array on the current device. This function currently does not support the ``order`` and ``subok`` options. Args: obj: :class:`cupy.ndarray` object or any other object that can be passed to :func:`...
Python
0.00003
@@ -2599,16 +2599,26 @@ 'C', 'F' +, 'A', 'K' %7D): Row- @@ -2687,79 +2687,201 @@ der. - This function currently does not%0A support order 'A' and 'K' +%0A When %60order%60 is 'A', it uses 'F' if %60a%60 is column-major and%0A uses %60C%60 otherwise.%0A And when %60order%60...
2f535837dfc026f3804b684541e257fba2a9a66b
Fix typo.
profiles/mono-mac-release/packages.py
profiles/mono-mac-release/packages.py
import os from bockbuild.darwinprofile import DarwinProfile class MonoReleasePackages: def __init__(self): # Toolchain self.packages.extend([ # 'autoconf.py', # 'automake.py', # 'libtool.py', 'xz.py', 'tar.py', 'gettext.py', 'pkg-config.py' ]) # # Base Libraries self.package...
Python
0.001604
@@ -498,17 +498,17 @@ libffi.p -g +y ',%0A%09%09%09%09'
dfbb93a132d9165e53478b579db92fa0b4cf02ce
Update compiler test infrastructure
tests/compiler/__init__.py
tests/compiler/__init__.py
from thinglang import pipeline from thinglang.compiler.opcodes import OpcodeCallInternal from thinglang.lexer.values.identifier import Identifier from thinglang.symbols.symbol_mapper import SymbolMapper from thinglang.utils.source_context import SourceContext SELF_ID, A_ID, B_ID, INST_ID, LST_ID, IMPLICIT_ITERATOR_ID,...
Python
0
@@ -1,20 +1,38 @@ +import itertools%0A%0A from thinglang impor @@ -305,24 +305,48 @@ _ID, LST_ID, + A_INST, B_INST, C_INST, IMPLICIT_IT @@ -384,27 +384,17 @@ D = -0, 1, 2, 3, 4, 5, 6 +range(10) %0AVAL @@ -474,9 +474,67 @@ T = -5 +6%0A%0APROGRAM, CONTAINER, A_THING, B_THING, C_THING = range(5) %0A%0ATE @@ -751...
1a2de64b2f9828dcdc7d345808251e8979cea23b
Change test tasks
geotrek/common/tests/test_tasks.py
geotrek/common/tests/test_tasks.py
# -*- encoding: utf-8 -*- from django.test import TestCase from geotrek.common.tasks import import_datas from geotrek.common.models import FileType class TasksTest(TestCase): def setUp(self): self.filetype = FileType.objects.create(type=u"Photographie") def test_import_exceptions(self): self...
Python
0.000129
@@ -388,22 +388,16 @@ badil', -class_ name='ha @@ -406,29 +406,24 @@ cot', module -_name ='toto')%0A%0A @@ -673,14 +673,8 @@ -class_ name @@ -707,13 +707,8 @@ dule -_name ='to
5372c246587c6097ba42c846d3965a78273ca555
update price
web_debranding/__openerp__.py
web_debranding/__openerp__.py
{ 'name': "Backend debranding", 'version': '1.0.5', 'author': 'IT-Projects LLC, Ivan Yelizariev', 'license': 'GPL-3', 'category': 'Debranding', 'website': 'https://twitter.com/yelizariev', 'price': 90.00, 'currency': 'EUR', 'depends': ['web', 'share', 'disable_openerp_online', 'mail_...
Python
0
@@ -223,9 +223,10 @@ e': -9 +15 0.00
153c54cba8786fda7e788c81a05ae63bf9b941c9
Fix wrong error message.
u2fval/core/api.py
u2fval/core/api.py
# Copyright (C) 2014 Yubico AB # # 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 ...
Python
0.000006
@@ -1739,87 +1739,22 @@ ent -does not exist: %25s'%0A %25 client_name +not specified' ))%0A
44a6101f8242a9ed77a77b1fcfbf54013bbb8a0a
Add sed-enabled check
plugins/sed.py
plugins/sed.py
from .util.decorators import command, initializer, require_admin import itertools import re import codecs import traceback from itertools import zip_longest import string string.ascii = [chr(i) for i in range(128)] SUB_REGEX = re.compile(r"^(?:(\S+)[:,]\s)?(?:s|(.+?)/s)/((?:\\/|[^/])+)\/((?:\\/|[^/])*?)/([gixs]{0,4})...
Python
0
@@ -3718,24 +3718,81 @@ chan, msg):%0A + if !(bot.getconfig()%5B%22sed-enabled%22%5D):%0A return%0A sub = Su
defdf2220804ca492ec889c9f4b6eff9ff56eefc
Correct import statement after renaming test_lists.py to testcases
tests/create_references.py
tests/create_references.py
#! /usr/bin/env python import os from cyclus_tools import run_cyclus from tests_list import sim_files def main(): """Creates reference databases. Assumes that cyclus is included into PATH. """ cwd = os.getcwd() # Run cyclus run_cyclus("cyclus", cwd, sim_files) if __name__ == "__main__": main()
Python
0.000004
@@ -77,14 +77,13 @@ test -s_list +cases imp
beabd675f51e0fe83afd7634bf8a87cc389338bc
Reorder ss and i to possibly fix bug.
youtube/convertor.py
youtube/convertor.py
import subprocess import os def _find_matching_file(filename): """Finds a matching filename, defaults to the original filename if it exists. If it doesn't exist, try to find a file with the same name but different extension Args: filename(str): The filename to match includes name and extension...
Python
0
@@ -2325,16 +2325,28 @@ fmpeg -y + -i %7Bsource%7D -ss %7Bst @@ -2354,28 +2354,16 @@ rt_time%7D - -i %7Bsource%7D -t %7Bdur
9d59ca5a05afaae81274805d4e3bd619b67b63e0
fix some name bug and add a simple test
rbm/rbm.py
rbm/rbm.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ This is a common rbm tools solved by CD-k. """ from numpy import random, dot, sum class RBM(object): def __init__(self, num_visible, num_hidden): self.weights = random.randn(num_visible, num_hidden) self.hidden_bias = random.randn(1, num_hidden) self.visib...
Python
0
@@ -127,17 +127,36 @@ dot, sum +, array, exp, zeros %0A - %0A%0Aclass @@ -590,16 +590,18 @@ t = zero +s( (len(sel @@ -631,32 +631,33 @@ lf.hidden_bias)) +) %0A%09%09grad_hbias = @@ -652,32 +652,34 @@ rad_hbias = zero +s( (1, len(self.hid @@ -688,16 +688,17 @@ n_bias)) +) %0A%09%09grad_ @@ -709,16 +709,18 @...
f89751b4f4b0f091561e614e0392dcd8b08ecf53
Update pip package version
pip_package/setup.py
pip_package/setup.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
Python
0
@@ -1063,17 +1063,17 @@ sion=%220. -2 +3 %22,%0A d
3d5e798eafb3f33151de8032d14f1732030a9244
Add quick todo so i don't forget
utils/__init__.py
utils/__init__.py
Python
0
@@ -0,0 +1,38 @@ +# TODO move utils folder inside napalm
14a624fb5486c06880b8211ce964329d7374ccab
Add dev alias to define command
plugins/web.py
plugins/web.py
""" Plugin for web commands Commands: define """ import discord from datetime import datetime from pcbot import Annotate, utils import plugins client = plugins.client # type: discord.Client # Create exchange rate cache and keep track of when we last reset it exchange_rate_cache = dict(reset=client.time_starte...
Python
0.000001
@@ -335,16 +335,29 @@ command( +aliases=%22def%22 )%0Aasync
8275d18d6c4f87225950ac88029191e525877134
Fix linting
core/timeline.py
core/timeline.py
# -*- coding: utf-8 -*- from django.urls import reverse from django.utils import timezone, timesince from django.utils.translation import gettext as _ from core.models import DiaperChange, Feeding, Note, Sleep, TummyTime from datetime import timedelta def get_objects(date, child=None): """ Create a time-sort...
Python
0.000004
@@ -1011,18 +1011,43 @@ x: ( -x%5B'time'%5D, +%0A x%5B'time'%5D,%0A exp @@ -1088,19 +1088,28 @@ e'), -1) +,%0A ), - %0A
9cedca2bfc045f596945de33e1a9076150022396
Add docstrings
utils/aioutils.py
utils/aioutils.py
import functools import aiofiles import aitertools aopen = functools.partial(aiofiles.open, encoding='utf-8') async def areader(aiofile): async for line in aiofile: yield [val.strip() for val in line.split(',')] async def make_batches(iterable, size): iterator = await aitertools.aiter(iterable) ...
Python
0.000005
@@ -131,24 +131,55 @@ r(aiofile):%0A + %22%22%22An async csv reader.%22%22%22%0A async fo @@ -290,24 +290,180 @@ ble, size):%0A + %22%22%22Make batches of size from iterable. This would be equivalent to slices%0A from 0 to size, then size to size * 2, etc, of a list of the iterable.%22%22%22%0A ite...
c194696644c2caa40048e5508cf8624a65e7c9b8
add 1 second to sleep in core take method for opera
common/core/dali_core.py
common/core/dali_core.py
import json import sys import time from selenium.webdriver import Remote from selenium.webdriver.remote.errorhandler import ErrorHandler from selenium.webdriver.remote.remote_connection import RemoteConnection from compare.pixel_diff import diff from supplement.scripts import Scripts class DaliRemote(Remote): d...
Python
0
@@ -1196,46 +1196,8 @@ eps%0A - ### @todo more common options%0A @@ -1207,25 +1207,25 @@ time.sleep( -1 +2 )%0A%0A f
c2e0b640a5cb26626e914a0621e94f672304161e
remove irrelevant docs from pallet
scripts/RasterPallet.py
scripts/RasterPallet.py
#!/usr/bin/env python # * coding: utf8 * ''' RasterPallet.py A module that contains a forklift pallet definition for the Raster app. It updates all data in the raster.gdb database. The DRG.gdb database is managed manually in staging. ''' from json import loads from os.path import dirname, join, realpath, basename im...
Python
0.000015
@@ -131,109 +131,8 @@ pp.%0A -It updates all data in the raster.gdb database.%0AThe DRG.gdb database is managed manually in staging.%0A '''%0A
cc878d029a2e892303d0e828ba07c70774299e40
remove error
addons/website_sale_delivery/controllers/main.py
addons/website_sale_delivery/controllers/main.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import http, _ from odoo.http import request from odoo.addons.website_sale.controllers.main import WebsiteSale from odoo.tools import float_repr class WebsiteSaleDelivery(WebsiteSale): @http.route(['/sho...
Python
0.000597
@@ -2156,266 +2156,8 @@ ss:%0A - values%5B'errors'%5D.append(%0A (_(%22Ouch, you cannot choose this carrier!%22),%0A _(%22%25s does not ship to your address, please choose another one.%5Cn(Error: %25s)%22 %25 (order.carrier_id.name, order.delivery_message))))%0A ...
ffa7ede78089e15c0c2de630098eed079c1291a4
Fix segmaker for segments without known base address
utils/segmaker.py
utils/segmaker.py
import os, json, re class segmaker: def __init__(self, bitsfile): print("Loading %s grid." % os.getenv("XRAY_DATABASE")) with open("../../../database/%s/tilegrid.json" % os.getenv("XRAY_DATABASE"), "r") as f: self.grid = json.load(f) self.bits = dict() self.tags = dict(...
Python
0
@@ -1440,24 +1440,92 @@ segment%22%5D%5D%0A%0A + if %22baseaddr%22 not in segdata:%0A continue%0A%0A
e914272be45d6e624f77dffc06b062e1ea003be5
修改了测试用例名称,以便区分
xbaydns/tests/namedconftest.py
xbaydns/tests/namedconftest.py
# encoding: utf-8 """ namedconftest.py Created by QingFeng on 2007-11-23. Copyright (c) 2007 yanxu. All rights reserved. """ import basetest import logging.config import os import shutil import tempfile import time import unittest import base64 log = logging.getLogger('xbaydns.tests.namedconftest') logging.basicConf...
Python
0
@@ -383,20 +383,21 @@ %0A%0Aclass -Init +Named ConfTest @@ -3159,12 +3159,13 @@ ite( -Init +Named Conf
457b6c74c676478f4045d0a9801fa81a3d75d714
Change how manage.py injects local directory into sys.path to ensure it overwrites other instalations
dashboard_server/manage.py
dashboard_server/manage.py
#!/usr/bin/python # # Copyright (C) 2010 Linaro Limited # # Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org> # # This file is part of Launch Control. # # Launch Control is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License version 3 # as published by...
Python
0.000001
@@ -981,15 +981,18 @@ ath. -append( +insert(0, base
708ad4b2d8f0e7fda71be1b8c20442f01b7c8f07
Fix history casebug
plugins/history.py
plugins/history.py
""" History """ from .util.decorators import command @command('history') def history(bot, nick, target, chan, arg): """ Get user's history. """ args = arg.split() try: if len(args) > 2 or len(args) < 2 or int(args[1]) > 16 or int(args[1]) < 1: return bot.msg(chan, "Usage: +history <nic...
Python
0.00008
@@ -349,16 +349,24 @@ args%5B0%5D +.lower() %0A
f9c85e29cc1d69cf50b72f0afd9c160b345a9d91
rename bigdl.utils to bigdl.dllib.utils
python/dllib/src/bigdl/dllib/utils/file_utils.py
python/dllib/src/bigdl/dllib/utils/file_utils.py
# # Copyright 2018 Analytics Zoo 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 agreed to...
Python
0.99985
@@ -594,16 +594,22 @@ m bigdl. +dllib. utils.co
0a211bcf14e2f353b889914fee44a4afeb6955bb
return a negative int for lag if an error occurs.
plugins/latency.py
plugins/latency.py
#from functools import partial from time import time import json import logging from ConfigParser import SafeConfigParser from os.path import expanduser from socket import error, timeout, gaierror from bson import json_util import eventlet import boto from arke.plugin import collect_plugin, config from arke.util imp...
Python
0.000002
@@ -2314,33 +2314,34 @@ lag = -0 +-1 %0A except @@ -2456,17 +2456,18 @@ lag = -0 +-1 %0A @@ -2587,17 +2587,18 @@ lag = -0 +-1 %0A%0A
fd2bd5d1f0c8deb74a2f88ca8c384f6b4f150c76
support hdfs and s3 (#2007)
python/dllib/test/bigdl/keras/test_load_model.py
python/dllib/test/bigdl/keras/test_load_model.py
# # Copyright 2016 The BigDL 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 agreed to in ...
Python
0
@@ -2842,16 +2842,993 @@ _data)%0A%0A + def test_load_definition(self):%0A kmodel, input_data, output_data = TestModels.kmodel_seq_lenet_mnist()%0A keras_model_json_path, keras_model_hdf5_path = self._dump_keras(kmodel, dump_weights=True)%0A bmodel = DefinitionLoader.from_json_path(keras_model_...
d7fd7dab9304f5a101edb0eef7ee47f088e4ab47
Fix some bugs that we can select the correct start and end point
python/interactive_select_start_end_of_a_wave.py
python/interactive_select_start_end_of_a_wave.py
import matplotlib.pyplot as plt import numpy as np from matplotlib.widgets import Button class Buttons: def __init__(self, filename): self.filename = filename def OK(self, event): plt.savefig(filename) plt.close() class DraggableRectangle: def __init__(self, rect,...
Python
0
@@ -166,16 +166,39 @@ ilename%0A + self.state = 0%0A @@ -253,16 +253,39 @@ lename)%0A + self.state = 1%0A @@ -551,16 +551,17 @@ _loc = 0 +. %0A%0A de @@ -1939,32 +1939,33 @@ .draw()%0A +# self.line.figure @@ -2242,26 +2242,55 @@ idth()/2 -%0A %0A +. %0A ...
8219cf69651ec410ae911dc664928df5754e55d3
fix 13w41a and 13w41b (protocol version 0)
burger/toppings/version.py
burger/toppings/version.py
""" Copyright (c) 2011 Tyler Kenendy <tk@tkte.ch> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,...
Python
0
@@ -4661,32 +4661,8 @@ ldc%22 - and version is not None :%0A @@ -5345,32 +5345,281 @@ erver!%22 in str:%0A + if version is None:%0A # 13w41a and 13w41b (protocol version 0)%0A # don't explicitly set the variable%0A...
9eb2347e1f1d36acb22d49341e066286146fdd17
use cron
tucanwatch.py
tucanwatch.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import mechanize from lxml import html def get_grades(username, password): br = mechanize.Browser() br.open("https://www.tucan.tu-darmstadt.de") br.select_form(nr=0) br.form["usrname"] = username br.form["pass"] = password br.submit() br.foll...
Python
0.000005
@@ -38,16 +38,64 @@ tf-8 -*- +%0Afrom __future__ import print_function%0Aimport os %0A%0Aimport @@ -1098,17 +1098,16 @@ dt.de%22)%0A -%0A grad @@ -1198,25 +1198,31 @@ int( -%22%5Cn%22.join(grades) +*grades, sep=os.linesep )%0A @@ -1249,97 +1249,113 @@ rt s -ubprocess%0A from time import sleep%0A%0A ...
6ff6f7ecf75551dc49685c4bb0501e6f4b2de854
Fix for regression test, since we rely on the formatter for std::vector in the test we need a libc++ category.
packages/Python/lldbsuite/test/expression_command/vector_of_enums/TestVectorOfEnums.py
packages/Python/lldbsuite/test/expression_command/vector_of_enums/TestVectorOfEnums.py
""" Test Expression Parser regression test to ensure that we handle enums correctly, in this case specifically std::vector of enums. """ import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestVectorOfEnums(TestBase): mydir = TestBase...
Python
0.000004
@@ -339,16 +339,51 @@ ile__)%0A%0A + @add_test_categories(%5B%22libc++%22%5D)%0A def te
96b2baf01c45e411cd3aa2438598087b85ed4e66
fix redefining built-in 'filter'
mss/helpers.py
mss/helpers.py
#!/usr/bin/env python # coding: utf-8 ''' Helpers and base class of the MSS module. See __init__.py. ''' from __future__ import division, print_function, unicode_literals from struct import pack from sys import maxsize from zlib import compress, crc32 __all__ = ['MSS', 'ScreenshotError', 'arch', 'mss'] class Scree...
Python
0.000002
@@ -3685,16 +3685,20 @@ +png_ filter = @@ -3753,16 +3753,20 @@ %5B +png_ filter +
df7e834b8418aeeeaee7fb90b953468c2490b93d
Add Ascii Art & Version Number
pypiup/cli.py
pypiup/cli.py
import os import click from pypiup.requirements import Requirements BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @click.command() @click.option('--requirement', '-r', default='requirements.txt', type=click.STRING, help='Specify the path of the requirements file. Defaults to "requirements.t...
Python
0
@@ -1,12 +1,28 @@ +import __init__%0A import os%0Aim @@ -563,24 +563,497 @@ te.%0A %22%22%22%0A +%0A print(%22%5Cn ______ __ __ ______ __ __ __ ______ %22)%0A print(%22/%5C == %5C /%5C %5C_%5C %5C /%5C == %5C /%5C %5C /%5C %5C/%5C %5C /%5C == %5C %22)%0A print(%22%5C %5C ...
6dd88849a6853a775b329ded5c40c3b85a66eae3
Add default parsing paths
npc/parser.py
npc/parser.py
#!/usr/bin/env python3.5 import re import itertools from os import path, walk from collections import defaultdict def get_characters(search_paths, ignore_paths): return itertools.chain.from_iterable((_parse_path(path, ignore_paths) for path in search_paths)) def _parse_path(start_path, ignore_paths = [], include...
Python
0.000001
@@ -140,16 +140,24 @@ ch_paths + = %5B'.'%5D , ignore @@ -162,16 +162,21 @@ re_paths + = %5B%5D ):%0A r
947f72109a153dd7c289cc5fc71e7d5c75bb1dce
Check correct config section for python-setup options
src/python/twitter/pants/python/interpreter_cache.py
src/python/twitter/pants/python/interpreter_cache.py
# ================================================================================================== # Copyright 2013 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
Python
0
@@ -4413,39 +4413,32 @@ %25s' %25 config.get -default ('python-setup', @@ -4460,16 +4460,24 @@ rsion', +default= '2.2'))%0A @@ -4544,23 +4544,16 @@ nfig.get -default ('python @@ -4578,16 +4578,24 @@ rsion', +default= '0.22.0'
01234caac86438d295b16ea59dcc4eb8390ad556
use published as 'since' time instead of uploaded at
plugins/youtube.py
plugins/youtube.py
from __future__ import unicode_literals from builtins import str import re import time from calendar import timegm from util import hook, http, timesince youtube_re = (r'(?:youtube.*?(?:v=|/v/)|youtu\.be/|yooouuutuuube.*?id=)' '([-_a-z0-9]+)', re.I) BASE_URL = 'https://www.googleapis.com/youtube/v3/' ...
Python
0
@@ -843,24 +843,85 @@ %25H:%25M:%25SZ%22)%0A + published_since = timesince.timesince(timegm(published))%0A publishe @@ -1906,227 +1906,8 @@ %5D)%0A%0A - upload_time_since = timesince.timesince(%0A timegm(%0A time.strptime(j%5B'uploaded'%5D, %22%25Y-%25m-%25dT%25H:%25M:%25S.000Z%22)%0A ...
e0423d453189508bdb73fc78320b5736bc127fd4
Bump version
waterbutler/__init__.py
waterbutler/__init__.py
__version__ = '0.2.1' __import__("pkg_resources").declare_namespace(__name__)
Python
0
@@ -16,9 +16,9 @@ 0.2. -1 +2 '%0D__
6833bd136086e0e46fabb3921c65d22325857c56
add utility for getting domains created by a user
corehq/apps/domain/utils.py
corehq/apps/domain/utils.py
import re from couchdbkit import ResourceNotFound from django.conf import settings from corehq import toggles from corehq.apps.domain.models import Domain from corehq.util.quickcache import quickcache from dimagi.utils.couch.database import get_db DOMAIN_MODULE_KEY = 'DOMAIN_MODULE_CONFIG' ADM_DOMAIN_KEY = 'ADM_ENA...
Python
0
@@ -243,16 +243,52 @@ get_db%0A +from corehq.apps.es import DomainES%0A %0A%0ADOMAIN @@ -2257,8 +2257,177 @@ eruser)%0A +%0A%0Adef get_domains_created_by_user(creating_user):%0A query = DomainES().created_by_user(creating_user)%0A data = query.run()%0A return %5Bd%5B'name'%5D for d in data.hits%5D%0A
695fb09b1f048878cd7358e1e536aee2313b6d61
Include listenonrepeat.com in regex for #39
plugins/youtube.py
plugins/youtube.py
import re import urllib import isodate import requests import smartbot from smartbot import utils from smartbot.exceptions import * from smartbot.formatting import * REGEX = r"(?:https?://)?(?:www\.)?youtu\.?be(?:\.com)?/(?:watch\?v=)?([^\s]+)" class Plugin(smartbot.Plugin): """Get information about posted Yo...
Python
0
@@ -197,16 +197,19 @@ :www%5C.)? +(?: youtu%5C.? @@ -210,16 +210,32 @@ utu%5C.?be +%7Clistenonrepeat) (?:%5C.com @@ -245,16 +245,18 @@ (?:watch +/? %5C?v=)?(%5B @@ -264,17 +264,16 @@ %5Cs%5D+)%22%0A%0A -%0A class Pl
5c0e4b6ec349747a70fbd18f5dd0b17c5ebd5914
Test change for better string use
multi-clone.py
multi-clone.py
#!/usr/bin/python import sys, re, getpass, argparse, subprocess from time import sleep from pysphere import MORTypes, VIServer, VITask, VIProperty, VIMor, VIException from pysphere.vi_virtual_machine import VIVirtualMachine def print_verbose(message): if verbose: print message def find_vm(name): try: vm = con.g...
Python
0.000001
@@ -3474,38 +3474,44 @@ ter -'+server+' for user '+ +%25s for user %25s: ' %25 (server, username +': @@ -3510,13 +3510,9 @@ name -+': ' +) )%0A%0A# @@ -3573,18 +3573,10 @@ ver -'+server+' +%25s wit @@ -3586,18 +3586,29 @@ sername -'+ +%25s', (server, username @@ -3608,16 +3608,17 @@ sername) +) %0Acon =...
520b9da78ac85f57d13e51e53d914c4b0dbce53d
Based on assumption, that only functions can have __code__ in the first place
nuit/utils.py
nuit/utils.py
'''Utils.''' from django.core.exceptions import PermissionDenied import six def _closure(fn): return six.get_function_closure(fn) def _code(fn): return six.get_function_code(fn) def has_closure(fn): return hasattr(fn, 'func_closure') or hasattr(fn, '__closure__') def has_code(fn): return hasatt...
Python
0.999937
@@ -70,16 +70,31 @@ ort six%0A +import inspect%0A %0A%0Adef _c @@ -326,58 +326,29 @@ urn -hasattr(fn, 'func_code') or hasattr(fn, '__code__' +inspect.isfunction(fn )%0A%0A%0A
088286502b545b65a63ce0e7e44f584faac3aa4b
Add Pox. Also remove erroneous left() from square
turtlehack.py
turtlehack.py
import turtle import random # A function that takes a turtle, a radius, a color, and an optional thickness and draws a circle def colored_circle(turtle, radius, color, thickness = 1): turtle.width(thickness) turtle.color(color) turtle.circle(radius) # A function that takes a side length and a color and makes a sq...
Python
0
@@ -1371,16 +1371,32 @@ ndom_x = + turtle.xcor() + random. @@ -1422,16 +1422,32 @@ ndom_y = + turtle.ycor() + random. @@ -1498,16 +1498,384 @@ dom_y)%0A%0A +# A function that makes n random colored and located dots inside x, y%0A# Thanks to Stacey Mantooth for the idea%0Adef pox(turtle, x, y, n = 10):%0A origx ...
6c9a3e5133115a4724c8499380ee690a9cca0552
Add Exception on import of pmagpy if using wrong Python version (should be impossible to install this version, but people are tricky….)
pmagpy/__init__.py
pmagpy/__init__.py
from __future__ import absolute_import from . import pmag from . import ipmag from . import pmagplotlib from . import find_pmag_dir from . import version from . import controlled_vocabularies2 as controlled_vocabularies from . import data_model3 from . import new_builder from . import mapping #import set_env __all__ =...
Python
0
@@ -32,16 +32,531 @@ _import%0A +import sys%0Aif sys.version_info %3C= (3,):%0A raise Exception(%22%22%22%0AYou are running Python %7B%7D.%0AThis version of pmagpy is only compatible with Python 3.%0AMake sure you have pip %3E= 9.0 to avoid this kind of issue,%0Aas well as setuptools %3E= 24.2:%0A%0A $ pip install ...
abc61568c1874a38d5875ecb961795f2a32d2379
Comment out exit(6) to allow tests to run on Travis
cairis/core/BorgFactory.py
cairis/core/BorgFactory.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...
Python
0
@@ -4389,16 +4389,17 @@ rr_msg)%0A +# ex
05f4a8af5f856f2451f1f9e2be262876f53f67ef
Bump schema version :disappointed:
corehq/apps/export/const.py
corehq/apps/export/const.py
""" Some of these constants correspond to constants set in corehq/apps/export/static/export/js/const.js so if changing a value, ensure that both places reflect the change """ from couchexport.deid import ( deid_ID, deid_date ) from corehq.apps.export.transforms import ( case_id_to_case_name, user_id_to_...
Python
0
@@ -470,9 +470,9 @@ N = -5 +6 %0A%0ADE
ef275bd9ff509842161397b81af8ac765c0bab3a
patch to work properly for ALL
update_firewall.py
update_firewall.py
#! /usr/bin/python import sys import os import json import socket import ext.iptables as ipt class ElasticRules(): rules = { 'allowed_ips': {}, 'ports': {}, } def add_port_rule(self, port, whom, type): key = "%s:%s:%s" % (port, type, whom) self.rules['ports'][key] = (port, whom, type) def re...
Python
0
@@ -1139,10 +1139,10 @@ = 'a -ny +ll ':%0A
f90304f5e797a6097e80fd806a5ab652fb2c7f95
Remove code seconds_from_config_interval not using anymore
qpanel/job.py
qpanel/job.py
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2019 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com> # from qpanel import backend, config from redis import Redis from rq_scheduler import Scheduler import datetime import time from rq import Connection, Worker def check_connect_redis(): try: Redis().echo...
Python
0.000003
@@ -3507,210 +3507,8 @@ y%0A%0A%0A -def seconds_from_config_interval(val):%0A %22%22%22%0A Get interval value for a configuration by parameter%0A %22%22%22%0A # day * hour * minute * seconds%0A return get_days_from_val(val) * 24 * 60 * 60%0A%0A%0A def
b184c44ddbe608dd74eabc4429de08b8acf09468
add observation sequence probability using forward algorithm
pydnb/dnb.py
pydnb/dnb.py
import time import numpy as np class DNB: """ Class representing Dynamic Naive Bayes. """ def __init__(self, debug=False): self.states_prior = None self.states_list = None self.features = None self.A = None self.B = None self.debug = debug def _st...
Python
0.001177
@@ -4064,16 +4064,110 @@ pass%0A%0A + def obs_seq_probability(self,data):%0A return sum(self._forward(data, k=len(data)))%0A%0A def
bf6effc4a868e85a488a20c05244e3c979b4286b
Make output flattern.
couchdb_auditor/__init__.py
couchdb_auditor/__init__.py
# -*- coding: utf-8 -*- # # Copyright (C) 2011 Alexander Shorin # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # import couchdb import getopt import logging import os import socket import sys from getpass import getp...
Python
0.999807
@@ -2345,24 +2345,145 @@ ='server'):%0A + root = logging.Logger('couchdb.audit')%0A handler = logging.StreamHandler(sys.stdout)%0A root.addHandler(handler)%0A%0A def audi @@ -2510,16 +2510,16 @@ tials):%0A - @@ -2596,16 +2596,64 @@ dentials +%0A root.info(' * %25s', server.resource.url...
b064d931850e7d1a9195df37e554584e5285847c
Remove white space.
utilapplication.py
utilapplication.py
# # StarPy -- Asterisk Protocols for Twisted # # Copyright (c) 2006, Michael C. Fletcher # # Michael C. Fletcher <mcfletch@vrplumber.com> # # See http://asterisk-org.github.com/starpy/ for more information about the # StarPy project. Please do not directly contact any of the maintainers of this # project for assistanc...
Python
0.000003
@@ -557,17 +557,16 @@ tails.%0A%0A -%0A %22%22%22Class
4b36f053a4cb8ded8197a7bc465c95f66ad9a152
Prefer upper case for debugging options
python/rf.py
python/rf.py
"""Script to remove temporary files The script contains a known list of globs for temporary files """ import os import sys import optparse import fnmatch def parse_options(arg_list = None): """Find out what user wants at command line""" parser = optparse.OptionParser() parser.add_option('-d', '--dry-run', actio...
Python
0.999998
@@ -274,125 +274,8 @@ r()%0A -%09parser.add_option('-d', '--dry-run', action='store_true', help='show which files would be removed, but do nothing')%0A %09par @@ -567,16 +567,135 @@ moved')%0A +%09parser.add_option('-T', '--Trial-Run', action='store_true', help='show which files would be removed, but do nothing')%0A...
7f4d21e43eb11bcf0c3ce6c7c0aabdac1d1b64dc
Change PM times to 24 hour, d'oh
radar2gif.py
radar2gif.py
#!/usr/bin/env python import requests import pytz import os import socket import arrow from PIL import Image from datetime import datetime, timedelta from images2gif import writeGif from bs4 import BeautifulSoup as Soup from StringIO import StringIO from twython import Twython if socket.gethostname() == 'm': from ...
Python
0.00238
@@ -4260,45 +4260,8 @@ our%0A - print current_hour%0A print bot%0A @@ -4305,19 +4305,22 @@ 12, -3, 5, 8, 11 +15, 17, 20, 23 %5D:%0A @@ -4636,17 +4636,16 @@ rom %25s E -S T #wx #G
4a7d02536f9015d56fcfda8e49c06805ff2f8e8d
fix ensure_tuple import
splash/lua_runner.py
splash/lua_runner.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import abc import itertools import six import lupa from splash.exceptions import ScriptError from splash.lua import parse_error_message, PyResult, ensure_tuple from splash.utils import truncated class AsyncCommand(object): # Dispatcher should call ....
Python
0.000002
@@ -207,22 +207,8 @@ sult -, ensure_tuple %0Afro @@ -238,16 +238,30 @@ runcated +, ensure_tuple %0A%0A%0Aclass
0e5db5420b941574f7074e716159d85b3097ae58
use vagrant as the default.
rdo/config.py
rdo/config.py
import os import functools from ConfigParser import ConfigParser def get_config(config_file='.rdo.conf'): config = ConfigParser() config.read(config_file) env = os.environ.get('RDO_ENV') or 'default' return dict(config.items(env)) if __name__ == '__main__': c = Config('example.conf') c.pars...
Python
0
@@ -60,16 +60,110 @@ Parser%0A%0A +# Use vagrant by default%0ADEFAULTS = %7B%0A 'driver': 'vagrant',%0A 'directory': '/vagrant'%0A%7D%0A%0A %0Adef get @@ -302,16 +302,29 @@ efault'%0A + try:%0A retu @@ -350,16 +350,80 @@ s(env))%0A + except ConfigParser.NoSectionError:%0A return DEFAULTS...
b99165b3c6e341a7f80bdb28e68e7c7a8cba34cb
upgrade uwsgi (fixes build)
rdrf/setup.py
rdrf/setup.py
import os from setuptools import setup, find_packages package_data = {} start_dir = os.getcwd() requirements = [ "ccg-django-utils==0.4.2", "Django==1.10.8", "django-ajax-selects==1.5.2", "django-anymail==0.11.1", "django-countries", "django-extensions>=0.7.1", "django-iprestrict==1.1.1", ...
Python
0
@@ -1055,17 +1055,17 @@ i==2.0.1 -3 +7 .1%22,%0A
ad7e69e4b35d76bec6183fcd992a179a2e1359ca
Disable verify for SSL
.ci/upload-release.py
.ci/upload-release.py
#!/usr/bin/env python import os import sys import urlparse import requests import subprocess AUTH_USERNAME = 'getsentry-bot' AUTH_TOKEN = os.environ['GITHUB_AUTH_TOKEN'] AUTH = (AUTH_USERNAME, AUTH_TOKEN) TAG = os.environ.get('TRAVIS_TAG') or os.environ.get('BUILD_TAG') TARGET = os.environ.get('TARGET') BIN_TYPE = os....
Python
0
@@ -686,16 +686,62 @@ p('/'))%0A + # default travis python does not have SNI%0A retu @@ -783,16 +783,30 @@ th=AUTH, + verify=False, **kwarg
f62119c77a28951a8d5be3ac55dfa9a62d790f94
Add a 'kvm' CPU alias
configs/common/CpuConfig.py
configs/common/CpuConfig.py
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
Python
0
@@ -2650,24 +2650,65 @@ rivO3CPU%22),%0A + (%22kvm%22, (%22ArmKvmCPU%22, %22X86KvmCPU%22)),%0A %5D%0A%0A# Fil
ee9bddbb05665055b483d2976d81928878f23546
fix pelican configuration
pelicanconf.py
pelicanconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals import datetime AUTHOR = u'Ma Wenbao' SITENAME = u'baozi-x' SITEURL = '' TIMEZONE = 'Asia/Shanghai' DATE_FORMATS = { 'zh_CN': '%Y-%m-%d %H:%M:%S', } DEFAULT_DATE_FORMAT = '%Y-%m-%d %H:%M:%S' DEFAULT_DATE = 'fs' # use file...
Python
0.000002
@@ -153,16 +153,31 @@ EURL = ' +http://atime.me '%0A%0ATIMEZ @@ -1288,17 +1288,23 @@ EME = '. -. +/themes /niu-x2'
ac1d6923e0dc682698f808e6401c4686348f4c33
Update to new settings
pelicanconf.py
pelicanconf.py
from __future__ import unicode_literals LOAD_CONTENT_CACHE = False SITEURL = '' # SITEURL = 'http://danielfrg.github.io' AUTHOR = u'Daniel Rodriguez' SITENAME = u'Daniel Rodriguez' TIMEZONE = 'UTC' DEFAULT_LANG = 'en' MARKUP = ('md', 'ipynb') DEFAULT_DATE_FORMAT = '%B %d, %Y' SUMMARY_MAX_LENGTH = 150 DEFAULT_PAG...
Python
0
@@ -624,25 +624,76 @@ S%0A%0AM -D_EXTENSIONS = %5B' +ARKDOWN = %7B%0A 'extension_configs': %7B%0A 'markdown.extensions. code @@ -698,17 +698,21 @@ dehilite -( +': %7B' css_clas @@ -712,17 +712,20 @@ ss_class -= +': ' codehili @@ -730,20 +730,131 @@ lite -)', 'extra'%5D +'%7D,%0A 'markdown.extens...
1f10b2f411d39ee96939137c640b182c60e2c254
Add persistance
persistance.py
persistance.py
from __future__ import with_statement import numpy as np import os from itertools import izip T_FILE = "t.npy" C_FILE = "c.npy" K_FILE = "k.npy" U_FILE = "u.npy" FP_FILE = "fp.npy" IER_FILE = "ier.npy" MSG_FILE = "msg.txt" def saveSplines(directory, splines): ((t, c, k), u), fp, ier, msg = splines[0] tlst = [] c...
Python
0.998588
@@ -50,16 +50,35 @@ y as np%0A +import scipy as sc%0A import o @@ -2389,11 +2389,508 @@ glst)%5D%0A%0A +def imread_path(path, first = 0, last = -1):%0A %22%22%22%0A This method read a complete list of image(video) contained inside a directory. It sort the image and then read sequentially all the images in th...
f248c4829e707e3b7379370c024c903123210404
Fix to noise generation for older numpy versions
pints/noise.py
pints/noise.py
# # A number of functions which can be used to generate different types of noise, # which can then be added to model output to simulate experimental data. # # This file is part of PINTS. # Copyright (c) 2017-2018, University of Oxford. # For licensing information, see the LICENSE file distributed with the PINTS # so...
Python
0.000003
@@ -2186,39 +2186,19 @@ ise%0A -v +s = - np.random.normal(0, sigma * @@ -2217,16 +2217,99 @@ rho**2) +%0A if s == 0:%0A v = np.zeros(n)%0A else:%0A v = np.random.normal(0, s , n)%0A
9caeab6005ca0508f7045c869def5962edb48ed1
verify Fixed a bug with the stop command for plain
plain/setup.py
plain/setup.py
import setup_util import subprocess import sys import time import os def start(args, logfile, errfile): setup_util.replace_text("plain/src/main/resources/application.conf", "127.0.0.1", args.database_host) if os.name == 'nt': subprocess.check_call(".\sbt.bat assembly && del /f /s /q target\scala-2.10\cache", s...
Python
0
@@ -1527,32 +1527,61 @@ & rm -rf project +/.ivy && rm -rf project/.boot %22, shell=True, c
1e0d38c2af696fb9702fb58c2ef97b5360482312
Update with CUrW adapter function name changes
continous/StoreContinous.py
continous/StoreContinous.py
#!/usr/bin/python3 import sys, traceback, csv, json, datetime, getopt, os, copy, requests, argparse from curwmysqladapter import mysqladapter from .LibContinousTimeseries import getTimeseries from .LibContinousTimeseries import extractSigleTimeseries from .LibContinousValidation import validateTimeseries try: IN...
Python
0
@@ -124,22 +124,22 @@ import -mysqla +MySQLA dapter%0Af @@ -1972,22 +1972,22 @@ apter = -mysqla +MySQLA dapter(h @@ -3541,22 +3541,24 @@ pter.get -E +_e vent -I +_i d(meta)%0A @@ -3634,14 +3634,16 @@ eate -E +_e vent -I +_i d(me @@ -4473,17 +4473,18 @@ retrieve -T +_t imeserie @@ -5239,17 +5239,18 @@ r....
cef963b5cc7646554816bd76187b4f6a0e5cad7a
send disco info about Gadget so we don't hardcode service's jid anymore
tests/olpc-buddy-search.py
tests/olpc-buddy-search.py
""" test OLPC search buddy """ import dbus from servicetest import call_async, EventPattern from gabbletest import exec_test, make_result_iq, acknowledge_iq from twisted.words.xish import domish, xpath from twisted.words.protocols.jabber.client import IQ NS_OLPC_BUDDY_PROPS = "http://laptop.org/xmpp/buddy-propertie...
Python
0.000001
@@ -612,16 +612,17 @@ tivity%22%0A +%0A NS_PUBSU @@ -661,16 +661,131 @@ pubsub%22%0A +NS_DISCO_INFO = %22http://jabber.org/protocol/disco#info%22%0ANS_DISCO_ITEMS = %22http://jabber.org/protocol/disco#items%22%0A%0A %0ANS_AMP @@ -883,24 +883,37 @@ _, iq_event +, disco_event = q.expect_ @@ -1093,53 +1093,959 @@...
8c1ec4a8dc35b38a15c000a6eb6ccb046f51d44a
Fix unit tests for export-configuration and generate-configuration.
tests/pdtools/test_node.py
tests/pdtools/test_node.py
import click from click.testing import CliRunner from mock import patch from pdtools import node @patch("pdtools.util.open_yaml_editor") @patch("pdtools.node.util.format_result") @patch("pdtools.node.ParadropClient") def test_simple_node_commands(ParadropClient, format_result, open_yaml_editor): commands = [ ...
Python
0
@@ -64,16 +64,27 @@ rt patch +, MagicMock %0A%0Afrom p @@ -1358,16 +1358,168 @@ %0A %5D%0A%0A + client = MagicMock()%0A client.generate_config.return_value = %7B%7D%0A client.get_config.return_value = %7B%7D%0A ParadropClient.return_value = client%0A%0A form @@ -1789,16 +1789,93 @@ _code))%0A + ...