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 |
|---|---|---|---|---|---|---|---|
a638655b922bc4afe09fedcd1125642dedd32d4b | Fix purchase_delivery_split_date stock move in waiting | purchase_delivery_split_date/models/purchase.py | purchase_delivery_split_date/models/purchase.py | # Copyright 2014-2016 Numérigraphe SARL
# Copyright 2017 ForgeFlow, S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from itertools import groupby
from odoo import api, fields, models
class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"
@api.model
def _get_g... | Python | 0.000002 | @@ -4922,24 +4922,74 @@
= date_key%0A
+ move._action_assign()%0A
|
7029835d5a700db946012c69ad8900e69e03ca55 | no need return False | sale_order_confirm/wizard/add_order_version.py | sale_order_confirm/wizard/add_order_version.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2013-2014 Didotech SRL (info at didotech.com)
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the who... | Python | 0.999999 | @@ -2378,138 +2378,8 @@
)))%0A
- return False%0A%0A sale_order_obj.write(cr, uid, order.id, %7B'revision_note': reason_note%7D, context=context)
%0A
|
232bc2bb83190482c1125ca5879ffb6f11d67b40 | Fix logging for testing environment | puzzlehunt_server/settings/travis_settings.py | puzzlehunt_server/settings/travis_settings.py | from .base_settings import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
SECRET_KEY = '$1B&VUf$OdUEfMJXd40qdakA36@%2NE_41Dz9tFs6l=z4v_3P-'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'puzzlehunt_db',
'HOST': '127.0.0.1',
... | Python | 0.000002 | @@ -21,16 +21,26 @@
import *
+%0Aimport os
%0A%0A# SECU
@@ -504,8 +504,334 @@
= %5B'*'%5D%0A
+%0ALOGGING = %7B%0A 'version': 1,%0A 'disable_existing_loggers': False,%0A 'handlers': %7B%0A 'console': %7B%0A 'class': 'logging.StreamHandler',%0A %7D,%0A %7D,%0A 'loggers': %7B%0A ... |
f3e0c0a9503da25e7bfed12215765254b2d6cb83 | Add objtrees.Primitive.of_enum | py/garage/garage/asyncs/messaging/objtrees.py | py/garage/garage/asyncs/messaging/objtrees.py | """
Schema for object trees that may translate an object tree to composition
of dict and list (this operation is called lower) and translate it back
to object tree (which is called higher).
You may use this as an intermediate layer between your domain object and
network presentation (say, JSON).
"""
__all__ = [
#... | Python | 0.000258 | @@ -5781,16 +5781,355 @@
igher)%0A%0A
+ @classmethod%0A def of_enum(cls, enum_type):%0A%0A def lower(member):%0A if not isinstance(member, enum_type):%0A raise ValueError('not member of %25r: %25r' %25 (enum_type, member))%0A return member.value%0A%0A def higher... |
cc911a308e70637b491943d8d4ff3531f30b0880 | Set beta_features to True. | py/testdir_single_jvm/rf_VA_simple_example.py | py/testdir_single_jvm/rf_VA_simple_example.py | import sys
import json
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_import as h2i
#
# This is intended to be the simplest possible RF example.
# Look at sandbox/commands.log for REST API requests to H2O.
#
print "--------------------------------------------------------------------------------"
print "... | Python | 0.000018 | @@ -623,20 +623,19 @@
tures =
-Fals
+Tru
e%0A%0A%0Aprin
|
380bfc2be3ae7f1fc20637d899aab60140cc77e3 | add logging | python/cleanup_old_files/cleanup_old_files.py | python/cleanup_old_files/cleanup_old_files.py | # -*- coding: utf-8 -*-
#!/usr/bin/python
##-------------------------------------------------------------------
## @copyright 2017 DennyZhang.com
## Licensed under MIT
## https://raw.githubusercontent.com/DennyZhang/devops_public/master/LICENSE
##
## File : cleanup_old_files.py
## Author : Denny <denny@dennyzhang.com... | Python | 0.000001 | @@ -1488,27 +1488,126 @@
re%0A%0A
-# TODO: add logging
+import logging%0Alog_file = %22/var/log/cleanup_old_files.log%22%0A%0Alogging.basicConfig(filename=log_file,level=logging.DEBUG)
%0A%0Ade
@@ -3210,24 +3210,25 @@
-print %22W
+logging.w
arning
-:
+(%22
%25d d
@@ -3253,24 +3253,25 @@
working_dir)
+)
%0A... |
51f714c8e8f1198f65d6003c7026200e5d0f239d | Remove conf record from game spider for not working correctly. Will add it back later when it is needed/fixed | scrapy_espn/scrapy_espn/spiders/game_spider.py | scrapy_espn/scrapy_espn/spiders/game_spider.py | import scrapy
class GameSpider(scrapy.Spider):
name = "game"
def __init__(self, game='', *args, **kwargs):
super(GameSpider, self).__init__(*args, **kwargs)
self.start_urls = ['http://www.espn.com/mens-college-basketball/game?gameId=%(game)s' % {'game': game}]
def parse(self, response):
# line is in terms ... | Python | 0 | @@ -2491,24 +2491,25 @@
ct()%5B1%5D,%0A%09%09%09
+#
'home_conf_r
@@ -2844,24 +2844,25 @@
ct()%5B0%5D,%0A%09%09%09
+#
'away_conf_r
|
31c3b93cddcc29bb2c0f1261583ce66b7f6ebc2d | Add home opener check to game crawler | scrapy_espn/scrapy_espn/spiders/game_spider.py | scrapy_espn/scrapy_espn/spiders/game_spider.py | import scrapy
from __future__ import division
class GameSpider(scrapy.Spider):
name = "game"
def __init__(self, game='', *args, **kwargs):
super(GameSpider, self).__init__(*args, **kwargs)
self.start_urls = ['http://www.espn.com/mens-college-basketball/game?gameId=%(game)s' % {'game': game}]
def parse(self, r... | Python | 0 | @@ -1404,16 +1404,129 @@
losses%0A%0A
+%09%09# home opener check%0A%09%09if home_wins + home_losses == 0:%0A%09%09%09first_game = %22true%22%0A%09%09else:%0A%09%09%09first_game = %22false%22%0A%0A
%0A%09%09# hom
@@ -3812,24 +3812,53 @@
home_score,%0A
+%09%09%09'first_game': first_game,%0A
%09%09%09# 'home_r
|
6646e681501deb8aac55cdc69a8a351ec058e989 | Fix performance regression in CSPLayout pass (#5514) | qiskit/transpiler/passes/layout/csp_layout.py | qiskit/transpiler/passes/layout/csp_layout.py | # This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | Python | 0.000011 | @@ -4620,16 +4620,20 @@
edges =
+set(
self.cou
@@ -4653,16 +4653,17 @@
_edges()
+)
%0A%0A
|
dd66c117b938e2a908a915f6da3b1483bf7a9054 | Improve help plugin | will/plugins/help/help.py | will/plugins/help/help.py | from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template
class HelpPlugin(WillPlugin):
@respond_to("^help$")
def help(self, message):
"""help: the normal help you're reading."""
# help_data = self.load("help_files")
... | Python | 0.000001 | @@ -174,16 +174,36 @@
o(%22%5Ehelp
+(?: (?P%3Cplugin%3E.*))?
$%22)%0A
@@ -224,16 +224,29 @@
message
+, plugin=None
):%0A
@@ -341,24 +341,43 @@
es%22)%0A
+ selected_modules =
help_module
@@ -482,16 +482,17 @@
essage)%0A
+%0A
@@ -534,16 +534,240 @@
to do:%22
+%0A if plugin and ... |
6ce5a8d1a2ea881592a264b7597536cddf07a00d | Fix a bug in check_secret | web/problems/models.py | web/problems/models.py | import json
from django.core.exceptions import ValidationError
from django.db import models
def shorten(s, max_length=50):
if len(s) < max_length:
return s
else:
return u'{0}...'.format(s[:50])
def is_json_string_list(s):
try:
val = json.loads(s)
except ValueError:
ra... | Python | 0.00001 | @@ -1805,13 +1805,13 @@
1, (
-s2, i
+i, s2
) in
|
3be48c5cded149186e63dfb37b58c95a45a1636c | Update FW Version for the 2020 Palisade (#22245) | selfdrive/debug/hyundai_enable_radar_points.py | selfdrive/debug/hyundai_enable_radar_points.py | #!/usr/bin/env python3
"""Some Hyundai radars can be reconfigured to output (debug) radar points on bus 1.
Reconfiguration is done over UDS by reading/writing to 0x0142 using the Read/Write Data By Identifier
endpoints (0x22 & 0x2E). This script checks your radar firmware version against a list of known
firmware versi... | Python | 0 | @@ -1498,77 +1498,8 @@
%0A #
- TODO: verify palisade fw version for diagnostic session type 7%0A # #
202
@@ -1510,18 +1510,16 @@
LISADE%0A
- #
b%22LX2_
@@ -1554,21 +1554,33 @@
10-S8100
-
+%5Cx19%5Cx05%5Cx02%5Cx16V
%22: %7B
@@ -1581,18 +1581,16 @@
%22: %7B%0A
- #
%22defa
@@ -1633,20 +1633,18... |
124a8c90a0af420cdfc01d5170e34c52be7c0b78 | italicize the p in p-value | server/scripts/reports/epi/NtpEpiAniResults.py | server/scripts/reports/epi/NtpEpiAniResults.py | from ..utils import TableMaker, DOCXReport
class NtpEpiAniResults(DOCXReport):
def build_res_tbl(self, caption, studies):
colWidths = [1.5, 1.5, 1.5, 1.0, 1.0, 1.0, 2.5]
styles = {
"title": "RoCTabletitle",
"header": "RoCColumnheading",
"body": "RoCTablebody",... | Python | 0.999999 | @@ -2757,64 +2757,261 @@
-txt = u%22Trend-test p-value: %7B%7D%22.format(res%5B%22trendTest%22%5D)
+runs = %5B%0A tbl.new_run(%22Trend-test %22, newline=False),%0A tbl.new_run(%22p%22, i=True, newline=False),%0A tbl.new_run(%22-value: %7B%7D%22.... |
c4d1ad1e4b170e8e7e562f05623c6b0a96abae63 | modify params transfer mode in test_snapshot_manage | tempest/api/volume/admin/test_snapshot_manage.py | tempest/api/volume/admin/test_snapshot_manage.py | # Copyright 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Python | 0.000253 | @@ -2561,15 +2561,10 @@
ue,
-params=
+**
para
|
ec79afeb0373e0155840bef4dcb84020bcc46542 | Fix bug in read_write_artifact_cache. | src/python/twitter/pants/cache/read_write_artifact_cache.py | src/python/twitter/pants/cache/read_write_artifact_cache.py | from twitter.pants.cache.artifact_cache import ArtifactCache
class ReadWriteArtifactCache(ArtifactCache):
"""An artifact cache that delegates to one cache for reading and another for writing.
The name is slightly misleading: all caches are read-write. But I couldn't think
of a better one.
"""
def __init__(... | Python | 0.000001 | @@ -466,86 +466,551 @@
root
+s
=
-read_artifact_cache.artifact_root%0A if write_artifact_cache.artifact_root
+%5B%5D%0A logs = %5B%5D%0A def get_root_and_log(cache):%0A if cache is not None:%0A artifact_roots.append(cache.artifact_root)%0A logs.append(cache.log)%0A get_root_and_log(re... |
18d8f09795de8e7315f4f5fc63f0e7caf23bfaa4 | Refactor cleanse_csv_data | src/python/datapreprocessor/datapreprocessor/csvcleanser.py | src/python/datapreprocessor/datapreprocessor/csvcleanser.py | UNWANTED_SPECIAL_CHARS = "".join([
'\xb1', '\xb2'
])
def is_row_empty(row):
return not any(row)
def remove_empty_lines(rows):
return [row for row in rows if not is_row_empty(row)]
def remove_excess_columns_from_row(row):
return row[:4]
def remove_empty_columns(rows):
return [remove_excess_co... | Python | 0 | @@ -117,729 +117,257 @@
ve_e
-mpty_lines(rows):%0A return %5Brow for row in rows if not is_row_empty(row)%5D%0A%0A%0Adef remove_excess_columns_from_row(row):%0A return row%5B:4%5D%0A%0A%0Adef remove_empty_columns(rows):%0A return %5Bremove_excess_columns_from_row(row) for row in rows%5D%0A%0A%0Adef remove_ext... |
0b8df69fca199de202b8e901f28d561661b89e6a | Change run_file to use sqlplus | api/migration.py | api/migration.py | import os
import re
from os import getcwd
from sys import path
from os.path import join, dirname
from api import db
def get_filenames(dirname):
files = os.listdir(dirname)
files = filter(lambda x: x.endswith("sql"), files)
files = [file.split(".")[0] for file in files]
return sorted(files)... | Python | 0.000001 | @@ -115,18 +115,35 @@
ort db%0D%0A
+import subprocess
%0D%0A
-
%0D%0Adef ge
@@ -391,426 +391,238 @@
-file = open(join(getcwd(), dirname, filename + '.sql'))%0D%0A %0D%0A sql = file.read()%0D%0A sqls = sql.split(';')%0D%0A%0D%0A connection = db.connection()%0D%0A cursor = connection.cursor()%0D%0... |
7682cb4ab70d86a1958d18509666b02c0d6e35be | Raise ValueError if regexp is invalid | abusehelper/core/rules/atoms.py | abusehelper/core/rules/atoms.py | from __future__ import absolute_import, unicode_literals
import re
from . import core
from . import iprange
from . import _domainname
class Atom(core.Matcher):
def match(self, value):
return False
class String(Atom):
def init(self, value):
Atom.init(self)
self._value = unicode(val... | Python | 0.009042 | @@ -1611,16 +1611,33 @@
else 0)%0A
+ try:%0A
@@ -1677,16 +1677,86 @@
, flags)
+%0A except re.error as error:%0A raise ValueError(error)
%0A%0A de
|
98c898daa62d401701069c54bf80d986219a09a0 | Fix the crash when there is no organization yet | accounting/apps/books/mixins.py | accounting/apps/books/mixins.py | from django.db.models.fields import FieldDoesNotExist
from django.views import generic
from .utils import organization_manager
class RestrictToSelectedOrganizationQuerySetMixin(object):
"""
To restrict objects to the current selected organization
"""
def get_restriction_filters(self):
# chec... | Python | 0.00052 | @@ -79,16 +79,106 @@
generic
+%0Afrom django.http import HttpResponseRedirect%0Afrom django.core.urlresolvers import reverse
%0A%0Afrom .
@@ -859,24 +859,299 @@
n queryset%0A%0A
+ def get(self, request, *args, **kwargs):%0A orga = organization_manager.get_selected_organization(request)%0A if orga i... |
15206298edfd988922654293e1c4cc91cd687044 | Revert [8799]. That wasn't ready for prime-time yet -- thanks, git-svn! | tests/regressiontests/datatypes/models.py | tests/regressiontests/datatypes/models.py | """
This is a basic model to test saving and loading boolean and date-related
types, which in the past were problematic for some database backends.
"""
from django.db import models
from django.conf import settings
class Donut(models.Model):
name = models.CharField(max_length=100)
is_frosted = models.BooleanFi... | Python | 0.000533 | @@ -2330,275 +2330,8 @@
%5B%5D%0A%0A
-# TZ-aware datetimes (#8354).%0A%3E%3E%3E from django.utils import tzinfo%0A%3E%3E%3E dt = datetime.datetime(2008, 8, 31, 16, 20, tzinfo=tzinfo.FixedOffset(0))%0A%3E%3E%3E d = Donut(name='Bear claw', consumed_at=dt)%0A%3E%3E%3E d.save()%0A%3E%3E%3E Donut.objects.filter(consumed_at... |
6fa3421abce79b29390015428f5023e1a74d00d3 | add a way to get the NAOqi version | nao_driver/src/nao_driver/nao_driver_naoqi.py | nao_driver/src/nao_driver/nao_driver_naoqi.py | # Copyright 2009-2011 Armin Hornung, University of Freiburg
# http://www.ros.org/wiki/nao
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# # Redistributions of source code must retain the above copyright
# n... | Python | 0 | @@ -2535,16 +2535,147 @@
.pport%0A%0A
+%09%09# A distutils.version.LooseVersion that contains the current verssion of NAOqi we're connected to%0A%09%09self.__naoqi_version = None%0A%0A
%09def con
@@ -3354,12 +3354,903 @@
eturn proxy%0A
+%0A%09def getVersion(self):%0A%09%09%22%22%22%0A%09%09Returns the NAOqi version.... |
cdc0305ef6e8594da4a1d24c147ce91291703a4c | Implement ETL scripts for STD data - remove rate persistance | software/owh/backoffice/owh/etl/std/std_etl.py | software/owh/backoffice/owh/etl/std/std_etl.py | import os
from owh.etl.common.etl import ETL
import logging
from owh.etl.common.datafile_parser import DataFileParser
logger = logging.getLogger('std_etl')
class STDETL (ETL):
"""
Loads STD data into ES db
"""
def __init__(self, configFile):
ETL.__init__(self, configFile)
self.creat... | Python | 0 | @@ -2181,177 +2181,8 @@
0%0A%0A
- if(len(record %5B'rate'%5D) %3E 0):%0A record%5B'rate'%5D = float(record%5B'rate'%5D)%0A else:%0A record%5B'rate'%5D = 0.0%0A%0A
|
4fe2a35492715027f29c0aa548015d83495fa3ca | Fix unit tests | mediacrush/network.py | mediacrush/network.py | import json
from flask import request, current_app, redirect
from flaskext.bcrypt import generate_password_hash
def get_ip():
ip = request.remote_addr
if ip == '127.0.0.1' or ip == '127.0.0.2' and "X-Real-IP" in request.headers:
ip = request.headers.get("X-Real-IP")
return ip
def makeMask(n):
... | Python | 0.000005 | @@ -148,32 +148,33 @@
ote_addr%0A if
+(
ip == '127.0.0.1
@@ -195,16 +195,17 @@
7.0.0.2'
+)
and %22X-
@@ -861,50 +861,15 @@
if i
-p == '127.0.0.3' and not current_app.debug
+s_tor()
:%0A
@@ -874,22 +874,20 @@
-return
+ip =
'anonym
|
a5262acf8bd34d723cc9c0c1b054b3bd8a6e15aa | Fix scons builder | yasha/scons.py | yasha/scons.py | """
The MIT License (MIT)
Copyright (c) 2015-2017 Kim Blomqvist
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, ... | Python | 0.000003 | @@ -1910,17 +1910,21 @@
variable
-s
+-file
%22%5D%0A
@@ -2018,17 +2018,21 @@
xtension
-s
+-file
%22%5D%0A%0A
|
656aa635667e4a308652635c3ffe24aa65b725d2 | Fix paths | app/alpha/dqi.py | app/alpha/dqi.py | import collections
import itertools
import numpy
import pickle
## machine learning
from sklearn import svm, grid_search
## handling natural language
from liwc import liwc
_liwc = liwc.LIWC()
import nltk
import nltk.data
lemma = nltk.stem.wordnet.WordNetLemmatizer()
sent_detector = nltk.data.load('tokenizers/punkt/e... | Python | 0.000277 | @@ -1480,24 +1480,30 @@
load( open('
+alpha/
model.svm')
|
c01b294d8d7c070547b9eb981b6001581b33c7b4 | fix script path escaping on windows, refs #293 | libmproxy/script.py | libmproxy/script.py | from __future__ import absolute_import
import os, traceback, threading, shlex
from . import controller
class ScriptError(Exception):
pass
class ScriptContext:
def __init__(self, master):
self._master = master
def log(self, message, level="info"):
"""
Logs an event.
... | Python | 0 | @@ -1662,16 +1662,232 @@
mmand):%0A
+ if os.name == %22nt%22: # Windows: escape all backslashes in the path.%0A backslashes = shlex.split(command, posix=False)%5B0%5D.count(%22%5C%5C%22)%0A command = command.replace(%22%5C%5C%22, %22%5C%5C%5C%5C%22, backslashes)%0A
|
f5aefa41fdda6c1c00e448938df6e5714df37e02 | Implement fix | app/behaviour.py | app/behaviour.py | """ Runs the default behaviour, which performs two functions...
1. Output the signal information to the prompt.
2. Notify users when a threshold is crossed.
"""
import structlog
class Behaviour():
"""Default behaviour which gives users basic trading information.
"""
def __init__(self, behaviour_config, e... | Python | 0.00002 | @@ -2721,24 +2721,65 @@
rical_data:%0A
+ try:%0A
@@ -2904,32 +2904,36 @@
+
market_data%5Bexch
@@ -2958,24 +2958,28 @@
%5B'symbol'%5D,%0A
+
@@ -3040,32 +3040,36 @@
+
candle_period%0A
@@ -3090,33 +3090,370... |
74238c8cd3212dc363790de338997ed052691c70 | test #7 | wechat/wechat/views.py | wechat/wechat/views.py | from django.http import HttpResponse, HttpResponseBadRequest
from hashlib import sha1
from lxml import etree
import urllib.request
import json
def _make_get_request(url):
req = urllib.request.Request(url)
resp_json = urllib.request.urlopen(req).read().decode('utf-8')
resp = json.loads(resp_json)
retu... | Python | 0.000007 | @@ -1857,16 +1857,17 @@
tf-8'))%0A
+%0A
try:
@@ -1871,184 +1871,8 @@
ry:%0A
- from_name = tree.xpath('/xml/FromUserName')%5B0%5D.text%0A to_name = tree.xpath('/xml/ToUserName')%5B0%5D.text%0A create_time = tree.xpath('/xml/CreateTime')%5B0%5D.text%0A
@@ -1925,61 +1925,8 @@
ext%0A
- ... |
746859067357761e3b6e1d0e21acd26dd7787f94 | raise import error is better for debug | wechat_sdk/__init__.py | wechat_sdk/__init__.py | # -*- coding: utf-8 -*-
__all__ = ['WechatConf', 'WechatBasic', 'WechatExt']
try:
from wechat_sdk.core.conf import WechatConf
from wechat_sdk.basic import WechatBasic
from wechat_sdk.ext import WechatExt
except ImportError:
pass
| Python | 0.000001 | @@ -22,71 +22,8 @@
*-%0A%0A
-__all__ = %5B'WechatConf', 'WechatBasic', 'WechatExt'%5D%0A%0Atry:%0A
from
@@ -62,20 +62,16 @@
hatConf%0A
-
from wec
@@ -103,20 +103,16 @@
atBasic%0A
-
from wec
@@ -144,33 +144,58 @@
Ext%0A
-except ImportError:%0A pass
+%0A__all__ = %5B'WechatConf', 'WechatBasic', 'Wec... |
dacca68e52a42d64c7db71bdc4a20e93cb99d992 | Add parameter for docker URL | wharfie/cmd/builder.py | wharfie/cmd/builder.py | #!/usr/bin/env python
import sys
import docopt;
import docker;
import time;
"""Wharfie is a tool for building reproducable Docker images. Wharfie produces ready-to-run images by
injecting a user source into a docker image and /preparing/ a new Docker image which incorporates
the base image and built source, and is r... | Python | 0.000001 | @@ -494,24 +494,38 @@
t):%0A %22%22%22%0A
+ Wharfie.%0A%0A
Usage:%0A
@@ -613,16 +613,28 @@
=USERID%5D
+ %5B--url=URL%5D
%0A
@@ -686,16 +686,28 @@
emental%5D
+ %5B--url=URL%5D
%0A
@@ -1068,16 +1068,133 @@
d user.%0A
+ --url=URL Connect to docker at the specifi... |
a9ec15d87853ce7efc013b8ae14701a44095014b | remove old function | BlueprintNodeGraph/graph.py | BlueprintNodeGraph/graph.py | #!/usr/bin/python
from PySide import QtGui
from .node import Node
from .src import node_types
from .src.scene import NodeScene
from .src.viewer import NodeViewer
class NodeGraph(QtGui.QWidget):
def __init__(self, parent=None):
super(NodeGraph, self).__init__(parent)
self.setWindowTitle('Node Gra... | Python | 0.02446 | @@ -4306,1704 +4306,4 @@
es)%0A
-%0A def connect_node_to_node(self, from_node, from_port, to_node, to_port):%0A %22%22%22%0A Connects a node with a matching node name and port name to another%0A node with matching node name and port name.%0A%0A Args:%0A from_node (str): name o... |
e56441a76e53d44e8070a1c905b760663329fced | Fix missing match for plain minister label | wikidata/government.py | wikidata/government.py | import json
import logging
from typing import List
from wikidata import wikidata
logger = logging.getLogger(__name__)
class GovernmentMemberData:
def __init__(self):
self.position_name = ''
self.position = None
self.properties = []
self.wikidata_id = None
self.wikipedia_u... | Python | 0.998337 | @@ -3139,32 +3139,60 @@
dse minister' in
+ item_label or 'minister' ==
item_label:%0A
|
086cd2ee8d71c352415b077fe5fbda9d315229c8 | Add test | tests/cupy_tests/indexing_tests/test_indexing.py | tests/cupy_tests/indexing_tests/test_indexing.py | import unittest
import cupy
from cupy import testing
@testing.gpu
class TestIndexing(unittest.TestCase):
@testing.numpy_cupy_array_equal()
def test_take_by_scalar(self, xp):
a = testing.shaped_arange((2, 4, 3), xp)
return a.take(2, axis=1)
@testing.numpy_cupy_array_equal()
def test_... | Python | 0.000005 | @@ -824,16 +824,559 @@
ake(b)%0A%0A
+ @testing.numpy_cupy_array_equal()%0A def test_take_along_axis(self, xp):%0A a = testing.shaped_random((2, 4, 3), xp, dtype='float32')%0A b = testing.shaped_random((2, 6, 3), xp, dtype='int64', scale=4)%0A return xp.take_along_axis(a, b, axis=-2)%0A%0A ... |
f32ebe7e29d8d9e753d2be23eb0c09889a328c61 | fix generation of issue url | auto_changelog/repository.py | auto_changelog/repository.py | import re
from datetime import date
from hashlib import sha256
from typing import Dict, List, Tuple, Any, Optional
from urllib.parse import urljoin
from git import Repo, Commit, TagReference
from auto_changelog.domain_model import RepositoryInterface, Changelog
class GitRepository(RepositoryInterface):
def __in... | Python | 0.000003 | @@ -2485,16 +2485,22 @@
join(url
+ + '/'
, %22issue
@@ -2778,57 +2778,199 @@
-url = re.sub(r%22(git@%7Cssh@%7Chttps?://)(.*):(.*)%5C..*
+# 'https://github.com/Michael-F-Bryan/auto-changelog.git' -%3E 'https://github.com/Michael-F-Bryan/auto-changelog'%0A url = re.sub(r%22%5E(https%7Cgit)(:%5C/%5C/%7C@)(%... |
6bfd02fd83da14d045fc01d16783942b14c51825 | fix issue #11 | zinnia/ping.py | zinnia/ping.py | """Pings for Zinnia"""
import xmlrpclib
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
current_site = Site.objects.get_current()
site = 'http://%s' % current_site.domain
blog_url = ''
blog_feed = ''
class DirectoryPinger(object):
"""Pinger for Directories"""
def _... | Python | 0 | @@ -659,33 +659,26 @@
nia_
-feeds', args=%5B'latest', %5D
+entry_latest_feed'
))%0A%0A
|
dd343250ee44da8d354e4d3754aa8bc116763502 | add test for setting settings values via env vars | yotta/test/settings.py | yotta/test/settings.py | #!/usr/bin/env python
# Copyright 2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import unittest
import tempfile
import os
# validate, , validate various things, internal
from yotta.lib import settings
from yotta.lib.fsutils import ... | Python | 0 | @@ -202,16 +202,30 @@
mport os
+%0Aimport random
%0A%0A# vali
@@ -380,22 +380,43 @@
-def setUp(self
+@classmethod%0A def setUpClass(cls
):%0A
@@ -422,20 +422,19 @@
-self
+cls
.test_di
@@ -701,36 +701,35 @@
%5D%0A
-self
+cls
.filenames = %5B%5D%0A
@@ -773,20 +773,19 @@
-... |
0e97c7ae85a3eb50d044e8eaf0361b4a3b2c39f8 | Handle string type properly | ycml/transformers/text.py | ycml/transformers/text.py | __all__ = ['CounterHashingVectorizer', 'ListHashingVectorizer', 'ListCountVectorizer', 'ListNGramAnalyzer', 'ListTfidfVectorizer', 'SpaceTokenizerTransformer']
import logging
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.feature_... | Python | 0.000019 | @@ -844,16 +844,87 @@
ngrams =
+ %5Bint(ngram_range)%5D%0A elif isinstance(ngram_range, int): ngrams =
%5Bngram_
|
9c1165bebd92fcaa9e5e3d961027e4a86f8e75cd | Update Where_is_the_code.py | DLCode/Where_is_the_code.py | DLCode/Where_is_the_code.py | """
AiAi.care uses confidential Patient X-Ray data protected by HIPAA.
We we will publish the code on Github Public repo after a code-audit to make sure
no HIPAA / PII information is published accidentally.
In the meantime we are working off of a private repository. Sorry 😔
""""
| Python | 0.00043 | @@ -292,10 +292,9 @@
ry %F0%9F%98%94%0A%22%22%22
-%22
%0A
|
09a677e11c5abd0441181d13306927c3f3fce29b | Add is_failure to add_error | backslash/error_container.py | backslash/error_container.py | from sentinels import NOTHING
class ErrorContainer(object):
def add_error(self, message, exception_type=NOTHING, traceback=NOTHING, timestamp=NOTHING):
return self.client.api.call_function('add_error', {self._get_id_key(): self.id,
'message': mes... | Python | 0.001757 | @@ -149,16 +149,36 @@
=NOTHING
+, is_failure=NOTHING
):%0A
@@ -579,87 +579,294 @@
'
-timestamp': timestamp%0A %7D)
+is_failure': is_failure,%0A 'timestamp': timestamp%0A ... |
57e7985b3b804ebde68cef582ff588000682ede4 | Change to use the connection module instead of directly creating DB connections. | tracker/src/main/scripts/locate_pcawg_samples.py | tracker/src/main/scripts/locate_pcawg_samples.py | from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine
import os.path
import datetime
base_path = "/gnosdata/data/"
base_path_tcga = "/gnosdata/tcga/"
# Connect to the database and reflect the schema into python objects
Base = automap_base()
engine = cr... | Python | 0 | @@ -143,16 +143,52 @@
datetime
+%0Afrom tracker.util import connection
%0A%0Abase_p
@@ -251,254 +251,8 @@
/%22%0A%0A
-# Connect to the database and reflect the schema into python objects%0ABase = automap_base()%0Aengine = create_engine(%0A 'postgresql://pcawg_admin:pcawg@postgresql.service.consul:5432/germline_ge... |
3e8df6836f0508fb4c6cd1c4a9f2f39192a01cea | Add Cloud Code tags for API Explorer pilot (#282) | samples/snippets/translate_v3_translate_text.py | samples/snippets/translate_v3_translate_text.py | # Copyright 2020 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 or agreed to in writing, ... | Python | 0 | @@ -611,44 +611,241 @@
xt%5D%0A
-from google.cloud import translate%0A%0A
+# %5BSTART translate_v3_translate_text_0%5D%0A# Imports the Google Cloud Translation library%0Afrom google.cloud import translate%0A# %5BEND translate_v3_translate_text_0%5D%0A%0A%0A# %5BSTART translate_v3_translate_text_1%5D%0A# Initialize Tra... |
c1d2834c304c8c1194dbc15c89f1c24b56bb24a9 | Fix styling | trace_viewer/build/trace2html_unittest.py | trace_viewer/build/trace2html_unittest.py | # Copyright (c) 2014 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 unittest
import tempfile
import os
from trace_viewer.build import trace2html
class Trace2HTMLTests(unittest.TestCase):
def test_writeHTMLForTra... | Python | 0.000001 | @@ -497,32 +497,35 @@
+
'..', '..', 'tes
@@ -750,16 +750,33 @@
sToFile(
+%0A
%5Bbig_tra
|
044cff4fa82768a6c589278fae50379e88a4ba5a | Fix a DRF upgrade error. | base/apps/api/serializers.py | base/apps/api/serializers.py | from rest_framework import serializers
from base.apps.people.models import Group, Idol, Membership
class MembershipSerializer(serializers.ModelSerializer):
class Meta:
model = Membership
fields = ('id', 'group', 'idol', 'is_primary', 'started', 'ended', 'generation',
'is_leader', 'lea... | Python | 0 | @@ -1,12 +1,36 @@
+# -*- coding: utf-8 -*-%0A
from rest_fr
@@ -1861,24 +1861,40 @@
elatedField(
+read_only=True,
view_name='a
|
e46a57a9ab0b13a34aed7a81f12f004eda1b78e8 | add player name to dataframes for consolidating | basketballdatabase/player.py | basketballdatabase/player.py | from itertools import ifilter
from datetime import timedelta, datetime
import pandas as pd
import requests
from bs4 import BeautifulSoup
from common import throttled, relativeurl_to_absolute, get_backtobacks
from common import consolidate_dfs, search_player
from common import ParseError
####
minimum_update_interval... | Python | 0 | @@ -2454,16 +2454,52 @@
anced)%0A%0A
+ stats%5B'Player'%5D = self.name%0A
|
bf5c84e1b90f62ae07b008756814eea4886dbc59 | Handle exceptions in loading | loader/yggdrasil.py | loader/yggdrasil.py | import hashlib
import os
import requests
from gdn.mongo import db
from gdn.log import logger
class Yggdrasil():
def __init__(self, config):
self.config = config
self.id_cache = {}
def has_id(self, id):
if not id in self.id_cache:
result = db.items.find_one({'_id': id})
... | Python | 0.000001 | @@ -2494,27 +2494,199 @@
-item%5B'$load'%5D(path)
+try:%0A item%5B'$load'%5D(path)%0A except Exception as e:%0A logger.exception('An error occured while loading %25s, skipping...' %25 idlist)%0A return%0A
%0A
|
e38e18b8ab5ee90a1e5e0e77070ec07260687332 | Add more tests for Malayalam | epitran/test/test_malayalam.py | epitran/test/test_malayalam.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
import unicodedata
import epitran
class TestMalayalamGeneral(unittest.TestCase):
def setUp(self):
self.epi = epitran.Epitran(u'mal-Mlym')
def _assert_trans(self, src, tar):
trans = self.epi.transliterate(src)
... | Python | 0 | @@ -1236,73 +1236,667 @@
')%0A%0A
-%0A def test_phalam(self):%0A self._assert_trans('%E0%B4%AB%E0%B4%BE%E0%B5%BB', 'fa%CB%90n
+ def test_fan(self):%0A self._assert_trans('%E0%B4%AB%E0%B4%BE%E0%B5%BB', 'fa%CB%90n')%0A%0Aclass TestMalayalamDentalAlveolarNasalDisambiguation(unittest.TestCase):%0A d... |
fe676a041b793f55d33bfd27eb2b4fdfe7d93bb6 | Change import path for pricing | twilio/rest/resources/pricing/__init__.py | twilio/rest/resources/pricing/__init__.py | from .voice import (
Voice,
VoiceCountry,
VoiceCountries,
VoiceNumber,
VoiceNumbers,
)
from .phone_numbers import (
PhoneNumberCountries,
PhoneNumberCountry,
PhoneNumbers,
)
| Python | 0 | @@ -1,13 +1,32 @@
from
+twilio.rest.pricing
.voice i
@@ -29,24 +29,24 @@
ce import (%0A
-
Voice,%0A
@@ -125,16 +125,35 @@
)%0A%0Afrom
+twilio.rest.pricing
.phone_n
@@ -157,17 +157,16 @@
e_number
-s
import
@@ -213,24 +213,24 @@
berCountry,%0A
+
PhoneNum
@@ -228,17 +228,16 @@
PhoneNumber
-s
,%0A... |
e5752f52b067cd51093c566e6b5dde295f407ca8 | fix for oyster state query | billy/bin/oyster_versions.py | billy/bin/oyster_versions.py | #!/usr/bin/env python
import os
import sys
import json
import random
from billy import db
from billy.conf import settings, base_arg_parser
import scrapelib
import lxml.etree
from oyster.client import get_configured_client
def oysterize_versions(state, update_mins=20000):
oclient = get_configured_client()
new... | Python | 0.999666 | @@ -1674,32 +1674,41 @@
.tracked.find(%7B'
+metadata.
state': state,%0A
|
66c951d62b4203693d5c96eed4b3c7ccab381a71 | Remove unused code | cyder/cydns/search_utils.py | cyder/cydns/search_utils.py | from django.db.models import Q
from django.core.exceptions import ObjectDoesNotExist
def fqdn_search(fqdn, *args, **kwargs):
"""Find any records that have a name that is the provided fqdn. This
name would show up on the left hand side of a zone file and in a PTR's
case the right side.
:param fqdn: Th... | Python | 0.000006 | @@ -84,466 +84,8 @@
t%0A%0A%0A
-def fqdn_search(fqdn, *args, **kwargs):%0A %22%22%22Find any records that have a name that is the provided fqdn. This%0A name would show up on the left hand side of a zone file and in a PTR's%0A case the right side.%0A%0A :param fqdn: The name to search for.%0A :type fq... |
c6f6e7d723d0146671fcceb4232959cec67cf2b4 | Fix typo in automagic docstring | IPython/core/magics/auto.py | IPython/core/magics/auto.py | """Implementation of magic functions that control various automatic behaviors.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING... | Python | 0 | @@ -1384,17 +1384,16 @@
rguments
-l
toggles
|
b000a384c0e9e1adb94bb7460f3a27a6917d4393 | Add comments appropriately | blambda/utils/env_manager.py | blambda/utils/env_manager.py | """ env_manager.py
Uses pyenv and pyenv-virtualenv to programmatically manage python environments.
"""
import subprocess as sp
from collections import namedtuple
import concurrent.futures
import os
import sys
from termcolor import cprint
LambdaRuntime = namedtuple('LambdaRuntime', ('name', 'version', 'env_name'))
... | Python | 0.000001 | @@ -2983,32 +2983,72 @@
ts:
---upgrade require or not
+separate target lib for dependencies with conflicting namespaces
%0A
@@ -3878,32 +3878,120 @@
+ dep, 'blue')%0A
+ # Below code will execute only for libs with conflicting namespaces%0A
|
ef3797e8393fcaa03356e73bebb92a7f9d283cd7 | Bump version | dataproperty/__version__.py | dataproperty/__version__.py | __author__ = "Tsuyoshi Hombashi"
__copyright__ = f"Copyright 2016, {__author__}"
__license__ = "MIT License"
__version__ = "0.53.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| Python | 0 | @@ -124,9 +124,9 @@
%220.5
-3
+4
.0%22%0A
|
25e3b8686adbcfc7caa4e53362ebfebcacf80e46 | Fix typo bugs | Lib/ufo2fdk/makeotfParts.py | Lib/ufo2fdk/makeotfParts.py | import re
from kernFeatureWriter import KernFeatureWriter
from markFeatureWriter import MarkFeatureWriter
class MakeOTFPartsCompiler:
"""Creates an outline binary, and generates missing feature definitions."""
def __init__(self, font, path, outlineCompilerClass):
self.font = font
self.path =... | Python | 0.001469 | @@ -1918,12 +1918,14 @@
auto
-Tabl
+Featur
es.i
@@ -3604,21 +3604,21 @@
for a
-ccent
+nchor
in glyp
@@ -3620,21 +3620,21 @@
glyph.a
-ccent
+nchor
s:%0A
|
09e0bca18b553c9fde6f368bde577583856206ff | Fix typos in parameters tab | src/cutecoin/gui/informations_tab.py | src/cutecoin/gui/informations_tab.py | """
Created on 31 janv. 2015
@author: vit
"""
import logging
from PyQt5.QtWidgets import QWidget
from ..gen_resources.informations_tab_uic import Ui_InformationsTabWidget
class InformationsTabWidget(QWidget, Ui_InformationsTabWidget):
"""
classdocs
"""
def __init__(self, account, community):
... | Python | 0.000015 | @@ -2103,26 +2103,27 @@
wth
-(
+c =
UD(t)
- / (
+/%5B
M(t-1)/N
t))'
@@ -2122,11 +2122,12 @@
1)/N
+(
t)
-)
+%5D
'%0A
@@ -2906,19 +2906,27 @@
'Growth
-(c)
+parameter c
',%0A
|
a248dc23b19b3120fe94f3fcd22943d9230a9833 | Use `label_from_instance` in QuerySetSequenceSelectMixin | src/dal_queryset_sequence/widgets.py | src/dal_queryset_sequence/widgets.py | """
Widget mixin that only renders selected options with QuerySetSequence.
For details about why this is required, see :mod:`dal.widgets`.
"""
from dal.widgets import WidgetMixin
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.utils import six
class QuerySetSequenceS... | Python | 0 | @@ -280,19 +280,35 @@
tils
- import six
+.encoding import force_text
%0A%0A%0Ac
@@ -354,16 +354,16 @@
Mixin):%0A
-
%22%22%22S
@@ -406,16 +406,167 @@
in.%22%22%22%0A%0A
+ def label_from_instance(self, obj):%0A %22%22%22Convert an object into string. Override it to customize display.%22%22%22%0A ... |
3621ad16160797b843d56af82314cfeb339e6ce1 | Make tasks view able to filter by jobuuid. | src/dashboard/src/dashboard/views.py | src/dashboard/src/dashboard/views.py | from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.shortcuts import render_to_response
from django.http import HttpResponse, HttpResponseServerError, HttpResponseRedirect
from dashboard.contrib.mcp.client import ... | Python | 0 | @@ -1666,65 +1666,8 @@
):%0A%0A
- objects = Task.objects.all().order_by('-createdtime')%0A%0A
if
@@ -1692,25 +1692,39 @@
est.
-GE
+REQUES
T:%0A
+job = Job.
objects.
filt
@@ -1723,22 +1723,19 @@
cts.
-filter
+get
(jobuuid
=req
@@ -1734,17 +1734,19 @@
uuid
-=
+ =
request.
GET.
@@ -1745,10 +1745,14 @@
... |
cb9d06fa4200305441b37f971ab0f81a9735b433 | add local ip address detection to installer. | src/dashboard/src/installer/views.py | src/dashboard/src/installer/views.py | # This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the ... | Python | 0 | @@ -1173,16 +1173,30 @@
requests
+%0Aimport socket
%0A%0Adef we
|
3b5acf1a95a7c3499b299ca02a8871e4e4f9ef63 | Update static files path component | config/settings/base.py | config/settings/base.py | import environ
root_dir = environ.Path(__file__) - 3
project_dir = root_dir.path('shopify')
env = environ.Env()
env.read_env('.env')
DJANGO_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.con... | Python | 0 | @@ -2282,13 +2282,18 @@
ir('
-asset
+staticfile
s')%0A
|
8ae2cc2b14661b4509671fd59da23076b0d67166 | Fix old boto bug | app/upload_s3.py | app/upload_s3.py | #!/usr/local/bin/python2.7
import os
import hashlib
import gzip
import time
import datetime
from sys import argv
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from config import (AWS_KEY, AWS_SECRET_KEY, AWS_BUCKET, AWS_DIRECTORY,
HTML_EXPIRES, STATIC_EXPIRES, IGNORE_DIRECTORIES, IGNORE_F... | Python | 0.000069 | @@ -150,16 +150,39 @@
nnection
+, OrdinaryCallingFormat
%0Afrom bo
@@ -2508,16 +2508,55 @@
CRET_KEY
+,calling_format=OrdinaryCallingFormat()
)%0A my
|
228ad789af6d4798de943f8f0ac0dacb32838a89 | convert to Beautiful Soup | trunk/toolserver/public_html/cgi-bin/reflinks.py | trunk/toolserver/public_html/cgi-bin/reflinks.py | #!/usr/bin/python
#
# (C) Legoktm 2008-2009, MIT License
#
import cgitb; cgitb.enable()
import cgi, sys, urllib2, re, time
import monobook
print "Content-Type: text/html\n"
months = {
'1':'01',
'2':'02',
'3':'03',
'4':'04',
'5':'05',
'6':'06',
'7':'07',
'8':'08',
'9':'09',
'10':'10',
'11':'11',
'12':'12',... | Python | 0.999999 | @@ -592,492 +592,99 @@
e%0A%09%09
-text = check.read()%0A%09%09try:%0A%09%09%09title = re.findall('%3Ctitle%3E(.*)%3C/title%3E', text)%5B0%5D%0A%09%09%09print re.findall('%3Ctitle%3E(.*)%3C/title%3E', text)%0A%09%09except IndexError: #means that it couldn't find a title%0A%09%09%09#check for any level 1 headers, and t... |
4935e29ca571f40630afb1b376bcb5c2c7eec98f | Update Collin College | tx_salaries/utils/transformers/collin_college.py | tx_salaries/utils/transformers/collin_college.py | from . import base
from .. import cleaver
class TransformedRecord(base.BaseTransformedRecord):
MAP = {
'compensation': 'ANNUAL SALARY (HOURLY RATE FOR PT)',
'hire_date': 'CURRENT HIRE DATE',
'first_name': 'FIRST NAME',
'last_name': 'LAST NAME'
}
NAME_FIELDS = ('first_name'... | Python | 0 | @@ -1,12 +1,39 @@
+from datetime import date%0A%0A
from . impor
@@ -39,16 +39,38 @@
rt base%0A
+from . import mixins%0A%0A
from ..
@@ -136,16 +136,109 @@
edRecord
+, mixins.RaceMixin,%0A mixins.GenericCompensationMixin, mixins.LinkMixin
):%0A M
@@ -416,16 +416,50 @@
ST NAME'
+,%0A ... |
b8e0b03756ca09c7bf050f0af18917c1728cb463 | Fix import error and argument of Clip | tests/chainer_tests/functions_tests/math_tests/test_clip.py | tests/chainer_tests/functions_tests/math_tests/test_clip.py | import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product({
'shape': [(3, 2), ()],
'dtype': [numpy.float16, numpy.float32, ... | Python | 0 | @@ -199,16 +199,73 @@
rt attr%0A
+from chainer.functions.math.clip import (Clip, ClipGrad)%0A
%0A%0A@testi
@@ -3594,32 +3594,24 @@
Clip(
-self.x,
None, None)%0A
|
84bf3e6c7c3f4f7a541a089226305738ec3db764 | Revert change to "real" style | astropy/visualization/mpl_style.py | astropy/visualization/mpl_style.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
__doctest_requires__ = {'*': ['matplotlib']}
""" This module contains dictionaries that can be used to set a
matplotlib plotting style.
It is mostly here to allow a consistent plotting style in tutorials,
but can be used to prepare any matplotlib figure.... | Python | 0.00002 | @@ -1904,39 +1904,45 @@
': %5B
-%0A '#E24A33', # orange%0A
+'#348ABD', # blue%0A
@@ -1947,32 +1947,34 @@
'#
-348ABD
+7A68A6
', #
-blu
+purpl
e%0A
@@ -1975,37 +1975,25 @@
-'#467821', # green%0A
+
@@ -2019,38 +2019,71 @@
-'#7A68... |
6ecedb3cb090616f62760af7a5113a533bc62907 | Update dht11pluspihole.py | 16x2LCD/dht11pluspihole.py | 16x2LCD/dht11pluspihole.py | # A combination of both the DHT and pihole scripts
# Requires adafruit python DHT11, DHT22 Library. See other DHT script
# Bradley Gillap 2016
import lcddriver #Driver
import socket #For host and IP
import time #For general timers. Sleep etc.
import fcntl #For host and IP
import struct
import json #For... | Python | 0 | @@ -871,17 +871,16 @@
x first%0A
-%0A
pin = 26
@@ -1419,18 +1419,16 @@
le API%0A%0A
-%0A%0A
#INIT FU
@@ -1439,51 +1439,23 @@
ONS
-Let's kill some kittens with globals first.
+KILLING KITTENS
%0Adef
|
d6f70dddc7376e2193ee27778f184022dec4014e | Call the superclass tearDown in VolumeTest | tests/integration/volume_test.py | tests/integration/volume_test.py | from __future__ import absolute_import
from __future__ import unicode_literals
from docker.errors import DockerException
from .testcases import DockerClientTestCase
from compose.volume import Volume
class VolumeTest(DockerClientTestCase):
def setUp(self):
self.tmp_volumes = []
def tearDown(self):
... | Python | 0 | @@ -514,16 +514,59 @@
_volumes
+%0A super(VolumeTest, self).tearDown()
%0A%0A de
|
97d237dafa1f84e4707e392015d1889b69770bfb | add new version (#22363) | var/spack/repos/builtin/packages/py-scikit-image/package.py | var/spack/repos/builtin/packages/py-scikit-image/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyScikitImage(PythonPackage):
"""Image processing algorithms for SciPy, including IO, morp... | Python | 0 | @@ -488,16 +488,113 @@
ar.gz%22%0A%0A
+ version('0.18.1', sha256='fbb618ca911867bce45574c1639618cdfb5d94e207432b19bc19563d80d2f171')%0A
vers
@@ -952,27 +952,180 @@
n@3.
-6:', when='@0.16.1:
+7:', when='@0.18:', type=('build', 'link', 'run'))%0A depends_on('python@3.6:', when='@0.16.1:', type=('build', 'lin... |
e5061b4d5f1a8fc0c75262931e614f0414eb9502 | Disable failing test | tests/modules/test_brightness.py | tests/modules/test_brightness.py | # pylint: disable=C0103,C0111
import mock
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError
import tests.mocks as mocks
from bumblebee.config import Config
from bumblebee.input import W... | Python | 0 | @@ -1347,24 +1347,25 @@
ght -10%25%22)%0A%0A
+#
@mock.pa
@@ -1410,32 +1410,33 @@
', create=True)%0A
+#
def test_upd
@@ -1449,32 +1449,33 @@
lf, mock_open):%0A
+#
mock_ope
@@ -1492,16 +1492,17 @@
ect = %5B%0A
+#
@@ -1554,16 +1554,17 @@
_value,%0A
+#
@@ -1616,16 +1616,17 @@
n_... |
efb86601fc64b6a199916d55dde9c5fc762e7e3d | rename function to not define it duplicately | corehq/apps/api/urls.py | corehq/apps/api/urls.py | from django.conf.urls import include, url
from django.http import HttpResponseNotFound
from tastypie.api import Api
from corehq.apps.api import accounting
from corehq.apps.api.domain_metadata import (
DomainMetadataResource,
GIRResource,
MaltResource,
)
from corehq.apps.api.object_fetch_api import (
C... | Python | 0.000004 | @@ -5526,32 +5526,39 @@
source,%0A)%0A%0A%0Adef
+global_
api_url_patterns
@@ -5751,32 +5751,39 @@
patterns = list(
+global_
api_url_patterns
|
71b89ea569e7a6ac84ba5e45cbef2cfcd9679c79 | Make sure send_unknown_user_type_stats is never run in quick succession | corehq/pillows/tasks.py | corehq/pillows/tasks.py | from datetime import timedelta
from celery.schedules import crontab
from celery.task import periodic_task
from corehq.apps.es import FormES
from corehq.form_processor.interfaces.dbaccessors import FormAccessors
from corehq.form_processor.utils.xform import resave_form
from corehq.pillows.utils import get_user_type_de... | Python | 0 | @@ -440,16 +440,62 @@
al_task%0A
+from corehq.util.quickcache import quickcache%0A
%0A%0A@perio
@@ -532,24 +532,114 @@
inutes=10))%0A
+@quickcache(%5B%5D, timeout=9 * 60) # Protect from many runs after recovering from a backlog%0A
def send_unk
|
5fd7fd69538b5a19c5d112e0eed3f64d597c3b89 | Test case can't throw away windows, it needs shared context space to continue. XXX fix this in pyglet, ideally. | tests/resource/RES_LOAD_IMAGE.py | tests/resource/RES_LOAD_IMAGE.py | #!/usr/bin/python
# $Id:$
import os
import sys
import unittest
from pyglet.gl import *
from pyglet import image
from pyglet import resource
from pyglet import window
__noninteractive = True
# Test image is laid out
# M R
# B G
# In this test the image is sampled at four points from top-right cloc... | Python | 0 | @@ -613,24 +613,25 @@
):%0D%0A
+#
self.w.close
@@ -633,16 +633,30 @@
close()%0D
+%0A pass%0D
%0A%0D%0A d
|
a6d6ff81e8fc8f1c2cd80e8f33ea34e892bb8345 | remove json import | examples/oauth_auth_example.py | examples/oauth_auth_example.py | # Run with Python 3
import json
import requests
# 1. Get your keys at https://stepic.org/oauth2/applications/ (client type = confidential,
# authorization grant type = client credentials)
client_id = "..."
client_secret = "..."
# 2. Get a token
auth = requests.auth.HTTPBasicAuth(client_id, client_secret)
resp = reque... | Python | 0.000606 | @@ -17,20 +17,8 @@
n 3%0A
-import json%0A
impo
@@ -476,28 +476,18 @@
n =
-json.loads(resp.text
+resp.json(
)%5B'a
@@ -634,19 +634,8 @@
e =
-json.loads(
requ
@@ -701,12 +701,13 @@
n%7D).
-text
+json(
)%0A%0Ap
|
68a445b1ef4eaaa7af12c6b31a345703b07b45fc | fix bug when printing variables | script/d3build/environment/variable.py | script/d3build/environment/variable.py | from ..shell import escape
import sys
import io
class Var(object):
"""A build variable."""
__slots__ = ['name']
def __init__(self, name, doc):
self.name = name
def __get__(self, instance, owner):
if instance is None:
return self
try:
return instance.var... | Python | 0.000002 | @@ -2074,14 +2074,8 @@
in(i
-.posix
for
|
1dbc0ba0ab6b33d855e7ad455d115a43ead9dfa2 | Fix test_servlet_newrequest | tests/test_servlet_newrequest.py | tests/test_servlet_newrequest.py | from contextlib import nested
import mock
import urllib
from core import db
from core.util import get_servlet_urlspec
from servlets.newrequest import NewRequestServlet
import testing as T
class NewRequestServletTest(T.TestCase, T.ServletTestMixin):
def get_handlers(self):
return [get_servlet_urlspec(NewR... | Python | 0 | @@ -241,19 +241,36 @@
estMixin
+, T.FakeDataMixin
):%0A
-
%0A def
@@ -1015,16 +1015,24 @@
'
+request-
title':
@@ -1079,44 +1079,16 @@
'
-user': 'testuser',%0A '
+request-
tags
@@ -1130,16 +1130,22 @@
'
+request-
review
-id
': 1
@@ -1163,16 +1163,24 @@
'
+request-
repo'... |
1342ff4a6d95bea5b0396a3765a406a0504fc72c | Add test for get_receive_message() (#53) | tests/test_websocket_protocol.py | tests/test_websocket_protocol.py | from mach9.http import HttpProtocol
from mach9.websocket import WebSocketProtocol
from tests.utils import Transport
def test_accept_content():
http_protocol = HttpProtocol(loop=None, request_handler=None)
headers = [[b'foo', b'bar']]
websocket_protocol = WebSocketProtocol(http_protocol, headers)
conte... | Python | 0.000001 | @@ -868,16 +868,57 @@
'v1'%5D%5D)%0A
+ assert websocket_protocol.order == 0%0A
asse
@@ -962,16 +962,16 @@
onnect'%0A
-
asse
@@ -1218,16 +1218,57 @@
%5D == ''%0A
+ assert message%5B'path'%5D == '/foo/bar'%0A
asse
@@ -1394,16 +1394,16 @@
, 1234)%0A
-
asse
@@ -1446,8 +1446,897 @@
, 5678)%0A
... |
232ffb4ab0c2bc41b1dc31ffc04ebc0477897088 | Fix ssh_demo example | examples/ssh_demo/ssh_demo1.py | examples/ssh_demo/ssh_demo1.py | from pyinfra import config, host, inventory
from pyinfra.operations import files, server
config.SUDO = True
# update the /etc/hosts file
def update_hosts_file(name, ip):
name = name.replace("@vagrant/", "")
files.line(
name="Add hosts to /etc/hosts",
path="/etc/hosts",
line=r" {}.exam... | Python | 0.000004 | @@ -37,16 +37,65 @@
ventory%0A
+from pyinfra.facts.hardware import Ipv4Addresses%0A
from pyi
@@ -607,27 +607,30 @@
tem.
+get_
fact
-.ipv4_a
+(Ipv4A
ddresses
%5B%22et
@@ -625,16 +625,17 @@
ddresses
+)
%5B%22eth0%22%5D
|
29ab9203f36c16cf30d032a6c658745e1679d41e | raise Exception if the command is not available | custodian/qchem/jobs.py | custodian/qchem/jobs.py | #!/usr/bin/env python
"""
This module implements basic kinds of jobs for QChem runs.
"""
from __future__ import division
import os
from monty.io import zopen
import shutil
import copy
import subprocess
from custodian.custodian import Job, gzip_dir
__author__ = "Xiaohui Qu"
__version__ = "0.1"
__maintainer__ = "Xiaoh... | Python | 0.000001 | @@ -2720,19 +2720,74 @@
r
-eturn False
+aise Exception(%22Command mode %5C%22%22, cmd_name, %22%5C%22 is not available%22)
%0A
|
ed0067397b7cb04681620a07e7471d55a0568b31 | Complete sort sol | cw_are_they_the_same.py | cw_are_they_the_same.py | """Codewars: Are they the "same"?
6 kyu
URL: https://www.codewars.com/kata/550498447451fbbd7600041c
Given two arrays a and b write a function comp(a, b) (compSame(a, b) in Clojure)
that checks whether the two arrays have the "same" elements, with the same
multiplicities. "Same" means, here, that the elements in b are... | Python | 0.001866 | @@ -2248,16 +2248,222 @@
True%0A%0A%0A
+def comp_sort(a1, a2):%0A # Edge cases.%0A if a1 is None or a2 is None:%0A return False%0A%0A # Compare if sorted squared a1 matches sorted a2.%0A return sorted(%5Bx ** 2 for x in a1%5D) == sorted(a2)%0A%0A%0A
def main
@@ -2462,24 +2462,24 @@
def main():%0A... |
cb4b06a8bba28ce86d5a7a677d4c17fdbaf4d25e | Increment the numbers | dashmat/server/react.py | dashmat/server/react.py | """
Use Docker to create an instance of node that will transform jsx into javascript.
"""
from harpoon.option_spec.harpoon_specs import HarpoonSpec
from harpoon.option_spec.image_objs import Mount
from harpoon.executor import docker_context
from harpoon.ship.builder import Builder
from harpoon.ship.runner import Runne... | Python | 0.999999 | @@ -711,12 +711,11 @@
%22%5E6.
-3.17
+4.0
%22%0A
@@ -748,17 +748,17 @@
: %22%5E6.2.
-0
+1
%22%0A
@@ -991,17 +991,17 @@
%22%5E0.23.
-0
+1
%22%0A
@@ -1147,17 +1147,17 @@
%22%5E0.14.
-3
+6
%22%0A
@@ -1184,17 +1184,17 @@
%22%5E0.14.
-3
+6
%22%0A%0A
@@ -1220,17 +1220,18 @@
%22%5E1.12.... |
a0c1496a11c59fc96765386500062ee2a637db4b | Fix glob for S(a,b) tables. Thanks @smharper. | data/convert_mcnp_71.py | data/convert_mcnp_71.py | #!/usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser
from collections import defaultdict
import glob
import os
import openmc.data
# Get path to MCNP data
parser = ArgumentParser()
parser.add_argument('-d', '--destination', default='mcnp_endfb71',
help='... | Python | 0 | @@ -803,12 +803,8 @@
, '
-lwtr
*.2?
|
fcef0f77b06b212dae3a56624d0000b67f1edc02 | Fix spellings | simphony/testing/abc_check_material_relation.py | simphony/testing/abc_check_material_relation.py | import abc
from simphony.core.data_container import DataContainer
from simphony.testing.utils import create_data_container
class CheckMaterialRelation(object):
__metaclass__ = abc.ABCMeta
def setUp(self):
pass
@abc.abstractmethod
def get_name():
""" Returns the name of the tested r... | Python | 0.99989 | @@ -419,17 +419,17 @@
the kin
-f
+d
of the
@@ -1938,25 +1938,25 @@
that descri
-o
+p
tion is set
|
9704f43d2245f53ed5315a62db3eabb40aa3dad8 | use name method for querying | sis_provisioner/management/commands/__init__.py | sis_provisioner/management/commands/__init__.py | from django.core.management.base import BaseCommand, CommandError
from django.utils.timezone import utc
from sis_provisioner.models import Job
import datetime
import sys
class SISProvisionerCommand(BaseCommand):
def __init__(self, *args, **kwargs):
super(SISProvisionerCommand, self).__init__(*args, **kwar... | Python | 0.000001 | @@ -878,26 +878,36 @@
t(name=s
-ys.
+elf.name_from_
argv
-%5B1%5D
+()
)%0A
|
1defb8b79e4dc93547c8bc76519acd7b6484e82b | Improve help-text and maintain just one list of VALID_LABELS (#670) | sorl/thumbnail/management/commands/thumbnail.py | sorl/thumbnail/management/commands/thumbnail.py | import sys
from django.core.management.base import LabelCommand, CommandError
from sorl.thumbnail import default
from sorl.thumbnail.images import delete_all_thumbnails
class Command(LabelCommand):
help = (
'Handles thumbnails and key value store'
)
missing_args_message = 'Enter one of [cleanup,... | Python | 0 | @@ -5,16 +5,58 @@
rt sys%0A%0A
+from argparse import RawTextHelpFormatter%0A
from dja
@@ -208,16 +208,101 @@
nails%0A%0A%0A
+VALID_LABELS = %5B'cleanup', 'clear', 'clear_delete_referenced', 'clear_delete_all'%5D%0A%0A%0A
class Co
@@ -343,17 +343,17 @@
-'
+%22
Handles
@@ -370,17 +370,17 @@
and key
-
+... |
6ba48af8f9daa43330b2076fe2cc1403c337f368 | Remove unused imports | jet/templatetags/jet_tags.py | jet/templatetags/jet_tags.py | from distutils.version import StrictVersion
from django import template
import django
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.core.urlresolvers import reverse
from django.db.models import OneToOneField
from django.forms import CheckboxInput, ModelChoiceField, Select, M... | Python | 0.000001 | @@ -1,48 +1,4 @@
-from distutils.version import StrictVersion%0A
from
@@ -25,22 +25,8 @@
ate%0A
-import django%0A
from
@@ -299,53 +299,8 @@
ple%0A
-from django.utils.encoding import smart_text%0A
from
@@ -408,16 +408,16 @@
ettings%0A
+
from jet
@@ -463,64 +463,8 @@
ion%0A
-from django.utils.translation import u... |
bd44caf8007ca1d47f3170f1db76a050738e8f7e | change the rnn optimizer to adam | magpie/nn/models.py | magpie/nn/models.py | from keras.layers.convolutional import MaxPooling1D, Convolution1D
from keras.layers.core import Flatten, Dropout, Dense, Merge
from keras.layers.recurrent import GRU
from keras.models import Sequential
from magpie.feature_extraction import WORD2VEC_LENGTH
from magpie.nn.config import OUTPUT_UNITS, SAMPLE_LENGTH, NB_E... | Python | 0.999037 | @@ -2316,15 +2316,12 @@
er='
-rmsprop
+adam
',%0A
|
ffc86b7fd5ef152d5a00bbdfcab7b69cb26be180 | Update all drivers except XENIFACE | manifestspecific.py | manifestspecific.py | # Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of conditions a... | Python | 0 | @@ -1647,10 +1647,10 @@
git%5C
-69
+70
%5Cxen
@@ -1698,17 +1698,17 @@
hq.git%5C6
-7
+8
%5Cxenvif.
@@ -1752,17 +1752,17 @@
hq.git%5C4
-5
+6
%5Cxennet.
@@ -1867,17 +1867,17 @@
q.git%5C13
-5
+7
%5Cxenvbd.
|
c1907882050d131caf1aeb1b29bd8a36170d17da | debug loss | DLT2T/utils/modality.py | DLT2T/utils/modality.py | # coding=utf-8
# Copyright 2017 The DLT2T 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 ... | Python | 0.000001 | @@ -6779,16 +6779,17 @@
oss_den)
+)
, loss_d
@@ -6783,33 +6783,32 @@
den)), loss_den)
-)
%0A return %5Bs
|
ae14e9ba030540836d506f99e637d8e046b021bd | make from_dict also work with dict | mpcontribs/io/core/mpfile.py | mpcontribs/io/core/mpfile.py | from __future__ import unicode_literals, print_function
import six, codecs, locale
from abc import ABCMeta
from mpcontribs.config import mp_level01_titles, default_mpfile_path
from recdict import RecursiveDict
from utils import pandas_to_dict, nest_dict
class MPFileCore(six.with_metaclass(ABCMeta, object)):
"""Abs... | Python | 0 | @@ -1062,22 +1062,41 @@
-if not
+mpfile = cls()%0A if
isinsta
@@ -1137,71 +1137,77 @@
-raise ValueError('Need RecursiveDict to init MPFile.')%0A
+mpfile.document = data%0A elif isinstance(data, dict):%0A
mpfi
@@ -1206,53 +1206,137 @@
+
mpfile
- = cls()%0A mpf... |
7467e55ab7f2b82613fddd357fe7e39fb874bc04 | Add us-west-1 and ca-central-1 as starter clusters for log gathering | scripts/cicd/verify-gather-logs-operations.py | scripts/cicd/verify-gather-logs-operations.py | #!/usr/bin/python
'''
Validates command to gather logs from a cluster
Developer usage:
ssh -i log_gathering_key use-tower2.ops.rhcloud.com -- -c <clusterName> -u <kerberosID>
clusterName is checked against a list of known/valid cluster names.
kerberosID is the Kerberos ID of the developer requesting logs, for t... | Python | 0 | @@ -969,16 +969,44 @@
e-stg',%0A
+ 'starter-ca-central-1',%0A
'sta
@@ -1047,16 +1047,41 @@
ast-2',%0A
+ 'starter-us-west-1',%0A
'sta
|
f1e700461340884aa6af99abbbc9f352be66df4c | Handle more recent modifications than retraction | scripts/migration/migrate_retraction_dates.py | scripts/migration/migrate_retraction_dates.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to migrate retracted registrations so that their date modified is date of retraction."""
import sys
import logging
from modularodm import Q
from website.models import Node, NodeLog
from website.app import init_app
from scripts import utils as script_utils
from f... | Python | 0.000001 | @@ -647,16 +647,74 @@
ion_id)%0A
+ if registration.date_modified %3C log.date:%0A
@@ -755,16 +755,20 @@
og.date%0A
+
@@ -791,16 +791,20 @@
.save()%0A
+
@@ -875,16 +875,124 @@
.date))%0A
+ else:%0A logger.warning('Date modified is more re... |
f325d3cfa6ec44daac59064c45aa01d27c528633 | fix type case for assertion | server_common/test_modules/utilities_tests.py | server_common/test_modules/utilities_tests.py | import unittest
from server_common.utilities import create_pv_name
class TestCreatePVName(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_WHEN_pv_name_contains_whitespace_THEN_replace_whitespace_with_underscore(self):
# Act
pv = create_pv_name... | Python | 0.000034 | @@ -1450,20 +1450,20 @@
pv_02, %22
-peev
+PEEV
01%22)%0A
@@ -1497,12 +1497,12 @@
3, %22
-peev
+PEEV
02%22)
@@ -2941,28 +2941,29 @@
ssertEquals(pv_02, %22CONF01%22)
+%0A
|
e96cfcbb21dc2a6058e53ae8d35fdb2cbcbddaa4 | Fix number of new lines while bytecode modification | _pydevd_frame_eval/pydevd_modify_bytecode.py | _pydevd_frame_eval/pydevd_modify_bytecode.py | import dis
from types import CodeType
def _modify_code_arguments(original_code, insert_code, insert_code_obj, attr, op_list):
"""
Modify arguments for some code attributes. This function append values of the inserted code to the original values,
and changes indexes inside inserted code. So it helps to av... | Python | 0 | @@ -1252,16 +1252,35 @@
lnotab)%0A
+ abs_offset = 0%0A
for
@@ -1324,22 +1324,55 @@
-if new_list%5Bi%5D
+abs_offset += new_list%5Bi%5D%0A if abs_offset
==
|
c303813602585f2653ffcaac2df0866e5a91f1a7 | declare 'coda' as external_dependencies | account_statement_coda_import/__openerp__.py | account_statement_coda_import/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Laurent Mignon
# Copyright 2014 'ACSONE SA/NV'
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | Python | 0.001923 | @@ -2036,16 +2036,73 @@
ne.eu',%0A
+ 'external_dependencies': %7B%0A 'python': %5B'coda'%5D,%0A %7D,%0A
'init_x
|
39383281db5b2653cbf0fbca1470861bb47c19ad | omit the leading underscore for the find_center_by_center_of_mass | abel/tools/center.py | abel/tools/center.py | import numpy as np
from scipy.ndimage import center_of_mass
def _find_center_by_center_of_mass(data, verbose=True, **kwargs):
com = center_of_mass(data)
com_round = np.around(com)
if verbose:
print("Center of mass at ({0}, {1}) ... round to ({2}, {3})".format(com[1], com[0], com_round[1]... | Python | 0.999779 | @@ -57,33 +57,32 @@
f_mass%0D%0A%0D%0A%0D%0Adef
-_
find_center_by_c
@@ -389,17 +389,16 @@
%0D%0A%0D%0Adef
-_
find_cen
@@ -534,17 +534,16 @@
%22auto%22:
-_
find_cen
@@ -578,17 +578,16 @@
%22com%22:
-_
find_cen
|
3b1c6549c6f2430a61727fa8fb148632e654ddbc | fix b2g urls to force trailing slash | apps/b2g/urls.py | apps/b2g/urls.py | from django.conf.urls.defaults import *
from views import b2g, about, faq
urlpatterns = patterns('',
(r'^b2g/faq/', faq),
(r'^b2g/about/', about),
(r'^b2g/', b2g),
)
| Python | 0.000009 | @@ -111,16 +111,17 @@
b2g/faq/
+$
', faq),
@@ -139,16 +139,17 @@
g/about/
+$
', about
@@ -163,16 +163,17 @@
(r'%5Eb2g/
+$
', b2g),
|
180530aef72e7845131f1744220cbf2aaaaac809 | Remove flax optim test now that flax.optim is deprecated in favor of optax https://github.com/google/flax/issues/2273 | fedjax/core/optimizers_test.py | fedjax/core/optimizers_test.py | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -684,38 +684,8 @@
rs%0A%0A
-import flax%0Aimport flax.optim%0A
impo
@@ -1813,1464 +1813,8 @@
))%0A%0A
- def test_create_optimizer_from_flax(self):%0A%0A def create_optimizer_from_flax(opt_def, **hyper_param_overrides):%0A hyper_params = opt_def.update_hyper_params(**hyper_param_overrides)%0A%0A def ... |
8e3d49cf357b2e4f497789ecd7940a89ed88a11e | add 2018.05.001.rc1 and 2017.11.001 (#8512) | var/spack/repos/builtin/packages/elpa/package.py | var/spack/repos/builtin/packages/elpa/package.py | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | Python | 0 | @@ -1448,16 +1448,162 @@
ar.gz'%0A%0A
+ version('2018.05.001.rc1', 'ccd77bd8036988ee624f43c04992bcdd')%0A version('2017.11.001', '4a437be40cc966efb07aaab84c20cd6e', preferred=True)%0A
vers
@@ -1848,32 +1848,16 @@
8d8b376'
-, preferred=True
)%0A ve
|
e947a0b15224edc2932489f269f0da4d7376cad2 | Add info for lmod@7.7 and lmod@7.6.14 (#5450) | var/spack/repos/builtin/packages/lmod/package.py | var/spack/repos/builtin/packages/lmod/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | Python | 0 | @@ -1904,16 +1904,132 @@
ar.gz'%0A%0A
+ version('7.7', '8ac594401716c6d1b40cac22bc1030ca')%0A version('7.6.14', '60726c991038b6337fbb27b6a333a2d4')%0A
vers
|
0ea3ef6c16ea22a256b393433a0a593eb3fe063b | Remove coarse input validation until we can find a better solution | mediacrush/files.py | mediacrush/files.py | import mimetypes
import base64
import hashlib
import os
import tempfile
import requests
from flask import current_app
from mediacrush.config import _cfg
from mediacrush.database import r, _k
from mediacrush.objects import File
from mediacrush.ratelimit import rate_limit_exceeded, rate_limit_update
from mediacrush.net... | Python | 0.000001 | @@ -2191,16 +2191,17 @@
m%22%0A%0A
+#
if f.con
@@ -2260,24 +2260,25 @@
udio'%5D:%0A
+#
return %22
|
6f6c243699f6f29629d809fa3861f8c1bb5bbeca | update hash for 4.0.2 patch (#16937) | var/spack/repos/builtin/packages/mpfr/package.py | var/spack/repos/builtin/packages/mpfr/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Mpfr(AutotoolsPackage, GNUMirrorPackage):
"""The MPFR library is a C library for multiple-... | Python | 0 | @@ -1824,72 +1824,72 @@
': '
-8f15fd27ab65341a60d724d594897d32f4597ddf642d0dc121995e2150181b0c
+3f80b836948aa96f8d1cb9cc7f3f55973f19285482a96f9a4e1623d460bcccf0
',%0A
|
76fb477ddbbd944c1d228dd6b5a6147ca3e02362 | Remove log translations | mistralclient/i18n.py | mistralclient/i18n.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Python | 0.000001 | @@ -845,310 +845,4 @@
ary%0A
-%0A# Translators for log levels.%0A#%0A# The abbreviated names are meant to reflect the usual use of a short%0A# name like '_'. The %22L%22 is for %22log%22 and the other letter comes from%0A# the level.%0A_LI = _translators.log_info%0A_LW = _translators.log_warning%0A_LE = _translators.l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.