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 |
|---|---|---|---|---|---|---|---|
17ac4f42fae21dcd0ebb18a63b50d949540488f2 | Test for update on User Field | aligot/tests/test_user.py | aligot/tests/test_user.py | # coding: utf-8
from django.core.urlresolvers import reverse
from django.db.utils import IntegrityError
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from ..models import User
class TestUser(TestCase):
def test_create_with_same_email(self):
... | Python | 0 | @@ -2549,28 +2549,850 @@
tus_code, response.content)%0A
+%0A def test_update(self):%0A %22%22%22%0A Test if a connected user can change is own mail.%0A %22%22%22%0A user = User.objects.create_user(%0A username='test',%0A password='test',%0A email='mail@ma... |
5c3af04057104e69531ae51e6dd755d0abbdc0be | move initialization code to init | yandextank/plugins/Influx/plugin.py | yandextank/plugins/Influx/plugin.py | # coding=utf-8
# TODO: make the next two lines unnecessary
# pylint: disable=line-too-long
# pylint: disable=missing-docstring
import logging
import sys
import datetime
from uuid import uuid4
from builtins import str
from influxdb import InfluxDBClient
from ...common.interfaces import AbstractPlugin, \
Monitori... | Python | 0.000005 | @@ -1071,336 +1071,8 @@
er)%0A
- self.client = None%0A self.decoder = None%0A%0A def start_test(self):%0A self.start_time = datetime.datetime.now()%0A%0A def end_test(self, retcode):%0A self.end_time = datetime.datetime.now() + datetime.timedelta(minutes=1)%0A return retcode%0A... |
ba7a3a51e34dc710ed30153a881ba86348fd8af2 | Improve playback controls by stopping before playing new track. Fix a couple of bugs. | mopidy/backends/libspotify.py | mopidy/backends/libspotify.py | import datetime as dt
import logging
import threading
from spotify import Link
from spotify.manager import SpotifySessionManager
from spotify.alsahelper import AlsaController
from mopidy import config
from mopidy.backends import (BaseBackend, BaseCurrentPlaylistController,
BaseLibraryController, BasePlaybackContr... | Python | 0 | @@ -1593,85 +1593,343 @@
ef _
-pause(self):%0A # TODO%0A return False%0A%0A def _play(self, track):
+next(self, track):%0A if self.state == self.PLAYING:%0A self._stop()%0A self._play(track)%0A return True%0A%0A def _pause(self):%0A # TODO%0A return Fal... |
42b1f3e7b7cc856b099796c7eb118ec2a6a96216 | Optimize queries | lib/aquilon/worker/commands/compile.py | lib/aquilon/worker/commands/compile.py | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2013,2014 Contributor
#
# 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... | Python | 0.000002 | @@ -2382,17 +2382,16 @@
q
-1
= sessi
@@ -2429,19 +2429,19 @@
q
-1
= q
-1.join
+.filter
(Ser
@@ -2456,25 +2456,29 @@
ance.clients
-)
+.any(
%0A q1
@@ -2478,23 +2478,12 @@
-q1 = q1.filter(
+
and_
@@ -2525,27 +2525,16 @@
-
-
Host.san
@@ -2550,32 +2550,59 @@
or =... |
e6045c103fa813b60471b57af6a82e274d798afd | add interactive console for debugging | gateway.py | gateway.py | #!/usr/bin/env python
import logging
import tornado.options
import tornado.web
import tornado.websocket
import os.path
import obelisk
import json
import threading
# Install Tornado reactor loop into Twister
# http://www.tornadoweb.org/en/stable/twisted.html
from tornado.platform.twisted import TwistedIOLoop
from twis... | Python | 0.000001 | @@ -156,16 +156,28 @@
hreading
+%0Aimport code
%0A%0A# Inst
@@ -4253,16 +4253,338 @@
=True)%0A%0A
+class DebugConsole(threading.Thread):%0A%0A daemon = True%0A%0A def __init__(self, application):%0A self.application = application%0A super(DebugConsole, self).__init__()%0A self.start()%0A%0... |
62cd48f8a0fc83261af5c4275a38102fc983d3ff | Increase failure tolerance for the Dashboard | tests/test_dashboard.py | tests/test_dashboard.py | from datetime import datetime, timedelta
from dateutil import parser as date_parser
import pytest
import pytz
from web_test_base import *
class TestIATIDashboard(WebTestBase):
requests_to_load = {
'Dashboard Homepage': {
'url': 'http://dashboard.iatistandard.org/'
}
}
def test_... | Python | 0 | @@ -695,17 +695,17 @@
he past
-2
+7
days.%0A
@@ -750,17 +750,17 @@
ta(days=
-2
+7
)%0A
|
c076fb75d40b85b593bd569eaf7f6e13ab95cdd8 | Replace Pykka internals misuse with proxies | mopidy/frontends/mpd/actor.py | mopidy/frontends/mpd/actor.py | import logging
import sys
import pykka
from mopidy import settings
from mopidy.core import CoreListener
from mopidy.frontends.mpd import session
from mopidy.utils import encoding, network, process
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(pykka.ThreadingActor, CoreListener):
"""
... | Python | 0.000014 | @@ -1329,200 +1329,107 @@
-# FIXME this should be updated once pykka supports non-blocking calls%0A # on proxies or some similar solution%0A pykka.ActorRegistry.broadcast(%7B%0A 'command': 'pykka_call',
+listeners = pykka.ActorRegistry.get_by_class(session.MpdSession)%0A for listen... |
c68833f3c464720b676080705d2df4f7e37c4392 | fix template render() expect Context and not dict | feincms/tests/applicationcontent_urls.py | feincms/tests/applicationcontent_urls.py | """
This is a dummy module used to test the ApplicationContent
"""
from django import template
from django.conf.urls.defaults import *
from django.http import HttpResponse, HttpResponseRedirect
def module_root(request):
return 'module_root'
def args_test(request, kwarg1, kwarg2):
return HttpResponse(u'%s-%... | Python | 0.000001 | @@ -864,16 +864,33 @@
.render(
+template.Context(
%7B'reques
@@ -902,16 +902,17 @@
equest%7D)
+)
%0A%0A%0Adef r
|
2da6415008f42b0295772730428fb8dc1b3137d2 | Add more tests for JST regression case | tests/test_ext_tasks.py | tests/test_ext_tasks.py | # -*- coding: utf-8 -*-
"""
Tests for discord.ext.tasks
"""
import asyncio
import datetime
import pytest
import sys
from discord import utils
from discord.ext import tasks
@pytest.mark.asyncio
async def test_explicit_initial_runs_tomorrow_single():
now = utils.utcnow()
if not ((0, 4) < (now.hour, now.m... | Python | 0 | @@ -2369,16 +2369,375 @@
dnight%0A%0A
+ today = datetime.date.today()%0A minute_before = %5Bdatetime.datetime.combine(today, time, tzinfo=jst) - datetime.timedelta(minutes=1) for time in times%5D%0A%0A for before, expected_time in zip(minute_before, times):%0A expected = datetime.datetime.combine(today... |
8b364a2b9eaff5e038d47a114746458de56b4ed5 | fix apitype casing for underscore classes | saga/base.py | saga/base.py |
import string
import saga.utils.logger
import saga.engine.engine
class SimpleBase (object) :
""" This is a very simple API base class which just initializes
the self._logger and self._engine members, but does not perform any further
initialization, nor any adaptor binding. This base is used for API clas... | Python | 0.000001 | @@ -1335,24 +1335,60 @@
parts %5Bl-2%5D%0A
+ t2 = t2.replace ('_', ' ')
%0A i
@@ -1390,15 +1390,11 @@
-if t1 =
+t2
= st
@@ -1411,16 +1411,75 @@
rds (t2)
+%0A t2 = t2.replace (' ', '')%0A%0A if t1 == t2
:%0A
|
1a830910b104476630bf5d1bc8a0eb8f757c1e20 | Fix scope for self view in orgchart. | mozillians/dino_park/views.py | mozillians/dino_park/views.py | import requests
import urlparse
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import HttpResponseForbidden, JsonResponse
from django.shortcuts import render
from django.views.decorators.cache import never_cache
f... | Python | 0 | @@ -1255,24 +1255,268 @@
user_id.%22%22%22%0A
+ try:%0A user = User.objects.get(username=username)%0A except (User.DoesNotExist, User.MultipleObjectsReturned):%0A pass%0A else:%0A if user == request.user:%0A scope = UserAccessLevel.PRIVATE%0A else:%0A
scope ... |
b282b2df1aed13cf5ad42b656f9cc2910feb90c2 | removed whitespace | python-wallaroo/wallaroo/client/node.py | python-wallaroo/wallaroo/client/node.py | # Copyright (c) 2013 Red Hat, Inc.
# Author: William Benton (willb@redhat.com)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | Python | 0.999428 | @@ -847,17 +847,16 @@
, fail%0A%0A
-%0A
class no
|
a8718082754246e32d0611655a4f6f487a34ddb7 | Add missed copyright notice | tests/test_fileaware.py | tests/test_fileaware.py | import os
import tempfile
from contextlib import contextmanager
import environ
import pytest
@contextmanager
def make_temp_file(text):
with tempfile.NamedTemporaryFile("w", delete=False) as f:
f.write(text)
f.close()
try:
yield f.name
finally:
if os.path.exists(f.name):
... | Python | 0 | @@ -1,12 +1,323 @@
+# This file is part of the django-environ.%0A#%0A# Copyright (c) 2021, Serghei Iakovlev %3Cegrep@protonmail.ch%3E%0A# Copyright (c) 2013-2021, Daniele Faraglia %3Cdaniele.faraglia@gmail.com%3E%0A#%0A# For the full copyright and license information, please view%0A# the LICENSE.txt file that was distr... |
2023f8ff3534b2bd70a4f31d247033b91dd76e79 | Fix crash when urlrewrite is configured to allow infinite rewriting | flexget/plugins/urlrewrite_urlrewrite.py | flexget/plugins/urlrewrite_urlrewrite.py | from __future__ import unicode_literals, division, absolute_import
import re
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('urlrewrite')
class UrlRewrite(object):
"""
Generic configurable urlrewriter.
Example::
urlrewrite:
demonoid:
... | Python | 0 | @@ -144,16 +144,82 @@
rt event
+%0Afrom flexget.plugins.plugin_urlrewriting import UrlRewritingError
%0A%0Alog =
@@ -2327,127 +2327,8 @@
g')%0A
- task.purge()%0A from flexget.plugins.plugin_urlrewriting import UrlRewritingError%0A
|
7e7fef808da6a350722660844ba2b913d5b4daa7 | Fix tests that fail after CET enters DST (#217) | tests/test_formatter.py | tests/test_formatter.py | from datetime import date, datetime, time, timedelta
import pytest
import pytz
from freezegun import freeze_time
from todoman.cli import cli
@pytest.mark.parametrize('interval', [
(65, 'in a minute'),
(-10800, '3 hours ago'),
])
@pytest.mark.parametrize('tz', ['CET', 'HST'])
def test_humanized_date(runner, ... | Python | 0 | @@ -281,16 +281,43 @@
'HST'%5D)%0A
+@freeze_time('2017-03-25')%0A
def test
|
e1d7d822c71779102ccb31106a71cce33970d75a | Address review comment: Better variable name. | flocker/control/test/test_persistence.py | flocker/control/test/test_persistence.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Tests for ``flocker.control._persistence``.
"""
from uuid import uuid4
from eliot.testing import validate_logging, assertHasMessage, assertHasAction
from twisted.internet import reactor
from twisted.trial.unittest import TestCase, SynchronousTestCase
... | Python | 0 | @@ -4211,33 +4211,41 @@
emp()))%0A
-l
+callbacks
= %5B%5D%0A l2
@@ -4242,17 +4242,25 @@
-l
+callbacks
2 = %5B%5D%0A
@@ -4283,33 +4283,41 @@
egister(lambda:
-l
+callbacks
.append(1))%0A
@@ -4414,17 +4414,25 @@
lambda:
-l
+callbacks
2.append
@@ -4577,12 +4577,28 @@
al((
-l, l
+cal... |
bfc248e92afdc02a8b3089d7a2a5194b7f55c2fe | add in the split out setup_ufw_rules to the api and setupnode | woven/api.py | woven/api.py | #!/usr/bin/env python
"""
The full public woven api
"""
from fabric.state import env
from woven.decorators import run_once_per_node, run_once_per_version
from woven.deployment import deploy_files, mkdirs
from woven.deployment import upload_template
from woven.environment import check_settings, deployment_root, set_e... | Python | 0 | @@ -796,16 +796,33 @@
tup_ufw,
+ setup_ufw_rules,
disable
@@ -2111,16 +2111,24 @@
plete'):
+%0A
env.ove
@@ -2389,16 +2389,33 @@
e()%0A
+setup_ufw_rules()
%0A set
|
bb74df460e0d1823048cbb3e09ce882e519167c5 | make not empty strings hold in node.text in XML backend | anyconfig/backend/xml_.py | anyconfig/backend/xml_.py | #
# Copyright (C) 2011 - 2014 Satoru SATOH <ssato @ redhat.com>
# License: MIT
#
# pylint: disable=R0921
from anyconfig.globals import LOGGER as logging
import anyconfig.backend.base as Base
import anyconfig.compat as AC
SUPPORTED = True
try:
# First, try lxml which is compatible with elementtree and looks faste... | Python | 0.000001 | @@ -1898,16 +1898,38 @@
oot.text
+ and root.text.strip()
:%0A
|
1a755a0512753111fedc229241c57d302f0115d4 | Refactor test_importers | tests/test_importers.py | tests/test_importers.py | try:
from mock import Mock
except ImportError:
from unittest.mock import Mock
import yaml
from passpie.importers import find_importer
from passpie.importers.default import DefaultImporter
def test_find_importer_returns_first_match_default_importer(mocker):
mock_importer = Mock()
mock_importer2 = Moc... | Python | 0 | @@ -167,16 +167,25 @@
.default
+_importer
import
@@ -452,32 +452,41 @@
mporters.default
+_importer
.os.path.isfile'
@@ -860,32 +860,41 @@
mporters.default
+_importer
.os.path.isfile'
@@ -949,32 +949,41 @@
mporters.default
+_importer
.DefaultImporter
@@ -1031,32 +1031,41 @@
mporters.default
+_importer
.yaml.... |
dbb153b4681a1fa73f93855e86d3657e4fff9bfb | remove self | tests/test_interface.py | tests/test_interface.py | ''' Script to check the readout system interface (software + FPGA firmware).
A global register test is performed with pyBAR and a simulation of the FPGA + FE-I4.
'''
import unittest
import shutil
import mock
from Queue import Empty
import subprocess
import time
import os
from pybar.run_manager import RunManager
from p... | Python | 0.000039 | @@ -436,22 +436,16 @@
e_pixel(
-self,
same_mas
@@ -488,38 +488,32 @@
f send_commands(
-self,
commands, repeat
|
2c67dd081895d00ffb33e29d8750b3f80121dfe5 | Change import | tests/test_judicious.py | tests/test_judicious.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `judicious` package."""
import pytest
from judicious import judicious
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return requests.get('htt... | Python | 0.000001 | @@ -98,23 +98,8 @@
t%0A%0A%0A
-from judicious
impo
|
9a278ac9ea0c124cfd108f276bc5d74da6c5c50c | Update notebook test | tests/test_notebooks.py | tests/test_notebooks.py | # Copyright 2017 the GPflow authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | Python | 0 | @@ -610,20 +610,8 @@
sys%0A
-import time%0A
impo
@@ -778,54 +778,8 @@
or%0A%0A
-from gpflow.test_util import session_context%0A%0A
# bl
@@ -2346,202 +2346,40 @@
-with session_context():%0A ts = time.time()%0A _exec_notebook(notebook_filename)%0A elapsed = time.time() - ts%0A print(... |
be412947c0fe30dd659298cd7641b5a701310f7d | add auth option | gitdata.py | gitdata.py | """GitHub query CLI.
cli() --------------> Handle command-line arguments.
"""
import os
import click
from click.testing import CliRunner
#------------------------------------------------------------------------------
@click.group()
@click.version_option(version='1.0', prog_name='Photerino')
def cli():
"""\b
... | Python | 0.000004 | @@ -217,21 +217,143 @@
---%0A
-@click.group(
+CONTEXT_SETTINGS = dict(help_option_names=%5B'-h', '--help'%5D)%0A@click.group(context_settings=CONTEXT_SETTINGS, options_metavar='%3Coptions%3E'
)%0A@c
@@ -602,61 +602,40 @@
-hexdump(filename=file, offset=offset, totbytes=nbytes
+click.echo('/// NOT IMPLEMENTED'
)... |
c0b5b971c184894afb66cfc1c8d2eb97cfc17d92 | Change test code to subclass UserString, not str. | tests/test_serialize.py | tests/test_serialize.py | """Tests for toron._serialize module."""
import unittest
from collections import namedtuple, OrderedDict
from toron._serialize import get_primitive_repr
from toron._serialize import dumps
class TestGetPrimitiveRepr(unittest.TestCase):
def test_supported_types(self):
"""Check that all supported instance t... | Python | 0 | @@ -98,16 +98,28 @@
eredDict
+, UserString
%0Afrom to
@@ -1263,19 +1263,26 @@
ubclass(
-str
+UserString
):%0A
|
049d734486627224b87cba72c575450515060c55 | fix split | vlermv/_s3.py | vlermv/_s3.py | import tempfile
import boto
from ._abstract import AbstractVlermv
def split(x):
return x.split('/')
class S3Vlermv(AbstractVlermv):
def __init__(self, bucketname, *args, connect_s3 = boto.connect_s3, **kwargs):
super(S3Vlermv, self).__init__(**kwargs)
self.bucket = connect_s3().create_bucke... | Python | 0.000001 | @@ -87,16 +87,22 @@
return
+tuple(
x.split(
@@ -105,16 +105,17 @@
lit('/')
+)
%0A%0Aclass
|
cb5fd2c5b7b34b2c0c080563c50527f6c690177e | Añade condición, solo guarda Voluntario=si | core/management/commands/importdata.py | core/management/commands/importdata.py | import argparse
from django.core.management.base import BaseCommand
from openpyxl import load_workbook
from core import models
class Command(BaseCommand):
help = 'Importa datos desde un archivo.'
def add_arguments(self, parser):
parser.add_argument('filename', type=argparse.FileType('rb'))
de... | Python | 0.000001 | @@ -3133,32 +3133,119 @@
.SUCCESS(msg))%0A%0A
+ is_volunteer = data%5B'Voluntario'%5D == 'si'%0A if is_volunteer:%0A
volu
@@ -3312,32 +3312,36 @@
+
person=person,%0A
@@ -3331,32 +3331,36 @@
person=person,%0A
+
@@ -3388,34 +3388,42 @... |
be0d287b2b23b89e5bf121558fc5ee4ea97710c2 | Fix generated file location for inclusion in sdist target when building with scons. | numpy/core/setupscons.py | numpy/core/setupscons.py | import os
import sys
import glob
from os.path import join, basename
from numpy.distutils import log
from numscons import get_scons_build_dir
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration,dot_join
from numpy.distutils.system_info import get_info, defau... | Python | 0 | @@ -254,16 +254,86 @@
ot_join%0A
+ from numpy.distutils.command.scons import get_scons_pkg_build_dir%0A
from
@@ -395,16 +395,16 @@
ib_dirs%0A
-
%0A con
@@ -1848,38 +1848,46 @@
target = join(
+get_
scons_
+pkg_
build_dir, local
@@ -1879,27 +1879,29 @@
uild_dir
-, local_dir
+(config.name)
, 'confi
@@... |
394473b6d8fb9898a19bb7e3bd2141a59572adec | 更新 modules users/apps.py, 修正 PEP8 警告 | commonrepo/users/apps.py | commonrepo/users/apps.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.apps import AppConfig
from actstream import registry
class UsersAppConfig(AppConfig):
name = 'commonrepo.users'
def ready(self):
registry.register(self.get_model('User'))
import commonrepo.users.sign... | Python | 0 | @@ -142,16 +142,17 @@
gistry%0A%0A
+%0A
class Us
|
265411a6b3ca799b1e20a5e63839a9dc71eaff5c | Remove old changes | libqtile/layout/zoomy.py | libqtile/layout/zoomy.py | # Copyright (c) 2011 Mounier Florian
# Copyright (c) 2011 Paul Colomiets
# Copyright (c) 2012 Craig Barnes
# Copyright (c) 2012, 2014 Tycho Andersen
# Copyright (c) 2013 Tao Sauvage
# Copyright (c) 2014 ramnes
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014 dmpayton
# Copyright (c) 2014 dequis
#
# Permission is here... | Python | 0.000016 | @@ -5677,475 +5677,4 @@
ous%0A
-%0A def get_state(self):%0A d = SingleWindow.info(self)%0A d%5B%22clients%22%5D = %5Bx.window.wid for x in self.clients%5D%0A if self.focused is not None:%0A d%5B%22focused%22%5D = self.focused.window.wid%0A return d%0A%0A def restore_state(s... |
999b8c29c7e3be974b29f69b8e007fcc77742e03 | fix broken test case | tests/test_transcode.py | tests/test_transcode.py | import os
from nose.tools import eq_
from pyexcel_cli.transcode import transcode
from click.testing import CliRunner
def test_simple_option():
runner = CliRunner()
test_fixture = os.path.join("tests", "fixtures",
"transcode_simple.csv")
output = "test_simple_option.csv"
... | Python | 0.000008 | @@ -379,10 +379,8 @@
, %22%5C
-r%5C
n%22,
|
dfa39db42cc5ce2c29da2ec0c388865ec7f41030 | Add allow field to form | oauth2_provider/forms.py | oauth2_provider/forms.py | from django import forms
class AllowForm(forms.Form):
redirect_uri = forms.URLField(widget=forms.HiddenInput())
scopes = forms.CharField(required=False, widget=forms.HiddenInput())
client_id = forms.CharField(widget=forms.HiddenInput())
state = forms.CharField(required=False, widget=forms.HiddenInput(... | Python | 0 | @@ -49,16 +49,63 @@
.Form):%0A
+ allow = forms.BooleanField(required=False)%0A
redi
|
07b7291caa83ce1948e6687651645c0a964c25b5 | Remove a space before colons | openquake/engine/settings.py | openquake/engine/settings.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2014, GEM Foundation.
#
# OpenQuake 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 Lice... | Python | 0.999998 | @@ -2380,17 +2380,16 @@
'HOST'
-
: DB_SEC
@@ -2429,17 +2429,16 @@
'PORT'
-
: DB_SEC
|
7480fa45fac507a9d3a14589d87a9f96beb1ddbb | fix mute button bug | app/controllers/mixers.py | app/controllers/mixers.py | # -*- encoding: utf-8; py-indent-offset: 4 -*-
# +--------------------------------------------------------------------------+
# | _____ __ ___ ______ __ |
# | / ___// /___ ______/ (_)___ / ____/___ ____ ____ ___ _____/ /_ |
# | \__ \/ __/ / / / __ / / __ \ ... | Python | 0.000002 | @@ -1565,24 +1565,25 @@
dindex=idx)%0A
+%0A
try:
@@ -1623,45 +1623,8 @@
e()%0A
- getrecs = mixer.getrec()%0A
@@ -1678,24 +1678,116 @@
mutes = %7B%7D
+%0A%0A try:%0A getrecs = mixer.getrec()%0A except alsaaudio.ALSAAudioError:
%0A
@@ -1796,24 +1796,25 @... |
cbb6929007b20d5b95be6aafba3e0841144a16e7 | Rename get_scheduled_report_ids keys helper and pull out guess_reporting_minute | corehq/apps/saved_reports/scheduled.py | corehq/apps/saved_reports/scheduled.py | from __future__ import absolute_import
from __future__ import unicode_literals
from calendar import monthrange
from datetime import datetime
from corehq.apps.saved_reports.models import ReportNotification
from corehq.util.soft_assert import soft_assert
from six.moves import range
_soft_assert = soft_assert(
to='{... | Python | 0.000001 | @@ -395,16 +395,43 @@
)%0A%0A%0Adef
+_make_all_notification_view
_keys(pe
@@ -445,53 +445,18 @@
s_of
-):%0A
+,
minute
- = guess_reporting_minute(as_of
)
+:
%0A
@@ -1594,15 +1594,86 @@
-keys =
+minute = guess_reporting_minute(as_of)%0A%0A keys = _make_all_notification_view
_key
@@ -1683,26 +1683... |
15fb011fd9af04516254c04f6d89d728ac52d5d3 | fix users tests | corehq/apps/users/tests/phone_users.py | corehq/apps/users/tests/phone_users.py | from django.test import TestCase
from corehq.apps.users.models import CouchUser, WebUser, CommCareUser
from dimagi.utils.couch import get_cached_property
class PhoneUsersTestCase(TestCase):
def setUp(self):
all_users = CouchUser.all()
for user in all_users:
user.delete()
self.... | Python | 0.000002 | @@ -26,16 +26,61 @@
estCase%0A
+from corehq.apps.domain.models import Domain%0A
from cor
@@ -450,16 +450,56 @@
domain'%0A
+ Domain(name=self.domain).save()%0A
|
cc4aca4cef667bfa4eb51cfad677e63ec54e60a9 | update searching fields | emgapi/viewsets.py | emgapi/viewsets.py | # -*- coding: utf-8 -*-
# Copyright 2017 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 requ... | Python | 0 | @@ -1440,41 +1440,92 @@
'
-centre_name',%0A 'project_id
+study_id',%0A 'secondary_accession',%0A 'project_id',%0A 'centre_name
',%0A
@@ -2759,24 +2759,68 @@
ent_model',%0A
+ 'experiment_type__experiment_type',%0A
'@sa
@@ -3071,32 +3071,62 @@
oFilterBackend,%0A
+ ... |
5acfd8072b3f1dff89b3bf7f1f01a15951d72fe1 | Add newline to please the Sphinx | ooni/templates/scapyt.py | ooni/templates/scapyt.py | # -*- encoding: utf-8 -*-
#
# :authors: Arturo Filastò
# :licence: see LICENSE
import random
from zope.interface import implements
from twisted.python import usage
from twisted.plugin import IPlugin
from twisted.internet import protocol, defer, threads
from scapy.all import send, sr, IP, TCP, config
from ooni.report... | Python | 0 | @@ -766,17 +766,19 @@
:http S'
-%5D
+%7D%5D%0A
%0A
|
8882569d3605d7b0e44f0e05fa6a9c86e590a843 | remove the reopen controller from the application.py | opal/core/application.py | opal/core/application.py | """
Application helpers for Opal
"""
import inspect
import os
import itertools
from opal.core import plugins
class OpalApplication(object):
core_javascripts = {
'opal.upstream.deps': [
"js/lib/modernizr.js",
"js/lib/jquery-1.11.3/jquery-1.11.3.js",
"js/lib/d3/d3.js",
... | Python | 0 | @@ -3446,61 +3446,8 @@
s%22,%0A
- %22js/opal/controllers/reopen_episode.js%22,%0A
|
b0ff934a2e20916f9e777874b795c9d0942a48e4 | use app.cfg from its proper place | openarticlegauge/core.py | openarticlegauge/core.py | import os, requests, json, redis
from flask import Flask
from openarticlegauge import config, licenses
from flask.ext.login import LoginManager, current_user
login_manager = LoginManager()
def create_app():
app = Flask(__name__)
configure_app(app)
if app.config['INITIALISE_INDEX']: initialise_index(app)
... | Python | 0.000001 | @@ -599,16 +599,22 @@
e(here),
+ '..',
'app.cf
@@ -616,16 +616,92 @@
pp.cfg')
+ # this file will be in the package dir, app.cfg is at the root of the repo
%0A if
|
da1dbddaa47e087b19dbeb1b256b337a3e77ed73 | Fix os not defined | gaphor/services/tests/test_properties.py | gaphor/services/tests/test_properties.py | import tempfile
from unittest import TestCase
from gaphor.services.properties import FileBackend, Properties
class MockEventManager(list):
def handle(self, event):
self.append(event)
class TestProperties(TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp()
backend = FileBack... | Python | 0 | @@ -1,12 +1,22 @@
+import os%0A
import tempf
|
56344224efbf74aff392967a84307f6f4b5429e1 | Fix job tracker in apache | encore/__init__.py | encore/__init__.py | from flask import request, Response, Flask, render_template, redirect, url_for
from .user_blueprint import user_area
from .admin_blueprint import admin_area
from .api_blueprint import api, ApiResult, ApiException
from .auth_blueprint import auth
from .notifier import get_notifier
from . import job_tracking
import os
im... | Python | 0.000003 | @@ -1282,16 +1282,58 @@
%0A if
+not %22FLASK_RUN_FROM_CLI%22 in os.environ or
os.envir
|
11cd074f67668135d606f68dddb66c465ec01756 | Add db index on field tag name | opps/core/tags/models.py | opps/core/tags/models.py | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilters import slugify
from opps.core.models import Date, Slugged
class Tag(Date, Slugged):
name = models.CharField(_(u'Name'), max_length=255, unique=True)
def save(self,... | Python | 0 | @@ -292,16 +292,59 @@
que=True
+,%0A db_index=True
)%0A%0A d
@@ -624,16 +624,59 @@
'Tags')%0A
+ unique_together = %5B'slug', 'name'%5D%0A
%0A%0Aclass
@@ -758,13 +758,67 @@
00,
-blank
+db_index=True,%0A blank=True, null
=Tru
|
caa1b8ffb1fa5fb5edbd7d1e9744c17aabb3d5bf | refactor logger, pythonist way | ensembl/service.py | ensembl/service.py | #
# Author : Manuel Bernal Llinares
# Project : trackhub-creator
# Timestamp : 28-06-2017 10:13
# ---
# © 2017 Manuel Bernal Llinares <mbdebian@gmail.com>
# All rights reserved.
#
"""
This module models an Ensembl service
"""
# App imports
import config_manager
from ensembl.models import SpeciesService
from exce... | Python | 0 | @@ -2431,36 +2431,30 @@
self._
-get_
logger
-()
.debug(%22Usin
@@ -2948,36 +2948,30 @@
self._
-get_
logger
-()
.debug(%22Requ
@@ -3063,28 +3063,22 @@
self._
-get_
logger
-()
.info(%0A
@@ -3376,20 +3376,14 @@
lf._
-get_
logger
-()
.deb
@@ -3582,64 +3582,8 @@
er%0A%0A
- def _get_logger(self... |
706aa6ed7170709828258bca1b9a1dfe6e8fa77e | improve helper functions | SLHelper.py | SLHelper.py | # -*- coding: utf-8 -*-
import re
import tkinter
from tkinter import messagebox
def file_content(filename):
with open(filename, 'r') as fin:
content = fin.read()
return content
def write_file(filename, content):
with open(filename, 'wb') as fout:
fout.write(content.encode('ut... | Python | 0.00001 | @@ -136,16 +136,17 @@
name, 'r
+b
') as fi
@@ -197,16 +197,32 @@
content
+.decode('utf-8')
%0D%0A%0D%0Adef
@@ -558,16 +558,24 @@
testring
+.strip()
%0D%0A%0D%0Adef
|
f3843f61f9480b74f2e94a9fa3d5bd97549a2b8e | Use a LOG instead of the root logger | entropy/entropy.py | entropy/entropy.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 Yahoo! 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.apach... | Python | 0.999946 | @@ -1023,16 +1023,50 @@
'logs')%0A
+LOG = logging.getLogger(__name__)%0A
%0A%0Adef va
@@ -1984,39 +1984,35 @@
s()%0A
-logging
+LOG
.warning('Will s
@@ -2100,39 +2100,35 @@
udit(args):%0A
-logging
+LOG
.warning('Regist
@@ -2228,39 +2228,35 @@
cript):%0A
-logging
+LOG
.warning('Need p
@@ -... |
c1a76b78b7c567f22e76372ae22380c511e7a2f1 | Complete docstring of parse_branches | readthedocs/vcs_support/backends/hg.py | readthedocs/vcs_support/backends/hg.py | # -*- coding: utf-8 -*-
"""Mercurial-related utilities."""
from __future__ import absolute_import
from readthedocs.projects.exceptions import RepositoryError
from readthedocs.vcs_support.base import BaseVCS, VCSVersion
class Backend(BaseVCS):
"""Mercurial VCS backend."""
supports_tags = True
supports_br... | Python | 0.000002 | @@ -1421,24 +1421,212 @@
%22%22%22
-Stable / default
+%0A Parses output of %60hg branches --quiet%60, eg:%0A%0A default%0A 0.2%0A 0.1%0A%0A Into VCSVersion objects with branch name as verbose_name and%0A identifier.%0A
%22%22%22%0A
|
3f2fb693203fc66aeab4c7d4178929829c65fbfb | Fix a broken try/except/else clause. | reviewboard/scmtools/tests/testcases.py | reviewboard/scmtools/tests/testcases.py | import os
import unittest
from errno import ECONNREFUSED
from tempfile import mkdtemp
from paramiko.ssh_exception import NoValidConnectionsError
from reviewboard.scmtools.core import HEAD
from reviewboard.scmtools.errors import SCMError, AuthenticationError
from reviewboard.scmtools.models import Repository
from revi... | Python | 0.002586 | @@ -2760,40 +2760,8 @@
g.')
-%0A else:%0A raise
%0A%0A
|
67bb13412118b3dddbee09d8df04788c50084506 | Fix use of bt_device in find_ruuvitags (#42) | ruuvitag_sensor/ruuvi.py | ruuvitag_sensor/ruuvi.py | import sys
import os
import time
import logging
from ruuvitag_sensor.decoder import get_decoder
log = logging.getLogger(__name__)
if not sys.platform.startswith('linux') or os.environ.get('CI') == 'True':
# Use BleCommunicationDummy also for CI as it can't use bluez
from ruuvitag_sensor.ble_communication im... | Python | 0.000005 | @@ -1912,33 +1912,32 @@
datas = dict()%0A
-%0A
for new_
@@ -1980,32 +1980,42 @@
_datas(bt_device
+=bt_device
):%0A i
|
ca35d04d841f55f9703cc2b2d7be1f88d5184fd0 | Return True when valid, PEP8 | oscarapi/views/basket.py | oscarapi/views/basket.py | from django.utils.translation import ugettext_lazy as _
from oscar.apps.basket import signals
from oscar.core.loading import get_model, get_class
from rest_framework import status, generics, exceptions
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.view... | Python | 0.999999 | @@ -1757,16 +1757,17 @@
%7D%0A
+
%22%22%22%0A
@@ -2393,16 +2393,42 @@
quantity
+%0A return True, None
%0A%0A de
@@ -3229,17 +3229,16 @@
basket,
-
context
|
9d65b613384b1d4781efd65588639ad68261e8d7 | Remove unused import. | cryptography/hazmat/primitives/hmac.py | cryptography/hazmat/primitives/hmac.py | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | Python | 0 | @@ -609,25 +609,8 @@
on%0A%0A
-import binascii%0A%0A
impo
|
1d7c70de13c70ce44cd6338b43b2ddc4aa348ac9 | Support requests for versioned metadata | website/addons/osfstorage/views.py | website/addons/osfstorage/views.py | from __future__ import unicode_literals
import httplib
import logging
from modularodm import Q
from modularodm.storage.base import KeyExistsException
from flask import request
from framework.auth import Auth
from framework.exceptions import HTTPError
from framework.auth.decorators import must_be_signed
from websit... | Python | 0 | @@ -3273,32 +3273,247 @@
ode, **kwargs):%0A
+ try:%0A # TODO This should change to version as its internal it can be changed anytime%0A version = int(request.args.get('revision'))%0A except ValueError: # If its not a number%0A version = -1%0A
return file_
@@ -3527,16 +3527,33 @@
riali... |
229c427a935112975f9f3928d669fa94b34c47d5 | Fix stupid bug | stash-space/python/store_space_usage.py | stash-space/python/store_space_usage.py | #!/usr/bin/env python
# Copyright 2015 University of Chicago
import sys
import argparse
import logging
import pytz
import os
import pwd
import grp
import datetime
import xattr
import elasticsearch
import elasticsearch.helpers
ES_NODES = ['uct2-es-head.mwt2.org:9200', 'uct2-es-door.mwt2.org:9200']
TZ_NAME = "US/Cen... | Python | 0.000016 | @@ -4187,32 +4187,53 @@
ppend(dir_info)%0A
+ continue%0A
dir_info
@@ -4900,32 +4900,53 @@
ppend(dir_info)%0A
+ continue%0A
dir_info
|
38a2d86aed4ea1e94691993c5f49722f9a69ac8d | Remove Python < 3.6 version check | lisa/__init__.py | lisa/__init__.py | #! /usr/bin/env python3
import warnings
import os
import sys
from lisa.version import __version__
# Raise an exception when a deprecated API is used from within a lisa.*
# submodule. This ensures that we don't use any deprecated APIs internally, so
# they are only kept for external backward compatibility purposes.
... | Python | 0 | @@ -907,312 +907,8 @@
')%0A%0A
-if sys.version_info %3C (3, 6):%0A warnings.warn(%0A 'Python 3.6 will soon be required to run LISA, please upgrade from %7B%7D to any version higher than 3.6'.format(%0A '.'.join(%0A map(str, tuple(sys.version_info)%5B:3%5D)%0A ),%0A ... |
13298bd49d9c72b8db6650fb0f8b316998b302f0 | Add permissions on TodoList model. | safarido/todos/models.py | safarido/todos/models.py | from django.conf import settings
from django.db import models
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
class TimestampedModel(models.Model):
created_on = models.DateTimeField(_('created on'), auto_now_add=True)
modified_on = models.DateTimeFiel... | Python | 0 | @@ -429,241 +429,8 @@
l):%0A
-# owner = models.ForeignKey(%0A# settings.AUTH_USER_MODEL%0A# )%0A# users = models.ManyToManyField(%0A# settings.AUTH_USER_MODEL,%0A# verbose_name=_('users'),%0A# related_name=_('todo_lists'),%0A# )%0A
@@ -1122,19 +1122,20 @@
fy(self.... |
73e69f86cbeb6bd883f0b66314b7c0b8caa349bb | Make euca-describe-instances show instance tags | euca2ools/utils.py | euca2ools/utils.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source ... | Python | 0 | @@ -4725,16 +4725,252 @@
n(items)
+%0A if hasattr(instance, 'tags') and isinstance(instance.tags, dict):%0A for tag in instance.tags:%0A print '%5Ct'.join(('TAG', 'instance', instance.id, tag,%0A instance.tags%5Btag%5D))
%0A%0Adef pr
|
b16a1987075bd72cb7d31cf3dc7e529ce8d0e102 | fix loop | wisely_project/get_courses_file.py | wisely_project/get_courses_file.py | import sys
import os
import traceback
from django import db
sys.path.append('/root/wisely/wisely_project/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'wisely_project.settings.production'
from django.db.models import F
from django.utils import timezone
from users.tasks import get_coursera_courses, get_edx_courses, get_u... | Python | 0.000002 | @@ -210,17 +210,20 @@
import F
+, Q
%0A
-
from dja
@@ -665,54 +665,54 @@
n'))
-:%0A if user.username != '' and user.
+.filter(~Q(email='')).filter(%0A
inco
@@ -718,39 +718,33 @@
orrect_login
- ==
+=
False
+)
:%0A
-
@@ -767,36 +767,32 @@
ame%0A
-
-
... |
f5f6b93d34318a1d6f65082df8482376e92960c9 | Revamp XML parsing method | wm_metrics/analyse_commons_dump.py | wm_metrics/analyse_commons_dump.py | # -*- coding: utf-8 -*-
import xml.dom.minidom
import re
import datetime
def handle_node(node, tag_name):
"""Return the contents of a tag based on his given name inside of a given node."""
element = node.getElementsByTagName(tag_name)
if element.length > 0:
if element.item(0).hasChildNodes():
... | Python | 0.998547 | @@ -862,48 +862,33 @@
n a
-list of the edits in a Wikimedia Commons
+dictionary from the given
dum
@@ -901,18 +901,23 @@
-edits = %5B%5D
+collection = %7B%7D
%0A
@@ -1126,50 +1126,102 @@
-for revision_node in page_node.childNodes:
+if page_node.localName == u'page':%0A page_id = h... |
a2c484afc3951a77a6684f9c7323672c6db691aa | Fix name of celery queue | genomic_neuralnet/common/celery_slave.py | genomic_neuralnet/common/celery_slave.py | from __future__ import print_function
import os
import sys
import time
import numpy as np
import redis
import pickle
from itertools import chain
from genomic_neuralnet.common.base_compare import try_predictor
from genomic_neuralnet.util.ec2_util import get_master_dns
from celery import Celery
import celery.app.cont... | Python | 0.999924 | @@ -1463,35 +1463,22 @@
n.llen('
-parallel_predictors
+celery
')%0A%0Adef
|
e8003dbb1e6a7efe60b02c65207c7202236b1adb | Update InputDialogCtrl.py | helenae/gui/widgets/InputDialogCtrl.py | helenae/gui/widgets/InputDialogCtrl.py | # -*- coding: utf-8 -*-
import wx
from validators.FileValidator import FileValidator
class InputDialog(wx.Dialog):
def __init__(self, parent, id, title, ico_folder, validator):
wx.Dialog.__init__(self, parent, id, title, style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER)
self.label = wx.StaticText(... | Python | 0.000001 | @@ -31,59 +31,8 @@
wx%0A
-from validators.FileValidator import FileValidator%0A
%0A%0Acl
@@ -283,15 +283,15 @@
%D0%98%D0%BC%D1%8F
-%D0%BA%D0%B0%D1%82%D0%B0%D0%BB%D0%BE%D0%B3
+%D1%8D%D0%BB%D0%B5%D0%BC%D0%B5%D0%BD%D1%82
%D0%B0:%22,
@@ -1161,16 +1161,71 @@
ain__':%0A
+ from validators.FileValidator import FileVa... |
484f845b50d1308dbf8b7f2496a1d565724f9e23 | Rename jwt_token var as auth_token on authentication submodule #48 | rest_framework_auth0/authentication.py | rest_framework_auth0/authentication.py | import base64
import jwt
from django.contrib.auth.backends import (
RemoteUserBackend,
get_user_model,
)
from django.contrib.auth.models import (
Group,
)
from django.utils.encoding import force_str
from django.utils.translation import ugettext as _
from rest_framework import exceptions
from rest_framework... | Python | 0.000001 | @@ -1995,25 +1995,26 @@
-jwt_value
+auth_token
= self.
@@ -2049,25 +2049,26 @@
if
-jwt_value
+auth_token
is None
@@ -2266,33 +2266,34 @@
-jwt_value
+auth_token
,%0A
@@ -2942,17 +2942,18 @@
-jwt_value
+auth_token
,%0A
|
a705892cd7e32a540c5fee61a2bf4c4d67abf477 | add get_all_required_node_names method | xos/tosca/resources/xosresource.py | xos/tosca/resources/xosresource.py | class XOSResource(object):
xos_base_class = "XOSResource"
xos_model = None
provides = None
def __init__(self, user, nodetemplate):
self.dirty = False
self.user = user
self.nodetemplate = nodetemplate
def get_requirements(self, relationship_name, throw_exception=False):
... | Python | 0.000003 | @@ -235,16 +235,237 @@
mplate%0A%0A
+ def get_all_required_node_names(self):%0A results = %5B%5D%0A for reqs in self.nodetemplate.requirements:%0A for (k,v) in reqs.items():%0A results.append(v%5B%22node%22%5D)%0A return results%0A%0A
def
|
34facd924f34edc3e99af3687429b88d5b1cc43d | Rename method | packaging/build_tools.py | packaging/build_tools.py | import json
from subprocess import check_output, CalledProcessError
import subprocess
import logging
import shutil
import os
import tox.config
import tox.session
import virtualenv_tools
import delorean
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARK_CYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m... | Python | 0.000002 | @@ -5158,16 +5158,20 @@
def get_
+git_
commit_d
|
bd8219763cbccd8ffde79a200585ff65128a7f22 | add defaults.update function | salt/modules/defaults.py | salt/modules/defaults.py | # -*- coding: utf-8 -*-
'''
Module to work with salt formula defaults files
'''
from __future__ import absolute_import
import copy
import json
import logging
import os
import yaml
import salt.fileclient
import salt.utils.data
import salt.utils.dictupdate as dictupdate
import salt.utils.files
import salt.utils.url
... | Python | 0.000003 | @@ -3856,12 +3856,1616 @@
opy(source)%0A
+%0A%0Adef update(dest, defaults, merge_lists=True, in_place=True):%0A '''%0A defaults.update%0A Allows to set defaults for group of data set e.g. group for nodes.%0A%0A This function is a combination of defaults.merge%0A and defaults.deepcopy to avoi... |
586faacdf9a80ab07cc9b8c717838e79540f1f3b | msgpack content-encoding must be 'binary' not 'utf-8' | kombu/serialization.py | kombu/serialization.py | """
kombu.serialization
===================
Serialization utilities.
:copyright: (c) 2009 - 2010
:license: BSD, see LICENSE for more details.
"""
import codecs
class SerializerNotInstalled(StandardError):
"""Support for the requested serialization type is not installed"""
pass
class SerializerRegistry(o... | Python | 0.998591 | @@ -8244,37 +8244,38 @@
ntent_encoding='
-utf-8
+binary
')%0A except Im
|
52fe3b7055bac981ce79a30fd59ec67d064da819 | mark test to run on cpu only | hoomd/hpmc/pytest/test_remove_drift.py | hoomd/hpmc/pytest/test_remove_drift.py | # Copyright (c) 2009-2021 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
"""Test hoomd.hpmc.update.RemoveDrift."""
import hoomd
from hoomd.conftest import operation_pickling_check
import pytest
import hoomd.hpmc.pytest.conftest
# no... | Python | 0 | @@ -949,32 +949,49 @@
est.mark.serial%0A
+@pytest.mark.cpu%0A
@pytest.mark.par
@@ -1035,32 +1035,32 @@
nstructor_args)%0A
-
def test_valid_c
@@ -1380,32 +1380,49 @@
est.mark.serial%0A
+@pytest.mark.cpu%0A
@pytest.mark.par
@@ -2894,32 +2894,49 @@
est.mark.serial%0A
+@pytest.mark.cpu%0A
@pytest.mark.par
@@ -3311,... |
97f9f6570c8eda39f5cb824f46ca923c6291bbbe | create directories for logging | loggingServer.py | loggingServer.py | import json
import os, datetime
from flask import Flask, jsonify, render_template, request
app = Flask(__name__, template_folder='./')
class logserver:
firefile = ""
potfile = ""
missfile = ""
repfile = ""
confile = ""
conwfile = ""
def logFiring(self, log):
self.writeLog(self.firefile, log)
return... | Python | 0.000001 | @@ -1431,16 +1431,141 @@
nergy'))
+%0A%0A%09%09for dir in %5Bconpath, conwpath, firepath, potpath, misspath, reppath%5D:%0A%09%09%09if not os.path.exists(dir):%0A%09%09%09%09os.makedirs(dir)
%0A%09%0A%09%09tim
|
baee05c39e1d9424348d5634825788e001a01fea | Update generator | CarND-Behavioral-Cloning-P3/model.py | CarND-Behavioral-Cloning-P3/model.py | import csv
import cv2
import numpy as np
lines = []
# Open the csv log file and read the file name of the figure
with open('./data/driving_log.csv') as csvfile:
reader = csv.reader(csvfile)
for line in reader:
lines.append(line)
images = []
measurements = []
for line in lines:
fo... | Python | 0.000001 | @@ -2261,146 +2261,511 @@
')%0A%0A
-model.compile(optimizer='adam', loss = 'mse')%0Amodel.fit(X_train, y_train, validation_split=0.2, shuffle=True, batch_size=128, nb_epoch = 5
+batch_size = 128%0Anb_epoch = 5%0A%0A# Save model weights after each epoch%0Acheckpointer = ModelCheckpoint(filepath=%22./tmp/v2-weights.%7Be... |
daa3762ed79e363841a2bb56dbd6a75e7a703dae | Fix too long lines in soc.models.org_app module. | app/soc/models/org_app.py | app/soc/models/org_app.py | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | Python | 0 | @@ -1955,17 +1955,19 @@
ple_text
-=
+ =
ugettext
@@ -2040,16 +2040,25 @@
tical%22%3E
+'%0A '
the offi
@@ -4208,16 +4208,22 @@
te-wide
+%0A #:
Terms of
@@ -4231,21 +4231,16 @@
Service.
-%0A #:
(Not a
@@ -4271,24 +4271,30 @@
he Terms of
+%0A #:
Service migh
@@ -4309,21 +4309,16 @@
present
-%0A... |
36a57b00d96e2ffed57572aaa3de074305e03244 | Use attr** in solax (#62397) | homeassistant/components/solax/sensor.py | homeassistant/components/solax/sensor.py | """Support for Solax inverter via local API."""
import asyncio
from datetime import timedelta
from solax import real_time_api
from solax.inverter import InverterError
import voluptuous as vol
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
SensorDeviceClass,
SensorEntity,
SensorStateCla... | Python | 0 | @@ -3332,32 +3332,63 @@
r a sensor.%22%22%22%0A%0A
+ _attr_should_poll = False%0A%0A
def __init__
@@ -3389,16 +3389,16 @@
init__(%0A
-
@@ -3577,17 +3577,29 @@
self.
-u
+_attr_unique_
id = uid
@@ -3616,46 +3616,44 @@
elf.
-serial = serial%0A self.key =
+_attr_name = f%22Solax %7Bserial%... |
bc6772cb8990039479f6fe2b238304765aafab41 | make 70_web.py better | examples/70_web.py | examples/70_web.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Run this script, then try the following urls:
#
# 1. http://127.0.0.1:5000/?person_id=mosky
# 2. http://127.0.0.1:5000/?name=Mosky Liu
# 3. http://127.0.0.1:5000/?name like=%Mosky%
#
import psycopg2
from flask import Flask, request, jsonify
from mosql.query import selec... | Python | 0.000151 | @@ -330,72 +330,102 @@
oin%0A
-%0Aapp = Flask(__name__)%0A%0Aconn = psycopg2.connect(host='127.0.0.1'
+from mosql.db import Database%0A%0Adb = Database(psycopg2, host='127.0.0.1')%0A%0Aapp = Flask(__name__
)%0A%0A@
@@ -460,28 +460,28 @@
-cur = conn.cursor()%0A
+with db as cur:%0A
@@ -500,16 +500,20 @@... |
c4e90fb96d57a5130f5e66958508f3c23ef24c4d | Correct ddt propagate invoice (almost all fields) | mexal_ddt/wizard/ddt_create_invoice.py | mexal_ddt/wizard/ddt_create_invoice.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Abstract (http://www.abstract.it)
# Copyright (C) 2014 Agile Business Group (http://www.agilebg.com)
#
# This program is free software: you can redistribute it and/or modify
# it und... | Python | 0 | @@ -2015,24 +2015,90 @@
agent_id.id%0A
+ #parcels = ddt.parcels # needed?%0A %0A
@@ -2260,57 +2260,8 @@
.id%0A
- #parcels = ddt.parcels # needed?%0A
@@ -3311,24 +3311,37 @@
nt Agent'))%0A
+ %0A
@@ -6055,32 +6055,33 @@
d,%0A%0A... |
cb5aeedc651773d1c298b167b07aa535dfd7beca | Fix typos/spelling in serializer docstrings (#2420) | parsl/serialize/concretes.py | parsl/serialize/concretes.py | import dill
import pickle
import logging
logger = logging.getLogger(__name__)
from parsl.serialize.base import SerializerBase
class PickleSerializer(SerializerBase):
""" Pickle serialization covers most python objects, with some notable exceptions:
* functions defined in a interpretor/notebook
* classes... | Python | 0.000005 | @@ -280,33 +280,33 @@
d in a interpret
-o
+e
r/notebook%0A *
@@ -392,25 +392,25 @@
me%0A * clo
-j
+s
ures, genera
@@ -1167,17 +1167,17 @@
nterpret
-o
+e
r/notebo
@@ -1345,17 +1345,17 @@
* clo
-j
+s
ures%0A
|
6891f7e7cf78d71d430341ea90fa8f1d65e29fdf | Fix super methods | VMEncryption/main/oscrypto/ubuntu_1404/Ubuntu1404EncryptionStateMachine.py | VMEncryption/main/oscrypto/ubuntu_1404/Ubuntu1404EncryptionStateMachine.py | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2015 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | Python | 0.000414 | @@ -3656,33 +3656,33 @@
super(Ubuntu1
-6
+4
04EncryptionStat
@@ -3865,33 +3865,33 @@
rn super(Ubuntu1
-6
+4
04EncryptionStat
@@ -4032,25 +4032,25 @@
uper(Ubuntu1
-6
+4
04Encryption
|
ef3969c84e1dea783c8b5d3389ec22d133601be8 | Load supertypes, types, and subtypes into memory | src/magic_cards/utils/initial_import.py | src/magic_cards/utils/initial_import.py | import io
import json
import zipfile
from contextlib import closing
import requests
from django.db import transaction
from magic_cards.models import Artist, Card, CardSubtype, CardSupertype, CardType, Printing, Set
MTG_JSON_URL = 'https://mtgjson.com/json/AllSets-x.json.zip'
FALLBACK_MTG_JSON_URL = 'http://mtgjson.c... | Python | 0.000001 | @@ -1471,16 +1471,268 @@
codes):%0A
+ # Load supertypes, types, and subtypes into memory%0A supertype_objs = %7Bt.name: t for t in CardSupertype.objects.all()%7D%0A type_objs = %7Bt.name: t for t in CardType.objects.all()%7D%0A subtype_objs = %7Bt.name: t for t in CardSubtype.objects.all()%7D%0A%0A
# ... |
7fd76d87cfda8f02912985cb3cf650ee8ff2e11e | Remove py2 Ska.DBI assert in report test | mica/report/tests/test_write_report.py | mica/report/tests/test_write_report.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import tempfile
import os
import shutil
import pytest
from .. import report
try:
import Ska.DBI
with Ska.DBI.DBI(server='sqlsao', dbi='sybase', user='aca_ops', database='axafocat') as db:
assert db.conn._is_connected == 1
HAS_SYBA... | Python | 0 | @@ -259,50 +259,8 @@
db:%0A
- assert db.conn._is_connected == 1%0A
|
bd4965042c251319d986fc918345a1453844ebeb | Fix log | laboratory/settings.py | laboratory/settings.py | import logging
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'sbib5ss_=z^qngyjqw1om5)4w5l@_ba@pin(7ee^k=#6q=0b)!'
DEBUG = "DLIS" in os.environ
INTERNAL_IPS = ['127.0.0.1', '192.168.0.200', '192.168.0.101', '192.168.102.4', '192.168.0.128']
ALLOWED_HOSTS = ['li... | Python | 0.000002 | @@ -3706,36 +3706,38 @@
'level': '
-DEBU
+WARNIN
G',%0A
@@ -3956,20 +3956,22 @@
evel': '
-DEBU
+WARNIN
G',%0A
|
319d457e1e6511f6c240f5f4f5479181647f7cf6 | Fix bug with test | scopus/tests/test_AffiliationSearch.py | scopus/tests/test_AffiliationSearch.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `AffiliationSearch` module."""
from collections import namedtuple
from nose.tools import assert_equal, assert_true
import scopus
s = scopus.AffiliationSearch('af-id(60021784)', refresh=True)
def test_affiliations():
received = s.affiliations
asser... | Python | 0 | @@ -348,17 +348,16 @@
list))%0A
-%0A
orde
@@ -479,9 +479,8 @@
d =
-%5B
Affi
@@ -539,24 +539,16 @@
rsity',%0A
-
@@ -570,22 +570,17 @@
uments='
-101148
+0
', city=
@@ -594,24 +594,8 @@
rk',
-%0A
cou
@@ -615,16 +615,24 @@
States',
+%0A
parent=
@@ -639,9 +639,8 @@
... |
28c29b6f3a481a0344f69c69490f49e020cacc73 | remove some leftover comments | lala/plugins/quotes.py | lala/plugins/quotes.py | import sqlite3
import logging
import os
from time import sleep
from lala.util import command, initplz, msg
#@initplz
#class Plugin(object):
#def __init__(self):
#self._con = sqlite3.connect(
#os.path.join(os.path.expanduser("~/.lala"),"quotes.sqlite3"))
#self._con.execute("CREATE T... | Python | 0 | @@ -106,414 +106,8 @@
sg%0A%0A
-#@initplz%0A#class Plugin(object):%0A #def __init__(self):%0A #self._con = sqlite3.connect(%0A #os.path.join(os.path.expanduser(%22~/.lala%22),%22quotes.sqlite3%22))%0A #self._con.execute(%22CREATE TABLE IF NOT EXISTS quotes(%5C%0A #quote TEXT)... |
ed0821bd41a10dd00727f09cf9ba82123bd2cf93 | Fix output of permissions import script | scripts/import_permissions_and_roles.py | scripts/import_permissions_and_roles.py | #!/usr/bin/env python
"""Import permissions, roles, and their relations from a TOML file.
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
import click
from byceps.services.authorization import impex_service
from byceps.util.system import get_config_filename_from... | Python | 0.000003 | @@ -550,16 +550,17 @@
+f
'Importe
|
52b6abfa11354792c01316fad7f886a4d892e013 | drugs sorted alphabetically | gui_py3.py | gui_py3.py | from tkinter import Tk, RIGHT, LEFT, TOP, BOTTOM, BOTH, FLAT, RAISED, SUNKEN, RIDGE, END, SW, W, Listbox, StringVar, Toplevel
from tkinter import ttk
#ttk import Frame, Button, Style, Label
import sqlite3
class Database(object):
def __init__(self, filename, table):
self.connection = sqlite3.connect(filena... | Python | 0.999229 | @@ -1,28 +1,60 @@
+#transmute: antipsychotic tool%0A%0A
from tkinter import Tk, RIGH
@@ -180,48 +180,8 @@
tk%0A%0A
-#ttk import Frame, Button, Style, Label%0A
impo
@@ -1161,23 +1161,39 @@
%0A%0Aclass
-Example
+TransmuteAntipsychotics
(ttk.Fra
@@ -1379,16 +1379,32 @@
ransmute
+: Antipsychotics
%22)%0A
@@ -1... |
cf94a8a51d4e8eb3fd96ca3587af0f4c38e2deec | Fix kdtree example | examples/kdtree.py | examples/kdtree.py | from __future__ import print_function
import numpy as np
import pcl
pc_1 = pcl.PointCloud()
pc_1.from_array(points_1)
pc_2 = pcl.PointCloud()
pc_2.from_array(points_2)
kd = pcl.KdTreeFLANN(pc_1)
points_1 = np.array([[0, 0, 0],
[1, 0, 0],
[0, 1, 0],
[1, 1... | Python | 0.000028 | @@ -67,136 +67,8 @@
cl%0A%0A
-pc_1 = pcl.PointCloud()%0Apc_1.from_array(points_1)%0Apc_2 = pcl.PointCloud()%0Apc_2.from_array(points_2)%0Akd = pcl.KdTreeFLANN(pc_1)%0A%0A
poin
@@ -364,16 +364,144 @@
oat32)%0A%0A
+pc_1 = pcl.PointCloud()%0Apc_1.from_array(points_1)%0Apc_2 = pcl.PointCloud()%0Apc_2.from_array(points_2... |
881290c3d29ad28fb0fddfdd895fe493d7909262 | make the wsgi.py work with all providers | django_deployer/paas_templates/wsgi.py | django_deployer/paas_templates/wsgi.py | import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),'{{ project_name }}')))
os.environ['DJANGO_SETTINGS_MODULE'] = '{{ django_settings }}_stackato'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler() | Python | 0 | @@ -178,16 +178,22 @@
%7D%7D_
-stackato
+%7B%7B provider %7D%7D
'%0Aim
|
b7b32005867b0bba06dd132713aebce4ed48f6c3 | update Param API | hwtLib/examples/hierarchy/unitWrapper.py | hwtLib/examples/hierarchy/unitWrapper.py | from hwt.hdl.constants import INTF_DIRECTION
from hwt.synthesizer.unit import Unit
from hwt.synthesizer.param import Param
class UnitWrapper(Unit):
"""
Class which creates wrapper around original unit instance,
original unit will be stored inside as subunit named baseUnit
:note: This is example of la... | Python | 0.000001 | @@ -583,21 +583,16 @@
for p
-_name
in self
@@ -660,17 +660,17 @@
eUnit, p
-_
+.
name))%0A
@@ -705,17 +705,17 @@
ameter(p
-_
+.
name, my
|
7b84c2bd59f455050a249da795d1a73021b12581 | Add an import | pathvalidate/__init__.py | pathvalidate/__init__.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from ._error import NullNameError
from ._error import InvalidCharError
from ._error import InvalidLengthError
from ._common import _validate_null_string
from ._app import validate_excel_sheet_nam... | Python | 0.000005 | @@ -184,24 +184,68 @@
idCharError%0A
+from ._error import InvalidCharWindowsError%0A
from ._error
|
a18262572150e24416088cc548268edcd3468b79 | Add .json to eventAPI path | sdk/python-sdk/predictionio/__init__.py | sdk/python-sdk/predictionio/__init__.py |
__version__ = "0.8.0-SNAPSHOT"
# import packages
import re
try:
import httplib
except ImportError:
# pylint: disable=F0401
# http is a Python3 module, replacing httplib
from http import client as httplib
import json
import urllib
from predictionio.connection import Connection
from predictionio.connection imp... | Python | 0.000001 | @@ -3471,16 +3471,21 @@
%22/events
+.json
%22%0A re
@@ -3850,16 +3850,21 @@
vents/%25s
+.json
%22 %25 enc_
|
343ed4b5ce1685c00eb611982319e48047c46361 | remove dead code | samples/test_a/test_a.py | samples/test_a/test_a.py | class project:
title = "Main Project"
estimate = 3
class task_a:
estimate = 8
class task_b:
title = "Task B"
estimate = 4
def deps(): return [project.task_a, other.task_d]
class task_c:
estimate = 6
def deps(): return [project.task_a]
class other:
... | Python | 0.999454 | @@ -480,380 +480,8 @@
an%0A%0A
- def print_tasks(tasks):%0A for name in sorted(tasks.keys()):%0A task = tasks%5Bname%5D%0A print('%7B0%7D :'.format(name))%0A print(' deps:')%0A for dep_name in task.deps:%0A print(' ' + dep_name)%0A pri... |
64becacba2458587ee524aeaef1f9c1995e0c921 | fix cymrulib unicode problems | intelmq/bots/experts/cymru/cymrulib.py | intelmq/bots/experts/cymru/cymrulib.py | import binascii, dns.resolver
from intelmq.lib.utils import reverse_ip, decode
'''
Reference: http://www.team-cymru.org/Services/ip-to-asn.html#dns
'''
IP_QUERY = "%s.origin%s.asn.cymru.com"
ASN_QUERY = "AS%s.asn.cymru.com"
class Cymru():
@staticmethod
def query(ip, ip_version):
raw_result = Cy... | Python | 0.000014 | @@ -22,16 +22,26 @@
resolver
+, StringIO
%0Afrom in
@@ -77,16 +77,8 @@
e_ip
-, decode
%0A%0A''
@@ -402,25 +402,16 @@
result)%0A
- %0A
@@ -745,16 +745,20 @@
='TXT'):
+
%0A
@@ -770,35 +770,225 @@
-return decode(query_result)
+fp = StringIO.StringIO()%0A query_result... |
e3693a267df703a76210e7ba2011421a6bc533a8 | Add, update and remove returns bool | pelix/remote/registry.py | pelix/remote/registry.py | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Pelix remote services: Imported end points registry
:author: Thomas Calmant
:copyright: Copyright 2013, isandlaTech
:license: Apache License 2.0
:version: 0.1.1
:status: Beta
..
Copyright 2013 isandlaTech
Licensed under the Apache License, Version 2.... | Python | 0.99984 | @@ -4353,32 +4353,91 @@
f the end point%0A
+ :return: True if the endpoint is known, else False%0A
%22%22%22%0A
@@ -4424,32 +4424,32 @@
lse%0A %22%22%22%0A
-
try:%0A
@@ -4837,32 +4837,38 @@
return
+ False
%0A%0A else:%0A
@@ -5254,32 +5254,57 @@
ener: %25s%22,... |
de21965a8e94e1f73efa8bd420a8d39367fa7f26 | fix for class based routing | sanic_openapi/openapi.py | sanic_openapi/openapi.py | import re
from itertools import repeat
from sanic.blueprints import Blueprint
from sanic.response import json
from sanic.views import CompositionView
from .doc import route_specs, RouteSpec, serialize_schema, definitions
blueprint = Blueprint('openapi', url_prefix='openapi')
_spec = {}
# Removes all null values ... | Python | 0 | @@ -143,16 +143,57 @@
tionView
+%0Afrom sanic.constants import HTTP_METHODS
%0A%0Afrom .
@@ -1583,24 +1583,611 @@
int.routes:%0A
+ if hasattr(route.handler, 'view_class'):%0A # class based view%0A view = route.handler.view_class%0A for http_meth... |
7b0f431a896ce8cfb39e11c2a6f3e802085f2e09 | Correct target file suffixes. | __init__.py | __init__.py | import SCons.Builder
import SCons.Scanner
def asciidoc_scanner(node, env, path):
"""Scans AsciiDoc files for include::[] directives"""
import os
import re
fname = str(node)
# TODO: maybe raise an error here?
if not os.path.isfile(fname):
return []
reg = re.compile('include::(.+)... | Python | 0 | @@ -1824,34 +1824,42 @@
return '
+.chunked
'%0A
-
elif env
@@ -2134,32 +2134,36 @@
return '
+.hhp
'%0A elif e
@@ -2212,16 +2212,20 @@
return '
+.man
'%0A
@@ -2455,16 +2455,16 @@
'text':%0A
-
@@ -2477,16 +2477,17 @@
turn '.t
+e
xt'%0A
|
b964efe5a0c7a620e1efb9a7ab43aa772f6eb5ff | Change config file path from user home to maya script directory Change config file format from plain text to json | __init__.py | __init__.py | from maya import cmds
import logging
import json
import sys
import imp
import os
# level = logging.DEBUG
level = logging.ERROR
logger = logging.getLogger(__name__)
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(level)
handler.setLevel(level)
def loadConfig():
""" Load config file
... | Python | 0 | @@ -387,46 +387,8 @@
%22%22%22%0A
- userDir = os.path.expanduser(%22~%22)%0A
@@ -389,24 +389,28 @@
%22%0A config
+File
Path = os.pa
@@ -438,30 +438,66 @@
oin(
-userDir, %22.rushConfig%22
+%0A cmds.internalVar(userScriptDir=True), 'rush.json'
))%0A%0A
@@ -694,16 +694,17 @@
if confi
+g
file do
... |
ba0f68221ed0aa3d0fcf99efcb3180ddd9d89e0b | add imports to magenta/music/__init__.py for notebook functions (#246) | __init__.py | __init__.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 | @@ -1179,24 +1179,135 @@
_midi_file%0A%0A
+from midi_synth import fluidsynth%0Afrom midi_synth import synthesize%0A%0Afrom notebook_utils import play_sequence%0A%0A
from sequenc
|
f21e1daa1324ec09e010ac7aa5b64134a97320db | Add test that runs `locust --help` | locust/test/test_main.py | locust/test/test_main.py | import os
from locust import main
from locust.argument_parser import parse_options
from locust.main import create_environment
from locust.core import HttpLocust, Locust, TaskSet
from .testcases import LocustTestCase
from .mock_locustfile import mock_locustfile
class TestLoadLocustfile(LocustTestCase):
def test_i... | Python | 0.000001 | @@ -2,16 +2,64 @@
mport os
+%0Aimport subprocess%0Afrom unittest import TestCase
%0A%0Afrom l
@@ -2589,12 +2589,584 @@
set_stats)%0A%0A
+%0Aclass LocustProcessIntegrationTest(TestCase):%0A def test_help_arg(self):%0A output = subprocess.check_output(%0A %5B%22locust%22, %22--help%22%5D, %0A ... |
0890014c18cd51f85534b096866c4d8b7cba6c3e | Create pool of processes and apply async | scripts4PAML/macse4cdsOrthofiles_TA.py | scripts4PAML/macse4cdsOrthofiles_TA.py | #!/usr/bin/python3
"""A program for aligning CDSs of a orthogroup.
USAGE: ./macse4cdsOrthofiles_TA.py
Author: Taruna Aggarwal
Affiliation: University of New Hampshire, Durham, NH, USA
Date: 01/27/2016
Purpose is
"""
import sys
import os
import subprocess
import argparse
from multiprocessing import pool
def runMACSE... | Python | 0 | @@ -270,12 +270,14 @@
rse%0A
-from
+import
mul
@@ -293,19 +293,13 @@
ing
-import pool
+as mp
%0A%0A%0Ad
@@ -1737,24 +1737,105 @@
up files.%22)%0A
+ parser.add_argument(%22--nproc%22, %22-n%22, default=2, help=%22Number of processors%22)%0A
args = p
@@ -2255,103 +2255,237 @@
)%5D%0A%0A
-%0A
-with P... |
ddd80dc52599b1295b39759d7657ae5d17f08faa | Correct end events | marsem/opencv.py | marsem/opencv.py | #!/usr/bin/python3.4 -tt
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import marsem.protocol.car as car
import marsem.protocol.config as cfg
class Color():
def __init__(self):
""" Defaults to red color """
self.min = create_color_range([17, 15, 140])
self.max = create_color_rang... | Python | 0.999176 | @@ -2818,608 +2818,37 @@
- Clock.unschedule(partial_def)%0A car.stream(False)%0A else:%0A stop()%0A Clock.unschedule(partial_def)%0A car.stream(False)%0A%0A # Checking running time of OpenCV:%0A current_time = timer() ... |
3afd38c8ed9596e18bbefdb2ce964d3e029bd061 | Fix #1 reversion not found bug | maslow/models.py | maslow/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.contrib.contenttypes.models import ContentType
from django.contrib.flatpages.models import FlatPage
from django.contrib.postgres.fields import JSONField
from mptt.models import MPTTModel, T... | Python | 0 | @@ -432,16 +432,17 @@
ersion%0A%0A
+%0A
class Na
@@ -1058,16 +1058,17 @@
form'))%0A
+%0A
# ca
@@ -1392,24 +1392,25 @@
blank=True)%0A
+%0A
# data_f
@@ -1918,24 +1918,24 @@
ct = True%0A%0A%0A
+
class Natura
@@ -1971,17 +1971,16 @@
Model):%0A
-%0A
clas
@@ -4461,17 +4461,16 @@
True%0A%0A%0A
-%0A
ON... |
b500c1277645350eb66610d796ffca3170e1bdc5 | Add options for excluding files | hashDir.py | hashDir.py | import argparse
import sys
from Furtive import Furtive
''' '''
def main():
# If Python 2.6 or lower, should import optparse but erroring out now
if sys.hexversion < 0x02070000:
raise SystemError("Python version 2.7.0 or greater is required. You are running " + sys.version)
parser = argparse.Argument... | Python | 0.000001 | @@ -726,16 +726,196 @@
rts sha1
+ only.%22)%0A parser.add_argument('--exclude', action=%22store%22, dest=%22excludes%22, default=%5B''%5D, %0A help=%22Patterns to exclude files and directories from manifest.
%22)%0A p
|
3db5577f860ac5c931fd267092433c3f547693ab | Upgrade selenium to version 2.52.0 | seleniumbase/core/selenium_launcher.py | seleniumbase/core/selenium_launcher.py | """ Download and run the selenium server jar file """
import subprocess
import os
import socket
import urllib
import time
SELENIUM_JAR = ("http://selenium-release.storage.googleapis.com"
"/2.50/selenium-server-standalone-2.50.1.jar")
JAR_FILE = "selenium-server-standalone-2.50.1.jar"
def download_se... | Python | 0 | @@ -203,17 +203,17 @@
%22/2.5
-0
+2
/seleniu
@@ -231,27 +231,27 @@
andalone-2.5
-0.1
+2.0
.jar%22)%0AJAR_F
@@ -291,11 +291,11 @@
-2.5
-0.1
+2.0
.jar
|
1fd2623c1e718a1b6685c82f40d4bcb11dd8541d | Add a get_collection method. | matgendb/util.py | matgendb/util.py | """
Utility functions used across scripts
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "1.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Dec 1, 2012"
import bson
import datetime
import json
import os
DEFAULT_PORT = 27017
DEFAULT... | Python | 0 | @@ -283,16 +283,48 @@
port os%0A
+from pymongo import Connection%0A%0A
%0ADEFAULT
@@ -917,16 +917,366 @@
INGS)%0A%0A%0A
+def get_collection(config_file, admin=False):%0A d = get_settings(config_file)%0A conn = Connection(d%5B%22host%22%5D, d%5B%22port%22%5D)%0A db = conn%5Bd%5B%22database%22%5D%5D%0A use... |
0477f78f830f1d569ea31f9b1745fe373ad67c2b | correct double logging | pimat_server/__main__.py | pimat_server/__main__.py | #!/usr/bin/python
import datetime
import logging
import signal
import sys
import time
import Adafruit_DHT
import RPi.GPIO as GPIO
import configparser
import scheduler
from relays import Relays
from sqlalchemy import Column, Integer, String, Float, DateTime
from sqlalchemy import create_engine
from sqlalchemy.orm import... | Python | 0.000006 | @@ -2324,335 +2324,8 @@
')%0A%0A
- sensors_log = logging.getLogger()%0A handler = logging.FileHandler('/var/log/pimat/sensors.log')%0A formatter = logging.Formatter('%5B%25(levelname)s%5D %5B%25(asctime)-15s%5D %5BPID: %25(process)d%5D %5B%25(name)s%5D %25(message)s')%0A handler.setFormatter(formatter)%0A ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.