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 |
|---|---|---|---|---|---|---|---|
2e46b8b4bc5270dca1a515b883db174dd7af59f3 | Fix the 64 bit build on Linux by adding -fPIC. | ppapi.gyp | ppapi.gyp | # Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'ppapi_c',
'type': 'none',
'direct_dependent_settings': {
'include_dirs': [
'... | Python | 0.000026 | @@ -1605,32 +1605,200 @@
8',%0A %7D%5D,%0A
+ %5B'OS==%22linux%22 or OS==%22openbsd%22 or OS==%22freebsd%22 and (target_arch==%22x64%22 or target_arch==%22arm%22) and linux_fpic!=1', %7B%0A 'cflags': %5B'-fPIC'%5D,%0A %7D%5D,%0A
%5D,%0A %7D,%0A
|
381990dc85b273129135e815e1701586062bc34a | fix filename for linux | integration_tests/test_write_without_handles.py | integration_tests/test_write_without_handles.py | # Copyright (c) 2020, Manfred Moitzi
# License: MIT License
import os
import pytest
import ezdxf
from ezdxf.lldxf.tagger import ascii_tags_loader
from ezdxf.lldxf.loader import load_dxf_structure
BASEDIR = os.path.dirname(__file__)
DATADIR = 'data'
@pytest.fixture(params=["POLI-ALL210_12.dxf"])
def filename(reques... | Python | 0.001164 | @@ -287,19 +287,19 @@
L210_12.
-dxf
+DXF
%22%5D)%0Adef
|
2468080009bde1aac156c7fb48972d8ff29f2c2e | Enable HTTPS option for social auth | tola/settings/local.py | tola/settings/local.py | from base import *
import os
try:
DATABASES = {
'default': {
'ENGINE': os.environ["TOLA_DB_ENGINE"],
'NAME': os.environ["TOLA_DB_NAME"],
'USER': os.environ["TOLA_DB_USER"],
'PASSWORD': os.environ["TOLA_DB_PASS"],
'HOST': os.environ["TOLA_DB_HOST"]... | Python | 0.000003 | @@ -1758,16 +1758,121 @@
RET = ''
+%0A%0ASOCIAL_AUTH_REDIRECT_IS_HTTPS = True if os.getenv('SOCIAL_AUTH_REDIRECT_IS_HTTPS') == 'True' else False
%0ASOCIAL_
|
7b3672288a6089b7ce3bc10590988e020bb944e9 | Remove unused import | sktracker/io/tests/test_objectsio.py | sktracker/io/tests/test_objectsio.py | import os
import tempfile
from nose import with_setup
from sktracker import data
from sktracker.io import StackIO
from sktracker.io import ObjectsIO
from sktracker.detection import peak_detector
from sktracker.io import validate_metadata
def test_objectsio():
fname = data.CZT_peaks()
st = StackIO(fname, j... | Python | 0.000001 | @@ -24,37 +24,8 @@
le%0A%0A
-from nose import with_setup%0A%0A
from
|
ee52ce5efffc10a1d1f8c97d889a43b47083cae2 | add category | MellPlayer/ui.py | MellPlayer/ui.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Netease Music UI
Created on 2017-02-21
@author: Mellcap
'''
import os
SONG_CATEGORIES = (
'流行', '摇滚', '民谣', '说唱', '轻音乐', '乡村', '古典', 'R&B/Soul', '电子', '另类/独立',\
'学习', '工作', '午休',\
'华语', '欧美', '日语', '韩语', '粤语', '小语种',\
'怀旧', '清新', '浪漫', '性感', '治愈', '... | Python | 0.001148 | @@ -172,16 +172,22 @@
, '%E8%BD%BB%E9%9F%B3%E4%B9%90',
+ '%E7%88%B5%E5%A3%AB',
'%E4%B9%A1%E6%9D%91', '
@@ -208,16 +208,22 @@
', '%E7%94%B5%E5%AD%90',
+ '%E8%88%9E%E6%9B%B2',
'%E5%8F%A6%E7%B1%BB/%E7%8B%AC%E7%AB%8B'
@@ -246,16 +246,27 @@
', '%E5%8D%88%E4%BC%91',
+ '%E6%B8%85%E6%99%A8', '%E5%A4%9C%E6%99%9A'
%5C%0A... |
216b95e50cd3a4d2ac306dde4744b0bf6f160aa7 | Add iostreams to available boost libraries in cxx/boost.py | src/drake/cxx/boost.py | src/drake/cxx/boost.py | # Copyright (C) 2009-2011, Quentin "mefyl" Hocquet
#
# This software is provided "as is" without warranty of any kind,
# either expressed or implied, including but not limited to the
# implied warranties of fitness for a particular purpose.
#
# See the LICENSE file for more information.
import drake
import drake.cxx
i... | Python | 0 | @@ -821,16 +821,52 @@
hrono',%0A
+ 'iostreams': 'boost_iostreams',%0A
%7D%0A%0A
|
2574552efdca9322a3579cc814cc0e268688ce6d | add permission checkers | utils/check.py | utils/check.py | import discord
from discord.ext.commands import check
def owner():
def checker(ctx):
return ctx.message.author.id in ctx.bot.owners
return check(checker)
def guild():
def checker(ctx):
return not ctx.is_dm()
return check(checker)
def roles(*roles: int):
def checker(ctx):
... | Python | 0.000001 | @@ -40,16 +40,25 @@
s import
+ Context,
check%0A%0A
@@ -67,24 +67,66 @@
ef owner():%0A
+ %22%22%22Check if caller is a bot owner%22%22%22%0A%0A
def chec
@@ -124,32 +124,41 @@
def checker(ctx
+: Context
):%0A retur
@@ -159,32 +159,24 @@
return ctx.
-message.
author.id in
@@ -229,24 +229,62 @@
e... |
a2f9ba16d6fa80c674b198921f463397f3d98131 | simplify sort_function_weight using cmp() | src/pondus/gui/guiutil.py | src/pondus/gui/guiutil.py | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
"""
This file is part of Pondus, a personal weight manager.
Copyright (C) 2007-08 Eike Nicklas <eike@ephys.de>
This program 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 Fou... | Python | 0.000051 | @@ -1092,75 +1092,35 @@
-if weight1 %3C weight2:%0A return -1%0A elif
+return cmp(
weight1
- ==
+,
weight2
:%0A
@@ -1119,53 +1119,9 @@
ght2
-:%0A return 0%0A else:%0A return 1
+)
%0A%0Ade
|
af4ccf50b218acb6ec97d691fb095d0160895c79 | Use loc to apply filtering to df directly. | analysis/smooth-data.py | analysis/smooth-data.py | #!/usr/bin/env python
import climate
import joblib
import numpy as np
import pandas as pd
import pypropack
import scipy.signal
import database
logging = climate.get_logger('smooth')
def marker_channel_columns(df, min_filled=0):
'''Return the names of columns that contain marker data.'''
return [c for c in ... | Python | 0 | @@ -5204,17 +5204,24 @@
df
-%5B
+.loc%5B:,
c%5D = sci
|
3df82afe6cc46d02bc41b86cb432331541ff96d0 | added formatted_total_time and formatted_average_time to return a nicely formated time string. added total_hours/minutes/seconds/years properties | anonymoususage/timer.py | anonymoususage/timer.py | __author__ = 'calvin'
import datetime
import logging
logger = logging.getLogger('AnonymousUsage')
from .statistic import Statistic
class Timer(Statistic):
"""
A timer is a special case of a Statistic where the count is the number of elapsed seconds. A Timer object can be
started and stopped in order t... | Python | 0.999929 | @@ -46,16 +46,28 @@
logging
+%0Aimport time
%0A%0Alogger
@@ -1403,32 +1403,1494 @@
' %25 self.name)%0A%0A
+ @property%0A def total_minutes(self):%0A return self.count / 60.%0A%0A @property%0A def total_hours(self):%0A return self.count / 3600.%0A%0A @property%0A def total_seconds(sel... |
8db6989f0cf2fcdd1433bfe731514f4f6de4bd0e | add basic similiarity function for lda | src/project/lda_corpus.py | src/project/lda_corpus.py | import sys
import datetime
from os.path import isdir, isfile
from gensim import models
from corpus import Corpus
from gensim.similarities import Similarity
class LDACorpus(Corpus):
def __init__(self, dictionary=None, corpus=None, lda_corpus=None, no_topics=100, update=1, chunksize=10000, passes=1, max_docs=None,... | Python | 0.000001 | @@ -1805,16 +1805,174 @@
tures)%0A%0A
+ def run_query(self, query, index_location):%0A if not self.sim_index: self._build_sim_index(index_dir=index_location)%0A # Do some query stuff%0A%0A
%0Adef mai
|
833cdb4b6fb2890039c110a1b60d16c44d4d61dd | increase version to 1.4.6 | src/pyscipopt/__init__.py | src/pyscipopt/__init__.py | __version__ = '1.4.5'
# export user-relevant objects:
from pyscipopt.Multidict import multidict
from pyscipopt.scip import Model
from pyscipopt.scip import Branchrule
from pyscipopt.scip import Conshdlr
from pyscipopt.scip import Eventhdlr
from pyscipopt.scip import Heur
from pyscipopt.scip ... | Python | 0.008209 | @@ -16,9 +16,9 @@
1.4.
-5
+6
'%0A%0A#
|
e841d3f099ff3b035919fff5a9cc0202010a9286 | add later checks, post optimization | src/python/pyqgl2/main.py | src/python/pyqgl2/main.py | #!/usr/bin/env python3
#
# Copyright 2015 by Raytheon BBN Technologies Corp. All Rights Reserved.
#
"""
Test driver for the pyqgl2 program
Located in the source directory for the sake of simplicity
during prototyping/debugging. The real driver is in scripts/qgl2prep
(although it may be renamed).
"""
import os
impo... | Python | 0 | @@ -923,16 +923,66 @@
kSymtab%0A
+from pyqgl2.check_waveforms import CheckWaveforms%0A
from pyq
@@ -3746,16 +3746,238 @@
(text)%0A%0A
+ type_check = CheckType(opts.filename, importer=importer)%0A new_ptree5 = type_check.visit(new_ptree4)%0A%0A wav_check = CheckWaveforms(opts.filename, type_check.func_defs)%... |
680a156dd2b1e34e45784482663af7b8ed47c2ab | Make our linter happy. | ingestors/__init__.py | ingestors/__init__.py | """Provides a set of ingestors based on different file types."""
from .doc import DocumentIngestor # noqa
from .html import HTMLIngestor # noqa
from .image import ImageIngestor # noqa
from .pdf import PDFIngestor # noqa
from .tabular import TabularIngestor # noqa
from .text import TextIngestor # noqa
__version_... | Python | 0 | @@ -573,11 +573,9 @@
rn:
-A t
+T
uple
|
0425ea0c496bea2779c2b375404534e1fdd05d44 | Update version to 2.10dev | version_st2.py | version_st2.py | # Copyright 2016 - StackStorm, Inc.
#
# 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 | @@ -622,10 +622,11 @@
= '
-3.
+2.1
0dev
|
c17888376413f2869f1dc10d3b8d829baf86637b | Allow the default db to come from env var (#494) | tools/config-editor.py | tools/config-editor.py | #!/usr/bin/env python3
import argparse
import json
import os
import sqlite3
import subprocess
import sys
import tempfile
_CONFIG_DATABASE = '/home/pi/mozilla-iot/gateway/db.sqlite3'
_DEFAULT_EDITOR = 'nano'
def main():
parser = argparse.ArgumentParser(
description='View and edit add-on configs.')
p... | Python | 0 | @@ -118,22 +118,23 @@
file%0A%0A%0A_
-CONFIG
+DEFAULT
_DATABAS
@@ -705,46 +705,141 @@
-if not os.path.isfile(_CONFIG_DATABASE
+database = os.getenv('MOZIOT_DATABASE')%0A if not database:%0A database = _DEFAULT_DATABASE%0A%0A if not os.path.isfile(database
):%0A
@@ -965,24 +965,16 @@
ect(
-_CONFI... |
002bd3b2208759db28d9be00e0ad80019e330971 | Add admin users auth to core/person api | core/views/api_person_views.py | core/views/api_person_views.py | from rest_framework.views import APIView
from rest_framework.views import Response
from rest_framework.views import Request
from rest_framework import status
from django.shortcuts import get_object_or_404
from core.models import Person
from core.serializers import PersonSerializer
class PersonList(APIView):
"""... | Python | 0 | @@ -150,16 +150,71 @@
t status
+%0Afrom rest_framework import authentication, permissions
%0A%0Afrom d
@@ -485,23 +485,233 @@
person%0A
- %22%22%22
+%0A * Requires token authentication.%0A * Only admin users are able to access this view.%0A %22%22%22%0A authentication_classes = (authentication.TokenA... |
dc5581f8ee34d38cb570812cc203ee9975f083ff | Fix flake8 issues. | vispy/geometry/__init__.py | vispy/geometry/__init__.py | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
This module implements classes and methods for handling geometric data.
"""
from __future__ import division
__all__ = ['MeshData', 'PolygonData', 'Rect', 'Triangulation'... | Python | 0 | @@ -797,16 +797,17 @@
import
+(
create_a
@@ -841,64 +841,117 @@
ne,
-create_cube, %5C%0A create_cylinder, create_plane,
+ # noqa%0A create_cube, create_cylinder, create_plane, # noqa%0A
cre
@@ -960,16 +960,17 @@
e_sphere
+)
# noqa
|
86d60cdfa4136a1d748120d5b764e64f70af7e5a | bump version | vkontakte_wall/__init__.py | vkontakte_wall/__init__.py | VERSION = (0, 5, 9)
__version__ = '.'.join(map(str, VERSION)) | Python | 0 | @@ -14,9 +14,10 @@
5,
-9
+10
)%0A__
|
9cd307d0ae9910996bedb80962eef7a032604c87 | disable object_api tests if workspace is not available | lib/doekbase/data_api/tests/test_object_api.py | lib/doekbase/data_api/tests/test_object_api.py | """
Unit tests for genome_annotation
"""
import logging
from unittest import skipUnless
from . import shared
from doekbase.data_api.core import ObjectAPI
_log = logging.getLogger(__name__)
t_ref = "ReferenceTaxons/242159_taxon"
t = None
def setup():
shared.setup()
global t
t = ObjectAPI(shared.servic... | Python | 0.000001 | @@ -1197,16 +1197,79 @@
entry%0A%0A%0A
+@skipUnless(shared.can_connect, 'Cannot connect to workspace')%0A
def test
@@ -1420,32 +1420,95 @@
schema, list)%0A%0A%0A
+@skipUnless(shared.can_connect, 'Cannot connect to workspace')%0A
def test_get_typ
@@ -1743,32 +1743,95 @@
pestring) %3E 0%0A%0A%0A
+@skipUnless(shared.... |
7a97000b57a46bf58a9c5db9e23e7fda035148cf | Use __import__ for python <2.7 | pydoop.py | pydoop.py | #!/usr/bin/env python
# encoding: utf-8
'''
pydoop -- a simple concurrent job execution library
'''
import sys
import os
from optparse import OptionParser
import importlib
def import_func(mod_file, func_name):
mod_name = os.path.basename(mod_file).split('.')
mod_name = mod_name[0]
try:
mod = imp... | Python | 0.995671 | @@ -153,24 +153,102 @@
ser%0A
+try:%0A from
import
+lib
import
-lib
+ import_module as import_mod%0Aexcept:%0A import_mod = __import__
%0A%0A%0Ad
@@ -392,18 +392,8 @@
d =
-importlib.
impo
@@ -398,19 +398,16 @@
port_mod
-ule
(mod_nam
@@ -3546,8 +3546,9 @@
(main())
+%0A
|
890a42bdf7f54b5907f7cc39832ea9f07fa18569 | Update list of key changes with version in __init__.py | src/rocommand/__init__.py | src/rocommand/__init__.py | # __init__.py
#__version__ = "0.2.1" # Initial version with installation package
#__version__ = "0.2.2" # Updated README documentation for PyPI page
#__version__ = "0.2.3" # Experimenting with distribution options
#__version__ = "0.2.4" # Added MANIFEST.in so that data files are part of sdist
#_... | Python | 0.000004 | @@ -1002,17 +1002,16 @@
renderin
-m
g traffi
@@ -1027,16 +1027,16 @@
isplays%0A
+
#__versi
@@ -1129,8 +1129,528 @@
#
-??%0A
+Fix problem evaluating RO with space in URI%0A # RDFReport add escaping support; escape quotes in JSON strings%0A # Fix problem with ... |
1533e8e0c3d86fafde5ca6796fa13814aab08f82 | Fix hostname typo in nodepool inventory | inventory/nodepool.py | inventory/nodepool.py | #!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwar... | Python | 0.000013 | @@ -2730,16 +2730,17 @@
== 'log
+s
.multino
|
0e5dc67fc42bd3b43391e233655bd93e29d2b4cb | change name of lightsoff function for consistency with other function names | pyglow.py | pyglow.py | ##
## PyGlow
##
## python module to control Pimoronis PiGlow (http://shop.pimoroni.com/products/piglow)
##
## for info & documentation see: https://github.com/benleb/PYGlow
##
import re, sys
import RPi.GPIO as rpi
from smbus import SMBus
bus = 0
class PyGlow:
def __init__(self):
## check ... | Python | 0 | @@ -1147,24 +1147,25 @@
lights
+_
off(%22usage:
@@ -1179,16 +1179,16 @@
255%5D)%22)%0A
-
%0A%0A de
@@ -1712,32 +1712,33 @@
self.lights
+_
off(%22usage: arm(
@@ -2581,32 +2581,33 @@
self.lights
+_
off(%22usage: colo
@@ -3598,24 +3598,25 @@
self.lights
+_
off(%22usage:
@@ -3926,32 +3926,32... |
60870a3e471637d44da32f3aac74064e4ca60208 | Use `set_defaults` of subparser to launch scripts | pyplot.py | pyplot.py | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""Module to bundle plotting scripts
`activate-global-python-argcomplete` must be run to enable auto completion """
import argparse
import argcomplete
import plotter
def parse_arguments():
"""Argument Parser, providing available scripts"""
parser = argparse.Argum... | Python | 0 | @@ -442,17 +442,49 @@
scripts'
+,%0A dest='used_subparser',
%0A
-
)%0A
@@ -579,27 +579,19 @@
__('
-.'.join(('
plotter
-',
+.' +
mod
@@ -601,10 +601,8 @@
_str
-))
, fr
@@ -807,24 +807,91 @@
%5D%0A )%0A
+ module_subparser%5Bmodule_str%5D.set_defaults(run=module.main)%0A
configur
... |
3232f591fec29916c71e19e3076243561830b813 | bump version | pyssdb.py | pyssdb.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
pyssdb
~~~~~~~
A SSDB Client Library for Python.
:copyright: (c) 2013 by Yue Du.
:license: BSD 2-clause License, see LICENSE for more details.
'''
__version__ = '0.1.0'
__author__ = 'Yue Du <ifduyue@gmail.com>'
__url__ = 'https://github.com/ifduyue/pyssdb'
__license_... | Python | 0 | @@ -212,17 +212,17 @@
= '0.1.
-0
+1
'%0A__auth
|
1fcf312a2d431b88a4792d6f3a3502286e88528e | def main | pytest.py | pytest.py | '''Print args
'''
import argparse
import sys
p = argparse.ArgumentParser(
description=__doc__
)
p.add_argument(
'msgs',
action='store',
nargs='*',
help='msgs to print'
)
ns = p.parse_args(sys.argv[1:])
for msg in ns.msgs:
print(msg)
sys.exit(0)
| Python | 0.998878 | @@ -39,16 +39,33 @@
rt sys%0A%0A
+def main(args):%0A%09
p = argp
@@ -85,16 +85,17 @@
Parser(%0A
+%09
%09descrip
@@ -107,18 +107,20 @@
__doc__%0A
+%09
)%0A
+%09
p.add_ar
@@ -127,16 +127,17 @@
gument(%0A
+%09
%09'msgs',
@@ -137,16 +137,17 @@
'msgs',%0A
+%09
%09action=
@@ -155,16 +155,17 @@
store',%0A
+%09
%0... |
51aae21ce211abc9897b989c233f22507813ecf2 | Add a pondmen column | openfisca_france_indirect_taxation/model/input_variables.py | openfisca_france_indirect_taxation/model/input_variables.py | # -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify
# it ... | Python | 0.000077 | @@ -1010,17 +1010,26 @@
ndividus
+, Menages
%0A
-
%0A%0Arefere
@@ -1340,16 +1340,20 @@
me = 'id
+ent_
men',%0A
@@ -1488,32 +1488,32 @@
ans le m%C3%A9nage%22,%0A
-
name = 'quim
@@ -1517,32 +1517,200 @@
uimen',%0A )%0A%0A%0A
+reference_input_variable(%0A column = IntCol,%0A entity_class = Menages,%... |
5fdba074d9e8a03d57f680bd70dc733d5ed352a1 | Use unittest.TestCase method. Check file existence before deleting it. | tests/chainer_tests/datasets_tests/test_cifar.py | tests/chainer_tests/datasets_tests/test_cifar.py | import mock
import os
import unittest
import numpy
from chainer.dataset import download
from chainer.datasets import get_cifar10
from chainer.datasets import get_cifar100
from chainer.datasets import tuple_dataset
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product({
... | Python | 0 | @@ -622,16 +622,53 @@
d_file')
+ and os.path.exists(self.cached_file)
:%0A
@@ -1264,34 +1264,38 @@
+self.
assert
- isi
+IsI
nstance(cifa
@@ -1304,16 +1304,54 @@
dataset,
+%0A
tuple_d
@@ -1468,18 +1468,22 @@
+self.
assert
- isi
+IsI
nsta
|
f7a6aa0434a13df6806bdedb885756d6179220db | fix course lesson 3 data prep test | tests/course/tests/lesson_3_data_prepare_test.py | tests/course/tests/lesson_3_data_prepare_test.py | # third party
import pytest
from testbook import testbook
@pytest.fixture(scope="module")
def tb():
with testbook("../courses/L3_DataPreparation.ipynb", execute=True) as tb:
yield tb
def test_data_acquisition(tb):
assert tb.cell_output_text(8) == "(2280, 451)"
def test_quality_check(tb):
asser... | Python | 0.000006 | @@ -447,43 +447,8 @@
- tb.cell_output_text(31)%0A ==
%22ra
@@ -555,38 +555,22 @@
'%3E%22%0A
-)%0A
-assert (%0A
+in
tb.cell
@@ -587,21 +587,37 @@
xt(3
-2
+1
)%0A
+)%0A
-==
+assert (%0A
%22te
@@ -711,38 +711,22 @@
'%3E%22%0A
-)%0A
-assert (%0A
+in
... |
fb5c92741243756516fa50073d34e94ba0b6981e | Generalize projection-matrix-removal script (#3430) | projects/anti_scaling/scripts/remove_projection_matrices.py | projects/anti_scaling/scripts/remove_projection_matrices.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import shutil
import torch
from parlai.utils import pickle
from parlai.utils.io import PathManager
fro... | Python | 0.000005 | @@ -212,22 +212,8 @@
arse
-%0Aimport shutil
%0A%0Aim
@@ -572,30 +572,37 @@
le%7D.
+_orig.
')%0A
-shutil
+PathManager
.copy
-file
(mod
|
56a45a124a9e6ec6ceb08f7d2ec3acf5957dea72 | Make py3 compatible | tools/netapp/netapp.py | tools/netapp/netapp.py | # Copyright (C) 2012-2014 Red Hat, Inc.
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or any later version.
#
# This library is distributed in the h... | Python | 0 | @@ -1082,17 +1082,17 @@
print
-
+(
'Param:'
@@ -1125,16 +1125,17 @@
==value'
+)
%0A
@@ -2636,17 +2636,17 @@
print
-
+(
'Please
@@ -2723,16 +2723,17 @@
ASSWORD'
+)
%0A
|
3dcabaf2b41b80a7135ac93e0f40237a39febc07 | Downgrade version. We don't bump until release branch. | iplantuml/__init__.py | iplantuml/__init__.py | import argparse
import os
import subprocess
import uuid
from IPython.core.magic import register_cell_magic
from IPython.display import SVG
import plantweb # dummy import to ensure plantweb module is present
__title__ = "iplantuml"
__description__ = "Package which adds a PlantUML cell magic to IPython."
__uri__ = "ht... | Python | 0 | @@ -490,11 +490,11 @@
%220.
-1.0
+0.6
%22%0A__
|
4b263bbeeabafd59326a1d70b37227a0275519f2 | use selected_columns | corehq/apps/api/odata/utils.py | corehq/apps/api/odata/utils.py | from __future__ import absolute_import
from __future__ import unicode_literals
import json
from collections import defaultdict, namedtuple
from corehq.apps.app_manager.dbaccessors import get_current_app
from corehq.apps.export.dbaccessors import get_latest_case_export_schema, get_latest_form_export_schema
from corehq... | Python | 0 | @@ -3096,66 +3096,8 @@
%7D
-%0A export_columns = case_export_config.tables%5B0%5D.columns
%0A%0A
@@ -3407,24 +3407,29 @@
r column in
+case_
export_colum
@@ -3429,23 +3429,22 @@
t_co
-lumns if column
+nfig.tables%5B0%5D
.sel
@@ -3448,16 +3448,24 @@
selected
+_columns
%5D%0A%0A%0Adef
|
e81e2c30c756f224ce6a861b96c3c51d0ca60993 | Add url validation util | video/utils.py | video/utils.py | import os
import uuid
import urllib
import subprocess
from django.conf import settings
from video.models import Video
def download_thumbnail(thumbnail_url):
destination_path = os.path.join(settings.MEDIA_ROOT, 'thumbnails')
thumbnail_file = str(uuid.uuid4()) + ".jpg"
urllib.urlretrieve(thumbnail_url, os.p... | Python | 0.000001 | @@ -29,16 +29,46 @@
urllib%0A
+from urlparse import urlparse%0A
import s
@@ -143,16 +143,313 @@
Video%0A%0A%0A
+def sanitize_url(url):%0A %22%22%22 Make sure an url is valid, prepending the scheme if needed. %22%22%22%0A parsed = urlparse(url)%0A if not parsed.scheme:%0A url = %22http://%22 + url%0A... |
305e45b1e1446d02143b148c81ca23d7ed9ec868 | Fix for anonymous (vs. logged-in) user | webapp/models/db.py | webapp/models/db.py | # -*- coding: utf-8 -*-
#########################################################################
## This scaffolding model makes your app work on Google App Engine too
## File is released under public domain and you can use without limitations
#########################################################################
... | Python | 0 | @@ -2556,16 +2556,33 @@
ditor =
+(auth.user) and (
auth.use
@@ -2612,16 +2612,17 @@
s.sender
+)
%0Aplugins
|
e98a53c3faf259c092fc7221afee98186b514d14 | fix pyemma to accept outtype | adaptivemd/analysis/pyemma/emma.py | adaptivemd/analysis/pyemma/emma.py | from adaptivemd import PythonTask
from adaptivemd.analysis import Analysis
from _remote import remote_analysis
class PyEMMAAnalysis(Analysis):
"""
Common computation of correlations between features using PyEmma
Attributes
----------
pdb_file : `File`
file reference to the pdb_file for re... | Python | 0 | @@ -965,29 +965,23 @@
-traj_name='output.dcd
+outtype='master
',%0A
@@ -1355,24 +1355,22 @@
-traj_nam
+outtyp
e : str%0A
@@ -1397,59 +1397,50 @@
the
-trajectory file with
+output description to pick
the
-trajectory directory given
+frames from
%0A
@@ -2250,16 +2250,339 @@
t.pdb')%0A
+%0A ... |
1088c960ab450e70d6295d04d916a63a6f87dee7 | add local feh dist | apogee/util/__init__.py | apogee/util/__init__.py | Python | 0.999737 | @@ -0,0 +1,233 @@
+import numpy%0Adef localfehdist(feh):%0A #From 2 Gaussian XD fit to Casagrande et al. (2011)%0A fehdist= 0.8/0.15*numpy.exp(-0.5*(feh-0.016)**2./0.15**2.)%5C%0A +0.2/0.22*numpy.exp(-0.5*(feh+0.15)**2./0.22**2.)%0A return fehdist%0A
| |
b6fa97d3a1b22c896838b4dd41842239b7848634 | Correct Exception type | sciunit/validators.py | sciunit/validators.py | """Cerberus validator classes for SciUnit."""
import inspect
import quantities as pq
from cerberus import TypeDefinition, Validator
from typing import Any
def register_type(cls, name: str) -> None:
"""Register `name` as a type to validate as an instance of class `cls`.
Args:
cls: a class
nam... | Python | 0.000002 | @@ -1416,25 +1416,19 @@
except
-Attribute
+Key
Error:%0A
|
6712af94557de22e192c9a8b63095ddb63f5f205 | add 'start_time' field in webservice for running jobs | scrapyd/webservice.py | scrapyd/webservice.py | import traceback
import uuid
from cStringIO import StringIO
from twisted.python import log
from scrapy.utils.txweb import JsonResource
from .utils import get_spider_list
class WsResource(JsonResource):
def __init__(self, root):
JsonResource.__init__(self)
self.root = root
def render(self, t... | Python | 0.000001 | @@ -3154,16 +3154,71 @@
s.spider
+,%0A %22start_time%22: s.start_time.isoformat(' ')
%7D for s
|
c70d0b8bbb6ffc24a8b01066fd938a24059cd3e1 | Fix the package view on gunicorn | warehouse/legacy/simple.py | warehouse/legacy/simple.py | # Copyright 2013 Donald Stufft
#
# 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, so... | Python | 0.000001 | @@ -4592,20 +4592,20 @@
-with
+fp =
open(fi
@@ -4621,126 +4621,9 @@
rb%22)
- as fp:%0A # setup no cover because of:%0A # https://bitbucket.org/ned/coveragepy/issue/146/%0A
+%0A
@@ -4667,28 +4667,8 @@
fp)
- # pragma: no cover
%0A
|
4c7fc01e2e4213ba4aa5fbb0ac7bf367e82f465d | Set .required_fields instead of overriding .present(). | vumi/config.py | vumi/config.py | # -*- test-case-name: vumi.tests.test_config -*-
from confmodel.config import ConfigField, FieldFallback
from vumi.utils import load_class_by_string
class ConfigClassName(ConfigField):
field_type = 'Class'
def __init__(self, doc, required=False, default=None, static=False,
implements=None)... | Python | 0 | @@ -1407,153 +1407,51 @@
eld%0A
-%0A
-def present(self, config):%0A port_field = self.get_field_descriptor(config, self.port_field)%0A return port_field.present(config)
+ self.required_fields = %5Bport_field%5D
%0A%0A
|
c39fd90e9b14e5c7be13be1301c2a68a1fa55158 | create the logs directory if it doesn't exist | cs251tk/lib/save_recordings.py | cs251tk/lib/save_recordings.py | from .format_collected_data import format_collected_data
from .helpers import warn, flatten, group_by
import yaml
from .columnize import asciiify
from .gist import post_gist
def record_recording_to_disk(results, file_identifier):
results = sorted(results, key=lambda file: file['student'])
results = [file['con... | Python | 0.000001 | @@ -167,16 +167,26 @@
st_gist%0A
+import os%0A
%0A%0Adef re
@@ -392,16 +392,60 @@
try:%0A
+ os.makedirs('logs', exists_ok=True)%0A
|
06e5045aa9f6f9fedfd858f571f2d16bc9f8f94e | Remove this class since we don't actually use it anymore. | curious/dataclasses/appinfo.py | curious/dataclasses/appinfo.py | # This file is part of curious.
#
# curious is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# curious is distributed in the ho... | Python | 0 | @@ -786,54 +786,13 @@
ort
-List, Union%0A%0Afrom dataclasses import dataclass
+Union
%0A%0Afr
@@ -3891,301 +3891,4 @@
s)%0A%0A
-%0A@dataclass%0Aclass AuthorizedApp:%0A %22%22%22%0A Represents an authorized app.%0A %22%22%22%0A #: The ID of the application authorized.%0A id: int%0A%0A #: The list o... |
e159d4f35e18d99c17195d59b718d24a678f7c46 | Tweak post-deploy steps in deploy_bug script | scripts/deploy_bug.py | scripts/deploy_bug.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
This script generates the summary and description for a Socorro -prod
deploy bug.
Usage:
... | Python | 0.000001 | @@ -3107,10 +3107,9 @@
nt('
-1.
+*
upd
@@ -3142,18 +3142,59 @@
print('
-2.
+* make configuration changes')%0A print('*
perform
@@ -3194,16 +3194,24 @@
perform
+alembic
migratio
@@ -3230,10 +3230,50 @@
nt('
-3.
+* perform django migrations')%0A print('*
ver
|
37dba05c2663fb1bf2209df420700b5996977db3 | remove the debug print out | makahiki/apps/managers/player_mgr/middleware.py | makahiki/apps/managers/player_mgr/middleware.py | """A middleware class for player login checking and tracking."""
import re
import datetime
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from apps.managers.challenge_mgr import challenge_mgr
from apps.widgets.badges import badges
from apps.widgets.status.models import DailyS... | Python | 0.000015 | @@ -1957,33 +1957,8 @@
ate%0A
- print last_visit%0A
@@ -2127,31 +2127,8 @@
0)%0A%0A
- print day_diff%0A
|
cc5d42a6c661ae6f59408865d082d80ab3c92e3a | add a retry loop to get | scripts/enterobase.py | scripts/enterobase.py | import os
import requests
import pandas as pd
def enterobase():
'''
Downloads all the E.coli genomes from Enterobase.
'''
options = {
'no_legacy':'true',
'experiment':'assembly_stats',
'database':'ecoli',
'strain_query_type':'query',
'strain_query':'all'
}
... | Python | 0 | @@ -40,16 +40,315 @@
as pd%0A%0A
+def get(identifier, barcode, dl_folder):%0A f = requests.get('http://enterobase.warwick.ac.uk/upload/download?assembly_id=' + str(identifier) + '&database=ecoli')%0A fn = dl_folder + '/' + str(barcode) + '.fasta'%0A with open(fn, 'w') as fl:%0A fl.write(f.text)%0A ... |
4b786f677d85b92aba079e50de7da21fcab1addd | fix restart does not works issue | daemon_skeleton/libs/daemon.py | daemon_skeleton/libs/daemon.py | '''
***
Modified generic daemon class
***
Author: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
www.boxedice.com
License: http://creativecommons.org/licenses/by-sa/3.0/
Changes: 23rd Jan 2009 (David Mytton <david@boxedice.com>)
... | Python | 0.000001 | @@ -698,16 +698,37 @@
on 2.4 (
+%0A
before S
@@ -1180,24 +1180,41 @@
=os.devnull,
+%0A
stderr=os.d
@@ -4784,16 +4784,30 @@
ht occur
+%0A #
if the
@@ -5610,24 +5610,41 @@
restart(self
+, *args, **kwargs
):%0A %22
@@ -5724,16 +5724,31 @@
f.start(
+*args, *... |
1ba015fb4f9dd188d2ef32fd55c369f2e79d9547 | Add short season mail list aliases | tuhlaajapojat_lists.py | tuhlaajapojat_lists.py | import os
import re
import sys
#cmd_folder = '/home/jluttine'
cmd_folder = '/home/jluttine/tuhlaajapojat'
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sportsteam.settings")
#os.environ['DJANGO_SETTINGS_MODULE'] = 'sportsteam.settings'
fr... | Python | 0.000013 | @@ -781,20 +781,21 @@
eck
-team
+short
aliases
%0A
@@ -794,541 +794,249 @@
ases
-%0A if list.lower() == 'adidas':%0A list = 'adidas2014'%0A if list.lower() == 'fmhd':%0A list = 'fmhd2012'%0A if list.lower() == 'fmhm':%0A list = 'fmhm2014'%0A if list.lower() == 'esport':%0A ... |
32c671fc59243a7a0b8b665369b5c06aaeb207af | Fix include paths in breakpad_client.gyp to make the build work | src/client/windows/breakpad_client.gyp | src/client/windows/breakpad_client.gyp | # Copyright (c) 2010, Google 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 and t... | Python | 0.000002 | @@ -2020,24 +2020,72 @@
'%3C(DEPTH)',%0A
+%09'%3C(DEPTH)/third_party/glog/glog/src/windows/',%0A
%5D,%0A
|
aac598d64fc0fa50cc068fc50173068e5d89b3fd | Update numpy dtypes extension for correct type codes. | segpy/ext/numpyext.py | segpy/ext/numpyext.py | """Optional interoperability with Numpy."""
import numpy
NUMPY_DTYPES = {'ibm': numpy.dtype('f4'),
'l': numpy.dtype('i4'),
'h': numpy.dtype('i2'),
'f': numpy.dtype('f4'),
'b': numpy.dtype('i1')}
def make_dtype(data_sample_format):
"""Conver... | Python | 0 | @@ -74,16 +74,20 @@
%7B'ibm':
+
numpy.d
@@ -115,17 +115,21 @@
'
-l
+int32
': num
@@ -161,17 +161,21 @@
'
-h
+int16
': num
@@ -208,20 +208,24 @@
'f
+loat32
':
-
numpy.d
@@ -257,11 +257,15 @@
'
-b
+int8
':
+
n
|
7db3f9c741d3dfd8dda14ffb537ed251280d2025 | Bump version number to 3.0.3 | src/mpi4py/__init__.py | src/mpi4py/__init__.py | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
"""
This is the **MPI for Python** package.
What is *MPI*?
==============
The *Message Passing Interface*, is a standardized and portable
message-passing system designed to function on a wide variety of
parallel computers. The standard defines the syntax and sem... | Python | 0.000364 | @@ -941,17 +941,17 @@
= '3.0.
-2
+3
'%0A__auth
|
a799c25f8ecbc841129d0e34e84c6f95531668c5 | Fix a misspelled variable | shop/models/fields.py | shop/models/fields.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
POSTGRES_FALG = False
if str(connection.vendor) == 'postgresql':
POSTGRES_FALG = True
try:
if POSTGRES_FALG:
from django.contrib.postgres.fields import JSONField
else:
raise ImportError
except... | Python | 0.999999 | @@ -98,26 +98,26 @@
%0A%0APOSTGRES_F
-A
L
+A
G = False%0Aif
@@ -171,18 +171,18 @@
STGRES_F
-A
L
+A
G = True
@@ -209,10 +209,10 @@
ES_F
-A
L
+A
G:%0A
|
e64d2de3454de3891f2e0338fbd4dea9b9816521 | Fix magnitude logic for 0 limit events | siemstress/trigger.py | siemstress/trigger.py | #!/usr/bin/env python
#_MIT License
#_
#_Copyright (c) 2017 Dan Persons (dpersonsdev@gmail.com)
#_
#_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 limi... | Python | 0.00006 | @@ -4204,17 +4204,16 @@
ude = ((
-(
len(rows
@@ -4263,17 +4263,16 @@
tLimit'%5D
-)
+ 1) //
|
16f9be68e485ba068fb4354725ea551a8e70eb26 | Debug triggers | siemstress/trigger.py | siemstress/trigger.py | #!/usr/bin/env python
#_MIT License
#_
#_Copyright (c) 2017 Dan Persons (dpersonsdev@gmail.com)
#_
#_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 limi... | Python | 0.000001 | @@ -3347,15 +3347,25 @@
le,
+Event
Limit,
+Event
Coun
|
a4483eb1618c6515e555d5da77ff54b3863e2c33 | Fix a bug when BeautifulSoup returns None | SLCheckUpdate.py | SLCheckUpdate.py | # -*- coding: utf-8 -*-
import itertools
import json
import re
import colorlabels as cl
import requests
from bs4 import BeautifulSoup
from SLGetLocalSoftware import get_local_software
from SLHelper import alert_messagebox, date_sanitizer, file_content, lower_name_sorted
from SLHTMLGeneration import disab... | Python | 0.001147 | @@ -1203,24 +1203,91 @@
elector'%5D)%0D%0A
+ if not els:%0D%0A return '%5BParse Failure%5D'%0D%0A
@@ -1311,19 +1311,10 @@
ing
-if els else
+or
'%5BP
@@ -1507,32 +1507,53 @@
if not els
+ or not els%5B0%5D.string
:%0D%0A
|
9c4425e5cff3d841f6e1120cbb244d7e322d6a96 | fix admin.py field eroor | src/proposals/admin.py | src/proposals/admin.py | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from import_export.admin import ExportMixin
from .models import AdditionalSpeaker, TalkProposal, TutorialProposal
from .resources import TalkProposalResource
class AdditionalSpeakerInline(GenericTabularInline):
m... | Python | 0.000001 | @@ -579,44 +579,8 @@
e',%0A
- 'python_level', 'accepted',%0A
@@ -963,83 +963,8 @@
y',%0A
- 'recording_policy', 'slide_link', 'referring_policy', 'cancelled',%0A
@@ -1431,9 +1431,8 @@
pass%0A
-%0A
|
83a8a7d5dea845d98fd1b5b8a810f797468601a0 | Use CommandError for nicer errors | django_lightweight_queue/management/commands/queue_runner.py | django_lightweight_queue/management/commands/queue_runner.py | import logging
import optparse
import daemonize
from django.apps import apps
from django.core.management.base import NoArgsCommand
from ...utils import get_backend, get_middleware, configure_logging
from ...runner import runner
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
opt... | Python | 0 | @@ -110,16 +110,30 @@
e import
+ CommandError,
NoArgsC
@@ -1724,29 +1724,31 @@
raise
-Value
+Command
Error(%0A
@@ -2088,29 +2088,31 @@
raise
-Value
+Command
Error(%22Nothi
@@ -2213,13 +2213,15 @@
ise
-Value
+Command
Erro
|
57a8dbfc74a44f38e6b55d761e6ea84c2037b628 | printing predict_proba as json | whereami/predict.py | whereami/predict.py | from collections import Counter
from access_points import get_scanner
from whereami.get_data import get_train_data, get_external_sample
from whereami.get_data import sample
from whereami.pipeline import get_model
from whereami.get_data import aps_to_dict
from whereami.compat import cross_val_score
def predict_proba... | Python | 0.999997 | @@ -1,12 +1,24 @@
+import json%0A
from collect
@@ -505,16 +505,27 @@
print(
+json.dumps(
dict(zip
@@ -573,16 +573,17 @@
e)%5B0%5D)))
+)
%0A%0A%0Adef p
|
05a5c2439a007ddf753006cc6137a0e317a567e8 | Add thread protection for wakeupAfter entrypoint. | thespian/system/transport/wakeupTransportBase.py | thespian/system/transport/wakeupTransportBase.py | """This module provides a mixin base class for transports that
implements support for wakeupAfter() timed messages."""
from thespian.actors import *
from thespian.system.timing import ExpirationTimer
from thespian.system.transport import *
class wakeupTransportBase(object):
"""The wakeupTransportBase is design... | Python | 0 | @@ -235,16 +235,33 @@
mport *%0A
+import threading%0A
%0A%0Aclass
@@ -1524,42 +1524,8 @@
st.%0A
- self._pendingWakeups = %5B%5D%0A
@@ -1588,16 +1588,122 @@
livered%0A
+ self._wakeup_lock = threading.Lock() # protects the following:%0A self._pendingWakeups = %5B%5D%0A
%0A%0A de
@@ -1... |
ae79184ff87b425fa658749ea2eef2db496c442a | Update smoothness_controller to use results.AddValue(...) | tools/perf/measurements/smoothness_controller.py | tools/perf/measurements/smoothness_controller.py | # Copyright 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 sys
from measurements import smooth_gesture_util
from telemetry.timeline.model import TimelineModel
from telemetry.page import page_measurement
from t... | Python | 0.000001 | @@ -479,16 +479,51 @@
othness%0A
+from telemetry.value import scalar%0A
%0A%0ARUN_SM
@@ -4285,17 +4285,76 @@
ults.Add
-(
+Value(scalar.ScalarValue(%0A results.current_page,
r.name,
@@ -4369,16 +4369,17 @@
r.value)
+)
%0A%0A def
|
edeb1e3d9c953f4699ee3e598e3d758c038eda40 | Add PathStats to intermediatePathTypes demo. | demos/intermediatePathTypes.py | demos/intermediatePathTypes.py | """ Example of finding paths and printing type details. """
from tulip import *
from tulipgui import *
import tulippaths as tp
# Load the graph.
graph = tlp.loadGraph("../data/test_one.tlp")
# Find start and end nodes
source = tp.getNodeById(176, graph)
target = tp.getNodeById(606, graph)
# Find paths
finder = tp.P... | Python | 0 | @@ -30,30 +30,36 @@
and
-printing type details.
+unique types using PathStats
%22%22%22
@@ -134,23 +134,113 @@
%0A%0A#
-Load the graph.
+Path parameters%0AgraphFile = '../data/514_4hops.tlp'%0AsourceNodeId = 593%0AtargetNodeId = 514%0AmaxNumHops = 5%0A
%0Agra
@@ -262,30 +262,17 @@
aph(
-%22../data/test_one.tlp%... |
107791e54c7f580935c0309bc286683bd92b31fc | Fix encoding errors around total truncation | worldpay/gateway.py | worldpay/gateway.py | from __future__ import unicode_literals
import hashlib
import hmac
import logging
import socket
from decimal import Decimal
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
from six import binary_type
logger = logging.getLogger("worldpay")
def build_payment_url(insta... | Python | 0.998536 | @@ -501,19 +501,16 @@
al(total
-)))
.decode(
@@ -517,16 +517,19 @@
%22ascii%22)
+)))
%0A dat
@@ -1289,16 +1289,32 @@
ne_total
+.encode(%22utf-8%22)
)%0A
|
f1477afc2ff20a702a53ed82549dca07acd388dc | Update jogovelha.py | Src/jogovelha.py | Src/jogovelha.py | def inicializar():
tab = [ ]
for i in range (3):
linha = [ ]
for j in range(3):
linha.append(".")
tab.append(linha)
return tab
def main( ):
jogo = inicializar ( )
print (jogo)
if _name_ == "_main_":
main()
| Python | 0 | @@ -96,17 +96,17 @@
append(%22
-.
+X
%22)%0A%09%09tab
|
7857eb53bc3d2f5a47880a316ec4988eb6a0a628 | raise exception if distributions in index is not a list | src/rosdistro/index.py | src/rosdistro/index.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2013, Open Source Robotics Foundation, 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 mus... | Python | 0.000001 | @@ -2074,19 +2074,19 @@
s not a
-lis
+dic
t raise
@@ -2272,19 +2272,19 @@
ions'%5D,
-lis
+dic
t):%0A
@@ -2318,18 +2318,10 @@
ror(
-'List of d
+%22D
istr
@@ -2329,16 +2329,21 @@
butions
+type
is inval
@@ -2350,33 +2350,106 @@
id:
-' + data%5B'distributions'%5D
+expected 'dict', but got '%25s': %25s%22... |
9d14f60713726e05dab00a1b1e8eccfc32b17d58 | bump version to 2.2.0 | smart_open/version.py | smart_open/version.py | __version__ = '2.1.1'
| Python | 0 | @@ -14,9 +14,9 @@
'2.
-1.1
+2.0
'%0A
|
0d90793d1d08043e9998032265202527e6ad8602 | Add time_limit option to avoid getting locked out of computer. | replay.py | replay.py | #!/usr/bin/env python
# Copyright 2010 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... | Python | 0.000103 | @@ -1699,16 +1699,94 @@
time%0A%0A%0A
+if sys.version %3C '2.6':%0A print 'Need Python 2.6 or greater.'%0A sys.exit(1)%0A%0A%0A
def main
@@ -3301,15 +3301,104 @@
-while 1
+start = time.time()%0A while not options.time_limit or time.time() - start %3C options.time_limit
:%0A
@@ -4030,17 +4030,16 @@
mat... |
df1f5839038692a7569427c7e071c5ef8ad1161e | Check return of _load_state | diskimage_builder/block_device/blockdevice.py | diskimage_builder/block_device/blockdevice.py | # Copyright 2016 Andreas Florath (andreas@florath.net)
#
# 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... | Python | 0.000001 | @@ -6171,32 +6171,76 @@
f._load_state()%0A
+ if dg is None:%0A return 0%0A
for node
@@ -6555,32 +6555,76 @@
f._load_state()%0A
+ if dg is None:%0A return 0%0A
for node
|
ef5cbe7b1a601c35237173fb9b398bcfacb0fada | use .contribute_macro instead of inlining macro def | smashlib/ipy_smash.py | smashlib/ipy_smash.py | """ smashlib.ipy_smash
Defines the main smash plugin, which itself loads and
allows communications between the other smash plugins.
TODO: dynamic loading of plugins (use EventfulList)
"""
import os
import cyrusbus
from collections import defaultdict
from IPython.utils.traitlets import List, Bool
from sm... | Python | 0.000165 | @@ -3510,64 +3510,52 @@
-from IPython.core.macro import Macro%0A m = Macro((
+self.contribute_macro(%0A 'export',
%0A
@@ -3567,13 +3567,16 @@
+%5B
%22tmp
-=
+ =
get_
@@ -3603,17 +3603,19 @@
t_line;%22
-%0A
+,%0A
@@ -3677,64 +3677,10 @@
));%22
-%0A ))%0A ... |
3222e6164906956f698c63e26bddd85cd6a941be | use new fetch methods | smc/actions/remove.py | smc/actions/remove.py | import logging
import smc.actions
import smc.api.web as web_api
import smc.api.common as common_api
from smc.elements.element import SMCElement
logger = logging.getLogger(__name__)
def element(name, objtype=None):
""" Remove by element
Args:
* name: name for object to remove
* objt... | Python | 0 | @@ -235,20 +235,16 @@
element%0A
-
Args
@@ -245,20 +245,16 @@
Args:%0A
-
@@ -287,20 +287,16 @@
remove%0A
-
@@ -390,20 +390,16 @@
etc%0A
-
-
Returns:
@@ -407,20 +407,16 @@
-
-
None%0A
@@ -420,16 +420,19 @@
%22%22%22%0A
+ %0A
remo
@@ -462,3... |
89973ed75031fb4e697b66d9f7d150e11978bce0 | Update django_dbq/management/commands/queue_depth.py | django_dbq/management/commands/queue_depth.py | django_dbq/management/commands/queue_depth.py | from django.core.management.base import BaseCommand
from django_dbq.models import Job
class Command(BaseCommand):
help = "Print the current depth of the given queue"
def add_arguments(self, parser):
parser.add_argument("queue_name", nargs="?", default="default", type=str)
def handle(self, *args... | Python | 0 | @@ -515,26 +515,8 @@
%22
-all_queues_depth=
queu
@@ -554,16 +554,52 @@
=%7Bdepth%7D
+ all_queues_depth=%7Ball_queue_depths%7D
%22.format
|
c60a324d9dc041fe8c9776aa933ed14cc1e7d1c4 | Fix error in docs. | xltable/__init__.py | xltable/__init__.py | """
xltable
=======
A package for writing excel worksheets with formulas and styles.
Introduction
------------
:py:mod:`xltable` is an API for writing tabular data and charts to Excel.
It is not a replacement for other Excel writing packages such as :py:mod:`xlsxwriter`,
:py:mod:`xlwt` or :py:mod:`pywin32`. Instead ... | Python | 0 | @@ -2562,20 +2562,21 @@
: Expres
+s
ion%0A
-
%0A.. auto
@@ -2778,16 +2778,28 @@
onstExpr
+, Expression
%0Afrom .s
@@ -2977,16 +2977,17 @@
_all__ =
+
%5B%0A %22W
@@ -3136,16 +3136,34 @@
olumn%22,%0A
+ %22Expression%22,%0A
%22Cel
@@ -3190,24 +3190,24 @@
%22Formula%22,%0A
-
%22ConstEx
@@ -3209,1... |
e4097d1d5906ea68c93de8bf0dc4788ad7e9323f | add some debugging messages | docs/UML/plantuml2papyrus/plantuml2papyrus.py | docs/UML/plantuml2papyrus/plantuml2papyrus.py | #!/usr/bin/env python2
import sys
from papyrus import *
rootclass = None
classes = {}
associations = []
f = open(sys.argv[1])
for line in f.readlines():
l = line.strip()
if len(l) == 0:
continue
if l.startswith("package"):
continue #TODO not implemented yet
if l.startswith("/'"):
... | Python | 0.000001 | @@ -713,16 +713,27 @@
print
+ %22class %22 +
classna
@@ -735,16 +735,16 @@
assname%0A
-
@@ -1447,32 +1447,80 @@
es%5BclassBname%5D%0A%0A
+ print classAname + %22 o-- %22 + classBname%0A
newassoc
@@ -2262,32 +2262,80 @@
es%5BclassBname%5D%0A%0A
+ print classAname + %22 *-- %22 +... |
154d5d6787b9ab13c6784d0dca6cd470d6282b46 | Add operation to add recipient to mailing list | routes.py | routes.py | from flask import Flask, render_template, redirect, request
import psycopg2
from functools import wraps
import os
import urlparse
import requests
app = Flask(__name__)
def connectDB(wrapped):
@wraps(wrapped)
def inner(*args, **kwargs):
urlparse.uses_netloc.append("postgres")
url = urlparse.u... | Python | 0 | @@ -731,29 +731,41 @@
def mailgun_
-send(
+operations(name,
email):%0A
@@ -836,16 +836,20 @@
+
%22https:/
@@ -948,16 +948,20 @@
+
auth=(%22a
@@ -971,16 +971,20 @@
, key),%0A
+
@@ -1070,16 +1070,20 @@
+
+
%22to%22: em
@@ -1087,16 +1087,20 @@
email,%0A
... |
98bedda08193d9633b828b8ae9a9161fceb0f614 | Fix error with missed secret key. | application/settings.py | application/settings.py | """
Django settings for application project.
"""
import os
import dj_database_url
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
# Security
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1', 'track-mail-web-kosolapov.herokuapp.com']
# App... | Python | 0 | @@ -235,16 +235,61 @@
False%0A%0A
+SECRET_KEY = os.environ%5B'DJANGO_SECRET_KEY'%5D%0A
ALLOWED_
|
f88efe1c63c8f480879cad671b34be854045fb1c | Improve source admin for mutations | apps/mutations/admin.py | apps/mutations/admin.py | #
# Copyright (C) 2016 Dr. Maha Farhat
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is d... | Python | 0 | @@ -854,16 +854,153 @@
ugForm%0A%0A
+class ImportSourceAdmin(ModelAdmin):%0A list_display = ('name', 'created', 'uploader', 'complete')%0A readonly_fields = ('uploaded',)%0A%0A
site.reg
@@ -1017,16 +1017,35 @@
rtSource
+, ImportSourceAdmin
)%0A%0Aclass
|
e04053e46f14226859199b40c9a5c67bdaa4f260 | add /lol search <text> | saylol.py | saylol.py | import json
from time import time
from helpers import *
from random import randrange
lol_filename = "plugins/redstoner-utils.py.dir/files/lol.json"
lols = []
timeout = 15
last_msg = 0
try:
lols = json.loads(open(lol_filename).read())
except Exception, e:
error("Failed to load lols: %s" % e)
de... | Python | 0 | @@ -1120,16 +1120,165 @@
sg)))%0A%0A%0A
+def search_lols(sender, keyword):%0A for i, lol in enumerate(lols):%0A if keyword in lol:%0A msg(sender, %22&a%25s: &e%25s%22 %25 (str(i).rjust(3), lol))%0A%0A%0A
@hook.co
@@ -1945,16 +1945,167 @@
s%5Bi%5D))%0A%0A
+ elif cmd == %22search%22:%0A if sender.hasPermi... |
a865dbad699025e9efce4ec08edae9584b2bd178 | add MIT license | scrape.py | scrape.py | #!/usr/bin/python
import boto
import requests
from lxml import html
import lxml
import PyRSS2Gen
import datetime
import StringIO
import sys
from dateutil.parser import parse
LINK = "https://aws.amazon.com/releasenotes/"
page = requests.get(LINK)
try:
tree = html.fromstring(page.text)
except lxml.etree.XMLSyntaxErro... | Python | 0 | @@ -12,16 +12,1175 @@
python%0A%0A
+# MIT license%0A# (see: http://www.opensource.org/licenses/mit-license.php)%0A#%0A# Copyright (c) 2014 Ted Timmons, ted@timmons.me%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the %E2%80%9CS... |
f0a9a75fee9035b18f60aabb9e6c233ee91725df | Add a log message when the scenario is executed. | argus/scenarios/base.py | argus/scenarios/base.py | # Copyright 2015 Cloudbase Solutions Srl
# 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
#
# ... | Python | 0 | @@ -3836,24 +3836,79 @@
for now.%0D%0A%0D%0A
+ LOG.info(%22Running scenario %25s%22, cls.__name__)%0D%0A
# Cr
|
88f38925e21df9164e30511ce15653ab3380bcee | Correct function name | rnacentral_pipeline/databases/ensembl/vertebrates/parser.py | rnacentral_pipeline/databases/ensembl/vertebrates/parser.py | # -*- coding: utf-8 -*-
"""
Copyright [2010-2018] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by... | Python | 0.999386 | @@ -2712,23 +2712,17 @@
ene=
-helpers
+embl
.gene
-_id
(gen
|
1fa66bae02b71f08bd695b1aa06e73bcfc9fc8ab | Corrige mensagem de exceção propagada | artigo/pandoc_parser.py | artigo/pandoc_parser.py | # coding: utf-8
import os, subprocess
import requests
import gitlab
'''
Class: PandocParser
description: realizar a conversão do artigo para PDF
author: Adriano dos Santos Vieira <adriano.vieira@dataprev.gov.br>
character encoding: UTF-8
raising Exception: evite propagar uma "Exception" genérica, ao contrário,
propagu... | Python | 0.000002 | @@ -2780,32 +2780,46 @@
AttributeError('
+pandocParser:
all parameters a
|
7e1e305966439b978b09fe6384404d094389caed | Add WString support (#11) | TWindbg/utils.py | TWindbg/utils.py | import pykd
import color
import context
import string
def to_int(val):
"""
Convert a string to int number
from https://github.com/longld/peda
"""
try:
return int(str(val), 0)
except:
return None
def to_addr(val):
""" Convert a value to a memory address """
try:
... | Python | 0 | @@ -1879,65 +1879,76 @@
def
-get_string(ptr):%0A %22%22%22 try to get string from a pointer
+load_str(load_str_func, ptr):%0A %22%22%22 Load string with pykd function
%22%22%22
@@ -1993,21 +1993,21 @@
s =
-pykd.loadCStr
+load_str_func
(ptr
@@ -2225,24 +2225,266 @@
eturn None%0A%0A
+def get_string(ptr):%0A... |
2f399910e56f2460b08052c806eabd3fc4ac7561 | Add the change number to the emails that gerrit sends out. | webapp/codereview/email.py | webapp/codereview/email.py | # Copyright 2008 The Android Open Source Project
#
# 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 ag... | Python | 0 | @@ -2634,16 +2634,27 @@
ject = %22
+Change %25s:
(%25s) %25s%22
@@ -2668,26 +2668,81 @@
nge.
-dest_project.name,
+key().id(), change.dest_project.name,%0A
cha
|
29aa96cdbb02ef686bdb0c722955d1ad875d0099 | Add check that image sizes match | plantcv/plantcv/visualize/overlay_two_imgs.py | plantcv/plantcv/visualize/overlay_two_imgs.py | # Overlay two input images
"""
Created on Tue. September 01 21:00:01 2020
A function
@author: hudanyunsheng
"""
import os
import cv2
import numpy as np
from plantcv.plantcv import fatal_error
from plantcv.plantcv import plot_image
from plantcv.plantcv import print_image
from plantcv.plantcv import params
def overla... | Python | 0 | @@ -754,16 +754,37 @@
%22%22%22%0A
+ # Validate alpha%0A
if a
@@ -882,16 +882,250 @@
,1)!%22)%0A%0A
+ # Validate image sizes are the same%0A size_img1 = img1.shape%5B0:2%5D%0A size_img2 = img2.shape%5B0:2%5D%0A if size_img1 != size_img2:%0A fatal_error(f%22The height/width of img1 (%7Bs... |
fab5fcd3ccf94d41e37b54093c3513369f3f9523 | Fix error when move stock quant to another location from wizard. | stock_quant_packages_moving_wizard/models/stock.py | stock_quant_packages_moving_wizard/models/stock.py | # -*- coding: utf-8 -*-
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, fields, models
from openerp.tools.float_utils import float_compare
class StockQuant(models.Model):
_inherit = 'stock.quant'
@api.one
def move_to(self, dest_location):
move_obj = self... | Python | 0 | @@ -954,16 +954,108 @@
%7D)%0A
+ new_move.action_confirm()%0A self.quants_reserve(%5B%5Bself, self.qty%5D%5D, new_move)%0A
|
e8badf03203c0a65ac291a0acdd233847dc7df3f | Update alsa_sound_control.py | Python/alsa_sound_control.py | Python/alsa_sound_control.py | import time
import serial
import random
from pygame import mixer
mixer.init()
running = True
elapsed_time = 0
next_value = 25
serialPort = serial.Serial(port = '/dev/ttyUSB0', baudrate = 115200)
for x in range(3):
serialPort.readline()
def play_song():
# picker = random.randint(2, 4)
global serialPort
... | Python | 0.000001 | @@ -628,23 +628,14 @@
ite(
-bytes(%5B
picker
-%5D)
)%0A%0As
@@ -1302,17 +1302,17 @@
e()) %3E=
-2
+1
5:%0A
|
b6ad18ba9a5869602f44372074e59d60dbdee054 | Fix propery reference | attorch/regularizers.py | attorch/regularizers.py | import torch.nn as nn
import numpy as np
import torch
from itertools import product
from torch.nn import functional as F
# def laplace():
# return np.array([[0.25, 0.5, 0.25], [0.5, -3.0, 0.5], [0.25, 0.5, 0.25]]).astype(np.float32)[None, None, ...]
def laplace():
return np.array([[0,-1, 0], [-1, 4, -1], [0, ... | Python | 0.000005 | @@ -922,16 +922,17 @@
ng=self.
+_
padding,
|
80701d30488cab98c63232723313aef6175e02a8 | Fix broken test. (#705) | magenta/models/shared/events_rnn_graph_test.py | magenta/models/shared/events_rnn_graph_test.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | Python | 0.000029 | @@ -623,16 +623,33 @@
ph.%22%22%22%0A%0A
+import tempfile%0A%0A
# intern
@@ -866,32 +866,132 @@
ef setUp(self):%0A
+ self._sequence_file = tempfile.NamedTemporaryFile(%0A prefix='EventSequenceRNNGraphTest')%0A%0A
self.config
@@ -1456,32 +1456,40 @@
n', self.config,
+%0A
sequence_exampl
@@ -... |
2ba28c83de33ebc75f386d127d0c55e17248a94b | Add location to step metadata. | mapclientplugins/meshgeneratorstep/__init__.py | mapclientplugins/meshgeneratorstep/__init__.py |
"""
MAP Client Plugin
"""
__version__ = '0.2.0'
__author__ = 'Richard Christie'
__stepname__ = 'Mesh Generator'
__location__ = ''
# import class that derives itself from the step mountpoint.
from mapclientplugins.meshgeneratorstep import step
# Import the resource file when the module is loaded,
# this enables the ... | Python | 0 | @@ -123,16 +123,82 @@
on__ = '
+https://github.com/ABI-Software/mapclientplugins.meshgeneratorstep
'%0A%0A# imp
@@ -437,8 +437,9 @@
urces_rc
+%0A
|
0229f96c0cf8e9cdb781074bfcdfe03c1dc1ce98 | Test DSI with b0s. | dipy/reconst/tests/test_dsi.py | dipy/reconst/tests/test_dsi.py | import numpy as np
from numpy.testing import (assert_equal,
assert_almost_equal,
run_module_suite,
assert_array_equal,
assert_raises)
from dipy.data import get_data, dsi_voxels
from dipy.reconst.dsi import Diffus... | Python | 0 | @@ -1039,17 +1039,16 @@
=0.0015,
-
%0A
@@ -2621,24 +2621,606 @@
)), True)%0A%0A%0A
+def test_multib0_dsi():%0A data, gtab = dsi_voxels()%0A # Create a new data-set with a b0 measurement:%0A new_data = np.concatenate(%5Bdata, data%5B..., 0, None%5D%5D, -1)%0A new_bvecs = np.concatenate(%5Bgtab.bve... |
a2df05a5ce93095e33dafb7a3c2807361ca93a37 | Add *all* errors to __init__.py | src/sphobjinv/__init__.py | src/sphobjinv/__init__.py | r"""``sphobjinv`` *package definition module*.
``sphobjinv`` is a toolkit for manipulation and inspection of
Sphinx |objects.inv| files.
**Author**
Brian Skinn (bskinn@alum.mit.edu)
**File Created**
17 May 2016
**Copyright**
\(c) Brian Skinn 2016-2022
**Source Repository**
https://github.com/bskinn... | Python | 0.002792 | @@ -665,16 +665,111 @@
import
+(%0A SOIIntersphinxError,%0A SOIIsphxNoMatchingObjectError,%0A SOIIsphxNotASuffixError,%0A
Sphobjin
@@ -775,16 +775,20 @@
nvError,
+%0A
Version
@@ -792,16 +792,19 @@
ionError
+,%0A)
%0Afrom sp
|
250a39b5fe32450ba17f5b98456fcd7096cdf679 | Tag TODO for using A* with issue number. | src/shared/geometry.py | src/shared/geometry.py | """
Functions for doing geometry calculations in the various types of coordinates
shared between client and server.
"""
from Queue import Queue
from src.shared.config import CHUNK_SIZE
from src.shared.exceptions import NoPathToTargetError
def findPath(gameState, srcPos, destPos):
"""
Compute and return a pat... | Python | 0 | @@ -1615,16 +1615,22 @@
# TODO
+ %5B#11%5D
: Use A*
|
3cd383f568a32b75381291428669c539429db144 | Fix loggin statement | djangae/contrib/secrets/gsm.py | djangae/contrib/secrets/gsm.py | import logging
import json
from dataclasses import asdict
from google.api_core import exceptions
from .utils import MissingSecretError, strip_keys_not_in_dataclass
class GSMBackend:
"""Secret storage backend for Google Secret Manager
https://cloud.google.com/secret-manager
Secrets value can either be ... | Python | 0.000008 | @@ -2479,16 +2479,17 @@
und at %25
+s
creatin
|
cd2f4ee643d377522a6ed53ac078ed2571f5c9e2 | remove import exception causing django app to quit | djangobb_forum/subscription.py | djangobb_forum/subscription.py | from django.core.mail import EmailMultiAlternatives
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.html import strip_tags
from celery.decorators import task
from djangobb_forum import settings as forum_settings
from djangobb_forum.util import absolute_url
from djangobb_... | Python | 0 | @@ -339,16 +339,18 @@
t Post%0A%0A
+#
from not
|
6cefc4f94bd78de84a6e5713e28111834307576d | Create model Member | djinstagram/instaapp/models.py | djinstagram/instaapp/models.py | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Follow(models.Model):
follower = models.ForeignKey(User, related_name='+', null=True)
following = models.ForeignKey(User, related_name='+', null=True)
active = models.BooleanField(default=True)
... | Python | 0 | @@ -1264,8 +1264,166 @@
f.photo%0A
+%0Aclass Member(models.Model):%0A user = models.OneToOneField(User, on_delete=models.CASCADE)%0A image = models.ImageField(upload_to=%22uploads/dp%22, null=True)%0A
|
cbeeccf0e1ed326930f2930799f390bb0c027471 | Add set permission test. | test/test_contentrepo.py | test/test_contentrepo.py | from mock import MagicMock
import pyaem
from pyaem import bagofrequests as bag
import unittest
from .util import HandlersMatcher
class TestContentRepo(unittest.TestCase):
def test_init(self):
content_repo = pyaem.contentrepo.ContentRepo('http://localhost:4502/.cqactions.html', foo='bar')
self.a... | Python | 0 | @@ -2663,16 +2663,888 @@
05%5D))%0A%0A%0A
+ def test_set_permission(self):%0A%0A _self = self%0A class SetPermissionHandlerMatcher(HandlersMatcher):%0A def __eq__(self, handlers):%0A result = handlers%5B200%5D(None)%0A _self.assertEquals(result%5B'status'%5D, '... |
f61e0aaef192b20c445f270671470d3a0d6d4161 | test that random_land actually returns land | tests/simulation_test.py | tests/simulation_test.py | import unittest
import numpy
from worldengine.simulations.hydrology import WatermapSimulation
from worldengine.model.world import World, Size, GenerationParameters
class TestSimulation(unittest.TestCase):
# The hydrology simulation indirectly calls the global rng.
# We want different implementations of... | Python | 0.000935 | @@ -2076,16 +2076,480 @@
d, 59)%0A%0A
+ def test_random_land_returns_only_land(self):%0A %0A size = Size(100,100)%0A%0A ocean = numpy.fromfunction(lambda y, x: y%3Ex, (size.height, size.width))%0A%0A w = World(%22random_land%22, size, 0, GenerationParameters(0, 1.0, 0))%0A w.ocea... |
3e24d680f9df08849c1cad825561f527a46eaeb5 | Remove rredundant space line | lc0004_median_of_two_sorted_arrays.py | lc0004_median_of_two_sorted_arrays.py | """Leetcode 4. Median of Two Sorted Arrays
Hard
There are two sorted arrays nums1 and nums2 of size m and n respectively.
Find the median of the two sorted arrays.
The overall run time complexity should be O(log (m+n)).
You may assume nums1 and nums2 cannot be both empty.
Example 1:
nums1 = [1, 3]
nums2 = [2]
The ... | Python | 0.031159 | @@ -721,17 +721,16 @@
s2%5Bi2%5D%0A%0A
-%0A
|
a3de6cc27266bfb2a71aa910451309ce4b7b6c79 | fix newline replacement | server.py | server.py | #!/usr/bin/env python3
import os
import json
import argparse
import subprocess
import tornado.ioloop
import tornado.web
import tornado.autoreload
BASE_PATH = os.path.dirname(os.path.realpath(__file__))
def run_process(command):
with subprocess.Popen(command, stdout=subprocess.PIPE) as proc:
return proc.stdout.re... | Python | 0 | @@ -716,20 +716,20 @@
%0A%0Aclass
-Repo
+Edit
Handler(
@@ -995,24 +995,25 @@
eplace('
+
$NEWLINE
', '%5Cn')
@@ -1004,16 +1004,17 @@
$NEWLINE
+
', '%5Cn')
@@ -1196,24 +1196,25 @@
('%5Cn', '
+
$NEWLINE
').repla
@@ -1205,16 +1205,17 @@
$NEWLINE
+
').repla
@@ -1686,15 +1686,20 @@
/%5D+)
-', Repo
+/edit', ... |
b7fba7c12a9f37665dd8747631fcc9495b55a369 | index and protocol fixes | server.py | server.py | import os
import redis
import logging
import datetime
from flask import Flask , send_from_directory, render_template, url_for, request
r = redis.from_url(os.environ.get("REDIS_URL"))
app = Flask(__name__)
#"Landing page"
@app.route('/')
def webprint():
return render_template('index.html')
#Saves the string <st... | Python | 0 | @@ -540,35 +540,39 @@
%0A return
+__
str
+__
(r.lrange('db',
@@ -1528,19 +1528,23 @@
return
+__
str
+__
(r.lrang
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.