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 |
|---|---|---|---|---|---|---|---|
7ae97b8619e78da2d818991c03b0fd9e0e330c85 | Fix python3 compat issue in propdict | src/clients/lib/python/xmmsclient/propdict.py | src/clients/lib/python/xmmsclient/propdict.py | #Py3k compat
try:
a = basestring
del a
except NameError:
basestring = str
class PropDict(dict):
def __init__(self, srcs):
dict.__init__(self)
self._sources = srcs
def set_source_preference(self, sources):
"""
Change list of source preference
This method has been depr... | Python | 0.000011 | @@ -947,18 +947,16 @@
or k
-,v
in self
.ite
@@ -955,20 +955,8 @@
self
-.iteritems()
:%0A
@@ -1059,17 +1059,41 @@
return
-v
+dict.__getitem__(self, k)
%0A
|
47b8f63d318e0007abc979884f6096221775843f | Implement near returns. | src/arch/x86/isa/insts/control_transfer/xreturn.py | src/arch/x86/isa/insts/control_transfer/xreturn.py | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the
# following conditions are met:
#
# The software must be used only for Non-Commercial Use which mean... | Python | 0 | @@ -3002,77 +3002,197 @@
e =
-%22%22%0A#let %7B
+'''%0Adef macroop RET%0A
%7B%0A
-#
-class RET(Inst):%0A# %09%22GenFault $%7Bnew UnimpInstFault%7D%22%0A#%7D%7D;
+ # Make the default data size of rets 64 bits in 64 bit mode%0A .adjust_env oszIn64Override%0A%0A ld t1, ss, %5B0, t0, rsp%5D%0A addi rsp, rs... |
f31934d9317bb9f50d75a34bba2b0b16ce545a8f | Bump version | config.py | config.py | import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
APP_VERSION = '0.4.0'
CSRF_SESSION_KEY = 'ABigSecretIsHardToFind'
DATABASE_CONNECTION_OPTIONS = {}
DEBUG = False
FACEBOOK_APP_ID= '89526572170'
GOOGLE_ANALYTICS_TRACKING_ID = os.environ.get('GOOGLE_ANALYTICS_TRACKING_ID', '')
HOST = '0.0.0.0'
PORT = 8080
... | Python | 0 | @@ -75,17 +75,17 @@
ON = '0.
-4
+5
.0'%0ACSRF
|
79c5081cf6ac0b5d8473e632c5df3ee715e1e87b | make sure attributes is a dict, even if it isn't provided | scrapi/linter/document.py | scrapi/linter/document.py | import json
import copy
import jsonschema
from scrapi import registry
from scrapi.util import json_without_bytes
def strip_empty(document, required=tuple()):
''' Removes empty fields from the processed schema
'''
new_doc = {}
for k, v in document.items():
if k in required:
new_do... | Python | 0.000007 | @@ -1466,24 +1466,62 @@
'''%0A
+ attributes = attributes or %7B%7D%0A
# va
|
8eefeb6129318d6237f1b3648e8254e7560c9bef | add implicit output support. | src/cobble/ninja_syntax.py | src/cobble/ninja_syntax.py | """Python module for generating .ninja files, derived from code provided by
the Ninja authors.
I've tightened semantics in some areas, and applied updates for Python 3.
"""
import collections
import itertools
import textwrap
import re
def _escape_path(word):
"""Used to escape paths; only escapes the characters t... | Python | 0 | @@ -3157,16 +3157,39 @@
+ implicit_outputs=None,
variabl
@@ -3525,19 +3525,19 @@
-out
+all
_outputs
@@ -3638,24 +3638,215 @@
e(inputs))%0A%0A
+ if implicit_outputs:%0A all_outputs = itertools.chain(%0A all_outputs,%0A %5B'%7C'%5D,%0A ... |
fcf3374544a04e94a7fe27f5e57bfe16bae9ce63 | Add typing annotations | notifier.py | notifier.py | #!/usr/bin/env python3
import argparse
from email.mime.text import MIMEText
from email.header import Header
import hashlib
import logging
import smtplib
import sqlite3
import time
import anyconfig
import requests
from diff import diff_strings
# Configuration
config = anyconfig.load('config.json')
from_addr ... | Python | 0.00006 | @@ -477,17 +477,29 @@
page(url
-)
+: str) -%3E str
:%0A r
@@ -555,25 +555,37 @@
te_hash(blob
-)
+: str) -%3E str
:%0A h = ha
@@ -687,15 +687,33 @@
hash
+: str
, blob
-)
+: str) -%3E bool
:%0A
@@ -765,32 +765,37 @@
d_mail(from_addr
+: str
, to_addr, subje
@@ -779,32 +779,37 @@
dr: str, to_addr
+: str
... |
f7d2b4d773636a3f858e082e011e2069a064a5e4 | Add __str__ on models | presentation/models.py | presentation/models.py | from django.db import models
from model_utils.models import TimeStampedModel
from warp.users.models import User
class Presentation(TimeStampedModel):
subject = models.CharField(max_length=50)
author = models.ForeignKey(User, on_delete=models.CASCADE)
views = models.IntegerField(default=0)
is_public =... | Python | 0.000468 | @@ -349,16 +349,68 @@
=True)%0A%0A
+ def __str__(self):%0A return self.subject%0A%0A
%0Aclass S
@@ -601,34 +601,57 @@
d()%0A
+%0A
-html = models.TextField()
+def __str__(self):%0A return self.markdown
%0A
|
8c706f4f7be18c25a1209365fa780edb76341b3a | Change make_healpixdb.py to work with eg. opsim DB | scripts/make_healpixdb.py | scripts/make_healpixdb.py | from __future__ import division
import numpy as np
import time
import sqlite3
import healpy as hp
from healpy import query_disc, query_polygon
import opsimsummary as oss
import pandas as pd
from itertools import repeat
opsim_hdf = '/Users/rbiswas/data/LSST/OpSimData/minion_1016.hdf'
OpSim_combined = pd.read_hdf(opsim_... | Python | 0.000005 | @@ -216,120 +216,452 @@
eat%0A
-%0Aopsim_hdf = '/Users/rbiswas/data/LSST/OpSimData/minion_1016.hdf'%0AOpSim_combined = pd.read_hdf(opsim_hdf, 'Table
+import os%0Afrom sqlalchemy import create_engine%0A%0ApkgDir = os.path.split(oss.__file__)%5B0%5D%0Adbname = os.path.join(pkgDir, 'example_data', 'enigma_1189_micro.db')... |
a21e234068b763dbb86113dff84f93e594d35c87 | Fix marks order in dashboard | apps/marks/dashboard/views.py | apps/marks/dashboard/views.py | # -*- encoding: utf-8 -*-
import json
import django.utils.timezone
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import login_required
from guardian.decorators import permission_required
from django.shortcuts import render, get_object_or_404, redirect
from django.http import ... | Python | 0.000007 | @@ -936,13 +936,8 @@
s =
-list(
Mark
@@ -946,24 +946,47 @@
bjects.all()
+.order_by('-added_date'
)%0A for ma
|
2ef72e261918ca021c159fd0eef744e3f2afdea4 | Create instance is now functioning. | orclient.py | orclient.py | """
"""
import requests
# class ORBaseObject(object):
# def __init__(self, api_url, user_key, pass_key):
# if (not isinstance(api_url, str) or
# not isinstance(user_key, str) or
# not isinstance(pass_key, str)):
# raise TypeError('All parameters should be an ins... | Python | 0 | @@ -25,531 +25,75 @@
%0A%0A#
-class ORBaseObject(object):%0A# def __init__(self, api_url, user_key, pass_key):%0A# if (not isinstance(api_url, str) or%0A# not isinstance(user_key, str) or%0A# not isinstance(pass_key, str)):%0A# raise TypeError('All parameters sh... |
66b217efddf8ad8a2a8e4cd2384d2d994155cd7b | Fix a bug | scripts/rtlightsensors.py | scripts/rtlightsensors.py | #!/usr/bin/env python
import sys, rospy
from raspimouse_ros.msg import LightSensorValues
def talker():
devfile = '/dev/rtlightsensor0'
rospy.init_node('lightsensors')
pub = rospy.Publisher('lightsensors', LightSensorValues, queue_size=1)
rate = rospy.Rate(10)
while not rospy.is_shutdown():
... | Python | 0.000192 | @@ -659,37 +659,8 @@
(d)%0A
- rate.sleep()%0A
@@ -723,16 +723,38 @@
vfile)%0A%0A
+ rate.sleep()%0A%0A
if __nam
|
0f452e9ae1cb3216337d062def1d3a68d8a3c16d | Update Qt.py | SPARK17/Qt.py | SPARK17/Qt.py | from PyQt5 import QtGui,QtCore,QtWidgets
| Python | 0.000001 | @@ -1,35 +1,189 @@
-from PyQt5 import QtGui,QtCore,
+import os%0Aif os.environ%5B'SPARK17_QT_LIB'%5D == 'PyQt5':%0A%09from PyQt5 import QtGui,QtCore,QtWidgets%0Aelse:%0A%09print ('using PyQt4')%0A%09from PyQt4 import QtGui,QtCore%0A%09from PyQt4 import QtGui as
QtWi
|
e8456fc52b37896d3a7caaa6dea18c4562c2d8f1 | Make d?profile default to the message author | dog/ext/info.py | dog/ext/info.py | from textwrap import dedent
import discord
from discord.ext.commands import guild_only
from lifesaver.bot import Cog, Context, command, group
from lifesaver.utils import human_delta
from dog.converters import HardMember
def date(date) -> str:
return f'{date}\n{human_delta(date)} ago'
class Info(Cog):
"""A... | Python | 0.000009 | @@ -1152,32 +1152,39 @@
user: HardMember
+ = None
):%0A %22%22%22Vi
@@ -1211,24 +1211,58 @@
t a user.%22%22%22
+%0A user = user or ctx.author
%0A%0A em
@@ -2767,28 +2767,16 @@
embers)%0A
-
%0A
|
d6546b63edb9ea6af3ae42ebdf017f1adb260d47 | handle no assigned time | dog/ext/time.py | dog/ext/time.py | import logging
import datetime
import discord
import pycountry
import pytz
from discord.ext.commands import group
from lifesaver.bot import Cog, Context
from lifesaver.bot.storage import AsyncJSONStorage
log = logging.getLogger(__name__)
class Time(Cog):
def __init__(self, bot):
super().__init__(bot)
... | Python | 0.999285 | @@ -923,16 +923,255 @@
or(who)%0A
+ if not formatted_time:%0A await ctx.send(%0A f'%7Bwho.display_name%7D has not set their time. You can tell them to set their time with '%0A f'%60%7Bctx.prefix%7Dtime set%60.'%0A )%0A return%0A
|
ea6985db437f9eb17f8b898605f41950e46a90c0 | fix download_all for mumps | download_all.py | download_all.py | # Simple script to run required operations to
# 1. Download FASTAs from database
# 2. Copy FASTAs to nextflu directory
# 3. Download titer tables from database
# 4. Copy titer tables to nextflu directory
# Run from base fauna directory with python flu/download_all.py
# Assumes that nextflu/, nextflu-cdc/ and nextflu-cd... | Python | 0 | @@ -5330,36 +5330,37 @@
l = %22python vdb/
-zika
+mumps
_download.py -db
|
79268e441dcdd7268e7ca9457ecfe9181165679a | Version bump 0.0.83 -> 0.0.84 | dpa/__init__.py | dpa/__init__.py | __version__ = '0.0.83'
| Python | 0 | @@ -17,7 +17,7 @@
.0.8
-3
+4
'%0A
|
e482de002200b2d2313bf3cafd05482913df1a45 | Version bump: 0.0.52 -> 0.0.53 | dpa/__init__.py | dpa/__init__.py | __version__ = '0.0.52'
| Python | 0 | @@ -17,7 +17,7 @@
.0.5
-2
+3
'%0A
|
87194047d01a7321a3729e1de67a59336ae7d9cf | Add dbus_init to the public API | secretstorage/__init__.py | secretstorage/__init__.py | # SecretStorage module for Python
# Access passwords using the SecretService DBus API
# Author: Dmitry Shachnev, 2013-2018
# License: 3-clause BSD, see LICENSE file
"""This file provides quick access to all SecretStorage API. Please
refer to documentation of individual modules for API details.
"""
from jeepney.integr... | Python | 0 | @@ -1081,24 +1081,38 @@
ollection',%0A
+%09'dbus_init',%0A
%09'get_all_co
|
f82883052291388b6c8bb0d88591467ce056c88c | version increment | SAGA/version.py | SAGA/version.py | """
SAGA package version
"""
__version__ = '0.6.15'
| Python | 0.000002 | @@ -46,7 +46,7 @@
.6.1
-5
+6
'%0A
|
14ab93b1cb1420a2874a7e197a6785812d9125d8 | version increment | SAGA/version.py | SAGA/version.py | """
SAGA package version
"""
__version__ = "0.40.0a3"
| Python | 0.000002 | @@ -48,7 +48,7 @@
0.0a
-3
+4
%22%0A
|
6438c8eabe34ea7c62eaddda42044a968e4437a8 | fix line endings bug in sefara-select | sefara/commands/select.py | sefara/commands/select.py | # Copyright (c) 2015. Mount Sinai School of Medicine
#
# 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 o... | Python | 0 | @@ -3975,16 +3975,37 @@
riter(fd
+, lineterminator='%5Cn'
)%0A
|
d342fd7a23542e7c968dca3af76281b1d35ba352 | use a better name for the test directory name in tests | osmaxx-py/osmaxx/tests/test_utils.py | osmaxx-py/osmaxx/tests/test_utils.py | import os
from django.test import TestCase
from osmaxx.utils import PrivateSystemStorage
class PrivateSystemStorageTestCase(TestCase):
def setUp(self):
self.directory_name = 'OSMAXX_OjM3cRB2xgSuDXr5yBxxzds9mO8gmP'
def test_creates_a_new_directory_if_it_does_not_exist(self):
directory_path =... | Python | 0.000005 | @@ -195,38 +195,43 @@
AXX_
-OjM3cRB2xgSuDXr5yBxxzds9mO8gmP
+private-storage-directory-for-tests
'%0A%0A
|
b587f7833a57d1f589e14aa33a7e761552c40a5a | bump to 0.19.6 | dvc/__init__.py | dvc/__init__.py | """
DVC
----
Make your data science projects reproducible and shareable.
"""
import os
import warnings
VERSION_BASE = '0.19.5'
__version__ = VERSION_BASE
PACKAGEPATH = os.path.abspath(os.path.dirname(__file__))
HOMEPATH = os.path.dirname(PACKAGEPATH)
VERSIONPATH = os.path.join(PACKAGEPATH, 'version.py')
if os.path.... | Python | 0.000003 | @@ -123,9 +123,9 @@
.19.
-5
+6
'%0A__
|
c645fdd45e0352f6cdfedee1392dc88e48f7d169 | bump to 0.33.1 | dvc/__init__.py | dvc/__init__.py | """
DVC
----
Make your data science projects reproducible and shareable.
"""
from __future__ import unicode_literals
import os
import warnings
VERSION_BASE = "0.33.0"
__version__ = VERSION_BASE
PACKAGEPATH = os.path.abspath(os.path.dirname(__file__))
HOMEPATH = os.path.dirname(PACKAGEPATH)
VERSIONPATH = os.path.jo... | Python | 0.000008 | @@ -161,17 +161,17 @@
= %220.33.
-0
+1
%22%0A__vers
|
52732f72f8bd54906935e175e9a984fa19c461ae | Fix WebSocketInstallStatus definition. | libpebble2/communication/transports/websocket/protocol.py | libpebble2/communication/transports/websocket/protocol.py | from __future__ import absolute_import
__author__ = 'katharine'
from six import iteritems
from enum import IntEnum
from libpebble2.protocol.base import PebblePacket
from libpebble2.protocol.base.types import *
class WebSocketRelayFromWatch(PebblePacket):
payload = BinaryArray()
class WebSocketRelayToWatch(Pe... | Python | 0 | @@ -702,33 +702,34 @@
status = Uint
-8
+32
()%0A%0A%0Aclass WebSo
|
a76f311cec8dccbf8f65ac227c9cc9eec02c03b3 | Version bump | edi/__init__.py | edi/__init__.py | # Copyright 2017 John Reese
# Licensed under the MIT license
# flake8: noqa
"""Simple and elegant Slack bot."""
from .bot import Edi
from .core import Unit, command
__version__ = "0.3.0"
| Python | 0.000001 | @@ -182,9 +182,9 @@
%220.
-3
+4
.0%22%0A
|
4d2afe72e7b0c1b812ca6f7bbe49c44ea77fecf2 | remove cleanup from setUpClass | corehq/apps/accounting/tests/test_migrations.py | corehq/apps/accounting/tests/test_migrations.py | from __future__ import absolute_import
import random
from datetime import date, timedelta
from django.test import TestCase
from corehq.apps.accounting.tests import generator
from corehq.apps.accounting.models import (
BillingAccount,
DefaultProductPlan,
SoftwarePlanEdition,
Subscription,
)
from corehq... | Python | 0 | @@ -46,16 +46,28 @@
random%0A
+import uuid%0A
from dat
@@ -657,213 +657,50 @@
-# TODO - remove once messy tests are cleaned up%0A for
+cls.
domain
-in
+=
Domain
-.get_all():%0A domain.delete()%0A%0A assert len(list(Domain.get_all())) == 0%0A%0A cls.domain = Domain(name='tes... |
4a4dabaaa5769ee69b12b0f808a09b3423603596 | Fix openweathermap hourly forecast (#74578) | homeassistant/components/openweathermap/weather.py | homeassistant/components/openweathermap/weather.py | """Support for the OpenWeatherMap (OWM) service."""
from __future__ import annotations
from typing import cast
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION,
ATTR_FORECAST_NATIVE_PRECIPITATION,
ATTR_FORECAST_NATIVE_TEMP,
ATTR_FORECAST_NATIVE_TEMP_LOW,
ATTR_FORECAST_NATIVE_... | Python | 0.000003 | @@ -4719,16 +4719,33 @@
%7B
+%0A
ha_key:
@@ -4761,16 +4761,32 @@
api_key%5D
+%0A
for api
@@ -4821,16 +4821,68 @@
.items()
+%0A if api_key in forecast%0A
%7D%0A
|
ca32f3f69db49312d65330758ccbea039937885d | append to a copy of list; var-name change | corehq/apps/userreports/expressions/__init__.py | corehq/apps/userreports/expressions/__init__.py | from django.conf import settings
from django.utils.module_loading import import_string
from corehq.apps.userreports.expressions.factory import ExpressionFactory
def get_custom_ucr_expressions():
custom_ucr_expressions = settings.CUSTOM_UCR_EXPRESSIONS
for expression_list in settings.CUSTOM_UCR_EXPRESSION_LIS... | Python | 0.000872 | @@ -1,20 +1,33 @@
+import copy%0A%0A
from django.conf imp
@@ -232,16 +232,26 @@
sions =
+copy.copy(
settings
@@ -273,16 +273,17 @@
RESSIONS
+)
%0A%0A fo
@@ -284,16 +284,24 @@
for
+path_to_
expressi
@@ -307,16 +307,17 @@
ion_list
+s
in sett
@@ -398,16 +398,24 @@
_string(
+path_to_
expressi
@@ -421,1... |
ce6af86e1740b491afe9318ab87a7ae5eafe024a | Put in an exception just in case the gender in PED didn't match standard nomenclature needed by Phenotips | xbrowse_server/base/management/commands/add_individuals_to_project.py | xbrowse_server/base/management/commands/add_individuals_to_project.py | from optparse import make_option
import gzip
import sys
from django.core.management.base import BaseCommand
from xbrowse_server.base.models import Project
from xbrowse_server import sample_management
from xbrowse.parsers import vcf_stuff
from xbrowse_server.phenotips.utilities import create_patient_record
class Comma... | Python | 0.000001 | @@ -3580,16 +3580,63 @@
iv_id'%5D%0A
+ if individual%5B'gender'%5D == 'female':%0A
@@ -3646,32 +3646,34 @@
der='F'%0A
+el
if individual%5B'g
@@ -3712,16 +3712,57 @@
der='M'%0A
+ else:%0A raise ValueError%0A
|
c8d382db5b9edd60cc98a765ca902b2365c8aee4 | Revert "Add failed tests" | projects/tests/base.py | projects/tests/base.py | from mock import MagicMock
from .. import models
class MockGithubMixin(object):
"""Mock github calls mixin"""
def setUp(self):
self._mock_github_call()
def _mock_github_call(self):
"""Mock github call"""
self._orig_get_remote_projects =\
models.ProjectManager._get_rem... | Python | 0 | @@ -575,39 +575,8 @@
%22%22%22%0A
- self.assertTrue(False)%0A
|
951e97cd0b3804fab7d4e675dd7175c273a11b91 | Add another environment check and add comments explaining the requirements | src/ice/runners/ice_engine.py | src/ice/runners/ice_engine.py | """
IceEngine
The job of this class is to perform the functionality that Ice is defined by.
By that I mean the high level goal of `Adding ROMs to Steam`.
"""
import os
from pysteam.steam import Steam
from ice import console
from ice import emulator
from ice import filesystem_helper as fs
from ice.configuration impor... | Python | 0 | @@ -1477,56 +1477,276 @@
-env_checker.require_program_not_running(%22Steam%22)
+# If Steam is running then any changes we make will be overwritten%0A env_checker.require_program_not_running(%22Steam%22)%0A # I'm not sure if there are situations where this won't exist, but I%0A # assume that i... |
4e414e763c5afbd5095729b2c85a91f0ae85f375 | Remove an extra comma, which breaks the following assertion | neutron_fwaas/tests/tempest_plugin/tests/scenario/base.py | neutron_fwaas/tests/tempest_plugin/tests/scenario/base.py | # Copyright (c) 2015 Midokura SARL
# 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 require... | Python | 0.999997 | @@ -1543,17 +1543,16 @@
connect)
-,
%0A
|
51e295b3cfb445cdf27b117e286a013ef61a399b | Fix dict key in ipc script | nomenclatures/ipc_descriptions/03_02_abstract_from_ipc.py | nomenclatures/ipc_descriptions/03_02_abstract_from_ipc.py | #!/usr/bin/python
import urllib
import json
import sys
import csv
import re
# Convert from CPC IPC ref format A63H17/273
# to IPC symbol format A63H0017273000 (zero padded, 4 digit for main
# group, 6 digits for group)
def cpcRefToIpc(s):
pos_subcode = s.find('/')
if pos_subcode > 0:
group = '0000' +... | Python | 0 | @@ -5524,17 +5524,16 @@
mns = %5B'
-
ipc_clas
|
827a1e7f8612b31e01fddfcff2e5ccb3de3fe518 | Use length of event.tags in tag constraint | src/conference_scheduler/lp_problem/constraints.py | src/conference_scheduler/lp_problem/constraints.py | import itertools as it
from conference_scheduler.resources import Shape, Constraint
from conference_scheduler.lp_problem import utils as lpu
def _schedule_all_events(events, slots, X, summation_type=None):
shape = Shape(len(events), len(slots))
summation = lpu.summation_functions[summation_type]
label =... | Python | 0.000001 | @@ -1680,24 +1680,28 @@
if
+len(
events%5Bevent
@@ -1710,14 +1710,13 @@
tags
- != ()
+) %3E 0
:%0A
|
e744f098506b2289b4e1891dc4c510327f75f0af | Add yscale (optional) | exotica_python/src/pyexotica/publish_trajectory.py | exotica_python/src/pyexotica/publish_trajectory.py | from __future__ import print_function, division
from time import sleep
import matplotlib.pyplot as plt
import signal
__all__ = ["sig_int_handler", "publish_pose", "publish_trajectory",
"publish_time_indexed_trajectory", "plot"]
def sig_int_handler(signal, frame):
raise KeyboardInterrupt
def publish_... | Python | 0.000001 | @@ -1619,16 +1619,29 @@
els=None
+, yscale=None
):%0A p
@@ -1753,16 +1753,70 @@
labels)%0A
+ if yscale is not None:%0A plt.yscale(yscale)%0A
plt.
|
91c8af7f2fcfbee6a63f360a6b29c8398bd71ac0 | Fix missing `g++` package in pip example. | examples/pip.py | examples/pip.py | from pyinfra import host
from pyinfra.operations import apk, apt, files, pip, python, yum
SUDO = True
if host.fact.linux_name in ['Alpine']:
apk.packages(
name='Install packages for python virtual environments',
packages=[
'gcc',
'libffi-dev',
'make',
... | Python | 0.000001 | @@ -257,16 +257,35 @@
'gcc',%0A
+ 'g++',%0A
|
f5d20cf976b3e1ba16e11bb42780f5cc25911e7f | Add session commit on movie clean | encarne/movie.py | encarne/movie.py | """The sqlite model for a Movie."""
import os
from encarne.db import base
from sqlalchemy import Column, String, Boolean, Integer
class Movie(base):
"""The sqlite model for a Movie."""
__tablename__ = 'movie'
name = Column(String(240), primary_key=True)
size = Column(Integer(), primary_key=True)
... | Python | 0 | @@ -2262,24 +2262,50 @@
ete(movie)%0A%0A
+ session.commit()%0A%0A
def fix_
|
20a0328136399edd50848c4bcdebb7536c3eafbe | Switch to boto3 for sending emails | src/mmw/apps/core/mail/backends/boto_ses_mailer.py | src/mmw/apps/core/mail/backends/boto_ses_mailer.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import json
import logging
import sys
import traceback
import boto.ses
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.exc... | Python | 0 | @@ -194,20 +194,17 @@
ort boto
-.ses
+3
%0A%0Afrom d
@@ -3693,32 +3693,179 @@
rom_email, to):%0A
+ kwargs = %7B%0A %22Source%22: from_email,%0A %22Destinations%22: to,%0A %22RawMessage%22: %7B%22Data%22: message_bytes%7D,%0A %7D%0A%0A
return s
@@ -3901,37 +3901... |
cba136dff9ba3ec5074fb9a2a4082c6e7430e3d1 | Add debug output for read_email. | spam/preprocess/preprocess.py | spam/preprocess/preprocess.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A set of function that cleans the dataset
for machine learning process.
"""
import re
from nltk import tokenize
from nltk.corpus import stopwords
def regex(text):
"""
A function that removes non-alphanumeric, -, _ characters
and the word `Subject:`, and ... | Python | 0 | @@ -120,16 +120,38 @@
s.%0A%22%22%22%0A%0A
+import io%0Aimport sys%0A%0A
import r
@@ -980,24 +980,214 @@
ord_list)%0A%0A%0A
+def static_vars(**kwargs):%0A def decorate(func):%0A for k in kwargs:%0A setattr(func, k, kwargs%5Bk%5D)%0A return func%0A return decorate%0A%0A%0A@static_vars(s... |
8f6f30dc9ecbda1c86dd4707d807dc58d1402276 | remove todo from fixed | farmfs/ui.py | farmfs/ui.py | import farmfs
from snapshot import snap_pull
from farmfs import getvol
from docopt import docopt
from functools import partial
from farmfs.util import empty2dot, fmap, transduce, concat
from farmfs.volume import mkfs
from os import getcwdu
from fs import Path
USAGE = \
"""
FarmFS
Usage:
farmfs mkfs [--root <root>] ... | Python | 0 | @@ -2526,54 +2526,8 @@
ks()
- #TODO touple based snaps fail to parse links.
%0A
|
78c52615d763a77d0347b0d001df21f4b23095b8 | fix bug in Response.read() | oss/http.py | oss/http.py | import requests
import platform
from . import __version__
from requests.structures import CaseInsensitiveDict
from .compat import to_bytes
_USER_AGENT = 'aliyun-sdk-python/{0} ({1}/{2}/{3};{4})'.format(
__version__, platform.system(), platform.release(), platform.machine(), platform.python_version())
class Ses... | Python | 0 | @@ -737,12 +737,11 @@
eam=
-Fals
+Tru
e))%0A
@@ -1844,32 +1844,53 @@
t%0A else:%0A
+ try:%0A
retu
@@ -1930,8 +1930,69 @@
t(amt))%0A
+ except StopIteration:%0A return b''%0A
|
5c5740e1ac07303a83e509fa34175218bb2b3c96 | insert missing conversion from modes to states | doc/guide/scripts/floquet_ex3.py | doc/guide/scripts/floquet_ex3.py | import numpy as np
from matplotlib import pyplot
import qutip
delta = 0.0 * 2*np.pi
eps0 = 1.0 * 2*np.pi
A = 0.25 * 2*np.pi
omega = 1.0 * 2*np.pi
T = 2*np.pi / omega
tlist = np.linspace(0.0, 20 * T, 101)
psi0 = qutip.basis(2,0)
H0 = - delta/2.0 * qutip.sigmax() - eps0/2.0 * qutip.sigmaz()
H1 = A/2.0 * q... | Python | 0 | @@ -1115,16 +1115,80 @@
, t, T)%0A
+ f_states_t = qutip.floquet_states(f_modes_t, f_energies, t)%0A
p_ex
@@ -1253,19 +1253,20 @@
sform(f_
-mod
+stat
es_t, Tr
|
4db2418afadb04dd6d6709a561d6073bfd42049f | Update migration | corehq/apps/sms/migrations/0003_add_backend_models.py | corehq/apps/sms/migrations/0003_add_backend_models.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import dimagi.utils.couch.migration
class Migration(migrations.Migration):
dependencies = [
('sms', '0002_add_selfregistrationinvitation'),
]
operations = [
migrations.CreateModel(
... | Python | 0.000001 | @@ -135,16 +135,65 @@
gration%0A
+import uuidfield.fields%0Aimport json_field.fields%0A
%0A%0Aclass
@@ -786,27 +786,37 @@
i_key',
-models.Char
+uuidfield.fields.UUID
Field(un
@@ -829,35 +829,62 @@
rue, max_length=
-126
+32, editable=False, blank=True
)),%0A
@@ -1343,27 +1343,38 @@
tries',
-mod
+js... |
510564f370ec61f9ddc2ca4a950583a31e97de5a | Include icons in non-local feeds. | create.py | create.py | import os
from xml.dom import minidom, XMLNS_NAMESPACE
from zeroinstall.injector.namespaces import XMLNS_IFACE
from zeroinstall.injector import model, reader
_local_template = """<?xml version="1.0" ?>
<?xml-stylesheet type='text/xsl'
href='http://0install.net/2006/stylesheets/interface.xsl'?>
<interface xmlns="... | Python | 0.000072 | @@ -159,32 +159,38 @@
%0A_local_template
+_start
= %22%22%22%3C?xml vers
@@ -303,102 +303,8 @@
l'?%3E
-%0A%0A%3Cinterface xmlns=%22http://zero-install.sourceforge.net/2004/injector/interface%22%3E%0A%3C/interface%3E
%0A%22%22%22
@@ -2079,18 +2079,111 @@
template
+_start +%0A%09%09'%3Cinterface xmlns=%22http://zer... |
0da80053f6c5fa41d33b692e6abc7067ed100bb4 | bump version | SAGA/version.py | SAGA/version.py | """
SAGA package version
"""
__version__ = "0.40.0a8"
| Python | 0 | @@ -48,7 +48,7 @@
0.0a
-8
+9
%22%0A
|
37adb9e0ecaa7311a92354531998e05fccbe9ee1 | Fix attach mode | tinfo/__init__.py | tinfo/__init__.py | #!/usr/bin/env python
# Rich Healey '11 all rights reserved
# Released under GPLv2 or WTFPL at your option
#
# TODO
# - Get yo feature bloat on, colors if we're attached to a TTY
# - port to ruby
# - More attractive visually
# - More intuitive options
import os
import sys
import subprocess
import argparse
import re
f... | Python | 0.000001 | @@ -1547,16 +1547,380 @@
itle))%0A%0A
+ def only_session_id(self):%0A keys = self.sessions.keys()%0A assert len(keys) == 1%0A return keys%5B0%5D%0A%0A def only_session(self):%0A session_id = self.only_session_id()%0A return self.sessions%5Bsession_id%5D%0A%0A def only_client... |
c694aefd2a555e0fb7e11212bfb4c412c226ea89 | Fix Codacy | frappe/desk/doctype/route_history/route_history.py | frappe/desk/doctype/route_history/route_history.py | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import json
class RouteHistory(Document):
pass
def flush_old_route_records():
"""Dele... | Python | 0.000001 | @@ -227,20 +227,8 @@
ment
-%0Aimport json
%0A%0Acl
|
b28ce799e27baffc2f577cec87930b2c46b35ae9 | Make our Isosurface class compatible with Vispy 0.4 | glue_vispy_viewers/isosurface/isosurface_visual.py | glue_vispy_viewers/isosurface/isosurface_visual.py | # This file implements a IsosurfaceVisual class that includes workarounds for
# the following VisPy bugs:
#
# https://github.com/vispy/vispy/pull/1179
# https://github.com/vispy/vispy/pull/1180
#
# It is derived from the original code for IsosurfaceVisual in
# vispy.visuals.isosurface, which is released under a BSD ... | Python | 0 | @@ -70,18 +70,17 @@
unds for
-
%0A
+
# the fo
@@ -100,17 +100,16 @@
bugs:%0A#
-
%0A# https
@@ -188,17 +188,16 @@
l/1180%0A#
-
%0A# It is
@@ -2237,16 +2237,36 @@
vision%0A%0A
+import numpy as np%0A%0A
from vis
@@ -2431,16 +2431,249 @@
_node%0A%0A%0A
+# Find out if we are using the original or new drawing A... |
8fe69d091171116808fc0421d58c41c7f017bcd4 | Add tests for developer form. | mdotdevs/test/forms.py | mdotdevs/test/forms.py | from django.test import TestCase
from django.test import Client
from mdotdevs.forms import ReviewForm
class MdotdevsFormTest(TestCase):
def setUp(self):
self.client = Client()
def test_form_input_consumption(self):
"""
Test that the form is valid when passed
all required valu... | Python | 0 | @@ -2943,32 +2943,1145 @@
ponse.content)%0A%0A
+ def test_bad_header(self):%0A %22%22%22%0A Test that when given incorrect data the request contains%0A 'Invalid header found.'.%0A%0A The new line character in the sponsor_name is%0A what causes the error.%0A %22%22%22%0A%0A ... |
c1ea7a007d70c2b815b4879d383af3825c74e7e8 | fix flake8 violation | tinyobj/fields.py | tinyobj/fields.py | """**tinyobj** implements a number of fields to do validation, etc."""
from . import _compat
class Field(object):
"""base for other fields"""
def __init__(self):
self.default = None
def initialize(self, value=()):
"""\
initialize returns a cleaned value or the default, raising Val... | Python | 0 | @@ -2587,17 +2587,16 @@
se self.default%0A
-%0A
|
818cfb2291a8fa9f683d16e8dcc24af7b0eb2870 | update dependency io_bazel to v0.27.0 | package.bzl | package.bzl | # Copyright 2018 The Bazel 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 applicable la... | Python | 0 | @@ -1876,19 +1876,19 @@
hive/0.2
-6.1
+7.0
.tar.gz%22
@@ -1926,11 +1926,11 @@
-0.2
-6.1
+7.0
%22,%0A
@@ -1950,72 +1950,72 @@
= %22
-560302a3414cf4dff79c417b4490c407a6e2b2f75a195c689b2b71ac2192ada0
+e6dfa13ffaeb3b31455d9fb7042605651412c121453ade95c0d7e67b04d27d8a
%22,%0A
|
e15f97713aac0459dc0cd553cf36658506c47367 | Make copyright perpetual | tmuxp/__init__.py | tmuxp/__init__.py | # -*- coding: utf-8 -*-
# flake8: NOQA
"""tmux session manager.
tmuxp
~~~~~
:copyright: Copyright 2013-2018 Tony Narlock.
:license: MIT, see LICENSE for details
"""
from __future__ import absolute_import, unicode_literals
from . import cli, config, util
from .__about__ import (
__author__,
__copyright__,
... | Python | 0.000013 | @@ -102,12 +102,8 @@
013-
-2018
Ton
|
0bab8864276e255130125d2a4ff95e8649ca823a | Revert "Switched to pycrypto for PKCS v1.5 signing" | crypto.py | crypto.py | #!/usr/bin/env python
"""
An early "lightning" attempt at getting TeleHash crypto working in Python
"""
from local_vars import DEST_KEY, DEST_HASH
import os
from struct import pack, unpack
from tomcrypt import rsa, ecc, cipher, hash
import Crypto.Signature.PKCS1_v1_5 as PKCS
import Crypto.Hash.SHA256 as SHA256
import ... | Python | 0 | @@ -231,122 +231,8 @@
ash%0A
-import Crypto.Signature.PKCS1_v1_5 as PKCS%0Aimport Crypto.Hash.SHA256 as SHA256%0Aimport Crypto.PublicKey.RSA as RSA%0A
impo
@@ -1711,16 +1711,61 @@
'hex')%0A%0A
+hasher = hash.new('sha256', session_ecc_pub)%0A
hasher.u
@@ -2121,243 +2121,8 @@
%22%22%22%0A
-%0Aid_key_new = RSA.import... |
61255b73b93309e360f890df4057dd2bc66e3e7a | modify demo | demos/hide_window_by_hotkey.py | demos/hide_window_by_hotkey.py | #!python3
# -*- coding: utf-8 -*-
# hide windows with hotkey Ctrl+1, show the hidden windows with hotkey Ctrl+2
import os
import sys
import time
import subprocess
from typing import List
from threading import Event
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # not required after 'pip ... | Python | 0 | @@ -1460,16 +1460,127 @@
trl+D')%0A
+ cmdWindow = auto.GetConsoleWindow()%0A if cmdWindow:%0A cmdWindow.GetTransformPattern().Move(0, 300)%0A
auto
@@ -2070,11 +2070,37 @@
%7D
+, waitHotKeyReleased=False
)%0A%0A
|
e908a2c62be1d937a68b5c602b8cae02633685f7 | Load at a distance content in updatadata command | csunplugged/general/management/commands/updatedata.py | csunplugged/general/management/commands/updatedata.py | """Module for the custom Django updatedata command."""
from django.core import management
class Command(management.base.BaseCommand):
"""Required command class for the custom Django updatedata command."""
help = "Update all data from content folders for all applications"
def add_arguments(self, parser)... | Python | 0 | @@ -1131,32 +1131,112 @@
load=lite_load)%0A
+ management.call_command(%22load_at_a_distance_data%22, lite_load=lite_load)%0A
manageme
|
cc16dc7d90457b045e8c5806a09b82e25ecc72d8 | Create move from zero | stock_quant_packages_moving_wizard/models/stock.py | stock_quant_packages_moving_wizard/models/stock.py | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
class StockQua... | Python | 0 | @@ -424,158 +424,307 @@
-last_move = self._get_latest_move(self)%0A new_move = last_move.copy()%0A new_move.location_id = new_move.location_dest_id%0A new_move.
+move_obj = self.env%5B'stock.move'%5D%0A new_move = move_obj.create(%7B%0A 'name': 'Move %25s to %25s' %25 (self.... |
4865ac05e38b7ffe55db3e4edb04812e3084bde5 | Update robot_execution.py | gilbreth_grasp_planning/scripts/robot_execution.py | gilbreth_grasp_planning/scripts/robot_execution.py | #!/usr/bin/env python
## A node executes the robot.
## Including Gripper control.
import sys
import rospy
import math
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
from gilbreth_msgs.msg import RobotTrajectories
from gilbreth_gazebo.msg import VacuumGripperState
from gilbreth_gazebo.srv imp... | Python | 0.000002 | @@ -2178,21 +2178,20 @@
==%3E
-Pick Approach
+Waiting Pose
.%22)%0A
|
707a1bdf98a0e0ece5afe83897901643282401c4 | switch to xkcd code names | crypto.py | crypto.py | import hmac, hashlib, subprocess, random
import gnupg
import config
BITS_IN_RANDOM_ID = 256
HASH_FUNCTION = hashlib.sha256
GPG_KEY_TYPE = "RSA"
GPG_KEY_LENGTH = "4096"
class CryptoException(Exception): pass
def genrandomid():
return hex(random.getrandbits(BITS_IN_RANDOM_ID))[2:-1]
def shash(s):
"""
>>> ... | Python | 0.000004 | @@ -62,19 +62,20 @@
config%0A%0A
-BIT
+WORD
S_IN_RAN
@@ -84,18 +84,39 @@
M_ID = 2
-56
+%0AWORD_LIST = 'wordlist'
%0AHASH_FU
@@ -229,64 +229,130 @@
ss%0A%0A
-def genrandomid():%0A return hex(random.getrandbits(BIT
+words = file(WORD_LIST).read().split('%5Cn')%0Adef genrandomid():%0A return ' '.join(random.cho... |
327676c56b492ba0501eb60436d1c691d464f011 | Remove docker from ipynb to outside. | docs/tutorials_source/generate_images_tutorial.py | docs/tutorials_source/generate_images_tutorial.py | # Need at least 20 # characters
"""
===============
Generate Images
===============
This ipython notebook demonstrates how to generate an image dataset with rich
ground truth from a virtual environment.
"""
####################
# Load some python libraries
from __future__ import division, absolute_import, print_funct... | Python | 0 | @@ -675,16 +675,18 @@
=======%0A
+#
from doc
@@ -708,16 +708,18 @@
runner%0A
+#
runner.s
@@ -4294,16 +4294,18 @@
r image%0A
+#
runner.s
|
a0249bc2ccd90bb8b21a57266589f67cbfa29d0c | test that view correct after subset deletion | glue/qt/widgets/tests/test_data_collection_view.py | glue/qt/widgets/tests/test_data_collection_view.py | from ..data_collection_view import DataCollectionView
from .... import core
from ....tests import example_data
from PyQt4.QtGui import QApplication
def setup_module(module):
module.app = QApplication([''])
def teardown_module(module):
module.app.exit()
del module.app
class Printer(core.hub.HubListene... | Python | 0.000003 | @@ -1914,32 +1914,241 @@
tem(self.data)%0A%0A
+ def test_subset_delete_updates_view(self):%0A self.collect.append(self.data)%0A s = self.data.new_subset()%0A assert self.has_item(s)%0A s.delete()%0A assert not self.has_item(s)%0A%0A
def test_dat
|
1a0848e2c65f9dedc17a337822c9cbc0e3681381 | update the replaceVars for the outermost segment | desertbot/modules/utils/Sub.py | desertbot/modules/utils/Sub.py | """
Created on Feb 28, 2015
@author: StarlitGhost
"""
import re
from twisted.plugin import IPlugin
from twisted.words.protocols.irc import assembleFormattedText as colour, attributes as A
from zope.interface import implementer
from desertbot.message import IRCMessage
from desertbot.moduleinterface import IModule
fro... | Python | 0.000001 | @@ -3967,32 +3967,259 @@
sponse.Metadata)
+%0A # update the replaceVars in case this is the outermost segment%0A # (and therefore we won't be looping again to pick them up)%0A if 'var' in metadata:%0A replaceVars = metadata%5B'var'%5D
%0A%0A pr
|
fd64db7ddfb3bfbca721f08768a826c60d384b82 | add fix type annotations | src/ezdxf/entities/circle.py | src/ezdxf/entities/circle.py | # Copyright (c) 2019-2021 Manfred Moitzi
# License: MIT License
from typing import TYPE_CHECKING, Iterable
import math
from ezdxf.lldxf import validator
from ezdxf.math import (
Vec3,
Matrix44,
NULLVEC,
Z_AXIS,
arc_segment_count,
linspace,
)
from ezdxf.math.transformtools import OCSTransform, N... | Python | 0 | @@ -530,16 +530,31 @@
S_MARKER
+, DXFValueError
%0Afrom .d
@@ -5918,32 +5918,116 @@
lf.get_layout()%0A
+ if layout is None:%0A raise DXFValueError(%22valid layout required%22)%0A
ellipse
@@ -6616,32 +6616,116 @@
lf.get_layout()%0A
+ if layout is None:%0A raise DXFValueE... |
fd9dc5337587831b16e51598295c2e659ee4c824 | Fix test-url | stream_django/tests/test_app/tests/test_manager.py | stream_django/tests/test_app/tests/test_manager.py | import httpretty
import re
from stream_django.feed_manager import feed_manager
from stream_django.tests import Tweet
import unittest
api_url = re.compile(r'(us-east-api.)?stream-io-api.com/*.')
class ManagerTestCase(unittest.TestCase):
def setUp(self):
feed_manager.enable_model_tracking()
def test... | Python | 0.000054 | @@ -183,16 +183,23 @@
-api.com
+(/api)?
/*.')%0A%0A%0A
|
d0e9fa1a6a5f298382ac0e145dbf07cf9b4a65c3 | update views of hotel | app/hotel/views.py | app/hotel/views.py | import datetime
from flask import Blueprint, render_template, request, redirect, url_for, abort, views
from app.core.json import json_respon, jsonify
from app.core.db import db
from models import Hotels, Country, Province, City
from sqlalchemy.exc import IntegrityError
from flask.ext.login import login_required, curren... | Python | 0 | @@ -537,16 +537,23 @@
('.hotel
+_detail
', id=ho
|
51e882394a73493aae873671b0287e6f4a873884 | Add an example | examples/led.py | examples/led.py | '''
LED
Turns on and off an on-board LED
Pluto has collect some number of Arduino boards with on-board LED attached to pin 13. For these boards, Pluto can recognize automatically through the use of the board's class. If unsure, consult the doc at http://arduino.cc and use general Board class, then supply the pin numb... | Python | 0 | @@ -1,15 +1,17 @@
'''%0A
-LED
+Blink
%0ATurns o
@@ -16,16 +16,8 @@
on
-and off
an o
@@ -32,322 +32,269 @@
LED
-%0A%0APluto has collect some number of Arduino boards with on-board LED attached to pin 13. For these boards, Pluto can recognize automatically through the use of
+on for one second, and then off.%0A%... |
047c95e255d6aac31651e3a95e2045de0b4888e2 | Make a real json response. | flask_app.py | flask_app.py | import json
from flask import abort
from flask import Flask
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
@app.route('/')
def display_available():
conten... | Python | 0.000096 | @@ -1,17 +1,4 @@
-import json%0A%0A
from
@@ -15,37 +15,29 @@
ort
-abort%0Afrom flask import Flask
+Flask, abort, jsonify
%0Afro
@@ -745,22 +745,19 @@
urn json
-.dumps
+ify
(main.li
@@ -963,14 +963,11 @@
json
-.dumps
+ify
(dat
|
048b39880158a26742b0fd654994df0f6c142a5f | Clarify compare_ops.__doc__ | devito/symbolics/inspection.py | devito/symbolics/inspection.py | from collections import Counter
from sympy import cos, sin, exp, log
from devito.symbolics.search import retrieve_xops, search
from devito.logger import warning
from devito.tools import as_tuple, flatten
__all__ = ['compare_ops', 'count', 'estimate_cost']
def compare_ops(e1, e2):
"""
Return True if the two... | Python | 0.000043 | @@ -291,23 +291,16 @@
%22%22%22%0A
-Return
True if
@@ -307,16 +307,22 @@
the two
+input
expressi
@@ -328,26 +328,8 @@
ions
- %60%60e1%60%60 and %60%60e2%60%60
per
@@ -352,20 +352,16 @@
ithmetic
-%0A
operati
@@ -363,16 +363,20 @@
erations
+%0A
over th
@@ -392,16 +392,17 @@
put
+%22
operands... |
a0c0fa9355c57c397d0009bd152415a82981919e | correct CFS tiler typo | scripts/yieldfx/cfs_tiler.py | scripts/yieldfx/cfs_tiler.py | """Generate PSIMs Tiles.
Run from RUN_NOON.sh for the previous UTC date."""
import datetime
import os
import numpy as np
from pyiem import iemre
from pyiem.datatypes import temperature
from pyiem.util import utc, ncopen
def make_netcdf(fullpath, valid, west, south):
"""Make our netcdf"""
if os.path.isfile(f... | Python | 0.998637 | @@ -5074,17 +5074,17 @@
nge(36,
-5
+4
4, 2):%0A
|
e1b858784781f109e5b3e7d936368420f984df51 | Simplify mapping and add missing functions | src/gramcore/scripts/gram.py | src/gramcore/scripts/gram.py | """Command line tool to execute a set of pythogram tasks."""
import sys
import json
import logging
from gramcore.data import images, arrays
from gramcore.transformations import arithmetic, geometric
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('gramcore')
MAPPING = {
'data.images.fromarra... | Python | 0.000002 | @@ -289,29 +289,24 @@
NG = %7B%0A '
-data.
images.froma
@@ -331,29 +331,24 @@
array,%0A '
-data.
images.load'
@@ -363,29 +363,24 @@
.load,%0A '
-data.
images.save'
@@ -476,21 +476,16 @@
s%0A #'
-data.
images.s
@@ -500,21 +500,16 @@
tions':
-data.
images.s
@@ -525,29 +525,24 @@
tions,%0A '
-da... |
4381e53dcc26ed7869f2b41ebe2a7754fbb8a1b8 | fix for latest jwt | pivportal/lib/pivportal/security.py | pivportal/lib/pivportal/security.py | """ Command Line Interface Module """
from flask import Response, request
import json
import re
import jwt
import datetime
from functools import wraps
# Redis "requests" hash
# {"12345678": { "username": X, "client_ip": X, "authorized": False, "time": time.time()}}
# {"dn1": "user1", "dn2": "user2"}
dn_to_username = ... | Python | 0 | @@ -2230,16 +2230,21 @@
ignature
+Error
:%0A
|
5f4dcd188e38563281e2b1f6be05d95d125e5905 | Remove unused import | examples/ale/train_ppo_ale.py | examples/ale/train_ppo_ale.py | from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases()
import argparse
import os
import chainer
from chainer import links a... | Python | 0.000001 | @@ -289,39 +289,8 @@
iner
-%0Afrom chainer import links as L
%0A%0Afr
@@ -588,60 +588,8 @@
icy%0A
-from chainerrl.recurrent import RecurrentChainMixin%0A
from
|
4a07285b55afebd30310af3445795490ba06d56b | bump version to 0.0.9 | posts/__init__.py | posts/__init__.py | __version__ = '0.0.8'
| Python | 0.000001 | @@ -16,7 +16,7 @@
0.0.
-8
+9
'%0A
|
0ec74d1230bb8f51c3676496feace20728b015c5 | Improve region_migraton_admin line ending | dbaas/region_migration/admin/databaseregionmigration.py | dbaas/region_migration/admin/databaseregionmigration.py | # -*- coding: utf-8 -*-
from django_services import admin
from django.utils.html import format_html
from django.core.urlresolvers import reverse
from django.conf.urls import url, patterns
from django.http import HttpResponseRedirect
from datetime import datetime
from notification.models import TaskHistory
from ..models... | Python | 0.000002 | @@ -1316,30 +1316,24 @@
-html = %5B%5D%0A%0A if
+last_step = len(
data
@@ -1344,32 +1344,57 @@
regionmigration.
+get_steps()) - 1%0A
next_step and da
@@ -1391,11 +1391,9 @@
tep
-and
+=
dat
@@ -1426,55 +1426,56 @@
step
- %3C len(databaseregionmigration.get_steps()) - 1
+%0A%0A if nex... |
e21557181b70d12c86e736b41cb29e872d0b9dab | Fix number of steps on steps_information | dbaas/region_migration/admin/databaseregionmigration.py | dbaas/region_migration/admin/databaseregionmigration.py | # -*- coding: utf-8 -*-
import logging
from django_services import admin
from django.utils.html import format_html
from django.core.urlresolvers import reverse
from django.conf.urls import url, patterns
from django.http import HttpResponseRedirect
from datetime import datetime
from notification.models import TaskHistor... | Python | 0.939982 | @@ -3733,16 +3733,20 @@
steps())
+ - 1
)%0A
|
e60d20e793eec9980ed8093eaadd8eba52692536 | All pronouned up and no place to go | ics/myics.py | ics/myics.py | #! /usr/bin/env python3
from ics import Calendar, Event
from random import randrange, choice
from datetime import timedelta, datetime
import click
import calendar
from dateutil import parser
def encourage(name):
encouragements = [
f"{name} would love to hear from you",
f"give {name} a compliment!"... | Python | 0.99864 | @@ -186,16 +186,205 @@
parser%0A%0A
+class Pronoun:%0A def __init__(self, they=%22they%22, them=%22them%22, their=%22their%22, theyre = %22they're%22):%0A self.they = they%0A self.them = them%0A self.their = their%0A self.theyre = theyre%0A%0A
def enco
@@ -393,16 +393,20 @@
age(name
+, pn
):%0A e
@@... |
5e3fb540186c9c01105809f660491a60a8c907d6 | Fix choropleth_states.py example | examples/choropleth_states.py | examples/choropleth_states.py | '''
Choropleth map of US states
'''
import folium
import pandas as pd
state_geo = r'us-states.json'
state_unemployment = r'US_Unemployment_Oct2012.csv'
state_data = pd.read_csv(state_unemployment)
# Let Folium determine the scale.
states = folium.Map(location=[48, -102], zoom_start=3)
states.geo_json(geo_path=stat... | Python | 0.000012 | @@ -291,24 +291,26 @@
%0Astates.
-geo_json
+choropleth
(geo_pat
@@ -719,16 +719,18 @@
es2.
-geo_json
+choropleth
(geo
|
bad746ebacee53a80c0b2d5e1e5e4ad8441971ad | update allowed hosts | WIP/settings.py | WIP/settings.py | """
Django settings for WIP 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 os
# ... | Python | 0 | @@ -917,16 +917,32 @@
OSTS = %5B
+%22.herokuapp.com%22
%5D%0A%0A%0A# Ap
|
70df7c120b9b3add873843801a7e1737dde3e16a | add GDEM climatology | pyfesom/climatology.py | pyfesom/climatology.py | # This file is part of pyfesom
#
################################################################################
#
# Original code by Dmitry Sidorenko, 2013
#
# Modifications:
# Nikolay Koldunov, 2016
# - change to netCDF4
# - change scipy griddata interpolation to KDTree for speed
# TODO
# Add se... | Python | 0.000008 | @@ -2837,9 +2837,834 @@
.S, 2)%0A%0A
+ if climname=='gdem':%0A ncfile = Dataset(os.path.join(path, 'gdemv3s_tm.nc'))%0A self.T = np.copy(ncfile.variables%5B'water_temp'%5D%5B0,:,:,:%5D)%0A x=np.copy(ncfile.variables%5B'lon'%5D%5B:%5D)%0A x%5Bx%3E180%5D=x%5Bx%3E180%5D-... |
84c9076a6bccfa4556be262d5bd5405a30d78268 | Revise to clarified comments | lc0448_find_all_numbers_disappeared_in_an_array.py | lc0448_find_all_numbers_disappeared_in_an_array.py | """Leetcode 448. Find All Numbers Disappeared in an Array
Easy
URL: https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/
Given an array of integers where 1 <= a[i] <= n (n = size of array),
some elements appear twice and others appear once.
Find all the elements of [1, n] inclusive that do not app... | Python | 0 | @@ -1449,10 +1449,11 @@
#
-At
+Use
idx
@@ -1462,48 +1462,47 @@
um-1
-, if num is appeared, mark
+ to mark appeared by updating
num
-s
%5Bidx%5D
- by
+=
-num
|
8b51e515062627f344a6a6241cf5e18a103edcbe | use default address | src/Devices/Sensors/LTR559.py | src/Devices/Sensors/LTR559.py | import logging
import ltr559
from blinker import signal
class LTR559:
def __init__(self, address):
logging.info('Initialising LTR559 sensor with address {}'.format(address))
self._sensor = ltr559.LTR559(i2c_dev=address)
def get_lux(self, mqtt_details):
"""
Return measured lux... | Python | 0.000002 | @@ -223,23 +223,8 @@
559(
-i2c_dev=address
)%0A%0A
|
09560bcf4ded4f9beffefbfc45e40a795d6f3883 | Create a new version | src/hammr/utils/constants.py | src/hammr/utils/constants.py | # To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="UShareSoft"
import os
import tempfile
VERSION="0.2.3"
TMP_WORKING_DIR=tempfile.gettempdir() + os.sep + "hammr-" + str(os.getpid())
HTTP_TIMEOUT=10
TEMPLATE_JSON_FILE_NAME="template.json"
TEMPLATE_JSON_NEW_FILE_N... | Python | 0.000003 | @@ -154,9 +154,9 @@
0.2.
-3
+4
%22%0A%0A%0A
|
c27ca7239280ec9f2e68c5778db1668db6e0d0c8 | Fix import error | app/main/errors.py | app/main/errors.py | from flask import render_template
from app.main import main
@main.app_errorhandler(403)
def forbidden(_):
return render_template('errors/403.html'), 403
@main.app_errorhandler(404)
def page_not_found(_):
return render_template('errors/404.html'), 404
@main.app_errorhandler(500)
def internal_server_error(... | Python | 0 | @@ -41,16 +41,22 @@
app.main
+.views
import
|
8217aa21db2b29389a9b4bd110158f41b2c11a0b | write header for new csv | tools/trim_csv.py | tools/trim_csv.py |
import os.path
import argparse
from unicodecsv import DictReader, DictWriter
def main():
prs = argparse.ArgumentParser()
prs.add_argument('--count', type=int, default=100)
prs.add_argument('file', type=file)
args = prs.parse_args()
count = args.count
assert count > 0
path = os.path.ab... | Python | 0.000001 | @@ -662,16 +662,45 @@
dnames)%0A
+ writer.writeheader()%0A
|
51655f84e4b8a6cfafa4e62421cdd6b4d6fd48e4 | rework python3-workers for parallel execution of check coroutines | parkkeeper/task_generator.py | parkkeeper/task_generator.py | # coding: utf-8
import multiprocessing
from time import sleep
import zmq
from django.conf import settings
from django.utils.timezone import now
from parkkeeper.event import emit_event
from parkkeeper import models
from parkworker.const import MONIT_TASK_EVENT
class TaskGenerator(multiprocessing.Process):
contex... | Python | 0 | @@ -1109,20 +1109,22 @@
et.send_
-json
+string
(task_js
|
1b591e155b062c2996a1ef755322f0af218d641a | Remove some needless statements | app/sso/tasks.py | app/sso/tasks.py | import sys
import logging
import urllib
import urllib2
from hashlib import sha512
from django.conf import settings
from django.db.models import signals
from django.utils import simplejson as json
from django.contrib.auth.models import User
from celery.signals import task_failure
from celery.decorators import task
fr... | Python | 0.999997 | @@ -3425,33 +3425,16 @@
.save()%0A
- pass%0A
else
@@ -3805,33 +3805,8 @@
e()%0A
- pass%0A
@@ -3935,33 +3935,8 @@
ve()
-%0A pass
%0A%0A
|
a845260eb28e112ba079db2eb80595b6ca3dc93e | Fix typo | widget/server/comet-server.py | widget/server/comet-server.py | #!/bin/env python
# I chose to implement the Comet driver in Python rather than Ruby because...the Ruby ICE bindings don't support callbacks. Blurg.
# Mostly adapted from http://mumble.git.sourceforge.net/git/gitweb.cgi?p=mumble/mumble;a=blob_plain;f=scripts/testcallback.py;hb=HEAD
#
# Implements a simple callback resp... | Python | 0.999999 | @@ -2021,17 +2021,16 @@
n/json%22%7D
-%7D
)%0A%09%09resp
|
63ba748e7034841b95689c32215285f05ab54106 | add tqdm progress bars to pdp.py config | diagnostic_primers/scripts/subcommands/subcmd_config.py | diagnostic_primers/scripts/subcommands/subcmd_config.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""subcmd_config.py
Provides the config subcommand for pdp.py
(c) The James Hutton Institute 2017-18
Author: Leighton Pritchard
Contact: leighton.pritchard@hutton.ac.uk
Leighton Pritchard,
Information and Computing Sciences,
James Hutton Institute,
Errol Road,
Invergow... | Python | 0 | @@ -1454,16 +1454,39 @@
ort os%0A%0A
+from tqdm import tqdm%0A%0A
from ..t
@@ -3457,16 +3457,21 @@
gcc in
+tqdm(
coll.dat
@@ -3467,24 +3467,25 @@
dm(coll.data
+)
:%0A if
|
4c0a9db0f635e304650ff1e572f3e6766ae61434 | remove log | panbaidu.py | panbaidu.py | #!/usr/bin/env python2
#!coding=utf-8
import sys
import os
import re
import urllib2
import json
import pdb
def getDownloadPage(url):
header = {
'User-Agent':'Mozilla/5.0 (X11; Linux x86_64)\
AppleWebKit/537.36 (KHTML, like Gecko)\
Chrome/28.0.1500.95 Safa... | Python | 0.000001 | @@ -80,31 +80,8 @@
lib2
-%0Aimport json%0Aimport pdb
%0A%0Ade
@@ -551,36 +551,16 @@
ata)%5B2%5D%0A
- pdb.set_trace()%0A
retu
@@ -704,28 +704,8 @@
(1)%0A
- pdb.set_trace()%0A
@@ -1205,16 +1205,18 @@
complete
+%5Cn
%22 %25 file
@@ -1469,17 +1469,17 @@
int 'V0.
-2
+3
'%0A
|
26bc3a761d5b513513773700b2167a0fd5b58102 | Add a note about [#76]. | astral/api/handlers/ticket.py | astral/api/handlers/ticket.py | from astral.api.handlers.base import BaseHandler
from astral.models import Ticket, Node, Stream, session
import logging
log = logging.getLogger(__name__)
class TicketHandler(BaseHandler):
def _load_ticket(self, stream_slug, destination_uuid):
stream = Stream.get_by(slug=stream_slug)
if not destin... | Python | 0 | @@ -762,16 +762,218 @@
delete()
+%0A # TODO if we were the destination, need to find another ticket%0A # TODO if we were forwarding this to someone else, need to propagate the%0A # delete to them if we can't find another
%0A%0A de
|
d07cf3a527e533259fcc916e0db856b4bc7d6f43 | change kernel name | _unittests/ut_documentation/test_run_notebooks.py | _unittests/ut_documentation/test_run_notebooks.py | #-*- coding: utf-8 -*-
"""
@brief test log(time=33s)
"""
import sys
import os
import unittest
import re
try:
import pyquickhelper
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
... | Python | 0.000003 | @@ -2841,27 +2841,37 @@
%22py
-quickhelper
+thon3_module_template
%22)%0A%0A
|
eaf758e79a477b74cdaca4b47b675ae9fa5b839d | Revert "Fonction format_mot(mot)=> marche bien" | tp2/Collecteur.py | tp2/Collecteur.py | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
import xml.etree.cElementTree as ET
from sys import argv
from Dictionnaire import get_word_file
from itertools import izip
from unidecode import unidecode
import copy
import re
import string
import unicodedata
class Collecteur:
mots_liste = []
mots ={}
... | Python | 0 | @@ -220,49 +220,8 @@
re%0A
-import string%0Aimport unicodedata%0A%0A%0A%0A %0A
%0A%0A%0Ac
@@ -5791,10 +5791,24 @@
ion
-ok
+a travailler car
cer
@@ -5857,314 +5857,155 @@
pte
-%0Adef format_mot(mot):%0A wolrd=%22%22%0A wl=%22%22%0A if isinstance(mot,str):%0A mot = unicode(mot,%22utf8%22,%22re... |
cf63e94ba36522a26adeec4948b86e114a8c291f | Check that in_reply_to on replies to triggers is unset by outbound resource. | go/apps/dialogue/tests/test_vumi_app.py | go/apps/dialogue/tests/test_vumi_app.py | # -*- coding: utf-8 -*-
"""Tests for go.apps.dialogue.vumi_app"""
import pkg_resources
import os
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.trial.unittest import SkipTest
from vumi.tests.helpers import VumiTestCase
from vumi.tests.utils import LogCatcher
from go.apps.dialogue.vumi... | Python | 0 | @@ -3327,24 +3327,79 @@
%5Cn2. Blue%22)%0A
+ self.assertEqual(msg%5B%22in_reply_to%22%5D, None)%0A
|
74bf6737e8e33c710eb33ed369e4693e6b6106dd | Update test_LONG_install_module.py | _unittests/ut_install/test_LONG_install_module.py | _unittests/ut_install/test_LONG_install_module.py | """
@brief test log(time=1s)
"""
import unittest
from pyquickhelper.loghelper import fLOG
from pymyinstall.installhelper.module_install import ModuleInstall
from pymyinstall.installhelper.module_install_version import get_module_version
class TestLONGInstallModule (unittest.TestCase):
def test_pypi_version(... | Python | 0.000004 | @@ -1950,20 +1950,16 @@
res is
-not
None:%0A
|
21c2fdca35feba077a3e22b8f403e52db3a42b26 | remove print statement | src/biokbase/narrative/handlers/narrativehandler.py | src/biokbase/narrative/handlers/narrativehandler.py | import os
from notebook.utils import (
url_path_join, url_escape
)
from notebook.base.handlers import (
IPythonHandler, FilesRedirectHandler
)
from tornado import web
from biokbase.narrative.common.kblogging import (
get_logger, log_event
)
from biokbase.narrative.common.util import kbase_env
import urllib
... | Python | 0.999999 | @@ -1913,68 +1913,8 @@
e:%0A
- print(%22ERROR%22)%0A print(e.status_code)%0A
|
36c891f4f11a7780a444894042cfd603c8fd4300 | Update __init__.py | src/nupic/research/frameworks/htm/__init__.py | src/nupic/research/frameworks/htm/__init__.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2022, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | Python | 0.000072 | @@ -1017,271 +1017,8 @@
er%0A%0A
-#from temporal_memory.temporal_memory_apical_tiebreak import TemporalMemoryApicalTiebreak%0A#from temporal_memory.sequence_memory_apical_tiebreak import SequenceMemoryApicalTiebreak%0A#from temporal_memory.pair_memory_apical_tiebreak import PairMemoryApicalTiebreak%0A%0A
from
|
7958acd24d3bc3c6f91ab6ef946dd7750d119569 | Reduce order to 4 from 5. | examples/step.py | examples/step.py | """PyWENO smooth reconstruction example."""
import math
import numpy
import pyweno.grid
import pyweno.weno
# explicitly define the function f that we will reconstruct ...
def f(x):
if x <= 0.0:
return 1.0
return 0.0
# build weno reconstructor
x = numpy.linspace(-1.0, 1.0, 21)
grid = pyweno.grid.Grid... | Python | 0.999995 | @@ -352,9 +352,9 @@
der=
-5
+4
, gr
@@ -1351,55 +1351,8 @@
'o')
-%0Aplt.plot(grid.centres(), weno.sigma%5B:,4%5D, 'o')
%0A%0Apl
@@ -1427,15 +1427,8 @@
r=3'
-, 'r=4'
%5D)%0A%0A
|
2984c0891006cd4f3e07c78f3d5c0e2efff27a7c | remove traits from NLSModel | lib/neuroimaging/algorithms/statistics/nlsmodel.py | lib/neuroimaging/algorithms/statistics/nlsmodel.py | import numpy as N
import numpy.linalg as L
from neuroimaging import traits
#from neuroimaging.algorithms.statistics import Model
from scipy.sandbox.models.model import Model
class NLSModel(Model, traits.HasTraits):
'''
Class representing a simple nonlinear least squares model.
Its arguments are:
... | Python | 0.000001 | @@ -40,94 +40,8 @@
s L%0A
-from neuroimaging import traits%0A#from neuroimaging.algorithms.statistics import Model%0A
from
@@ -106,26 +106,8 @@
odel
-, traits.HasTraits
):%0A%0A
@@ -759,305 +759,428 @@
-Y = traits.Any()%0A design = traits.Any()%0A theta = traits.Any()%0A f = traits.Any()%0A theta ... |
69ba9731261f79ee6ce8d44a2def2bc0e5d2809d | Set trunk RELEASE_TAG back to None after creation of 0.0a20081123rc release candidate branch. | app/soc/release.py | app/soc/release.py | # Copyright 2008 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 ... | Python | 0 | @@ -2057,22 +2057,10 @@
G =
-'0.0a20081123rc'
+None
%0A%0A
|
ea30119d1a46d863688aa9092d316efdfd193552 | Change make update to make production | deploy.py | deploy.py | """
Takes a project name as the first argument
and a git-branch as the second (optional).
Finds the hostname from a config file, then
uses ssh to deploy the project.
"""
import os
import sys
import json
from fabric.api import env, run, cd
class MissingProjectNameError(Exception):
def __init__(self):
Exce... | Python | 0 | @@ -1454,14 +1454,18 @@
ake
-update
+production
')%0A%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.