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 |
|---|---|---|---|---|---|---|---|
1f73444e7ee63513eec00ec9635bdfcdb09f41b7 | Version 0.3.3 | apistar/__init__.py | apistar/__init__.py | """
_ ____ ___ ____ _
__/\__ / \ | _ \_ _| / ___|| |_ __ _ _ __ __/\__
\ / / _ \ | |_) | | \___ \| __/ _` | '__| \ /
/_ _\ / ___ \| __/| | ___) | || (_| | | /_ _\
\/ /_/ \_\_| |___| |____/ \__\__,_|_| \/
"""
from apistar.core import Command, Co... | Python | 0.000001 | @@ -476,9 +476,9 @@
0.3.
-2
+3
'%0A__
|
d301e196017b442562224f786cfe23cc8cc3c70c | Update connectivity matrix. | experiments/connectivityMatrix.py | experiments/connectivityMatrix.py | from tulip import *
from tulipgui import *
import tulippaths as tp
import json
graphFile = '../data/test_feedback.tlp'
#graphFile = '../data/514_10hops.tlp'
graph = tlp.loadGraph(graphFile)
acRegexes = ['AC', 'IAC', 'YAC']
acRegexes = '(?:%s)' % '|'.join(acRegexes)
nodeConstraints = ['CBb.*', acRegexes, 'GC']
edgeCon... | Python | 0 | @@ -73,16 +73,17 @@
t json%0A%0A
+#
graphFil
@@ -114,17 +114,16 @@
ck.tlp'%0A
-#
graphFil
@@ -216,16 +216,23 @@
', 'YAC'
+, 'GAC'
%5D%0AacRege
@@ -312,10 +312,13 @@
s, '
-G
C
+Bb.*
'%5D%0Ae
@@ -348,16 +348,20 @@
'.*'%5D%0A%0A
+%22%22%22%0A
matrix =
@@ -444,50 +444,392 @@
ts)%0A
-jsonObject = matrix.getAsJs... |
122afeb4eb9afce62e2643f814d829289b22e366 | Add missing 'mlir_text' xla format. (#7709) | llvm-external-projects/iree-compiler-api/python/iree/compiler/tools/xla.py | llvm-external-projects/iree-compiler-api/python/iree/compiler/tools/xla.py | # Lint-as: python3
# Copyright 2020 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Imports XLA artifacts via the `iree-import-xla` tool."""
# TODO(#4131) python>=3... | Python | 0.999999 | @@ -1204,16 +1204,42 @@
lo_text%22
+%0A MLIR_TEXT = %22mlir_text%22
%0A%0A @sta
@@ -6297,16 +6297,40 @@
HLO_TEXT
+, ImportFormat.MLIR_TEXT
%0A %5D
|
a76d215f95b5acaf1ce7e35daeef6447fa122795 | fix maintainer email address to point to mailing list | zsi/setup.py | zsi/setup.py | #! /usr/bin/env python
# $Header$
import sys
from distutils.core import setup
_url = "http://pywebsvcs.sf.net/"
import ConfigParser
cf = ConfigParser.ConfigParser()
cf.read('setup.cfg')
major = cf.getint('version', 'major')
minor = cf.getint('version', 'minor')
release = cf.getint('version', 'release')
_version = "%d... | Python | 0.000009 | @@ -702,24 +702,31 @@
r=%22Rich Salz
+, et al
%22,%0A autho
@@ -781,16 +781,23 @@
ich Salz
+, et al
%22,%0A m
@@ -813,35 +813,43 @@
_email=%22
-rsalz@datapower.com
+pywebsvcs-talk@lists.sf.net
%22,%0A u
|
c106e1863d35232bdecd31f0a2d426c2e13b196e | update crontab debug flow | scripts/crontab.py | scripts/crontab.py | #!/usr/bin/env python
"""
- look through events table, process what we're suppose to do
- can include building fee transactions, submitting govobjs to the network
"""
import pdb
from pprint import pprint
import random
import sys, os
sys.path.append( os.path.join( os.path.dirname(__file__), '..', 'lib' ) )
sys.... | Python | 0 | @@ -4424,16 +4424,103 @@
height)%0A
+ if not sb:%0A print %22No superblock created, sorry. Returning.%22%0A return%0A
# pp
@@ -6533,26 +6533,24 @@
g events%0A
- #
prepare_eve
@@ -6563,18 +6563,16 @@
shd)%0A
- #
submit_
|
b251a1aff396aae1da39fc7330644826fc3f5923 | Introduce api version 3 for script, https://github.com/GluuFederation/oxTrust/issues/885 | scim_event_handler/sample/SampleScript.py | scim_event_handler/sample/SampleScript.py | # oxTrust is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
# Copyright (c) 2014, Gluu
#
# Author: Jose Gonzalez
#
from org.gluu.model.custom.script.type.scim import ScimType
from org.gluu.util import StringHelper, ArrayHelper
from java.util import Arrays, ArrayList
from o... | Python | 0 | @@ -1062,21 +1062,76 @@
st*
-scripts being
+methods executed%0A #return 3 if you also want the get* methods
exe
|
0e26b31df0c80412d2980dc61b45468f5d577a43 | Fix artifact download to deal with changes on the Github side. (#4769) | scripts/helpers/github_fetch_artifacts.py | scripts/helpers/github_fetch_artifacts.py | #!/usr/bin/env python3
#
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | Python | 0.000006 | @@ -1968,16 +1968,24 @@
rl)%0A%0A
+ status,
headers
@@ -2017,24 +2017,16 @@
uestBlob
-AndCheck
('GET',
@@ -2042,67 +2042,21 @@
if
-'
status
-' not in headers or headers%5B'status'%5D
!=
-'
302
- Found'
:%0A
@@ -2131,14 +2131,42 @@
got
-%25r.' %25
+status %25d, headers %25r.' %25 (status,
hea
@@ ... |
67c98ba67f99d5de5022b32fdb3eb9cd0d96908f | Add missing line on the script and some comment | scripts/tappedout.py | scripts/tappedout.py | from binascii import unhexlify
def request(context, flow):
if (flow.request.host.find('change.me') > -1 and flow.request.path.find('somethingaboutcurrency') > -1):
def response(context, flow):
if (flow.request.host.find('change.me') > -1 and flow.request.path.find('somethingaboutcurrency') > -1):... | Python | 0 | @@ -25,16 +25,83 @@
exlify%0A%0A
+#This can be replace by using the %22decode%22 function on the reponse%0A
def requ
@@ -236,16 +236,63 @@
%0A
+flow.request.headers%5B'Accept-Encoding'%5D = %5B''%5D%0A
%0A%0Adef re
@@ -424,24 +424,24 @@
cy') %3E -1):%0A
-
flow
@@ -487,8 +487,87 @@
ff%5B..%5D')
+ %... |
9d0c506e6e4a9c84dd7b17904d389937ec733e88 | fix download bug | fate_flow/apps/data_access_app.py | fate_flow/apps/data_access_app.py | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 0 | @@ -3062,20 +3062,16 @@
data
-.get(
+%5B
%22head%22
-)
+%5D
%5D,%0A
@@ -3166,20 +3166,16 @@
data
-.get(
+%5B
%22file%22
-)
+%5D
%5D,%0A
@@ -3707,16 +3707,21 @@
limitor%22
+, %22,%22
)%5D,%0A
@@ -3759,21 +3759,17 @@
fig_data
-.get(
+%5B
%22output_
@@ -3773,17 +3773,17 @@
ut_path%22
-)
+%5D
%5D,%0A ... |
2b9a8ccc982c286a78c541a9748f0bba5da4caf1 | Move to using redirects for names | firefly/ui_server.py | firefly/ui_server.py | from __future__ import with_statement
import hashlib
import logging
import os.path
import sqlite3
import sys
import util
import tornado.httpserver
import tornado.ioloop
import tornado.web
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
log = logging.getLogger('firefly_ui_server')
def shorten(state, db_co... | Python | 0 | @@ -3388,51 +3388,8 @@
))%0A%0A
- # TODO: make the content-type json%0A
@@ -3421,33 +3421,39 @@
ent-Type%22, %22
-text/plai
+application/jso
n%22)%0A
@@ -3579,16 +3579,18 @@
state
+id
= conn.
@@ -3609,45 +3609,8 @@
ect
-state from states where id = (select
stat
@@ -3638,17 +3638,16 @@
... |
d2f810f0c5554362cca29c8a324ae35e370a2dd3 | Fix a bug in Mellanox plugin RPC caused by secgroup RPC refactoring | neutron/plugins/mlnx/rpc_callbacks.py | neutron/plugins/mlnx/rpc_callbacks.py | # Copyright 2013 Mellanox Technologies, 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 or agreed t... | Python | 0.000005 | @@ -738,16 +738,44 @@
db_api%0A
+from neutron import manager%0A
from neu
@@ -1401,34 +1401,89 @@
%7D)%0A p
-ort = self
+lugin = manager.NeutronManager.get_plugin()%0A port = plugin
.get_port_fr
@@ -3195,34 +3195,89 @@
%7D)%0A p
-ort = self
+lugin = manager.NeutronManager.get_plugin()%0A ... |
c32d393212ddad0a86c9ee1280e23caa76f1f874 | Add a heading before the subrenderer autodoc starts | feincms3/incubator/subrenderer.py | feincms3/incubator/subrenderer.py | """
Subrenderers
~~~~~~~~~~~~
Subrenderers allow rendering sections inside regions using different renderers.
The same plugin may be rendered differently in different contexts. Sometimes
just differentiating on the plugin itself or inserting additional elements as
described in :ref:`rendering-plugins-differently` is s... | Python | 0 | @@ -3590,16 +3590,56 @@
tents).%0A
+%0ACode documentation%0A------------------%0A%0A
%22%22%22%0A%0Afro
|
a785143a8a3d25544ba2418d37cddb472ae78ab0 | Update noxfile. | firestore/noxfile.py | firestore/noxfile.py | # -*- coding: utf-8 -*-
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Python | 0 | @@ -768,15 +768,12 @@
def
-blacken
+lint
(ses
@@ -794,51 +794,122 @@
Run
-black.%0A%0A Format code to uniform standard
+linters.%0A%0A Returns a failure if the linters find linting errors or sufficiently%0A serious code quality issues
.%0A
@@ -935,22 +935,45 @@
nstall(%22
-black%22
+flake8%22, %22blac... |
fa517434095253f2a78e2a12377ce15462414f4e | enable to select python | lib/data_config.py | lib/data_config.py | from lib.train_config import TrainParamServer
from PyQt5 import QtWidgets
class DataDialog(QtWidgets.QDialog):
def __init__(self, *args, settings=None):
self.settings = settings
train_edit = DataFileEdit(settings, self, 'TrainData')
self.test_edit = DataFileEdit(settings, self, 'TestData... | Python | 0 | @@ -195,16 +195,21 @@
+self.
train_ed
@@ -758,16 +758,21 @@
Data',
+self.
train_ed
@@ -805,16 +805,21 @@
('',
+self.
train_ed
@@ -3379,16 +3379,319 @@
lf, _):%0A
+ if self.train_edit.python_selected():%0A self.same_data_check.setDisabled(True)%0A self.ratio_edit.setDis... |
6aae8dacee80dce6f84b342d6036e9abd2ea818e | Print log message. | nipype/interfaces/traits_extension.py | nipype/interfaces/traits_extension.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""This module contains Trait classes that we've pulled from the
traits source and fixed due to various bugs. File and Directory are
redefined as the release version had dependencies on TraitsUI, which
we ... | Python | 0.000001 | @@ -1127,16 +1127,81 @@
efined%0A%0A
+from ... import logging%0Alogger = logging.getLogger('interface')%0A%0A
class Ba
@@ -2817,32 +2817,130 @@
alidated_value%0A%0A
+ logger.error(%22Mandatory output file was not found: %25s%22 %25 os.path.abspath(value))%0A %0A
self.err
|
cec7703f1cd1d59315cf8efa9cc43aeeeb6f9027 | Update keyPad.py | keyPad.py | keyPad.py | # Servo Control
import time
import wiringpi
import RPi.GPIO
import random
import time
import requests
import numpy
from twilio.rest import TwilioRestClient
from matrix_keypad import RPi_GPIO
def readcode():
#Reads in numbers until the pound is pressed. Star resets
attempt = ''
i = 0
ex... | Python | 0 | @@ -2563,220 +2563,8 @@
%22)%0D%0A
- checkKeypad = kp.getKey()%0D%0A while (checkKeypad) != '*':%0D%0A checkKeypad = kp.getKey()%0D%0A #print(checkKeypad)%0D%0A if checkKeypad == '*': #If its the start key%0D%0A print(%22Star Pressed%22)%0D%0A
@@ -3298,24 +3298,25 @@
e)%0D%0A ... |
26e0d7858627c92d9fa7751c0d9e930c76510a8a | Make it easier to manipulate trs | flask_table/table.py | flask_table/table.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import OrderedDict
from flask import Markup
from .columns import Col
from .compat import with_metaclass
class TableMeta(type):
"""The metaclass for the Table class. We use the metaclass to sort of
the columns defined in the tab... | Python | 0.000035 | @@ -2527,16 +2527,23 @@
def tr
+_format
(self, i
@@ -2560,28 +2560,257 @@
-return '%3Ctr%3E%7B%7D%3C/tr%3E'
+%22%22%22Returns the string that is formatted with the contents of the%0A tr. Override this if you want to alter the attributes of the%0A tr.%0A%0A %22%22%22%0A%0A return '%... |
e7dd7b470f8d268aa889acba0191c7497bcd0e0b | Fix circular import | jasmin_notifications/models.py | jasmin_notifications/models.py | """
Django ORM models for the JASMIN notifications app.
"""
__author__ = "Matt Pryor"
__copyright__ = "Copyright 2015 UK Science and Technology Facilities Council"
import enum, uuid
from django.conf import settings
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.te... | Python | 0.000005 | @@ -794,84 +794,8 @@
ey%0A%0A
-from .helpers import notify, notify_if_not_exists, notify_pending_deadline%0A%0A
%0A@en
@@ -5887,32 +5887,68 @@
e).%0A %22%22%22%0A
+ from .helpers import notify%0A
notify(n
@@ -6298,32 +6298,82 @@
ls.%0A %22%22%22%0A
+ from .helpers import notify_... |
8bf580cc52d159cea4528e40b4052dd0fc4571be | Converting compounds to a set | PyFBA/fba/external_reactions.py | PyFBA/fba/external_reactions.py | import copy
import PyFBA
def uptake_and_secretion_reactions(model_compounds, compounds):
"""
Figure out which compounds can be taken up from the media and/or secreted into the media. We provide an endless
reaction for these which allows them to be taken up and/or secreted without affecting the rest of th... | Python | 0.99967 | @@ -62,27 +62,16 @@
s(model_
-compounds,
compound
@@ -70,24 +70,24 @@
compounds):%0A
+
%22%22%22%0A
@@ -425,175 +425,110 @@
the
-identifiers of all the compounds we have identified so far%0A :type model_compounds: set%0A :param compounds: the dict of all the compounds%0A :type compounds: dict
+c... |
452f03d4ac5f75d57bb0ee880fa67e3c44acb153 | Add newline to EOF. | flop/model_tester.py | flop/model_tester.py | import model as m
import numpy as np
import sys
ACTION_TO_IND_MAP = {
'check': 1,
'call': 1,
'bet': 2,
'raise': 2,
'fold': 0
}
RANK_MAP = {
'2':0,
'3':1,
'4':2,
'5':3,
'6':4,
'7':5,
'8':6,
'9':7,
'10':8,
't':8,
'j':9,
'q':10,
'k':11,
'a':12
}... | Python | 0 | @@ -3699,24 +3699,25 @@
%5B1%5D)%0A interact(model)
+%0A
|
4e6b759219c2d15902196d1747a7eb89cebad150 | test commit | chat/models.py | chat/models.py | from django.db import models
class Chatroom(models.Model):
name = models.CharField(max_length=32)
occupants = models.IntegerField(default=0)
def __unicode__(self):
return self.name
class Message(models.Model):
chatroom = models.ForeignKey(Chatroom)
username = models.CharField(max_length... | Python | 0.000001 | @@ -471,8 +471,9 @@
lf.text%0A
+%0A
|
1851a8965e481084c8a8f869c58147c01ed670c6 | add network_name attribute | sfa/rspecs/elements/versions/sfav1Node.py | sfa/rspecs/elements/versions/sfav1Node.py | from sfa.util.sfalogging import logger
from sfa.util.xml import XpathFilter
from sfa.util.plxrn import PlXrn, xrn_to_hostname
from sfa.util.xrn import Xrn
from sfa.rspecs.elements.element import Element
from sfa.rspecs.elements.node import Node
from sfa.rspecs.elements.sliver import Sliver
from sfa.rspecs.elements.loca... | Python | 0.000001 | @@ -5983,32 +5983,33 @@
re=Node.fields)%0A
+%0A
node
@@ -6000,24 +6000,220 @@
+parent = node_elem.getparent()%0A if (parent != None) and (parent.tag==%22network%22) and (%22name%22 in parent.attrib):%0A node%5B'network_name'%5D = parent.attrib%5B'name'%5D%0A%0A ... |
151a5f75a240c875fc591390c208c933e8d0e782 | Update name of Eidos reading class | indra/sources/eidos/eidos_reader.py | indra/sources/eidos/eidos_reader.py | import json
from indra.java_vm import autoclass, JavaException
class EidosReader(object):
"""Reader object keeping an instance of the Eidos reader as a singleton.
This allows the Eidos reader to need initialization when the first piece of
text is read, the subsequent readings are done with the same
in... | Python | 0 | @@ -1013,28 +1013,29 @@
g.clulab.wm.
-Agro
+Eidos
System')%0A
|
977557675167a5e2c22fd3d94cd4c93acbb4b326 | Update ipc_lista1.8.py | lista1/ipc_lista1.8.py | lista1/ipc_lista1.8.py | #ipc_lista1.8
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que pergunte quanto você ganha por hora e o número de horas trabalhadas no mês.
#Calcule e mostre o total do seu salário no referido mês.
QntHora = input("Entre com o valor de seu rendimento por hora: ")
hT = input("E... | Python | 0 | @@ -393,10 +393,12 @@
tHora*hT
+,2
%0A%0A
|
b549a3b263daeadc2b43d8ecff773b3340685b5d | Test drum-dev | indra/sources/trips/trips_client.py | indra/sources/trips/trips_client.py | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import re
import sys
import getopt
import xml.dom.minidom
import logging
import requests
logger = logging.getLogger('trips')
trips_url = 'http://trips.ihmc.us/parser/cgi/drum'
def send_query(text, query_args=None... | Python | 0 | @@ -273,16 +273,20 @@
cgi/drum
+-dev
'%0A%0A%0Adef
|
ddeb77497c1af2f59fa0b1b4528155989082e8e6 | add support for octal access mode | litespi/phy/generic.py | litespi/phy/generic.py | from migen import *
from migen.genlib.fsm import FSM, NextState
from litespi.clkgen import LiteSPIClkGen
from litespi.common import *
from litex.soc.interconnect import stream
# Output enable masks for the tri-state buffers, data mode mask is not included as oe pins default to 0
cmd_oe_mask = 0b0001
soft_oe_mask = 0... | Python | 0 | @@ -288,23 +288,28 @@
oe_mask
+
= 0b000
+0000
1%0Asoft_o
@@ -322,16 +322,20 @@
= 0b000
+0000
1%0Aaddr_o
@@ -357,16 +357,20 @@
1: 0b000
+0000
1,%0A 2
@@ -375,16 +375,20 @@
2: 0b00
+0000
11,%0A
@@ -392,16 +392,39 @@
4: 0b
+00001111,%0A 8: 0b1111
1111,%0A%7D%0A
@@ -837,16 +837,22 @@
ual/quad
+... |
ad76d59c48443697107854812073ea8521d21cbf | Update __init__.py | forceDAQ/__init__.py | forceDAQ/__init__.py | __version__ = "0.8.11b"
__author__ = "Oliver Lindemann"
"""
launch the GUI force from your Python program:
``
from forceDAQ import gui
gui.run_with_options(remote_control=False,
ask_filename=True,
calibration_file="FT_sensor1.cal")
``
import relevant stuff to program your own fo... | Python | 0.000072 | @@ -14,17 +14,17 @@
%220.8.11
-b
+c
%22%0A__auth
|
3db6d8352a993f64380c21c2b29d30ae7f79e4cc | Fix isolated test runner | llvm/tests/__init__.py | llvm/tests/__init__.py | from __future__ import print_function
import sys
import os
import unittest
import subprocess
import llvm
tests = [] # stores unittest.TestCase objects
# Isolated tests
# Tests that affect process-wide settings
isolated_tests = [] # stores modue name
def run(verbosity=1):
print('llvmpy is installed in: ' + os.... | Python | 0.000003 | @@ -1457,16 +1457,20 @@
+
cmd = %5Bs
@@ -1496,16 +1496,20 @@
, test%5D%0A
+
@@ -1587,16 +1587,20 @@
+
+
stderr=s
@@ -1621,24 +1621,28 @@
UT)%0A
+
for line in
@@ -1651,16 +1651,20 @@
stdout:%0A
+
@@ -1710,16 +1710,20 @@
+
p.wait()
... |
1b5d54839daa5d0cb1efcf4d6c376655b81ddad6 | Add missing imports in the multi_gpu_model() example. (#8180) | keras/utils/training_utils.py | keras/utils/training_utils.py | from ..layers.merge import concatenate
from .. import backend as K
from ..layers.core import Lambda
from ..engine.training import Model
def _get_available_devices():
from tensorflow.python.client import device_lib
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_p... | Python | 0.000014 | @@ -1663,16 +1663,91 @@
Xception
+%0A from keras.utils import multi_gpu_model%0A import numpy as np
%0A%0A
|
aae63bca5f5a9a70be40078de38a074f95c53f64 | fix duplicate text execution | local/commands/test.py | local/commands/test.py | import logging
import tempfile
from google.appengine.tools import dev_appserver
from google.appengine.tools import dev_appserver_main
from nose.core import main
from nosegae import NoseGAE
from nose_exclude import NoseExclude
from nose.plugins.logcapture import LogCapture
import re
import os
os.environ['NOSE_WITH_N... | Python | 0.9998 | @@ -2011,16 +2011,36 @@
.argv%5B2%5D
+%0A del sys.argv%5B2%5D
%0A%0Amain(p
|
a667d80a7b8106dd7f233fd79fd9937342ba5a1e | add managers for Category and Tag. Simplify next() and prev() by moving published() to Manager. | blog/models.py | blog/models.py | from django.db import models
from django.utils import timezone
from django.utils.text import slugify
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from .markup import markup
from blog import views as blog
class Category(models.Model):
name = models.CharField(max_lengt... | Python | 0 | @@ -213,17 +213,16 @@
markup%0A
-%0A
from blo
@@ -245,16 +245,139 @@
s blog%0A%0A
+%0A%0Aclass CategoryQuerySet(models.QuerySet):%0A def search(self, term):%0A return self.filter(name__icontains=term)%0A%0A%0A%0A
class Ca
@@ -495,24 +495,71 @@
ble=False)%0A%0A
+ objects = CategoryQuerySet().as_manage... |
4f02c0b814e257ff14aa5c2bc2192ac541b1f054 | Simplify custom Post Manager. | blog/models.py | blog/models.py | from datetime import date
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from organizer.models import Startup, Tag
# Model Field Reference
# https://docs.djangoproject.com/en/1.8/ref/models/fields/
class PostQueryset(models.QuerySet):
def published(... | Python | 0 | @@ -434,28 +434,25 @@
def
-get_queryset
+published
(self):%0A
@@ -470,133 +470,103 @@
urn
-PostQueryset(%0A self.model, using=self._db)%0A%0A def published(self):%0A return self.get_queryset().published(
+self.get_queryset().published()%0A%0A%0AConnectedPostManager = PostManager.from_query... |
2d34a073932cc61a469e0c9e86be44465e3fa67f | fix auth.urls | locksmith/auth/urls.py | locksmith/auth/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns('locksmith.auth.views',
url(r'^create_key/$', self.create_key_view, name='create_key'),
url(r'^update_key/$', self.update_key_view, name='update_key'),
url(r'^update_key_by_email/$', self.update_key_view, {'get_by':'email'},
name='updat... | Python | 0.000006 | @@ -107,21 +107,17 @@
key/$',
-self.
+'
create_k
@@ -114,29 +114,25 @@
'create_key
-_view
+'
, name='crea
@@ -163,29 +163,25 @@
ate_key/$',
-self.
+'
update_key_v
@@ -178,21 +178,17 @@
date_key
-_view
+'
, name='
@@ -240,13 +240,9 @@
$',
-self.
+'
upda
@@ -251,13 +251,9 @@
_key
-_view
+'
, %7B'
|
401d180c3255099e9164f082e53ae9a006532898 | Move function doc into func itself | app/event/api.py | app/event/api.py | from django.http import JsonResponse
from event.models import Event
#リクエストのあったイベントを新規イベントは作成日時順、他は開始日時順の若い方から10件をjsonで返す。
def event_filter(request, event_kind, *args, **kwargs):
if request.method == 'POST':
def new_events():
return Event.objects.all().order_by('-created')[:10]
if reques... | Python | 0 | @@ -66,61 +66,8 @@
nt%0A%0A
-#%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%AE%E3%81%82%E3%81%A3%E3%81%9F%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%82%92%E6%96%B0%E8%A6%8F%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%81%AF%E4%BD%9C%E6%88%90%E6%97%A5%E6%99%82%E9%A0%86%E3%80%81%E4%BB%96%E3%81%AF%E9%96%8B%E5%A7%8B%E6%97%A5%... |
8179c573ff3a55e9a8df878c1286d5a99acab9cd | test perm using py.test - tidy #1150 | login/tests/fixture.py | login/tests/fixture.py | # -*- encoding: utf-8 -*-
import pytest
from login.tests.factories import (
TEST_PASSWORD,
UserFactory,
)
class PermTest:
def __init__(self, client):
setup_users()
self.client = client
def anon(self, url):
self.client.logout()
response = self.client.get(url)
... | Python | 0 | @@ -297,32 +297,91 @@
client.get(url)%0A
+ message = %22'url should be public '%7B%7D'%22.format(url)%0A
assert 2
@@ -406,16 +406,25 @@
tus_code
+, message
%0A%0A de
|
f5b296a1908d46942670d964411c145e11232c28 | Fix can_order_book condition | bulb/utils.py | bulb/utils.py | # -*- coding: utf-8 -*-
import datetime
from django.utils import timezone
from django.db import IntegrityError
from clubs.models import Club
from core.models import Tweet
import accounts.utils
import clubs.utils
def create_tweet(user, action, arguments, media_path=""):
if not user.social_auth.exists():
... | Python | 0.000214 | @@ -3606,17 +3606,17 @@
e_until
-%3E
+%3C
timezon
|
831c802d855ffb78790b8796586ae8d4eaeb36b0 | fix sorting and whitespace | daffodil/pretty_print.py | daffodil/pretty_print.py | import operator as op
import re
from UserList import UserList
def to_daffodil_str(s):
# escape quotes
s = s.replace(u'"', u'\\"')
# wrap string in quotes
return u'"{0}"'.format(s)
class DaffodilWrapper(UserList):
grouping = "all"
dense = True
@property
def opener(self):
... | Python | 0.000024 | @@ -196,16 +196,149 @@
ormat(s)
+%0A %0Adef indent(s, amount=u%22 %22):%0A s = unicode(s)%0A return u%22%5Cn%22.join(u%22%7B0%7D%7B1%7D%22.format(amount, line) for line in s.split(u%22%5Cn%22))
%0A%0Aclass
@@ -758,18 +758,266 @@
-return obj
+if not isinstance(obj, DaffodilWrapper):%0A r... |
09ed0e911e530e9b907ac92f2892248b6af245fa | Add cassette and failed request as properties of thrown CannotOverwriteCassetteException | vcr/errors.py | vcr/errors.py | class CannotOverwriteExistingCassetteException(Exception):
def __init__(self, *args, **kwargs):
message = self._get_message(kwargs["cassette"], kwargs["failed_request"])
super(CannotOverwriteExistingCassetteException, self).__init__(message)
def _get_message(self, cassette, failed_request):
... | Python | 0 | @@ -93,16 +93,114 @@
wargs):%0A
+ self.cassette = kwargs%5B%22cassette%22%5D%0A self.failed_request = kwargs%5B%22failed_request%22%5D%0A
|
b6e9222f6a5ca57a309c9c6f7e2859d97b54f7ad | fix creation of lock_filenames | mapproxy/cache/base.py | mapproxy/cache/base.py | # This file is part of the MapProxy project.
# Copyright (C) 2011 Omniscale <http://omniscale.de>
#
# 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... | Python | 0.000004 | @@ -2798,16 +2798,32 @@
ache_dir
+.encode('utf-8')
).hexdig
|
fa01d53efb573f8d3fcc38e8cc477e3cc7d3cee1 | Add the manifest file to our zip archive on windows. | dartium_tools/archive.py | dartium_tools/archive.py | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import glob
import optparse
import os
import shutil
import subprocess
import sys
import utils
HOST_OS = utils.guessOS()
if HOST_OS =... | Python | 0.000003 | @@ -4948,39 +4948,174 @@
, mode)%0A
-extra_files = %5B
+# issue(16760) - we _need_ to fix our parsing of the FILES.cfg%0A extra_files = %5Bfile for file in os.listdir(releaseDir) if file.endswith('manifest')
%5D%0A else:%0A
|
8895e6e8217e24696ca5aa6502d54a88af37d7ea | add some comments | solvebio/contrib/vcf_parser/vcf_parser.py | solvebio/contrib/vcf_parser/vcf_parser.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from vcf.parser import VCFReader
class ExpandingVCFParser(object):
"""
Expands multiple alleles in a VCF record to one row per allele.
Please note that this parser DOES NOT include the reference allele
... | Python | 0 | @@ -1738,16 +1738,194 @@
_snpeff%0A
+ # The infos%5B'ANN'%5D description looks like:%0A # Functional annotations: 'A %7C B %7C C'%0A # where A, B, and C are ANN keys.%0A
@@ -2640,16 +2640,151 @@
parsed%0A
+ # Split on '%7C', merge with ... |
18f24306c5201d3bf5241ad0a684e3e4016bf10f | Improve the design: machinist style FSM, another failure edge case. | flocker/snapshots.py | flocker/snapshots.py | """
Snapshotting of a filesystem.
"""
from zope.interface import Interface
class IFilesystemSnapshots(Interface):
"""
Support creating and listing snapshots of a specific filesystem.
"""
def create(name):
"""
Create a snapshot of the filesystem.
@param name: The name of the s... | Python | 0 | @@ -461,16 +461,92 @@
failed.
+ The L%7BDeferred%7D should support cancellation%0A if at all possible.
%0A
@@ -1173,16 +1173,141 @@
ated on.
+%0A 4. Snapshots are expected to run very quickly, so if a snapshot take%0A more than 10 seconds it should be cancelled.
%0A%0A Th
@@ -1364,16 ... |
b060daef3430222569900ba7a81caa5dd3d0c154 | update dynamic elements | sdklib/http/har.py | sdklib/http/har.py | import json
from sdklib.compat import str
from sdklib import http
from sdklib.http import HttpRequestContext
from sdklib.http.renderers import get_renderer
from sdklib.util.urls import urlsplit
class Cookie(object):
def __init__(self, j):
self._dict =json.loads(j) if isinstance(j, str) else j
@prope... | Python | 0 | @@ -101,16 +101,30 @@
tContext
+, HttpResponse
%0Afrom sd
@@ -2433,24 +2433,204 @@
)%0A%0A%0A
+class Response(object):%0A%0A def __init__(self, j):%0A self._dict =json.loads(j) if isinstance(j, str) else j%0A%0A def as_http_response(self):%0A return HttpResponse()%0A%0A%0A
class Entry(
@... |
8a6f5b7b31562a076ce7f5ebda71c70632266e14 | Use mpldatacursor for more interactive plot | notebooks/Command_Line_Tools/skewt.py | notebooks/Command_Line_Tools/skewt.py | # skewt.py - A simple Skew-T plotting tool
import argparse
from datetime import datetime
import matplotlib.pyplot as plt
import metpy.calc as mpcalc
from metpy.io.upperair import get_upper_air_data
from metpy.plots import Hodograph, SkewT
from metpy.units import units
from mpl_toolkits.axes_grid1.inset_locator import... | Python | 0 | @@ -325,16 +325,53 @@
et_axes%0A
+from mpldatacursor import datacursor%0A
import n
@@ -3664,16 +3664,110 @@
else:%0A
+ datacursor(formatter=u'%7By:.02f%7D hPa %5Cn%7Bx:.02f%7D%5Cu00B0C'.format, bbox=dict(fc='white'))%0A
|
d8a0c5adc2b3554e085c7199a1ad1011fe237f9b | bump version to v0.5.6 | flowpipe/__init__.py | flowpipe/__init__.py | """Flow-based programming with python."""
__version__ = '0.5.5'
import logging
PACKAGE = 'flowpipe'
# create logger
logger = logging.getLogger(PACKAGE)
logger.propagate = False
# create console handler and set level to debug
handler = logging.StreamHandler()
# create formatter
formatter = logging.Formatter('%(nam... | Python | 0 | @@ -55,17 +55,17 @@
= '0.5.
-5
+6
'%0A%0Aimpor
|
1fe3ab2fdd15043e84c3f6d2ec50e007b658c60c | Fix mailchimp authentication. | km_api/mailing_list/mailchimp_utils.py | km_api/mailing_list/mailchimp_utils.py | """Utilities for interacting with MailChimp.
"""
import logging
from django.conf import settings
import mailchimp3
from requests.exceptions import HTTPError
from mailing_list import models
logger = logging.getLogger(__name__)
def get_member_info(user):
"""
Generate info for a MailChimp list member.
... | Python | 0.000001 | @@ -1806,18 +1806,8 @@
imp(
-'km-api',
sett
@@ -1828,16 +1828,26 @@
_API_KEY
+, 'km-api'
)%0A%0A%0Adef
|
0bcf649cadfbb80c1cea81d6497ddf8fb8c7b814 | Fix oslo namespace in default log level | ironic/common/service.py | ironic/common/service.py | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 eNovance <licensing@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | Python | 0.000001 | @@ -4348,24 +4348,27 @@
=%5B'amqp=WARN
+ING
',%0A
@@ -4408,24 +4408,27 @@
amqplib=WARN
+ING
',%0A
@@ -4528,17 +4528,17 @@
'oslo
-.
+_
messagin
@@ -4599,24 +4599,27 @@
alchemy=WARN
+ING
',%0A
@@ -4795,24 +4795,27 @@
.server=WARN
+ING
',%0A
@@ -4855,24 +4855,27 @@
iso8601... |
01b2307235512db3f8395797cd7c5ac8f464d23c | Update extralife crawler | comics/comics/extralife.py | comics/comics/extralife.py | from comics.aggregator.crawler import CrawlerBase, CrawlerResult
from comics.meta.base import MetaBase
class Meta(MetaBase):
name = 'ExtraLife'
language = 'en'
url = 'http://www.myextralife.com/'
start_date = '2001-06-17'
rights = 'Scott Johnson'
class Crawler(CrawlerBase):
history_capable_dat... | Python | 0 | @@ -453,13 +453,13 @@
com/
-strip
+comic
s/%25s
@@ -504,15 +504,15 @@
e('%25
+Y-%25
m-%25d
--%25Y
'),)
|
48f9f8b299d665b8fa96231b58c5be0809988b4e | add doc | app/api/__init__.py | app/api/__init__.py | from .article import controller as article_api
from .list import controller as list_api
from .user import controller as user_api
from .group import controller as group_api
from .comment import controller as comment_api
from .article import model as article_model
from .list import model as list_model
from .user import m... | Python | 0 | @@ -1434,16 +1434,185 @@
valid%22%0A %7D%0A%22%22%22
+%0A%0A%22%22%22%0A@apiDefine UserNotInGroup%0AapiError UserNotInGroup The user is not in any group%0A@apiErrorExample Error 204%0A %7B%0A %22msg%22: %22User is not in any group%22%0A %7D%0A%22%22%22
|
f0bd1ac1499f069e11fc773d33c82018670f91af | Fix RestFormMixin errors bug | is_core/form/__init__.py | is_core/form/__init__.py | from django import forms
from django.core.exceptions import ValidationError
class AllFieldsUniqueValidationModelForm(forms.ModelForm):
def validate_unique(self):
try:
self.instance.validate_unique()
except ValidationError as e:
self._update_errors(e)
class RestFormMixin(... | Python | 0 | @@ -648,17 +648,23 @@
rrors =
-%7B
+errors%5B
'non-fie
@@ -673,17 +673,19 @@
-errors'
-:
+%5D =
non_fie
@@ -693,17 +693,16 @@
d_errors
-%7D
%0A%0A
|
61e00b2d0d5a580160707b57cfd73fd6af4bd538 | Check if both status were monitored | isserviceup/celeryapp.py | isserviceup/celeryapp.py | import logging
import time
import raven
from celery import Celery
from celery.utils.log import get_task_logger
from raven.conf import setup_logging
from raven.contrib.celery import register_signal, register_logger_signal
from raven.handlers.logging import SentryHandler
from isserviceup import managers
from isserviceu... | Python | 0.000002 | @@ -2918,12 +2918,25 @@
us__
-in=%5B
+all=%5Bold_status,
new_
@@ -3190,12 +3190,8 @@
%0A
- s =
Sla
@@ -3205,22 +3205,16 @@
ook_url)
-%0A s
.notify(
|
977fbe3a6359873a57afc93a9918463366ed6191 | Update drive_rover.py | code/drive_rover.py | code/drive_rover.py | # Do the necessary imports
import argparse
import shutil
import base64
from datetime import datetime
import os
import cv2
import numpy as np
import socketio
import eventlet
import eventlet.wsgi
from PIL import Image
from flask import Flask
from io import BytesIO, StringIO
import json
import pickle
import matplotlib.ima... | Python | 0.000001 | @@ -461,13 +461,18 @@
%0A%0A#
-Start
+Initialize
soc
@@ -483,16 +483,41 @@
o server
+ and Flask application %0A#
(learn
@@ -6656,14 +6656,14 @@
ith
-engine
+socket
io's
|
4f1765c070378aac1fee8e6656b6864d9f6d6d66 | Add begin_read_only | jacquard/storage/base.py | jacquard/storage/base.py | """Base class for storage engine implementations."""
import abc
import contextlib
from .utils import TransactionMap
class StorageEngine(metaclass=abc.ABCMeta):
"""
Base storage engine class.
StorageEngine subclasses are not under any obligation to be thread-safe.
"""
@abc.abstractmethod
de... | Python | 0.000001 | @@ -685,29 +685,8 @@
ion.
- Used even for reads.
%22%22%22%0A
@@ -710,32 +710,229 @@
ImplementedError
+%0A%0A def begin_read_only(self):%0A %22%22%22%0A Enter a new, read-only transaction.%0A%0A May be overloaded for efficiency - by default, just calls begin().%0A %22%22%22%0A s... |
a44b2aa2072b30505bdbf72017742ef8f8c9f03c | fix for web browsers | kaldigstserver/master_server.py | kaldigstserver/master_server.py | #!/usr/bin/env python
#
# Copyright 2013 Tanel Alumae
"""
Reads speech data via websocket requests, sends it to Redis, waits for results from Redis and
forwards to client via websocket
"""
import logging
import json
import codecs
import os.path
import uuid
import tornado.escape
import tornado.ioloop
import tornado.op... | Python | 0.000002 | @@ -2704,24 +2704,427 @@
pecified%22)%0A%0A
+ def options(self, *args, **kwargs):%0A self.set_header('Access-Control-Allow-Origin', '*')%0A self.set_header('Access-Control-Allow-Methods', 'POST, OPTIONS')%0A self.set_header('Access-Control-Max-Age', 1000)%0A # note that '*' is not valid ... |
8c15a5794ef89c34f1ae1f1eb20ea335a0592f7f | Remove accidentally added line | openedx/core/djangoapps/content/block_structure/tasks.py | openedx/core/djangoapps/content/block_structure/tasks.py | """
Asynchronous tasks related to the Course Blocks sub-application.
"""
import logging
from capa.responsetypes import LoncapaProblemError
from celery.task import task
from django.conf import settings
from lxml.etree import XMLSyntaxError
from edxval.api import ValInternalError
from opaque_keys.edx.keys import Course... | Python | 0 | @@ -1131,61 +1131,8 @@
ue,%0A
- routing_key=settings.DEFAULT_PRIORITY_QUEUE,%0A
|
8fdb17d647a356838ba3f89d540ebda04b734443 | use more aggressive dropout for seq2seq | anna/model/premade.py | anna/model/premade.py | from anna.model.trainer import Trainer
from anna.model.encode import *
from anna.model.decode import *
class AVGxBR(Trainer):
def __init__(self, data_dir, labels, *args, **kwargs):
super().__init__(data_dir,
labels,
EncoderAvg(data_dir, input_limit=300),
... | Python | 0 | @@ -3462,32 +3462,121 @@
rBiRNN(data_dir,
+%0A dropout=0.5,%0A
input_limit=300
@@ -3624,32 +3624,81 @@
ta_dir, labels,%0A
+ dropout=0.5,%0A
|
e6abb0a1326cc15209076883029b61e5d4fd03c3 | Add date format to queue_util | inpassing/worker/queue_util.py | inpassing/worker/queue_util.py | # Copyright (c) 2016 Luke San Antonio Bialecki
# All rights reserved.
CONSUMER_QUEUE_FMT = '{}:{}:consumer'
def consumer_queue(org_id, date):
return CONSUMER_QUEUE_FMT.format(org_id, str(date))
PRODUCER_QUEUE_FMT = '{}:{}:producer'
def producer_queue(org_id, date):
return PRODUCER_QUEUE_FMT.format(org_id, str... | Python | 0.000018 | @@ -64,16 +64,39 @@
erved.%0A%0A
+DATE_FMT = '%25Y-%25m-%25d'%0A%0A
CONSUMER
|
cae15cbf6eba931eb40585ad9e5ac6dfaa633659 | Add terrible docs | chef/search.py | chef/search.py | import collections
import copy
import urllib
from chef.api import ChefAPI
from chef.base import ChefQuery, ChefObject
class SearchRow(dict):
"""A single row in a search result."""
def __init__(self, row, api):
super(SearchRow, self).__init__(row)
self.api = api
self._object = None
... | Python | 0.999926 | @@ -872,16 +872,377 @@
f index.
+%0A %0A The only required argument is the index name to search (eg. node, role, etc).%0A The second, optional argument can be any Solr search query, with the same semantics%0A as Chef.%0A %0A Example::%0A %0A for row in Search('node', 'roles:app'):%0A ... |
0dfb00466b8a5ad38520b9346d35cec032d1d969 | Update buy.py | jarviscli/plugins/buy.py | jarviscli/plugins/buy.py | from plugin import plugin
import os
import subprocess
import sys
import webbrowser
@plugin("buy")
def buy(jarvis, s):
"""
Searches the string you provide on amazon or ebay.
Generates Url and opens browser.
Uses: a) "buy <shop> <search term>" (One line command)
b) "buy", Asks for shop,"<shop>... | Python | 0 | @@ -1201,41 +1201,8 @@
RL)%0A
- #openBrowser(jarvis, endURL)%0A
%0A%0A#
@@ -2312,14 +2312,12 @@
turn endURL%0A
-%0A%0A
|
4e0c4fe3301aec4fbe875c6f251d8da32c6fe21a | update cart quantity | app/merchant/views.py | app/merchant/views.py | from flask import render_template, abort, request, redirect, url_for
from . import merchant
from ..decorators import merchant_required
from flask.ext.login import login_required, current_user
from ..models import Listing, CartItem
from .. import db
# from forms import SearchForm
@merchant.route('/')
@login_required
@... | Python | 0 | @@ -1884,25 +1884,179 @@
-pass # save
+for item in current_user.cart_items:%0A item.quantity = request.form%5Bitem.listing_id%5D%0A db.session.commit()%0A return redirect(url_for('.manage_
cart
+'))
%0A
|
8f33211f2516307e4ece76dd93a75b88e36c4393 | Fix typo in import, was using path | runtime/tools/create_snapshot_file.py | runtime/tools/create_snapshot_file.py | #!/usr/bin/env python
#
# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# Script to convert snapshot files to a C++ file which can be compiled and
# linke... | Python | 0.999998 | @@ -425,76 +425,8 @@
ort
-google3.third_party.dart_lang.v2_1_1_dev_0_1.runtime.tools.utils as
util
|
392f209791eede86d65f018a9b873b33cb7ccb02 | Fix issue with GO term (unsorted). | test/test_uniprot_retrieval_data.py | test/test_uniprot_retrieval_data.py | import numpy as np
import pandas as pa
import unittest
import pathway_extraction.uniprot_retrieval_data as uniprot_retrieval_data
test_data_directory_uniprot = 'test_data/' + 'test_uniprot_retrieval/'
class uniprot_retrieval_data_test(unittest.TestCase):
def test_extract_information_from_uniprot(self):
... | Python | 0 | @@ -753,32 +753,39 @@
%5B'GOs'%5D.tolist()
+.sort()
, df_result_trut
@@ -801,16 +801,23 @@
tolist()
+.sort()
)%0A
|
e17fe26503e9a72b43c1b9b662dd4319ccff1fd7 | Use an immutable tagged version of the Docker CLI container | server/__init__.py | server/__init__.py | import os
from girder.utility.webroot import Webroot
from .rest_slicer_cli import genRESTEndPointsForSlicerCLIsInDocker
_template = os.path.join(
os.path.dirname(__file__),
'webroot.mako'
)
def load(info):
girderRoot = info['serverRoot']
histomicsRoot = Webroot(_template)
histomicsRoot.updateHt... | Python | 0 | @@ -586,16 +586,23 @@
tomicstk
+:v0.1.0
'%0A )%0A
|
cc0c460c734e7984b852fbe4c3d8c989ae8dbfae | Update main.py | cea/technologies/network_layout/main.py | cea/technologies/network_layout/main.py | import os
import cea.config
import cea.inputlocator
from cea.technologies.network_layout.connectivity_potential import calc_connectivity_network
from cea.technologies.network_layout.steiner_spanning_tree import calc_steiner_spanning_tree
from cea.technologies.network_layout.substations_location import calc_substation_... | Python | 0.000001 | @@ -1354,69 +1354,67 @@
-disconnected_buildings = network_layout.disconnected_building
+allow_looped_networks = network_layout.allow_looped_network
s%0A%0A
@@ -2883,24 +2883,237 @@
e_network)%0A%0A
+ if connected_buildings != %5B%5D: #if not blank.%0A disconnected_building_names = %5Bx for x in conne... |
9bba07c29f8cf5ecfa1f20d1fa16a16866bb3f6c | update Pendle import script for parl.2017-06-08 (closes #948) | polling_stations/apps/data_collection/management/commands/import_pendle.py | polling_stations/apps/data_collection/management/commands/import_pendle.py | from data_collection.management.commands import BaseXpressWebLookupCsvImporter
class Command(BaseXpressWebLookupCsvImporter):
council_id = 'E07000122'
addresses_name = 'PendlePropertyPostCodePollingStationWebLookup-2017-03-01.TSV'
stations_name = 'PendlePropertyPostCodePollingStationWebLookup-2017-03-01.TS... | Python | 0 | @@ -47,33 +47,37 @@
t BaseXpress
-WebLookup
+DemocracyClub
CsvImporter%0A
@@ -101,25 +101,29 @@
seXpress
-WebLookup
+DemocracyClub
CsvImpor
@@ -183,218 +183,176 @@
= '
-PendlePropertyPostCodePollingStationWebLookup-2017-03-01.TSV'%0A stations_name = 'PendlePropertyPostCodePollingStationWebLookup-2017-03-01.TSV... |
9e2c595901223561a6d9370f6e6b11c37767a579 | add context manager | migration/migration.py | migration/migration.py | from aiographite.aiographite import connect
from aiographite.protocol import PlaintextProtocol
import asyncio
import whisper
import os
def default_schema_func(key):
return key
def debug_print(s, debug):
if debug:
print(s)
class Migration:
def __init__(self, directory, host, port,
... | Python | 0.000099 | @@ -5272,8 +5272,194 @@
%5D, path%0A
+%0A%0A async def __aenter__(self):%0A await self.connect_to_graphite()%0A return self.graphite_conn%0A%0A%0A async def __aexit__(self):%0A await self.close_conn_to_graphite()%0A
|
aefcf622112cb44af7b56b0a183283bcbf194788 | use .format() for floating point decimal conversion | mlens/metrics/utils.py | mlens/metrics/utils.py | """ML-ENSEMBLE
:author: Sebastian Flennerhag
:copyright: 2017
:licence: MIT
Utility functions for constructing metrics
"""
from __future__ import division
import warnings
import numpy as np
from ..utils.exceptions import MetricWarning
try:
from collections import OrderedDict as _dict
except ImportError:
_di... | Python | 0.000069 | @@ -407,20 +407,28 @@
urn
-str(np.round
+'%7B0:.%7Bdec%7Df%7D'.format
(obj
@@ -432,17 +432,20 @@
obj, dec
-)
+=dec
)%0A ex
@@ -784,16 +784,39 @@
ata=None
+, padding=2, decimals=2
):%0A
@@ -924,16 +924,88 @@
__(data)
+%0A self.__padding__ = padding%0A self.__decimals__ = decimals
%0A%0A ... |
1b265016697ec22d92822fcd0462549920118e08 | fix bugs in generalization error calculation (#179) | mnist_hogwild/train.py | mnist_hogwild/train.py | import os
import torch
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transforms
def train(rank, args, model):
torch.manual_seed(args.seed + rank)
train_loader = torch.utils.data.DataLoader(
datasets.MNIST('../data', tr... | Python | 0 | @@ -2071,17 +2071,57 @@
rget
-).data%5B0%5D
+, size_average=False).data%5B0%5D # sum up batch loss
%0A
@@ -2254,34 +2254,8 @@
()%0A%0A
- test_loss = test_loss%0A
@@ -2275,69 +2275,28 @@
len(
-data
+test
_loader
-) # loss function already averages over batch size
+.dataset)
%0A
|
dc45614bbe89a1716f64ff17dee9054ef947cda9 | change forgotten RuntimeError into MocodoError | mocodo/diagram_link.py | mocodo/diagram_link.py | #!/usr/bin/env python
# encoding: utf-8
from __future__ import division
import sys
import re
from .dynamic import Dynamic
class DiagramLink:
def __init__(self, entities, foreign_entity, foreign_key):
self.foreign_entity = foreign_entity
self.foreign_key = foreign_key
try:
sel... | Python | 0.00001 | @@ -116,16 +116,54 @@
Dynamic
+%0Afrom .mocodo_error import MocodoError
%0A%0Aclass
@@ -459,41 +459,23 @@
ise
-RuntimeError(%22
Mocodo
-
Err
-.14 - %22 +
+or(14,
_('
@@ -952,41 +952,23 @@
ise
-RuntimeError(%22
Mocodo
-
Err
-.15 - %22 +
+or(15,
_('
|
6ff0a16e4b9f6b0e1aabfa50135f59ec6e36042c | fix os.environ | analyticsdataserver/settings/production.py | analyticsdataserver/settings/production.py | """Production settings and globals."""
from os import environ
from base import *
import yaml
from analyticsdataserver.logsettings import get_logger_config
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ... | Python | 0.000004 | @@ -985,19 +985,16 @@
ASSWORD=
-os.
environ.
@@ -1060,19 +1060,16 @@
ENGINE=
-os.
environ.
@@ -1137,19 +1137,16 @@
USER=
-os.
environ.
@@ -1210,19 +1210,16 @@
NAME=
-os.
environ.
@@ -1283,19 +1283,16 @@
HOST=
-os.
environ.
@@ -1360,11 +1360,8 @@
ORT=
-os.
envi
|
4019f2a2e1000a655fd2cebc16c4c47626895469 | fix problems with DownloadManager startup and stop | lbrynet/core/client/DownloadManager.py | lbrynet/core/client/DownloadManager.py | import logging
from twisted.internet import defer
from twisted.python import failure
from zope.interface import implements
from lbrynet import interfaces
log = logging.getLogger(__name__)
class DownloadManager(object):
implements(interfaces.IDownloadManager)
def __init__(self, blob_manager):
self.b... | Python | 0 | @@ -47,43 +47,8 @@
fer%0A
-from twisted.python import failure%0A
from
@@ -831,16 +831,43 @@
turn d%0A%0A
+ @defer.inlineCallbacks%0A
def
@@ -888,33 +888,32 @@
ding(self):%0A
-%0A
def check_st
@@ -904,544 +904,149 @@
-def check_start(result, manager):%0A if isinstance(result, fai... |
41dc702b3b76793013f556f0f66c098fcc6cebec | check version dublicating | models/distributive.py | models/distributive.py | import re
import os
from mongokit import Document
from bson.objectid import ObjectId
from models.environment import Environment
from flask import current_app, request, flash, redirect, url_for
from werkzeug.utils import secure_filename
from werkzeug.datastructures import FileStorage
class Distributive(Document):
... | Python | 0 | @@ -1719,17 +1719,17 @@
= %7B'$ne'
-,
+:
self%5B'_
@@ -1735,16 +1735,57 @@
_id'%5D%7D%0A%0A
+ print check_dist_existance_data%0A%0A
|
1dad123a3bbcb6248d1557319a7e02d55a6d29e8 | Fix data types HypermediaResource | resource/HypermediaResource.py | resource/HypermediaResource.py |
import json
import terms as v
from Links import Links
class HypermediaResource(object) :
def __init__(self):
self._contentFormats = {}
LinkFormatHandler(self)
LinkFormatPatchHandler(self)
PlainTextHandler(self)
SenmlValueHandler(self)
self._value = {v... | Python | 0.000021 | @@ -2293,32 +2293,141 @@
thod%5D == v.get:%0A
+ for key in self._resource._value:%0A if key in (v._v, v._bv, v._sv, v._ov):%0A
requ
@@ -2488,20 +2488,19 @@
._value%5B
-v._v
+key
%5D)%0A
|
a7f82aff385d93f00630aef6375c16f9742c6096 | Drop extra information so that x_series, jvm_totals and top_totals all have the same number of elements. This prevents errors when drawing the graphs. | build-graph.py | build-graph.py | #!/usr/bin/env python
#
# A script to parse dump.sh data obtained from `cf logs`
#
# Author: Daniel Mikusa <dmikusa@pivotal.io>
# Date: 2015-10-20
#
# Script requires: matplotlib & python-dateutil
#
import sys
import re
import matplotlib.pyplot as plt
from dateutil.parser import parse
def read_data(filename, ... | Python | 0 | @@ -2363,58 +2363,167 @@
-return (x_series, jvm_totals, top_totals, crashes,
+max_len = len(x_series)%0A return (x_series,%0A jvm_totals%5B0:max_len%5D,%0A top_totals%5B0:max_len%5D,%0A crashes%5B0:max_len%5D,%0A
sta
|
ce7d80de371baac92c786651706bde09ee45c96e | Handle check-ins w/o boarding group/position | lambda/src/handlers/check_in.py | lambda/src/handlers/check_in.py | import logging
import sys
import swa, exceptions, mail
# Set up logging
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
def _generate_email_body(response):
body = "I just checked in to your flight! Please login to Southwest to view your boarding passes.\n"
for flight in response['checkInConfir... | Python | 0 | @@ -500,24 +500,159 @@
ssengers'%5D:%0A
+ # Child and infant fares might check in without a boarding group/position%0A if 'boardingGroup' in passenger:%0A
@@ -745,24 +745,95 @@
ition'%5D%7D%5Cn%22%0A
+ else:%0A body += f%22 - %7Bpassenger%5B'name'%5D%... |
7a79d64e1257888f79e7ba21f29e6843dca2f015 | fix leprikon_tags.upstream | leprikon/templatetags/leprikon_tags.py | leprikon/templatetags/leprikon_tags.py | import requests
from django import template
from django.contrib.staticfiles import finders
from django.core.cache import InvalidCacheBackendError, caches
from django.utils.safestring import mark_safe
from lxml.html import fromstring, tostring
from ..conf import settings
from ..forms.schoolyear import SchoolYearForm
fr... | Python | 0.000002 | @@ -2182,20 +2182,11 @@
path
-, index=0
):%0A
+
@@ -2532,17 +2532,17 @@
che
+300
menu
-300
%25%7D%7B%25
@@ -2551,16 +2551,17 @@
pstream
+'
https://
@@ -2576,14 +2576,17 @@
com/
-
+' '
//nav
+'
%25%7D%7B
@@ -2915,17 +2915,69 @@
afe(
-tostring(
+b''.join(%0A tostring(node)%0A ... |
8a20c956c02caa74dbf7c79e9e714e420479dcef | update py | web_test.py | web_test.py | from selenium import webdriver
from pandas import *
import csv
import time
# load test data
with open('web_test_funnel.csv', 'rb') as f:
reader = csv.reader(f)
testbot_raw = list(reader)
testbot = sorted(testbot_raw, key=lambda testbot_raw: testbot_raw[2])
df = DataFrame(testbot, columns = testbot[len(testbot)-1])
... | Python | 0 | @@ -541,17 +541,16 @@
sid%5Bk%5D%0A%09
-#
value =
@@ -572,16 +572,17 @@
omJS()%0A%09
+#
value =
|
2cf4d2446414795ab23a1117874085bc19cd814e | make it runnable even if locale is not set such like in docker env; may close issues#3 | anytemplate/compat.py | anytemplate/compat.py | #
# Author: Satoru SATOH <ssato redhat.com>
# License: MIT
#
# pylint: disable=invalid-name, redefined-builtin, unused-argument
"""Module to keep backward compatibilities.
"""
from __future__ import absolute_import
import codecs
import itertools
import locale
import os.path
import sys
try:
import json
except Impo... | Python | 0.000001 | @@ -455,16 +455,27 @@
ale()%5B1%5D
+ or %22UTF-8%22
%0A%0A%0A# Bor
|
760ad145b380fe45d6a0350d7298a29d7c47452c | Add python3.4 compatibility to is_json | is_valid/wrapper_predicates.py | is_valid/wrapper_predicates.py | import json
def is_transformed(transform, predicate, *args, exceptions=[
Exception
], msg='data can\'t be transformed', **kwargs):
"""
Generates a predicate that checks if the data is valid according to some
predicate after a function has been applied to the data. If this function
throws an except... | Python | 0.998425 | @@ -26,16 +26,21 @@
sformed(
+%0A
transfor
@@ -51,32 +51,36 @@
redicate, *args,
+%0A
exceptions=%5B%0A
@@ -76,21 +76,16 @@
ptions=%5B
-%0A
Exceptio
@@ -85,17 +85,16 @@
xception
-%0A
%5D, msg='
@@ -122,32 +122,33 @@
ormed', **kwargs
+%0A
):%0A %22%22%22%0A G
@@ -1534,16 +1534,139 @@
valid%... |
c047752870b1c07af5384b177b9d5d820f850616 | Modify receivedtimestamp when utctimestamp changes | tests/alerts/test_bruteforce_ssh.py | tests/alerts/test_bruteforce_ssh.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
#
# Contributors:
# Brandon Myers bmyers@mozilla.com
from positive_alert_test_c... | Python | 0.000001 | @@ -1707,16 +1707,141 @@
s': 1%7D)%0A
+ event%5B'_source'%5D%5B'receivedtimestamp'%5D = AlertTestSuite.subtract_from_timestamp_lambda(date_timedelta=%7B'minutes': 1%7D)%0A
test
@@ -5922,16 +5922,126 @@
s': 3%7D)%0A
+ event%5B'_source'%5D%5B'receivedtimestamp'%5D = AlertTestSuite.subtract_from_times... |
63a9d670035368e1a2e8da2a5b783b6811340575 | add actionAngleSpherical to top level | galpy/actionAngle.py | galpy/actionAngle.py | from galpy.actionAngle_src import actionAngle
from galpy.actionAngle_src import actionAngleFlat
from galpy.actionAngle_src import actionAnglePower
from galpy.actionAngle_src import actionAngleAxi
from galpy.actionAngle_src import actionAngleAdiabatic
from galpy.actionAngle_src import actionAngleAdiabaticGrid
from galpy... | Python | 0.000001 | @@ -530,16 +530,71 @@
neApprox
+%0Afrom galpy.actionAngle_src import actionAngleSpherical
%0A%0A#%0A# Ex
@@ -1467,28 +1467,92 @@
.actionAngleIsochroneApprox%0A
+actionAngleSpherical= actionAngleSpherical.actionAngleSpherical%0A
|
72f39edc6fe573f7c67f55fc1205b1c9b904395b | fix up printing | ott/utils/parse/logs/request_dwell.py | ott/utils/parse/logs/request_dwell.py |
#F="gap-log-halloween-11.50am"
F="gap-log-at-1.09pm"
class LogInfo(object):
pre_line = None
lg_line = None
lg_line_no = 0
delay = 0
def __init__(self):
pass
def set(self, pre_line, lg_line, lg_line_no, delay):
self.pre_line = pre_line
self.lg_line = lg_line
s... | Python | 0.000019 | @@ -467,33 +467,37 @@
es)
-%5Cn%5Cn
+at
line
-1:
+%7B%7D of
%7B%7D %5Cn
+%5Cn
line
-2
+%7B%7D
: %7B%7D
@@ -511,16 +511,13 @@
e %7B%7D
- of %7B%7D%5Cn
+: %7B%7D
%5Cn%22.
@@ -571,24 +571,39 @@
0, self.
-pre
+lg_line_no, total
_line
+s
, self.l
@@ -608,16 +608,36 @@
.lg_line
+_no-1, self.pre_line
, self... |
1e10da86d224642066e4e3390454be615c308664 | set the process group and kill children | paasta_tools/paasta_cli/paasta_cli.py | paasta_tools/paasta_cli/paasta_cli.py | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""A command line tool for viewing information from the PaaSTA stack."""
import argcomplete
import argparse
from paasta_tools.paasta_cli import cmds
from paasta_tools.paasta_cli.utils \
import file_names_in_dir as paasta_commands_dir, load_method
from paasta_tools.util... | Python | 0.000002 | @@ -146,16 +146,40 @@
argparse
+%0Aimport os%0Aimport signal
%0A%0Afrom p
@@ -1699,24 +1699,55 @@
ry.%0A %22%22%22%0A
+%0A os.setpgrp()%0A try:%0A
configur
@@ -1754,24 +1754,28 @@
e_log()%0A
+
+
args = parse
@@ -1782,16 +1782,20 @@
_args()%0A
+
args
@@ -1809,16 +1809,66 @@
d(ar... |
4da09ae9bc9fa05545f5032c398a350798035d60 | Fix factory import | tests/fixtures/factories/student.py | tests/fixtures/factories/student.py | import factory
from datetime import timedelta, datetime, timezone
from utils import datetime_from_date
from .user import UserFactory
from scuevals_api import models
class StudentFactory(UserFactory):
class Meta:
model = models.Student
sqlalchemy_session = models.db.session
graduation_year = ... | Python | 0 | @@ -64,45 +64,8 @@
ne%0A%0A
-from utils import datetime_from_date%0A
from
@@ -122,16 +122,66 @@
models%0A
+from scuevals_api.utils import datetime_from_date%0A
%0A%0Aclass
|
2333980b427c818e0db320a3a5406094a9e64183 | Test parent processes handling of KeyboardInterrupt | tests/test_hasher_hash_directory.py | tests/test_hasher_hash_directory.py | """ Test cases for furtive.hasher object """
import logging
import unittest
import multiprocessing
from mock import MagicMock
from furtive.hasher import HashDirectory, hash_task, initializer
class TestHashDirectory(unittest.TestCase):
def test_hash_directory(self):
""" Ensure HashDirectory will correctl... | Python | 0 | @@ -120,16 +120,23 @@
agicMock
+, patch
%0A%0Afrom f
@@ -928,16 +928,519 @@
s), 4)%0A%0A
+ def test_hash_directory_keyboard_interupt(self):%0A %22%22%22 Ensure HashDirectory gracefully handles a KeyboardInterrupt %22%22%22%0A%0A with patch('furtive.hasher.multiprocessing.Pool') as mock_pool:%0A ... |
78609a236dba424129c520405fe726e8f1baaab6 | fix lint error caused by black | tests/unit/cloud/clouds/test_gce.py | tests/unit/cloud/clouds/test_gce.py | # -*- coding: utf-8 -*-
"""
:codeauthor: `Anthony Shaw <anthonyshaw@apache.org>`
tests.unit.cloud.clouds.gce_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import collections
# Import Salt Libs
from salt.cloud.cl... | Python | 0.000001 | @@ -5217,17 +5217,16 @@
unt%22: 42
-,
%7D%0A
|
008af0ac6b306b0478fb5769e1bf73002b00773a | Fix unit tests | tests/unit/modules/test_win_snmp.py | tests/unit/modules/test_win_snmp.py | # -*- coding: utf-8 -*-
'''
:synopsis: Unit Tests for Windows SNMP Module 'module.win_snmp'
:platform: Windows
:maturity: develop
.. versionadded:: 2017.7.0
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Libs
import salt.modules.win_snmp as win_snmp
# Import Salt Testin... | Python | 0.000005 | @@ -291,16 +291,66 @@
win_snmp
+%0Afrom salt.exceptions import CommandExecutionError
%0A%0A# Impo
@@ -2337,37 +2337,35 @@
''%0A mock_
-value
+ret
= MagicMock(ret
@@ -2433,18 +2433,16 @@
-
'vname':
@@ -2461,16 +2461,67 @@
ity'%7D%5D)%0A
+ mock_false = MagicMock(return_value=False)%0A
... |
f8d824092a4ae9bd7a68bf4726ede1c9da5d3d8e | add dbrps to main kapacitor test | tests/unit/states/test_kapacitor.py | tests/unit/states/test_kapacitor.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt testing libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
from tests.support.mock import Mock, patch, mock_open
# Import Salt libs
import salt.states.kapacitor as kapaci... | Python | 0 | @@ -500,16 +500,59 @@
fault',%0A
+ dbrps=%5B'testdb2.default_rp'%5D,%0A
@@ -1842,16 +1842,29 @@
e=enable
+, dbrps=dbrps
)%0A%0A r
@@ -1992,16 +1992,26 @@
stream',
+%0A
db='tes
@@ -2699,32 +2699,44 @@
olicy='default',
+%0A
task_type='stre
@@ -2730,32 +2730,62 @@
sk_... |
cedc609503eb617755dfd3dee425cf4019cefce4 | Fix test suite hang on salt testing | tests/unit/transport/zeromq_test.py | tests/unit/transport/zeromq_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Thomas Jackson <jacksontj.89@gmail.com>`
'''
# Import python libs
from __future__ import absolute_import
import os
import threading
import platform
import time
import zmq.eventloop.ioloop
# support pyzmq 13.0.x, TODO: remove once we force people to 14.0.x
if not ha... | Python | 0 | @@ -2320,32 +2320,147 @@
DownClass(cls):%0A
+ # Attempting to kill the children hangs the test suite.%0A # Let the test suite handle this instead.%0A#
cls.proc
|
f890f76e6b8beed9e603855e263b9983fe5daa42 | Tidy up whitespace | sphinx_autobuild/__init__.py | sphinx_autobuild/__init__.py | """
Automatic builder for Sphinx based documentation sets.
MIT License. See LICENSE for more details.
Copyright (c) 2013, Jonathan Stoppani
"""
import argparse
import fnmatch
import os
import subprocess
import sys
try:
import pty
except ImportError:
pty = None
from livereload import Server
from watchdog.o... | Python | 0.999972 | @@ -7100,17 +7100,16 @@
gnored)%0A
-%0A
serv
@@ -7153,24 +7153,25 @@
gWatcher())%0A
+%0A
server.w
@@ -7345,24 +7345,25 @@
tch(outdir)%0A
+%0A
server.s
|
76484b68b63d5c80547cc086f9675ae30cb45fe0 | add errors in command_base.py. | gdrv/command_base.py | gdrv/command_base.py | #!/usr/bin/python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
import os
import sys
import logging
import fnmatch
import httplib2
import global_mod as gm
from apiclient.discovery import build
from oauth2client.file import Storage
lg = logging.getLogger("BASE")
#lg.setLevel(logging.INFO)
class DriveCommand():
... | Python | 0 | @@ -153,16 +153,45 @@
d as gm%0A
+from apiclient import errors%0A
from api
|
cf682a0ead28c7096b4dc7092ccf1b64fd7d6a08 | Add ability to specify src dir | server/download.py | server/download.py | #!/usr/bin/env python
from __future__ import print_function
import argparse
import logging
import os
import sys
import pysftp
LOG_FORMAT = '%(asctime)-15s %(name)-10s %(levelname)-7s %(message)s'
# max number of files to download per sftp connection - not getting them all at
# once helps avoid lockups/hangs on the ... | Python | 0 | @@ -346,16 +346,78 @@
N = 10%0A%0A
+DEFAULT_SRC_DIR = os.path.expanduser(%22/mnt/sdcard/timelapse%22)%0A
DEFAULT_
@@ -461,16 +461,16 @@
lapse%22)%0A
-
%0ALOG_FIL
@@ -987,16 +987,144 @@
os to%22)%0A
+ parser.add_argument('--src-dir', default=DEFAULT_SRC_DIR,%0A help=%22Directory to downloa... |
a0792e74598dc8bb6ac2b79b9288c6acc05e9fec | Correct "profile" to "user entity". | app/soc/views/host.py | app/soc/views/host.py | # Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | Python | 0 | @@ -1989,23 +1989,27 @@
have a
-profile
+user entity
.%0A if
|
90da7aa5028d64437f3fcaf903075cbda293b575 | Fix logging in tests | test/requests/parametrized_test.py | test/requests/parametrized_test.py | import logging
import unittest
from elasticsearch import Elasticsearch, TransportError
class ParametrizedTest(unittest.TestCase):
def __init__(self, methodName='runTest', gn2_url="http://localhost:5003", es_url="localhost:9200"):
super(ParametrizedTest, self).__init__(methodName=methodName)
self.g... | Python | 0 | @@ -24,16 +24,40 @@
nittest%0A
+from wqflask import app%0A
from ela
@@ -537,16 +537,72 @@
earch%22)%0A
+ es_logger.setLevel(app.config.get(%22LOG_LEVEL%22))%0A
|
cdf369a3cce9718a41a6f2580ede7b127cb6fe28 | convert passed srid into int | geoalchemy2/types.py | geoalchemy2/types.py | """
This module includes the :class:`geoalchemy2.types.Geometry` and
:class:`geoalchemy2.types.Geography` to use when defining geometry
and geography columns, respecively.
Reference
---------
"""
from sqlalchemy.types import UserDefinedType
from sqlalchemy.sql import func
from .comparator import Comparator
from .ele... | Python | 0.002291 | @@ -2572,20 +2572,25 @@
.srid =
+int(
srid
+)
%0A
|
3c85da71f22c43041e7475b01b4683f22fc3a618 | Add a PY2 also. | setuptools/compat.py | setuptools/compat.py | import sys
import itertools
PY3 = sys.version_info >= (3,)
if not PY3:
basestring = basestring
import __builtin__ as builtins
import ConfigParser
from StringIO import StringIO
BytesIO = StringIO
execfile = execfile
func_code = lambda o: o.func_code
func_globals = lambda o: o.func_globa... | Python | 0.000002 | @@ -57,19 +57,21 @@
3,)%0A
-%0Aif
+PY2 =
not PY3
:%0A
@@ -62,24 +62,32 @@
Y2 = not PY3
+%0A%0Aif PY2
:%0A basest
|
54219918015bc6b8a5fdc9bcd2479db1a996475e | fix of 6d72a68 typo fix | vocabulary.py | vocabulary.py | import random
import numpy as np
import regex as re
class Vocabulary(object):
def __init__(self, tokenized_text=None):
self.word_to_index = {}
self.index_to_word = []
self.word_count = {}
self.add_tokenized_text(["<pad>", "<s>", "</s>", "<unk>"])
if tokenized_text:
... | Python | 0.000003 | @@ -2983,24 +2983,34 @@
ndices%5B0%5D =
+np.repeat(
self.get_wor
@@ -3023,16 +3023,33 @@
x(%22%3Cs%3E%22)
+, len(sentences))
%0A%0A
|
b60fb0db2cc1ab3605f34e9b604e920279434c36 | Disable mouse handling in vterm example. | vterm_test.py | vterm_test.py | #!/usr/bin/python
import urwid
def main():
event_loop = urwid.SelectEventLoop()
mainframe = urwid.Frame(
urwid.Columns([
('fixed', 3, urwid.SolidFill('|')),
urwid.Pile([
('weight', 70, urwid.TerminalWidget(None, event_loop)),
('fixed', 1, urwid.F... | Python | 0 | @@ -920,16 +920,44 @@
nframe,%0A
+ handle_mouse=False,%0A
|
e1fc818b8d563c00c77060cd74d2781b287c0b5d | Include Plot, SPlot in xnuplot.__all__. | xnuplot/__init__.py | xnuplot/__init__.py | from .plot import Plot, SPlot
__all__ = ["gnuplot", "numplot"]
| Python | 0.000001 | @@ -34,16 +34,33 @@
ll__ = %5B
+%22Plot%22, %22SPlot%22,
%22gnuplot
|
52da77d49854568c07e10fed94bbff31bb4f4f05 | fix incorrect CAZAC sequence | commpy/sequences.py | commpy/sequences.py | # Authors: CommPy contributors
# License: BSD 3-Clause
"""
==================================================
Sequences (:mod:`commpy.sequences`)
==================================================
.. autosummary::
:toctree: generated/
pnsequence -- PN Sequence Generator.
zcsequence -... | Python | 0.999998 | @@ -2249,32 +2249,37 @@
ce(u, seq_length
+, q=0
):%0A %22%22%22%0A G
@@ -2394,24 +2394,29 @@
ZC sequence
+: u%3E0
.%0A%0A seq_l
@@ -2501,190 +2501,485 @@
mber
-.%0A%0A Returns%0A -------%0A zcseq : 1D ndarray of complex floats%0A ZC sequence generated.%0A %22%22%22%0A zcseq = exp((-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.