commit stringlengths 40 40 | subject stringlengths 1 1.49k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | new_contents stringlengths 1 29.8k | old_contents stringlengths 0 9.9k | lang stringclasses 3
values | proba float64 0 1 |
|---|---|---|---|---|---|---|---|
e145ef6ca54c9615f038601da17daf16550196d6 | Use environment variables to locate Windows GStreamer includes | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "gstreamer-superficial",
"sources": [ "gstreamer.cpp", "GLibHelpers.cpp", "GObjectWrap.cpp", "Pipeline.cpp" ],
"include_dirs": [
"<!(node -e \"require('nan')\")"
],
"cflags": [
"-Wno-cast-function-type"
],
"conditions" : [
["OS=='linux'", {
"in... | {
"targets": [
{
"target_name": "gstreamer-superficial",
"sources": [ "gstreamer.cpp", "GLibHelpers.cpp", "GObjectWrap.cpp", "Pipeline.cpp" ],
"include_dirs": [
"<!(node -e \"require('nan')\")"
],
"cflags": [
"-Wno-cast-function-type"
],
"conditions" : [
["OS=='linux'", {
"in... | Python | 0 |
55dd6cb9dfb72fcbff89b10ccdd0d68c309d9aa9 | Enable RTTI on OS X to fix exception handling (gh issue #106) | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "oracle_bindings",
"sources": [ "src/connection.cpp",
"src/oracle_bindings.cpp",
"src/executeBaton.cpp",
"src/reader.cpp",
"src/statement.cpp",
"src/outParam.cpp" ],
"... | {
"targets": [
{
"target_name": "oracle_bindings",
"sources": [ "src/connection.cpp",
"src/oracle_bindings.cpp",
"src/executeBaton.cpp",
"src/reader.cpp",
"src/statement.cpp",
"src/outParam.cpp" ],
"... | Python | 0 |
043a0ad774964d2608ee1c8bd8ba1abc5b2ed0b4 | Tweak binding.gyp so it doesn't error out on Windows | binding.gyp | binding.gyp | {
'targets': [{
'target_name': 'pty',
'conditions': [
['OS!="win"', {
'include_dirs' : [
'<!(node -e "require(\'nan\')")'
],
'sources': [
'src/unix/pty.cc'
],
'libraries': [
'-lutil',
'-L/usr/lib',
'-L/usr/local/li... | {
'conditions': [
['OS!="win"', {
'targets': [{
'target_name': 'pty',
'include_dirs' : [
'<!(node -e "require(\'nan\')")'
],
'sources': [
'src/unix/pty.cc'
],
'libraries': [
'-lutil',
'-L/usr/lib',
'-L/usr/loca... | Python | 0 |
5a6f748981554cb4d4aa0b5500a9b86bd09eb1b5 | Add Linux static bindings | binding.gyp | binding.gyp | {
'targets': [
{
'target_name': 'zmq',
'sources': [ 'binding.cc' ],
'include_dirs' : [
"<!(node -e \"require('nan')\")"
],
'conditions': [
['OS=="win"', {
'win_delay_load_hook': 'true',
'include_dirs': ['windows/include'],
'link_settings'... | {
'targets': [
{
'target_name': 'zmq',
'sources': [ 'binding.cc' ],
'include_dirs' : [
"<!(node -e \"require('nan')\")"
],
'conditions': [
['OS=="win"', {
'win_delay_load_hook': 'true',
'include_dirs': ['windows/include'],
'link_settings'... | Python | 0 |
777bb37f9ac4457dca79a07953356ce46b941a30 | change '-std=c++11' to '-std=c++0x' for linux | binding.gyp | binding.gyp | {
'targets': [
{
'target_name': 'eigen',
'sources': [
'src/EigenJS.cpp'
],
'include_dirs': [
'deps',
"<!(node -e \"require('nan')\")"
],
'conditions': [
['OS=="win"', {
'msvs_settings': {
'VCCLCompilerTool': {
... | {
'targets': [
{
'target_name': 'eigen',
'sources': [
'src/EigenJS.cpp'
],
'include_dirs': [
'deps',
"<!(node -e \"require('nan')\")"
],
'conditions': [
['OS=="win"', {
'msvs_settings': {
'VCCLCompilerTool': {
... | Python | 0.000023 |
786e7d83672ad5ff2718c9a440dbd180f8e7b24a | make addon buildable as static library (#119) | binding.gyp | binding.gyp | {
'targets': [
{
'target_name': 'kerberos',
'type': 'loadable_module',
'include_dirs': [ '<!(node -e "require(\'nan\')")' ],
'sources': [
'src/kerberos.cc'
],
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.12',
'OTHER_CFLAGS': [
"-std=c++1... | {
'targets': [
{
'target_name': 'kerberos',
'include_dirs': [ '<!(node -e "require(\'nan\')")' ],
'sources': [
'src/kerberos.cc'
],
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.12',
'OTHER_CFLAGS': [
"-std=c++11",
"-stdlib=libc++"
... | Python | 0.000001 |
b6208c1f9b6f0afca1dff40a66d2c915594b1946 | Add exception hook to help diagnose server test errors in python3 gui mode | blaze/io/server/tests/start_simple_server.py | blaze/io/server/tests/start_simple_server.py | """
Starts a Blaze server for tests.
$ start_test_server.py /path/to/catalog_config.yaml <portnumber>
"""
import sys, os
if os.name == 'nt':
old_excepthook = sys.excepthook
# Exclude this from our autogenerated API docs.
undoc = lambda func: func
@undoc
def gui_excepthook(exctype, value, tb):
... | """
Starts a Blaze server for tests.
$ start_test_server.py /path/to/catalog_config.yaml <portnumber>
"""
import sys, os
import blaze
from blaze.io.server.app import app
blaze.catalog.load_config(sys.argv[1])
app.run(port=int(sys.argv[2]), use_reloader=False)
| Python | 0 |
826698c9894ce94c625718eb041ce817eb6ab5ef | Update config.dist.py | boiler/boiler_template/config/config.dist.py | boiler/boiler_template/config/config.dist.py | from project.backend import config
class DefaultConfig(config.DefaultConfig):
""" Local development config """
# set this for offline mode
SERVER_NAME = None
SECRET_KEY = None
class DevConfig(config.DevConfig, DefaultConfig):
""" Local development config """
pass
class TestingConfig(config... | from project.backend import config
class DefaultConfig(config.DefaultConfig):
""" Local development config """
# set this for offline mode
SERVER_NAME = None
SECRET_KEY = None
class DevConfig(config.DevConfig, DefaultConfig):
""" Local development config """
pass
class TestingConfig(config... | Python | 0.000002 |
4c4b1e6a4bde5edb9e11942245a21437e73fe6df | fix link creation | archivebox/index/sql.py | archivebox/index/sql.py | __package__ = 'archivebox.index'
from io import StringIO
from typing import List, Tuple, Iterator
from .schema import Link
from ..util import enforce_types
from ..config import setup_django, OUTPUT_DIR
### Main Links Index
@enforce_types
def parse_sql_main_index(out_dir: str=OUTPUT_DIR) -> Iterator[Link]:
setu... | __package__ = 'archivebox.index'
from io import StringIO
from typing import List, Tuple, Iterator
from .schema import Link
from ..util import enforce_types
from ..config import setup_django, OUTPUT_DIR
### Main Links Index
@enforce_types
def parse_sql_main_index(out_dir: str=OUTPUT_DIR) -> Iterator[Link]:
setu... | Python | 0 |
efdf4a4898cc3b5217ac5e45e75a74e19eee95d4 | bump version | evojax/version.py | evojax/version.py | __version__ = "0.1.0-14"
| __version__ = "0.1.0-13"
| Python | 0 |
155c953f7bf8590b4a11547369bee29baa5ea5f6 | Fix typo. | isaactest/tests/numeric_q_all_correct.py | isaactest/tests/numeric_q_all_correct.py | import time
from ..utils.log import log, INFO, ERROR, PASS
from ..utils.isaac import answer_numeric_q
from ..utils.i_selenium import assert_tab, image_div
from ..utils.i_selenium import wait_for_xpath_element
from ..tests import TestWithDependency
from selenium.common.exceptions import TimeoutException, NoSuchElementEx... | import time
from ..utils.log import log, INFO, ERROR, PASS
from ..utils.isaac import answer_numeric_q
from ..utils.i_selenium import assert_tab, image_div
from ..utils.i_selenium import wait_for_xpath_element
from ..tests import TestWithDependency
from selenium.common.exceptions import TimeoutException, NoSuchElementEx... | Python | 0.001604 |
aabc4bc60f0c8b6db21453dd6fad387773b18e55 | Fix a print | openquake/commands/__main__.py | openquake/commands/__main__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2018 GEM Foundation
#
# OpenQuake 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 ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2018 GEM Foundation
#
# OpenQuake 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 ... | Python | 0.999999 |
df8848beffeb952f8da034c13d22245ce123f576 | fix 677: Error on enum type during manage.py migrations | shop/models/fields.py | shop/models/fields.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import enum
import six
from django.conf import settings
from django.db import models
from django.utils.six import python_2_unicode_compatible, string_types
from django.utils.translation import ugettext_lazy as _, ugettext
postgresql_engine_names = [
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import enum
import six
from django.conf import settings
from django.db import models
from django.utils.six import python_2_unicode_compatible, string_types
from django.utils.translation import ugettext_lazy as _, ugettext
postgresql_engine_names = [
... | Python | 0 |
8b69b3af8b7ed9dcbd00f2b22a47828627dc7c78 | fix setup | zgres/tests/test_apt.py | zgres/tests/test_apt.py | import os
from unittest import mock
import asyncio
from subprocess import check_output, check_call
import pytest
import psycopg2
from . import FakeSleeper
def have_root():
destroy = os.environ.get('ZGRES_DESTROY_MACHINE', 'false').lower()
if destroy in ['t', 'true']:
user = check_output(['whoami']).de... | import os
from unittest import mock
import asyncio
from subprocess import check_output, check_call
import pytest
import psycopg2
from . import FakeSleeper
def have_root():
destroy = os.environ.get('ZGRES_DESTROY_MACHINE', 'false').lower()
if destroy in ['t', 'true']:
user = check_output(['whoami']).de... | Python | 0.000001 |
2a13f4d21085228a1ef615eec8a3e42110c315d3 | Make test pass | benchmarker/modules/problems/cnn2d_toy/pytorch.py | benchmarker/modules/problems/cnn2d_toy/pytorch.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from benchmarker.modules.problems.helpers_torch import Net4Inference, Net4Train
class Net(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=2)
self.conv2 ... | import torch
import torch.nn as nn
import torch.nn.functional as F
from benchmarker.modules.problems.helpers_torch import Net4Inference, Net4Train
class Net(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=2)
self.conv2 =... | Python | 0.000225 |
f6e93144a2471ef22883f4db935a499463a76824 | fix sytanx errors | will/0003/into_redis.py | will/0003/into_redis.py | # 第 0003 题: 将 0001 题生成的 200 个激活码(或者优惠券)保存到 Redis 非关系型数据库中。
import random, string, time, math, uuid, redis
chars = string.ascii_letters + string.digits
def gen1():
key = ''.join(random.sample(chars, 10))
#key2 = ''.join(random.choice(chars) for i in range(10))
return key
def gen2():
key = math.modf(ti... | # 第 0003 题: 将 0001 题生成的 200 个激活码(或者优惠券)保存到 Redis 非关系型数据库中。
import random, string, time, math, uuid, redis
chars = string.ascii_letters + string.digits
def gen1():
key = ''.join(random.sample(chars, 10))
#key2 = ''.join(random.choice(chars) for i in range(10))
return key
def gen2():
key = math.modf(ti... | Python | 0.000031 |
3b564cdd4adbf3185d2f18ec6eedbf4b87057cf5 | Add virus fixture to conftest | conftest.py | conftest.py | from virtool.tests.fixtures.db import *
from virtool.tests.fixtures.documents import *
from virtool.tests.fixtures.client import *
from virtool.tests.fixtures.core import *
from virtool.tests.fixtures.hmm import *
from virtool.tests.fixtures.users import *
from virtool.tests.fixtures.viruses import *
def pytest_addop... | from virtool.tests.fixtures.db import *
from virtool.tests.fixtures.documents import *
from virtool.tests.fixtures.client import *
from virtool.tests.fixtures.core import *
from virtool.tests.fixtures.hmm import *
from virtool.tests.fixtures.users import *
def pytest_addoption(parser):
parser.addoption("--quick",... | Python | 0 |
8b2827a87927e60cefb83f273b58d9aba9f9600d | improve error representation for doctests with cython | conftest.py | conftest.py | # -*- coding: utf-8 -*-
import os
import sys
import pytest
from inspect import currentframe, getframeinfo
from sphinx.application import Sphinx
import imgui
PROJECT_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
sphinx = None
def project_path(*paths):
return os.path.join(PROJECT_ROOT_DIR, *paths)
clas... | # -*- coding: utf-8 -*-
import os
import pytest
from sphinx.application import Sphinx
import imgui
PROJECT_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
sphinx = None
def project_path(*paths):
return os.path.join(PROJECT_ROOT_DIR, *paths)
class SphinxDoc(pytest.File):
def __init__(self, path, par... | Python | 0 |
900de7c14607fbe2936fa682d03747916337f075 | Fix the reactor_pytest fixture. | conftest.py | conftest.py | from pathlib import Path
import pytest
def _py_files(folder):
return (str(p) for p in Path(folder).rglob('*.py'))
collect_ignore = [
# not a test, but looks like a test
"scrapy/utils/testsite.py",
# contains scripts to be run by tests/test_crawler.py::CrawlerProcessSubprocess
*_py_files("tests/... | from pathlib import Path
import pytest
def _py_files(folder):
return (str(p) for p in Path(folder).rglob('*.py'))
collect_ignore = [
# not a test, but looks like a test
"scrapy/utils/testsite.py",
# contains scripts to be run by tests/test_crawler.py::CrawlerProcessSubprocess
*_py_files("tests/... | Python | 0 |
7059622c5787f06027ae2cf978beb69df4e5cabd | Send googler profiling data. | breakpad.py | breakpad.py | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Breakpad for Python.
Sends a notification when a process stops on an exception.
It is only enabled when all these conditions are met:
1. hostname ... | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Breakpad for Python.
Sends a notification when a process stops on an exception.
It is only enabled when all these conditions are met:
1. hostname ... | Python | 0 |
01d4279b40eb9e3029f857bf9d81d66d0314532d | Bump version to 1.5.1 | enlighten/__init__.py | enlighten/__init__.py | # -*- coding: utf-8 -*-
# Copyright 2017 - 2020 Avram Lubkin, All Rights Reserved
# 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/.
"""
**Enlighten Progress Bar**
Provi... | # -*- coding: utf-8 -*-
# Copyright 2017 - 2020 Avram Lubkin, All Rights Reserved
# 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/.
"""
**Enlighten Progress Bar**
Provi... | Python | 0 |
5c27ebd8e69802cce4afe51b917df233dcf4d972 | Add D3DCompiler_46.dll to ignore list Review URL: https://codereview.chromium.org/12217044 | site_config/config.py | site_config/config.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Declares a number of site-dependent variables for use by scripts.
A typical use of this module would be
import chromium_config as config
v8_url... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Declares a number of site-dependent variables for use by scripts.
A typical use of this module would be
import chromium_config as config
v8_url... | Python | 0 |
8ef11bf983705540973badb40f7daf5a14c1173a | Fix typo | astrobin/permissions.py | astrobin/permissions.py | # Django
from django.db.models import Q
# Third party apps
from pybb.permissions import DefaultPermissionHandler
# AstroBin apps
from astrobin_apps_groups.models import Group
class CustomForumPermissions(DefaultPermissionHandler):
# Disable forum polls
def may_create_poll(self, user):
return False
... | # Django
from django.db.models import Q
# Third party apps
from pybb.permissions import DefaultPermissionHandler
# AstroBin apps
from astrobin_apps_groups.models import Group
class CustomForumPermissions(DefaultPermissionHandler):
# Disable forum polls
def may_create_poll(self, user):
return False
... | Python | 0.999999 |
b54d7b8079bf414b1fe79061b33e41c6350707d6 | use integer instead of string | mopidy_rotaryencoder/__init__.py | mopidy_rotaryencoder/__init__.py | from __future__ import unicode_literals
import logging
import os
from mopidy import config, ext
__version__ = '0.1.0'
logger = logging.getLogger(__name__)
class Extension(ext.Extension):
dist_name = 'Mopidy-RotaryEncoder'
ext_name = 'rotaryencoder'
version = __version__
def get_default_config(sel... | from __future__ import unicode_literals
import logging
import os
from mopidy import config, ext
__version__ = '0.1.0'
logger = logging.getLogger(__name__)
class Extension(ext.Extension):
dist_name = 'Mopidy-RotaryEncoder'
ext_name = 'rotaryencoder'
version = __version__
def get_default_config(sel... | Python | 0.027486 |
c2a79d8cbbb174530991d8b59578169ee9b2be44 | use absolute paths for external scripts in Spidermonkey wrapper | wrapper_spidermonkey.py | wrapper_spidermonkey.py | #!/usr/bin/env python
"""
wrapper for JSLint
requires Spidermonkey
Usage:
$ wrapper_spidermonkey.py <filepath>
TODO:
* support for JSLint options
"""
import sys
import os
import spidermonkey
from simplejson import loads as json
cwd = sys.path[0]
lint_path = os.path.join(cwd, "fulljslint.js")
json_path = os.pa... | #!/usr/bin/env python
"""
wrapper for JSLint
requires Spidermonkey
Usage:
$ wrapper_spidermonkey.py <filepath>
TODO:
* support for JSLint options
"""
import sys
import spidermonkey
from simplejson import loads as json
lint_path = "fulljslint.js"
json_path = "json2.js"
def main(args=None):
filepath = args[1... | Python | 0 |
2271131d5c2794eeba256a9d9547fa925f7bdf73 | bump __version__ | matplotlib2tikz/__init__.py | matplotlib2tikz/__init__.py | # -*- coding: utf-8 -*-
#
'''Script to convert Matplotlib generated figures into TikZ/PGFPlots figures.
'''
__author__ = 'Nico Schlömer'
__email__ = 'nico.schloemer@gmail.com'
__copyright__ = 'Copyright (c) 2010-2016, %s <%s>' % (__author__, __email__)
__credits__ = []
__license__ = 'MIT License'
__version__ = '0.5.7'... | # -*- coding: utf-8 -*-
#
'''Script to convert Matplotlib generated figures into TikZ/PGFPlots figures.
'''
__author__ = 'Nico Schlömer'
__email__ = 'nico.schloemer@gmail.com'
__copyright__ = 'Copyright (c) 2010-2016, %s <%s>' % (__author__, __email__)
__credits__ = []
__license__ = 'MIT License'
__version__ = '0.5.6'... | Python | 0.000017 |
35d3284a1242bdeb6ea3aec128deb92b3138106b | Add the ability to specify the Cakefile parent directory. | flask_cake/cake.py | flask_cake/cake.py | from __future__ import absolute_import
import os
import subprocess
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class Cake(object):
def __init__(self, app=None, tasks=["build"], cakeparent="coffee"):
"""Initalize a new instance of Flask-Cake.
:param ... | from __future__ import absolute_import
import os
import subprocess
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class Cake(object):
def __init__(self, app=None, tasks=["build"]):
"""Initalize a new instance of Flask-Cake.
:param app: The Flask app
... | Python | 0 |
cd25fd1bd40a98886b92f5e3b357ee0ab2796c7b | add /query route, with plain text for mongo | flaskr/__init__.py | flaskr/__init__.py | #!/usr/bin/python3
# -*- coding: latin-1 -*-
import os
import sys
# import psycopg2
import json
from bson import json_util
from pymongo import MongoClient
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
def create_app():
app = Flask(__name__)
return app
a... | #!/usr/bin/python3
# -*- coding: latin-1 -*-
import os
import sys
# import psycopg2
import json
from bson import json_util
from pymongo import MongoClient
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
def create_app():
app = Flask(__name__)
return app
a... | Python | 0 |
af4b53a85aec95c9ec7bf20b1c019ec0f397eacb | Bump version to 0.2.2 | flavio/_version.py | flavio/_version.py | __version__='0.2.2'
| __version__='0.2.1'
| Python | 0.000002 |
b2b5e91649cdfadda63e11dcfe5ef5c105d28f23 | Add timeout cli arg | pg_bawler/listener.py | pg_bawler/listener.py | #!/usr/bin/env python
'''
Listen on given channel for notification.
$ python -m pg_bawler.listener mychannel
If you installed notification trigger with ``pg_bawler.gen_sql`` then
channel is the same as ``tablename`` argument.
'''
import argparse
import asyncio
import importlib
import logging
import sys
import pg... | #!/usr/bin/env python
'''
Listen on given channel for notification.
$ python -m pg_bawler.listener mychannel
If you installed notification trigger with ``pg_bawler.gen_sql`` then
channel is the same as ``tablename`` argument.
'''
import argparse
import asyncio
import importlib
import logging
import sys
import pg... | Python | 0.000001 |
8602d984a9caf73dc40168e0e7937c9e930d035b | Stop $PYTHONPATH from messing up the search path for DLLs. CURA-3418 Cura build on Win 64 fails due to $PYTHONPATH | cura_app.py | cura_app.py | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import os
import sys
import platform
from UM.Platform import Platform
#WORKAROUND: GITHUB-88 GITHUB-385 GITHUB-612
if Platform.isLinux(): # Needed for platform.linux_distribution, which is not avail... | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import os
import sys
import platform
from UM.Platform import Platform
#WORKAROUND: GITHUB-88 GITHUB-385 GITHUB-612
if Platform.isLinux(): # Needed for platform.linux_distribution, which is not avail... | Python | 0 |
90571c86f39fee14fafcc9c030de66d4255c5d82 | Change naming style | lexos/interfaces/statistics_interface.py | lexos/interfaces/statistics_interface.py | from flask import request, session, render_template, Blueprint
from lexos.helpers import constants as constants
from lexos.interfaces.base_interface import detect_active_docs
from lexos.managers import utility, session_manager as session_manager
# this is a flask blue print
# it helps us to manage groups of views
# s... | from flask import request, session, render_template, Blueprint
from lexos.helpers import constants as constants
from lexos.managers import utility, session_manager as session_manager
from lexos.interfaces.base_interface import detect_active_docs
# this is a flask blue print
# it helps us to manage groups of views
# s... | Python | 0.000002 |
009cdf804f0f730ed081c6003eedb1015283948f | update to test for non categorized event publishing | lg_replay/test/offline/test_lg_replay.py | lg_replay/test/offline/test_lg_replay.py | #!/usr/bin/env python
PKG = 'lg_replay'
NAME = 'test_lg_replay'
import rospy
import unittest
import json
from evdev import InputEvent
from lg_replay import DeviceReplay
from interactivespaces_msgs.msg import GenericMessage
class MockDevice:
def __init__(self):
self.events = [
InputEvent(144... | #!/usr/bin/env python
PKG = 'lg_replay'
NAME = 'test_lg_replay'
import rospy
import unittest
import json
from evdev import InputEvent
from lg_replay import DeviceReplay
from interactivespaces_msgs.msg import GenericMessage
class MockDevice:
def __init__(self):
self.events = [
InputEvent(144... | Python | 0 |
41548ba9efb1d47c823696adeb13560bdbb73878 | allow update of IP to timeout without quitting loop | dyndnsc/updater/base.py | dyndnsc/updater/base.py | # -*- coding: utf-8 -*-
import logging
import requests
from ..common.subject import Subject
from ..common.events import IP_UPDATE_SUCCESS, IP_UPDATE_ERROR
log = logging.getLogger(__name__)
class UpdateProtocol(Subject):
"""
base class for all update protocols that use the dyndns2 update protocol
"""
... | # -*- coding: utf-8 -*-
import logging
import requests
from ..common.subject import Subject
from ..common.events import IP_UPDATE_SUCCESS, IP_UPDATE_ERROR
log = logging.getLogger(__name__)
class UpdateProtocol(Subject):
"""
base class for all update protocols that use the dyndns2 update protocol
"""
... | Python | 0 |
25f57a023f978fca94bbeb9655a4d90f0b2d95f0 | Fix typo | pints/toy/__init__.py | pints/toy/__init__.py | #
# Root of the toy module.
# Provides a number of toy models and logpdfs for tests of Pints' functions.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
from __future_... | #
# Root of the toy module.
# Provides a number of toy models and logpdfs for tests of Pints' functions.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
from __future_... | Python | 0.999999 |
5b120e5b89c06a0a5c01f8c710f85a4a179f56f7 | Change HTML theme to match BIND ARM, add copyright, EPUB info | doc/conf.py | doc/conf.py | ############################################################################
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# 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 https://mozil... | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | Python | 0 |
6366fe6da78cd0e910b52352b918ff18d89f25c4 | update tests_forms | myideas/core/tests/test_forms.py | myideas/core/tests/test_forms.py | from django.test import TestCase
from django.shortcuts import resolve_url as r
from registration.forms import RegistrationForm
from myideas.core.forms import IdeasForm, IdeasFormUpdate
class IdeasFormTest(TestCase):
def setUp(self):
self.form = IdeasForm()
def test_form_has_fields(self):
"""... | from django.test import TestCase
from django.shortcuts import resolve_url as r
from registration.forms import RegistrationForm
from myideas.core.forms import IdeasForm, IdeasFormUpdate
class IdeasFormTest(TestCase):
def setUp(self):
self.form = IdeasForm()
def test_form_has_fields(self):
""... | Python | 0.000001 |
82b87b05068a8fb56f2983714c08c0b822b5dde5 | Remove settings leftover from sphinx-releases | doc/conf.py | doc/conf.py | # -*- coding: utf-8 -*-
import os
import sys
import alagitpull
# Get the project root dir, which is the parent dir of this
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext")))
# package data
about = ... | # -*- coding: utf-8 -*-
import os
import sys
import alagitpull
# Get the project root dir, which is the parent dir of this
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext")))
# package data
about = ... | Python | 0 |
b3dfb211d0d81210dcaa317a0d6f79b6ad249816 | Update netlogo_example.py | ema_workbench/examples/netlogo_example.py | ema_workbench/examples/netlogo_example.py | """
This example is a proof of principle for how NetLogo models can be
controlled using pyNetLogo and the ema_workbench. Note that this
example uses the NetLogo 6 version of the predator prey model that
comes with NetLogo. If you are using NetLogo 5, replace the model file
with the one that comes with NetLogo.
"""
im... | '''
This example is a proof of principle for how NetLogo models can be
controlled using pyNetLogo and the ema_workbench. Note that this
example uses the NetLogo 6 version of the predator prey model that
comes with NetLogo. If you are using NetLogo 5, replace the model file
with the one that comes with NetLogo.
'''
fr... | Python | 0.000001 |
8c6f178782b6470b98536a2384391970e0cbafb9 | Update config file | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Edwin Khoo'
SITENAME = 'Edwin Khoo'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'America/New_York'
DEFAULT_LANG = 'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = No... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Edwin Khoo'
SITENAME = 'Edwin Khoo'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'America/New_York'
DEFAULT_LANG = 'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = No... | Python | 0.000001 |
96d083f6cc6bb9a55a35a494f4c671ed62a3cd40 | make plot for hh example | docs/_code/potential.py | docs/_code/potential.py | import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np
import gary.potential as gp
from gary.units import galactic
# ----------------------------------------------------------------------------
p = gp.MiyamotoNagaiPotential(1E11, 6.5, 0.27, units=(u.kpc, u.Msun, u.Myr))
fig = p.plot_contours(gr... | import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np
import gary.potential as sp
from gary.units import galactic
# ----------------------------------------------------------------------------
p = sp.MiyamotoNagaiPotential(1E11, 6.5, 0.27, units=(u.kpc, u.Msun, u.Myr))
fig,axes = p.plot_contou... | Python | 0.000003 |
5bfdeb94d64ffe7cbcb750dda2edc48f5a1d23b2 | add a link to python course 2018 | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
from pathlib import Path
AUTHOR = u'Python Group'
SITENAME = u'Python Group UEA'
SITEURL = ''
PATH = 'content'
STATIC_PATHS = ['extra', 'extra/robots.txt', 'pdfs', 'figures',
'extra/favicon.ico', 'extra/custom.css'... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
from pathlib import Path
AUTHOR = u'Python Group'
SITENAME = u'Python Group UEA'
SITEURL = ''
PATH = 'content'
STATIC_PATHS = ['extra', 'extra/robots.txt', 'pdfs', 'figures',
'extra/favicon.ico', 'extra/custom.css'... | Python | 0 |
5cf5c6028bd7007a867691af966f89574f02de1f | clean up setup | mojolicious/setup.py | mojolicious/setup.py | import subprocess
import sys
import json
from os.path import expanduser
import os
import getpass
home = expanduser("~")
def start(args, logfile, errfile):
conf = {
'database_host' : args.database_host,
'workers' : args.max_threads,
}
with open('mojolicious/app.conf', 'w') as f:
f.write(json.d... | import subprocess
import sys
#import setup_util
import json
from os.path import expanduser
import os
import getpass
home = expanduser("~")
def start(args, logfile, errfile):
# setup_util.replace_text("mojolicious/app.pl", "localhost", ""+ args.database_host +"")
# str(args.max_threads)
conf = {
'database_h... | Python | 0.000002 |
8d935a2141b8f5c080d922189df7d79bb838b3a0 | Use default router implementation | mopidy_lux/router.py | mopidy_lux/router.py | import os
from tinydb import TinyDB
from tinydb.storages import JSONStorage
from tinydb.middlewares import CachingMiddleware
import tornado.web
from mopidy import http
class LuxRouter(http.Router):
name = 'lux'
def setup_routes(self):
db = TinyDB(
self.config['lux']['db_file'],
... | import os
from tinydb import TinyDB
from tinydb.storages import JSONStorage
from tinydb.middlewares import CachingMiddleware
import tornado.web
class LuxRouter(object):
def __init__(self, _config):
self.config = _config
self._db = TinyDB(
self.config['lux']['db_file'],
sto... | Python | 0 |
32481a906e00a1c5d301e6227ab43cf8feba31e0 | fix double-import trap | json5/__init__.py | json5/__init__.py | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | Python | 0.000212 |
b2e7eeafb263c12a333056e6a8239d2534833a22 | Allow specifying --couchbase-root | binding.gyp | binding.gyp | {
'targets': [{
'target_name': 'couchbase_impl',
'defines': ['LCBUV_EMBEDDED_SOURCE'],
'conditions': [
[ 'OS=="win"', {
'variables': {
'couchbase_root%': 'C:/couchbase'
},
'include_dirs': [
'<(couchbase_root)/include/',
],
'link_settings': ... | {
'targets': [{
'target_name': 'couchbase_impl',
'defines': ['LCBUV_EMBEDDED_SOURCE'],
'conditions': [
[ 'OS=="win"', {
'variables': {
'couchbase_root%': 'C:/couchbase'
},
'include_dirs': [
'<(couchbase_root)/include/',
],
'link_settings': ... | Python | 0 |
c91147dee9d9910cfc8e6c2e078d388f19d6ab1e | fix build error in FreeBSD (#25) | binding.gyp | binding.gyp | {
"targets": [{
"target_name": "node_snap7",
"include_dirs": [
"<!(node -e \"require('nan')\")",
"./src"
],
"sources": [
"./src/node_snap7.cpp",
"./src/node_snap7_client.cpp",
"./src/node_snap7_server.cpp",
"./sr... | {
"targets": [{
"target_name": "node_snap7",
"include_dirs": [
"<!(node -e \"require('nan')\")",
"./src"
],
"sources": [
"./src/node_snap7.cpp",
"./src/node_snap7_client.cpp",
"./src/node_snap7_server.cpp",
"./sr... | Python | 0 |
95bde4f783a4d11627d8bc64e24b383e945bdf01 | Revert local CDN location set by Jodok | src/web/tags.py | src/web/tags.py | # -*- coding: utf-8 -*-
# vim: set fileencodings=utf-8
__docformat__ = "reStructuredText"
import json
import datetime
from django.template.base import Library
from django.utils.safestring import mark_safe
register = Library()
CDN_URL = 'https://cdn.crate.io'
def media(context, media_url):
"""
Get the path... | # -*- coding: utf-8 -*-
# vim: set fileencodings=utf-8
__docformat__ = "reStructuredText"
import json
import datetime
from django.template.base import Library
from django.utils.safestring import mark_safe
register = Library()
#CDN_URL = 'https://cdn.crate.io'
CDN_URL = 'http://localhost:8001'
def media(context, m... | Python | 0 |
06f328b5843d83946b353697745ec82c7741ee3e | Allow colons in record label URLs (for timestamps such as '2013-02-13_08:42:00'). | src/web/urls.py | src/web/urls.py | """
Define URL dispatching for the Sumatra web interface.
"""
from django.conf.urls.defaults import *
from django.views.generic import list_detail
from django.conf import settings
from sumatra.web.views import Timeline
P = {
'project': r'(?P<project>\w+[\w ]*)',
'label': r'(?P<label>\w+[\w|\-\.:]*)',
}
urlpa... | """
Define URL dispatching for the Sumatra web interface.
"""
from django.conf.urls.defaults import *
from django.views.generic import list_detail
from django.conf import settings
from sumatra.web.views import Timeline
P = {
'project': r'(?P<project>\w+[\w ]*)',
'label': r'(?P<label>\w+[\w|\-\.]*)',
}
urlpat... | Python | 0.000007 |
a1cbeb7f7a03d0618ec9f60f65308168e521af18 | Add encodings for imul instructions to RISC-V. | meta/isa/riscv/encodings.py | meta/isa/riscv/encodings.py | """
RISC-V Encodings.
"""
from __future__ import absolute_import
from cretonne import base
from .defs import RV32, RV64
from .recipes import OPIMM, OPIMM32, OP, OP32, R, Rshamt, I
from .settings import use_m
# Basic arithmetic binary instructions are encoded in an R-type instruction.
for inst, inst_imm, ... | """
RISC-V Encodings.
"""
from __future__ import absolute_import
from cretonne import base
from .defs import RV32, RV64
from .recipes import OPIMM, OPIMM32, OP, OP32, R, Rshamt, I
# Basic arithmetic binary instructions are encoded in an R-type instruction.
for inst, inst_imm, f3, f7 in [
(bas... | Python | 0.000003 |
4c547687662f7ea2a12d876291adb6e0bed85fc8 | Fix database relationships | database.py | database.py | #
# database.py
#
# set up and manage a database for storing data between sessions
#
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
from sqlalchemy.orm import sessio... | #
# database.py
#
# set up and manage a database for storing data between sessions
#
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
from sqlalchemy.orm import sessio... | Python | 0.000003 |
d017c2a2e09d043caecd555217a399453c7e60b8 | fix migration imports | eventstore/migrations/0050_askfeedback.py | eventstore/migrations/0050_askfeedback.py | # Generated by Django 2.2.24 on 2021-12-07 06:26
import uuid
import django.contrib.postgres.fields.jsonb
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("eventstore", "0049_auto_20211202_1220")]
operations = [
migrations... | # Generated by Django 2.2.24 on 2021-12-07 06:26
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
dependencies = [("eventstore", "0049_auto_20211202_1220")]
operations = [
migrations.... | Python | 0.000001 |
5763c341a1660e13b70780a37d822eed65b00255 | refactor example fit_text_path_into_box.py | examples/addons/fit_text_path_into_box.py | examples/addons/fit_text_path_into_box.py | # Copyright (c) 2021-2022, Manfred Moitzi
# License: MIT License
import pathlib
import ezdxf
from ezdxf import path, zoom
from ezdxf.math import Matrix44
from ezdxf.tools import fonts
from ezdxf.addons import text2path
CWD = pathlib.Path("~/Desktop/Outbox").expanduser()
if not CWD.exists():
CWD = pathlib.Path(".... | # Copyright (c) 2021, Manfred Moitzi
# License: MIT License
from pathlib import Path
import ezdxf
from ezdxf import path, zoom
from ezdxf.math import Matrix44
from ezdxf.tools import fonts
from ezdxf.addons import text2path
DIR = Path("~/Desktop/Outbox").expanduser()
fonts.load()
doc = ezdxf.new()
doc.layers.new("... | Python | 0.001126 |
daed646ff987bc86b333a995bac1283360a583ef | bump up version to 0.1.2 | src/javactl/__init__.py | src/javactl/__init__.py | __version__ = '0.1.2'
| __version__ = '0.1.1'
| Python | 0.000007 |
fce501b446d2a4133a244f86653bdc683f4f03de | test project manager using initial DB & validation code added | buildbuild/projects/tests/test_project_manager.py | buildbuild/projects/tests/test_project_manager.py | from django.test import TestCase
from projects.models import Project
from teams.models import Team
from django.db import IntegrityError
from django.core.exceptions import ValidationError
class TestProjectName(TestCase):
fixtures = ['properties_data.yaml']
def setUp(self):
self.name = "test_project_name... | from django.test import TestCase
from projects.models import Project
from teams.models import Team
from django.db import IntegrityError
from django.core.exceptions import ValidationError
class TestProjectName(TestCase):
def setUp(self):
self.name = "test_project_name"
self.second_name = "test_secon... | Python | 0 |
be778b351e6b6af18a786265851142a1b9dd420a | remove erroneous quotes in isinstance() | networkx/classes/labeledgraph.py | networkx/classes/labeledgraph.py | from graph import Graph
from digraph import DiGraph
from networkx.exception import NetworkXException, NetworkXError
import networkx.convert as convert
class LabeledGraph(Graph):
def __init__(self, data=None, name='', weighted=True):
super(LabeledGraph,self).__init__(data,name,weighted)
# node label... | from graph import Graph
from digraph import DiGraph
from networkx.exception import NetworkXException, NetworkXError
import networkx.convert as convert
class LabeledGraph(Graph):
def __init__(self, data=None, name='', weighted=True):
super(LabeledGraph,self).__init__(data,name,weighted)
# node label... | Python | 0.000042 |
c6453752f9630a760cd2b2508d9ba39413871d86 | Update SensorMotorTest.py | 04Dan/SensorMotorTest.py | 04Dan/SensorMotorTest.py | import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
##GPIO.setup(18, GPIO.OUT) servo
##GPIO.setup(22, GPIO.OUT) motor
GPIO.setup(16, GPIO.IN) ##button
try:
while True:
i = GPIO.input(16)
print(i)
delay(1000)
except Keyboardinterrupt:
GPIO.cleanup()
| import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
##GPIO.setup(18, GPIO.OUT) servo
##GPIO.setup(22, GPIO.OUT) motor
GPIO.setup(16, GPIO.IN) ##button
try:
while True:
i = GPIO.input(16)
print(i)
delay(1000)
except Keyboardinterupt:
GPIO.cleanup()
| Python | 0 |
c3ecc4a06a212da11f52c9c0cd5c7b5c8d500516 | Support -h/--help on createdb.py | createdb.py | createdb.py | #!/usr/bin/env python
import sys
import fedmsg.config
import fmn.lib.models
config = fedmsg.config.load_config()
uri = config.get('fmn.sqlalchemy.uri')
if not uri:
raise ValueError("fmn.sqlalchemy.uri must be present")
if '-h' in sys.argv or '--help'in sys.argv:
print "createdb.py [--with-dev-data]"
sys.... | #!/usr/bin/env python
import sys
import fedmsg.config
import fmn.lib.models
config = fedmsg.config.load_config()
uri = config.get('fmn.sqlalchemy.uri')
if not uri:
raise ValueError("fmn.sqlalchemy.uri must be present")
session = fmn.lib.models.init(uri, debug=True, create=True)
if '--with-dev-data' in sys.argv:... | Python | 0 |
29205582e07eaa8b28eea4b0691a9556d0999015 | Remove unused LoginForm | src/keybar/web/forms.py | src/keybar/web/forms.py | from django.utils.translation import ugettext_lazy as _
from django.contrib import auth
import floppyforms.__future__ as forms
from keybar.models.user import User
class RegisterForm(forms.ModelForm):
name = forms.CharField(label=_('Your name'),
widget=forms.TextInput(
attrs={'placeholder': _(... | from django.utils.translation import ugettext_lazy as _
from django.contrib import auth
import floppyforms.__future__ as forms
from keybar.models.user import User
class RegisterForm(forms.ModelForm):
name = forms.CharField(label=_('Your name'),
widget=forms.TextInput(
attrs={'placeholder': _(... | Python | 0.000001 |
2626b5dbfe91a6b8fee7beab370e60a5a474c699 | Add my implementation of kind() | CS212/Lesson-01/poker.py | CS212/Lesson-01/poker.py | #
# In the first Lesson of the class we are attempting to
# build a Poker program.
#
def poker(hands):
"Return the best hand: poker([hand,...]) => hand"
return max(hands, key=hand_rank)
def hand_rank(hand):
ranks = card_ranks(hand)
if straight(ranks) and flush(hand): # straight flush
... | #
# In the first Lesson of the class we are attempting to
# build a Poker program.
#
def poker(hands):
"Return the best hand: poker([hand,...]) => hand"
return max(hands, key=hand_rank)
def hand_rank(hand):
ranks = card_ranks(hand)
if straight(ranks) and flush(hand): # straight flush
... | Python | 0 |
d004bf46236a4a0e2bd72b7106e58d2dcfdc2bf8 | Add type reflection tests | test/sqlalchemy/test_introspection.py | test/sqlalchemy/test_introspection.py | from sqlalchemy import Table, Column, MetaData, testing, ForeignKey, UniqueConstraint, \
CheckConstraint
from sqlalchemy.types import Integer, String, Boolean
import sqlalchemy.types as sqltypes
from sqlalchemy.testing import fixtures
from sqlalchemy.dialects.postgresql import INET
from sqlalchemy.dialects.postgres... | from sqlalchemy import Table, Column, MetaData, testing, ForeignKey, UniqueConstraint, \
CheckConstraint
from sqlalchemy.types import Integer, String, Boolean
from sqlalchemy.testing import fixtures
meta = MetaData()
customer_table = Table('customer', meta,
Column('id', Integer, primary_key... | Python | 0 |
8d8002062a0ecbf3720870d7561670a8c7e98da2 | Fix test for auth tokens store | test/stores/test_auth_tokens_store.py | test/stores/test_auth_tokens_store.py | from test.base import ApiTestCase
from zou.app.stores import auth_tokens_store
class CommandsTestCase(ApiTestCase):
def setUp(self):
super(CommandsTestCase, self).setUp()
self.store = auth_tokens_store
self.store.clear()
def tearDown(self):
self.store.clear()
def test_g... | from test.base import ApiTestCase
from zou.app.stores import auth_tokens_store
class CommandsTestCase(ApiTestCase):
def setUp(self):
super(CommandsTestCase, self).setUp()
self.store = auth_tokens_store
self.store.clear()
def tearDown(self):
self.store.clear()
def test_g... | Python | 0.000002 |
639a692bc06cf31b5feb1d990740976884f88a0c | Fix key format (?) | testlog_etl/transforms/jscov_to_es.py | testlog_etl/transforms/jscov_to_es.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: Trung Do (chin.bimbo@gmail.com)
#
from __future__ import division
from __future__ import ... | # 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: Trung Do (chin.bimbo@gmail.com)
#
from __future__ import division
from __future__ import ... | Python | 0.00006 |
d4f2fadd94603eea2c15f5bb8a2a7d29c0d39ed0 | Hello David | CreateM3Us/CreateM3Us.py | CreateM3Us/CreateM3Us.py | import os
incomingDirectory = 'C:\\temp'
for subdir, dirs, files in os.walk(incomingDirectory): #What does is.walk do
for file in files:
#print os.path.join(subdir, file)
filepath = subdir + os.sep + file
print (filepath)
# File input/output
# https://www.digitalocean.com/com... | import os
incomingDirectory = 'C:\\temp'
for subdir, dirs, files in os.walk(incomingDirectory):
for file in files:
#print os.path.join(subdir, file)
filepath = subdir + os.sep + file
print (filepath)
# File input/output
# https://www.digitalocean.com/community/tutorials/how-t... | Python | 0.999971 |
0f1551db96cd27ed20e62545cac1540a405e8f1a | fix bug | FlaskWebProject/views.py | FlaskWebProject/views.py | """
Routes and views for the flask application.
"""
import os
from datetime import datetime
from flask import render_template, request
from FlaskWebProject import app
from generate_summary_json import generate_summary_json
@app.route('/')
@app.route('/home')
def home():
"""Renders the home page."""
return re... | """
Routes and views for the flask application.
"""
import os
from datetime import datetime
from flask import render_template, request
from FlaskWebProject import app
from generate_summary_json import generate_summary_json
@app.route('/')
@app.route('/home')
def home():
"""Renders the home page."""
return re... | Python | 0.000001 |
529987bb17a05c041cdbf3bbe2a98edda72872fc | remove unneeded Todo | InvenTree/plugin/urls.py | InvenTree/plugin/urls.py | """
URL lookup for plugin app
"""
from django.conf.urls import url, include
from plugin import plugin_reg
PLUGIN_BASE = 'plugin' # Constant for links
def get_plugin_urls():
"""returns a urlpattern that can be integrated into the global urls"""
urls = []
for plugin in plugin_reg.plugins.values():
... | """
URL lookup for plugin app
"""
from django.conf.urls import url, include
from plugin import plugin_reg
PLUGIN_BASE = 'plugin' # Constant for links
def get_plugin_urls():
"""returns a urlpattern that can be integrated into the global urls"""
urls = []
for plugin in plugin_reg.plugins.values():
... | Python | 0.000036 |
6137a6f00abbeb81b080f534481bb255f950dd83 | access oauth token securely through azure | FlaskWebProject/views.py | FlaskWebProject/views.py | """
Routes and views for the Flask application.
"""
import os
from flask import render_template, request
from FlaskWebProject import app
from generate_summary_json import generate_summary_json
ACCESS_TOKEN = os.getenv('TREEHACKS_SLACK_ACCESS_TOKEN')
@app.route('/')
@app.route('/home')
def home():
"""Renders t... | """
Routes and views for the Flask application.
"""
from flask import render_template, request
from FlaskWebProject import app
from oauth_constants import TEST_TEAM_SLACK_ACCESS_TOKEN
from generate_summary_json import generate_summary_json
global TEST_TEAM_SLACK_ACCESS_TOKEN
@app.route('/')
@app.route('/home')
de... | Python | 0 |
cd5f824a2d756c8770be6f47d946c7e39c85228e | Fix postcode importing all | molly/apps/places/providers/postcodes.py | molly/apps/places/providers/postcodes.py | import simplejson, urllib, random, csv, zipfile, tempfile, urllib2, os.path
from django.contrib.gis.geos import Point
from molly.apps.places.providers import BaseMapsProvider
from molly.apps.places.models import Entity, EntityType, Source
from molly.conf.settings import batch
class PostcodesMapsProvider(BaseMapsPro... | import simplejson, urllib, random, csv, zipfile, tempfile, urllib2, os.path
from django.contrib.gis.geos import Point
from molly.apps.places.providers import BaseMapsProvider
from molly.apps.places.models import Entity, EntityType, Source
from molly.conf.settings import batch
class PostcodesMapsProvider(BaseMapsPro... | Python | 0 |
e5cc051bc7be854e253853d85b1de8b3037170be | always convert to floats | nbgrader/preprocessors/overwritecells.py | nbgrader/preprocessors/overwritecells.py | from IPython.nbformat.v4.nbbase import validate
from nbgrader import utils
from nbgrader.api import Gradebook
from nbgrader.preprocessors import NbGraderPreprocessor
class OverwriteCells(NbGraderPreprocessor):
"""A preprocessor to overwrite information about grade and solution cells."""
def preprocess(self, ... | from IPython.nbformat.v4.nbbase import validate
from nbgrader import utils
from nbgrader.api import Gradebook
from nbgrader.preprocessors import NbGraderPreprocessor
class OverwriteCells(NbGraderPreprocessor):
"""A preprocessor to overwrite information about grade and solution cells."""
def preprocess(self, ... | Python | 0.999827 |
6565e5bd88ebe5fde8d65664041a9e8f571ca7d7 | switch to requests | IMGURdl/downloadIMGUR.py | IMGURdl/downloadIMGUR.py | # example from:
# https://www.toptal.com/python/beginners-guide-to-concurrency-and-parallelism-in-python
import json
import logging
import os
from pathlib import Path
from urllib.request import urlopen, Request
import requests
logger = logging.getLogger(__name__)
def get_links(client_id):
headers = {'Authorizati... | # example from:
# https://www.toptal.com/python/beginners-guide-to-concurrency-and-parallelism-in-python
import json
import logging
import os
from pathlib import Path
from urllib.request import urlopen, Request
# import requests
logger = logging.getLogger(__name__)
def get_links(client_id):
headers = {'Authoriza... | Python | 0.000001 |
59b3d8b5bce596583f5901f1b3b79a883b7b8e55 | Fix stocktake export | InvenTree/stock/admin.py | InvenTree/stock/admin.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
from import_export.resources import ModelResource
from import_export.fields import Field
import import_export.widgets as widgets
from .models import StockLocation, S... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
from import_export.resources import ModelResource
from import_export.fields import Field
import import_export.widgets as widgets
from .models import StockLocation, S... | Python | 0 |
1323154dfbc453959f3d64fef439288004f6461e | add test for SyntaxError on def f(a): global a | Lib/test/test_compile.py | Lib/test/test_compile.py | from test_support import verbose, TestFailed
if verbose:
print 'Running tests on argument handling'
try:
exec('def f(a, a): pass')
raise TestFailed, "duplicate arguments"
except SyntaxError:
pass
try:
exec('def f(a = 0, a = 1): pass')
raise TestFailed, "duplicate keyword arguments"
except Syn... | from test_support import verbose, TestFailed
if verbose:
print 'Running test on duplicate arguments'
try:
exec('def f(a, a): pass')
raise TestFailed, "duplicate arguments"
except SyntaxError:
pass
try:
exec('def f(a = 0, a = 1): pass')
raise TestFailed, "duplicate keyword arguments"
except Sy... | Python | 0.000193 |
69a735cd134723e4d47c02d21f4ff85a65d28148 | enable test_main.py | Lib/test/test_lib2to3.py | Lib/test/test_lib2to3.py | # Skipping test_parser and test_all_fixers
# because of running
from lib2to3.tests import (test_fixers, test_pytree, test_util, test_refactor,
test_parser, test_main as test_main_)
import unittest
from test.test_support import run_unittest
def suite():
tests = unittest.TestSuite()
lo... | # Skipping test_parser and test_all_fixers
# because of running
from lib2to3.tests import (test_fixers, test_pytree, test_util, test_refactor,
test_parser)
import unittest
from test.test_support import run_unittest
def suite():
tests = unittest.TestSuite()
loader = unittest.TestLoade... | Python | 0.000004 |
92c123820be466ad76078537b457bb596b86c338 | Put some meaningful standard includes in the sample configuration | dwight_chroot/config.py | dwight_chroot/config.py | import copy
import os
from .exceptions import (
CannotLoadConfiguration,
InvalidConfiguration,
NotRootException,
UnknownConfigurationOptions,
)
from .include import Include
_USER_CONFIG_FILE_PATH = os.path.expanduser("~/.dwightrc")
_USER_CONFIG_FILE_TEMPLATE = """# AUTOGENERATED DEFAULT CONFIG
# ... | import copy
import os
from .exceptions import (
CannotLoadConfiguration,
InvalidConfiguration,
NotRootException,
UnknownConfigurationOptions,
)
from .include import Include
_USER_CONFIG_FILE_PATH = os.path.expanduser("~/.dwightrc")
_USER_CONFIG_FILE_TEMPLATE = """# AUTOGENERATED DEFAULT CONFIG
# ... | Python | 0 |
ae23c81ee18726755ed770d1d3654e50d28fb028 | Update views.py | chat/views.py | chat/views.py | from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.contrib import auth
from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.views.decorators.csrf import csrf_exempt
import json
from chat.mo... | from django.shortcuts import render
# Create your views here.
| Python | 0 |
3bfd3ea70980acc02bf35b1654b6c616f4af45ec | update error page | chat/views.py | chat/views.py | import random
import string
from django.db import transaction
from django.shortcuts import render, redirect
import haikunator
from .models import Room
def about(request):
return render(request, "chat/about.html")
def home(request):
return render(request, "chat/about.html")
# def new_room(request):
# """
... | import random
import string
from django.db import transaction
from django.shortcuts import render, redirect
import haikunator
from .models import Room
def about(request):
return render(request, "chat/about.html")
def home(request):
return render(request, "chat/about.html")
# def new_room(request):
# """
... | Python | 0.000001 |
e5a3a49cfe6953160e6e3fbdf1ce9f55dafb2b40 | Change data-checker messages to use Python logger | check_data.py | check_data.py | #!/usr/bin/env python
import argparse
import logging
import os
import sys
from six import string_types
import yaml
# ABCs moved in Python 3, but six doesn't keep track of them.
try:
from collections.abc import Sequence
except ImportError:
from collections import Sequence
REPO_ROOT = os.path.dirname(__file__... | #!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import sys
from six import string_types
import yaml
# ABCs moved in Python 3, but six doesn't keep track of them.
try:
from collections.abc import Sequence
except ImportError:
from collections import Sequence
REPO_ROOT = ... | Python | 0 |
a6acf8a68ee5b2ef185f279b6169a34c2b70896d | Increase feature version | acmd/__init__.py | acmd/__init__.py | # coding: utf-8
""" aem-cmd main module. """
__version__ = '0.12.0b'
# Standard error codes that can be returned from any tool.
OK = 0
UNCHANGED = 1
USER_ERROR = 4711
CONFIG_ERROR = 4712
SERVER_ERROR = 4713
INTERNAL_ERROR = 4714
import acmd.logger
init_log = acmd.logger.init_log
log = acmd.logger.log
warning = acmd... | # coding: utf-8
""" aem-cmd main module. """
__version__ = '0.11.1b'
# Standard error codes that can be returned from any tool.
OK = 0
UNCHANGED = 1
USER_ERROR = 4711
CONFIG_ERROR = 4712
SERVER_ERROR = 4713
INTERNAL_ERROR = 4714
import acmd.logger
init_log = acmd.logger.init_log
log = acmd.logger.log
warning = acmd... | Python | 0 |
61c9d4f6798d81d6ae6d2e5641a8432121de52fa | Implement function: get_network_adapters | cloudbaseinit/osutils/freebsd.py | cloudbaseinit/osutils/freebsd.py | from cloudbaseinit.osutils import base
import subprocess
class FreeBSDUtils(base.BaseOSUtils):
def reboot(self):
if ( os.system('reboot') != 0 ):
raise Exception('Reboot failed')
def user_exists(self, username):
try:
subprocess.check_output(["id", username])
exc... | from cloudbaseinit.osutils import base
import subprocess
class FreeBSDUtils(base.BaseOSUtils):
def reboot(self):
if ( os.system('reboot') != 0 ):
raise Exception('Reboot failed')
def user_exists(self, username):
try:
subprocess.check_output(["id", username])
exc... | Python | 0.999999 |
deb96907dc9c96e0ff8772d14cad765cc5e47602 | improve crawler | crawler/pagecrawler/pagecrawler/spiders/article_spider.py | crawler/pagecrawler/pagecrawler/spiders/article_spider.py | import scrapy
from pagecrawler.items import ArticlecrawlerItem
from pagecrawler.model_article import Articles
class ArticleSpider(scrapy.Spider):
name = "articlespider"
filename = "delicious_article_dataset.dat"
# load url in bookmarks from dataset
start_urls = []
crawled_urls = {}
# url_count ... | import scrapy
from pagecrawler.items import ArticlecrawlerItem
from pagecrawler.model_article import Articles
class ArticleSpider(scrapy.Spider):
name = "articlespider"
filename = "delicious_article_dataset.dat"
# load url in bookmarks from dataset
start_urls = []
crawled_urls = {}
# url_count ... | Python | 0.000129 |
39cd42fa27b87b9b1604635236f8860759a4a8db | Set Dialog's orientation to vertical | ELiDE/ELiDE/dialog.py | ELiDE/ELiDE/dialog.py | """Generic dialog boxes and menus, for in front of a Board
Mostly these will be added as children of KvLayoutFront but you
could use them independently if you wanted.
"""
from kivy.properties import DictProperty, ListProperty, StringProperty, NumericProperty, VariableListProperty
from kivy.core.text import DEFAULT_FO... | """Generic dialog boxes and menus, for in front of a Board
Mostly these will be added as children of KvLayoutFront but you
could use them independently if you wanted.
"""
from kivy.properties import DictProperty, ListProperty, StringProperty, NumericProperty, VariableListProperty
from kivy.core.text import DEFAULT_FO... | Python | 0 |
d1c77a8ce0b7c4b1957e443a88bb797450e6f1df | Revert "Al fer el canvi d'id a id_attachment m'havia deixat una cosa" | filtres/filtre.py | filtres/filtre.py | import base64
import logging
logger = logging.getLogger(__name__)
class Filtre(object):
def __init__(self,msg=None,tickets=None,identitat=None):
self.msg=msg
self.tickets=tickets
self.identitat=identitat
def set_mail(self,msg):
self.msg=msg
def set_tickets(self,tickets):
self.tickets=tick... | import base64
import logging
logger = logging.getLogger(__name__)
class Filtre(object):
def __init__(self,msg=None,tickets=None,identitat=None):
self.msg=msg
self.tickets=tickets
self.identitat=identitat
def set_mail(self,msg):
self.msg=msg
def set_tickets(self,tickets):
s... | Python | 0 |
69c590d7cf2d328b9e6ef63ddf49933e67df9614 | fix typo | statsd/gauge.py | statsd/gauge.py | import statsd
class Gauge(statsd.Client):
'''Class to implement a statsd gauge
'''
def send(self, subname, value):
'''Send the data to statsd via self.connection
:keyword subname: The subname to report the data to (appended to the
client name)
:keyword value: The gau... | import statsd
class Gauge(statsd.Client):
'''Class to implement a statd gauge
'''
def send(self, subname, value):
'''Send the data to statsd via self.connection
:keyword subname: The subname to report the data to (appended to the
client name)
:keyword value: The gaug... | Python | 0.999991 |
b97edcc911419197099338085f0f2937286dead0 | Bump version | galaxy/__init__.py | galaxy/__init__.py | # (c) 2012-2014, Ansible, Inc. <support@ansible.com>
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | # (c) 2012-2014, Ansible, Inc. <support@ansible.com>
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | Python | 0 |
b99de7f7d91c1be99ee7ea04da997d48126fd08b | fix model finance | finance/models.py | finance/models.py | from django.db import models
from datetime import datetime
class TypeLaunch(models.Model):
type_name = models.CharField(max_length=100, unique=True)
class Provider(models.Model):
description = models.CharField(max_length=100, unique=True)
type_launch = models.ForeignKey(TypeLaunch, blank=True, null=True... | from django.db import models
from datetime import datetime
class TypeLaunch(models.Model):
type_name = models.CharField(max_length=100, unique=True)
class Provider(models.Model):
description = models.CharField(max_length=100, unique=True)
type_launch = models.ForeignKey(TypeLaunch, blank=True, null=True... | Python | 0.000001 |
747fa98c7a9ec7906dfba44e4860d300825eee39 | Drop Py2 and six on tests/integration/modules/test_key.py | tests/integration/modules/test_key.py | tests/integration/modules/test_key.py | import re
import pytest
from tests.support.case import ModuleCase
from tests.support.helpers import slowTest
@pytest.mark.windows_whitelisted
class KeyModuleTest(ModuleCase):
@slowTest
def test_key_finger(self):
"""
test key.finger to ensure we receive a valid fingerprint
"""
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import re
import pytest
from tests.support.case import ModuleCase
from tests.support.helpers import slowTest
@pytest.mark.windows_whitelisted
class KeyModuleTest(ModuleCase):
@slowTest
def test_key_finger(self)... | Python | 0 |
6140507068c7a42a988bad951c1a6f120de741fb | Update cam_timeLapse_Threaded_upload.py | camera/timelapse/cam_timeLapse_Threaded_upload.py | camera/timelapse/cam_timeLapse_Threaded_upload.py | #!/usr/bin/env python2.7
import time
import os
from subprocess import call
import sys
class Logger(object):
def __init__(self):
self.terminal = sys.stdout
self.log = open("logfile.log", "a")
def write(self, message):
self.terminal.write(message)
self.log.write(message)
sys.... | #!/usr/bin/env python2.7
import time
import os
from subprocess import call
UPLOAD_INTERVAL = 60
def upload_file(inpath, outpath):
uploadCmd = "/home/pi/Dropbox-Uploader/dropbox_uploader.sh upload %s %s" % (inpath, outpath)
call ([uploadCmd], shell=True)
while True:
# record start_time
start_time = time.tim... | Python | 0 |
16fca36c2032929589a718507a74c87bee52c161 | move planarAxiPotential to top-level | galpy/potential.py | galpy/potential.py | from galpy.potential_src import Potential
from galpy.potential_src import planarPotential
from galpy.potential_src import linearPotential
from galpy.potential_src import verticalPotential
from galpy.potential_src import MiyamotoNagaiPotential
from galpy.potential_src import LogarithmicHaloPotential
from galpy.potential... | from galpy.potential_src import Potential
from galpy.potential_src import planarPotential
from galpy.potential_src import linearPotential
from galpy.potential_src import verticalPotential
from galpy.potential_src import MiyamotoNagaiPotential
from galpy.potential_src import LogarithmicHaloPotential
from galpy.potential... | Python | 0 |
0a4265282f240dc52acac4347636417a14274ada | update dict list in mixfeatures | code/python/seizures/features/MixFeatures.py | code/python/seizures/features/MixFeatures.py | import numpy as np
from seizures.features.FeatureExtractBase import FeatureExtractBase
from seizures.features.ARFeatures import ARFeatures
from seizures.features.FFTFeatures import FFTFeatures
from seizures.features.PLVFeatures import PLVFeatures
from seizures.features.RandomFeatures import RandomFeatures
from seizures... | import numpy as np
from seizures.features.FeatureExtractBase import FeatureExtractBase
from seizures.features.ARFeatures import ARFeatures
from seizures.features.FFTFeatures import FFTFeatures
from seizures.features.PLVFeatures import PLVFeatures
from seizures.features.RandomFeatures import RandomFeatures
from seizures... | Python | 0 |
198e5256063d43006b5c245866604f5bd746cfcd | Allow the plugin to be loaded from a query | plugins/Success/plugin.py | plugins/Success/plugin.py | ###
# Copyright (c) 2005, Daniel DiPaolo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of condition... | ###
# Copyright (c) 2005, Daniel DiPaolo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of condition... | Python | 0 |
4c084313d2e27a620f194e6282a51aa1e94f7a35 | Change chunk so it only takes an int | node/floor_divide.py | node/floor_divide.py | #!/usr/bin/env python
from nodes import Node
class FloorDiv(Node):
char = "f"
args = 2
results = 1
@Node.test_func([3,2], [1])
@Node.test_func([6,-3], [-2])
def func(self, a:Node.number,b:Node.number):
"""a/b. Rounds down, returns an int."""
return a//b
@Node.test... | #!/usr/bin/env python
from nodes import Node
class FloorDiv(Node):
char = "f"
args = 2
results = 1
@Node.test_func([3,2], [1])
@Node.test_func([6,-3], [-2])
def func(self, a:Node.number,b:Node.number):
"""a/b. Rounds down, returns an int."""
return a//b
@Node.test... | Python | 0.000002 |
942e3b183859623d2f2a6bf874f8d763e960ea5b | Print AST during integration test | tests/integration/test_integration.py | tests/integration/test_integration.py | import collections
import io
import json
import os
import pytest
import glob
import subprocess
import thinglang
from thinglang import run, utils
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
SEARCH_PATTERN = os.path.join(BASE_PATH, '**/*.thing')
TestCase = collections.namedtuple('TestCase', ['code', 'meta... | import collections
import io
import json
import os
import pytest
import glob
import subprocess
import thinglang
from thinglang import run, utils
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
SEARCH_PATTERN = os.path.join(BASE_PATH, '**/*.thing')
TestCase = collections.namedtuple('TestCase', ['code', 'meta... | Python | 0.000001 |
4fc0162c73178678281c0e09cf32ffefa4b7b923 | Handle unavailable server | flasque/client.py | flasque/client.py | # -*- coding: utf8 -*-
import json
import time
import Queue
import requests
import threading
class ThreadQueue(threading.Thread):
def __init__(self, api, qname, *args, **kwargs):
super(ThreadQueue, self).__init__(*args, **kwargs)
self.api = api
self.qname = qname
self.q = Queue.Q... | # -*- coding: utf8 -*-
import json
import Queue
import requests
import threading
class ThreadQueue(threading.Thread):
def __init__(self, api, qname, *args, **kwargs):
super(ThreadQueue, self).__init__(*args, **kwargs)
self.api = api
self.qname = qname
self.q = Queue.Queue()
... | Python | 0.000001 |
7dd10d88b89da4a10db45d6393fd05d0d2dc718e | Change get_check_by_name optional argument | pingdombackup/PingdomBackup.py | pingdombackup/PingdomBackup.py | from calendar import timegm
from datetime import datetime, timedelta
from .Pingdom import Pingdom
from .Database import Database
from .log import log
class PingdomBackup:
MAX_INTERVAL = 2764800
def __init__(self, email, password, app_key, database):
self.pingdom = Pingdom(email, password, app_key)
... | from calendar import timegm
from datetime import datetime, timedelta
from .Pingdom import Pingdom
from .Database import Database
from .log import log
class PingdomBackup:
MAX_INTERVAL = 2764800
def __init__(self, email, password, app_key, database):
self.pingdom = Pingdom(email, password, app_key)
... | Python | 0.000003 |
0dd41b65aaa0798a7a72a0d61d746bfa29bc3aad | Allow POST of fly and worm donors | src/encoded/types/donor.py | src/encoded/types/donor.py | from ..schema_utils import (
load_schema,
)
from ..contentbase import (
location,
)
from .base import (
ACCESSION_KEYS,
ALIAS_KEYS,
Collection,
paths_filtered_by_status,
)
class DonorItem(Collection.Item):
base_types = ['donor'] + Collection.Item.base_types
embedded = set(['organism'])... | from ..schema_utils import (
load_schema,
)
from ..contentbase import (
location,
)
from .base import (
ACCESSION_KEYS,
ALIAS_KEYS,
Collection,
paths_filtered_by_status,
)
class DonorItem(Collection.Item):
base_types = ['donor'] + Collection.Item.base_types
embedded = set(['organism'])... | Python | 0 |
b9133e2fe7444b4449ab67f4d726c20ce5e21cd8 | clean ups in presentation of names | gazetteer/admin.py | gazetteer/admin.py | from django.contrib import admin
from django import forms
from gazetteer.models import *
from skosxl.models import Notation
from .settings import TARGET_NAMESPACE_FT
# Register your models here.
# works for Dango > 1.6
class NameInline(admin.TabularInline):
model = LocationName
readonly_fields = ['nameUsed',... | from django.contrib import admin
from django import forms
from gazetteer.models import *
from skosxl.models import Notation
from .settings import TARGET_NAMESPACE_FT
# Register your models here.
# works for Dango > 1.6
class NameInline(admin.TabularInline):
model = LocationName
class LocationTypeInlineForm... | Python | 0.000007 |
59da9b84c491fd5ca4f4c7add5891d5e9ee4b405 | Make it work with astor 0.5 for now | flaws/asttools.py | flaws/asttools.py | import ast
try:
from ast import arg as ast_arg
except ImportError:
ast_arg = type('arg', (ast.AST,), {})
from funcy.py3 import lmap
def is_write(node):
return isinstance(node, (ast.Import, ast.ImportFrom, ast.ExceptHandler,
ast.FunctionDef, ast.ClassDef, ast.arguments, ast_arg... | import ast
try:
from ast import arg as ast_arg
except ImportError:
ast_arg = type('arg', (ast.AST,), {})
from funcy.py3 import lmap
def is_write(node):
return isinstance(node, (ast.Import, ast.ImportFrom, ast.ExceptHandler,
ast.FunctionDef, ast.ClassDef, ast.arguments, ast_arg... | Python | 0 |
4ac7e5d15d3fba11ae37e5826ca6c7181539804b | Disable nested types tests affected by IMPALA-2295 | tests/query_test/test_nested_types.py | tests/query_test/test_nested_types.py | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
import pytest
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestNestedTypes(ImpalaTestSuite):
@classmethod
def get_workload(self):
return 'functional-query'
@classmethod
def add_test... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
import pytest
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestNestedTypes(ImpalaTestSuite):
@classmethod
def get_workload(self):
return 'functional-query'
@classmethod
def add_test... | Python | 0 |
f5f0cc6998f28bee7ccdaf304d3bc5e7e45ab9a6 | save memory allocation using kwarg `out`. | chainer/optimizer_hooks/gradient_hard_clipping.py | chainer/optimizer_hooks/gradient_hard_clipping.py | import chainer
from chainer import backend
class GradientHardClipping(object):
"""Optimizer/UpdateRule hook function for gradient clipping.
This hook function clips all gradient arrays to be within a lower and upper
bound.
Args:
lower_bound (float): The lower bound of the gradient value.
... | import chainer
class GradientHardClipping(object):
"""Optimizer/UpdateRule hook function for gradient clipping.
This hook function clips all gradient arrays to be within a lower and upper
bound.
Args:
lower_bound (float): The lower bound of the gradient value.
upper_bound (float): T... | Python | 0 |
8c17d2076d54864094c3cd8ee51d514bc806c913 | bump version | flexx/__init__.py | flexx/__init__.py | """
`Flexx <https://flexx.readthedocs.io>`_ is a pure Python toolkit for
creating graphical user interfaces (GUI's), that uses web technology
for its rendering. Apps are written purely in Python; The
`PScript <https://pscript.readthedocs.io>`_ transpiler generates the
necessary JavaScript on the fly.
You can use Flexx... | """
`Flexx <https://flexx.readthedocs.io>`_ is a pure Python toolkit for
creating graphical user interfaces (GUI's), that uses web technology
for its rendering. Apps are written purely in Python; The
`PScript <https://pscript.readthedocs.io>`_ transpiler generates the
necessary JavaScript on the fly.
You can use Flexx... | Python | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.