commit stringlengths 40 40 | subject stringlengths 1 1.49k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | new_contents stringlengths 1 29.8k | old_contents stringlengths 0 9.9k | lang stringclasses 3
values | proba float64 0 1 |
|---|---|---|---|---|---|---|---|
198d4944e961fd998d6e896b3e75ca2e815ffaa5 | Add log to file function for vimapt package | src/vimapt/library/vimapt/__init__.py | src/vimapt/library/vimapt/__init__.py | import logging
logging.basicConfig(filename='/var/log/vimapt.log', level=logging.INFO)
logger = logging.getLogger(__name__)
| Python | 0 | |
a84dde598297495fe6f0f8b233b3a3761b0df7d4 | Update test to check newer logic | tests/functional/test_warning.py | tests/functional/test_warning.py | import textwrap
def test_environ(script, tmpdir):
"""$PYTHONWARNINGS was added in python2.7"""
demo = tmpdir.join('warnings_demo.py')
demo.write(textwrap.dedent('''
from logging import basicConfig
from pip._internal.utils import deprecation
deprecation.install_warning_logger()
... |
def test_environ(script, tmpdir):
"""$PYTHONWARNINGS was added in python2.7"""
demo = tmpdir.join('warnings_demo.py')
demo.write('''
from pip._internal.utils import deprecation
deprecation.install_warning_logger()
from logging import basicConfig
basicConfig()
from warnings import warn
warn("deprecated!",... | Python | 0 |
d49668dfb76e148fab6e878b2d1944a5e70a3c38 | fix test_cookie test on windows | tests/integration/test_cookie.py | tests/integration/test_cookie.py | # vim:ts=4:sw=4:et:
# Copyright 2018-present Facebook, Inc.
# Licensed under the Apache License, Version 2.0
# no unicode literals
from __future__ import absolute_import, division, print_function
import os
import socket
import pywatchman
import WatchmanTestCase
@WatchmanTestCase.expand_matrix
class TestCookie(Watc... | # vim:ts=4:sw=4:et:
# Copyright 2018-present Facebook, Inc.
# Licensed under the Apache License, Version 2.0
# no unicode literals
from __future__ import absolute_import, division, print_function
import os
import socket
import pywatchman
import WatchmanTestCase
@WatchmanTestCase.expand_matrix
class TestCookie(Watc... | Python | 0.000001 |
a08c54d524e166d913c7e395e6a36cca76243df4 | add sqlite no-op tests | tests/integration/test_sqlite.py | tests/integration/test_sqlite.py | import os
import unittest
from threading import Thread
from unittest.mock import patch
from requests_cache.backends.sqlite import DbDict, DbPickleDict
from tests.integration.test_backends import BaseStorageTestCase
class SQLiteTestCase(BaseStorageTestCase):
def tearDown(self):
try:
os.unlink(... | import os
import unittest
from threading import Thread
from unittest.mock import patch
from requests_cache.backends.sqlite import DbDict, DbPickleDict
from tests.integration.test_backends import BaseStorageTestCase
class SQLiteTestCase(BaseStorageTestCase):
def tearDown(self):
try:
os.unlink(... | Python | 0.000002 |
21e95ff23a4ceca06d4bfd291f0e2b29b896af2f | Add tests for timeout and listen stop | tests/test_listener.py | tests/test_listener.py | #!/usr/bin/env python
import argparse
import os
import pytest
import pg_bawler.core
import pg_bawler.listener
class NotificationListener(
pg_bawler.core.BawlerBase,
pg_bawler.core.ListenerMixin
):
pass
class NotificationSender(
pg_bawler.core.BawlerBase,
pg_bawler.core.SenderMixin
):
pass
... | #!/usr/bin/env python
import argparse
import os
import pytest
import pg_bawler.core
import pg_bawler.listener
class NotificationListener(
pg_bawler.core.BawlerBase,
pg_bawler.core.ListenerMixin
):
pass
class NotificationSender(
pg_bawler.core.BawlerBase,
pg_bawler.core.SenderMixin
):
pass
... | Python | 0 |
9c92cf39a69bbc6a078a8ffd7fcd8ea8f95b2678 | fix tests | tests/test_payments.py | tests/test_payments.py | # Test cases can be run with either of the following:
# python -m unittest discover
# nosetests -v --rednose --nologcapture
import unittest
from app import payments
from db import app_db, models
class TestModels(unittest.TestCase):
def setUp(self):
payments.app.debug = True
payments.app.config[... | # Test cases can be run with either of the following:
# python -m unittest discover
# nosetests -v --rednose --nologcapture
import unittest
import db
from app import payments
from db import db, models
class TestModels(unittest.TestCase):
def setUp(self):
payments.app.debug = True
payments.app.c... | Python | 0.000001 |
00f15f47f8eeabf336e0e2a71cda48aaef270f85 | Comment out apparently-unused code. | build/getversion.py | build/getversion.py | #!/usr/bin/env python
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | #!/usr/bin/env python
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | Python | 0 |
ee0f31857028a68116f2912054877f37bd64683a | fix vdsClient connections | ovirt_hosted_engine_ha/broker/submonitor_util.py | ovirt_hosted_engine_ha/broker/submonitor_util.py | #
# ovirt-hosted-engine-ha -- ovirt hosted engine high availability
# Copyright (C) 2013 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 Licens... | #
# ovirt-hosted-engine-ha -- ovirt hosted engine high availability
# Copyright (C) 2013 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 Licens... | Python | 0 |
727b42a1cdec461d715b845872c321326ce18554 | Load aliases on module load | Modules/Alias.py | Modules/Alias.py | from ModuleInterface import ModuleInterface
from IRCResponse import IRCResponse, ResponseType
import GlobalVars
class Alias(ModuleInterface):
triggers = ["alias"]
help = 'alias <alias> <command> <params> - aliases <alias> to the specified command and parameters\n' \
'you can specify where parameter... | from ModuleInterface import ModuleInterface
from IRCResponse import IRCResponse, ResponseType
import GlobalVars
class Alias(ModuleInterface):
triggers = ["alias"]
help = 'alias <alias> <command> <params> - aliases <alias> to the specified command and parameters\n' \
'you can specify where parameter... | Python | 0 |
52cf1efd8b1f721d65732d16b171040d83d02b21 | fix test_workflow | tests/test_workflow.py | tests/test_workflow.py | from unittest import TestCase
from dvc.graph.workflow import Workflow
from dvc.graph.commit import Commit
class TestWorkflow(TestCase):
def setUp(self):
self._commit4 = Commit('4', '3', 'name1', 'today', 'comment4')
self._commit3 = Commit('3', '2', 'name1', 'today', 'DVC repro-run ...')
s... | from unittest import TestCase
from dvc.graph.workflow import Workflow
from dvc.graph.commit import Commit
class TestWorkflow(TestCase):
def setUp(self):
self._commit4 = Commit('4', '3', 'name1', 'today', 'comment4')
self._commit3 = Commit('3', '2', 'name1', 'today', 'DVC repro-run ...')
s... | Python | 0 |
ede603fd2b63f101174d4312ed77f710aaaeec3a | comment out test for `test_data_split_nlu` | tests/cli/test_rasa_data.py | tests/cli/test_rasa_data.py | import argparse
import os
from unittest.mock import Mock
import pytest
from collections import namedtuple
from typing import Callable, Text
from _pytest.monkeypatch import MonkeyPatch
from _pytest.pytester import RunResult
from rasa.cli import data
from rasa.importers.importer import TrainingDataImporter
from rasa.val... | import argparse
import os
from unittest.mock import Mock
import pytest
from collections import namedtuple
from typing import Callable, Text
from _pytest.monkeypatch import MonkeyPatch
from _pytest.pytester import RunResult
from rasa.cli import data
from rasa.importers.importer import TrainingDataImporter
from rasa.val... | Python | 0 |
a69a346e2fd35e531c72b06a2c895d928340c110 | Fix `includes_today` trait fo `MembershipFactory` | tests/factories/property.py | tests/factories/property.py | from datetime import datetime, timedelta, timezone
from functools import partial
from itertools import chain
import factory
from pycroft.model.user import Membership, PropertyGroup
from pycroft.helpers import interval
from .base import BaseFactory
from .user import UserFactory
class MembershipFactory(BaseFactory):... | from datetime import datetime, timedelta, timezone
from functools import partial
from itertools import chain
import factory
from pycroft.model.user import Membership, PropertyGroup
from pycroft.helpers import interval
from .base import BaseFactory
from .user import UserFactory
class MembershipFactory(BaseFactory):... | Python | 0 |
acce8817eae67dc605ffe628d0d536511d3ea915 | remove dead code | corehq/apps/ota/forms.py | corehq/apps/ota/forms.py | from django import forms
from django.utils.translation import gettext
from crispy_forms import layout as crispy
# todo proper B3 Handle
from crispy_forms.bootstrap import StrictButton
from crispy_forms.helper import FormHelper
from corehq.apps.hqwebapp import crispy as hqcrispy
class PrimeRestoreCacheForm(forms.For... | from django import forms
from django.utils.translation import gettext
from crispy_forms import layout as crispy
# todo proper B3 Handle
from crispy_forms.bootstrap import StrictButton
from crispy_forms.helper import FormHelper
from corehq.apps.hqwebapp import crispy as hqcrispy
class PrimeRestoreCacheForm(forms.For... | Python | 0.999454 |
24439d318668897d8d1aff99df1606e80d45b875 | add watchdog test | tests/test_bmc.py | tests/test_bmc.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
from nose.tools import eq_, raises
from pyipmi.bmc import *
import pyipmi.msgs.bmc
from pyipmi.msgs import encode_message
from pyipmi.msgs import decode_message
def test_watchdog_object():
m = pyipmi.msgs.bmc.GetWatchdogTimerRsp()
decode_message(m, '\x00\x41\x42\x... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
from nose.tools import eq_, raises
from pyipmi.bmc import *
import pyipmi.msgs.bmc
from pyipmi.msgs import encode_message
from pyipmi.msgs import decode_message
def test_deviceid_object():
m = pyipmi.msgs.bmc.GetDeviceIdRsp()
decode_message(m, '\x00\x12\x84\x05\x6... | Python | 0 |
5ae1d9ebcc34d47c858ba63e26121be92771d812 | temporary fix test_bot login | tests/test_bot.py | tests/test_bot.py | import json
import requests
from instabot import Bot
try:
from unittest.mock import Mock, patch
except ImportError:
from mock import Mock, patch
class TestBot:
def setup(self):
self.USER_ID = 1234567
self.USERNAME = "test_username"
self.PASSWORD = "test_password"
self.FU... | import json
import requests
from instabot import Bot
try:
from unittest.mock import Mock, patch
except ImportError:
from mock import Mock, patch
class TestBot:
def setup(self):
self.USER_ID = 1234567
self.USERNAME = "test_username"
self.PASSWORD = "test_password"
self.FU... | Python | 0.997568 |
e6519d121ab80467fafdab6a2183964d97ef60e8 | Add test for set_meta command. | tests/test_cli.py | tests/test_cli.py | # -*- coding: utf-8 -*-
import os
from click.testing import CliRunner
from sigal import init
from sigal import serve
from sigal import set_meta
def test_init(tmpdir):
config_file = str(tmpdir.join('sigal.conf.py'))
runner = CliRunner()
result = runner.invoke(init, [config_file])
assert result.exit_c... | # -*- coding: utf-8 -*-
import os
from click.testing import CliRunner
from sigal import init
from sigal import serve
def test_init(tmpdir):
config_file = str(tmpdir.join('sigal.conf.py'))
runner = CliRunner()
result = runner.invoke(init, [config_file])
assert result.exit_code == 0
assert result.... | Python | 0 |
f5652e96edf871ca88e80a920cfc97876e7531a3 | modify tests (add example for string => int) | tests/test_fst.py | tests/test_fst.py | import os, sys
# TODO: better way to find package...
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parent_dir)
import fst
from fst import Matcher
import unittest
from struct import pack, unpack
class TestFST(unittest.TestCase):
def test_create_minimum_transducer1(s... | import os, sys
# TODO: better way to find package...
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parent_dir)
import fst
from fst import Matcher
import unittest
class TestFST(unittest.TestCase):
def test_create_minimum_transducer1(self):
dict_file = '/tmp/... | Python | 0.000001 |
d2de2d44a46ff521ab8c1d8bbc57d4eeb8d5dc53 | Fix an error | taiga/users/services.py | taiga/users/services.py | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | Python | 0.998142 |
0f5d0353f9faad9bb34432cd047540b81c6ea643 | add exception test for invalid authentication | tests/test_tpm.py | tests/test_tpm.py | import requests
import requests_mock
import unittest
import os.path
import tpm
import json
import logging
log = logging.getLogger(__name__)
api_url = 'https://tpm.example.com/index.php/api/v4/'
local_path = 'tests/resources/'
item_limit = 20
def fake_data(url, m):
"""
A stub urlopen() implementation that lo... | import requests
import requests_mock
import unittest
import os.path
import tpm
import json
import logging
log = logging.getLogger(__name__)
api_url = 'https://tpm.example.com/index.php/api/v4/'
local_path = 'tests/resources/'
item_limit = 20
def fake_data(url, m):
"""
A stub urlopen() implementation that lo... | Python | 0.000001 |
d43d4638eefe6d08dcb9ad739753bc4c43647c2a | fix another lazy test | tests/legacy/test_xmlrpc.py | tests/legacy/test_xmlrpc.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... | # 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.000034 |
87ff78dfe54795f9067fa45f832e8bc84b16c894 | Fix integer division | tf_rl/simulate.py | tf_rl/simulate.py | from __future__ import division
import math
import time
from IPython.display import clear_output, display, HTML
from itertools import count
from os.path import join, exists
from os import makedirs
def simulate(simulation,
controller= None,
fps=60,
visualize_every=1,
... | import math
import time
from IPython.display import clear_output, display, HTML
from itertools import count
from os.path import join, exists
from os import makedirs
def simulate(simulation,
controller= None,
fps=60,
visualize_every=1,
action_every=1,
si... | Python | 0.999999 |
31a2439c1137068d8532c5f85cc1c8fb913d7ee8 | Add reconnect to clamscan | modules/Antivirus/ClamAVScan.py | modules/Antivirus/ClamAVScan.py | # 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/.
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals
try:
import pyclam... | # 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/.
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals
try:
import pyclam... | Python | 0.000001 |
821e191e05269b9c1cc5f58b3d4cecf5bd20e896 | Correct Range sample | samples/python/com.ibm.streamsx.topology.pysamples/opt/python/streams/spl_sources.py | samples/python/com.ibm.streamsx.topology.pysamples/opt/python/streams/spl_sources.py | # Licensed Materials - Property of IBM
# Copyright IBM Corp. 2015, 2016
from __future__ import absolute_import, division, print_function
# Simple inclusion of Python logic within an SPL application
# as a SPL "Function" operator. A "Function" operator has
# a single input port and single output port, a function
# is ... | # Licensed Materials - Property of IBM
# Copyright IBM Corp. 2015, 2016
from __future__ import absolute_import, division, print_function
# Simple inclusion of Python logic within an SPL application
# as a SPL "Function" operator. A "Function" operator has
# a single input port and single output port, a function
# is ... | Python | 0.000001 |
b23a887edd6b55f2386c45c9b93c04431bceba5e | remove all__vary_rounds setting (deprecated in Passlib 1.7) | coremods/login.py | coremods/login.py | """
login.py - Implement core login abstraction.
"""
from pylinkirc import conf, utils, world
from pylinkirc.log import log
try:
from passlib.context import CryptContext
except ImportError:
CryptContext = None
log.warning("Hashed passwords are disabled because passlib is not installed. Please install "
... | """
login.py - Implement core login abstraction.
"""
from pylinkirc import conf, utils, world
from pylinkirc.log import log
try:
from passlib.context import CryptContext
except ImportError:
CryptContext = None
log.warning("Hashed passwords are disabled because passlib is not installed. Please install "
... | Python | 0 |
b79a80d894bdc39c8fa6f76fe50e222567f00df1 | Update cofnig_default: add elastic search config | config_default.py | config_default.py | # -*- coding: utf-8 -*-
"""
Created on 2015-10-23 08:06:00
@author: Tran Huu Cuong <tranhuucuong91@gmail.com>
"""
import os
# Blog configuration values.
# You may consider using a one-way hash to generate the password, and then
# use the hash again in the login view to perform the comparison. This is just
# for sim... | # -*- coding: utf-8 -*-
"""
Created on 2015-10-23 08:06:00
@author: Tran Huu Cuong <tranhuucuong91@gmail.com>
"""
import os
# Blog configuration values.
# You may consider using a one-way hash to generate the password, and then
# use the hash again in the login view to perform the comparison. This is just
# for sim... | Python | 0 |
a7c084b4ff3d5529ca54209283d0e1a5984ebea2 | Fix lint error | tldextract/cli.py | tldextract/cli.py | '''tldextract CLI'''
import logging
import sys
from .tldextract import TLDExtract
from ._version import version as __version__
def main():
'''tldextract CLI main command.'''
import argparse
logging.basicConfig()
parser = argparse.ArgumentParser(
prog='tldextract',
description='Par... | '''tldextract CLI'''
import logging
import sys
from .tldextract import TLDExtract
from ._version import version as __version__
def main():
'''tldextract CLI main command.'''
import argparse
logging.basicConfig()
parser = argparse.ArgumentParser(
prog='tldextract',
description='Pars... | Python | 0.000035 |
3f0930f4c7758bc690f01d09f743e24068db05c1 | extend benchmark to run both upload and download tests | tools/run_benchmark.py | tools/run_benchmark.py | import os
import time
import shutil
import subprocess
import sys
toolset = ''
if len(sys.argv) > 1:
toolset = sys.argv[1]
ret = os.system('cd ../examples && bjam boost=source profile statistics=on -j3 %s stage_client_test' % toolset)
ret = os.system('cd ../examples && bjam boost=source release -j3 %s stage_connectio... | import os
import time
import shutil
import subprocess
import sys
port = (int(time.time()) % 50000) + 2000
toolset = ''
if len(sys.argv) > 1:
toolset = sys.argv[1]
ret = os.system('cd ../examples && bjam boost=source profile statistics=on -j3 %s stage_client_test' % toolset)
ret = os.system('cd ../examples && bjam b... | Python | 0 |
c22ffd3c2c8feb0dfba2eb6df6fb8cbb49475cee | Remove un-used `message` arg, Fixes #4824 | salt/returners/sentry_return.py | salt/returners/sentry_return.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Salt returner that report error back to sentry
Pillar need something like::
raven:
servers:
- http://192.168.1.1
- https://sentry.example.com
public_key: deadbeefdeadbeefdeadbeefdeadbeef
secret_key: beefdeadbeefdeadbeefdeadbeefde... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Salt returner that report error back to sentry
Pillar need something like::
raven:
servers:
- http://192.168.1.1
- https://sentry.example.com
public_key: deadbeefdeadbeefdeadbeefdeadbeef
secret_key: beefdeadbeefdeadbeefdeadbeefde... | Python | 0 |
e7c462af8382a5eb7f5fee2abfc04f002e36b193 | Add varint and varlong tests | tests/mcp/test_datautils.py | tests/mcp/test_datautils.py | from spock.mcp import datautils
from spock.utils import BoundBuffer
def test_unpack_varint():
largebuff = BoundBuffer(b'\x80\x94\xeb\xdc\x03')
smallbuff = BoundBuffer(b'\x14')
assert datautils.unpack_varint(smallbuff) == 20
assert datautils.unpack_varint(largebuff) == 1000000000
def test_pack_varint... | Python | 0 | |
4e887718e44453f0f0cd65addc0284668b31bbd2 | Disable session cache | src/clarityv2/conf/production.py | src/clarityv2/conf/production.py | from .base import *
import raven
#
# Standard Django settings.
#
DEBUG = False
ENVIRONMENT = 'production'
ADMINS = (
'Alex', 'khomenkodev17@gmail.com'
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('DB_NAME'),
'USER': os.getenv('DB_USER'),
... | from .base import *
import raven
#
# Standard Django settings.
#
DEBUG = False
ENVIRONMENT = 'production'
ADMINS = (
'Alex', 'khomenkodev17@gmail.com'
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('DB_NAME'),
'USER': os.getenv('DB_USER'),
... | Python | 0.000001 |
ca885203ab82026ca21a200c1bee5ad3c0a82cb5 | Change default interval | src/cmsplugin_carousel/models.py | src/cmsplugin_carousel/models.py | from adminsortable.models import SortableMixin
from cms.models import CMSPlugin
from cms.models.fields import PageField
from django.db import models
from django.utils.translation import ugettext_lazy as _
from filer.fields.image import FilerImageField
class CarouselPlugin(CMSPlugin):
interval = models.PositiveInt... | from adminsortable.models import SortableMixin
from cms.models import CMSPlugin
from cms.models.fields import PageField
from django.db import models
from django.utils.translation import ugettext_lazy as _
from filer.fields.image import FilerImageField
class CarouselPlugin(CMSPlugin):
interval = models.PositiveInt... | Python | 0.000001 |
25508fef8d2632835bf29e22a39ef1d70b615f62 | make PooledConnection more robust to other kinds of exceptions | connection.py | connection.py | import threading
from Queue import Queue
from thrift import Thrift
from thrift.transport import TTransport
from thrift.transport import TSocket
from thrift.protocol import TBinaryProtocol
from cassandra import Cassandra
__all__ = ['connect', 'connect_thread_local', 'connect_pooled']
DEFAULT_SERVER = 'localhost:9160'... | import threading
from Queue import Queue
from thrift import Thrift
from thrift.transport import TTransport
from thrift.transport import TSocket
from thrift.protocol import TBinaryProtocol
from cassandra import Cassandra
__all__ = ['connect', 'connect_thread_local', 'connect_pooled']
DEFAULT_SERVER = 'localhost:9160'... | Python | 0 |
d8077e7de68d2059ba338b650cfd1904686af754 | fix problem in thread-local connections where it was reconnecting every function call | connection.py | connection.py | from exceptions import Exception
import threading
from Queue import Queue
from thrift import Thrift
from thrift.transport import TTransport
from thrift.transport import TSocket
from thrift.protocol import TBinaryProtocol
from cassandra import Cassandra
__all__ = ['connect', 'connect_thread_local', 'NoServerAvailable'... | from exceptions import Exception
import threading
from Queue import Queue
from thrift import Thrift
from thrift.transport import TTransport
from thrift.transport import TSocket
from thrift.protocol import TBinaryProtocol
from cassandra import Cassandra
__all__ = ['connect', 'connect_thread_local', 'NoServerAvailable'... | Python | 0.000001 |
64e3f7c56d8c395aebf5bc15fb03264fb9b390bb | Update Admin.py | Plugins/Admin.py | Plugins/Admin.py | import discord
from discord.ext import commands
import random
import asyncio
import Dependencies
from datetime import datetime
class Admin():
def __init__(self, bot):
self.bot = bot
# strike command
@commands.has_role("Mods")
@commands.command(pass_context=True)
async ... | import discord
from discord.ext import commands
import random
import asyncio
import Dependencies
from datetime import datetime
class Admin():
def __init__(self, bot):
self.bot = bot
# strike command
@commands.has_role("Mods")
@commands.command(pass_context=True)
async ... | Python | 0.000001 |
8bcd0063ce0ede395172409c5bcbe778a54cf92c | Fix bug in api related to querying mapobject types | tmaps/mapobject/api.py | tmaps/mapobject/api.py | import os.path as p
import json
from flask.ext.jwt import jwt_required
from flask.ext.jwt import current_identity
from flask.ext.jwt import jwt_required
from flask import jsonify, request
from sqlalchemy.sql import text
from tmaps.api import api
from tmaps.extensions import db
from tmaps.mapobject import MapobjectOu... | import os.path as p
import json
from flask.ext.jwt import jwt_required
from flask.ext.jwt import current_identity
from flask.ext.jwt import jwt_required
from flask import jsonify, request
from sqlalchemy.sql import text
from tmaps.api import api
from tmaps.extensions import db
from tmaps.mapobject import MapobjectOu... | Python | 0 |
f96f3f6ac5ca5f9301c2c463b0a3f4f710187f21 | Use utf-8 | constantes.py | constantes.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from BeautifulSoup import BeautifulSoup
import requests
def get_profs():
r = requests.get("http://www.heb.be/esi/personnel_fr.htm")
soup = BeautifulSoup(r.text)
soup = soup.findAll('ul')[2]
profs = {}
for line in soup:
line = str(line)
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from BeautifulSoup import BeautifulSoup
import requests
def get_profs():
r = requests.get("http://www.heb.be/esi/personnel_fr.htm")
soup = BeautifulSoup(r.text)
soup = soup.findAll('ul')[2]
profs = {}
for line in soup:
line = str(line)
... | Python | 0 |
0726bc2cabd98639214e2cd14c49d30262e75d5e | Streamline setup of deCONZ button platform (#70593) | homeassistant/components/deconz/button.py | homeassistant/components/deconz/button.py | """Support for deCONZ buttons."""
from __future__ import annotations
from dataclasses import dataclass
from pydeconz.models.event import EventType
from pydeconz.models.scene import Scene as PydeconzScene
from homeassistant.components.button import (
DOMAIN,
ButtonEntity,
ButtonEntityDescription,
)
from ... | """Support for deCONZ buttons."""
from __future__ import annotations
from dataclasses import dataclass
from pydeconz.models.scene import Scene as PydeconzScene
from homeassistant.components.button import (
DOMAIN,
ButtonEntity,
ButtonEntityDescription,
)
from homeassistant.config_entries import ConfigEn... | Python | 0 |
afdc58945c710f623714e6b07c593489c0cd42be | Implement basic list command | src/xii/builtin/commands/list/list.py | src/xii/builtin/commands/list/list.py | import datetime
from xii import definition, command, error
from xii.need import NeedLibvirt, NeedSSH
class ListCommand(command.Command):
"""List all currently defined components
"""
name = ['list', 'ls']
help = "list all currently defined components"
@classmethod
def argument_parser(cls):
... | from xii import definition, command, error
from xii.need import NeedLibvirt, NeedSSH
class ListCommand(command.Command):
"""List all currently defined components
"""
name = ['list', 'ls']
help = "list all currently defined components"
@classmethod
def argument_parser(cls):
parser = co... | Python | 0.999947 |
095ec4c38015f1b1b53cb88ae59fbf6a7596b492 | update VAF | mnist/training.py | mnist/training.py | # Copyright 2017 Max W. Y. Lam
#
# 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... | # Copyright 2017 Max W. Y. Lam
#
# 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 |
7a8aa79f191ed633babc1134238017c164b306f3 | Add optional rtsp_port for Foscam (#22786) | homeassistant/components/foscam/camera.py | homeassistant/components/foscam/camera.py | """
This component provides basic support for Foscam IP cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.foscam/
"""
import logging
import voluptuous as vol
from homeassistant.components.camera import (
Camera, PLATFORM_SCHEMA, SUPPOR... | """
This component provides basic support for Foscam IP cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.foscam/
"""
import logging
import voluptuous as vol
from homeassistant.components.camera import (
Camera, PLATFORM_SCHEMA, SUPPOR... | Python | 0 |
ec23d68af3cacefe39fd9e9f21f4cdfebe8f02e5 | update mime type when sending email | contact.py | contact.py | from __future__ import (
absolute_import,
print_function,
)
from collections import defaultdict
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from flask import render_template
import json
import requests
from subprocess import (
Popen,
PIPE,
)
from config import (... | from __future__ import (
absolute_import,
print_function,
)
from collections import defaultdict
from flask import render_template
import json
import requests
from subprocess import (
Popen,
PIPE,
)
from config import (
DOMAIN_NAME,
TELSTRA_CONSUMER_KEY,
TELSTRA_CONSUMER_SECRET,
YO_API_... | Python | 0.000001 |
85537e3f8557a76b8b2ad89edc41848c29622c24 | Update the paint tool shape with the viewer image changes | skimage/viewer/plugins/labelplugin.py | skimage/viewer/plugins/labelplugin.py | import numpy as np
from .base import Plugin
from ..widgets import ComboBox, Slider
from ..canvastools import PaintTool
__all__ = ['LabelPainter']
rad2deg = 180 / np.pi
class LabelPainter(Plugin):
name = 'LabelPainter'
def __init__(self, max_radius=20, **kwargs):
super(LabelPainter, self).__init_... | import numpy as np
from .base import Plugin
from ..widgets import ComboBox, Slider
from ..canvastools import PaintTool
__all__ = ['LabelPainter']
rad2deg = 180 / np.pi
class LabelPainter(Plugin):
name = 'LabelPainter'
def __init__(self, max_radius=20, **kwargs):
super(LabelPainter, self).__init_... | Python | 0 |
8a6b100e671b4f22dee6b0399eb8a4bc8bf1a97e | update longdesc string | mriqc/info.py | mriqc/info.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
MRIQC
"""
__versionbase__ = '0.8.6'
__versionrev__ = 'a4'
__version__ = __versionbase__ + __versionrev__
__author__ = 'Oscar Esteban'
__email__ = 'code@osc... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
MRIQC
"""
__versionbase__ = '0.8.6'
__versionrev__ = 'a4'
__version__ = __versionbase__ + __versionrev__
__author__ = 'Oscar Esteban'
__email__ = 'code@osc... | Python | 0.000004 |
fb2c9469f6d026e77e0f8c20a12f4373e68f9ba2 | update dependency xgboost to v1 (#543) | training/xgboost/structured/base/setup.py | training/xgboost/structured/base/setup.py | #!/usr/bin/env python
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | #!/usr/bin/env python
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python | 0 |
9aff0b8d5989bf11242ac30b718c23242631668e | call enable in RataryEncoder.__init__, fixed a few typos | libraries/RotaryEncoder/rotary_encoder.py | libraries/RotaryEncoder/rotary_encoder.py |
import os
from bbio.platform import sysfs
from bbio import addToCleanup, cape_manager, OCP_PATH, delay
class RotaryEncoder(object):
_eqep_dirs = [
'%s/48300000.epwmss/48300180.eqep' % OCP_PATH,
'%s/48302000.epwmss/48302180.eqep' % OCP_PATH,
'%s/48304000.epwmss/48304180.eqep' % OCP_PATH
]
... |
import os
from bbio.platform import sysfs
from bbio import addToCleanup, cape_manager, OCP_PATH, delay
class RotaryEncoder(object):
_eqep_dirs = [
'%s/48300000.epwmss/48300180.eqep' % OCP_PATH,
'%s/48302000.epwmss/48302180.eqep' % OCP_PATH,
'%s/48304000.epwmss/48304180.eqep' % OCP_PATH
]
... | Python | 0.995994 |
06a1b635b02e001e798fa57e70a56ad17f9df7d0 | fix country cleanup migrate script 5 | portality/migrate/p1p2/country_cleanup.py | portality/migrate/p1p2/country_cleanup.py | import sys
from datetime import datetime
from portality import models
from portality import xwalk
def main(argv=sys.argv):
start = datetime.now()
journal_iterator = models.Journal.all_in_doaj()
counter = 0
for j in journal_iterator:
counter += 1
oldcountry = j.bibjson().count... | import sys
from datetime import datetime
from portality import models
from portality import xwalk
def main(argv=sys.argv):
start = datetime.now()
journal_iterator = models.Journal.all_in_doaj()
counter = 0
for j in journal_iterator:
counter += 1
oldcountry = j.bibjson().count... | Python | 0.000001 |
042446c8394794255471d784e041c1d9c4ef0752 | Update example config | calplus/conf/providers.py | calplus/conf/providers.py | """Provider Configuration"""
from oslo_config import cfg
# Openstack Authenticate Configuration.
openstack_group = cfg.OptGroup('openstack',
title='OpenStack Hosts')
openstack_opts = [
cfg.StrOpt('driver_name',
default='OpenStackHUST'),
cfg.StrOpt('type_driver',
... | """Provider Configuration"""
from oslo_config import cfg
# Openstack Authenticate Configuration.
openstack_group = cfg.OptGroup('openstack1',
title='OpenStack Hosts')
openstack_opts = [
cfg.StrOpt('driver_name',
default='OpenStackHUST'),
cfg.StrOpt('type_driver',
... | Python | 0.000001 |
ccaca70aa28bdd3e4f2a9c6e46d76e3ff8653f88 | Fix public page hashids issue | crestify/views/public.py | crestify/views/public.py | from crestify import app, hashids
from crestify.models import Bookmark
from flask import render_template
@app.route('/public/<string:bookmark_id>', methods=['GET'])
def bookmark_public(bookmark_id):
bookmark_id = hashids.decode(str(bookmark_id))[0]
query = Bookmark.query.get(bookmark_id)
return render_tem... | from crestify import app, hashids
from crestify.models import Bookmark
from flask import render_template
@app.route('/public/<string:bookmark_id>', methods=['GET'])
def bookmark_public(bookmark_id):
bookmark_id = hashids.decode(bookmark_id)[0]
query = Bookmark.query.get(bookmark_id)
return render_template... | Python | 0 |
bfdf4bffdb30e6f9651c96afb711d2a871b9ff87 | fix output to shell | create_recipes.py | create_recipes.py | import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("package_list", help="List of packages for which" +
" recipies will be created")
args = parser.parse_args()
package_names = [package.strip() for package in
open(args.package_list, 'r').readlin... | import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("package_list", help="List of packages for which" +
" recipies will be created")
args = parser.parse_args()
package_names = [package.strip() for package in
open(args.package_list, 'r').readlin... | Python | 0.000023 |
21000dfd4bf63ceae0e8c6ac343624fbf5c5bea2 | read tags before people | cat/test_cat.py | cat/test_cat.py | from cat.code import GenerateSite
import unittest
import json
import os
import sys
def read_json(file):
with open(file) as fh:
return json.loads(fh.read())
#return fh.read()
class TestDemo(unittest.TestCase):
def test_generate(self):
GenerateSite().generate_site()
assert True
... | from cat.code import GenerateSite
import unittest
import json
import os
import sys
def read_json(file):
with open(file) as fh:
return json.loads(fh.read())
#return fh.read()
class TestDemo(unittest.TestCase):
def test_generate(self):
GenerateSite().generate_site()
assert True
... | Python | 0 |
b220af1b5219c59735bd1f35493b0a659c627738 | Fix cookie handling for tornado | social/strategies/tornado_strategy.py | social/strategies/tornado_strategy.py | import json
from tornado.template import Loader, Template
from social.utils import build_absolute_uri
from social.strategies.base import BaseStrategy, BaseTemplateStrategy
class TornadoTemplateStrategy(BaseTemplateStrategy):
def render_template(self, tpl, context):
path, tpl = tpl.rsplit('/', 1)
... | import json
from tornado.template import Loader, Template
from social.utils import build_absolute_uri
from social.strategies.base import BaseStrategy, BaseTemplateStrategy
class TornadoTemplateStrategy(BaseTemplateStrategy):
def render_template(self, tpl, context):
path, tpl = tpl.rsplit('/', 1)
... | Python | 0.000001 |
c5db8af5faca762e574a5b3b6117a0253e59cd05 | use new urls module | couchexport/urls.py | couchexport/urls.py | from django.conf.urls import *
urlpatterns = patterns('',
url(r'^model/$', 'couchexport.views.export_data', name='model_download_excel'),
url(r'^async/$', 'couchexport.views.export_data_async', name='export_data_async'),
url(r'^saved/(?P<export_id>[\w-]+)/$', 'couchexport.views.download_saved_export',
... | from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^model/$', 'couchexport.views.export_data', name='model_download_excel'),
url(r'^async/$', 'couchexport.views.export_data_async', name='export_data_async'),
url(r'^saved/(?P<export_id>[\w-]+)/$', 'couchexport.views.download_saved_expo... | Python | 0.000001 |
b68da6c5b64009dbd2d53206be4c8d98ed1b0a45 | Add print option to exercise_oaipmh.py | librisxl-tools/scripts/exercise_oaipmh.py | librisxl-tools/scripts/exercise_oaipmh.py | import requests
from lxml import etree
from StringIO import StringIO
import time
PMH = "{http://www.openarchives.org/OAI/2.0/}"
def parse_oaipmh(start_url, name, passwd, do_print=False):
start_time = time.time()
resumption_token = None
record_count = 0
while True:
url = make_next_url(start_ur... | import requests
from lxml import etree
import time
PMH = "{http://www.openarchives.org/OAI/2.0/}"
def parse_oaipmh(start_url, name, passwd):
start_time = time.time()
resumption_token = None
record_count = 0
while True:
url = make_next_url(start_url, resumption_token)
res = requests.ge... | Python | 0.000005 |
a8104d2765ef97b698f108192dfc0b334498151a | Add ability to look up other rietveld instances | my_reviews.py | my_reviews.py | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Get rietveld stats.
Example:
- my_reviews.py -o me@chromium.org -Q for stats for last quarter.
"""
import datetime
import op... | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Get rietveld stats.
Example:
- my_reviews.py -o me@chromium.org -Q for stats for last quarter.
"""
import datetime
import op... | Python | 0.000001 |
f4408cb2feb5a28a5117fefebe782a61ea80de96 | fix res_company | hr_employee_time_clock/models/__init__.py | hr_employee_time_clock/models/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2016 - now Bytebrand Outsourcing AG (<http://www.bytebrand.net>).
#
# This program is free software: you can redistribute it and/or modify
# it... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2016 - now Bytebrand Outsourcing AG (<http://www.bytebrand.net>).
#
# This program is free software: you can redistribute it and/or modify
# it... | Python | 0.000001 |
f71a4ca03b8c7c63816bab57a71f9d28a7139e2d | Add justification for utility method as comment. | contrib/vcloud/vcloud_util.py | contrib/vcloud/vcloud_util.py | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import collections
import os
import sys
import benchexec.util
sys.dont_write_bytecode = ... | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import collections
import os
import sys
import benchexec.util
sys.dont_write_bytecode = ... | Python | 0 |
96158b6b5a153db6b9a5e5d40699efefc728a9b3 | Make our LiveWidget handle a 'topics' property along with 'topic' | moksha/api/widgets/live/live.py | moksha/api/widgets/live/live.py | # This file is part of Moksha.
# Copyright (C) 2008-2009 Red Hat, Inc.
#
# 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 ... | # This file is part of Moksha.
# Copyright (C) 2008-2009 Red Hat, Inc.
#
# 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 ... | Python | 0 |
410f02a4f657f9a8b9c839f3e08b176f443de9e8 | Handle cases when searched word is only part of the people name. | linkedin_scraper/spiders/people_search.py | linkedin_scraper/spiders/people_search.py | from os import environ
from scrapy_splash import SplashRequest
from scrapy.spiders.init import InitSpider
from scrapy.http import Request, FormRequest
class PeopleSearchSpider(InitSpider):
name = 'people_search'
allowed_domains = ['linkedin.com']
login_page = 'https://www.linkedin.com/uas/login'
def... | from os import environ
from scrapy_splash import SplashRequest
from scrapy.spiders.init import InitSpider
from scrapy.http import Request, FormRequest
class PeopleSearchSpider(InitSpider):
name = 'people_search'
allowed_domains = ['linkedin.com']
login_page = 'https://www.linkedin.com/uas/login'
def... | Python | 0.000001 |
0e0a0de8f6be116ba00a6938586dcbc315c4db3f | Clarify that symbolic representations are Tensors | cleverhans/model.py | cleverhans/model.py | from abc import ABCMeta
class Model(object):
"""
An abstract interface for model wrappers that exposes model symbols
needed for making an attack. This abstraction removes the dependency on
any specific neural network package (e.g. Keras) from the core
code of CleverHans. It can also simplify expo... | from abc import ABCMeta
class Model(object):
"""
An abstract interface for model wrappers that exposes model symbols
needed for making an attack. This abstraction removes the dependency on
any specific neural network package (e.g. Keras) from the core
code of CleverHans. It can also simplify expo... | Python | 0.999999 |
655fcce56abd0d3f0da9b52e911636d931157443 | bump version | dockercloud/__init__.py | dockercloud/__init__.py | import base64
import logging
import os
import requests
from future.standard_library import install_aliases
install_aliases()
from dockercloud.api import auth
from dockercloud.api.service import Service
from dockercloud.api.container import Container
from dockercloud.api.repository import Repository
from dockercloud.... | import base64
import logging
import os
import requests
from future.standard_library import install_aliases
install_aliases()
from dockercloud.api import auth
from dockercloud.api.service import Service
from dockercloud.api.container import Container
from dockercloud.api.repository import Repository
from dockercloud.... | Python | 0 |
6589c5cc30c228e5aacd77184310e9afd9dc0345 | Fix test | tests/test_contributors_views.py | tests/test_contributors_views.py | # -*- coding: utf-8 -*-
from nose.tools import * # noqa; PEP8 asserts
from tests.factories import ProjectFactory, NodeFactory, AuthUserFactory
from tests.base import OsfTestCase, fake
from framework.auth.decorators import Auth
from website.profile import utils
class TestContributorUtils(OsfTestCase):
def se... | # -*- coding: utf-8 -*-
from nose.tools import * # noqa; PEP8 asserts
from tests.factories import ProjectFactory, NodeFactory, AuthUserFactory
from tests.base import OsfTestCase, fake
from framework.auth.decorators import Auth
from website.profile import utils
class TestContributorUtils(OsfTestCase):
def se... | Python | 0.000004 |
b0c5d485543e123c985336d054b6f20d60634221 | Add new kumquat settings.py file from the origin. We need to find a other solution in the future to overwrite config files | copy/tmp/kumquat-settings.py | copy/tmp/kumquat-settings.py | """
Django settings for kumquat_web project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...... | """
Django settings for kumquat_web project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...... | Python | 0 |
b41e563c866a8918a65253c1cbb1a1fa5c44c212 | Placate angry bot | xunit-autolabeler-v2/ast_parser/python/test_data/new_tests/fixture_detection_test.py | xunit-autolabeler-v2/ast_parser/python/test_data/new_tests/fixture_detection_test.py | # Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python | 0.999805 |
4617750140daf87e6e686bce19497a0e4e8bea75 | remove out of context request checking | tests/test_ember_osf_web.py | tests/test_ember_osf_web.py |
import mock
from flask import request
from tests.base import OsfTestCase
from website.ember_osf_web.decorators import ember_flag_is_active
from osf_tests.factories import FlagFactory, UserFactory
from django.contrib.auth.models import Group
class TestEmberFlagIsActive(OsfTestCase):
def setUp(self):
su... |
import mock
from flask import request
from tests.base import OsfTestCase
from website.ember_osf_web.decorators import ember_flag_is_active
from osf_tests.factories import FlagFactory, UserFactory
from django.contrib.auth.models import Group
class TestEmberFlagIsActive(OsfTestCase):
def setUp(self):
su... | Python | 0.000001 |
dae16f72b9ca5d96c7f894601aa3a69facbbb00e | Fix memory limit in MongoDB while loading logs (#5) | scripts/load_logs_to_mongodb.py | scripts/load_logs_to_mongodb.py | import os
import sys
from datetime import datetime
from collections import defaultdict
from pymongo import MongoClient
logs_file = open(sys.argv[1])
article_urls = set()
article_views = defaultdict(list) # article_url: list of user's id's
article_times = {}
for line in logs_file:
try:
timestamp, url, user... | import os
import sys
from datetime import datetime
from collections import defaultdict
from pymongo import MongoClient
logs_file = open(sys.argv[1])
article_urls = set()
article_views = defaultdict(list) # article_url: list of user's id's
article_times = {}
for line in logs_file:
try:
timestamp, url, user... | Python | 0 |
3375c9cd3311bff8ff3ab07c361e18c68226784c | remove stray print | mc2/controllers/base/managers/rabbitmq.py | mc2/controllers/base/managers/rabbitmq.py | import base64
import hashlib
import random
import time
import uuid
from django.conf import settings
from pyrabbit.api import Client
from pyrabbit.http import HTTPError
class ControllerRabbitMQManager(object):
def __init__(self, controller):
"""
A helper manager to get to connect to RabbitMQ
... | import base64
import hashlib
import random
import time
import uuid
from django.conf import settings
from pyrabbit.api import Client
from pyrabbit.http import HTTPError
class ControllerRabbitMQManager(object):
def __init__(self, controller):
"""
A helper manager to get to connect to RabbitMQ
... | Python | 0.000215 |
2cee1d5bff32831a9c15755e7482057ac7b9a39a | Update packets.py | cs143sim/packets.py | cs143sim/packets.py | """This module contains all packet definitions.
.. autosummary::
Packet
DataPacket
RouterPacket
.. moduleauthor:: Lan Hongjian <lanhongjianlr@gmail.com>
.. moduleauthor:: Yamei Ou <oym111@gmail.com>
.. moduleauthor:: Samuel Richerd <dondiego152@gmail.com>
.. moduleauthor:: Jan Van Bruggen <jancvanbruggen... | """This module contains all packet definitions.
.. autosummary::
Packet
DataPacket
RouterPacket
.. moduleauthor:: Lan Hongjian <lanhongjianlr@gmail.com>
.. moduleauthor:: Yamei Ou <oym111@gmail.com>
.. moduleauthor:: Samuel Richerd <dondiego152@gmail.com>
.. moduleauthor:: Jan Van Bruggen <jancvanbruggen... | Python | 0.000001 |
0c35c0f7fe126b87eccdf4f69933b84927956658 | Fix account __type__ | module/plugins/accounts/XFileSharingPro.py | module/plugins/accounts/XFileSharingPro.py | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.XFSPAccount import XFSPAccount
class XFileSharingPro(XFSPAccount):
__name__ = "XFileSharingPro"
__type__ = "account"
__version__ = "0.02"
__description__ = """XFileSharingPro multi-purpose account plugin"""
__license__ = "GPLv3"
... | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.XFSPAccount import XFSPAccount
class XFileSharingPro(XFSPAccount):
__name__ = "XFileSharingPro"
__type__ = "crypter"
__version__ = "0.01"
__description__ = """XFileSharingPro dummy account plugin for hook"""
__license__ = "GPLv3"
... | Python | 0 |
a396d3e7b4de10710c2f2e0beab0ef82acaf866b | Create first test | web/impact/impact/tests/test_track_api_calls.py | web/impact/impact/tests/test_track_api_calls.py | from django.test import (
TestCase,
)
from mock import mock, patch
from impact.tests.api_test_case import APITestCase
class TestTrackAPICalls(APITestCase):
@patch('impact.middleware.track_api_calls.TrackAPICalls.process_request.logger')
def test_when_user_authenticated(self, logger_info_patch):
... | from django.test import (
RequestFactory,
TestCase,
)
from mock import patch
class TestTrackAPICalls(TestCase):
def test_when_user_auth(self):
pass
def test_when_no_user_auth(self):
pass
| Python | 0 |
1fc456f00d9895358ee52e967edfdfc2512315d0 | Update stackexchange.py | data_loaders/stackexchange.py | data_loaders/stackexchange.py | #
# stackexchange.py
# Mich, 2015-03-12
# Copyright (c) 2015 Datacratic Inc. All rights reserved.
#
import requests
import json
from datetime import datetime
def load_data(mldb, payload):
mldb.log("StackExchange data loader")
payload = json.loads(payload)
assert payload['site'], mldb.log("payload: site i... | #
# stackexchange.py
# Mich, 2015-03-12
# Copyright (c) 2015 Datacratic Inc. All rights reserved.
#
import requests
import json
from datetime import datetime
def load_data(mldb, payload):
mldb.log("StackExchange data loader")
payload = json.loads(payload)
assert payload['site'], mldb.log("payload: site i... | Python | 0.000001 |
9e577694d2f8665599d590299e58355dd7472011 | Fix less | cupy/logic/comparison.py | cupy/logic/comparison.py | from cupy.logic import ufunc
def allclose(a, b, rtol=1e-05, atol=1e-08):
# TODO(beam2d): Implement it
raise NotImplementedError
def isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False, allocator=None):
# TODO(beam2d): Implement it
raise NotImplementedError
def array_equal(a1, a2):
# TODO(bea... | from cupy.logic import ufunc
def allclose(a, b, rtol=1e-05, atol=1e-08):
# TODO(beam2d): Implement it
raise NotImplementedError
def isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False, allocator=None):
# TODO(beam2d): Implement it
raise NotImplementedError
def array_equal(a1, a2):
# TODO(bea... | Python | 0.000092 |
244f3262989b0331a120eb546ca22c9bea9194e4 | add DownloadDelta to the admin | crate_project/apps/packages/admin.py | crate_project/apps/packages/admin.py | from django.contrib import admin
from packages.models import Package, Release, ReleaseFile, TroveClassifier, PackageURI
from packages.models import ReleaseRequire, ReleaseProvide, ReleaseObsolete, ReleaseURI, ChangeLog
from packages.models import DownloadDelta, ReadTheDocsPackageSlug
class PackageURIAdmin(admin.Tabu... | from django.contrib import admin
from packages.models import Package, Release, ReleaseFile, TroveClassifier, PackageURI
from packages.models import ReleaseRequire, ReleaseProvide, ReleaseObsolete, ReleaseURI, ChangeLog
from packages.models import ReadTheDocsPackageSlug
class PackageURIAdmin(admin.TabularInline):
... | Python | 0 |
4c703480fe395ddef5faa6d388a472b7053f26af | Add debug command line option. | jskom/__main__.py | jskom/__main__.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import asyncio
import logging
from hypercorn.asyncio import serve
from hypercorn.config import Config
from jskom import app, init_app
log = logging.getLogger("jskom.main")
def run(host, port):
# use 127.0.0.1 instead of localhost to avoid delays re... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import asyncio
import logging
from hypercorn.asyncio import serve
from hypercorn.config import Config
from jskom import app, init_app
log = logging.getLogger("jskom.main")
def run(host, port):
# use 127.0.0.1 instead of localhost to avoid delays re... | Python | 0 |
cdcc807ecd7126f533bbc01721276d62a4a72732 | fix all_docs dbs to work after flip | corehq/couchapps/__init__.py | corehq/couchapps/__init__.py | from corehq.preindex import CouchAppsPreindexPlugin
from django.conf import settings
CouchAppsPreindexPlugin.register('couchapps', __file__, {
'form_question_schema': 'meta',
'users_extra': (settings.USERS_GROUPS_DB, settings.NEW_USERS_GROUPS_DB),
'noneulized_users': (settings.USERS_GROUPS_DB, settings.NEW... | from corehq.preindex import CouchAppsPreindexPlugin
from django.conf import settings
CouchAppsPreindexPlugin.register('couchapps', __file__, {
'form_question_schema': 'meta',
'users_extra': (settings.USERS_GROUPS_DB, settings.NEW_USERS_GROUPS_DB),
'noneulized_users': (settings.USERS_GROUPS_DB, settings.NEW... | Python | 0 |
39f26d6bb46eeb96c54881ab9c0147051328b8e8 | fix another misuse of the 1.0 DB API. | trac/tests/env.py | trac/tests/env.py | from __future__ import with_statement
from trac import db_default
from trac.core import ComponentManager
from trac.env import Environment
import os.path
import unittest
import tempfile
import shutil
class EnvironmentCreatedWithoutData(Environment):
def __init__(self, path, create=False, options=[]):
Comp... | from __future__ import with_statement
from trac import db_default
from trac.core import ComponentManager
from trac.env import Environment
import os.path
import unittest
import tempfile
import shutil
class EnvironmentCreatedWithoutData(Environment):
def __init__(self, path, create=False, options=[]):
Comp... | Python | 0.000005 |
a27e667dedeaaa0aefadc3328149f311bb277c45 | Update bottlespin.py | bottlespin/bottlespin.py | bottlespin/bottlespin.py | import discord
from discord.ext import commands
from random import choice
class Bottlespin:
"""Spins a bottle and lands on a random user."""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True, no_pm=True, alias=["bottlespin"])
async def spin(self, ctx, role):
... | import discord
from discord.ext import commands
from random import choice
class Bottlespin:
"""Spins a bottle and lands on a random user."""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True, no_pm=True, alias=["bottlespin"])
async def spin(self, ctx, role):
... | Python | 0 |
7a25ace4851da30a252842b5d5e3a7efee90ce00 | Raise error when /boundaries/set-slug URL points to a nonexistent set | boundaryservice/views.py | boundaryservice/views.py | from django.contrib.gis.db import models
from django.http import Http404
from boundaryservice.base_views import (ModelListView, ModelDetailView,
ModelGeoListView, ModelGeoDetailView)
from boundaryservice.models import BoundarySet, Boundary
class BoundarySetListView(ModelListVie... | from django.contrib.gis.db import models
from django.http import Http404
from boundaryservice.base_views import (ModelListView, ModelDetailView,
ModelGeoListView, ModelGeoDetailView)
from boundaryservice.models import BoundarySet, Boundary
class BoundarySetListView(ModelListVie... | Python | 0 |
c63463ff040f79c605d6c0414261527dda3ed00a | Switch to new babel version in require test. | tests/test_jsinterpreter.py | tests/test_jsinterpreter.py | import unittest
from dukpy._dukpy import JSRuntimeError
import dukpy
from diffreport import report_diff
class TestJSInterpreter(unittest.TestCase):
def test_interpreter_keeps_context(self):
interpreter = dukpy.JSInterpreter()
ans = interpreter.evaljs("var o = {'value': 5}; o")
assert ans... | import unittest
from dukpy._dukpy import JSRuntimeError
import dukpy
from diffreport import report_diff
class TestJSInterpreter(unittest.TestCase):
def test_interpreter_keeps_context(self):
interpreter = dukpy.JSInterpreter()
ans = interpreter.evaljs("var o = {'value': 5}; o")
assert ans... | Python | 0 |
3681ada3917d5811e1e959270e1df0edea7ebf55 | Update __init__.py | mapclientplugins/smoothfitstep/__init__.py | mapclientplugins/smoothfitstep/__init__.py |
'''
MAP Client Plugin
'''
__version__ = '0.1.0'
__author__ = 'Richard Christie'
__stepname__ = 'smoothfit'
__location__ = ''
# import class that derives itself from the step mountpoint.
from mapclientplugins.smoothfitstep import step
# Import the resource file when the module is loaded,
# this enables... |
'''
MAP Client Plugin
'''
__version__ = '0.1.0'
__author__ = 'Richard Christie'
__stepname__ = 'smoothfit'
__location__ = ''
# import class that derives itself from the step mountpoint.
from mapclientplugins.smoothfitstep import step
# Import the resource file when the module is loaded,
# this enables... | Python | 0.000072 |
379d2df1041605d3c8a21d543f9955601ee07558 | Add threading to syncer | imageledger/management/commands/syncer.py | imageledger/management/commands/syncer.py | from collections import namedtuple
import itertools
import logging
from multiprocessing.dummy import Pool as ThreadPool
from elasticsearch import helpers
from django.core.management.base import BaseCommand, CommandError
from django.db import connection, transaction
from imageledger import models, search
console = l... | from collections import namedtuple
import itertools
import logging
from elasticsearch import helpers
from django.core.management.base import BaseCommand, CommandError
from django.db import connection, transaction
from imageledger import models, search
console = logging.StreamHandler()
log = logging.getLogger(__name_... | Python | 0.000001 |
33b7e9371305c4171594c21c154cd5724ea013cb | allow segment and overlap be specified as a parameter | scripts/nanopolish_makerange.py | scripts/nanopolish_makerange.py | import sys
import argparse
from Bio import SeqIO
parser = argparse.ArgumentParser(description='Partition a genome into a set of overlapping segments')
parser.add_argument('--segment-length', type=int, default=50000)
parser.add_argument('--overlap-length', type=int, default=200)
args, extra = parser.parse_known_args()
... | import sys
from Bio import SeqIO
recs = [ (rec.name, len(rec.seq)) for rec in SeqIO.parse(open(sys.argv[1]), "fasta")]
SEGMENT_LENGTH = 50000
OVERLAP_LENGTH = 200
for name, length in recs:
n_segments = (length / SEGMENT_LENGTH) + 1
for n in xrange(0, length, SEGMENT_LENGTH):
if ( n + SEGMENT_LENGTH)... | Python | 0 |
105a413b18456f9a505dd1ed4bf515987b4792d2 | add --force option to management command to force all files to be pushed | mediasync/management/commands/syncmedia.py | mediasync/management/commands/syncmedia.py | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import mediasync
class Command(BaseCommand):
help = "Sync local media with S3"
args = '[options]'
requires_model_validation = False
option_list = BaseCommand.option_list + (
make_op... | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import mediasync
class Command(BaseCommand):
help = "Sync local media with S3"
args = '[options]'
requires_model_validation = False
option_list = BaseCommand.option_list + (
make_op... | Python | 0 |
0be6bddf8c92c461af57e7c61c2378c817fb0143 | Make oppetarkiv work with --all-episodes again | lib/svtplay_dl/service/oppetarkiv.py | lib/svtplay_dl/service/oppetarkiv.py | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
import re
from svtplay_dl.service.svtplay import Svtplay
from svtplay_dl.log import log
class OppetArkiv(Svtplay):
supported_domains = ['oppetarkiv.se']
def find_all_episodes(self, ... | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
import re
from svtplay_dl.service.svtplay import Svtplay
from svtplay_dl.log import log
class OppetArkiv(Svtplay):
supported_domains = ['oppetarkiv.se']
def find_all_episodes(self, ... | Python | 0 |
a52b4097dfcb9fea26af0bc994426baecb97efc1 | update image if streetview url | croplands_api/views/api/locations.py | croplands_api/views/api/locations.py | from croplands_api import api
from croplands_api.models import Location
from processors import api_roles, add_user_to_posted_data, remove_relations, debug_post
from records import save_record_state_to_history
from croplands_api.utils.s3 import upload_image
import requests
import uuid
import cStringIO
def process_recor... | from croplands_api import api
from croplands_api.models import Location
from processors import api_roles, add_user_to_posted_data, remove_relations, debug_post
from records import save_record_state_to_history
from croplands_api.tasks.records import get_ndvi
def process_records(result=None, **kwargs):
"""
This... | Python | 0.000005 |
1d305388fd1c673096e327ea2c0259b955d64156 | Update test_step_7.py | pySDC/tests/test_tutorials/test_step_7.py | pySDC/tests/test_tutorials/test_step_7.py | import os
import subprocess
import pytest
from pySDC.tutorial.step_7.B_pySDC_with_mpi4pyfft import main as main_B
@pytest.mark.fenics
def test_A():
from pySDC.tutorial.step_7.A_pySDC_with_FEniCS import main as main_A
main_A()
@pytest.mark.parallel
def test_B():
main_B()
@pytest.mark.parallel
def tes... | import os
import subprocess
import pytest
from pySDC.tutorial.step_7.B_pySDC_with_mpi4pyfft import main as main_B
@pytest.mark.fenics
def test_A():
from pySDC.tutorial.step_7.A_pySDC_with_FEniCS import main as main_A
main_A()
@pytest.mark.parallel
def test_B():
main_B()
@pytest.mark.parallel
def test_... | Python | 0.000014 |
928d498b5f67970f9ec75d62068e8cbec0fdc352 | Update python3, flake8 | ni_scanner.py | ni_scanner.py | from ConfigParser import SafeConfigParser
from utils.cli import CLI
from api.queue import Queue
from api.nerds import NerdsApi
from scanner.host import HostScanner
from scanner.exceptions import ScannerExeption
from utils.url import url_concat
import logging
FORMAT = '%(name)s - %(levelname)s - %(message)s'
logging.ba... | from ConfigParser import SafeConfigParser
from utils.cli import CLI
from api.queue import Queue
from api.nerds import NerdsApi
from scanner.host import HostScanner
from scanner.exceptions import ScannerExeption
from utils.url import url_concat
import logging
FORMAT = '%(name)s - %(levelname)s - %(message)s'
logging.ba... | Python | 0.000004 |
496007543f941bb3ca46c011383f2673b9362e47 | Bump development version | debreach/__init__.py | debreach/__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from distutils import version
__version__ = '1.4.1'
version_info = version.StrictVersion(__version__).version
default_app_config = 'debreach.apps.DebreachConfig'
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from distutils import version
__version__ = '1.4.0'
version_info = version.StrictVersion(__version__).version
default_app_config = 'debreach.apps.DebreachConfig'
| Python | 0 |
31d6ce09382035458eca2a310f99cb3c958ea604 | Use main template environment for rendering document content | nib/render.py | nib/render.py | import jinja2
from jinja2 import Environment, FileSystemLoader, Template
from os import path
import time
jinja_filters = {}
def jinja(name):
def decorator(f):
jinja_filters[name] = f
return f
return decorator
class Render(object):
def __init__(self, options, documents):
self.optio... | import jinja2
from jinja2 import Environment, FileSystemLoader, Template
from os import path
import time
jinja_filters = {}
def jinja(name):
def decorator(f):
jinja_filters[name] = f
return f
return decorator
class Render(object):
def __init__(self, options, documents):
self.optio... | Python | 0 |
76ad51d4161bca9435358a07cc9a726dc0ce8a8b | Add document boosts to search indexes (reorder by boost) | csunplugged/topics/search_indexes.py | csunplugged/topics/search_indexes.py | """Search index for topics models.
Note: Document boosting for Whoosh backend is with keyword '_boost' instead
of 'boost'.
"""
from haystack import indexes
from topics.models import (
Topic,
UnitPlan,
Lesson,
ProgrammingChallenge,
CurriculumIntegration,
CurriculumArea,
)
class TopicInd... | """Search index for topics models."""
from haystack import indexes
from topics.models import (
Topic,
UnitPlan,
Lesson,
ProgrammingChallenge,
CurriculumIntegration,
CurriculumArea,
)
class TopicIndex(indexes.SearchIndex, indexes.Indexable):
"""Search index for Topic model."""
text = ... | Python | 0 |
8a03a3fbcfdb22dc21e5539462a2b235e744abba | change open/close to with | output.py | output.py | def summarizeECG(instHR, avgHR, brady, tachy):
"""Create txt file summarizing ECG analysis
:param instHR: (int)
:param avgHR: (int)
:param brady: (int)
:param tachy: (int)
"""
#Calls hrdetector() to get instantaneous heart rate
#instHR = findInstHR()
#Calls findAvgHR() to get avera... | def summarizeECG(instHR, avgHR, brady, tachy):
"""Create txt file summarizing ECG analysis
:param instHR: (int)
:param avgHR: (int)
:param brady: (int)
:param tachy: (int)
"""
#Calls hrdetector() to get instantaneous heart rate
#instHR = findInstHR()
#Calls findAvgHR() to get avera... | Python | 0 |
b0a1f10d60abc6c9fc7751e3bae492976d3f3306 | Update version 1.0.0.dev3 -> 1.0.0.dev4 | dimod/package_info.py | dimod/package_info.py | __version__ = '1.0.0.dev4'
__author__ = 'D-Wave Systems Inc.'
__authoremail__ = 'acondello@dwavesys.com'
__description__ = 'A shared API for binary quadratic model samplers.'
| __version__ = '1.0.0.dev3'
__author__ = 'D-Wave Systems Inc.'
__authoremail__ = 'acondello@dwavesys.com'
__description__ = 'A shared API for binary quadratic model samplers.'
| Python | 0.000001 |
eccc07a4639e1da98c09689295964e0f15c8068c | Add fix author functionality | dasem/runeberg.py | dasem/runeberg.py | """runeberg.
Usage:
dasem.runeberg download-catalogue
dasem.runeberg catalogue-as-csv
Description
-----------
Runeberg is a digital library with primarily Nordic texts. It is available from
http://runeberg.org/
"""
from __future__ import absolute_import, division, print_function
from os.path import join
from... | """runeberg.
Usage:
dasem.runeberg download-catalogue
dasem.runeberg catalogue-as-csv
Description
-----------
Runeberg is a digital library with primarily Nordic texts. It is available from
http://runeberg.org/
"""
from __future__ import absolute_import, division, print_function
from os.path import join
from... | Python | 0.000001 |
034fa60d73468df21b6f75eb7a8130ab9a40cbae | Fix #3225 | module/plugins/hoster/FilerNet.py | module/plugins/hoster/FilerNet.py | # -*- coding: utf-8 -*-
import os
import re
from ..captcha.ReCaptcha import ReCaptcha
from ..internal.SimpleHoster import SimpleHoster
class FilerNet(SimpleHoster):
__name__ = "FilerNet"
__type__ = "hoster"
__version__ = "0.28"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?filer\.ne... | # -*- coding: utf-8 -*-
import os
import re
from ..captcha.ReCaptcha import ReCaptcha
from ..internal.SimpleHoster import SimpleHoster
class FilerNet(SimpleHoster):
__name__ = "FilerNet"
__type__ = "hoster"
__version__ = "0.27"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?filer\.ne... | Python | 0 |
518443854f7ef4466885d88cf7b379c626692da1 | Add PlannedBudgetLimits to Budgets::Budget BudgetData | troposphere/budgets.py | troposphere/budgets.py | # Copyright (c) 2012-2019, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 8.0.0
from . import AWSObject
from . import AWSProperty
from .validators import boolean
from .validators import do... | # Copyright (c) 2012-2018, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import boolean
class Spend(AWSProperty):
props = {
'Amount': (float, True),
'Unit': (basestring, True),
}
class CostTypes(... | Python | 0.000006 |
f612fafa3e4d7352b64d993390fb074686fe46b7 | Update slack post format | chainer/ya/utils/slack.py | chainer/ya/utils/slack.py | import json
import os
import requests
from chainer.training import extension
class SlackPost(extension.Extension):
def __init__(self, token, channel, **kwargs):
self.token = token
self.channel = channel
self.priority = 50
def initialize(self, trainer):
try:
plot_r... | import os
import requests
import json
from chainer.training import extension
class SlackPost(extension.Extension):
def __init__(self, token, channel, **kwargs):
self.token = token
self.channel = channel
self.priority = 50
def initialize(self, trainer):
try:
plot_r... | Python | 0 |
48412195e020c7f2a549deb869d98f6a366d9552 | improve workflow conversion | cwlupgrader/main.py | cwlupgrader/main.py | #!/usr/bin/env python
from __future__ import print_function
import ruamel.yaml
from typing import Any, Dict, Union
from collections import Mapping, MutableMapping, Sequence
import sys
import copy
def main(): # type: () -> int
for path in sys.argv[1:]:
with open(path) as entry:
document = ruam... | #!/usr/bin/env python
from __future__ import print_function
import ruamel.yaml
from typing import Any, Dict, Union
from collections import Mapping, MutableMapping, Sequence
import sys
import copy
def main(): # type: () -> int
for path in sys.argv[1:]:
with open(path) as entry:
document = ruam... | Python | 0.000002 |
ba84f4a1b11f486d211254721397be43f8c9b07a | update __manifest__.py | tko_coexiste_coa/__manifest__.py | tko_coexiste_coa/__manifest__.py | # -*- coding: utf-8 -*-
# © 2017 TKO <http://tko.tko-br.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Plano de Contas Brasileiro',
'summary': '',
'description': 'Plano de contas brasileiro adaptável a qualquer segmento.',
'author': 'TKO',
'category': 'l10n_br',
... | # -*- coding: utf-8 -*-
# © 2017 TKO <http://tko.tko-br.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Plano de Contas Brasileiro',
'summary': '',
'description': 'Plano de contas brasileiro adaptável a qualquer segmento.',
'author': 'TKO',
'category': 'l10n_br',
... | Python | 0.000059 |
febb2e9369a706d7319d89851cac3dc9a1fd167e | add source of kyoko image | tsundiary/jinja_env.py | tsundiary/jinja_env.py | from tsundiary import app
app.jinja_env.globals.update(theme_nicename = {
'classic': 'Classic Orange',
'minimal': 'Minimal Black/Grey',
'misato-tachibana': 'Misato Tachibana',
'rei-ayanami': 'Rei Ayanami',
'saya': 'Saya',
'yuno': 'Yuno Gasai',
'kyoko-sakura': 'Kyoko Sakura',
'colorful':... | from tsundiary import app
app.jinja_env.globals.update(theme_nicename = {
'classic': 'Classic Orange',
'minimal': 'Minimal Black/Grey',
'misato-tachibana': 'Misato Tachibana',
'rei-ayanami': 'Rei Ayanami',
'saya': 'Saya',
'yuno': 'Yuno Gasai',
'kyoko-sakura': 'Kyoko Sakura',
'colorful':... | Python | 0 |
fb9e2ec66f2c80b60ae565665f091b0ee47843a9 | Remove six lib from install script | docs/scripts/install.py | docs/scripts/install.py | #!/usr/bin/env python
'''
File name: install
Author: Tim Anema
Date created: Sep 29, 2016
Date last modified: Sep 14 2018
Python Version: 2.7
Description: Install script for themekit. It will download a release and make it executable
'''
import os, json, sys, hashlib
class Installer(object):
... | #!/usr/bin/env python
'''
File name: install.py
Author: Tim Anema
Date created: Sep 29, 2016
Date last modified: Nov 19 2020
Python Version: 2.x, 3.x
Description: Install script for themekit. It will download a release and make it executable
'''
import os, json, sys, hashlib
from six.moves.urll... | Python | 0 |
3cf93f7f640ef04a1be31d515c19cffec19cec45 | Remove logging import unused | searchlightclient/osc/plugin.py | searchlightclient/osc/plugin.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
# distrib... | # 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
# distrib... | Python | 0.000001 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.