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 |
|---|---|---|---|---|---|---|---|
0a0da3821c6dec714b42e119468f1caba2da5341 | Remove unused imports | openprescribing/pipeline/management/commands/run_pipeline_e2e_tests.py | openprescribing/pipeline/management/commands/run_pipeline_e2e_tests.py | from distutils.dir_util import copy_tree
import glob
import os
import shutil
from django.apps import apps
from django.core.management import BaseCommand, CommandError
from django.conf import settings
from django.core.management import call_command
from gcutils.bigquery import Client as BQClient, DATASETS, build_sche... | Python | 0.000001 | @@ -470,55 +470,8 @@
obal
-, TariffPrice%0Afrom dmd2.models import VMP, VMPP
%0Afro
|
64ef54a757b1ad8160f8b30e9b5d1e90b47cac22 | Version bump. | uptimerobot/__init__.py | uptimerobot/__init__.py | # -*- coding: utf-8 -*-
__version__ = '0.1.0'
| Python | 0 | @@ -40,7 +40,6 @@
0.1.
-0'
+1
%0A
|
707be52f21dae6682cd541d62941c0095869c98f | Update time util docstrings | mycroft/util/time.py | mycroft/util/time.py | #
# Copyright 2018 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python | 0.000001 | @@ -575,16 +575,202 @@
ense.%0A#%0A
+%22%22%22Time utils for getting and converting datetime objects for the Mycroft%0Asystem. This time is based on the setting in the Mycroft config and may or%0Amay not match the system locale.%0A%22%22%22%0A
from dat
@@ -863,17 +863,16 @@
%0A %22%22%22
-
Get the
@@ -1611,33 ... |
ee1f59a8a61709bebc4f08adce520ab251576148 | Use a single query to fetch the guardian and hub. | us_ignite/hubs/views.py | us_ignite/hubs/views.py | from django.db.models import Q
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.http import Http404
from django.template.response import TemplateResponse
from django.shortcuts import get_object_or_404, redirect
from us_ignite.hubs.models import Hub, HubRequest
f... | Python | 0 | @@ -1425,19 +1425,63 @@
_or_404(
-Hub
+%0A Hub.objects.select_related('guardian')
, slug=s
|
abd2bbc081167c9306558d6376c691a965e0cf71 | Improve onchage experience | l10n_es_location_nuts/models/res_partner.py | l10n_es_location_nuts/models/res_partner.py | # -*- coding: utf-8 -*-
# Python source code encoding : https://www.python.org/dev/peps/pep-0263/
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright :
# (c) 2015 Antiun Ingenieria, SL (Madrid, Spain, http://www... | Python | 0.000001 | @@ -2564,8 +2564,1096 @@
result%0A
+%0A @api.onchange('substate', 'region')%0A def onchange_substate_or_region(self):%0A result = super(ResPartner, self).onchange_substate_or_region()%0A if (self.state_id.country_id.code == 'ES' or%0A self.substate.country_id.code == 'ES' or%0A ... |
0fdb93fb73142315fe404b9a161ef19af0d920cd | Add simple test for config builder | tests/test_bawlerd.py | tests/test_bawlerd.py | import io
import os
from textwrap import dedent
from pg_bawler import bawlerd
class TestBawlerdConfig:
def test_build_config_location_list(self):
assert not bawlerd.conf.build_config_location_list(locations=())
user_conf = os.path.join(
os.path.expanduser('~'),
bawlerd.c... | Python | 0 | @@ -1214,8 +1214,490 @@
config%0A
+%0A def test_read_config_files(self):%0A config_base = os.path.join(%0A os.path.abspath(os.path.dirname(__file__)), 'configs')%0A locations = %5B%0A os.path.join(config_base, 'etc'),%0A os.path.join(config_base, 'home'),%0A %5... |
e62b62107ef44fec414a3a932a3e3e7bad211f34 | add django-extensions for easier local view debugging | coffeestats/coffeestats/settings/local.py | coffeestats/coffeestats/settings/local.py | # -*- python -*-
# pymode:lint_ignore=W0401,E501
"""Development settings and globals."""
from __future__ import absolute_import
from .base import * # noqa
# ######### DEBUG CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# ######### END DEBUG CONFIGURATION
# ######### ... | Python | 0 | @@ -926,16 +926,41 @@
olbar',%0A
+ 'django_extensions',%0A
)%0A%0AMIDDL
|
0589fe156e710a97fd08001142ec05dea4bc2b65 | Use other key for exercise strings for react | wger/core/management/commands/extract-i18n.py | wger/core/management/commands/extract-i18n.py | # -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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 ... | Python | 0.000001 | @@ -1285,16 +1285,176 @@
ions):%0A%0A
+ # Replace whitespace with underscores and make lowercase%0A def cleanup_name(name: str) -%3E str:%0A return name.replace(' ', '_').lower()%0A%0A
@@ -2385,18 +2385,52 @@
+= f't(%22
-%7Bi
+exercises.%7Bcleanup_name(i.__str__())
%7D%22);%5Cn'%0A... |
bc75dbaecfac0b9afff324c54e6c022b35419f28 | set debug to false | project/web/app/website/settings.py | project/web/app/website/settings.py | """
Django settings for website project.
Generated by 'django-admin startproject' using Django 1.10.2.
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 os... | Python | 0.99987 | @@ -814,19 +814,20 @@
DEBUG =
-Tru
+Fals
e%0ALOG =
|
a835dbfbaa2c70329c08d4b8429d49315dc6d651 | Remove dangerous safestring declaration | openstack_dashboard/dashboards/identity/mappings/tables.py | openstack_dashboard/dashboards/identity/mappings/tables.py | # Copyright (C) 2015 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Python | 0.000002 | @@ -612,44 +612,8 @@
on%0A%0A
-from django.utils import safestring%0A
from
@@ -2263,35 +2263,13 @@
urn
-safestring.mark_safe(
rules
-)
%0A%0A%0Ac
|
67bcec666fb1dc1ca48e531fd49bbbc75c09f041 | fix the bug when the method it's call by the onchange (#140) | stock_voucher/models/stock_picking_voucher.py | stock_voucher/models/stock_picking_voucher.py | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import fields, models, api, _
from odoo.exceptions import Valid... | Python | 0 | @@ -2268,45 +2268,17 @@
- ('id', '!=', self.id),%0A %5D)
+%5D) - self
%0A
|
4b0902e960f08f9ef99ce211b98e211b1685f68b | Update walletchangepass.py | contrib/wallettools/walletchangepass.py | contrib/wallettools/walletchangepass.py | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:46393")
pwd = raw_input("Enter old wallet passphrase: ")
pwd2 = raw_input("Enter new wallet passphrase: ")
access.walletpassphrasechange(pwd, pwd2) | Python | 0.000001 | @@ -70,13 +70,12 @@
0.1:
-46393
+6647
%22)%0Ap
@@ -212,8 +212,9 @@
d, pwd2)
+%0A
|
af0a932e8097701179310501d75888d7d4617dac | verifica codice con Schema dello SdI per fatturapa | l10n_it_payment_reason/tests/test_reason.py | l10n_it_payment_reason/tests/test_reason.py | from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase
class TestReasons(TransactionCase):
def setUp(self):
super(TestReasons, self).setUp()
self.reason_model = self.env["payment.reason"]
self.reason_b = self.env.ref("l10n_it_payment_reason.b")
def t... | Python | 0 | @@ -84,16 +84,97 @@
onCase%0A%0A
+from odoo.addons.l10n_it_account.tools.account_tools import fpa_schema_get_enum%0A%0A
%0Aclass T
@@ -796,16 +796,542 @@
%5D,%0A )%0A
+%0A def test_compare_with_fpa_schema(self):%0A %22%22%22Check that the values we define in this module are%0A the same as ... |
c59a2ce0a6b164e7af26d73a553349937642c370 | write frozen graph instead of just the graph def | write_pb_file.py | write_pb_file.py | #!/usr/bin/env python3
from gnt_model import model, error_rate, IMAGE_HEIGHT, IMAGE_WIDTH, PIXEL_DEPTH
import sys
import tensorflow as tf
def main():
if len(sys.argv) != 3:
print('Usage: {} modelpath outputdir'.format(sys.argv[0]))
sys.exit()
_, model_path, output_dir = sys.argv
node_im... | Python | 0.000006 | @@ -98,16 +98,26 @@
_DEPTH%0A%0A
+import os%0A
import s
@@ -144,16 +144,113 @@
as tf%0A%0A
+from tensorflow.python.platform import gfile%0Afrom tensorflow.python.framework import graph_util%0A%0A
def main
@@ -305,21 +305,27 @@
age: %7B%7D
-model
+checkpoint_
path out
@@ -327,16 +327,17 @@
h output
+_
dir'.for... |
6ecccc9d5600f46e4810ab3fdf82d29268105abc | use watchdog instead of bare inotifyx for recursive file system monitoring | purkinje_pytest/testrunner.py | purkinje_pytest/testrunner.py | # -*- coding: utf-8 -*-
"""Automatic test execution"""
from __future__ import print_function
from watchdog.observers import Observer
from watchdog.events import LoggingEventHandler
import logging
import time
logger = logging.getLogger(__file__)
#WATCH_MASK = inotify.IN_CLOSE_WRITE | inotify.IN_DELETE
# Extensions ... | Python | 0 | @@ -156,23 +156,26 @@
import
-Logging
+FileSystem
EventHan
@@ -362,16 +362,643 @@
.py'%5D%0A%0A%0A
+class Handler(FileSystemEventHandler):%0A%0A %22%22%22Triggers test execution when project contents change%0A %22%22%22%0A%0A def on_created(self, event):%0A self._trigger(event)%0A%0A def on_dele... |
167b55048595f5329c064ad83c3dc19eaa9dc03e | add flask API function to add a set of images | recognition_server.py | recognition_server.py | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 12 18:08:52 2017
@author: Shaun Werkhoven
@purpose: To create a image classification system for the Image Intelligence
TakeHome Assignment
Licensed under the Apache License, Version 2.0 (the "License");
Simple image classification with TensorFlow and the Inception mode... | Python | 0 | @@ -2654,8 +2654,1385 @@
mg%5B0%5D%7D)%0A
+%0A%0A### test String%0A### curl -i -H %22Content-Type: application/json%22 -X POST -d '%7B%22url%22:%22http://imgdirect.s3-website-us-west-2.amazonaws.com/neither.jpg%22%7D' http://127.0.0.1:5000/img/api/v1.0/images%0A@app.route('/img/api/v1.0/images', methods = %5B'POST'%5D... |
c052aaca11f8fdcd465ee986548db8141b27a197 | bump to 0.7.2 | hublib/__init__.py | hublib/__init__.py | from pint import UnitRegistry
ureg = UnitRegistry()
ureg.autoconvert_offset_to_baseunit = True
Q_ = ureg.Quantity
__version__ = "0.7.1"
| Python | 0.000013 | @@ -131,8 +131,8 @@
0.7.
-1
+2
%22%0A%0A
|
8a0a00a688d2a7edb6b03a505d4ededf72730886 | Remove useless import | zinnia/views/trackback.py | zinnia/views/trackback.py | """Views for Zinnia trackback"""
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.utils.decorators import method_decor... | Python | 0.000004 | @@ -235,42 +235,8 @@
404%0A
-from django.utils import timezone%0A
from
|
8959801a293fa33cb7625b524c6e9226af7253b2 | Use separate HITTypeIds for live vs. sandbox | recruiters.py | recruiters.py | """Recruiters of judicious humans."""
import logging
import os
import boto3
# Set up logging.
logger = logging.getLogger(__name__)
handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s [recruiter.1]: %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLe... | Python | 0.000001 | @@ -1367,57 +1367,142 @@
-response = self._client.create_hit_with_hit_type(
+if self.mode == %22sandbox%22:%0A HITTypeId = os.environ%5B%22JUDICIOUS_MTURK_HIT_TYPE_ID_SANDBOX%22%5D%0A elif self.mode == %22live%22:
%0A
@@ -1519,17 +1519,19 @@
ITTypeId
-=
+ =
os.envir
@@ -1561,18 +1561,114 ... |
6655a1b2633ccf55c8511a37a242560f53b15299 | Implement Deathlord and Wailing Soul | fireplace/carddata/minions/neutral/rare.py | fireplace/carddata/minions/neutral/rare.py | import random
from ...card import *
from fireplace.enums import CardType, Race
# Injured Blademaster
class CS2_181(Card):
def action(self):
self.hit(self, 4)
# Young Priestess
class EX1_004(Card):
def OWN_TURN_END(self):
other_minions = [t for t in self.controller.field if t is not self]
if other_minions:
... | Python | 0 | @@ -2105,82 +2105,402 @@
%0A%0A#
-Sludge Belcher%0Aclass FP1_012(Card):%0A%09deathrattle = summonMinion(%22FP1_012t%22
+Deathlord%0Aclass FP1_009(Card):%0A%09def deathrattle(self):%0A%09%09minions = self.controller.opponent.deck.filterByType(CardType.MINION)%0A%09%09if minions:%0A%09%09%09self.controller.opponent.sum... |
1d50124d9d4465a42beb2ca37cde390d088c8c78 | Include health monitors expected codes upper bound into HAProxy config | quantum/plugins/services/agent_loadbalancer/drivers/haproxy/cfg.py | quantum/plugins/services/agent_loadbalancer/drivers/haproxy/cfg.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 New Dream Network, LLC (DreamHost)
#
# 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/li... | Python | 0.000001 | @@ -6879,16 +6879,20 @@
int(hi)
+ + 1
))%0A
|
7f2f00edd248f231627615328c1173110053baac | use consume | dace/processinstance/tests/test_signal.py | dace/processinstance/tests/test_signal.py | import transaction
from pyramid.threadlocal import get_current_registry
from dace.interfaces import IProcessDefinition
import dace.processinstance.tests.example.process as example
from dace.processdefinition.processdef import ProcessDefinition
from dace.processdefinition.activitydef import ActivityDefinition
from dace... | Python | 0.000003 | @@ -3276,37 +3276,39 @@
proc = start_wi.
-start
+consume
()%0A a_wi.
@@ -3376,33 +3376,33 @@
time.sleep(
-3
+5
)%0A transa
@@ -3676,29 +3676,31 @@
d_wi.
-start
+consume
().start()%0A
@@ -6047,37 +6047,39 @@
proc = start_wi.
-start
+consume
()%0A b_wi.
@@ -6860,21 +6860,23 @@
... |
5cae7ae0896731d45483279c29a03e67a036321e | store the time from before the changelog was requested, not after | crate_project/apps/pypi/tasks.py | crate_project/apps/pypi/tasks.py | import collections
import datetime
import hashlib
import logging
import re
import time
import xmlrpclib
import redis
import requests
from celery.task import task
from django.conf import settings
from packages.models import Package
from pypi.processor import PyPIPackage
logger = logging.getLogger(__name__)
INDEX_U... | Python | 0 | @@ -1588,16 +1588,83 @@
500152%0A%0A
+ current = time.mktime(datetime.datetime.utcnow().timetuple())%0A%0A
pypi
@@ -4315,57 +4315,13 @@
EY,
-time.mktime(datetime.datetime.utcnow().timetuple())
+current
)%0A
|
af36bbe421b133de96d8f1eeeb5beacd01e5d467 | store the time from before the changelog was requested, not after | crate_project/apps/pypi/tasks.py | crate_project/apps/pypi/tasks.py | import collections
import datetime
import hashlib
import logging
import re
import time
import xmlrpclib
import redis
import requests
from celery.task import task
from django.conf import settings
from packages.models import Package
from pypi.processor import PyPIPackage
logger = logging.getLogger(__name__)
INDEX_U... | Python | 0 | @@ -1588,16 +1588,83 @@
500152%0A%0A
+ current = time.mktime(datetime.datetime.utcnow().timetuple())%0A%0A
pypi
@@ -4315,57 +4315,13 @@
EY,
-time.mktime(datetime.datetime.utcnow().timetuple())
+current
)%0A
|
3ca6affb630f0dea9b414f5405acae7a20f213d2 | add request apis | crawler/spiders/movies_spider.py | crawler/spiders/movies_spider.py | # -*- coding: utf-8 -*-
import scrapy
import json
from core.models import db, Movie
from crawler.spiders.subjects_spider import save_subject_detail
class MoviesSpider(scrapy.Spider):
name = 'MoviesSpider'
allowed_domains = ['douban.com']
start_urls = [
'https://frodo.douban.com/jsonp/subject_coll... | Python | 0 | @@ -344,25 +344,106 @@
ems?
-os=ios&callback=&
+start=0&count=100',%0A 'https://frodo.douban.com/jsonp/subject_collection/movie_latest/items?
star
@@ -456,9 +456,10 @@
unt=
-3
+10
0',%0A
|
2be8bef16d7da5701a70ca23a854f5d0bbe416d5 | Update learner record MFE port for local/devstack development | credentials/settings/devstack.py | credentials/settings/devstack.py | from credentials.settings._debug_toolbar import *
from credentials.settings.base import *
from credentials.settings.utils import get_logger_config, str2bool
DEBUG = str2bool(os.environ.get("DEBUG", True))
ALLOWED_HOSTS = ["*"]
LOGGING = get_logger_config(debug=True, dev_env=True, local_loglevel="DEBUG")
del LOGGING[... | Python | 0 | @@ -2929,19 +2929,19 @@
calhost:
-808
+199
0%22,)%0A%0ASO
@@ -4093,11 +4093,11 @@
ost:
-808
+199
0/%22%0A
|
3387dc727255647b8e38f3363807052abcceee61 | put leaderboards vars to env vars | cron-scripts/get_weekly_stats.py | cron-scripts/get_weekly_stats.py | import asyncio
import aiohttp
import json
import urllib.request
import urllib.parse
import datetime
import pymongo
CONFIG = json.load(open("config.json"))
# For GUI-less OS uncomment the line below
# dryscrape.start_xvfb()
# Countries selection
COUNTRIES = ("gr", "cy")
# number of top players/teams
TOP_PLAYERS = 5
... | Python | 0 | @@ -108,16 +108,27 @@
pymongo%0A
+import os%0A%0A
%0ACONFIG
@@ -339,16 +339,125 @@
MS = 3%0A%0A
+LEADERBOARDS = os.environ.get('LEADERBOARDS')%0ASPECIFIC_LEADERBOARD = os.environ.get('SPECIFIC_LEADERBOARD')%0A%0A
%0Adef req
@@ -834,30 +834,20 @@
est(
-CONFIG%5B'leaderboards'%5D
+LEADERBOARDS
, pa
@@ -1866,38 +18... |
ac7090293c4686b071ca314c37304b2eeddec766 | Fix isort problems | pretix_cartshare/migrations/0002_auto_20161008_1047.py | pretix_cartshare/migrations/0002_auto_20161008_1047.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-08 10:47
from __future__ import unicode_literals
from django.db import migrations, models
import pretix_cartshare.models
class Migration(migrations.Migration):
dependencies = [
('pretix_cartshare', '0001_initial'),
]
operations = [... | Python | 0.000002 | @@ -107,16 +107,47 @@
terals%0A%0A
+import pretix_cartshare.models%0A
from dja
@@ -183,39 +183,8 @@
els%0A
-import pretix_cartshare.models%0A
%0A%0Acl
|
bbb9ecacd59186f07f0120d154e625fabd5a87af | Set name on vpc | touchdown/aws/vpc/vpc.py | touchdown/aws/vpc/vpc.py | # Copyright 2014 Isotoma Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | Python | 0.000001 | @@ -1745,31 +1745,94 @@
%22)%0A%0A
-%22%22%22%0Aclass UpdateVPCName
+ # FIXME: Create and invoke CreateTags to set the name here.%0A%0A%0Aclass CreateTags
(Act
@@ -1861,30 +1861,28 @@
= %22
-Change zone comment to
+Set tags on resource
'%25(
@@ -1925,23 +1925,31 @@
policy,
-zone_id
+resources, tags
):%0... |
7c7d517a7b749d43968ee491b181b437df2f923b | remove startswith filter | custom/enikshay/nikshay_datamigration/management/commands/create_enikshay_cases.py | custom/enikshay/nikshay_datamigration/management/commands/create_enikshay_cases.py | import logging
from django.core.management import BaseCommand
import mock
from casexml.apps.case.mock import CaseFactory
from casexml.apps.phone.cleanliness import set_cleanliness_flags_for_domain
from custom.enikshay.nikshay_datamigration.factory import EnikshayCaseFactory, get_nikshay_codes_to_location
from custom.... | Python | 0.000001 | @@ -1419,152 +1419,8 @@
)
-%0A parser.add_argument(%0A '--startswith',%0A dest='startswith',%0A default='',%0A type=str,%0A )
%0A%0A
@@ -1546,80 +1546,8 @@
cts.
-filter(%0A PregId__startswith=options%5B'startswith'%5D,%0A ).
orde
|
1b7289dd8b72cb67fe5c369e99b60e5cd0e85958 | Fix neovim support | ftplugin/markdown/follow_markdown_links.py | ftplugin/markdown/follow_markdown_links.py | import re
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from vim import *
DEFAULT_EXTENSION = 'md'
MAX_LINE_LEN = 1024
def _extract_link_under_cursor():
_, col = current.window.cursor
line = current.line
# skip long lines to stop hogging CPU in vim
... | Python | 0 | @@ -1,12 +1,22 @@
+import os%0A
import re%0Atr
@@ -13,16 +13,16 @@
port re%0A
-
try:%0A
@@ -115,25 +115,18 @@
se%0A%0A
-from vim
import
-*
+vim
%0A%0ADE
@@ -216,16 +216,20 @@
, col =
+vim.
current.
@@ -253,16 +253,20 @@
line =
+vim.
current.
@@ -765,16 +765,20 @@
dirname(
+vim.
current.
@@ -1604,32 ... |
44532322f4a183bd535de22374d149a6e2f8176a | Fix pep8 errors | RandoAmisSecours/views/reporting.py | RandoAmisSecours/views/reporting.py | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2014 Rémi Duraffort
# This file is part of RandoAmisSecours.
#
# RandoAmisSecours 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... | Python | 0.000217 | @@ -1453,32 +1453,33 @@
text(request))%0A%0A
+%0A
@staff_member_re
@@ -1653,16 +1653,17 @@
uest))%0A%0A
+%0A
@staff_m
|
6f6e57fe3e8251454b5ee2e349199424dc60a118 | Add thumbnail treklist | geotrek/api/mobile/serializers/trekking.py | geotrek/api/mobile/serializers/trekking.py | from __future__ import unicode_literals
from django.conf import settings
from rest_framework import serializers
from rest_framework_gis import serializers as geo_serializers
from geotrek.common import models as common_models
from geotrek.zoning.models import City
class AttachmentSerializer(serializers.ModelSerializ... | Python | 0 | @@ -1581,32 +1581,126 @@
d_transformed')%0A
+ thumbnail = serializers.SerializerMethodField(source='serializable_thumbnail_mobile')%0A
length =
@@ -3116,16 +3116,224 @@
formed%0A%0A
+ def get_thumbnail(self, obj):%0A if obj.serializable_thumbnail_mobile:%0A return '/%7... |
b5b5542af86f2b8fd7e6613d6f5e21961cae17e8 | Remove useless type | geotrek/signage/migrations/0001_initial.py | geotrek/signage/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2019-01-10 15:26
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import geotrek.authent.models
def deplace_data(apps, schema_editor):
# We can't import Infrastructure models directly as it m... | Python | 0.000133 | @@ -707,16 +707,22 @@
objects.
+all().
filter(t
@@ -733,38 +733,8 @@
'S')
-:%0A values = signagetype
.val
@@ -738,16 +738,17 @@
values()
+:
%0A
@@ -752,22 +752,27 @@
del
-values
+signagetype
%5B'type'%5D
@@ -813,15 +813,95 @@
e(**
-values)
+signagetype)%0A%0A for signagetypedelete in Infr... |
b8e7b9d9316e84fec4c8524eab6839e82b8534c1 | Fix typo in add_subset | glue_vispy_viewers/volume/volume_viewer.py | glue_vispy_viewers/volume/volume_viewer.py | from ..common.vispy_data_viewer import BaseVispyViewer
from .layer_artist import VolumeLayerArtist
from .layer_style_widget import VolumeLayerStyleWidget
class VispyVolumeViewer(BaseVispyViewer):
LABEL = "3D Volume Rendering"
_layer_style_widget_cls = VolumeLayerStyleWidget
def add_data(self, data):
... | Python | 0.000093 | @@ -868,24 +868,16 @@
rArtist(
-message.
subset,
|
dcffc99e64fa6f90b39dfa8bcb79e441e728831e | Updated the max length of a log message to be 1024 characters | google/cloud/forseti/common/util/logger.py | google/cloud/forseti/common/util/logger.py | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | Python | 0.999991 | @@ -852,24 +852,29 @@
: %25(message)
+.1024
s')%0ASYSLOG_L
@@ -972,16 +972,21 @@
message)
+.1024
s')%0ALOGG
|
7f687f75eff291f0acb0038e9552b84a367d17c3 | teste merge | Shigemura_Python_NeuralNetwork_1.py | Shigemura_Python_NeuralNetwork_1.py | """
network.py - Changed at MASTER branch
~~~~~~~~~~
A module to implement the stochastic gradient descent learning
algorithm for a feedforward neural network. Gradients are calculated
using backpropagation. Note that I have focused on making the code
simple, easily readable, and easily modifiable. It is not optimi... | Python | 0.000001 | @@ -1,12 +1,25 @@
%22%22%22%0A
+%3C%3C%3C%3C%3C%3C%3C HEAD%0A
network.
@@ -48,16 +48,83 @@
branch%0A
+=======%0Anetwork.py - CHANGED AT SHIGEMURA BRANCH%0A%3E%3E%3E%3E%3E%3E%3E Shigemura%0A
~~~~~~~~
|
a61e2a461176801a3089e1db341e5e80f4b08659 | Remove debug code | UM/Qt/Bindings/PointingRectangle.py | UM/Qt/Bindings/PointingRectangle.py | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import pyqtSlot, pyqtProperty, pyqtSignal, PYQT_VERSION
from PyQt5.QtCore import QPoint
from PyQt5.QtGui import QColor
from PyQt5.QtQuick import QQuickItem, QSGGeometryNode, QSGGeometry, QSGFlatColorMat... | Python | 0.000299 | @@ -2596,36 +2596,8 @@
())%0A
- print(target_offset)
%0A
|
91bb5bb09d84bc6db8c99a19e2c878a22d599c76 | Revert 189061 "[chromedriver] Update the devtools socket names f..." | chrome/test/chromedriver/chrome/adb_commands.py | chrome/test/chromedriver/chrome/adb_commands.py | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""A wrapper around adb commands called by chromedriver.
Preconditions:
- A single device is attached.
- adb is in PATH.
This... | Python | 0.000002 | @@ -544,16 +544,76 @@
cket'%5D)%0A
+CHROME_INFO = PackageInfo('Main', 'chrome_devtools_remote')%0A
PACKAGE_
@@ -807,309 +807,130 @@
me':
-%0A PackageInfo('Main', 'chromium_devtools_remote'),%0A 'com.chrome.dev':%0A PackageInfo('Main', 'chrome_dev_devtools_remote'),%0A 'com.chrome.beta':%0A ... |
872e008b3986b18a7c01cd47e91a7ef39e21006b | Remove unused parameter in test (#5423) | cirq-core/cirq/contrib/paulistring/pauli_string_dag_test.py | cirq-core/cirq/contrib/paulistring/pauli_string_dag_test.py | # Copyright 2018 The Cirq Developers
#
# 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 ... | Python | 0 | @@ -582,23 +582,8 @@
e.%0A%0A
-import pytest%0A%0A
impo
@@ -590,16 +590,16 @@
rt cirq%0A
+
%0Afrom ci
@@ -694,57 +694,8 @@
t%0A%0A%0A
-@pytest.mark.parametrize('repetition', range(6))%0A
def
@@ -733,18 +733,8 @@
uit(
-repetition
):%0A
|
6044f11916a909f46291653560a5aa2088ee3189 | remove the wrong conversion of the ObjectID to an integer | coherence/upnp/services/servers/content_directory_server.py | coherence/upnp/services/servers/content_directory_server.py | # Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2005, Tim Potter <tpot@samba.org>
# Copyright 2006 John-Mark Gurney <gurney_j@resnet.uoregon.edu>
# Copyright 2006, Frank Scholz <coherence@beebits.net>
# Content Directory service
from twisted.python import failure
from tw... | Python | 0.999905 | @@ -3306,20 +3306,16 @@
ot_id =
-int(
Containe
@@ -3317,17 +3317,16 @@
tainerID
-)
%0A
@@ -4784,20 +4784,16 @@
d =
-int(
ObjectID
)%0A%0A
@@ -4788,17 +4788,16 @@
ObjectID
-)
%0A%0A
@@ -4832,20 +4832,16 @@
_id(
-int(
root_id)
)%0A
@@ -4836,17 +4836,16 @@
root_id)
-)
%0A
|
0c69ef23d6ed2368cc416bf2d47ec0aacead9ae8 | Update test_exportchannel.py | contentcuration/contentcuration/tests/test_exportchannel.py | contentcuration/contentcuration/tests/test_exportchannel.py | import os
import pytest
import zipfile
import tempfile
from mixer.backend.django import mixer
from contentcuration import models as cc
from kolibri.content import models as k
from django.core.management import call_command
from django.conf import settings
pytestmark = pytest.mark.django_db
@pytest.fixture
def video... | Python | 0.000001 | @@ -4324,2068 +4324,4 @@
nel%0A
-%0A%0A# def test_things_work(channel, license_wtfpl):%0A# # TODO (aron): split different gets/asserts into their own tests%0A# call_command('exportchannel', channel.pk)%0A%0A# k.ChannelMetadata.objects.get(name=channel.name)%0A%0A# cc_root = channel.main_tree%0A%0A# ... |
dfe99dde7c7d783caa90bc19e792ad04b53fd960 | add doc type and update docs | corehq/apps/hqadmin/management/commands/stale_data_in_es.py | corehq/apps/hqadmin/management/commands/stale_data_in_es.py |
import inspect
from collections import namedtuple
import dateutil
from django.core.management.base import BaseCommand, CommandError
from datetime import datetime
from corehq.form_processor.models import CommCareCaseSQL
from corehq.form_processor.utils import should_use_sql_backend
from corehq.sql_db.util import get_... | Python | 0 | @@ -766,16 +766,39 @@
(doc_id,
+ doc_type, doc_subtype,
es_serv
@@ -2356,16 +2356,29 @@
ase_id%7D,
+CommCareCase,
%7Bcase_ty
|
7917515dc5580bbd56b477435a46552d3a5353af | drop other pattern ops indexes | corehq/warehouse/migrations/0033_form_fact_user_id_index.py | corehq/warehouse/migrations/0033_form_fact_user_id_index.py | from django.db import migrations, models
FORM_STAGING_USER_INDEX_NAME = 'warehouse_f_user_id_785d18_idx'
COLUMNS = ['user_id']
CREATE_INDEX_SQL = "CREATE INDEX CONCURRENTLY IF NOT EXISTS {} ON {} ({})"
DROP_INDEX_SQL = "DROP INDEX CONCURRENTLY IF EXISTS {}"
class Migration(migrations.Migration):
atomic = False... | Python | 0 | @@ -1944,32 +1944,1491 @@
ons.RunSQL.noop%0A
+ ),%0A migrations.RunSQL(%0A DROP_INDEX_SQL.format('warehouse_domaindim_domain_id_b1c3504b_like'),%0A migrations.RunSQL.noop%0A ),%0A migrations.RunSQL(%0A DROP_INDEX_SQL.format('warehouse_groupdim_group_id_b5f6f... |
d7a665a3947e04c4689db67f35827db2cc3a6842 | Update randrect.pyde | sketches/randrect/randrect.pyde | sketches/randrect/randrect.pyde | from random import randint, choice
a = 220
colors = [color(155, 46, 105, a), color(217, 55, 80, a), color(226, 114, 79, a),
color(243, 220, 123, a), color(78, 147, 151, a)]
def setup():
size(940, 300)
rectMode(CENTER)
strokeWeight(2)
# noStroke()
background(255)
def draw():
for _ in... | Python | 0.000001 | @@ -204,14 +204,14 @@
ize(
-940, 3
+600, 6
00)%0A
@@ -248,17 +248,17 @@
eWeight(
-2
+5
)%0A #
|
06d281160d5ce60f9c8dea5c75d8234e70f63642 | Fix loading script to actually save options for answers. | estudios_socioeconomicos/load.py | estudios_socioeconomicos/load.py | import pickle
from estudios_socioeconomicos.models import Seccion, Subseccion, Pregunta, OpcionRespuesta
def parse(name):
""" utility script to parse the study.
"""
preguntas = {}
while True:
seccion = input('Ingrese el nombre de la seccion: ')
if seccion == 'n':
break
... | Python | 0 | @@ -2005,24 +2005,31 @@
ion.objects.
+get_or_
create(nombr
@@ -2052,16 +2052,19 @@
ms%5Bsec%5D)
+%5B0%5D
%0A
@@ -2148,32 +2148,39 @@
seccion.objects.
+get_or_
create(%0A
@@ -2305,16 +2305,19 @@
umero=i)
+%5B0%5D
%0A
@@ -2387,32 +2387,39 @@
regunta.objects.
+get_or_
create(%0A
@@ ... |
4ff146a7e81fe4b065a551e29f42ef9b2a973823 | document title edit | servee_document/views.py | servee_document/views.py | import json
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from django.contrib.auth.decorators import login_required
from .models import Document
@csrf_exempt
@require_POST
@login_required
def upload_documents(request)... | Python | 0.000003 | @@ -711,20 +711,12 @@
obj.
-document.nam
+titl
e%7D%0A
|
4aad6aa1b50f8b0c86c49867bc75081b03b03086 | remove unused import | repository/shimclient.py | repository/shimclient.py | #
# Copyright (c) 2005 rpath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/licen... | Python | 0.000001 | @@ -585,24 +585,8 @@
ient
-%0Aimport netrepos
%0A%0Acl
|
c36282a41c248ad3d2405a0461195c679ef5327c | disable socket timeout, set heartbeat to 10 from 30 | hiispider/amqp/amqp.py | hiispider/amqp/amqp.py | import specs
from twisted.internet.protocol import ClientCreator
from twisted.internet import reactor
from txamqp.client import TwistedDelegate
from txamqp.protocol import AMQClient
import txamqp.spec
def createClient(amqp_host, amqp_vhost, amqp_port=5672):
amqp_spec = txamqp.spec.loadString(specs.v0_8)
amqp_d... | Python | 0.000001 | @@ -195,16 +195,17 @@
p.spec%0A%0A
+%0A
def crea
@@ -377,17 +377,16 @@
reactor,
-
%0A
@@ -396,17 +396,16 @@
QClient,
-
%0A
@@ -501,9 +501,9 @@
eat=
-3
+1
0).c
@@ -532,16 +532,27 @@
mqp_port
+, timeout=0
)%0A re
@@ -558,12 +558,13 @@
eturn client
+%0A
|
4ef2c3988616736800b4e4470b598449b06790cd | Refactor some score calculation to make using the competition scorer easier | svm.py | svm.py | import numpy as np
from sklearn import svm, preprocessing
from feature_generation import FeatureGenerator
from FeatureData import FeatureData
class SVMModel(object):
def __init__(self):
self._stance_map = {'unrelated': 0, 'discuss': 2, 'agree': 3, 'disagree': 4}
self._use_features= [
# ... | Python | 0.000015 | @@ -1661,222 +1661,24 @@
-print str(self._use_features)%0A print %22Precision %25f%22 %25 self.precision(y_test, predicted)%0A print %22Recal %25f%22 %25 self.recal(y_test, predicted)%0A print %22Accuracy %25f%22 %25 self.accuracy(y_test, predicted)
+return predicted
%0A%0A
@@ -3029,24 +30... |
f2acfb8b25c5df8cdfe278ee2df26ec4b3673334 | remove redundant conditional branches | tap.py | tap.py | import random
import socket
import string
import struct
from mc_bin_client import mc_bin_client, memcacheConstants as Constants
class Batch(object):
def __init__(self, source):
self.source = source
self.msgs = []
self.bytes = 0
self.adjust_size = 0
def append(self, msg, num_... | Python | 0.030329 | @@ -1332,16 +1332,17 @@
p_conn)%0A
+%0A
@@ -1459,17 +1459,16 @@
if
-(
cmd == C
@@ -1496,68 +1496,8 @@
TION
- or%0A cmd == Constants.CMD_TAP_DELETE)
:%0A
@@ -1721,440 +1721,70 @@
- if cmd == Constants.CMD_TAP_DELETE:%0A batch.adjust_size += 1%... |
1198d398fc8051142c700991c1360750b0857dc4 | Update mp3test.py | home/Markus/mp3test.py | home/Markus/mp3test.py | # this is a test script
# i have a folder with the mp3 files named from music1 to music8.
# it random choses the files . no problem
# but i want to change the sleep(120) so the next starts when the previous is finished
from java.lang import String
from org.myrobotlab.service import Speech
from org.myrobotlab.servi... | Python | 0.000001 | @@ -21,206 +21,8 @@
ript
-%0A# i have a folder with the mp3 files named from music1 to music8.%0A# it random choses the files . no problem%0A# but i want to change the sleep(120) so the next starts when the previous is finished
%0A%0Afr
|
53b346ff3d816cc2e637dd19003ff06505023929 | Test InvalidUCRData more explicitly | corehq/apps/userreports/tests/test_save_errors.py | corehq/apps/userreports/tests/test_save_errors.py | from __future__ import absolute_import
from __future__ import unicode_literals
import uuid
from alembic.operations import Operations
from alembic.runtime.migration import MigrationContext
from django.test import TestCase, override_settings
from corehq.apps.userreports.app_manager.helpers import clean_table_name
from ... | Python | 0 | @@ -2820,16 +2820,64 @@
ave(doc)
+%0A%0A invalid = InvalidUCRData.objects.all()
%0A
@@ -2898,41 +2898,149 @@
ual(
-I
+len(i
nvalid
-UCRData.objects.count(), 1
+), 1)%0A self.assertEqual(invalid%5B0%5D.validation_name, 'not_null_violation')%0A self.assertEqual(invalid%5B0%5D.doc_id, '123'... |
7388de0439913a8a33ac47a3cec14546e2860737 | Add code example with loggable quantities in _CustomAction | hoomd/custom_action.py | hoomd/custom_action.py | from abc import ABC, abstractmethod
from hoomd.parameterdicts import ParameterDict
from hoomd.operation import _HOOMDGetSetAttrBase
class _CustomAction(ABC):
"""Base class for all Python ``Action``s.
This class must be the parent class for all Python ``Action``s. This class
requires all subclasses to imp... | Python | 0 | @@ -1561,16 +1561,583 @@
values.
+%0A%0A .. code-block:: python%0A%0A from hoomd.python_action import _CustomAction%0A from hoomd.logger import LoggerQuantity%0A%0A%0A class ExampleActionWithFlag(_CustomAction):%0A def __init__(self):%0A self.log_quantities = %7B%0A ... |
3ef08fc11a512070e02586d7981c0c539eabff13 | fix wrong parameter name | host/scan_threshold.py | host/scan_threshold.py | from scan.scan import ScanBase
from daq.readout import open_raw_data_file
from analysis.analyze_raw_data import AnalyzeRawData
import logging
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - [%(levelname)-8s] (%(threadName)-10s) %(message)s")
class ThresholdScan(ScanBase):
def ... | Python | 0.000003 | @@ -735,16 +735,17 @@
er_value
+s
=None):%0D
@@ -737,32 +737,32 @@
_values=None):%0D%0A
-
'''Scan
@@ -1033,16 +1033,17 @@
er_value
+s
: list,
@@ -1192,16 +1192,17 @@
er_value
+s
is None
@@ -1283,24 +1283,24 @@
else:%0D%0A
-
@@ -1350,16 +1350,17 @@
er_value
+s
)%0D%0A%0D%0A
|
94ecbdc67dd72c671862aea29fd5525ea92650d8 | Update model.py | hurricane/model.py | hurricane/model.py | Python | 0.000001 | @@ -1 +1,1805 @@
%0A
+import sys%0Aimport os%0Aimport urllib2%0Aimport datetime%0Aimport time%0Aimport psycopg2%0Aimport pandas%0Afrom subprocess import call, Popen%0A%0A# pull the 6 hr forecast track forecast from NHC %0A#os.system(%22wget http://www.srh.noaa.gov/ridge2/Precip/qpehourlyshape/latest/last_1_hours.tar.... | |
c78cb26ff07712027b3ae340d6209482e8708641 | implement single-length tuple | vlermv/transformers/raw.py | vlermv/transformers/raw.py | import posixpath
error_msg = '''The index must be a string.'''
def to_path(key):
return tuple(key.strip('/').split('/'))
def from_path(path):
return posixpath.join(*path)
| Python | 0.999999 | @@ -84,46 +84,264 @@
-return tuple(key.strip('/').split('/')
+if isinstance(key, tuple) and len(key) == 1:%0A key = key%5B0%5D%0A%0A if hasattr(key, 'strip') and hasattr(key, 'split'):%0A return tuple(key.strip('/').split('/'))%0A else:%0A raise TypeError('Key must be string-like or a t... |
8cc4816556d43fde3f51b75d985fbf2e15299302 | Add version and a help text | subvenv/core.py | subvenv/core.py | #!/usr/bin/env python
# coding=utf-8
import json
import logging
import os
import sys
import click
from collections import namedtuple
log = logging.getLogger(__name__)
HELP_COMMANDS = dict(help_option_names=['-h', '--help'])
class VirtualenvError(Exception):
pass
def get_virtualenv():
path = os.getenv... | Python | 0.000001 | @@ -31,16 +31,32 @@
=utf-8%0A%0A
+import argparse%0A
import j
@@ -3267,16 +3267,731 @@
eter)%0A%0A%0A
+def main():%0A description = (%0A 'Subvenv is a tool for creating virtualenv-friendly Sublime Text '%0A 'project files.%5CnIt can be used as a standalone or as a plugin for '%0A 'Virtualenw... |
edb6a027aae1656d07112c0dcb455d6891a44992 | split around nan test is passing | test_data_processor.py | test_data_processor.py | import DataProcessor as dp
import numpy as np
def test_unsize_vector():
n = 3
a = np.ones(n)
b = np.append(a, np.array([np.nan, np.nan]))
c = dp.unsize_vector(a, n)
assert (a == c).all()
def test_time_vector():
numSamples = 100
sampleRate = 50
time = dp.time_vector(numSamples, sampleRa... | Python | 0.000296 | @@ -700,94 +700,255 @@
ert
-indices%5B0%5D == (1, 5)%0A assert indices%5B1%5D == (6, 20)%0A assert indices%5B2%5D == (21, 24
+len(indices) == 7%0A assert indices%5B0%5D == (0, 1)%0A assert indices%5B1%5D == (1, 5)%0A assert indices%5B2%5D == (5, 6)%0A assert indices%5B3%5D == (6, 20)%0A assert in... |
e5c3ece6ebad2b7ab524e074fd982e7fc11497b1 | set better filter | watcher/tweakerswatcher.py | watcher/tweakerswatcher.py | import requests
import json
import os.path
from watcher.watcher import Watcher
class TweakersWatcher(Watcher):
watcher_name = 'Tweakers Pricewatch'
filename = 'site_tweakers.txt'
def parse_site(self):
url = 'https://tweakers.net/xmlhttp/xmlHttp.php?application=tweakbase&type=filter&action=deals&f... | Python | 0.000002 | @@ -316,147 +316,200 @@
als&
-fromHash=1&currFilters=q1ZKSaz0T0srTi1RsjLUUcpNrAhKzUksySxLDSjKTE51KcovgEhk5jkmFefnlJYgSxgZgGWcS4uKUvNKwBJKVhAxMKcYpheLoQZ6ZmCpsMzUcqA6g1oA
+dayOffset=1&minRelativePriceDrop=0.4&maxRelativePriceDrop=1&minAbsolutePriceDrop=30&maxAbsolutePriceDrop=&minCurrentPrice=0&maxCurrentPrice=&minPric... |
6f641efb983c88427b0ec7955792a48ecbc0e0ea | add checking to avoiding update status issue of event_cases | web/controller/strategy.py | web/controller/strategy.py | # -*- coding:utf-8 -*-
__author__ = 'Ulric Qin'
from web import app
from flask import request, jsonify
from web.model.strategy import Strategy
from frame import config
from fe_api import post2FeUpdateEventCase
import logging
log = logging.getLogger(__name__)
@app.route('/strategy/update', methods=['POST'])
def strateg... | Python | 0 | @@ -1251,16 +1251,343 @@
rt=22')%0A
+ st = Strategy.get(sid)%0A need_reset = False%0A if st.func != func or st.right_value != right_value or st.op != op:%0A need_reset = True%0A elif st.metric != metric or st.tags != tags:%0A log.info(%22g 2%22)%0A need_reset = True%0A log.debug(%22... |
2790a7c5f7f90eaafa543651a6cf273c9f40e6e1 | tidy engine | team1/engine.py | team1/engine.py | #! /usr/bin/env python
import os
import sys
import json
import difflib
#{ 'document': ['terms', 'terms'],
# 'document2': ['1','2','3'],
#}
def simple_search_engine(index, query):
return [doc_name for doc_name, terms in index.iteritems() if query in terms]
def weighted_search_engine(index, query):
results = {... | Python | 0.000001 | @@ -1405,56 +1405,45 @@
-return %5Bresult%0A for result, score in%0A
+sorted_pairs = sorted(%0A
@@ -1452,17 +1452,8 @@
- sorted(
resu
@@ -1468,16 +1468,40 @@
items(),
+%0A
key=lam
@@ -1527,17 +1527,17 @@
score%5B1%5D
-)
+,
%0A
@@ -1537,24 +... |
c0566ab5f4dabdf0c366d6b6a32cbd8ca3fb4a75 | use idle_add callback for animation | test/animate.py | test/animate.py | import matplotlib
matplotlib.use('GTKAgg')
import pygrib
import matplotlib.pyplot as plt
import numpy as np
import time
from mpl_toolkits.basemap import Basemap
# animation example.
grbs = pygrib.open('../sampledata/safrica.grib2')
# grab all "brightness temp" grib messages.
btemps = [grb for grb in grbs if grb['name... | Python | 0.000006 | @@ -49,16 +49,31 @@
t pygrib
+, time ,gobject
%0Aimport
@@ -120,20 +120,8 @@
np%0A
-import time%0A
from
@@ -412,20 +412,8 @@
se()
-%0Aprint projd
%0A%0A#
@@ -743,44 +743,8 @@
i')%0A
-plt.ion() # set interactive mode on%0A
plt.
@@ -1038,16 +1038,22 @@
0,0,1%5D)%0A
+txt =
plt.titl
@@ -1074,125 +1074,278 @@
... |
65f5695b90054f73d7119f0c50be51f61de777fa | Print the time of checking status at github. | tardis/tests/tests_slow/runner.py | tardis/tests/tests_slow/runner.py | import argparse
import json
import os
import time
import requests
from tardis import __githash__ as tardis_githash
parser = argparse.ArgumentParser(description="Run slow integration tests")
parser.add_argument("--yaml", dest="yaml_filepath",
help="Path to YAML config file for integration tests.")... | Python | 0.000022 | @@ -9,16 +9,32 @@
rgparse%0A
+import datetime%0A
import j
@@ -1189,16 +1189,210 @@
else:%0A
+ checked = datetime.datetime.now()%0A print %22Up-to-date. Checked on %7B0%7D %7B1%7D%22.format(%0A checked.strftime(%22%25d-%25b-%25Y%22), checked.strftime(%22%25H:%25M:%25S%22)%0A ... |
33956d6a31f3c019758a397688d6a29cd8fe9a45 | Use profile likelihood when appropriate | 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
from Network import Network
from Models import StationaryLogistic, NonstationaryLogistic
from Models import FixedMargins, alpha_norm
from ... | Python | 0 | @@ -1537,42 +1537,64 @@
_nll
-):%0A # Evaluate likelihoods on a
+, profile = False, pre_offset = False):%0A # Initialize
gri
@@ -1844,16 +1844,146 @@
y((G,G))
+%0A%0A if pre_offset:%0A net.offset_extremes()%0A else:%0A net.initialize_offset()%0A%0A # Evaluate likelihoods on a grid
%0A ... |
3bc6ab85f4fc2e3dba0e7c9d16a28fa370558021 | remove useless comment | tests/images.py | tests/images.py | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | Python | 0 | @@ -2931,67 +2931,4 @@
ds)%0A
-%0A # def test_2(self):%0A # article = self.getArticle()%0A
|
08a65747d608fcc530adf6291a95104d4348eae6 | apply RatingTargetMixin to test model | tests/models.py | tests/models.py | from __future__ import unicode_literals
from django.db import models
class TextSnippet(models.Model):
text = models.TextField()
user = models.ForeignKey('auth.User')
| Python | 0 | @@ -67,27 +67,106 @@
ls%0A%0A
-%0Aclass TextSnippet(
+from generic_ratings.model_mixins import RatingTargetMixin%0A%0A%0Aclass TextSnippet(RatingTargetMixin,
mode
|
bff7989e5ce0f5cde4176ee0652578100201c90b | Update about.py | tincan/about.py | tincan/about.py | # Copyright 2014 Rustici Software
#
# 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 agr... | Python | 0 | @@ -1506,17 +1506,8 @@
ist%0A
- %0A
@@ -3513,17 +3513,16 @@
nsions%60%0A
-%0A
|
5935a9f0ec35774f95b32465134d88d3e087fd1b | Use newer sphinx if available. | tools/sphinx.py | tools/sphinx.py | # Simple Sphinx tool and builder.
import os
from SCons.Script import *
# Build sphinx documentation:
def _action_sphinx(target, source, env):
sourcedir = os.path.dirname(source[0].path)
outdir = os.path.dirname(target[0].path)
app = "%s %s %s %s" % (env['SPHINX_BUILD'], env['SPHINX_OPTS'],
... | Python | 0 | @@ -1695,16 +1695,149 @@
tall%7D)%0A%0A
+ if os.path.exists('/usr/bin/sphinx-1.0-build'):%0A env.AppendUnique(SPHINX_BUILD='/usr/bin/sphinx-1.0-build')%0A else:%0A
env.
|
19c59d3d80b2cf64880d428d0e762d4e262385a5 | Handle stale PostgreSQL (or others) more gracefully. Closes #3394. Thanks to flfr at stibo.com for the patch. | trac/db/pool.py | trac/db/pool.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgew... | Python | 0.000001 | @@ -2266,37 +2266,217 @@
-break
+try:%0A cnx.cursor() # check whether the connection is stale%0A break%0A except Exception:%0A cnx.close()
%0A
|
f0cd7923a82cd06d15f486db608a5dbc1fb15b1f | rewrite timer logic | traderthread.py | traderthread.py | import sys
import decimal
from decimal import Decimal
import PyQt4
from PyQt4 import QtCore
from PyQt4.QtCore import pyqtSlot
from PyQt4.QtCore import pyqtSignal
class Tops(object):
ask1 = Decimal('0')
ask1_amount = Decimal('0')
bid1 = Decimal('0')
bid1_amount = Decimal('0')
ask2 = Decimal('0')
ask2_amount... | Python | 0 | @@ -1103,9 +1103,9 @@
val=
-9
+1
00,
@@ -1396,17 +1396,20 @@
gleShot(
-0
+True
)%0A se
@@ -1483,17 +1483,20 @@
gleShot(
-1
+True
)%0A se
@@ -2059,16 +2059,44 @@
a1, a2)
+%0A %0A self.timer.start()
%0A%0A def
|
0f02210e4f57f0023a2be6b11059bc5754f4d467 | Update version.py | ttim/version.py | ttim/version.py | __version__='0.4.0'
#__build__='4.0.0.0'
| Python | 0 | @@ -10,17 +10,17 @@
__='0.4.
-0
+1
'%0A#__bui
|
91a25c6933015dc09fdf63c6bca75dfaf6115c47 | fix test | backend/src/tests/backend/plugins/misc/test_filter_validators.py | backend/src/tests/backend/plugins/misc/test_filter_validators.py | # This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import unittest
from gosa.backend.plugins.misc.filter_validators import *
class FilterValidatorTest... | Python | 0.000002 | @@ -1060,32 +1060,33 @@
, 'test', %5B%22test
+1
%22%5D)%0A asse
@@ -1256,16 +1256,17 @@
, %5B%22test
+1
%22%5D)%0A
|
6a46f45bec528ccb342661a07db09cdd2d8ad8a2 | Correct statistics in qpe test (#328) | projectq/setups/decompositions/phaseestimation_test.py | projectq/setups/decompositions/phaseestimation_test.py | # Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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 app... | Python | 0 | @@ -4267,33 +4267,33 @@
hase/100. %3E= 0.3
-5
+4
, %22Statistics ph
@@ -4351,33 +4351,33 @@
_phase/100., 0.3
-5
+4
)%0A%0A%0Adef test_X_n
|
1df785d6f337fa2dc9e42c808fab79a5a2827258 | remove line to run tests | hs_modflow_modelinstance/tests/__init__.py | hs_modflow_modelinstance/tests/__init__.py | from test_modflow_modelinstance_metadata import * | Python | 0.000002 | @@ -1,49 +1 @@
-from test_modflow_modelinstance_metadata import *
+%0A
|
40a98808da485edeaa87bb30f0e0749401c500da | update documentation configuration | _doc/sphinxdoc/source/conf3/conf.py | _doc/sphinxdoc/source/conf3/conf.py | import sys
import os
import datetime
import re
import sphinx_bootstrap_theme
source_path = os.path.normpath(
os.path.join(
os.path.abspath(
os.path.split(__file__)[0]),
".."))
try:
from conf_base import *
except ImportError:
sys.path.append(source_path)
from conf_base impo... | Python | 0.000001 | @@ -1254,19 +1254,22 @@
tion': %22
-nav
+footer
%22,%0A
|
00990ff3905b70c4833053dbea6505998c3d9685 | Simplify import clauses | modules/thm/python/peacock/ModelBuilder/FlowChannelParametersCalculator.py | modules/thm/python/peacock/ModelBuilder/FlowChannelParametersCalculator.py | import os, sys
from PyQt5 import QtCore, QtWidgets, QtGui
from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot, QProcess
from PyQt5.QtWidgets import QSizePolicy, QLabel
from PyQt5.QtGui import QDoubleValidator
import peacock
import FlowChannelGeometries
class FlowChannelParametersCalculator(QtWidgets.QWidget, peacock.ba... | Python | 0.000003 | @@ -55,157 +55,8 @@
Gui%0A
-from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot, QProcess%0Afrom PyQt5.QtWidgets import QSizePolicy, QLabel%0Afrom PyQt5.QtGui import QDoubleValidator%0A
impo
@@ -395,16 +395,26 @@
ePolicy(
+QtWidgets.
QSizePol
@@ -428,16 +428,26 @@
ferred,
+QtWidgets.
QSizePol
@@ -1750,16 +1750,22 ... |
32f0270ee3049e1a624d86f7f0a68bb4ea55c5f1 | Correct IrActionsActWindow.read overloading | smile_base/models/ir_actions.py | smile_base/models/ir_actions.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Smile (<http://www.smile.fr>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | Python | 0 | @@ -1001,16 +1001,30 @@
models,
+ SUPERUSER_ID,
tools%0Af
@@ -1079,76 +1079,8 @@
eval
-%0Afrom openerp.addons.base.ir.ir_actions import ir_actions_act_window
%0A%0Afr
@@ -2112,20 +2112,12 @@
es%0A%0A
-%0A@api.multi%0A
+
def
@@ -2131,44 +2131,167 @@
lf,
-fields=None, load='_classic_read'):%0A
+cr, uid, id... |
e4942c16322829d37f780d539517fe10e50e0e39 | Fix bad var | hubblestack/extmods/grains/splunkconfig.py | hubblestack/extmods/grains/splunkconfig.py | # -*- coding: utf-8 -*-
'''
Attempt to load alternate splunk config from the hubble.d/ directory and store
in grains for use by the splunk returners. This way splunk config changes don't
require a hubble restart.
'''
import os
import yaml
def splunkconfig():
'''
Walk the hubble.d/ directory and read in any .c... | Python | 0.000618 | @@ -734,20 +734,16 @@
(root, f
-path
)%0A
|
e30304ee1cd90763f072e350aa850313e1d4a06b | version bump for pypi | gooey/__init__.py | gooey/__init__.py | import os
from gooey.python_bindings.gooey_decorator import Gooey
from gooey.python_bindings.gooey_parser import GooeyParser
# from gooey.gui import application
version_file = os.path.join(os.path.dirname(__file__), 'version')
__version__ = '0.1.9'
| Python | 0 | @@ -251,9 +251,10 @@
'0.1
-.9
+0.0
'%0D%0A
|
c9e8462dacfd511ca996cf73d7a08e1fdfeded01 | fix file permission of stom collector | intelmq/bots/collectors/stomp/collector.py | intelmq/bots/collectors/stomp/collector.py | # -*- coding: utf-8 -*-
import os.path
from intelmq.lib.bot import CollectorBot
try:
import stomp
class StompListener(stomp.listener.PrintingListener):
""" the stomp listener gets called asynchronously for
every STOMP message
"""
def __init__(self, n6stompcollector):
... | Python | 0 | |
e8e7d188b45b06967a6f7ec210f91b1bbe4e494c | use pathlib | abilian/web/admin/panels/sysinfo.py | abilian/web/admin/panels/sysinfo.py | # coding=utf-8
"""
"""
from __future__ import absolute_import, print_function, division
import os
import sys
import pkg_resources
from pip.vcs import vcs
from flask import render_template
from ..panel import AdminPanel
class SysinfoPanel(AdminPanel):
id = 'sysinfo'
label = 'System information'
icon = 'hdd'
... | Python | 0.000001 | @@ -147,16 +147,41 @@
port vcs
+%0Afrom pathlib import Path
%0A%0Afrom f
@@ -707,37 +707,17 @@
n =
-os.path.normcase(os.path.absp
+unicode(P
ath(
@@ -730,16 +730,27 @@
ocation)
+.absolute()
)%0A
@@ -787,24 +787,25 @@
e(location)%0A
+%0A
if vcs
|
d971b8c7d0261ee0774ccecf41b0484cff1dd62c | Change url config for image to see if it loads in production this way instead | source/services/imdb_service.py | source/services/imdb_service.py | import requests
import re
from bs4 import BeautifulSoup
from source.models.technical_specs import TechnicalSpecs
class ImdbService:
__URL = 'http://www.imdb.com/title/'
__API_URL = 'http://www.imdb.com/xml/find?'
__OMDB_URL = 'http://www.omdbapi.com/?'
__SEPERATOR = '-'
def __init__(self, title... | Python | 0 | @@ -1086,17 +1086,16 @@
oster'%5D%0A
-%0A
@@ -1092,28 +1092,43 @@
%5D%0A re
-turn
+sized_artwork_url =
self.format
@@ -1154,16 +1154,52 @@
k_url)%0A%0A
+ return resized_artwork_url%0A%0A
%0A def
@@ -2503,12 +2503,30 @@
, '_
-SX333
+UY460_UY0,0,333,460_AL_
')%0A
|
d2ac9fd6e1bebd85b345df09e1717b65359c54bd | Correct Torfaen opening times | polling_stations/apps/data_importers/management/commands/import_torfaen.py | polling_stations/apps/data_importers/management/commands/import_torfaen.py | from addressbase.models import Address, UprnToCouncil
from core.opening_times import OpeningTimes
from data_importers.management.commands import BaseHalaroseCsvImporter
from data_importers.mixins import AdvanceVotingMixin
from pollingstations.models import AdvanceVotingStation
class Command(BaseHalaroseCsvImporter, A... | Python | 0.000066 | @@ -1823,12 +1823,12 @@
22-0
-5-01
+4-30
%22, %22
@@ -1890,17 +1890,17 @@
022-05-0
-2
+1
%22, %2210:0
|
b195e909ce3d3903998a91de0b5763dd679b25e3 | fix version | debile/slave/runners/findbugs.py | debile/slave/runners/findbugs.py | # Copyright (c) 2012-2013 Paul Tagliamonte <paultag@debian.org>
# Copyright (c) 2013 Leo Cavaille <leo@cavaille.net>
# Copyright (c) 2013 Sylvestre Ledru <sylvestre@debian.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "So... | Python | 0.004257 | @@ -170,16 +170,82 @@
an.org%3E%0A
+# Copyright (c) 2015 Lucas Kanashiro %3Ckanashiro.duarte@gmail.com%3E%0A
#%0A# Perm
@@ -2327,14 +2327,8 @@
%0A
- name,
ver
@@ -2343,16 +2343,13 @@
ut.s
-plit(%22 %22
+trip(
)%0A
@@ -2362,12 +2362,18 @@
rn (
-name
+'findbugs'
, ve
|
4e3e8d49b06c03b1ab31357206fc6385256d8438 | Switch to official python graphviz port | graph/gengraph.py | graph/gengraph.py | #!/usr/bin/python
import sys
from graphviz import Digraph
class Gengraph(object):
def __init__(self):
pass
def getTrName(self, line):
line = line.strip(' ')
name = line.split(' ')
name.remove('tr_t')
for n in name:
if len(n) > 0:
x = n.find('... | Python | 0 | @@ -26,36 +26,17 @@
sys%0A
-from graphviz import Digraph
+import gv
%0A%0Acl
@@ -911,48 +911,82 @@
-self.dot.node(tok%5B0%5D, tok%5B0%5D
+n = gv.node(self.dot, tok%5B0%5D)%0A gv.setv(n
,
+%22
shape
-=%22box
+%22, %22Mrecord
%22)%0A
@@ -1113,48 +1113,82 @@
-self.dot.node(tok%5B1%5D, tok... |
1ce9f91ac81c11013480e5ce20bb86774a397866 | Fix bug when Cordaid fundin partner funding_amount is None | akvo/scripts/cordaid/post_import.py | akvo/scripts/cordaid/post_import.py | # -*- coding: utf-8 -*-
# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
import datetime
from lxml import etre... | Python | 0.999965 | @@ -3959,16 +3959,42 @@
needed +
+ (%0A
cordaid
@@ -4028,16 +4028,43 @@
g_amount
+ or 0%0A )
%0A
|
43125b7ea61606d6d65d0c75168539cee8cdfcd2 | support touch-tip for JSON protocols (#2000) | api/opentrons/protocols/__init__.py | api/opentrons/protocols/__init__.py | import time
from itertools import chain
from opentrons import instruments, labware, robot
from opentrons.instruments import pipette_config
def _sleep(seconds):
if not robot.is_simulating():
time.sleep(seconds)
def load_pipettes(protocol_data):
pipettes = protocol_data.get('pipettes', {})
pipette... | Python | 0 | @@ -1871,24 +1871,100 @@
ipetteId)%0A%0A%0A
+# C901 code complexity is due to long elif block, ok in this case (Ian+Ben)%0A
def dispatch
@@ -2017,24 +2017,43 @@
ed_labware):
+ # noqa: C901 E501
%0A subproc
@@ -3149,16 +3149,99 @@
ation)%0A%0A
+ elif command_type == 'touch-tip':%0A pipette.tou... |
4d157780f3f7927635b0a57399fc70a956924a0c | Add binding with filter function | gsensors/basic.py | gsensors/basic.py | #-*- coding:utf-8 -*-
import logging
from datetime import datetime
import gevent
from events import Events
from gsensors.utils import full_exc_info
class GSensorApp():
debug = False
def __init__(self):
self.sources = []
def add(self, source):
self.sources.append(source)
source.d... | Python | 0 | @@ -2266,32 +2266,64 @@
llback, value):%0A
+ if callable(value):%0A
def wrap
@@ -2326,16 +2326,24 @@
wrapper(
+source,
new_valu
@@ -2350,32 +2350,172 @@
e):%0A
+ if value(new_value):%0A callback(new_value)%0A else:%0A def wrapper(source, new_v... |
4dace020f536fdec191f322d16e8af71bc2b327c | Add Burmese | appcomposer/translator/languages.py | appcomposer/translator/languages.py | """
To contain language-related ops.
"""
from collections import OrderedDict
import babel
from babel import Locale, UnknownLocaleError
from appcomposer.babel import gettext
def obtain_groups():
"""
Obtains the groups that are available for translation, as an Ordered Dictionary.
:return: Ordered dictionar... | Python | 0.999999 | @@ -1224,143 +1224,8 @@
ndi%0A
- # The following have been selected to be interesting for Go-Lab%0A 'no', # Norwegian%0A 'id', # Indonesian%0A 'ja', # Japanese%0A
@@ -1377,16 +1377,170 @@
rn Sami%0A
+ # The following have been selected to be interesting for Go-Lab%0A 'no', # Norwegian%0A '... |
57f494f27eca25228a49bcc26f5d28a9f390ac26 | Fix premailer test | apps/sumo/tests/test_email_utils.py | apps/sumo/tests/test_email_utils.py | from mock import patch
from nose.tools import eq_
from django.conf import settings
from django.utils.translation import get_language
from django.utils.functional import lazy
from sumo.email_utils import (uselocale, safe_translation,
emails_with_users_and_watches)
from sumo.tests import T... | Python | 0 | @@ -77,16 +77,61 @@
ettings%0A
+from django.contrib.sites.models import Site%0A
from dja
@@ -4509,17 +4509,21 @@
a href=%22
-#
+/test
%22%3EHyperl
@@ -4845,68 +4845,172 @@
-self.assertIn('%3Ca href=%22#%22 style=%22color:#000%22%3EHyperlink%3C/a%3E'
+tag = ('%3Ca href=%22https://%25s/test%22 style=%22color:#0... |
2d3e2f796d6a839994c2708f31e60d52c6bf8c15 | Simplify main() | sjp.py | sjp.py | #!/usr/bin/env python3
import urllib.request # to download HTML source
import sys # to access CLI arguments and to use exit codes
from bs4 import BeautifulSoup # to parse HTML source
version = 0.01
def printUsageInfo():
helpMsg = """Usage:
sjp.py <word>
sjp.py (-h | --help | /?)
sjp.py (-v | --ve... | Python | 0.000042 | @@ -1231,17 +1231,18 @@
gv)
-%3E
+%3C=
1:%0A
@@ -1233,24 +1233,64 @@
) %3C= 1:%0A
+ printUsageInfo()%0A sys.exit()%0A
if sys.a
@@ -1299,17 +1299,17 @@
v%5B1%5D in
-%5B
+(
%22-h%22, %22-
@@ -1320,17 +1320,17 @@
p%22, %22/?%22
-%5D
+)
:%0A
@@ -1327,28 +1327,24 @@
%22):%0A ... |
a78d1bcfdc3d979cd7be1f82345c29047993953d | Add more init logic to handle AWS HTTP API | sqs.py | sqs.py | #!/usr/bin/env python
from tornado.httpclient import AsyncHTTPClient, HTTPRequest, HTTPClient
from tornado.httputil import url_concat
import datetime
import hashlib
import hmac
class SQSRequest(HTTPRequest):
"""SQS AWS Adapter for Tornado HTTP request"""
def __init__(self, *args, **kwargs):
t = datet... | Python | 0 | @@ -819,16 +819,1337 @@
west-1')
+%0A%0A amz_date = t.strftime('%25Y%25m%25dT%25H%25M%25SZ')%0A datestamp = t.strftime('%25Y%25m%25d')%0A%0A canonical_headers = 'host:' + host + '%5Cn' + 'x-amz-date:' + amz_date + '%5Cn'%0A signed_headers = 'host;x-amz-date'%0A payload_hash = hashlib... |
b751cd9cfd9286431f37525e57b713270addd69c | Version bump | iam_syncr/__init__.py | iam_syncr/__init__.py | VERSION="0.2.3"
| Python | 0.000001 | @@ -10,7 +10,7 @@
0.2.
-3
+4
%22%0A
|
2166f52ce5da81bf8f28a3dbbc92145b0913db07 | Update usage of layouts.get_layout | examples/basics/visuals/graph.py | examples/basics/visuals/graph.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
This example demonstrates how to visualise a NetworkX graph using the
GraphVisual.
"""
import sys
import networkx as nx
from vispy import app, glo... | Python | 0.000001 | @@ -264,16 +264,35 @@
rt sys%0A%0A
+import numpy as np%0A
import n
@@ -669,14 +669,32 @@
(100
+0
, 0.0
-2
+006, directed=True
)%0A%0A
@@ -735,16 +735,74 @@
Visual(%0A
+ # np.asarray(nx.to_numpy_matrix(self.graph)),%0A
@@ -868,16 +868,23 @@
outs.get
+_layout
('force_
@@ -1001,10 +1001,9 @@
... |
2a8d1fb9fca47078334a0c030b3c99d66bb5eb13 | Rename _run_mover into _run_dds_put | delivery/services/dds_service.py | delivery/services/dds_service.py | import os.path
import shutil
import logging
import re
import json
from tornado import gen
from delivery.models.db_models import StagingStatus, DeliveryStatus
from delivery.exceptions import ProjectNotFoundException, TooManyProjectsFound, InvalidStatusException
log = logging.getLogger(__name__)
class DDSService(obje... | Python | 0.999946 | @@ -790,21 +790,23 @@
ef _run_
-mover
+dds_put
(deliver
@@ -5593,21 +5593,23 @@
for_run_
-mover
+dds_put
= %7B'del
@@ -6194,21 +6194,23 @@
ce._run_
-mover
+dds_put
(**args_
@@ -6217,21 +6217,23 @@
for_run_
-mover
+dds_put
)%0A%0A
|
e43aa23b3d4b7d3319e4b2766cdb4a9b9382954b | Fix typo | django_tricks/models/abstract.py | django_tricks/models/abstract.py | from uuid import uuid4
from django.db import models
from .mixins import MPAwareModel
treebeard = True
try:
from treebeard.mp_tree import MP_Node
except ImportError:
treebeard = False
class UniqueTokenModel(models.Model):
token = models.CharField(max_length=32, unique=True, blank=True)
class Meta:... | Python | 0.999999 | @@ -379,16 +379,20 @@
return
+str(
uuid4().
@@ -394,17 +394,17 @@
d4().hex
-t
+)
%0A%0A de
|
0d0bc3b5c1dad86cd5b2d7d90925d5722f2be6e8 | Add locale fuzzer to FUZZERS_MISSING_CORPORA | test/fuzz/test_runner.py | test/fuzz/test_runner.py | #!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run fuzz test targets.
"""
import argparse
import configparser
import os
import sys
import subprocess
impor... | Python | 0.000001 | @@ -839,24 +839,38 @@
serialize%22,%0A
+ %22locale%22,%0A
%22merkle_
|
8b5f8c1baa44b11bbe8790bd4eaa7ffdd8b0990b | fix comments | telemeta/util/kdenlive/session.py | telemeta/util/kdenlive/session.py | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2013 Parisson SARL
# This software is a computer program whose purpose is to backup, analyse,
# transcode and stream any audio content with its metadata over a web frontend.
# This software is governed by the CeCILL license under French law and
# abiding by the rules of d... | Python | 0.000001 | @@ -3495,16 +3495,158 @@
utes'%5D%0A%0A
+%09def fix_text(self, text):%0A%09%09try:%0A%09%09%09s = text.split(' ')%0A%09%09%09i = int(s%5B1%5D)%0A%09%09%09s.insert(2, ':')%0A%09%09%09return ' '.join(s)%0A%09%09except:%0A%09%09%09return text%0A%0A
%09def mar
@@ -3676,16 +3676,16 @@
set=0):%0A
-
%09%09marker
@@ -4108,... |
54b720ded25f04d51e60673044b2d1320f870d4d | Fix Django importlib deprecation warnings | impersonate/helpers.py | impersonate/helpers.py | import re
from django.conf import settings
from django.utils.safestring import mark_safe
from django.utils.importlib import import_module
from django.core.paginator import Paginator, EmptyPage
try:
# Django 1.5 check
from django.contrib.auth import get_user_model
except ImportError:
from django.contrib.aut... | Python | 0.000005 | @@ -86,57 +86,8 @@
afe%0A
-from django.utils.importlib import import_module%0A
from
@@ -316,24 +316,157 @@
er_model()%0A%0A
+try:%0A from importlib import import_module # Python 2.7%0Aexcept ImportError:%0A from django.utils.importlib import import_module%0A%0A
%0Adef get_red
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.