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 |
|---|---|---|---|---|---|---|---|
5f57501192275b4c996d8da5aef6ec847969509c | Fix up the datastore path | djangae/boot.py | djangae/boot.py | import logging
import os
import sys
def setup_datastore_stubs():
if "test" in sys.argv:
return
from google.appengine.datastore import datastore_sqlite_stub
from google.appengine.api import apiproxy_stub_map
from google.appengine.datastore import datastore_stub_util
app_id = application_id... | Python | 0.998288 | @@ -445,16 +445,19 @@
atastore
+.db
%22),%0A
|
dfce5d05c2d573da499af90074bddaa39ee67e57 | Fix 'str' object has no attribute 'open' | dotsecrets/main.py | dotsecrets/main.py | #!/usr/bin/env python3
import argparse
import logging
import sys
from dotsecrets.clean import clean
from dotsecrets.init import init
from dotsecrets.metadata import VERSION
from dotsecrets.smudge import smudge
from dotsecrets.stow import stow, unstow
from dotsecrets.test import test
logger = logging.getLogger()
log... | Python | 0.999985 | @@ -59,16 +59,42 @@
rt sys%0A%0A
+from pathlib import Path%0A%0A
from dot
@@ -2000,24 +2000,35 @@
s from FILE'
+, type=Path
)%0A%0A store
@@ -2193,16 +2193,27 @@
om FILE'
+, type=Path
)%0A%0A i
|
ee5eb198f4190859570175d7a6cff5cd47925676 | Improve performance adding curies. | dougrain/drafts.py | dougrain/drafts.py | # Copyright (c) 2013 Will Harris
# See the file license.txt for copying permission.
"""Draft-specific behaviours.
This module represents the differences between drafts of the HAL specification
and provides a mechanism for specifying the backwards-compatibility behavior of
Document instances.
Calling code is expected ... | Python | 0 | @@ -2036,33 +2036,37 @@
doc.
-add_link(
+o%5BLINKS_KEY%5D%5B
self.curies_
@@ -2068,35 +2068,66 @@
ries_rel
-,
+%5D.append(%0A %7B'href':
href,
+'
name
-=
+':
name,
+'
template
@@ -2119,37 +2119,39 @@
name, 'templated
-=
+':
True
+%7D
)%0A%0A%0Aclass Draft5
|
3d813e9960a44bfacd94551b95caf489b85ea3bb | Fix typo in upgrade script | trac/upgrades/db11.py | trac/upgrades/db11.py | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | Python | 0.000731 | @@ -1111,24 +1111,25 @@
efault_macro
+s
_dir__ as ma
@@ -1127,24 +1127,25 @@
r__ as macro
+s
_dir%0A for
@@ -1162,24 +1162,25 @@
istdir(macro
+s
_dir):%0A
@@ -1261,16 +1261,17 @@
in(macro
+s
_dir, f)
|
36f5789686f16e463f76843664c654465c52d406 | add comment disabling tasks | ummeli/vlive/tasks.py | ummeli/vlive/tasks.py | from celery.task import task
from celery.task.sets import TaskSet
from vumiclient.client import Client
from django.conf import settings
from django.core.mail import send_mail, EmailMessage
@task(ignore_result=True)
def send_password_reset(msisdn, new_password):
message = 'Ummeli on YAL :) Your new password is: %s... | Python | 0 | @@ -183,16 +183,57 @@
Message%0A
+from jmboarticles.models import Article%0A%0A
%0A@task(i
@@ -541,16 +541,17 @@
ssage)%0A%0A
+%0A
@task(ig
@@ -857,13 +857,9 @@
se)%0A
-
%0A
+
%0Adef
@@ -950,24 +950,24 @@
I_PASSWORD)%0A
-
client.s
@@ -1015,24 +1015,321 @@
'1', message = message)
+%0A%0A%0Adef disable... |
3da31e3262ee3b07e96efa4eca381953ff1de169 | Remove APIRouterV3 | nova/api/openstack/compute/__init__.py | nova/api/openstack/compute/__init__.py | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | Python | 0.000003 | @@ -7327,897 +7327,4 @@
nfo%0A
-%0A%0A# NOTE(oomichi): Now v3 API tests use APIRouterV3. After moving all v3%0A# API extensions to v2.1 API, we can remove this class.%0Aclass APIRouterV3(nova.api.openstack.APIRouterV21):%0A %22%22%22Routes requests on the OpenStack API to the appropriate controller%0A and method... |
e521b16844efc2853c0db9014098cb3e37f6eb04 | Add missing returns to the array API sorting functions | numpy/_array_api/_sorting_functions.py | numpy/_array_api/_sorting_functions.py | def argsort(x, /, *, axis=-1, descending=False, stable=True):
from .. import argsort
from .. import flip
# Note: this keyword argument is different, and the default is different.
kind = 'stable' if stable else 'quicksort'
res = argsort(x, axis=axis, kind=kind)
if descending:
res = flip(r... | Python | 0.000002 | @@ -327,16 +327,31 @@
is=axis)
+%0A return res
%0A%0Adef so
@@ -650,28 +650,43 @@
res = flip(res, axis=axis)%0A
+ return res%0A
|
f6715a47447a3fd22d62d6f9309d1d9a156b5a85 | Bump version. | pudb/__init__.py | pudb/__init__.py | VERSION = "0.92.5"
CURRENT_DEBUGGER = [None]
def set_trace():
if CURRENT_DEBUGGER[0] is None:
from pudb.debugger import Debugger
dbg = Debugger()
CURRENT_DEBUGGER[0] = dbg
import sys
dbg.set_trace(sys._getframe().f_back)
def post_mortem(t):
p = Debugger()
p.r... | Python | 0 | @@ -13,9 +13,9 @@
.92.
-5
+6
%22%0A%0A%0A
|
68e6a05718fa01032200200876115c17d1f69bce | Add 'atacam' interface type to pySMART. | pySMART/utils.py | pySMART/utils.py | # Copyright (C) 2014 Marc Herndon
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; wi... | Python | 0 | @@ -1826,16 +1826,40 @@
: 'scsi'
+,%0A 'atacam': 'atacam'
%0A%7D%0A%22%22%22%0A*
|
6e3649bd13cd6dbbf9ad6d446e1a0ed030d24e56 | Add AWS support to rd_server. | rd_server.py | rd_server.py | #!/usr/bin/env python3
import tornado.ioloop
import tornado.web
import os
import codecs
import json
import argparse
import sshslot
import threading
from work import *
from utility import *
video_sets_f = codecs.open('sets.json','r',encoding='utf-8')
video_sets = json.load(video_sets_f)
machines = []
slots = []
taken... | Python | 0 | @@ -142,16 +142,33 @@
reading%0A
+import awsremote%0A
from wor
@@ -2441,16 +2441,73 @@
t=4000)%0A
+ parser.add_argument('-awsgroup', default='AOM Test')%0A
args
@@ -2768,16 +2768,86 @@
ath'%5D))%0A
+ else:%0A machines = awsremote.get_machines(3, args.awsgroup)%0A
for
|
b33ddd2e178e3cf869e0ce56162fd05b6daafd26 | Fix missing variable | src/syft/core/common/serializable.py | src/syft/core/common/serializable.py | # external lib imports
import json
# external class/method imports
from google.protobuf import json_format
# syft import
from syft.util import index_syft_by_module_name
from syft.util import get_fully_qualified_name
from syft.core.common.lazy_structures import LazyDict
class Serializable(object):
def __init__(s... | Python | 0.998703 | @@ -4222,22 +4222,36 @@
able%22)%0A%0A
-string
+fully_qualified_name
2type =
|
d67213da48b8e9b0add96bb5be5f897c9375399a | fix missing variable | hpsspy/scan/process_missing.py | hpsspy/scan/process_missing.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
def process_missing(missing_cache,disk_root,hpss_root,dirmode='2770'):
"""Convert missing files into HPSS commands.
Parameters
----------
missing_cache : str
Name of a JSON file containing the missing file d... | Python | 0.000424 | @@ -2219,37 +2219,47 @@
'-m', dirmode,
-h_
dir
+name(h_file)
)%0A
|
89a79cebab258da237492344a481e070bd4f6657 | Fix bootstrap error | conjureup/controllers/newcloud/gui.py | conjureup/controllers/newcloud/gui.py | import json
import os
import os.path as path
from functools import partial
from subprocess import check_output
from conjureup import async, controllers, juju, utils
from conjureup.api.models import model_info
from conjureup.app_config import app
from conjureup.models.provider import load_schema
from conjureup.telemetr... | Python | 0.000015 | @@ -1381,40 +1381,33 @@
on(%22
-Bootstrap error: %7B%7D%22.format(err)
+Juju failed to bootstrap%22
)%0A
|
8ee8f2b34b8df168a4d3f2664a9f418469079723 | Use Pendulum's built-in UTC object (#21732) | airflow/example_dags/plugins/workday.py | airflow/example_dags/plugins/workday.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | Python | 0 | @@ -969,16 +969,21 @@
m import
+ UTC,
Date, D
@@ -999,18 +999,8 @@
Time
-, timezone
%0A%0Afr
@@ -1047,16 +1047,16 @@
wPlugin%0A
+
from air
@@ -1141,133 +1141,8 @@
le%0A%0A
-# MyPy Does not recognize callable modules https://github.com/python/mypy/issues/9240%0AUTC = timezone(%22UTC%22) # type: ignore%0A%0A
%0... |
12d71e50d335f8a095e3049af333112204d45775 | Remove unused import from singleton | sympy/core/singleton.py | sympy/core/singleton.py | """Singleton mechanism"""
from core import BasicMeta, Registry
from sympify import sympify
from basic import Basic
class SingletonRegistry(Registry):
"""
A map between singleton classes and the corresponding instances.
E.g. S.Exp == C.Exp()
"""
__slots__ = []
__call__ = staticmethod(sympify)
... | Python | 0 | @@ -88,32 +88,8 @@
pify
-%0Afrom basic import Basic
%0A%0Acl
|
8846f410ffdc707e648d6786dd31247f0412eccf | Update version.py | packtools/version.py | packtools/version.py | """Single source to the version across setup.py and the whole project.
"""
from __future__ import unicode_literals
__version__ = '2.10.0'
| Python | 0.000001 | @@ -128,11 +128,11 @@
= '2.10.
-0
+2
'%0A
|
f57511df7de901f3694fa4225af458e192975299 | Fix PdfDict: __getattr__, not __getattribute__ | pdf_parser/pdf_types/compound_types.py | pdf_parser/pdf_types/compound_types.py | from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(self, *args, **kwa... | Python | 0.000007 | @@ -336,21 +336,16 @@
_getattr
-ibute
__(self,
|
e8fdc11c227c47ed2d26ce5516bad305a63c64d9 | update migration for django 2 compatibility | aldryn_video/migrations/0001_initial.py | aldryn_video/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('cms', '0015_auto_20160421_0000'),
('contenttypes', '0001_initial'),
]
operations = [
migrati... | Python | 0 | @@ -448,98 +448,263 @@
eld(
-parent_link=True, auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin'
+%0A parent_link=True,%0A auto_created=True,%0A primary_key=True,%0A serialize=False,%0A to='cms.CMSPlug... |
ca62d6fef8ecc5b11a28d955942ba267f3ab3f78 | Revert changes in unit tests | skopt/tests/test_transformers.py | skopt/tests/test_transformers.py | import pytest
import numbers
import numpy as np
from numpy.testing import assert_raises
from numpy.testing import assert_array_equal
from numpy.testing import assert_equal
from numpy.testing import assert_raises_regex
from skopt.space import LogN, Normalize
from skopt.space.transformers import StringEncoder, LabelEncod... | Python | 0 | @@ -3101,17 +3101,17 @@
sform, 2
-1
+0
.6)%0A
@@ -3331,33 +3331,33 @@
nsform, 1. + 1e-
-5
+6
)%0A assert_rai
@@ -3399,25 +3399,25 @@
rm, 0. - 1e-
-5
+6
)%0A transf
@@ -3802,25 +3802,25 @@
m, 20. + 1e-
-5
+6
)%0A assert
@@ -3867,25 +3867,25 @@
m, 1.0 - 1e-
-5
+6
)%0A assert
@@ -3943,17 +3943,17... |
b483064e348b5b1788798d656573e8fd9ce72b5b | version 1.2 | pam_typtop/config.py | pam_typtop/config.py | VERSION = "1.1.3"
DB_NAME = ".typoToler"
SEC_DB_PATH = '/etc/pam_typtop'
SEC_DB_NAME = DB_NAME + ".ro" # READ_ONLY // ROOT_ONLY
ORIG_SK_SALT = 'OriginalPwSaltForEncSecretKey'
ORIG_PW_CTX = 'OrignalPwCtx'
ORIG_PW_ENTROPY_CTX = 'OrgignalPwEntropyCtx'
HMAC_SALT_CTX = 'HMACSaltCtx'
ORIG_PW_ID = 'OrgPwID'
ORIG_PW_ENC_PK = ... | Python | 0.000001 | @@ -10,11 +10,9 @@
%221.
-1.3
+2
%22%0ADB
|
6c88e7cb287d8d47efcfe4e3c9e1fcf8fae01916 | add a testcase for exported SPICE subcircuit file | skrf/tests/test_vectorfitting.py | skrf/tests/test_vectorfitting.py | import unittest
import skrf
import numpy as np
class VectorFittingTestCase(unittest.TestCase):
def test_vectorfitting_ring_slot(self):
# expected fitting parameters for skrf.data.ring_slot with 2 initial real poles
expected_poles = np.array([-7.80605445e+10+5.32645184e+11j])
expected_zero... | Python | 0 | @@ -40,16 +40,32 @@
y as np%0A
+import tempfile%0A
%0A%0Aclass
@@ -3135,24 +3135,601 @@
bs %3C 0.01)%0A%0A
+ def test_spice_subcircuit(self):%0A # fit ring slot example network%0A nw = skrf.data.ring_slot%0A vf = skrf.vectorFitting.VectorFitting(nw)%0A vf.vector_fit(n_poles_real=4, n_... |
5f483fab02473617a62a35b54fc9d964e5a607f4 | raise N in pchoice test | hyperopt/tests/test_pchoice.py | hyperopt/tests/test_pchoice.py | from functools import partial
import numpy as np
import unittest
from hyperopt import hp, Trials, fmin, tpe, anneal, rand
import hyperopt.pyll.stochastic
class TestPChoice(unittest.TestCase):
def test_basic(self):
space = hp.pchoice('naive_type',
[(.14, 'gaussian'),
(.02,... | Python | 0.000008 | @@ -3054,16 +3054,17 @@
N =
+1
50%0A
|
7211dd0449f413fcf2dab5db8dca41a5c3bacf56 | add short description of xml_driver | lib/xml_driver.py | lib/xml_driver.py | #!/usr/bin/env python
import re
from itertools import chain, izip
from collections import deque
from xml.sax import make_parser, handler, saxutils
from cgi import escape
class ChainList(list):
"""
This is the base structure that handles the tree created by XMLElement
and XMLHandler. Overriding __getattr__... | Python | 0.000023 | @@ -16,16 +16,230 @@
python%0A%0A
+%22%22%22%0AGeneral purpose XML parsing driver for use as a content handler through%0APython's xml.sax module. Works in conjunction with lib/xml_util.py, which%0Aprovides useful helper methods to handle the parsed data.%0A%22%22%22%0A%0A
import r
|
2ebca418d8538ce3d0f782994083c1ebab6e6a87 | Fix escaping pattern | pyhiccup/core.py | pyhiccup/core.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... | Python | 0.000728 | @@ -1100,14 +1100,12 @@
%25s=%5C
-%5C
%22%25s%5C
-%5C
%22' %25
|
daca7d588436c065d2cdcddb2b0503f060fdc5e1 | order documents by -modified_at by default | ideasbox/mediacenter/models.py | ideasbox/mediacenter/models.py | from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
from taggit.managers import TaggableManager
from ideasbox.models import TimeStampedModel
from ideasbox.search.models import SearchableQuerySet, SearchMixin... | Python | 0 | @@ -1852,16 +1852,71 @@
=True)%0A%0A
+ class Meta:%0A ordering = %5B%22-modified_at%22, %5D%0A%0A
def
|
13419d1c3f36b7c0eee2350b253858e9d926d973 | Fix a false log | smarkets/streaming_api/client.py | smarkets/streaming_api/client.py | "Smarkets API client"
# Copyright (C) 2011 Smarkets Limited <support@smarkets.com>
#
# This module is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
import logging
import sys
from smarkets.signal import Signal
from smarkets.streaming_api import eto
from smarkets.streaming_api impo... | Python | 0.999919 | @@ -5106,32 +5106,46 @@
back %25s%22, name)%0A
+ else:%0A
self
|
6956048f1f2fe6cf2cdffb9f2618664d57f65f7c | Revise _flag to _bool | ds_ordered_list.py | ds_ordered_list.py | from __future__ import print_function
class Node(object):
"""Node class as building block for linked list."""
def __init__(self, init_data):
self.data = init_data
self.next = None
def get_data(self):
return self.data
def get_next(self):
return self.next
def set_d... | Python | 0.999999 | @@ -1341,36 +1341,36 @@
ne%0A stop_
-flag
+bool
= False%0A
@@ -1418,20 +1418,20 @@
ot stop_
-flag
+bool
:%0A
@@ -1479,36 +1479,36 @@
stop_
-flag
+bool
= True%0A
@@ -1940,36 +1940,36 @@
e%0A found_
-flag
+bool
= False%0A%0A
@@ -1978,36 +1978,36 @@
while not... |
3cb6a475008dfa4eacb1f25175737dbf0754eee2 | Fix error when logging removal of soft-deleted project | src/waldur_mastermind/support/log.py | src/waldur_mastermind/support/log.py | from waldur_core.logging.loggers import EventLogger, event_logger
from waldur_core.structure.models import Project
from waldur_core.structure.permissions import _get_project
from . import models
def get_issue_scopes(issue):
result = set()
if issue.resource:
project = _get_project(issue.resource)
... | Python | 0.000001 | @@ -429,16 +429,19 @@
.project
+_id
:%0A
@@ -434,32 +434,149 @@
ect_id:%0A
+project = Project.all_objects.get(%0A id=issue.project_id%0A ) # handle soft-deleted projects%0A
result.add(issue
@@ -570,22 +570,16 @@
ult.add(
-issue.
project)
|
078acaf076f9c3e6af71e047cbc77ed45d088f05 | add template_sufix conf support | dtrans/__init__.py | dtrans/__init__.py | # -*- coding: UTF-8 -*-
"""
Utils lib.
Copyright (C) 2012 Corp B2C S.A.C.
Authors:
Nicolas Valcarcel Scerpella <nvalcarcel@corpb2c.com>
"""
# std imports
# 3rd party imports
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models import get_app
from django.... | Python | 0 | @@ -2014,24 +2014,377 @@
mf_class%0A%0A%0A
+def get_template(app_name. model_name):%0A template_name = '%25s_%25s.html' %25 (app_name, model_name)%0A%0A if hasattr(settings, 'DTRANS_CONF'):%0A conf = settings.DTRANS_CONF%0A%0A if 'template_sufix' in conf:%0A template_name = '%25s_%25s_%... |
070b532b041cec627b9823e8030c3e8d974e18c4 | prepare 1.6.0 | easyci/__init__.py | easyci/__init__.py | __version__ = '1.5.0'
| Python | 0.000018 | @@ -14,9 +14,9 @@
'1.
-5
+6
.0'%0A
|
ae5591de01e00a018c302d4eb5afd1831fbd0812 | add phone number | ed/kernel_panic.py | ed/kernel_panic.py | from utils import detect_string, gen_hashcode, jsonify_headers
import time
KERNEL_PANIC = [
r"(kernel BUG at[^\n]+)",
r"(spinlock bad magic)",
r"(Unable to handle kernel[^\n]+)",
r"(modem subsystem failure reason:.*Could not turn on the UNIV_STMR ustmr_qtimer_off_counter)",
r"(\w+ subsystem failur... | Python | 0.000567 | @@ -60,20 +60,8 @@
ers%0A
-import time%0A
%0A%0AKE
@@ -1005,64 +1005,8 @@
on:%0A
- result%5B%22random%22%5D = str(time.time())%0A
@@ -1168,16 +1168,32 @@
s', 'sn'
+, 'phone_number'
%5D:%0A
|
f07f53458ec9e6b13eaec42b56537c7c7e2b00b4 | break Applictaion out into its own module | pyweek12/main.py | pyweek12/main.py |
import sys
import pyglet
from pyglet.event import EVENT_HANDLED
from .camera import Camera
from .cameraman import CameraMan
from .collide import Collide
from .color import Color
from .items.greenery import Tree, Weed, Flower, Fronds
from .items.hudmessage import LivesMessage, TimeMessage
from .items.portals import E... | Python | 0.000001 | @@ -1,16 +1,4 @@
-%0Aimport sys%0A
%0Aimp
@@ -12,136 +12,45 @@
let%0A
+%0A
from
-pyglet.event import EVENT_HANDLED%0A%0Afrom .camera import Camera%0Afrom .cameraman import CameraMan%0Afrom .collide import Collide
+.application import Application
%0Afro
@@ -283,120 +283,8 @@
all%0A
-from .keyboard import Keyboard%... |
63f996ae03cf3991d12070c20fe57e4cf4e8213d | bump version | qgitc/version.py | qgitc/version.py | # -*- coding: utf-8 -*-
VERSION_MAJOR = 3
VERSION_MINOR = 0
VERSION_PATCH = 0
VERSION = "{}.{}.{}".format(VERSION_MAJOR,
VERSION_MINOR,
VERSION_PATCH)
| Python | 0 | @@ -71,17 +71,17 @@
PATCH =
-0
+1
%0AVERSION
|
b532e7e1c8e5fe1fa705e9fd438134ac1001d771 | Refactor estimator module | qnd/estimator.py | qnd/estimator.py | import functools
import inspect
import tensorflow as tf
import tensorflow.contrib.learn as learn
from . import util
from .config import def_config
def def_estimator(distributed=False):
config = def_config(distributed)
@util.func_scope
def estimator(model_fn, model_dir):
return tf.contrib.learn.... | Python | 0 | @@ -24,16 +24,30 @@
inspect
+%0Aimport typing
%0A%0Aimport
@@ -1447,15 +1447,51 @@
-if (not
+return (%0A results%0A if
isi
@@ -1544,16 +1544,21 @@
elFnOps)
+ else
%0A
@@ -1566,100 +1566,73 @@
- and not isinstance(results, tuple)):%0A results = (results,)%0A%... |
8627b014652db5da52308df2dea563bce26052d5 | Fix the max characters on Daruma DR700 | stoqdrivers/printers/daruma/DR700.py | stoqdrivers/printers/daruma/DR700.py | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2015 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU Lesser General Public License as published by
## the Free Software F... | Python | 0.000109 | @@ -1356,17 +1356,17 @@
ters = 5
-8
+7
%0A%0A de
|
4af41255a18130d3a54194308e395b28bf479bc5 | Add TODOs regarding data dependencies for flow expiry | sts/happensbefore/hb_shadow_table.py | sts/happensbefore/hb_shadow_table.py | """
Shadow flow table for tracking read-after-write dependencies
"""
from collections import defaultdict
from bisect import bisect_left
from pox.openflow.flow_table import FlowTableModification
from hb_json_event import *
from hb_events import *
from hb_sts_events import *
from hb_utils import compare_flow_table
fr... | Python | 0 | @@ -6346,32 +6346,377 @@
== 1%0A %0A
+ # TODO(jm): Instead of merely removing entries, we should also add a%0A # data dependency edge here like for reads and writes.%0A # Also see TODOs in hb_logger and hb_graph on how to do this%0A # correctly... |
9c5bd21ae44f81255815ce0d184c4e1319e8f415 | Add GUI imports to qtui/__init__.py | qtui/__init__.py | qtui/__init__.py | Python | 0.000003 | @@ -0,0 +1,343 @@
+from PyQt4 import QtCore, QtGui%0Afrom PyQt4.QtCore import *%0Afrom PyQt4.QtGui import *%0A%0Afrom metamarket_qt import *%0Afrom view_ident_dialog import *%0Afrom view_offer_dialog import *%0Afrom view_market_dialog import *%0Afrom view_chanmsg_dialog import *%0Afrom import_market_dialog import *%0Af... | |
4adc4b4b3398a03909d069a6ad1af2203e958c1d | Make quark compile be more friendly towards Eclipse | quark/command.py | quark/command.py | # Copyright 2015 datawire. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | Python | 0 | @@ -4118,102 +4118,8 @@
t)%22)
-%0A if os.path.exists(output):%0A shutil.rmtree(output)%0A os.mkdir(output)
%0A%0A
@@ -4228,32 +4228,32 @@
--python-out%22%5D)%0A
-
js_dir =
@@ -4297,24 +4297,288 @@
ipt-out%22%5D)%0A%0A
+ if os.path.exists(output):%0A for dir in ... |
1fcb98f9aee0d580bab42f233ee11d34891cb17b | Fix XLSX import | tablib/formats/_xlsx.py | tablib/formats/_xlsx.py | # -*- coding: utf-8 -*-
""" Tablib - XLSX Support.
"""
import sys
if sys.version_info[0] > 2:
from io import BytesIO
else:
from cStringIO import StringIO as BytesIO
from tablib.compat import openpyxl
import tablib
Workbook = openpyxl.workbook.Workbook
ExcelWriter = openpyxl.writer.excel.ExcelWriter
get_co... | Python | 0 | @@ -1489,32 +1489,40 @@
l.load_workbook(
+BytesIO(
in_stream)%0A s
@@ -1511,24 +1511,25 @@
O(in_stream)
+)
%0A sheet =
@@ -1955,16 +1955,24 @@
orkbook(
+BytesIO(
in_strea
@@ -1973,16 +1973,17 @@
_stream)
+)
%0A%0A fo
|
c48599eef984ce8e5939804ad3e4ad901fbb84a6 | Update latex.py | tellurium/teio/latex.py | tellurium/teio/latex.py | """
Export utilities.
Write to latex.
"""
from __future__ import print_function, division
import os.path
class LatexExport(object):
""" Class for exporting simulation to latex. """
def __init__(self, rr,
color=['blue', 'green', 'red', 'black'],
xlabel='x',
y... | Python | 0 | @@ -5213,32 +5213,177 @@
lt.shape%5B1%5D - 1%0A
+ if len (self.color) %3C Ncol:%0A raise StandardError ('The number of specified colors does not match the number of data columns') %0A
latexPat
|
e1e6624b97455fe73cce951a7a934464a16d8197 | Update to utils to cope with either python 3 or 2 type strings. | templatefinder/utils.py | templatefinder/utils.py | import fnmatch
import logging
import os
from django.conf import settings
from django.utils.importlib import import_module
__all__ = ('find_all_templates', 'flatten_template_loaders')
LOGGER = logging.getLogger('templatefinder')
def flatten_template_loaders(templates):
"""
Given a collection of template l... | Python | 0 | @@ -117,16 +117,120 @@
module%0A%0A
+try:%0A from django.utils.six import string_types%0Aexcept ImportError:%0A string_types = (basestring,)%0A
%0A__all__
@@ -672,26 +672,28 @@
loader,
-base
string
+_types
):%0A
|
38e0200e415c30b8fd9f41a76af5a6a72003bc54 | Update CINERGI API URL to official production host | src/mmw/apps/bigcz/clients/cinergi/search.py | src/mmw/apps/bigcz/clients/cinergi/search.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import requests
import dateutil.parser
from django.contrib.gis.geos import Polygon
from django.conf import settings
from apps.bigcz.models import Resource, ResourceLink, ResourceList,... | Python | 0 | @@ -422,28 +422,24 @@
p://
-132.249.238.169:8080
+cinergi.sdsc.edu
/geo
|
c7b02315788ba0d6cbf326ce25593c60295860b7 | Add tenant and tenant name to deployment output | src/nodeconductor_paas_oracle/serializers.py | src/nodeconductor_paas_oracle/serializers.py | from rest_framework import serializers
from nodeconductor.core import models as core_models
from nodeconductor.core import serializers as core_serializers
from nodeconductor.core.fields import NaturalChoiceField
from nodeconductor.structure import serializers as structure_serializers
from nodeconductor_openstack impor... | Python | 0 | @@ -2461,33 +2461,74 @@
ll()
-,
+)
%0A
- write_only=True
+tenant_name = serializers.ReadOnlyField(source='tenant.name'
)%0A%0A
@@ -3461,32 +3461,47 @@
'tenant',
+ 'tenant_name',
'flavor', 'ssh_
@@ -3551,16 +3551,28 @@
quests',
+%0A
'jira_i
@@ -3577,36 +3577,24 @@
_issue_key',
-%0A ... |
63ef8c6ce601942b3c69f12e994e7cde8362888e | login function was borked | application/flicket/forms/form_login.py | application/flicket/forms/form_login.py | #! usr/bin/python3
# -*- coding: utf-8 -*-
#
# Flicket - copyright Paul Bourne: evereux@gmail.com
import bcrypt
from flask_wtf import FlaskForm
from sqlalchemy import func, or_
from wtforms import BooleanField, PasswordField, StringField
from wtforms.validators import DataRequired
from application import app
from app... | Python | 0.999728 | @@ -1082,16 +1082,18 @@
me.lower
+()
))%0A i
|
613da40aaaebc86a3ea3565dff557f2a63bf2565 | Allow wifi scanning to run in endless loop | application/senic/nuimo_hub/commands.py | application/senic/nuimo_hub/commands.py | import click
import json
import os
from os.path import abspath
from subprocess import run, PIPE, TimeoutExpired
import wifi
from pyramid.paster import get_app
DEFAULT_IFACE = 'wlan0'
IFACES_AVAILABLE = '/etc/network/interfaces.available/{}'
IFACES_D = '/etc/network/interfaces.d/{}'
ENTER_SETUP_FLAG = '/var/run/NUIM... | Python | 0 | @@ -27,16 +27,28 @@
mport os
+%0Aimport time
%0A%0Afrom o
@@ -948,16 +948,217 @@
file')%0A
+@click.option('--forever/--no-forever', default=False, help='scan forever (until interupted')%0A@click.option('--waitsec', default=20, help='How many seconds to wait inbetween scans (only when forever')%0A
@click.a
@@ -1215... |
5e4a0340ee8d47e6f4887e64bc8c859b64cf50d1 | Clean up flake8 and add logging for PR #52 | awslimitchecker/services/elasticache.py | awslimitchecker/services/elasticache.py | """
awslimitchecker/services/elasticache.py
The latest version of this package is available at:
<https://github.com/jantman/awslimitchecker>
################################################################################
Copyright 2015 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
This file ... | Python | 0 | @@ -4885,25 +4885,16 @@
oups%22%22%22%0A
- %0A
@@ -5475,13 +5475,101 @@
rror
-, e:%0A
+:%0A logger.debug(%22caught BotoServerError checking ElastiCache security %22%0A
@@ -5580,28 +5580,76 @@
+ %22
groups
-= %5B%5D%0A
+(account without EC2-Classic?)%22)%0A... |
8f5f162938d449c58cd8b6d6d379c38c7da7ae23 | Fix upgrade to schema version 21 for PostgreSQL databases. Closes #5593. | trac/upgrades/db21.py | trac/upgrades/db21.py |
def do_upgrade(env, ver, cursor):
"""Upgrade the reports to better handle the new workflow capabilities"""
db = env.get_db_cnx()
owner = db.concat('owner', "' *'")
reports = list(cursor.execute('SELECT id, query, description FROM report'))
for report, query, description in reports:
# All st... | Python | 0 | @@ -178,23 +178,8 @@
-reports = list(
curs
@@ -233,16 +233,47 @@
report')
+%0A reports = cursor.fetchall(
)%0A fo
|
029ed00330bc79e56c673532a01d7e1084c896bd | Delete previous ice restart from new restart directory. See #85. | payu/models/cice5.py | payu/models/cice5.py | """
The payu interface for the CICE model
-------------------------------------------------------------------------------
Contact: Marshall Ward <marshall.ward@anu.edu.au>
-------------------------------------------------------------------------------
Distributed as part of Payu, Copyright 2011 Marshall Ward
Licensed u... | Python | 0 | @@ -2014,16 +2014,597 @@
t_path%0A%0A
+%0A def archive(self):%0A super(Cice5, self).archive()%0A%0A res_ptr_path = os.path.join(self.restart_path, 'ice.restart_file')%0A with open(res_ptr_path) as f:%0A res_name = os.path.basename(f.read()).strip()%0A%0A assert os.path.exists(... |
37a5d1729611b4171920253811036f7ffb1cdd64 | dashboard, env/netbsd-{amd64,386}: mount /tmp on disk instead of RAM | env/netbsd-amd64/mkvm.py | env/netbsd-amd64/mkvm.py | #!/usr/bin/env python
# Copyright 2016 The Go 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 anita
import sys
arch = sys.argv[1]
release = sys.argv[2]
commands = [
"""cat >> /etc/rc.local <<EOF
(
export PATH=/usr/pkg/bi... | Python | 0.99922 | @@ -1563,24 +1563,137 @@
h, release),
+%0A%0A # Remove the /tmp entry, because it's mounted as tmpfs -s=ram%2525 by default, which isn't enough disk space.
%0A %22%22%22ed /
@@ -1715,19 +1715,17 @@
F%0AH%0A
-%25s/wd0/sd0/
+/%5C%5C/tmp/d
%0Awq%0A
@@ -1728,24 +1728,25 @@
%0Awq%0AEOF%22%22%22,%0A
+%0A
%22e... |
0db5c9b2cc9bed0f43931030269db19862c03ae5 | Remove support for writing config options. This also solves Issue 60 | rst2pdf/config.py | rst2pdf/config.py | # -*- coding: utf-8 -*-
# Singleton config object
import ConfigParser
import os
from simplejson import dumps, loads
cfdir=os.path.join(os.path.expanduser('~'),'.rst2pdf')
cfname=os.path.join(cfdir,'config')
def getValue(section,key,default=None):
section=section.lower()
key=key.lower()
try:
return loads(c... | Python | 0 | @@ -370,337 +370,8 @@
lt%0A%0A
-def setValue(section,key,value):%0A section=str(section)%0A key=str(key)%0A section=section.lower()%0A key=key.lower()%0A value=dumps(value)%0A try:%0A r=conf.set(section,key,value)%0A except ConfigParser.NoSectionError:%0A conf.add_section(section)%0A r=conf.set(section... |
b7de4f92e72092cd8d83e0cbcf20be67a086bbe2 | refactor out common constructor code | ee_balance_test.py | ee_balance_test.py | import configparser
import unittest
from ee_balance import *
class EEUnitTests(unittest.TestCase):
def setUp(self):
config = configparser.ConfigParser()
config.read('secret.auth')
self.eecon = EEConnector(username=config['auth']['username'], password=config['auth']['password'])
... | Python | 0.999207 | @@ -1,25 +1,4 @@
-import configparser%0D%0A
impo
@@ -10,16 +10,16 @@
ittest%0D%0A
+
from ee_
@@ -122,35 +122,54 @@
g =
-configparser.ConfigParser()
+%22%22%0D%0A with open(%22secret.auth%22,%22r%22) as f:
%0D%0A
@@ -178,33 +178,28 @@
+
+
config
+ = f
.read(
-'secret.auth'
)%0D%0A
@@ -233,81... |
5b4cdbfaeb43e12d5bb576f8eeaa4b1f4d1e734c | fix yaml warning | app/app.py | app/app.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Imports of external stuff that is needed
import tornado.escape
import tornado.ioloop
import tornado.web
from tornado.options import define, options
import json,os,yaml
import logging
import logging.handlers
# import scheduling ingredients
from apscheduler.schedulers.tor... | Python | 0 | @@ -772,16 +772,40 @@
l.load(f
+, Loader=yaml.FullLoader
)%0Af.clos
|
bb0854d5dd188d55e65c5d5e5288e1ec927f7dd9 | Remove unused import. | ws4py/utf8validator.py | ws4py/utf8validator.py | # coding=utf-8
###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## Note:
##
## This code is a Python implementation of the algorithm
##
## "Flexible and Economical UTF-8 Decoder"
##
## by Bjoern Hoehrmann
##
## bjoer... | Python | 0 | @@ -1055,40 +1055,8 @@
%0D%0A%0D%0A
-from ws4py.compat import range%0D%0A
%0D%0Acl
|
32dbadc4ccfbe17cf766bb75236304cbf1fe850f | update name scopes | train_from_scratch.py | train_from_scratch.py | import tensorflow as tf
import numpy as np
from nlpfromscratch.vocab import MultiVocab
from nlpfromscratch.csvreader import CSVReader
from nlpfromscratch.embeds import Embeddings
from nlpfromscratch.mlp import linear
from nlpfromscratch.loss import reg_softmax_loss
from nlpfromscratch.args import parser
from nlpfromsc... | Python | 0.000001 | @@ -1982,24 +1982,61 @@
GS.lambda_)%0A
+ with tf.name_scope('predict'):%0A
predict
@@ -2067,16 +2067,35 @@
.lookup(
+%0A
tf.argma
@@ -3026,16 +3026,30 @@
rint gs,
+ FLAGS.epochs,
step_lo
|
7b23f3956a5a05f6659684499e848a8c96270b53 | bump version to 0.4.0.b1 | cellpy/_version.py | cellpy/_version.py | version_info = (0, 4, 0, "a5")
__version__ = ".".join(map(str, version_info))
| Python | 0.000001 | @@ -23,10 +23,10 @@
0, %22
-a5
+b1
%22)%0A_
|
e2d182cfb4fcc9501beee0380dbc870f7905be8a | Fix bugs when no plugins input or wrong input | pdc_client/runner.py | pdc_client/runner.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from __future__ import print_function
import sys
import argparse
import beanbag
import os
import os.path
import logging
import imp
# The client supports Bash completion if argcomplete ... | Python | 0.000001 | @@ -1974,25 +1974,29 @@
g and config
-%5B
+.get(
CONFIG_PLUGI
@@ -2006,17 +2006,17 @@
KEY_NAME
-%5D
+)
:%0A
@@ -2037,17 +2037,21 @@
= config
-%5B
+.get(
CONFIG_P
@@ -2065,17 +2065,113 @@
KEY_NAME
-%5D
+)%0A if not isinstance(plugins, list):%0A raise TypeError('Plugins must be a list')
%0... |
2efef9a3a1e3376962749e0524290417ae012ef4 | load model from gpm | epistasis/models/base.py | epistasis/models/base.py | __doc__ = """
Base class for epistasis models. This is meant to be called in a subclass.
"""
import numpy as np
import itertools as it
from collections import OrderedDict
# imports from seqspace dependency
from seqspace.utils import farthest_genotype, binary_mutations_map
# Local imports
from epistasis.utils import e... | Python | 0 | @@ -2365,969 +2365,217 @@
%22%22%22%0A
-%0A # Grab un scaled phenotypes and errors%0A if gpm.log_transform is True:%0A _phenotypes = gpm.Raw.phenotypes%0A _stdeviations = gpm.Raw.stdeviations%0A else:%0A _phenotypes = gpm.phenotypes%0A _stdeviations = gp... |
78f5006bd5182317200d3396481cd4afd9e95417 | Fix typo in forms.py. | linguist/forms.py | linguist/forms.py | # -*- coding: utf-8 -*_
from django import forms
from django.forms.models import BaseInlineFormSet
from .utils.i18n import get_language
__all__ = [
'TranslationModelFormMixin',
'TranslationModelForm',
]
class TranslationModelFormMixin(object):
language = None
def __init__(self, *args, **kwargs):
... | Python | 0.000014 | @@ -659,13 +659,8 @@
uage
-_code
= c
|
d6b8156d18a358b594ecf8efe4c6f9de26e4af16 | allow more tolerance | random_sample.py | random_sample.py | import numpy as np
import unittest
import pdb
def rand(d):
'''Generate random np.array sample of size d drawn uniformly from [0,1]'''
while True:
result = np.random.rand(d)
yield result
def randn(d, mean, var):
'''Generate random np.array sample of size d drawn from N(mean, var) '''
... | Python | 0.000001 | @@ -1349,17 +1349,17 @@
mean), .
-3
+5
)%0A%0A d
@@ -1786,17 +1786,17 @@
_mean),
-3
+5
)%0A%0A%0Aif _
|
ecb15c8182058c828f5519ea8d909c30ee028b4e | fix trailing whitespace | errata_tool/connector.py | errata_tool/connector.py | from errata_tool import ErrataException
import requests
from requests_kerberos import HTTPKerberosAuth
from jsonpath_rw import parse
class ErrataConnector:
_url = "https://errata.devel.redhat.com"
_auth = HTTPKerberosAuth()
ssl_verify = True # Shared
# Simple wrappers to avoid copying around when au... | Python | 0 | @@ -3313,17 +3313,16 @@
, add it
-
%0A
|
1bc001b46eab526c87c3e58c4f5efe5948c0130a | add simple help to cli interface | errormator_client/cli.py | errormator_client/cli.py | from __future__ import with_statement
import os
import pkg_resources
import sys
from errormator_client import client
import logging
logging.basicConfig()
cwd = os.getcwd()
class CommandRouter(object):
@classmethod
def makeini(cls, ini_name):
while True:
print '\nCurrent directory: ... | Python | 0 | @@ -2753,24 +2753,504 @@
= sys.argv%0A
+ if not args:%0A print %22%22%22%0A Possible commands%0A makeini %5BERRORMATOR_INI_NAME%5D - creates new config file for errormator%0A %0A testini %5BERRORMATOR_INI_NAME%5D - sends a test log entry to test your API key%0A %0A ... |
653352c36cb6a3d805fd572744adddf466b6e419 | Add times, objects to word dict. Extend locations to include GPE & FACILITY | pensieve/pensieve.py | pensieve/pensieve.py | from __future__ import unicode_literals
import spacy
import os
import textacy
from collections import defaultdict
from collections import Counter
nlp = spacy.load('en')
class Corpus(object):
def __init__(self, corpus_dir=None):
self.corpus_dir = corpus_dir
self.docs = self.read_corpus(corpus_dir... | Python | 0.000001 | @@ -1190,16 +1190,35 @@
ords = %7B
+'times':Counter(),
'verbs':
@@ -1265,17 +1265,37 @@
ounter()
-
+, 'objects':Counter()
%7D%0A
@@ -1666,16 +1666,46 @@
(self):%0A
+ doc_times = Counter()%0A
@@ -1787,32 +1787,155 @@
unter()%0A
+doc_objects = Counter()%0A%0A times = textacy... |
ec15cfe29eb4f99725315d54c97d99d81e3b3ccc | Enable Config instantiation from kwargs only | elevator/config.py | elevator/config.py | # -*- coding: utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
from ConfigParser import ConfigParser
from utils.snippets import items_to_dict
class Config(dict):
"""
Unix shells like environment class. Implements add,
get, load, flush methods. Handles lists of... | Python | 0 | @@ -407,16 +407,21 @@
(self, f
+=None
, *args,
|
04408fadd39b8fe75a97f08186be6701dd200799 | Fix PEP8 in make-win-dist | src/etc/make-win-dist.py | src/etc/make-win-dist.py | # Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or ht... | Python | 0.998436 | @@ -685,21 +685,39 @@
sys
-, os, shutil,
+%0Aimport os%0Aimport shutil%0Aimport
sub
@@ -725,16 +725,17 @@
rocess%0A%0A
+%0A
def find
@@ -1092,16 +1092,17 @@
found%0A%0A
+%0A
def make
@@ -4241,18 +4241,20 @@
__name__
+
==
+
%22__main_
|
6e12759b011751e95aec37a25abb470d6b17fd40 | check if args.model is None | rasa/cli/test.py | rasa/cli/test.py | import argparse
import logging
import os
from typing import List
from rasa.cli import SubParsersAction
import rasa.shared.data
import rasa.shared.utils.io
from rasa.cli.arguments import test as arguments
from rasa.shared.constants import (
CONFIG_SCHEMA_FILE,
DEFAULT_E2E_TESTS_PATH,
DEFAULT_CONFIG_PATH,
... | Python | 0.999999 | @@ -149,16 +149,45 @@
tils.io%0A
+import rasa.shared.utils.cli%0A
from ras
@@ -2613,16 +2613,207 @@
del%5B0%5D%0A%0A
+ if args.model is None:%0A rasa.shared.utils.cli.print_error(%0A %22No model provided. Please make sure to specify the model to test with '--model'.%22%0A )%0A retu... |
eb5ea3eaa830482471ede267a57902c093b8a6d6 | Update : add some output server runner | elevator/server.py | elevator/server.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import zmq
import leveldb
import threading
from database import Backend, Frontend
def run():
backend = Backend('test')
frontend = Frontend('tcp://127.0.0.1:4141')
poll = zmq.Poller()
poll.register(backend.socket, zmq.POLLIN)
poll.register(frontend.so... | Python | 0 | @@ -39,16 +39,27 @@
-8 -*-%0A%0A
+import sys%0A
import z
@@ -352,16 +352,155 @@
try:%0A
+ %09print %3E%3E sys.stdout, %22Elevator server started%22%0A %09print %3E%3E sys.stdout, %22The server is now ready to accept connections on port 4141%22%0A
|
1aec7c5d6cd4bce43c866836a24ff19defebcccf | Extract a function from a class | raspicam/main.py | raspicam/main.py | """
This module contains the main application object.
"""
import logging
from argparse import ArgumentParser
import cv2
from config_resolver import Config
from processing import detect
from raspicam.camera import PiCamera, USBCam
from raspicam.source import FileReader
from raspicam.storage import NullStorage, Storag... | Python | 0.999999 | @@ -1326,21 +1326,16 @@
args =
-self.
parse_ar
@@ -1859,554 +1859,8 @@
gs%0A%0A
- def parse_args(self, cli_args):%0A '''%0A Parse CLI arguments and return the parsed object.%0A '''%0A parser = ArgumentParser()%0A parser.add_argument('ui', help='Chose a UI. One of %5Bgui, web, ... |
a8571485601114b908204f9d73af2b5dd30c9ed1 | Move imports to top for pjlink (#29540) | homeassistant/components/pjlink/media_player.py | homeassistant/components/pjlink/media_player.py | """Support for controlling projector via the PJLink protocol."""
import logging
import voluptuous as vol
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import (
SUPPORT_SELECT_SOURCE,
SUPPORT_TURN_OFF,
SUPPORT_TURN_ON,
... | Python | 0 | @@ -74,16 +74,105 @@
ogging%0A%0A
+from pypjlink import MUTE_AUDIO, Projector%0Afrom pypjlink.projector import ProjectorError%0A
import v
@@ -239,16 +239,33 @@
import
+PLATFORM_SCHEMA,
MediaPla
@@ -277,25 +277,8 @@
vice
-, PLATFORM_SCHEMA
%0Afro
@@ -2785,47 +2785,8 @@
.%22%22%22
-%0A from pypjlink impo... |
debbfdbcf66d8ba015a878a19a8ddcb1531fcbf9 | check github acc v.2 | trolly/faver/views.py | trolly/faver/views.py | from django.shortcuts import render_to_response
from django.http import HttpResponse
from .models import GeoLocation, StopTime, StationStop
from django.core import serializers
from .utils import get_normalized_time
import json
def index(request):
stations = serializers.serialize(
'json', GeoLocation.objec... | Python | 0 | @@ -169,16 +169,28 @@
alizers%0A
+import json%0A
from .ut
@@ -220,28 +220,16 @@
ed_time%0A
-import json%0A
%0A%0Adef in
|
9274ccd814badac95bb3625eaf78a1c09266e033 | Correct URL to current upstream github project. | plinth.py | plinth.py | #!/usr/bin/env python
import os, sys, argparse
from gettext import gettext as _
import cfg
if not os.path.join(cfg.file_root, "vendor") in sys.path:
sys.path.append(os.path.join(cfg.file_root, "vendor"))
import cherrypy
from cherrypy import _cpserver
from cherrypy.process.plugins import Daemonizer
Daemonizer(cherr... | Python | 0 | @@ -1167,17 +1167,18 @@
com/
-jvasile/p
+NickDaly/P
lint
|
fa1909f13414dd8106f7624f264945957b5308df | fix building in python 2 | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath(... | Python | 0.000159 | @@ -16,16 +16,56 @@
tf-8 -*-
+%0Afrom __future__ import unicode_literals
%0A%0Aimport
|
860a3a7b40d68213830e609b12cf8fc63b8882b5 | change to lookup by username, not id | recommend.py | recommend.py | from slacker import Slacker
from optparse import OptionParser
from collections import defaultdict
import json
from statistics import mean
parser = OptionParser()
parser.add_option("-i", "--in", dest="infile", help="the name of the summary JSON file")
parser.add_option("-t", "--token", dest="token", help="your slack t... | Python | 0.000028 | @@ -364,18 +364,20 @@
st=%22user
-id
+name
%22, help=
@@ -381,18 +381,20 @@
lp=%22user
-id
+name
to prod
@@ -492,16 +492,400 @@
oken)%0A%0A%0A
+class UnknownUsername(Exception):%0A def __init__(self, name):%0A self.name = name%0A%0A def __str__(self):%0A return %22unknown user: %7B0%7D%22.form... |
2e88589c8da300cf06616b0e77978f86a665bac5 | Bump version to 1.3.0 | monk/__init__.py | monk/__init__.py | # ------------------------------------------------------------------------------
# Monk: a lightweight, markdownish markup language.
#
# Author: Darren Mulholland <darren@mulholland.xyz>
# License: Public Domain
# ------------------------------------------------------------------------------
# Package version number.
... | Python | 0 | @@ -334,11 +334,11 @@
%221.
-2.2
+3.0
%22%0A%0Af
|
f704df90bc790a8b24146af4a61931acadb8bcf1 | Fix stacktrace in batch with dup minion ids | salt/cli/batch.py | salt/cli/batch.py | # -*- coding: utf-8 -*-
'''
Execute batch runs
'''
# Import python libs
from __future__ import print_function
from __future__ import absolute_import
import math
import time
import copy
# Import salt libs
import salt.client
import salt.output
import salt.exceptions
from salt.utils import print_cli
from salt.ext.six.mo... | Python | 0 | @@ -5816,24 +5816,103 @@
art.keys():%0A
+ if id in minion_tracker%5Bqueue%5D%5B'minions'%5D:%0A
|
38f6f652bb2cc4c58320f58a1ae57482f612a89a | Remove logic from return stm, and unnecessary return. | bipy/maths/stats/ordination/utils.py | bipy/maths/stats/ordination/utils.py | #-----------------------------------------------------------------------------
# Copyright (c) 2013, The BiPy Developers.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------------... | Python | 0.000001 | @@ -2213,32 +2213,8 @@
one%0A
- return avg, std%0A
@@ -3236,22 +3236,25 @@
one%0A
-return
+ avg =
avg if
@@ -3272,16 +3272,31 @@
lse None
+%0A return avg
, std%0A%0A%0A
|
82d7d96a33ca21f30d20db4f0cda75473aea6625 | Fix values and element name in schema base | ems/schema/base.py | ems/schema/base.py | #!/usr/bin/env python
#
# Copyright 2016 Opsview Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python | 0.000001 | @@ -5255,20 +5255,21 @@
six.iter
-item
+value
s(self._
@@ -5884,32 +5884,35 @@
%5Broot_elem
+ent
.append(elem)%0A
@@ -6030,16 +6030,19 @@
oot_elem
+ent
.append(
@@ -6052,16 +6052,45 @@
ldren)%0A%0A
+ return root_element%0A%0A
def
|
d37b0b5781dd44dd25467f7ee7cf20e3ff5518e4 | add gen_key to ssh shell module | salt/ssh/shell.py | salt/ssh/shell.py | '''
Manage transport commands via ssh
'''
# Import python libs
import time
import subprocess
# Import salt libs
import salt.utils
import salt.utils.nb_popen
class Shell(object):
'''
Create a shell connection object to encapsulate sssh executions
'''
def __init__(
self,
host,
... | Python | 0.000001 | @@ -53,24 +53,34 @@
python libs%0A
+import os%0A
import time%0A
@@ -164,16 +164,281 @@
popen%0A%0A%0A
+def gen_key(path):%0A '''%0A Genrate a key for use with salt-ssh%0A '''%0A cmd = 'ssh-keygen -P %22%22 -f %7B0%7D -t rsa -q'.format(path)%0A if not os.path.isdir(os.path.dirname(path)):%0A os.... |
0ce7e598bf4ca6bcae1ca874c5f20081182e91f9 | test stop service | iottly-device-agent-py/main.py | iottly-device-agent-py/main.py | """
Copyright 2015 Stefano Terna
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | Python | 0.000001 | @@ -1288,16 +1288,76 @@
sg(msg)%0A
+ if %22ECHO%22 in msg.keys():%0A agent.close()%0A%0A
%0A%0A #i
|
c2ceeb784107ac8fb4c92852e9838317a7b2c45e | Convert git-hash bytes to string | encore/__init__.py | encore/__init__.py | from flask import request, Response, Flask, render_template, redirect, url_for
from .user_blueprint import user_area
from .admin_blueprint import admin_area
from .api_blueprint import api, ApiResult, ApiException
from .auth_blueprint import auth
from .notifier import get_notifier
from . import job_tracking
import atexi... | Python | 1 | @@ -3670,17 +3670,32 @@
git_hash
-
+.decode(%22utf-8%22)
%0A exc
|
9e394259cdb61eb34cf9f170f161083e18c2b981 | Bump version to 0.0.8 | pgawedge/_version.py | pgawedge/_version.py | version_info = (0, 0, 7)
__version__ = '.'.join(map(str, version_info))
| Python | 0.000001 | @@ -19,9 +19,9 @@
0,
-7
+8
)%0A%0A_
|
d19da9627ca84b6627347647e7829e43e39a1576 | add function includes() | pgmapcss/includes.py | pgmapcss/includes.py | includes = {}
def register_includes(inc):
global includes
includes = dict(list(includes.items()) + list(inc.items()))
def include_text():
global includes
ret = ''
for name, function in includes.items():
ret += function
return ret
| Python | 0 | @@ -1,16 +1,17 @@
+_
includes = %7B%7D%0A%0Ad
@@ -40,32 +40,33 @@
nc):%0A global
+_
includes%0A inc
@@ -62,16 +62,17 @@
des%0A
+_
includes
@@ -84,16 +84,17 @@
ct(list(
+_
includes
@@ -156,16 +156,17 @@
global
+_
includes
@@ -205,16 +205,17 @@
tion in
+_
includes
@@ -264,8 +264,88 @@
urn ret%0A... |
b8ffb619a26e27f1376bf8a39e752cdf2eb3afac | Make copyright year consistent with license | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
project = 'astropy-helpers'
copyright = '2019, The Astropy Developers'
author = 'The Astropy Developers'
# We need to get the version number from the package
import sys # noqa
sys.path.insert(0, '..')
import astropy_helpers # noqa
version = astropy_helpers.__version__
release = astropy_helpe... | Python | 0.999343 | @@ -66,9 +66,9 @@
'201
-9
+4
, Th
|
eb5e9b4271f263b619175dc83700b2534a208c67 | Fix typo: email address | check_bandwidth.py | check_bandwidth.py | #!/usr/bin/python
'''
Nagios (NRPE) plugin for checking bandwidth speed limit.
'''
from argparse import ArgumentParser
from time import sleep
from sys import exit
from os.path import isdir
import re
__description__ = 'Nagios (NRPE) plugin for checking bandwidth speed limit.'
__author__ = "Puru Tuladhar <tualdharpuru... | Python | 0.999999 | @@ -303,18 +303,18 @@
dhar %3Ctu
-a
l
+a
dharpuru
|
143233cf237a9f8e45718f4860e8b4ec5c4e1a6c | Make regtab a class attribute | registers.py | registers.py | class Registers(object):
def __init__(self):
self.registers = [0 for _ in xrange(32)]
self.regtab = {
'v0': 2, 'v1': 3,
'a0': 4, 'a1': 5, 'a2': 6, 'a3': 7,
't0': 8, 't1': 9, 't2': 10, 't3': 11, 't4': 12, 't5': 13, 't6': 14, 't7': 15,
's0': 16, 's1': 17... | Python | 0.000001 | @@ -26,90 +26,8 @@
-def __init__(self):%0A self.registers = %5B0 for _ in xrange(32)%5D%0A self.
regt
@@ -33,20 +33,16 @@
tab = %7B%0A
-
@@ -67,20 +67,16 @@
-
-
'a0': 4,
@@ -111,20 +111,16 @@
-
-
't0': 8,
@@ -189,20 +189,16 @@
7': 15,%0A
-
... |
6a3963c3c31e9320f41dccf6d8e48730cb679bb0 | Update pip package version | envlogger/setup.py | envlogger/setup.py | # coding=utf-8
# Copyright 2022 DeepMind Technologies Limited..
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 0.000001 | @@ -882,9 +882,9 @@
1.0.
-6
+7
'%0A%0A_
|
2ed883b1d4d2bc38c031799afdf66efe3473a2ec | Replace start+duration with finish. | schedule/lists.py | schedule/lists.py | """Functions for selecting lists of timeslots based on certain criteria."""
import datetime
import functools
import itertools
import sqlalchemy
import lass.schedule.models
import lass.common.time
import lass.schedule.filler
def process(slots, start, finish):
"""Processes a raw list of timeslots, annotating and... | Python | 0 | @@ -5498,16 +5498,24 @@
(
+start %3C
lass.sch
@@ -5540,17 +5540,8 @@
lot.
-start %3C=
fini
@@ -5559,39 +5559,8 @@
(
-%0A (%0A
lass
@@ -5595,95 +5595,16 @@
art
-+%0A lass.schedule.models.Timeslot.duration%0A ) %3E start%0A
+%3C finish
)%0A... |
55759064f016c8c63dadbd45a59696d6580f1570 | Set common session namespace as well as old way to help transition | src/eduid_webapp/authn/acs_actions.py | src/eduid_webapp/authn/acs_actions.py | #
# Copyright (c) 2016 NORDUnet A/S
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of ... | Python | 0 | @@ -1744,16 +1744,78 @@
request
+%0A%0Afrom eduid_common.session.namespaces import LoginApplication
%0Afrom sa
@@ -2571,24 +2571,86 @@
one%0A %22%22%22%0A
+ # Old style sessions (remove after we use only new style)%0A
session%5B
@@ -2761,111 +2761,8 @@
ppn%0A
- session%5B'user_eppn'%5D = user.eppn #... |
8be263bd909f293ab88829ffc5bb6ea50804d7ae | add [st]-comma-below to normalization map | mptracker/nlp.py | mptracker/nlp.py | import sys
import re
import csv
import logging
from collections import namedtuple
from collections import defaultdict
from functools import lru_cache
import flask
from flask.ext.script import Manager
from path import path
from jellyfish import jaro_winkler
logger = logging.getLogger(__name__)
logger.setLevel(logging.I... | Python | 0.000001 | @@ -625,9 +625,41 @@
('
-%C8%9B
+%C5%9F', 's'),%0A ('%C8%9B', 't'),%0A ('%C5%A3
', '
|
3161a8e622177f9eaec979562d86c90bbbd0ac29 | 修改 head | jobs/guess_return_daily_job.py | jobs/guess_return_daily_job.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import libs.common as common
import sys
import time
import pandas as pd
import numpy as np
import math
import tushare as ts
from sqlalchemy.types import NVARCHAR
from sqlalchemy import inspect
import datetime
import heapq
"""
SELECT `date`, `code`, `name`, `changepercent`, ... | Python | 0 | @@ -2712,24 +2712,26 @@
el_sql)%0A%0A
+ #
print(data_
|
5fe8c927e9a3463a43eeb02b227fae256137ee6f | Add function to identify the types of cycle sets | chemtools/graph.py | chemtools/graph.py |
class Tree(object):
def __init__(self, value, parent=None):
self.parent = parent
self.value = value
self.children = []
def add(self, value):
new = Tree(value, parent=self)
self.children.append(new)
return new
def search(self):
if self.parent is not ... | Python | 0.000007 | @@ -5099,8 +5099,618 @@
_cycles%0A
+%0Adef identify_cycle_types(cycles):%0A types = %5B%5D%0A for fused_cycle in cycles:%0A lengths = %5Blen(x) for x in fused_cycle%5D%0A if len(lengths) == 3:%0A if lengths == %5B5, 6, 5%5D:%0A types.append(%22DCORE%22)%0A elif ... |
6dd1a02ebb047be648722a9e91109fd27409b4a4 | Add sv commas | src/vws/_request_utils.py | src/vws/_request_utils.py | """
Utilities for making requests to Vuforia.
Based on Python examples from https://developer.vuforia.com/downloads/samples.
"""
import base64
import email.utils
import hashlib
import hmac
from urllib.parse import urljoin
import requests
def compute_hmac_base64(key: bytes, data: bytes) -> bytes:
"""
Return... | Python | 0.999984 | @@ -2370,24 +2370,25 @@
st_path: str
+,
%0A) -%3E reques
|
4f26f73d7206d052307ac8ceaf6fef6b472d8162 | move pikelangprogram parser to init | pikalang/__init__.py | pikalang/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pikalang module.
A brainfuck derivative based off the vocabulary of Pikachu from Pokemon.
Copyright (c) 2019 Blake Grotewold
"""
import sys
import os
from pikalang.parser import PikalangParser
MAX_LOCATIONS = 20
class PikalangProgram:
def __init__(self, source)... | Python | 0.000001 | @@ -343,16 +343,55 @@
= source
+%0A self.parser = PikalangParser()
%0A%0A de
@@ -573,42 +573,8 @@
e):%0A
- parser = PikalangParser()%0A
@@ -584,16 +584,21 @@
return
+self.
parser.p
|
73ad88788d01562a2e89e7044a24f9b11e1943b9 | update mappings | bulbs/content/management/__init__.py | bulbs/content/management/__init__.py | from django.db.models.signals import post_syncdb
from django.conf import settings
from elasticutils import get_es
from pyelasticsearch.exceptions import IndexAlreadyExistsError, ElasticHttpError
import bulbs.content.models
def sync_es(sender, **kwargs):
"""
You must delete the index first to actually update... | Python | 0 | @@ -255,133 +255,8 @@
s):%0A
- %22%22%22%0A You must delete the index first to actually update the ES index.%0A %0A -%3E es.delete_index(index_name)%0A %22%22%22%0A
@@ -1669,50 +1669,228 @@
rror
- as e:%0A print(e.error)%0A pass
+:%0A for doc_type, mapping in mappings.iterite... |
d3dfd577cec31910404e2fa231b46b922ab48a31 | use generic fs types for nodev filesystems and mount /dev/shm | chroot/__init__.py | chroot/__init__.py | """pychroot is a library that simplifies chroot handling"""
__version__ = '0.9.6'
import os
import sys
if sys.hexversion >= 0x03030000:
from socket import sethostname # pylint: disable=no-name-in-module
from chroot.base import WithParentSkip
from chroot.exceptions import ChrootError, ChrootMountError, MountErr... | Python | 0 | @@ -1322,17 +1322,16 @@
'
-/
proc': %7B
%7D,%0A
@@ -1330,28 +1330,97 @@
': %7B
-%7D,%0A '/sys': %7B
+'dest': '/proc'%7D,%0A 'sysfs': %7B'dest': '/sys'%7D,%0A 'tmpfs': %7B'dest': '/dev/shm'
%7D,%0A
|
a17d55fdc1f0e81ff27b426ed90802a6c5fc02c1 | update docs | chainer/dataset/tabular/from_data.py | chainer/dataset/tabular/from_data.py | import chainer
from chainer.dataset.tabular import tabular_dataset
def from_data(data, size=None):
"""Create a :class:`~chainer.dataset.TabularDataset` from data.
>>> from chainer.dataset import tabular
>>>
>>> dataset = tabular.from_data([0, 1, 2])
>>> dataset[0]
0
>>> dataset = tabular.... | Python | 0.000001 | @@ -114,33 +114,8 @@
e a
-:class:%60~chainer.dataset.
Tabu
@@ -128,19 +128,36 @@
aset
-%60
from
-data
+lists/arrays/callables
.%0A%0A
|
5452c7df44bb89515fbb58a158907bbf67bab158 | Update star probs regression tests for new dark model | chandra_aca/tests/test_star_probs.py | chandra_aca/tests/test_star_probs.py | from __future__ import print_function, division
import numpy as np
from chandra_aca.star_probs import t_ccd_warm_limit, mag_for_p_acq, acq_success_prob
def test_t_ccd_warm_limit_1():
out = t_ccd_warm_limit([10.4] * 6, date='2015:001', min_n_acq=(2, 8e-3))
assert np.allclose(out[0], -14.87863, atol=0.01, rtol... | Python | 0 | @@ -295,13 +295,12 @@
-14.
-87863
+7541
, at
@@ -518,11 +518,11 @@
-14.
-731
+609
, at
@@ -717,10 +717,10 @@
10.8
-58
+67
, rt
@@ -1266,54 +1266,54 @@
0.78
-565034, 0.75125101, 0.71514977, 0.675911
+033749, 0.75681248, 0.73114306, 0.7032639
3%5D)%0A%0A
-%0A
def
@@ -1509,55 +1509,58 @@
%5B0.8
-6318705,
+75332... |
9dd39bf0ea32f51bac3e614f28ce69276c8955d4 | add max_content_length to default_settings | ckanext/archiver/default_settings.py | ckanext/archiver/default_settings.py | # path to ckan config file
CKAN_CONFIG = '/home/okfn/pyenv/src/ckan/ckan.ini'
# directory to save downloaded files to
ARCHIVE_DIR = '/tmp/archive'
# Use this user name when requesting data from ckan
ARCHIVE_USER = u'okfn_maintenance'
| Python | 0.000003 | @@ -229,8 +229,106 @@
enance'%0A
+%0A# Max content-length of archived files, larger files will be ignored%0AMAX_CONTENT_LENGTH = 500000%0A
|
64172679bd860119f1ecb8960542160bd7b8670e | Kill eventlet after successful registration | picoCTF-web/tests/load/registration.py | picoCTF-web/tests/load/registration.py | """Register various types of users and store their login credentials."""
import random
import uuid
from locust import HttpLocust, TaskSet, task
from demographics_generator import get_affiliation, get_country_code, get_user_type, get_username, get_password, get_email, get_demographics
MONGO_HOST = "127.0.0.1"
MONGO_... | Python | 0 | @@ -137,16 +137,56 @@
et, task
+%0Afrom locust.exception import StopLocust
%0A%0Afrom d
@@ -321,17 +321,16 @@
aphics%0A%0A
-%0A
MONGO_HO
@@ -383,16 +383,16 @@
= None%0A
+
MONGO_PA
@@ -406,152 +406,8 @@
ne%0A%0A
-USERS_TO_REGISTER = 200%0A%0ABASIC_AUTH_USERNAME = 'pico'%0ABASIC_AUTH_PASSWORD = '94b98f68b2cea8eec... |
94e054b0d8b72cdc61a5b45b89010e183c2888b7 | Fix for PEP8 | argosd/argosd.py | argosd/argosd.py | import sys
import logging
import signal
from queue import PriorityQueue
from peewee import *
from argosd import settings
from argosd.scheduling import TaskScheduler, TaskRunner
from argosd.models import Show, Episode
from argosd.api.app import Api
class ArgosD:
"""Main ArgosD class. Starts all runners and proce... | Python | 0.000001 | @@ -1432,16 +1432,17 @@
l frame
+
# Unused
|
03bef8e094032c2f8a10236166e67ed69f8fcbd2 | Fix missing closing quotes in translate help message | plugins/translate.py | plugins/translate.py | import sys
import re
from textblob import TextBlob
class Plugin:
matcher = re.compile(r'translate (?:from ([^ ]+) )?(?:to ([^ ]+) )?(.*)')
def on_command(self, bot, msg, stdin, stdout, reply):
match = self.matcher.match(msg["message"])
if not match:
return
from_lang = ma... | Python | 0.000387 | @@ -707,9 +707,10 @@
%5D %3Ctext%3E
+%22
%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.