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 |
|---|---|---|---|---|---|---|---|
56150b1aef230cd7a7fb4cd8f44dd8884934d716 | set value for field expected_date in purchase.order | addons/purchase/report/purchase_report.py | addons/purchase/report/purchase_report.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | Python | 0 | @@ -4539,33 +4539,16 @@
-date_trunc('day',
s.minimu
@@ -4561,17 +4561,16 @@
ned_date
-)
as expe
@@ -6715,25 +6715,8 @@
-date_trunc('day',
s.mi
@@ -6733,17 +6733,16 @@
ned_date
-)
,%0A
|
708f916be9060d6df17f53ee0e4acc59fd742c9c | Add kwargs to websocket message constructor (#1328) | opsdroid/connector/websocket/__init__.py | opsdroid/connector/websocket/__init__.py | """A connector which allows websocket connections."""
import logging
import json
import uuid
from datetime import datetime
import aiohttp
import aiohttp.web
from aiohttp import WSCloseCode
from opsdroid.connector import Connector, register_event
from opsdroid.events import Message
_LOGGER = logging.getLogger(__name... | Python | 0 | @@ -3747,16 +3747,21 @@
Message(
+text=
msg.data
@@ -3766,20 +3766,42 @@
ta,
+user=
None,
-None,
+target=None, connector=
self
|
4b7e6d7df8a447873bc57adfedfb6013b915190c | Fix Node.namespace_uri for py3 | cio/node.py | cio/node.py | # coding=utf-8
from __future__ import unicode_literals
from .environment import env
from .utils.formatters import ContentFormatter
from .utils.uri import URI
import six
empty = object()
class Node(object):
_formatter = ContentFormatter()
def __init__(self, uri, content=None, **meta):
self.env = en... | Python | 0.000765 | @@ -1767,20 +1767,20 @@
return
-iter
+next
(%0A
@@ -1789,16 +1789,21 @@
+iter(
filter(l
@@ -1843,16 +1843,17 @@
lf._uri)
+)
%0A
@@ -1862,15 +1862,8 @@
)
-.next()
%0A
|
3a42b4458f85d8f2640c34fce79c9a99a79f5323 | Revert "add second db connection to coastdat" | calc_renpass_gis/scenario_reader/db.py | calc_renpass_gis/scenario_reader/db.py | # -*- coding: utf-8 -*-
from sqlalchemy import (Column, Float, ForeignKey, Integer, MetaData, String,
Table, join, create_engine, ForeignKeyConstraint,
Boolean, DateTime, Sequence)
from sqlalchemy.orm import sessionmaker, relationship, configure_mappers
# from sqlalchemy.... | Python | 0 | @@ -1110,484 +1110,8 @@
%22)%0A%0A
-%0A# establish second db connection to%0A# change of init file in .open_ego and Server connetion via ssh required%0Asection2 = 'Coastdat'%0Aconn2 = create_engine(%0A %22postgresql+psycopg2://%7Buser%7D:%7Bpassword%7D@%7Bhost%7D:%7Bport%7D/%7Bdb%7D%22.format(%0A user=cfg.g... |
14a7d5305a3e5dfc73834cb6164def4c0706e740 | Fix : cmdline GET output | cli/client.py | cli/client.py | # -*- coding: utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
from __future__ import absolute_import
import zmq
from elevator.constants import *
from .errors import *
from .message import Request, ResponseHeader, Response
class Client(object):
def __init__(self, *a... | Python | 0.000002 | @@ -1298,16 +1298,155 @@
return%0A%0A
+ def _format_response(self, req_cmd, res_datas):%0A if req_cmd == %22GET%22:%0A return res_datas%5B0%5D%0A return res_datas%0A%0A
def
@@ -2228,24 +2228,55 @@
return
+ self._format_response(command,
response.da
@@ -2274,13 +2274,14 @@
sp... |
900b37fee45db789b413d55b497d87992c3dab00 | Remove Welcome! Flash | bakery/gitauth/views.py | bakery/gitauth/views.py | # coding: utf-8
# Copyright 2013 The Font Bakery Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | Python | 0.000008 | @@ -3275,34 +3275,8 @@
ser%0A
- flash(_('Welcome!'))%0A%0A
|
49152781ecbfb4f51707e6e54641301038eba80f | set varchar length | king/DataPoint.py | king/DataPoint.py | from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, PickleType, Boolean, String, DateTime
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from datetime import datetime
engine = create_engine('mysql+pymysql://ucb_268_measure:ucb_268_measure@data.c... | Python | 0.000068 | @@ -599,24 +599,36 @@
olumn(String
+(length=200)
)%0A name2
@@ -638,24 +638,36 @@
olumn(String
+(length=200)
)%0A target
@@ -872,16 +872,28 @@
n(String
+(length=200)
)%0A su
|
4795eb8f7b59c915a15afef6ac884e46e2682564 | Revert "suppress error" | daemon16.py | daemon16.py | #!/usr/bin/env python
# Based on previous work by
# Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process)
# and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/)
# Adapted by M.Hendrix [2015]
# daemon16.... | Python | 0 | @@ -2357,17 +2357,16 @@
%5B%22upsc%22,
-
%22ups@loc
@@ -2376,16 +2376,8 @@
ost%22
-, %222%3E&1%22
%5D).s
|
b40ae3422ed5a5da8387d9c21bd25ae7ccf25ff6 | use in keyword | duration.py | duration.py | import re
_millisecond_size = 1.0
_second_size = 100.0 * _millisecond_size
_minute_size = 60.0 * _second_size
_hour_size = 60.0 * _minute_size
_day_size = 24.0 * _hour_size
_week_size = 7.0 * _day_size
class Duration():
def __init__(self, value):
self._milliseconds =... | Python | 0.000002 | @@ -3291,54 +3291,28 @@
ion
-== %220%22 or duration == %22+0%22 or duration ==
+in (%220%22, %22+0%22,
%22-0%22
+)
:%0A
|
93db3543a576ccde905fc77d7c3ad825f6a100a1 | change threshold | misc_scripts/compare_bounds.py | misc_scripts/compare_bounds.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys, re
from fontTools.ttLib import TTFont
from fontTools.pens.boundsPen import BoundsPen, ControlBoundsPen
class ConcordanceInfo(object):
def __init__(self):
self.glyphs = 0
self.concordant_glyphs = 0
self.maxdiff = 0
self.... | Python | 0.000001 | @@ -883,16 +883,17 @@
- v2) %3E
+=
1:%0A
|
df88bc165e0a505b07c84aea4a29bf3c048895ac | replace OSError with FileNotFoundError when appropriate | dwi/hdf5.py | dwi/hdf5.py | """Support for HDF5 files."""
from collections import OrderedDict
import numpy as np
import h5py
import dwi.util
DEFAULT_DSETNAME = 'default'
DEFAULT_DSETPARAMS = dict(
compression='gzip', # Smaller, compatible.
# compression='lzf', # Faster.
shuffle=True, # Rearrange bytes for better compression.
... | Python | 0.000039 | @@ -97,23 +97,34 @@
py%0A%0A
-import dwi.util
+from dwi.types import Path
%0A%0ADE
@@ -1228,16 +1228,88 @@
e, 'r')%0A
+ # On missing file, h5py raises OSError without errno (or filename).%0A
exce
@@ -1315,10 +1315,10 @@
ept
-I
O
+S
Erro
@@ -1340,32 +1340,198 @@
if
-e.filename is None:%0A
+not Path... |
5d1f9d3eaa27c0abf555fe3c79e9c11f9f7167ae | Fix redundant warning about 'file_name' config value. | foliant/pandoc.py | foliant/pandoc.py | """Wrapper around Pandoc. Used by builder."""
from __future__ import print_function
import subprocess
from . import gitutils
PANDOC_PATH = "pandoc"
FROM_PARAMS = "-f markdown_strict+simple_tables+multiline_tables+grid_tables+pipe_tables+table_captions+fenced_code_blocks+line_blocks+definition_lists+all_symbols_escap... | Python | 0 | @@ -2180,16 +2180,66 @@
%25 filt)%0A
+ elif key == %22file_name%22:%0A pass%0A
|
a324051e28d359a1591dff48fa4bbb32c3caf44a | add loaders __doc__ | src/loaders/__init__.py | src/loaders/__init__.py | # -*- coding: utf-8 -*-
# Copyright (c) 2018 shmilee
import os
from ..glogger import getGLogger
from . import base
__all__ = ['get_rawloader', 'is_rawloader', 'get_pckloader', 'is_pckloader']
log = getGLogger('L')
rawloader_names = ['DirRawLoader', 'TarRawLoader', 'SftpRawLoader']
pckloader_names = ['CachePckLoader... | Python | 0.000002 | @@ -48,16 +48,904 @@
hmilee%0A%0A
+'''%0AThis is the subpackage %60%60loaders%60%60 of gdpy3.%0AIt contains two kinds of loaders.%0A%0A1. %60%60RawLoader%60%60, get by :func:%60get_rawloader%60.%0A %60%60RawLoader%60%60 has attributes%0A :attr:%60base.BaseRawLoader.path%60%60,%0A :attr:%60base.BaseRawLoader.file... |
bfe6c752aa2a95cc28109f4819cf6a9e88e7ee4b | remove unnecessary comments | stores/views.py | stores/views.py | from newt.views import JSONRestView
from common.response import json_response
from django.conf import settings
import json
store_adapter = __import__(settings.NEWT_CONFIG['ADAPTERS']['STORES'], globals(), locals(), ['adapter'], -1)
import logging
logger = logging.getLogger(__name__)
class StoresRootView(JSONRestVi... | Python | 0 | @@ -554,59 +554,32 @@
name
-%0A%0A # TODO: create a store with a given name%0A
+ if no name is specified
%0A
@@ -826,59 +826,8 @@
8%5D%0A%0A
- # TODO: parse post body for initial datas%0A%0A
@@ -2365,16 +2365,17 @@
_name)%0A%0A
+%0A
class St
|
d97bb53f74c11b654f506f7e14342e7b3582a4c4 | Fix duplicate test method names. | eliot/tests/test_api.py | eliot/tests/test_api.py | """
Tests for the public API exposed by L{eliot}.
"""
from __future__ import unicode_literals
from unittest import TestCase
from .._output import Logger
import eliot
class PublicAPITests(TestCase):
"""
Tests for the public API.
"""
def test_addDestination(self):
"""
L{eliot.addDesti... | Python | 0.000013 | @@ -745,33 +745,31 @@
ef test_
-removeDestination
+addGlobalFields
(self):%0A
|
be0b85f50b8cd4f7323d5c6def5c388c7a8fad36 | fix webhook | webhooks.py | webhooks.py | from http.server import HTTPServer, BaseHTTPRequestHandler
import json
import os
import shutil
from episode import GitRepo, Episode
WORK_DIR = "repo"
class WebHookHandler(BaseHTTPRequestHandler):
def do_POST(self):
event_type = self.headers.get('X-Github-Event')
if event_type != 'push':
... | Python | 0.000017 | @@ -904,16 +904,38 @@
eploy()%0A
+ os.chdir(%22..%22)
%0A
|
7581bd9b435c53b09d8ecb7683fd63b5d1399a2e | Switch to the next dev version. | knossos/center.py | knossos/center.py | ## Copyright 2017 Knossos authors, see NOTICE file
##
## 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... | Python | 0 | @@ -887,17 +887,17 @@
N = '0.1
-2
+4
.0-dev'%0A
|
ae99e958a6f1b021e445a0ba4c665df4be13671d | Load config from file system | wikibugs.py | wikibugs.py | #!/usr/bin/env python
from dogpile.cache import make_region
import phabricator
import configfetcher
import rqueue
conf = configfetcher.ConfigFetcher()
redis_region = make_region().configure(
'dogpile.cache.redis',
arguments={
'host': conf.get('REDIS_HOST'),
'port': 6379,
'db': 0,
... | Python | 0 | @@ -16,16 +16,38 @@
python%0A%0A
+import os%0Aimport json%0A
from dog
@@ -5394,16 +5394,162 @@
ain__':%0A
+ conf_path = os.path.join(os.path.dirname(__file__), 'config.json')%0A with open(conf_path) as conf_file:%0A conf = json.load(conf_file)%0A
bugs
|
4787c9e1b895b5ce0bdd0fedeb537a971fab5933 | add management command to benchmark get_direct_ccz | corehq/apps/app_manager/management/commands/benchmark_direct_ccz.py | corehq/apps/app_manager/management/commands/benchmark_direct_ccz.py | Python | 0.000001 | @@ -0,0 +1,921 @@
+from __future__ import absolute_import%0Afrom __future__ import print_function%0Afrom __future__ import unicode_literals%0A%0Aimport json%0A%0Afrom django.core.management import BaseCommand%0A%0Afrom corehq.apps.app_manager.dbaccessors import get_app%0Afrom corehq.apps.app_manager.management.commands... | |
db356499cf079ec9284baf16817d3c3054d8688d | Add source_added tests | tests/integration/states/test_chocolatey.py | tests/integration/states/test_chocolatey.py | # -*- coding: utf-8 -*-
"""
Tests for the Chocolatey State
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt libs
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers imp... | Python | 0.000001 | @@ -1191,32 +1191,68 @@
ey.uninstalled%60%0A
+ - %60chocolatey.source_added%60%0A
%22%22%22%0A
@@ -1558,24 +1558,113 @@
= %2257.0.2%22%0A
+ src_name = %22test_repo%22%0A src_location = %22https://repo.test.com/chocolatey%22%0A
log.
@@ -3690,24 +3690,648 @@
l(ret, %7B%7D)%0... |
585317f3a03f55f6487a98446d4a9279f91714d2 | Add a test of the linearity of scalar multiplication | tests/test_vector2_scalar_multiplication.py | tests/test_vector2_scalar_multiplication.py | import pytest # type: ignore
from hypothesis import given
from hypothesis.strategies import floats
from utils import vectors
from ppb_vector import Vector2
@pytest.mark.parametrize("x, y, expected", [
(Vector2(6, 1), 0, Vector2(0, 0)),
(Vector2(6, 1), 2, Vector2(12, 2)),
(Vector2(0, 0), 3, Vector2(0, 0))... | Python | 0.002828 | @@ -771,8 +771,242 @@
(right)%0A
+%0A@given(%0A l=floats(min_value=-1e150, max_value=1e150),%0A x=vectors(max_magnitude=1e150),%0A y=vectors(max_magnitude=1e150),%0A)%0Adef test_scalar_linear(l: float, x: Vector2, y: Vector2):%0A assert (l * (x + y)).isclose(l*x + l*y)%0A
|
cecbb5951ef806c5b4b7b6894c05e4d086730fb0 | order fy descending (newest on top) | base_ordered/ordered.py | base_ordered/ordered.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 Camptocamp Austria (<http://www.camptocamp.at>)
#
# This program is free softw... | Python | 0 | @@ -1652,12 +1652,146 @@
_invoice()%0A%0A
+class account_fiscalyear(osv.osv):%0A _inherit = %22account.fiscalyear%22%0A _order = 'date_start desc, id desc'%0A%0Aaccount_fiscalyear()%0A%0A
|
42ca6c8bfc2b7598acd880a013f7898db5245004 | Add dependency prefixes to CMAKE_PREFIX_PATH | lib/spack/spack/build_environment.py | lib/spack/spack/build_environment.py | """
This module contains all routines related to setting up the package
build environment. All of this is set up by package.py just before
install() is called.
There are two parts to the bulid environment:
1. Python build environment (i.e. install() method)
This is how things are set up when install() is called.... | Python | 0.000002 | @@ -5354,16 +5354,187 @@
ng_dir%0A%0A
+ # Add dependencies to CMAKE_PREFIX_PATH%0A dep_prefixes = %5Bd.package.prefix for d in pkg.spec.dependencies.values()%5D%0A path_set(%22CMAKE_PREFIX_PATH%22, dep_prefixes)%0A%0A
%0Adef set
|
f13009ad215c570810abfa2275a0d04abae6d37e | Use server side searches. | wraptool.py | wraptool.py | #!/usr/bin/env python3
# Copyright 2015 The Meson development team
# 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 appl... | Python | 0 | @@ -1824,74 +1824,57 @@
-# FIXME, add search to server side%0A projects = get_projectlist(
+jd = get_result(API_ROOT + 'query/byname/' + name
)%0A
@@ -1880,32 +1880,36 @@
for p in
+jd%5B'
projects
:%0A if
@@ -1900,36 +1900,12 @@
ects
+'%5D
:%0A
- if name in p:%0A
@@ -1952,67... |
45feb9326f359fb94ebeb17867bcd098ba6fd4b4 | Make sure _start_event and _end_event are initialized | glue_exp/tools/floodfill_selection/floodfill_selection.py | glue_exp/tools/floodfill_selection/floodfill_selection.py | import os
import numpy as np
from glue.viewers.common.qt.mouse_mode import MouseMode
from glue.external.qt import QtGui
from .floodfill_scipy import floodfill_scipy
from glue.core.edit_subset_mode import EditSubsetMode
from glue.core.subset import MaskSubsetState
__all__ = ['FloodfillSelectionTool']
ROOT = os.path... | Python | 0.008759 | @@ -3468,16 +3468,80 @@
ction.')
+%0A self._start_event = None%0A self._end_event = None
%0A%0A de
|
2fedc43c50bd933924046b6f79633687a452116a | bump version | src/mrfitty/__init__.py | src/mrfitty/__init__.py | __version__ = '0.11.0'
| Python | 0 | @@ -11,13 +11,13 @@
_ = '0.1
-1
+2
.0'%0A
|
f48601ceacbf9d05412aa5f45b6d4f9bb46d266e | update the script for GMC | utilities/scripts/correct_momentum_conservation.py | utilities/scripts/correct_momentum_conservation.py | #!/usr/bin/env python3
import sys
from numpy import *
from os import path
def parse_data(data_line):
data = data_line.split()
data = list(map(int, data[:2])) + list(map(float, data[2:]))
return(data)
OSCAR_file_path = str(sys.argv[1])
OSCAR_file = open(OSCAR_file_path, 'r')
output_file = open('OSCAR_w_... | Python | 0 | @@ -14,17 +14,16 @@
v python
-3
%0A%0Aimport
@@ -328,16 +328,44 @@
, 'w')%0A%0A
+a = 2 # w_i = pT%5Ea/%3CpT%5Ea%3E%0A%0A
line_cou
@@ -1156,173 +1156,505 @@
-total_E = sum(event_data%5B:, 5%5D)%0A print(%22total energy = %25g GeV%22 %25 total_E)%0A print(%22correction per particle: delta_px = %2... |
d7baf900a39e9a209a737b4370b65e8e67902da0 | Version bump to v3.6.7 | geomdl/__init__.py | geomdl/__init__.py | """ NURBS & B-Spline 2D/3D curve and surface evaluation library in pure Python
.. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com>
"""
__author__ = "Onur Rauf Bingol"
__version__ = "3.6.6"
__license__ = "MIT"
| Python | 0 | @@ -186,17 +186,17 @@
= %223.6.
-6
+7
%22%0A__lice
|
f5e2e7cbb494fc111efcf4abd5c744091e9ee8aa | Fix function name error | module/submodules/graphs.py | module/submodules/graphs.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
import time
from shinken.log import logger
from .metamodule import MetaModule
class GraphsMetaModule(MetaModule):
_functions = ['get_graph_uris']
_custom_log = "You should configure the module 'graphite' in your broker and the mo... | Python | 0.002384 | @@ -1419,21 +1419,21 @@
ve_graph
-s
_uri
+s
', None)
|
6ba01511dd8a9e0fd02de9553e5646e0de7aae0a | Version bump to v3.6.8 | geomdl/__init__.py | geomdl/__init__.py | """ NURBS & B-Spline 2D/3D curve and surface evaluation library in pure Python
.. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com>
"""
__author__ = "Onur Rauf Bingol"
__version__ = "3.6.7"
__license__ = "MIT"
| Python | 0 | @@ -190,9 +190,9 @@
3.6.
-7
+8
%22%0A__
|
e69542c01959e7cf874c6ca1ae5c94d0c9a0ba1f | Fix tarball URL's for htslib (#5993) | var/spack/repos/builtin/packages/htslib/package.py | var/spack/repos/builtin/packages/htslib/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 | @@ -1402,105 +1402,8 @@
lib%22
-%0A url = %22https://github.com/samtools/htslib/releases/download/1.3.1/htslib-1.3.1.tar.bz2%22
%0A%0A
@@ -1624,75 +1624,8 @@
79f'
-,%0A url='https://github.com/samtools/htslib/archive/1.2.tar.gz'
)%0A%0A
@@ -1826,32 +1826,32 @@
', when=%22@1.2%22)%0A
-
depends_... |
1a2c69e95eb02010f0a72aebe2554be58db63f42 | Generate name from German title if possible | ckanext/switzerland/dcat/harvesters.py | ckanext/switzerland/dcat/harvesters.py | # flake8: noqa
import json
import ckan.plugins as p
import ckan.model as model
from ckanext.harvest.model import HarvestObject
from ckanext.dcat.parsers import RDFParserException, RDFParser
from ckanext.dcat.interfaces import IDCATRDFHarvester
from ckanext.dcat.harvesters.rdf import DCATRDFHarvester
import logging... | Python | 1 | @@ -1,252 +1,4 @@
-# flake8: noqa%0A%0Aimport json%0A%0Aimport ckan.plugins as p%0Aimport ckan.model as model%0A%0Afrom ckanext.harvest.model import HarvestObject%0A%0Afrom ckanext.dcat.parsers import RDFParserException, RDFParser%0Afrom ckanext.dcat.interfaces import IDCATRDFHarvester%0A
from
@@ -1691,1558 +1691,102 ... |
7f29770766a30bf821689960189e95526eee6bdc | print python version if using file directly, not as import | getDataRemotely.py | getDataRemotely.py | import sys
from dictAsFile_wrapper import *
def run():
hashtableName = 'hashtable.pkl'
data = {}
# use different import based on python version number:
if (sys.version_info > (3, 0)):
# python 3:
print('python 3')
import urllib.request
url = 'https://raw.githubuser... | Python | 0.000001 | @@ -220,16 +220,55 @@
thon 3:%0A
+ if __name__ == '__main__':%0A
@@ -900,16 +900,55 @@
thon 2:%0A
+ if __name__ == '__main__':%0A
|
9c218079f00e9b3c7285cd94dcc7836531f722a5 | Install RMPISNOW wrapper in prefix.bin for r-snow (#16479) | var/spack/repos/builtin/packages/r-snow/package.py | var/spack/repos/builtin/packages/r-snow/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 RSnow(RPackage):
"""Support for simple parallel computing in R."""
homepage = "https:... | Python | 0 | @@ -739,8 +739,147 @@
'run'))%0A
+%0A @run_after('install')%0A def install_wrapper(self):%0A mkdir(self.prefix.bin)%0A install('inst/RMPISNOW', self.prefix.bin)%0A
|
5c7d690902b19b6c333a9fbced80ffa0f1d1b81e | update cfg_validator tests for breakage | congress/tests/cfg_validator/test_parsing.py | congress/tests/cfg_validator/test_parsing.py | #
# Copyright (c) 2017 Orange.
#
# 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 agre... | Python | 0 | @@ -1819,24 +1819,68 @@
onfigOpts()%0A
+ initial_keys_len = len(conf.keys())%0A
pars
@@ -1976,32 +1976,51 @@
elf.assertEqual(
+initial_keys_len +
1, len(keys))%0A
@@ -2258,24 +2258,80 @@
manager%22%22%22%0A
+ initial_keys_len = len(cfg.ConfigOpts().keys())%0A
conf
@@ -2484,16 +24... |
f42744558b989f8122f67d24bf65c8514eb516cb | Use better names for generated IR files. | runac/__init__.py | runac/__init__.py | from . import tokenizer, ast, blocks, ti, specialize, codegen
from util import Error
import sys, os, subprocess, tempfile
BASE = os.path.dirname(__path__[0])
CORE_DIR = os.path.join(BASE, 'core')
TRIPLES = {
'darwin': 'x86_64-apple-darwin11.0.0',
'linux2': 'x86_64-pc-linux-gnu',
}
def tokenize(f):
return tokenize... | Python | 0 | @@ -892,99 +892,70 @@
%0A%09%0A%09
-fd,
name =
-tempfile.mkstemp('.ll', dir='.')%0A%09f = os.fdopen(fd, 'wb')%0A%09f.write(ir)%0A%09f.close(
+outfn + '.ll'%0A%09with open(name, 'wb') as f:%0A%09%09f.write(ir
)%0A%09%0A
|
a328a1974b985eda47191748e28a69d1e521f070 | 实现FREEBUF的AJAX页面爬取的几种小爬虫-json库解析-科学方法 | freebufspider2.py | freebufspider2.py | import requests
from bs4 import BeautifulSoup
import json
for i in range(1, 20):
url = 'http://www.freebuf.com/www.freebuf.com?action=ajax_wenku&year=all&score=all&type=all&tech=0&keyword=&page=' + str(
i)
r = requests.get(url)
data = json.loads(r.text)
soup = BeautifulSoup(data['cont'])
fo... | Python | 0 | @@ -267,16 +267,32 @@
(r.text)
+#%E4%BD%BF%E7%94%A8json%E5%BA%93%E8%A7%A3%E6%9E%90%EF%BC%8C%E7%A7%91%E5%AD%A6%E7%9A%84%E5%81%9A%E6%B3%95
%0A sou
|
cd9e8c1595e0e987e2ec0067c9532a9778e64ea3 | Update test_plugin.py | logstash_plugin/tests/test_plugin.py | logstash_plugin/tests/test_plugin.py | ########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... | Python | 0.000003 | @@ -1173,32 +1173,37 @@
L)%0A self.
+local
env.execute('ins
@@ -1958,32 +1958,37 @@
s)%0A self.
+local
env.execute('ins
@@ -2024,16 +2024,21 @@
self.
+local
env.exec
|
74a182a13bae5dde3e2b4fe604a839e5ec05e771 | load palette hoohah | cooperhewitt/swatchbook/palettes/__init__.py | cooperhewitt/swatchbook/palettes/__init__.py | # I blame, Guido
| Python | 0.000002 | @@ -1,17 +1,430 @@
-# I blame, Guido
+def palettes():%0A%0A return %5B%0A 'css3',%0A 'css4'%0A %5D%0A%0Adef load_palette(reference):%0A%0A if not reference in palettes():%0A raise Exception, %22Invalid palette%22%0A%0A # Please figure out the hoo-hah to make dynamic%0A # loading work... |
f6686e69e71522514f3f9e5f583e77176fdc9580 | Fix step minimum duration field type | microdrop/core_plugins/device_info_plugin/__init__.py | microdrop/core_plugins/device_info_plugin/__init__.py | """
Copyright 2015 Christian Fobel
This file is part of droplet_planning_plugin.
droplet_planning_plugin is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... | Python | 0.000001 | @@ -3092,23 +3092,23 @@
-Boolean
+Integer
.named('
|
ff99ed308edd661db7b692cb92eb3c6465843204 | Add JSON parser | pande_gas/utils/molecule_net/__init__.py | pande_gas/utils/molecule_net/__init__.py | """
Utilities for MoleculeNet.
"""
import re
import xml.etree.cElementTree as et
class PcbaXmlParser(object):
"""
Parser for PubChem BioAssay XML.
Parameters
----------
filename : str
Filename.
"""
def __init__(self, filename):
self.tree = et.parse(filename)
self.r... | Python | 0.000084 | @@ -28,16 +28,28 @@
et.%0A%22%22%22%0A
+import json%0A
import r
@@ -88,16 +88,1236 @@
as et%0A%0A%0A
+class PcbaJsonParser(object):%0A %22%22%22%0A Parser for PubChemBioAssay JSON.%0A%0A Parameters%0A ----------%0A filename : str%0A Filename.%0A %22%22%22%0A def __init__(self, filename):%... |
220983a4cf75f4e27f5491812de9ff04f4104510 | fix butter_bandpass | code/python/seizures/preprocessing/preprocessing.py | code/python/seizures/preprocessing/preprocessing.py | import scipy.signal as signal
def preprocess_multichannel_data(matrix,fs):
"""
:param matrix: multichannel EEG data
:param fs: sampling frequency
:return: data without mains, electrical artefacts etc
authors: Lea and Vincent
"""
n_channel,m= matrix.shape
for i in range(n_channel):
... | Python | 0.000004 | @@ -766,19 +766,45 @@
-lowcut = 59
+bandstop = 60%0A lowcut = bandstop-1
%0A
@@ -814,17 +814,25 @@
ghcut =
-6
+bandstop+
1%0A%0A%0A
@@ -1077,20 +1077,17 @@
_filter(
-data
+x
, lowcut
|
4a4e56a0909d8e89d82462c846f365b0849b3cb4 | add missing import | generator/aidl.py | generator/aidl.py | #!/usr/bin/python
from eclipse2buck.generator.base_target import BaseTarget
from eclipse2buck.decorator import target
from eclipse2buck.util import util
from eclipse2buck import config
class AIDL(BaseTarget):
"""
generated all aidl targets
"""
aidl_path_list = []
def __init__(self, root, name):
... | Python | 0.000042 | @@ -178,16 +178,26 @@
t config
+%0Aimport os
%0A%0Aclass
|
6cf322bbce2bfd4088cc4c5af96cd72cad86ea95 | Add aspect as a parameter of Displayer init. | manifold/infrastructure/displayer.py | manifold/infrastructure/displayer.py | import math
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from sklearn.metrics import confusion_matrix
class Displayer(object):
def __init__(self, **kwargs):
self.items = []
self.parameters = ', '.join(['%s: %s' % (k, str(v)) for k, v in kwargs.items()... | Python | 0 | @@ -220,18 +220,48 @@
elf.
-items = %5B%5D
+aspect = kwargs.pop('aspect', (20, -40))
%0A
@@ -363,26 +363,18 @@
elf.
-aspect = (20, -40)
+items = %5B%5D
%0A%0A
@@ -1336,54 +1336,69 @@
-kwargs = %7B%7D%0A if dimension %3E 2:%0A
+if color is None:%0A color = np.zeros(samples)%0... |
da54f60def189953b9ebbd754200103668e00042 | Handle full result sets. | marshmallow_pagination/paginators.py | marshmallow_pagination/paginators.py | # -*- coding: utf-8 -*-
import abc
import math
import six
import sqlalchemy as sa
from marshmallow_sqlalchemy.convert import ModelConverter
from marshmallow_pagination import pages
converter = ModelConverter()
def convert_value(row, attr):
field = converter._get_field_class_for_property(attr.property)
valu... | Python | 0 | @@ -553,54 +553,71 @@
elf.
-per_page = per_page%0A self.count = count
+count = count or self._count()%0A self.per_page = per_page
or
@@ -621,24 +621,21 @@
or self.
-_
count
-()
%0A%0A de
|
9105326cdb6ad7a6d4d23504ef36beb6303eaf65 | make offset_date type unaware | custom/opm/opm_reports/tests/case_reports.py | custom/opm/opm_reports/tests/case_reports.py | from collections import defaultdict
from datetime import datetime, date
from unittest import TestCase
from jsonobject import (JsonObject, DictProperty, DateTimeProperty,
StringProperty, IntegerProperty, BooleanProperty)
from casexml.apps.case.models import CommCareCase
from custom.opm.opm_reports.reports import S... | Python | 0.000047 | @@ -3051,20 +3051,36 @@
return
+type(reference_
date
+)
(new_yea
|
ba4396f1868dad9a637ddd3cbf9e935fa8d93cf0 | print Exception error | git_downloader.py | git_downloader.py | #!/usr/bin/env python
#
import sys, os, argparse, logging, fnmatch, urllib, posixpath, urlparse, socket
from github import Github
def main(args, loglevel):
logging.basicConfig(format="%(levelname)s: %(message)s", level=loglevel)
socket.setdefaulttimeout(args.timeout)
g = Github()
with open(args.... | Python | 0.999548 | @@ -1421,32 +1421,51 @@
except
+ Exception as error
:%0A
@@ -1502,35 +1502,48 @@
downloading
+ %25s.
%25s' %25
+(
file
+, error)
)%0A
@@ -1542,32 +1542,51 @@
except
+ Exception as error
:%0A
@@ -1628,27 +1628,40 @@
pository
+ %25s.
%25s' %25
+(
l... |
665d2991bbf8ac9d11cd7211ef9123863689adff | remove redundant module sys, add begin/end timestamps | gitmyfeeds_bot.py | gitmyfeeds_bot.py | #!/usr/bin/python
import sys
import json
import httplib
from bs4 import BeautifulSoup
import telegram
import re
import psycopg2
import psycopg2.extras
with open('config.json', 'r') as f:
config = json.load(f)
pg = config['db']['pg_conn']
tg_bot = config['telegram_bot']
""" connect to postgres """
conn = psycopg... | Python | 0.000001 | @@ -23,11 +23,12 @@
ort
-sys
+time
%0Aimp
@@ -272,16 +272,75 @@
_bot'%5D%0A%0A
+print '%5B%25s%5D start...'%25 time.strftime('%25d.%25m.%25Y %25H:%25M:%25S')%0A%0A
%22%22%22 conn
@@ -3204,16 +3204,96 @@
_feeds:%0A
+ print 'send feed item %5B%25s%5D to chat %5B%25s%5D'%25 (feed%5B'id'%5D, chat%5B'chat_id'%5... |
cadf61287b9b68af5b734b4ab2fefd9c758cfc26 | Update skiptest | data_importer/tests/test_generic_importer.py | data_importer/tests/test_generic_importer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import mock
import os
import django
from django.test import TestCase
from unittest import skipIf
from data_importer.importers.generic import GenericImporter
from data_importer.readers.xls_reader import XLSReader
from data_importer.readers.xlsx_reader import XLSXReader
from ... | Python | 0.000001 | @@ -1812,37 +1812,30 @@
pIf(
-(
django.
-get_version() %3C '1.4'
+VERSION %3C (1, 4
), %22
|
6e7a20675cd66d9ca7d4a286958404198369dece | Validate ReplicationTopology data | dbaas/physical/forms/replication_topology.py | dbaas/physical/forms/replication_topology.py | from django import forms
from django.forms.widgets import SelectMultiple
#from django.forms.widgets import CheckboxSelectMultiple
from ..models import ReplicationTopology, Parameter
class ReplicationTopologyForm(forms.ModelForm):
class Meta:
model = ReplicationTopology
def __init__(self, *args, **kw... | Python | 0.000001 | @@ -1,16 +1,40 @@
+# -*- coding: utf-8 -*-%0A
from django impo
@@ -198,16 +198,40 @@
arameter
+, DatabaseInfraParameter
%0A%0A%0Aclass
@@ -635,16 +635,16 @@
s.all()%0A
-
@@ -741,8 +741,1119 @@
pology'%0A
+%0A def clean(self):%0A cleaned_data = super(ReplicationTopologyForm, self).clean()%0A%0A ... |
12ca4bef094b03fa5a049fc38739bb24ebdde5b7 | use constants | corehq/apps/userreports/reports/builder/__init__.py | corehq/apps/userreports/reports/builder/__init__.py | from __future__ import absolute_import
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
import six
DEFAULT_CASE_PROPERTY_DATATYPES = {
"name": "string",
"modified_on": "datetime",
"opened_on": "datetime",
"owner_id": "string",
"user_id": "string",
}
FO... | Python | 0.00002 | @@ -567,75 +567,166 @@
%0A%5D%0A%0A
-%0ADATA_SOURCE_TYPE_CHOICES = (%0A (%22case%22, _(%22Cases%22)),%0A (%22form%22
+DATA_SOURCE_TYPE_CASE = 'case'%0ADATA_SOURCE_TYPE_FORM = 'form'%0ADATA_SOURCE_TYPE_CHOICES = (%0A (DATA_SOURCE_TYPE_CASE, _(%22Cases%22)),%0A (DATA_SOURCE_TYPE_FORM
, _(
|
1820001e6ec6960014b5e9cf23eb7a2f8b90c213 | Remove a broken test case from decorators_test | dm_control/mujoco/testing/decorators_test.py | dm_control/mujoco/testing/decorators_test.py | # Copyright 2017 The dm_control 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 i... | Python | 0.000015 | @@ -872,47 +872,8 @@
test
-%0Afrom absl.testing import parameterized
%0A%0Afr
@@ -2117,846 +2117,8 @@
t)%0A%0A
- def test_works_with_named_parameters(self):%0A%0A func = mock.MagicMock()%0A names = %5B%22foo%22, %22bar%22, %22baz%22%5D%0A params = %5B1, 2, 3%5D%0A calls_per_thread = 2%0A num_threads ... |
b58d296373ed4ba75d0e6409e332e70abea76086 | add more axes labels | data/boada/analysis_all/redshifts/redshift_stats.py | data/boada/analysis_all/redshifts/redshift_stats.py | import pandas as pd
import pylab as pyl
from glob import glob
files = glob('*.csv')
for f in files:
results = pd.read_csv(f)
# good redshifts
try:
q0 = pyl.append(q0, results[results.Q == 0].r.values)
q1 = pyl.append(q1, results[results.Q == 1].r.values)
x = ~pyl.isnan(results.fibe... | Python | 0 | @@ -607,16 +607,112 @@
alues%5D%0A%0A
+# make a figure%0Af = pyl.figure(1,figsize=(5,5*(pyl.sqrt(5.)-1.0)/2.0))%0Aax = f.add_subplot(111)%0A%0A
bins = p
@@ -733,19 +733,18 @@
,22,15)%0A
-pyl
+ax
.hist(q2
@@ -839,19 +839,18 @@
='Q=2')%0A
-pyl
+ax
.hist(q1
@@ -969,19 +969,18 @@
an(q0)%5D%0A
-pyl
+ax
.hist(q0
@@ -... |
b8399e48872271ccac6431d9f875238ff509a03a | Increment number of JS files in test_js_load | InvenTree/InvenTree/test_views.py | InvenTree/InvenTree/test_views.py | """
Unit tests for the main web views
"""
import re
import os
from django.test import TestCase
from django.urls import reverse
from django.contrib.auth import get_user_model
class ViewTests(TestCase):
""" Tests for various top-level views """
username = 'test_user'
password = 'test_pass'
def setUp... | Python | 0.000003 | @@ -1889,10 +1889,10 @@
S =
-39
+40
%0A%0A
|
83b6e177fccaef7d62682c25a0e82f29bcba01e6 | Remove autofilling "GSSAPI" mechanism in hue.ini | desktop/core/src/desktop/lib/mapr_config_changer.py | desktop/core/src/desktop/lib/mapr_config_changer.py | import re
import os
GSSAPI = "GSSAPI"
MAPR_SECURITY = "MAPR-SECURITY"
KERBEROS_ENABLE = "kerberosEnable"
SECURE = "secure"
SECURITY_ENABLED = 'security_enabled'
MECHANISM = 'mechanism'
MAPR_CLUSTERS_CONF_PATH = "/opt/mapr/conf/mapr-clusters.conf"
templates = {
MECHANISM: 'none',
SECURITY_ENABLED: 'false'
}
def ... | Python | 0 | @@ -18,26 +18,8 @@
os%0A%0A
-GSSAPI = %22GSSAPI%22%0A
MAPR
@@ -50,43 +50,8 @@
TY%22%0A
-KERBEROS_ENABLE = %22kerberosEnable%22%0A
SECU
@@ -689,131 +689,8 @@
TY%0A%0A
- if (KERBEROS_ENABLE in cluster_props) and (cluster_props%5BKERBEROS_ENABLE%5D == %22true%22):%0A templates%5BMECHANISM%5D = GSSAPI%0A%0A
%0Ate... |
13bf2bcbbfd079c75b84a993a86086493d2e6dee | Cleaned up output #2 | django_postgres/management/commands/sync_pgviews.py | django_postgres/management/commands/sync_pgviews.py | """Syncronise SQL Views.
"""
from django.core.management.base import BaseCommand
from django.db import models
from django_postgres.view import create_views
class Command(BaseCommand):
args = '<appname appname ...>'
help = 'Creates and Updates all SQL Views'
def handle(self, *args, **options):
""... | Python | 0.998498 | @@ -356,16 +356,37 @@
%22%22%22%0A
+ if args:%0A
@@ -403,16 +403,33 @@
t.write(
+%0A
'Creatin
@@ -473,33 +473,16 @@
=args))%0A
- if args:%0A
@@ -602,13 +602,9 @@
ns)%0A
-
%0A
+
@@ -729,32 +729,45 @@
eating Views for
+ all modules:
%7Bmodules%7... |
0b5c75a9222fa399b8db45f67bfc514e7fc226f6 | fix typo | Lib/glyphsLib/builder/features.py | Lib/glyphsLib/builder/features.py | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python | 0.000022 | @@ -1688,16 +1688,24 @@
%25s %7B' %25
+feature.
name%5D%0A
|
737adf50f39aafd59e56f47c0ede31c214530959 | Fix NaN handling | drivendata_validator/drivendata_validator.py | drivendata_validator/drivendata_validator.py | #!/usr/bin/python2
import sys
import json
import pandas as pd
import numpy as np
class DrivenDataValidationError(Exception):
""" Custom Exception class for validation errors that we can anticipate. These messages
are returned to the user. Other unanticipated exceptions get a generic message we pass to t... | Python | 0 | @@ -1184,19 +1184,50 @@
ion_path
+, skip_validating_dataset=False
):%0A
-
@@ -1636,86 +1636,572 @@
gs)%0A
- submission_df = pd.read_csv(submission_path, **self.validation_kwargs)
+%0A # automatically validate and return the dataframe if we're comparing something to itself.%0A # Refs:%0... |
a44d2a9239e755b9e5726521b11aca9734b89180 | Fix crashing when Authorization is not set | ereuse_devicehub/resources/account/domain.py | ereuse_devicehub/resources/account/domain.py | import base64
from bson.objectid import ObjectId
from ereuse_devicehub.exceptions import WrongCredentials, BasicError, StandardError
from ereuse_devicehub.resources.account.role import Role
from ereuse_devicehub.resources.account.settings import AccountSettings
from ereuse_devicehub.resources.domain import Domain, Res... | Python | 0.000004 | @@ -2331,24 +2331,41 @@
hash it.%22%22%22%0A
+ try:%0A
x =
@@ -2422,16 +2422,18 @@
-header =
+ return
par
@@ -2462,33 +2462,61 @@
r(x)
-%0A if header is Non
+%5B'username'%5D%0A except (KeyError, TypeError) as
e:%0A
@@ -2595,55 +2595,33 @@
tten
-: ' + x, 400)%0A ... |
dba78b02daa5674769cccf56b867f5266d6ec0f1 | Add voluptuous to locative (#3254) | homeassistant/components/device_tracker/locative.py | homeassistant/components/device_tracker/locative.py | """
Support for the Locative platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.locative/
"""
import logging
from homeassistant.components.device_tracker import DOMAIN
from homeassistant.const import HTTP_UNPROCESSABLE_ENTITY, STATE... | Python | 0.00002 | @@ -194,67 +194,8 @@
ng%0A%0A
-from homeassistant.components.device_tracker import DOMAIN%0A
from
@@ -323,16 +323,139 @@
tantView
+%0A# pylint: disable=unused-import%0Afrom homeassistant.components.device_tracker import ( # NOQA%0A DOMAIN, PLATFORM_SCHEMA)
%0A%0A_LOGGE
@@ -775,17 +775,17 @@
url =
-%22
+'
/... |
06277ea30094ff6669537f2365b6ad9f5a19642b | Update laundry.py | fxcmminer_v1.1/fxcmminer/cleaning/laundry.py | fxcmminer_v1.1/fxcmminer/cleaning/laundry.py | from event import CleanedDataEvent
class DataCleaner(object):
"""
Basic data cleaning
"""
def __init__(self, events_queue):
"""
"""
self.events_queue = events_queue
def _remove_duplicates(self, data):
"""
Drop any duplicates in the Datetime Index
"""... | Python | 0.000001 | @@ -72,27 +72,357 @@
-Basic data cleaning
+The DataCleaner class is the process of correcting%0A (or removing) corrupt or inaccurate records from a record set%0A and refers to identifying incomplete, incorrect, inaccurate%0A or irrelevant parts of the data and then replacing,%0A modifying, or deleting... |
4844ba065d86fdce3f01b7b191ecc6a4ef43661e | Add autoclass directives to Visualization/__init__.py. This will enable Visualization module methods to appear in function reference. | OpenPNM/Visualization/__init__.py | OpenPNM/Visualization/__init__.py | r"""
*******************************************************************************
:mod:`OpenPNM.Visualization`: Network Visualization
*******************************************************************************
.. module:: OpenPNM.Visualization
Contents
--------
tbd
.. note::
n/a
Import
------
>>> import ... | Python | 0.000034 | @@ -292,174 +292,193 @@
a%0A %0A
-Import%0A------%0A%3E%3E%3E import OpenPNM as PNM%0A%3E%3E%3E tmp=PNM.Visualization ....%0A%0A%0ASubmodules%0A----------%0A::%0A%0A None --- No subpackages at the moment%0A%0A
+%0AClasses%0A-------%0A%0A.. autoclass:: GenericVisualization%0A :members:%0A ... |
6e6ccc8566fe90323d900fd0ebd38f45ad4d0b63 | Update TipCalculator.py | PracticePrograms/TipCalculator.py | PracticePrograms/TipCalculator.py | '''
Author : DORIAN JAVA BROWN
Version : N/A
Copyright : All Rights Reserve; You may use, distribute and modify this code.
Description : This program provides the user with options on how much tip the customer should leave the waiter/waitress
'''
import os
total = 21.49
def cls():
os.system('cls' i... | Python | 0 | @@ -920,26 +920,26 @@
rint('B) %25%25
-20
+15
$
@@ -950,34 +950,34 @@
3f' %25((total * .
-20
+15
)))%0A print('C)
@@ -975,25 +975,25 @@
rint('C) %25%25
-2
+1
0
@@ -1005,33 +1005,33 @@
3f' %25((total * .
-2
+1
0)))%0A print('D)
@@ -1032,20 +1032,20 @@
nt('D)
+
%25%25
-20
+5
... |
953ce15f2a3b2ffdc0e27d95afbe4f8cda2cdbfd | set default behavior to add datacenters | SoftLayer/CLI/image/datacenter.py | SoftLayer/CLI/image/datacenter.py | """Edit details of an image."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import helpers
@click.command()
@click.argument('identifier')
@click.option('--add/--remove',
default=False,
help="To add ... | Python | 0 | @@ -256,30 +256,16 @@
remove',
-%0A
default
@@ -269,12 +269,11 @@
ult=
-Fals
+Tru
e,%0A
|
704b2fb59857d6a59bf2223830236a4deb31d3e6 | Update test code | about_code_tool/tests/test_gen.py | about_code_tool/tests/test_gen.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
# ============================================================================
# Copyright (c) 2014-2016 nexB Inc. http://www.nexb.com/ - All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complian... | Python | 0.000001 | @@ -1534,32 +1534,70 @@
t with copyright
+%5CnPlease correct the input and re-run.
')%5D%0A resu
@@ -1900,16 +1900,54 @@
opyright
+%5CnPlease correct the input and re-run.
')%5D%0A
|
1c31d23dd95fb4ca8a5daaf37aaa7d75472f1d24 | fix run time error: list indices must be integers not str (#611) | src/harness/reference_models/pre_iap_filtering/pre_iap_filtering.py | src/harness/reference_models/pre_iap_filtering/pre_iap_filtering.py | # Copyright 2018 SAS Project Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | Python | 0.000014 | @@ -2194,16 +2194,266 @@
models%0A
+ # Initialize expected keys in protected_entities to empty array if type does not exist%0A for key in %5B'gwblRecords', 'fssRecords', 'ppaRecords', 'palRecords', 'gwpzRecords'%5D:%0A if key not in protected_entities:%0A protected_entities%5Bkey%5D = %5B%5D%0A%0A
list_o... |
cdd28cba2c6299e18b5d5221f8d10b8649c1faed | Use numpy | tests/chainer_tests/functions_tests/array_tests/test_expand_dims.py | tests/chainer_tests/functions_tests/array_tests/test_expand_dims.py | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
@testing.parameterize(
{'in_shape': (3, 2), 'out_shape': (1, 3, 2), 'axis': 0},
{'in_shape': (3, 2), 'out_shape':... | Python | 0.00006 | @@ -1140,15 +1140,11 @@
-cuda.cu
+num
py.t
@@ -1169,22 +1169,35 @@
y_equal(
+cuda.to_cpu(
y.data
+)
, y_expe
|
9323df973584b86355e19229f4beb8ebc7981693 | remove `gamma` and `Decoonvolution`s | tests/chainer_tests/link_hooks_tests/test_weight_standardization.py | tests/chainer_tests/link_hooks_tests/test_weight_standardization.py | import unittest
import numpy
import pytest
import chainer
from chainer.backends import cuda
from chainer.link_hooks.weight_standardization import WeightStandardization
import chainer.links as L
from chainer import testing
from chainer.testing import attr
class TestExceptions(unittest.TestCase):
def setUp(self)... | Python | 0.000151 | @@ -1191,233 +1191,8 @@
f.x)
-%0A if not self.use_gamma:%0A assert not hasattr(layer, 'gamma')%0A else: # Use gamma parameter%0A assert hasattr(layer, 'gamma')%0A assert layer.gamma.ndim == 0 and layer.gamma.size == 1
%0A%0A
@@ -4028,30 +4028,11 @@
on1D
-, L.Deconvol... |
b2e0812f6946f88cef2cdffb0be603b4b769033a | rename run_test to execute in streams simple benchmark (#4941) | tests/kafkatest/benchmarks/streams/streams_simple_benchmark_test.py | tests/kafkatest/benchmarks/streams/streams_simple_benchmark_test.py | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | Python | 0 | @@ -4568,32 +4568,31 @@
self.
-run_test
+execute
(single_test
@@ -4712,32 +4712,31 @@
self.
-run_test
+execute
(single_test
@@ -4854,32 +4854,31 @@
self.
-run_test
+execute
(single_test
@@ -4998,24 +4998,23 @@
self.
-run_test
+execute
(single_
@@ -5057,24 +5057,23 @@
self.
-run_test
... |
d1fa13bdf3ca7d1c4eabdaace5758d6b031ef909 | Set up the download url, which I forgot about. | exampleSettings/urls.py | exampleSettings/urls.py | from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'post.views.list', name='home'),
(r'... | Python | 0 | @@ -912,65 +912,8 @@
),%0A%0A
- (r'%5Eeditorg/(.*)/$', 'organization.views.orgedit'),%0A%0A
@@ -1641,16 +1641,75 @@
edit'),%0A
+ (r'%5Edownload/(.*)/$', 'filemanager.views.download'),%0A%0A%0A
%0A)+ stat
|
5b1eefb315cd9094de8c8827e0f3a8c0eeefe95a | delete view: make sure item is closed before it is removed from storage | bepasty/views/delete.py | bepasty/views/delete.py | # Copyright: 2014 Dennis Schmalacker <github@progde.de>
# License: BSD 2-clause, see LICENSE for details.
import errno
from flask import current_app, redirect, url_for, render_template, abort
from flask.views import MethodView
from werkzeug.exceptions import NotFound
from . import blueprint
from ..utils.permissions ... | Python | 0 | @@ -447,38 +447,36 @@
ry:%0A
+w
it
-em =
+h
current_app.sto
@@ -486,24 +486,33 @@
e.open(name)
+ as item:
%0A exc
@@ -512,166 +512,8 @@
-except (OSError, IOError) as e:%0A if e.errno == errno.ENOENT:%0A return render_template('file_not_found.html'), 404%0A ... |
1596b1b782b96c89f0a06710dd3e75b65defc3d8 | Fix validating no parms for led_matrix methods | cnavsense/services/led_matrix.py | cnavsense/services/led_matrix.py | import os
from zmqservices import services
from cnavconstants.servers import (
LOCAL_LED_MATRIX_ADDRESS, LED_MATRIX_PORT_ADDRESS
)
from cnavsense import settings
from cnavsense.utils import sentry, logger
class LedMatrix(services.JsonrpcServerResource):
def __init__(self, *args, **kwargs):
super(Le... | Python | 0.000002 | @@ -1430,22 +1430,18 @@
urn
+not
params
- is None
%0A%0A
|
aa5259efac8f7fbe8e2afd263198feaaa45fc4c3 | Change test for running on Tingbot | tingbot/platform_specific/__init__.py | tingbot/platform_specific/__init__.py | import platform
def is_tingbot():
"""return True if running as a tingbot. We can update this function to be more smart in future"""
return platform.machine().startswith('armv71')
if platform.system() == 'Darwin':
from osx import fixup_env, create_main_surface, register_button_callback
elif is_tingbot():
... | Python | 0 | @@ -8,17 +8,21 @@
platform
+, os
%0A
-
%0Adef is_
@@ -39,17 +39,22 @@
%0A %22%22%22
-r
+%0A R
eturn Tr
@@ -84,117 +84,149 @@
bot.
- We can update this function to be more smart in future%22%22%22%0A return platform.machine().startswith('armv71')
+%0A %22%22%22%0A # TB_RUN_ON_LCD is an environment v... |
998fe3252403553efb3bf022510b12c0a219f355 | Test coverage | playkit/api.py | playkit/api.py | import requests
from bs4 import BeautifulSoup
def search(keyword="",category="apps",country="us",pricing="all",rating="all",format="dict",proxies=None):
requests.packages.urllib3.disable_warnings()
priceMap = {"all":0,"free":1,"paid":2,"All":0,"Free":1,"Paid":2}
ratingsMap = {"all":0,"4+":1,"All":0}
... | Python | 0.000001 | @@ -597,36 +597,32 @@
turn response%0A%0A%0A
-
%0A url = %22http
@@ -839,24 +839,16 @@
ayload)%0A
-
%0A
|
808ce13f918cdda1b55a2baa73e81128c4f8fdd7 | Check file size during initial creation | bepasty/views/upload.py | bepasty/views/upload.py | # Copyright: 2013 Bastian Blank <bastian@waldi.eu.org>
# License: BSD 2-clause, see LICENSE for details.
import os
import re
from flask import abort, current_app, jsonify, redirect, request, url_for
from flask.views import MethodView
from ..utils.html import ContentRange
from ..utils.name import ItemName
from . impo... | Python | 0 | @@ -449,16 +449,250 @@
/-%5D+')%0A%0A
+ @classmethod%0A def filter_size(cls, i):%0A %22%22%22%0A Filter size.%0A Check for advertised size.%0A %22%22%22%0A i = int(i)%0A if i %3E= 4 * 1024 * 1024 * 1024: # 4 GiB%0A abort(413)%0A return i%0A%0A
@cla... |
093cec82b1c30129a2ac96c631acd8563fff9cf7 | Update blacklisted plugins | modules/sfp_tool_whatweb.py | modules/sfp_tool_whatweb.py | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_tool_whatweb
# Purpose: SpiderFoot plug-in for using the 'WhatWeb' tool.
# Tool: https://github.com/urbanadventurer/whatweb
#
# Author: <bcoles@gmail.com>
#
# Created: 2... | Python | 0.000001 | @@ -4518,17 +4518,81 @@
', '
-X-Cache',
+x-hacker', 'x-machine', 'x-pingback', 'X-Backend', 'X-Cache',%0A
'X-
@@ -4622,16 +4622,35 @@
red-By',
+ 'X-Forwarded-For',
'X-Fram
|
63e28ba358fefbe3b3b5389dc9dabf3284588270 | Revert "Just use ckminions in batch mode." | salt/cli/batch.py | salt/cli/batch.py | # -*- coding: utf-8 -*-
'''
Execute batch runs
'''
# Import python libs
from __future__ import print_function
import math
import time
import copy
# Import salt libs
import salt.client
import salt.output
import salt.utils.minions
from salt.utils import print_cli
class Batch(object):
'''
Manage the execution ... | Python | 0 | @@ -202,34 +202,8 @@
put%0A
-import salt.utils.minions%0A
from
@@ -703,59 +703,139 @@
-ckminions = salt.utils.minions.CkMinions(self.opts)
+args = %5Bself.opts%5B'tgt'%5D,%0A 'test.ping',%0A %5B%5D,%0A self.opts%5B'timeout'%5D,%0A %5D%0A
%0A
@@ -96... |
6f0676877f5c23c0e6d04422cb8365e16958eb82 | document potential for streaming | camerav4.py | camerav4.py | import picamera
from picamera import PiCamera
import time
from datetime import datetime
import os.path
from subprocess32 import Popen
print "\nSecurity Camera Logger v3 | Ben Broce & William Hampton\n\n"
print "Streams video to vids/vidstream.h264 | Captures to pics/[timestamp].jpg"
print "Ctrl-C quits.\n\n"
stream =... | Python | 0 | @@ -527,16 +527,272 @@
ng...%22%0A%0A
+#http://www.raspberry-projects.com/pi/pi-hardware/raspberry-pi-camera/streaming-video-using-vlc-player%0A#http://www.diveintopython.net/scripts_and_streams/stdin_stdout_stderr.html%0A#Ouput video (record) =%3E stream =%3E stdout =%3E %7C =%3E cvlc livestream =%3E browser%0A
if s... |
6cce83bfcaf2072f57f15fb8d05e89c6d8ef56b6 | load from credentials.oracle, not credentials | database.py | database.py | #!/usr/bin/python
import MySQLdb, datetime, httplib, json, os
class mysql_database:
def __init__(self, host, user, password, db):
self.connection = MySQLdb.connect(host, user, password, db)
self.cursor = self.connection.cursor()
def execute(self, query):
try:
self.cursor.ex... | Python | 0.000019 | @@ -953,16 +953,23 @@
dentials
+.oracle
%22)%0A
|
37e2813d2b972100e7a562fe99cde72c99f5a544 | Add handler to create token when a user is created | popit/signals/handlers.py | popit/signals/handlers.py | # TODO: Implement for each
from django.db.models.signals import pre_delete
from django.db.models.signals import post_save
from django.dispatch import receiver
from popit.models import Person
from popit.models import Organization
from popit.models import Membership
from popit.models import Post
from popit.serializers im... | Python | 0 | @@ -1,31 +1,4 @@
-# TODO: Implement for each%0A
from
@@ -125,16 +125,60 @@
eceiver%0A
+from django.contrib.auth.models import User%0A
from pop
@@ -539,16 +539,66 @@
search%0A
+from rest_framework.authtoken.models import Token%0A
%0A%0A@recei
@@ -3501,28 +3501,195 @@
indexer.delete(instance)
+%0A%0A%0A@receiv... |
28d27274336ca4c84d732418b86292fe0f8b2634 | Update pseudocolor.py | plantcv/plantcv/pseudocolor.py | plantcv/plantcv/pseudocolor.py | # Pseudocolor any grayscale image
import os
import cv2
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import *
from plantcv.plantcv import params
from plantcv.plantcv import plot_image
from plantcv.plantcv import fatal_error
def pseudocolor(gray_img, mask=None, cmap=None, background="image",... | Python | 0.000002 | @@ -1341,35 +1341,39 @@
aram min_value:
-int
+numeric
%0A :param max_
@@ -1379,19 +1379,23 @@
_value:
-int
+numeric
%0A :pa
|
9b237bc260d4f78ddc97b8d678d36076d22178e6 | use custom vm | datastax.py | datastax.py | import yaml
import base64
import json
def GenerateFirewall(context):
name = context.env['deployment'] + '-opscenterfirewall-' + context.env['name']
firewalls = [
{
'name': name,
'type': 'compute.v1.firewall',
'properties': {
'sourceRanges': [
... | Python | 0 | @@ -1243,39 +1243,39 @@
v1/projects/
-ubuntu-os-cloud
+datastax-public
/global/imag
@@ -1281,36 +1281,40 @@
ges/
+datastax-
ubuntu
--
1404-
-trusty-v20160314
+img-03172016
',%0A
@@ -4544,23 +4544,23 @@
cts/
-ubuntu-os-cloud
+datastax-public
/glo
@@ -4574,36 +4574,40 @@
ges/
+datastax-
ubuntu
--
1404-
-trust... |
5f46c92ccaeb273e0d3422b65f983aaf327e8f5a | drop more unused code | datastax.py | datastax.py | import yaml
import base64
import json
def GenerateFirewall(context):
name = 'opscenterfirewall-' + context.env['name']
firewalls = [
{
'name': name,
'type': 'compute.v1.firewall',
'properties': {
'sourceRanges': [
'0.0.0.0/0'
... | Python | 0 | @@ -9,34 +9,8 @@
aml%0A
-import base64%0Aimport json%0A
%0A%0Ade
@@ -991,271 +991,8 @@
%5D%7D%0A%0A
- #seed_nodes_dns_names = ''%0A #for zone in context.properties%5B'zones'%5D:%0A # seed_nodes_dns_names += context.env%5B'deployment'%5D + '-service-' + zone + '-1-vm,'%0A #seed_nodes_dns_names = seed_n... |
48a30aade7e606e671db44e8ee69092c0e67b363 | Complete lc051_n_queens.py | lc051_n_queens.py | lc051_n_queens.py | """Leetcode 51. N-Queens.
Hard.
URL: https://leetcode.com/problems/n-queens/
The n-queens puzzle is the problem of placing n queens on an nxn chessboard
such that no two queens attack each other.
Given an integer n, return all distinct solutions to the n-queens puzzle.
Each solution contains a distinct board confi... | Python | 0.99916 | @@ -764,16 +764,38 @@
is valid
+ among previous queens
.%22%22%22%0A
@@ -1165,27 +1165,19 @@
def
-solveNQueen
+_df
s(self,
@@ -1182,24 +1182,27 @@
, n, res
+=%5B%5D
, queens
):%0A
@@ -1185,32 +1185,35 @@
, res=%5B%5D, queens
+=%5B%5D
):%0A %22%22%22%0A
@@ -1214,141 +1214,55 @@
%22%22%22... |
16c1ae09e0288036aae87eb4337c24b23b1e6638 | Clean up some unused imports and comments | classify.py | classify.py | from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.neighbors import KNeighborsRegressor
from sklearn.ensemble import RandomForestRegressor
from sklearn.pipeline import Pipeline
import numpy as np
import json
import sys
import time
from analyze import Analyzer # for some train data labelling
def m... | Python | 0 | @@ -57,58 +57,8 @@
zer%0A
-from sklearn.neighbors import KNeighborsRegressor%0A
from
@@ -188,20 +188,8 @@
sys%0A
-import time%0A
from
@@ -795,48 +795,8 @@
())%0A
- #('clf', KNeighborsRegressor())%0A
|
4f3d1e90ec4af618ada415f53ddd9eec42bafb38 | Indent with 4 spaces, not 3 | wafer/talks/tests/test_wafer_basic_talks.py | wafer/talks/tests/test_wafer_basic_talks.py | # This tests the very basic talk stuff, to ensure some levels of sanity
def test_add_talk():
"""Create a user and add a talk to it"""
from django.contrib.auth.models import User
from wafer.talks.models import Talks
user = User.objects.create_user('john', 'best@wafer.test', 'johnpassword')
talk = Talks... | Python | 0.998158 | @@ -91,16 +91,17 @@
k():%0A
+
%22%22%22Creat
@@ -133,16 +133,17 @@
o it%22%22%22%0A
+
from
@@ -184,16 +184,17 @@
User%0A
+
from waf
@@ -223,16 +223,17 @@
Talks%0A%0A
+
user
@@ -305,16 +305,17 @@
rd')%0A
+
talk = T
@@ -363,16 +363,17 @@
talk%22,%0A
+
@@ -452,16 +452,17 @@
... |
82f648557d3c14568811038a63d766d3d84a9b79 | Fix dataverse upload bug | waterbutler/providers/dataverse/provider.py | waterbutler/providers/dataverse/provider.py | import asyncio
import http
import tempfile
import xmltodict
from waterbutler.core import streams
from waterbutler.core import provider
from waterbutler.core import exceptions
from waterbutler.providers.dataverse import settings
from waterbutler.providers.dataverse.metadata import DataverseDatasetMetadata
from waterbu... | Python | 0.000001 | @@ -3356,16 +3356,20 @@
lf, path
+='/'
, state=
|
7b0a6d27389f8e4abde77b2ed76dac795c33cfab | Use url_for | demo/app.py | demo/app.py | import flask
from flask import request
from markupsafe import Markup
import diffhtml
app = flask.Flask('Diff-HTML Demo')
DEFAULT_A = """
I am the very model of a modern Major-General,
I've information vegetable, animal, and mineral,
I know the kings of England, and I quote the fights historical,
From Marathon to ... | Python | 0.000354 | @@ -1234,17 +1234,31 @@
ect(
+flask.url_for(
'
-/
ndiff')
+)
%0A%0A%0Ai
|
dd249ca665f21f574d9ff992e0cd3e78433c7fa7 | Use printf-style String Formatting for output | sanic/response.py | sanic/response.py | import ujson
STATUS_CODES = {
200: 'OK',
400: 'Bad Request',
401: 'Unauthorized',
402: 'Payment Required',
403: 'Forbidden',
404: 'Not Found',
405: 'Method Not Allowed',
500: 'Internal Server Error',
501: 'Not Implemented',
502: 'Bad Gateway',
503: 'Service Unav... | Python | 0.000006 | @@ -36,16 +36,17 @@
200:
+b
'OK',%0D%0A
@@ -53,16 +53,17 @@
400:
+b
'Bad Req
@@ -79,16 +79,17 @@
401:
+b
'Unautho
@@ -106,16 +106,17 @@
402:
+b
'Payment
@@ -137,16 +137,17 @@
403:
+b
'Forbidd
@@ -161,16 +161,17 @@
404:
+b
'Not Fou
@@ -185,16 +185,17 @@
405:
+b
'Method
@@ -218... |
6662067dd688a61417252712b4f8cbdf8da74798 | Version bump 0.1.29 | swf/__init__.py | swf/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
version = (0, 1, 28)
__title__ = "python-simple-workflow"
__author__ = "Oleiade"
__license__ = "MIT"
__version__ = '.'.join(map(str, version))
| Python | 0 | @@ -58,17 +58,17 @@
(0, 1, 2
-8
+9
)%0A%0A__tit
|
68b2e1cb5a914d408761229bd27677e80967f5ff | Remove unused import. | hashbrown/management/commands/switches.py | hashbrown/management/commands/switches.py | from optparse import make_option
from django.core.management.base import BaseCommand
from django.utils.six.moves import input
from hashbrown.models import Switch
from hashbrown.utils import SETTINGS_KEY, is_active, get_defaults
class Command(BaseCommand):
help = 'Creates / deletes feature switches in the databa... | Python | 0 | @@ -1,38 +1,4 @@
-from optparse import make_option%0A%0A
from
|
6876fc6339fe91ea21b573dc23cb989561f6192a | Use lazy util to refresh img-list in event model. | hhlevents/apps/hhlregistrations/models.py | hhlevents/apps/hhlregistrations/models.py | import datetime
import uuid
from glob import glob
from os.path import basename
from django.db import models
from django_markdown.models import MarkdownField
from django_markdown.fields import MarkdownFormField
from happenings.models import Event as HappeningsEvent
from happenings.utils.next_event import get_next_event
... | Python | 0 | @@ -465,16 +465,57 @@
equired%0A
+from django.utils.functional import lazy%0A
from dat
@@ -570,52 +570,36 @@
gs%0A%0A
-%0A
-class Event(HappeningsEvent):%0A # Get all
+# Always get a fresh list of
png
@@ -627,22 +627,34 @@
mg/%0A
-
+def
IMAGES
- = (
+():%0A return %5B
(%22/
@@ -678,17 +678,16 @@
nam... |
ac85a3ce64ea815fd3530085c085e384cf8269fb | Use pydeconz interface controls for button platform (#74654) | homeassistant/components/deconz/button.py | homeassistant/components/deconz/button.py | """Support for deCONZ buttons."""
from __future__ import annotations
from dataclasses import dataclass
from pydeconz.models.event import EventType
from pydeconz.models.scene import Scene as PydeconzScene
from homeassistant.components.button import (
DOMAIN,
ButtonEntity,
ButtonEntityDescription,
)
from ... | Python | 0 | @@ -2608,21 +2608,57 @@
ttr(
-self._device,
+%0A self.gateway.api.scenes,%0A
sel
@@ -2687,16 +2687,26 @@
utton_fn
+,%0A
)%0A
@@ -2729,16 +2729,54 @@
tton_fn(
+self._device.group_id, self._device.id
)%0A%0A d
|
8c657d4254a1f64f2b8efebef429d0e685fe0f26 | use the input stream codec as the template for the output streams (#22747) | homeassistant/components/stream/worker.py | homeassistant/components/stream/worker.py | """Provides the worker thread needed for processing streams."""
from fractions import Fraction
import io
import logging
from .const import AUDIO_SAMPLE_RATE
from .core import Segment, StreamBuffer
_LOGGER = logging.getLogger(__name__)
def generate_audio_frame():
"""Generate a blank audio frame."""
from av i... | Python | 0 | @@ -1040,158 +1040,30 @@
eam(
-%0A stream_output.video_codec, video_stream.rate)%0A # Fix format%0A vstream.codec_context.format = %5C%0A video_stream.codec_context.format
+template=video_stream)
%0A
|
9b529f2ba00c4ee76b571ef1c27faada89e4bc29 | Add full compatibility functions. | alchy/_compat.py | alchy/_compat.py | #pylint: skip-file
'''Python 2/3 compatibility
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
Borrowed from https://github.com/mitsuhiko/flask/blob/master/flask/_compat.py
'''
import sys
PY2 = sys.version_info[0] ==... | Python | 0 | @@ -316,16 +316,40 @@
0%5D == 2%0A
+_identity = lambda x: x%0A
%0A%0Aif not
@@ -555,16 +555,227 @@
tems())%0A
+%0A from io import StringIO%0A%0A def reraise(tp, value, tb=None):%0A if value.__traceback__ is not tb:%0A raise value.with_traceback(tb)%0A raise value%0A%0A implements_to... |
b241f242b6eae6c2c19a6fe0336933c22998f262 | deal with negative RAs | bin/full_map_any_sky.py | bin/full_map_any_sky.py |
#!/usr/bin/env python
import sys
import os
import numpy as N
from pylab import *
import matplotlib.pyplot as P
import matplotlib.patches as mpatches
def readmulticolumn(f,names,types):
for line in f:
line=line.strip()
if line.startswith('#') or len(line)==0:
continue
items=... | Python | 0.00002 | @@ -1470,9 +1470,12 @@
_max
-%7C
+ or
mra%3E
|
114d7bc6b45d18f528a7ed5c12e1938e35efb93c | Update hash_db_password.py | bin/hash_db_password.py | bin/hash_db_password.py | import sys
from werkzeug.security import generate_password_hash
from flask_appbuilder.security.models import User
try:
from app import app, db
except:
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
if len(sys.argv) < 2:
print "Without typical app structure use parameter t... | Python | 0.000071 | @@ -771,16 +771,8 @@
at(e
-.message
)%0A
|
3224a95d79f6e3166e235f4cfc857a48d1b17c52 | Revise docstring: memoization | alg_fibonacci.py | alg_fibonacci.py | """Fibonacci series:
0, 1, 1, 2, 3, 5, 8,...
- Fib(0) = 0
- Fib(1) = 1
- Fib(n) = Fib(n - 1) + Fib(n - 2)
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def fibonacci_recur(n):
"""Get the nth number of Fibonacci series, Fn, by recursion.
-... | Python | 0.998763 | @@ -580,25 +580,24 @@
Fn, by memo
-r
ization.%0A%0A
|
2ac49aacb0f9e7c15b48119bff13be45e9b3616d | Switch to compression to blosc as its faster than gzip | jax/experimental/gda_serialization/serialization.py | jax/experimental/gda_serialization/serialization.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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -1959,12 +1959,13 @@
': '
-gzip
+blosc
'%0A
|
858e84f336f76a1e65b730834ad8ffb346ee6b0f | fix logger singleton to work with pyjd | examples/mail/Logger.py | examples/mail/Logger.py | from pyjamas.ui.Grid import Grid
_logger = None
class Logger(Grid):
def __new__(cls):
global _logger
# make sure there is only one instance of this class
if _logger:
return _logger
_logger = Grid.__new__(cls)
return _logger
def __init__(self, target="", mes... | Python | 0.000007 | @@ -59,16 +59,19 @@
gger
+Cls
(Grid):%0A
@@ -70,510 +70,32 @@
d):%0A
- def __new__(cls):%0A global _logger%0A # make sure there is only one instance of this class%0A if _logger:%0A return _logger%0A _logger = Grid.__new__(cls)%0A return _logger%0A%0A def __in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.