commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
7e45baa3e2b372d5a81dce656781879c0408bcc1 | Fix overlapping text | almarklein/scikit-image,SamHames/scikit-image,michaelaye/scikit-image,Midafi/scikit-image,juliusbierk/scikit-image,chintak/scikit-image,chriscrosscutler/scikit-image,robintw/scikit-image,paalge/scikit-image,youprofit/scikit-image,blink1073/scikit-image,bennlich/scikit-image,juliusbierk/scikit-image,oew1v07/scikit-image... | doc/examples/plot_equalize.py | doc/examples/plot_equalize.py | """
======================
Histogram Equalization
======================
This examples enhances an image with low contrast, using a method called
*histogram equalization*, which "spreads out the most frequent intensity
values" in an image [1]_. The equalized image has a roughly linear cumulative
distribution function.... | """
======================
Histogram Equalization
======================
This examples enhances an image with low contrast, using a method called
*histogram equalization*, which "spreads out the most frequent intensity
values" in an image [1]_. The equalized image has a roughly linear cumulative
distribution function.... | bsd-3-clause | Python |
0611d3452d5f752e28bbcb39452a7433bfb4eb5d | remove unused import | chicagopython/chipy.org,chicagopython/chipy.org,agfor/chipy.org,agfor/chipy.org,agfor/chipy.org,chicagopython/chipy.org,chicagopython/chipy.org | chipy_org/urls.py | chipy_org/urls.py | from django.conf import settings
from django.conf.urls import url, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.generic import TemplateView
from chipy_org.apps.contact.views import ChipyContactView
from chipy_org.apps.meetings.views impo... | from django.conf import settings
from django.conf.urls import patterns, url, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.generic import TemplateView
from chipy_org.apps.contact.views import ChipyContactView
from chipy_org.apps.meetings.... | mit | Python |
0f8e2337556832889b400b8f570390eca0a51817 | Update license metadata | PyCQA/astroid | astroid/__pkginfo__.py | astroid/__pkginfo__.py | # Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014-2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2015-2017 Ceridwen <ceridwenv@gmail.com>
# Copyright (c) 2015 Florian Bruhin <me@the-compiler.org>
# Copyright (c) 2015 Radosław Ga... | # Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014-2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2015-2017 Ceridwen <ceridwenv@gmail.com>
# Copyright (c) 2015 Florian Bruhin <me@the-compiler.org>
# Copyright (c) 2015 Radosław Ga... | lgpl-2.1 | Python |
ced3b9ab9f9a78acec10b2c0f6527659e9956398 | Use Django's copy of six | sgaist/django-haystack,elishowk/django-haystack,django-searchstack/django-searchstack,barseghyanartur/django-haystack,dionysio/django-haystack,cyanut/django-haystack,blancltd/django-haystack,eventials/django-haystack,django-searchstack/django-searchstack,celerityweb/django-haystack,blancltd/django-haystack,kuanyui/djan... | haystack/management/commands/clear_index.py | haystack/management/commands/clear_index.py | from __future__ import print_function
from __future__ import unicode_literals
from optparse import make_option
import sys
from django.core.management.base import BaseCommand
from django.utils import six
class Command(BaseCommand):
help = "Clears out the search index completely."
base_options = (
make... | from __future__ import print_function
from __future__ import unicode_literals
from optparse import make_option
import sys
import six
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Clears out the search index completely."
base_options = (
make_option('--noinput... | bsd-3-clause | Python |
84b569bd6f30d23547593f7a38d77145b25b20e7 | add setting, but doesn't seem to work | avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf | src/python/expedient/clearinghouse/commands/management/commands/bootstrap_local_settings.py | src/python/expedient/clearinghouse/commands/management/commands/bootstrap_local_settings.py | '''Command to bootstrap local settings with None values.
Created on Aug 24, 2010
@author: jnaous
'''
from optparse import make_option
import pkg_resources
import os
from django.core.management.base import NoArgsCommand
from django.conf import settings
from expedient.clearinghouse.commands.utils import bootstrap_local... | '''Command to bootstrap local settings with None values.
Created on Aug 24, 2010
@author: jnaous
'''
from optparse import make_option
import pkg_resources
import os
from django.core.management.base import NoArgsCommand
from django.conf import settings
from expedient.clearinghouse.commands.utils import bootstrap_local... | bsd-3-clause | Python |
188d6f7884b372fa0bc21f938dae9da386795da7 | Bump release | Calysto/octave_kernel,Calysto/octave_kernel | octave_kernel/__init__.py | octave_kernel/__init__.py | """An Octave kernel for Jupyter"""
__version__ = '0.19.7'
| """An Octave kernel for Jupyter"""
__version__ = '0.19.6'
| bsd-3-clause | Python |
4c3aff7bf33d876646eb538c8338a5f9ed063a44 | fix syntax | jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab | jupyterlab/_version.py | jupyterlab/_version.py | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from collections import namedtuple
VersionInfo = namedtuple('VersionInfo', [
'major',
'minor',
'micro',
'releaselevel',
'serial'
])
# DO NOT EDIT THIS DIRECTLY! It is managed by bumpversion
__ver... | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from collections import namedtuple
VersionInfo = namedtuple('VersionInfo', [
'major',
'minor',
'micro',
'releaselevel',
'serial'
])
# DO NOT EDIT THIS DIRECTLY! It is managed by bumpversion
__ver... | bsd-3-clause | Python |
b0ca54aa590c15ee4a33fb120b77a99b646d391a | Update read_html_file.py | gwu-business/salad-system-py,gwu-business/salad-system-py | software/read_html_file.py | software/read_html_file.py | # to run from root dir: `python software/read_html_file.py`
import code # to debug: `code.interact(local=locals())`
import os
from bs4 import BeautifulSoup
#
# READ HTML FILE
#
menu_dot_html = os.path.abspath(__file__).replace(os.path.relpath(__file__), "menu-items/index.html")
print "READING HTML FILE -- %(file_na... | # to run from root dir: `python software/read_html_file.py`
# source: https://wiki.python.org/moin/MiniDom
import code # to debug: `code.interact(local=locals())`
import os
from bs4 import BeautifulSoup
#
# READ HTML FILE
#
menu_dot_html = os.path.abspath(__file__).replace(os.path.relpath(__file__), "menu-items/inde... | mit | Python |
8478643d1826c7ee84da1cbe2846fb17beb2ec0f | revise my_func.py | adleff/python_ansible | class2/my_func.py | class2/my_func.py | #!/usr/bin/env python
# make a function that prints 'hello'
def my_func():
print 'hello'
def main():
my_func()
if __name__ == "__main__":
main()
| #!/usr/bin/env python
# make a function that prints 'hello'
def my_func():
print 'hello'
if __name__ == "__main__":
my_func()
| apache-2.0 | Python |
96cd690c399cd0c3f7d5b6a2add8a75bd7461c28 | remove napoleon_use_admonition_for_notes | cmeeren/apexpy,cmeeren/apexpy | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon'
]
if os.getenv('SPELLCHECK'):
extensions += 'sphinxcontrib.spelling',
spelling_show_suggestions = True
spel... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon'
]
if os.getenv('SPELLCHECK'):
extensions += 'sphinxcontrib.spelling',
spelling_show_suggestions = True
spel... | mit | Python |
2c91438c182562f69927037bd8c0192502ce07b5 | add support for telnet | sk2/autonetkit | autonetkit/ank_pika.py | autonetkit/ank_pika.py | import autonetkit.config as config
import autonetkit.log as log
import socket
use_rabbitmq = config.settings['Rabbitmq']['active']
if use_rabbitmq:
import pika
use_message_pipe = config.settings['Message Pipe']['active']
if use_message_pipe:
import telnetlib
#TODO: tidy this to be a try/except ImportError
#... | import autonetkit.config as config
import autonetkit.log as log
use_rabbitmq = config.settings['Rabbitmq']['active']
if use_rabbitmq:
import pika
#TODO: tidy this to be a try/except ImportError
#import pika.log
#pika.log.setup(pika.log.DEBUG, color=True)
class AnkPika(object):
def __init__(self, host):
... | bsd-3-clause | Python |
0d161e09baa174e3dee972c9069a484a5a272117 | Remove \'_static\' from docs build | numberoverzero/bloop,numberoverzero/bloop | docs/conf.py | docs/conf.py | import sys
import alabaster
extensions = [
'alabaster',
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon'
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'bloop'
copyright = '2015, Joe Cross'
author = 'Joe Cross'
import pkg_resources
try:
... | import sys
import alabaster
extensions = [
'alabaster',
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon'
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'bloop'
copyright = '2015, Joe Cross'
author = 'Joe Cross'
import pkg_resources
try:
... | mit | Python |
859f93891e4bf47d02899f03f0620fd1f29ca224 | Fix generate_sample_data.py - bug from #2978 | CZCV/s-dilation-caffe,wangg12/caffe,wangg12/caffe,tackgeun/caffe,CZCV/s-dilation-caffe,gnina/gnina,tackgeun/caffe,CZCV/s-dilation-caffe,gnina/gnina,gnina/gnina,tackgeun/caffe,gnina/gnina,tackgeun/caffe,wangg12/caffe,gnina/gnina,wangg12/caffe,CZCV/s-dilation-caffe,gnina/gnina | src/caffe/test/test_data/generate_sample_data.py | src/caffe/test/test_data/generate_sample_data.py | """
Generate data used in the HDF5DataLayer and GradientBasedSolver tests.
"""
import os
import numpy as np
import h5py
script_dir = os.path.dirname(os.path.abspath(__file__))
# Generate HDF5DataLayer sample_data.h5
num_cols = 8
num_rows = 10
height = 6
width = 5
total_size = num_cols * num_rows * height * width
da... | """
Generate data used in the HDF5DataLayer and GradientBasedSolver tests.
"""
import os
import numpy as np
import h5py
script_dir = os.path.dirname(os.path.abspath(__file__))
# Generate HDF5DataLayer sample_data.h5
num_cols = 8
num_rows = 10
height = 6
width = 5
total_size = num_cols * num_rows * height * width
da... | agpl-3.0 | Python |
d52d0942831ada869a37cc30f018428b1e9481c5 | Add published date to the admin page for the episodes | matachi/sputnik,matachi/sputnik,matachi/sputnik,matachi/sputnik | podcasts/admin.py | podcasts/admin.py | from django.contrib import admin
from django.contrib.messages import constants
import socket
from podcasts.models import Podcast, Episode, PodcastUserProfile, Tag, Category
class EpisodeInline(admin.StackedInline):
model = Episode
extra = 1
def update_podcast(modeladmin, request, queryset):
for podcast... | from django.contrib import admin
from django.contrib.messages import constants
import socket
from podcasts.models import Podcast, Episode, PodcastUserProfile, Tag, Category
class EpisodeInline(admin.StackedInline):
model = Episode
extra = 1
def update_podcast(modeladmin, request, queryset):
for podcast... | mit | Python |
0acceec5bae916550ec0da40d2108b4e478cdb7a | fix isjsonnet error | kubespray/kpm,ant31/kpm,ant31/kpm,ant31/kpm,ant31/kpm | kpm/commands/remove.py | kpm/commands/remove.py | from kpm.utils import parse_cmdline_variables
import kpm.deploy
from kpm.commands.deploy import DeployCmd
class RemoveCmd(DeployCmd):
name = 'remove'
help_message = "remove a package from kubernetes"
def _call(self):
variables = None
if self.variables is not None:
variables = ... | from kpm.utils import parse_cmdline_variables
import kpm.deploy
from kpm.commands.deploy import DeployCmd
class RemoveCmd(DeployCmd):
name = 'remove'
help_message = "remove a package from kubernetes"
def _call(self):
variables = None
if self.variables is not None:
variables = ... | apache-2.0 | Python |
cf98f7b8a0c8104d0830d9acab85f07047738cff | Update for docs/ | wwunlp/sner | docs/conf.py | docs/conf.py | import os
import sys
sys.path.append(os.path.abspath('../sner'))
project = 'SNER'
author = 'WWUNLP SNER Team'
copyright = '2017, ' + author
release = '0.1.1'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon'
]
source_suffix = '.rst'
master_doc = 'index'
pygments_style = 'sphinx'
html_theme = 'alaba... | import os
import sys
sys.path.append(os.path.abspath('..'))
project = 'SNER'
author = 'WWUNLP SNER Team'
copyright = '2017, ' + author
release = '0.1.1'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon'
]
source_suffix = '.rst'
master_doc = 'index'
pygments_style = 'sphinx'
html_theme = 'alabaster'... | mit | Python |
a2b1dc11dc4a845f16567388672aa5d51292c9e2 | Bump event grid module version | yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli | src/command_modules/azure-cli-eventgrid/setup.py | src/command_modules/azure-cli-eventgrid/setup.py | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ----------------------------------------------... | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ----------------------------------------------... | mit | Python |
370f9a77a973bd6557a702f4f2f4bc82f940fc3a | Bump version to 0.1.1 | bopo/django-taggit-serializer,pombredanne/django-taggit-serializer,glemmaPaul/django-taggit-serializer | taggit_serializer/__init__.py | taggit_serializer/__init__.py | __version__ = '0.1.1' | __version__ = '0.1.0' | bsd-3-clause | Python |
f19d0cbcb5cb94b4813fbba5cb47a9e4b5a81374 | add few corrections | adriaaah/monit-dashboard,adriaaah/monit-dashboard,adriaaah/monit-dashboard | bin/monit-dashboard.py | bin/monit-dashboard.py | #!/usr/bin/python
import web
import requests
import xmltodict
import json
import os
import sys
import datetime
from collections import OrderedDict
from operator import itemgetter
urls = ('/', 'index',
'/help', 'help'
)
app = web.application(urls, globals())
render = web.template.render('templates/', ... | #!/usr/bin/python
import web
import requests
import xmltodict
import json
import os
import sys
import datetime
from collections import OrderedDict
from operator import itemgetter
urls = ('/', 'index',
'/help', 'help'
)
app = web.application(urls, globals())
render = web.template.render('templates/', ... | agpl-3.0 | Python |
90c1c0f257b1b26d3a4c6b081cbfe5d61d9e31d2 | refactor commonmark test | miyuchina/mistletoe,miyuchina/mistletoe | test/commonmark/commonmark.py | test/commonmark/commonmark.py | import json
import mistletoe
from pprint import pprint
from traceback import print_tb
def run_tests(test_entries, runnable):
return [run_test(test_entry, runnable) for test_entry in test_entries]
def run_test(test_entry, runnable):
test_case = test_entry['markdown'].splitlines(keepends=True)
try:
... | SKIPPED_TESTS = {}
def run_tests(test_entries, runnable):
return [run_test(test_entry, runnable) for test_entry in test_entries
if test_entry['example'] not in SKIPPED_TESTS]
def run_test(test_entry, runnable):
test_case = test_entry['markdown'].splitlines(keepends=True)
try:
output ... | mit | Python |
8940e5be1e5fbf30ccdf5327777b993b7f0b0a1f | add type | ClaudiaSaxer/PlasoScaffolder | src/plasoscaffolder/bll/mappings/init_mapping.py | src/plasoscaffolder/bll/mappings/init_mapping.py | # -*- coding: utf-8 -*-
""" Module representing function for the different files """
from plasoscaffolder.bll.mappings.mapping_helper import render_template
def get_formatter_init_create(plugin_name: str) -> str:
"""
renders formatter init if you want to create new init file
:param plugin_name: the plugin name
... | # -*- coding: utf-8 -*-
""" Module representing function for the different files """
from plasoscaffolder.bll.mappings.mapping_helper import render_template
def get_formatter_init_create(plugin_name: str) -> str:
"""
renders formatter init if you want to create new init file
:param plugin_name: the plugin name
... | apache-2.0 | Python |
9144ef537e61fe0e1d5ff81243e899fad42ce1c1 | update lutin naming | generic-library/lua,generic-library/lua,generic-library/lua | lutin_lua.py | lutin_lua.py | #!/usr/bin/python
# --------------------------------------------------------
# -- Linear Math librairy
# --------------------------------------------------------
import lutinModule as module
import lutinTools as tools
def get_desc():
return "Lua Lua interpretic script module"
def create(target):
myModule = module.... | #!/usr/bin/python
# --------------------------------------------------------
# -- Linear Math librairy
# --------------------------------------------------------
import lutinModule
import lutinTools
def Create(target):
myModule = lutinModule.module(__file__, 'lua', 'LIBRARY')
myModule.AddModuleDepend('etk')
myM... | mit | Python |
1570fe173cc3eb9acdbe8ebec88f50f3e9c81f7f | test fixed | turippj/turip-manifest,turippj/turip-manifest,turippj/turip-manifest | main_test.py | main_test.py | import sys
import unittest
sys.path.append('/home/travis/google-cloud-sdk/platform/google_appengine')
from google.appengine.ext import testbed
from google.appengine.ext import ndb
from google.appengine.api import search
import webapp2
import main
class TestHandlers(unittest.TestCase):
def setUp(self):
sel... | import sys
import unittest
sys.path.append('/home/travis/google-cloud-sdk/platform/google_appengine')
from google.appengine.ext import testbed
from google.appengine.ext import ndb
import webapp2
import main
class TestHandlers(unittest.TestCase):
def setUp(self):
self.testbed = testbed.Testbed()
se... | mit | Python |
ebd16d5d2554796630de871b6c6ec1aa66f5ad37 | Clarify the missing information. | ridibooks/lightweight-rest-tester,ridibooks/lightweight-rest-tester | rest_tester/setting/target.py | rest_tester/setting/target.py | from .api import API
from .tests import Tests
class TestTarget(object):
KEY_API = 'api'
KEY_TESTS = 'tests'
def __init__(self, json_data):
try:
self._api = API(json_data[self.KEY_API])
self._tests = Tests(json_data[self.KEY_TESTS])
except KeyError as e:
... | from .api import API
from .tests import Tests
class TestTarget(object):
KEY_API = 'api'
KEY_TESTS = 'tests'
def __init__(self, json_data):
try:
self._api = API(json_data[self.KEY_API])
self._tests = Tests(json_data[self.KEY_TESTS])
except KeyError:
rais... | mit | Python |
c940747eba6aa6d5eb4c9e0108efdb155fc9dcaa | Fix for Python 2.6. | scikit-hep/scikit-hep | tests/math/test_kinematics.py | tests/math/test_kinematics.py | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license, see LICENSE.
"""
Tests for the skhep.math.kinematics module.
"""
# -----------------------------------------------------------------------------
# Import statements
# -----------------------------------------------------------------------------
impor... | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license, see LICENSE.
"""
Tests for the skhep.math.kinematics module.
"""
# -----------------------------------------------------------------------------
# Import statements
# -----------------------------------------------------------------------------
impor... | bsd-3-clause | Python |
64086acee22cfc2dde2fec9da1ea1b7745ce3d85 | Remove useless test about model representation | cgwire/zou | tests/misc/test_base_model.py | tests/misc/test_base_model.py | # -*- coding: UTF-8 -*-
from tests.base import ApiDBTestCase
class BaseModelTestCase(ApiDBTestCase):
def test_query(self):
pass
def test_get(self):
pass
def test_get_by(self):
pass
def test_get_all_by(self):
pass
def test_create(self):
pass
def tes... | # -*- coding: UTF-8 -*-
from tests.base import ApiDBTestCase
class BaseModelTestCase(ApiDBTestCase):
def test_repr(self):
self.generate_fixture_project_status()
self.generate_fixture_project()
self.assertEqual(str(self.project), "<Project %s>" % self.project.name)
def test_query(self... | agpl-3.0 | Python |
82dcc4d41fb76621475f56650bdd53e1e3d2263e | Return 1 on failure | nbigaouette/sorting,nbigaouette/sorting,nbigaouette/sorting,nbigaouette/sorting | profiling/plot.py | profiling/plot.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import glob
import re
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
if len(sys.argv) == 1:
print('Usage: plot.py path/to/build/profiling')
sys.exit(1)
csv_files = glob.glob(os.path.join(sys.argv[1], '*.csv'))
fig = plt.figure()
ax = ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import glob
import re
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
if len(sys.argv) == 1:
print('Usage: plot.py path/to/build/profiling')
sys.exit(0)
csv_files = glob.glob(os.path.join(sys.argv[1], '*.csv'))
fig = plt.figure()
ax = ... | bsd-3-clause | Python |
93daf0b40505dceae41e8977ca416d3f6c878de7 | Disable negative timestamp tests on windows #20 | antidot/Pyckson | tests/test_arrow_formatter.py | tests/test_arrow_formatter.py | import os
from datetime import datetime, date
from pyckson.dates.arrow import ArrowStringFormatter, ArrowTimestampFormatter
def test_parse_string_datetimes():
formatter = ArrowStringFormatter()
assert formatter.parse_datetime('2013-05-05 12:30:45') == datetime(2013, 5, 5, 12, 30, 45)
assert formatter.pa... | from datetime import datetime, date
from pyckson.dates.arrow import ArrowStringFormatter, ArrowTimestampFormatter
def test_parse_string_datetimes():
formatter = ArrowStringFormatter()
assert formatter.parse_datetime('2013-05-05 12:30:45') == datetime(2013, 5, 5, 12, 30, 45)
assert formatter.parse_date('... | lgpl-2.1 | Python |
7000e89828ec82f8e5c26c39ac290cb329036e17 | Test Cache root level dictionary update via apply_changes | dls-controls/pymalcolm,dls-controls/pymalcolm,dls-controls/pymalcolm | tests/test_core/test_cache.py | tests/test_core/test_cache.py | import os
import sys
import unittest
from collections import OrderedDict
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
# import logging
# logging.basicConfig(level=logging.DEBUG)
import setup_malcolm_paths
from mock import MagicMock
# module imports
from malcolm.core.cache import Cache
class TestP... | import os
import sys
import unittest
from collections import OrderedDict
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
# import logging
# logging.basicConfig(level=logging.DEBUG)
import setup_malcolm_paths
from mock import MagicMock
# module imports
from malcolm.core.cache import Cache
class TestP... | apache-2.0 | Python |
5feb6b02755ce2958ed57a3cef13a10e2e04bc3f | simplify self.users | ecreall/dace | dace/testing.py | dace/testing.py | import unittest
from pyramid.config import Configurator
from pyramid.testing import DummyRequest
from pyramid import testing
from substanced.db import root_factory
from substanced.principal import User
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config =... | import unittest
from pyramid.config import Configurator
from pyramid.testing import DummyRequest
from pyramid import testing
from substanced.db import root_factory
from substanced.principal import User
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config =... | agpl-3.0 | Python |
6ac987a608a35ab6109a61ac543092bb9d3ac102 | Remove log entry | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/utils/win_powershell.py | salt/utils/win_powershell.py | # -*- coding: utf-8 -*-
'''
Common functions for working with powershell
'''
# Import Python libs
from __future__ import absolute_import
import logging
import os
log = logging.getLogger(__name__)
__virtualname__ = 'powershell'
def __virtual__():
'''
Load only on Windows
'''
if not salt.utils.is_wind... | # -*- coding: utf-8 -*-
'''
Common functions for working with powershell
'''
# Import Python libs
from __future__ import absolute_import
import logging
import os
log = logging.getLogger(__name__)
__virtualname__ = 'powershell'
def __virtual__():
'''
Load only on Windows
'''
if not salt.utils.is_wind... | apache-2.0 | Python |
ee54c907c79a7f71072ad40bdc278f9ee48eb77a | Test now usesdownload_testdata() | castelao/pyARGO | tests/test_profile_from_nc.py | tests/test_profile_from_nc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from argo.argo import profile_from_nc
from argo.utils import download_testdata
datafile = download_testdata('20150127_prof.nc')
def validate_profile(p):
assert hasattr(p, 'keys')
assert hasattr(p, 'attributes')
assert 'datetime' in p.attributes
de... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from argo.argo import profile_from_nc
def validate_profile(p):
assert hasattr(p, 'keys')
assert hasattr(p, 'attributes')
assert 'datetime' in p.attributes
def test_extract_1_profile():
pp = profile_from_nc('test_data/20150127_prof.nc', 0)
... | bsd-3-clause | Python |
4080dd6bb3e0a0ba5e5bf34229a000a1e3925cfe | Use asynchronous calls in Strip tool | fluendo/cerbero,fluendo/cerbero,fluendo/cerbero,fluendo/cerbero,fluendo/cerbero | cerbero/tools/strip.py | cerbero/tools/strip.py | #!/usr/bin/env python3
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free S... | #!/usr/bin/env python3
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free S... | lgpl-2.1 | Python |
d4cfd743b235e0113618afa2415c807ea3485498 | Add test functionality to mysql_database state | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/states/mysql_database.py | salt/states/mysql_database.py | '''
MySQL Database Management
=========================
The mysql_database module is used to create and manage MySQL databases, databases can be set
as either absent or present
.. code-block:: yaml
frank:
mysql_database:
- present
'''
def present(name):
'''
Ensure that the named database is... | '''
MySQL Database Management
=========================
The mysql_database module is used to create and manage MySQL databases, databases can be set
as either absent or present
.. code-block:: yaml
frank:
mysql_database:
- present
'''
def present(name):
'''
Ensure that the named database is... | apache-2.0 | Python |
028f997970854e38238bb91b3c6e24a622ad4cd0 | Fix session constructors for gae_login. | google/ctfscoreboard,google/ctfscoreboard,google/ctfscoreboard,google/ctfscoreboard | scoreboard/auth/appengine.py | scoreboard/auth/appengine.py | """Appengine based login support."""
import flask
from google.appengine.api import users
from scoreboard.app import app
from scoreboard import controllers
from scoreboard import errors
from scoreboard import models
from scoreboard import utils
def login_user(_):
"""Login based on GAE Auth."""
gae_user = u... | """Appengine based login support."""
import flask
from google.appengine.api import users
from scoreboard.app import app
from scoreboard import controllers
from scoreboard import errors
from scoreboard import models
def login_user(_):
"""Login based on GAE Auth."""
gae_user = users.get_current_user()
i... | apache-2.0 | Python |
07658324cb59eba77f5e807bd1b0dca8e7ed4548 | Fix format_infirmier | regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data | scripts/format_infirmiers.py | scripts/format_infirmiers.py | # -*- coding: utf-8 -*-
import pandas as pd
import sys
from utils import find_zipcode, euro2float, str2date
header_mapping = {
'ORIGIN': 'ORIGIN',
'LABO': 'LABO',
'QUALITE_NOM_PRENOM': 'BENEF_PS_QUALITE_NOM_PRENOM',
'ADRESSE': 'BENEF_PS_ADR',
'QUALIFICATION': 'BENEF_PS_QUALIFICATION',
'MONTANT... | # -*- coding: utf-8 -*-
import pandas as pd
import sys
from utils import find_zipcode, euro2float, str2date
header_mapping = {
'ORIGIN': 'ORIGIN',
'LABO': 'LABO',
'QUALITE_NOM_PRENOM': 'BENEF_PS_QUALITE_NOM_PRENOM',
'ADRESSE': 'BENEF_PS_ADR',
'QUALIFICATION': 'BENEF_PS_QUALIFICATION',
'MONTANT... | agpl-3.0 | Python |
1f5d65024df8f0e0b70e75dbac071e72bd4ad29b | Update datacite Cannonical uri harvesting to return a single uri instead of a list | mehanig/scrapi,erinspace/scrapi,jeffreyliu3230/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,fabianvf/scrapi,alexgarciac/scrapi,CenterForOpenScience/scrapi,felliott/scrapi,mehanig/scrapi,fabianvf/scrapi | scrapi/harvesters/datacite.py | scrapi/harvesters/datacite.py | '''
Harvester for the DataCite MDS for the SHARE project
Example API call: http://oai.datacite.org/oai?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
from scrapi.base.helpers import updated_schema, oai_extract_dois
class DataciteHarvester(OAIH... | '''
Harvester for the DataCite MDS for the SHARE project
Example API call: http://oai.datacite.org/oai?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
from scrapi.base.helpers import updated_schema, oai_extract_dois
class DataciteHarvester(OAIH... | apache-2.0 | Python |
8a042586f1f446ccf4e4779e49783cf94eba3fb7 | Migrate sensor to async (#4663) | Cinntax/home-assistant,ct-23/home-assistant,rohitranjan1991/home-assistant,dmeulen/home-assistant,tinloaf/home-assistant,mezz64/home-assistant,tboyce021/home-assistant,toddeye/home-assistant,nkgilley/home-assistant,pschmitt/home-assistant,eagleamon/home-assistant,tboyce1/home-assistant,molobrakos/home-assistant,qedi-r/... | homeassistant/components/sensor/__init__.py | homeassistant/components/sensor/__init__.py | """
Component to interface with various sensors that can be monitored.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/sensor/
"""
import asyncio
import logging
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helper... | """
Component to interface with various sensors that can be monitored.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/sensor/
"""
import logging
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.config_valida... | apache-2.0 | Python |
7310c2ce4b8ccd69374a85877c2df97a2b6ade70 | Add _fields cache Change _update to _apply and add option for non-required fields | limbera/django-nap,MarkusH/django-nap | nap/dataviews/views.py | nap/dataviews/views.py |
from collections import defaultdict
from inspect import classify_class_attrs
from django.forms import ValidationError
from django.utils.functional import cached_property
from .fields import field
from .utils import DictObject
class DataView(object):
def __init__(self, obj=None, **kwargs):
if obj is No... |
from collections import defaultdict
from inspect import classify_class_attrs
from django.forms import ValidationError
from django.utils.functional import cached_property
from .fields import field
from .utils import DictObject
class DataView(object):
def __init__(self, obj=None, **kwargs):
if obj is No... | bsd-3-clause | Python |
ee60d49f57c450a56579f8bbe2c4382a93f60f38 | Fix test_utf8 for Python 3. | aherlihy/Monary,aherlihy/Monary | test/test_utf8.py | test/test_utf8.py | # -*- coding: utf-8 -*-
# Monary - Copyright 2011-2014 David J. C. Beach
# Please see the included LICENSE.TXT and NOTICE.TXT for licensing information.
import sys
import pymongo
import monary
expected = ["aあ", "âéÇ", "αλΩ", "眥¨≠"]
if sys.version_info[0] < 3:
# Python 2: convert from str to unicode.
expe... | # -*- coding: utf-8 -*-
# Monary - Copyright 2011-2014 David J. C. Beach
# Please see the included LICENSE.TXT and NOTICE.TXT for licensing information.
import pymongo
import monary
expected = ["aあ".decode('utf-8'),
"âéÇ".decode('utf-8'),
"αλΩ".decode('utf-8'),
"眥¨≠".decode('ut... | apache-2.0 | Python |
2f5918a02f7c1a4d6ccb3db01cf6d79d6aebeb76 | test on template - old way of testing home page removed | mbdebian/py-playground,mbdebian/py-playground | tdd-python/from_videos/superlists/lists/tests.py | tdd-python/from_videos/superlists/lists/tests.py | from django.http import HttpRequest
from django.test import TestCase
from lists.views import home_page
# Create your tests here.
class HomePageTet(TestCase):
def test_home_page_is_about_todo_lists(self):
request = HttpRequest()
response = home_page(request)
with open('lists/templates/hom... | from django.http import HttpRequest
from django.test import TestCase
from lists.views import home_page
# Create your tests here.
class HomePageTet(TestCase):
def test_home_page_is_about_todo_lists(self):
request = HttpRequest()
response = home_page(request)
self.assertTrue(response.conte... | apache-2.0 | Python |
5e5affd62d9774eb6af23e5f5fa63e9aeb0f817f | fix attention flop | undertherain/benchmarker,undertherain/benchmarker,undertherain/benchmarker,undertherain/benchmarker | benchmarker/modules/problems/attention/pytorch.py | benchmarker/modules/problems/attention/pytorch.py | import torch.nn as nn
class Net(nn.MultiheadAttention):
def forward(self, data):
super().forward(data, data, data)
def get_kernel(params):
assert params["mode"] == "inference"
cnt_samples = params["problem"]["size"][0]
len_seq = params["problem"]["size"][1]
embed_dim = params["problem"][... | import torch.nn as nn
class Net(nn.MultiheadAttention):
def forward(self, data):
super().forward(data, data, data)
def get_kernel(params):
assert params["mode"] == "inference"
cnt_samples = params["problem"]["size"][0]
len_seq = params["problem"]["size"][1]
embed_dim = params["problem"][... | mpl-2.0 | Python |
b52123473454487df5c617dd354fafeb500668b0 | Reformat codesearch/__init__.py | chromium/codesearch-py,chromium/codesearch-py | codesearch/__init__.py | codesearch/__init__.py | # Copyright 2017 The Chromium Authors.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd.
from __future__ import absolute_import
from .client_api import \
CodeSearch, \
NoFileSpecError, \
No... | # Copyright 2017 The Chromium Authors.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd.
from __future__ import absolute_import
from .client_api import CodeSearch, XrefNode, ServerError, NoFileSpecErro... | bsd-3-clause | Python |
2adbbe6c7291dd79784bd3a1e5702945435fa436 | Put Synchrophasor in a seperate file | sonusz/PhasorToolBox | phasortoolbox/__init__.py | phasortoolbox/__init__.py | #!/usr/bin/env python3
import asyncio
from .synchrophasor import Synchrophasor
from .parser import Parser, PcapParser
from .client import Client
from .pdc import PDC
import logging
logging.getLogger(__name__).addHandler(logging.NullHandler())
| #!/usr/bin/env python3
import asyncio
from .parser import Parser, PcapParser
from .client import Client
from .pdc import PDC
import logging
logging.getLogger(__name__).addHandler(logging.NullHandler())
| mit | Python |
05e8d1b4e162b55321f802bdba8a9eb7bdffd971 | remove object_id during conversion | tyarkoni/pliers,tyarkoni/featureX | pliers/converters/misc.py | pliers/converters/misc.py | """Miscellaneous conversion classes."""
from pliers.extractors import ExtractorResult
from pliers.stimuli import SeriesStim
from .base import Converter
class ExtractorResultToSeriesConverter(Converter):
"""Converts an ExtractorResult instance to a list of SeriesStims."""
_input_type = ExtractorResult
_o... | """Miscellaneous conversion classes."""
from pliers.extractors import ExtractorResult
from pliers.stimuli import SeriesStim
from .base import Converter
class ExtractorResultToSeriesConverter(Converter):
"""Converts an ExtractorResult instance to a list of SeriesStims."""
_input_type = ExtractorResult
_o... | bsd-3-clause | Python |
f371f8eff785cd117880466899a14a0d6ee70655 | update websiteUrl for news data | EUMSSI/EUMSSI-platform,EUMSSI/EUMSSI-platform,EUMSSI/EUMSSI-platform | preprocess/news2eumssi.py | preprocess/news2eumssi.py | #!/usr/bin/env python
import pymongo
import time
import datetime
from eumssi_converter import EumssiConverter
def transf_date(x):
if x=="": #no date information
x= "1900-01-01 00:00:00.0" #fake date for empty-location, should be aware of that when using
if x.__class__==datetime.datetime:
retur... | #!/usr/bin/env python
import pymongo
import time
import datetime
from eumssi_converter import EumssiConverter
def transf_date(x):
if x=="": #no date information
x= "1900-01-01 00:00:00.0" #fake date for empty-location, should be aware of that when using
if x.__class__==datetime.datetime:
retur... | apache-2.0 | Python |
1bbc1fab976dd63e6a2f05aa35117dc74db40652 | Use ModelSelectField. Javascript still broken for some reason. | skolsuper/pybbm_private_messages,skolsuper/pybbm_private_messages,skolsuper/pybbm_private_messages | private_messages/forms.py | private_messages/forms.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from django_select2.fields import HeavyModelSelect2MultipleChoiceField
from pybb import util
from private_messages.models imp... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
from django_select2.fields import HeavySelect2MultipleChoiceField
from pybb import util
from private_messages.models import PrivateMessage
class MessageForm(forms.ModelFo... | mit | Python |
790142d9b5f04700f5dcecee1816f6cf415886b1 | Remove print statement | dbinetti/barberscore-django,dbinetti/barberscore-django,dbinetti/barberscore,dbinetti/barberscore,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api | project/apps/api/views.py | project/apps/api/views.py | import logging
log = logging.getLogger(__name__)
import watson
from rest_framework import (
mixins,
viewsets,
# filters,
)
from .models import (
Convention,
Chorus,
Quartet,
)
from .serializers import (
ConventionSerializer,
ChorusSerializer,
QuartetSerializer,
SearchSerializ... | import logging
log = logging.getLogger(__name__)
import watson
from rest_framework import (
mixins,
viewsets,
# filters,
)
from .models import (
Convention,
Chorus,
Quartet,
)
from .serializers import (
ConventionSerializer,
ChorusSerializer,
QuartetSerializer,
SearchSerializ... | bsd-2-clause | Python |
0ff8623c34e9123c554875503d2f9e8327f41a74 | allow more than once space around operators, bygroups around includes, variables | dbrgn/pygments-mirror,dbrgn/pygments-mirror,dbrgn/pygments-mirror,kirbyfan64/pygments-unofficial,dbrgn/pygments-mirror,dbrgn/pygments-mirror,kirbyfan64/pygments-unofficial,kirbyfan64/pygments-unofficial,dbrgn/pygments-mirror,dbrgn/pygments-mirror,kirbyfan64/pygments-unofficial,dbrgn/pygments-mirror,kirbyfan64/pygments-... | pygments/lexers/puppet.py | pygments/lexers/puppet.py | # -*- coding: utf-8 -*-
"""
pygments.lexers.puppet
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the Puppet DSL.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, bygroups
from pygments.token import *
__all__ ... | # -*- coding: utf-8 -*-
"""
pygments.lexers.puppet
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the Puppet DSL.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, bygroups
from pygments.token import *
__all__ ... | bsd-2-clause | Python |
9847886f060483fb38ea6c00ddaba317fadaea29 | Apply isort | thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader | pytablereader/__init__.py | pytablereader/__init__.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from tabledata import (
EmptyDataError, InvalidDataError, InvalidHeaderNameError, InvalidTableNameError,
SQLiteTableDataSanitizer, TableData, TableDataSanitizer)
from ._constant i... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from tabledata import (
SQLiteTableDataSanitizer,
TableData,
TableDataSanitizer,
InvalidTableNameError,
InvalidHeaderNameError,
InvalidDataError,
EmptyDataErro... | mit | Python |
dab54ff92da91f7971e2701d2cf20d03a577664b | Fix crash when CIRCLE_NODE_TOTAL exists but is empty | micktwomey/pytest-circleci | pytest_circleci/plugin.py | pytest_circleci/plugin.py |
import os, hashlib
class CircleCIError(Exception):
"""Raised for problems running the CirleCI py.test plugin"""
def read_circleci_env_variables():
"""Read and convert CIRCLE_* environment variables"""
circle_node_total = int(os.environ.get("CIRCLE_NODE_TOTAL").strip() or "1")
circle_node_index = in... |
import os, hashlib
class CircleCIError(Exception):
"""Raised for problems running the CirleCI py.test plugin"""
def read_circleci_env_variables():
"""Read and convert CIRCLE_* environment variables"""
circle_node_total = int(os.environ.get("CIRCLE_NODE_TOTAL", "1").strip())
circle_node_index = int(... | mit | Python |
f6ab612ca7caa78ddbdd3496ce6b75e10da310ec | update test stage | ORNL-CEES/Cap,ORNL-CEES/Cap,Rombur/Cap,Rombur/Cap,Rombur/Cap,dalg24/Cap,dalg24/Cap,ORNL-CEES/Cap,dalg24/Cap | python/test/test_stage.py | python/test/test_stage.py | from pycap import PropertyTree,EnergyStorageDevice,Stage,initialize_data
import unittest
device_database=PropertyTree()
device_database.parse_xml('device.xml')
device=EnergyStorageDevice(device_database)
class capStageTestCase(unittest.TestCase):
def test_constant_current_charge_for_given_time(self):
ptre... | from pycap import PropertyTree,EnergyStorageDevice,Stage,initialize_data
import unittest
device_database=PropertyTree()
device_database.parse_xml('device.xml')
device=EnergyStorageDevice(device_database)
class capStageTestCase(unittest.TestCase):
def test_nothing(self):
ptree=PropertyTree()
ptree.... | bsd-3-clause | Python |
20fe9ec286f4040e8b10cdfbe300124e781ebf7c | change hr.analytic.timesheet instead of account.analytic.line when associated line to invoice | damdam-s/project-reporting | project_billing_utils/wizard/associate_aal.py | project_billing_utils/wizard/associate_aal.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joël Grand-Guillaume
# Copyright 2010 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
# ... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joël Grand-Guillaume
# Copyright 2010 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
# ... | agpl-3.0 | Python |
7c1ab84e5a7acfc439b3b34950a31b933c22d679 | fix migrations | codeforamerica/rva-screening,codeforamerica/rva-screening,codeforamerica/rva-screening | migrations/versions/65f28fd897d_.py | migrations/versions/65f28fd897d_.py | """empty message
Revision ID: 65f28fd897d
Revises: 11288927b825
Create Date: 2015-09-23 14:44:44.824420
"""
# revision identifiers, used by Alembic.
revision = '65f28fd897d'
down_revision = '3f1fecf4ecc8'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pl... | """empty message
Revision ID: 65f28fd897d
Revises: 11288927b825
Create Date: 2015-09-23 14:44:44.824420
"""
# revision identifiers, used by Alembic.
revision = '65f28fd897d'
down_revision = '11288927b825'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pl... | bsd-3-clause | Python |
22b4774372583050d5f2b45bf8cba29a08355efe | move prepare method / in case there are some loose changes exit on resume | jacobilsoe/rtc2git,cwill747/rtc2git,ohumbel/rtc2git,rtcTo/rtc2git,WtfJoke/rtc2git,akchinSTC/rtc2git | migration.py | migration.py | import os
import sys
from rtcFunctions import ImportHandler
from rtcFunctions import WorkspaceHandler
from rtcFunctions import RTCInitializer
from gitFunctions import Initializer
from gitFunctions import Commiter
import configuration
import shouter
def initialize(config):
directory = config.workDirectory
if ... | import os
import sys
from rtcFunctions import ImportHandler
from rtcFunctions import WorkspaceHandler
from rtcFunctions import RTCInitializer
from gitFunctions import Initializer
from gitFunctions import Commiter
import configuration
import shouter
def initialize(config):
directory = config.workDirectory
if ... | mit | Python |
04ea2096ade2cf323312cb1a1ff008c667994e24 | Use tf.lite as the py_module name. Made the necessary changes to the api generator to accomodate for `dots` in the py_module name | cxxgtxy/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,aldian/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,davidzchen/tensorflow,gautam1858/tensorflow,... | tensorflow/lite/g3doc/tools/build_py_api_docs.py | tensorflow/lite/g3doc/tools/build_py_api_docs.py | # Lint as: python3
# Copyright 2020 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 ... | # Lint as: python3
# Copyright 2020 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 ... | apache-2.0 | Python |
23c25516765bb9290fcd59159114b2815c4c60c3 | add unit test for pytables._update_or_append() | nathanhilbert/ulmo,nathanhilbert/ulmo,cameronbracken/ulmo,ocefpaf/ulmo,ocefpaf/ulmo,cameronbracken/ulmo | test/usgs_test.py | test/usgs_test.py | import datetime
import os
import isodate
import tables
import pyhis
TEST_FILE_PATH = '/tmp/pyhis_test.h5'
def test_init():
os.remove(TEST_FILE_PATH)
assert not os.path.exists(TEST_FILE_PATH)
pyhis.usgs.pytables.init_h5(TEST_FILE_PATH)
assert os.path.exists(TEST_FILE_PATH)
def test_parse_get_site... | import os
import tables
import pyhis
TEST_FILE_PATH = '/tmp/pyhis_test.h5'
def test_init():
os.remove(TEST_FILE_PATH)
assert not os.path.exists(TEST_FILE_PATH)
pyhis.usgs.pytables.init_h5(TEST_FILE_PATH)
assert os.path.exists(TEST_FILE_PATH)
def test_parse_get_sites():
site_files = ['RI_dail... | bsd-3-clause | Python |
5384deb82aeddfb6f02c7e198c372dc1b06cd861 | Add purchase suppliers dataset | datasciencebr/serenata-toolbox | serenata_toolbox/datasets.py | serenata_toolbox/datasets.py | import os
from urllib.request import urlretrieve
def fetch(filename, destination_path,
aws_bucket='serenata-de-amor-data',
aws_region='s3-sa-east-1'):
url = 'https://{}.amazonaws.com/{}/{}'.format(aws_region,
aws_bucket,
... | import os
from urllib.request import urlretrieve
def fetch(filename, destination_path,
aws_bucket='serenata-de-amor-data',
aws_region='s3-sa-east-1'):
url = 'https://{}.amazonaws.com/{}/{}'.format(aws_region,
aws_bucket,
... | mit | Python |
b61c51798ce2f1fde3d8777d36d809b209741984 | Fix compatibility with Python2 | niboshi/chainer,hvy/chainer,okuta/chainer,ktnyt/chainer,chainer/chainer,pfnet/chainer,wkentaro/chainer,chainer/chainer,hvy/chainer,niboshi/chainer,chainer/chainer,tkerola/chainer,ronekko/chainer,okuta/chainer,hvy/chainer,niboshi/chainer,rezoo/chainer,wkentaro/chainer,keisuke-umezawa/chainer,ktnyt/chainer,niboshi/chaine... | tests/chainer_tests/utils_tests/test_argument.py | tests/chainer_tests/utils_tests/test_argument.py | import unittest
import six
from chainer import testing
from chainer.utils.argument import parse_kwargs
class TestArgument(unittest.TestCase):
def test_parse_kwargs(self):
def test(**kwargs):
return parse_kwargs(kwargs, ('foo', 1), ('bar', 2))
self.assertEqual(test(), (1, 2))
... | import unittest
from chainer import testing
from chainer.utils.argument import parse_kwargs
class TestArgument(unittest.TestCase):
def test_parse_kwargs(self):
def test(**kwargs):
return parse_kwargs(kwargs, ('foo', 1), ('bar', 2))
self.assertEqual(test(), (1, 2))
self.asse... | mit | Python |
5d3646a8fc4c05a2902b2f3ca60321204e87f355 | Fix handling of user details | tobias47n9e/social-core,python-social-auth/social-core,python-social-auth/social-core | social_core/backends/asana.py | social_core/backends/asana.py | import datetime
from .oauth import BaseOAuth2
class AsanaOAuth2(BaseOAuth2):
name = 'asana'
AUTHORIZATION_URL = 'https://app.asana.com/-/oauth_authorize'
ACCESS_TOKEN_METHOD = 'POST'
ACCESS_TOKEN_URL = 'https://app.asana.com/-/oauth_token'
REFRESH_TOKEN_URL = 'https://app.asana.com/-/oauth_token'... | import datetime
from .oauth import BaseOAuth2
class AsanaOAuth2(BaseOAuth2):
name = 'asana'
AUTHORIZATION_URL = 'https://app.asana.com/-/oauth_authorize'
ACCESS_TOKEN_METHOD = 'POST'
ACCESS_TOKEN_URL = 'https://app.asana.com/-/oauth_token'
REFRESH_TOKEN_URL = 'https://app.asana.com/-/oauth_token'... | bsd-3-clause | Python |
565bb12ca79a159b34ec0e03385a038a05db93c2 | Remove example from docstring | Vayel/MPF,tartopum/MPF | mpf/processors/difference.py | mpf/processors/difference.py | class Difference:
"""TODO"""
def __init__(self):
pass
def work(self, data):
"""Process the difference between an element in the `data` list and the
next one.
:param data: the data to be processed
:type data: list
:return: the list ... | class Difference:
"""
TODO
"""
def __init__(self):
pass
def work(self, data):
"""Process the difference between an element in the `data` list and the
next one.
:param data: the data to be processed
:type data: list
:ret... | mit | Python |
9a903f9f003d743242d4ac41b4a4045559f1ff4c | add MIT License copyright header to zmq_sub.py | shaolinfry/litecoin,emc2foundation/einsteinium,EntropyFactory/creativechain-core,nlgcoin/guldencoin-official,funkshelper/woodcore,zcoinofficial/zcoin,zcoinofficial/zcoin,gjhiggins/vcoincore,zcoinofficial/zcoin,Electronic-Gulden-Foundation/egulden,OmniLayer/omnicore,lbrtcoin/albertcoin,lbrtcoin/albertcoin,nlgcoin/gulden... | contrib/zmq/zmq_sub.py | contrib/zmq/zmq_sub.py | #!/usr/bin/env python2
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import array
import binascii
import zmq
import struct
port = 28332
zmqContext = zmq.Context()
zmqSubSoc... | #!/usr/bin/env python2
import array
import binascii
import zmq
import struct
port = 28332
zmqContext = zmq.Context()
zmqSubSocket = zmqContext.socket(zmq.SUB)
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "hashblock")
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "hashtx")
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "rawblock")
zmqSub... | mit | Python |
2fdac02fe93f4aa4f25c9ae4dadfb7325e7f7bc6 | Resolve flask-wtf deprecation warning | der-michik/c3bottles,der-michik/c3bottles,der-michik/c3bottles,der-michik/c3bottles | controller/__init__.py | controller/__init__.py | #!/usr/bin/python
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_wtf import CSRFProtect
c3bottles = Flask(__name__,
static_folder="../static",
template_folder="../templates"
)
# We need to set this here to prevent the depreciation warning
c3bot... | #!/usr/bin/python
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_wtf import CsrfProtect
c3bottles = Flask(__name__,
static_folder="../static",
template_folder="../templates"
)
# We need to set this here to prevent the depreciation warning
c3bot... | mit | Python |
c131a725af7e27fd8b80683e6af1ddfc986ca2c4 | Add mpfr 4.0.2 (#13091) | iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/mpfr/package.py | var/spack/repos/builtin/packages/mpfr/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 Mpfr(AutotoolsPackage):
"""The MPFR library is a C library for multiple-precision
f... | # 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 Mpfr(AutotoolsPackage):
"""The MPFR library is a C library for multiple-precision
f... | lgpl-2.1 | Python |
6fd8c2b1c1ee59820ce26474c9504b514d325106 | Update scanopy.py | nyholmniklas/scanopy | Scanopy/scanopy.py | Scanopy/scanopy.py | from gui import *
from scanner import *
if __name__ == '__main__':
scanner = Scanner()
gui_thread = Gui(scanner)
gui_thread.run()
| from gui import *
from scanner import *
if __name__ == '__main__':
scanner = Scanner()
gui_thread = Gui(scanner)
gui_thread.start() | mit | Python |
35df1104c0df6a89e083b77a82cca44b7ecbbfd9 | Print a log message every 1000 inserted URLs | berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud | mediacloud/mediawords/util/sitemap/media.py | mediacloud/mediawords/util/sitemap/media.py | from mediawords.db import DatabaseHandler
from mediawords.util.log import create_logger
from mediawords.util.sitemap.tree import sitemap_tree_for_homepage
log = create_logger(__name__)
# FIXME add test for this function
def fetch_sitemap_pages_for_media_id(db: DatabaseHandler, media_id: int) -> None:
"""Fetch an... | from mediawords.db import DatabaseHandler
from mediawords.util.log import create_logger
from mediawords.util.sitemap.tree import sitemap_tree_for_homepage
log = create_logger(__name__)
# FIXME add test for this function
def fetch_sitemap_pages_for_media_id(db: DatabaseHandler, media_id: int) -> None:
"""Fetch an... | agpl-3.0 | Python |
64313aabb821719f86f331b3f83cdf158344f5c7 | Improve documentation | meetmangukiya/coala-bears,chriscoyfish/coala-bears,yashtrivedi96/coala-bears,dosarudaniel/coala-bears,naveentata/coala-bears,madhukar01/coala-bears,ku3o/coala-bears,incorrectusername/coala-bears,coala-analyzer/coala-bears,ankit01ojha/coala-bears,madhukar01/coala-bears,Vamshi99/coala-bears,damngamerz/coala-bears,kaustub... | bears/configfiles/DockerfileLintBear.py | bears/configfiles/DockerfileLintBear.py | import json
from coalib.bearlib.abstractions.Linter import linter
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.results.Result import Result
@linter(executable='dockerfile_lint')
class DockerfileLintBear:
"""
Check file syntax as well as arbitrary semantic and best practice
in Do... | import json
from coalib.bearlib.abstractions.Linter import linter
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.results.Result import Result
@linter(executable='dockerfile_lint')
class DockerfileLintBear:
"""
Checks the given file with ``dockerfile_lint``.
"""
severity_map =... | agpl-3.0 | Python |
81dc3cf445046290381e94ccf8f20c32f419dde2 | Fix datetime creation | scorphus/okapi | okapi/api.py | okapi/api.py | """
okapi.api
~~~~~~~~~
This module implements the Requests API while storing valuable information into mongodb.
"""
import datetime
import requests
import time
import urlparse
from pymongo import MongoClient
# TODO:
# Depends on how we want to calculate the time to
# receieve the request form Home Depots API.
#... | """
okapi.api
~~~~~~~~~
This module implements the Requests API while storing valuable information into mongodb.
"""
import datetime
import requests
import time
import urlparse
from pymongo import MongoClient
# TODO:
# Depends on how we want to calculate the time to
# receieve the request form Home Depots API.
#... | bsd-3-clause | Python |
d1514b6be184915e0f1227e2761db00945d0e7b4 | use the new interface to attach gdb | HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak | spyvm/plugins/vmdebugging.py | spyvm/plugins/vmdebugging.py | import os
from spyvm import model, error
from spyvm.plugins.plugin import Plugin
from spyvm.util.system import IS_WINDOWS
DebuggingPlugin = Plugin()
DebuggingPlugin.userdata['stop_ui'] = False
def stop_ui_process():
DebuggingPlugin.userdata['stop_ui'] = True
# @DebuggingPlugin.expose_primitive(unwrap_spec=[obje... | import os
from spyvm import model, error
from spyvm.plugins.plugin import Plugin
from spyvm.util.system import IS_WINDOWS
DebuggingPlugin = Plugin()
DebuggingPlugin.userdata['stop_ui'] = False
def stop_ui_process():
DebuggingPlugin.userdata['stop_ui'] = True
# @DebuggingPlugin.expose_primitive(unwrap_spec=[obje... | bsd-3-clause | Python |
313cafa9320a3842eb91186a1ffe225e6d3a025d | Add __version__ (#372) | mlflow/mlflow,mlflow/mlflow,mlflow/mlflow,mlflow/mlflow,mlflow/mlflow,mlflow/mlflow,mlflow/mlflow | mlflow/__init__.py | mlflow/__init__.py | """
Provides the MLflow fluent API, allowing management of an active MLflow run.
For example:
.. code:: python
import mlflow
mlflow.start_run()
mlflow.log_param("my", "param")
mlflow.log_metric("score", 100)
mlflow.end_run()
You can also use syntax like this:
.. code:: python
with mlflow.st... | """
Provides the MLflow fluent API, allowing management of an active MLflow run.
For example:
.. code:: python
import mlflow
mlflow.start_run()
mlflow.log_param("my", "param")
mlflow.log_metric("score", 100)
mlflow.end_run()
You can also use syntax like this:
.. code:: python
with mlflow.st... | apache-2.0 | Python |
f45f1b5a70473d36ac6845db4e1ebf050ec0d9ea | Change u'id' from unicode to ascii string | iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api | project_fish/whats_fresh/tests/test_vendor_model.py | project_fish/whats_fresh/tests/test_vendor_model.py | from django.test import TestCase
from django.conf import settings
from phonenumber_field.modelfields import PhoneNumberField
from whats_fresh.models import *
from django.contrib.gis.db import models
import os
import time
import sys
import datetime
class VendorTestCase(TestCase):
def setUp(self):
self.ex... | from django.test import TestCase
from django.conf import settings
from phonenumber_field.modelfields import PhoneNumberField
from whats_fresh.models import *
from django.contrib.gis.db import models
import os
import time
import sys
import datetime
class VendorTestCase(TestCase):
def setUp(self):
self.ex... | apache-2.0 | Python |
d25c1e53408c792205f10bf8e9e6b20fbc9eb836 | Remove doubled license header from blob_storage.py | lihui7115/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,lihui7115/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,lihui7115/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,lihui7115/ChromiumGStreame... | tools/perf/benchmarks/blob_storage.py | tools/perf/benchmarks/blob_storage.py | # 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.
from core import perf_benchmark
from telemetry import benchmark
from telemetry.timeline import tracing_category_filter
from telemetry.web_perf import timeli... | # 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.
# 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 fi... | bsd-3-clause | Python |
04be2f88383d6cdeb59d817c331cd406c25c0c8e | Fix task URL | Kitware/cumulus,Kitware/cumulus,cjh1/cumulus,cjh1/cumulus | cumulus/task/status.py | cumulus/task/status.py | from __future__ import absolute_import
from cumulus.starcluster.logging import StarClusterLogHandler, StarClusterCallWriteHandler, logstdout, StarClusterLogFilter
import cumulus.starcluster.logging
from cumulus.starcluster.tasks.celery import app
from cumulus.starcluster.tasks.common import _check_status
import cumulus... | from __future__ import absolute_import
from cumulus.starcluster.logging import StarClusterLogHandler, StarClusterCallWriteHandler, logstdout, StarClusterLogFilter
import cumulus.starcluster.logging
from cumulus.starcluster.tasks.celery import app
from cumulus.starcluster.tasks.common import _check_status
import cumulus... | apache-2.0 | Python |
1a5d480a251a78048cd920b9f5b615a787a7b90c | make test easier so that we can use qpbo | pystruct/pystruct,amueller/pystruct,wattlebird/pystruct,d-mittal/pystruct,massmutual/pystruct,wattlebird/pystruct,pystruct/pystruct,amueller/pystruct,d-mittal/pystruct,massmutual/pystruct | pystruct/tests/test_learners/test_frankwolfe_svm.py | pystruct/tests/test_learners/test_frankwolfe_svm.py | from tempfile import mkstemp
import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import assert_less
from sklearn.datasets import load_iris
from pystruct.models import GridCRF, GraphCRF
from pystruct.datasets import generate_blocks_multinomial
from pystruct.learners import FrankWolfeSSVM
f... | from tempfile import mkstemp
import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import assert_less
from sklearn.datasets import load_iris
from pystruct.models import GridCRF, GraphCRF
from pystruct.datasets import generate_blocks_multinomial
from pystruct.learners import FrankWolfeSSVM
f... | bsd-2-clause | Python |
f1d3d2f5543c0e847c4b2051c04837cb3586846e | Enhance our plotter to use the new div_markers code | yw374cornell/e-mission-server,joshzarrabi/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,joshzarrabi/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mission-server,joshzarrabi/e-mis... | emission/analysis/plotting/leaflet_osm/our_plotter.py | emission/analysis/plotting/leaflet_osm/our_plotter.py | import pandas as pd
import folium
def df_to_string_list(df):
"""
Convert the input df into a list of strings, suitable for using as popups in a map.
This is a utility function.
"""
print "Converting df with size %s to string list" % df.shape[0]
array_list = df.as_matrix().tolist()
return [s... | import pandas as pd
import folium
def get_map_list(df, potential_splits):
mapList = []
potential_splits_list = list(potential_splits)
for start, end in zip(potential_splits_list, potential_splits_list[1:]):
trip = df[start:end]
currMap = folium.Map([trip.mLatitude.mean(), trip.mLongitude.me... | bsd-3-clause | Python |
db2308b1599f28e33897ac08d38a4c7751decf64 | add autots import check (#5384) | intel-analytics/BigDL,yangw1234/BigDL,yangw1234/BigDL,intel-analytics/BigDL,yangw1234/BigDL,intel-analytics/BigDL,yangw1234/BigDL,intel-analytics/BigDL | python/chronos/src/bigdl/chronos/autots/__init__.py | python/chronos/src/bigdl/chronos/autots/__init__.py | #
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | #
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 | Python |
0a8ce480bac176a53a418f6ab4242fd2f439942e | Bump version | thombashi/sqlitebiter,thombashi/sqlitebiter | sqlitebiter/__version__.py | sqlitebiter/__version__.py | # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.27.2"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.27.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
eee49d1b4a5f326cc7c4becf50b71ebe92580c7c | Update Graphics Python examples to use new pipeline API | berendkleinhaneveld/VTK,keithroe/vtkoptix,candy7393/VTK,hendradarwin/VTK,keithroe/vtkoptix,mspark93/VTK,msmolens/VTK,sumedhasingla/VTK,demarle/VTK,gram526/VTK,collects/VTK,ashray/VTK-EVM,biddisco/VTK,SimVascular/VTK,gram526/VTK,cjh1/VTK,mspark93/VTK,sankhesh/VTK,biddisco/VTK,collects/VTK,aashish24/VTK-old,sankhesh/VTK,... | Examples/Graphics/Python/SegmentAndBrokenLineSources.py | Examples/Graphics/Python/SegmentAndBrokenLineSources.py | ############################################################
from vtk import *
############################################################
# Create sources
line1 = vtkLineSource()
line1.SetPoint1( 1, 0, 0 )
line1.SetPoint2( -1, 0, 0 )
line1.SetResolution( 32 )
points = vtkPoints()
points.InsertNextPoint( 1, 0, 0 )
p... | ############################################################
from vtk import *
############################################################
# Create sources
line1 = vtkLineSource()
line1.SetPoint1( 1, 0, 0 )
line1.SetPoint2( -1, 0, 0 )
line1.SetResolution( 32 )
points = vtkPoints()
points.InsertNextPoint( 1, 0, 0 )
p... | bsd-3-clause | Python |
b4f3f5cc91836765037a44b359f54cf2c58a2033 | Include defaults in --help output. | vine/mysql-prefetcher | myprefetch/fake_updates_prefetch.py | myprefetch/fake_updates_prefetch.py | #!/usr/local/bin/python2.6 -Wignore::DeprecationWarning
import argparse
import logging
import os
from myprefetch import readahead
from myprefetch.rewriters import fake_update
from myprefetch.mysql import Config
def main():
logging.basicConfig()
parser = argparse.ArgumentParser(description="""
This prefetche... | #!/usr/local/bin/python2.6 -Wignore::DeprecationWarning
import argparse
import logging
import os
from myprefetch import readahead
from myprefetch.rewriters import fake_update
from myprefetch.mysql import Config
def main():
logging.basicConfig()
parser = argparse.ArgumentParser(description="""
This prefetche... | apache-2.0 | Python |
72603e1cbffaecc3abe0076cb4271013b7f550d7 | Add a depreciation warning on importing nipy.neurospin.utils.mask | alexis-roche/nipy,bthirion/nipy,nipy/nipy-labs,alexis-roche/nipy,alexis-roche/register,arokem/nipy,alexis-roche/niseg,alexis-roche/register,bthirion/nipy,bthirion/nipy,arokem/nipy,alexis-roche/niseg,alexis-roche/nireg,arokem/nipy,nipy/nireg,alexis-roche/nipy,alexis-roche/register,nipy/nipy-labs,bthirion/nipy,alexis-roc... | nipy/neurospin/utils/mask.py | nipy/neurospin/utils/mask.py | """
Compatibility module
"""
import warnings
warnings.warn(DeprecationWarning(
"This module (nipy.neurospin.utils.mask) has been moved and "
"is depreciated. Please update your code to import from "
"'nipy.neurospin.mask'."))
from ..mask import *
| """
Compatibility module
"""
# No relative imports, as they are not permitted with 'import *'
from nipy.neurospin.mask import *
| bsd-3-clause | Python |
4892c5d51a973846338f6f46f0dd33843a470ea7 | Bump version to 0.5.2 | Princeton-CDH/django-pucas,Princeton-CDH/django-pucas | pucas/__init__.py | pucas/__init__.py | default_app_config = 'pucas.apps.PucasConfig'
__version_info__ = (0, 5, 2, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
| default_app_config = 'pucas.apps.PucasConfig'
__version_info__ = (0, 5, 1, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
| apache-2.0 | Python |
2216370f0f9d04da2c2d5b4556d93e01aecd6e97 | fix testdata | SerCeMan/intellij-community,petteyg/intellij-community,ThiagoGarciaAlves/intellij-community,fitermay/intellij-community,hurricup/intellij-community,retomerz/intellij-community,ibinti/intellij-community,ryano144/intellij-community,fengbaicanhe/intellij-community,blademainer/intellij-community,robovm/robovm-studio,Lekani... | python/testData/completion/predefinedMethodName.py | python/testData/completion/predefinedMethodName.py | class Foo:
def __rad<caret>
| class Foo:
def __ra<caret>
| apache-2.0 | Python |
93700dba921c6bffe77f2eaadc2d7ece5dde03e5 | Fix error caused by moving function setup_logging | raphiz/bsAbstimmungen,raphiz/bsAbstimmungen | tests/__init__.py | tests/__init__.py | from bsAbstimmungen.utils import setup_logging
setup_logging('tests/test-logging.json')
| from bsAbstimmungen import setup_logging
setup_logging('tests/test-logging.json')
| mit | Python |
3b8c4f7a2184e886128ddf5a31a773322ef4ea97 | fix bug: comment.canonical was removed long ago | SysTheron/adhocracy,alkadis/vcv,liqd/adhocracy,SysTheron/adhocracy,alkadis/vcv,phihag/adhocracy,phihag/adhocracy,DanielNeugebauer/adhocracy,phihag/adhocracy,liqd/adhocracy,DanielNeugebauer/adhocracy,alkadis/vcv,alkadis/vcv,liqd/adhocracy,SysTheron/adhocracy,alkadis/vcv,DanielNeugebauer/adhocracy,phihag/adhocracy,Daniel... | adhocracy/lib/auth/comment.py | adhocracy/lib/auth/comment.py | from pylons import tmpl_context as c
from authorization import has
import poll
# helper functions
def is_own(co):
return c.user and co.creator == c.user
# authorisation checks
def index(check):
check.perm('comment.view')
def show(check, co):
check.perm('comment.view')
check.other('comment_is_de... | from pylons import tmpl_context as c
from authorization import has
import poll
# helper functions
def is_own(co):
return c.user and co.creator == c.user
# authorisation checks
def index(check):
check.perm('comment.view')
def show(check, co):
check.perm('comment.view')
check.other('comment_is_de... | agpl-3.0 | Python |
d16006e4274a79b577e2f3ca62c7e2b1db775d4a | fix indent for workqueue.py | weiHelloWorld/accelerated_sampling_with_autoencoder,weiHelloWorld/accelerated_sampling_with_autoencoder | MD_simulation_on_trp_cage/current_work/src/workqueue.py | MD_simulation_on_trp_cage/current_work/src/workqueue.py | """
this programs takes a file containing all Python programs to run as input, and
put these programs into a workqueue, and at every instance we make sure only
n Python programs are running
===========================
input:
- file containing Python programs to run
- number of programs allowed to run concurrently
... | """
this programs takes a file containing all Python programs to run as input, and
put these programs into a workqueue, and at every instance we make sure only
n Python programs are running
===========================
input:
- file containing Python programs to run
- number of programs allowed to run concurrently
... | mit | Python |
fb3f1494bc5bff911df39223d7dd4f96c2f8c389 | remove version | AnythingTechPro/curionet | tests/__init__.py | tests/__init__.py | """
* Copyright (C) Caleb Marshall and others... - All Rights Reserved
* Written by Caleb Marshall <anythingtechpro@gmail.com>, May 23rd, 2017
* Licensing information can found in 'LICENSE', which is part of this source code package.
"""
| """
* Copyright (C) Caleb Marshall and others... - All Rights Reserved
* Written by Caleb Marshall <anythingtechpro@gmail.com>, May 23rd, 2017
* Licensing information can found in 'LICENSE', which is part of this source code package.
"""
__version__ = '1.0.0'
| apache-2.0 | Python |
6dec30deb4530f0ce7823f5942448309c2a59cea | FIX invoice restrict invoicing | ingadhoc/account-invoicing | account_partner_restrict_invoicing/account_invoice.py | account_partner_restrict_invoicing/account_invoice.py | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, api, _
from openerp.ex... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, api, _
from openerp.ex... | agpl-3.0 | Python |
4b0f54a52fc4ca7f954d8a7e9734ef772894518d | Fix search tests | authmillenon/pycomicvine | tests/__init__.py | tests/__init__.py | from tests.characters import *
from tests.chats import *
from tests.concepts import *
from tests.issues import *
from tests.locations import *
from tests.movies import *
from tests.objects import *
from tests.people import *
from tests.promos import *
from tests.powers import *
from tests.search import *
from tests.sto... | from search import *
from tests.characters import *
from tests.chats import *
from tests.concepts import *
from tests.issues import *
from tests.locations import *
from tests.movies import *
from tests.objects import *
from tests.people import *
from tests.promos import *
from tests.powers import *
from tests.story_arc... | mit | Python |
801b077024f1233b1026e5d8e8884bde22afc1df | use correct attribute to find the instance of a bound method | npinto/pytest | py/test/compat.py | py/test/compat.py | import py
from py.test.collect import Function
if py.std.sys.version_info > (3, 0):
_self = "__self__"
else:
_self = "im_self"
class TestCaseUnit(Function):
""" compatibility Unit executor for TestCase methods
honouring setUp and tearDown semantics.
"""
def runtest(self, _deprecated=None)... | import py
from py.test.collect import Function
class TestCaseUnit(Function):
""" compatibility Unit executor for TestCase methods
honouring setUp and tearDown semantics.
"""
def runtest(self, _deprecated=None):
boundmethod = self.obj
instance = boundmethod.im_self
instanc... | mit | Python |
65877e88ab9819ed0a505d3cedd2b180bf6f30fa | Update playback.py | miguelgrinberg/pydub,joshrobo/pydub,cbelth/pyMusic,sgml/pydub,jiaaro/pydub,Geoion/pydub | pydub/playback.py | pydub/playback.py | """
Support for playing AudioSegments - pyaudio is a *much* nicer solution, but
is tricky to install. See my notes on installing pyaudio in a virtualenv (on
OSX 10.10): https://gist.github.com/jiaaro/9767512210a1d80a8a0d
"""
import subprocess
from tempfile import NamedTemporaryFile
from .utils import get_player_name,... | import subprocess
from tempfile import NamedTemporaryFile
from .utils import get_player_name, make_chunks
PLAYER = get_player_name()
def _play_with_ffplay(seg):
with NamedTemporaryFile("w+b", suffix=".wav") as f:
seg.export(f.name, "wav")
subprocess.call([PLAYER, "-nodisp", "-autoexit", f.name])
def _play_wi... | mit | Python |
9c9f692c2da9ee989382504026bc7c95826e3842 | add parse_defaults unittest | imjoey/pyhaproxy | pyhaproxy/test.py | pyhaproxy/test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import parse
class TestParse(object):
@classmethod
def setup_class(cls):
pass
@classmethod
def teardown_class(cls):
pass
def setup(self):
self.parser = parse.Parser('haproxy.cfg')
self.configration = self.parser.buil... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import parse
class TestParse(object):
@classmethod
def setup_class(cls):
pass
@classmethod
def teardown_class(cls):
pass
def setup(self):
self.parser = parse.Parser('haproxy.cfg')
self.configration = self.parser.buil... | mit | Python |
d93c0905ba7ffd1ab860ee489bd948d564ff5ea9 | implement wof core get_site_data | ulmo-dev/ulmo-common | pyhis/wof/core.py | pyhis/wof/core.py | import cStringIO as StringIO
import suds
import pyhis.waterml.v1_0 as wml
def get_sites(wsdl_url):
suds_client = suds.client.Client(wsdl_url)
suds_client.service.GetSites('')
response_text = unicode(suds_client.last_received())
response_buffer = StringIO.StringIO()
# hacks: Hydroserver doesn't ... | import cStringIO as StringIO
import suds
import pyhis.waterml.v1_0 as wml
def get_sites(wsdl_url):
suds_client = suds.client.Client(wsdl_url)
suds_client.service.GetSites('')
response_text = unicode(suds_client.last_received())
response_buffer = StringIO.StringIO()
# hacks: Hydroserver doesn't ... | bsd-3-clause | Python |
d1af9d4a245ae6cc60baca4080b88fd2ef8f911c | Add `pylxd.client.Client` to `pylxd.Client`. | lxc/pylxd,lxc/pylxd | pylxd/__init__.py | pylxd/__init__.py | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | apache-2.0 | Python |
e2402e8c1f1f058dca39531f548490cb327c4fb2 | Remove db fixture | tranlyvu/find-link,tranlyvu/findLink | tests/conftest.py | tests/conftest.py | import pytest
from wikilink.wiki_link import WikiLink
@pytest.fixture()
def engine():
return create_engine('postgresql://localhost/test_database')
| import pytest
from wikilink.wiki_link import WikiLink
@pytest.fixture()
def engine():
return create_engine('postgresql://localhost/test_database')
@pytest.fixture()
def wikilin_db_connection(tmpdir):
WikiLink.setup_db()
yield
| apache-2.0 | Python |
df6cb2c96f0833d96a42aea2980717d04b566a2b | Undo skipping trustme tests under linux32 | KeepSafe/aiohttp,KeepSafe/aiohttp,KeepSafe/aiohttp | tests/conftest.py | tests/conftest.py | import hashlib
import ssl
import pytest
import trustme
pytest_plugins = ['aiohttp.pytest_plugin', 'pytester']
@pytest.fixture
def tls_certificate_authority():
return trustme.CA()
@pytest.fixture
def tls_certificate(tls_certificate_authority):
return tls_certificate_authority.issue_server_cert(
'lo... | import hashlib
import platform
import ssl
import pytest
import trustme
pytest_plugins = ['aiohttp.pytest_plugin', 'pytester']
@pytest.fixture
def tls_certificate_authority():
if (platform.system() == 'Linux' and
platform.architecture() == ('32bit', 'ELF')):
pytest.xfail("trustme fails on 32b... | apache-2.0 | Python |
74d8e24d58d402ad60aef1fb99f6a8fee5fc81b3 | Fix regression test only: annotator use is not created | xs2maverick/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,liqd/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocracy3.mercator,liqd/adhocracy3.mercator,liqd/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,liqd/adho... | tests/conftest.py | tests/conftest.py | """Add or override py.test fixtures for all tests in this directory."""
from splinter import Browser
from pytest import fixture
from pytest import skip
def pytest_addoption(parser):
"""Add pytest option --run_embed_tests."""
parser.addoption('--run_embed_tests', action='store_true', default=False,
... | """Add or override py.test fixtures for all tests in this directory."""
from splinter import Browser
from pytest import fixture
from pytest import skip
def pytest_addoption(parser):
"""Add pytest option --run_embed_tests."""
parser.addoption('--run_embed_tests', action='store_true', default=False,
... | agpl-3.0 | Python |
8684bd9c1324f1f3030a84090202f3665407854b | remove unused csrf_exempt | kartta-labs/noter-backend,kartta-labs/noter-backend | noter_backend/noter_backend/urls.py | noter_backend/noter_backend/urls.py | from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from main import views
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('api/v0.1/images/', views.ImageList.as_view()),
path('api/v0.1/ima... | from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from main import views
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
from django.views.decorators.csrf import csrf_exempt
urlpatterns = [
path('api/v0.1/images/... | apache-2.0 | Python |
6b7148bb9f9845a9897bb64776ea4025cc4d186e | Patch for issue #303 (thanks to @eltjpm) | stuartarchibald/numba,gdementen/numba,stuartarchibald/numba,stefanseefeld/numba,gmarkall/numba,stuartarchibald/numba,pombredanne/numba,numba/numba,cpcloud/numba,numba/numba,pombredanne/numba,stonebig/numba,stonebig/numba,IntelLabs/numba,pitrou/numba,pitrou/numba,ssarangi/numba,gmarkall/numba,numba/numba,gmarkall/numba,... | numba/tests/issues/test_issue_56.py | numba/tests/issues/test_issue_56.py | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
from numba import *
from numba.testing import test_support
import numpy
import unittest
# NOTE: See also numba.tests.ops.test_binary_ops
def maxstar1d(a, b):
M = a.shape[0]
res = numpy.empty(M)
for i in range(M):
... | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
from numba import *
from numba.testing import test_support
import numpy
import unittest
# NOTE: See also numba.tests.ops.test_binary_ops
def maxstar1d(a, b):
M = a.shape[0]
res = numpy.empty(M)
for i in range(M):
... | bsd-2-clause | Python |
18a9863627f5edb2f909f3c900600d0883493ac0 | Add back fft to scipy namespace. | maniteja123/scipy,aman-iitj/scipy,ChanderG/scipy,woodscn/scipy,mtrbean/scipy,richardotis/scipy,jakevdp/scipy,jseabold/scipy,lukauskas/scipy,anielsen001/scipy,zaxliu/scipy,haudren/scipy,efiring/scipy,grlee77/scipy,ogrisel/scipy,giorgiop/scipy,mingwpy/scipy,befelix/scipy,newemailjdm/scipy,kleskjr/scipy,hainm/scipy,endoli... | Lib/__init__.py | Lib/__init__.py | """\
SciPy --- A scientific computing package for Python
===================================================
You can support the development of SciPy by purchasing documentation
at
http://www.trelgol.com
It is being distributed for a fee for a limited time to try and raise
money for development.
Documentation is ... | """\
SciPy --- A scientific computing package for Python
===================================================
You can support the development of SciPy by purchasing documentation
at
http://www.trelgol.com
It is being distributed for a fee for a limited time to try and raise
money for development.
Documentation is ... | bsd-3-clause | Python |
cf2e38a9ffac6294be8fc67f5ab422e07b4deab1 | fix log message | bnomis/macports-update | macports.py | macports.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# macports: updates macports
# https://github.com/bnomis/macports-update
# (c) Simon Blanchard
import argparse
import datetime
import subprocess
import sys
# the port command
portcmd = '/opt/local/bin/port'
# where to write logs
logfile = '/var/root/logs/macports.log'
#... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# macports: updates macports
# https://github.com/bnomis/macports-update
# (c) Simon Blanchard
import argparse
import datetime
import subprocess
import sys
# the port command
portcmd = '/opt/local/bin/port'
# where to write logs
logfile = '/var/root/logs/macports.log'
#... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.