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
43b992c09b092391e95b5a1893b6c19855482ff7
fix autoconf header
dist/tools/kconfiglib/riot_kconfig.py
dist/tools/kconfiglib/riot_kconfig.py
""" RIOT customization of Kconfig """ import argparse import sys from kconfiglib import Kconfig, KconfigError class RiotKconfig(Kconfig): """ RIOT adaption of Kconfig class """ def _parse_help(self, node): """ Parses the help section of a node, removing Doxygen markers """ doxygen_markers = [...
""" RIOT customization of Kconfig """ import argparse import sys from kconfiglib import Kconfig, KconfigError class RiotKconfig(Kconfig): """ RIOT adaption of Kconfig class """ def _parse_help(self, node): """ Parses the help section of a node, removing Doxygen markers """ doxygen_markers = [...
Python
0
6d7c21979a741e60053faf6d4e444ad4bf01dcde
Fix unittests
backward/backends/session.py
backward/backends/session.py
try: import cPickle as pickle except ImportError: import pickle from .base import Backend from backward import settings class SessionBackend(Backend): def get_url_redirect(self, request): return request.session.get(settings.URL_REDIRECT_NAME, None) def save_url_redirect(self, request, respo...
try: import cPickle as pickle except ImportError: import pickle from .base import Backend from backward import settings class SessionBackend(Backend): def get_url_redirect(self, request): return request.session.get(settings.URL_REDIRECT_NAME, None) def save_url_redirect(self, request, respo...
Python
0.000005
81cfcd62dacebac895fd819ccf0640597cc2822f
define a one-to-many relation from PostState to Post. post.state will be a lazy backref.
models/blog.py
models/blog.py
from datetime import datetime from flask_misaka import markdown from extensions import db posts_to_tags = db.Table('posts_to_tags', db.Column('tag_id', db.Integer, db.ForeignKey('tag.id')), db.Column('post_id', db.Integer, db.ForeignKey('post.id'))) class Post(db....
from datetime import datetime from flask_misaka import markdown from extensions import db posts_to_tags = db.Table('posts_to_tags', db.Column('tag_id', db.Integer, db.ForeignKey('tag.id')), db.Column('post_id', db.Integer, db.ForeignKey('post.id'))) class Post(db....
Python
0.00001
5c87c2bba8a95db865c11545df6d0405abd8fbfd
Update demo for prediction. (#6789)
demo/guide-python/predict_first_ntree.py
demo/guide-python/predict_first_ntree.py
import os import numpy as np import xgboost as xgb from sklearn.datasets import load_svmlight_file CURRENT_DIR = os.path.dirname(__file__) train = os.path.join(CURRENT_DIR, "../data/agaricus.txt.train") test = os.path.join(CURRENT_DIR, "../data/agaricus.txt.test") def native_interface(): # load data in do traini...
import os import numpy as np import xgboost as xgb # load data in do training CURRENT_DIR = os.path.dirname(__file__) dtrain = xgb.DMatrix(os.path.join(CURRENT_DIR, '../data/agaricus.txt.train')) dtest = xgb.DMatrix(os.path.join(CURRENT_DIR, '../data/agaricus.txt.test')) param = {'max_depth': 2, 'eta': 1, 'objective':...
Python
0
fdbaaa6c1f20a48d0891106455c91d600c8236f7
Change client.skia.fyi ports
masters/master.client.skia.fyi/master_site_config.py
masters/master.client.skia.fyi/master_site_config.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ActiveMaster definition.""" from config_bootstrap import Master class SkiaFYI(Master.Master3): project_name = 'SkiaFYI' master_port = 8098 slave...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ActiveMaster definition.""" from config_bootstrap import Master class SkiaFYI(Master.Master3): project_name = 'SkiaFYI' master_port = 8094 slave...
Python
0.000001
9a688a0311cbf802bc541e267afac968bcf7ae2c
break down sample with a little bit extra info and show each step along the way
ocv_image_artihmetic.py
ocv_image_artihmetic.py
import numpy as np import cv2 as cv def ims(img, key, windows_name='dummy'): cv.destroyAllWindows() cv.imshow(windows_name, img) k = 0 while k != ord(key): k = cv.waitKey(10) cv.destroyAllWindows() # blue = np.zeros((300,512,3), np.uint8) # img = cv.imread('messi5.jpg') # main image img ...
import numpy as np import cv2 as cv blue = np.zeros((300,512,3), np.uint8) img = cv.imread('messi5.jpg') cv.imshow('b', blue) k = 0 while k != ord('q'): k = cv.waitKey(100) cv.destroyAllWindows()
Python
0
4a12f00012b1a49d5a3b6876c563a58ab4583b26
Add comments and MSVS settings
lib/node_modules/@stdlib/math/base/blas/dasum/binding.gyp
lib/node_modules/@stdlib/math/base/blas/dasum/binding.gyp
{ 'targets': [ { # The target name should match the add-on export name: 'target_name': 'addon', # Allow developer to choose whether to build a static or shared library: 'type': '<(library)', # Settings that should be applied when a target's object files are used as linker input: ...
{ "targets": [ { "target_name": "addon", "link_settings": { "libraries": [ "<(module_root_dir)/src/c_dasum.o", "<(module_root_dir)/src/dasum.o", "<(module_root_dir)/src/dasumsub.o" ] }, "include_dirs": [ "<!(node -e \"require('nan')\")"...
Python
0
139cfb7756aa6c01d547c0a88cac939c6e88e926
Print where file is saved to.
util/tsne.py
util/tsne.py
#!/usr/bin/env python2 import numpy as np import pandas as pd from sklearn.decomposition import PCA from sklearn.manifold import TSNE import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import matplotlib.cm as cm plt.style.use('bmh') import os import sys import argparse print(""" Note: This e...
#!/usr/bin/env python2 import numpy as np import pandas as pd from sklearn.decomposition import PCA from sklearn.manifold import TSNE import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import matplotlib.cm as cm plt.style.use('bmh') import os import sys import argparse print(""" Note: This e...
Python
0
680d71646773737b4c41543df55d292b9f4f388a
add doc
banana/views/mixins.py
banana/views/mixins.py
from django.db import models from banana.db import check_database class MultiDbMixin(object): """ This mxin makes a Django class based views support multiple databases. It requires a db variable in your request. """ def get_queryset(self): self.db_name = self.kwargs.get('db', 'default') ...
from django.db import models from banana.db import check_database class MultiDbMixin(object): """ This mxin makes a Django class based views support multiple databases. It requires a db variable in your request. """ def get_queryset(self): self.db_name = self.kwargs.get('db', 'default') ...
Python
0
65aefc39a4528e7375c9c8920032be21e6880137
Improve formatting
ogn/collect/receiver.py
ogn/collect/receiver.py
from sqlalchemy.sql import func, null from sqlalchemy.sql.functions import coalesce from sqlalchemy import and_, or_ from celery.utils.log import get_task_logger from ogn.model import Receiver, ReceiverBeacon from ogn.utils import get_country_code from ogn.collect.celery import app logger = get_task_logger(__name__)...
from sqlalchemy.sql import func, null from sqlalchemy.sql.functions import coalesce from sqlalchemy import and_, or_ from celery.utils.log import get_task_logger from ogn.model import Receiver, ReceiverBeacon from ogn.utils import get_country_code from ogn.collect.celery import app logger = get_task_logger(__name__)...
Python
0.000002
e844847323a39f8bfd1870a21071f9f07f110274
manage password
models/user.py
models/user.py
from peewee import CharField, DateTimeField from flask_login import UserMixin from hashlib import sha1 from time import mktime import datetime from models.base import BaseModel class User(BaseModel, UserMixin): created = DateTimeField(default=datetime.datetime.now) email = CharField(max_length=50) passwo...
from peewee import CharField, DateTimeField from flask_login import UserMixin from hashlib import sha1 from time import mktime import datetime from models.base import BaseModel class User(BaseModel, UserMixin): created = DateTimeField(default=datetime.datetime.now) email = CharField(max_length=50) passwo...
Python
0.000004
f964aae2848f1dcd59750a7657aceed55f52f087
add GP methods: loss, kernel and optimization
vlgp/fast.py
vlgp/fast.py
""" Fast version of EM algorithm === Cut trials into small segments for EM Infer latent processes with EM-estimated parameters Convention --- sigma: variance, usual sigma squared omega: timescale, usual 0.5 / tau^2 epsilon: state noise variance """ import logging import math import numpy as np logger = logging.getLo...
""" Fast version of EM algorithm --- Cut trials into small segments for EM Infer latent processes with EM-estimated parameters """ import math from typing import Iterable import numpy as np def cut_trial(trial: dict, length=50): """Cut a trial into small segments :param trial: a trial :param length: max...
Python
0
31381728cb8d76314c82833d4400b4140fcc573f
Change parameter name so it does not conflict with an url parameter called "name".
django_jinja/builtins/global_context.py
django_jinja/builtins/global_context.py
# -*- coding: utf-8 -*- import logging from django.conf import settings from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch from django.contrib.staticfiles.storage import staticfiles_storage JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False) l...
# -*- coding: utf-8 -*- import logging from django.conf import settings from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch from django.contrib.staticfiles.storage import staticfiles_storage JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False) l...
Python
0.000001
6dffa2d22fa5da3b2d8fbcdff04477ff0116bfc1
Resolve a bug in the write function
utilities.py
utilities.py
# Function to return a list of pvs from a given file import pkg_resources pkg_resources.require('aphla') import aphla as ap def get_pv_names(mode): ''' Given a certain ring mode as a string, return all available pvs ''' ap.machines.load(mode) result = set() elements = ap.getElements('*') for el...
# Function to return a list of pvs from a given file import pkg_resources pkg_resources.require('aphla') import aphla as ap def get_pv_names(mode): ''' Given a certain ring mode as a string, return all available pvs ''' ap.machines.load(mode) result = set() elements = ap.getElements('*') for el...
Python
0.00024
1002b81ba5d612271a1e4c33e411eed01398f6fa
Remove not needed env string
dhcpcanon/clientscript.py
dhcpcanon/clientscript.py
# """""" from __future__ import unicode_literals import os import logging import attr import subprocess from constants import STATES2REASONS logger = logging.getLogger('dhcpcanon') @attr.s class ClientScript(object): """Simulates the behaviour of isc-dhcp client-script or Network Manager nm-dhcp-helper. ...
# """""" from __future__ import unicode_literals import os import logging import attr import subprocess from constants import STATES2REASONS logger = logging.getLogger('dhcpcanon') @attr.s class ClientScript(object): """Simulates the behaviour of isc-dhcp client-script or Network Manager nm-dhcp-helper. ...
Python
0.00082
d09fa37069dd6f107d464870d2c59c05fd9625d6
add tool menu flag
sansview/local_config.py
sansview/local_config.py
""" Application settings """ import time import os from sans.guiframe.gui_style import GUIFRAME # Version of the application __appname__ = "SansView" __version__ = '1.9_release_candidate' __download_page__ = 'http://danse.chem.utk.edu' __update_URL__ = 'http://danse.chem.utk.edu/sansview_version.php' ...
""" Application settings """ import time import os from sans.guiframe.gui_style import GUIFRAME # Version of the application __appname__ = "SansView" __version__ = '1.9_release_candidate' __download_page__ = 'http://danse.chem.utk.edu' __update_URL__ = 'http://danse.chem.utk.edu/sansview_version.php' ...
Python
0.000002
f6a5bb4784bc069813e68278a8f78abacd49f4f6
raise exception when parsing XML failed and libxml2 was the backend
bakefile/src/xmlparser.py
bakefile/src/xmlparser.py
class Element: def __init__(self): self.name = None self.value = None self.props = {} self.children = [] self.filename = None self.lineno = None def __copy__(self): x = Element() x.name = self.name x.value = self.value x.props = s...
class Element: def __init__(self): self.name = None self.value = None self.props = {} self.children = [] self.filename = None self.lineno = None def __copy__(self): x = Element() x.name = self.name x.value = self.value x.props = s...
Python
0.000004
3cf13b783a1aa3a5bd956d38ad2ca193bc67f1ae
Fix call
pyproteome/__init__.py
pyproteome/__init__.py
from .utils import DEFAULT_DPI from .analysis import ( correlation, tables, volcano, ) from .motifs import ( logo, motif, phosphosite, ) from . import ( analysis, bca, data_sets, discoverer, levels, loading, modification, motifs, paths, pride, protein, sequence, utils, version, ) from . import clus...
from .utils import DEFAULT_DPI from .analysis import ( correlation, tables, volcano, ) from .motifs import ( logo, motif, phosphosite, ) from . import ( analysis, bca, data_sets, discoverer, levels, loading, modification, motifs, paths, pride, protein, sequence, utils, version, ) from . import clus...
Python
0.000001
55f4507c2285b5927e911a455065dd9c6d60112a
add a Node.__repr__ method
pypuppetdbquery/ast.py
pypuppetdbquery/ast.py
# -*- coding: utf-8 -*- # # This file is part of pypuppetdbquery. # Copyright © 2016 Chris Boot <bootc@bootc.net> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
# -*- coding: utf-8 -*- # # This file is part of pypuppetdbquery. # Copyright © 2016 Chris Boot <bootc@bootc.net> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
Python
0
4be8aea26f5dbec2c93413f6e545a47e850a7382
Mark test as xfail due to new connection factory behavior
irc/tests/test_client.py
irc/tests/test_client.py
import datetime import random import pytest import mock import irc.client def test_version(): assert 'VERSION' in vars(irc.client) assert isinstance(irc.client.VERSION, tuple) assert irc.client.VERSION, "No VERSION detected." def test_delayed_command_order(): """ delayed commands should be sorted by delay time...
import datetime import random import pytest import mock import irc.client def test_version(): assert 'VERSION' in vars(irc.client) assert isinstance(irc.client.VERSION, tuple) assert irc.client.VERSION, "No VERSION detected." def test_delayed_command_order(): """ delayed commands should be sorted by delay time...
Python
0
0314334373b380c41e72ed41bfef1f7cbc65b894
Add CAN_DETECT
bears/yml/YAMLLintBear.py
bears/yml/YAMLLintBear.py
from coalib.bearlib.abstractions.Linter import linter from coalib.bears.requirements.PipRequirement import PipRequirement @linter(executable='yamllint', output_format="regex", output_regex=r'.+:(?P<line>\d+):(?P<column>\d+): ' r'\[(?P<severity>error|warning)\] (?P<message>.+)') cl...
from coalib.bearlib.abstractions.Linter import linter from coalib.bears.requirements.PipRequirement import PipRequirement @linter(executable='yamllint', output_format="regex", output_regex=r'.+:(?P<line>\d+):(?P<column>\d+): ' r'\[(?P<severity>error|warning)\] (?P<message>.+)') cl...
Python
0.000235
0d9b29c80502f8c4f23920ec65bc89093d553e47
Corrige numero da versao do pacote
pysigep/__version__.py
pysigep/__version__.py
__title__ = 'pysigep' __description__ = 'API python para uso dos serviços fornecidos pelo ' \ 'SIGEPWeb dos Correios ' __version__ = '0.1.0' __url__ = 'https://github.com/mstuttgart/pysigep' __download_url__ = 'https://github.com/mstuttgart/pysigep' __author__ = 'Michell Stuttgart' __author_email__ = ...
__title__ = 'pysigep' __description__ = 'API python para uso dos serviços fornecidos pelo ' \ 'SIGEPWeb dos Correios ' __version__ = '0.4.4' __url__ = 'https://github.com/mstuttgart/pysigep' __download_url__ = 'https://github.com/mstuttgart/pysigep' __author__ = 'Michell Stuttgart' __author_email__ = ...
Python
0
124d202ee6c18b79e5baf560b1cbfaddf47ed194
allow runtests.py to run only certain tests
mpmath/tests/runtests.py
mpmath/tests/runtests.py
#!/usr/bin/env python """ python runtests.py -py Use py.test to run tests (more useful for debugging) python runtests.py -psyco Enable psyco to make tests run about 50% faster python runtests.py -profile Generate profile stats (this is much slower) python runtests.py -nogmpy Run tests without u...
#!/usr/bin/env python """ python runtests.py -py Use py.test to run tests (more useful for debugging) python runtests.py -psyco Enable psyco to make tests run about 50% faster python runtests.py -profile Generate profile stats (this is much slower) python runtests.py -nogmpy Run tests without u...
Python
0.000004
c9157639b1e412d9d13fcfca8bf4e0f04858e323
Fix tempfile cleanup.
betago/corpora/archive.py
betago/corpora/archive.py
import os import shutil import tarfile import tempfile from contextlib import contextmanager from operator import attrgetter __all__ = [ 'SGF', 'find_sgfs', ] class SafetyError(Exception): pass class SGF(object): def __init__(self, locator, contents): self.locator = locator self.con...
import os import shutil import tarfile import tempfile from contextlib import contextmanager from operator import attrgetter __all__ = [ 'SGF', 'find_sgfs', ] class SafetyError(Exception): pass class SGF(object): def __init__(self, locator, contents): self.locator = locator self.con...
Python
0
2373734b9eda5c887621ee64a2ca755850685699
test c-model
transiNXOR_modeling/transixor_predictor.py
transiNXOR_modeling/transixor_predictor.py
import sys sys.path.append('../') import numpy as np from itertools import product from pinn_api import predict_ids_grads, predict_ids import matplotlib.pyplot as plt import glob ## ------------ True data --------------- ids_file = glob.glob('./transiXOR_data/current_D9.npy') # ids_file = glob.glob('./transiXOR_data...
import sys sys.path.append('../') import numpy as np from itertools import product from pinn_api import predict_ids_grads, predict_ids import matplotlib.pyplot as plt import glob ## ------------ True data --------------- ids_file = glob.glob('./transiXOR_data/current_D9.npy') # ids_file = glob.glob('./transiXOR_data...
Python
0.000005
168b29e28dd3b48f4b4fc3ce82daa0e13ffa7223
Use Cython i.o. setuptools
python/smurff/setup.py
python/smurff/setup.py
import subprocess from setuptools import setup from Cython.Distutils import Extension from Cython.Distutils import build_ext import numpy import numpy.distutils.system_info as sysinfo import sys import os lapack_opt_info = sysinfo.get_info("lapack_opt") # {'libraries': ['mkl_rt', 'pthread'], # 'library_dirs': ['/Use...
import subprocess from setuptools import setup from setuptools import Extension from Cython.Build import build_ext import numpy import numpy.distutils.system_info as sysinfo import sys import os lapack_opt_info = sysinfo.get_info("lapack_opt") # {'libraries': ['mkl_rt', 'pthread'], # 'library_dirs': ['/Users/vandera...
Python
0
d692ed6c48fc36b296b9a3e952dd1f70b133210c
add migrate script to remove ezid from suggestions
portality/migrate/p1p2/suggestionrestructure.py
portality/migrate/p1p2/suggestionrestructure.py
from portality import models, settings import requests, json # first thing to do is delete suggestions which are marked "waiting for answer" q = { "query" : { "bool" : { "must" : [ {"term" : {"admin.application_status.exact" : "waiting for answer"}} ] } ...
from portality import models, settings import requests, json # first thing to do is delete suggestions which are marked "waiting for answer" q = { "query" : { "bool" : { "must" : [ {"term" : {"admin.application_status.exact" : "waiting for answer"}} ] } ...
Python
0
4bc871aaa72fa1d793203e5627a2ac5f859ae27d
add dependencies; still incomplete
tardis/montecarlo/setup_package.py
tardis/montecarlo/setup_package.py
#setting the right include from setuptools import Extension import numpy as np import os from astropy_helpers.setup_helpers import get_distutils_option from glob import glob if get_distutils_option('with_openmp', ['build', 'install', 'develop']) is not None: compile_args = ['-fopenmp', '-W', '-Wall', '-Wmissing-p...
#setting the right include from setuptools import Extension import numpy as np import os from astropy_helpers.setup_helpers import get_distutils_option from glob import glob if get_distutils_option('with_openmp', ['build', 'install', 'develop']) is not None: compile_args = ['-fopenmp', '-W', '-Wall', '-Wmissing-p...
Python
0
df16f3e9c49ba2fb3cdbfdc62e120c6358eb25f9
Add 'dump_header' function
edgedb/lang/common/markup/__init__.py
edgedb/lang/common/markup/__init__.py
## # Copyright (c) 2011 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## from . import elements, serializer, renderers from .serializer import serialize from .serializer import base as _base_serializer from semantix.exceptions import ExceptionContext as _ExceptionContext from semantix.utils import ...
## # Copyright (c) 2011 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## from . import elements, serializer, renderers from .serializer import serialize from .serializer import base as _base_serializer from semantix.exceptions import ExceptionContext as _ExceptionContext from semantix.utils import ...
Python
0.000005
9aeecaac014e67e5ad55b670be2dc4ab5dd95b5f
decrease max files size limit from 2mb to 250kb (#3602)
ecommerce/extensions/offer/constants.py
ecommerce/extensions/offer/constants.py
from django.utils.translation import ugettext_lazy as _ DYNAMIC_DISCOUNT_FLAG = 'offer.dynamic_discount' # OfferAssignment status constants defined here to avoid circular dependency. OFFER_ASSIGNMENT_EMAIL_PENDING = 'EMAIL_PENDING' OFFER_ASSIGNED = 'ASSIGNED' OFFER_REDEEMED = 'REDEEMED' OFFER_ASSIGNMENT_EMAIL_BOUNCED...
from django.utils.translation import ugettext_lazy as _ DYNAMIC_DISCOUNT_FLAG = 'offer.dynamic_discount' # OfferAssignment status constants defined here to avoid circular dependency. OFFER_ASSIGNMENT_EMAIL_PENDING = 'EMAIL_PENDING' OFFER_ASSIGNED = 'ASSIGNED' OFFER_REDEEMED = 'REDEEMED' OFFER_ASSIGNMENT_EMAIL_BOUNCED...
Python
0
ab6e5754283999ece4e77da959c6f9c868b964a7
Add Security Manager information
variables.py
variables.py
""" Define the variables in a module. """ NOT_EVALUATED_PHASE = 'Not Evaluated' NOT_STARTED_PHASE = 'Not Started' IN_PROGRESS_PHASE = 'In Progress' DONE_PHASE = 'Done' SECURITY_MANAGER_NAME = 'Rémi Lavedrine' SECURITY_MANAGER_EMAIL = 'remi.lavedrine@orange.com' SECURITY_MANAGER_PHONE = '06 31 17 80 39'
""" Define the variables in a module. """ NOT_EVALUATED_PHASE = 'Not Evaluated' NOT_STARTED_PHASE = 'Not Started' IN_PROGRESS_PHASE = 'In Progress' DONE_PHASE = 'Done'
Python
0
e44021fff840435fe49aaef1a1531cb2ccf44e43
Add back to "rebuild_data" command
project/api/management/commands/rebuild_data.py
project/api/management/commands/rebuild_data.py
# Django from django.apps import apps from django.core.management.base import BaseCommand from django.utils import timezone import datetime class Command(BaseCommand): help = "Command to rebuild denorms." def add_arguments(self, parser): parser.add_argument( '--days', type=int...
# Django from django.apps import apps from django.core.management.base import BaseCommand from django.utils import timezone import datetime class Command(BaseCommand): help = "Command to rebuild denorms." def add_arguments(self, parser): parser.add_argument( '--days', type=int...
Python
0.000005
b24ed88670460f9037b6fbfa17a37d7912d45af9
Fix test that fails when you have a SMTP server on localhost
openspending/ui/test/functional/test_account.py
openspending/ui/test/functional/test_account.py
from .. import ControllerTestCase, url, helpers as h from openspending.model import Account, meta as db from openspending.lib.mailer import MailerException from pylons import config import json class TestAccountController(ControllerTestCase): def test_login(self): response = self.app.get(url(controller='...
from .. import ControllerTestCase, url, helpers as h from openspending.model import Account, meta as db from openspending.lib.mailer import MailerException import json class TestAccountController(ControllerTestCase): def test_login(self): response = self.app.get(url(controller='account', action='login'))...
Python
0.000001
48b33bedda0da0ad324f8f7a3ac2fbafa8e6f665
change issue commit to markdown
moment/main.py
moment/main.py
from sanic import Sanic from sanic.response import json as response_json import aiohttp import json from moment.gitlab_message_dict import get_dingtalk_data app = Sanic(__name__) async def post(url, json_data): headers = { "Content-Type": "application/json" } conn = aiohttp.TCPConnector(verify_ss...
from sanic import Sanic from sanic.response import json as response_json import aiohttp import json from moment.gitlab_message_dict import get_dingtalk_data app = Sanic(__name__) async def post(url, json_data): headers = { "Content-Type": "application/json" } conn = aiohttp.TCPConnector(verify_ss...
Python
0
8ec6b8b6c2f099261f85a3f68b5d6e87cbdb1c25
set context to none for ws://
src/mattermostdriver/websocket.py
src/mattermostdriver/websocket.py
import json import ssl import asyncio import logging import websockets logging.basicConfig(level=logging.INFO) log = logging.getLogger('mattermostdriver.websocket') class Websocket: def __init__(self, options, token): self.options = options self._token = token @asyncio.coroutine def connect(self, event_handl...
import json import ssl import asyncio import logging import websockets logging.basicConfig(level=logging.INFO) log = logging.getLogger('mattermostdriver.websocket') class Websocket: def __init__(self, options, token): self.options = options self._token = token @asyncio.coroutine def connect(self, event_handl...
Python
0.000014
238c49d4fb1fe67ffd63ed7b9dc5dce0915ae389
remove internationalisation of uri. fix issue #2
django_authopenid/urls.py
django_authopenid/urls.py
# -*- coding: utf-8 -*- from django.conf.urls.defaults import patterns, url from django.utils.translation import ugettext as _ urlpatterns = patterns('django_authopenid.views', # yadis rdf url(r'^yadis.xrdf$', 'xrdf', name='yadis_xrdf'), # manage account registration url(r'^signin/$', 'signin', name='...
# -*- coding: utf-8 -*- from django.conf.urls.defaults import patterns, url from django.utils.translation import ugettext as _ urlpatterns = patterns('django_authopenid.views', # yadis rdf url(r'^yadis.xrdf$', 'xrdf', name='yadis_xrdf'), # manage account registration url(r'^%s$' % _('signin/'), 'signi...
Python
0.000001
fe314468c4a8c02650b3b983a239acd06bfc003f
Improve config file handling on the job.
lobster/cmssw/data/job.py
lobster/cmssw/data/job.py
#!/usr/bin/env python import base64 import json import os import pickle import shutil import subprocess import sys fragment = """import FWCore.ParameterSet.Config as cms process.source.fileNames = cms.untracked.vstring({input_files}) process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1)) process.sour...
#!/usr/bin/env python import base64 import json import os import pickle import subprocess import sys def edit_process_source(cmssw_config_file, config_params): (dataset_files, lumis) = config_params config = open(cmssw_config_file, 'a') with open(cmssw_config_file, 'a') as config: fragment = ('imp...
Python
0
95a21d9c758e471f7d458f6dc597d615605afe73
Add function to derive iRODS zone name and use to make correct collection
jicirodsmanager/irods.py
jicirodsmanager/irods.py
"""Module for storing irods specific code.""" import os import json import logging from jicirodsmanager import StorageManager, CommandWrapper logger = logging.getLogger(__name__) def string_to_list(s): """Return a list of items. :param s: string with white space separated items :returns: list of items...
"""Module for storing irods specific code.""" import logging from jicirodsmanager import StorageManager, CommandWrapper logger = logging.getLogger(__name__) def string_to_list(s): """Return a list of items. :param s: string with white space separated items :returns: list of items """ return s....
Python
0
4645f904d0f522d51148d9fde3f50da6a619c6a8
add forms widget factory beginnings
examples/djangowanted/wanted/forms.py
examples/djangowanted/wanted/forms.py
from django.forms import ModelForm from django import forms from wanted.models import * class FlagForm(ModelForm): item = forms.ModelChoiceField(queryset=Item.objects.all()) type = forms.ModelChoiceField(queryset=FlagType.objects.all()) value = forms.CharField(max_length=255) class ItemForm(ModelForm): ...
from django.forms import ModelForm from django import forms from wanted.models import * class FlagForm(ModelForm): item = forms.ModelChoiceField(queryset=Item.objects.all()) type = forms.ModelChoiceField(queryset=FlagType.objects.all()) value = forms.CharField(max_length=255) class ItemForm(ModelForm): ...
Python
0.000001
abffd85d6038494eea93b277b2d25af816dc2b78
Enable bidi tests for Firefox 86+
py/test/selenium/webdriver/common/bidi_tests.py
py/test/selenium/webdriver/common/bidi_tests.py
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
Python
0
e0681bcee248e409dcec9f0918a8cd8101cb1c0d
Set terminal width for Vyatta Driver
netmiko/vyos/vyos_ssh.py
netmiko/vyos/vyos_ssh.py
import time from netmiko.cisco_base_connection import CiscoSSHConnection class VyOSSSH(CiscoSSHConnection): """Implement methods for interacting with VyOS network devices.""" def session_preparation(self): """Prepare the session after the connection has been established.""" self._test_channel...
import time from netmiko.cisco_base_connection import CiscoSSHConnection class VyOSSSH(CiscoSSHConnection): """Implement methods for interacting with VyOS network devices.""" def session_preparation(self): """Prepare the session after the connection has been established.""" self._test_channel...
Python
0
9722016a0117682fa7d0d5599a8dc2f1a75f7c6a
remove softmax / centroidloss
pyannote/audio/embedding/approaches/__init__.py
pyannote/audio/embedding/approaches/__init__.py
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2017-2018 CNRS # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limita...
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2017-2018 CNRS # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limita...
Python
0.00003
57a1e59f034b0edbabaa76376ba6475d6e4d0297
Add code to work out the Julian representation of a date.
qual/calendars/main.py
qual/calendars/main.py
from datetime import date, timedelta from qual.helpers import ordinal, month_string from date import DateWithCalendar, InvalidDate from base import Calendar class ProlepticGregorianCalendar(Calendar): display_name = "Proleptic Gregorian Calendar" def date(self, year, month, day): try: d =...
from datetime import date, timedelta from qual.helpers import ordinal, month_string from date import DateWithCalendar, InvalidDate from base import Calendar class ProlepticGregorianCalendar(Calendar): display_name = "Proleptic Gregorian Calendar" def date(self, year, month, day): try: d =...
Python
0.000001
82f563d7ed8dc53d00edf361af1f607f9a89b918
Add the rv32mi tests.
Simulation/core/conftest.py
Simulation/core/conftest.py
#!/usr/bin/env python # Copyright (c) 2015 Angel Terrones (<angelterrones@gmail.com>) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the r...
#!/usr/bin/env python # Copyright (c) 2015 Angel Terrones (<angelterrones@gmail.com>) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the r...
Python
0
55fbe047e091669d005a73ebb333392954186ace
Compact test false negative fix
jpp/cli_test/cli_test.py
jpp/cli_test/cli_test.py
import os import shutil import subprocess import unittest from collections import namedtuple CURR_DIR = os.path.dirname(os.path.realpath(__file__)) class TestCli(unittest.TestCase): TMP_TEST_FILES = os.path.join(CURR_DIR, '__tmp__') @classmethod def setUpClass(cls): FileDef = namedtuple('FileDe...
import os import shutil import subprocess import unittest from collections import namedtuple CURR_DIR = os.path.dirname(os.path.realpath(__file__)) class TestCli(unittest.TestCase): TMP_TEST_FILES = os.path.join(CURR_DIR, '__tmp__') @classmethod def setUpClass(cls): FileDef = namedtuple('FileDe...
Python
0.999412
ab5c36e8d50eacf7c13234c75e17b606c0d97758
convert HTTP request arguments to lowercase
webserver.py
webserver.py
import threading __author__ = 'bawki' from http.server import BaseHTTPRequestHandler, HTTPServer import socket import multiprocessing import json from database import CatDb class CatHandler(BaseHTTPRequestHandler): def servePingData(self, arguments): self.sendSuccessHeader() print('servePingData:...
import threading __author__ = 'bawki' from http.server import BaseHTTPRequestHandler, HTTPServer import socket import multiprocessing import json from database import CatDb class CatHandler(BaseHTTPRequestHandler): def servePingData(self, arguments): self.sendSuccessHeader() print('servePingData:...
Python
0.999999
b193f9ccabb1093db8a803f7994adb14a85caf5a
Update __init__.py
djconnectwise/__init__.py
djconnectwise/__init__.py
# -*- coding: utf-8 -*- VERSION = (0, 3, 32, 'final') # pragma: no cover if VERSION[-1] != "final": __version__ = '.'.join(map(str, VERSION)) else: # pragma: no cover __version__ = '.'.join(map(str, VERSION[:-1])) default_app_config = 'djconnectwise.apps.DjangoConnectwiseConfig'
# -*- coding: utf-8 -*- VERSION = (0, 3, 31, 'final') # pragma: no cover if VERSION[-1] != "final": __version__ = '.'.join(map(str, VERSION)) else: # pragma: no cover __version__ = '.'.join(map(str, VERSION[:-1])) default_app_config = 'djconnectwise.apps.DjangoConnectwiseConfig'
Python
0.000005
0e9d3f5c2bae999dc71c8f7bb62e380faac5dec7
improve example
examples/widgets/tabbed_panel_test.py
examples/widgets/tabbed_panel_test.py
''' TabbedPannel ====== Test of the widget TabbedPannel. ''' from kivy.app import App from kivy.animation import Animation from kivy.clock import Clock from kivy.uix.button import Button from kivy.uix.floatlayout import FloatLayout from kivy.uix.tabbedpannel import TabbedPannel from kivy.properties import ObjectPrope...
''' TabbedPannel ====== Test of the widget TabbedPannel. ''' from kivy.app import App from kivy.animation import Animation from kivy.clock import Clock from kivy.uix.button import Button from kivy.uix.floatlayout import FloatLayout from kivy.uix.tabbedpannel import TabbedPannel from kivy.properties import ObjectPrope...
Python
0.000031
b8e1d2419a1dbe065e1828599e60867bc845f0e3
Add some docs to nm root package
neuralmonkey/__init__.py
neuralmonkey/__init__.py
"""The neuralmonkey package is the root package of this project."""
Python
0
aa741b5a2b18a7df402325b53476eba36e448b40
Update to 0.0.49
djconnectwise/__init__.py
djconnectwise/__init__.py
# -*- coding: utf-8 -*- VERSION = (0, 0, 49, 'alpha') # pragma: no cover if VERSION[-1] != "final": __version__ = '.'.join(map(str, VERSION)) else: # pragma: no cover __version__ = '.'.join(map(str, VERSION[:-1]))
# -*- coding: utf-8 -*- VERSION = (0, 0, 48, 'alpha') # pragma: no cover if VERSION[-1] != "final": __version__ = '.'.join(map(str, VERSION)) else: # pragma: no cover __version__ = '.'.join(map(str, VERSION[:-1]))
Python
0.000001
95f09bc7d61d6ea0a1228229a5092e2bff889855
make website_multi_company_demo hidden
website_multi_company_demo/__manifest__.py
website_multi_company_demo/__manifest__.py
# -*- coding: utf-8 -*- { "name": """Demo Data for \"Real Multi Website\"""", "summary": """Provides demo websites""", "category": "Hidden", # "live_test_URL": "", "images": [], "version": "1.0.0", "application": False, "author": "IT-Projects LLC, Ivan Yelizariev", "support": "apps@...
# -*- coding: utf-8 -*- { "name": """Demo Data for \"Real Multi Website\"""", "summary": """Provides demo websites""", "category": "eCommerce", # "live_test_URL": "", "images": [], "version": "1.0.0", "application": False, "author": "IT-Projects LLC, Ivan Yelizariev", "support": "ap...
Python
0
a8333a5c3e9c6b07df2b04782c9e0cc3c4b6e60c
Bump Version
common.py
common.py
VERSION_YEAR = 2017 VERSION_MONTH = 10 VERSION_DAY = 5 VERSION_REV = 0 whos_in = None twitter = None users = {} twilio_client = None ARGS = {} smmry_api_key = None # Variable hold trumps last tweet id last_id = 0 trump_chance_roll_rdy = False # Runtime stats duels_conducted = 0 items_awarded = 0 trump_tweets_seen = ...
VERSION_YEAR = 2017 VERSION_MONTH = 10 VERSION_DAY = 2 VERSION_REV = 1 whos_in = None twitter = None users = {} twilio_client = None ARGS = {} smmry_api_key = None # Variable hold trumps last tweet id last_id = 0 trump_chance_roll_rdy = False # Runtime stats duels_conducted = 0 items_awarded = 0 trump_tweets_seen = ...
Python
0
7047816b5edc7911685219d53970c892728d0220
add os to config
config.py
config.py
# -*- encoding: utf-8 -*- import datetime import os # ----------------------------------------------------- # Application configurations # ------------------------------------------------------ DEBUG = True SECRET_KEY = os.environ['SECRET_KEY'] PORT = os.environ['PORT'] HOST = os.environ['HOST'] # -------------------...
# -*- encoding: utf-8 -*- import datetime # ----------------------------------------------------- # Application configurations # ------------------------------------------------------ DEBUG = True SECRET_KEY = os.environ['SECRET_KEY'] PORT = os.environ['PORT'] HOST = os.environ['HOST'] # -----------------------------...
Python
0.000001
4748a984b2e594c2e92b02eaac3b27457ec1d023
reorder l2 lambda
config.py
config.py
import tensorflow as tf from classes.model import Layer class BaseConfig(): TRAINING_DATA = './assignment/train_potus_by_county.csv' TESTING_DATA = './assignment/train_potus_by_county.csv' TARGET_LABEL = 'Winner' OUTFILES = {'targets': './targets.csv', 'preprocessing_means': './prep...
import tensorflow as tf from classes.model import Layer class BaseConfig(): TRAINING_DATA = './assignment/train_potus_by_county.csv' TESTING_DATA = './assignment/train_potus_by_county.csv' TARGET_LABEL = 'Winner' OUTFILES = {'targets': './targets.csv', 'preprocessing_means': './prep...
Python
0.999999
9a09b6fdcd26fbacfa73574835da1fe27a8760f6
Add separate config for preview.
config.py
config.py
class Config(object): DEBUG = False class DevelopmentConfig(Config): DEBUG = True RULES_ENGINE_URL = "http://localhost:5005" BANKRUPTCY_DATABASE_API = "http://localhost:5004" CASEWORK_DATABASE_API = "http://localhost:5006" class PreviewConfig(Config): RULES_ENGINE_URL = "http://localhost:5...
class Config(object): DEBUG = False class DevelopmentConfig(object): DEBUG = True RULES_ENGINE_URL = "http://localhost:5005" BANKRUPTCY_DATABASE_API = "http://localhost:5004" CASEWORK_DATABASE_API = "http://localhost:5006"
Python
0
1c895f37f3b3090f1f53ab9d01bc639758f14a2f
refine coding style
nthuoj/urls.py
nthuoj/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings from django.http import HttpResponseRedirect from ckeditor.views import upload, browse from utils.user_info import validate_user import autocomplete_light # OP autodiscover autocomplete_light.autodisco...
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings from django.http import HttpResponseRedirect from ckeditor.views import upload, browse from utils.user_info import validate_user import autocomplete_light # OP autodiscover autocomplete_light.autodisco...
Python
0.908904
7f13b29cc918f63c4d1fc24717c0a0b5d2f5f8ad
Fix problem with array values.
filter.py
filter.py
import numpy as np class LowPassFilter(object): ''' First order discrete IIR filter. ''' def __init__(self, feedback_gain, initial_value=0.0): self.feedback_gain = np.ones_like(initial_value) * feedback_gain self.initial_value = initial_value self.output_gain = 1.0 - feedback_ga...
import numpy as np class LowPassFilter(object): ''' First order discrete IIR filter. ''' def __init__(self, feedback_gain, initial_value=0.0): self.feedback_gain = np.ones_like(initial_value) * feedback_gain self.initial_value = initial_value self.output_gain = 1.0 - feedback_ga...
Python
0.000021
bb8e3163920bb81998bc9851a3abceac498e0b0e
add coding:utf-8 comment to finder.py
finder.py
finder.py
# -*- coding: utf-8 -*- from design import FindDesigns class Finder(object): def __init__(self, payload, preferred_radial_size, delta_vs, accelerations, pressures, gimbal, boosters, electricity, length): """Initializes this finder. Args: payload (Int) - Payload size ...
from design import FindDesigns class Finder(object): def __init__(self, payload, preferred_radial_size, delta_vs, accelerations, pressures, gimbal, boosters, electricity, length): """Initializes this finder. Args: payload (Int) - Payload size in kilograms. ...
Python
0
1f78da6be6aa0aaa2d361eaa3994488f1a8b4a07
add nodesMentioned, edgesMentioned
src/dig/outline.py
src/dig/outline.py
#!/usr/bin/env python import sys try: from StringIO import StringIO except ImportError: from io import StringIO from pprint import pprint from collections import defaultdict from util import info iii = None class Outline(object): def __init__(self, graph, subgraph, query, root, **kwargs): self.gr...
#!/usr/bin/env python import sys try: from StringIO import StringIO except ImportError: from io import StringIO from pprint import pprint from collections import defaultdict iii = None class Outline(object): def __init__(self, graph, subgraph, query, root, **kwargs): self.graph = graph se...
Python
0.000036
9378ee0d414321bd557b478ffb6725ee899bc9b0
simplify code and add comment
TaskList/FileInfo/FileInfo.py
TaskList/FileInfo/FileInfo.py
#!/usr/bin/python3.4 # -*-coding:Utf-8 -* '''module to manage blender file info''' import xml.etree.ElementTree as xmlMod from TaskList.FileInfo.Scene import * from usefullFunctions import XML import os class FileInfo: '''class to manage blender file info''' def __init__(self, xml): '''initialize blender file ...
#!/usr/bin/python3.4 # -*-coding:Utf-8 -* '''module to manage blender file info''' import xml.etree.ElementTree as xmlMod from TaskList.FileInfo.Scene import * from usefullFunctions import XML import os class FileInfo: '''class to manage blender file info''' def __init__(self, xml): '''initialize blender file ...
Python
0.000001
b0f25b7263a42fbd1e90cf7ebe3dcba50f9cfe42
use the correct class name
amiconfig/plugins/rmakeserver.py
amiconfig/plugins/rmakeserver.py
# # Copyright (c) 2008 rPath, Inc. # import os from rmakeplugin import rMakePlugin class AMIConfigPlugin(rMakePlugin): name = 'rmakeserver' def pluginMethod(self): self._setupProxy() self._setuprBuilder() self._setupRepoUrl() def _setupProxy(self): proxycfg = '/etc/rmake...
# # Copyright (c) 2008 rPath, Inc. # import os from rmakeplugin import rMakePlugin class rMakeServer(rMakePlugin): name = 'rmakeserver' def pluginMethod(self): self._setupProxy() self._setuprBuilder() self._setupRepoUrl() def _setupProxy(self): proxycfg = '/etc/rmake/ser...
Python
0.999948
ba31be554d3cc4fd51b7189434071596143b686c
add audio.load.readrecf
hvc/audio/load.py
hvc/audio/load.py
import numpy as np def read_cbin(filename): """ loads .cbin files output by EvTAF """ data = np.fromfile(filename,dtype=">d") # ">d" means big endian, double return data def readrecf(filename): """ reads .rec files output by EvTAF """ rec_dict = {} with open(filename,'r') as ...
import numpy as np def read_cbin(filename): """ loads .cbin files output by EvTAF """ data = np.fromfile(filename,dtype=">d") # ">d" means big endian, double return data def readrecf(filename): """ reads .rec files output by EvTAF """
Python
0
4b46c07b795e3e16c16a8897ac42a0755e88c213
Use trial logging.
analysis/sanity-count-markers.py
analysis/sanity-count-markers.py
#!/usr/bin/env python import climate import collections import joblib import lmj.cubes import lmj.plot import numpy as np logging = climate.get_logger('count') def count(trial): trial.load() trial.mask_dropouts() total = len(trial.df) markers = {m: trial.df[m + '-c'].count() / total for m in trial.m...
#!/usr/bin/env python import climate import collections import joblib import lmj.cubes import lmj.plot import numpy as np logging = climate.get_logger('count') def count(trial): trial.load() trial.mask_dropouts() total = len(trial.df) markers = {m: trial.df[m + '-c'].count() / total for m in trial.m...
Python
0
8c651899be8eab478d0cc6da22f695ecd3b33313
Add parents
anybox/recipe/openerp/vcs/git.py
anybox/recipe/openerp/vcs/git.py
import os import subprocess import logging from ..utils import working_directory_keeper from .base import BaseRepo from .base import SUBPROCESS_ENV logger = logging.getLogger(__name__) class GitRepo(BaseRepo): """Represent a Git clone tied to a reference branch.""" vcs_control_dir = '.git' def parents...
import os import subprocess import logging from ..utils import working_directory_keeper from .base import BaseRepo from .base import SUBPROCESS_ENV logger = logging.getLogger(__name__) class GitRepo(BaseRepo): """Represent a Git clone tied to a reference branch.""" vcs_control_dir = '.git' def uncommi...
Python
0.000069
be291475601657cbcd3903679c77c2860b543308
fix doc
deepchem/feat/tests/test_dummy_featurizer.py
deepchem/feat/tests/test_dummy_featurizer.py
import unittest import deepchem as dc import numpy as np class TestDummyFeaturizer(unittest.TestCase): """ Test for DummyFeaturizer. """ def test_featurize(self): """ Test the featurize method on an array of inputs. """ input_array = np.array([[ "N#C[S-].O=C(CBr)c1ccc(C(F)(F)F)cc1>CCO...
import unittest import deepchem as dc import numpy as np class TestDummyFeaturizer(unittest.TestCase): """ Test for DummyFeaturizer. """ def test_featurize(self): """ Test the featurize method on a list of inputs. """ input_array = np.array([[ "N#C[S-].O=C(CBr)c1ccc(C(F)(F...
Python
0.000001
c8a97a33449eedc110169cb9b3f0120124d95e49
Add tiny test for ToPickle (#6021)
distributed/protocol/tests/test_to_pickle.py
distributed/protocol/tests/test_to_pickle.py
from typing import Dict import dask.config from dask.highlevelgraph import HighLevelGraph, MaterializedLayer from distributed.client import Client from distributed.protocol import dumps, loads from distributed.protocol.serialize import ToPickle from distributed.utils_test import gen_cluster def test_ToPickle(): ...
from typing import Dict import dask.config from dask.highlevelgraph import HighLevelGraph, MaterializedLayer from distributed.client import Client from distributed.protocol.serialize import ToPickle from distributed.utils_test import gen_cluster class NonMsgPackSerializableLayer(MaterializedLayer): """Layer tha...
Python
0
63b20c15d3749fc60fcb7e1e43fbbc8832b50354
Alphabetize imports
django_graph_api/tests/graphql/test_types.py
django_graph_api/tests/graphql/test_types.py
import pytest from unittest import mock from django_graph_api.graphql.schema import Schema from django_graph_api.graphql.types import Boolean, Float, Field, Int, List, String schema = Schema() def test_field_get_value_calls_coerce(): field = Field() field.type_ = mock.Mock() field.name = 'foo' fiel...
import pytest from unittest import mock from django_graph_api.graphql.schema import Schema from django_graph_api.graphql.types import Boolean, Float, Field, Int, String, List schema = Schema() def test_field_get_value_calls_coerce(): field = Field() field.type_ = mock.Mock() field.name = 'foo' fiel...
Python
0.999913
288d02bccf08ff0498767aafca9bd37509213ec3
Update forms.py
djforms/communications/printrequest/forms.py
djforms/communications/printrequest/forms.py
# -*- coding: utf-8 -*- from django import forms from django.conf import settings from localflavor.us.forms import USPhoneNumberField from djforms.communications.printrequest.models import PrintRequest, FORMATS class PrintRequestForm(forms.ModelForm): phone = USPhoneNumberField( label = "Phone ...
# -*- coding: utf-8 -*- from django import forms from django.conf import settings from localflavor.us.forms import USPhoneNumberField from djforms.communications.printrequest.models import PrintRequest, FORMATS class PrintRequestForm(forms.ModelForm): phone = USPhoneNumberField( label = "Phone ...
Python
0
1b13a929122c2bcb7e524b39183610ac3e57f191
Mark Show.upcoming as @staticmethod
karspexet/show/models.py
karspexet/show/models.py
from django.db import models import datetime class Production(models.Model): name = models.CharField(max_length=100) description = models.TextField(blank=True) def __str__(self): return self.name class Show(models.Model): production = models.ForeignKey(Production, on_delete=models.PROTECT) ...
from django.db import models import datetime class Production(models.Model): name = models.CharField(max_length=100) description = models.TextField(blank=True) def __str__(self): return self.name class Show(models.Model): production = models.ForeignKey(Production, on_delete=models.PROTECT) ...
Python
0
8ad3308738890d6f4301c7b306afc95d480930ef
Fix spurious headers in ListBucket requests
euca2ools/commands/walrus/listbucket.py
euca2ools/commands/walrus/listbucket.py
# Copyright 2013 Eucalyptus Systems, Inc. # # 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 code must retain the above copyright notice, # this list of conditions and t...
# Copyright 2013 Eucalyptus Systems, Inc. # # 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 code must retain the above copyright notice, # this list of conditions and t...
Python
0.000003
92008233d8418e1166b3aab18d93f91e552f4a8f
Order elections by election ID
every_election/apps/elections/models.py
every_election/apps/elections/models.py
from django.db import models from django.core.urlresolvers import reverse from suggested_content.models import SuggestedByPublicMixin from .managers import ElectionManager class ElectionType(models.Model): """ As defined at https://democracyclub.org.uk/projects/election-ids/reference/ """ name = mo...
from django.db import models from django.core.urlresolvers import reverse from suggested_content.models import SuggestedByPublicMixin from .managers import ElectionManager class ElectionType(models.Model): """ As defined at https://democracyclub.org.uk/projects/election-ids/reference/ """ name = mo...
Python
0
f834e728e2635c91f95bd234c9dd2ffca7699ee0
fix flake8
dvc/progress.py
dvc/progress.py
"""Manages progress bars for dvc repo.""" from __future__ import print_function import logging from tqdm import tqdm from concurrent.futures import ThreadPoolExecutor class TqdmThreadPoolExecutor(ThreadPoolExecutor): """ Ensure worker progressbars are cleared away properly. """ def __enter__(self): ...
"""Manages progress bars for dvc repo.""" from __future__ import print_function import logging from tqdm import tqdm from concurrent.futures import ThreadPoolExecutor class TqdmThreadPoolExecutor(ThreadPoolExecutor): """ Ensure worker progressbars are cleared away properly. """ def __enter__(self): ...
Python
0
426972e55f155d817e1db975afa2f25dbf860445
disable super progress bar for single-files
dvc/repo/add.py
dvc/repo/add.py
import logging import os import colorama from . import locked from dvc.exceptions import RecursiveAddingWhileUsingFilename from dvc.progress import Tqdm from dvc.repo.scm_context import scm_context from dvc.stage import Stage from dvc.utils import LARGE_DIR_SIZE logger = logging.getLogger(__name__) @locked @scm_co...
import logging import os import colorama from . import locked from dvc.exceptions import RecursiveAddingWhileUsingFilename from dvc.progress import Tqdm from dvc.repo.scm_context import scm_context from dvc.stage import Stage from dvc.utils import LARGE_DIR_SIZE logger = logging.getLogger(__name__) @locked @scm_co...
Python
0
823071f923b0226faae011146bf13dd7a74e5532
Simplify implementation
scripts/airtable_sync.py
scripts/airtable_sync.py
#!usr/bin/env python #=============================================================================== # Import modules #=============================================================================== # Standard Library import os import sys import datetime import time import collections import json # Third party modul...
#!usr/bin/env python #=============================================================================== # Import modules #=============================================================================== # Standard Library import os import sys import datetime import time import collections import json # Third party modul...
Python
0.00011
2c939c104298166b16f3f20a27f7a325e146921b
update tests to reflect recent changes
test/test_bioconductor_skeleton.py
test/test_bioconductor_skeleton.py
import pytest from bioconda_utils import bioconductor_skeleton from bioconda_utils import cran_skeleton from bioconda_utils import utils import helpers utils.setup_logger('bioconda_utils', 'debug') env_matrix = helpers.tmp_env_matrix() config = { 'env_matrix': env_matrix, 'channels': ['bioconda', 'conda-fo...
import os from textwrap import dedent import subprocess as sp import logging import pytest from bioconda_utils import bioconductor_skeleton from bioconda_utils import cran_skeleton from bioconda_utils import utils import helpers utils.setup_logger('bioconda_utils', 'debug') def test_cran_write_recipe(tmpdir): ...
Python
0
e6c072aedfebfeacfe98ccf03385b90335e74f00
improve tests
testing/testSamplingAndPlotting.py
testing/testSamplingAndPlotting.py
import pandas as pd import numpy as np import pickle from matplotlib import pyplot as plt import GPflow from BranchedGP import VBHelperFunctions as bplot from BranchedGP import BranchingTree as bt from BranchedGP import branch_kernParamGPflow as bk import unittest from BranchedGP import FitBranchingModel class TestSam...
import pandas as pd import numpy as np import pickle from matplotlib import pyplot as plt import GPflow from BranchedGP import VBHelperFunctions as bplot from BranchedGP import BranchingTree as bt from BranchedGP import branch_kernParamGPflow as bk import unittest from BranchedGP import FitBranchingModel class TestSam...
Python
0.000016
5f3e659d2346e10138fb75b01239396b04ceec3f
Allow runserver to be executed from anywhere
contentdensity/contentdensity/settings.py
contentdensity/contentdensity/settings.py
""" Django settings for contentdensity project. Generated by 'django-admin startproject' using Django 1.11.3. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ im...
""" Django settings for contentdensity project. Generated by 'django-admin startproject' using Django 1.11.3. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ im...
Python
0
5389bd7b53e1ca2186c7bde06ffdf1c84ef6fd54
Add put_device method
devicehive/api.py
devicehive/api.py
from devicehive.api_unit import Info from devicehive.api_unit import Token from devicehive.api_unit import Device class Api(object): """Api class.""" def __init__(self, transport, authentication): self._transport = transport self._token = Token(transport, authentication) def authenticate...
from devicehive.api_unit import Info from devicehive.api_unit import Token from devicehive.api_unit import Device class Api(object): """Api class.""" def __init__(self, transport, authentication): self._transport = transport self._token = Token(transport, authentication) def authenticate...
Python
0.000006
0bc2a8ddae824a74ce443ffc120e3152641842d6
Added a filter method to dicts
app/soc/logic/dicts.py
app/soc/logic/dicts.py
#!/usr/bin/python2.5 # # Copyright 2008 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 applicable...
#!/usr/bin/python2.5 # # Copyright 2008 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 applicable...
Python
0.999999
5906946b0287536976f816884169e3a3c91df043
Add a verbose_name and help_text to the User.id Property.
app/soc/models/user.py
app/soc/models/user.py
#!/usr/bin/python2.5 # # Copyright 2008 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...
#!/usr/bin/python2.5 # # Copyright 2008 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.001817
b717696b5cff69e3586e06c399be7d06c057e503
Make spawn_n() stub properly ignore errors in the child thread work
nova/tests/fake_utils.py
nova/tests/fake_utils.py
# Copyright (c) 2013 Rackspace Hosting # # 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...
# Copyright (c) 2013 Rackspace Hosting # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Python
0.000006
1f65be1f67867fc445b692df0f9390d6aa576e02
Fix import in common/utils
manyfaced/common/utils.py
manyfaced/common/utils.py
import time import pickle from socket import error as socket_error from status import CLIENT_TIMEOUT def dump_file(data): try: with file('temp.db') as f: string_file = f.read() db = pickle.loads(string_file) except: db = list() db.append(data) with open('temp.db', ...
import time import pickle from socket import error as socket_error from manyfaced.common.status import CLIENT_TIMEOUT def dump_file(data): try: with file('temp.db') as f: string_file = f.read() db = pickle.loads(string_file) except: db = list() db.append(data) with...
Python
0.000022
8355340347f57db0796385c0700a91d61cb9b82a
Fix typos
scripts/guides_master.py
scripts/guides_master.py
KT_GUIDES_MASTER = { 'path': 'keras_tuner/', 'title': 'Hyperparameter Tuning', 'toc': True, 'children': [ { 'path': 'getting_started', 'title': 'Getting started with KerasTuner', }, { 'path': 'distributed_tuning', 'title': 'Distribu...
KT_GUIDES_MASTER = { 'path': 'keras_tuner/', 'title': 'Hyperparameter Tuning', 'toc': True, 'children': [ { 'path': 'getting_started', 'title': 'Getting started with KerasTuner', }, { 'path': 'distributed_tuning', 'title': 'Distribu...
Python
0.999999
03f99a79941ade157689534e7ed0d0d196dd4d56
fix grep command
scripts/logfetch/grep.py
scripts/logfetch/grep.py
import os import sys from termcolor import colored GREP_COMMAND_FORMAT = 'xargs -n {0} {1} < {2}' DEFAULT_GREP_COMMAND = 'grep --color=always \'{0}\'' def grep_files(args, all_logs): if args.grep: greplist_filename = '{0}/.greplist'.format(args.dest) create_greplist(args, all_logs, greplist_filename) co...
import os import sys from termcolor import colored GREP_COMMAND_FORMAT = 'xargs -n {0} {1} < {2}' DEFAULT_GREP_COMMAND = 'grep --color=always \'{1}\'' def grep_files(args, all_logs): if args.grep: greplist_filename = '{0}/.greplist'.format(args.dest) create_greplist(args, all_logs, greplist_filename) co...
Python
0.000609
90e74a04a0c398237e1e1f850715c70aec16cdaf
support for 'soft' button - only works when tempdisarmed
garage.py
garage.py
#!/usr/bin/python import serial import redis import pynma import time import os from config import * from shared import * wait_for_redis() ser = serial.Serial(SERIAL_PORT,9600,timeout=5) r = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT, db=0) p = pynma.PyNMA( r.get('prowl-api-key') ) ser.flushInput() def sen...
#!/usr/bin/python import serial import redis import pynma import time import os from config import * from shared import * wait_for_redis() ser = serial.Serial(SERIAL_PORT,9600,timeout=5) r = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT, db=0) p = pynma.PyNMA( r.get('prowl-api-key') ) ser.flushInput() def...
Python
0
c4bbe848f2e8f972423e766a42d1959df782f623
fix publisher for sending messages
oct/core/hq.py
oct/core/hq.py
from __future__ import print_function import zmq import time import json class HightQuarter(object): """The main hight quarter that will receive informations from the turrets and send the start message :param publish_port int: the port for publishing information to turrets :param rc_port int: the res...
from __future__ import print_function import zmq import time import json class HightQuarter(object): """The main hight quarter that will receive informations from the turrets and send the start message :param publish_port int: the port for publishing information to turrets :param rc_port int: the res...
Python
0.000001
3eea445a445a9154758cd82c11c52751f2804eca
add axis to 3d example
examples/tomo/xray_trafo_parallel_3d.py
examples/tomo/xray_trafo_parallel_3d.py
# Copyright 2014, 2015 The ODL development group # # This file is part of ODL. # # ODL is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
# Copyright 2014, 2015 The ODL development group # # This file is part of ODL. # # ODL is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
Python
0.00002
e76777897bed5b9396d126e384555ea230b35784
Use StaticFileStorage to determine source directories
sass_processor/apps.py
sass_processor/apps.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from django.apps import apps, AppConfig from django.conf import settings from django.core.files.storage import get_storage_class APPS_INCLUDE_DIRS = [] class SassProcessorConfig(AppConfig): name = 'sass_processor' verbose_name = "Sass...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from django.apps import apps, AppConfig APPS_INCLUDE_DIRS = [] class SassProcessorConfig(AppConfig): name = 'sass_processor' verbose_name = "Sass Processor" _static_dir = 'static' _sass_exts = ('.scss', '.sass') def ready...
Python
0.000001
25f12dacbd2d447ee2340aa0e18da4569bcc319e
disable libunwind on windows
scripts/pipeline_main.py
scripts/pipeline_main.py
#!/usr/bin/env python3 # Copyright 2020 Google LLC # # Licensed under the the Apache License v2.0 with LLVM Exceptions (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://llvm.org/LICENSE.txt # # Unless required by applicable law ...
#!/usr/bin/env python3 # Copyright 2020 Google LLC # # Licensed under the the Apache License v2.0 with LLVM Exceptions (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://llvm.org/LICENSE.txt # # Unless required by applicable law ...
Python
0
49b102159e47f0865f5a8790d341987b664cadf0
Add CLI test
numba/tests/test_help.py
numba/tests/test_help.py
from __future__ import print_function import sys import subprocess import types as pytypes import os.path import numpy as np from numba.six.moves import builtins from numba import types from .support import TestCase, temp_directory from numba.help.inspector import inspect_function, inspect_module class TestInspect...
from __future__ import print_function import types as pytypes import numpy as np from numba.six.moves import builtins from numba import types from .support import TestCase from numba.help.inspector import inspect_function, inspect_module class TestInspector(TestCase): def check_function_descriptor(self, info, ...
Python
0
81622074d2d7544b897cec196257b130904f06b7
Comment about JSON
firefox/src/py/extensionconnection.py
firefox/src/py/extensionconnection.py
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
Python
0.000001
b667bb6b463c8049fcc67d54d02ffbba2094823f
Fix test
numba/tests/test_help.py
numba/tests/test_help.py
from __future__ import print_function import sys import subprocess import types as pytypes import os.path import numpy as np from numba.six.moves import builtins from numba import types, utils from .support import TestCase, temp_directory from numba.help.inspector import inspect_function, inspect_module class Test...
from __future__ import print_function import sys import subprocess import types as pytypes import os.path import numpy as np from numba.six.moves import builtins from numba import types, utils from .support import TestCase, temp_directory from numba.help.inspector import inspect_function, inspect_module class Test...
Python
0.000004
b6b514d385e8e18d03b939cf5fae9873c9f02a21
add constraint for price_list_ite
netforce_product/netforce_product/models/price_list_item.py
netforce_product/netforce_product/models/price_list_item.py
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
Python
0.000005
699524032f9bbcae410637f66b762fb21b92d796
Use Crypto's pad function
CanvasSync/settings/cryptography.py
CanvasSync/settings/cryptography.py
""" CanvasSync by Mathias Perslev February 2017 -------------------------------------------- cryptography.py, module Functions used to encrypt and decrypt the settings stored in the .CanvasSync.settings file. When the user has specified settings the string of information is encrypted using the AES 256 module of the ...
""" CanvasSync by Mathias Perslev February 2017 -------------------------------------------- cryptography.py, module Functions used to encrypt and decrypt the settings stored in the .CanvasSync.settings file. When the user has specified settings the string of information is encrypted using the AES 256 module of the ...
Python
0.000015
577c0bff1e7333fe0f0fd5e45ce7c7cf19710605
Fix migration [WAL-904]
nodeconductor/structure/migrations/0052_customer_subnets.py
nodeconductor/structure/migrations/0052_customer_subnets.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-07 08:52 from __future__ import unicode_literals from django.db import migrations, models import nodeconductor.core.validators class Migration(migrations.Migration): dependencies = [ ('structure', '0051_add_customer_email_phone_agreement_nu...
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-07 08:52 from __future__ import unicode_literals from django.db import migrations, models import nodeconductor.core.validators class Migration(migrations.Migration): dependencies = [ ('structure', '0051_add_customer_email_phone_agreement_nu...
Python
0
f9a02492ca8f902ca349e60ce42dee4cadbd35c0
Make run under Python 2.4.
include/HFacer.py
include/HFacer.py
# HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface # definition file. # The header files are copied to a temporary file apart from the section between a //++Autogenerated # comment and a //--Autogenerated comment which is generated by the printHFile and printLexHFile # func...
# HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface # definition file. # The header files are copied to a temporary file apart from the section between a //++Autogenerated # comment and a //--Autogenerated comment which is generated by the printHFile and printLexHFile # func...
Python
0.000001
dea7ffe79e674315ff9b1f69f44b3c8b725697a0
use str instead of basestring
corehq/apps/hqadmin/management/commands/make_supervisor_conf.py
corehq/apps/hqadmin/management/commands/make_supervisor_conf.py
import json import os import sys from django.core.management.base import BaseCommand from django.conf import settings from django.template import Context, Template def parse_params(option, opt, value, parser): try: args_dict = json.loads(value) except ValueError: print "argument error, %s sho...
import json import os import sys from django.core.management.base import BaseCommand from django.conf import settings from django.template import Context, Template def parse_params(option, opt, value, parser): try: args_dict = json.loads(value) except ValueError: print "argument error, %s sho...
Python
0.000035
cbe38648644c63dc01a02f3ba6cbcac8eec45274
fix celerybeat
scrapy_joy/__init__.py
scrapy_joy/__init__.py
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import absolute_import import os, sys, django sys.path.append(os.path.dirname(os.path.dirname(__file__))) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "scrapy_joy.settings") ################################################## # add django-dynamic-scraper f...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import absolute_import import os, sys, django sys.path.append(os.path.dirname(os.path.dirname(__file__))) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "scrapy_joy.settings") django.setup() ################################################## # add django-dy...
Python
0.000128
41b4cb48de1e6db7b2cb95e893ea5ed981d49425
handle date object passed as argument
custom/icds_reports/management/commands/run_custom_data_pull.py
custom/icds_reports/management/commands/run_custom_data_pull.py
import os import zipfile from django.conf import settings from django.core.management.base import ( BaseCommand, CommandError, ) from django.db import connections from custom.icds_reports.const import CUSTOM_DATA_PULLS class Command(BaseCommand): help = "Dump data from a pre-defined query for ICDS data ...
import os import zipfile from django.conf import settings from django.core.management.base import ( BaseCommand, CommandError, ) from django.db import connections from custom.icds_reports.const import CUSTOM_DATA_PULLS class Command(BaseCommand): help = "Dump data from a pre-defined query for ICDS data ...
Python
0.000007
f399f8e4ae3fde706a404a7e18d182cd605ea97a
revert the 2 hdmi inputs (only hdmi_in1 working???)
opsis_video.py
opsis_video.py
#!/usr/bin/env python3 from opsis_base import * from litevideo.input import HDMIIn from litevideo.output import VideoOut base_cls = MiniSoC class VideoMixerSoC(base_cls): csr_peripherals = ( "hdmi_out0", "hdmi_out1", "hdmi_in0", "hdmi_in0_edid_mem", "hdmi_in1", "h...
#!/usr/bin/env python3 from opsis_base import * from litevideo.output import VideoOut base_cls = MiniSoC class VideoMixerSoC(base_cls): csr_peripherals = ( "hdmi_out0", "hdmi_out1" ) csr_map_update(base_cls.csr_map, csr_peripherals) def __init__(self, platform, **kwargs): ba...
Python
0