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 |
|---|---|---|---|---|---|---|---|
5c269ac55507ec5b44c3f27e70df0a79cfc67f06 | Fix some whitespace and the field definition | staff/fields.py | staff/fields.py | from django import forms
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext as _
import os
URL_PREFIX = getattr(settings, 'STATIC_URL', settings.MEDIA_URL)
class DeleteCheckboxWidget(forms.CheckboxInput):
"""
A specialzed checkbox that displays the fil... | Python | 0.004689 | @@ -3824,17 +3824,21 @@
e_name)%0A
+
%0A
-
def
@@ -3889,17 +3889,21 @@
eField'%0A
+
%0A
-
def
@@ -4242,17 +4242,21 @@
, None)%0A
+
%0A
-
def
@@ -4679,22 +4679,42 @@
s =
-self.__class__
+%22staff.fields.RemoveableFileField%22
%0A
@@ -4756,41 +4756,8 @@
lf)%0A
- # That's ... |
5474980b11ab20e8706cf57d98a1f684e9c11c4e | Support for standalone operation | i3pystatus/__init__.py | i3pystatus/__init__.py | #!/usr/bin/env python
import sys
import json
from threading import Thread
import time
from contextlib import contextmanager
class Module:
output = None
position = 0
def registered(self, status_handler):
"""Called when this module is registered with a status handler"""
class AsyncModule(Module):
... | Python | 0.988937 | @@ -1642,16 +1642,652 @@
n line%0A%0A
+class StandaloneIO(IOHandler):%0A %22%22%22%0A I/O handler for standalone usage of i3pystatus (w/o i3status)%0A%0A writing as usual, reading will always return a empty JSON array,%0A and the i3bar protocol header%0A %22%22%22%0A%0A n = -1%0A def __init__(self... |
272f75aa07d52127645f636526df0e13716c1a3c | Parse names from name rather than description | iati/core/codelists.py | iati/core/codelists.py | """A module containing a core representation of IATI Codelists."""
import collections
from lxml import etree
import iati.core.resources
import iati.core.utilities
def fetch_mappings():
"""Fetch the mappings between Codelists and XPaths.
These mappings make it possible to work out which attributes within the ... | Python | 0.999993 | @@ -4041,27 +4041,20 @@
ndtext('
-description
+name
/narrati
|
f2574d9ddf75b0554d18b7e8406123b3648d931f | Fix stupid error that would result in all wiki changes getting the same timestamp when running under mod_python or tracd. Closes #1563. Many thanks to PBruin for finding the culprit. | trac/wiki/model.py | trac/wiki/model.py | # -*- coding: iso8859-1 -*-
#
# Copyright (C) 2003, 2004, 2005 Edgewall Software
# Copyright (C) 2003, 2004, 2005 Jonas Borgstrm <jonas@edgewall.com>
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
#
# Trac is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Lice... | Python | 0.000043 | @@ -3814,19 +3814,12 @@
, t=
-time.time()
+None
, db
@@ -3950,32 +3950,83 @@
dle_ta = False%0A%0A
+ if t is None:%0A t = time.time()%0A%0A
if self.
|
c94671faaa2580d05494d770cca5183cde29e55e | bump version | conveyor/__init__.py | conveyor/__init__.py | __version__ = "0.1.dev22"
| Python | 0 | @@ -16,11 +16,11 @@
0.1.dev2
-2
+3
%22%0A
|
956a6cb12cf3010f4975647a3674762209fccbe6 | version 0.2.3 bump | traptor/version.py | traptor/version.py | __version__ = '0.2.2'
VERSION = tuple(int(x) for x in __version__.split('.'))
| Python | 0.000001 | @@ -12,17 +12,17 @@
= '0.2.
-2
+3
'%0AVERSIO
|
bef826ae925ee22719b87177aba32b06ddf579ed | Remove DEFAULT_FROM_EMAIL from settings.py | oeplatform/settings.py | oeplatform/settings.py | """
Django settings for oeplatform project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build p... | Python | 0 | @@ -2686,45 +2686,8 @@
/'%0A%0A
-DEFAULT_FROM_EMAIL = %22test@foo.com%22%0A%0A
REST
|
aaf6b2fefec03ec0896662605c3208d26aaab0dd | change i18n | conveyor/cmd/plan.py | conveyor/cmd/plan.py | #!/usr/bin/python
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | Python | 0.000006 | @@ -1238,80 +1238,60 @@
eat.
-common.i18n import _LC%0Afrom conveyor.conveyorheat.engine import template
+engine import template%0Afrom conveyor.i18n import _LC
%0A%0Aif
|
08f40c4e0c9dca21f6f7ff108868970b43725716 | change mimetype of get-video by ID endpoint as well | oertube/controllers.py | oertube/controllers.py | import os
from flask import Flask, request, Response
from flask import render_template, url_for, redirect, send_from_directory, jsonify
from flask import send_file, make_response, abort
from oertube import app
from bson import json_util
# routing for API endpoints, generated from the models designated as API_MODELS... | Python | 0 | @@ -2237,24 +2237,33 @@
%0A return
+Response(
json_util.du
@@ -2278,16 +2278,59 @@
lt_json)
+, mimetype=%22application/json%22) # lists_json
%0A%0A# spec
|
3266ecee8f9a6601d8678a91e8923c6d7137adb3 | Make ilock lock name user specific | oggm/tests/conftest.py | oggm/tests/conftest.py | import pytest
import logging
import multiprocessing as mp
from oggm import cfg, utils
import pickle
logger = logging.getLogger(__name__)
def pytest_configure(config):
if config.pluginmanager.hasplugin('xdist'):
try:
from ilock import ILock
utils.lock = ILock("oggm_xdist_download_lo... | Python | 0.000732 | @@ -33,29 +33,15 @@
ort
-multiprocessing as mp
+getpass
%0Afro
@@ -68,22 +68,8 @@
tils
-%0Aimport pickle
%0A%0Alo
@@ -287,17 +287,38 @@
oad_lock
-%22
+_%22 + getpass.getuser()
)%0A
|
05f0d841bf1bd6b440d21f66df4bd18cb797ec24 | increment version | trimesh/version.py | trimesh/version.py | __version__ = '3.10.2'
| Python | 0.000004 | @@ -17,7 +17,7 @@
.10.
-2
+3
'%0A
|
1f6cd4fa677e58dfaa213adf581a2339d1d84413 | Change rule to eq | stream/views.py | stream/views.py | import json
import random
import requests
from JestemGraczem.settings import TWITCH_API_KEY
from django.http import JsonResponse
from django.shortcuts import redirect, render
from django.utils.datetime_safe import datetime
from django.core.exceptions import ObjectDoesNotExist
from django.core.mail import se... | Python | 0.00001 | @@ -5478,16 +5478,20 @@
%0A if
+not
twitch_p
@@ -5504,18 +5504,19 @@
_ids
- is not
+.__eq__(
''
+)
:%0D%0A
|
7e037940258e5a19bb9af44c912ff272f9366147 | Update example_visualization.py | example_visualization.py | example_visualization.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -1571,36 +1571,37 @@
plit', default='
-data
+train
', type=str,%0A
|
cc298348cceece3b5ff64bdfb030d3885cc2e53f | fix filter | anytask/courses/templatetags/form_func.py | anytask/courses/templatetags/form_func.py | from BeautifulSoup import BeautifulSoup, Comment
from django import template
from django.utils.translation import ugettext as _
from issues.models import Issue
from issues.model_issue_field import IssueStatusField
register = template.Library()
@register.filter(name='field_in_data')
def form_selected_value(data, fie... | Python | 0.000001 | @@ -86,132 +86,29 @@
ngo.
-utils.translation import ugettext as _%0Afrom issues.models import Issue%0Afrom issues.model_issue_field import IssueStatusField
+http import QueryDict
%0A%0A%0Ar
@@ -223,19 +223,44 @@
-print data%0A
+if isinstance(data, QueryDict):%0A
@@ -291,16 +291,30 @@
d.name)%0A
+ ... |
6ed303ae43b2313f6425d34f08697121a4f7b0cd | remove unused var accidents_file | anyway/parsers/preprocessing_cbs_files.py | anyway/parsers/preprocessing_cbs_files.py | from six import iteritems
import os
CBS_FILES_HEBREW = {'sadot': 'Fields',
'zmatim_ironiim': 'IntersectUrban',
'zmatim_lo_ironiim': 'IntersectNonUrban',
'rehev': 'VehData',
'milon':'Dictionary',
'meoravim': 'InvData',
... | Python | 0.000001 | @@ -503,34 +503,8 @@
)%5D)%0A
- accidents_file = None%0A
@@ -1074,59 +1074,4 @@
th)%0A
-%0A%0A# def main(path):%0A# update_cbs_files_names(path)%0A
|
c6095cd72e5a0c60a837214e5408feb42baf939d | Update config.py | core/nginx/config.py | core/nginx/config.py | #!/usr/bin/python
import jinja2
import os
convert = lambda src, dst, args: open(dst, "w").write(jinja2.Template(open(src).read()).render(**args))
args = os.environ.copy()
# Get the first DNS server
with open("/etc/resolv.conf") as handle:
content = handle.read().split()
args["RESOLVER"] = content[content.in... | Python | 0.000001 | @@ -1607,11 +1607,11 @@
var/
-log
+run
/ngi
|
1ed08e4bd93c713d8a31a387265057f1d4d7ae8f | Increment the version | txircd/__init__.py | txircd/__init__.py | __version__ = '0.2.4' | Python | 0.997865 | @@ -16,6 +16,6 @@
0.2.
-4
+5
'
|
712ea23eec78df7650e0af47e3361313aa4c3901 | clean set context data, articles utils | opps/articles/utils.py | opps/articles/utils.py | # -*- coding: utf-8 -*-
from django.conf import settings
from opps.articles.models import ArticleBox
def set_context_data(self, SUPER, **kwargs):
context = super(SUPER, self).get_context_data(**kwargs)
if len(self.article) >= 1:
article = self.article[0]
context['articleboxes'] = ArticleBox.o... | Python | 0.000003 | @@ -267,16 +267,17 @@
icle%5B0%5D%0A
+%0A
@@ -504,16 +504,17 @@
rticle)%0A
+%0A
|
e3a3e9559fa06fd3e07d7342dcf2520fcf023a76 | add PROJECT_ACCESS as a privilege | corehq/privileges.py | corehq/privileges.py | from django.utils.translation import ugettext_lazy as _
LOOKUP_TABLES = 'lookup_tables'
API_ACCESS = 'api_access'
CLOUDCARE = 'cloudcare'
ACTIVE_DATA_MANAGEMENT = 'active_data_management'
CUSTOM_BRANDING = 'custom_branding'
CUSTOM_REPORTS = 'custom_reports'
# Legacy privilege associated with Pro plan
REPORT_BUILDE... | Python | 0.000002 | @@ -1925,16 +1925,51 @@
feeed'%0A%0A
+PROJECT_ACCESS = 'project_access'%0A%0A
MAX_PRIV
@@ -2822,16 +2822,36 @@
A_FEED,%0A
+ PROJECT_ACCESS,%0A
%5D%0A%0A# The
@@ -5388,32 +5388,83 @@
Integration'),%0A
+ PROJECT_ACCESS: _(%22Project Features%22),%0A
%7D.get(pr
|
8f78205406aae98314310cbbb4302acb10b3048f | remove idle and signon time in WHOIS output (#267) | coremods/handlers.py | coremods/handlers.py | """
handlers.py - Implements miscellaneous IRC command handlers (WHOIS, services login, etc.)
"""
from pylinkirc import utils
from pylinkirc.log import log
def handle_whois(irc, source, command, args):
"""Handle WHOIS queries, for IRCds that send them across servers (charybdis, UnrealIRCd; NOT InspIRCd)."""
t... | Python | 0 | @@ -3972,271 +3972,8 @@
))%0A%0A
- # 317: shows idle and signon time. However, we don't track the user's real%0A # idle time, so we simply return 0.%0A # %3C- 317 GL GL 15 1437632859 :seconds idle, signon time%0A f(server, 317, source, %22%25s 0 %25s :seconds idle, signon time%22 %25 (nick, user.ts))%0A%0A... |
9775a3d5d2dcba0b33fbcf6a911b924be8f9a6e7 | allow NoSuchProjectError to bubble up | subcmds/info.py | subcmds/info.py | # -*- coding:utf-8 -*-
#
# Copyright (C) 2012 The Android Open Source Project
#
# 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 re... | Python | 0 | @@ -683,45 +683,8 @@
ing%0A
-from error import NoSuchProjectError%0A
from
@@ -2940,93 +2940,111 @@
-try:%0A projs = self.GetProjects(args)%0A except NoSuchProjectError:%0A return
+# We let exceptions bubble up to main as they'll be well structured.%0A projs = self.GetProjects(args)
%0A%0A
|
06fb3fa4b4850dced647eaaf699e05f006a31817 | Change rating strings | survey/forms.py | survey/forms.py | from django import forms
class ActivityRatingForm(forms.Form):
RATING_CHOICES = (
('0', 'Would not go'),
('1', 'Probably would not go'),
('2', 'Probably would go'),
('3', 'Would go')
)
rating = forms.ChoiceField(choices=RATING_CHOICES, required=False, label="", label_suffi... | Python | 0.000011 | @@ -100,20 +100,15 @@
', '
-Would not go
+No shot
'),%0A
@@ -202,16 +202,17 @@
', '
-Would go
+Heck yea!
')%0A
|
6135699ccf19d8c5f801b1a73794f2414f7200d7 | test to check recording a survey actually records something | survey/tests.py | survey/tests.py | from django.core.urlresolvers import reverse
from django.test import TestCase
from survey.models import User
class StartPageTest(TestCase):
def test_front_page_displays(self):
response = self.client.get(reverse('survey:survey'))
self.assertEqual(response.status_code, 200)
self.assertContai... | Python | 0 | @@ -102,16 +102,22 @@
ort User
+, Item
%0A%0Aclass
@@ -1364,8 +1364,688 @@
e(u.id)%0A
+%0A def test_survey_is_recorded(self):%0A response = self.client.get(reverse('survey:survey'))%0A self.assertEqual(response.status_code, 200)%0A self.assertContains(response, %22University of Manchester%22... |
300a4ed447275544bd53fa7b36a30b8ab1cb4022 | clear double | server/test/test_modules_validations.py | server/test/test_modules_validations.py | from modules.validations import is_required, is_boolean, is_string, \
is_number, is_language, is_list, is_email, has_min_length, is_one_of, \
is_list_of_strings, is_url, is_string_or_number, is_integer, \
has_max_length, is_dict, is_uuid, is_list_of_strings, is_in_range, \
is_datetime, is_list_of_uuids
... | Python | 0.000002 | @@ -243,36 +243,16 @@
is_uuid,
- is_list_of_strings,
is_in_r
|
12cb64596e3b036735730c9b93475751a89decb2 | Change exception handling to work off of logging instead of print_exc | ufyr/decorators.py | ufyr/decorators.py | #stdlib
import os
from atexit import register
from random import triangular
from time import sleep
#local
from semaphore import RedisSemaphore
from logger import Logger
def rate_limited(*args, **kwargs):
'''
Semaphore decorator.
@rate_limited
def foo():
pass
Will only allow o... | Python | 0.000001 | @@ -11,16 +11,31 @@
port os%0A
+import logging%0A
from ate
@@ -108,16 +108,17 @@
sleep%0A%0A
+%0A
#local%0Af
@@ -156,34 +156,8 @@
hore
-%0Afrom logger import Logger
%0A%0Ade
@@ -3182,65 +3182,493 @@
-import traceback%0A traceback.print_exc(
+logging.exception('%25s.%25s -%25s %25s raised... |
3188fae3f3a1d4f1cf1cd10a92a6ecde202d8477 | Add option to save uncompressed movie (I420 format) when dwarfing. | undistort_video.py | undistort_video.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Undistort a video
@author: Kevin Middleton
Based on:
https://github.com/ying17zi/gopro-undistort
"""
# Arguments
# -f Video file to process
# -c Camera matrix file
# -d Distortion coefficient file
# -r Save raw images
import cv
import os
import argparse
from se... | Python | 0 | @@ -1248,155 +1248,274 @@
-args = parser.parse_args()%0A%0A # Get video files name and set output name%0A vidFileName
+parser.add_argument('--uncompressed',%0A help='Output uncompressed video',%0A action=%22store_true%22,%0A required=False... |
c73f1674dd57217569009716260af3d13a787052 | Bump version to 0.1.11 | swf/__init__.py | swf/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
version = (0, 1, 10)
__title__ = "python-simple-workflow"
__author__ = "Oleiade"
__license__ = "MIT"
__version__ = '.'.join(map(str, version))
| Python | 0 | @@ -58,17 +58,17 @@
(0, 1, 1
-0
+1
)%0A%0A__tit
|
a79f422991532cf559d394b608237953aa376bf6 | add admin for project | unicoremc/admin.py | unicoremc/admin.py | # ensure celery autodiscovery runs
from djcelery import admin as celery_admin
from djcelery.models import (
TaskState, WorkerState, PeriodicTask, IntervalSchedule, CrontabSchedule)
from django.contrib import admin
from django.contrib.sites.models import Site
# remove celery from admin
admin.site.unregister(Site)... | Python | 0 | @@ -259,16 +259,428 @@
t Site%0A%0A
+from unicoremc.models import Project, Localisation%0A%0A%0Aclass ProjectAdmin(admin.ModelAdmin):%0A%0A list_display = (%0A 'app_type', 'country', 'state', 'base_repo_url', 'repo_url')%0A readonly_fields = (%0A 'app_type', 'base_repo_url', 'country', 'state', 're... |
fd50ec469eebafe28938a5d9484a760f67ed154d | set version to 1.6dev | cutadapt/__init__.py | cutadapt/__init__.py | from __future__ import print_function
import sys
__version__ = '1.5'
def check_importability():
try:
import cutadapt._align
except ImportError as e:
if 'undefined symbol' in str(e):
print("""
ERROR: A required extension module could not be imported because it is
incompatible with your system. A quick fix is ... | Python | 0.000001 | @@ -64,9 +64,12 @@
'1.
-5
+6dev
'%0A%0Ad
|
34c7a823ad109f2721c9dc368a4fef1c05a24175 | allow overriding activity type from CLI | upload_activity.py | upload_activity.py | #! /usr/bin/env python
"""A program that uploads an activity file to a Garmin
Connect account.
"""
import argparse
import getpass
from garminexport.garminclient import GarminClient
import logging
import sys
import traceback
logging.basicConfig(
level=logging.INFO, format="%(asctime)-15s [%(levelname)s] %(message)s... | Python | 0 | @@ -1425,32 +1425,173 @@
r.add_argument(%0A
+ '-T', '--type', help=%22Override activity type (running, cycling, walking, hiking, strength_training, etc.)%22)%0A parser.add_argument(%0A
%22--log-l
@@ -2597,16 +2597,41 @@
.private
+, activity_type=args.type
)%0A
@@ -2710,16 +2710,18 @@
ailed:... |
74bc4270d48f89d3754263d065bd08333d2f3b49 | Fix variable names in score_update.studentIterator | app/soc/modules/gci/tasks/score_update.py | app/soc/modules/gci/tasks/score_update.py | # Copyright 2012 the Melange 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 wr... | Python | 0.99998 | @@ -3226,24 +3226,32 @@
file)%0A%0A if
+student_
profiles:%0A
@@ -3325,16 +3325,20 @@
rsor': q
+uery
.cursor(
|
102f7979338b948744b6af06689f928deb72f27c | Fix lemma ordering in test | spacy/tests/regression/test_issue781.py | spacy/tests/regression/test_issue781.py | # coding: utf-8
from __future__ import unicode_literals
import pytest
# Note: "chromosomes" worked previous the bug fix
@pytest.mark.models('en')
@pytest.mark.parametrize('word,lemmas', [("chromosomes", ["chromosome"]), ("endosomes", ["endosome"]), ("colocalizes", ["colocalize", "colocaliz"])])
def test_issue781(EN,... | Python | 0.000069 | @@ -272,17 +272,16 @@
olocaliz
-e
%22, %22colo
@@ -285,16 +285,17 @@
olocaliz
+e
%22%5D)%5D)%0Ade
|
083357596778f0b5b24fc564a820cfef4dbb02fc | Add JSON configuration in Avro meta data | pax/plugins/io/Avro.py | pax/plugins/io/Avro.py | """Avro is responsible for the raw digitizer data storage
Avro is a remote procedure call and data serialization framework developed
within Apache's Hadoop project. We use it within 'pax' to store the raw data
from the experiment to disk. These classes are used, for example, by the data
aquisition system to write th... | Python | 0.000001 | @@ -485,16 +485,29 @@
0.%0A%22%22%22%0A%0A
+import json%0A%0A
import n
@@ -2754,17 +2754,16 @@
#
-
also sa
@@ -2817,16 +2817,16 @@
ound in%0A
+
@@ -3160,16 +3160,217 @@
.schema)
+%0A%0A # Used for converting processor config to JSON string%0A def json_object_handler(obj):%0A ... |
7dfb568de55c0460affcbd060bab3b3a91136480 | use decimal encoder (#104) | tdp_core/sql.py | tdp_core/sql.py | from phovea_server.ns import Namespace, request, abort, Response
from . import db
from .utils import map_scores
from phovea_server.util import jsonify
from phovea_server.security import login_required
import logging
__author__ = 'Samuel Gratzl'
_log = logging.getLogger(__name__)
app = Namespace(__name__)
def load_id... | Python | 0.000001 | @@ -1561,166 +1561,64 @@
json
-(obj):%0A from phovea_server.ns import Response%0A import json%0A return Response(json.dumps(obj, ensure_ascii=False), mimetype='application/json; charset=utf-8'
+_decimal(obj):%0A return jsonify(obj, double_precision=15
)%0A%0A%0A
@@ -1791,16 +1791,24 @@
mat_json
+_decimal
%0A r... |
c74251b3dc92e4188c8a27e5ca4bb13fe7c80df2 | add annotator urls | tellina/urls.py | tellina/urls.py | """django_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
C... | Python | 0.000001 | @@ -732,33 +732,18 @@
ort
-views%0Afrom website import
+annotator,
cmd
@@ -747,16 +747,23 @@
cmd2html
+, views
%0A%0Aurlpat
@@ -878,56 +878,8 @@
o),%0A
- url(r'%5Eexplain_cmd$', cmd2html.explain_cmd),
%0A
@@ -952,49 +952,165 @@
(r'%5E
-recently_asked$', views.recently_asked
+vote', views.vote),%0A%0A ... |
3d836dded0f21afb2d81c0a448149f73f4217fb3 | Bump to rc2. | pebble_tool/version.py | pebble_tool/version.py | version_base = (4, 0, 1)
version_suffix = 'rc1'
if version_suffix is None:
__version_info__ = version_base
else:
__version_info__ = version_base + (version_suffix,)
__version__ = '{}.{}'.format(*version_base)
if version_base[2] != 0:
__version__ += '.{}'.format(version_base[2])
if version_suffix is not N... | Python | 0 | @@ -38,17 +38,17 @@
ix = 'rc
-1
+2
'%0A%0Aif ve
|
bc84075ded6c861bf28e58509a192ddb1362cbb6 | Make URLWrapper.slug settable again | pelican/urlwrappers.py | pelican/urlwrappers.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import functools
import logging
import os
import six
from pelican.utils import python_2_unicode_compatible, slugify
logger = logging.getLogger(__name__)
@python_2_unicode_compatible
@functools.total_ordering
class URLWrapper(object):
def __init__... | Python | 0 | @@ -852,32 +852,185 @@
._slug is None:%0A
+ class_key = '%7B%7D_REGEX_SUBSTITUTIONS'.format(%0A self.__class__.__name__.upper())%0A if class_key in self.settings:%0A
self
@@ -1059,24 +1059,28 @@
+
+
self.name,%0A
@@ -1078,16 +1078,164 @@
f.name... |
7471b4c8975794c488a75f5e7444f7fe99624064 | Add large_ops scenario test | tempest/test.py | tempest/test.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack, LLC
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | Python | 0.998416 | @@ -4747,16 +4747,17 @@
status.
+
%22%0A
|
2f805bc9171f93f2d126c9fb727d77a38717d607 | add user agent to headers | examples/gtkhtml_demo.py | examples/gtkhtml_demo.py | # $Id$
import sys
import os
import urllib, urlparse
from gtk import *
from gnome.ui import *
from gtkhtml import *
import cStringIO, threading, Queue, time
import pycurl
# url history
history = []
# links for 'forward'
forward = []
# number of concurrent connections to the web-server
NUM_THREADS = 4
def about(butto... | Python | 0.000001 | @@ -1138,16 +1138,100 @@
IRS, 5)%0A
+ curl.setopt(pycurl.HTTPHEADER, %5B%22User-Agent: GtkHTML/PycURL demo browser%22%5D)%0A
|
a2b3d233acb432142e0683217d46d5281649a696 | Update __version__.py | irc_bot/__version__.py | irc_bot/__version__.py | __version__ = '1.0.35'
| Python | 0.000079 | @@ -17,7 +17,7 @@
.0.3
-5
+6
'%0A
|
7f3a263a191401b1bd5ff986c57bbbc2c3b23481 | remove decimals from labels | jetpack/chart/utils.py | jetpack/chart/utils.py | """
Utils
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
import matplotlib.pyplot as plt
from functools import wraps
import numpy as np
__all__ = ['setfontsize', 'noticks', 'nospines', 'breathe', 'setcolor', 'tickdir', 'minlabels']
def plotwrapper(fun):
"""
Decorator... | Python | 0.999954 | @@ -3017,24 +3017,181 @@
get_xlim()%0A%0A
+ # remove decimals from labels%0A if xmin.is_integer():%0A xmin = int(xmin)%0A if xmax.is_integer():%0A xmax = int(xmax)%0A%0A
# re
@@ -3296,20 +3296,19 @@
= %5Bstr(x
-t%5B0%5D
+min
), *%5B''
@@ -3340,21 +3340,19 @@
%5D,... |
b97a9290dfddd6777187f4acb6c3222b1e346fd8 | Fix defect in argument parser invokation | jicirodsmanager/cli.py | jicirodsmanager/cli.py | """Manger iRODS storage."""
import argparse
import logging
from jicirodsmanager.irods import IrodsStorageManager
root = logging.getLogger()
root.setLevel(logging.DEBUG)
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
handler = logging.StreamHandler()
handler.setFormatter... | Python | 0.000011 | @@ -1499,29 +1499,31 @@
lts(func=add
-group
+project
)%0A%0A args
|
ecbd4edf7f61b32177b0757db1e975a1f42af21c | Remove argparser argument --avoid-collisions | photo_rename/rename.py | photo_rename/rename.py | import argparse
import logging
import os
import re
import stat
import sys
import pyexiv2
import photo_rename
from photo_rename import FileMap, FileMapList, Harvester
logger = logging.getLogger(__name__)
def process_all_files(
workdir=None, simon_sez=None, mapfile=None):
"""
Manage the entire process... | Python | 0.000009 | @@ -1061,168 +1061,8 @@
e%22)%0A
- parser.add_argument(%22-a%22, %22--avoid-collisions%22,%0A help=%22Append suffix until filenames do not collide. 10x max.%22,%0A action=%22store_true%22)%0A
|
28264115a79e84568a46f223b8c66223b03bed11 | update updated time!!! | pinterestfeed/tasks.py | pinterestfeed/tasks.py | # -*- coding: utf-8 -*-
#
# jbweb-pinterestfeed - Django app that generates Pinterest RSS feeds
# Copyright (C) 2013 Thomas Jollans <t@jollybox.de>
#
# 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... | Python | 0 | @@ -1516,16 +1516,96 @@
pdated:%0A
+ feed_obj.last_updated = timezone.now ()%0A feed_obj.save()%0A
|
943e8284977903a505ed890db231827e61bc7fc6 | Fix the debug output for encode issue | pipelines/api/utils.py | pipelines/api/utils.py | from datetime import datetime
import yaml
from concurrent.futures.thread import ThreadPoolExecutor
from tornado import ioloop, concurrent
from yaml.error import YAMLError
import re
from pipelines.api import PIPELINES_EXT
import os.path
import json
import logging
from uuid import uuid4
import base64
from tornado.web i... | Python | 0.000032 | @@ -3856,27 +3856,16 @@
ug,
-json.dumps(
params))
)%0A
@@ -3860,17 +3860,16 @@
params))
-)
%0A # G
@@ -4966,17 +4966,17 @@
ntext: %25
-j
+s
' %25 user
|
20170c71ce8e724b898d92fa8a5fa95331e213d6 | Work harder to combine collisions in the intersection | json-for-collisions.py | json-for-collisions.py | #!/usr/bin/env python3
# Copyright 2014 Martin Robinson
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | Python | 0.000872 | @@ -1844,16 +1844,179 @@
turn 2%0A%0A
+def intersection_name(collision):%0A intersections = sorted(%5Bcollision.primary_road, collision.secondary_road%5D)%0A return '%7B0%7D and %7B1%7D'.format(*intersections)%0A%0A%0A
if __nam
@@ -2736,77 +2736,35 @@
n':
-'%7B0%7D and %7B1%7D'.format(collision.primary_road, ... |
dbbddc64f321ba4703f286758f552ef0ea344308 | Switch back to interactive mode | test_grant_2.py | test_grant_2.py | #!/usr/bin/env python
# Some tests written in support of Matt's grant-writing.
# Daniel Klein, 10/26/2012
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
import os
os.environ['PATH'] += ':/usr/texbin'
from matplotlib import rc
rc('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']... | Python | 0.000001 | @@ -558,10 +558,9 @@
G =
-30
+5
%0Aalp
@@ -1088,22 +1088,23 @@
(net, ('
-degree
+row_sum
', targe
@@ -3332,17 +3332,16 @@
gistic%0A%0A
-#
for c in
@@ -3353,17 +3353,16 @@
riates:%0A
-#
plt.
@@ -3370,17 +3370,16 @@
igure()%0A
-#
plt.
@@ -3443,17 +3443,16 @@
trix())%0A
-#
plt.
@@ -3459,16 +3459,1... |
df78c3093e377a6f4f9e7a92653d2273bd8a356d | Add to test per tutorial | test_journal.py | test_journal.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import pytest
from sqlalchemy import create_engine
from sqlalchemy.exc import IntegrityError
TEST_DATABASE_URL = os.environ.get(
'DATABASE_URL',
'postgresql://jonathan:@localhost:5432/test-learning-journal'
)
os.environ['DATABASE_URL'] =... | Python | 0 | @@ -1690,8 +1690,460 @@
is None%0A
+ # flush the session to %22write%22 the data to the database%0A db_session.flush()%0A # now, we should have one entry:%0A assert db_session.query(journal.Entry).count() == 1%0A for field in kwargs:%0A if field != 'session':%0A assert getattr(entry, f... |
52d4b82a2dff35b22cea389274aaf3731570fe80 | add numpy import | astropy/cosmology/tests/test_cosmology.py | astropy/cosmology/tests/test_cosmology.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .. import cosmology
def test_cosmology():
cosmo = cosmology.Cosmology(H0=70, Om=0.27 ,Ol=0.73)
z = 1
# Test values were taken from the following web cosmology
# calculators on 27th Feb 2012:
# Wright: http://www.astro.ucla.edu/~... | Python | 0.000002 | @@ -82,16 +82,35 @@
osmology
+%0Aimport numpy as np
%0A%0Adef te
|
182fa87ebb013c71744566bc0fe693ccef8df251 | add unit test suite | test_pycosat.py | test_pycosat.py | import pycosat
print pycosat.solve(
5, [
[1, -5, 4],
[-1, 5, 3, 4],
[-3, -4],
],
# True
)
print pycosat.solve(
2, [
[-1],
[1],
],
# True
)
| Python | 0 | @@ -4,82 +4,230 @@
ort
-pycosat%0A%0Aprint pycosat.solve(%0A 5, %5B%0A %5B1, -5, 4%5D,%0A %5B-1, 5, 3, 4%5D,%0A
+unittest%0A%0Aimport pycosat%0A%0A%0Atests = %5B%5D%0A%0Aclass TestSolver(unittest.TestCase):%0A%0A def test_sat_1(self):%0A res = pycosat.solve(5, %5B%5B1, -5, 4%5D,%0A ... |
8e618fa37068ce2ccf7015a3236287a312a80fd9 | Update file mode | test_toolbar.py | test_toolbar.py | import unittest
import tkinter as tk
from tkinter import ttk
import pathlib
import toolbar
BASE = pathlib.Path()
class ToolBarSuite(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.master = tk.Tk()
cls.toolbar = toolbar.ToolBar(cls.master)
cls.toolbar.grid()
@classmeth... | Python | 0.000001 | |
bcb1d2d7a67a1db9d4c64ee55c009800180dca09 | Improve tracing of xvfb.py | testing/xvfb.py | testing/xvfb.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs the test with xvfb on linux. Runs the test normally on other platforms.
For simplicity in gyp targets, this script just ru... | Python | 0.00004 | @@ -1615,10 +1615,8 @@
turn
- 0
%0A r
@@ -1629,12 +1629,8 @@
proc
-.pid
%0A%0A%0Ad
@@ -1748,16 +1748,24 @@
try:%0A
+ _logs =
subproc
@@ -1774,20 +1774,22 @@
s.check_
-call
+output
(%0A
@@ -1811,40 +1811,8 @@
k%5D,%0A
- stdout=subprocess.PIPE,%0A
@@ -2024,24 +2024,29 @@
ProcessError
+ a... |
8d8c752bca025f7c9c34ac4d145f8ad1e62f160d | option for samba | fabrications/password.py | fabrications/password.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Password related fabric commands.
:copyright: (c) 2014 by Alexander Skiba <skiba@icg.tugraz.at>
:licence: MIT
:bugreports: skiba@icg.tugraz.at
"""
from fabric.api import run, task
from os.path import basename, splitext
import configuration as config
# module config... | Python | 0.999997 | @@ -593,16 +593,33 @@
ord_type
+, username=%22self%22
):%0A %22
@@ -676,65 +676,394 @@
type
-.%22%22%22%0A%0A if password_type == %22local%22:%0A run(%22passwd%22
+, (string) user.%0A%0A Arguments:%0A password_type can be either 'local' or 'samba'%0A user will default to the user you lo... |
68989a94b738a9e5ab7aed000523950da99029ec | update cloto db | facts/cloto_db_client.py | facts/cloto_db_client.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright 2014 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of FI-WARE project.
#
# 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 th... | Python | 0 | @@ -1847,12 +1847,8 @@
ROM
-%7B0%7D.
clot
@@ -1877,17 +1877,17 @@
antId=%22%7B
-1
+0
%7D%22'.form
@@ -1893,12 +1893,8 @@
mat(
-db,
tena
|
0ae9b232b82285f2fa275b8ffa5dced6b9377b0e | Add equality operator to EnvironCredential | keyring/credentials.py | keyring/credentials.py | import os
import abc
class Credential(metaclass=abc.ABCMeta):
"""Abstract class to manage credentials"""
@abc.abstractproperty
def username(self):
return None
@abc.abstractproperty
def password(self):
return None
class SimpleCredential(Credential):
"""Simple credentials imp... | Python | 0.000026 | @@ -862,16 +862,283 @@
nv_var%0A%0A
+ def __eq__(self, other: object) -%3E bool:%0A if not isinstance(other, EnvironCredential):%0A return NotImplemented%0A%0A return (%0A self.user_env_var == other.user_env_var%0A and self.pwd_env_var == other.pwd_env_var%0A )%... |
af572475c4ce2a2d5eafbf95dcbeff5759401cb3 | Fix typo in docstring | byceps/services/authentication/service.py | byceps/services/authentication/service.py | """
byceps.services.authentication.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import Optional
from ..user import service as user_service
from ..user.transfer.models import User
from .exceptions import Aut... | Python | 0.013244 | @@ -1579,16 +1579,17 @@
suspe
+n
ded, or
|
dac757beaa74756d292a72abe9910fe5cbb32272 | Fix division operator to true division | vectors/vectors.py | vectors/vectors.py | import math
class Point(object):
""" Point class: Reprepsents a point in the x, y, z space. """
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
def __repr__(self):
return '{0}({1}, {2}, {3})'.format(self.__class__.__name__, self.x,
self.y, sel... | Python | 0.999999 | @@ -1,8 +1,41 @@
+from __future__ import division%0A%0A
import m
|
a4ca3f479d10eb1aa3a04729342a070d51ded39d | Update databases.py | cea/interfaces/dashboard/api/databases.py | cea/interfaces/dashboard/api/databases.py | import os
import glob
from collections import OrderedDict
from flask_restplus import Namespace, Resource, abort
import pandas
import cea.databases
import cea.scripts
from cea.utilities.schedule_reader import read_cea_schedule, save_cea_schedule
api = Namespace("Databases", description="Database data for technologies... | Python | 0.000001 | @@ -906,284 +906,8 @@
%7D),%0A
- (%22lifecycle%22, %7B%0A %22lca_buildings%22: %7B%0A %22file_ext%22: %22.xlsx%22,%0A %22schema_key%22: %22get_database_lca_buildings%22%0A %7D,%0A %22lca_mobility%22: %7B%0A %22file_ext%22: %22.xls%22,%0A %22schema_key... |
b1de92ea458c5207620b999454ebb0e42716b629 | print eta only when fps > 0 | chainercv/utils/iterator/progress_hook.py | chainercv/utils/iterator/progress_hook.py | from __future__ import division
import sys
import time
class ProgressHook(object):
"""A hook class reporting the progress of iteration.
This is a hook class designed for
:func:`~chainercv.utils.apply_prediction_to_iterator`.
Args:
n_total (int): The number of images. This argument is option... | Python | 0.000001 | @@ -659,16 +659,28 @@
not None
+ and fps %3E 0
:%0A
|
9f76d65e4f372faa0f96d873d3ef07ca027038b9 | Use openssl pkey to convert EC key into printable form before comparing, because different openssl versions use different privkey formats | tests/testec.py | tests/testec.py | from ctypescrypto.oid import Oid
from ctypescrypto.ec import create
from base64 import b16decode
import unittest
class TestEcCreation(unittest.TestCase):
ec1priv="""-----BEGIN PRIVATE KEY-----
MIGEAgEAMBAGByqGSM49AgEGBSuBBAAKBG0wawIBAQQgKnG6neqZvB98EEuuxnHs
fv+L/5abuNNG20wzUqRpncOhRANCAARWKXWeUZ6WiCKZ2kHx87jmJyx... | Python | 0 | @@ -94,26 +94,650 @@
ode%0A
-import unittest%0A%0A%0A
+from subprocess import Popen, PIPE%0Aimport unittest%0A%0Adef dump_key(key):%0A %22%22%22 Convert key into printable form using openssl utility%0A Used to compare keys which can be stored in different%0A format by different OpenSSL versions%0A %2... |
97312b55525f81ecba3c0df1d6c2e55fa217ce83 | Make tests run on sqlite by default | testsettings.py | testsettings.py | import os
import dj_database_url
DATABASES = {
"default": dj_database_url.parse(os.environ["DATABASE_URL"]),
}
INSTALLED_APPS = ("django_dbq",)
MIDDLEWARE_CLASSES = (
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewM... | Python | 0.000001 | @@ -27,16 +27,86 @@
se_url%0A%0A
+%0ADATABASE_URL = os.environ.get(%22DATABASE_URL%22, %22sqlite:///:memory:%22)%0A%0A
DATABASE
@@ -152,20 +152,8 @@
rse(
-os.environ%5B%22
DATA
@@ -160,18 +160,16 @@
BASE_URL
-%22%5D
),%0A%7D%0A%0AIN
|
3f8075a69102af969e169ae0d97f0ee58205eed4 | rephrase USING_CITUS calculation | testsettings.py | testsettings.py | from __future__ import absolute_import
from __future__ import unicode_literals
import settingshelper as helper
from settings import *
USING_CITUS = any(db for db in DATABASES.values() if db.get('ROLE') == 'citus_master')
# note: the only reason these are prepended to INSTALLED_APPS is because of
# a weird travis issu... | Python | 0.999641 | @@ -152,43 +152,8 @@
y(db
- for db in DATABASES.values() if db
.get
@@ -178,16 +178,45 @@
_master'
+ for db in DATABASES.values()
)%0A%0A# not
|
599553e9011966112c81799876ade3ac80fbea39 | use get_handler method in ViewCollection to avoid key error | view_collection.py | view_collection.py | import tempfile
import time
class ViewCollection:
views = {} # Todo: these aren't really views but handlers. Refactor/Rename.
git_times = {}
git_files = {}
buf_files = {}
compare_against = "HEAD"
@staticmethod
def add(view):
key = ViewCollection.get_key(view)
try:
... | Python | 0 | @@ -1289,37 +1289,38 @@
(view):%0A
-key =
+return
ViewCollection.
@@ -1327,58 +1327,21 @@
get_
-key(view)%0A return ViewCollection.views%5Bkey%5D
+handler(view)
.dif
@@ -1388,37 +1388,38 @@
(view):%0A
-key =
+return
ViewCollection.
@@ -1426,58 +1426,21 @@
get_
-key(view)%0A return... |
06c3cfa85bdf9109523733ec1b6b8d9c8c1c95ad | Add solve_laplace | lcapy/nodalanalysis.py | lcapy/nodalanalysis.py | """This module performs nodal analysis. It is primarily for showing
the equations rather than for evaluating them.
Copyright 2019-2021 Michael Hayes, UCECE
"""
from .circuitgraph import CircuitGraph
from .tmatrix import TimeDomainMatrix
from .expr import equation, ExprTuple
from .systemequations import SystemEquati... | Python | 0.00273 | @@ -6132,24 +6132,261 @@
le(self.y)%0A%0A
+ def solve_laplace(self):%0A %22%22%22Determine the unknown voltages using Laplace transforms and%0A return as a dict%22%22%22%0A%0A from .sexpr import s%0A %0A return self.nodal_equations()(s).solve(self.unknowns(s))%0A %0A
%0Afr... |
ab55e0daaffb627fdab7090946f91b36e9a95d2a | fix #772 修改密码后,新密码无法登录 (登录时密码做了位数验证) | walle/form/user.py | walle/form/user.py | # -*- coding: utf-8 -*-
"""
walle-web
:copyright: © 2015-2017 walle-web.io
:created time: 2017-03-19 15:50:07
:author: wushuiyong@walle-web.io
"""
try:
from flask_wtf import FlaskForm # Try Flask-WTF v0.13+
except ImportError:
from flask_wtf import Form as FlaskForm # Fallback to Flask-WTF v... | Python | 0 | @@ -2416,20 +2416,12 @@
th(min=6
-, max=35
)%5D)%0A
|
501793ee53d9c47822147f58334356686510519a | generate cover titles | titles/title.py | titles/title.py | # coding=utf-8
import ConfigParser
import svgwrite
ConfigColor = ConfigParser.ConfigParser()
ConfigColor.read("./color.ini")
bg_colors = []
font_colors = []
def generate_works(color_name, bg_color, font_color):
dwg = svgwrite.Drawing('generate/titles/' + color_name + '.svg', size=(u'950', u'500'))
shapes =... | Python | 0.999999 | @@ -159,36 +159,46 @@
%0A%0A%0Adef generate_
-w
+title_by_col
or
-k
s(color_name, bg
@@ -657,33 +657,35 @@
)%0A%0A%0A
-if __name__ == '__main__'
+def generate_cover_titles()
:%0A
@@ -875,12 +875,22 @@
ate_
-w
+title_by_col
or
-k
s(co
@@ -921,8 +921,65 @@
_color)%0A
+%0A%0Aif __name__ == '__main__':%0A gen... |
3a3dd951bc4b3fe4c54cbc542cb63f84d5b0fdcc | Bump version number to 2.2alpha for continued development. | tkp/__init__.py | tkp/__init__.py | """
This package contains the Python modules used by the LOFAR Transients Pipeline
(TraP). This includes:
- Pipeline configuration management;
- Task distribution;
- Image loading and quality control;
- Source detection and measurement;
- Storing and associating sources in the database.
For details, see http://docs.t... | Python | 0 | @@ -357,9 +357,9 @@
%222.
-1.
+2a
0%22%0A
|
328d40f8f166f6744db94332d5620500cac73f02 | fix bug, required not allowed for positionals | defs/gcs_uploader.py | defs/gcs_uploader.py | #!/usr/bin/env python
# Copyright 2016 The Kubernetes 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 appli... | Python | 0 | @@ -1661,31 +1661,16 @@
s_path%22,
- required=True,
help=%22p
|
02f985c5828427a84917003abb2b368514385f1e | Use resource_find to get the dbs if I can | ELiDE/ELiDE/game.py | ELiDE/ELiDE/game.py | import os
from importlib import import_module
from kivy.properties import (
AliasProperty,
ObjectProperty
)
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.screenmanager import ScreenManager, Screen
from LiSE.engine import Engine
import LiSE.proxy
class GameScreen(Screen):
switch... | Python | 0 | @@ -109,16 +109,57 @@
perty%0A)%0A
+from kivy.resources import resource_find%0A
from kiv
@@ -791,57 +791,52 @@
y()%0A
+%0A
-worlddb = AliasProperty(%0A lambda self:
+def _get_worlddb(self):%0A filen =
sel
@@ -883,25 +883,24 @@
iSEWorld.db'
-,
%0A lam
@@ -900,137 +900,321 @@
-lamb... |
eb563248e35effa49b424879f184babec771f2aa | Add args 'since', since commit hash used for release-note | deploy2testflight.py | deploy2testflight.py | #!/usr/bin/env python2.7
#coding=utf-8
#
#The MIT License (MIT)
#
#Copyright (c) 2012-2013 HUB Systems, Inc.
#
#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 with... | Python | 0.000002 | @@ -3044,16 +3044,172 @@
arget')%0A
+ argParser.add_argument('-s', '--since', default=%5B'master'%5D, metavar='NAME', nargs=1, help='since commit-hash, used for release-notes. ex)%3CNAME%3E..HEAD')%0A
args
@@ -3532,18 +3532,28 @@
ate note
+s
(
+default:
commit t
@@ -3678,22 +3678,37 @@
%22- %25s%5C%22
-... |
2c408b775f46373f5d0260b8fa0dfd559a6e4d49 | Move an import to the top | transmutagen.py | transmutagen.py | import sys
from sympy import (nsolve, symbols, Mul, Add, chebyshevt, exp, simplify,
chebyshevt_root, Tuple, diff, plot, N, solve, together, Poly)
def general_rat_func(d, x, chebyshev=False):
"""
Return a general rational function with numerator and denominator degree d
Returns a tuple, (rational func... | Python | 0.000001 | @@ -145,16 +145,75 @@
Poly)%0A%0A
+from sympy.utilities.decorator import conserve_mpmath_dps%0A%0A
def gene
@@ -1914,66 +1914,8 @@
ts%0A%0A
-from sympy.utilities.decorator import conserve_mpmath_dps%0A
%0A@co
|
a8246967f239938251d754bd934823f56f3d4df1 | update try_lightGBM.py | try_lightGBM.py | try_lightGBM.py | import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import lightgbm as lgb
import xgboost as xgb
from sklearn.preprocessing import LabelEncoder,OneHotEncoder
from sklearn.model_selection import train_test_split
data=pd.read_csv('adult.csv',header=None)
# assign column names to the data
... | Python | 0.000001 | @@ -2019,8 +2019,1261 @@
ize=.3)%0A
+%0A%0A# Method 1 - XGBOOST, single thread%0Adtrain=xgb.DMatrix(features_train,label=label_train)%0Adtest=xgb.DMatrix(features_test)%0A## xgboost params%0Aparameters=%7B'max_depth':7, 'eta':1, 'silent':1,'objective':'binary:logistic','eval_metric':'auc','learning_rate':.05%7D%0A%0Af... |
deaa25fd68b40d902cdd823e034d5d6a511e95c2 | test commit | diggit/src/diggit.py | diggit/src/diggit.py | #!/usr/bin/python
#
# bl4de | <bloorq@gmail.com> | https://twitter.com/_bl4de
#
# diggit - gets .git repository
import argparse
import os
import re
# some common definitions
VERSION = "1.0.0"
OBJECT_DIR = "/.git/objects/"
term = {
"black": '\33[30m',
"red": '\33[31m',
"green": '\33[32m',
"yellow": '\3... | Python | 0.000001 | @@ -1953,16 +1953,29 @@
endl%22%5D)%0A
+ %0A
%0A%0Adef ge
|
492a58abdf34737f6d186668a42cda5b0b0df2be | Add write method to FeedSingle writer. | firmant/writers/feeds.py | firmant/writers/feeds.py | # Copyright (c) 2010, Robert Escriva
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of condition... | Python | 0 | @@ -1606,16 +1606,39 @@
.%0A'''%0A%0A%0A
+from copy import copy%0A%0A
from fir
@@ -1664,16 +1664,16 @@
Writer%0A
-
%0A%0Aclass
@@ -2687,12 +2687,1145 @@
-pass
+'''Write a parsed feed to the filesystem.%0A%0A Example on testdata/pristine::%0A%0A %3E%3E%3E fs = FeedSingle(settings, objs, url... |
ef638d679a87cb33975fb29fea652cc84aa71663 | Rename /atom.xml to /feed.atom | flaskrst/modules/atom.py | flaskrst/modules/atom.py | # -*- coding: utf-8 -*-
"""
flask-rst.modules.atom
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011 by Christoph Heer.
:license: BSD, see LICENSE for more details.
"""
from flask import Blueprint, request, current_app, url_for
from werkzeug.contrib.atom import AtomFeed, FeedEntry
from flaskrst.modules.blo... | Python | 0.000237 | @@ -387,16 +387,17 @@
e(%22/
+feed.
atom
-.xml
%22)%0Ad
|
f805adf307faec18ba833f7ca4491bd520721489 | __all__ should contain strings. | flocker/docs/__init__.py | flocker/docs/__init__.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
from ._version import get_doc_version, is_release
__all__ = ['get_doc_version', is_release]
| Python | 0.999995 | @@ -136,16 +136,17 @@
rsion',
+'
is_relea
@@ -147,10 +147,11 @@
_release
+'
%5D%0A
|
6350c312891b91aea16eebc8a9cb1502d1a058a4 | Bump version to 1.1.3 | fluent_utils/__init__.py | fluent_utils/__init__.py | # following PEP 386
__version__ = "1.1.2"
| Python | 0 | @@ -36,7 +36,7 @@
1.1.
-2
+3
%22%0A
|
be93bbc76a988dac1452b0b26f879204d95603e1 | clear _website_pages in clear_web | frappe/website/render.py | frappe/website/render.py | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr
import mimetypes, json
from werkzeug.wrappers import Response
from frappe.website.context import get_context
f... | Python | 0.000085 | @@ -4305,16 +4305,64 @@
Guest%22)%0A
+%09%09frappe.cache().delete_value(%22_website_pages%22)%0A
%09%09clear_
|
5a55033bc1cc5570e08c72c3018b3c81483a7fbb | Simplify code | lib/dataset_sampler.py | lib/dataset_sampler.py | import os
import six
import numpy as np
import multiprocessing
from tempfile import NamedTemporaryFile
from lib import iproc
from lib.pairwise_transform import pairwise_transform
class DatasetSampler():
def __init__(self, datalist, config):
self.datalist = datalist
self.config = config
... | Python | 0.041259 | @@ -1533,33 +1533,32 @@
running = False%0A
-%0A
if s
@@ -1601,25 +1601,24 @@
t_process()%0A
-%0A
@@ -1630,33 +1630,32 @@
_reload = False%0A
-%0A
return s
|
527edae58c7ec2de273c686adbd7323f097bd2a9 | fix references to self.process | lib/exaproxy/worker.py | lib/exaproxy/worker.py | #!/usr/bin/env python
# encoding: utf-8
"""
process.py
Created by Thomas Mangin on 2011-11-29.
Copyright (c) 2011 Exa Networks. All rights reserved.
"""
from threading import Thread
import subprocess
import errno
import os
import time
import socket
from Queue import Empty
from .http import regex
from .logger impo... | Python | 0.000001 | @@ -3771,29 +3771,24 @@
%09%09%09try:%0A%09%09%09%09
-self.
process.stdi
@@ -3828,21 +3828,16 @@
p))%0A%09%09%09%09
-self.
process.
@@ -3865,21 +3865,16 @@
ponse =
-self.
process.
|
543cd45764afba42cfc215b7d8098d1a9168ba7c | Add curly quotes, | generate_quote_images.py | generate_quote_images.py | #!/usr/bin/env python
import json
import os
import textwrap
from PIL import Image, ImageDraw, ImageFont
OUT_DIR = '.quote_images'
CANVAS_WIDTH = 640
CANVAS_HEIGHT = 640
TEXT_MARGIN = (40, 40, 200, 40)
TEXT_MAX_WIDTH = CANVAS_WIDTH - (TEXT_MARGIN[1] + TEXT_MARGIN[3])
TEXT_MAX_HEIGHT = CANVAS_WIDTH - (TEXT_MARGIN[0] ... | Python | 0 | @@ -14,16 +14,39 @@
v python
+%0A# -*- coding: utf8 -*-
%0A%0Aimport
@@ -1837,16 +1837,26 @@
text =
+ u'%E2%80%9C%25s%E2%80%9D' %25
speech%5B
|
e679d2646b79e3cedd144447b9b5944b670c8f8c | Update fractalnet.py | generation/fractalnet.py | generation/fractalnet.py | from __future__ import division, print_function, absolute_import
from string import Template
import textwrap
import sys
# SETTINGS
INPUT_SIZE = 32
REDUCTIONS = 5
COLUMNS = 3
CLASSES = 10
GLOBAL_DROP_PATH = False
FILTERS = [64, 128, 256, 512, 512]
DROPOUTS = [0.0, 0.1, 0.2, 0.3, 0.4]
# Set drop-path in globals.crox
... | Python | 0 | @@ -258,13 +258,8 @@
= %5B
-0.0,
0.1,
|
1b05421a58b8b6d62d62bfd7323e91df2fbc496d | patch auth.User to have utility methods | generic_follow/models.py | generic_follow/models.py | from django.conf import settings
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from .managers import FollowManager
class Follow(models.Model):
user = models.ForeignKey(getattr(settings, 'AUTH_USER_MODEL', 'auth.User'))
... | Python | 0.000001 | @@ -623,8 +623,351 @@
nager()%0A
+%0A%0A# apply user model mixins to auth.User model%0Aif getattr(settings, 'AUTH_USER_MODEL', 'auth.User') == 'auth.User':%0A from .model_mixins import UserFollowMixin%0A from django.contrib.auth.models import User%0A%0A for name, method in UserFollowMixin.__dict__:%0A ... |
d88bb6542373f248f6792bd064ad84a17efe9414 | fix teacher and student model | src/crike_django/crike_django/models.py | src/crike_django/crike_django/models.py | #coding:utf-8
from django.db import models
from django.contrib.auth.models import User
from mongoengine import *
# 数据库基本模型分为word、dict、user、course、voice、image、game、video
# 当前目标:实现word、dict、user、course,其余皆往后排
# dict包含多个word,course包含多个word,user包含多个course
class Word(Document):
name = StringField(required=True, max_l... | Python | 0.000001 | @@ -1499,211 +1499,45 @@
p
-rofile = models.ForeignKey(Profile)%0A%0A class Meta:%0A db_table = 'teacher_user'%0A%0Aclass Student(Profile):%0A profile = models.ForeignKey(Profile)%0A%0A class Meta:%0A db_table = 'student_user'
+ass%0A%0Aclass Student(Profile):%0A pass
%0A%0Acl
|
6da6ee07cb987f1e8f42bcfcfa28dae6406852d8 | implement review feedback | src/gateway/api/serializers/delivery.py | src/gateway/api/serializers/delivery.py | # Copyright (C) 2020 OpenMotics BV
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribu... | Python | 0.000001 | @@ -2692,68 +2692,8 @@
y'%5D%0A
- if user_controller.user_id_exists(user_id):%0A
@@ -2759,35 +2759,59 @@
id)%0A
-els
+if user_delivery_dto is Non
e:%0A
@@ -3095,68 +3095,8 @@
p'%5D%0A
- if user_controller.user_id_exists(user_id):%0A
@@ -3168,19 +316... |
b5a92b53e95bef1858b3dfa1ab6b1828dd085ed4 | disable blue logs | libdotfiles/logging.py | libdotfiles/logging.py | # pylint: disable=unused-import,protected-access,invalid-name
import logging
import os
from logging import (
DEBUG,
ERROR,
INFO,
WARNING,
debug,
error,
getLogger,
info,
warning,
)
import coloredlogs
def _add_custom_level(number, name):
logging.addLevelName(number, name.upper()... | Python | 0 | @@ -1084,37 +1084,8 @@
%22: %7B
-%22color%22: %22blue%22, %22bold%22: True
%7D,%0A
|
8160b272ca3b5bdcadc9caff53422b097bb02eb8 | fix prefetch | geotrek/outdoor/views.py | geotrek/outdoor/views.py | from django.conf import settings
from django.contrib.gis.db.models.functions import Transform
from django.db.models import Q
from mapentity.views import (MapEntityLayer, MapEntityList, MapEntityDetail, MapEntityCreate, MapEntityUpdate,
MapEntityDelete, MapEntityFormat)
from geotrek.authent... | Python | 0.000003 | @@ -7009,16 +7009,23 @@
elated('
+parent_
sites')%0A
|
22ecd2d6d5937357c40fc529df39d677e5bf7ff2 | include subject and compat py2.6 | userena/mail.py | userena/mail.py | # -*- coding: utf-8 -*-
import re
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
from django.core.mail import EmailMultiAlternatives
from userena import settings as userena_settings
from html2text import html2text
def send_mail... | Python | 0 | @@ -1295,23 +1295,23 @@
:%0A%0A _
-subject
+message
_txt = '
@@ -1326,24 +1326,25 @@
emails/%7B
+0
%7D_email_
subject%7B
@@ -1339,16 +1339,17 @@
ail_
-subject%7B
+message%7B1
%7D.tx
@@ -1356,23 +1356,23 @@
t'%0A _
-subject
+message
_html =
@@ -1388,16 +1388,17 @@
emails/%7B
+0
%7D_email_
@@ -1409,15 +... |
fed687bb6a5b4685b04b3533920288c8e5ae4faf | Use db.session directly rather than relying on convenience methods | gittip/authentication.py | gittip/authentication.py | """Defines website authentication helpers.
"""
import datetime
import rfc822
import time
import pytz
from aspen import Response
from gittip.models import User
BEGINNING_OF_EPOCH = rfc822.formatdate(0)
TIMEOUT = 60 * 60 * 24 * 7 # one week
def inbound(request):
"""Authenticate from a cookie.
"""
if 'sessi... | Python | 0 | @@ -122,16 +122,42 @@
esponse%0A
+from gittip.orm import db%0A
from git
@@ -1638,17 +1638,54 @@
-user.save
+db.session.add(user)%0A db.session.commit
()%0A%0A
|
383a9d6d74c55b8fb037e43c8236d0dc7ff38e07 | add argv argument to the process function (which defaults to sys.argv) | Synopsis/process.py | Synopsis/process.py | # $Id: process.py,v 1.5 2003/12/11 04:38:59 stefan Exp $
#
# Copyright (C) 2003 Stefan Seefeld
# All rights reserved.
# Licensed to the public under the terms of the GNU LGPL (>= 2),
# see the file COPYING for details.
#
from Processor import Processor
import AST
from getoptions import getoptions
import sys
def erro... | Python | 0 | @@ -443,16 +443,33 @@
process(
+argv = sys.argv,
**comman
@@ -1251,20 +1251,16 @@
if len(
-sys.
argv) %3C
@@ -1314,28 +1314,24 @@
put files%5D%22%25
-sys.
argv%5B0%5D)%0A%0A
@@ -1336,20 +1336,16 @@
elif
-sys.
argv%5B1%5D
@@ -1380,36 +1380,32 @@
age: %25s --help%22%25
-sys.
argv%5B0%5D%0A pr
@@ ... |
62778a8eeeeb72785a208e0099b5a6f35531b2ca | fix focal loss | lightnn/base/losses.py | lightnn/base/losses.py | # -*- encoding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
cutoff = 1e-12
def _cutoff(z):
return np.clip(z, cutoff, 1 - cutoff)
class Loss(object):
@staticmethod
def forward(y_hat, y):
raise NotImpleme... | Python | 0 | @@ -2917,16 +2917,20 @@
_to_num(
+y *
np.power
|
1de2ebab77eba6bdf35b7db004af42804a3984d1 | Fix admin file widget for cases where no file exists | lingcod/array/forms.py | lingcod/array/forms.py | #from django.contrib.admin.widgets import AdminFileWidget
from django.forms import ModelForm
from django.utils.safestring import mark_safe
from django import forms
from lingcod.array.models import MpaArray
from lingcod.rest.forms import UserForm
from os.path import splitext,split
class AdminFileWidget(forms.FileInput)... | Python | 0 | @@ -565,40 +565,44 @@
-filename = split
+if value and hasattr
(value
-.
+, %22
name
-)%5B-1%5D
+%22):
%0A
@@ -610,43 +610,44 @@
-if value and hasattr(value, %22url%22):
+ filename = split(value.name)%5B-1%5D
%0A
|
074b09f7a0831dd34e00727951fba89bfa559c42 | Update ipc_lista1.2.py | lista1/ipc_lista1.2.py | lista1/ipc_lista1.2.py | #ipc_lista1.2
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um Programa que peça um número e então mostre a mensagem O número informado foi [número].
number = input("Digite um número: ")
print "O número digitado foi ",number
| Python | 0.000001 | @@ -250,8 +250,10 @@
,number%0A
+%0A%0A
|
468c7496109dcd23f02b6407bd10a0d758229c2a | Update ipc_lista1.5.py | lista1/ipc_lista1.5.py | lista1/ipc_lista1.5.py | #ipc_lista1.5
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que converta metros para centímetros.
metros = input("Digite o valor em metros que deseja converter em centímetros: ")
centimetros = metros * 100
print
| Python | 0 | @@ -247,9 +247,10 @@
00%0Aprint
+
%0A
|
f2b30562b76ed7ab52a1d52c065dd01de9edaef0 | Update ipc_lista1.7.py | lista1/ipc_lista1.7.py | lista1/ipc_lista1.7.py | #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o #usuário.
altura = input("Digite a altura do quadrado em metros: ")
largura = input("Digite a largura do quadrado em metros:
| Python | 0 | @@ -288,9 +288,11 @@
metros:
+%22)
%0A
|
7c2b2d2a7a9cad2d266448081ca1b5fbea2120ca | fix bug: REST_FRAMEWORK setting overlapping | drf_auth/settings.py | drf_auth/settings.py | """
Django settings for drf_auth project.
Generated by 'django-admin startproject' using Django 1.10.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import o... | Python | 0.000001 | @@ -3471,30 +3471,9 @@
)
-%0A%7D%0A%0AREST_FRAMEWORK = %7B
+,
%0A
@@ -3488,11 +3488,12 @@
IZE': 10
+,
%0A%7D%0A
|
baac4c71cbf10ee0c807f2236efb971eb07c06ce | Fix logical errors in input_events.py | locust/input_events.py | locust/input_events.py | import gevent
import logging
import os
if os.name == "nt":
from win32api import STD_INPUT_HANDLE
from win32console import (
GetStdHandle,
KEY_EVENT,
ENABLE_ECHO_INPUT,
ENABLE_LINE_INPUT,
ENABLE_PROCESSED_INPUT,
)
else:
import sys
import select
import term... | Python | 0.999783 | @@ -1093,24 +1093,16 @@
if
-not len(
self.cap
@@ -1116,14 +1116,8 @@
hars
-) == 0
:%0A
@@ -1752,20 +1752,16 @@
if
-not
self.cap
|
768c18f1b0bb8a974ffc4323dc302b03c96cbf86 | Bump version | logbook/__version__.py | logbook/__version__.py | __version__ = "1.5.2"
| Python | 0 | @@ -16,7 +16,7 @@
1.5.
-2
+3
%22%0A
|
61aa3cc80c1c235a7b5b57d67909b4f436de31d9 | Fix line length issue | venvs/common.py | venvs/common.py | from itertools import chain
import os
import platform
import subprocess
import sys
import sysconfig
import attr
import click
import filesystems.native
def get_module_path(name):
if sys.version_info >= (3, 4):
import importlib
spec = importlib.util.find_spec(name)
path = spec.origin
el... | Python | 0.000063 | @@ -1613,29 +1613,54 @@
def create(
-self,
+%0A self,%0A
arguments=(
@@ -1661,16 +1661,28 @@
ents=(),
+%0A
python=
@@ -1686,16 +1686,28 @@
on=None,
+%0A
stdout=
@@ -1709,32 +1709,44 @@
dout=sys.stdout,
+%0A
stderr=sys.stde
@@ -1743,24 +1743,30 @@
r=sy... |
ac98e59b0a5fc4f129082ceeb7344d53f2def72a | Kill obsolete runner-related code in AnyToBoostFunction. | src/object/any-to-boost-function.hxx.py | src/object/any-to-boost-function.hxx.py | #!/usr/bin/python
def type_fun(r, runner, nargs, name, met):
args = []
if r:
r = 'R'
else:
r = 'void'
if runner:
args += ['runner::Runner&']
if met == 0:
args += ['S']
for i in range(nargs):
args += ['Arg%s' % i]
const = ''
if met == 2:
... | Python | 0 | @@ -23,32 +23,24 @@
type_fun(r,
- runner,
nargs, name
@@ -39,32 +39,32 @@
gs, name, met):%0A
+
%0A args = %5B%5D%0A%0A
@@ -122,59 +122,8 @@
id'%0A
- if runner:%0A args += %5B'runner::Runner&'%5D%0A
@@ -420,32 +420,24 @@
ype_boost(r,
- runner,
nargs, met)
@@ -525,59 +525,8 @@
d'%5D%0A
- ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.