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 |
|---|---|---|---|---|---|---|---|
83e26982473176e853cf0d6b6f7d9bcd19039588 | Fix crash | enamlx/qt/qt_tree_view.py | enamlx/qt/qt_tree_view.py | # -*- coding: utf-8 -*-
'''
Created on Aug 28, 2015
@author: jrm
'''
from atom.api import (
Typed, Instance, Property, Int
)
from enamlx.qt.qt_abstract_item_view import (
QtAbstractItemView, QAbstractAtomItemModel
)
from enamlx.widgets.tree_view import (
ProxyTreeViewItem, ProxyTreeView ,ProxyTreeViewColum... | Python | 0.000004 | @@ -5220,32 +5220,65 @@
e_widget(self):%0A
+ if self.declaration:%0A
for chil
@@ -5303,32 +5303,36 @@
():%0A
+
+
if isinstance(ch
@@ -5370,24 +5370,28 @@
+
self.delegat
@@ -5400,24 +5400,28 @@
= child%0A
+
%0A def set
|
b689cadb696ce07372588b368a6d3709f636ca8a | Edit descriptions | manage.py | manage.py | from os.path import abspath
from flask import current_app as app
from app import create_app, db
# from app.model import init_db, populate_db()
from flask.ext.script import Manager
manager = Manager(create_app)
manager.add_option('-m', '--cfgmode', dest='config_mode', default='Development')
manager.add_option('-f', '-... | Python | 0.000001 | @@ -556,28 +556,41 @@
%09%22%22%22
-Delet
+Remov
es all
+content from
database
tab
@@ -589,15 +589,8 @@
base
- tables
%22%22%22%0A
@@ -721,32 +721,55 @@
nt from database
+ and creates new tables
%22%22%22%0A%09%09db.drop_al
|
15a37d1e86d9217eec218aadbe53d633335460ae | Fix block name. | xadmin/templatetags/xadmin_tags.py | xadmin/templatetags/xadmin_tags.py | from django import template
from django.template import Library
from django.utils import six
from django.utils.safestring import mark_safe
from xadmin.util import static, vendor as util_vendor
register = Library()
@register.simple_tag(takes_context=True)
def view_block(context, block_name, *args, **kwargs):
if '... | Python | 0 | @@ -451,24 +451,42 @@
%25 block_name
+.replace('-', '_')
%0A%0A cls_st
|
1eb025811e5cc7df5b0185d34f053379d52b26ab | Remove create_admin command | manage.py | manage.py | from flask_script import Manager
from radar.app import create_app
from radar.lib.database import db
from radar.models.users import User
from radar.lib import fixtures
app = create_app('settings.py')
manager = Manager(app)
@manager.command
def create_tables():
db.drop_all()
db.create_all()
@manager.comman... | Python | 0.000003 | @@ -98,44 +98,8 @@
db%0A
-from radar.models.users import User%0A
from
@@ -322,238 +322,8 @@
)%0A%0A%0A
-@manager.command%0Adef create_admin():%0A user = User()%0A user.username = 'admin'%0A user.email = 'admin@example.org'%0A user.set_password('password')%0A user.is_admin = True%0A db.session.add(... |
bc12ed9c9ecb108cd051feedd2dc74e9849b7e7c | Print all failures in pron rule eval test. | xh/evaluate_pronunciation_rules.py | xh/evaluate_pronunciation_rules.py | #! /usr/bin/python2 -u
# -*- coding: utf-8 -*-
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | Python | 0.000001 | @@ -1488,16 +1488,33 @@
ionary.%0A
+ success = True%0A
with c
@@ -2022,22 +2022,25 @@
-return
+success =
False%0A
@@ -2047,20 +2047,23 @@
return
-True
+success
%0A%0A%0Adef A
|
74959fa6f12d5be7491f1fbf3d99b1678486c311 | bump version for release | slacksocket/version.py | slacksocket/version.py | version = '0.4.4'
| Python | 0 | @@ -10,9 +10,9 @@
'0.
-4.4
+5.0
'%0A
|
022d5ec88c3156b77cf9797dfa51812bc24efb81 | Return to homescreen from launcher with START | esp32/modules/launcher.py | esp32/modules/launcher.py | import ugfx, badge, sys, gc
import uos as os
import uerrno as errno
import ujson as json
import time
import esp
import appglue
import version
ugfx.init()
ugfx.input_init()
ugfx.clear(ugfx.BLACK)
ugfx.flush()
ugfx.clear(ugfx.WHITE)
ugfx.flush()
ugfx.string_box(148,22,148,26, "STILL", "Roboto_BlackItalic24", ugfx.BLACK... | Python | 0.000002 | @@ -3388,16 +3388,106 @@
lse 0)%0A%0A
+ugfx.input_attach(ugfx.BTN_START, lambda pushed: appglue.start_app(%22%22) if pushed else 0)%0A%0A
ugfx.set
|
cf4fd0c08049e42f724f0a00a7385ba32b3a51cd | Remove function show_hand | blackjack/blackjack.py | blackjack/blackjack.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from random import shuffle
class Blackjack(object):
def __init__(self):
self.money = 2000.00
def creat_deck(self, deck=1):
'''
Create card function, it is possible to create a deck with more cards.
Increases the difficulty for the p... | Python | 0.000009 | @@ -788,35 +788,37 @@
, coin, quantity
+=1
):%0A
-
'''%0A
@@ -1889,311 +1889,26 @@
how_
-hand(self):%0A '''%0A This function only shows the cards to the player. His and those in the%0A house.%0A '''%0A msg = ('Your card: %7B%7D')%0A cards = ', '.join(self.hand)%... |
e3e3b59654133bd33c708343976825bb0c68d6f1 | use development config as default | manage.py | manage.py | #!/usr/bin/env python
import os
import errno
import logging
from flask import current_app
from flask.ext.script import Manager
from pypi_notifier import create_app, db, models, cache
logging.basicConfig(level=logging.DEBUG)
manager = Manager(create_app)
# Must be a class name from config.py
config = os.environ['P... | Python | 0.000001 | @@ -253,16 +253,26 @@
e_app)%0A%0A
+%0Atry:%0A
# Must b
@@ -301,16 +301,20 @@
nfig.py%0A
+
config =
@@ -349,16 +349,272 @@
ONFIG'%5D%0A
+except KeyError:%0A print %22PYPI_NOTIFIER_CONFIG is not found in env, using DevelopmentConfig.%22%0A print 'If you want to use another config please set it as ' %5... |
f63c31349b3191ae46c7fd2f66e964a7b799f4ea | Remove --detach flag from "git checkout" | slave/skia_slave_scripts/utils/gclient_utils.py | slave/skia_slave_scripts/utils/gclient_utils.py | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module contains utilities for managing gclient checkouts."""
from common import find_depot_tools
import os
import shell_... | Python | 0.000003 | @@ -2483,20 +2483,8 @@
er',
- '--detach',
'-f
|
b96877517bedc9934905ff6b79c4158e04d5f9b7 | initialize currentPoseName to None | software/ddapp/src/python/ddapp/jointcontrol.py | software/ddapp/src/python/ddapp/jointcontrol.py | import math
from ddapp.timercallback import TimerCallback
from ddapp.simpletimer import SimpleTimer
from ddapp import midi
class JointController(object):
def __init__(self, models, poseCollection=None):
#self.numberOfJoints = model.numberOfJoints()
self.numberOfJoints = 34
self.models = m... | Python | 0.999999 | @@ -388,16 +388,52 @@
lection%0A
+ self.currentPoseName = None%0A
|
26fc40f3ca729147e838af4d98362484bed776df | Simplify main function in problem58.py | euler_python/problem58.py | euler_python/problem58.py | """
problem58.py
Starting with 1 and spiralling anticlockwise in the following way, a square
spiral with side length 7 is formed.
37 36 35 34 33 32 31
38 17 16 15 14 13 30
39 18 5 4 3 12 29
40 19 6 1 2 11 28
41 20 7 8 9 10 27
42 21 22 23 24 25 26
43 44 45 46 47 48 49
It is intere... | Python | 0.000004 | @@ -1203,289 +1203,98 @@
-# Yields all four corners from each new layer, starting at fifth layer.%0A # next(all_corners) --%3E %5B81, 73, 65, 57%5D, %5B121, 111, 101, 91%5D, ...%0A all_corners = (corners(x**2) for x in count(start=9, step=2))%0A
+length = 7%0A primes = 8%0A total = 13%0A while
... |
b9e86baf8a7765a4a616ae5c4890263ea07cea14 | Add support for string filtering | zc_common/remote_resource/views.py | zc_common/remote_resource/views.py | from django.db.models import Model
from django.db.models.manager import Manager
from django.db.models.query import QuerySet
from rest_framework import viewsets
from rest_framework.exceptions import MethodNotAllowed
from rest_framework_json_api.views import RelationshipView as OldRelView
from zc_common.remote_resource.... | Python | 0.000001 | @@ -1,28 +1,80 @@
+from django.db.models import fields as model_fields%0A
from django.db.models import
@@ -1212,167 +1212,658 @@
-# TODO: replace deprecated get_all_field_names()%0A field_names = queryset.model._meta.get_all_field_names()%0A primary_key = queryset.model._meta.pk
+return_fields = %7... |
a6ce64d251effaae77efd5e74d8121d0ff8280f4 | fix style and grammar | eventful/events/models.py | eventful/events/models.py | from collections import defaultdict
from django.contrib.auth.models import User
from django.db import models
from .managers import EventManager, EventInviteManager
class Event(models.Model):
PUBLIC = 'PB'
PRIVATE = 'PR'
FRIENDS = 'FR'
PRIVACY_CHOICES = (
(PUBLIC, 'Public'),
(PRIVATE... | Python | 0.000005 | @@ -1896,17 +1896,16 @@
elif
-(
self.pri
@@ -1928,32 +1928,16 @@
ENDS and
-%0A
user.pr
@@ -1983,17 +1983,16 @@
d_by_id)
-)
:%0A
@@ -2068,16 +2068,17 @@
te_exist
+s
(self, u
@@ -2128,29 +2128,16 @@
.filter(
-%0A
event=se
@@ -2183,25 +2183,16 @@
ite.SELF
-%0A
).ex... |
68e32ab4c763461ffbbea6a3ed698f66fdb48d4d | Use only user_id and course_id during the kNN computation: speedup is 5x Previously most time was consumed in db queries and suprisingly in __hash__ methods (seem that hashing a django model takes longer that hashing a int) | catalog/predictions.py | catalog/predictions.py | from users.models import User
from catalog.models import Course
import collections
from django.contrib.contenttypes.models import ContentType
from actstream.models import Follow
def distance(v1, v2):
absolute_difference = [abs(c1 - c2) for c1, c2 in zip(v1, v2)]
distance = sum(absolute_difference)
return ... | Python | 0.000002 | @@ -1,34 +1,4 @@
-from users.models import User%0A
from
@@ -433,26 +433,16 @@
.objects
-%5C%0A
.filter(
@@ -470,83 +470,35 @@
ype)
-%5C%0A .select_related('user')%5C%0A .prefetch_related('follow_
+.only('user_id', '
object
+_id
')%0A%0A
@@ -612,20 +612,17 @@
user
-.net
+_
id%5D.add(
foll
... |
8d70c34e0a8c384ed42e3017ba744166ec439a50 | Use the ConsumerSet so all custom queues are purged as well. Thanks to Mat Clayton. | celery/task/control.py | celery/task/control.py | from celery import conf
from celery.messaging import TaskConsumer, BroadcastPublisher, with_connection
@with_connection
def discard_all(connection=None,
connect_timeout=conf.BROKER_CONNECTION_TIMEOUT):
"""Discard all waiting tasks.
This will ignore all tasks waiting for execution, and they will
b... | Python | 0 | @@ -49,22 +49,8 @@
port
- TaskConsumer,
Bro
@@ -68,25 +68,71 @@
sher
-, with_connection
+%0Afrom celery.messaging import with_connection, get_consumer_set
%0A%0A%0A@
@@ -453,23 +453,28 @@
umer
+s
=
-TaskC
+get_c
onsumer
+_set
(con
@@ -525,16 +525,17 @@
consumer
+s
.discard
@@ -570,16 +570,17 @@
consumer
+... |
797c4405aa2b75da9b7bdbb7e0e26f8bae3308b6 | handle BadPickleGet on restore | coopy/restore.py | coopy/restore.py | import logging
import fileutils
from snapshot import SnapshotManager
from foundation import RestoreClock
from cPickle import Unpickler
logger = logging.getLogger("coopy")
LOG_PREFIX = '[RESTORE] '
def restore(system, basedir):
#save current clock
current_clock = system._clock
#restore from snapshot... | Python | 0 | @@ -128,17 +128,31 @@
npickler
+, BadPickleGet
%0A
-
%0Alogger
@@ -294,22 +294,17 @@
m._clock
- %0A
+%0A
%0A #re
@@ -380,21 +380,17 @@
pshot()%0A
-
%0A
+
file
@@ -523,29 +523,25 @@
turn system%0A
-
%0A
+
actions
@@ -841,32 +841,136 @@
.append(action)%0A
+ except BadPickleGet:... |
4c9b8a55d26df7421decdc05236499f61583ab38 | fix smart folder content getter | novaideo/utilities/smart_folder_utility.py | novaideo/utilities/smart_folder_utility.py | # -*- coding: utf8 -*-
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# avalaible on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
from substanced.util import get_oid
from dace.util import get_obj
from novaideo.views.filter import (
find_entities)
from novaideo.utilities.... | Python | 0.000001 | @@ -175,18 +175,15 @@
rom
-substanced
+hypatia
.uti
@@ -195,26 +195,34 @@
ort
-get_oid%0A%0Afrom da
+ResultSet%0A%0Afrom substan
ce
+d
.uti
@@ -235,18 +235,34 @@
rt get_o
-bj
+id, find_objectmap
%0A%0Afrom n
@@ -1384,43 +1384,102 @@
ject
-s.extend(%5Bget_obj(o) for o in oids%5D
+map = find_objectmap(folder)%0... |
70db54eba970f8e8f6c42587675f1525002ea12f | Update wrong status code stated in docstring | hug/redirect.py | hug/redirect.py | """hug/redirect.py
Implements convience redirect methods that raise a redirection exception when called
Copyright (C) 2016 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software... | Python | 0 | @@ -1926,9 +1926,9 @@
P 30
-4
+7
sta
|
1db7ef99aef8691600d74b23a751c6a753e2a5da | Update : Enhancing timer function and exec times storage | hurdles/base.py | hurdles/base.py | # -*- coding:utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
import time
from functools import wraps
from inspect import getmembers, ismethod
def time_it(func, *args, **kwargs):
"""
Decorator whichs times a function execution.
"""
start = time.time()
... | Python | 0 | @@ -113,16 +113,51 @@
t time%0A%0A
+from collections import namedtuple%0A
from fun
@@ -223,275 +223,81 @@
d%0A%0A%0A
-def time_it(func, *args, **kwargs):%0A %22%22%22%0A Decorator whichs times a function ex
+ExecTimeColl
ec
-u
tion
-.%0A %22%22%22%0A start = time.time()%0A func(*args, **kwargs)%0A ... |
aebe8c0b586b408b55b13d8ddd3a974c194455a6 | Update categorical_braninhoo_example.py | examples/categorical_braninhoo_example.py | examples/categorical_braninhoo_example.py | import whetlab
import numpy as np
# Define parameters to optimize
parameters = { 'X' : {'type':'float','min':0,'max':15,'size':1},
'Y' : {'type':'float','min':-5,'max':10,'size':1},
'Z' : {'type': 'enum', 'options': ['bad','Good!','OK']}}
#access_token = ''
name = 'Categorical Braninhoo'
... | Python | 0.000001 | @@ -1,12 +1,206 @@
+# In this example we will optimize the 'Braninhoo' optimization benchmark with a small twist to %0A# demonstrate how to set up a categorical variable. There is also a constraint on the function.%0A
import whetl
|
1db096e38a15543aa93ee20357f8f5369b60443d | Exclude failed nodes from pairing | models.py | models.py | """Define additional classes required for the Joint Estimation Experiment."""
from dallinger.experiments import Experiment
from dallinger.models import Network, Node, Info
from sqlalchemy import Integer
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.sql.expression import cast
from dallinger.nodes im... | Python | 0.000001 | @@ -806,16 +806,28 @@
vectors(
+failed=%22all%22
))%5D%0A%0A
@@ -908,32 +908,45 @@
import random%0A
+ %0A
# pi
|
09a35f644e303b625be941432193d19feb7231ac | Make links in posts and comments usable | models.py | models.py | """ Data model module for appengine_multiblog
Contains data model definitions
used by Google Cloud Datastore. These are imported
by main.py
"""
from google.appengine.ext import ndb
import bleach
import jinja2
import os
TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), 'templates')
JINJA_ENV = jinja2.E... | Python | 0 | @@ -1173,32 +1173,57 @@
jinja2.Markup(%0A
+ bleach.linkify(%0A
bleach
@@ -1256,32 +1256,32 @@
%5Bu'a', u'img'%5D,%0A
-
@@ -1371,32 +1371,33 @@
strip=False))
+)
%0A self._r
@@ -1651,32 +1651,57 @@
jinja2.Markup(%0A
+ bleach.linkify(%0A
bleach
@@ -1... |
cc5c7e7c360ff6379259ad878310bd59c47c6f29 | mark string for translation | coupons/forms.py | coupons/forms.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016, Raffaele Salmaso <raffaele@salmaso.org>
# Copyright (C) 2013, byteweaver
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of... | Python | 0.000019 | @@ -2399,16 +2399,18 @@
bel=
+_(
%22Prefix%22
,%0A
@@ -2405,16 +2405,17 @@
%22Prefix%22
+)
,%0A )%0A
|
c3c986e08dadf3ecdd4f94eca6abf36c22a1c209 | Update DB/ Deploy | models.py | models.py | from sqlalchemy import create_engine, Column, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
def db_connect():
"""
Performs database connection
Returns sqlalchemy engine instance
"""
return create_engine('postgres://fbcmeskynsvati:aURfAdENt6-... | Python | 0 | @@ -292,96 +292,162 @@
://f
-bcmeskynsvati:aURfAdENt6-kumO0j224GuXRWH'%0D%0A '@ec2-54-221-235-135
+cvxvbdsuotypy:a3b010cca1fa4e6949ff39c11c6'%0D%0A 'e0b9edf9ce67a650535436dc349ba29b8c751@ec2-54-243-253-'%0D%0A '17
.com
@@ -466,16 +466,22 @@
naws... |
6c71dd12abffefdaec062555283afc9346dacc0a | answering haitham questions | modles.py | modles.py | #encoding: utf-8
from django.db import models
#Haitham: (how models works? will the following model be defined in 1 database?)
#Haitham: (what does foreign key means?)
#Haitham: how the different model interact?
#Haitham: can we change the models (add/remove fields) in the future?
#Haitham: how to store use... | Python | 0.998489 | @@ -129,95 +129,506 @@
?)%0A#
-Haitham: (what does foreign key means?)%0A#Haitham: how the different model interact?
+daonb: all models are deifned in one database - as define in the project's settings.py%0A#Haitham: (what does foreign key means?)%0A#daonb: a one-to-many relationship, helping you connect two mod... |
fac8a172a16da011bab9e41afc52f24f833687fc | Simplify the date calculation | monday.py | monday.py | #! /usr/bin/env python
"""Run this during the week to write last week's short-form entry"""
from __future__ import print_function
from datetime import datetime, timedelta
import errno
import operator
import os
import sys
def sunday_after(dt, offset=1):
"""offset == 3 means 3rd Sunday from now, -2 means two Sun... | Python | 0.999998 | @@ -515,15 +515,32 @@
+s = dt + timedelta(
days
- =
+=
6 -
@@ -555,138 +555,43 @@
ay()
+)
%0A
-hours = 23 - dt.hour%0A mins = 59 - dt.minute%0A sec = 59 - dt.second%0A s = dt + timedelta(days=days, hours=hours
+s = s.replace(hour=23
, minute
s=mi
@@ -590,22 +590,19 @@
nute
-s=mins
+=59
, se... |
334577d786f8fc8a839800d46cae3ac21cff7dc1 | Add quick cimport identification | isort/identify.py | isort/identify.py | """"""
from typing import NamedTuple, Optional
from .comments import parse as parse_comments
from .settings import DEFAULT_CONFIG, Config
from pathlib import Path
from isort.parse import _normalize_line, _strip_syntax, skip_line
from typing import TextIO, Iterator
def import_type(line: str, config: Config = DEFAULT... | Python | 0 | @@ -627,14 +627,21 @@
line
+_number
: int%0A
-
@@ -1796,24 +1796,265 @@
mments(line)
+%0A normalized_import_string = import_string.replace(%22import(%22, %22import (%22).replace(%22%5C%5C%22, %22 %22).replace(%22%5Cn%22, %22 %22)%0A cimports: bool = %22 cimport %22 in normalized_import_st... |
59257dc386f65f013ca7dd36300ac1078caf5d82 | Fix setting biome temperature and rainfall from stack | burger/toppings/biomes.py | burger/toppings/biomes.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""
Copyright (c) 2011 Tyler Kenendy <tk@tkte.ch>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the... | Python | 0 | @@ -2531,24 +2531,25 @@
k) == 2 and
+(
type(stack%5B1
@@ -2569,16 +2569,54 @@
loatType
+ or type(stack%5B0%5D) == types.FloatType)
:%0A
@@ -3103,16 +3103,155 @@
ck.pop()
+%0A if len(stack) == 2:%0A tmp%5B%22rainfall%22%5D = stack.pop()%0A tmp%5B%22tempera... |
8dbb1acb0800aef83a599fdd575c22824e5716da | initialize doctors field of the Act model when creating a new appointment | calebasse/actes/models.py | calebasse/actes/models.py | # -*- coding: utf-8 -*-
from django.db import models
from calebasse.agenda.models import Event, EventType
from calebasse.agenda.managers import EventManager
class Act(models.Model):
act_type = models.ForeignKey('ressources.ActType',
verbose_name=u'Type d\'acte')
validated = models.BooleanField(bl... | Python | 0 | @@ -2697,16 +2697,54 @@
date(),%0A
+ doctors=participants,%0A
|
221d5a352d587eb80b146e79e2baf0d5269f439e | Fix resolution of Place-based locations to known ancestor | carmen/resolvers/place.py | carmen/resolvers/place.py | """Resolvers based on Twitter Places."""
from collections import defaultdict
from itertools import count
import re
import warnings
from ..location import Location, EARTH
from ..names import ALTERNATIVE_COUNTRY_NAMES, US_STATE_ABBREVIATIONS
from ..resolver import AbstractResolver
STATE_RE = re.compile(r'.+,\s*(\w+)... | Python | 0.000004 | @@ -1098,16 +1098,125 @@
start)%0A%0A
+ def _find_by_location(self, location):%0A return self._locations_by_name.get(location.canonical())%0A%0A
def
@@ -3208,110 +3208,8 @@
on)%0A
- if self.allow_unknown_locations:%0A # Remember this location for future lookups.%0A
@@ -3245... |
a1abbc0ab186eb0560e8924dd85298c931185b37 | Fix to git.lookaside messages. | fedmsg_meta_fedora_infrastructure/scm.py | fedmsg_meta_fedora_infrastructure/scm.py | # This file is part of fedmsg.
# Copyright (C) 2012 Red Hat, Inc.
#
# fedmsg 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 Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#... | Python | 0 | @@ -2947,33 +2947,32 @@
'.git.lookaside
-.
' in msg%5B'topic'
@@ -5352,33 +5352,32 @@
'.git.lookaside
-.
' in msg%5B'topic'
@@ -6676,33 +6676,32 @@
'.git.lookaside
-.
' in msg%5B'topic'
@@ -7665,17 +7665,16 @@
ookaside
-.
' in msg
|
17cbd0f3c9d9d5d3ef2caa7d15ada64266206c94 | Add watt to mysensors switch attributes (#13370) | homeassistant/components/switch/mysensors.py | homeassistant/components/switch/mysensors.py | """
Support for MySensors switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.mysensors/
"""
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components import mysensors
from homeassistant.comp... | Python | 0 | @@ -2597,16 +2597,205 @@
mistic%0A%0A
+ @property%0A def current_power_w(self):%0A %22%22%22Return the current power usage in W.%22%22%22%0A set_req = self.gateway.const.SetReq%0A return self._values.get(set_req.V_WATT)%0A%0A
@pro
|
a7bc9b1111630db55a2bbcd96a30145389937d20 | fix a pull | homeassistant/components/thermostat/zwave.py | homeassistant/components/thermostat/zwave.py | """
ZWave Thermostat.
"""
# Because we do not compile openzwave on CI
# pylint: disable=import-error
from homeassistant.components.thermostat import DOMAIN
from homeassistant.components.thermostat import ThermostatDevice
from homeassistant.components.zwave import (
ATTR_NODE_ID, ATTR_VALUE_ID, NETWORK,
ZWaveD... | Python | 0.0001 | @@ -1483,22 +1483,26 @@
ation =
-%22Idle%22
+STATE_IDLE
%0A
@@ -1538,14 +1538,18 @@
e =
-%22Idle%22
+STATE_IDLE
%0A
|
996a037cb90afa29305c61d8662fc9e3b5d508e5 | Add name to mixer | mopidy_alsamixer/mixer.py | mopidy_alsamixer/mixer.py | from __future__ import unicode_literals
import logging
import sys
import alsaaudio
from mopidy import mixer
import pykka
logger = logging.getLogger(__name__)
class AlsaMixer(pykka.ThreadingActor, mixer.Mixer):
def __init__(self, config):
super(AlsaMixer, self).__init__()
self.config = confi... | Python | 0.000002 | @@ -212,16 +212,40 @@
ixer):%0A%0A
+ name = 'alsamixer'%0A%0A
def
|
fceda4761545eb3838cdbd3bda51531be577a417 | remove artist | mopidy_youtube/backend.py | mopidy_youtube/backend.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import string
import unicodedata
from multiprocessing.pool import ThreadPool
from urlparse import parse_qs, urlparse
from mopidy import backend
from mopidy.models import Artist, Album, SearchResult, Track
import pafy
import pykka
import req... | Python | 0 | @@ -243,16 +243,8 @@
port
- Artist,
Alb
@@ -1442,19 +1442,16 @@
- %25s %25s
-%25s
%25s' %25 (%0A
@@ -1482,22 +1482,8 @@
tle,
- video.author,
uri
@@ -2067,105 +2067,8 @@
),%0A
- artists=%5B%0A Artist(%0A name=video.author%0A )%0A %5D,%0A
|
3a5dfcce22ef2e1da6c2ee680a6bf37228a3be2c | change view file for pantry | flask-api/api/blueprints/pantry/views.py | flask-api/api/blueprints/pantry/views.py | from flask import Blueprint, request, make_response, jsonify, g
from flask.views import MethodView
from flask_restful import Api, Resource, url_for
from api import bcrypt, db
from api.models.user import User
from api.models.ingredient import Ingredient, PantryIngredient
from api.decorators import is_logged_in
pantry_... | Python | 0 | @@ -537,24 +537,25 @@
ed_in%5D%0A%0A
+%0A
def
delete(s
@@ -550,14 +550,13 @@
def
-delete
+patch
(sel
@@ -575,14 +575,37 @@
%22%22%22
-Remove
+%0A Change the amount of
an
@@ -615,20 +615,18 @@
redient
-from
+in
the pan
@@ -629,19 +629,16 @@
pantry
-%22%22%22
%0A
@@ -642,70 +642,237 ... |
affe8fc9ab1f24aab0463898c84bd7fdaab3e0c1 | Make sure urlrewrite plugin only affects tasks it is configured in. fix #2812 | flexget/plugins/urlrewrite_urlrewrite.py | flexget/plugins/urlrewrite_urlrewrite.py | from __future__ import unicode_literals, division, absolute_import
import re
import logging
from flexget import plugin
from flexget.event import event
from flexget.plugins.plugin_urlrewriting import UrlRewritingError
log = logging.getLogger('urlrewrite')
class UrlRewrite(object):
"""
Generic configurable ur... | Python | 0 | @@ -530,207 +530,8 @@
%7B%7D%0A%0A
- # built-in resolves%0A%0A# resolves = yaml.safe_load(%22%22%22%0A# tvsubtitles:%0A# match: http://www.tvsubtitles.net/subtitle-%0A# replace: http://www.tvsubtitles.net/download-%0A# %22%22%22%0A# )%0A%0A
@@ -541,16 +541,16 @@
ema = %7B%0A
+
... |
b6b721bd4072fc28a613fd2d4491cdc8e29b8fe5 | Fix xref counts in release notes | rnacentral/portal/management/commands/ftp_exporters/ftp_base.py | rnacentral/portal/management/commands/ftp_exporters/ftp_base.py | """
Copyright [2009-2017] 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 applicable law or a... | Python | 0 | @@ -7977,32 +7977,52 @@
ma(Xref.objects.
+filter(deleted='N').
count())%0A
|
27699aa0e7a2fb96dab2900eba6b0b8c7e24909b | remove leftover print statement | celery/bin/celeryd_detach.py | celery/bin/celeryd_detach.py | import os
import sys
from optparse import OptionParser, BadOptionError, make_option as Option
from celery import __version__
from celery.platforms import create_daemon_context
OPTION_LIST = (
Option('-f', '--logfile', default=None,
action="store", dest="logfile",
help="Path to t... | Python | 0.027089 | @@ -5160,62 +5160,8 @@
))%0A
- print(%22LEFTOVERS: %25r%22 %25 (parser.leftovers, ))%0A
|
7dc26b39ea988d46669a11a6f6e10d648e4b9470 | support for token response in authorization code | keystoneclient/v3/contrib/oauth2/authorization_codes.py | keystoneclient/v3/contrib/oauth2/authorization_codes.py | # Copyright (C) 2014 Universidad Politecnica de Madrid
# 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... | Python | 0 | @@ -2599,29 +2599,79 @@
'
+state': query%5B'state'%5D%0A %7D%0A
code
-':
+ =
query
-%5B
+.get(
'code'
-%5D
,
+ None)
%0A
@@ -2679,45 +2679,170 @@
- 'state': query%5B'state'%5D%0A %7D
+if code:%0A authorization_code%5B'code'%5D = code%0A%0A token = query.get(... |
bb6ba761e6b7d8ff60662b36f18afdbf2c93bd13 | change link message text to include baby switch | snappybouncer/tasks.py | snappybouncer/tasks.py | from celery import task
from celery.utils.log import get_task_logger
import requests
import json
import urllib
from go_http.send import HttpApiSender
from go_http.contacts import ContactsApiClient
from besnappy import SnappyApiSender
from django.conf import settings
from snappybouncer.models import Ticket
logger = ... | Python | 0 | @@ -3359,12 +3359,29 @@
ser
-out:
+Out or Switch to Baby
%22 +
|
d4ef5e2cb956d7ac7b28497cdc849f7c2bc85712 | add radio by default | shop_catalog/settings.py | shop_catalog/settings.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
SLUG_FIELD_HELP_TEXT = _(
'Can only contain the letters a-z, A-Z, digits, minus and underscores, '
'and can\'t start with a digit.')
PRODUCT_CHANGE_FORM_TE... | Python | 0.000001 | @@ -405,17 +405,120 @@
OICES =
-(
+getattr(%0A settings, 'SHOP_CATALOG_ATTRIBUTE_TEMPLATE_CHOICES', (%0A ('radio', _('Radio')),%0A )
)%0A%0AHAS_C
|
aa84a3b3a0b936ab29da5b0a8b3590841e787991 | add properties | biothings_explorer/dispatcher.py | biothings_explorer/dispatcher.py | # -*- coding: utf-8 -*-
"""
biothings_explorer.dispatcher
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains code that biothings_explorer use to communicate to and receive from APIs. It serves as a glue between "apicall" module and "api_output_parser" module.
"""
from collections import defaultdict
from .registry im... | Python | 0.000001 | @@ -495,24 +495,25 @@
self.
+_
edges = edge
@@ -563,32 +563,33 @@
ry%0A self.
+_
batch_mode = bat
@@ -605,24 +605,25 @@
self.
+_
values = sel
@@ -726,50 +726,739 @@
-def preprocess_input_values(self, values):
+@property%0A def batch_mode(self):%0A return self._batch_mode%0A%0A... |
0b635ffb77acb362c34769a72dfd6d0063c32f38 | Handle range of success codes | chargehound/api_requestor.py | chargehound/api_requestor.py | from __future__ import unicode_literals
import chargehound
import requests
from chargehound.error import create_chargehound_error
from chargehound.version import VERSION
class APIRequestor(object):
def parse_response(self, response):
payload = response.json()
if response.status_code == 200:
... | Python | 0 | @@ -305,12 +305,11 @@
ode
-== 2
+%3C 4
00:%0A
|
41537854b93137b9455c194645778d05e94ec33c | Fix error when deleting directories. | ide/projects.py | ide/projects.py | import errno
import os
import shutil
WORKSPACE_DIR = os.path.expanduser('~/mclab-ide-projects')
def get_all_projects():
mkdir_p(WORKSPACE_DIR)
return map(Project, os.listdir(WORKSPACE_DIR))
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as e:
if e.errno != errno.EEXIST or ... | Python | 0 | @@ -1622,18 +1622,15 @@
-os.remove(
+path =
self
@@ -1640,16 +1640,121 @@
th(file)
+%0A if os.path.isdir(path):%0A shutil.rmtree(path)%0A else:%0A os.remove(path
)%0A%0A d
|
62569c736148aae34c9bafbfceb1033b88871daf | use https for ipinfo.io | check.py | check.py | import json
import urllib2
import datetime
import mysqlhack #pylint: disable = unused-import
from traceback import format_exc as print_traceback
from com.ziclix.python.sql import zxJDBC
from secrets import *
from helpers import *
# receive info based on the user's IP. information provided by ipinfo.io
def ip_info(pla... | Python | 0 | @@ -391,16 +391,17 @@
en(%22http
+s
://ipinf
|
6ef5db75b8b5798e12baec25f5e1d6d26a8c29fa | fix conflict | blitzortung/dataimport/strike.py | blitzortung/dataimport/strike.py | # -*- coding: utf8 -*-
"""
Copyright 2014-2016 Andreas Würl
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by ap... | Python | 0.031708 | @@ -1739,154 +1739,8 @@
e()%0A
-%3C%3C%3C%3C%3C%3C%3C Updated upstream%0A target_url = self.data_url.build_path(os.path.join('Protected', 'Strikes', url_path), region=region)%0A=======%0A
@@ -1861,32 +1861,8 @@
on)%0A
-%3E%3E%3E%3E%3E%3E%3E Stashed changes%0A
|
30089f005f62e84367aa6affd5acbd4920f8086a | fix installation on Arch | cfg/search/__main__.py | cfg/search/__main__.py | from pathlib import Path
from libdotfiles import HOME_DIR, PKG_DIR, packages, util
FZF_DIR = HOME_DIR / ".fzf"
if util.distro_name() == "arch":
packages.try_install("fzf") # super opener
packages.try_install(
"silver-searcher-git"
) # super grep (vim-fzf dependency)
packages.try_install("ri... | Python | 0 | @@ -217,33 +217,28 @@
all(
-%0A %22
+%22the_
silver
--
+_
searcher
-git
@@ -237,39 +237,14 @@
cher
--git%22%0A ) # super grep (vim-
+%22) #
fzf
@@ -253,17 +253,16 @@
pendency
-)
%0A pac
|
a2efba8d942171249b3ed2f28497d84f81cbbb06 | Add lint test and format generated code (#4114) | java-language/google-cloud-language/synth.py | java-language/google-cloud-language/synth.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 | @@ -696,112 +696,226 @@
gcp%0A
-%0Agapic = gcp.GAPICGenerator()%0Acommon_templates = gcp.CommonTemplates()%0A%0Afor version in %5B%22v1%22, %22v1beta2%22%5D
+import synthtool.languages.java as java%0A%0Agapic = gcp.GAPICGenerator()%0A%0Aservice = 'language'%0Aversions = %5B'v1', 'v1beta2'%5D%0Aconfig_pattern = '/googl... |
d8c1dfc97b525728cd2e70070a578d7a216bc55b | remove unecessary emailbackend override | imager/tests.py | imager/tests.py | import factory
from django.test import Client
from django.test import TestCase
from django.core import mail
from django.test.utils import override_settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.files.uploadedfile import SimpleUploadedFile
from django.contrib.auth.models import Use... | Python | 0.000035 | @@ -464,157 +464,8 @@
'%0A%0A%0A
-class TestEmailBackend(BaseEmailBackend):%0A def send_messages(self, messages):%0A mail.outbox.extend(messages)%0A return len(messages)%0A%0A%0A
clas
@@ -5818,74 +5818,8 @@
)%0A%0A%0A
-@override_settings(EMAIL_BACKEND='imager.tests.TestEmailBackend')%0A
clas
|
743b2593113a19382e60c3968897c871d98e20a8 | add alternate shorthand arguments, simplify shell execution | alfred.py | alfred.py | #!/usr/bin/python
import argparse, subprocess, re, sys
VERSION="0.1";
parser = argparse.ArgumentParser(description='''Execute a test''',)
parser.add_argument('--file', type=str, required=True, help="Filename of php file (ex 'script.php')")
parser.add_argument('--query', type=str, required=True, help="Value to repla... | Python | 0.000005 | @@ -153,16 +153,22 @@
rgument(
+'-f',
'--file'
@@ -168,17 +168,16 @@
--file',
-
type=st
@@ -261,16 +261,22 @@
rgument(
+'-q',
'--query
@@ -277,17 +277,16 @@
-query',
-
type=st
@@ -373,17 +373,16 @@
ersion',
-
action=
@@ -597,16 +597,22 @@
it(1)%0A%0Ap
+rocess
= subpr
@@ -730,128 +730,86 @@
True
-)... |
643b00ee74e8c056bfd0e05856c624800562f969 | Include tinymt in windows build | build.py | build.py | import sys
import os
import platform
sys.path.insert(0, 'input')
import ninja_syntax
plat = platform.system()
bit64 = platform.architecture()[0] == '64bit'
joinp = os.path.join
if(bit64):
fmoddir = 'x86_64'
else:
fmoddir = 'x86'
cflags = '-Iinc -Wall -Wextra -Werror -g'
ldflags = ''
if plat == 'Windows':
cfla... | Python | 0 | @@ -428,16 +428,31 @@
win/inc
+-Iinput/TinyMT
'%0A ldfl
@@ -646,16 +646,47 @@
mwindows
+ input/TinyMT/tinymt/tinymt64.o
'%0Aelif p
|
2ea2958516b32626a2513ea2ae939915ec8332df | Save the metadata at the end of the transfer | onitu/api/dealer.py | onitu/api/dealer.py | import time
from threading import Thread, Event
from multiprocessing.pool import ThreadPool
import zmq
import redis
from logbook import Logger
from .metadata import Metadata
class Dealer(Thread):
"""Receive and reply to orders from the Referee.
All the requests are handled in a thread-pool.
"""
d... | Python | 0.000003 | @@ -6067,24 +6067,58 @@
dealer.name)
+%0A self.metadata.write()
%0A%0A
|
031e99c3545de7e4e80ddb62a2603ec46e39ffab | Update db.py | app/db.py | app/db.py | # -*- coding: utf-8 -*-
import pymysql.cursors
import logging
import logging.config
logging.config.fileConfig('logging.conf')
db_logger = logging.getLogger()
config = {
'host':'172.17.0.2',
'port':3306,
'user':'root',
'password':'123456',
'db':'test',
'charset':'utf8',
}
connection = pymysql... | Python | 0.000001 | @@ -377,48 +377,8 @@
):%0D%0A
-%09# type_token = token_type(markettype)%0D%0A
%09try
@@ -1147,18 +1147,8 @@
y:%0D%0A
-%09%09# pass%0D%0A
%09%09co
@@ -1261,48 +1261,8 @@
):%0D%0A
-%09# type_token = token_type(markettype)%0D%0A
%09try
|
41124f4e8c071e611d6bf5fbf94a5473b97b8a07 | Add track.html generator with a bookmark link into the build script | build.py | build.py | # Python 3
import fileinput
import glob
import shutil
import sys
import os
EXEC_UGLIFYJS = "uglifyjs --bare-returns --compress --mangle --mangle-props --reserve-domprops --reserved-file reserve.txt --screw-ie8 --output \"{1}\" \"{0}\""
EXEC_CLOSURECOMPILER = "java -jar lib/closure-compiler-v20160911.jar --js \"{0}\"... | Python | 0 | @@ -840,32 +840,36 @@
):%0A output_file
+_raw
= %22bld/track.js
@@ -870,16 +870,61 @@
ack.js%22%0A
+ output_file_bookmark = %22bld/track.html%22%0A %0A
output
@@ -1009,32 +1009,36 @@
open(output_file
+_raw
, %22w%22) as out:%0A
@@ -1252,32 +1252,36 @@
rmat(output_file
+_raw
, output_file_tm
@@ -1354,16 +... |
5390e8c9d999845c997da431894e2fa5ae32b6ce | Handle KeyboardInterrupt exception during delete confirmation loop | clink.py | clink.py | #! /usr/bin/env python
# Clink - the CLI URL collector
# Author: Nicholay Nascimento
import pyperclip, argparse, os, time
parser = argparse.ArgumentParser(
description="A simple bookmark manager for the command-line",
epilog="")
exgroup = parser.add_mutually_exclusive_group()
exgroup.add_argument("-a", "--ad... | Python | 0 | @@ -2483,16 +2483,21 @@
%0A
+ try:
choice
@@ -2545,24 +2545,76 @@
y/n %22)%0A
-
+%09except KeyboardInterrupt:%0A%09 print %22%5Cnabort%22%0A%09 break%0A%09
if choic
|
1a28b026ae586bfac43c55a6d92d801c0bd0d139 | use name as name | adhocracy4/filters/widgets.py | adhocracy4/filters/widgets.py | from itertools import chain
import django_filters
from django.db.models.fields import BLANK_CHOICE_DASH
from django.forms import TextInput
from django.forms.widgets import flatatt
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
class DropdownLinkWidget(django_fi... | Python | 0.999127 | @@ -2210,26 +2210,12 @@
e':
-self.label.lower()
+name
,%0A
|
a216e92177f6daf7857e600e3fac9a4775ab0a21 | Make sure that profile actually has an email, before trying to associate users by it | linked_accounts/views.py | linked_accounts/views.py | from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import redirect, render
from django.utils import simplejson as json
from django.utils.crypto import salted_hmac
from django.views.decorators.csrf import csrf_exempt
import django.con... | Python | 0 | @@ -3092,24 +3092,42 @@
_ASSOCIATION
+ and profile.email
:%0A
|
f74aaf00050d0bbe14fe921efefcd04bd17f4174 | add intervals | bam2vcf_GATK_wolves.py | bam2vcf_GATK_wolves.py | #!/usr/bin/env python
#import argparse
#from glob import glob
#-s test_samples.txt
#-b /mnt/lfs2/hend6746/devils/reference/sarHar1.fa
#-i /mnt/home/hend6746/scratch/wolves/bed_files/baits_canfam3.1_sorted_merged.bed
from os.path import join as jp
from os.path import abspath
import os
import sys
import argparse
pars... | Python | 0.999983 | @@ -2695,17 +2695,18 @@
rvalPath
-,
+ +
' --int
@@ -2724,17 +2724,18 @@
ng 1000'
-,
+ +
' --int
@@ -2762,16 +2762,17 @@
SECTION'
+,
%0A '%3E%3E
|
1d3651e2556a2dce8a2482ea1e3b56800fa81029 | Use ChoiceSet.values() for access to raw values | netbox/utilities/utils.py | netbox/utilities/utils.py | import datetime
import json
from collections import OrderedDict
from django.core.serializers import serialize
from django.db.models import Count, OuterRef, Subquery
from jinja2 import Environment
from dcim.choices import CableLengthUnitChoices
from extras.utils import is_taggable
def csv_format(data):
"""
E... | Python | 0 | @@ -4563,23 +4563,8 @@
ts =
- %5Bu%5B0%5D for u in
Cab
@@ -4582,17 +4582,25 @@
tChoices
-%5D
+.values()
%0A if
|
9c720cf806364e4eaf40da24691bc224a9288485 | Clean combo script | combo.py | combo.py | from flask import Flask
from libmproxy import filt
import proxyswitch as pswitch
# app = Flask('proxapp')
# @app.route('/')
# def hello_world():
# return 'Hello World!'
# @app.route('/foo')
# def foo():
# return 'foo'
def enable():
settings = ('127.0.0.1', '8080')
pswitch.enable(*settings)
def disa... | Python | 0 | @@ -1,28 +1,4 @@
-from flask import Flask%0A
from
@@ -55,156 +55,8 @@
ch%0A%0A
-# app = Flask('proxapp')%0A%0A# @app.route('/')%0A# def hello_world():%0A# return 'Hello World!'%0A%0A# @app.route('/foo')%0A# def foo():%0A# return 'foo'%0A%0A
def
@@ -291,59 +291,8 @@
om%22)
-%0A # context.app_registry.add... |
7204f13be70f92749ca88497d11a51fedcd65553 | Move back to `default_player_roles`. | meltingpot/python/utils/substrates/substrate_factory.py | meltingpot/python/utils/substrates/substrate_factory.py | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | Python | 0.000002 | @@ -1286,32 +1286,31 @@
str%5D,%0A
-scenario
+default
_player_role
@@ -1312,27 +1312,16 @@
_roles:
-Collection%5B
Sequence
@@ -1325,17 +1325,16 @@
nce%5Bstr%5D
-%5D
,%0A ) -%3E
@@ -2124,24 +2124,23 @@
.%0A
-scenario
+default
_player_
@@ -2141,24 +2141,36 @@
layer_roles:
+ the default
player rol... |
e9151b46cdfd120daf5ecae00a551f23e85373da | Update comments to reflect config migration | beetsplug/mpdupdate.py | beetsplug/mpdupdate.py | # This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | Python | 0 | @@ -743,20 +743,19 @@
our
-.beets
config
+.yaml
to
@@ -769,17 +769,16 @@
re:%0A
-%5B
mpdupdat
@@ -782,18 +782,22 @@
date
-%5D%0A
+:%0A
host
= l
@@ -792,18 +792,17 @@
host
- =
+:
localho
@@ -808,16 +808,20 @@
ost%0A
+
port
= 6
@@ -820,16 +820,19 @@
port
- =
+:
6600%0A
+
... |
d69346bf912f45bca00edf6abea9a4f05f9f7d73 | bionetplot.py should be executable | client/plot/bionetplot.py | client/plot/bionetplot.py | #!/usr/bin/python
from twisted.internet import reactor, interfaces, protocol
from twisted.protocols import basic
from twisted.web import server, resource
from twisted.web.static import File
from twisted.web.server import Site
from twisted.web.resource import Resource
from twisted_bionet_client import *
from bionet im... | Python | 0.999999 | |
250e166f02642e9d3c41f3854b6e9e12c560daba | update script for battle | battle.py | battle.py |
# Welcome to Battleship
# http://www.codecademy.com/courses/python-beginner-en-4XuFm/0/1?curriculum_id=4f89dab3d788890003000096
""" In this project you will build a simplified, one-player version of the
classic board game Battleship! In this version of the game, there will be a
single ship hidden in a random locati... | Python | 0 | @@ -755,16 +755,115 @@
(board)%0A
+print %22Battle ship is in row %25s, col %25s%22 %25 (ship_row, ship_col)%0A%0Adef check_guess(row, col, turn):%0A%09
guess_ro
@@ -896,16 +896,17 @@
ow: %22))%0A
+%09
guess_co
@@ -944,133 +944,495 @@
))%0A%0A
-print %22B
+%09if guess_row == ship_row and guess_col == ship_col:%0A%... |
c2673bc4ab244e55d876ce6eb643a3cab37c6573 | Use Django's now() | src/edurepo/resources/management/commands/validate_resources.py | src/edurepo/resources/management/commands/validate_resources.py | from datetime import datetime, timedelta
from optparse import make_option
import sys
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.utils.timezone import utc
import requests
from resources.models import Resource, ResourceVerification
def now():
return datetime.utcn... | Python | 0 | @@ -195,19 +195,19 @@
import
-utc
+now
%0Aimport
@@ -282,70 +282,8 @@
n%0A%0A%0A
-def now():%0A return datetime.utcnow().replace(tzinfo=utc)%0A%0A%0A
def
|
03708a87b65ed4695a54cb588b6dc5298a14edcb | Add some checks | smartreact/smartreact.py | smartreact/smartreact.py | import copy
import discord
from redbot.core import Config, commands, checks
from redbot.core.utils.chat_formatting import pagify
BaseCog = getattr(commands, "Cog", object)
class SmartReact(BaseCog):
"""Create automatic reactions when trigger words are typed in chat"""
default_guild_settings = {
"rea... | Python | 0 | @@ -535,16 +535,67 @@
)%0A%0A
+ @checks.mod_or_permissions(administrator=True)%0A
@com
@@ -921,24 +921,75 @@
, message)%0A%0A
+ @checks.mod_or_permissions(administrator=True)%0A
@command
@@ -1593,16 +1593,67 @@
n None%0A%0A
+ @checks.mod_or_permissions(administrator=True)%0A
@com
|
3566e9a4d59779c1fca5cfa3031d03a1bb5a72ba | remove process executor option | cheeseprism/wsgiapp.py | cheeseprism/wsgiapp.py | from .jenv import EnvFactory
from cheeseprism.auth import BasicAuthenticationPolicy
from cheeseprism.resources import App
from functools import partial
from pyramid.config import Configurator
from pyramid.session import UnencryptedCookieSessionFactoryConfig
from pyramid.settings import asbool
import futures
import logg... | Python | 0.000002 | @@ -119,38 +119,8 @@
App%0A
-from functools import partial%0A
from
@@ -298,47 +298,11 @@
ort
-multiprocessing%0Aimport os%0Aimport signal
+os%0A
%0A%0A%0Al
@@ -1380,503 +1380,162 @@
def
-sig_handler(executor, sig, frame, wait=True):%0A logger.warn(%22Signal %25d recieved: wait: %25s%22, sig, wait)%0A execu... |
8eb938086a77a11cb2df8c83f872b9daa519f858 | fix pyhon3 compat issues in rename. | bento/compat/rename.py | bento/compat/rename.py | import os.path
import os
import random
def rename(src, dst):
"Atomic rename on windows."
# This is taken from mercurial
try:
os.rename(src, dst)
except OSError, err:
# If dst exists, rename will fail on windows, and we cannot
# unlink an opened file. Instead, the destination is ... | Python | 0 | @@ -31,16 +31,29 @@
t random
+%0Aimport errno
%0A%0Adef re
@@ -194,13 +194,8 @@
rror
-, err
:%0A
@@ -616,18 +616,17 @@
IOError
-,
+(
(errno.E
@@ -669,16 +669,17 @@
found%22)
+)
%0A%0A
|
66847c06102731668c65d2728a707eadbd554437 | Fix for the fix. | cherrypy/_cpchecker.py | cherrypy/_cpchecker.py | import os
import warnings
import cherrypy
class Checker(object):
global_config_contained_paths = False
def __call__(self):
oldformatwarning = warnings.formatwarning
warnings.formatwarning = self.formatwarning
try:
for name in dir(self):
if name.st... | Python | 0.000002 | @@ -5019,20 +5019,23 @@
bsolete%5B
-c
+secti
on
-f
%5D))%0A
@@ -5212,20 +5212,23 @@
recated%5B
-c
+secti
on
-f
%5D))%0A
|
18392d9b4ee6a62eae815d846f21299e652ae56b | Add msising import. | mysite/search/management/commands/search_daily_tasks.py | mysite/search/management/commands/search_daily_tasks.py | from django.core.management.base import BaseCommand
import django.conf
django.conf.settings.CELERY_ALWAYS_EAGER = True
import mysite.search.tasks
import mysite.customs.bugtrackers.roundup_general
import mysite.customs.bugtrackers
import mysite.search.tasks.launchpad_tasks
import mysite.customs.miro
import mysite.cus... | Python | 0 | @@ -1,12 +1,28 @@
+import logging%0A%0A
from django.
|
b61a45c13ffa82356f896f0914d2f28dabea7a7f | Include credentials for heat calling self | heat/engine/clients/os/heat_plugin.py | heat/engine/clients/os/heat_plugin.py | #
# 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.000114 | @@ -1272,16 +1272,413 @@
t_url()%0A
+ if self._get_client_option('heat', 'url'):%0A # assume that the heat API URL is manually configured because%0A # it is not in the keystone catalog, so include the credentials%0A # for the standalone auth_password middleware%0A arg... |
3a956cd2c435dba256b97d1380e0f9bd7598ed0d | Fix syntax error in daily search script. | mysite/search/management/commands/search_daily_tasks.py | mysite/search/management/commands/search_daily_tasks.py | from django.core.management.base import BaseCommand
import django.conf
django.conf.settings.CELERY_ALWAYS_EAGER = True
import mysite.search.tasks
import mysite.customs.bugtrackers.roundup_general
import mysite.customs.bugtrackers
import mysite.search.tasks.launchpad_tasks
import mysite.customs.miro
import mysite.cus... | Python | 0 | @@ -5421,17 +5421,16 @@
callable
-%22
)%0A
|
c4108fec4f879b1f98f8cb0ad7e7959bd8a3557d | Move yi imports at top-level (#29001) | homeassistant/components/yi/camera.py | homeassistant/components/yi/camera.py | """Support for Xiaomi Cameras (HiSilicon Hi3518e V200)."""
import asyncio
import logging
import voluptuous as vol
from homeassistant.components.camera import Camera, PLATFORM_SCHEMA
from homeassistant.components.ffmpeg import DATA_FFMPEG
from homeassistant.const import (
CONF_HOST,
CONF_NAME,
CONF_PATH,
... | Python | 0.000454 | @@ -83,16 +83,149 @@
ogging%0A%0A
+from aioftp import Client, StatusCodeError%0Afrom haffmpeg.camera import CameraMjpeg%0Afrom haffmpeg.tools import IMAGE_JPEG, ImageFrame%0A
import v
@@ -289,16 +289,8 @@
port
- Camera,
PLA
@@ -301,16 +301,24 @@
M_SCHEMA
+, Camera
%0Afrom ho
@@ -434,23 +434,8 @@
ME,%0A
- CON... |
ce797b963d7219f131548f32509ce4379c8d055a | disable append slash | snippit/settings/base.py | snippit/settings/base.py | """
Django settings for snippit project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... | Python | 0.000003 | @@ -2330,16 +2330,40 @@
%5B%22*%22%5D%0A%0A
+%0AAPPEND_SLASH = False%0A%0A%0A
########
|
d1e4be6cc43968253d980cbb8484cb7e43203590 | add the team code of FC Bayern München | soccer/data/teamnames.py | soccer/data/teamnames.py | __all__ = ['TEAM_NAMES']
TEAM_NAMES = {
'EFFZEH': 1,
'TSG': 2,
'B04': 3,
'BVB': 4,
'S04': 6,
'HSV': 7,
'H96': 8,
'BSC': 9,
'VFB': 10,
'WOB': 11,
'SVW': 12,
'FCK': 13,
'FCN': 14,
'M05': 15,
'FCA': 16,
'SCF': 17,
'BMG': 18,
'SGE': 19,
'FCP': 20,... | Python | 0.99997 | @@ -93,16 +93,31 @@
VB': 4,%0A
+ 'FCBM': 5,%0A
'S04
|
4a2d16d02cb53ce4c4003247cbd0ed7e137dcb35 | Add frame Fatal & reduce keepalive interval to 30s | cqsdk.py | cqsdk.py | #!/usr/bin/env python3
import re
import socket
import socketserver
import sys
import threading
import time
import traceback
from base64 import b64encode, b64decode
from collections import namedtuple
ClientHello = namedtuple("ClientHello", ("port"))
ServerHello = namedtuple("ServerHello", ())
RcvdPrivateMessage = na... | Python | 0 | @@ -1101,16 +1101,55 @@
ion%22))%0A%0A
+Fatal = namedtuple(%22Fatal%22, (%22text%22))%0A%0A
FrameTyp
@@ -1204,16 +1204,16 @@
send%22))%0A
-
FRAME_TY
@@ -1391,75 +1391,8 @@
e),%0A
- FrameType(%22GroupMessage%22, RcvdGroupMessage, SendGroupMessage),%0A
@@ -1452,32 +1452,99 @@
iscussMessage),%0A
+ FrameT... |
0a34e0a96df5ce270b5733656234876e0f1dd451 | Fix bug with autoremove. | pykmer/file.py | pykmer/file.py | """
This module provides simple parsers for the FASTA and FASTQ sequence
data formats.
The FASTQ parser is not strictly conformant since it assumes the input
to be in a line oriented form (which is usually true).
"""
__docformat__ = 'restructuredtext'
import os
import subprocess
import uuid
def readFasta(file):
... | Python | 0 | @@ -258,16 +258,31 @@
port os%0A
+import os.path%0A
import s
@@ -3422,16 +3422,55 @@
in fns:%0A
+ if os.path.isfile(fn):%0A
|
05c210f1a5f83ebbea2319f48ba58eb054b32ce2 | fix indent | q_out_panel.py | q_out_panel.py | from . import chain
#show_q_output
class QOutPanelCommand(chain.ChainCommand):
def do(self, edit, input=None):
panel = self.view.window().get_output_panel("q")
syntax_file = "Packages/q KDB/syntax/q_output.tmLanguage"
try:
sublime.load_binary_resource(syntax_file)
except Exception:... | Python | 0.00006 | @@ -223,61 +223,37 @@
e%22%0A%09
- try:%0A%09 sublime.load_binary_resourc
+%09try:%0A%09%09%09panel.set_syntax_fil
e(sy
@@ -264,24 +264,17 @@
_file)%0A%09
-
+%09
except E
@@ -288,54 +288,48 @@
n:%0A%09
- continue%0A%0A%09%09panel.set_
+%09%09print(%22Unable to load
syntax
-_
... |
95fd70cfe1f4ca972d1e31e431dad87b9bab84fc | FIX imports | addons/infrastructure_x/database.py | addons/infrastructure_x/database.py | # -*- coding: utf-8 -*-
from openerp import osv, models, fields, api, _
from openerp.exceptions import except_orm, Warning, RedirectWarning
import openerplib
import xmlrpclib
from dateutil.relativedelta import relativedelta
from datetime import datetime
# from fabric.api import local, settings, abort, run, cd, env, sud... | Python | 0.000001 | @@ -247,18 +247,16 @@
atetime%0A
-#
from fab
@@ -313,18 +313,16 @@
v, sudo%0A
-#
import o
|
468544c29071e07dc0a8923d8924b5ec43f529e4 | 修复大于4M的文件hash计算错误的问题 | qiniu/utils.py | qiniu/utils.py | # -*- coding: utf-8 -*-
from hashlib import sha1
from base64 import urlsafe_b64encode, urlsafe_b64decode
from .config import _BLOCK_SIZE
from .compat import b, s
try:
import zlib
binascii = zlib
except ImportError:
zlib = None
import binascii
def urlsafe_base64_encode(data):
"""urlsafe的base64编... | Python | 0.000001 | @@ -2117,16 +2117,14 @@
= b
-(
'%5Cx16'
-)
%0A
@@ -2220,16 +2220,14 @@
= b
-(
'%5Cx96'
-)
%0A
|
593f51e50d0e492862d98045f4ba2770a4ff341d | Remove unneeded imports | src/ggrc_basic_permissions/contributed_roles.py | src/ggrc_basic_permissions/contributed_roles.py | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: david@reciprocitylabs.com
# Maintained By: david@reciprocitylabs.com
from ggrc.extensions import get_extension_modules
from ggrc.models import Prog... | Python | 0.000004 | @@ -289,47 +289,8 @@
les%0A
-from ggrc.models import Program, Audit%0A
from
|
62398ce1fde0402a9c4b77ff018e47716ba1fdd3 | allow restricting the refresh_useractions command by user | tndata_backend/goals/management/commands/refresh_useractions.py | tndata_backend/goals/management/commands/refresh_useractions.py | import logging
from django.core.management.base import BaseCommand
from goals.models import CustomAction, UserAction
logger = logging.getLogger("loggly_logs")
class Command(BaseCommand):
help = 'Updates the next_trigger_date field for stale UserActions and CustomActions.'
def handle(self, *args, **options)... | Python | 0.000001 | @@ -27,45 +27,138 @@
o.co
-re.management.base import BaseCommand
+ntrib.auth import get_user_model%0Afrom django.core.management.base import BaseCommand, CommandError%0Afrom django.db.models import Q%0A
%0Afro
@@ -368,16 +368,883 @@
ions.'%0A%0A
+ def add_arguments(self, parser):%0A parser.add_argument(%0A... |
e16e0676b466bce1da42ed389f0c7cb27496c9b4 | add in original column values for better reporting | delta.py | delta.py | import MySQLdb
import csv
import os
import datetime
from numbers import Number
from decimal import *
from collections import deque
import itertools
import csv
# if we are in debug mode, make sure we are verbose with ssh logging too
env = {}
env["dbuser"] = "<user>"
env["dbpass"] = "<pass>"
env["dbhost"] = "<host>"
d... | Python | 0.000001 | @@ -141,16 +141,44 @@
ertools%0A
+from itertools import chain%0A
import c
@@ -982,16 +982,17 @@
hone()%0A%0A
+%0A
%09headerD
@@ -1875,16 +1875,46 @@
riterow(
+list(chain(*zip(filteredNames,
map(lamb
@@ -1960,16 +1960,19 @@
dNames))
+)))
%0A%09%09%09%09%09%09h
@@ -2460,32 +2460,48 @@
ge%0A%09%09%09%09%09
-outcs... |
5b6587cbe03ff79a29a400fb1f9b29d889b4edc5 | Make executable | appid.py | appid.py | # Find a Steam appid given its name
import json
import os.path
import sys
from fuzzywuzzy import process, fuzz # ImportError? pip install 'fuzzywuzzy[speedup]'
CACHE_FILE = os.path.abspath(__file__ + "/../appid.json")
try:
with open(CACHE_FILE) as f:
appids = json.load(f)
except FileNotFoundError:
import requests... | Python | 0.004691 | @@ -1,8 +1,31 @@
+#!/usr/bin/env python3%0A
# Find a
|
c2dc0ba54279ac555e6c76f8846f873cbd2c238f | Add Object (Asset) fields and supporting types from API docs | asset.py | asset.py | import httplib2
from urlparse import urljoin, urlparse, urlunparse
from datetime import datetime
import re
from typepad.remote import RemoteObject, BASE_URL
from typepad import fields
class Link(RemoteObject):
fields = {
'rel': fields.Something(),
'href': fields.Something(),
'type... | Python | 0 | @@ -2760,22 +2760,33 @@
%0A%0Aclass
-Object
+PublicationStatus
(RemoteO
@@ -2821,83 +2821,361 @@
'
-id': fields.Something(),%0A #'control': fields.Object(Control
+published': fields.Something(),%0A 'spam': fields.Something(),%0A %7D%0A%0Aclass ObjectRef(RemoteObject):%0A fields ... |
d2d090383d93e89bd8ce07d533715612cf472152 | Support lists of nodes in astpp | astpp.py | astpp.py | """
A pretty-printing dump function for the ast module. The code was copied from
the ast.dump function and modified slightly to pretty-print.
Alex Leone (acleone ~AT~ gmail.com), 2010-01-30
"""
from ast import *
def dump(node, annotate_fields=True, include_attributes=False, indent=' '):
"""
Return a format... | Python | 0 | @@ -1728,16 +1728,98 @@
r(node)%0A
+ if isinstance(node, list):%0A return '%5Cn'.join(_format(n) for n in node)%0A
if n
|
6b718b0fbfac2c7206a50a451a443079aad362ac | Make ESC navigate previous controllers | subiquity/controllers/__init__.py | subiquity/controllers/__init__.py | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | Python | 0 | @@ -1941,16 +1941,187 @@
, key):%0A
+ if key in %5B'esc'%5D and Routes.current_route_idx != 0:%0A Routes.prev()%0A current_route = Routes.current()%0A current_route(self).show()%0A
|
a1996022dd288b5a986cd07b2694f5af514296e4 | Delete unnecessary annotation in examples/bucket_policy.py | examples/bucket_policy.py | examples/bucket_policy.py |
import os
import oss2
import json
# 以下代码展示了bucket_policy相关API的用法,
# 具体policy书写规则参考官网文档说明
# 首先初始化AccessKeyId、AccessKeySecret、Endpoint等信息。
# 通过环境变量获取,或者把诸如“<你的AccessKeyId>”替换成真实的AccessKeyId等。
#
# 以杭州区域为例,Endpoint可以是:
# http://oss-cn-hangzhou.aliyuncs.com
# https://oss-cn-hangzhou.aliyuncs.com
# 分别以HTTP、HTTPS协议访问。
... | Python | 0.000001 | @@ -296,29 +296,8 @@
com%0A
-# %E5%88%86%E5%88%AB%E4%BB%A5HTTP%E3%80%81HTTPS%E5%8D%8F%E8%AE%AE%E8%AE%BF%E9%97%AE%E3%80%82%0A
acce
|
268d23ebd987a30312694eb95322b1dad332c291 | Update sender.py | adslproxy/sender.py | adslproxy/sender.py | import re
import time
import requests
from requests.exceptions import ConnectionError, ReadTimeout
from adslproxy.db import RedisClient
from adslproxy.config import *
import platform
if platform.python_version().startswith('2.'):
import commands as subprocess
elif platform.python_version().startswith('3.'):
im... | Python | 0.000001 | @@ -1063,209 +1063,8 @@
ry:%0A
- response = requests.get(TEST_URL, proxies=%7B%0A 'http': 'http://' + proxy,%0A 'https': 'https://' + proxy%0A %7D, timeout=TEST_TIMEOUT,headers=self.headers)%0A
@@ -1140,60 +1140,8 @@
xy)%0A
- if response.status_... |
b3b753880a0a4e46c8e436f87d752f348503abb2 | Comment out problematic line for now | examples/custom_plugin.py | examples/custom_plugin.py | """
Defining a Custom Plugin
========================
Test the custom plugin demoed on the `Pythonic Perambulations
<http://jakevdp.github.io/blog/2014/01/10/d3-plugins-truly-interactive/>`_
blog. Hover over the points to see the associated sinusoid.
Use the toolbar buttons at the bottom-right of the plot to enable zo... | Python | 0 | @@ -1417,16 +1417,53 @@
%7D%0A
+ // TODO: (@vladh) Fix this.%0A //
pts.ele
|
3665b8859f72ec416682857ab22f7e29fc30f0df | Add field on cached alignments to store more information | alignment/models.py | alignment/models.py | from django.db import models
# Create your models here.
class AlignmentConsensus(models.Model):
slug = models.SlugField(max_length=100, unique=True)
alignment = models.BinaryField() | Python | 0 | @@ -184,8 +184,103 @@
yField()
+%0A gn_consensus = models.BinaryField(blank=True) # Store conservation calculation for each GN
|
b1587da729c87ec39c38e0915cdf61bb3cc5f87c | remove unused imports in main | web3/main.py | web3/main.py | from __future__ import absolute_import
import warnings
from eth_utils import (
apply_to_return_value,
add_0x_prefix,
decode_hex,
encode_hex,
from_wei,
is_address,
is_checksum_address,
keccak,
remove_0x_prefix,
to_checksum_address,
to_wei,
)
from web3.admin import Admin
fro... | Python | 0 | @@ -37,25 +37,8 @@
rt%0A%0A
-import warnings%0A%0A
from
@@ -107,24 +107,8 @@
ix,%0A
- decode_hex,%0A
|
61e9b3db58c124cf41ede9fc9a3ad9c01e5bff81 | add select related query for group social links | sociallinks/templatetags/sociallink_tags.py | sociallinks/templatetags/sociallink_tags.py | # -*- coding: utf-8 -*-
from django import template
from django.contrib.contenttypes.models import ContentType
from sociallinks.models import SocialLink, SocialLinkGroup
register = template.Library()
@register.assignment_tag
def obj_social_links(obj):
"""return list of social links for obj. Obj is instance of a... | Python | 0 | @@ -1056,30 +1056,28 @@
select_related('link_type')%0A
-%0A%0A
|
1b9f944d9123a765068ea02296dcb38014183a91 | add applogic.addShortcut convenience method | software/ddapp/src/python/ddapp/applogic.py | software/ddapp/src/python/ddapp/applogic.py |
import os
import time
import math
import ddapp.vtkAll as vtk
import PythonQt
from PythonQt import QtCore
from PythonQt import QtGui
from ddapp import getDRCBaseDir as getDRCBase
from ddapp import botspy
_mainWindow = None
_defaultRenderView = None
def getMainWindow():
return _mainWindow
def quit():
QtGui.Q... | Python | 0.000001 | @@ -3743,24 +3743,204 @@
)', func)%0A%0A%0A
+def addShortcut(widget, keySequence, func):%0A shortcut = QtGui.QShortcut(QtGui.QKeySequence(keySequence), widget)%0A shortcut.connect('activated()', func)%0A return shortcut%0A%0A%0A
def setupAct
|
55efbaddf22b009175645dea9aba593740a7b4c9 | Add message to queue if handcheck is not finished. | websocket.py | websocket.py | import uuid
import re
import hashlib
import base64
from twisted.internet.protocol import Protocol as BaseProtocol
handshake = '\
HTTP/1.1 101 Web Socket Protocol Handshake\r\n\
Upgrade: WebSocket\r\n\
Connection: Upgrade\r\n\
Sec-WebSocket-Accept: %s\r\n\r\n\
'
class WebSocketError(Exception): pass
class FrameError(E... | Python | 0 | @@ -4591,24 +4591,54 @@
self, msg):%0A
+ self.commands.append(msg)%0A
if not s
@@ -4675,38 +4675,8 @@
urn%0A
- self.commands.append(msg)%0A
|
709a7139b4f3acaace53e79c7ca1adafd8f24027 | Use tempfile to save modifications | basic.py | basic.py | """Run a basic simulation"""
import os
import hoomd
import molecule
import numpy as np
import pandas
import TimeDep
from hoomd import md
import gsd.hoomd
from StepSize import generate_steps
def run_npt(snapshot, temp, steps, **kwargs):
"""Initialise a hoomd simulation"""
with hoomd.context.initialize(kwargs... | Python | 0 | @@ -41,19 +41,56 @@
%0Aimport
-hoo
+tempfile%0Aimport hoomd%0Afrom hoomd import
md%0Aimpor
@@ -148,37 +148,16 @@
TimeDep%0A
-from hoomd import md%0A
import g
@@ -386,24 +386,19 @@
it.read_
-snapshot
+gsd
(snapsho
@@ -398,16 +398,29 @@
snapshot
+, time_step=0
)%0A
@@ -857,23 +857,45 @@
dRigid(s
-napshot... |
44f3c42c5eec3c0208dfdf688c80b1aba19ce097 | Fix unit test when running via `tox` in a VsCode bash shell on Windows. | smugcli/terminal_size.py | smugcli/terminal_size.py | #!/usr/bin/env python
# Source: https://gist.github.com/jtriley/1108174
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
- get width and height of console
- works on linux,os x,windows,cygwin(windows)
originally retrieved from:
... | Python | 0 | @@ -821,32 +821,64 @@
tuple_xy is None
+ or any(not i for i in tuple_xy)
:%0A tuple_
|
5d8e6e47964d80f380db27acd120136a43e80550 | Fix tool description in argparse help | aimpoint_mon/make_web_page.py | aimpoint_mon/make_web_page.py | #!/usr/bin/env python
import os
import argparse
import json
from pathlib import Path
from jinja2 import Template
import pyyaks.logger
def get_opt():
parser = argparse.ArgumentParser(description='Get aimpoint drift data '
'from aspect solution files')
parser.add_argument(... | Python | 0.000038 | @@ -200,11 +200,12 @@
on='
-Get
+Make
aim
@@ -214,85 +214,24 @@
int
-drift data '%0A 'from aspect solution files
+monitor web page
')%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.