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
d3c2eb97d82b74abf3ac44f452a30c54d72a99b2
Bumped version number to 2.0.2alpha1
morfessor/__init__.py
morfessor/__init__.py
#!/usr/bin/env python """ Morfessor 2.0 - Python implementation of the Morfessor method """ import logging __all__ = ['MorfessorException', 'ArgumentException', 'MorfessorIO', 'BaselineModel', 'main', 'get_default_argparser', 'main_evaluation', 'get_evaluation_argparser'] __version__ = '2.0.2al...
#!/usr/bin/env python """ Morfessor 2.0 - Python implementation of the Morfessor method """ import logging __all__ = ['MorfessorException', 'ArgumentException', 'MorfessorIO', 'BaselineModel', 'main', 'get_default_argparser', 'main_evaluation', 'get_evaluation_argparser'] __version__ = '2.0.1' ...
Python
0.998853
d9044815f4034a51d27e4949ffcd153e253cc882
use double quotes
frappe/integrations/doctype/google_settings/test_google_settings.py
frappe/integrations/doctype/google_settings/test_google_settings.py
# -*- coding: utf-8 -*- # Copyright (c) 2021, Frappe Technologies and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest from .google_settings import get_file_picker_settings class TestGoogleSettings(unittest.TestCase): def setUp(self): settings = frappe.get_sing...
# -*- coding: utf-8 -*- # Copyright (c) 2021, Frappe Technologies and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest from .google_settings import get_file_picker_settings class TestGoogleSettings(unittest.TestCase): def setUp(self): settings = frappe.get_sing...
Python
0.000001
f83076f722d66ebc27d66bc13798d4e5bc9cc27a
Fix `TypeError: must use keyword argument for key function` on Python 3
scikits/image/transform/tests/test_hough_transform.py
scikits/image/transform/tests/test_hough_transform.py
import numpy as np from numpy.testing import * import scikits.image.transform as tf import scikits.image.transform.hough_transform as ht from scikits.image.transform import probabilistic_hough def append_desc(func, description): """Append the test function ``func`` and append ``description`` to its name. ...
import numpy as np from numpy.testing import * import scikits.image.transform as tf import scikits.image.transform.hough_transform as ht from scikits.image.transform import probabilistic_hough def append_desc(func, description): """Append the test function ``func`` and append ``description`` to its name. ...
Python
0.000409
c6f1ab2d33c31201c00435f336c7793b4ff8dd2a
Fix for docutils.error_reporting -> docutils.utils.error_reporting
notebook_sphinxext.py
notebook_sphinxext.py
import sys import os.path import re import time from docutils import io, nodes, statemachine, utils from docutils.utils.error_reporting import ErrorString from docutils.parsers.rst import Directive, convert_directive_function from docutils.parsers.rst import directives, roles, states from docutils.parsers.rst.roles imp...
import sys import os.path import re import time from docutils import io, nodes, statemachine, utils from docutils.error_reporting import ErrorString from docutils.parsers.rst import Directive, convert_directive_function from docutils.parsers.rst import directives, roles, states from docutils.parsers.rst.roles import se...
Python
0
15016615c5406a56468171ab55c0cc60797dc580
Check author is not NoneType, not author.name
reddit2kindle.py
reddit2kindle.py
import os from flask import Flask, request, jsonify from flask.templating import render_template import util import forms app = Flask(__name__) app.secret_key = os.urandom(24) forms.csrf.init_app(app) @app.route('/') def index(): post = forms.Submission() subreddit = forms.Subreddit() return render_te...
import os from flask import Flask, request, jsonify from flask.templating import render_template import util import forms app = Flask(__name__) app.secret_key = os.urandom(24) forms.csrf.init_app(app) @app.route('/') def index(): post = forms.Submission() subreddit = forms.Subreddit() return render_te...
Python
0.021749
f3cada11b253ceea129342040f7e3d75f4f0cf15
use assertions with the form elements in test_new instead of the regex on the html content
test_notes.py
test_notes.py
from webtest import TestApp import os import re import notes import dbaccessor DB = 'notes.db' class TestWebserver(): def test_index(self): dba = dbaccessor.DbAccessor(DB) dba.addNote('eins', 'lorem ipsum') dba.addNote('zwei', 'blabla') bottle = TestApp(notes.app) result ...
from webtest import TestApp import os import re import notes import dbaccessor DB = 'notes.db' class TestWebserver(): def test_index(self): dba = dbaccessor.DbAccessor(DB) dba.addNote('eins', 'lorem ipsum') dba.addNote('zwei', 'blabla') bottle = TestApp(notes.app) result ...
Python
0
77e3f0da9bec64c2bf0f34faec735a29f1a74284
remove test for Google+
tests/test.py
tests/test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from you_get import * from you_get.__main__ import url_to_module def test_urls(urls): for url in urls: url_to_module(url).download(url, info_only = True) class YouGetTests(unittest.TestCase): def test_freesound(self): test_ur...
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from you_get import * from you_get.__main__ import url_to_module def test_urls(urls): for url in urls: url_to_module(url).download(url, info_only = True) class YouGetTests(unittest.TestCase): def test_freesound(self): test_ur...
Python
0.00001
bbbd535ecabc6017aec6a3549c917d26036aff3b
Remove checks for testGotTrace unit test until trace event importer is implemented.
tools/telemetry/telemetry/core/chrome/tracing_backend_unittest.py
tools/telemetry/telemetry/core/chrome/tracing_backend_unittest.py
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import cStringIO import json import logging import os import unittest from telemetry.core import util from telemetry.core.chrome import tracing_backend ...
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import cStringIO import json import logging import os import unittest from telemetry.core import util from telemetry.core.chrome import tracing_backend ...
Python
0.000002
a440cef4140a4225fc093c9143d7cfd1a0c4e917
Update metric through API
biggraphite/cli/web/namespaces/biggraphite.py
biggraphite/cli/web/namespaces/biggraphite.py
#!/usr/bin/env python # Copyright 2018 Criteo # # 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 agree...
#!/usr/bin/env python # Copyright 2018 Criteo # # 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 agree...
Python
0
1dbb1e0f8751f37271178665a727c4eefc49a88c
Remove subclassing of exception, since there is only one.
partner_firstname/exceptions.py
partner_firstname/exceptions.py
# -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # 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 versio...
# -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # 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 versio...
Python
0
017889913a1dba443022ee032535bdc4cb40ddb6
Make nodepool git repo caching more robust
modules/openstack_project/files/nodepool/scripts/cache_git_repos.py
modules/openstack_project/files/nodepool/scripts/cache_git_repos.py
#!/usr/bin/env python # Copyright (C) 2011-2013 OpenStack Foundation # # 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 ...
#!/usr/bin/env python # Copyright (C) 2011-2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
Python
0.000122
fc3bd4b8f6ce1f688afa86975619b11f64e3cd02
Initialize BaseStaticSiteRenderer.client to None
django_medusa/renderers/base.py
django_medusa/renderers/base.py
from __future__ import print_function from django.conf import settings from django.test.client import Client __all__ = ['COMMON_MIME_MAPS', 'BaseStaticSiteRenderer'] # Since mimetypes.get_extension() gets the "first known" (alphabetically), # we get supid behavior like "text/plain" mapping to ".bat". This list # ove...
from __future__ import print_function from django.conf import settings from django.test.client import Client __all__ = ['COMMON_MIME_MAPS', 'BaseStaticSiteRenderer'] # Since mimetypes.get_extension() gets the "first known" (alphabetically), # we get supid behavior like "text/plain" mapping to ".bat". This list # ove...
Python
0.000022
ebfd3d465c376f0eb9eb664f93d6656b232c7867
Add 'styp' major brand to compatible brands, and make compatible_brands a set.
isobmff.py
isobmff.py
from base64 import b64encode import bitstring from bitstring import BitStream import json import struct def _to_json(o): if isinstance(o, bytes): try: return o.decode("ASCII") except: return b64encode(o) if isinstance(o, set): return list(o) return o.__dict_...
from base64 import b64encode import bitstring from bitstring import BitStream import json import struct def _to_json(o): if isinstance(o, bytes): try: return o.decode("ASCII") except: return b64encode(o) return o.__dict__ class Box(object): def __init__(self, type)...
Python
0
b0133c948555c821a9dcae1df4119a2bfcc19304
fix building
packages/dependencies/librubberband.py
packages/dependencies/librubberband.py
{ 'repo_type' : 'git', 'url' : 'https://github.com/breakfastquay/rubberband.git', 'download_header' : [ 'https://raw.githubusercontent.com/DeadSix27/python_cross_compile_script/master/additional_headers/ladspa.h', ], 'env_exports' : { 'AR': '{cross_prefix_bare}ar', 'CC': '{cross_prefix_bare}gcc', 'PREFIX':...
{ 'repo_type' : 'git', 'url' : 'https://github.com/breakfastquay/rubberband.git', 'download_header' : [ 'https://raw.githubusercontent.com/DeadSix27/python_cross_compile_script/master/additional_headers/ladspa.h', ], 'env_exports' : { 'AR' : '{cross_prefix_bare}ar', 'CC' : '{cross_prefix_bare}gcc', 'PREFIX...
Python
0.000003
a96cb89524f2fa17a015011d972d396e509a1079
Add code for getting and releasing a database connection
journal.py
journal.py
# -*- coding: utf-8 -*- from flask import Flask import os import psycopg2 from contextlib import closing from flask import g DB_SCHEMA = """ DROP TABLE IF EXISTS entries; CREATE TABLE entries ( id serial PRIMARY KEY, title VARCHAR (127) NOT NULL, text TEXT NOT NULL, created TIMESTAMP NOT NULL ) """ ...
# -*- coding: utf-8 -*- from flask import Flask import os import psycopg2 from contextlib import closing DB_SCHEMA = """ DROP TABLE IF EXISTS entries; CREATE TABLE entries ( id serial PRIMARY KEY, title VARCHAR (127) NOT NULL, text TEXT NOT NULL, created TIMESTAMP NOT NULL ) """ app = Flask(__name_...
Python
0
69705079398391cdc392b18dcd440fbc3b7404fd
Set celery to ignore results
celery_cgi.py
celery_cgi.py
import os import logging from celery import Celery from temp_config.set_environment import DeployEnv runtime_env = DeployEnv() runtime_env.load_deployment_environment() redis_server = os.environ.get('REDIS_HOSTNAME') redis_port = os.environ.get('REDIS_PORT') celery_tasks = [ 'hms_flask.modules.hms_controller', ...
import os import logging from celery import Celery from temp_config.set_environment import DeployEnv runtime_env = DeployEnv() runtime_env.load_deployment_environment() redis_server = os.environ.get('REDIS_HOSTNAME') redis_port = os.environ.get('REDIS_PORT') celery_tasks = [ 'hms_flask.modules.hms_controller', ...
Python
0
9bdc1dbc37a67d726f808e724b862e7de84fa06a
Change function name
changedate.py
changedate.py
""" Calcular Data a partir de uma quantidade de minutos """ def change_date(dataEnt, op, minutosEnt): """ Calcular nova data """ dataEnt, horaEnt = dataEnt.split(" ", 2) diaIni, mesIni, anoIni = dataEnt.split("/", 3) horaIni, minuIni = horaEnt.split(":", 2) # transformar tudo em minutos # con...
""" Calcular Data a partir de uma quantidade de minutos """ def alterar_data(dataEnt, op, minutosEnt): """ Calcular nova data """ dataEnt, horaEnt = dataEnt.split(" ", 2) diaIni, mesIni, anoIni = dataEnt.split("/", 3) horaIni, minuIni = horaEnt.split(":", 2) # transformar tudo em minutos # co...
Python
0.000092
a10729414971ee454276960fcc1a736c08b3aef7
Fix syntax error
corehq/tests/noseplugins/uniformresult.py
corehq/tests/noseplugins/uniformresult.py
r"""A plugin to format test names uniformly for easy comparison Usage: # collect django tests COLLECT_ONLY=1 ./manage.py test -v2 --settings=settings 2> tests-django.txt # collect nose tests ./manage.py test -v2 --collect-only 2> tests-nose.txt # clean up django test output: s/skipped\ \'.*\'$/o...
"""A plugin to format test names uniformly for easy comparison Usage: # collect django tests COLLECT_ONLY=1 ./manage.py test -v2 --settings=settings 2> tests-django.txt # collect nose tests ./manage.py test -v2 --collect-only 2> tests-nose.txt # clean up django test output: s/skipped\ \'.*\'$/ok...
Python
0.999991
50805c2da2889c13485096f53de27af27a06391a
Implement tree preorder traversal
all-domains/data-structures/trees/tree-order-traversal/solution.py
all-domains/data-structures/trees/tree-order-traversal/solution.py
# https://www.hackerrank.com/challenges/tree-preorder-traversal # Python 2 """ Node is defined as self.left (the left child of the node) self.right (the right child of the node) self.data (the value of the node) """ def preOrder(tree): if tree is None: return print(tree.data), return preOrder(tree.left) o...
# https://www.hackerrank.com/challenges/tree-preorder-traversal # Python 2 """ Node is defined as self.left (the left child of the node) self.right (the right child of the node) self.data (the value of the node) """ def preOrder(tree): if tree is None: return print(tree.data) return preOrder(tree.left) or ...
Python
0.000002
1097889524cf7deb4b87722d3aedd27c071117c1
Simplify exception logging in template render method.
app/soc/views/template.py
app/soc/views/template.py
#!/usr/bin/env python2.5 # # Copyright 2011 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 applic...
#!/usr/bin/env python2.5 # # Copyright 2011 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 applic...
Python
0
a6ed56b37bba3f5abff73c297a8a20271d73cab2
Add configure call to random_agent
example/random-agent/random-agent.py
example/random-agent/random-agent.py
#!/usr/bin/env python import argparse import logging import sys import gym import universe # register the universe environments from universe import wrappers logger = logging.getLogger() def main(): parser = argparse.ArgumentParser(description=None) parser.add_argument('-v', '--verbose', action='count', des...
#!/usr/bin/env python import argparse import logging import sys import gym import universe # register the universe environments from universe import wrappers logger = logging.getLogger() def main(): parser = argparse.ArgumentParser(description=None) parser.add_argument('-v', '--verbose', action='count', des...
Python
0.000001
cd23780fdc39003f2affe7352bc3253f958faaa5
Change assertion so it works with pytest (don't know what its problem is...)
src/zeit/content/cp/browser/tests/test_centerpage.py
src/zeit/content/cp/browser/tests/test_centerpage.py
import mock import zeit.cms.testing import zeit.content.cp import zope.testbrowser.testing class PermissionsTest(zeit.cms.testing.BrowserTestCase): layer = zeit.content.cp.testing.layer def setUp(self): super(PermissionsTest, self).setUp() zeit.content.cp.browser.testing.create_cp(self.brows...
import mock import zeit.cms.testing import zeit.content.cp import zope.testbrowser.testing class PermissionsTest(zeit.cms.testing.BrowserTestCase): layer = zeit.content.cp.testing.layer def setUp(self): super(PermissionsTest, self).setUp() zeit.content.cp.browser.testing.create_cp(self.brows...
Python
0
fed1475564f7ca8a496d50446e4e5924befe8628
Update function output type annotation
tensorflow/core/function/capture/free_vars_detect.py
tensorflow/core/function/capture/free_vars_detect.py
# Copyright 2022 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2022 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0.000007
cbfbc2dbeeb8a03cd96ef2756185099a9be9b714
Update data_provider_test.py
tensorflow_gan/examples/esrgan/data_provider_test.py
tensorflow_gan/examples/esrgan/data_provider_test.py
# coding=utf-8 # Copyright 2021 The TensorFlow GAN 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 applicabl...
# coding=utf-8 # Copyright 2021 The TensorFlow GAN 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 applicabl...
Python
0
ef0d0fa26bfd22c281c54bc348877afd0a7ee9d7
Use regex to match user metrics
tests/integration/blueprints/metrics/test_metrics.py
tests/integration/blueprints/metrics/test_metrics.py
""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import re import pytest # To be overridden by test parametrization @pytest.fixture def config_overrides(): return {} @pytest.fixture def client(admin_app, config_overrides, make_admin_app): app = make_admin...
""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import pytest # To be overridden by test parametrization @pytest.fixture def config_overrides(): return {} @pytest.fixture def client(admin_app, config_overrides, make_admin_app): app = make_admin_app(**conf...
Python
0.000006
e71bbe6dff52d7977332ee37ffa9df5505173a0c
Use sets like they should be, and finish up changes for the night
test_utils/management/commands/relational_dumpdata.py
test_utils/management/commands/relational_dumpdata.py
from django.core.management.base import BaseCommand, CommandError from django.core import serializers from optparse import make_option from django.db.models.fields.related import ForeignKey, ManyToManyField from django.db.models import get_app, get_apps, get_models def _relational_dumpdata(app, collected): object...
from django.core.management.base import BaseCommand, CommandError from django.core import serializers from optparse import make_option from django.db.models.fields.related import ForeignKey, ManyToManyField from django.db.models import get_app, get_apps, get_models def _relational_dumpdata(app, collected): object...
Python
0
cc1b63e76a88fd589bfe3fce2f6cbe5becf995bc
use no_backprop_mode
tests/links_tests/model_tests/vgg_tests/test_vgg16.py
tests/links_tests/model_tests/vgg_tests/test_vgg16.py
import unittest import numpy as np import chainer from chainer.initializers import Zero from chainer import testing from chainer.testing import attr from chainer import Variable from chainercv.links import VGG16 @testing.parameterize( {'pick': 'prob', 'shapes': (1, 200), 'n_class': 200}, {'pick': 'pool5', ...
import unittest import numpy as np from chainer.initializers import Zero from chainer import testing from chainer.testing import attr from chainer import Variable from chainercv.links import VGG16 @testing.parameterize( {'pick': 'prob', 'shapes': (1, 200), 'n_class': 200}, {'pick': 'pool5', 'shapes': (1, 5...
Python
0.000005
b635d3bb0a0de01539d66dda4555b306c59082ee
fix version number
constant2/__init__.py
constant2/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from ._constant2 import Constant except: # pragma: no cover pass __version__ = "0.0.10" __short_description__ = "provide extensive way of managing your constant variable." __license__ = "MIT" __author__ = "Sanhe Hu" __author_email__ = "husanhe@gmail.com" __m...
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from ._constant2 import Constant except: # pragma: no cover pass __version__ = "0.0.9" __short_description__ = "provide extensive way of managing your constant variable." __license__ = "MIT" __author__ = "Sanhe Hu" __author_email__ = "husanhe@gmail.com" __ma...
Python
0.000014
28b7b5f43d5206609f789a94c614d6811ae87cef
Fix call to resolve nick protection
txircd/modules/extra/services/account_nick_protect.py
txircd/modules/extra/services/account_nick_protect.py
from twisted.internet import reactor from twisted.plugin import IPlugin from txircd.config import ConfigValidationError from txircd.module_interface import IModuleData, ModuleData from txircd.utils import now from zope.interface import implements from weakref import WeakKeyDictionary from datetime import timedelta cla...
from twisted.internet import reactor from twisted.plugin import IPlugin from txircd.config import ConfigValidationError from txircd.module_interface import IModuleData, ModuleData from txircd.utils import now from zope.interface import implements from weakref import WeakKeyDictionary from datetime import timedelta cla...
Python
0
770c4fd0b282ee355d2ea3e662786113dd6b4e74
add 1.4.2 (#26472)
var/spack/repos/builtin/packages/py-nipype/package.py
var/spack/repos/builtin/packages/py-nipype/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyNipype(PythonPackage): """Neuroimaging in Python: Pipelines and Interfaces.""" home...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyNipype(PythonPackage): """Neuroimaging in Python: Pipelines and Interfaces.""" home...
Python
0.000001
63d4d37c9194aacd783e911452a34ca78a477041
add latest version 1.2.0 (#23528)
var/spack/repos/builtin/packages/py-vermin/package.py
var/spack/repos/builtin/packages/py-vermin/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) class PyVermin(PythonPackage): """Concurrently detect the minimum Python versions needed to run code.""" homepag...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) class PyVermin(PythonPackage): """Concurrently detect the minimum Python versions needed to run code.""" homepag...
Python
0
28c9c0349e0f86fbdee8a02b46386e42dbe702a2
fix conflict
oct_turrets/turret.py
oct_turrets/turret.py
import time import json import traceback from oct_turrets.base import BaseTurret from oct_turrets.canon import Canon class Turret(BaseTurret): """This class represent the classic turret for oct """ def init_commands(self): """Initialize the basics commandes for the turret """ sel...
import time import json from oct_turrets.base import BaseTurret from oct_turrets.canon import Canon class Turret(BaseTurret): """This class represent the classic turret for oct """ def init_commands(self): """Initialize the basics commandes for the turret """ self.commands['start...
Python
0.031708
c0627c6d8d11a9b9597b8fecd10b562d46a71521
Send fio results to fio.sc.couchbase.com
perfrunner/tests/fio.py
perfrunner/tests/fio.py
from collections import defaultdict import requests from logger import logger from perfrunner.helpers.misc import pretty_dict from perfrunner.helpers.remote import RemoteHelper from perfrunner.tests import PerfTest class FIOTest(PerfTest): TRACKER = 'fio.sc.couchbase.com' TEMPLATE = { 'group': '{}...
from collections import defaultdict from logger import logger from perfrunner.helpers.misc import pretty_dict from perfrunner.helpers.remote import RemoteHelper from perfrunner.tests import PerfTest class FIOTest(PerfTest): def __init__(self, cluster_spec, test_config, verbose): self.cluster_spec = clu...
Python
0
148b3db081ef85a6ac0e6d20a65fa05cdf005ad8
Allow editing of existing patches
Plist-To-Patch.py
Plist-To-Patch.py
import plistlib import os import sys import time script_path = os.path.dirname(os.path.realpath(__file__)) def create_patch(add_plist = {}, rem_plist = {}, desc = ""): new_plist = { "Add": add_plist, "Remove": rem_plist, "Description": desc } return new_plist def grab(prompt): if sys.version_...
import plistlib import os import sys import time script_path = os.path.dirname(os.path.realpath(__file__)) def create_patch(add, remove, description): if add == "": add_plist = {} else: add_plist = plistlib.readPlist(add) if remove == "": rem_plist = {} else: ...
Python
0
69038348a0e029d2b06c2753a0dec9b2552ed820
Add license header to __init__.py
openquake/__init__.py
openquake/__init__.py
""" OpenGEM is an open-source platform for the calculation of hazard, risk, and socio-economic impact. It is a project of the Global Earthquake Model, nd may be extended by other organizations to address additional classes of peril. For more information, please see the website at http://www.globalquakemodel.org Thi...
""" OpenGEM is an open-source platform for the calculation of hazard, risk, and socio-economic impact. It is a project of the Global Earthquake Model, nd may be extended by other organizations to address additional classes of peril. For more information, please see the website at http://www.globalquakemodel.org Thi...
Python
0.000018
9815f575f882ac54f4633a2899513dc492bd47e3
Update optimizeHyper.py
oppa/optimizeHyper.py
oppa/optimizeHyper.py
import numpy as np import math #from macs.learnMACSparam import run as learnMACparam from BayesianOptimization.bayes_opt.bayesian_optimization import BayesianOptimization #function for testing Bayesian optimization. def test_function(y): return (y-50)**2 def optimized_function(function, error, *param): """ ...
import numpy as np import math #from macs.learnMACSparam import run as learnMACparam from BayesianOptimization.bayes_opt.bayesian_optimization import BayesianOptimization #function for testing Bayesian optimization. def test_function(y): return (y-50)**2 def optimized_function(function, error, *param): """ ...
Python
0.000001
bab1ad914ab9273aa8ab905edef2578b5c760f31
add django installed apps init opps core
opps/core/__init__.py
opps/core/__init__.py
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from django.conf import settings trans_app_label = _('Opps') settings.INSTALLED_APPS += ('opps.article', 'opps.image', 'opps.channel', 'opps.source', 'redactor', 'tagging',) settings.REDACTOR_OPT...
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ trans_app_label = _('Opps')
Python
0
fdea91164a145474d0ce093420aeace592cc57a6
Update RESOURCE_TYPE_MAP and datacite format subjects
osf/metadata/utils.py
osf/metadata/utils.py
from website import settings SUBJECT_SCHEME = 'bepress Digital Commons Three-Tiered Taxonomy' RESOURCE_TYPE_MAP = { 'Audio/Video': 'Audiovisual', 'Dataset': 'Dataset', 'Image': 'Image', 'Model': 'Model', 'Software': 'Software', 'Book': 'Text', 'Funding Submission': 'Text', 'Journal Ar...
from website import settings SUBJECT_SCHEME = 'bepress Digital Commons Three-Tiered Taxonomy' RESOURCE_TYPE_MAP = { 'Audio/Video': 'Audiovisual', 'Dataset': 'Dataset', 'Image': 'Image', 'Model': 'Model', 'Software': 'Software', 'Book': 'Text', 'Funding Submission': 'Text', 'Journal Ar...
Python
0
ff60b8e2cb89e1c4d6c75af79d0199d142c6e2b4
fix TypeError: memoryview: a bytes-like object is required, not 'str'
ouimeaux/subscribe.py
ouimeaux/subscribe.py
from collections import defaultdict import logging from xml.etree import cElementTree from functools import partial import gevent from gevent.pywsgi import WSGIServer from ouimeaux.utils import get_ip_address, requests_request from ouimeaux.device.insight import Insight from ouimeaux.device.maker import Maker from ou...
from collections import defaultdict import logging from xml.etree import cElementTree from functools import partial import gevent from gevent.pywsgi import WSGIServer from ouimeaux.utils import get_ip_address, requests_request from ouimeaux.device.insight import Insight from ouimeaux.device.maker import Maker from ou...
Python
0.000294
f5275dba7285a97b05ac3abb756897ba75f119c5
remove execute permission
p038_conut_and_say.py
p038_conut_and_say.py
#!/usr/bin/python # -*- utf-8 -*- class Solution: def __init__(self, init='1'): self._list = [init] # @return a string def countAndSay(self, n): while len(self._list) < n: self._list.append(self.say(self._list[-1])) return self._list[n-1] @staticmethod def say(...
#!/usr/bin/python # -*- utf-8 -*- class Solution: def __init__(self, init='1'): self._list = [init] # @return a string def countAndSay(self, n): while len(self._list) < n: self._list.append(self.say(self._list[-1])) return self._list[n-1] @staticmethod def say(...
Python
0.000004
de29012d0bf48cf970ad37c62d7db960161f14c0
Remove unused stat import
core/dovecot/start.py
core/dovecot/start.py
#!/usr/bin/python3 import os import glob import multiprocessing import logging as log import sys from podop import run_server from socrate import system, conf log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def start_podop(): os.setuid(8) url = "http://" + os.environ["ADMI...
#!/usr/bin/python3 import os import stat import glob import multiprocessing import logging as log import sys from podop import run_server from socrate import system, conf log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def start_podop(): os.setuid(8) url = "http://" + os.e...
Python
0
b61c907a49e20da6148828aa512c86b58c0312c1
use the real index info in the sql pillow
corehq/pillows/sms.py
corehq/pillows/sms.py
from corehq.apps.change_feed import topics from corehq.apps.change_feed.consumer.feed import KafkaChangeFeed from corehq.elastic import get_es_new from corehq.apps.sms.models import SMSLog from corehq.pillows.mappings.sms_mapping import SMS_MAPPING, SMS_INDEX, SMS_META, SMS_TYPE from dimagi.utils.decorators.memoized im...
from corehq.apps.change_feed import topics from corehq.apps.change_feed.consumer.feed import KafkaChangeFeed from corehq.elastic import get_es_new from corehq.apps.sms.models import SMSLog from corehq.pillows.mappings.sms_mapping import SMS_MAPPING, SMS_INDEX, SMS_META, SMS_TYPE from dimagi.utils.decorators.memoized im...
Python
0
d48a0cb42aabf0c42debfddfcf09a8c2f954b9ff
Put project when create account.analytic.account for test.
purchase_line_with_delivery_service_info/tests/test_purchase_line_with_delivery_service_info.py
purchase_line_with_delivery_service_info/tests/test_purchase_line_with_delivery_service_info.py
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## import openerp.tests.common as common class TestPurchaseL...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## import openerp.tests.common as common class TestPurchaseL...
Python
0
6593fe983b40a5d4c467cb2ea0847e10e5faae1c
Update Beck_Pang_First_Python_practice_2.7.py
Coding_practice/Beck_Pang_First_Python_practice_2.7.py
Coding_practice/Beck_Pang_First_Python_practice_2.7.py
""" Beck Pang 25/07/2014 First practice project for our summer robotics team """ import random def name_to_number (name): # This helper function converts the string name into a number between 0 an 4 # pre: take a name in String as a parameter # post: return an represented number in integer if (name ==...
""" Beck Pang 25/07/2014 First practice project for our summer robotics team """ import random def name_to_number (name): # This helper function converts the string name into a number between 0 an 4 # pre: take a name in String as a parameter # post: return an represented number in integer if (name ==...
Python
0.000001
7ad0a248ab019c1c99080da5860ecba56f5a7654
switch to beautiful soup for extraction
ifind/common/position_content_extractor.py
ifind/common/position_content_extractor.py
#!/usr/bin/env python # -*- coding: latin-1 -*- __author__ = 'rose' from BeautifulSoup import BeautifulSoup from copy import deepcopy class PositionContentExtractor(object): def __init__(self, div_ids=None): self.div_ids = div_ids self.html = '' self.html_soup = None self.text = ...
#!/usr/bin/env python # -*- coding: latin-1 -*- __author__ = 'rose' from BeautifulSoup import BeautifulSoup from copy import deepcopy class PositionContentExtractor(object): def __init__(self, div_ids=None): self.div_ids = div_ids self.html = '' self.html_soup = None self.text = ...
Python
0
157a5b7350928eab13170da7e0c06636ae1e9975
Add option to load instrumentation key from env
applicationinsights/flask/ext.py
applicationinsights/flask/ext.py
from os import getenv from applicationinsights import TelemetryClient from applicationinsights.channel import AsynchronousSender from applicationinsights.channel import AsynchronousQueue from applicationinsights.channel import TelemetryChannel from applicationinsights.logging import LoggingHandler from applicationinsi...
from applicationinsights import TelemetryClient from applicationinsights.channel import AsynchronousSender from applicationinsights.channel import AsynchronousQueue from applicationinsights.channel import TelemetryChannel from applicationinsights.logging import LoggingHandler from applicationinsights.requests import WS...
Python
0
8483de37aad2256266deb404ce4d9eaae31a8142
Remove backend
kaggle-classification/keras_trainer/rnn.py
kaggle-classification/keras_trainer/rnn.py
"""RNN""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from keras.layers import Input, GRU, Dense, Embedding, Dropout, Bidirectional, TimeDistributed, Multiply, Flatten, Reshape, Dot from keras.models import Model from keras_trainer import base_model fro...
"""RNN""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from keras.layers import Input, GRU, Dense, Embedding, Dropout, Bidirectional, TimeDistributed, Multiply, Flatten, Reshape, Dot from keras.models import Model from keras_trainer import base_model fro...
Python
0.000001
fa022cf128f16e97aad4670cbb87b9178744e0d8
Add unittest for page size=1 & page chunck size=1
kboard/core/tests/test_utils_pagination.py
kboard/core/tests/test_utils_pagination.py
from django.core.paginator import Paginator from django.test import TestCase from core.utils import get_pages_nav_info class TestUtilsPagiation(TestCase): def get_pages_nav_info(PAGE_SIZE, NAV_PAGE_CHUNK_SIZE, TEST_LOAD_PAGE, OBJS_SIZE): object_list = range(OBJS_SIZE) paginator = Paginator(objec...
from django.core.paginator import Paginator from django.test import TestCase from core.utils import get_pages_nav_info class TestUtilsPagiation(TestCase): def get_pages_nav_info(PAGE_SIZE, NAV_PAGE_CHUNK_SIZE, TEST_LOAD_PAGE, OBJS_SIZE): object_list = range(OBJS_SIZE) paginator = Paginator(objec...
Python
0
1075b77abfbd04238a95c4b3e070c80fb141ab8b
Rename get_view() to get_view_method() for clarity.
incuna_test_utils/testcases/integration.py
incuna_test_utils/testcases/integration.py
from django.core.exceptions import ImproperlyConfigured from django.shortcuts import render from .request import BaseRequestTestCase class BaseIntegrationTestCase(BaseRequestTestCase): """ A TestCase that operates similarly to a Selenium test. Contains methods that access pages and render them to string...
from django.core.exceptions import ImproperlyConfigured from django.shortcuts import render from .request import BaseRequestTestCase class BaseIntegrationTestCase(BaseRequestTestCase): """ A TestCase that operates similarly to a Selenium test. Contains methods that access pages and render them to string...
Python
0
4bda6769c5e6a01e8a62b06ad310dc846fbc7cbf
fix an error handling bug I introduced
core/dbt/task/base.py
core/dbt/task/base.py
from abc import ABCMeta, abstractmethod import os import six from dbt.config import RuntimeConfig, Project from dbt.config.profile import read_profile, PROFILES_DIR from dbt import flags from dbt import tracking from dbt.logger import GLOBAL_LOGGER as logger import dbt.exceptions class NoneConfig(object): @clas...
from abc import ABCMeta, abstractmethod import os import six from dbt.config import RuntimeConfig, Project from dbt.config.profile import read_profile, PROFILES_DIR from dbt import flags from dbt import tracking from dbt.logger import GLOBAL_LOGGER as logger import dbt.exceptions class NoneConfig(object): @clas...
Python
0.000002
7fd0ed0897ffedf117698502cdefac0436ac4f2c
remove MotechTab import
corehq/tabs/config.py
corehq/tabs/config.py
from corehq.apps.styleguide.tabs import SGExampleTab, SimpleCrispyFormSGExample, \ ControlsDemoSGExample from corehq.tabs.tabclasses import DashboardTab, ProjectReportsTab, ProjectInfoTab, SetupTab, \ ProjectDataTab, ApplicationsTab, CloudcareTab, MessagingTab, ProjectUsersTab, \ AdminTab, IndicatorAdminTab...
from corehq.apps.styleguide.tabs import SGExampleTab, SimpleCrispyFormSGExample, \ ControlsDemoSGExample from corehq.tabs.tabclasses import DashboardTab, ProjectReportsTab, ProjectInfoTab, SetupTab, \ ProjectDataTab, ApplicationsTab, CloudcareTab, MessagingTab, ProjectUsersTab, \ AdminTab, IndicatorAdminTab...
Python
0
0185a30a340fae956c0e5b9d9f354e56e2e2178a
update the wsgi file
crate_project/wsgi.py
crate_project/wsgi.py
import os import sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "apps"))) import newrelic.agent newrelic.agent.initialize() from django.core.wsgi import get_wsgi_application application = get_wsgi_application()
import newrelic.agent newrelic.agent.initialize() import pinax.env from django.core.wsgi import get_wsgi_application # setup the environment for Django and Pinax pinax.env.setup_environ(__file__) # set application for WSGI processing application = get_wsgi_application()
Python
0
a0fab69d12d64d4e5371fcb26a4ec70365a76fa6
Move task results database to data dir
cref/app/web/tasks.py
cref/app/web/tasks.py
from celery import Celery from cref.app.terminal import run_cref app = Celery( 'tasks', backend='db+sqlite:///data/results.sqlite', broker='amqp://guest@localhost//' ) @app.task def predict_structure(sequence, params={}): return run_cref(sequence)
from celery import Celery from cref.app.terminal import run_cref app = Celery( 'tasks', backend='db+sqlite:///results.sqlite', broker='amqp://guest@localhost//' ) @app.task def predict_structure(sequence, params={}): return run_cref(sequence)
Python
0.000004
6e287393ad87ad09f94f845d372b5835ad4ebaba
Increase plot range
examples/alpha250-4/adc-bram/test.py
examples/alpha250-4/adc-bram/test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import os import time from adc_bram import AdcBram from koheron import connect import matplotlib matplotlib.use('TKAgg') from matplotlib import pyplot as plt from matplotlib.lines import Line2D host = os.getenv('HOST', '192.168.1.50') client = connect(...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import os import time from adc_bram import AdcBram from koheron import connect import matplotlib matplotlib.use('TKAgg') from matplotlib import pyplot as plt from matplotlib.lines import Line2D host = os.getenv('HOST', '192.168.1.50') client = connect(...
Python
0.000001
63b828983b38eb00e68683c19c51f444102a030d
support p3k on python file
plugin/vim_bootstrap_updater.py
plugin/vim_bootstrap_updater.py
import os try: import urllib2 import urllib except ImportError: import urllib.request as urllib2 import urllib.parse as urllib def vimrc_path(editor): return os.path.expanduser('~/.%src' % editor) def _generate_vimrc(editor, langs): params = [('langs', l.strip()) for l in langs] params.a...
import os import urllib import urllib2 def vimrc_path(editor): return os.path.expanduser('~/.%src' % editor) def _generate_vimrc(editor, langs): params = [('langs', l.strip()) for l in langs] params.append(('editor', editor)) data = urllib.urlencode(params) resp = urllib2.urlopen("https://vim-bo...
Python
0
5851c7524e66cfe3ee7e59542224d097d6e01f9e
Remove 's' in path.
mojo/public/tools/download_archiecture_independent_frameworks.py
mojo/public/tools/download_archiecture_independent_frameworks.py
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import os import sys CURRENT_PATH = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(CURREN...
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import os import sys CURRENT_PATH = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(CURREN...
Python
0.000005
ff16e993beca5ff0aa490bb140a46e64d026a6c9
Fix task banner with 'actionable' callback when using templates in name (#38165)
lib/ansible/plugins/callback/actionable.py
lib/ansible/plugins/callback/actionable.py
# (c) 2015, Andrew Gaffney <andrew@agaffney.org> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' callba...
# (c) 2015, Andrew Gaffney <andrew@agaffney.org> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' callba...
Python
0
ce70c151a8cbc70526e125f829a1fafdf390e9a7
Make scalars is_active short circuit if apt (#621)
tensorboard/plugins/scalar/scalars_plugin.py
tensorboard/plugins/scalar/scalars_plugin.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0.000001
900d872d4d1f8a593f25ac982e48ac86660955fd
Store name unique
bazaar/listings/models.py
bazaar/listings/models.py
from __future__ import unicode_literals from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from ..fields import MoneyField from ..goods.models import Product @python_2_unicode_compatible class Listing(models.Model): title = models.CharFie...
from __future__ import unicode_literals from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from ..fields import MoneyField from ..goods.models import Product @python_2_unicode_compatible class Listing(models.Model): title = models.CharFie...
Python
0.999952
19df232461679b3156f9d5889d59f095e0b97d60
Add CAN_DETECT
bears/yml/RAMLLintBear.py
bears/yml/RAMLLintBear.py
from coalib.bearlib.abstractions.Linter import linter from coalib.bears.requirements.NpmRequirement import NpmRequirement @linter(executable='ramllint', output_format='regex', output_regex=r'(?P<severity>error|warning|info).*\n (?P<message>.+) ' r'\[(?P<origin>.+)\]') class RAMLL...
from coalib.bearlib.abstractions.Linter import linter from coalib.bears.requirements.NpmRequirement import NpmRequirement @linter(executable='ramllint', output_format='regex', output_regex=r'(?P<severity>error|warning|info).*\n (?P<message>.+) ' r'\[(?P<origin>.+)\]') class RAMLL...
Python
0.998251
d399f1910df7a14b9f2f36ef1d08cb7bdb839781
Revise to t_char_count_d and comments
lc0076_minimum_window_substring.py
lc0076_minimum_window_substring.py
"""Leetcode 76. Minimum Window Substring Hard URL: https://leetcode.com/problems/minimum-window-substring/ Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). Example: Input: S = "ADOBECODEBANC", T = "ABC" Output: "BANC" Note: - If there is no...
"""Leetcode 76. Minimum Window Substring Hard URL: https://leetcode.com/problems/minimum-window-substring/ Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). Example: Input: S = "ADOBECODEBANC", T = "ABC" Output: "BANC" Note: - If there is no...
Python
0.000001
9513011caa73cbfa4aec2b96070f482466dde490
Fix urlshorten output
plugins/internet/url.py
plugins/internet/url.py
# -*- coding: utf-8 -*- import bot from html.parser import HTMLParser class LinksParser(HTMLParser): def __init__(self): HTMLParser.__init__(self) self.recording = 0 self.data = [] def handle_starttag(self, tag, attributes): if tag != 'title': return if se...
# -*- coding: utf-8 -*- import bot from html.parser import HTMLParser class LinksParser(HTMLParser): def __init__(self): HTMLParser.__init__(self) self.recording = 0 self.data = [] def handle_starttag(self, tag, attributes): if tag != 'title': return if se...
Python
0.999998
824a2a547218febf61aed8d99eff5ddeeaf6f5ca
Remove unused imports
polyaxon/libs/models.py
polyaxon/libs/models.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from django.db import models from django.core.cache import cache class DescribableModel(models.Model): description = models.TextField(blank=True, null=True) class Meta: abstract = True class DiffModel(models.M...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from django.core.validators import validate_slug from django.db import models from django.core.cache import cache from libs.blacklist import validate_blacklist_name class DescribableModel(models.Model): description = models...
Python
0.000001
814cc6cef757c3eef775240c749a098b1288eef3
Enable searching for an image in the admin
pombola/images/admin.py
pombola/images/admin.py
from django.contrib import admin from django.contrib.contenttypes.generic import GenericTabularInline from sorl.thumbnail import get_thumbnail from sorl.thumbnail.admin import AdminImageMixin from pombola.images import models class ImageAdmin(AdminImageMixin, admin.ModelAdmin): list_display = [ 'thumbnail',...
from django.contrib import admin from django.contrib.contenttypes.generic import GenericTabularInline from sorl.thumbnail import get_thumbnail from sorl.thumbnail.admin import AdminImageMixin from pombola.images import models class ImageAdmin(AdminImageMixin, admin.ModelAdmin): list_display = [ 'thumbnail',...
Python
0
6f0fddaad968078fd65ed25f81a3d8345d7924fb
Update Application Commands
kdr/cli.py
kdr/cli.py
import click import cli_syncthing_adapter CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) @click.version_option() @click.group( epilog="Run 'kdr COMMAND --help' for more information on a command.", context_settings=CONTEXT_SETTINGS #add_help_option=False, #options_metavar="\b", ) @click....
import click import cli_syncthing_adapter CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) @click.version_option() @click.group( epilog="Run 'kdr COMMAND --help' for more information on a command.", context_settings=CONTEXT_SETTINGS #add_help_option=False, #options_metavar="\b", ) @click....
Python
0
c99d5d30a698aafe3e554c48c9a47dd8be1a5575
Use imap instead of map
library.py
library.py
import json import logging import os import subprocess import urllib import grequests import numpy logging.basicConfig() logger = logging.getLogger("recheck") logger.setLevel(logging.DEBUG) def get_change_ids(repo_path, subtree=None, since="6.months"): """Return array of change-Ids of merged patches. retur...
import json import logging import os import subprocess import urllib import grequests import numpy logging.basicConfig() logger = logging.getLogger("recheck") logger.setLevel(logging.DEBUG) def get_change_ids(repo_path, subtree=None, since="6.months"): """Return array of change-Ids of merged patches. retur...
Python
0
b0f5913d5f775062b8d5e253e1403b995b67c81a
Bump to version 3.2.0
post_office/__init__.py
post_office/__init__.py
VERSION = (3, 2, 0) from .backends import EmailBackend default_app_config = 'post_office.apps.PostOfficeConfig'
VERSION = (3, 2, 0, 'dev') from .backends import EmailBackend default_app_config = 'post_office.apps.PostOfficeConfig'
Python
0
f28732596487a2a0fc664c5444e618ce5c23eccd
fix usage
bin/extract_darkmatter.py
bin/extract_darkmatter.py
#!/usr/bin/env python import argparse import leveldb import os import shutil import sys from Bio import SeqIO def main(args): parser = argparse.ArgumentParser(description="Script to extract darkmatter - predicted proteins with no similarities") parser.add_argument("-i", "--input", dest="input", help="Name of ...
#!/usr/bin/env python import argparse import leveldb import os import shutil import sys from Bio import SeqIO def main(args): parser = argparse.ArgumentParser(description="Script to extract darkmatter - predicted proteins with no similarities") parser.add_argument("-i", "--input", help="Name of input genecall...
Python
0.000002
f93e23db1d5cedbdc75ef6b412f52f8b3800a270
use more versatile valueByTag mechanism
applications/plugins/RigidScale/python/RigidScale/sml.py
applications/plugins/RigidScale/python/RigidScale/sml.py
import Sofa import RigidScale.API import SofaPython.sml import Compliant.StructuralAPI import Compliant.sml printLog = True def insertRigidScale(parentNode, solidModel, param): """ create a RigidScale.API.ShearlessAffineBody from the solidModel """ if printLog: Sofa.msg_info("RigidScale.sml", "ins...
import Sofa import RigidScale.API import SofaPython.sml import Compliant.StructuralAPI import Compliant.sml printLog = True def insertRigidScale(parentNode, solidModel, param): """ create a RigidScale.API.ShearlessAffineBody from the solidModel """ if printLog: Sofa.msg_info("RigidScale.sml", "ins...
Python
0
a5857bc5b019dda8baca03bd68f08b4a26a85911
add import module in init file.
biokit/rtools/__init__.py
biokit/rtools/__init__.py
from .rtools import *
Python
0
5ac8d6824a53c05ac233c9dcaf7d39171bafed31
add params to the grid
fedoracommunity/mokshaapps/demos/controllers/root.py
fedoracommunity/mokshaapps/demos/controllers/root.py
# This file is part of Fedora Community. # 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) ...
# This file is part of Fedora Community. # 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) ...
Python
0.000001
ca856016d54e4ca19c9b6701f2a4f1061bfb2fda
Wrong column name
printer_tray/printer.py
printer_tray/printer.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
Python
0.890483
1a2f3f74a398422fe70d6b482cdd779f728e9a21
add 'continue' lines, change print to logging
scripts/migrations/034-update_subscriptions_ticket_and_mr_titles.py
scripts/migrations/034-update_subscriptions_ticket_and_mr_titles.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (t...
# 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 (t...
Python
0.000001
94a07652c23f55a20f856550a1ceed549b6b8cd7
Updated the expected matching strings.
test/global_variables/TestGlobalVariables.py
test/global_variables/TestGlobalVariables.py
"""Show global variables and check that they do indeed have global scopes.""" import os, time import unittest2 import lldb from lldbtest import * class GlobalVariablesTestCase(TestBase): mydir = "global_variables" @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_...
"""Show global variables and check that they do indeed have global scopes.""" import os, time import unittest2 import lldb from lldbtest import * class GlobalVariablesTestCase(TestBase): mydir = "global_variables" @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_...
Python
0.999999
8599480ed93a0117f326689280c7a896d6bf697a
add version 3.1-4 to r-bayesm (#20807)
var/spack/repos/builtin/packages/r-bayesm/package.py
var/spack/repos/builtin/packages/r-bayesm/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RBayesm(RPackage): """Bayesian Inference for Marketing/Micro-Econometrics Covers many...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RBayesm(RPackage): """Bayesian Inference for Marketing/Micro-Econometrics""" homepage...
Python
0
52e0f47a3ff67bd0c8a31c6755b384dedd70ee02
update scalasca to latest version, simplify recipe (#11999)
var/spack/repos/builtin/packages/scalasca/package.py
var/spack/repos/builtin/packages/scalasca/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Scalasca(AutotoolsPackage): """Scalasca is a software tool that supports the performance ...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Scalasca(AutotoolsPackage): """Scalasca is a software tool that supports the performance ...
Python
0
8ffe530025e38d06ffc567fb69e9b96874db3faa
Increase version
conveyor/__init__.py
conveyor/__init__.py
__version__ = "0.1.dev3"
__version__ = "0.1.dev2"
Python
0
ce537832eb3d1c0a7ceec213abe1d52c189037c2
fix a bug in the controller of new courses
course_controller.py
course_controller.py
import os import urllib from google.appengine.api import users from google.appengine.ext import ndb import jinja2 import webapp2 import main_controller import app.models.course_model as coursemodel JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions=...
import os import urllib from google.appengine.api import users from google.appengine.ext import ndb import jinja2 import webapp2 import main_controller import app.models.course_model as coursemodel JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions=...
Python
0
20d5f5d5e10dcf118639b4ca538ef7537863145a
add cache 2 hours
dv_apps/dvobject_api/views_dataverses.py
dv_apps/dvobject_api/views_dataverses.py
import json from collections import OrderedDict from django.shortcuts import render from django.http import Http404 from django.conf import settings from django.http import JsonResponse, HttpResponse from django.template.loader import render_to_string from django.forms.models import model_to_dict from django.views.de...
import json from collections import OrderedDict from django.shortcuts import render from django.http import Http404 from django.conf import settings from django.http import JsonResponse, HttpResponse from django.template.loader import render_to_string from django.forms.models import model_to_dict from django.views.de...
Python
0
4e515f070f844569b84eeb77f7e7eda883bc861e
fix class name
easy_my_coop/wizard/update_share_line.py
easy_my_coop/wizard/update_share_line.py
# -*- coding: utf-8 -*- from openerp import api, fields, models, _ from openerp.exceptions import UserError class ShareLineUpdateInfo(models.TransientModel): _name = "share.line.update.info" @api.model def _get_share_line(self): active_id = self.env.context.get('active_id') return self.e...
# -*- coding: utf-8 -*- from openerp import api, fields, models, _ from openerp.exceptions import UserError class PartnerUpdateInfo(models.TransientModel): _name = "share.line.update.info" @api.model def _get_share_line(self): active_id = self.env.context.get('active_id') return self.env...
Python
0.000051
38db4b0a23e2c2aaf858d0b2bd9d5ae4df819e66
Move imports in mythicbeastsdns component (#28033)
homeassistant/components/mythicbeastsdns/__init__.py
homeassistant/components/mythicbeastsdns/__init__.py
"""Support for Mythic Beasts Dynamic DNS service.""" from datetime import timedelta import logging import mbddns import voluptuous as vol from homeassistant.const import ( CONF_DOMAIN, CONF_HOST, CONF_PASSWORD, CONF_SCAN_INTERVAL, ) from homeassistant.helpers.aiohttp_client import async_get_clientsess...
"""Support for Mythic Beasts Dynamic DNS service.""" import logging from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.const import ( CONF_DOMAIN, CONF_HOST, CONF_PASSWORD, CONF_SCAN_INTERVAL, ) from homeassistant.helpers.aio...
Python
0
5616573372638f2b195714cf02db8a7a02a4678f
Correct column name
luigi/tasks/rfam/pgload_go_term_mapping.py
luigi/tasks/rfam/pgload_go_term_mapping.py
# -*- coding: utf-8 -*- """ Copyright [2009-2017] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless requir...
# -*- coding: utf-8 -*- """ Copyright [2009-2017] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless requir...
Python
0
1f3325519a72cb98669185149b03b11c1ec25f70
Fix line number convention
bears/c_languages/CPPLintBear.py
bears/c_languages/CPPLintBear.py
import sys from coalib.bearlib.abstractions.Linter import linter from dependency_management.requirements.PipRequirement import PipRequirement from coalib.settings.Setting import typed_list @linter(executable='cpplint', normalize_line_numbers=True, use_stdout=False, use_stderr=True, ou...
import sys from coalib.bearlib.abstractions.Linter import linter from dependency_management.requirements.PipRequirement import PipRequirement from coalib.settings.Setting import typed_list @linter(executable='cpplint', use_stdout=False, use_stderr=True, output_format='regex', output_r...
Python
0
58c6868cc95a44100f18f20dfe91764727263005
Write bytes to fobj if we open it in 'wb' mode
django_babel/management/commands/babel.py
django_babel/management/commands/babel.py
# -*- coding: utf-8 -*- import os from distutils.dist import Distribution from optparse import make_option from subprocess import call from django.core.management.base import LabelCommand, CommandError from django.conf import settings class Command(LabelCommand): args = '[makemessages] [compilemessages]' o...
# -*- coding: utf-8 -*- import os from distutils.dist import Distribution from optparse import make_option from subprocess import call from django.core.management.base import LabelCommand, CommandError from django.conf import settings class Command(LabelCommand): args = '[makemessages] [compilemessages]' o...
Python
0.000001
99e0b2e29ec5baa525dce54a3bfcf69710f5a59b
Fix UserProfile creation
accounts/models.py
accounts/models.py
from django.conf import settings from django.db import transaction from django.db.models.signals import post_save from django.contrib.sites.models import RequestSite from django.contrib.auth.models import User from django.db import models from registration import models as regmodels from registration.signals i...
from django.conf import settings from django.db import transaction from django.db.models.signals import post_save from django.contrib.sites.models import RequestSite from django.contrib.auth.models import User from django.db import models from registration import models as regmodels from registration.signals i...
Python
0.000006
df7e5f56fdb2a9bc34a0fdf62b5847ee4183d32e
Update import_gist.py
lib/import_gist/bin/import_gist.py
lib/import_gist/bin/import_gist.py
#!/usr/bin/env python # -*- coding: utf-8 -*- def import_gist(url_gist): ''' import custom functions from gist.github.com usage: mod_name = import_gist(url_gist) params: url_gist: url of gist. be sure to append '/raw/' to the gist url to load script, not html e.g. https://gist.githubuser...
#!/usr/bin/env python # -*- coding: utf-8 -*- def import_gist(url_gist): ''' import custom functions from gist.github.com usage: mod_name = import_gist(url_gist) params: url_gist: url of gist. be sure to append '/raw/' to the gist url to load script, not html e.g. https://gist.githubuser...
Python
0.000001
7ef1afc579c62fa0c713d8db0bf17eb09b498a0b
Add unittest for random_integers
tests/cupy_tests/random_tests/test_sample.py
tests/cupy_tests/random_tests/test_sample.py
import mock import unittest from cupy import cuda from cupy import testing from cupy import random @testing.gpu class TestRandint(unittest.TestCase): _multiprocess_can_split_ = True def setUp(self): device_id = cuda.Device().id self.m = mock.Mock() self.m.interval.return_value = 0 ...
import mock import unittest from cupy import cuda from cupy import testing from cupy import random @testing.gpu class TestRandint(unittest.TestCase): _multiprocess_can_split_ = True def setUp(self): device_id = cuda.Device().id self.m = mock.Mock() self.m.interval.return_value = 0 ...
Python
0.000013
5aa2a3e4b724784bbedaa5a436893e5ce28f7c45
Bump version to 0.2.3
fluentcms_emailtemplates/__init__.py
fluentcms_emailtemplates/__init__.py
# following PEP 440 __version__ = "0.2.3"
# following PEP 440 __version__ = "0.2.2"
Python
0.000001
eda0e5d60ca30a284c0b6b4fc209e595b5484941
Fix _import_from() on Python 2
dev/_import.py
dev/_import.py
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import imp import sys import os from . import build_root, package_name, package_root if sys.version_info < (3,): getcwd = os.getcwdu else: getcwd = os.getcwd def _import_from(mod, path, mod_dir=None, allow_er...
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import imp import sys import os from . import build_root, package_name, package_root if sys.version_info < (3,): getcwd = os.getcwdu else: getcwd = os.getcwd def _import_from(mod, path, mod_dir=None, allow_er...
Python
0.997305
64ae848095215715ea7448c517011d64403dee85
Remove useless import
geotrek/api/mobile/views/trekking.py
geotrek/api/mobile/views/trekking.py
from __future__ import unicode_literals from django.conf import settings from django.db.models import F from geotrek.api.mobile.serializers import trekking as api_serializers from geotrek.api.mobile import viewsets as api_viewsets from geotrek.api.v2.functions import Transform, Length, StartPoint from geotrek.trekkin...
from __future__ import unicode_literals from django.conf import settings from django.db.models import F from rest_framework_extensions.mixins import DetailSerializerMixin from geotrek.api.mobile.serializers import trekking as api_serializers from geotrek.api.mobile import viewsets as api_viewsets from geotrek.api.v2...
Python
0.000004
ee487dd220612dfff9cb5e63c602490371e2bdac
Update repo_metadata.py
gitmostwanted/tasks/repo_metadata.py
gitmostwanted/tasks/repo_metadata.py
from gitmostwanted.app import app, db, celery from gitmostwanted.models.repo import Repo, RepoMean from gitmostwanted.lib.github import api from sqlalchemy.sql import func, expression from datetime import datetime, timedelta @celery.task() def metadata_maturity(num_months): repos = Repo.query\ .filter(Rep...
from gitmostwanted.app import app, db, celery from gitmostwanted.models.repo import Repo, RepoMean from gitmostwanted.lib.github import api from sqlalchemy.sql import func, expression from datetime import datetime, timedelta @celery.task() def metadata_maturity(num_months): repos = Repo.query\ .filter(Rep...
Python
0.000002
6105e355cf0275e00f284ac6658454905a9b9a07
change import of tfpark
python/chronos/src/bigdl/chronos/forecaster/tfpark_forecaster.py
python/chronos/src/bigdl/chronos/forecaster/tfpark_forecaster.py
# # Copyright 2018 Analytics Zoo Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
# # Copyright 2018 Analytics Zoo Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
Python
0
60ecc08395eb266f09aa8587bf38aceb59a2b968
Update Scramble_String.py
Array/Scramble_String.py
Array/Scramble_String.py
""" Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representation of s1 = "great": great / \ gr eat / \ / \ g r e at / \ a t To scramble the string, we may choose any non-leaf nod...
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representation of s1 = "great": great / \ gr eat / \ / \ g r e at / \ a t To scramble the string, we may choose any non-leaf node an...
Python
0.000002
04def6c69d5ee35edb1b2d7d2d10f7aa18b2eb47
Move fermi activation flag out of route mapper.
palm/blink_factory.py
palm/blink_factory.py
import numpy from palm.base.model_factory import ModelFactory from palm.blink_model import BlinkModel from palm.blink_state_enumerator import SingleDarkState, DoubleDarkState,\ SingleDarkStateEnumeratorFactory,\ DoubleDarkStateEnumeratorFac...
import numpy from palm.base.model_factory import ModelFactory from palm.blink_model import BlinkModel from palm.blink_state_enumerator import SingleDarkState, DoubleDarkState,\ SingleDarkStateEnumeratorFactory,\ DoubleDarkStateEnumeratorFac...
Python
0
f89f170aa8d672a891547ed7ac77d806cda697c4
Update TestWebserver.py
emission/tests/netTests/TestWebserver.py
emission/tests/netTests/TestWebserver.py
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import # Standard imports from future import standard_library standard_library.install_aliases() from builtins import * import unittest import json import sys import os import ...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import # Standard imports from future import standard_library standard_library.install_aliases() from builtins import * import unittest import json import sys import os import ...
Python
0.000001
37e8452ad999f42746be395d193a306f9a893dbf
Update rpc.py
ncclient/operations/third_party/juniper/rpc.py
ncclient/operations/third_party/juniper/rpc.py
from ncclient.xml_ import * from ncclient.operations.rpc import RPC from ncclient.operations.rpc import RPCReply from ncclient.operations.rpc import RPCError class GetConfiguration(RPC): def request(self, format='xml', filter=None): node = new_ele('get-configuration', {'format':format}) if filter ...
from ncclient.xml_ import * from ncclient.operations.rpc import RPC from ncclient.operations.rpc import RPCReply from ncclient.operations.rpc import RPCError class GetConfiguration(RPC): def request(self, format='xml', filter=None): node = new_ele('get-configuration', {'format':format}) if filter ...
Python
0.000001
8fc2ace83f7c25d5245f0496c3e52adcc2fd71c7
Fix typo in ResolverNode move alias.
tfx/components/common_nodes/resolver_node.py
tfx/components/common_nodes/resolver_node.py
# Lint as: python2, python3 # Copyright 2019 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 req...
# Lint as: python2, python3 # Copyright 2019 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 req...
Python
0.999044
3c33b9d7ea3736329d3e0939b042db08e6365eb5
Move experiments to ``experiments`` module
dallinger/version.py
dallinger/version.py
"""Dallinger version number.""" __version__ = "2.7.0"
"""Dallinger version number.""" __version__ = "3.0.0a1"
Python
0.000007
0516ca2a5bfaa162a44f407c13b55ca9487897fe
refresh group/keywords every hour
hortiradar/database/tasks_workers.py
hortiradar/database/tasks_workers.py
from configparser import ConfigParser from time import time from redis import StrictRedis import ujson as json from keywords import get_frog, get_keywords from selderij import app from tasks_master import insert_tweet keywords = get_keywords() keywords_sync_time = time() config = ConfigParser() config.read("tasks_...
from configparser import ConfigParser from redis import StrictRedis import ujson as json from keywords import get_frog, get_keywords from selderij import app from tasks_master import insert_tweet keywords = get_keywords() config = ConfigParser() config.read("tasks_workers.ini") posprob_minimum = config["workers"]....
Python
0
2ec6aa75d80dce2dc68d1369173b9a361864409b
update save()
alogator/models.py
alogator/models.py
from django.db import models from django.core.mail import send_mail from django.utils import timezone class LogActor(models.Model): email = models.CharField(max_length=100, blank=True, null=True, help_text='Alogator will send a messages to this email address.') active = mo...
from django.db import models from django.core.mail import send_mail from django.utils import timezone class LogActor(models.Model): email = models.CharField(max_length=100, blank=True, null=True, help_text='Alogator will send a messages to this email address.') active = mo...
Python
0