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 |
|---|---|---|---|---|---|---|---|---|
79b258dedda23c9130dda6d4d674f077ac52683e | Add select field for food type | foodsnag/foodsnag-web,foodsnag/foodsnag-web,foodsnag/foodsnag-web | app/main/forms.py | app/main/forms.py | import datetime
from dateutil.parser import parse
from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, BooleanField, SelectField,\
DateTimeField, SubmitField
from wtforms.validators import Required, Length, Email
from wtforms import ValidationError
from ..models import User, Event, Location
... | import datetime
from dateutil.parser import parse
from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, BooleanField, SelectField,\
DateTimeField, SubmitField
from wtforms.validators import Required, Length, Email
from wtforms import ValidationError
from ..models import User, Event, Location
... | mit | Python |
d973f95e1807cb27ac61febaa7ffbcf849252ffa | adjust labeling of demo_inset.py | leejjoon/pywcsgrid2 | examples/demo_inset.py | examples/demo_inset.py | import matplotlib.pyplot as plt
from astropy.io import fits as pyfits
from mpl_toolkits.axes_grid1.axes_grid import ImageGrid
import pywcsgrid2
#from pywcsgrid2.axes_wcs import AxesWcs, GridHelperWcs
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, mark_inset
import mpl_toolkits.axisartist as axisar... | import matplotlib.pyplot as plt
from astropy.io import fits as pyfits
from mpl_toolkits.axes_grid1.axes_grid import ImageGrid
import pywcsgrid2
#from pywcsgrid2.axes_wcs import AxesWcs, GridHelperWcs
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, mark_inset
import mpl_toolkits.axisartist as axisar... | mit | Python |
060b124888953d302d8611c459f978ef9201ae96 | update g95 version pattern | jschueller/numpy,SiccarPoint/numpy,NextThought/pypy-numpy,drasmuss/numpy,charris/numpy,drasmuss/numpy,BabeNovelty/numpy,dato-code/numpy,behzadnouri/numpy,pbrod/numpy,Anwesh43/numpy,jorisvandenbossche/numpy,Eric89GXL/numpy,ogrisel/numpy,mhvk/numpy,numpy/numpy,ahaldane/numpy,madphysicist/numpy,b-carter/numpy,stefanv/nump... | numpy/distutils/fcompiler/g95.py | numpy/distutils/fcompiler/g95.py | # http://g95.sourceforge.net/
import os
import sys
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler import FCompiler
class G95FCompiler(FCompiler):
compiler_type = 'g95'
# version_pattern = r'G95 \((GCC (?P<gccversion>[\d.]+)|.*?) \(g95!\) (?P<version>.*)\).*'
# $ g95 --version
... | # http://g95.sourceforge.net/
import os
import sys
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler import FCompiler
class G95FCompiler(FCompiler):
compiler_type = 'g95'
version_pattern = r'G95 \((GCC (?P<gccversion>[\d.]+)|.*?) \(g95!\) (?P<version>.*)\).*'
# $ g95 --version
... | bsd-3-clause | Python |
7e8e5ceb765189974bcaee86e15c26b94ac05f3a | Update modulation.py | Koheron/lase | examples/modulation.py | examples/modulation.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import initExample
import os
from lase.core import KClient
# Driver to use
from lase.drivers import Oscillo
# Modules to import
import numpy as np
import matplotlib.pyplot as plt
import time
# Load the oscillo instrument
host = os.getenv('HOST','192.168.1.100')
password... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import initExample
import os
from lase.core import KClient
# Driver to use
from lase.drivers import Oscillo
# Modules to import
import numpy as np
import matplotlib.pyplot as plt
import time
# Connect to Lase
host = os.getenv('HOST','192.168.1.100')
client = KClient(hos... | mit | Python |
6dbcc892f8b659a22a33fce3836cb082b64dd817 | load order | sl2017/campos | campos_event/__openerp__.py | campos_event/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of CampOS Event,
# an Odoo module.
#
# Copyright (c) 2015 Stein & Gabelgaard ApS
# http://www.steingabelgaard.dk
# Hans Henrik Gaelgaard
... | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of CampOS Event,
# an Odoo module.
#
# Copyright (c) 2015 Stein & Gabelgaard ApS
# http://www.steingabelgaard.dk
# Hans Henrik Gaelgaard
... | agpl-3.0 | Python |
00c07a76185aff4873abe3eb814b847b6d02f58f | fix date | jerodg/hackerrank-python | 02_BasicDataTypes/04_find-second-maximum-number-in-a-list.py | 02_BasicDataTypes/04_find-second-maximum-number-in-a-list.py | #!/usr/bin/python3.6
"""Jerod Gawne, 2017-09-28
Find the Second Largest Number
https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list/
Editorial:
- There are many ways to solve this problem.
This can be solved by maintaining two variables max and second_max.
Iterate through the list and fi... | #!/usr/bin/python3.6
"""Jerod Gawne, 2017-09-12
Find the Second Largest Number
https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list/
Editorial:
- There are many ways to solve this problem.
This can be solved by maintaining two variables max and second_max.
Iterate through the list and fi... | mit | Python |
0c305e8bd8624af2d2ce1ca292bb26095d0e1dcc | Fix __eq__ method on ExecuteContainer to compare only proper classes | jboss-container-images/concreate,jboss-container-images/concreate,jboss-container-images/concreate | cekit/descriptor/execute.py | cekit/descriptor/execute.py | import yaml
import cekit
from cekit.descriptor import Descriptor
execute_schemas = [yaml.safe_load("""
map:
name: {type: str}
script: {type: str}
user: {type: text}""")]
container_schemas = [yaml.safe_load("""
seq:
- {type: any}""")]
class Execute(Descripto... | import yaml
import cekit
from cekit.descriptor import Descriptor
execute_schemas = [yaml.safe_load("""
map:
name: {type: str}
script: {type: str}
user: {type: text}""")]
container_schemas = [yaml.safe_load("""
seq:
- {type: any}""")]
class Execute(Descripto... | mit | Python |
b0d88fccf51f240800fda462bddb9d934931c078 | Update tests.py | py-in-the-sky/challenges,py-in-the-sky/challenges,py-in-the-sky/challenges | intermediate_words_search_python/tests.py | intermediate_words_search_python/tests.py | # imports from solution
from main import solution, LOCAL_DICTIONARY
from utils import show_path
from time import time
TEST_CASES = (
# start word, target word, minimal path length
( 'cat', 'dog', 4 ),
( 'cat', 'mistrial', 9 ),
( 'strong', 'weak', 7 ),
( 'hot', 'cold'... | # imports from solution
from main import solution
from utils import show_path
def tests():
for search_method in ('BFS', 'A*'):
opts = { 'search_method': search_method }
assert solution('cat', 'dog', opts) == ('cat', 'cot', 'dot', 'dog')
assert solution('cat', 'dot', opts) == ('cat', 'cot... | mit | Python |
32e83559e00b7d5a363585d599cd087af854c445 | Support custom initializer in links.CRF1d | keisuke-umezawa/chainer,hvy/chainer,okuta/chainer,niboshi/chainer,niboshi/chainer,okuta/chainer,chainer/chainer,chainer/chainer,keisuke-umezawa/chainer,keisuke-umezawa/chainer,okuta/chainer,pfnet/chainer,tkerola/chainer,wkentaro/chainer,chainer/chainer,okuta/chainer,hvy/chainer,niboshi/chainer,hvy/chainer,chainer/chain... | chainer/links/loss/crf1d.py | chainer/links/loss/crf1d.py | from chainer.functions.loss import crf1d
from chainer import link
from chainer import variable
class CRF1d(link.Link):
"""Linear-chain conditional random field loss layer.
This link wraps the :func:`~chainer.functions.crf1d` function.
It holds a transition cost matrix as a parameter.
Args:
... | from chainer.functions.loss import crf1d
from chainer import link
from chainer import variable
class CRF1d(link.Link):
"""Linear-chain conditional random field loss layer.
This link wraps the :func:`~chainer.functions.crf1d` function.
It holds a transition cost matrix as a parameter.
Args:
... | mit | Python |
8214d516b3feba92ab3ad3b1f2fa1cf253e83012 | Remove use of deprecated `scan_plugins` method | chfw/pyexcel,chfw/pyexcel | pyexcel/internal/__init__.py | pyexcel/internal/__init__.py | """
pyexcel.internal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pyexcel internals that subjected to change
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
from lml.loader import scan_plugins
from pyexcel.internal.plugins import PARSER, RENDERER # noqa
from pyexcel.int... | """
pyexcel.internal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pyexcel internals that subjected to change
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
from lml.loader import scan_plugins
from pyexcel.internal.plugins import PARSER, RENDERER # noqa
from pyexcel.int... | bsd-3-clause | Python |
708e105713d7fd480b4b45d3ef31a46e35e63a8e | annotate calculate_tx_fee. | PeerAssets/pypeerassets | pypeerassets/transactions.py | pypeerassets/transactions.py |
'''transaction assembly/dissasembly'''
from time import time
from math import ceil
from btcpy.structs.address import Address
from btcpy.structs.transaction import TxOut, TxIn, Sequence, Locktime, MutableTransaction
from btcpy.structs.script import StackData, ScriptSig, NulldataScript, ScriptSig, ScriptPubKey
from btc... |
'''transaction assembly/dissasembly'''
from time import time
from math import ceil
from btcpy.structs.address import Address
from btcpy.structs.transaction import TxOut, TxIn, Sequence, Locktime, MutableTransaction
from btcpy.structs.script import StackData, ScriptSig, NulldataScript, ScriptSig, ScriptPubKey
from btc... | bsd-3-clause | Python |
56e4c14ea6e2266bb8fa6f25ef1c0a3b2123f5ad | fix py3k | squeaky-pl/pystacia,squeaky-pl/pystacia | pystacia/image/_impl/blur.py | pystacia/image/_impl/blur.py | # coding: utf-8
# pystacia/image/_impl/blur.py
# Copyright (C) 2011-2012 by Paweł Piotr Przeradowski
# This module is part of Pystacia and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from future_builtins import zip
def _make_radius_strength_bias(c_name, names, order=Non... | # coding: utf-8
# pystacia/image/_impl/blur.py
# Copyright (C) 2011-2012 by Paweł Piotr Przeradowski
# This module is part of Pystacia and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
def _make_radius_strength_bias(c_name, names, order=None):
def function(image, *args)... | mit | Python |
27273335422781dcee950ee081ed13e53816e6d6 | Bump version | thombashi/pytablewriter | pytablewriter/__version__.py | pytablewriter/__version__.py | __author__ = "Tsuyoshi Hombashi"
__copyright__ = f"Copyright 2016, {__author__}"
__license__ = "MIT License"
__version__ = "0.63.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| __author__ = "Tsuyoshi Hombashi"
__copyright__ = f"Copyright 2016, {__author__}"
__license__ = "MIT License"
__version__ = "0.62.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
349f975e257192458b1944753d4f609869b9e8d6 | use yield_fixture to support pytest on py2.7 | fireeye/flare-wmi,fireeye/flare-wmi,fireeye/flare-wmi | python-cim/tests/fixtures.py | python-cim/tests/fixtures.py | import os
import pytest
import cim
import cim.objects
@pytest.fixture
def repopath():
"""
Returns:
str: path to the repos/win7/deleted-instance repository
"""
cd = os.path.dirname(os.path.abspath(__file__))
return os.path.join(cd, 'repos', 'win7', 'deleted-instance')
@pytest.fixture
de... | import os
import pytest
import cim
import cim.objects
@pytest.fixture
def repopath():
"""
Returns:
str: path to the repos/win7/deleted-instance repository
"""
cd = os.path.dirname(os.path.abspath(__file__))
return os.path.join(cd, 'repos', 'win7', 'deleted-instance')
@pytest.fixture
de... | apache-2.0 | Python |
fe4c66b2e50035ab2701923d6a2cd0cb82e63780 | Fix call mkl gemm in mkldnn.py (#7007) | Laurawly/tvm-1,dmlc/tvm,dmlc/tvm,Laurawly/tvm-1,Laurawly/tvm-1,Laurawly/tvm-1,Laurawly/tvm-1,dmlc/tvm,Laurawly/tvm-1,dmlc/tvm,Laurawly/tvm-1,dmlc/tvm,Laurawly/tvm-1,dmlc/tvm,Laurawly/tvm-1,dmlc/tvm,dmlc/tvm,dmlc/tvm,Laurawly/tvm-1 | python/tvm/contrib/mkldnn.py | python/tvm/contrib/mkldnn.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 (the
# "License"); you may not u... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 | Python |
a2097bf7c3103ec6e0482bb34f3b33c753ea7889 | Enable QtNetwork test for PySide | davvid/qtpy,davvid/qtpy,spyder-ide/qtpy,goanpeca/qtpy,goanpeca/qtpy | qtpy/tests/test_qtnetwork.py | qtpy/tests/test_qtnetwork.py | from __future__ import absolute_import
import pytest
from qtpy import PYSIDE, PYSIDE2, QtNetwork
def test_qtnetwork():
"""Test the qtpy.QtNetwork namespace"""
assert QtNetwork.QAbstractNetworkCache is not None
assert QtNetwork.QNetworkCacheMetaData is not None
if not PYSIDE and not PYSIDE2:
a... | from __future__ import absolute_import
import pytest
from qtpy import PYSIDE, PYSIDE2, QtNetwork
@pytest.mark.skipif(PYSIDE2 or PYSIDE, reason="It fails on PySide/PySide2")
def test_qtnetwork():
"""Test the qtpy.QtNetwork namespace"""
assert QtNetwork.QAbstractNetworkCache is not None
assert QtNetwork.QN... | mit | Python |
cd323386b61cd280fcf3e599ae6a02b889f81a40 | Remove support for old style api urls | getsentry/raven-python,johansteffner/raven-python,getsentry/raven-python,johansteffner/raven-python,johansteffner/raven-python,getsentry/raven-python | raven/contrib/django/urls.py | raven/contrib/django/urls.py | """
raven.contrib.django.urls
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
try:
from django.conf.urls import url
except ImportError:
# for Django version less than 1... | """
raven.contrib.django.urls
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
try:
from django.conf.urls import url
except ImportError:
# for Django version less than 1... | bsd-3-clause | Python |
80c0f29d7b81a68d14e261ce1c062d37a0e6d4f7 | Increase ARM process startup time baseline | firecracker-microvm/firecracker,firecracker-microvm/firecracker,firecracker-microvm/firecracker,firecracker-microvm/firecracker,firecracker-microvm/firecracker | tests/integration_tests/performance/test_process_startup_time.py | tests/integration_tests/performance/test_process_startup_time.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Test that the process startup time up to socket bind is within spec."""
import json
import os
import platform
import time
import host_tools.logging as log_tools
MAX_STARTUP_TIME_CPU_US = {'x86_64': 5500... | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Test that the process startup time up to socket bind is within spec."""
import json
import os
import platform
import time
import host_tools.logging as log_tools
MAX_STARTUP_TIME_CPU_US = {'x86_64': 5500... | apache-2.0 | Python |
0a80fa2e610637a6c657f99c8eac5d99e33b5844 | Use /usr/bin/env in #! | chisophugis/clang-compdb-in-object-file,chisophugis/clang-compdb-in-object-file | lines2jsonarray.py | lines2jsonarray.py | #!/usr/bin/env python
from __future__ import print_function
import sys
print('[')
for i, line in enumerate(sys.stdin):
if i != 0:
print(',')
print(line)
print(']')
| #!/usr/bin/python
from __future__ import print_function
import sys
print('[')
for i, line in enumerate(sys.stdin):
if i != 0:
print(',')
print(line)
print(']')
| mit | Python |
14884a18b42dab22e5893c619164049a475888cc | fix traceback on bank accounts creation | ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo | addons/account_bank_statement_import/wizard/setup_wizards.py | addons/account_bank_statement_import/wizard/setup_wizards.py | # -*- coding: utf-8 -*-
from odoo import models, fields, api
class SetupBarBankConfigWizard(models.TransientModel):
_inherit = 'account.setup.bank.manual.config'
def validate(self):
""" Default the bank statement source of new bank journals as 'file_import'
"""
super(SetupBarBankConf... | # -*- coding: utf-8 -*-
from odoo import models, fields, api
class SetupBarBankConfigWizard(models.TransientModel):
_inherit = 'account.setup.bank.manual.config'
def validate(self):
""" Default the bank statement source of new bank journals as 'file_import'
"""
super(SetupBarBankConf... | agpl-3.0 | Python |
8fbdced7a4c8ea61116e8c978e420c30b8a1f1dc | update for urls.py | cdelguercio/slothauth,cdelguercio/slothauth | slothauth/urls.py | slothauth/urls.py | from django.conf.urls import include, url
from rest_framework.routers import DefaultRouter
from .views import change_email, login, logout, password_reset, profile, signup, passwordless_signup,\
passwordless_login, AccountViewSet, AuthViewSet
from . import settings
router = DefaultRouter()
router.... | from django.conf.urls import include, url
from rest_framework.routers import DefaultRouter
from .views import change_email, login, logout, password_reset, profile, signup, passwordless_signup,\
passwordless_login, AccountViewSet, AuthViewSet
from . import settings
router = DefaultRouter()
router.... | apache-2.0 | Python |
ac765968a9a83685c28244200958164d2a0fc81e | fix typo | nyaruka/smartmin,nyaruka/smartmin,nyaruka/smartmin,caktus/smartmin,caktus/smartmin,caktus/smartmin,caktus/smartmin | smartmin/email.py | smartmin/email.py | from django.conf import settings
from django.template import Context
from django.utils.module_loading import import_string
def link_components(request, user=None):
protocol = 'https' if request.is_secure() else 'http'
hostname = getattr(settings, 'HOSTNAME', request.get_host())
return {"protocol": proto... | from django.conf import settings
from django.template import Context
from django.utils.module_loading import import_string
def link_components(request, user=None):
protocol = 'https' if request.is_secure() else 'http'
hostname = getattr(settings, 'HOSTNAME', request.get_host())
return {"protocol": proto... | bsd-3-clause | Python |
091735fce650d6326e73ca6fb224a77ae68bb601 | Add data written to message | Frostman/SalaryZenAggregator,Frostman/SalaryZenAggregator_Old | salaryzenaggr/manager.py | salaryzenaggr/manager.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 |
1dd8ce20632d8a6b857a06136b89ac11b27c8f07 | Update documentation | bwhicks/PlinyProject,bwhicks/PlinyProject,bwhicks/PlinyProject,bwhicks/PlinyProject | letters/models.py | letters/models.py | from django.db import models
from common.models import Citation
class Letter(models.Model):
"""A letter from one of Pliny's books of personal correspondence
Attributes:
book (PositiveSmallIntegerField): book number.
manuscript_correspondent_name (CharField): override if manuscript
... | from django.db import models
from common.models import Citation
class Letter(models.Model):
"""A letter from one of Pliny's books of personal correspondence"""
book = models.PositiveSmallIntegerField()
manuscript_correspondent_name = models.CharField(blank=True, max_length=255)
letter = models.Positiv... | mit | Python |
c1be270c96ef07faa7ceecf4117890ce06af65a8 | Update setup.py | IntelRealSense/librealsense,IntelRealSense/librealsense,IntelRealSense/librealsense,IntelRealSense/librealsense,IntelRealSense/librealsense,IntelRealSense/librealsense,IntelRealSense/librealsense,IntelRealSense/librealsense,IntelRealSense/librealsense | wrappers/python/setup.py | wrappers/python/setup.py | from setuptools import setup, find_packages
from setuptools.dist import Distribution
# _version.py should be generated by running find_librs_version.py and copied to pyrealsense2 folder
from pyrealsense2._version import __version__
import os
import io
package_name = "pyrealsense2"
package_data = {}
print("version =... | from setuptools import setup, find_packages
from setuptools.dist import Distribution
# _version.py should be generated by running find_librs_version.py and copied to pyrealsense2 folder
from pyrealsense2._version import __version__
import os
import io
package_name = "pyrealsense2"
package_data = {}
print("version =... | apache-2.0 | Python |
60ccc393fc428d609e772b838c5a4c4002e3ec49 | Add sendError method | tsnik/SkyNet | snp/SNProtocol.py | snp/SNProtocol.py | from twisted.internet import defer
from twisted.protocols.basic import NetstringReceiver
import json
class SNError(Exception):
def __init__(self, *args, **kwargs):
Exception.__init__(self, args, kwargs)
self.code = args[1]
self.request = args[2]
class SNProtocol(NetstringReceiver):
i... | from twisted.internet import defer
from twisted.protocols.basic import NetstringReceiver
import json
class SNError(Exception):
def __init__(self, *args, **kwargs):
Exception.__init__(self, args, kwargs)
self.code = args[1]
self.request = args[2]
class SNProtocol(NetstringReceiver):
i... | mit | Python |
b223865ded88b5467c1088abbf628048e39e564c | Test str_cat() schema; use fixtures for exception tests | ContinuumIO/blaze,ContinuumIO/blaze | blaze/expr/tests/test_strings.py | blaze/expr/tests/test_strings.py | import pytest
from datashape import dshape
from blaze import symbol
dshapes = ['var * {name: string}',
'var * {name: ?string}',
'var * string',
'var * ?string',
'string']
lhsrhs_ds = ['var * {name: string, comment: string[25]}',
'var * {name: string[10], comme... | import pytest
from datashape import dshape
from blaze import symbol
dshapes = ['var * {name: string}',
'var * {name: ?string}',
'var * string',
'var * ?string',
'string']
@pytest.mark.parametrize('ds', dshapes)
def test_like(ds):
t = symbol('t', ds)
expr = getattr(... | bsd-3-clause | Python |
09fffb062b45e4715c092c0899a6d4f89cf0b4e1 | Fix toolbarbox test | azjps/bokeh,Karel-van-de-Plassche/bokeh,rs2/bokeh,dennisobrien/bokeh,ericmjl/bokeh,schoolie/bokeh,aavanian/bokeh,dennisobrien/bokeh,mindriot101/bokeh,Karel-van-de-Plassche/bokeh,philippjfr/bokeh,jakirkham/bokeh,rs2/bokeh,stonebig/bokeh,phobson/bokeh,draperjames/bokeh,philippjfr/bokeh,timsnyder/bokeh,azjps/bokeh,DuCorey... | bokeh/models/tests/test_tools.py | bokeh/models/tests/test_tools.py | from __future__ import absolute_import
from bokeh.models.layouts import Box
from bokeh.models.tools import Toolbar, ToolbarBox
# TODO (bev) validate entire list of props
def test_Toolbar():
tb = Toolbar()
assert tb.active_drag == 'auto'
assert tb.active_scroll == 'auto'
assert tb.active_tap == 'aut... | from __future__ import absolute_import
from bokeh.models.layouts import Box
from bokeh.models.tools import Toolbar, ToolbarBox
# TODO (bev) validate entire list of props
def test_Toolbar():
tb = Toolbar()
assert tb.active_drag == 'auto'
assert tb.active_scroll == 'auto'
assert tb.active_tap == 'aut... | bsd-3-clause | Python |
9fbab30f5d32d96460c7c8188f21a94aa050e0cb | add baomihua.com | lcplj123/video-dl,lcplj123/video-get | extractors/baomihua.py | extractors/baomihua.py | #!/usr/bin/env python3
import re
import sys
import json
sys.path.append('..')
from define import *
from utils import *
from extractor import BasicExtractor
import urllib.parse
class BaoMiHuaExtractor(BasicExtractor):
'''
ku6下载器
'''
def __init__(self,c):
super(BaoMiHuaExtractor,self).__init__(c, BAOMIHUA)
def d... | #!/usr/bin/env python3 | mit | Python |
edb1c61a7ded49b63e272bd409fcbf6468173948 | remove comment | bit-bots/bitbots_behaviour | bitbots_head_behavior/src/bitbots_head_behavior/head_node.py | bitbots_head_behavior/src/bitbots_head_behavior/head_node.py | #!/usr/bin/env python3
"""
This is the ROS-Node which contains the head behavior, starts the appropriate DSD, initializes the HeadBlackboard
and subscribes to head_behavior specific ROS-Topics.
"""
import os
import rospy
from bitbots_blackboard.blackboard import HeadBlackboard
from dynamic_stack_decider.dsd import DS... | #!/usr/bin/env python3
"""
This is the ROS-Node which contains the head behavior, starts the appropriate DSD, initializes the HeadBlackboard
and subscribes to head_behavior specific ROS-Topics.
"""
import os
import rospy
from bitbots_blackboard.blackboard import HeadBlackboard
from dynamic_stack_decider.dsd import DS... | bsd-3-clause | Python |
0fceb297dc4855cd5617daaf9821fb3a332c19ed | Fix descriptions | roderickm/MediaCrush,MediaCrush/MediaCrush,MediaCrush/MediaCrush,roderickm/MediaCrush,nerdzeu/NERDZCrush,roderickm/MediaCrush,nerdzeu/NERDZCrush,nerdzeu/NERDZCrush | mediacrush/slimdown.py | mediacrush/slimdown.py | from functools import partial
from markdown import Markdown, odict
from markdown.blockprocessors import build_block_parser
from markdown.preprocessors import build_preprocessors
from markdown.inlinepatterns import build_inlinepatterns
from markdown.treeprocessors import build_treeprocessors
slimdown = Markdown(safe_m... | from functools import partial
from markdown import Markdown, odict
from markdown.blockprocessors import build_block_parser
from markdown.preprocessors import build_preprocessors
from markdown.inlinepatterns import build_inlinepatterns
from markdown.treeprocessors import build_treeprocessors
slimdown = Markdown(safe_m... | mit | Python |
a23a1050501563889c2806a514fe2994a2ebe3a8 | Add python3 support in example | johnwlockwood/stream_tap,johnwlockwood/karl_data,johnwlockwood/stream_tap,johnwlockwood/iter_karld_tools | example/consume_many_csv_files.py | example/consume_many_csv_files.py | from __future__ import print_function
from itertools import chain
try:
from itertools import imap
except ImportError:
# if python 3
imap = map
import karld
from karld.path import i_walk_csv_paths
def main():
"""
Consume many csv files as if one.
"""
import pathlib
input_dir = pathl... | from __future__ import print_function
from itertools import chain
from itertools import imap
import karld
from karld.path import i_walk_csv_paths
def main():
"""
Consume many csv files as if one.
"""
import pathlib
input_dir = pathlib.Path('test_data/things_kinds')
# # Use a generator expr... | apache-2.0 | Python |
d27c34c65198280e324c37acda7f33ece07c2c92 | make text field usage consistnt | ChristosChristofidis/bokeh,percyfal/bokeh,quasiben/bokeh,birdsarah/bokeh,tacaswell/bokeh,schoolie/bokeh,percyfal/bokeh,muku42/bokeh,ahmadia/bokeh,phobson/bokeh,ericmjl/bokeh,timsnyder/bokeh,ericmjl/bokeh,abele/bokeh,laurent-george/bokeh,KasperPRasmussen/bokeh,stuart-knock/bokeh,ChristosChristofidis/bokeh,roxyboy/bokeh,... | examples/plotting/server/markers.py | examples/plotting/server/markers.py | # The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
from numpy.random import random
from bokeh.plotting import *
def mscatter(p, x, y, typestr):
p.scatter(x, y, marker=typestr,
line_color="#6666ee", fill_color="#ee6666", fill_alpha=0.5, size=12)
def mtext(p, x, y,... | # The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
from numpy.random import random
from bokeh.plotting import *
def mscatter(p, x, y, typestr):
p.scatter(x, y, marker=typestr,
line_color="#6666ee", fill_color="#ee6666", fill_alpha=0.5, size=12)
def mtext(p, x, y,... | bsd-3-clause | Python |
0051b5a5e287057cab06452d4f178e4c04cbd0c5 | Put the win_osinfo classes in a helper function | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/utils/win_osinfo.py | salt/utils/win_osinfo.py | # -*- coding: utf-8 -*-
'''
Get Version information from Windows
'''
# http://stackoverflow.com/questions/32300004/python-ctypes-getting-0-with-getversionex-function
from __future__ import absolute_import
# Import Third Party Libs
import ctypes
try:
from ctypes.wintypes import BYTE, WORD, DWORD, WCHAR
HAS_WIN3... | # -*- coding: utf-8 -*-
'''
Get Version information from Windows
'''
# http://stackoverflow.com/questions/32300004/python-ctypes-getting-0-with-getversionex-function
from __future__ import absolute_import
# Import Third Party Libs
import ctypes
try:
from ctypes.wintypes import BYTE, WORD, DWORD, WCHAR
HAS_WIN3... | apache-2.0 | Python |
1cc1df8c00a7a956b0a1207f99928f731714541a | add main path reminder in TaskLog | CaptainDesAstres/Blender-Render-Manager,CaptainDesAstres/Simple-Blender-Render-Manager | TaskList/TaskLog/TaskLog.py | TaskList/TaskLog/TaskLog.py | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage task running log'''
import xml.etree.ElementTree as xmlMod
from TaskList.TaskLog.GroupLog import *
from Preferences.PresetList.Preset.Preset import *
from Preferences.PresetList.Preset.Metapreset import *
class TaskLog:
'''class to manage task running lo... | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage task running log'''
import xml.etree.ElementTree as xmlMod
from TaskList.TaskLog.GroupLog import *
from Preferences.PresetList.Preset.Preset import *
from Preferences.PresetList.Preset.Metapreset import *
class TaskLog:
'''class to manage task running lo... | mit | Python |
32ab2353d7a7f64300445688b0bd583fbe1a13fb | Improve keystone.conf [endpoint_policy] documentation | mahak/keystone,mahak/keystone,rajalokan/keystone,ilay09/keystone,openstack/keystone,ilay09/keystone,openstack/keystone,openstack/keystone,rajalokan/keystone,mahak/keystone,rajalokan/keystone,cernops/keystone,ilay09/keystone,cernops/keystone | keystone/conf/endpoint_policy.py | keystone/conf/endpoint_policy.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 | Python |
29384b927b620b7e943343409f62511451bb3059 | Fix problem with Hopfield energy function for Python 2.7 | stczhc/neupy,stczhc/neupy,itdxer/neupy,itdxer/neupy,stczhc/neupy,stczhc/neupy,itdxer/neupy,itdxer/neupy | neupy/algorithms/memory/utils.py | neupy/algorithms/memory/utils.py | from numpy import where, inner
from numpy.core.umath_tests import inner1d
__all__ = ('sign2bin', 'bin2sign', 'hopfield_energy')
def sign2bin(matrix):
return where(matrix == 1, 1, 0)
def bin2sign(matrix):
return where(matrix == 0, -1, 1)
def hopfield_energy(weight, input_data, output_data):
return -0... | from numpy import where
__all__ = ('sign2bin', 'bin2sign', 'hopfield_energy')
def sign2bin(matrix):
return where(matrix == 1, 1, 0)
def bin2sign(matrix):
return where(matrix == 0, -1, 1)
def hopfield_energy(weight, input_data, output_data):
energy_output = -0.5 * input_data.dot(weight).dot(output_da... | mit | Python |
bf28376f252fd474d594e5039d0b2f2bb1afc26a | Add proper warnings on use of the backwards compatibility shim. | ipython/ipython,ipython/ipython | IPython/frontend.py | IPython/frontend.py | """
Shim to maintain backwards compatibility with old frontend imports.
We have moved all contents of the old `frontend` subpackage into top-level
subpackages (`html`, `qt` and `terminal`). This will let code that was making
`from IPython.frontend...` calls continue working, though a warning will be
printed.
"""
#--... | import sys
import types
class ShimModule(types.ModuleType):
def __getattribute__(self, key):
exec 'from IPython import %s' % key
return eval(key)
sys.modules['IPython.frontend'] = ShimModule('frontend')
| bsd-3-clause | Python |
7f800ee03790d28a25f0f5989c8f6a15401af172 | remove print statement | mmohrhard/crash,Liongold/crash,Liongold/crash,mmohrhard/crash,Liongold/crash,mmohrhard/crash | django/crashreport/symbols/views.py | django/crashreport/symbols/views.py | # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from django.shortcuts import rende... | # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from django.shortcuts import rende... | mpl-2.0 | Python |
f782633c857932803283dd9c26621e69f6ccb44e | fix version | acysos/odoo-addons,acysos/odoo-addons,acysos/odoo-addons | l10n_es_aeat_sii/__manifest__.py | l10n_es_aeat_sii/__manifest__.py | # -*- coding: utf-8 -*-
# Copyright 2017 Ignacio Ibeas <ignacio@acysos.com>
# (c) 2017 Diagram Software S.L.
# Copyright (c) 2017-TODAY MINORISA <ramon.guiu@minorisa.net>
# (c) 2017 Studio73 - Pablo Fuentes <pablo@studio73.es>
# (c) 2017 Studio73 - Jordi Tolsà <jordi@studio73.es>
# License AGPL-3.0 or later (http://www... | # -*- coding: utf-8 -*-
# Copyright 2017 Ignacio Ibeas <ignacio@acysos.com>
# (c) 2017 Diagram Software S.L.
# Copyright (c) 2017-TODAY MINORISA <ramon.guiu@minorisa.net>
# (c) 2017 Studio73 - Pablo Fuentes <pablo@studio73.es>
# (c) 2017 Studio73 - Jordi Tolsà <jordi@studio73.es>
# License AGPL-3.0 or later (http://www... | agpl-3.0 | Python |
7d7b12d176a0315057c54eff794fbe7117c7f6da | Include the Python version in the support tracking data. | bkochendorfer/reviewboard,sgallagher/reviewboard,reviewboard/reviewboard,1tush/reviewboard,reviewboard/reviewboard,reviewboard/reviewboard,KnowNo/reviewboard,KnowNo/reviewboard,1tush/reviewboard,brennie/reviewboard,custode/reviewboard,1tush/reviewboard,davidt/reviewboard,custode/reviewboard,1tush/reviewboard,beol/revie... | reviewboard/admin/support.py | reviewboard/admin/support.py | from __future__ import unicode_literals
import base64
import sys
import time
from datetime import datetime
from hashlib import sha1
from django.conf import settings
from django.contrib.auth.models import User
from djblets.siteconfig.models import SiteConfiguration
from reviewboard import get_package_version
def ge... | from __future__ import unicode_literals
import base64
import time
from datetime import datetime
from hashlib import sha1
from django.conf import settings
from django.contrib.auth.models import User
from djblets.siteconfig.models import SiteConfiguration
from reviewboard import get_package_version
def get_install_k... | mit | Python |
64d5847f058dec81a288482665a1d8208f0f4e17 | Fix security issue in singularity + misc cleanups (#8657) | iulian787/spack,LLNL/spack,mfherbst/spack,krafczyk/spack,LLNL/spack,mfherbst/spack,mfherbst/spack,LLNL/spack,krafczyk/spack,iulian787/spack,mfherbst/spack,iulian787/spack,krafczyk/spack,iulian787/spack,LLNL/spack,krafczyk/spack,mfherbst/spack,LLNL/spack,krafczyk/spack,iulian787/spack | var/spack/repos/builtin/packages/singularity/package.py | var/spack/repos/builtin/packages/singularity/package.py | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python |
346e6c45b3c2a49168eac9fd1b703bd5c05503b1 | fix sql дата начала-создания направления из подверждения исследования | moodpulse/l2,moodpulse/l2,moodpulse/l2,moodpulse/l2,moodpulse/l2 | rmis_integration/sql_func.py | rmis_integration/sql_func.py | from django.db import connection
from laboratory.settings import TIME_ZONE
def get_confirm_direction(d_s, d_e, limit):
with connection.cursor() as cursor:
cursor.execute(
"""WITH
t_all_direction AS (
SELECT DISTINCT ON (napravleniye_id) napravleniye_id FROM public.dire... | from django.db import connection
from laboratory.settings import TIME_ZONE
def get_confirm_direction(d_s, d_e, limit):
with connection.cursor() as cursor:
cursor.execute(
"""WITH
t_all_direction AS (
SELECT DISTINCT ON (napravleniye_id) napravleniye_id FROM public.dire... | mit | Python |
77ffc94a0439dd7309df0630cddba7daf60bc5ee | Add imported requests to Audit context. | hyperNURb/ggrc-core,hasanalom/ggrc-core,jmakov/ggrc-core,edofic/ggrc-core,hasanalom/ggrc-core,hasanalom/ggrc-core,kr41/ggrc-core,edofic/ggrc-core,uskudnik/ggrc-core,kr41/ggrc-core,vladan-m/ggrc-core,plamut/ggrc-core,uskudnik/ggrc-core,jmakov/ggrc-core,uskudnik/ggrc-core,andrei-karalionak/ggrc-core,uskudnik/ggrc-core,se... | src/ggrc/converters/requests.py | src/ggrc/converters/requests.py | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: silas@reciprocitylabs.com
# Maintained By: silas@reciprocitylabs.com
from .base import *
from ggrc.models import Audit, Request
from .base_row impo... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: silas@reciprocitylabs.com
# Maintained By: silas@reciprocitylabs.com
from .base import *
from ggrc.models import Request
from .base_row import *
fr... | apache-2.0 | Python |
3b950782e0f4140715084ebace2820db4f61c600 | Fix reindent-rst.py: it works on binary files | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Tools/scripts/reindent-rst.py | Tools/scripts/reindent-rst.py | #!/usr/bin/env python
# Make a reST file compliant to our pre-commit hook.
# Currently just remove trailing whitespace.
import sys, re, shutil
ws_re = re.compile(br'\s+(\r?\n)$')
def main(argv=sys.argv):
rv = 0
for filename in argv[1:]:
try:
with open(filename, 'rb') as f:
... | #!/usr/bin/env python
# Make a reST file compliant to our pre-commit hook.
# Currently just remove trailing whitespace.
import sys, re, shutil
ws_re = re.compile(r'\s+(\r?\n)$')
def main(argv=sys.argv):
rv = 0
for filename in argv[1:]:
try:
with open(filename, 'rb') as f:
... | mit | Python |
5221630769f53853fea490e04301c2a19711894c | Fix #296. Generate name according to profile's sex. Thanks @Dutcho for the report | HAYASAKA-Ryosuke/faker,trtd/faker,joke2k/faker,danhuss/faker,meganlkm/faker,joke2k/faker | faker/providers/profile/__init__.py | faker/providers/profile/__init__.py | # coding=utf-8
from .. import BaseProvider
import itertools
class Provider(BaseProvider):
"""
This provider is a collection of functions to generate personal profiles and identities.
"""
def simple_profile(self):
"""
Generates a basic profile with personal informations
"""
... | # coding=utf-8
from .. import BaseProvider
import itertools
class Provider(BaseProvider):
"""
This provider is a collection of functions to generate personal profiles and identities.
"""
def simple_profile(self):
"""
Generates a basic profile with personal informations
"""
... | mit | Python |
981a74b116081f3ce1d97262c3c88104a953cdf4 | Use numpy's float supporting range | Mause/statistical_atlas_of_au | saau/sections/misc/header.py | saau/sections/misc/header.py | import matplotlib.pyplot as plt
from operator import itemgetter
from lxml.etree import fromstring, XMLSyntaxError
import numpy as np
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:... | import matplotlib.pyplot as plt
from operator import gt, lt, itemgetter
from lxml.etree import fromstring, XMLSyntaxError
def frange(start, stop, step):
cur = start
op = gt if start > stop else lt
while op(cur, stop):
yield cur
cur += step
def parse_lines(lines):
for line in lines:
... | mit | Python |
4e2fa3a249b9027f9e50f0f957163cad3bdc28bf | Fix typo | cpsaltis/pythogram-core | src/gramcore/features/points.py | src/gramcore/features/points.py | """Functions for extracting interest points.
These are applied to numpy.arrays representing images.
"""
import numpy
from skimage import feature
def harris(parameters):
"""Harris interest point operator.
It wraps `skimage.feature.harris`. The `threshold`, `eps` and
`gaussian_deviation` options are not ... | """Functions for extracting interest points.
These are applied to numpy.arrays representing images.
"""
import numpy
from skimage import feature
def harris(parameters):
"""Harris interest point operator.
It wraps `skimage.feature.harris`. The `threshold`, `eps` and
`gaussian_deviation` options are not ... | mit | Python |
f4bbb244716f9471b520f53ebffaf34a31503cd1 | Remove unused imports (besides they are Py 2.x only) | CoolProp/CoolProp,CoolProp/CoolProp,henningjp/CoolProp,henningjp/CoolProp,CoolProp/CoolProp,CoolProp/CoolProp,CoolProp/CoolProp,henningjp/CoolProp,henningjp/CoolProp,henningjp/CoolProp,henningjp/CoolProp,henningjp/CoolProp,CoolProp/CoolProp,CoolProp/CoolProp,henningjp/CoolProp,CoolProp/CoolProp | Web/scripts/CPWeb/__init__.py | Web/scripts/CPWeb/__init__.py | """
CPWeb - A collection of commonly used routines to produce CoolProp's online documentation
=====
"""
from __future__ import division, absolute_import, print_function
def get_version():
return 5.0
if __name__ == "__main__":
print('You are using version %s of the Python package for creating CoolProp\' onli... | """
CPWeb - A collection of commonly used routines to produce CoolProp's online documentation
=====
"""
from __future__ import division, absolute_import, print_function
import codecs
import csv
import cStringIO
def get_version():
return 5.0
if __name__ == "__main__":
print('You are using version %s of the... | mit | Python |
3b77fbb82d2ba098f00f7221070f9610d0d90809 | add unknown person | tomviner/dojo-adventure-game | game.py | game.py | import random
from adventurelib import Item, Bag, when, start
import rooms
import characters
from sys import exit
people = '123456'
rooms = 'abcdef'
# murder configuration
# who was where
# who is the murderer
# current configuration
# who was where
# player location
murder_config_people = list(people)
random.... | import random
from adventurelib import Item, Bag, when, start
import rooms
import characters
from sys import exit
people = '123456'
rooms = 'abcdef'
# murder configuration
# who was where
# who is the murderer
# current configuration
# who was where
# player location
murder_config_people = list(people)
random.... | mit | Python |
144a35d639ccd3a60f100793df00fd62aa81766b | document no trust algo | tomviner/network-rock-paper-scissors | game.py | game.py | """
Play with trust:
for player in game:
if current player:
send move
else:
listen for move
receive move
decide winner
Play trusting no one:
Swap hashes:
for player in game:
if current player:
send hasher(move + salt)
else:
listen for hash
... | """
For player in game:
if current player:
send move
else:
listen for move
receive move
decide winner
"""
| bsd-2-clause | Python |
866e0ec72163debd9f46b1ecb8e4d07b040694b4 | Fix absolute import | testedminds/sand,testedminds/sand | sand/cytoscape/themes/ops.py | sand/cytoscape/themes/ops.py | from . import colors as c
from . import label_positions as p
settings = {
# node style
'NODE_TRANSPARENCY': 255,
'NODE_SIZE': 25,
'NODE_BORDER_WIDTH': 4,
'NODE_BORDER_PAINT': c.BRIGHT_GREEN,
'NODE_FILL_COLOR': c.DARK_GREEN,
'NODE_SELECTED_PAINT': c.BRIGHT_YELLOW,
# node label style
... | import sand.cytoscape.themes.colors as c
import sand.cytoscape.themes.label_positions as p
settings = {
# node style
'NODE_TRANSPARENCY': 255,
'NODE_SIZE': 25,
'NODE_BORDER_WIDTH': 4,
'NODE_BORDER_PAINT': c.BRIGHT_GREEN,
'NODE_FILL_COLOR': c.DARK_GREEN,
'NODE_SELECTED_PAINT': c.BRIGHT_YELL... | apache-2.0 | Python |
75635315598ccbcad887bf77f7cdc99772157033 | Add construct_data function to construct data for the API | meetmangukiya/gistey,meetmangukiya/gistey | gist.py | gist.py | import os
import sys
from parser import parser
args = parser.parse_args()
def process_files(args):
"""
:param args:
The arguments parsed by argparse
:returns:
A dict containing file_names as keys and a
dict containing a key `content` as the value
Example return:
{
... | import os
import sys
from parser import parser
args = parser.parse_args()
def process_files(args):
"""
:param args:
The arguments parsed by argparse
:returns:
A dict containing file_names as keys and a
dict containing a key `content` as the value
Example return:
{
... | mit | Python |
37ab58016e69993b5ab1d63c99d9afcf54bd95af | Implement more TGT Neutral Epics | Meerkov/fireplace,Ragowit/fireplace,oftc-ftw/fireplace,liujimj/fireplace,oftc-ftw/fireplace,smallnamespace/fireplace,Ragowit/fireplace,Meerkov/fireplace,liujimj/fireplace,amw2104/fireplace,beheh/fireplace,amw2104/fireplace,NightKev/fireplace,smallnamespace/fireplace,jleclanche/fireplace | fireplace/cards/tgt/neutral_epic.py | fireplace/cards/tgt/neutral_epic.py | from ..utils import *
##
# Minions
# Twilight Guardian
class AT_017:
play = HOLDING_DRAGON & Buff(SELF, "AT_017e")
# Sideshow Spelleater
class AT_098:
play = Summon(CONTROLLER, Copy(ENEMY_HERO_POWER))
# Kodorider
class AT_099:
inspire = Summon(CONTROLLER, "AT_099t")
# Master of Ceremonies
class AT_117:
pla... | from ..utils import *
##
# Minions
# Kodorider
class AT_099:
inspire = Summon(CONTROLLER, "AT_099t")
| agpl-3.0 | Python |
dfe1213ba9de5e5e5aaf9690a2cf5e3b295869fa | Remove Python 3 incompatible print statement | RMKD/networkx,jakevdp/networkx,JamesClough/networkx,jni/networkx,harlowja/networkx,debsankha/networkx,andnovar/networkx,tmilicic/networkx,ghdk/networkx,goulu/networkx,RMKD/networkx,dmoliveira/networkx,beni55/networkx,chrisnatali/networkx,wasade/networkx,nathania/networkx,jakevdp/networkx,blublud/networkx,kernc/networkx... | examples/graph/degree_sequence.py | examples/graph/degree_sequence.py | #!/usr/bin/env python
"""
Random graph from given degree sequence.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
__date__ = "$Date: 2004-11-03 08:11:09 -0700 (Wed, 03 Nov 2004) $"
__credits__ = """"""
__revision__ = "$Revision: 503 $"
# Copyright (C) 2004 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Sc... | #!/usr/bin/env python
"""
Random graph from given degree sequence.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
__date__ = "$Date: 2004-11-03 08:11:09 -0700 (Wed, 03 Nov 2004) $"
__credits__ = """"""
__revision__ = "$Revision: 503 $"
# Copyright (C) 2004 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Sc... | bsd-3-clause | Python |
72e30b3b881418d40dd0446842176fc5c4468802 | Add name url converter | mikeboers/Flask-Roots,mikeboers/Flask-Roots | flask_roots/routing.py | flask_roots/routing.py | from werkzeug.routing import BaseConverter
class RegexConverter(BaseConverter):
def __init__(self, url_map, *items):
super(RegexConverter, self).__init__(url_map)
self.regex = items[0]
def strip_accents(s):
s = unicode(s)
return ''.join((c for c in unicodedata.normalize('NFD', s) if unic... | from werkzeug.routing import BaseConverter
class RegexConverter(BaseConverter):
def __init__(self, url_map, *items):
super(RegexConverter, self).__init__(url_map)
self.regex = items[0]
def setup_routing(app):
app.url_map.converters['re'] = RegexConverter
| bsd-3-clause | Python |
42463351a598d45f2738c894e00d0eceec308f9c | Add docstring | wholebiome/aegea,wholebiome/aegea,kislyuk/aegea,wholebiome/aegea,kislyuk/aegea,kislyuk/aegea | aegea/billing.py | aegea/billing.py | """
View detailed billing reports.
Detailed billing reports can be configured at https://console.aws.amazon.com/billing/home#/preferences.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, json, zipfile, csv, io
from io import BytesIO, TextIOWrapper
from datetime ... | """
View detailed billing reports.
Detailed billing reports can be configured at https://console.aws.amazon.com/billing/home#/preferences.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, json, zipfile, csv, io
from io import BytesIO, TextIOWrapper
from datetime ... | apache-2.0 | Python |
803fead9cbfa9d2a950e9fa16f42e905f6a942d7 | add module imports | jml/flocker,Azulinho/flocker,runcom/flocker,agonzalezro/flocker,hackday-profilers/flocker,w4ngyi/flocker,1d4Nf6/flocker,runcom/flocker,1d4Nf6/flocker,AndyHuu/flocker,hackday-profilers/flocker,mbrukman/flocker,moypray/flocker,Azulinho/flocker,jml/flocker,achanda/flocker,mbrukman/flocker,achanda/flocker,wallnerryan/flock... | flocker/ca/__init__.py | flocker/ca/__init__.py | # Copyright ClusterHQ Inc. See LICENSE file for details.
"""
A minimal certificate authority.
"""
__all__ = [
"RootCredential", "ControlCredential", "NodeCredential", "UserCredential",
"ComparableKeyPair", "PathError", "CertificateAlreadyExistsError",
"KeyAlreadyExistsError", "EXPIRY_20_YEARS",
"AUTH... | # Copyright ClusterHQ Inc. See LICENSE file for details.
"""
A minimal certificate authority.
"""
__all__ = [
"RootCredential", "ControlCredential", "NodeCredential",
"ComparableKeyPair", "PathError", "CertificateAlreadyExistsError",
"KeyAlreadyExistsError", "EXPIRY_20_YEARS",
"AUTHORITY_CERTIFICATE_... | apache-2.0 | Python |
b45db0476212891dd23934d775bc3082cbcaabdf | Fix KLD | mufid/berkilau,mufid/berkilau | ws/CSUIBotClass2014/MCL/kldmcl.py | ws/CSUIBotClass2014/MCL/kldmcl.py | # @obj: implement the standard MCL alg.; table 8.2 on the book Prob. Robotics by S. Thrun
# @author: vektor dewanto
import numpy as np
import CSUIBotClass2014.action_model.model_uas as act_model
import CSUIBotClass2014.perception_model.beam_range_finder_model as obs_model
from scipy import stats
import math
def norma... | # @obj: implement the standard MCL alg.; table 8.2 on the book Prob. Robotics by S. Thrun
# @author: vektor dewanto
import numpy as np
import CSUIBotClass2014.action_model.model_uas as act_model
import CSUIBotClass2014.perception_model.beam_range_finder_model as obs_model
def normalize_weight(X):
# Normalize all ... | mit | Python |
bf476a199492c7966b6a3886da284867622a8b04 | Update populate_vm_metrics.py | GoogleCloudPlatform/gcsfuse,GoogleCloudPlatform/gcsfuse,GoogleCloudPlatform/gcsfuse | perfmetrics/scripts/populate_vm_metrics.py | perfmetrics/scripts/populate_vm_metrics.py | """Executes vm_metrics.py by passing appropriate arguments.
To run the script:
>> python3 populate_vm_metrics.py <start_time> <end_time>
"""
import socket
import sys
import time
import os
from vm_metrics import vm_metrics
INSTANCE = socket.gethostname()
metric_data_name = ['start_time_sec', 'cpu_utilization_peak','c... | """Executes vm_metrics.py by passing appropriate arguments.
To run the script:
>> python3 populate_vm_metrics.py <start_time> <end_time>
"""
import socket
import sys
import time
import os
from vm_metrics import vm_metrics
INSTANCE = socket.gethostname()
metric_data_name = ['start_time_sec', 'cpu_utilization_peak','c... | apache-2.0 | Python |
c18972be7609b3de061ec41977ad73efccd5213c | Fix HTTP Basic authentication decorator | lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django | agir/lib/http.py | agir/lib/http.py | import base64
from functools import wraps
from hashlib import sha1
from django.http import HttpResponse
from django.utils.crypto import constant_time_compare
EMPTY_HASH = sha1().digest()
class HttpResponseUnauthorized(HttpResponse):
status_code = 401
def __init__(self, content=b'', realm="api", *args, **k... | import base64
from functools import wraps
from hashlib import sha1
from django.http import HttpResponse
from django.utils.crypto import constant_time_compare
EMPTY_HASH = sha1().digest()
class HttpResponseUnauthorized(HttpResponse):
status_code = 401
def __init__(self, content=b'', realm="api", *args, **k... | agpl-3.0 | Python |
3e8d113a6fa32c7c9163d3334e484993c29080ba | remove split test | tlevine/vlermv | vlermv/test/test_s3.py | vlermv/test/test_s3.py | import json
import pytest
from .._s3 import S3Vlermv
class FakeBucket:
def __init__(self, name, **db):
self.db = db
self.name = name
def list(self):
for key in self.db:
yield self.new_key(key)
def new_key(self, key):
return FakeKey(self.db, key)
def get_key... | import json
import pytest
from .._s3 import S3Vlermv, split
class FakeBucket:
def __init__(self, name, **db):
self.db = db
self.name = name
def list(self):
for key in self.db:
yield self.new_key(key)
def new_key(self, key):
return FakeKey(self.db, key)
def ... | agpl-3.0 | Python |
d4ffe068638aa1394c1a34eaa43859edb47c0473 | Update hodograph_inset example for plot the colormap by height. | ShawnMurd/MetPy,ahaberlie/MetPy,dopplershift/MetPy,Unidata/MetPy,Unidata/MetPy,ahaberlie/MetPy,dopplershift/MetPy | examples/plots/Hodograph_Inset.py | examples/plots/Hodograph_Inset.py | # Copyright (c) 2016 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
Hodograph Inset
===============
Layout a Skew-T plot with a hodograph inset into the plot.
"""
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import... | # Copyright (c) 2016 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
Hodograph Inset
===============
Layout a Skew-T plot with a hodograph inset into the plot.
"""
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import... | bsd-3-clause | Python |
3b0865bbfcee18afb842cc9f50f8c83c0d70f221 | Add the other v ;-). | saifrahmed/bokeh,azjps/bokeh,aiguofer/bokeh,KasperPRasmussen/bokeh,josherick/bokeh,rs2/bokeh,ChinaQuants/bokeh,schoolie/bokeh,schoolie/bokeh,daodaoliang/bokeh,timsnyder/bokeh,phobson/bokeh,bokeh/bokeh,ChinaQuants/bokeh,xguse/bokeh,bokeh/bokeh,timsnyder/bokeh,quasiben/bokeh,justacec/bokeh,ptitjano/bokeh,CrazyGuo/bokeh,K... | sphinx/fabfile.py | sphinx/fabfile.py | from fabric.api import run, env, roles
from fabric.contrib.files import exists
from fabric.contrib.project import rsync_project
import sys
sys.path.append("source")
import conf
env.roledefs = {
'web': ['bokeh.pydata.org']
}
env.user = "bokeh"
@roles('web')
def deploy(v=None):
if v is None:
v = conf.... | from fabric.api import run, env, roles
from fabric.contrib.files import exists
from fabric.contrib.project import rsync_project
import sys
sys.path.append("source")
import conf
env.roledefs = {
'web': ['bokeh.pydata.org']
}
env.user = "bokeh"
@roles('web')
def deploy(v=None):
if v is None:
v = conf.... | bsd-3-clause | Python |
b3ddba27c92f36ee9534903b43ff632daa148585 | Fix public body search index by indexing jurisdiction name | CodeforHawaii/froide,ryankanno/froide,okfse/froide,stefanw/froide,CodeforHawaii/froide,catcosmo/froide,LilithWittmann/froide,ryankanno/froide,stefanw/froide,fin/froide,okfse/froide,LilithWittmann/froide,catcosmo/froide,fin/froide,okfse/froide,okfse/froide,fin/froide,ryankanno/froide,LilithWittmann/froide,catcosmo/froid... | froide/publicbody/search_indexes.py | froide/publicbody/search_indexes.py | from django.conf import settings
from haystack import indexes
from haystack import site
from publicbody.models import PublicBody
from helper.searchindex import QueuedRealTimeSearchIndex
PUBLIC_BODY_BOOSTS = getattr(settings, "FROIDE_PUBLIC_BODY_BOOSTS", {})
class PublicBodyIndex(QueuedRealTimeSearchIndex):
te... | from django.conf import settings
from haystack import indexes
from haystack import site
from publicbody.models import PublicBody
from helper.searchindex import QueuedRealTimeSearchIndex
PUBLIC_BODY_BOOSTS = getattr(settings, "FROIDE_PUBLIC_BODY_BOOSTS", {})
class PublicBodyIndex(QueuedRealTimeSearchIndex):
te... | mit | Python |
3da17a2f61daecc34772ead7e6caffa9da49bf48 | Add default values and shebang | hashbangstudio/Python-Minecraft-Examples | 06-setPositionFromArgs.py | 06-setPositionFromArgs.py | #!/usr/bin/env python
# We have to import the minecraft api module to do anything in the minecraft world
from mcpi.minecraft import *
import sys
# this means that the file can be imported without executing anything in this code block
if __name__ == "__main__":
"""
First thing you do is create a connection t... | # We have to import the minecraft api module to do anything in the minecraft world
from mcpi.minecraft import *
import sys
# this means that the file can be imported without executing anything in this code block
if __name__ == "__main__":
"""
First thing you do is create a connection to minecraft
This is... | bsd-3-clause | Python |
de381a56e87a21da1e82146da01bb546c5094ec4 | Print the traceback as well for debugging purposes. | eltoncarr/tubular,eltoncarr/tubular | scripts/asgard-deploy.py | scripts/asgard-deploy.py | #!/usr/bin/env python
import sys
import logging
import traceback
import click
from os import path
# Add top-level module path to sys.path before importing tubular code.
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from tubular import asgard
logging.basicConfig(stream=sys.stdout, level=l... | #!/usr/bin/env python
import sys
import logging
import click
from os import path
# Add top-level module path to sys.path before importing tubular code.
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from tubular import asgard
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
@cl... | agpl-3.0 | Python |
0a81356e0f8011f0764a8c28719d1371e5860656 | Make sure create_privatekml mgmt command produces unique names less than 100 chars; fail gracefully if not | Ecotrust/madrona_addons,Ecotrust/madrona_addons | lingcod/layers/management/commands/create_privatekml.py | lingcod/layers/management/commands/create_privatekml.py | from django.core.management.base import BaseCommand, AppCommand
from django.conf import settings
from optparse import make_option
import os
import glob
from lingcod.layers.models import PrivateKml
from django.contrib.auth.models import User, Group
class Command(BaseCommand):
help = "Populates the PrivateKml table ... | from django.core.management.base import BaseCommand, AppCommand
from django.conf import settings
from optparse import make_option
import os
import glob
from lingcod.layers.models import PrivateKml
from django.contrib.auth.models import User, Group
class Command(BaseCommand):
help = "Populates the PrivateKml table ... | bsd-3-clause | Python |
9a1921fb27b7073d9c79f6727766eb516478f403 | Bump version 0.6.0 (git sync solution) | aldryn/aldryn-client,aldryn/aldryn-client | cmscloud_client/__init__.py | cmscloud_client/__init__.py | # -*- coding: utf-8 -*-
__version__ = '0.6.0'
| # -*- coding: utf-8 -*-
__version__ = '0.5.4'
| bsd-3-clause | Python |
9926cbb1919b96999d479f5a8d67e17ce71a1091 | Improve the get_nick a tiny amount | Motoko11/MotoBot | motobot/irc_message.py | motobot/irc_message.py | class IRCMessage:
""" Class to store and parse an IRC Message. """
def __init__(self, msg):
""" Parse a raw IRC message to IRCMessage. """
self.sender = None
self.nick = None
self.command = None
self.params = []
self.__parse_msg(msg)
def __parse_msg(self, ... | class IRCMessage:
""" Class to store and parse an IRC Message. """
def __init__(self, msg):
""" Parse a raw IRC message to IRCMessage. """
self.sender = None
self.nick = None
self.command = None
self.params = []
self.__parse_msg(msg)
def __parse_msg(self, ... | mit | Python |
119ce47d9e876c345c2bc44751ccf04f0b226259 | Remove lie_system package dependency | MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio | components/lie_structures/setup.py | components/lie_structures/setup.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# package: lie_docking
# file: setup.py
#
# Part of ‘lie_docking’, a package providing molecular docking functionality
# for the LIEStudio package.
#
# Copyright © 2016 Marc van Dijk, VU University Amsterdam, the Netherlands
#
# Licensed under the Apache License, Version ... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# package: lie_docking
# file: setup.py
#
# Part of ‘lie_docking’, a package providing molecular docking functionality
# for the LIEStudio package.
#
# Copyright © 2016 Marc van Dijk, VU University Amsterdam, the Netherlands
#
# Licensed under the Apache License, Version ... | apache-2.0 | Python |
eb48fba5b3334437a752681df200c2bbefb0bc18 | change font to be purple | allen7wang/musicbox,caitinggui/musicbox,kigawas/musicbox,Catofes/musicbox,kigawas/musicbox,AnyOfYou/musicbox,darknessomi/musicbox | NEMbox/osdlyrics.py | NEMbox/osdlyrics.py | from PyQt4 import QtGui, QtCore, QtDBus
import sys
import os
from multiprocessing import Process
class Lyrics(QtGui.QWidget):
def __init__(self):
super(Lyrics, self).__init__()
self.initUI()
def initUI(self):
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
self.resize(900... | from PyQt4 import QtGui, QtCore, QtDBus
import sys
import os
from multiprocessing import Process
class Lyrics(QtGui.QWidget):
def __init__(self):
super(Lyrics, self).__init__()
self.initUI()
def initUI(self):
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
self.resize(900... | mit | Python |
c61d4c6df77fe505074c81eebaec938c6716d9ab | Create columns before querying them. | vguzmanp/dataset,reubano/dataset,askebos/dataset,pudo/dataset,okfn/sqlaload,stefanw/dataset,twds/dataset,saimn/dataset | sqlaload/query.py | sqlaload/query.py | import logging
from itertools import count
from sqlalchemy.sql import expression, and_
from sqlaload.schema import _ensure_columns
log = logging.getLogger(__name__)
def resultiter(rp):
""" SQLAlchemy ResultProxies are not iterable to get a
list of dictionaries. This is to wrap them. """
keys = rp.keys()... | import logging
from itertools import count
from sqlalchemy.sql import expression, and_
log = logging.getLogger(__name__)
def resultiter(rp):
""" SQLAlchemy ResultProxies are not iterable to get a
list of dictionaries. This is to wrap them. """
keys = rp.keys()
while True:
row = rp.fetchone()... | mit | Python |
0c4e6ff26d716bf20a1a7c36a4e3e363a1101c2a | add forced/default to plexpy.library.stream | pannal/Subliminal.bundle,pannal/Subliminal.bundle,pannal/Subliminal.bundle | Contents/Libraries/Shared/plex/objects/library/stream.py | Contents/Libraries/Shared/plex/objects/library/stream.py | from plex.objects.core.base import Descriptor, Property
class Stream(Descriptor):
id = Property(type=int)
index = Property(type=int)
stream_type = Property('streamType', type=int)
selected = Property(type=bool)
forced = Property(type=bool)
default = Property(type=bool)
title = Property
... | from plex.objects.core.base import Descriptor, Property
class Stream(Descriptor):
id = Property(type=int)
index = Property(type=int)
stream_type = Property('streamType', type=int)
selected = Property(type=bool)
title = Property
duration = Property(type=int)
codec = Property
codec_id... | mit | Python |
e92a612ba231eebb8dbe7ac42d24ac002a89fbe1 | add docstring | mhbu50/frappe,saurabh6790/frappe,frappe/frappe,saurabh6790/frappe,yashodhank/frappe,almeidapaulopt/frappe,saurabh6790/frappe,yashodhank/frappe,yashodhank/frappe,saurabh6790/frappe,frappe/frappe,almeidapaulopt/frappe,almeidapaulopt/frappe,almeidapaulopt/frappe,StrellaGroup/frappe,StrellaGroup/frappe,mhbu50/frappe,aditya... | frappe/utils/logger.py | frappe/utils/logger.py | # imports - compatibility imports
from __future__ import unicode_literals
# imports - standard imports
import logging
import os
from logging.handlers import RotatingFileHandler
# imports - third party imports
from six import text_type
# imports - module imports
import frappe
default_log_level = logging.DEBUG
site ... | # imports - compatibility imports
from __future__ import unicode_literals
# imports - standard imports
import logging
import os
from logging.handlers import RotatingFileHandler
# imports - third party imports
from six import text_type
# imports - module imports
import frappe
default_log_level = logging.DEBUG
site ... | mit | Python |
24fbe55a3517e50f4d158bbb7b8857f8f10dc148 | Use argparse to parse julia-py arguments | JuliaLang/pyjulia,JuliaPy/pyjulia,JuliaPy/pyjulia | src/julia/julia_py.py | src/julia/julia_py.py | """
Launch Julia through PyJulia.
"""
from __future__ import print_function, absolute_import
import argparse
import os
import sys
from .api import LibJulia
from .core import enable_debug
from .tools import julia_py_executable
def julia_py(julia, pyjulia_debug, jl_args):
if pyjulia_debug:
enable_debug()... | from __future__ import print_function, absolute_import
from argparse import Namespace
import os
import sys
from .api import LibJulia
from .tools import julia_py_executable
def parse_args(args):
ns = Namespace(julia="julia")
jl_args = list(args)
if len(jl_args) >= 2 and jl_args[0] == "--julia":
... | mit | Python |
59e7fc5c924ebf8af66e0aeef990da55e84d3f9e | update to 3.30.1 | DeadSix27/python_cross_compile_script | packages/dependencies/sqlite3.py | packages/dependencies/sqlite3.py | {
'repo_type' : 'archive',
'custom_cflag' : '-O2', # make sure we build it without -ffast-math
'download_locations' : [
{ 'url' : 'https://www.sqlite.org/2019/sqlite-autoconf-3300100.tar.gz', 'hashes' : [ { 'type' : 'sha256', 'sum' : '8c5a50db089bd2a1b08dbc5b00d2027602ca7ff238ba7658fabca454d4298e60' }, ], },
{ '... | {
'repo_type' : 'archive',
'custom_cflag' : '-O2', # make sure we build it without -ffast-math
'download_locations' : [
{ 'url' : 'https://www.sqlite.org/2019/sqlite-autoconf-3300000.tar.gz', 'hashes' : [ { 'type' : 'sha256', 'sum' : 'e0a8cf4c7a87455e55e10413d16f358ca121ccec687fe1301eac95e2d340fc58' }, ], },
{ '... | mpl-2.0 | Python |
6ad4796030aab2f6dbf8389b4030007d0fcf8761 | Update to test for mount setup | Guokr1991/POCS,joshwalawender/POCS,AstroHuntsman/POCS,panoptes/POCS,AstroHuntsman/POCS,panoptes/POCS,Guokr1991/POCS,Guokr1991/POCS,Guokr1991/POCS,panoptes/POCS,AstroHuntsman/POCS,panoptes/POCS,joshwalawender/POCS,AstroHuntsman/POCS,fmin2958/POCS,joshwalawender/POCS,fmin2958/POCS,fmin2958/POCS | panoptes/test/mount/test_ioptron.py | panoptes/test/mount/test_ioptron.py | from nose.tools import raises
import panoptes
from panoptes.mount.ioptron import Mount
class TestIOptron():
@raises(AssertionError)
def test_no_config_no_commands(self):
""" Mount needs a config """
mount = Mount()
@raises(AssertionError)
def test_config_bad_commands(self):
""" Passes in a default config ... | from nose.tools import raises
import panoptes
from panoptes.mount.ioptron import Mount
class TestIOptron():
@raises(AssertionError)
def test_no_config_no_commands(self):
""" Mount needs a config """
mount = Mount()
@raises(AssertionError)
def test_config_no_commands(self):
""" """
mount = Mount(config={... | mit | Python |
4f0e0d4d92301dea408925d99001913e76a15ee1 | Update filterscan.py | galkan/flashlight | lib/filterscan.py | lib/filterscan.py | try:
import os
import subprocess
from lib.core.core import Core
from lib.filter.filter import Filter
except ImportError, err:
from lib.core.core import Core
Core.print_error(err)
class FilterScan(Filter):
def __init__(self, args):
self.__args = args
Filter.__init__(self, [self.__args.pcap], self.__args,... |
try:
import subprocess
from lib.core.core import Core
from lib.filter.filter import Filter
except ImportError, err:
from lib.core.core import Core
Core.print_error(err)
class FilterScan(Filter):
def __init__(self, args):
Filter.__init__(self, [args.pcap], args, "filter")
print self._output_dir
def _... | mit | Python |
c52d056091acf49624450cc2d1e01cbf0900a08f | Add a profiling option | mouton5000/DiscreteEventApplicationEditor | main.py | main.py | #!/usr/bin/env python
import sys
from PyQt4.QtGui import QApplication as QApp
from gui.EditorWindow import MainWindow
def main():
import grammar.grammars
grammar.grammars.compileGrammars()
app = QApp(sys.argv)
ex = MainWindow()
sys.exit(app.exec_())
if __name__ == '__main__':
profile = ... | #!/usr/bin/env python
import sys
from PyQt4.QtGui import QApplication as QApp
from gui.EditorWindow import MainWindow
def main():
import grammar.grammars
grammar.grammars.compileGrammars()
app = QApp(sys.argv)
ex = MainWindow()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
| mit | Python |
d951b11e9991c021e631299f0e22da8eb4c7d850 | comment out post-checkout undo demonstration | lancekindle/gitTA,lancekindle/gitTA | main.py | main.py | # this is the main file that get called
import os
import sys
import gitTA as git
import colorama
from colorama import Fore, Back # add color output to terminal: we want anything printed to be VERY visible to user
colorama.init() # called so that windows colors work
'''
modify this file! When git runs certain commands... | # this is the main file that get called
import os
import sys
import gitTA as git
import colorama
from colorama import Fore, Back # add color output to terminal: we want anything printed to be VERY visible to user
colorama.init() # called so that windows colors work
'''
modify this file! When git runs certain commands... | mit | Python |
1624504bd966eaf47698938e387a58dd14738a76 | add warnings about deprecation of compiler specific template tags | paera/django-static-precompiler,liumengjun/django-static-precompiler,liumengjun/django-static-precompiler,liumengjun/django-static-precompiler,liumengjun/django-static-precompiler,jaheba/django-static-precompiler,liumengjun/django-static-precompiler,jaheba/django-static-precompiler,paera/django-static-precompiler,jaheb... | static_precompiler/templatetags/compile_static.py | static_precompiler/templatetags/compile_static.py | import six
import warnings
from django.template import Library
from django.templatetags.static import static
from static_precompiler.settings import PREPEND_STATIC_URL, USE_CACHE, CACHE_TIMEOUT
from static_precompiler.utils import compile_static, get_compiler_by_name, get_cache_key, get_hexdigest, get_cache
from stati... | import six
from django.template import Library
from django.templatetags.static import static
from static_precompiler.settings import PREPEND_STATIC_URL, USE_CACHE, CACHE_TIMEOUT
from static_precompiler.utils import compile_static, get_compiler_by_name, get_cache_key, get_hexdigest, get_cache
from static_precompiler.te... | mit | Python |
437643d0f0680470b52ce893555df5dac17bdca1 | use selenium for loading js content | Shadi-A/ExpediaCrawler | main.py | main.py | import time
from bs4 import BeautifulSoup
from selenium import webdriver
browser = webdriver.Firefox()
ffResults = browser.get("https://www.expedia.com/Flights-Search?trip=roundtrip&leg1=from:Hamburg,%20Germany%20(HAM-All%20Airports),to:Amman,%20Jordan%20(AMM-Queen%20Alia%20Intl.),departure:03/08/2017TANYT&leg2=fr... | import urllib.request
result=urllib.request.urlopen("https://www.expedia.de/Flights-Search?trip=roundtrip&leg1=from:Hamburg,%20Deutschland%20(HAM-Alle%20Flugh%C3%A4fen),to:Amman,%20Jordanien%20(AMM-Queen%20Alia%20Intl.),departure:08.03.2017TANYT&leg2=from:Amman,%20Jordanien%20(AMM-Queen%20Alia%20Intl.),to:Hamburg,%20D... | mit | Python |
24d4fee92c1c2ff4bac1fe09d9b436748234a48c | Add argument for execution of defective server. | Solucionamos/dummybmc | main.py | main.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
""" Main script. Executes the XML Server implementation with an HTTP
connection and default parameters.
"""
import sys
import argparse
from server import xml_server, defective_servers
from connection import http_connection
parser = argparse.Argument... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
""" Main script. Executes the XML Server implementation with an HTTP
connection and default parameters.
"""
import sys
import argparse
from server import xml_server
from connection import http_connection
parser = argparse.ArgumentParser()
parser.add... | apache-2.0 | Python |
52c2205804d8dc38447bca1ccbf5599e00cd1d7b | Rename user_id config key to admin_user_id | alvarogzp/telegram-bot,alvarogzp/telegram-bot | main.py | main.py | #!/usr/bin/env python3
import requests
CONFIG_DIR = "config"
class Bot:
def __init__(self):
self.config = Config(CONFIG_DIR)
self.api = TelegramBotApi(self.config.get_auth_token())
def run(self):
self.api.send_message(self.config.get_admin_user_id(), "test")
class TelegramBotApi:
... | #!/usr/bin/env python3
import requests
CONFIG_DIR = "config"
class Bot:
def __init__(self):
self.config = Config(CONFIG_DIR)
self.api = TelegramBotApi(self.config.get_auth_token())
def run(self):
self.api.send_message(self.config.get_user_id(), "test")
class TelegramBotApi:
de... | agpl-3.0 | Python |
8cbe375b478764f05e67b3d5600ca51bbd5b5c48 | enable 'inline_defnode_calls' optimisation for benchmarks (even though they don't benefit currently) | andreasvc/cython,mrGeen/cython,fabianrost84/cython,slonik-az/cython,ChristopherHogan/cython,mcanthony/cython,c-blake/cython,scoder/cython,da-woods/cython,mrGeen/cython,madjar/cython,madjar/cython,scoder/cython,encukou/cython,da-woods/cython,mrGeen/cython,JelleZijlstra/cython,madjar/cython,fabianrost84/cython,hhsprings/... | Demos/benchmarks/setup.py | Demos/benchmarks/setup.py | from distutils.core import setup
from Cython.Build import cythonize
directives = {
'optimize.inline_defnode_calls': True
}
setup(
name = 'benchmarks',
ext_modules = cythonize("*.py", language_level=3, annotate=True,
compiler_directives=directives),
)
| from distutils.core import setup
from Cython.Build import cythonize
setup(
name = 'benchmarks',
ext_modules = cythonize("*.py", language_level=3, annotate=True),
)
| apache-2.0 | Python |
18d59a1d23cc9021fa388028ab723822e031dc07 | Add health check | waprin/continuous-deployment-demo,waprin/continuous-deployment-demo,waprin/continuous-deployment-demo,waprin/continuous-deployment-demo | main.py | main.py | # Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
# law or agreed to in writing, software d... | # Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
# law or agreed to in writing, software d... | apache-2.0 | Python |
6ddc63dcb1005ccf6d09f2577faf99566bafced7 | fix Log.add_group() use in live_plot.py example | vlukes/sfepy,rc/sfepy,vlukes/sfepy,BubuLK/sfepy,sfepy/sfepy,sfepy/sfepy,sfepy/sfepy,vlukes/sfepy,BubuLK/sfepy,rc/sfepy,BubuLK/sfepy,rc/sfepy | examples/miscellaneous/live_plot.py | examples/miscellaneous/live_plot.py | from __future__ import print_function
from __future__ import absolute_import
import os
import sys
sys.path.append( '.' )
import numpy as nm
from sfepy.base.base import output, pause
from sfepy.base.log import Log
def main():
cwd = os.path.split(os.path.join(os.getcwd(), __file__))[0]
log = Log((['sin(x)', '... | from __future__ import print_function
from __future__ import absolute_import
import os
import sys
sys.path.append( '.' )
import numpy as nm
from sfepy.base.base import output, pause
from sfepy.base.log import Log
def main():
cwd = os.path.split(os.path.join(os.getcwd(), __file__))[0]
log = Log((['sin(x)', '... | bsd-3-clause | Python |
884e17eb92e35ab5a9f4d6bc94f11f49977711a3 | Use render() so that we can pass in the request context and thus link to static files correctly (reviewed by @smn). | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/apps/jsbox/views.py | go/apps/jsbox/views.py | import requests
from urlparse import urlparse, urlunparse
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from go.conversation.base import ConversationViews
from go.apps.jsbox.forms ... | import requests
from urlparse import urlparse, urlunparse
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.views.decorators.csrf import csrf_exempt
from go.conversation.base import ConversationViews
from go.apps.... | bsd-3-clause | Python |
8d2167bc3bc37f68e225ddcd86bc4114d90be87e | Update version number | spywhere/LocalPackages | local_packages.py | local_packages.py | import sublime
from .event_handler import EventHandler
from .settings import Settings
package_control_installed = False
LOCAL_PACKAGES_VERSION = "0.1.2"
evaluating = False
retry_times = 3
def plugin_loaded():
Settings.reset()
Settings.startup()
EventHandler().register_handler(
evaluate_install,
... | import sublime
from .event_handler import EventHandler
from .settings import Settings
package_control_installed = False
LOCAL_PACKAGES_VERSION = "0.1.1"
evaluating = False
retry_times = 3
def plugin_loaded():
Settings.reset()
Settings.startup()
EventHandler().register_handler(
evaluate_install,
... | mit | Python |
4ca8889396595f9da99becbb88fb7e38ab0ed560 | Raise exception if connection not succeed and customize error message | anapaulagomes/reviews-assigner | hunter/reviewsapi.py | hunter/reviewsapi.py | import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': token, 'Content-Length': '0'}
def certifications(self):
try:
... | import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': token, 'Content-Length': '0'}
def certifications(self):
try:
... | mit | Python |
792e46bcd01d2718215a3cb324b8deca5e4e1a7e | bump 1.3.10 release (#160) | F5Networks/f5-icontrol-rest-python,F5Networks/f5-icontrol-rest-python | icontrol/__init__.py | icontrol/__init__.py | __version__ = "1.3.10"
| __version__ = "1.3.9"
| apache-2.0 | Python |
9d20717b39154252109153a6c5936922d28c6511 | mark unicode context values as safe | danxshap/django-mailviews,danxshap/django-mailviews | mailviews/utils.py | mailviews/utils.py | import textwrap
from collections import namedtuple
from django.utils.safestring import mark_safe
Docstring = namedtuple('Docstring', ('summary', 'body'))
def split_docstring(value):
"""
Splits the docstring of the given value into it's summary and body.
:returns: a 2-tuple of the format ``(summary, bo... | import textwrap
from collections import namedtuple
from django.utils.safestring import mark_safe
Docstring = namedtuple('Docstring', ('summary', 'body'))
def split_docstring(value):
"""
Splits the docstring of the given value into it's summary and body.
:returns: a 2-tuple of the format ``(summary, bo... | apache-2.0 | Python |
bdca4889442e7d84f8c4e68ecdbee676d46ff264 | Fix data provider example file. | Lothiraldan/pytf | examples/test_with_data_provider.py | examples/test_with_data_provider.py | from pytf.dataprovider import DataProvider, call
@DataProvider(max_5=call(max=5), max_10=call(max=10), max_15=call(max=15))
class TestCase(object):
def __init__(self, max):
self.max = max
@DataProvider(n_3=call(n=3), n_7=call(n=7), n_12=call(n=12), n_20=call(n=20))
def test_test(self, n):
... | from pytf.dataprovider import DataProvider
try:
from unittest.mock import call
except ImportError:
from mock import call
@DataProvider([call(max=5), call(max=10), call(max=15)])
class TestCase(object):
def __init__(self, max):
self.max = max
@DataProvider([call(n=3), call(n=7), call(n=12), c... | mit | Python |
97e2e80b43ba3639e5af9deb6485c28da1a5e7af | change path | duthchao/kaggle-Otto,tks0123456789/kaggle-Otto | make_submission.py | make_submission.py | """
Ensemble by columnwise weighted sum.
The weights are determined by scipy.optimize.minimize using validation set predictions.
LB Private: 0.40076
LB Public: 0.39773
"""
import numpy as np
import pandas as pd
import sklearn.preprocessing as pp
path = './'
# Neural Networks
pred = [np.load(path + 'pred_TRI_kmax_' ... | """
Ensemble by columnwise weighted sum.
The weights are determined by scipy.optimize.minimize using validation set predictions.
LB Private: 0.40076
LB Public: 0.39773
"""
import numpy as np
import pandas as pd
import sklearn.preprocessing as pp
path = '~/'
# Neural Networks
pred = [np.load(path + 'pred_TRI_kmax_' ... | mit | Python |
542ddc0d0bd96c8ff8635f649344f468d7d497d0 | bump version to 0.2.3 | braintree/mallory,braintree/mallory | mallory/version.py | mallory/version.py | Version = "0.2.3"
| Version = "0.2.2"
| mit | Python |
ff9444ea838bb7ed3efae125d343cee2cec994a9 | Improve the level of comments in mysite/base/depends.py | moijes12/oh-mainline,sudheesh001/oh-mainline,Changaco/oh-mainline,heeraj123/oh-mainline,Changaco/oh-mainline,willingc/oh-mainline,willingc/oh-mainline,openhatch/oh-mainline,heeraj123/oh-mainline,onceuponatimeforever/oh-mainline,SnappleCap/oh-mainline,mzdaniel/oh-mainline,onceuponatimeforever/oh-mainline,ehashman/oh-mai... | mysite/base/depends.py | mysite/base/depends.py | # -*- coding: utf-8 -*-
# This file is part of OpenHatch.
# Copyright (C) 2011 Asheesh Laroia
#
# 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 ... | import os
try:
import lxml
import lxml.etree
import lxml.html
except:
class nothing(object):
pass
lxml = nothing()
lxml.etree = None
lxml.html = None
import logging
if lxml.html is None:
logging.warning("Some parts of the OpenHatch site may fail because the lxml"
... | agpl-3.0 | Python |
bf8b29e7d05a7b476198109f1dccfd42da38f73b | Update pack.py: copy directory to destination instead of compressing | AwesomeTickets/StaticPageServer,AwesomeTickets/StaticPageServer | pack.py | pack.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
' Generate static webpage files '
import os
import sys
import shutil
usage_prompt = 'Usage: python3 pack.py <destination_path> [-H <hostname>]'
protocal = "http"
hostname = ''
host_path = os.path.join('scripts', 'host.js')
site_dir = 'site'
if (len(sys.argv) < 2):
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
' Generate static webpage files '
import os
import sys
usage_prompt = '''Usage:
python3 pack.py
python3 pack.py -H <hostname>
python3 pack.py { ? | -h | --help }'''
protocal = "http"
hostname = 'localhost'
filename_host = os.path.join('scripts', 'host.js')
dir_site = ... | mit | Python |
346e296872e1ca011eb5e469505de1c15c86732f | Clarify the comment about setting the PYTHON variable for the Doc Makefile. | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Doc/tools/sphinx-build.py | Doc/tools/sphinx-build.py | # -*- coding: utf-8 -*-
"""
Sphinx - Python documentation toolchain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007 by Georg Brandl.
:license: Python license.
"""
import sys
if __name__ == '__main__':
if sys.version_info[:3] < (2, 5, 0):
print >>sys.stderr, """\
Error: Sphinx ne... | # -*- coding: utf-8 -*-
"""
Sphinx - Python documentation toolchain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007 by Georg Brandl.
:license: Python license.
"""
import sys
if __name__ == '__main__':
if sys.version_info[:3] < (2, 5, 0):
print >>sys.stderr, """\
Error: Sphinx ne... | mit | Python |
8070b119c11ad18e2c1979afef21503a255dd8d8 | Check the number of matches for each query | kalgynirae/rockuefort | rockuefort.py | rockuefort.py | #!/usr/bin/python3
"""
Usage: rockuefort copy <file> <destination>
rockuefort symlink <file> <destination>
rockuefort list <file>
"""
from collections import OrderedDict
import subprocess
import sys
from docopt import docopt
def log(*args, **kwargs):
print("rockuefort:", *args, file=sys.stderr, **kw... | #!/usr/bin/python3
"""
Usage: rockuefort copy <file> <destination>
rockuefort symlink <file> <destination>
rockuefort list <file>
"""
from collections import OrderedDict
import subprocess
import sys
from docopt import docopt
def log(*args, **kwargs):
print("rockuefort:", *args, file=sys.stderr, **kw... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.