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 |
|---|---|---|---|---|---|---|---|---|
f7fbe9837e79d8f7f0b7a3601e25b9b6d06f46b6 | Implement secure RBAC for share replica locations | openstack/manila,openstack/manila | manila/policies/share_replica_export_location.py | manila/policies/share_replica_export_location.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
# d... | # 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 |
a6ac6781c30147f326299038266a8ca59140110c | include created datetime in entitlement support detail serializer | appsembler/edx-platform,a-parhom/edx-platform,cpennington/edx-platform,jolyonb/edx-platform,gsehub/edx-platform,teltek/edx-platform,arbrandes/edx-platform,arbrandes/edx-platform,mitocw/edx-platform,BehavioralInsightsTeam/edx-platform,angelapper/edx-platform,stvstnfrd/edx-platform,Edraak/edraak-platform,philanthropy-u/e... | common/djangoapps/entitlements/api/v1/serializers.py | common/djangoapps/entitlements/api/v1/serializers.py | """
Serializers for all Course Entitlement related return objects.
"""
from django.contrib.auth import get_user_model
from rest_framework import serializers
from entitlements.models import CourseEntitlement, CourseEntitlementSupportDetail
from openedx.core.lib.api.serializers import CourseKeyField
class CourseEntitl... | """
Serializers for all Course Entitlement related return objects.
"""
from django.contrib.auth import get_user_model
from rest_framework import serializers
from entitlements.models import CourseEntitlement, CourseEntitlementSupportDetail
from openedx.core.lib.api.serializers import CourseKeyField
class CourseEntitl... | agpl-3.0 | Python |
e9b0a1eb323f86c319a6543fc587b766019ae941 | Fix minor bug | SHTOOLS/SHTOOLS,MarkWieczorek/SHTOOLS,MarkWieczorek/SHTOOLS,SHTOOLS/SHTOOLS | examples/python/ClassInterface/WindowExample.py | examples/python/ClassInterface/WindowExample.py | #!/usr/bin/env python
"""
This script tests the python class interface
"""
from __future__ import absolute_import, division, print_function
# standard imports:
import os
import sys
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
sys.path.append(os.path.join(os.path.dirname(__file__), "..... | #!/usr/bin/env python
"""
This script tests the python class interface
"""
from __future__ import absolute_import, division, print_function
# standard imports:
import os
import sys
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
sys.path.append(os.path.join(os.path.dirname(__file__), "..... | bsd-3-clause | Python |
0ca853ca732a4ad01b93ac13fb3dd0b267e5c05a | fix for args/parse | aureooms/sak,aureooms/sak | lib/args.py | lib/args.py | from __future__ import absolute_import, division, print_function, unicode_literals
import lib.json
ARGS = "args"
KWARGS = "kwargs"
NO = "no"
DIRECTIVE_ARG = "+a"
def parse(argv, args, kwargs):
key = ""
isflag = False
isvalue = False
islist = False
isarg = False
for p in argv:
if isarg : args.append(p)
... | from __future__ import absolute_import, division, print_function, unicode_literals
import lib.json
ARGS = "args"
KWARGS = "kwargs"
NO = "no"
DIRECTIVE_ARG = "+a"
def parse(argv, args, kwargs):
key = ""
isflag = False
isvalue = False
islist = False
isarg = False
for p in argv:
if isarg : args.append(p)
... | agpl-3.0 | Python |
e059bafe94d13e98e96abe66719e395570010c11 | Allow manpage to use with sphinx -j auto or such | tdi/sphinxcontrib-manpage | sphinxcontrib/manpage.py | sphinxcontrib/manpage.py | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2013 Dariusz Dwornikowski. All rights reserved.
#
"""
Providing links to manpages with :linuxman: directiv
"""
from docutils import nodes, utils
from docutils.parsers.rst.roles import set_classes
from string import Template
import re
from sphinx.util import ... | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2013 Dariusz Dwornikowski. All rights reserved.
#
"""
Providing links to manpages with :linuxman: directiv
"""
from docutils import nodes, utils
from docutils.parsers.rst.roles import set_classes
from string import Template
import re
from sphinx.util import ... | apache-2.0 | Python |
74ed32f1e722d63ce68ba5b201082d31a7c9b382 | Remove code that was specific to nginx/uwsgi setup | watchcat/cbu-rotterdam,watchcat/cbu-rotterdam,localprojects/Change-By-Us,codeforeurope/Change-By-Us,codeforeurope/Change-By-Us,localprojects/Change-By-Us,localprojects/Change-By-Us,codeforeurope/Change-By-Us,localprojects/Change-By-Us,watchcat/cbu-rotterdam,watchcat/cbu-rotterdam,watchcat/cbu-rotterdam,codeforeurope/Ch... | framework/log.py | framework/log.py | """
:copyright: (c) 2011 Local Projects, all rights reserved
:license: Affero GNU GPL v3, see LICENSE for more details.
"""
"""
Extend the standard log module to enable some more detailed debug information.
"""
import os
import logging
import __main__
import logging.handlers
from config import Config
# Attemp... | """
:copyright: (c) 2011 Local Projects, all rights reserved
:license: Affero GNU GPL v3, see LICENSE for more details.
"""
"""
Extend the standard log module to enable some more detailed debug information.
"""
import os
import logging
import __main__
import logging.handlers
from config import Config
# Attemp... | agpl-3.0 | Python |
1d28ca665ae13978203e5b42affef15ac25d8720 | raise NotImplementedError in InstanceManager.required_utility | klahnakoski/SpotManager | spot/instance_manager.py | spot/instance_manager.py | # encoding: utf-8
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from __fu... | # encoding: utf-8
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from __fu... | mpl-2.0 | Python |
9acc8dc65a2554315cb72a709174637e4c1c2ab8 | Add mux2 and mux4. | AngelTerrones/Algol,AngelTerrones/Algol | Algol/common/mux.py | Algol/common/mux.py | #!/usr/bin/env python
# Copyright (c) 2015 Angel Terrones (<angelterrones@gmail.com>)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the r... | #!/usr/bin/env python
# Copyright (c) 2015 Angel Terrones (<angelterrones@gmail.com>)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the r... | mit | Python |
58be36ca646c4bb7fd4263a592cf3a240fbca64f | Fix tag creation with non-ascii chars. (Dammit bottle!) | drougge/wwwwellpapp,drougge/wwwwellpapp,drougge/wwwwellpapp | post_tag.py | post_tag.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from common import init, globaldata, tag_clean, tag_prefix, tag_post, tagtypes
from bottle import post, request, redirect, mako_view as view
@post("/post-tag")
@view("post-tag")
def r_post_tag():
client = init()
m = request.forms.post
post = client.get_post(m)
tags = ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from common import init, globaldata, tag_clean, tag_prefix, tag_post, tagtypes
from bottle import post, request, redirect, mako_view as view
@post("/post-tag")
@view("post-tag")
def r_post_tag():
client = init()
m = request.forms.post
post = client.get_post(m)
tags = ... | mit | Python |
bb32f2327d2e3aa386fffd2fd320a7af7b03ce95 | Include superusers in web user domaing access record | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/domain/project_access/middleware.py | corehq/apps/domain/project_access/middleware.py | from __future__ import absolute_import
from __future__ import unicode_literals
from datetime import datetime, timedelta
from django.utils.deprecation import MiddlewareMixin
from corehq.apps.domain.project_access.models import SuperuserProjectEntryRecord, ENTRY_RECORD_FREQUENCY
from corehq.util.quickcache import quickc... | from __future__ import absolute_import
from __future__ import unicode_literals
from datetime import datetime, timedelta
from django.utils.deprecation import MiddlewareMixin
from corehq.apps.domain.project_access.models import SuperuserProjectEntryRecord, ENTRY_RECORD_FREQUENCY
from corehq.util.quickcache import quickc... | bsd-3-clause | Python |
512609dfd0b761616d18f8ef12d2bf1b043b9aad | Remove unused import | jessamynsmith/boards-backend,jessamynsmith/boards-backend,GetBlimp/boards-backend | blimp/users/tests/test_authentication.py | blimp/users/tests/test_authentication.py | from django.http import HttpResponse
from django.test import TestCase
from rest_framework import permissions, status
from rest_framework.compat import patterns
from rest_framework.test import APIClient
from rest_framework.views import APIView
from ...utils.jwt_handlers import jwt_payload_handler, jwt_encode_handler
f... | import uuid
from django.http import HttpResponse
from django.test import TestCase
from rest_framework import permissions, status
from rest_framework.compat import patterns
from rest_framework.test import APIClient
from rest_framework.views import APIView
from ...utils.jwt_handlers import jwt_payload_handler, jwt_enc... | agpl-3.0 | Python |
e2fcb7826bf93d567561b19a77ad440f73e5fa9a | check status_int instead of grepping response body | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/ex-submodules/dimagi/utils/couch/sync_docs.py | corehq/ex-submodules/dimagi/utils/couch/sync_docs.py | import logging
from collections import namedtuple
from couchdbkit import push, RequestFailed
from couchdbkit.exceptions import ResourceNotFound
log = logging.getLogger(__name__)
def sync_design_docs(db, design_dir, design_name, temp=None):
"""
pushes design documents and brings new index up to date if temp
... | import logging
from collections import namedtuple
from couchdbkit import push, RequestFailed
from couchdbkit.exceptions import ResourceNotFound
log = logging.getLogger(__name__)
def sync_design_docs(db, design_dir, design_name, temp=None):
"""
pushes design documents and brings new index up to date if temp
... | bsd-3-clause | Python |
dd336c7555390d2713ef896f49ba27dbadc80a14 | Use correct env to check if on github | Clinical-Genomics/scout,Clinical-Genomics/scout,Clinical-Genomics/scout | tests/server/extensions/test_execute_command.py | tests/server/extensions/test_execute_command.py | """Tests for execute commands function"""
import os
import subprocess
import pytest
from scout.server.extensions.loqus_extension import execute_command
TRAVIS = os.getenv("TRAVIS")
GITHUB = os.getenv("CI")
def test_run_execute_command():
"""Test run echo with execute command"""
# GIVEN a command to run in ... | """Tests for execute commands function"""
import os
import subprocess
import pytest
from scout.server.extensions.loqus_extension import execute_command
TRAVIS = os.getenv("TRAVIS")
GITHUB = os.getenv("GITHUB")
def test_run_execute_command():
"""Test run echo with execute command"""
# GIVEN a command to run... | bsd-3-clause | Python |
db19a9af918e72174d52a46fa12cd93ecab63b64 | Update merge_elevation_and_segment.py | johnash1990/crashDataAnalysisTools | crashDataAnalysisTools/merge_elevation_and_segment.py | crashDataAnalysisTools/merge_elevation_and_segment.py | import pandas as pd
import sqlite3 as dbi
def merge_elev_and_seg(road_tb, elev_tb):
'''
This is the function that integrates the grade information stored in the
elevation table into the road segment table.
Two .csv files were saved in the current working directory, with Washington
State... | import os
import pandas as pd
import sqlite3 as dbi
def merge_elev_and_seg(road_tb, elev_tb):
'''
This is the function that integrate the grade information stored in the
elevation table into the road segment table.
Two .csv files were saved in the current working directory, with Washington
... | bsd-2-clause | Python |
90169c80e02c9a57a9ccc46545300f2c81ab14c7 | Update the copyright statement. | eliteraspberries/fftresize | fftresize/fftresize.py | fftresize/fftresize.py | #!/usr/bin/env python2
'''FFTresize resizes images using zero-padding in the frequency
domain.
'''
from avena import image, utils
from numpy import zeros as _zeros
from . import fftinterp
__author__ = 'Mansour Moufid'
__copyright__ = 'Copyright 2013-2015, Mansour Moufid'
__license__ = 'ISC'
__version__ = '0.5'
__e... | #!/usr/bin/env python2
'''FFTresize resizes images using zero-padding in the frequency
domain.
'''
from avena import image, utils
from numpy import zeros as _zeros
from . import fftinterp
__author__ = 'Mansour Moufid'
__copyright__ = 'Copyright 2013, 2014, Mansour Moufid'
__license__ = 'ISC'
__version__ = '0.5'
__... | isc | Python |
37107032575212e29d172c43e83d5eddbde2cb33 | Fix flask lint command | pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality | tracker/commands.py | tracker/commands.py | """Click commands."""
import os
from glob import glob
from subprocess import call
import click
HERE = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.join(HERE, os.pardir)
TEST_PATH = os.path.join(PROJECT_ROOT, 'tests')
@click.command()
def test():
"""Run the tests."""
import pytest
rv... | """Click commands."""
import os
from glob import glob
from subprocess import call
import click
HERE = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.join(HERE, os.pardir)
TEST_PATH = os.path.join(PROJECT_ROOT, 'tests')
@click.command()
def test():
"""Run the tests."""
import pytest
rv... | agpl-3.0 | Python |
3b3b9c196290e847e44158bd37a368cf6d7538b2 | Rename to batchflow | analysiscenter/dataset | batchflow/tests/config_test.py | batchflow/tests/config_test.py | import sys
import pytest
sys.path.append('..')
from batchflow import Config
@pytest.fixture
def config():
_config = dict(key1='val1', key2=dict())
_config['key2']['subkey1'] = 'val21'
return Config(_config)
class TestConfig:
def test_getitem_key(self, config):
assert config['key1'] == confi... | import sys
import pytest
sys.path.append('..')
from dataset import Config
@pytest.fixture
def config():
_config = dict(key1='val1', key2=dict())
_config['key2']['subkey1'] = 'val21'
return Config(_config)
class TestConfig:
def test_getitem_key(self, config):
assert config['key1'] == config.... | apache-2.0 | Python |
ed2bf858a97cc36adfeaee947038e71c46f08322 | clarify conditional | glyph/automat,glyph/Automat | automat/_introspection.py | automat/_introspection.py | """
Python introspection helpers.
"""
from types import CodeType as code, FunctionType as function
import six
def copycode(template, changes):
names = [
"argcount", "nlocals", "stacksize", "flags", "code", "consts",
"names", "varnames", "filename", "name", "firstlineno", "lnotab",
"freev... | """
Python introspection helpers.
"""
from types import CodeType as code, FunctionType as function
def copycode(template, changes):
names = [
"argcount", "nlocals", "stacksize", "flags", "code", "consts",
"names", "varnames", "filename", "name", "firstlineno", "lnotab",
"freevars", "cellva... | mit | Python |
c1b8974a227f721c1734c61d52119c97243bb5d7 | Update monitor.py for the new DBus interface | ThomasBollmeier/libsocialweb-flickr-oauth,GNOME/libsocialweb,lcp/libsocialweb,lcp/mojito,lcp/libsocialweb,ThomasBollmeier/libsocialweb-flickr-oauth,GNOME/libsocialweb,lcp/mojito,lcp/libsocialweb,GNOME/libsocialweb,lcp/mojito,ThomasBollmeier/libsocialweb-flickr-oauth | examples/monitor.py | examples/monitor.py | #! /usr/bin/env python
import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
bus.start_service_by_name("com.intel.Mojito")
mojito = bus.get_object("com.intel.Mojito", "/com/intel/Mojito")
mojito = dbus.Interface(mojito, "com.intel.Mojito")
path... | #! /usr/bin/env python
import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
bus.start_service_by_name("com.intel.Mojito")
mojito = bus.get_object("com.intel.Mojito", "/com/intel/Mojito")
mojito = dbus.Interface(mojito, "com.intel.Mojito")
path... | lgpl-2.1 | Python |
dc8d00ff4fd85ce9711802412e68fb01660cbb25 | Bump version to 0.1.8 | abiquo/api-python-client | abiquo/__init__.py | abiquo/__init__.py | # Copyright (C) 2008 Abiquo Holdings S.L.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | # Copyright (C) 2008 Abiquo Holdings S.L.
#
# 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... | apache-2.0 | Python |
db6cf45dd90d696845fbcec3e0e3810346336f42 | fix an import in dit.abc | chebee7i/dit,dit/dit,chebee7i/dit,dit/dit,chebee7i/dit,dit/dit,Autoplectic/dit,Autoplectic/dit,Autoplectic/dit,dit/dit,chebee7i/dit,Autoplectic/dit,dit/dit,Autoplectic/dit | dit/abc.py | dit/abc.py | """
Import several functions as shorthand.
"""
from dit import (Distribution as D,
ScalarDistribution as SD,
)
from dit.algorithms.entropy2 import entropy as H
from dit.algorithms import (coinformation as I,
gk_common_information as K,
... | """
Import several functions as shorthand.
"""
from dit import (Distribution as D,
ScalarDistribution as SD,
)
from dit.algorithms.entropy2 import entropy as H
from dit.algorithms import (coinformation as I,
common_information as K,
... | bsd-3-clause | Python |
ea0f3b0e18854a969d2508333436a1758ef7cb01 | update db name for testing | jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle | bluebottle/settings/testing.py | bluebottle/settings/testing.py | from .base import *
from .secrets import *
from bluebottle.payments_docdata.settings import *
# Supress naive date warnings
import warnings
warnings.filterwarnings(
'ignore', r"DateTimeField received a naive datetime .* while time zone support is active",
RuntimeWarning, r'django\.db\.models\.fields')
... | from .base import *
from .secrets import *
from bluebottle.payments_docdata.settings import *
# Supress naive date warnings
import warnings
warnings.filterwarnings(
'ignore', r"DateTimeField received a naive datetime .* while time zone support is active",
RuntimeWarning, r'django\.db\.models\.fields')
... | bsd-3-clause | Python |
2c2267cc84d2f49b67788bc3882a896b8aa4c73d | Correct return type for merge_with | valohai/valohai-yaml | valohai_yaml/objs/base.py | valohai_yaml/objs/base.py | from collections import OrderedDict
from typing import Any, Callable, Optional, Type, TypeVar
from ..lint import LintResult
from ..objs.utils import serialize_into
from ..utils.merge import merge_simple
T = TypeVar('T', bound='Item')
class Item:
"""
Base class for all objects represented in a valohai.yaml f... | from collections import OrderedDict
from typing import Any, Callable, Optional, Type, TypeVar
from ..lint import LintResult
from ..objs.utils import serialize_into
from ..utils.merge import merge_simple
T = TypeVar('T', bound='Item')
class Item:
"""
Base class for all objects represented in a valohai.yaml f... | mit | Python |
acadf626f5034ea25fc56298f2d25c95c7574d87 | fix typo wrong dependency | inclement/python-for-android,ibobalo/python-for-android,ibobalo/python-for-android,kivy/python-for-android,kronenpj/python-for-android,kronenpj/python-for-android,inclement/python-for-android,germn/python-for-android,inclement/python-for-android,PKRoma/python-for-android,inclement/python-for-android,rnixx/python-for-an... | pythonforandroid/recipes/libtribler/__init__.py | pythonforandroid/recipes/libtribler/__init__.py | from pythonforandroid.toolchain import PythonRecipe
"""
Privacy with BitTorrent and resilient to shut down
http://www.tribler.org
"""
class LibTriblerRecipe(PythonRecipe):
version = 'devel'
url = 'git+https://github.com/Tribler/tribler.git'
depends = ['apsw', 'cryptography', 'ffmpeg', 'libsodium', 'lib... | from pythonforandroid.toolchain import PythonRecipe
"""
Privacy with BitTorrent and resilient to shut down
http://www.tribler.org
"""
class LibTriblerRecipe(PythonRecipe):
version = 'devel'
url = 'git+https://github.com/Tribler/tribler.git'
depends = ['apsw', 'cryptography', 'ffmpeg', 'libsodium', 'lib... | mit | Python |
d8e2b5999c6f7a592f437ae9d3aea6c764c6c807 | Add default site settings check | ComputerScienceHouse/conditional,RamZallan/conditional,ComputerScienceHouse/conditional,ComputerScienceHouse/conditional,RamZallan/conditional,RamZallan/conditional | conditional/__init__.py | conditional/__init__.py | from flask import Flask
from flask import redirect
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
import structlog
app = Flask(__name__)
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db = SQLAlchemy(app)
migrate = Migrate(app, db)
logger = structlog.get_logger()
# pylint: disable=C... | from flask import Flask
from flask import redirect
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
import structlog
app = Flask(__name__)
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db = SQLAlchemy(app)
migrate = Migrate(app, db)
logger = structlog.get_logger()
# pylint: disable=C... | mit | Python |
21653d1894eae9cc52ecf5ae7cda3dfa921aee88 | bump version to 0.5.0.dev1 | jakevdp/vega_datasets | vega_datasets/__init__.py | vega_datasets/__init__.py | from vega_datasets.core import DataLoader, LocalDataLoader
data = DataLoader()
local_data = LocalDataLoader()
__version__ = '0.5.0.dev1'
| from vega_datasets.core import DataLoader, LocalDataLoader
data = DataLoader()
local_data = LocalDataLoader()
__version__ = '0.4.1'
| mit | Python |
cb161110adb2fcedcdf9ce0cce875037b1b4cabb | Update settings.py | dOpensource/dsiprouter,dOpensource/dsiprouter,dOpensource/dsiprouter,khorsmann/dsiprouter,khorsmann/dsiprouter,khorsmann/dsiprouter,dOpensource/dsiprouter,khorsmann/dsiprouter,dOpensource/dsiprouter | gui/settings.py | gui/settings.py | # dSIPRouter settings
# dSIPRouter will need to be restarted for any changes to take effect - except for Teleblock settings
DSIP_PORT = 5000
USERNAME = 'admin'
PASSWORD = 'admin'
# dSIPRouter internal settings
VERSION = 0.35
DEBUG = 0
# MySQL settings for kamailio
KAM_DB_TYPE = 'mysql'
KAM_DB_HOST = 'localhost'
KA... | # dSIPRouter settings
# dSIPRouter will need to be restarted for any changes to take effect - except for Teleblock settings
DSIP_PORT = 5000
USERNAME = 'admin'
PASSWORD = 'admin'
# dSIPRouter internal settings
VERSION = 0.34
DEBUG = 0
# MySQL settings for kamailio
KAM_DB_TYPE = 'mysql'
KAM_DB_HOST = 'localhost'
KA... | apache-2.0 | Python |
61c57b1eac6a9576971af41978083b5604b7edc5 | Update match_word_boundaries.py | costincaraivan/hackerrank,costincaraivan/hackerrank | regex/grouping/python3/match_word_boundaries.py | regex/grouping/python3/match_word_boundaries.py | Regex_Pattern = r'\b[aeiouAEIOU][a-zA-Z]*\b' # Do not delete 'r'.
| mit | Python | |
6d8e535a56ee2f05f051d101ee5f3903176f19fe | Update the default settings file to include the database threaded option | RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode | rnacentral/rnacentral/local_settings_default.py | rnacentral/rnacentral/local_settings_default.py | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | apache-2.0 | Python |
a4ff92e42dbbb4c6a302da31a4424759ac84c58b | remove nonexisting cti dependency (#14178) | iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/mrnet/package.py | var/spack/repos/builtin/packages/mrnet/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 Mrnet(AutotoolsPackage):
"""The MRNet Multi-Cast Reduction Network."""
homepage = "ht... | # 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 Mrnet(AutotoolsPackage):
"""The MRNet Multi-Cast Reduction Network."""
homepage = "ht... | lgpl-2.1 | Python |
21ac189b831cd79e5fdf7fa032173c745f7edae5 | Update example_distance.py example | openhumanoids/exotica,openhumanoids/exotica,openhumanoids/exotica,openhumanoids/exotica | examples/exotica_examples/scripts/example_distance.py | examples/exotica_examples/scripts/example_distance.py | #!/usr/bin/env python
import pyexotica as exo
from pyexotica.publish_trajectory import sigIntHandler
from time import sleep
import signal
import math
exo.Setup.initRos()
ompl = exo.Setup.loadSolver('{exotica_examples}/resources/configs/example_distance.xml')
sc = ompl.getProblem().getScene()
dt = 0.01
t = 0.0
signal... | #!/usr/bin/env python
import pyexotica as exo
from pyexotica.publish_trajectory import *
import math
exo.Setup.initRos()
ompl=exo.Setup.loadSolver('{exotica_examples}/resources/configs/example_distance.xml')
sc=ompl.getProblem().getScene()
sc.loadSceneFile('{exotica_examples}/resources/scenes/example_distance.scene')... | bsd-3-clause | Python |
8046dd94a4d7f81fe918909d7f53a47fa26eb252 | Raise <Model>.DoesNotExist rather than KeyError when appropriate | jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow | game/__init__.py | game/__init__.py | # -*- coding: utf-8 -*-
"""
Game module
Contains model logic for the game
"""
from .colors import *
class Model(object):
"""
Base Model class for all the game models:
Items, Spells, Quests, Talents, ...
"""
class DoesNotExist(Exception):
pass
@classmethod
def initProxy(cls, proxy):
cls.proxy = proxy(cls... | # -*- coding: utf-8 -*-
"""
Game module
Contains model logic for the game
"""
from .colors import *
class Model(object):
"""
Base Model class for all the game models:
Items, Spells, Quests, Talents, ...
"""
@classmethod
def initProxy(cls, proxy):
cls.proxy = proxy(cls)
def __init__(self, id):
if not has... | cc0-1.0 | Python |
823f81e57eaed91203fa819eac22aa2a3f41cf75 | Enforce Lithuanian language also for production | sirex/ubuntu.lt,sirex/ubuntu.lt | project/settings/prod.py | project/settings/prod.py | # -*- coding: utf-8 -*-
# MINIMAL CONFIGURATION FOR PRODUCTION ENV
# Create your own prod_local.py
# import * this module there and use it like this:
# python manage.py runserver --settings=project.settings.prod_local
from __future__ import unicode_literals
from .base import * # noqa
DEBUG = False
# https://doc... | # -*- coding: utf-8 -*-
# MINIMAL CONFIGURATION FOR PRODUCTION ENV
# Create your own prod_local.py
# import * this module there and use it like this:
# python manage.py runserver --settings=project.settings.prod_local
from __future__ import unicode_literals
from .base import * # noqa
DEBUG = False
# https://doc... | agpl-3.0 | Python |
3d3809931b5683b69e57507320b6d78df102f8d1 | Mark TimeStampedMixin.modified as an onupdate FetchedValue | davidfischer/warehouse | warehouse/database/mixins.py | warehouse/database/mixins.py | from sqlalchemy.dialects import postgresql as pg
from sqlalchemy.schema import FetchedValue
from sqlalchemy.sql import func
from sqlalchemy.sql.expression import text
from warehouse import db
from warehouse.database.schema import TableDDL
class UUIDPrimaryKeyMixin(object):
id = db.Column(pg.UUID(as_uuid=True),
... | from sqlalchemy.dialects import postgresql as pg
from sqlalchemy.sql import func
from sqlalchemy.sql.expression import text
from warehouse import db
from warehouse.database.schema import TableDDL
class UUIDPrimaryKeyMixin(object):
id = db.Column(pg.UUID(as_uuid=True),
primary_key=True, server_defaul... | bsd-2-clause | Python |
0a5d3cb164003ca95f1a9a55af6968a50fb0d4b5 | Use integers for slices. | Astroua/TurbuStat,e-koch/TurbuStat | turbustat/statistics/vca_vcs/slice_thickness.py | turbustat/statistics/vca_vcs/slice_thickness.py |
import numpy as np
def change_slice_thickness(cube, slice_thickness=1):
'''
Degrades the velocity resolution of a data cube. This is to avoid
shot noise by removing velocity fluctuations at small thicknesses.
Parameters
----------
cube : numpy.ndarray
3D data cube to degrade
... |
import numpy as np
def change_slice_thickness(cube, slice_thickness=1.0):
'''
Degrades the velocity resolution of a data cube. This is to avoid
shot noise by removing velocity fluctuations at small thicknesses.
Parameters
----------
cube : numpy.ndarray
3D data cube to degrade
... | mit | Python |
e778d2ab32d0317c23486a2c41ffd29a99592cc1 | Make drop_db script Python 3 compatible | pytest-dev/plugincompat,pytest-dev/plugincompat,pytest-dev/plugincompat | drop_db.py | drop_db.py | from web import PlugsStorage
s=PlugsStorage()
s.drop_all()
print('Database dropped')
| from web import PlugsStorage
s=PlugsStorage()
s.drop_all()
print 'Database dropped'
| mit | Python |
07bfcbb0142ff27453d455db3a20193d8c943bc3 | remove unwanted default options | lingdb/CoBL-public,lingdb/CoBL-public,lingdb/CoBL-public,lingdb/CoBL-public | ielex/lexicon/management/commands/writenexus.py | ielex/lexicon/management/commands/writenexus.py | from optparse import make_option
from os.path import expanduser, expandvars
from django.core.management.base import NoArgsCommand, CommandError
from ielex.lexicon.views import write_nexus
class Command(NoArgsCommand):
help="""Export a nexus file from the database"""
requires_model_validation = False
unique... | from optparse import make_option
from os.path import expanduser, expandvars
from django.core.management.base import NoArgsCommand, CommandError
from ielex.lexicon.views import write_nexus
class Command(NoArgsCommand):
help="""Export a nexus file from the database"""
requires_model_validation = False
unique... | bsd-2-clause | Python |
e97a03b7eb786621cc10189353a8c022ccb6ca83 | Add example to fasta documentation | grst/microbio | microbio/formats/fasta.py | microbio/formats/fasta.py | """
Read and write [fasta format](http://blast.ncbi.nlm.nih.gov/blastcgihelp.shtml)
"""
from itertools import groupby
class FastaReader(object):
"""
Read fasta files into tuples (header, seq).
"""
def __init__(self, file):
"""
Args:
file: The fasta file. Can either be a nam... | """
Read and write fasta format [1].
[1] http://blast.ncbi.nlm.nih.gov/blastcgihelp.shtml
"""
from itertools import groupby
class FastaReader(object):
"""
Read fasta files into tuples (header, seq).
"""
def __init__(self, file):
"""
Args:
file: The fasta file. Can either b... | mit | Python |
ee2366792cb7144d5e3c7b82f0607e32dcc9a178 | Add .h as an auxiliary extension for objc(++) | jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000 | bfg9000/tools/c_family.py | bfg9000/tools/c_family.py | from . import builder, cc, msvc
from .common import choose_builder
from ..languages import known_formats, known_langs
with known_langs.make('c') as x:
x.vars(compiler='CC', flags='CFLAGS')
x.exts(source=['.c'], header=['.h'])
with known_langs.make('c++') as x:
x.vars(compiler='CXX', flags='CXXFLAGS')
... | from . import builder, cc, msvc
from .common import choose_builder
from ..languages import known_formats, known_langs
with known_langs.make('c') as x:
x.vars(compiler='CC', flags='CFLAGS')
x.exts(source=['.c'], header=['.h'])
with known_langs.make('c++') as x:
x.vars(compiler='CXX', flags='CXXFLAGS')
... | bsd-3-clause | Python |
9784b1b0e9a5fd77c82cb9a41baac7f89bca03d2 | add 3.26 (#23788) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/fio/package.py | var/spack/repos/builtin/packages/fio/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Fio(AutotoolsPackage):
"""Flexible I/O Tester.
Fio spawns a number of threads or processes doing a particu... | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Fio(AutotoolsPackage):
"""Flexible I/O Tester.
Fio spawns a number of threads or processes doing a particu... | lgpl-2.1 | Python |
891b445677906229b01fe953a14ff2d950fba69e | Remove unused import | forseti-security/real-time-enforcer | app/parsers/cai.py | app/parsers/cai.py | # Copyright 2020 The Forseti Real Time Enforcer 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 requ... | # Copyright 2020 The Forseti Real Time Enforcer 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 requ... | apache-2.0 | Python |
8e9f4d007875821e65c0138e38a567fcce7c56d2 | Update for Build 7020 of nagfor compiler (#17555) | LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack | var/spack/repos/builtin/packages/nag/package.py | var/spack/repos/builtin/packages/nag/package.py | # Copyright 2013-2020 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 *
import os
class Nag(Package):
"""The NAG Fortran Compiler."""
homepage = "http://www.nag.com... | # Copyright 2013-2020 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 *
import os
class Nag(Package):
"""The NAG Fortran Compiler."""
homepage = "http://www.nag.com... | lgpl-2.1 | Python |
61e00ac1e1903f0d924ef4691b45f799a9befffc | add v1.4.4 (#22004) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/nim/package.py | var/spack/repos/builtin/packages/nim/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path
class Nim(Package):
"""Nim is a statically typed compiled systems programming language.
It combine... | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Nim(Package):
"""Nim is a statically typed compiled systems programming language.
It ... | lgpl-2.1 | Python |
537fa81c5dc9aca98fc8f0b5f66a17d7abc85fdf | add version 2019-04-24 (#11710) | LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack | var/spack/repos/builtin/packages/r3d/package.py | var/spack/repos/builtin/packages/r3d/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 R3d(MakefilePackage):
"""Fast, robust polyhedral intersections, analytic integration, and
... | # 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 R3d(MakefilePackage):
"""Fast, robust polyhedral intersections, analytic integration, and
... | lgpl-2.1 | Python |
98d12630332a4086f1f5530d794a14dd74adb800 | add CELERYD_MAX_TASKS_PER_CHILD = 128 | zBMNForks/mist.io,zBMNForks/mist.io,Lao-liu/mist.io,johnnyWalnut/mist.io,munkiat/mist.io,afivos/mist.io,DimensionDataCBUSydney/mist.io,kelonye/mist.io,munkiat/mist.io,afivos/mist.io,munkiat/mist.io,kelonye/mist.io,johnnyWalnut/mist.io,munkiat/mist.io,Lao-liu/mist.io,Lao-liu/mist.io,Lao-liu/mist.io,DimensionDataCBUSydne... | src/mist/io/celery_app.py | src/mist/io/celery_app.py | from __future__ import absolute_import
import logging
from celery import Celery
# Parse user defined settings from settings.py in the top level project dir
log = logging.getLogger(__name__)
settings = {}
try:
execfile("settings.py", settings)
except IOError:
log.warning("No settings.py file found.")
except E... | from __future__ import absolute_import
import logging
from celery import Celery
# Parse user defined settings from settings.py in the top level project dir
log = logging.getLogger(__name__)
settings = {}
try:
execfile("settings.py", settings)
except IOError:
log.warning("No settings.py file found.")
except E... | agpl-3.0 | Python |
84e62a0cba60ec2701e5776cb05e3fdb6c1194f0 | Fix unused imports | dissemin/dissemin,wetneb/dissemin,dissemin/dissemin,dissemin/dissemin,dissemin/dissemin,wetneb/dissemin,wetneb/dissemin,dissemin/dissemin,wetneb/dissemin | publishers/migrations/0002_update_aliases.py | publishers/migrations/0002_update_aliases.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def backwards(apps, schema_editor):
"""
Migration nullified after squash of papers
"""
pass
class Migration(migrations.Migration):
dependencies = [
('publishers', '0001_initial'),
]
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import defaultdict
from django.db import migrations
def backwards(apps, schema_editor):
"""
Migration nullified after squash of papers
"""
pass
class Migration(migrations.Migration):
dependencies = [
('publi... | agpl-3.0 | Python |
95f87ddd85aff07961a46d57c68a025b9f04ddd0 | Update banhelper.py | TingPing/plugins,TingPing/plugins | HexChat/banhelper.py | HexChat/banhelper.py | import hexchat
__module_name__ = "Banhelper"
__module_author__ = "TingPing"
__module_version__ = "5"
__module_description__ = "Simplifies banning and quieting"
wasop = False
def is_op():
for user in hexchat.get_list('users'):
if user.nick == hexchat.get_info('nick'):
# FIXME: This might not work on all network... | import hexchat
__module_name__ = "Banhelper"
__module_author__ = "TingPing"
__module_version__ = "5"
__module_description__ = "Simplifies banning and quieting"
wasop = False
def is_op():
for user in hexchat.get_list('users'):
if user.nick == hexchat.get_info('nick'):
if user.prefix == '@':
return True
e... | mit | Python |
d9f20935f6a0d5bf4e2c1dd1a3c5b41167f8518b | Fix migration file for Python 3.2 (and PEP8) | treyhunner/django-email-log,treyhunner/django-email-log | email_log/migrations/0001_initial.py | email_log/migrations/0001_initial.py | # encoding: utf8
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Email',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False,
... | # encoding: utf8
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Email',
fields=[
(u'id', models.AutoField(verbose_name=u'ID', serialize=False, auto_created=Tru... | mit | Python |
7b1a431c5f99ce9224c48f962f3135cc62b6d97c | Fix issue12938 - Update the docstring of html.escape. Include the information on single quote. | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/html/__init__.py | Lib/html/__init__.py | """
General functions for HTML manipulation.
"""
_escape_map = {ord('&'): '&', ord('<'): '<', ord('>'): '>'}
_escape_map_full = {ord('&'): '&', ord('<'): '<', ord('>'): '>',
ord('"'): '"', ord('\''): '''}
# NB: this is a candidate for a bytes/string polymorphic inter... | """
General functions for HTML manipulation.
"""
_escape_map = {ord('&'): '&', ord('<'): '<', ord('>'): '>'}
_escape_map_full = {ord('&'): '&', ord('<'): '<', ord('>'): '>',
ord('"'): '"', ord('\''): '''}
# NB: this is a candidate for a bytes/string polymorphic inter... | mit | Python |
a649fe6d3e1d21efb1323e0faff46f7f38fc381b | Check if input is a supported language | maxdeviant/linguist | linguist.py | linguist.py | import os
import re
import json
from os.path import join, isdir
from sys import argv, exit
from goslate import Goslate
gs = Goslate()
if len(argv) < 3:
exit('Not enough arguments')
source_language = argv[1].lower()
target_language = argv[2].lower()
supported = [x.lower() for x in gs.get_languages().keys()]
if ... | import os
import re
import json
from os.path import join, isdir
from sys import argv, exit
from goslate import Goslate
gs = Goslate()
if len(argv) < 3:
exit('Not enough arguments')
source_language = argv[1]
target_language = argv[2]
def wrap(string):
pattern_start = re.compile('{{')
pattern_end = re.com... | mit | Python |
6d0654bf7160f67f93fc9e07c7a07299bd9f3c9c | Update Vec class constructor, remove indirection via function, use operator module. | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Demo/classes/Vec.py | Demo/classes/Vec.py | # A simple vector class
import operator
class Vec:
def __init__(self, *v):
self.v = list(v)
@classmethod
def fromlist(cls, v):
if not isinstance(v, list):
raise TypeError
inst = cls()
inst.v = v
return inst
def __repr__(self):
return 'Vec... | # A simple vector class
def vec(*v):
return Vec(*v)
class Vec:
def __init__(self, *v):
self.v = list(v)
def fromlist(self, v):
if not isinstance(v, list):
raise TypeError
self.v = v[:]
return self
def __repr__(self):
return 'vec(' + repr(self.v)... | mit | Python |
4f1796881516b2475d64af44874997f2f10c8b48 | Reorder providers | neno1978/xbmctorrent | resources/site-packages/xbmctorrent/index.py | resources/site-packages/xbmctorrent/index.py | from xbmctorrent import plugin, scrapers
from xbmctorrent.scrapers import \
MODULES, \
eztv, \
yify, \
kickass, \
tpb
from xbmctorrent.ga import tracked, track_event
@plugin.route("/")
@tracked
def index():
for module in MODULES:
yield {
"label": module["name"],
... | from xbmctorrent import plugin, scrapers
from xbmctorrent.scrapers import \
MODULES, \
tpb, \
eztv, \
kickass
from xbmctorrent.ga import tracked, track_event
@plugin.route("/")
@tracked
def index():
for module in MODULES:
yield {
"label": module["name"],
"thumbnail... | apache-2.0 | Python |
742ca44700b5c1a715fb18f50905c64435e79474 | clarify update perf test has only one test so far | j5int/sqlalchemy,j5int/sqlalchemy | examples/performance/bulk_updates.py | examples/performance/bulk_updates.py | """This series of tests will illustrate different ways to UPDATE a large number
of rows in bulk (under construction! there's just one test at the moment)
"""
from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.ext.declarative ... | """This series of tests illustrates different ways to UPDATE a large number
of rows in bulk.
"""
from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import Session
fr... | mit | Python |
6cda2ff43a31ca9dafd2281844f0ce33c17f1704 | Update __about__.py | prkumar/uplink | uplink/__about__.py | uplink/__about__.py | """
This module is the single source of truth for any package metadata
that is used both in distribution (i.e., setup.py) and within the
codebase.
"""
__version__ = "0.2.1"
| """
This module is the single source of truth for any package metadata
that is used both in distribution (i.e., setup.py) and within the
codebase.
"""
__version__ = "0.2.0"
| mit | Python |
fb5a0dca62fc954060385e6d1b52a73e1670bc72 | Fix import for boto.cloudhsm.layer1.CloudHSMConnection. | janslow/boto,trademob/boto,Asana/boto,nexusz99/boto,varunarya10/boto,zachmullen/boto,ekalosak/boto,podhmo/boto,dimdung/boto,weebygames/boto,khagler/boto,bryx-inc/boto,awatts/boto,ryansb/boto,jindongh/boto,pfhayes/boto,zzzirk/boto,jotes/boto,TiVoMaker/boto,shaunbrady/boto,elainexmas/boto,lra/boto,yangchaogit/boto,rosmo/... | boto/cloudhsm/__init__.py | boto/cloudhsm/__init__.py | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights... | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights... | mit | Python |
985ad2edc81ba4d018f8c17be1f7bf19cedc6ede | Update to latest API | tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status | modules/contrib/layout.py | modules/contrib/layout.py | # pylint: disable=C0111,R0903
"""Displays and changes the current keyboard layout
Requires the following executable:
* setxkbmap
"""
import core.module
import core.widget
import core.input
import util.cli
class Module(core.module.Module):
def __init__(self, config):
super().__init__(config, core.wi... | # pylint: disable=C0111,R0903
"""Displays and changes the current keyboard layout
Requires the following executable:
* setxkbmap
"""
import bumblebee.util
import bumblebee.input
import bumblebee.output
import bumblebee.engine
class Module(bumblebee.engine.Module):
def __init__(self, engine, config):
... | mit | Python |
ba1c44289ba564b287eb694e34d1947202ccb317 | Add workers to db and fix faulty ssh | HaliteChallenge/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite,yangle/HaliteIO,HaliteChallenge/Halite-II,HaliteChallenge/Halite,HaliteChallenge/Halite,yangle/HaliteIO,lanyudhy/Halite-II,yangle/HaliteIO,yangle/HaliteIO,HaliteChallenge/Halite,yangle/HaliteIO,HaliteChallenge/Halite,HaliteChallenge/Halite,lanyudhy/Hal... | website/php/openNewWorker.py | website/php/openNewWorker.py | import boto.ec2
import boto.manage.cmdshell
import time
import random
import pymysql
import os.path
import configparser
parser = configparser.ConfigParser()
parser.read("../../halite.ini")
AWS_CONFIG = parser["aws"]
DB_CONFIG = parser["database"]
# Create instance
conn = boto.ec2.connect_to_region("us-east-1", aws_ac... | import boto.ec2
import boto.manage.cmdshell
import time
import os.path
import configparser
parser = configparser.ConfigParser()
parser.read("../../halite.ini")
AWS_CONFIG = parser["aws"]
print(AWS_CONFIG)
conn = boto.ec2.connect_to_region("us-east-1", aws_access_key_id=AWS_CONFIG["accessKey"], aws_secret_access_key=A... | mit | Python |
7eaccdf0e465aa9530b16d229a3d758f7292a7da | Make `flyingcloud --build testrunner` be non fatal. | cookbrite/flyingcloud,cookbrite/flyingcloud | examples/flask-web-app/salt/testrunner/layer.py | examples/flask-web-app/salt/testrunner/layer.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import, print_function
import os
from flyingcloud import DockerBuildLayer, CommandError
class TestRunner(DockerBuildLayer):
def do_build(self, namespace):
namespace.logger.warning("TestRunner build does nothing")
def do_run(... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import, print_function
import os
from flyingcloud import DockerBuildLayer, CommandError
class TestRunner(DockerBuildLayer):
def build(self, namespace):
raise NotImplementedError('TestRunner is not built')
def do_run(self, na... | apache-2.0 | Python |
f06c15d7e3f111dc93b0fba6899a449bc9d23b4a | Comment out DiscountPolicy stats method | hasgeek/boxoffice,hasgeek/boxoffice,hasgeek/boxoffice,hasgeek/boxoffice | boxoffice/extapi/slack.py | boxoffice/extapi/slack.py | from boxoffice import app
from boxoffice.models import DiscountPolicy, ItemCollection, LineItem, Order, ORDER_STATUS
from boxoffice.models.line_item import LINE_ITEM_STATUS
import requests
import json
from tabulate import tabulate
from rq.decorators import job
# def discount_stats(item_collection):
# stats = []
# ... | from boxoffice import app
from boxoffice.models import DiscountPolicy, ItemCollection, LineItem, Order, ORDER_STATUS
from boxoffice.models.line_item import LINE_ITEM_STATUS
import requests
import json
from tabulate import tabulate
from rq.decorators import job
def discount_stats(item_collection):
stats = []
fo... | agpl-3.0 | Python |
5577e2cbd8ce2bec0db07e425a3495ff40f601eb | fix not returning a list of versions when use_max_tag is set | lilydjwg/nvchecker | nvchecker/source/bitbucket.py | nvchecker/source/bitbucket.py | # MIT licensed
# Copyright (c) 2013-2019 lilydjwg <lilydjwg@gmail.com>, et al.
from . import session
from ..sortversion import sort_version_keys
# doc: https://confluence.atlassian.com/display/BITBUCKET/commits+or+commit+Resource
BITBUCKET_URL = 'https://bitbucket.org/api/2.0/repositories/%s/commits/%s'
BITBUCKET_MAX... | # MIT licensed
# Copyright (c) 2013-2019 lilydjwg <lilydjwg@gmail.com>, et al.
from . import session
from ..sortversion import sort_version_keys
# doc: https://confluence.atlassian.com/display/BITBUCKET/commits+or+commit+Resource
BITBUCKET_URL = 'https://bitbucket.org/api/2.0/repositories/%s/commits/%s'
BITBUCKET_MAX... | mit | Python |
9d22eb32d000aaff3a2cc61479e63a05cfa72aac | test that documentation is released | Omenia/robotframework-whitelibrary,Omenia/robotframework-whitelibrary | src/WhiteLibrary/version.py | src/WhiteLibrary/version.py | VERSION= "0.0.0"
STABLE= True
if __name__ == '__main__':
print(STABLE)
| VERSION= "0.0.0"
STABLE= False
if __name__ == '__main__':
print(STABLE)
| apache-2.0 | Python |
8bcc3736bbb4b88fefe284ff7eca5ee7abd07359 | change version | OCA/l10n-belgium,OCA/l10n-belgium | account_bank_statement_import_coda/__manifest__.py | account_bank_statement_import_coda/__manifest__.py | # Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Import CODA Bank Statement',
'author': "ACSONE SA/NV,Odoo Community Association (OCA)",
'website': "http://www.acsone.eu",
'category': 'Accounting & Finance',
'vers... | # Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Import CODA Bank Statement',
'author': "ACSONE SA/NV,Odoo Community Association (OCA)",
'website': "http://www.acsone.eu",
'category': 'Accounting & Finance',
'vers... | agpl-3.0 | Python |
f51226f5d67ae7297e5aa385fc324162028d806b | add serious benches | nushio3/formura,nushio3/formura,nushio3/formura,nushio3/formura,nushio3/formura,nushio3/formura | attic/xeon/survey-bench.py | attic/xeon/survey-bench.py | #!/usr/bin/env python
import subprocess, re
with open("/proc/cpuinfo","r") as fp:
for l in fp:
if re.match('model name', l):
m = re.search('\:\s*([^@]*)\s*\@',l)
rawcpuname = m.group(1)
cpuname = re.sub('[^A-Za-z0-9]','_',rawcpuname)
print cpuname
def gene... | #!/usr/bin/env python
import subprocess, re
with open("/proc/cpuinfo","r") as fp:
for l in fp:
if re.match('model name', l):
m = re.search('\:\s*([^@]*)\s*\@',l)
rawcpuname = m.group(1)
cpuname = re.sub('[^A-Za-z0-9]','_',rawcpuname)
print cpuname
def gene... | mit | Python |
fcbea07f020b0c21886a2df8b9a66e3c39eeba5b | Update "header" for lbfgsb. | mwhoffman/pybo,jhartford/pybo | pybo/globalopt/lbfgsb.py | pybo/globalopt/lbfgsb.py | """
Local gradient-based solver using multiple restarts.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
import numpy as np
import scipy.optimize
# exported symbols
__all__ = ['solve_lbfgsb']
def solve_lbfgsb(func_gr... | from __future__ import division
import numpy as np
import scipy.optimize
__all__ = ['solve_lbfgsb']
def solve_lbfgsb(func_grad, bounds, ngrid=10000, nbest=10, max=False):
"""
Compute func on a grid, pick nbest points, and LBFGS from there.
Args:
func_grad: function handle that takes an optional... | bsd-2-clause | Python |
44f0cbdb53f8e72ed029eb4c513da39fbd375ccc | Revise descriptive comments | bowen0701/algorithms_data_structures | lc0026_remove_duplicates_from_sorted_array.py | lc0026_remove_duplicates_from_sorted_array.py | """Leetcode 26. Remove Duplicates from Sorted Array
Easy
URL: https://leetcode.com/problems/remove-duplicates-from-sorted-array/
Given a sorted array nums, remove the duplicates in-place such that each element
appear only once and return the new length.
Do not allocate extra space for another array, you must do this... | """Leetcode 26. Remove Duplicates from Sorted Array
Easy
URL: https://leetcode.com/problems/remove-duplicates-from-sorted-array/
Given a sorted array nums, remove the duplicates in-place such that each element
appear only once and return the new length.
Do not allocate extra space for another array, you must do this... | bsd-2-clause | Python |
bed9f76bee74f703bc85492013d80daeb6b2f578 | Remove print | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | fellowms/management/commands/applicants_data.py | fellowms/management/commands/applicants_data.py | import pandas as pd
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ObjectDoesNotExist
from fellowms.models import Fellow
class Command(BaseCommand):
help = "Add old information to database."
# TODO Make use of args and options.
def handle(self, *args... | import pandas as pd
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ObjectDoesNotExist
from fellowms.models import Fellow
class Command(BaseCommand):
help = "Add old information to database."
# TODO Make use of args and options.
def handle(self, *args... | bsd-3-clause | Python |
b29755d8b287d263d350ac7a513c0030db293e04 | Add basic data models. | bable5/schdlr,bable5/schdlr,bable5/schdlr,bable5/schdlr | backend/schedule/models.py | backend/schedule/models.py | from django.db import models
class Event(models.Model):
contacts = models.ManyToMany(Contact)
capacity = models.IntegerField
setup_start = models.DateField
setup_end = model.DateField
event_start = model.DateField
event_end = model.DateField
teardown_start = model.DateField
teardown_end... | from django.db import models
class Event(models.Model):
pass
class Location(models.Model):
pass
class Contact(models.Model):
pass
class Resource(models.Model):
pass
class Contacts(models.Model):
pass
| mit | Python |
80ae893dcbc872a801767e8f2a0cfcd00cf4d132 | Update aperture tests | astropy/photutils,larrybradley/photutils | photutils/aperture/tests/test_aperture_common.py | photutils/aperture/tests/test_aperture_common.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides base classes for aperture tests.
"""
from astropy.coordinates import SkyCoord
from astropy.tests.helper import assert_quantity_allclose
from numpy.testing import assert_array_equal
class BaseTestApertureParams:
index = 2
... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides base classes for aperture tests.
"""
from astropy.coordinates import SkyCoord
from astropy.tests.helper import assert_quantity_allclose
from numpy.testing import assert_array_equal
class BaseTestApertureParams:
index = 2
... | bsd-3-clause | Python |
0d2b4d0901bc39966338eeb1a9f2c8213a7f8693 | Add media directory to urls.py | perna/bandhunter,perna/bandhunter | bandhunter/urls.py | bandhunter/urls.py | """bandhunter URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """bandhunter URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | mit | Python |
2b8dec15c1ab8008e25e25bb2d051f58c2a82343 | Change name to more meaningful name | IanLee1521/utilities | version/__init__.py | version/__init__.py | #! /usr/bin/env python
import datetime
import os
import subprocess
def pep386(version):
"""
Returns a PEP 386-compliant version number from VERSION
Given a 5 tuple of (X, Y, Z, rel, N) return a PEP-386 compliant version
string
"""
assert len(version) == 5
assert version[3] in ('alpha', '... | #! /usr/bin/env python
import datetime
import os
import subprocess
def get_version(version):
"""
Returns a PEP 386-compliant version number from VERSION
Given a 5 tuple of (X, Y, Z, rel, N) return a PEP-386 compliant version
string
"""
assert len(version) == 5
assert version[3] in ('alph... | mit | Python |
39ecdc13c57a350e00cdbe98d2fb7089fac86eb0 | Switch Cambridge to CSV | opencivicdata/scrapers-ca,opencivicdata/scrapers-ca | ca_on_cambridge/people.py | ca_on_cambridge/people.py | from __future__ import unicode_literals
from utils import CSVScraper
class CambridgePersonScraper(CSVScraper):
csv_url = 'https://maps.cambridge.ca/Images/OpenData/SharedDocuments/ElectedOfficials.csv'
| from __future__ import unicode_literals
from utils import CanadianScraper, CanadianPerson as Person
import re
COUNCIL_PAGE = 'http://www.cambridge.ca/cs_mayor/wards_councillors.php?cpid=51&sid=57'
MAYOR_PAGE = 'http://www.cambridge.ca/article.php?ssid=167'
class CambridgePersonScraper(CanadianScraper):
def scr... | mit | Python |
b99d1e6a27b84ae0d59587de35e32650ec7397b6 | update to version 0.38 | fatrix/django-fastapp,fatrix/django-fastapp,fatrix/django-fastapp | fastapp/__init__.py | fastapp/__init__.py | __version__ = "0.38"
| __version__ = "0.37"
| mit | Python |
046c0cc23e4092561c9dbd11dcb355d7b75256f2 | Add a test for the running_mean function | gully/PyKE,christinahedges/PyKE | pyke/tests/test_utils.py | pyke/tests/test_utils.py | import argparse
from numpy.testing import assert_almost_equal
from ..utils import PyKEArgumentHelpFormatter
from ..utils import module_output_to_channel, channel_to_module_output
from ..utils import running_mean
def test_PyKEArgumentHelpFormatter():
parser = argparse.ArgumentParser(
description=(... | import argparse
from ..utils import PyKEArgumentHelpFormatter
from ..utils import module_output_to_channel, channel_to_module_output
def test_PyKEArgumentHelpFormatter():
parser = argparse.ArgumentParser(
description=('Test PyKEArgumentHelpFormatter'),
formatter_class=PyKEArgument... | mit | Python |
b3d171a48122524725f8ade9eb51e144eec97841 | fix user update | mlgruby/mining,mining/mining,chrisdamba/mining,seagoat/mining,jgabriellima/mining,jgabriellima/mining,avelino/mining,chrisdamba/mining,mlgruby/mining,mlgruby/mining,avelino/mining,mining/mining,AndrzejR/mining,AndrzejR/mining,seagoat/mining | controllers/api/base.py | controllers/api/base.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle import response, request
from bson.json_util import dumps
from utils import slugfy
def base():
response.set_header('charset', 'utf-8')
response.content_type = 'application/json'
def get(mongodb, collection, slug):
base()
if slug:
da... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle import response, request
from bson.json_util import dumps
from utils import slugfy
def base():
response.set_header('charset', 'utf-8')
response.content_type = 'application/json'
def get(mongodb, collection, slug):
base()
if slug:
da... | mit | Python |
335808d7ea2bebf249cb62206a3a8bea5b1f163b | Fix push | zackzachariah/scavenger,zackzachariah/scavenger | server/pushlanding.py | server/pushlanding.py | import logging
import os
import json
from .models import Game, Player, Progress
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse, Http404
from django.views.decorators.csrf import csrf_exempt
from twilio.rest import TwilioRestClient
logger = logging.getLogger('django')
@csrf_... | import logging
import os
import json
from .models import Player, Progress
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse, Http404
from django.views.decorators.csrf import csrf_exempt
from twilio.rest import TwilioRestClient
logger = logging.getLogger('django')
@csrf_exempt... | mit | Python |
c1e89b73cd5b2e29b4d75958872a60c2f44beb71 | Add test to fabric | banjocat/calorie-find,banjocat/calorie-find | fabfile.py | fabfile.py | from fabric.api import env, run, put, hosts, cd, local
env.user = 'root'
@hosts('giantgreendinosaur.com')
def deploy():
'''
Deploy it
'''
run('mkdir -p /app/caloriefind')
put('./production-compose.yml', '/app/caloriefind/docker-compose.yml')
with cd('/app/caloriefind'):
run('docker-com... | from fabric.api import env, run, put, hosts, cd
env.user = 'root'
@hosts('giantgreendinosaur.com')
def deploy():
'''
Deploy it
'''
run('mkdir -p /app/caloriefind')
put('./production-compose.yml', '/app/caloriefind/docker-compose.yml')
with cd('/app/caloriefind'):
run('docker-compose pu... | bsd-2-clause | Python |
c4241d448300f7110b52e8375b3d177a7f67b8b0 | remove useless import | yohanboniface/memopol-core,yohanboniface/memopol-core,yohanboniface/memopol-core | memopol2/urls.py | memopol2/urls.py | import os
from django.contrib.sitemaps import GenericSitemap
from django.conf.urls.defaults import patterns, include, url
from django.views.generic.simple import direct_to_template
from django.conf import settings
from django.contrib import admin
from django.views.static import serve
from mps.models import MP
from mep... | import os
from django.contrib.sitemaps import GenericSitemap
from django.conf.urls.defaults import patterns, include, url
from django.views.generic.simple import direct_to_template
from django.views.generic import ListView
from django.conf import settings
from django.contrib import admin
from django.views.static impor... | agpl-3.0 | Python |
733404ba2eb7218bb4d253cd74fe88107ff75afc | Remove successful OpenID login live test. It's redundant with our message-related live tests. | ByteCommander/ChatExchange6,hichris1234/ChatExchange,Charcoal-SE/ChatExchange,hichris1234/ChatExchange,ByteCommander/ChatExchange6,Charcoal-SE/ChatExchange | test/test_live_openid_login.py | test/test_live_openid_login.py | import time
import pytest
from chatexchange.browser import SEChatBrowser, LoginError
import live_testing
if live_testing.enabled:
def test_openid_login_recognizes_failure():
"""
Tests that failed SE OpenID logins raise errors.
"""
browser = SEChatBrowser()
# avoid hitti... | import time
import pytest
from chatexchange.browser import SEChatBrowser, LoginError
import live_testing
if live_testing.enabled:
def test_openid_login():
"""
Tests login to the Stack Exchange OpenID provider.
"""
browser = SEChatBrowser()
# avoid hitting the SE servers... | apache-2.0 | Python |
77bd56c0c1d6143f67c7a5a0684a42b8a403a895 | Copy images to presentation during build | alanorth/rmg-linux-migration-2014 | fabfile.py | fabfile.py | from fabric.api import local
from jinja2 import Environment, FileSystemLoader
template_env = Environment(loader=FileSystemLoader('.'))
# copy reveal.js assets from submodule to presentation
def prepare():
local('cp -r reveal.js/css/* presentation/css/')
local('cp -r reveal.js/js/* presentation/js/')
loca... | from fabric.api import local
from jinja2 import Environment, FileSystemLoader
template_env = Environment(loader=FileSystemLoader('.'))
# copy reveal.js assets from submodule to presentation
def prepare():
local('cp -r reveal.js/css/* presentation/css/')
local('cp -r reveal.js/js/* presentation/js/')
loca... | unlicense | Python |
35acf90d45146c78c6bfa2e04e30e548629385f4 | deploy to master | sounay/flaminggo-test,qlands/onadata,ehealthafrica-ci/onadata,GeoODK/onadata,kobotoolbox/kobocat,hnjamba/onaclone,awemulya/fieldsight-kobocat,ehealthafrica-ci/formhub,kobotoolbox/kobocat,SEL-Columbia/formhub,mainakibui/kobocat,ehealthafrica-ci/onadata,smn/onadata,hnjamba/onaclone,SEL-Columbia/formhub,spatialdev/onadata... | fabfile.py | fabfile.py | import os
from fabric.api import env, run, cd
from fabric.decorators import hosts
DEFAULTS = {
'home': '/home/wsgi/srv/',
'repo_name': 'formhub',
}
DEPLOYMENTS = {
'alpha': {
'project': 'ei_surveyor_alpha',
'branch': 'master',
},
'dev': {
'project': 'formhub_dev',
... | import os
from fabric.api import env, run, cd
from fabric.decorators import hosts
DEFAULTS = {
'home': '/home/wsgi/srv/',
'repo_name': 'formhub',
}
DEPLOYMENTS = {
'alpha': {
'project': 'ei_surveyor_alpha',
'branch': 'master',
},
'dev': {
'project': 'formhub_dev',
... | bsd-2-clause | Python |
d2164a1045badfe28b27509098a456a3b96a2687 | put solebtc in home | freeusd/solebtc,solefaucet/sole-server,freeusd/solebtc,freeusd/solebtc,solefaucet/sole-server,solefaucet/sole-server | fabfile.py | fabfile.py | from fabric.api import env
from fabric.context_managers import cd
from fabric.operations import run, local, put
env.shell = '/bin/bash -l -c'
env.user = 'd'
env.roledefs.update({
'staging': ['staging.solebtc.com'],
'production': ['solebtc.com']
})
# Heaven will execute fab -R staging deploy:branch_name=master... | from fabric.api import env
from fabric.context_managers import cd
from fabric.operations import run, local, put
env.shell = '/bin/bash -l -c'
env.user = 'd'
env.roledefs.update({
'staging': ['staging.solebtc.com'],
'production': ['solebtc.com']
})
# Heaven will execute fab -R staging deploy:branch_name=master... | mit | Python |
9da489494a08aaa1c14f2bd1673b51d3b35333c2 | add blosc compression | opesci/pyrevolve,opesci/pyrevolve | pyrevolve/compression.py | pyrevolve/compression.py | import blosc
from contexttimer import Timer
def identity(indata):
return indata
def blosc_compress(indata):
s = indata.tostring()
CHUNK_SIZE = 1000000
chunked = [ s[i:i+CHUNK_SIZE] for i in range(0, len( s), CHUNK_SIZE)]
time = 0
size = 0
for chunk in chunked:
with Timer(factor=10... |
def identity(indata):
print("Got data")
return indata
compressors = {None: identity}
decompressors = {None: identity}
| epl-1.0 | Python |
4b12315c8db362759cb7d5a7d732fd23ca2f3f96 | Add haversine, imports | johngroves/SCOUT,johngroves/SCOUT | Logic/navigation.py | Logic/navigation.py | # ------------------------------------------------------------------------------
# Control Arduino With Python Via Serial
# ------------------------------------------------------------------------------
from math import radians, cos, sin, asin, sqrt
import PyCmdMessenger
arduino = PyCmdMessenger.ArduinoBoard("/dev/cu... | # ------------------------------------------------------------------------------
# Control Arduino With Python Via Serial
# ------------------------------------------------------------------------------
import PyCmdMessenger
arduino = PyCmdMessenger.ArduinoBoard("/dev/cu.usbmodem1421",baud_rate=115200, timeout=10)
co... | mit | Python |
66febc983b70b72326ef93a098950842b469774d | Update __init__.py | inkenbrandt/WellApplication | wellapplication/__init__.py | wellapplication/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from .transport import *
from .usgs import *
from .chem import *
from .mesopy import *
from .graphs import *
from .MannKendall import *
__version__ = '0.4.28'
__author__ = 'Paul Inkenbrand... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from .transport import *
from .usgs import *
from .chem import *
from .mesopy import *
from .graphs import *
from .MannKendall import *
__version__ = '0.4.27'
__author__ = 'Paul Inkenbrand... | mit | Python |
210e99b9b19484991f4d7d4106ed9c0ae802b2f7 | Stop forwarding flash by default, it breaks more than it doesn't. | windmill/windmill,windmill/windmill,windmill/windmill,windmill/windmill,windmill/windmill,windmill/windmill | windmill/server/__init__.py | windmill/server/__init__.py | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# 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
#
# ... | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# 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
#
# ... | apache-2.0 | Python |
b1519ec451d5ba3b32539a3d1cf9aae670d90f69 | add Parfrey to microbes | OpenTreeOfLife/gcmdr | microbes.py | microbes.py | synthottolid="805080"
"""
full list
study 425 tree 5976
study 239 tree 111 and 112
study 263 tree 149
study 2413 tree 5093 and 5094
study 2397 tree 5038 and 5039
study 2398 tree 5040
from Dail
2739 6325 Bettina E Schirrmeister, Alexandre Antonelli, Homayoun C Bagheri. 2011. The origin of multicellularity in cyan... | synthottolid="805080"
"""
full list
study 425 tree 5976
study 239 tree 111 and 112
study 263 tree 149
study 2413 tree 5093 and 5094
study 2397 tree 5038 and 5039
study 2398 tree 5040
from Dail
2739 6325 Bettina E Schirrmeister, Alexandre Antonelli, Homayoun C Bagheri. 2011. The origin of multicellularity in cyan... | bsd-2-clause | Python |
8f97fa4ddc3350563db44e335f7eaf5c02801a67 | use full path to CPack on Windows | idscan/polly,idscan/polly,ruslo/polly,ruslo/polly | bin/detail/pack_command.py | bin/detail/pack_command.py | # Copyright (c) 2014, Ruslan Baratov
# All rights reserved.
import os
import subprocess
import detail.call
def run(config, logging, cpack_generator):
pack_command = ['cpack']
if os.name == 'nt':
# use full path to cpack since Chocolatey pack command has the same name
cmake_list = subprocess.check_output(... | # Copyright (c) 2014, Ruslan Baratov
# All rights reserved.
import detail.call
def run(config, logging, cpack_generator):
pack_command = ['cpack']
if config:
pack_command.append('-C')
pack_command.append(config)
pack_command.append('--verbose')
if cpack_generator:
pack_command.append('-G{}'.format... | bsd-2-clause | Python |
44a476983e3b865774975d3e2d5e40f9171eed77 | use new style string formatting | racker/fleece,racker/fleece | fleece/httperror.py | fleece/httperror.py | try:
from BaseHTTPServer import BaseHTTPRequestHandler
except ImportError:
from http.server import BaseHTTPRequestHandler
# import lzstring
# lz = lzstring.LZString()
# lz.decompressFromBase64(SECRET)
SECRET = ('FAAj4yrAKVogfQeAlCV9qIDQ0agHTLQxxKK76U0GEKZg'
'4Dkl9YA9NADoQfeJQHFiC4gAPgCJJ4np07BZS8OMqy... | try:
from BaseHTTPServer import BaseHTTPRequestHandler
except ImportError:
from http.server import BaseHTTPRequestHandler
# import lzstring
# lz = lzstring.LZString()
# lz.decompressFromBase64(SECRET)
SECRET = ('FAAj4yrAKVogfQeAlCV9qIDQ0agHTLQxxKK76U0GEKZg'
'4Dkl9YA9NADoQfeJQHFiC4gAPgCJJ4np07BZS8OMqy... | apache-2.0 | Python |
c47688d76b069ddb8ec0c3dae4c7cc8dc0b7b0c8 | Prepare v2.20.1.dev | tobinjt/Flexget,Danfocus/Flexget,tobinjt/Flexget,ianstalk/Flexget,gazpachoking/Flexget,malkavi/Flexget,Flexget/Flexget,Flexget/Flexget,malkavi/Flexget,tobinjt/Flexget,Flexget/Flexget,JorisDeRieck/Flexget,Danfocus/Flexget,Danfocus/Flexget,JorisDeRieck/Flexget,Flexget/Flexget,crawln45/Flexget,gazpachoking/Flexget,malkavi... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
103225d30e62313ef38f41fadae58bfa66e365c5 | Update settings.py | tariqdaouda/Mariana,tariqdaouda/Mariana,JonathanSeguin/Mariana,tariqdaouda/Mariana | Mariana/settings.py | Mariana/settings.py | #Personal tribute to nomad soul
OMICRON_SIGNATURE = ">|\/| /-\ |-> | /-\ |\| /-\>"
VERBOSE = True
SAVE_MESSAGE_LOG = True
SAVE_MESSAGE_LOG_FILE = "Mariana_logs.txt"
#The random used for initialising weights
RANDOM_SEED = None
| #Personal tribute to nomad soul
OMICRON_SIGNATURE = ">|\/| /-\ |-> | /-\ |\| /-\>"
VERBOSE = True
SAVE_MESSAGE_LOG = False
SAVE_MESSAGE_LOG_FILE = "Mariana_logs.txt"
#The random used for initialising weights
RANDOM_SEED = None
| apache-2.0 | Python |
61eccf905b01476761d5bc9ed380bd7000fedea1 | Add some more information on how many entries were saved | e-mission/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server | emission/public/pull_and_load_public_data.py | emission/public/pull_and_load_public_data.py | import emission.core.get_database as edb
import bson.json_util as bju
import requests
import json
import logging
# Request data for the specified phones and time range
def request_data(server_url, from_ts, to_ts, phone_ids, debug):
url = server_url + "/eval/publicData/timeseries?from_ts=" + str(
from_ts) ... | import emission.core.get_database as edb
import bson.json_util as bju
import requests
import json
import logging
# Request data for the specified phones and time range
def request_data(server_url, from_ts, to_ts, phone_ids, debug):
url = server_url + "/eval/publicData/timeseries?from_ts=" + str(
from_ts) ... | bsd-3-clause | Python |
e932867fb3cfbd2a07b632d6dc90da78967c9e74 | add GCC currencies | khchine5/django-shop,divio/django-shop,jrief/django-shop,nimbis/django-shop,khchine5/django-shop,nimbis/django-shop,divio/django-shop,jrief/django-shop,khchine5/django-shop,nimbis/django-shop,divio/django-shop,jrief/django-shop,nimbis/django-shop,khchine5/django-shop,awesto/django-shop,jrief/django-shop,awesto/django-s... | shop/money/iso4217.py | shop/money/iso4217.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
# Dictionary of currency representations:
# key: official ISO 4217 code
# value[0]: numeric representation
# value[1]: number of digits
# value[2]: currency symbol in UTF-8
# value[3]: textual descri... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
# Dictionary of currency representations:
# key: official ISO 4217 code
# value[0]: numeric representation
# value[1]: number of digits
# value[2]: currency symbol in UTF-8
# value[3]: textual descri... | bsd-3-clause | Python |
3963c53872e1edeb816b87fffd0149f282aa6697 | Bump to 0.11.6 | flomotlik/formica | formica/__init__.py | formica/__init__.py | import logging
import sys
__version__ = "0.11.6"
CHANGE_SET_FORMAT = "{stack}-change-set"
logger = logging.getLogger("formica")
handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter("%(message)s")
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
| import logging
import sys
__version__ = "0.11.5"
CHANGE_SET_FORMAT = "{stack}-change-set"
logger = logging.getLogger("formica")
handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter("%(message)s")
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
| mit | Python |
3337617c50269a148f5c09e9ca2ab9d8bda9425a | Delete parent modules from sys.modules | sixty-north/cosmic-ray | cosmic_ray/importing.py | cosmic_ray/importing.py | """Functionality related to Python's import mechanisms.
"""
import contextlib
from importlib.abc import MetaPathFinder
from importlib.machinery import ModuleSpec
from itertools import accumulate
import sys
class ASTLoader: # pylint:disable=old-style-class,too-few-public-methods
"""An `importlib.abc.Loader` whic... | """Functionality related to Python's import mechanisms.
"""
import contextlib
from importlib.abc import MetaPathFinder
from importlib.machinery import ModuleSpec
import sys
class ASTLoader: # pylint:disable=old-style-class,too-few-public-methods
"""An `importlib.abc.Loader` which loads an AST for a particular n... | mit | Python |
765f0cc33ad49160376481b4579c7720c78aa367 | fix url params matching | uw-it-aca/course-roster-lti,uw-it-aca/course-roster-lti,uw-it-aca/course-roster-lti,uw-it-aca/course-roster-lti | course_roster/models.py | course_roster/models.py | from django.db import models
from uw_pws import PWS
try:
from urllib.parse import urlparse, urlunparse
except ImportError:
from urlparse import urlparse, urlunparse
import random
import string
class IDPhoto(models.Model):
""" Retrieves idphoto images for Canvas users.
"""
url_key = models.CharFiel... | from django.db import models
from uw_pws import PWS
try:
from urllib.parse import urlparse, urlunparse, urlencode
except ImportError:
from urlparse import urlparse, urlunparse
from urllib import urlencode
import random
import string
class IDPhoto(models.Model):
""" Retrieves idphoto images for Canvas ... | apache-2.0 | Python |
6f74e2989b1e5b4b1cdfa963a2dbe03a6407d843 | Fix flake8 issues | morepath/reg | reg/tests/test_docgen.py | reg/tests/test_docgen.py | import pydoc
from sphinx.application import Sphinx
from .fixtures.module import Foo, foo
def rstrip_lines(s):
"Delete trailing spaces from each line in s."
return "\n".join(line.rstrip() for line in s.splitlines())
def test_dispatch_method_class_help(capsys):
pydoc.help(Foo)
out, err = capsys.readou... | import pydoc
from sphinx.application import Sphinx
from .fixtures.module import Foo, foo
def rstrip_lines(s):
"Delete trailing spaces from each line in s."
return "\n".join(l.rstrip() for l in s.splitlines())
def test_dispatch_method_class_help(capsys):
pydoc.help(Foo)
out, err = capsys.readouterr()... | bsd-3-clause | Python |
2c0ba063b79259e17336f6a6f6776bb8b7c16e87 | Fix missing import | ECP-CANDLE/Benchmarks,ECP-CANDLE/Benchmarks,ECP-CANDLE/Benchmarks | Pilot3/P3B5/p3b5.py | Pilot3/P3B5/p3b5.py | import os
import candle
file_path = os.path.dirname(os.path.realpath(__file__))
lib_path2 = os.path.abspath(os.path.join(file_path, '..', '..', 'common'))
sys.path.append(lib_path2)
REQUIRED = [
'learning_rate',
'learning_rate_min',
'momentum',
'weight_decay',
'grad_clip',
'seed',
'unro... | import candle
file_path = os.path.dirname(os.path.realpath(__file__))
lib_path2 = os.path.abspath(os.path.join(file_path, '..', '..', 'common'))
sys.path.append(lib_path2)
REQUIRED = [
'learning_rate',
'learning_rate_min',
'momentum',
'weight_decay',
'grad_clip',
'seed',
'unrolled',
... | mit | Python |
231c1f045a9b534f1aaf5e016e063a687c2d9402 | make FriendList in friend_machanism.py iterable | misterlihao/network-programming-project | friend_mechanism.py | friend_mechanism.py | from online_check import *
class FriendList:
def __init__(self, file_name):
self.file_name = file_name
self.ip_name_status_list = []
with open(self.file_name) as file:
for line in file:
ip, name = line.split(':')
self.ip_name_status_list.append([ip... | from online_check import *
class FriendList:
def __init__(self, file_name):
self.file_name = file_name
self.friends_status_list = []
with open(self.file_name) as file:
for line in file:
ip, name = line.split(':')
self.friends_status_list.append([ip... | mit | Python |
a34982db60460d9e9664b34bd9168117ed9d7a8f | Remove print | mvaled/sentry,gg7/sentry,daevaorn/sentry,kevinastone/sentry,gencer/sentry,JTCunning/sentry,wujuguang/sentry,1tush/sentry,vperron/sentry,JamesMura/sentry,ewdurbin/sentry,camilonova/sentry,fuziontech/sentry,Natim/sentry,JackDanger/sentry,argonemyth/sentry,felixbuenemann/sentry,zenefits/sentry,BuildingLink/sentry,JTCunnin... | src/sentry/utils/raven.py | src/sentry/utils/raven.py | from __future__ import absolute_import, print_function
from django.conf import settings
from django.db import transaction
from raven.contrib.django.client import DjangoClient
from sentry.event_manager import EventManager
class SentryInternalClient(DjangoClient):
def is_enabled(self):
return settings.SEN... | from __future__ import absolute_import, print_function
from django.conf import settings
from django.db import transaction
from raven.contrib.django.client import DjangoClient
from sentry.event_manager import EventManager
class SentryInternalClient(DjangoClient):
def is_enabled(self):
return settings.SEN... | bsd-3-clause | Python |
f9566ae8f34cf1dcfa8a5ca57dff0aef900f3df9 | Add basic tests | znerol/spreadflow-thumbor | spreadflow_thumbor/test/test_thumbor_proc.py | spreadflow_thumbor/test/test_thumbor_proc.py | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import copy
from twisted.internet import defer
from mock import Mock
from testtools import TestCase, run_test_with
from testtools.twistedsupport import AsynchronousDeferredRunTest
from spreadflow_core.sche... | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from twisted.trial import unittest
from spreadflow_thumbor.proc import ThumborService, ThumborUrlGenerator
class SpreadflowThumborTestCase(unittest.TestCase):
pass
| mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.