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 |
|---|---|---|---|---|---|---|---|
d39dbc227eab571312533ec25bdad1d6542ffac8 | ADD license text | pages/desktop_page.py | pages/desktop_page.py | from gi.repository import Gtk
import common
import gettext
import locale
import logging
def init_localization():
locale.setlocale(locale.LC_ALL, '') # use user's preferred locale
# take first two characters of country code
loc = locale.getlocale()
filename = "../lang/desktop_%s.mo" % locale.getlocale()[0][0:2]... | Python | 0 | @@ -1,12 +1,256 @@
+# Part of ubuntu-easy-config https://github.com/minwook-shin/ubuntu-easy-config%0A#%0A# See LICENSE file for copyright and license details%0A#%0A# This program written for beginner for ubuntu and %22ubuntu Setting%22 by minwook Shin and hedone21, fmowl10%0A%0A
from gi.repo
|
ee487dd220612dfff9cb5e63c602490371e2bdac | Update repo_metadata.py | gitmostwanted/tasks/repo_metadata.py | gitmostwanted/tasks/repo_metadata.py | from gitmostwanted.app import app, db, celery
from gitmostwanted.models.repo import Repo, RepoMean
from gitmostwanted.lib.github import api
from sqlalchemy.sql import func, expression
from datetime import datetime, timedelta
@celery.task()
def metadata_maturity(num_months):
repos = Repo.query\
.filter(Rep... | Python | 0.000002 | @@ -2441,17 +2441,17 @@
worth %3C
-0
+5
).delete
|
6105e355cf0275e00f284ac6658454905a9b9a07 | change import of tfpark | python/chronos/src/bigdl/chronos/forecaster/tfpark_forecaster.py | python/chronos/src/bigdl/chronos/forecaster/tfpark_forecaster.py | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | Python | 0 | @@ -633,11 +633,18 @@
rom
-zoo
+bigdl.orca
.tfp
|
60ecc08395eb266f09aa8587bf38aceb59a2b968 | Update Scramble_String.py | Array/Scramble_String.py | Array/Scramble_String.py | Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
Below is one possible representation of s1 = "great":
great
/ \
gr eat
/ \ / \
g r e at
/ \
a t
To scramble the string, we may choose any non-leaf node an... | Python | 0.000002 | @@ -1,12 +1,16 @@
+%22%22%22%0A
Given a stri
@@ -939,16 +939,20 @@
of s1.%0A%0A
+%22%22%22%0A
class So
|
04def6c69d5ee35edb1b2d7d2d10f7aa18b2eb47 | Move fermi activation flag out of route mapper. | palm/blink_factory.py | palm/blink_factory.py | import numpy
from palm.base.model_factory import ModelFactory
from palm.blink_model import BlinkModel
from palm.blink_state_enumerator import SingleDarkState, DoubleDarkState,\
SingleDarkStateEnumeratorFactory,\
DoubleDarkStateEnumeratorFac... | Python | 0 | @@ -2738,80 +2738,8 @@
AX_A
-,%0A fermi_activation=self.fermi_activation
)%0A
|
4579231595e42674fc53b2869242fd4ac1ff4ff1 | Remove some unneeded code | blaze/datashape/normalization.py | blaze/datashape/normalization.py | # -*- coding: utf-8 -*-
"""
Datashape normalization. This handles Ellipses and broadcasting.
"""
from itertools import chain
from collections import defaultdict, deque
from blaze import error
from . import transform, tzip
from .coretypes import DataShape, Ellipsis, Fixed, CType
#------------------------------------... | Python | 0.000033 | @@ -1183,52 +1183,8 @@
)):%0A
- a, b = normalize_constructors(a, b)%0A
@@ -1573,558 +1573,8 @@
--%0A%0A
-def normalize_constructors(a, b):%0A %22%22%22%0A Normalize a pair (DataShape, CType) constructors by %22promoting%22 the CType%0A to a DataShape.%0A%0A Since a DataShape has at least one ... |
f89f170aa8d672a891547ed7ac77d806cda697c4 | Update TestWebserver.py | emission/tests/netTests/TestWebserver.py | emission/tests/netTests/TestWebserver.py | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import *
import unittest
import json
import sys
import os
import ... | Python | 0.000001 | @@ -2244,61 +2244,8 @@
f):%0A
- import emission.net.api.cfc_webapp as enacw%0A%0A
|
504b527e493ae6ba377671e972338ef4cf58b017 | Remove accidental print statements. | nbviewer/providers/github/tests/test_client.py | nbviewer/providers/github/tests/test_client.py | # encoding: utf-8
import mock
from tornado.httpclient import AsyncHTTPClient
from tornado.testing import AsyncTestCase
from ..client import AsyncGitHubClient
from ....utils import quote
class GithubClientTest(AsyncTestCase):
"""Tests that the github API client makes the correct http requests."""
def setUp(... | Python | 0.000012 | @@ -1246,53 +1246,8 @@
urn%0A
- print beginning%0A print string%0A
|
37e8452ad999f42746be395d193a306f9a893dbf | Update rpc.py | ncclient/operations/third_party/juniper/rpc.py | ncclient/operations/third_party/juniper/rpc.py | from ncclient.xml_ import *
from ncclient.operations.rpc import RPC
from ncclient.operations.rpc import RPCReply
from ncclient.operations.rpc import RPCError
class GetConfiguration(RPC):
def request(self, format='xml', filter=None):
node = new_ele('get-configuration', {'format':format})
if filter ... | Python | 0.000001 | @@ -1191,39 +1191,8 @@
fig%0A
- print to_xml(node)%0A
|
28d306758e1f7704bc7b2e945a428b790e6b6487 | Fix test based on new data from FIRST. | tests/test_datafeed_usfirst_legacy_events.py | tests/test_datafeed_usfirst_legacy_events.py | import unittest2
import datetime
from google.appengine.ext import testbed
from consts.event_type import EventType
from datafeeds.datafeed_usfirst_legacy import DatafeedUsfirstLegacy
class TestDatafeedUsfirstLegacyEvents(unittest2.TestCase):
def setUp(self):
self.testbed = testbed.Testbed()
self... | Python | 0 | @@ -2680,19 +2680,19 @@
_eid, %225
-519
+623
%22)%0A
@@ -2798,16 +2798,202 @@
0%5D.name,
+ %22Alamo Regional%22)%0A%0A self.assertEqual(events%5B1%5D.first_eid, %225519%22)%0A self.assertEqual(events%5B1%5D.event_type_enum, EventType.REGIONAL)%0A self.assertEqual(events%5B1%5D.name,
%22BA... |
8fc2ace83f7c25d5245f0496c3e52adcc2fd71c7 | Fix typo in ResolverNode move alias. | tfx/components/common_nodes/resolver_node.py | tfx/components/common_nodes/resolver_node.py | # Lint as: python2, python3
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python | 0.999044 | @@ -1567,36 +1567,32 @@
esolver.Resolver
-Node
',%0A func_or
|
d6d60b1d44742a3d8c67f1a78562a376a9627c21 | remove features not in django 1.11 | minio_storage/management/commands/minio.py | minio_storage/management/commands/minio.py | import json
import sys
from string import Template
from unittest.mock import patch
import minio.error
from django.core.management.base import BaseCommand, CommandError, no_translations
from django.utils.module_loading import import_string
from minio_storage.policy import Policy
from minio_storage.storage import MinioS... | Python | 0.000001 | @@ -165,25 +165,8 @@
rror
-, no_translations
%0Afro
@@ -2550,29 +2550,8 @@
r)%0A%0A
- @no_translations%0A
|
3c33b9d7ea3736329d3e0939b042db08e6365eb5 | Move experiments to ``experiments`` module | dallinger/version.py | dallinger/version.py | """Dallinger version number."""
__version__ = "3.0.0a1"
| Python | 0.000007 | @@ -45,13 +45,11 @@
= %22
-3.0.0a1
+2.7.0
%22%0A
|
55e55eb7b74def06e3d15e7a4045c5c0a0ed0544 | Fix TcpClient INIT state not returning state | blitz/io/client_states.py | blitz/io/client_states.py | __author__ = 'Will Hart'
import logging
import threading
from blitz.constants import *
class BaseState(object):
"""
A base state diagram which provides a few methods - this should not be directly instantiated.
All methods return a BaseState derived object which should handle future message processing
... | Python | 0 | @@ -4139,32 +4139,52 @@
t.start()
+%0A return self
%0A%0A def reques
|
24e3c8baf5739aead32c3314ecb39edc51de1a5d | Remove entry message to avoid reconnect spam. | bot/grenouille_irc_bot.py | bot/grenouille_irc_bot.py | import logging
import sys
import os
from time import sleep
import irc.bot
import irc.strings
from datetime import datetime, timezone, timedelta
import threading
import xml.etree.ElementTree
class GrenouilleIrcBot(irc.bot.SingleServerIRCBot):
"""The module of the bot responsible for the Twitch (IRC) chat.
Li... | Python | 0 | @@ -1971,93 +1971,8 @@
s')%0A
- connection.privmsg(self.channel, %22Je suis la !grenouille pour vous servir.%22)%0A
|
e7722145dd3074a22e19712cbd916accf8275050 | Fix create new initiative first step | bluebottle/initiatives/models.py | bluebottle/initiatives/models.py | from django.db import models
from django.db.models.deletion import SET_NULL
from django.template.defaultfilters import slugify
from django.forms.models import model_to_dict
from django.utils.translation import ugettext_lazy as _
from djchoices.choices import DjangoChoices, ChoiceItem
from multiselectfield import Multi... | Python | 0.000008 | @@ -6067,17 +6067,38 @@
lug
-== '' and
+in %5B'', 'new'%5D:%0A if
sel
@@ -6106,16 +6106,20 @@
.title:%0A
+
@@ -6154,16 +6154,67 @@
.title)%0A
+ else:%0A self.slug = 'new'
%0A
|
0516ca2a5bfaa162a44f407c13b55ca9487897fe | refresh group/keywords every hour | hortiradar/database/tasks_workers.py | hortiradar/database/tasks_workers.py | from configparser import ConfigParser
from redis import StrictRedis
import ujson as json
from keywords import get_frog, get_keywords
from selderij import app
from tasks_master import insert_tweet
keywords = get_keywords()
config = ConfigParser()
config.read("tasks_workers.ini")
posprob_minimum = config["workers"].... | Python | 0 | @@ -30,16 +30,38 @@
igParser
+%0Afrom time import time
%0A%0Afrom r
@@ -240,16 +240,44 @@
ywords()
+%0Akeywords_sync_time = time()
%0A%0Aconfig
@@ -514,16 +514,16 @@
d_str):%0A
-
%22%22%22F
@@ -578,16 +578,174 @@
eet.%22%22%22%0A
+ global keywords, keywords_sync_time%0A if (time() - keywords_sync_time)... |
2ec6aa75d80dce2dc68d1369173b9a361864409b | update save() | alogator/models.py | alogator/models.py | from django.db import models
from django.core.mail import send_mail
from django.utils import timezone
class LogActor(models.Model):
email = models.CharField(max_length=100,
blank=True,
null=True,
help_text='Alogator will send a messages to this email address.')
active = mo... | Python | 0 | @@ -823,18 +823,39 @@
-if
+try:%0A orig =
self.__
@@ -885,16 +885,96 @@
self.pk)
+%0A except DoesNotExist:%0A pass%0A else:%0A if orig
.mute an
@@ -994,32 +994,36 @@
te:%0A
+
try:%0A
@@ -1019,32 +1019,36 @@
+
... |
ea2e71ffe07fbb1e8a307d4b33e9718d6b9b2576 | Increase closing threshold. | obfsproxy/transports/scramblesuit/state.py | obfsproxy/transports/scramblesuit/state.py | """
Provide a way to store the server's state information on disk.
The server possesses state information which should persist across runs. This
includes key material to encrypt and authenticate session tickets, replay
tables and PRNG seeds. This module provides methods to load, store and
generate such state informa... | Python | 0 | @@ -3790,9 +3790,9 @@
H *
-2
+5
)%0A%0A
|
e8f97a1d8372dd1a351c5e1e22ecc3f288ae130c | Change batch size and epochs for NCF benchmarks | official/recommendation/ncf_keras_benchmark.py | official/recommendation/ncf_keras_benchmark.py | # Copyright 2018 The TensorFlow 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 applica... | Python | 0 | @@ -2838,34 +2838,33 @@
rain_epochs'%5D =
-14
+8
%0A default_fla
@@ -2908,35 +2908,34 @@
'batch_size'%5D =
-160
+99
000%0A default_
@@ -4653,10 +4653,9 @@
%5D =
-14
+8
%0A
@@ -4689,11 +4689,10 @@
%5D =
-160
+99
000%0A
|
6bb45d2e0e2b716c284e747adc1e65324583ea0c | Improve INSDC to SO term mapping | rnacentral_pipeline/databases/data/utils.py | rnacentral_pipeline/databases/data/utils.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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... | Python | 0.000001 | @@ -2360,16 +2360,58 @@
'ncRNA'%0A
+SO_INSDC_MAPPING%5B'SO:0000594'%5D = 'snoRNA'%0A
%0A%0Aclass
|
af073d3cfaddb33d9cb4675c33707a223348e3b8 | fix nans from logs in large models | models/distributions/distributions.py | models/distributions/distributions.py | import math
import theano.tensor as T
# ----------------------------------------------------------------------------
# this is all taken from the parmesan lib
c = - 0.5 * math.log(2*math.pi)
def log_bernoulli(x, p, eps=1e-5):
"""
Compute log pdf of a Bernoulli distribution with success probability p, at valu... | Python | 0 | @@ -2775,10 +2775,8 @@
%0A
- #
lv_
@@ -2864,22 +2864,22 @@
T.exp(l
-og_var
+v_clip
) + eps)
|
993d08b0ca0bcf90af77709e58698b7ecc5ba6b5 | Update log.py | django_tenants/log.py | django_tenants/log.py | import logging
from django.db import connection
class TenantContextFilter(logging.Filter):
"""
Add the current ``schema_name`` and ``domain_url`` to log records.
Thanks to @regolith for the snippet on https://github.com/bernardopires/django-tenant-schemas/issues/248
"""
def filter(self, record):
... | Python | 0.000001 | @@ -445,14 +445,12 @@
l',
-'n
+N
one
-'
)%0A
|
b392649fc0ecdb3e770c60c2043110658b06daeb | Fix pep8 | pastamaker/webhack.py | pastamaker/webhack.py | # -*- encoding: utf-8 -*-
#
# Copyright © 2017 Red Hat, 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 applica... | Python | 0.000001 | @@ -628,16 +628,39 @@
port re%0A
+import sys%0A%0Aimport mock
%0Aimport
@@ -3910,39 +3910,8 @@
_':%0A
- import sys%0A import mock%0A
|
463e6563bcfa63e672ec23231b1a16870b68c56d | Fix __str__ method | pathvalidate/error.py | pathvalidate/error.py | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import enum
from typing import Optional, cast
from ._common import Platform
@enum.unique
class ErrorReason(enum.Enum):
FOUND_ABS_PATH = "FOUND_ABS_PATH"
NULL_NAME = "NULL_NAME"
INVALID_CHARACTER = "INVALID_CHARACTER"
INVALID_LEN... | Python | 0.020279 | @@ -1761,24 +1761,26 @@
if self.
+__
reusable_nam
@@ -1780,16 +1780,28 @@
ble_name
+ is not None
:%0A
|
2756326b134acc6c343be8458870121baed963cb | fix db url | pergamena/settings.py | pergamena/settings.py | # -*- coding: utf-8 -*-
import os
os_env = os.environ
class Config(object):
SECRET_KEY = os_env.get('PERGAMENA_SECRET', 'secret-key') # TODO: Change me
APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory
PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir))
BCRYPT_LOG_RO... | Python | 0.999203 | @@ -639,64 +639,34 @@
I =
-'postgresql://localhost/pergamena_db' # TODO: Change me
+os_env.get('DATABASE_URL')
%0A
|
b7c531220fe7a46ad56eeeb160effe94510ba4b0 | Use handler registration in listener | pg_bawler/listener.py | pg_bawler/listener.py | #!/usr/bin/env python
'''
Listen on given channel for notification.
$ python -m pg_bawler.listener mychannel
If you installed notification trigger with ``pg_bawler.gen_sql`` then
channel is the same as ``tablename`` argument.
'''
import argparse
import asyncio
import importlib
import logging
import sys
import pg... | Python | 0 | @@ -2217,26 +2217,33 @@
istener.
+register_
handler
- =
+(
resolve_
@@ -2263,16 +2263,17 @@
handler)
+)
%0A loo
|
36ae5c9502d8aa7189d2e89c094a18c9891cbb6a | Use PID, which represents stable ID, over ID, which is instance dependent | pg_bridge/pgbridge.py | pg_bridge/pgbridge.py | """
PostGIS bridge
"""
import psycopg2
import json
class PGBMABridge(object):
def __init__(self, layer, conn_args):
self.layer = layer
self.connect(conn_args)
def connect(self, conn_args):
self.conn = psycopg2.connect(host=conn_args['host'],
... | Python | 0 | @@ -1898,16 +1898,17 @@
'SELECT
+p
id FROM
|
77170407ad61370dda87c1ed3f24aa2a50cb4ccc | Access the current line directly from the Document instance instead of calculating it manually | pgcli/key_bindings.py | pgcli/key_bindings.py | import logging
from prompt_toolkit.enums import EditingMode
from prompt_toolkit.keys import Keys
from prompt_toolkit.key_binding.manager import KeyBindingManager
from prompt_toolkit.filters import Condition
from .filters import HasSelectedCompletion
_logger = logging.getLogger(__name__)
def pgcli_bindings(get_vi_mod... | Python | 0 | @@ -1959,213 +1959,15 @@
-line_start = doc.cursor_position + doc.get_start_of_line_position()%0A line_end = doc.cursor_position + doc.get_end_of_line_position()%0A current_line = doc.text%5Bline_start:line_end%5D%0A%0A if
+if doc.
curr
|
e3f7b73ee06301484dbb97209508c5f36a88236f | split Polar/Airfoil data. added more general modification slots for airfoil preprocessing | fusedwind/src/fusedwind/basic_airfoil.py | fusedwind/src/fusedwind/basic_airfoil.py | #!/usr/bin/env python
# encoding: utf-8
from openmdao.main.api import Component, Assembly, VariableTree
from openmdao.main.datatypes.api import Float, Array, Slot, Str, List
# ------- variable trees ---------
class PolarDataVT(VariableTree):
"""airfoil data at a given Reynolds number"""
alpha = Array(unit... | Python | 0 | @@ -619,16 +619,21 @@
= List(
+Slot(
PolarDat
@@ -635,16 +635,17 @@
arDataVT
+)
, desc='
@@ -1862,24 +1862,121 @@
lDataVT()%0A%0A%0A
+class NoModification(ModifyAirfoilBase):%0A%0A def execute(self):%0A self.afOut = self.afIn%0A%0A
%0Aclass ReadA
@@ -2666,24 +2666,25 @@
-------%0A%0A%0A%0A%0A
+%0A
# ... |
ef53285ce0777650dbbadce92ddfdb15e401887a | Add some error tracking hints for sentry | mainapp/functions/geo_functions.py | mainapp/functions/geo_functions.py | import logging
import re
from typing import Optional, Dict, Any, List, Tuple
from django.conf import settings
from geopy import OpenCage, Nominatim, MapBox
from geopy.exc import GeocoderServiceError
from geopy.geocoders.base import Geocoder
from slugify import slugify
logger = logging.getLogger(__name__)
def get_ge... | Python | 0 | @@ -1747,16 +1747,60 @@
rn None%0A
+ # exc_info to help sentry with grouping%0A
logg
@@ -1864,24 +1864,39 @@
as %7Bsearch%7D%22
+, exc_info=True
)%0A return
|
5ff6dffeaf757e360a42e22a9df6d74345a4f418 | Fix panda part imports | malcolm/parts/pandabox/__init__.py | malcolm/parts/pandabox/__init__.py | # Don't import all the parts as they need to be created from
# includes.pandabox.hardware_collection()
from malcolm.parts.pandabox.pandaboxdriverpart import PandABoxDriverPart
| Python | 0.000001 | @@ -1,178 +1,188 @@
#
-Don't import all the parts as they need to be created from%0A# includes.pandabox.hardware_collection()%0Afrom malcolm.parts.pandabox.pandaboxdriverpart import PandABoxDriverPart%0A%0A
+Find all subpackages, MethodMeta decorated callables, and YAML files%0Afrom malcolm.packageutil import prepare... |
29846e0abbd27b05029bb3e937a6bdcbc1f31b0e | Raise an exception when the wpr_archive_info isn't created. | tools/telemetry/telemetry/page/record_wpr.py | tools/telemetry/telemetry/page/record_wpr.py | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import sys
from telemetry import benchmark
from telemetry.core import browser_options
from telemetry.core import discover
from telemetry.core... | Python | 0.0001 | @@ -5904,24 +5904,129 @@
, results):%0A
+ assert self._page_set.wpr_archive_info, (%0A 'Pageset archive_data_file path must be specified.')%0A
self._pa
|
370731942a2b5cdc6e0f712f5ee307f1ee45e488 | Improve memory usage | markovify/chain.py | markovify/chain.py | import random
import itertools
import operator
import bisect
import json
from collections import defaultdict
BEGIN = "___BEGIN__"
END = "___END__"
def accumulate(iterable, func=operator.add):
"""
Cumulative calculations. (Summation, by default.)
Via: https://docs.python.org/3/library/itertools.html#iterto... | Python | 0.000228 | @@ -11,25 +11,8 @@
dom%0A
-import itertools%0A
impo
@@ -52,44 +52,8 @@
json
-%0Afrom collections import defaultdict
%0A%0ABE
@@ -1741,24 +1741,25 @@
lists%22)%0A
+%0A
model =
@@ -1754,53 +1754,136 @@
-model = d
+# Using a D
efault
-dict(lambda: defaultdict(int))
+Dict here would be a lot more co... |
d2fdf0d91f41350347ba460e33cc04aa1e59eb96 | Call the run script from the analysis driver | analysis_driver.py | analysis_driver.py | #! /usr/bin/env python
# Brokers communication between Dakota and SWASH through files.
#
# Arguments:
# $1 is 'params.in' from Dakota
# $2 is 'results.out' returned to Dakota
import sys
import os
import re
import shutil
from subprocess import call
import numpy as np
def read(output_file, variable=None):
"""R... | Python | 0 | @@ -1481,16 +1481,48 @@
'Botlev'
+%0A run_script = 'run_swash.sh'
%0A%0A #
@@ -1854,65 +1854,151 @@
ith
-the new input file.%0A call(%5B'swash_mpi.exe', input_file
+a script containing PBS commands.%0A job_name = 'SWASH-Dakota' + os.path.splitext(os.getcwd())%5B1%5D%0A call(%5B'qsub', '-N', job_name... |
9e95522c847b12a19cff54737a44f569fe2cf6b7 | Add method for getting Candidacy.party_name | opencivicdata/elections/admin/candidacy.py | opencivicdata/elections/admin/candidacy.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom administration panels for Candidacy-related models.
"""
from django import VERSION as django_version
from django.contrib import admin
from opencivicdata.core.admin import base
from .. import models
class CandidacySourceInline(base.LinkInline):
"""
Custo... | Python | 0.000001 | @@ -984,33 +984,32 @@
%0A 'party_
-_
name',%0A '
@@ -1398,17 +1398,11 @@
on__
-start_tim
+dat
e'%0A%0A
@@ -1454,8 +1454,246 @@
,%0A %5D%0A
+%0A def party_name(self, obj):%0A %22%22%22%0A Return the name of the Party associated with the Candidacy.%0A %22%22%22%0A if o... |
ce266cec800fd921f9b4de82fd9f9666ed2df053 | Fix another shit | modules/gy-271/core/get.py | modules/gy-271/core/get.py | # Distributed with a free-will license.
# Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
# HMC5883
# This code is designed to work with the HMC5883_I2CS I2C Mini Module available from ControlEverything.com.
# https://www.controleverything.com/content/Compass?sku=HMC58... | Python | 0.000005 | @@ -431,16 +431,27 @@
ort time
+%0Aimport sys
%0A%0A# Get
|
4fccaeefd67c3c736861870a8fe711a934c96e6d | Add some documentation | mythril/laser/ethereum/transaction.py | mythril/laser/ethereum/transaction.py | import logging
from mythril.laser.ethereum.state import GlobalState, Environment, CalldataType
from mythril.laser.ethereum.cfg import Node, Edge, JumpType
from z3 import BitVec
class CallTransaction:
def __init__(self, callee_address):
self.callee_address = callee_address
self.caller = BitVec("cal... | Python | 0.000001 | @@ -203,43 +203,264 @@
-def __init__(self, callee_address):
+%22%22%22 Represents a call value transaction %22%22%22%0A def __init__(self, callee_address):%0A %22%22%22%0A Constructor for Call transaction, sets up all symbolic parameters%0A :param callee_address: Address of the contract th... |
9f3bf2756debb4534ddcbf538577044e2bae6528 | remove unused import | memopol2/search.py | memopol2/search.py | # -*- coding: utf-8 -*-
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import logging
from django.db.models import signals
from django.conf import settings
from whoosh import fields, index
from whoosh.filedb.filestore import FileStorage
log = logging.getLogger(__name__)
WHOOSH_SCHEMA = fields.Schema(titl... | Python | 0 | @@ -187,23 +187,16 @@
t fields
-, index
%0Afrom wh
|
e995a4725873f0587300aa1d0df6d05c7eaf412c | Move package folder deletion to start of execution | matador/commands/deploy_package.py | matador/commands/deploy_package.py | #!/usr/bin/env python
from .command import Command
from .deploy_ticket import execute_ticket
from matador.session import Session
import subprocess
import os
import shutil
import yaml
from importlib.machinery import SourceFileLoader
class ActionPackage(Command):
def _add_arguments(self, parser):
parser.pr... | Python | 0.000001 | @@ -1045,24 +1045,83 @@
, package)%0A%0A
+ shutil.rmtree(package_folder, ignore_errors=True)%0A%0A
Sess
@@ -2138,33 +2138,17 @@
s.yml')%0A
- try:%0A
+%0A
@@ -2199,20 +2199,16 @@
-
for tick
@@ -2234,20 +2234,16 @@
-
-
execute_
@@ -2300,66 +2300,8 @@
u... |
534437a0d55fccae50a86a95182a0460d07c64da | Increment version number. | mopidy_pandora/__init__.py | mopidy_pandora/__init__.py | from __future__ import absolute_import, division, print_function, unicode_literals
import os
from mopidy import config, ext
__version__ = '0.2.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-Pandora'
ext_name = 'pandora'
version = __version__
def get_default_config(self):
conf_file... | Python | 0.000001 | @@ -139,17 +139,17 @@
= '0.2.
-0
+1
'%0A%0A%0Aclas
|
fa67f0326f9f57bc01b023a266e1f896da617ff7 | make send_mail mockable by importing the module | osmaxx-py/excerptconverter/converter_helper.py | osmaxx-py/excerptconverter/converter_helper.py | from django.contrib import messages
from django.core.mail import send_mail
from django.utils.translation import ugettext_lazy as _
import stored_messages
from osmaxx.excerptexport import models
def module_converter_configuration(name, export_formats, export_options):
"""
:param export_formats example:
... | Python | 0 | @@ -49,21 +49,16 @@
core
-.mail
import
send
@@ -53,21 +53,16 @@
import
-send_
mail%0Afro
@@ -2239,16 +2239,21 @@
+mail.
send_mai
|
bac0b5e09fc172a991fb6b7172025c698c1a23d9 | Add validation that type is type of Rule into MultipleRulesGrammar | grammpy/Grammars/MultipleRulesGrammar.py | grammpy/Grammars/MultipleRulesGrammar.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 15.08.2017 14:40
:Licence GNUv3
Part of grammpy
"""
from .StringGrammar import StringGrammar
from ..HashContainer import HashContainer
from ..IsMethodsRuleExtension import IsMethodsRuleExtension as Rule
class MultipleRulesGrammar(StringGrammar):
def __i... | Python | 0.000045 | @@ -105,16 +105,79 @@
py%0A%0A%22%22%22%0A
+import inspect%0A%0Afrom grammpy.exceptions import NotRuleException
%0Afrom .S
@@ -319,16 +319,40 @@
as Rule
+, IsMethodsRuleExtension
%0A%0A%0Aclass
@@ -965,24 +965,150 @@
i in rules:%0A
+ if not inspect.isclass(i) or not issubclass(i, IsMethodsRuleExtension... |
c26e61ca6e995142a0312800d8cf18a7f21a64ae | add gamma setting to physical DMDs | mpfmc/core/physical_dmd.py | mpfmc/core/physical_dmd.py | """Physical DMD."""
import struct
from kivy.clock import Clock
from kivy.graphics.fbo import Fbo
from kivy.graphics.opengl import glReadPixels, GL_RGB, GL_UNSIGNED_BYTE
from kivy.graphics.texture import Texture
from kivy.uix.effectwidget import EffectWidget, EffectBase
from mpfmc.widgets.dmd import Gain
class Physic... | Python | 0 | @@ -1377,32 +1377,139 @@
brightness'%5D))%0A%0A
+ if self.config%5B'gamma'%5D != 1.0:%0A effect_list.append(Gamma(gamma=self.config%5B'gamma'%5D))%0A%0A
self.eff
@@ -5524,12 +5524,465 @@
%0A '''
+%0A%0Aclass Gamma(EffectBase):%0A %22%22%22GLSL effect to apply a gamma setting to a ... |
f09470679ee831272c97dc0765a43faca5f28e75 | Remove extra newline in bordered() | dodo_commands/framework/util.py | dodo_commands/framework/util.py | # -*- coding: utf-8 -*-
"""Utilities."""
from six.moves import input as raw_input
import os
import sys
def query_yes_no(question, default="yes"):
"""Ask a yes/no question via raw_input() and return their answer.
"question" is a string that is presented to the user.
"default" is the presumed answer if th... | Python | 0.000001 | @@ -2430,12 +2430,5 @@
res)
- + '%5Cn'
%0A
|
6d8b1ea0e459bd3383528fb32e6b1a348b00a9bc | Remove unknown attributes. | phoxpy/server/auth.py | phoxpy/server/auth.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from random import randint
from phoxpy import exceptions
from phoxpy.messages import PhoxRequest, PhoxR... | Python | 0.000002 | @@ -1901,137 +1901,33 @@
nse(
-%0A buildnumber=request.buildnumber,%0A sessionid=request.sessionid,%0A version=request.version%0A
+sessionid=request.sessionid
)%0A
|
a4cc48aa03a5924fb58807b87e69695b69811e6f | fix wiki_vectorize: switch table from wiki to wiki_ratings | src/data_prep/wiki_vectorize.py | src/data_prep/wiki_vectorize.py | from src.utils import article_to_category, glove, remove_templates, clean_categories, clean_links
import string
import numpy as np
class wiki_vectorize():
def __init__(self, user_interactions, content, user_vector_type, content_vector_type, sqlCtx, **support_files):
"""
Class initializer to load t... | Python | 0.00001 | @@ -3765,16 +3765,24 @@
rom wiki
+_ratings
%5C%0A
|
e2cbc0a3acf793ca8c45eb17cb0071a254a7e2b7 | Update parse_indepexpends.py | server/src/datasource/parse_indepexpends.py | server/src/datasource/parse_indepexpends.py | from datasource import fec
from datasource import propublica
import os
FEC_APIKEY = os.getenv('FEC_API_KEY', '')
ProPublica_APIKEY = os.getenv('PP_API_KEY', '')
FecApiObj = fec.FECAPI(FEC_APIKEY)
committees = FecApiObj.get_committees()
PPCampFinObj = propublica.CampaignFinanceAPI(ProPublica_APIKEY)
datafi... | Python | 0 | @@ -311,49 +311,541 @@
Y)%0D%0A
-datafile = open(%22IndepExpends.json%22, 'w')
+PPCongressApi = propublica.CongressAPI(ProPublica_APIKEY)%0D%0Alegislator_index = list()%0D%0Alegislators = PPCongressApi.list_members('house')%5B%22results%22%5D%5B0%5D%5B%22members%22%5D%0D%0Afor legislator in legislators:%0D%0A name ... |
0c450f52bfd30b694cea19a80fed900b22a39b90 | Update nbgrader/plugins/export.py | nbgrader/plugins/export.py | nbgrader/plugins/export.py | from traitlets import Unicode, List
from .base import BasePlugin
from ..api import MissingEntry
class ExportPlugin(BasePlugin):
"""Base class for export plugins."""
to = Unicode("", help="destination to export to").tag(config=True)
student = List([],
help="list of students to export").tag(confi... | Python | 0 | @@ -1437,29 +1437,26 @@
signments =
-False
+%5B%5D
%0A els
|
dc4471a09ecab349f4a7336df4f2a223369b5650 | install gnupg and do not remove gnupg and dpkg | neurodocker/interfaces/neurodebian.py | neurodocker/interfaces/neurodebian.py | """Add Dockerfile instructions to add NeuroDebian repository."""
# Author: Jakub Kaczmarzyk <jakubk@mit.edu>
from neurodocker.utils import check_url, indent, manage_pkgs
class NeuroDebian(object):
"""Object to add NeuroDebian repository.
Parameters
----------
os_codename : str
Operating syst... | Python | 0 | @@ -3106,16 +3106,22 @@
%22dirmngr
+ gnupg
%22%0A
@@ -3448,39 +3448,8 @@
te%22%0A
- %22%5Cn&& %7Bremove%7D%22%0A
|
7341bdd68b697ff13100388f4cf5c67b38144de9 | Clarify log message. | nipype/interfaces/traits_extension.py | nipype/interfaces/traits_extension.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""This module contains Trait classes that we've pulled from the
traits source and fixed due to various bugs. File and Directory are
redefined as the release version had dependencies on TraitsUI, which
we ... | Python | 0.000029 | @@ -2856,16 +2856,19 @@
ndatory
+%25s
output f
@@ -2891,16 +2891,44 @@
d: %25s%22 %25
+%0A (name,
os.path
@@ -2943,25 +2943,17 @@
(value))
-%0A
+)
%0A
|
737342a556b5a008690293839e5bbdabb6d9d329 | delete old rpcmethods | device/rpcmethods.py | device/rpcmethods.py | import crypto
import read
import os
import json
import base64
import traceback
"""
All methods that are RPCs should go here.
"""
ALLOW_LIST = [
"package",
"unpackage",
"whoami",
"test_prompt",
"teapot",
]
# Confirm controller handle.
csc = None
def package(src_uid, dst_uid, message):
"""Encr... | Python | 0.000001 | @@ -2581,1726 +2581,8 @@
%7D%0A%0A
-def encrypt(recipient_uid, message):%0A %22%22%22 Encrypts a message using a one time pad %0A recipient_uid is the id of the recipient. This impacts what pad will be used to encrypt%0A message is the intended message to be encrypted%0A returns a dictionary with keys ci... |
3eb99546062045f3b431b9d6c1c095bed197fedc | Add subscribe_commands method | devicehive/device.py | devicehive/device.py | from devicehive.api_object import ApiObject
from devicehive.command import Command
class Device(ApiObject):
"""Device class."""
ID_KEY = 'id'
NAME_KEY = 'name'
DATA_KEY = 'data'
NETWORK_ID_KEY = 'networkId'
IS_BLOCKED_KEY = 'isBlocked'
def __init__(self, transport, token, device=None):
... | Python | 0.000002 | @@ -5334,28 +5334,1234 @@
port, self._token, command)%0A
+%0A def subscribe_commands(self, names=None, limit=None, timestamp=None):%0A # TODO: finish HTTP support after server changes will be ready.%0A url = 'device/%25s/command/poll' %25 self._id%0A action = 'command/subscribe'%0A reque... |
e751329b8aacdf51b70537be47172386deaded63 | Fix alembic env | alembic/env.py | alembic/env.py | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... | Python | 0.999689 | @@ -647,16 +647,20 @@
m rootio
+.app
import
|
564b434c2fd7fadc5d467fe884e5bd88b794acc3 | Fix config. | sample-config.py | sample-config.py | # -*- coding: utf-8 -*-
"""
Example configuration for GEAStarterKit
"""
##
## Authentication/authorizationc config
import authomatic
from authomatic.providers import oauth2
from collections import OrderedDict
AUTHOMATIC_CONFIG = OrderedDict([
('google', {
'name': 'Google',
'id': 1000,
'... | Python | 0 | @@ -2369,16 +2369,17 @@
('en',
+u
'English
@@ -2393,16 +2393,17 @@
('es',
+u
'Espa%C3%B1ol
@@ -2417,16 +2417,17 @@
('fr',
+u
'Fran%C3%A7ai
|
b76e91c4517e52528f8543fce276ff4b5af9a4f6 | fix temp file creation to something more multiplatform friendly | burp_reports/lib/files.py | burp_reports/lib/files.py | import tempfile
import os
def temp_file(file='temporal'):
"""
return: str with tempfilename
"""
# Append uid to end of filename
file += '_{}'.format(os.getuid())
# Simplified and reutilized core funtionally from python
cache_path = os.path.join(tempfile.gettempdir(), file)
return cach... | Python | 0 | @@ -170,19 +170,21 @@
t(os.get
-uid
+login
())%0A
|
632b86289ef643381c954adeca1f58c78e2aa8d5 | Add documentation for plugins | cactus/plugin/defaults.py | cactus/plugin/defaults.py | #coding:utf-8
# Define no-op plugin methods
def preBuildPage(page, context, data):
return context, data
def postBuildPage(page):
pass
def preBuildStatic(static):
pass
def postBuildStatic(static):
pass
def preBuild(site):
pass
def postBuild(site):
pass
def preDeploy(site):
pass
... | Python | 0 | @@ -85,297 +85,1741 @@
-return context, data%0A%0A%0Adef postBuildPage(page):%0A pass%0A%0A%0Adef preBuildStatic(static):%0A pass%0A%0A%0Adef postBuildStatic(static):%0A pass%0A%0A%0Adef preBuild(site):%0A pass%0A%0Adef postBuild(site):%0A pass%0A%0A%0Adef preDeploy(site):%0A pass%0A%0A%0Adef po... |
04fd80cda56a911289bca20c7ee1bd70ac263bd4 | set readonly from true to false because the cursor is hidded if readonly is true. | call_seq/TextEdit/rich.py | call_seq/TextEdit/rich.py | from PySide import QtCore
import pyqode.python
# public API
from pyqode.python.bootstrapper import Bootstrapper
from pyqode.python.modes import PyAutoCompleteMode
from pyqode.python.modes import CalltipsMode
from pyqode.python.modes import CommentsMode
from pyqode.python.modes import PyCodeCompletionMode, JediComplet... | Python | 0 | @@ -2000,9 +2000,10 @@
nly(
-Tru
+Fals
e)
|
650fb08d6e7269d468bbb38f8e2ff2481583cff4 | fix KeyError and remove 'or' | cliche/cli.py | cliche/cli.py | """:mod:`cliche.cli` --- Command-line interfaces
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import code
import functools
import logging.config
import os
import pathlib
import sys
from alembic.util import CommandError
from click import Path, argument, echo, group, option
from flask import _request_ctx_stack
... | Python | 0.000007 | @@ -5090,33 +5090,35 @@
p.config
-%5B
+.get(
'DEBUG'
-%5D or
+,
True
+)
%0A if
@@ -5170,25 +5170,27 @@
nfig
-%5B
+.get(
'DEBUG'
-%5D or
+,
True
+)
%0A%0A
|
29aed8ce12734ac0489a8b4e4aa9b48ff4a320a7 | fix fail | client/cli.py | client/cli.py | #!/usr/bin/env python
import base64
import sys
import logging
import firehose.common as common
class CLI(common.FirehoseClient):
def __select(self, chums, prompt):
print prompt
for n, chum in enumerate(chums):
print "%02d> %s (%s)" % (n, chum.name, chum.keyid)
inp = raw_input... | Python | 0.000003 | @@ -818,16 +818,19 @@
%25s%3E %22 %25
+my_
chum.nam
|
b2c879b782629fd063dcbcfd98178445ca3e499d | Update migrations to use the common URI function. | dataactcore/migrations/env.py | dataactcore/migrations/env.py | from __future__ import with_statement
from alembic import context
# Load all DB tables into metadata object
# @todo - load these dynamically
from dataactcore.models import (
baseModel, domainModels, fsrs, errorModels, jobModels, stagingModels,
userModel, validationModels)
from dataactcore.config import CONFIG_D... | Python | 0 | @@ -165,22 +165,16 @@
import
-(%0A
baseMode
@@ -178,142 +178,93 @@
odel
-, domainModels, fsrs, errorModels, jobModels, stagingModels,%0A userModel, validationModels)%0Afrom dataactcore.config import CONFIG_DB
+%0Afrom dataactcore.config import CONFIG_DB%0Afrom dataactcore.interfaces.db import dbURI
%0Afro
... |
d0c1dfaa884d96bd930aa07bc88c2929db7f97bd | version 0.61 | lib/version.py | lib/version.py | ELECTRUM_VERSION = "0.60"
SEED_VERSION = 4 # bump this everytime the seed generation is modified
TRANSLATION_ID = 28079 # version of the wiki page
| Python | 0.000001 | @@ -16,17 +16,17 @@
N = %220.6
-0
+1
%22%0ASEED_V
@@ -114,11 +114,11 @@
= 28
-079
+344
# v
|
2135deb7fcc4ebf6ef07e31a957df1b18acb25f5 | Remove JSONRPCServer from console service test | pyethapp/tests/test_console_service.py | pyethapp/tests/test_console_service.py | from itertools import count
import pytest
import serpent
from devp2p.peermanager import PeerManager
import ethereum
from ethereum import tester
from ethereum.ethpow import mine
import ethereum.keys
import ethereum.config
from ethereum.slogging import get_logger
from pyethapp.accounts import Account, AccountsService, mk... | Python | 0 | @@ -529,51 +529,8 @@
ice%0A
-from pyethapp.jsonrpc import JSONRPCServer%0A
from
@@ -3436,23 +3436,8 @@
ice,
- JSONRPCServer,
Con
|
f8ce7d7709c3b83e02dde352b8888f462be572ce | Make event handlers for Debugger non-filters with a priority of 100.0 (they aren't donig any filtering) | circuits/core/debugger.py | circuits/core/debugger.py | # Module: debugger
# Date: 2nd April 2006
# Author: James Mills, prologic at shortcircuit dot net dot au
"""
Debugger component used to debug each event in a system by printing
each event to sys.stderr or to a Logger Component instnace.
"""
import os
import sys
from cStringIO import StringIO
from handlers im... | Python | 0 | @@ -1608,27 +1608,30 @@
ption%22,
-filter=True
+priority=100.0
)%0A de
@@ -2216,19 +2216,22 @@
ler(
-filter=True
+priority=100.0
)%0A
|
3157bbd5cca51ea2ac0c086a9337296c6652fafc | fix url order | citizendialer3000/urls.py | citizendialer3000/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns('citizendialer3000.views',
url(r'^$', 'callcampaign_list', name='call_list'),
url(r'^(?P<slug>[\w\-]+)/$', 'callcampaign_detail', name='call_campaign'),
url(r'^(?P<slug>[\w\-]+)/(?P<bioguide_id>\w+)/$', 'contact_detail', name='call_contact'),
... | Python | 0.982361 | @@ -222,102 +222,8 @@
'),%0A
- url(r'%5E(?P%3Cslug%3E%5B%5Cw%5C-%5D+)/(?P%3Cbioguide_id%3E%5Cw+)/$', 'contact_detail', name='call_contact'),%0A
@@ -550,10 +550,104 @@
mary'),%0A
+ url(r'%5E(?P%3Cslug%3E%5B%5Cw%5C-%5D+)/(?P%3Cbioguide_id%3E%5Cw+)/$', 'contact_detail', name='call_contact'),%0A
)%0A
|
4e42da241c5edc43990778225ad84ae241973770 | Convert unicode in sa engine | ckanserviceprovider/db.py | ckanserviceprovider/db.py | import sqlalchemy as sa
engine = None
metadata = None
jobs_table = None
metadata_table = None
logs_table = None
def setup_db(app):
global engine, metadata
engine = sa.create_engine(app.config.get('SQLALCHEMY_DATABASE_URI'),
echo=app.config.get('SQLALCHEMY_ECHO'))
metadata = ... | Python | 0.999999 | @@ -296,16 +296,68 @@
Y_ECHO')
+,%0A convert_unicode=True
)%0A me
|
302934bfd8b30ee1b33cdfb60ca36021df153746 | improve cleanup process of test by removing the downloaded file | quantecon/util/tests/test_notebooks.py | quantecon/util/tests/test_notebooks.py | """
Tests for Notebook Utilities
Functions
---------
fetch_nb_dependencies
"""
from quantecon.util import fetch_nb_dependencies
import unittest
FILES = ['README.md']
REPO = "https://github.com/QuantEcon/QuantEcon.py"
RAW = "raw"
BRANCH = "master"
class TestNotebookUtils(unittest.TestCase):
def test_fetch_nb_d... | Python | 0 | @@ -139,16 +139,26 @@
unittest
+%0Aimport os
%0A%0AFILES
@@ -783,45 +783,230 @@
NCH)
-%0A self.assertTrue(False in status
+ #First will succeed%0A status = fetch_nb_dependencies(files=FILES, repo=REPO, raw=RAW, branch=BRANCH) #Second should skip%0A self.assertTrue(False in status)%0A%0A de... |
02b7d5416ad55b78e256e58ed6a282681d1df48d | Add required get_model for Haystack 2.0 | readthedocs/projects/search_indexes.py | readthedocs/projects/search_indexes.py | # -*- coding: utf-8-*-
import codecs
import os
from django.utils.html import strip_tags
#from haystack import site
from haystack import indexes
from haystack.fields import CharField
#from celery_haystack.indexes import SearchIndex
from projects.models import File, ImportedFile, Project
import logging
log = logging... | Python | 0 | @@ -691,16 +691,65 @@
l()%5B0%5D%0A%0A
+ def get_model(self):%0A return Project%0A%0A
class Fi
@@ -1066,16 +1066,62 @@
l()%5B0%5D%0A%0A
+ def get_model(self):%0A return File%0A%0A
#Should
@@ -2425,12 +2425,66 @@
rn to_index%0A
+%0A def get_model(self):%0A return ImportedFile%0A
|
96877f2cb706a465c5e7fb4d316dbd82ff2cb432 | add comment | purelyjs/interpreter.py | purelyjs/interpreter.py | from .io import invoke
class Interpreter(object):
known_engines = ['js', 'rhino']
def __init__(self, exes=None):
engines = exes if exes else self.known_engines
self.exe = self.detect(engines)
if not self.exe:
raise ValueError("No js engine could be found, tried: %s"
... | Python | 0 | @@ -443,16 +443,59 @@
ngines:%0A
+ # NOTE: Very platform specific%0A
|
b99ded7ddd0166d88111ced1a648bd9c79a8bbbe | mark xfail of test_get_psm3 (#803) | pvlib/test/test_psm3.py | pvlib/test/test_psm3.py | """
test iotools for PSM3
"""
import os
from pvlib.iotools import psm3
from conftest import needs_pandas_0_22
import numpy as np
import pandas as pd
import pytest
from requests import HTTPError
BASEDIR = os.path.abspath(os.path.dirname(__file__))
PROJDIR = os.path.dirname(BASEDIR)
DATADIR = os.path.join(PROJDIR, 'dat... | Python | 0 | @@ -809,16 +809,48 @@
_KEY'%0A%0A%0A
+@pytest.mark.xfail(strict=True)%0A
@needs_p
|
494e7ae13c7b8c0ef4a65cb0b005578f8a0d2857 | Fix canary command | pwndbg/commands/misc.py | pwndbg/commands/misc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import errno as _errno
import struct
import gdb
import pwndbg as _pwndbg
import pwndbg.arch as _arch
impor... | Python | 0.000011 | @@ -2414,16 +2414,17 @@
auxv =
+_
pwndbg.a
@@ -2441,30 +2441,76 @@
-if 'AT_SECURE' in auxv
+at_random = auxv.get('AT_RANDOM', None)%0A if at_secure is not None
:%0A
@@ -2525,22 +2525,22 @@
int(%22AT_
-SECURE
+RANDOM
=%25#x%22 %25
@@ -2544,24 +2544,16 @@
%25 a
-uxv%5B'AT_SECURE'%5D
+t_secure
)%0A ... |
5aa90e98abcfafa9036f8cc19cd49b33aa638181 | update dev version after 0.26.0 tag [skip ci] | py/desispec/_version.py | py/desispec/_version.py | __version__ = '0.26.0'
| Python | 0 | @@ -14,10 +14,18 @@
'0.26.0
+.dev3104
'%0A
|
b59b0e12a0f5fc83d69d9eaa1f7652e8e1b4ac81 | Improve tuple and list converters | pybinding/utils/misc.py | pybinding/utils/misc.py | from functools import wraps
import numpy as np
def to_tuple(o):
if isinstance(o, (tuple, list)):
return tuple(o)
else:
return o,
def with_defaults(options: dict, defaults_dict: dict=None, **defaults_kwargs):
"""Return a dict where missing keys are filled in by defaults
>>> options ... | Python | 0.000001 | @@ -68,39 +68,129 @@
-if isinstance(o, (tuple, list))
+try:%0A return tuple(o)%0A except TypeError:%0A return (o,) if o is not None else ()%0A%0A%0Adef to_list(o):%0A try
:%0A
@@ -194,37 +194,36 @@
%0A return
-tuple
+list
(o)%0A else:%0A
@@ -211,27 +211,39 @@
ist(o)%0A e
... |
ee5a85df1d2db8babd8d6df6a188137051c3a48e | Change the improvement policies due to reorganizing reggie. | pybo/policies/simple.py | pybo/policies/simple.py | """
Acquisition functions based on the probability or expected value of
improvement.
"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
__all__ = ['EI', 'PI', 'UCB', 'Thompson']
def EI(model, _, xi=0.0):
"""
Expected improveme... | Python | 0 | @@ -378,36 +378,17 @@
-X = model.data%5B0%5D%0A x
+target
=
-X%5B
mode
@@ -393,39 +393,52 @@
del.predict(
-X
+model.data%5B0%5D
)%5B0%5D.
-arg
max()
-%5D
+ + xi
%0A%0A def in
@@ -527,29 +527,30 @@
rovement(X,
-x, xi
+target
, grad)%0A%0A
@@ -693,36 +693,17 @@
-X = model.data%5B0%5D%0A ... |
951817c3852c248a60a9ada242415b3f3e632777 | remove unneeded import | pycket/test/test_ast.py | pycket/test/test_ast.py | import pytest
from pycket.expand import expand, expand_string
from pycket.values import W_Symbol
from pycket.expand import _to_ast, to_ast, parse_module
from pycket.interpreter import (LexicalVar, ModuleVar, Done, CaseLambda,
variable_set, variables_equal,
... | Python | 0.000003 | @@ -2826,58 +2826,8 @@
Env%0A
- from pycket.values import W_PromotableClosure%0A
|
1a8d7797e691bd5959fc8f7cdc0371e39208aee7 | Update version # | pyhindsight/__init__.py | pyhindsight/__init__.py | __author__ = "Ryan Benson"
__version__ = "2.0.5"
__email__ = "ryan@obsidianforensics.com"
| Python | 0 | @@ -41,11 +41,11 @@
%222.
-0.5
+1.0
%22%0A__
|
c8b89d104d5676c006b39825fcdb4a1e80f6515a | Update wingding | pyquirks/quirk_funcs.py | pyquirks/quirk_funcs.py | from random import sample
_wdalpha = {
"!": 9999, "\"": 9986, "#": 9985, "$": 128083, "%": 128365,
"&": 128366, "'": 128367, "(": 9742, ")": 9990, "*": 128386,
"+": 128387, ",": 128234, "-": 128235, ".": 128236, "/": 128237,
"0": 128193, "1": 128194, "2": 128196, "3": 128463, "4": 12846... | Python | 0 | @@ -1276,16 +1276,42 @@
z%22: 8984
+, %22p%22: 128912, %22j%22: 128624
%0A %7D%0A%0A
|
ec6191d63236a130e6a39f2383b7e8a6ae8ec672 | Remove the unexisting import. | pytask/profile/forms.py | pytask/profile/forms.py | import os
from django import forms
from registration.forms import RegistrationFormUniqueEmail
from registration.models import RegistrationProfile
from pytask.utils import make_key
from pytask.profile.models import GENDER_CHOICES, Profile
class CustomRegistrationForm(RegistrationFormUniqueEmail):
"""Used instead... | Python | 0.000012 | @@ -146,42 +146,8 @@
le%0A%0A
-from pytask.utils import make_key%0A
from
|
51ad733a0e69dbb84969df9271a0a1631d67c8d2 | change the inf to nan in the height maps computed by height_rpc_move | python/triangulation.py | python/triangulation.py | #!/usr/bin/env python
import numpy as np
import common
import homography_cropper
def compute_height_map(rpc1, rpc2, H1, H2, disp, mask, height, rpc_err):
"""
Computes a height map from a disparity map, using rpc.
Args:
rpc1, rpc2: paths to the xml files
H1, H2: paths to the files containi... | Python | 0.000001 | @@ -1439,24 +1439,66 @@
ask%0A %22%22%22%0A
+ # write the matrix associated to crop%0A
A = comm
@@ -1527,16 +1527,16 @@
-x, -y)%0A
-
f =
@@ -1649,24 +1649,97 @@
t(H_crop, A)
+%0A%0A # run the height_rpc_move binary%0A tmp_h = common.tmpfile('.tif')
%0A common.
@@ -1835,26 +1835,21 @@
H_cr... |
ff33ac85c6364915f647828692f881ab8c3431cc | Fix parameter URL. | pythonpro/core/views.py | pythonpro/core/views.py | from django.conf import settings
from django.contrib.auth import login, update_session_auth_hash
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import SetPasswordForm
from django.contrib.auth.views import PasswordChangeView, PasswordResetView
from django.http import HttpRespons... | Python | 0 | @@ -1092,20 +1092,21 @@
_source=
-home
+iscas
&utm_med
|
ac30ee4d7a5b91c07f18ab36eb8b1783f32f8045 | Fix reading CPU Timestamps | tools/telemetry/telemetry/core/platform/android_platform_backend.py | tools/telemetry/telemetry/core/platform/android_platform_backend.py | # 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.
import logging
from telemetry.core import exceptions
from telemetry.core import platform
from telemetry.core import util
from telemetry.core.platform im... | Python | 0.000017 | @@ -6184,15 +6184,26 @@
rn '
+%5Cn
'.join(
+%0A
self
|
cd6028a0dc1ea0b5268c5a8520f4e0fb668b8845 | Change default of grid search n_trials to None, so the search will span all discrete combinations | metal/mmtl/aws/grid_search_mmtl.py | metal/mmtl/aws/grid_search_mmtl.py | """
Sample call: python metal/mmtl/aws/mmtl_aws.py --mode run --aws_access_key_id xxx --aws_secret_access_key xxx --keypath ~/personalkeyncalifornia.pem
Sample output:
...
Putting file output/configspace/config_1.json -> config
Putting file output/configspace/config_0.json -> config
Getting file config -> output/1/conf... | Python | 0 | @@ -3733,18 +3733,20 @@
pace, n=
-10
+None
):%0A c
|
c45fc8485935c39af869204f9fc6b0dd6bc0deb1 | Move I/O outside of properties for light/tplink platform (#8699) | homeassistant/components/light/tplink.py | homeassistant/components/light/tplink.py | """
Support for TPLink lights.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/light.tplink/
"""
import logging
from homeassistant.const import (CONF_HOST, CONF_NAME)
from homeassistant.components.light import (
Light, ATTR_BRIGHTNESS, ATTR_COLOR_TEM... | Python | 0 | @@ -1627,24 +1627,88 @@
tate = None%0A
+ self._color_temp = None%0A self._brightness = None%0A
_LOG
@@ -1750,16 +1750,16 @@
Bulb%22)%0A
-
%0A @pr
@@ -2354,25 +2354,24 @@
brightness)%0A
-%0A
self
@@ -2666,296 +2666,31 @@
-if self.smartbulb.is_color:%0A if (self.sm... |
82a9dc620cc20692e5b5c84381be38084f89ad75 | Add device_class to Shelly cover domain (#46894) | homeassistant/components/shelly/cover.py | homeassistant/components/shelly/cover.py | """Cover for Shelly."""
from aioshelly import Block
from homeassistant.components.cover import (
ATTR_POSITION,
SUPPORT_CLOSE,
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
SUPPORT_STOP,
CoverEntity,
)
from homeassistant.core import callback
from . import ShellyDeviceWrapper
from .const import COAP, DAT... | Python | 0 | @@ -102,32 +102,58 @@
ATTR_POSITION,%0A
+ DEVICE_CLASS_SHUTTER,%0A
SUPPORT_CLOS
@@ -2281,16 +2281,148 @@
atures%0A%0A
+ @property%0A def device_class(self) -%3E str:%0A %22%22%22Return the class of the device.%22%22%22%0A return DEVICE_CLASS_SHUTTER%0A%0A
asyn
|
f4d81f450a9c2627438dd4f310448e0d64f4541c | fix tests | mkt/webapps/tests/test_fakedata.py | mkt/webapps/tests/test_fakedata.py | import collections
from nose.tools import eq_, ok_
import mkt.site.tests
from mkt.webapps.fakedata import (fake_app_names, generate_app_data,
generate_app_from_spec)
class TestAppGeneration(mkt.site.tests.TestCase):
def test_tinyset(self):
size = 4
data = list(g... | Python | 0.000001 | @@ -2246,16 +2246,52 @@
'public'
+,%0A description='test app'
)%0A
@@ -2821,32 +2821,68 @@
bled', 'public'%5D
+,%0A description='test app'
)%0A eq_(ap
@@ -3525,16 +3525,52 @@
public'%5D
+,%0A description='test app'
)%0A
|
ea6f60838ae309e5fb0662b2416d3c4450be7823 | correct straight function | design_of_computer_programs_cs212/lesson01/poker_game.py | design_of_computer_programs_cs212/lesson01/poker_game.py |
def poker(hands):
"""Return the best hand: poker([hand,...]) => hand"""
return max(hands, key=hand_rank)
def hand_rank(hand):
"""define a rank for a specific hand"""
ranks = card_ranks(hand)
if straight(ranks) and flush(hand): # straight flush
return (8, max(ranks))
elif k... | Python | 0.000437 | @@ -1299,16 +1299,66 @@
return
+%5B5, 4, 3, 2, 1%5D if ranks == %5B14, 5, 4, 3, 2%5D else
ranks%0A%0A%0A
|
3422967b65838ae7eed1f79e2b9295102d5c18bb | Fix flake8 | hs_core/management/commands/check_bag.py | hs_core/management/commands/check_bag.py | # -*- coding: utf-8 -*-
"""
Generate metadata and bag for a resource from Django
"""
import os
from django.core.management.base import BaseCommand
from hs_core.models import BaseResource
from hs_core.hydroshare.hs_bagit import create_bag_files
from hs_core.tasks import create_bag_by_irods
from django_irods.icommands... | Python | 0 | @@ -3016,33 +3016,32 @@
-
'resourcemap.xml
|
56c3c373563a38991da72bc235d4e3e40e711968 | Use extra space. | remove_duplicates_from_sorted_array.py | remove_duplicates_from_sorted_array.py | #! /usr/bin/env python3
"""
http://oj.leetcode.com/problems/remove-duplicates-from-sorted-array/
Given a sorted array, remove the duplicates in place such that each element
appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with
constant memory.
For ... | Python | 0.000008 | @@ -549,17 +549,17 @@
s(self,
-A
+a
):%0A
@@ -557,33 +557,50 @@
a):%0A
-L
+global A%0A l
= len(
-A
+a
)%0A if
@@ -600,17 +600,17 @@
if
-L
+l
in (0,
@@ -632,17 +632,17 @@
return
-L
+l
%0A
@@ -682,26 +682,132 @@
-while i %3C= L - 2
+B = %5B%5D%0A whi... |
97dbd18e12094820be5985b9daec4ceab4d86116 | Fix getfolders() | offlineimap/repository/LocalStatus.py | offlineimap/repository/LocalStatus.py | # Local status cache repository support
# Copyright (C) 2002 John Goerzen
# <jgoerzen@complete.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or... | Python | 0 | @@ -3242,87 +3242,26 @@
of
-ALL folders on this server.%0A%0A This is currently nowhere used in the code
+all cached folders
.%22%22%22
@@ -3325,24 +3325,51 @@
f._folders%0A%0A
+ self._folders = %5B%5D%0A
for
@@ -3398,32 +3398,32 @@
elf.directory):%0A
+
self
@@ -3435,17 +3435,... |
3ac4ceb808462a6a5702e7764148c7e9720d989f | Add on_delete parameter to all ForeignKey fields | modoboa_pfxadmin_migrate/models.py | modoboa_pfxadmin_migrate/models.py | # coding: utf-8
"""postfixadmin models."""
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# Feel free to rename the models, but don't rename db_table values o... | Python | 0 | @@ -471,16 +471,62 @@
models%0A
+from django.db.models.deletion import CASCADE%0A
%0A%0Aclass
@@ -2699,16 +2699,68 @@
sername'
+,%0A on_delete=CASCADE
)%0A do
@@ -2810,16 +2810,35 @@
'domain'
+, on_delete=CASCADE
)%0A cr
@@ -5972,16 +5972,71 @@
acation'
+,%0A ... |
e16d9bb8e384f29017e588ae347ae000318aeed8 | Remove print statement | ddsc_worker/tasks.py | ddsc_worker/tasks.py | from __future__ import absolute_import
import gzip
import logging
import os
import shutil
import string
import time
from celery.signals import after_setup_task_logger
from celery.utils.log import get_task_logger
from django.conf import settings
#from pandas.io.parsers import read_csv
from ddsc_core.models import Tim... | Python | 0.007015 | @@ -4144,22 +4144,8 @@
ame%0A
- print src%0A
|
c1cbdf20e6c109ff1586f663cab7e24f1716af08 | Make remove-if-exists function public | opwen_email_server/utils/temporary.py | opwen_email_server/utils/temporary.py | from contextlib import contextmanager
from contextlib import suppress
from os import close
from os import remove
from tempfile import mkstemp
from typing import Generator
def create_tempfilename() -> str:
file_descriptor, filename = mkstemp()
close(file_descriptor)
return filename
@contextmanager
def re... | Python | 0.000217 | @@ -411,17 +411,16 @@
-_
remove_i
@@ -440,17 +440,16 @@
)%0A%0A%0Adef
-_
remove_i
|
f238d2f036d79cd9d192b09b05575a71864fb682 | API tests should tearDown in the correct order | moniker/tests/test_api/test_v1/__init__.py | moniker/tests/test_api/test_v1/__init__.py | # Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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 r... | Python | 0.999982 | @@ -1409,73 +1409,73 @@
s
-uper(ApiV1Test, self).tearDown()%0A self.central_service.stop
+elf.central_service.stop()%0A super(ApiV1Test, self).tearDown
()%0A
|
baf149711302fab8a29f32316cc78d7bd3a0f94f | Enable heartbeats by default for non-clustered agents (#385) | cloudify/broker_config.py | cloudify/broker_config.py | ########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... | Python | 0 | @@ -1919,43 +1919,8 @@
= 30
- if config.get('cluster') else None
%0Aif
|
94763abaf573bfd25cad06da0cffc6b94a7dedc8 | Fix a flaw in the old implementation of checking whether the state has changed. | pervert/management/commands/pervert_migrate.py | pervert/management/commands/pervert_migrate.py | import json
from django.core.management.base import BaseCommand, CommandError
from pervert.models import AbstractPervert, SchemaState, PervertError
class Command(BaseCommand):
help = "Registers new schema for Pervert-controlled models"
def handle(self, *args, **options):
states = []
print "Rea... | Python | 0.000002 | @@ -1168,130 +1168,24 @@
tate
-%5B%22fields%22%5D.sort()%0A state%5B%22fks%22%5D.sort()%0A states.append(state)%0A%0A jsonstate = json.dumps(states)
+s.append(state)%0A
%0A
@@ -1297,16 +1297,27 @@
+json.loads(
SchemaSt
@@ -1358,21 +1358,19 @@
tate
+)
==
-json
state
+s
... |
24c83211588ac71492640ce43e3a893e05466a54 | Change old membership migration to null | amy/workshops/migrations/0065_multiple_memberships.py | amy/workshops/migrations/0065_multiple_memberships.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('workshops', '0064_membership'),
]
operations = [
migrations.RemoveField(
model_... | Python | 0 | @@ -706,16 +706,27 @@
ps.Host'
+, null=True
),%0A
|
c267a580ca2179722d31941f4d02e2c67093769b | Add temporary streaming mechanism for output files | dockci/views/build.py | dockci/views/build.py | """
Views related to build management
"""
import logging
import mimetypes
import os.path
import re
from flask import (abort,
flash,
redirect,
render_template,
request,
Response,
url_for,
... | Python | 0 | @@ -92,16 +92,30 @@
mport re
+%0Aimport select
%0A%0Afrom f
@@ -3108,16 +3108,17 @@
ld data%0A
+%0A
@@ -3125,16 +3125,280 @@
+#if build.state == 'running' and filename == %22%25s.log%22 %25 build.build_stage_slugs%5B-1%5D:%0A if filename == %22%25s.log%22 %25 build.build_stage_slug... |
9bc8b9967631064821112b5c7ff3b65fb0b176f6 | Fix wrong column name in db migration script of ryu plugin | neutron/db/migration/alembic_migrations/versions/5a875d0e5c_ryu.py | neutron/db/migration/alembic_migrations/versions/5a875d0e5c_ryu.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 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 | @@ -1487,36 +1487,38 @@
sa.Column('
-last
+tunnel
_key', sa.Intege
@@ -1721,36 +1721,38 @@
yKeyConstraint('
-last
+tunnel
_key')%0A )%0A%0A
|
687681724202949105a476254f7a122171b2cf3e | Update existing objects on reimport when the ID is the same. | open511/management/commands/import_xml_roadevents.py | open511/management/commands/import_xml_roadevents.py | import datetime
import logging
import sys
from django.contrib.gis.geos import fromstr as geos_geom_from_string
from django.core.management.base import BaseCommand, CommandError
from lxml import etree
from open511.models import RoadEvent
from open511.utils.postgis import gml_to_ewkt
from open511.utils.serialization i... | Python | 0 | @@ -714,74 +714,230 @@
-rdev = RoadEvent()%0A rdev.source_id = event.get('id'
+source_id = event.get('id')%0A try:%0A rdev = RoadEvent.objects.get(source_id=source_id)%0A except RoadEvent.DoesNotExist:%0A rdev = RoadEvent(source_id... |
927fcfaca3a07f46566d2c48d61ea96d380e88bc | Update validator in cancellation view | openprocurement/tender/limited/views/cancellation.py | openprocurement/tender/limited/views/cancellation.py | # -*- coding: utf-8 -*-
from openprocurement.api.utils import (
json_view, context_unpack, APIResource, get_now, error_handler
)
from openprocurement.tender.core.utils import (
apply_patch, save_tender, optendersresource
)
from openprocurement.tender.core.validation import (
validate_cancellation_data, va... | Python | 0 | @@ -110,28 +110,36 @@
et_now,
-error_handle
+raise_operation_erro
r%0A)%0A%0Afro
@@ -4462,71 +4462,42 @@
-self.request.errors.add(%0A 'body', 'data'
+raise_operation_error(self.request
, 'C
@@ -4581,122 +4581,8 @@
n))%0A
- self.request.errors.status = 403%0A ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.