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 |
|---|---|---|---|---|---|---|---|
457550824bece74f1dd1a07eb7e6c484a4e53348 | remove pyc | util/store.py | util/store.py | # -*- coding: utf-8 -*-
'''
Created on 2016. 6. 28.
@author: nw
'''
from google.appengine.ext import ndb
class Store(ndb.Model):
'''
classdocs 클래스 설명
'''
key = ndb.StringProperty()
RTLRID = ndb.StringProperty()
RECORDNO = ndb.IntegerProperty()
... | Python | 0.998824 | @@ -166,16 +166,18 @@
s %ED%81%B4%EB%9E%98%EC%8A%A4 %EC%84%A4%EB%AA%85
+
%0D%0A ''
|
67254d140ec1b98bd60fa59a676ad11ebf276112 | Fix up the test utility | utils/test.py | utils/test.py | #!/usr/bin/python
"""Waits for the sensor to appear on /dev/ttyUSB5, then reads moisture and temperature from it continuously"""
import chirp_modbus
from time import sleep
import minimalmodbus
ADDRESS = 1
minimalmodbus.TIMEOUT=0.5
# for baudrate in chirp_modbus.SoilMoistureSensor.baudrates:
# print("Checking baudr... | Python | 0.000302 | @@ -816,8 +816,75 @@
ep(0.3)%0A
+%09except IOError as e:%0A%09%09print e%0A%09%09print(%22Waiting...%22)%0A%09%09sleep(0.3)%0A
|
7ae8cd06fd299656858416b79d0b96ca380de84b | add os | vaping/cli.py | vaping/cli.py |
from __future__ import absolute_import
from __future__ import print_function
import click
import munge
import munge.click
# test direct imports
import vaping
import vaping.daemon
class Context(munge.click.Context):
app_name = 'vaping'
config_class = vaping.Config
def update_context(ctx, kwargs):
ctx.... | Python | 0.000591 | @@ -116,16 +116,26 @@
ge.click
+%0Aimport os
%0A%0A# test
|
ee77150df7db9d22e00f1ff0c34a88eb310fb26c | add experimental debug function | era/utils/__init__.py | era/utils/__init__.py | Python | 0.000018 | @@ -0,0 +1,256 @@
+from .functools import unidec%0A%0A%0A@unidec%0Adef o_O(fn, *args, **kw):%0A import ipdb%0A locals().update(fn.__globals__)%0A closure = %5Bx.cell_contents for x in fn.__closure__ or %5B%5D%5D%0A ipdb.set_trace()%0A return fn(*args, **kw)%0A%0A%0A__builtins__%5B'o_O'%5D = o_O%0A
| |
1bf9aabc8b9a2eaa3b0cea7578c3a6d609b0d8e3 | fix the update-message when running 'fips diag fips' | verbs/diag.py | verbs/diag.py | """run diagnosis
diag all -- run all diagnosis functions
diag tools -- check if required tools can be found
diag configs -- check all configs
diag imports -- check all imports
diag -- same as 'diag all'
"""
from mod.tools import git, cmake, ccmake, cmake_gui, python2, vscode, clion
from m... | Python | 0.00001 | @@ -764,35 +764,25 @@
un '
-git pull' in fips directory
+fips update fips'
!%22)%0A
|
4c6c0c14f05b2946e8ecafd8e3031fbf68ee222f | use Form instead of FlaskForm with flask_wtf | views/blog.py | views/blog.py | """
This Blueprint implements Blog related views.
"""
from flask import Blueprint, render_template, abort, request
from flask_misaka import markdown
from flask_login import login_required
from flask_wtf import FlaskForm
import wtforms
from models import Post, Tag
blog = Blueprint('blog', __name__)
@blog.route('/')... | Python | 0 | @@ -203,21 +203,16 @@
import
-Flask
Form%0Aimp
@@ -1300,13 +1300,8 @@
orm(
-Flask
Form
|
b9bae46996308c49554148ff547ae5efca72d90e | Switch to stable | account_asset_management/__manifest__.py | account_asset_management/__manifest__.py | # Copyright 2009-2019 Noviat
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Assets Management",
"version": "13.0.3.7.1",
"license": "AGPL-3",
"depends": ["account", "report_xlsx_helper"],
"excludes": ["account_asset"],
"ext... | Python | 0 | @@ -301,24 +301,71 @@
nt_asset%22%5D,%0A
+ %22development_status%22: %22Production/Stable%22,%0A
%22externa
|
f0b2fa27656473b4c397f59074e96712ed9613eb | Bump version (#115) | vt/version.py | vt/version.py | """Defines VT release version."""
__version__ = '0.15.0'
| Python | 0 | @@ -50,9 +50,9 @@
'0.1
-5
+6
.0'%0A
|
c6cc632b015f7d4621c5d2dbb3fb70c6fe00c5e7 | Add conference registration to urls | wafer/urls.py | wafer/urls.py | from django.conf.urls import include, patterns, url
from django.views.generic import RedirectView, TemplateView
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$',
TemplateView.as_view(template_name='wafer/index.html'),
... | Python | 0 | @@ -716,32 +716,94 @@
.pages.urls')),%0A
+ (r'%5Eregister/', include('wafer.conf_registration.urls')),%0A
(r'%5Eadmin/',
|
d205fcdd27048a166111d7c0077174ed73052310 | Fix intervals unit test. | src/python/tests/intervals.py | src/python/tests/intervals.py | # Copyright (c) 2015-2017 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
from ..mpi import MPI
from .mpi import MPITestCase
import sys
import os
import numpy as np
import numpy.testing as nt
from... | Python | 0.000001 | @@ -1026,14 +1026,8 @@
int(
-0.5 +
self
|
79d2214eed99b3502bdbe1437f08495a29e8bedc | add the final merge fct | week2/2048.py | week2/2048.py | """
Clone of 2048 game.
"""
import poc_2048_gui
# Directions, DO NOT MODIFY
UP = 1
DOWN = 2
LEFT = 3
RIGHT = 4
# Offsets for computing tile indices in each direction.
# DO NOT MODIFY this dictionary.
OFFSETS = {UP: (1, 0),
DOWN: (-1, 0),
LEFT: (0, 1),
RIGHT: (0, -1)}
def merge(line)... | Python | 0 | @@ -592,16 +592,143 @@
j += 1%0A
+%0A for k in range(l-1):%0A if s1%5Bk%5D == s1%5Bk+1%5D:%0A s1%5Bk%5D *=2%0A s1.pop(k+1)%0A s1.append(0)%0A%0A
retu
|
d0effd9330692a7cab0f8a0209f4295d70ae1734 | fix thing | Player1.py | Player1.py | import pygame
from Player import PlayerBase
class Player1():
def __init__(self, pos):
pygame.sprite.Sprite.__init__(self, self.containers)
self.upImage = pygame.image.load("ArkansasSimth.png")
self.downImage = pygame.image.load("ArkansasSimth.png")
self.leftImage = pygame.image.loa... | Python | 0.000006 | @@ -38,17 +38,16 @@
erBase%0A%0A
-%0A
class Pl
@@ -52,16 +52,36 @@
Player1(
+pygame.sprite.Sprite
):%0A d
|
878eb7f3525575363a232d5663e5a7f02cbf972a | Add filtering by username and full name for Rancher users | src/waldur_rancher/filters.py | src/waldur_rancher/filters.py | import django_filters
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from waldur_core.core import filters as core_filters
from waldur_core.structure import filters as structure_filters
from . import models
class ServiceProjectLinkFilter(structure_filters.BaseServiceProject... | Python | 0 | @@ -2958,24 +2958,254 @@
ser__uuid')%0A
+ user_username = django_filters.CharFilter(%0A field_name='user__username', lookup_expr='icontains'%0A )%0A user_full_name = django_filters.CharFilter(%0A field_name='user__full_name', lookup_expr='icontains'%0A )%0A
settings
|
d822ce0a6517a7d1bff804d58469a339fa79f1ec | Fix openstack code on python3 | src/wirecloud/fiware/proxy.py | src/wirecloud/fiware/proxy.py | # -*- coding: utf-8 -*-
# Copyright (c) 2014-2016 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud 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 v... | Python | 0.999762 | @@ -812,67 +812,8 @@
me%0A%0A
-from openstack_token_manager import OpenstackTokenManager%0A%0A
from
@@ -990,16 +990,91 @@
_SERVER%0A
+from wirecloud.fiware.openstack_token_manager import OpenstackTokenManager%0A
from wir
|
7624b72d5d7bb08e38ffa40e8606d581de124d1d | Update lookupAndStoreTweets.py docs: Update lookupAndStoreTweets.py | app/utils/insert/lookupAndStoreTweets.py | app/utils/insert/lookupAndStoreTweets.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Lookup and Store Tweets utility.
"""
import argparse
import os
import sys
# Allow imports to be done when executing this file directly.
appDir = os.path.abspath(os.path.join(os.path.dirname(__file__),
os.path.pardir, os.path.pardi... | Python | 0.000001 | @@ -185,16 +185,26 @@
ly.%0A
-appDir =
+sys.path.insert(0,
os.
@@ -229,16 +229,21 @@
th.join(
+%0A
os.path.
@@ -264,46 +264,8 @@
__),
-%0A
os.
@@ -296,35 +296,10 @@
dir)
+%0A
)
-%0Asys.path.insert(0, appDir
)%0A%0Af
@@ -350,16 +350,86 @@
t auth%0A%0A
+# TODO: Use the... |
255d075aec1d1fecb9ac267ba9e39ffd1675c065 | np.min+flake | examples/cfd/tools.py | examples/cfd/tools.py | from mpl_toolkits.mplot3d import Axes3D # noqa
import numpy as np
from matplotlib import pyplot, cm
def plot_field(field, xmin=0., xmax=2., ymin=0., ymax=2., zmin=None, zmax=None, view=None, linewidth=0):
"""Utility plotting routine for 2D data
:param field: Numpy array with field data to plot
:param x... | Python | 0.999557 | @@ -176,16 +176,20 @@
ax=None,
+%0A
view=No
@@ -998,20 +998,29 @@
et_zlim(
-zmin
+np.min(field)
, zmax)%0A
|
d8d05a16577aff422fb69cc39d468a9d9d5e6ba5 | fix type error | Python/nn.py | Python/nn.py | import tensorflow as tf
import numpy as np
def get_step_indexes(step, batch_size, n):
start = (step * batch_size) % n
stop = start + batch_size
if stop > n:
stop = n
return (start, stop)
ratio = 0.7
batch_size = 500
n_features = 784
label_index = 0
feature_index = range(0, n_features + 1)
feat... | Python | 0.000004 | @@ -562,34 +562,34 @@
dtype = np.float
-64
+32
,%0A
@@ -4432,10 +4432,10 @@
loat
-64
+32
,%0A
|
4f512ae6a3500c390d0cf2e8d3f5c3f5d890b4b4 | fix word forms | word_forms.py | word_forms.py | # coding: utf8
"""
See this comment about usage
https://github.com/radomd92/botjagwar/issues/6#issuecomment-361023958
"""
import os
import re
import sys
import pywikibot
from api.entryprocessor import WiktionaryProcessorFactory
from api.output import Output
from api.parsers import AdjectiveForm
from api.parsers impor... | Python | 0.999965 | @@ -3031,16 +3031,99 @@
ements)%0A
+ if elements is None:%0A print(%22No elements%22)%0A return 0%0A
|
40500ede3adfa90e33dd86e9df30c5a7e40bc189 | Update SAT object | SATObject.py | SATObject.py | #
# SAT object that will have work done onto
class SATObject(object):
"""
"""
# SATObject has only a list of variables (for refrence) and a clause list
def __init__(self):
# Dictionary of variable strings (keys) to refernce variable (values)
self.varDict = {}
# List of clauses... | Python | 0 | @@ -1586,24 +1586,204 @@
s,cnfFile):%0A
+ '''%0A Alternative constructor that reads CNF file and imports clauses into %0A SAT object instance. %0A%0A Input: String of CNF filename%0A '''%0A
# Cr
|
6b6c035479c28524af91db284e897eb1178eadf0 | Fix crash if connection fail | SQLMapper.py | SQLMapper.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# SQLMapper.py
# PythonSQLMapper
#
# Copyright 2013-2017 Kenji Nishishiro. All rights reserved.
# Written by Kenji Nishishiro <marvel@programmershigh.org>.
#
import re
class MappingError(Exception):
def __init__(self, message, cause=None):
self.message... | Python | 0.000072 | @@ -931,16 +931,47 @@
arams):%0A
+ self.connection = None%0A
|
5c5119febc2a1f2ab4157895f5fe336adedc5807 | correct path for selftest | Test/test.py | Test/test.py | #!/usr/bin/env python3
"""
self-test for GeoDataPython
"""
from numpy.testing import assert_allclose,run_module_suite
#
from load_isropt import load_risromti
def test_risr():
isrfn = 'data/ran120219.004.hdf5'
omtifn = 'data/OMTIdata.h5'
risr,omti = load_risromti(isrfn,omtifn)
assert_allclose(risr.data[... | Python | 0.000004 | @@ -52,16 +52,49 @@
hon%0A%22%22%22%0A
+from os.path import dirname,join%0A
from num
@@ -185,16 +185,40 @@
sromti%0A%0A
+path=dirname(__file__)%0A%0A
def test
@@ -238,22 +238,34 @@
isrfn =
+join(path,
'data
-/
+','
ran12021
@@ -275,16 +275,17 @@
04.hdf5'
+)
%0A omt
@@ -294,14 +294,26 @@
n =
+join(path,
... |
15bc3fc431e5c3bd065927baf30afc8b197dadaf | Use the ascii version of ReadConsole | xyppy/term.py | xyppy/term.py | # os-specific txt controls
import sys, atexit, ctypes
def init(env):
if is_windows():
old_output_mode = ctypes.c_uint32()
stdout_handle = ctypes.windll.kernel32.GetStdHandle(ctypes.c_ulong(-11))
ctypes.windll.kernel32.GetConsoleMode(stdout_handle, ctypes.byref(old_output_mode))
cty... | Python | 0.000001 | @@ -5309,16 +5309,112 @@
ives us%0A
+ # NOTE: W version of this function == ERROR_NOACCESS after text color set in photopia!?%0A
@@ -5456,17 +5456,17 @@
dConsole
-W
+A
(stdin_h
|
eec9da37a43bc49a771267e3545fe197f02d8b37 | Use italic instead of bold and leave the colon unformatted | yui3/parse.py | yui3/parse.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from BeautifulSoup import BeautifulSoup
from collections import defaultdict
# Use defaultdict to append duplicates, but output only the first entry
modules = defaultdict(list)
def normalize(string):
''' -> Remove parantheses part from ending of module names... | Python | 0 | @@ -479,19 +479,19 @@
'''%3C
-b
+i
%3EType
-:
%3C/
-b%3E
+i%3E:
%25s%3C
@@ -496,17 +496,17 @@
s%3Cbr /%3E%3C
-b
+i
%3EDescrip
@@ -513,13 +513,13 @@
tion
-:
%3C/
-b%3E
+i%3E:
%25s'
|
3dd9e7ab651a324f45339dfcd5485283c22fc85a | fix build on windows | zookeeper.gyp | zookeeper.gyp | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'zookeeper',
'type': 'static_library',
'sources': [
'config.h',
'src/zookeeper.c'... | Python | 0 | @@ -1782,32 +1782,224 @@
h'%0A %5D,%0A
+ 'defines': %5B%0A 'USE_STATIC_LIB',%0A %5D,%0A 'direct_dependent_settings': %7B%0A 'defines': %5B%0A 'USE_STATIC_LIB',%0A %5D,%0A %7D,%0A
'msvs_
|
8918a4296ce3d7100578c4adce3cf39a37719173 | update help button to use font awesome and be disabled if no help | xgds_core/templatetags/help_button.py | xgds_core/templatetags/help_button.py | #__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance ... | Python | 0 | @@ -1254,20 +1254,25 @@
tton
-'%3E%3Ci class='
+ btn btn-primary
fa f
@@ -1302,30 +1302,21 @@
lg'
-aria-hidden='true'%3E%3C/i
+role='button'
%3E%3C/a
@@ -1402,52 +1402,181 @@
nd d
-o not include the help button%0A return %22%22
+isable it%0A result = %22%3Ca href='#' class='help_button btn btn-prim... |
a2f9ecc391a4e77b22f857d26e8ffc7741e92b4a | fix default for provider_service | xos/core/xoslib/methods/volttenant.py | xos/core/xoslib/methods/volttenant.py | from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import serializers
from rest_framework import generics
from core.models import *
from django.forms import widgets
from cord.models import VOLTTenant, VOLTService
fro... | Python | 0.000001 | @@ -1145,18 +1145,16 @@
_service
-()
)%0A%0A
|
8d29e6bfbf3b85bb4471b5cd41be180bf9fcda4f | support REST query by service_specific_id and vlan_id | xos/core/xoslib/methods/volttenant.py | xos/core/xoslib/methods/volttenant.py | from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import serializers
from rest_framework import generics
from core.models import *
from django.forms import widgets
from cord.models import VOLTTenant, VOLTService
fro... | Python | 0.000001 | @@ -1522,78 +1522,8 @@
w):%0A
- queryset = VOLTTenant.get_tenant_objects().select_related().all()%0A
@@ -1622,16 +1622,595 @@
enant%22%0A%0A
+ def get_queryset(self):%0A queryset = VOLTTenant.get_tenant_objects().select_related().all()%0A%0A service_specific_id = self.request.QUERY_PARAMS.ge... |
ebbe67666e113345a6f96edcd514ff8a1854485d | Bump version to 1.1 | fabtastic/__init__.py | fabtastic/__init__.py | VERSION = '1.0' | Python | 0 | @@ -10,6 +10,7 @@
'1.
-0'
+1'%0A
|
6e623ec1722b0d1848977faf66afcc44839e9206 | add a TODO to generated code generator code regarding the missing code to generate | gsl_blockly/blockly_target.py | gsl_blockly/blockly_target.py | import os.path
import json
import textwrap
from gsl import lines, generate
def js_string(s):
return json.dumps(s, ensure_ascii=False)
def generate_code(model, root='.'):
for mod in model.modules:
generate_block_module_code(model, mod, root)
generate_generator_module_code(model, mod, root)
... | Python | 0 | @@ -4859,16 +4859,42 @@
de = '';
+%0A // TODO generate code
%22%22%22)%0A
|
4be7f694220ee969683f07b982f8fcbe61971a04 | Add comment to explain the length of the scripts taken into account in DuplicateScripts | hairball/plugins/duplicate.py | hairball/plugins/duplicate.py | """This module provides plugins for basic duplicate code detection."""
from hairball.plugins import HairballPlugin
class DuplicateScripts(HairballPlugin):
"""Plugin that keeps track of which scripts have been
used more than once whithin a project."""
def __init__(self):
super(DuplicateScripts, ... | Python | 0 | @@ -767,16 +767,80 @@
plugin.
+%0A Only takes into account scripts with more than 3 blocks
%22%22%22%0A
|
091445f20eca624112ab0660791b5858e268080d | add missing Ap_rst | hdl_toolkit/interfaces/all.py | hdl_toolkit/interfaces/all.py | from hdl_toolkit.interfaces.std import BramPort, \
BramPort_withoutClk, Ap_hs, Ap_clk, Ap_rst_n, Ap_none, Ap_vld
from hdl_toolkit.interfaces.amba import Axi4, Axi4_xil, \
AxiLite, AxiLite_xil, AxiStream, AxiStream_withoutSTRB, AxiStream_withUserAndStrb, AxiStream_withUserAndNoStrb
allInterfaces ... | Python | 0.998841 | @@ -123,16 +123,29 @@
, Ap_vld
+,%5C%0A Ap_rst
%0Afrom hd
@@ -506,32 +506,40 @@
Ap_hs, Ap_clk,
+ Ap_rst,
Ap_rst_n, Ap_vl
|
014bf9d6112af6ac062156d3b8032a8f08e12ba3 | Remove i18n import from loguserdata.py | heat/cloudinit/loguserdata.py | heat/cloudinit/loguserdata.py | #!/usr/bin/env python
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Python | 0 | @@ -729,75 +729,8 @@
ys%0A%0A
-from heat.common.i18n import _LE%0Afrom heat.common.i18n import _LI%0A%0A
%0AVAR
@@ -1714,20 +1714,16 @@
G.error(
-_LE(
'Userdat
@@ -1748,25 +1748,24 @@
cutable: %25s'
-)
, ex)%0A
@@ -1822,20 +1822,16 @@
G.error(
-_LE(
'OS erro
@@ -1845,33 +1845,32 @@
ng userdata: %25s'
-)
... |
f117580efce5f82ad7ecadbdb553ef186beae0d9 | Use correct actions for StackResource | heat/engine/stack_resource.py | heat/engine/stack_resource.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicab... | Python | 0.000053 | @@ -3293,16 +3293,24 @@
on=self.
+_nested.
CREATE)%0A
@@ -5440,16 +5440,24 @@
on=self.
+_nested.
SUSPEND,
@@ -6254,16 +6254,24 @@
on=self.
+_nested.
RESUME,%0A
|
15996286496d913c25290362ba2dba2d349bd5f6 | Fix bug of invoking /bin/sh on several OSs | imageManagerUtils/settings.py | imageManagerUtils/settings.py | # Copyright (c) 2017, MIT Licensed, Medicine Yeh
# This file helps to read settings from bash script into os.environ
import os
import sys
import subprocess
# This path is the location of the caller script
MAIN_SCRIPT_PATH = os.path.dirname(os.path.abspath(sys.argv[0]))
# Set up the path to settings.sh
settings_path ... | Python | 0 | @@ -612,16 +612,40 @@
ell=True
+, executable='/bin/bash'
)%0A# Tran
|
44514aa5d70af10a14fd90a77fe57d7af01d538e | add automated email workflow improvements: 1) don't use extra_models, now renamed to queries 2) use new date_filter construct where appropriate | attendee_tournaments/automated_emails.py | attendee_tournaments/automated_emails.py | from attendee_tournaments import *
AutomatedEmail.extra_models[AttendeeTournament] = lambda session: session.query(AttendeeTournament).all()
AutomatedEmail(AttendeeTournament, 'Your tournament application has been received', 'tournament_app_received.txt',
lambda app: app.status == c.NEW)
AutomatedEmai... | Python | 0.000139 | @@ -48,19 +48,14 @@
ail.
-extra_model
+querie
s%5BAt
|
1470dbdcea1d9754a5b7b7557cd73f5ae621dddc | Add a `min_pool` function. | flax/linen/pooling.py | flax/linen/pooling.py | # Copyright 2021 The Flax 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 wri... | Python | 0.999944 | @@ -4166,20 +4166,761 @@
padding)%0A return y%0A
+%0A%0Adef min_pool(inputs, window_shape, strides=None, padding=%22VALID%22):%0A %22%22%22Pools the input by taking the minimum of a window slice.%0A%0A Args:%0A inputs: Input data with dimensions (batch, window dims..., features).%0A window_shape: A shape tupl... |
fead22592dfe644cb1684888ed8d8b422b1fb101 | Update views.py | fngs/analyze/views.py | fngs/analyze/views.py | from django.http import HttpResponse, Http404
from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from .models import Submission
from .forms import SubmissionFor... | Python | 0 | @@ -2299,10 +2299,8 @@
%22 %3E
-&!
%22 +
|
5a46276585aaaae76f00095b7166a4ddf52ad335 | fix log formatting (#2427) | azurelinuxagent/common/osutil/systemd.py | azurelinuxagent/common/osutil/systemd.py | #
# Copyright 2018 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | Python | 0 | @@ -2479,18 +2479,24 @@
of %7B1%7D%22
-,
+.format(
property
@@ -2516,33 +2516,9 @@
ame)
- # pylint: disable=W0715
+)
%0A
|
6df2e34b43f1fa35217741972e069c4e0005783c | Fix get_{current,previous}_sha | freight/models/app.py | freight/models/app.py | from __future__ import absolute_import
from datetime import datetime
from sqlalchemy import Column, DateTime, ForeignKey, Integer, String
from sqlalchemy.schema import Index
from freight.config import db
from freight.db.types.json import JSONEncodedDict
DEFAULT_REF = 'master'
class App(db.Model):
"""
Examp... | Python | 0.002138 | @@ -2367,32 +2367,71 @@
).filter(%0A
+ Deploy.task_id == Task.id,%0A
Task
@@ -2943,32 +2943,71 @@
).filter(%0A
+ Deploy.task_id == Task.id,%0A
Task
|
bcd1e5124efda816ff60b79112a99e19f6846960 | clean the test-build | benchbuild/projects/benchbuild/python.py | benchbuild/projects/benchbuild/python.py | from benchbuild.project import wrap
from benchbuild.projects.benchbuild.group import BenchBuildGroup
from benchbuild.utils.compiler import lt_clang, lt_clang_cxx
from benchbuild.utils.downloader import Wget
from benchbuild.utils.run import run
from plumbum import local
from benchbuild.utils.cmd import make, tar
from ... | Python | 0.000029 | @@ -1300,14 +1300,8 @@
- exp =
wra
@@ -1413,34 +1413,8 @@
ake%5B
-%22TESTPYTHON=%22 + str(exp),
%22-i%22
|
5961b899446bd6c90d7fcc7840b9d746af6ef53a | add solr to timermiddleware | Allura/allura/lib/custom_middleware.py | Allura/allura/lib/custom_middleware.py | import os
import re
import logging
import tg
import pkg_resources
from paste import fileapp
from pylons.util import call_wsgi_application
from timermiddleware import Timer, TimerMiddleware
from webob import exc, Request
from allura.lib import helpers as h
log = logging.getLogger(__name__)
class StaticFilesMiddlewar... | Python | 0 | @@ -213,16 +213,30 @@
Request
+%0Aimport pysolr
%0A%0Afrom a
@@ -7303,26 +7303,103 @@
'generate'),%0A
+ Timer('solr', pysolr.Solr, 'add', 'delete', 'search', 'commit'),%0A
%5D%0A
|
0f673f5c3bb4fbeda582ad6b42933a36b1279186 | Remove wildcard import from test_dynd | blaze/compute/tests/test_dynd_compute.py | blaze/compute/tests/test_dynd_compute.py | from __future__ import absolute_import, division, print_function
import pytest
dynd = pytest.importorskip('dynd')
from dynd import nd
from blaze.compute.core import compute
from blaze.expr import *
from blaze.compute.dynd import *
def eq(a, b):
return nd.as_py(a) == nd.as_py(b)
n = symbol('n', '3 * 5 * int')
... | Python | 0 | @@ -182,21 +182,16 @@
laze
-.expr
import
*%0Afr
@@ -190,42 +190,14 @@
ort
-*%0Afrom blaze.compute.dynd import *
+symbol
%0A%0A%0Ad
|
b3ee16996ef331e98c3f6b5f664e07d17487d6d2 | Add missing log function. | Backend/scripts/data_prep/data_prep.py | Backend/scripts/data_prep/data_prep.py | # Copyright 2016 Matthias Petursson
# Robert Kjaran <robert@kjaran.com>
# Apache 2.0
import MySQLdb
import os
import sys
# mv out of script directory and do relative imports from server-interface.
newPath = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir, 'server-... | Python | 0.000002 | @@ -403,16 +403,37 @@
atabase%0A
+from util import log%0A
sys.path
|
79b81526e5961f02c43734f4bbdfc2f7a15b8de9 | Update mythril/analysis/modules/ether_thief.py | mythril/analysis/modules/ether_thief.py | mythril/analysis/modules/ether_thief.py | from mythril.analysis.ops import *
from mythril.analysis import solver
from mythril.analysis.analysis_utils import get_non_creator_constraints
from mythril.analysis.report import Issue
from mythril.analysis.swc_data import UNPROTECTED_ETHER_WITHDRAWAL
from mythril.analysis.modules.base import DetectionModule
from mythr... | Python | 0 | @@ -1189,19 +1189,13 @@
le:
-%22 + format(
+%25s%22,
self
@@ -1200,17 +1200,16 @@
lf.name)
-)
%0A
|
8cf8e7c968232fe999e4dfc20541be4ff96fcee1 | Add user-supplied arguments in log_handler | neutron/openstack/common/log_handler.py | neutron/openstack/common/log_handler.py | # Copyright 2013 IBM Corp.
#
# 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.002685 | @@ -594,16 +594,17 @@
icense.%0A
+%0A
import l
@@ -1092,10 +1092,19 @@
ord.
-msg
+getMessage()
))%0A
|
11b8f93078e7eb416f29fececc3ed8a6f6dff4cc | Add general tests for supervised FOMs | odl/contrib/fom/test/test_supervised.py | odl/contrib/fom/test/test_supervised.py | # Copyright 2014-2017 The ODL contributors
#
# This file is part of ODL.
#
# 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 https://mozilla.org/MPL/2.0/.
"""Tests for supervised FoMs."""
from __fut... | Python | 0 | @@ -537,17 +537,32 @@
_fixture
+, noise_element
%0A
-
%0Afft_imp
@@ -735,16 +735,17 @@
ftw')%5D)%0A
+%0A
space =
@@ -854,17 +854,1375 @@
, 1, 10)
-%5D
+,%0A odl.uniform_discr(%5B0, 0%5D, %5B1, 1%5D, %5B5, 5%5D)%5D)%0A%0Ascalar_fom = simple_fixture('FOM',%0A %5Bod... |
e5e7abc60a4cd8bd5e90bba9e66bcee32439ffec | Update docs | agar/auth.py | agar/auth.py | """
The ``agar.auth`` module contains classes, functions, and decorators to help secure a `webapp2.Requesthandler`_.
"""
from functools import wraps
from agar.config import Config
class AuthConfig(Config):
"""
:py:class:`~agar.config.Config` settings for the ``agar.auth`` library.
Settings are under the ... | Python | 0.000001 | @@ -3813,100 +3813,8 @@
%60_.%0A
- This decorator uses the :py:func:%60~agar.auth.https_authenticate%60 authenticate function.%0A
|
3c6d4a03ca6297cfbbb4a717784516adb5a545a3 | Update ppo.py | agent/ppo.py | agent/ppo.py | # coding: utf-8
import copy
import torch
import torch.optim as optim
from torch.autograd import Variable
from torch.distributions import Normal
from torch.utils.data import TensorDataset, DataLoader
from agent.core import Agent
from agent.replay_buffer import ReplayBuffer
from policy.shared import MLPPolicy
from poli... | Python | 0.000001 | @@ -307,34 +307,9 @@
licy
-%0Afrom policy.shared import
+,
CNN
|
b04b733032bb85778aae8c906e5dc3f5a6119ccc | clean up comments | api/route.py | api/route.py | from flask import Flask, make_response, jsonify, render_template, redirect, session, request, g, send_from_directory
from flask_login import LoginManager, login_user, login_required, logout_user, current_user
from passlib.hash import sha256_crypt
from api import app
from api.models import User, Group, App, Log, Invites... | Python | 0 | @@ -431,123 +431,45 @@
n %0A%0A
-%0A#-----------%0A#FUNCTIONS%0A#-----------%0A%0A#-----------%0A#STATIC VAL%0A#-----------%0A%0A# Provide methods%0A# mailing = Mailing
+#-----------%0A#STATIC VAL%0A#-----------
%0A%0A#R
|
29f5e0a9b3d441f4fbc31055e319da4f37d9f40b | add import_regulomedb.py | pergenie/lib/mongo/import_regulomedb.py | pergenie/lib/mongo/import_regulomedb.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import pymongo
path_to_23adnme_snps = '/Users/numa/Dropbox/py/perGENIE/pergenie/data/large_dbs/23andme-api/snps.data' # FIX to path of yours.
def import_23andme_snps():
print >>sys.stderr, 'Importing 23andMe SNPs...'
with pymongo.MongoClient() as c:... | Python | 0.000001 | @@ -75,28 +75,26 @@
path_to_
-23adnme_snps
+regulomedb
= '/Use
@@ -149,55 +149,53 @@
dbs/
-23andme-api/snps.data' # FIX to path of yours.
+regulomedb/RegulomeDB.dbSNP132.Category1.txt'
%0A%0A%0Ad
@@ -204,28 +204,26 @@
import_
-23andme_snps
+regulomedb
():%0A
@@ -257,20 +257,8 @@
ing
-23andMe SNPs
...'
@... |
a35d3b3f7ee1a35f1bc71aeb1482eb1a9c20f60c | fix if stuff | api/views.py | api/views.py | from api.serializers import *
from devices.models import *
from devicetypes.models import *
from network.models import *
from rest_framework import generics
from rest_framework.decorators import api_view
from rest_framework.views import APIView
from rest_framework.response import Response
import rest_framework.reverse
... | Python | 0.996347 | @@ -3070,16 +3070,51 @@
elif
+not request.POST%5B%22bookmarked%22%5D and
device.b
|
dcbeeffbc06b3497f07573d9b6d978067357fa7a | fix name shadow warning | api/views.py | api/views.py | import functools
from django.http import HttpResponse, JsonResponse
import lib.aur as aur
import manager.operation as operation
def make_api(require=None, optional=None, error_check=False, status=400):
if optional is None:
optional = []
if require is None:
require = []
def decorator(fun... | Python | 0.000002 | @@ -311,23 +311,16 @@
orator(f
-unction
):%0A
@@ -340,23 +340,16 @@
.wraps(f
-unction
)%0A
@@ -827,15 +827,8 @@
= f
-unction
(par
|
9548b436cf6d11b0d3217ab6771c129aaa25f2ad | remove cg 5 and 6 nodes from uswest | plugins/bongo/check-cgnode-mm-health.py | plugins/bongo/check-cgnode-mm-health.py | #!/usr/bin/env python
from optparse import OptionParser
import socket
import sys
import httplib
import json
PASS = 0
FAIL = 1
cgnodes = {}
cgnodes["east"] = ["prd-useast-choose-goose-01.prd.yb0t.cc",
"prd-useast-choose-goose-02.prd.yb0t.cc",
"prd-useast-choose-goose-03.prd.yb0t.cc... | Python | 0.000001 | @@ -740,128 +740,8 @@
.cc%22
-,%0A %22prd-uswest-choose-goose-05.prd.yb0t.cc%22,%0A %22prd-uswest-choose-goose-06.prd.yb0t.cc%22
%5D%0A%0Ad
|
38da9b42558d59b5858d18e5b2c9a26d5d8fd23b | Update email.py | app/email.py | app/email.py | from threading import Thread
from flask.ext.mail import Message
from flask import render_template, current_app
from . import mail
from .decorators import async
@async
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_... | Python | 0.000002 | @@ -795,33 +795,16 @@
ckname,
-%0A
current_
@@ -824,33 +824,16 @@
DMIN'%5D,
-%0A
%5Bfollowe
@@ -842,33 +842,16 @@
email%5D,
-%0A
render_t
@@ -889,24 +889,8 @@
t%22),
-%0A
ren
|
31c6228936cabb9fd2eb4a9962b1c44638a10fc3 | Fix lint errors | app/utils.py | app/utils.py | # -*- coding: utf-8 -*-
"""
app.utils
~~~~~~~~~
Provides misc utility functions
"""
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
import itertools as it
import requests
from json import dumps, loads, JSONEncoder
from ast import literal_eval
... | Python | 0.000396 | @@ -440,34 +440,8 @@
tial
-%0Afrom random import choice
%0A%0Afr
@@ -2978,41 +2978,8 @@
s'%5D%0A
- title = package%5B'title'%5D%0A
|
978e7efcb5b75995b05f5b51fe4ccffa45cc664c | Update views.py | app/views.py | app/views.py | from flask import render_template, flash, redirect, request, session
from app import app
import requests
import json
import time
import os
CLIENT_ID = os.environ['CLIENT_ID']
CLIENT_SECRET = os.environ['CLIENT_SECRET']
def error_healing(error_code):
if error_code == 1:
return 'Произошла не... | Python | 0 | @@ -4277,32 +4277,47 @@
ine_friends_info
+%5B'response'%5D%5B0%5D
%0D%0A params%5B'on
@@ -4354,24 +4354,39 @@
friends_info
+%5B'response'%5D%5B0%5D
%0D%0A params
|
f141e64b1b936a7f18d8873ebe86a0b29eba1e07 | Fix portfolio value and short sell transaction cost calculations | app/views.py | app/views.py | from __future__ import division
import os
import math
import time
from decimal import Decimal
from flask import render_template, g, request, session, send_from_directory
from app import app, db
from models import User, Stock, StockPrice, BasketItem, Terror
from forms import RegForm, LoginForm, TradeForm
@app.route(... | Python | 0 | @@ -1885,17 +1885,17 @@
imal(0.9
-8
+9
) * shor
@@ -4272,16 +4272,17 @@
_id%5D +=
+(
basket_i
@@ -4375,24 +4375,138 @@
.first().bid
+ + basket_item.qty * StockPrice.query.filter_by(stock_id=basket_item.stock_id, date=%222013-08-19%22).first().ask) / 2
%0A%0A # Stor
|
22ae4b9e0ce5c9d1ac37a2dc2d225c2855b7f9f1 | Save votes to redis | app/views.py | app/views.py | from flask import render_template, request
from app import app, babel
@babel.localeselector
def get_locale():
if hasattr(request, 'locale'):
if request.locale in app.config['LOCALES'] and request.locale:
return request.locale
else:
return request.accept_languages.best_match... | Python | 0 | @@ -1,12 +1,36 @@
+from uuid import uuid4%0A%0A
from flask i
@@ -59,16 +59,31 @@
request
+, make_response
%0Afrom ap
@@ -101,16 +101,23 @@
p, babel
+, redis
%0A%0A%0A@babe
@@ -495,21 +495,39 @@
e%0A re
-turn
+sponse = make_response(
render_t
@@ -551,91 +551,330 @@
ml')
-%0A%0A%0A@app.route('/poll', methods... |
7a22663a66749ef7f86a78575fb915b66ed02f73 | Update views to frontend | app/views.py | app/views.py | from app import app, tempchamber
from app.auth import google, whitelist_required, admin_required
from flask import request, url_for, redirect, flash, session, jsonify
chamber = tempchamber.TempChamber()
@app.route('/')
def home():
if 'google_token' in session:
me = google.get('userinfo')
return js... | Python | 0 | @@ -14,20 +14,16 @@
rt app,
-temp
chamber%0A
@@ -159,212 +159,95 @@
nify
-%0A%0Achamber = tempchamber.TempChamber()%0A%0A@app.route('/')%0Adef home():%0A if 'google_token' in session:%0A me = google.get('userinfo')%0A return jsonify(%7B%22data%22: me.data%7D)%0A return 'No user data'
+, render_t... |
32918348b9248df86d1c4ba2e2ee4b2175d95e2f | fix docstrings | InvenTree/common/test_notifications.py | InvenTree/common/test_notifications.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from common.notifications import NotificationMethod, SingleNotificationMethod, BulkNotificationMethod
from part.test_part import BaseNotificationIntegrationTest
class BaseNotificationTests(BaseNotificationIntegrationTest):
def test_NotificationMeth... | Python | 0.000101 | @@ -2686,33 +2686,42 @@
lf):%0A %22%22%22
-e
+%0A E
nsure the implem
@@ -2744,32 +2744,123 @@
ments are tested
+.%0A NotImplementedError needs to raise if the send_bulk() method is not set.%0A
%22%22%22%0A%0A cla
@@ -3236,33 +3236,42 @@
lf):%0A %22%22%22
-e
+%0A E
... |
8d57a87fdd798e395775027fa5df3d4d27778e9b | Use log scale for PCA explained variance analysis | asaph/pca.py | asaph/pca.py | """
Copyright 2017 Ronald J. Nowling
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, softw... | Python | 0 | @@ -1414,20 +1414,24 @@
plt.
-plot
+semilogy
(explain
@@ -1568,31 +1568,8 @@
16)%0A
- plt.ylim(%5B0., 1.%5D)%0A
|
e7722be3b0bcc7b793c811237cb9c6cdf7f1abd7 | Add import | automator.py | automator.py | #!/usr/bin/env python3
import sys
assert sys.version >= '3.3', 'Please use Python 3.3 or higher.'
import argparse
import logging
import os
import ssl
import json
import asyncio
import aiohttp
import aiohttp.server
from urllib.parse import urlparse, parse_qsl
from aiohttp.multidict import MultiDict
def constant_time... | Python | 0.000001 | @@ -492,16 +492,34 @@
t == 0%0A%0A
+import subprocess%0A
class Da
|
a31428a7bd18a1c9f551276b08b1334352fb552b | debug = false | OpenDataCatalog/settings_production.py | OpenDataCatalog/settings_production.py | import os
from settings import *
SITE_ROOT = ''
LOGIN_URL = SITE_ROOT + "/accounts/login/"
# Theme info
# LOCAL_STATICFILE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
# '../../ODC-overlay/static'))
# LOCAL_TEMPLATE_DIR = os.path.abspath(os.path.join(os.path.dirname(_... | Python | 0.999999 | @@ -1,15 +1,4 @@
-import os%0A%0A
from
@@ -17,16 +17,31 @@
port *%0A%0A
+DEBUG = False%0A%0A
SITE_ROO
@@ -666,25 +666,24 @@
%0AADMINS = (%0A
-
('Colin'
@@ -712,16 +712,16 @@
.com'),%0A
+
)%0ACONTAC
@@ -935,17 +935,16 @@
ERS = (%0A
-
('Co
@@ -977,16 +977,16 @@
.com'),%0A
+
)%0A%0ADATAB
@@ -1673,16 +... |
89ca2b6e871bfcf4391fed68c58311733c119bf3 | reorder loops to minimize variable transfers to Matlab | pywt/tests/test_matlab_compatibility.py | pywt/tests/test_matlab_compatibility.py | """
Test used to verify PyWavelets Discrete Wavelet Transform computation
accuracy against MathWorks Wavelet Toolbox.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_, dec, run_module_suite
import pywt
_has_matlab = False
try:
from pymatb... | Python | 0 | @@ -624,17 +624,16 @@
racy():%0A
-%0A
# li
@@ -919,102 +919,409 @@
-mlab.start()%0A try:%0A for pmode, mmode in modes:%0A for wavelet in wavelets:%0A
+rstate = np.random.RandomState(1234)%0A mlab.start()%0A try:%0A for wavelet in wavelets:%0A w = pywt.Wavelet(wav... |
89b73aa0e0c49060c07da49b3e6dba52249cfd6b | Add Shib auth to project page | qipr_approver/approver/views/project.py | qipr_approver/approver/views/project.py | import json
from django.shortcuts import render,redirect
from django.http import HttpResponse, Http404
from django.views.decorators.csrf import csrf_protect
from django.contrib.auth.models import User
from django.utils import timezone
from approver.models import Project
from approver.forms import AboutYouForm, Projec... | Python | 0 | @@ -211,28 +211,131 @@
ngo.
-utils import timezon
+contrib.auth.decorators import login_required%0Afrom django.utils import timezone%0Afrom django.core.urlresolvers import revers
e%0A%0Af
@@ -470,55 +470,8 @@
rud%0A
-from approver.decorators import login_required%0A
impo
@@ -539,53 +539,8 @@
tils
-%0Afrom django.c... |
7a6c48ac249f8741d3fa11886f7d2f9b1d4c0b40 | implement separate method 'get_url' | readthedocs/vcs_support/backends/svn.py | readthedocs/vcs_support/backends/svn.py | # -*- coding: utf-8 -*-
"""Subversion-related utilities."""
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import csv
from builtins import str
from six import StringIO # noqa
from readthedocs.projects.exceptions import RepositoryError
from readthedocs.vcs_su... | Python | 0.99841 | @@ -1692,20 +1692,19 @@
-base
+url
= self.
base
@@ -1703,164 +1703,41 @@
elf.
-base_url.rstrip('/')%0A tag = ''%0A if identifier:%0A tag = identifier.lstrip('/')%0A url = '%7B%7D/%7B%7D'.format(base, tag
+get_url(self.base_url, identifier
)%0A
@@ -3137,20 +31... |
f55a7bffd1cd6a75aa7e5151d4cd564826ab08b2 | Remove unused code | rollbar/contrib/starlette/middleware.py | rollbar/contrib/starlette/middleware.py | import logging
import sys
from starlette.requests import Request
from starlette.types import Receive, Scope, Send
import rollbar
from .requests import store_current_request
from rollbar.contrib.asgi import ASGIMiddleware
from rollbar.lib._async import RollbarAsyncError, try_report
log = logging.getLogger(__name__)
... | Python | 0.000006 | @@ -1,19 +1,4 @@
-import logging%0A
impo
@@ -267,43 +267,8 @@
rt%0A%0A
-log = logging.getLogger(__name__)%0A%0A
%0Acla
|
a0f03b293d726e5b5b2e2bcd4bb422386f5cc69b | fix --single not accepting task args | doit/cmd_run.py | doit/cmd_run.py | import sys
import codecs
from .exceptions import InvalidCommand
from .plugin import PluginDict
from .action import PythonAction
from .task import Stream
from .control import TaskControl
from .runner import Runner, MRunner, MThreadRunner
from .cmd_base import DoitCmdBase
from . import reporter
# verbosity
opt_verbosi... | Python | 0.000003 | @@ -5505,24 +5505,53 @@
ask_name in
+self.control._process_filter(
self.sel_tas
@@ -5552,16 +5552,17 @@
el_tasks
+)
:%0A
|
07a22bbbea0f98d44357f6ed9ca42371b855146d | use new CommandManager in form_Y | dumbo/form_Y.py | dumbo/form_Y.py | #!/usr/bin/env python
'''
This script is used to form the eigen decomposition needed for the DMD data.
Example usage:
python form_Y.py --S=MATMUL_OUT --Vt=SVD/Vt --Sigma=SVD/Sigma -o DMD
Use:
python form_Y.py --help
for more information on how to use the program.
S = U^TA^{(n)}
A^{(n-1)} = U*Sigma*V^t
Let S_tild... | Python | 0 | @@ -590,697 +590,154 @@
com%0A
-'''%0A%0Aimport os%0Aimport sys%0Aimport numpy%0Aimport subprocess%0Afrom optparse import OptionParser%0A%0A# print error messages and exit with failure%0Adef error(msg):%0A print msg%0A sys.exit(1)%0A%0A# simple wrapper around printing with verbose option%0Adef output(msg):%0A print... |
e93a87f451b1e2a11b0393fa8ed048f19203eafc | bump to 0.19.0 | dvc/__init__.py | dvc/__init__.py | """
DVC
----
Make your data science projects reproducible and shareable.
"""
import os
import warnings
VERSION_BASE = '0.18.15'
__version__ = VERSION_BASE
PACKAGEPATH = os.path.abspath(os.path.dirname(__file__))
HOMEPATH = os.path.dirname(PACKAGEPATH)
VERSIONPATH = os.path.join(PACKAGEPATH, 'version.py')
if os.path... | Python | 0.000004 | @@ -121,12 +121,11 @@
'0.1
-8.15
+9.0
'%0A__
|
f15437f30fc31d28ab4860ecdd7e89da010766b3 | version bump | dyn/__init__.py | dyn/__init__.py | # -*- coding: utf-8 -*-
"""This library provides an easily scriptable approach to accessing all of the
features provided by your Traffic Management (TM) or Message Management (MM)
services.
Requires Python 2.6 or higher, or the "simplejson" package.
"""
version_info = (1, 3, 10)
__name__ = 'dyn'
__doc__ =... | Python | 0.000001 | @@ -271,17 +271,17 @@
(1, 3, 1
-0
+1
)%0A__name
|
0abe6ce3c7998ddb1a218f11d429dd50166ee056 | Fix : Handle type errors on Batch operations | elevator/api.py | elevator/api.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import leveldb
import logging
from .utils.patterns import destructurate
from .constants import KEY_ERROR, TYPE_ERROR,\
VALUE_ERROR, RUNTIME_ERROR,\
SUCCESS_STATUS, FAILURE_STATUS, WARNING_STATUS,\
SIGNAL... | Python | 0 | @@ -5091,16 +5091,137 @@
...)%22%5D)%0A
+ except TypeError:%0A return (FAILURE_STATUS,%0A %5BTYPE_ERROR, %22Invalid type supplied%22%5D)%0A
|
8d1f5155555f2fb56db818132f5f59743dcf7e63 | change maximum listing value for errata in admin | errata/admin.py | errata/admin.py | import unicodecsv
from django.contrib import admin
from django.db import models
from django.forms import CheckboxSelectMultiple
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_protect
from django.http import HttpResponse
from django.utils.encoding import smart_str
fro... | Python | 0 | @@ -652,16 +652,71 @@
Admin):%0A
+ list_max_show_all = 10000%0A list_per_page = 200%0A%0A
fiel
|
beeecf4000d2554f90470e5e1357b03eb48d1bd4 | Fix English | evdev/events.py | evdev/events.py | # encoding: utf-8
'''
This module provides the :class:`InputEvent` class, which closely
resembles the ``input_event`` struct defined in ``linux/input.h``:
.. code-block:: c
struct input_event {
struct timeval time;
__u16 type;
__u16 code;
__s32 value;
};
This module also defi... | Python | 0.999999 | @@ -2713,16 +2713,17 @@
ent of a
+n
event c
@@ -5372,74 +5372,8 @@
ent.
- Synchronization events are used as%0A markers to separate event.
Use
@@ -5396,20 +5396,16 @@
separate
-%0A
events.
@@ -5418,16 +5418,20 @@
s may be
+%0A
separat
@@ -5466,20 +5466,16 @@
as with
-%0A
the mul
|
4ee58acb7e9a35be0514d1a4189fbc6c4a53baa5 | update http example | example/http.py | example/http.py | import csp
from twisted.web.client import getPage
def request(url):
return csp.channelify(getPage(url))
def main():
def timeout_channel(seconds):
c = csp.Channel()
def _t():
yield csp.wait(seconds)
yield c.put(None)
csp.go(_t())
return c
c = requ... | Python | 0 | @@ -72,326 +72,675 @@
-return
+channel =
csp.
-c
+C
hannel
-ify(getPage(url))%0A%0A%0Adef main():%0A def timeout_channel(seconds):%0A
+(1)%0A def ok(value):%0A csp.put_then_callback(channel, (value, None), csp.no_op)%0A def error(failure):%0A
-c =
+
csp.
-Channel()%0A def _t... |
32c35a39fa14aecf91747727ee8b54bb60027b48 | add function to parse fixer_io | exch/helpers.py | exch/helpers.py | Python | 0.999329 | @@ -0,0 +1,614 @@
+%22%22%22 helper functions to gather the currency rates %22%22%22%0A%0Afrom urllib.parse import urlencode%0Aimport requests%0Afrom decimal import Decimal, getcontext%0A%0Agetcontext().prec = 2%0A%0Adef fixer(base, target, value=1, date='latest'):%0A %22%22%22get currency exchange rate from fixer.i... | |
6f421c97a0b5d08c5d8d76330ddda89a4bb78a73 | Update seo_meta.py | src/checker/plugin/checkers/seo_meta.py | src/checker/plugin/checkers/seo_meta.py | from common import PluginType, getSoup
from yapsy.IPlugin import IPlugin
import logging
class MetaTagValidator(IPlugin):
category = PluginType.CHECKER
id = "seometa"
contentTypes = ["text/html"]
__defects = {"seo:multidsc": "Multiple description meta tags found",
"seo:nodsc": "No de... | Python | 0.000001 | @@ -496,9 +496,9 @@
= 0.
-8
+4
%0A%0A
|
48e4b347dcbef03efc889c227895c4f2b66e0838 | Improve test names. | analyzr/test/test_networkdiscoverer.py | analyzr/test/test_networkdiscoverer.py | import unittest
from analyzr.constants import topports
from analyzr.core import NetworkToolFacade, Fingerprinter
from analyzr.networkdiscoverer import NetworkDiscoverer
class NetworkToolMock(NetworkToolFacade):
pass
class FingerprinterMock(Fingerprinter):
pass
class InitConfig(unittest.TestCase):
def... | Python | 0.000006 | @@ -651,26 +651,27 @@
def test_
-wh
+giv
en_no_ports_
@@ -670,27 +670,34 @@
o_ports_
-give
+to_sca
n_then_
+uses_
default_
@@ -693,37 +693,32 @@
es_default_ports
-_used
(self):%0A
@@ -843,34 +843,35 @@
)%0A%0A def test_
-wh
+giv
en_config_does_n
@@ -868,37 +868,40 @@
fig_
-does_not_have_ports_ke... |
ca5587c878767b144ac355e15d80a163f44ae128 | Add command-line interface to eyes_wrapper.py | eyes_wrapper.py | eyes_wrapper.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
from applitools import _match_window_task
from applitools import errors
import applitools.eyes
from selenium.webdriver.remote import webdriver
applitools.eyes.Eyes.api_key = (
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
APP_NAME = 'app'
TEST_NAM... | Python | 0.000002 | @@ -40,16 +40,54 @@
-8 -*-%0A%0A
+from __future__ import print_function%0A
import o
@@ -92,16 +92,27 @@
os.path
+%0Aimport sys
%0A%0Afrom a
@@ -2778,22 +2778,24 @@
Matches
+an
image
-s
against
@@ -3478,133 +3478,1261 @@
def
-main():%0A test(r'C:%5CUsers%5CDCorbett%5CDesktop%5CApplitools%5CBaseline',
+_u... |
1bae18a57bbda31ff14b8689d0dfaa205596456b | Move setting of CALACCESS_WEBSITE_ENV before initial django db migration | fabfile/chef.py | fabfile/chef.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import collections
from app import migrate, collectstatic
from configure import ConfigTask, copyconfig
from fabric.api import sudo, task, env
from fabric.contrib.project import rsync_project
from fabric.colors import green
@task(task_class=ConfigTask)
def boot... | Python | 0 | @@ -614,69 +614,131 @@
#
-Fire up the Django project%0A migrate()%0A collectstatic()%0A
+Set the CALACCESS_WEBSITE_ENV var when the virtualenv is activated.%0A # Otherwise the Django project will default to DEV.
%0A
@@ -849,16 +849,88 @@
section)
+%0A %0A # Fire up the Django project%0A migra... |
0c30ef094371c6f1a42175379ce9cfc91a8529ed | fix snap unicode encoding | farmfs/keydb.py | farmfs/keydb.py | from farmfs.fs import Path
from farmfs.fs import ensure_dir
from farmfs.fs import ensure_file
from hashlib import md5
from json import loads, JSONEncoder
from errno import ENOENT as NoSuchFile
from errno import EISDIR as IsDirectory
from os.path import sep
from func_prototypes import typed, returned
@returned(str)
@ty... | Python | 0.000001 | @@ -756,21 +756,20 @@
value_
-bytes
+json
= JSONE
@@ -808,16 +808,90 @@
e(value)
+%0A if not isinstance(value_json, bytes):%0A value_json = value_json
.encode(
@@ -927,21 +927,20 @@
e(value_
-bytes
+json
, bytes)
@@ -972,21 +972,20 @@
m(value_
-bytes
+json
).encode
@@ -1092,21 +1092,20 @@
e(value_... |
6bfc59ada82d8e1013939bc10e601f29243da56f | Fix querying variable names | feedinlib/db.py | feedinlib/db.py | from itertools import chain
from pandas import to_datetime as tdt
from geoalchemy2.elements import WKTElement as WKTE
from sqlalchemy.orm import sessionmaker
import sqlalchemy as sqla
import oedialect
import openFRED as ofr
def defaultdb():
engine = getattr(defaultdb, "engine", None) or sqla.create_engine(
... | Python | 0 | @@ -3927,25 +3927,25 @@
v.name for
-r
+v
in session.
@@ -3950,23 +3950,18 @@
n.query(
-classes
+db
%5B%22Variab
|
ebf9c923388b8ea013785791b4c5031760987d4b | fix generate_process_flowchart | lbworkflow/views/flowchart.py | lbworkflow/views/flowchart.py | from django.http import HttpResponse
from django.template import Context
from django.template import Template
from lbworkflow.models import Process
try:
import pygraphviz as pgv
except ImportError:
pass
def generate_process_flowchart(process):
file_template = """
strict digraph {
... | Python | 0.000029 | @@ -399,20 +399,22 @@
abel=%22%7B%7B
+
name
+
%7D%7D%22%0A
@@ -626,16 +626,25 @@
on.input
+_activity
.name %7D%7D
@@ -669,16 +669,25 @@
n.output
+_activity
.name %7D%7D
@@ -736,16 +736,17 @@
me %7D%7D %7B%25
+
if trans
@@ -781,25 +781,20 @@
: %7B%25
+
endif
+
%25%7D
-flow_note
+%7B%7B
tra
@@ -82... |
30e7567ae6d8fe407b8360425ebcd46b4633a852 | Update fetchWeather.py | fetchWeather.py | fetchWeather.py | #!/usr/bin/python
import json, requests, commands
url='http://forecast.weather.gov/MapClick.php'
params = dict(
lat = 37.9752,
lon = -100.8642,
FcstType = 'json'
)
resp = requests.get(url=url, params=params)
data = json.loads(resp.text)
#weather=data['location']['areaDescription']+' Weather.... | Python | 0 | @@ -508,20 +508,16 @@
ut('
-pico2wave -w
+flite -o
/tm
|
7efbb0c4edbe572b03495c8403d56d2230dc97db | Tag new release: 3.1.14 | floo/version.py | floo/version.py | PLUGIN_VERSION = '3.1.13'
# The line above is auto-generated by tag_release.py. Do not change it manually.
try:
from .common import shared as G
assert G
except ImportError:
from common import shared as G
G.__VERSION__ = '0.11'
G.__PLUGIN_VERSION__ = PLUGIN_VERSION
| Python | 0 | @@ -16,17 +16,17 @@
= '3.1.1
-3
+4
'%0A# The
|
805fc09e8274ac46f635989d9115cd2c3011363f | Add the title in the file name. | pod/dlpod.py | pod/dlpod.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# 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 witho... | Python | 0.000006 | @@ -1952,16 +1952,51 @@
.keys())
+%0A item_title = item%5B'title'%5D
%0A%0A
@@ -2219,133 +2219,635 @@
-1%5D%0A
- file_name = ''.join(c for c in file_name if (c.isalnum() or c in %22.-_%22)) # remove special char in file_name
+%0A file_name, file_extension = os.path.splite... |
7c8a91efa6f71625611ff7b8855de104158b644e | Fix test | fuel_test/ci.py | fuel_test/ci.py | import logging
import traceback
import devops
from devops.model import Environment, Network, Node, Disk, Interface
from devops.helpers import tcp_ping, wait, ssh, http_server, os
from root import root
logger = logging.getLogger('ci')
class Ci:
hostname = 'nailgun'
domain = 'mirantis.com'
def __init__(sel... | Python | 0.000004 | @@ -5872,16 +5872,62 @@
e(text)%0A
+ logger.info('Write config %25s' %25 text)%0A
|
11f90a5dbd4c6146d960eced1e0b8d0ce0052eed | Switch over to the time-periods.csv table. | gane-periods.py | gane-periods.py |
import csv
import datetime
import logging
from optparse import OptionParser
import sys
from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from pleiades.bulkup import secure, setup_cmfuid
from Products.PleiadesEntity.time import to_ad
root_logger = logging.getLogger()
root_logger.setLevel... | Python | 0.000001 | @@ -1490,16 +1490,20 @@
in rows
+%5B1:%5D
:%0A
@@ -1524,18 +1524,20 @@
- n,
title,
+ tid,
sta
@@ -1574,55 +1574,8 @@
row%0A
- tid = utils.normalizeString(title)%0A
|
bf868291475361048092ecd392f4923da11d4043 | switch to just casting to bytearray | gb/cartridge.py | gb/cartridge.py | import six
from six.moves import xrange
from gb.mem import *
ROM_TYPE_BYTE = 0x147
class CartridgeError(Exception):
"""Base exception for this module."""
pass
class RegistrationError(CartridgeError):
"""Error raised when a cartridge tries to register itself with an illegal state."""
pass
class CartridgeMet... | Python | 0 | @@ -1732,32 +1732,322 @@
dge%0A else:%0A
+ # 2/3: convert to bytearry to ensure uniform indexing. Could also use%0A # six.indexbytes, but that doesn't work on existing bytearrays, so we would still%0A # need a conversion, and we might as well use python builtins if we can.%0A romstring... |
173c3448791bf3be42769e13b5c27d3573e082af | Modify some plots | gefry3/plots.py | gefry3/plots.py | import numpy as np
import seaborn as sb
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from mpl_toolkits.mplot3d import Axes3D
import mpl_toolkits.mplot3d.art3d as art3d
__all__ = ["render_patches", "set_bounds", "plot_response", "plot_hist_results"]
def build_patches(p, **patchargs):
so... | Python | 0.000003 | @@ -1805,16 +1805,48 @@
ze, bins
+, draw_loc=True, draw_mean=False
):%0A #
@@ -2134,24 +2134,47 @@
y (m)%22)%0A%0A
+ if draw_loc:%0A #
g.ax_joint.
@@ -2237,24 +2237,30 @@
pha=0.5)%0A
+ #
g.ax_joint.
@@ -2321,24 +2321,126 @@
alpha=0.5)%0A%0A
+ g.ax_joint.scatter(%5Bsource_loc%5B0%5D%5... |
2b3839d638d6256f7f4e0752f8d68c80e9f86eb3 | set svn propset to make generate_xml.py executable | generate_xml.py | generate_xml.py | #!/usr/bin/env python
import os
import re
import sys
import glob
import optparse
import platform
import tempfile
__version__ = '0.1.0'
REASONABLE_DEFAULTS = {
'epsg':'900913', # default osm2pgsql import srid
'world_boundaries':'world_boundaries', # relative path
'symbols':'symbols', # relativ... | Python | 0.000003 | |
8fd6d943c73a5d9772b598923893d6501a4ed343 | Bump minor build | ggd/__init__.py | ggd/__init__.py | __version__ = "0.0.8"
| Python | 0 | @@ -16,7 +16,7 @@
0.0.
-8
+9
%22%0A
|
9d217417e0d1b452476f2b35d5ce8dd5843f25fa | fix some bug | docker_registry/drivers/mos.py | docker_registry/drivers/mos.py | # -*- coding: utf-8 -*-
"""
docker_registry.drivers.mos
~~~~~~~~~~~~~~~~~~~~~~~~~~
mos is Open Storage Service provided by huawei.com
see detail http://www.hwclouds.com/
"""
import os
import logging
from com.hws.s3.client.hwawei_s3 import HuaweiS3
from com.hws.s3.models.s3object import S3Object
from docker_registry.c... | Python | 0.000004 | @@ -217,17 +217,17 @@
client.h
-w
+u
awei_s3
@@ -325,18 +325,18 @@
import d
-i
r
+i
ver%0Afrom
@@ -466,18 +466,18 @@
torage(d
-i
r
+i
ver.Base
@@ -563,27 +563,26 @@
config.
+mos_
access
-_key_
id%0A
@@ -616,30 +616,26 @@
config.
-secret
+mos
_access
-_
key%0A
@@ -662,25 +662,31 @@
config.
-i... |
5197d53d9b5ba14918ca31631517e1323d53b685 | add stats vilable choices | goals/models.py | goals/models.py | from django.db import models
from django.contrib.postgres.fields import HStoreField
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilters import slugify
class Goal(models.Model):
code = models.CharField(_('Goal number'), max_length=10,
unique=True)... | Python | 0 | @@ -183,16 +183,31 @@
slugify
+, truncatechars
%0A%0A%0Aclass
@@ -1827,24 +1827,65 @@
, blank=True
+,%0A choices=STATS_AVAILABLE_CHOICES
)%0A data_s
@@ -2455,24 +2455,75 @@
return
+'%25s : %25s' %5C%0A %25(self.code, truncatechars(
self.descrip
@@ -2526,16 +2526,22 @@
cription
+, 50))... |
c027e671d1a47d485755b748f2dffc202c704ff8 | Update goodreads API to `show original_publication_year` | goodreadsapi.py | goodreadsapi.py | #!/usr/bin/env python
import re
from xml.parsers.expat import ExpatError
import requests
import xmltodict
from settings import goodreads_api_key
def get_goodreads_ids(comment_msg):
# receives goodreads url
# returns the id using regex
regex = r'goodreads.com/book/show/(\d+)'
return set(re.findall(r... | Python | 0 | @@ -767,28 +767,8 @@
ges'
-, 'publication_year'
%5D%0A
@@ -833,16 +833,227 @@
.get(k)%0A
+ try:%0A work = book_data%5B'work'%5D%0A book%5B'publication_year'%5D = work%5B'original_publication_year'%5D%5B'#text'%5D%0A except KeyError:%0A book%5B'publication_year'%5D = book_data.get('public... |
3d60db6c43ef08b6bfda0206b9af9adc68911da1 | Add ValueError into realtime. | grs/realtime.py | grs/realtime.py | # -*- coding: utf-8 -*-
''' Get TWSE real time data. '''
# From http://github.com/toomore/tw-stock
# Copyright (c) 2012 Toomore Chiang, http://toomore.net/
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# i... | Python | 0 | @@ -4892,16 +4892,17 @@
except
+(
IndexErr
@@ -4899,24 +4899,37 @@
(IndexError
+, ValueError)
:%0A
|
59b015bb3e45497b7ec86bf1799e8442a30b65da | Exit method. - (New) Added exit method. | py/PMUtil.py | py/PMUtil.py | # PMUtil.py
# Phenotype microarray utility functions
#
# Author: Daniel A Cuevas
# Created on 27 Jan. 2015
# Updated on 27 Jan. 2015
from __future__ import absolute_import, division, print_function
import sys
import time
import datetime
def timeStamp():
'''Return time stamp'''
t = time.time()
fmt = '[%Y-... | Python | 0 | @@ -89,25 +89,24 @@
ed on 27 Jan
-.
2015%0A# Upda
@@ -117,14 +117,13 @@
on 2
-7 Jan.
+0 Aug
201
@@ -530,8 +530,73 @@
flush()%0A
+%0A%0Adef exitScript(num=1):%0A '''Exit script'''%0A sys.exit(num)%0A
|
a8976ff1c3bdc177ca72becf48c4278f963d2627 | Add Publications class to initialisation | gtr/__init__.py | gtr/__init__.py | __all__ = [
"gtr.services.funds.Funds",
"gtr.services.organisations.Organisations",
"gtr.services.persons.Persons",
"gtr.services.projects.Projects"
]
__version__ = "0.1.0"
from gtr.services.base import _Service
from gtr.services.funds import Funds
from gtr.services.organisations import Organisations
f... | Python | 0 | @@ -157,16 +157,62 @@
rojects%22
+,%0A %22gtr.services.publications.Publications%22
%0A%5D%0A__ver
@@ -442,8 +442,59 @@
rojects%0A
+from gtr.services.publications import Publications%0A
|
2f3a9847425e1dbbf13ac5172518d6f2d05228c4 | Make QubesMemoryError inherit from QubesVMError | qubes/exc.py | qubes/exc.py | #
# The Qubes OS Project, https://www.qubes-os.org/
#
# Copyright (C) 2015 Joanna Rutkowska <joanna@invisiblethingslab.com>
# Copyright (C) 2015 Wojtek Porczyk <woju@invisiblethingslab.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#... | Python | 0 | @@ -5483,25 +5483,23 @@
or(Qubes
-Exception
+VMError
, Memory
|
fb33d854e71d355d6e493fdf0e8ce56636ff679b | Improve log formating | reactobus.py | reactobus.py | #!/usr/bin/python3
import argparse
import itertools
import logging
import signal
import sys
import yaml
from lib.core import Core
FORMAT = "%(asctime)-15s %(levelname)s %(name)s %(message)s"
LOG = logging.getLogger("ROB")
def configure_logger(log_file, level):
if level == "ERROR":
LOG.setLevel(logging... | Python | 0.000003 | @@ -160,24 +160,25 @@
%25(levelname)
+7
s %25(name)s %25
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.