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 |
|---|---|---|---|---|---|---|---|
cb97332633a0e34205abdbc97f4e85a1342ea2ed | add code in test ean | erpeek_inventory/erpeek_article_test.py | erpeek_inventory/erpeek_article_test.py | # -*- coding: utf-8 -*-
###############################################################################
#
# ODOO (ex OpenERP)
# Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>)
# Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>)
# This pro... | # -*- coding: utf-8 -*-
###############################################################################
#
# ODOO (ex OpenERP)
# Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>)
# Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>)
# This pro... | Python | 0.000001 |
3c231fb34f8adb1d290f2cfc0164dbea6049bc34 | Reorder methods in test.py | test.py | test.py | from ethjsonrpc import EthJsonRpc
methods = [
'web3_clientVersion',
'net_version',
'net_peerCount',
'net_listening',
'eth_protocolVersion',
'eth_coinbase',
'eth_mining',
'eth_hashrate',
'eth_gasPrice',
'eth_accounts',
'eth_blockNumber',
'eth_getCompilers',
'eth_newPe... | from ethjsonrpc import EthJsonRpc
methods = [
'web3_clientVersion',
'net_version',
'net_listening',
'net_peerCount',
'eth_protocolVersion',
'eth_coinbase',
'eth_mining',
'eth_hashrate',
'eth_gasPrice',
'eth_accounts',
'eth_blockNumber',
'eth_getCompilers',
'eth_newPe... | Python | 0.000003 |
7a1ad4ae0e3ec15c1fd5aec763476e482ea76ba8 | Make a better version of shuffle | somber/components/utilities.py | somber/components/utilities.py | """Utility functions."""
import numpy as np
class Scaler(object):
"""
Scales data based on the mean and standard deviation.
Attributes
----------
mean : numpy array
The columnwise mean of the data after scaling.
std : numpy array
The columnwise standard deviation of the data a... | """Utility functions."""
import numpy as np
class Scaler(object):
"""
Scales data based on the mean and standard deviation.
Attributes
----------
mean : numpy array
The columnwise mean of the data after scaling.
std : numpy array
The columnwise standard deviation of the data a... | Python | 0.998703 |
00b57b668a5c68a209dac335915bbf2312df0580 | Make sure tests run on local package | test.py | test.py | #
# Copyright (c) 2013-2014, Scott J Maddox
#
# This file is part of openbandparams.
#
# openbandparams is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# ... | #
# Copyright (c) 2013-2014, Scott J Maddox
#
# This file is part of openbandparams.
#
# openbandparams is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# ... | Python | 0 |
a122193144185320f045367613650b40f7df00b8 | Rework the test script a bit. | test.py | test.py | import codegen, jinja2, spidermonkey, sys
import simplejson as json
TESTS = [
('{{ test }}', {'test': 'crap'}),
('{% if a %}x{% endif %}', {'a': True}),
('{% if a %}c{% endif %}b', {'a': False}),
('{{ 1 if a else 2 }}', {'a': True}),
('{{ 1 if a else 2 }}', {'a': False}),
('{% if a %}d{% else %}e{% endif %}', {'... | import codegen, jinja2, spidermonkey, sys
import simplejson as json
def jstest(env, src, data):
run = spidermonkey.Runtime()
ctx = run.new_context()
js = codegen.generate(env, codegen.compile(env, src))
jsobj = json.dumps(data)
code = js + '\ntemplate.render(%s);' % jsobj
return ctx.execute(code)
def pytest(env... | Python | 0 |
6d425b617a28b2eb35d53f35f5136148aa1f2ef6 | Add relative import for the parser | source/champollion/__init__.py | source/champollion/__init__.py | # :coding: utf-8
import os
from ._version import __version__
from .directive.data import AutoDataDirective
from .directive.function import AutoFunctionDirective
from .directive.class_ import AutoClassDirective
from .directive.method import AutoMethodDirective
from .directive.attribute import AutoAttributeDirective
... | # :coding: utf-8
import os
from ._version import __version__
from .directive.data import AutoDataDirective
from .directive.function import AutoFunctionDirective
from .directive.class_ import AutoClassDirective
from .directive.method import AutoMethodDirective
from .directive.attribute import AutoAttributeDirective
... | Python | 0.000003 |
feb745334c4b7ba97a54c8e2b1862888ed9369ea | fix test: str->bytes | test.py | test.py | #!/usr/bin/env python
from __future__ import print_function, unicode_literals
# Standard library imports
import unittest
import random
import hashlib
try:
range = xrange
except NameError:
pass
# Custom SHA-1 library
import sha1
class TestSha1(unittest.TestCase):
"""TestSha1 class
Test case for the ... | #!/usr/bin/env python
# Standard library imports
import unittest
import random
import hashlib
# Custom SHA-1 library
import sha1
class TestSha1(unittest.TestCase):
"""TestSha1 class
Test case for the custom SHA-1 implementation.
"""
def test_similar(self):
"""Test Similar SHA-1 Inputs
... | Python | 0.000023 |
1caace2631f8e9c38cf0adfb1179a5260dcd3c33 | Change output_all_unitprot to allow multi ids for some proteins. | tools/management/commands/output_all_uniprot.py | tools/management/commands/output_all_uniprot.py | from django.core.management.base import BaseCommand, CommandError
from django.core.management import call_command
from django.conf import settings
from django.db import connection
from django.db.models import Q
from django.template.loader import render_to_string
from protein.models import Protein
from residue.models im... | from django.core.management.base import BaseCommand, CommandError
from django.core.management import call_command
from django.conf import settings
from django.db import connection
from django.db.models import Q
from django.template.loader import render_to_string
from protein.models import Protein
from residue.models im... | Python | 0 |
1b06091101c119f30eb5eabb2d2638fab0e8f658 | Test modified to work with renamed debug function | test_debug.py | test_debug.py | from bullsandcows import isdebug
def test_isdebug():
assert isdebug() == 0, "program is in debug mode, this should not be commited"
| from bullsandcows import isdebugmode
def test_isdebugmode():
assert isdebugmode() == 0, "program is in debug mode, this should not be commited"
| Python | 0 |
f1c47f99255bc6ff2dc7819d72ceafbecaa328a4 | Fix comment formatting | imapclient/test/util.py | imapclient/test/util.py | # Copyright (c) 2014, Menno Smits
# Released subject to the New BSD License
# Please see http://en.wikipedia.org/wiki/BSD_licenses
from __future__ import unicode_literals
def find_unittest2():
import unittest
if hasattr(unittest, 'skip') and hasattr(unittest, 'loader'):
return unittest # unittest f... | # Copyright (c) 2014, Menno Smits
# Released subject to the New BSD License
# Please see http://en.wikipedia.org/wiki/BSD_licenses
from __future__ import unicode_literals
def find_unittest2():
import unittest
if hasattr(unittest, 'skip') and hasattr(unittest, 'loader'):
return unittest # unittest f... | Python | 0.000003 |
6e35f8778b3293a9b2ad60624637460146f755ba | add njobs parameters | implement/tunemodels.py | implement/tunemodels.py | import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from implement.decisiontreemodel import DecisionTreeModel
from sklearn.grid_search import GridSearchCV, RandomizedSearchCV
from evaluation.sklearnmape import mean_absolute_percentage_error_scoring
import logging
from utility.logger_tool import Logger
from ... | import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from implement.decisiontreemodel import DecisionTreeModel
from sklearn.grid_search import GridSearchCV, RandomizedSearchCV
from evaluation.sklearnmape import mean_absolute_percentage_error_scoring
import logging
from utility.logger_tool import Logger
from ... | Python | 0.000001 |
96261b3c277cb2f694fb5cc2f7cbe29847ff1a53 | change the receiver | SyncEmailNotification.py | SyncEmailNotification.py | __author__ = 'chuqiao'
import smtplib
import base64
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
def viewlog(file):
file = open("syncsolr.log")
file.seek(0,2)# Go to the end of the file
while True:
line = file.readline()
if "***Finished synchronizi... | __author__ = 'chuqiao'
import smtplib
import base64
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
def viewlog(file):
file = open("syncsolr.log")
file.seek(0,2)# Go to the end of the file
while True:
line = file.readline()
if "***Finished synchronizi... | Python | 0.000017 |
474dfd3aa9d03ed6bbda47078523badcc7909664 | Reorganize and refactor | scripts/observations/scrape/CalFloraScraper.py | scripts/observations/scrape/CalFloraScraper.py | from selenium import webdriver
import pandas as pd
import argparse
import PyFloraBook.web.communication as scraping
import PyFloraBook.input_output.data_coordinator as dc
# ---------------- GLOBALS ----------------
SITE_NAME = "CalFlora"
# ---------------- INPUT ----------------
# Parse arguments
PARSER = argparse... | from selenium import webdriver
import pandas as pd
import argparse
import PyFloraBook.web.communication as scraping
import PyFloraBook.input_output.data_coordinator as dc
# ---------------- INPUT ----------------
# Parse arguments
parser = argparse.ArgumentParser(
description='Scrape CalFlora for species counts... | Python | 0.000002 |
1305af162dd05591cc0e5328eb192843b63dabb1 | Use DefaultRouter instead of SimpleRouter | kk/urls_v1.py | kk/urls_v1.py | from django.conf.urls import include, url
from kk.views import (
HearingCommentViewSet, HearingImageViewSet, HearingViewSet, SectionCommentViewSet,
SectionViewSet, UserDataViewSet
)
from rest_framework_nested import routers
router = routers.DefaultRouter()
router.register(r'hearing', HearingViewSet)
router.reg... | from django.conf.urls import include, url
from kk.views import (
HearingCommentViewSet, HearingImageViewSet, HearingViewSet, SectionCommentViewSet,
SectionViewSet, UserDataViewSet
)
from rest_framework_nested import routers
router = routers.SimpleRouter()
router.register(r'hearing', HearingViewSet)
router.regi... | Python | 0 |
cd04513f6f0f5bb9f55e895aa852ffefefe1e47f | fix building by name of configuration; add some form of pretty-printing to the build by id command | pnc/builds.py | pnc/builds.py | from argh import arg
import client
from client.BuildconfigurationsApi import BuildconfigurationsApi
import utils
__author__ = 'thauser'
def _create_build_configuration(name, project_id, environment, description, scm_url, scm_revision, patches_url,
build_script):
created_build_config... | from argh import arg
import client
from client.BuildconfigurationsApi import BuildconfigurationsApi
import utils
__author__ = 'thauser'
def _create_build_configuration(name, project_id, environment, description, scm_url, scm_revision, patches_url,
build_script):
created_build_config... | Python | 0 |
a0dcb73836222e3515c4af4cf4cfe2d41f470b9e | handle missing stash[benchstorage] (#3564) | tests/integration_tests/tests/benchmarks/conftest.py | tests/integration_tests/tests/benchmarks/conftest.py | import pytest
from datetime import datetime
def log_result(name, timing, start, stop):
if timing:
name = f'{name}.{timing}'
print(f'BENCH {name}: {stop - start}')
class _Timings(object):
def __init__(self, func_name):
self.records = {}
self._func_name = func_name
def start(s... | import pytest
from datetime import datetime
def log_result(name, timing, start, stop):
if timing:
name = f'{name}.{timing}'
print(f'BENCH {name}: {stop - start}')
class _Timings(object):
def __init__(self, func_name):
self.records = {}
self._func_name = func_name
def start(s... | Python | 0 |
57adb8240cf0015e1e10f2e9fd4f090a8d896a27 | Revert "[examples...bindings_generator] began to update" | examples/stationarylinear_bindings_generator.py | examples/stationarylinear_bindings_generator.py | #! /usr/bin/env python
# This file is part of the dune-pymor project:
# https://github.com/pymor/dune-pymor
# Copyright Holders: Felix Albrecht, Stephan Rave
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import sys
from pybindgen import param, retval
from dune.pymor.core import prepa... | #! /usr/bin/env python
# This file is part of the dune-pymor project:
# https://github.com/pymor/dune-pymor
# Copyright Holders: Felix Albrecht, Stephan Rave
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import sys
from pybindgen import param, retval
from dune.pymor.core import prepa... | Python | 0 |
e6cef6d96a3c2bd6dd07f580f4a704734133d316 | Bump version to 0.3c2 | lava_server/__init__.py | lava_server/__init__.py | # Copyright (C) 2010, 2011 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of LAVA Server.
#
# LAVA Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software F... | # Copyright (C) 2010, 2011 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of LAVA Server.
#
# LAVA Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software F... | Python | 0.000001 |
c6878b3306290760231ca24893418e0c87eb1f8a | Make directory in selinux tests | tests/pytests/unit/modules/file/test_file_selinux.py | tests/pytests/unit/modules/file/test_file_selinux.py | import logging
import os
import shutil
import pytest
import salt.config
import salt.loader
import salt.modules.cmdmod as cmdmod
import salt.modules.file as filemod
import salt.utils.data
import salt.utils.files
import salt.utils.platform
import salt.utils.stringutils
from tests.support.mock import MagicMock, patch
lo... | import logging
import os
import shutil
import pytest
import salt.config
import salt.loader
import salt.modules.cmdmod as cmdmod
import salt.modules.file as filemod
import salt.utils.data
import salt.utils.files
import salt.utils.platform
import salt.utils.stringutils
from tests.support.mock import MagicMock, patch
lo... | Python | 0 |
cf194c1c3a64c4547049c16fb901a2b33dc84ddf | Add verbose output | src/xii/output.py | src/xii/output.py | import os
from threading import Lock
from abc import ABCMeta, abstractmethod
# synchronize output from multiple threads
output_lock = Lock()
class colors:
TAG = '\033[0m'
NORMAL = '\033[37m'
CLEAR = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
WARN = '\033[91m'
SUCCESS = '\033[34m'
... | import os
from threading import Lock
from abc import ABCMeta, abstractmethod
# synchronize output from multiple threads
output_lock = Lock()
class colors:
TAG = '\033[0m'
NORMAL = '\033[37m'
CLEAR = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
WARN = '\033[91m'
SUCCESS = '\033[34m'
... | Python | 0.999999 |
b3b99ed11d6c86721e9e57441111e0c88461eb70 | Fix example state relation | examples/defining_new_state_relation.py | examples/defining_new_state_relation.py | import numpy as np
import matplotlib.pyplot as plt
from math import log
from rsfmodel import rsf
# This is really just the Ruina realtion, but let's pretend we invented it!
# We'll inherit attributes from rsf.StateRelation, but you wouldn't have to.
# It does provide velocity contribution calculation for us though!
... | import numpy as np
import matplotlib.pyplot as plt
from math import log
from rsfmodel import rsf
# This is really just the Ruina realtion, but let's pretend we invented it!
# We'll inherit attributes from rsf.StateRelation, but you wouldn't have to.
# It does provide velocity contribution calculation for us though!
... | Python | 0.998463 |
cdbf31d056f1991b5206a4f42f2ab129f800e7a7 | Add get_maximum_transfer_length function | letmecreate/core/spi.py | letmecreate/core/spi.py | #!/usr/bin/env python3
"""Python binding of SPI wrapper of LetMeCreate library."""
import ctypes
_LIB = ctypes.CDLL('libletmecreate_core.so')
# SPI_SPEED
SPI_680K = 680000
SPI_1M36 = 1360000
SPI_2M73 = 2730000
SPI_5M46 = 5460000
SPI_10M93 = 10930000
SPI_21M87 = 21870000
SPI_43M75 = 43750000
def init():
"""Init... | #!/usr/bin/env python3
"""Python binding of SPI wrapper of LetMeCreate library."""
import ctypes
_LIB = ctypes.CDLL('libletmecreate_core.so')
# SPI_SPEED
SPI_680K = 680000
SPI_1M36 = 1360000
SPI_2M73 = 2730000
SPI_5M46 = 5460000
SPI_10M93 = 10930000
SPI_21M87 = 21870000
SPI_43M75 = 43750000
def init():
"""Init... | Python | 0 |
abd3daed5cd0c70d76bf8fa1cfdda93efcda3e70 | Make the `now` helper timezone aware | knights/compat/django.py | knights/compat/django.py |
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.utils.encoding import iri_to_uri
import datetime
from knights.library import Library
register = Library()
@register.helper
def now(fmt):
return timezone.now().strftime(fmt)
@register.helper
def url(name, *args, **kwar... |
from django.core.urlresolvers import reverse
from django.utils.encoding import iri_to_uri
import datetime
from knights.library import Library
register = Library()
@register.helper
def now(fmt):
return datetime.datetime.now().strftime(fmt)
@register.helper
def url(name, *args, **kwargs):
try:
ret... | Python | 0.000001 |
cbe4f5470fec966538f63ca9beb04838bfbf3aa3 | change to contentnode_1 and contentnode_2 for content relationship | kolibri/content/admin.py | kolibri/content/admin.py | from django.contrib import admin
from .models import PrerequisiteContentRelationship, RelatedContentRelationship
class PrerequisiteRelationshipInline1(admin.TabularInline):
model = PrerequisiteContentRelationship
fk_name = 'contentnode_1'
max = 20
extra = 0
class PrerequisiteRelationshipInline2(admi... | from django.contrib import admin
from .models import PrerequisiteContentRelationship, RelatedContentRelationship
class PrerequisiteRelationshipInline1(admin.TabularInline):
model = PrerequisiteContentRelationship
fk_name = 'contentmetadata_1'
max = 20
extra = 0
class PrerequisiteRelationshipInline2(... | Python | 0.000001 |
d43657286f49271a6236499bdba288925fb23087 | update tests to v1.2.0 (#1307) | exercises/roman-numerals/roman_numerals_test.py | exercises/roman-numerals/roman_numerals_test.py | import unittest
import roman_numerals
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
class RomanTest(unittest.TestCase):
numerals = {
1: 'I',
2: 'II',
3: 'III',
4: 'IV',
5: 'V',
6: 'VI',
9: 'IX',
27: 'XXVII',
48... | import unittest
import roman_numerals
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
class RomanTest(unittest.TestCase):
numerals = {
1: 'I',
2: 'II',
3: 'III',
4: 'IV',
5: 'V',
6: 'VI',
9: 'IX',
27: 'XXVII',
48... | Python | 0 |
1c2c7eb9b14a8abaea22e644d8b6e4bd4a649fcb | move replacing img path holder logic to back-end because if we deal with it at front-end, we are dealing with a JS object | kolibri/content/views.py | kolibri/content/views.py | import datetime
import mimetypes
import os
import zipfile
from django.http import Http404
from django.http.response import FileResponse, HttpResponseNotModified
from django.utils.http import http_date
from django.views.generic.base import View
from .utils.paths import get_content_storage_file_path
class ZipContentV... | import datetime
import mimetypes
import os
import zipfile
from django.http import Http404
from django.http.response import FileResponse, HttpResponseNotModified
from django.utils.http import http_date
from django.views.generic.base import View
from .utils.paths import get_content_storage_file_path
class ZipContentV... | Python | 0 |
34b2385d6a3bb7acdbcd3f894d30dfbc734bd52e | allow to set matplotlib backend from env MATPLOTLIB_BACKEND | ggplot/__init__.py | ggplot/__init__.py | # For testing purposes we might need to set mpl backend before any
# other import of matplotlib.
def _set_mpl_backend():
import os
import matplotlib as mpl
env_backend = os.environ.get('MATPLOTLIB_BACKEND')
if env_backend:
# we were instructed
mpl.use(env_backend)
_set_mpl_backend()
f... | from .ggplot import *
from .exampledata import *
| Python | 0.000001 |
4e9a530403dce47f322df471255a0fc40fd1071f | Change number of episodes to 60000 | examples/tic_ql_tabular_selfplay_all.py | examples/tic_ql_tabular_selfplay_all.py | '''
The Q-learning algorithm is used to learn the state-action values for all
Tic-Tac-Toe positions by playing games against itself (self-play).
'''
from capstone.game.games import TicTacToe
from capstone.game.players import RandPlayer
from capstone.rl import Environment, GameMDP
from capstone.rl.learners import QLearn... | '''
The Q-learning algorithm is used to learn the state-action values for all
Tic-Tac-Toe positions by playing games against itself (self-play).
'''
from capstone.game.games import TicTacToe
from capstone.game.players import RandPlayer
from capstone.rl import Environment, GameMDP
from capstone.rl.learners import QLearn... | Python | 0.999996 |
f694b2a234216ae7ecc7b925799f43caca5e9a32 | add more debug output for config file | preprocess.py | preprocess.py | #!/usr/bin/env python3
# Copyright 2016 Curtis Sand <curtissand@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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | #!/usr/bin/env python3
# Copyright 2016 Curtis Sand <curtissand@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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Python | 0 |
292fd33a3d251b4c5773e96989e45d8e3d7c6c3b | Change tasks in settingfs | krunchr/settings/base.py | krunchr/settings/base.py | from socket import gethostname
HOSTNAME = gethostname()
HOSTNAME_SHORT = HOSTNAME.split('.')[0]
APPLICATION_ROOT = '/v1/krunchr'
DEBUG = True
RETHINKDB_HOST = 'batman.krunchr.net'
RETHINKDB_PORT = 28019
RETHINKDB_AUTH = ''
RETHINKDB_DB = 'krunchr'
BROKER_URL = 'redis://localhost:6379'
CELERY_RESULT_BACKEND = 'redi... | from socket import gethostname
HOSTNAME = gethostname()
HOSTNAME_SHORT = HOSTNAME.split('.')[0]
APPLICATION_ROOT = '/v1/krunchr'
DEBUG = True
RETHINKDB_HOST = 'batman.krunchr.net'
RETHINKDB_PORT = 28019
RETHINKDB_AUTH = ''
RETHINKDB_DB = 'krunchr'
BROKER_URL = 'redis://localhost:6379'
CELERY_RESULT_BACKEND = 'redi... | Python | 0.000001 |
9fa72e3df775d4848336bcb0965cfd6afeaf5953 | change cmi_and_test to invoke the targets 'all', 'tests' and 'run_tests' separately | scripts/devel/catkin_make_isolated_and_test.py | scripts/devel/catkin_make_isolated_and_test.py | #!/usr/bin/env python3
import argparse
import os
import sys
from ros_buildfarm.catkin_workspace import call_catkin_make_isolated
from ros_buildfarm.catkin_workspace import clean_workspace
from ros_buildfarm.catkin_workspace import ensure_workspace_exists
def main(argv=sys.argv[1:]):
parser = argparse.ArgumentPa... | #!/usr/bin/env python3
import argparse
import os
import sys
from ros_buildfarm.catkin_workspace import call_catkin_make_isolated
from ros_buildfarm.catkin_workspace import clean_workspace
from ros_buildfarm.catkin_workspace import ensure_workspace_exists
def main(argv=sys.argv[1:]):
parser = argparse.ArgumentPa... | Python | 0.000008 |
2d391f9e6183f06c0785cbb2c57b7a4fcf703a80 | Bump version to 0.1a14 | chirptext/__version__.py | chirptext/__version__.py | # -*- coding: utf-8 -*-
# chirptext's package version information
__author__ = "Le Tuan Anh"
__email__ = "tuananh.ke@gmail.com"
__copyright__ = "Copyright (c) 2012, Le Tuan Anh"
__credits__ = []
__license__ = "MIT License"
__description__ = "ChirpText is a collection of text processing tools for Python."
__url__ = "ht... | # -*- coding: utf-8 -*-
# chirptext's package version information
__author__ = "Le Tuan Anh"
__email__ = "tuananh.ke@gmail.com"
__copyright__ = "Copyright (c) 2012, Le Tuan Anh"
__credits__ = []
__license__ = "MIT License"
__description__ = "ChirpText is a collection of text processing tools for Python."
__url__ = "ht... | Python | 0 |
6436a8adf4088f59c704a7d49e5f61c30d665058 | return true in ping cli | lacli/server/__init__.py | lacli/server/__init__.py | from lacli.decorators import command
from lacli.command import LaBaseCommand
from twisted.python.log import startLogging, msg
from twisted.internet import reactor
from thrift.transport import TTwisted
from thrift.protocol import TBinaryProtocol
from lacli.server.interface.ClientInterface import CLI
import sys
import z... | from lacli.decorators import command
from lacli.command import LaBaseCommand
from twisted.python.log import startLogging, msg
from twisted.internet import reactor
from thrift.transport import TTwisted
from thrift.protocol import TBinaryProtocol
from lacli.server.interface.ClientInterface import CLI
import sys
import z... | Python | 0.00219 |
869ce2f18641da5cb304b2ec4e8e63f7cc4840d3 | Make it work with logging (at the cost of multiprocessing) | gigaword_loader.py | gigaword_loader.py | from __future__ import print_function
from bs4 import BeautifulSoup
import re
import dateutil.parser
import os
import multiprocessing
import pika
import json
from bson import json_util
from pymongo import MongoClient
import datetime
import logging
import sys
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)... | from bs4 import BeautifulSoup
import re
import dateutil.parser
import os
from multiprocessing import Pool
import pika
import json
from bson import json_util
from pymongo import MongoClient
import datetime
connection = MongoClient()
db = connection.lexisnexis
collection = db['gigaword']
def extract_xml(doc):
artic... | Python | 0 |
af40e69bca873a7d0060aaf3391fb8feb91bf673 | Use correct format for custom payload keys | openprescribing/frontend/signals/handlers.py | openprescribing/frontend/signals/handlers.py | import logging
from allauth.account.signals import user_logged_in
from anymail.signals import tracking
from requests_futures.sessions import FuturesSession
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.conf import settings
... | import logging
from allauth.account.signals import user_logged_in
from anymail.signals import tracking
from requests_futures.sessions import FuturesSession
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.conf import settings
... | Python | 0.000004 |
52a6ea1e7dd4333b9db6a0bbd53b8ae0b39a1f6d | Add __doc__ to module functions | Designs/redundant.py | Designs/redundant.py | '''Due to the needs arising from completing the project on time, I have defined redundant.py
which will hold replacement modules as I migrate from file based application to lists only web application. This modules
so far will offer the capabilities of registration, creating a shopping list and adding items into
a shopp... | '''Due to the needs arising from completing the project on time, I have defined redundant.py
which will hold replacement modules as I migrate from file based application to lists only web application. This modules
so far will offer the capabilities of registration, creating a shopping list and adding items into
a shopp... | Python | 0.000025 |
9f52714e696879e46ebf98164827ebf0cc4cd666 | Return to homepage after logout | opendebates/registration_urls.py | opendebates/registration_urls.py | """
URLconf for registration and activation, using django-registration's
one-step backend.
If the default behavior of these views is acceptable to you, simply
use a line like this in your root URLconf to set up the default URLs
for registration::
(r'^accounts/', include('registration.backends.simple.urls')),
Thi... | """
URLconf for registration and activation, using django-registration's
one-step backend.
If the default behavior of these views is acceptable to you, simply
use a line like this in your root URLconf to set up the default URLs
for registration::
(r'^accounts/', include('registration.backends.simple.urls')),
Thi... | Python | 0.000001 |
111cdf1496074e25b764e042fa0ab1b7b0e2a2b7 | Add agriculture import to calendar registry | pandas_market_calendars/calendar_registry.py | pandas_market_calendars/calendar_registry.py | from .market_calendar import MarketCalendar
from .exchange_calendar_asx import ASXExchangeCalendar
from .exchange_calendar_bmf import BMFExchangeCalendar
from .exchange_calendar_cfe import CFEExchangeCalendar
from .exchange_calendar_cme import CMEExchangeCalendar
from .exchange_calendar_cme_agriculture import CMEAgricu... | from .market_calendar import MarketCalendar
from .exchange_calendar_asx import ASXExchangeCalendar
from .exchange_calendar_bmf import BMFExchangeCalendar
from .exchange_calendar_cfe import CFEExchangeCalendar
from .exchange_calendar_cme import CMEExchangeCalendar
from .exchange_calendar_eurex import EUREXExchangeCalend... | Python | 0 |
1534c3c47fea71db2cf4f9f224c2e5ff5a8632e2 | Remove audio file after playing, not while | tests/test.py | tests/test.py | from time import sleep
import sys
import os
sys.path.insert(0, os.path.realpath("../../swood"))
import swood
def find_program(prog):
for path in os.environ["PATH"].split(os.pathsep):
vlc_location = os.path.join(path.strip('"'), prog)
if os.path.isfile(fpath):
return vlc_location, args
... | from time import sleep
import sys
import os
sys.path.insert(0, os.path.realpath("../../swood"))
import swood
def find_program(prog):
for path in os.environ["PATH"].split(os.pathsep):
vlc_location = os.path.join(path.strip('"'), prog)
if os.path.isfile(fpath):
return vlc_location, args
... | Python | 0.000001 |
fda1544249585a9a65136af24f92b976a19938d7 | Fix bug when not using translation | cbpos/translator.py | cbpos/translator.py | import cbpos
import gettext
cbpos.config.set_default('locale', 'use', True)
cbpos.config.set_default('locale', 'languages', list())
cbpos.config.set_default('locale', 'fallback', True)
cbpos.config.set_default('locale', 'codeset', '')
class TranslatorBuilder(object):
"""
Helper class to create a GlobalTransla... | import cbpos
import gettext
cbpos.config.set_default('locale', 'use', True)
cbpos.config.set_default('locale', 'languages', list())
cbpos.config.set_default('locale', 'fallback', True)
cbpos.config.set_default('locale', 'codeset', '')
class TranslatorBuilder(object):
"""
Helper class to create a GlobalTransla... | Python | 0 |
f2350b4be2e88f282e7a49cafebb7e8e7c37efd9 | Bump version | YaDiskClient/__init__.py | YaDiskClient/__init__.py | """
Client for Yandex.Disk.
"""
__version__ = '1.0.1'
| """
Client for Yandex.Disk.
"""
__version__ = '0.5.1'
| Python | 0 |
741ef67787c0e49a6d506d077d5eb14c2e280805 | add tests for provision_configs with directories | tests/util.py | tests/util.py | import aminator.util.linux
import unittest
import os
import logging
import shutil
import tempfile
log = logging.getLogger(__name__)
logging.root.addHandler(logging.StreamHandler())
logging.root.setLevel(logging.DEBUG)
class linux_util(unittest.TestCase):
src_root = tempfile.mkdtemp(dir='/tmp', prefix='src_')
... | import aminator.util.linux
import unittest
import os
import logging
import shutil
import tempfile
log = logging.getLogger(__name__)
logging.root.addHandler(logging.StreamHandler())
logging.root.setLevel(logging.DEBUG)
class linux_util(unittest.TestCase):
src_root = tempfile.mkdtemp(dir='/tmp', prefix='src_')
... | Python | 0 |
e0082e0564ccb1fc838e3248e6d8306132166364 | symlink libtool{ize} to glibtool{ize} (#7060) | var/spack/repos/builtin/packages/libtool/package.py | var/spack/repos/builtin/packages/libtool/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | Python | 0.999189 |
9a1a346999b77ef7485913c79d7d854c779ecd0d | add version 2.10.0 (#15205) | var/spack/repos/builtin/packages/py-h5py/package.py | var/spack/repos/builtin/packages/py-h5py/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 *
class PyH5py(PythonPackage):
"""The h5py package provides both a high- and low-level interface t... | # 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 *
class PyH5py(PythonPackage):
"""The h5py package provides both a high- and low-level interface t... | Python | 0 |
4014a29d2b163aaa3906bee1adeb2ca778ddd620 | Use proper deptype so that spack activate works | var/spack/repos/builtin/packages/py-meep/package.py | var/spack/repos/builtin/packages/py-meep/package.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | Python | 0 |
6a7611c4c2a41d5bf316697df92636b2b43e9125 | add version 2.1.2 to r-gsodr (#21035) | var/spack/repos/builtin/packages/r-gsodr/package.py | var/spack/repos/builtin/packages/r-gsodr/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RGsodr(RPackage):
"""A Global Surface Summary of the Day (GSOD) Weather Data Client for R
... | # 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 RGsodr(RPackage):
"""A Global Surface Summary of the Day (GSOD) Weather Data Client for R"... | Python | 0 |
d19b2af11c7b7942d81fb8aa68fe019409055a68 | Add atomic rewrite of the JSON file | ldform/cgi.py | ldform/cgi.py | #!/usr/bin/env python3
import cgi
import cgitb
import os
import datetime
import random
import string
import json
import importlib
# Python 3.2 compatibility
if __package__ is None:
__package__ = "ldform"
# Base path global variable
BASE_PATH = ""
class MyDict(dict):
"""
Dictionary with few convinience... | #!/usr/bin/env python3
import cgi
import cgitb
import os
import datetime
import random
import string
import json
import importlib
# Python 3.2 compatibility
if __package__ is None:
__package__ = "ldform"
# Base path global variable
BASE_PATH = ""
class MyDict(dict):
"""
Dictionary with few convinience... | Python | 0.000001 |
22428bcdbb095b407a0845c35e06c8ace0653a44 | Use MEDIA_URL instead of a hardcoded path | urls.py | urls.py | from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
(r'^', include('blangoblog.blango.urls')),
)
handler500 = 'blango.views.server_error'
handler404 = 'blango.views.page_not... | from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
(r'^', include('blangoblog.blango.urls')),
)
handler500 = 'blango.views.server_error'
handler404 = 'blango.views.page_not... | Python | 0.000002 |
b30391c105e8aaa6533cbd043772983aad14a04a | remove bigbrother from urls | urls.py | urls.py | from django.conf.urls.defaults import patterns, url, include
from django.contrib.gis import admin
import settings
admin.autodiscover()
# Sitemaps
import venue.sitemaps
import band.sitemaps
import event.sitemaps
sitemaps = {}
sitemaps.update(venue.sitemaps.sitemaps)
sitemaps.update(band.sitemaps.sitemaps)
sitemaps.u... | from django.conf.urls.defaults import patterns, url, include
from django.contrib.gis import admin
import settings
admin.autodiscover()
# Sitemaps
import venue.sitemaps
import band.sitemaps
import event.sitemaps
sitemaps = {}
sitemaps.update(venue.sitemaps.sitemaps)
sitemaps.update(band.sitemaps.sitemaps)
sitemaps.u... | Python | 0.000001 |
46666faa163fde00c29eca375398f20ee2b86154 | fix line splitting for diff generation | gitmagic/change.py | gitmagic/change.py | import difflib
from io import StringIO
import git
class Change(object):
def __init__(self, a_file_name: str, b_file_name: str, a_file_content: [str],
b_file_content: [str], a_hunk: (int, int), b_hunk: (int, int), diff: str):
self.a_file_name = a_file_name
self.b_file_name = b_fil... | import difflib
from io import StringIO
import git
class Change(object):
def __init__(self, a_file_name: str, b_file_name: str, a_file_content: [str],
b_file_content: [str], a_hunk: (int, int), b_hunk: (int, int), diff: str):
self.a_file_name = a_file_name
self.b_file_name = b_fil... | Python | 0.000001 |
d44c28a13649a46a7fe6eddc7413d66fc1a4acba | Fix module docstring | flocker/acceptance/endtoend/test_diagnostics.py | flocker/acceptance/endtoend/test_diagnostics.py | # Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Tests for ``flocker-diagnostics``.
"""
import os
import tarfile
from twisted.internet import reactor
from twisted.python.filepath import FilePath
from twisted.trial.unittest import TestCase
from ...common.runner import run_ssh, download_file
from ..testt... | # Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Tests for the flocker-diagnostics.
"""
import os
import tarfile
from twisted.internet import reactor
from twisted.python.filepath import FilePath
from twisted.trial.unittest import TestCase
from ...common.runner import run_ssh, download_file
from ..testt... | Python | 0.000005 |
224700aada7e7d80b4389b123ee00b5f14e88c99 | Fix HTML escaping of TextPlugin, by feature/text-filters branch | fluent_contents/plugins/text/content_plugins.py | fluent_contents/plugins/text/content_plugins.py | """
Definition of the plugin.
"""
from django.utils.safestring import mark_safe
from fluent_contents.extensions import ContentPlugin, plugin_pool, ContentItemForm
from fluent_contents.plugins.text.models import TextItem
class TextItemForm(ContentItemForm):
"""
Perform extra processing for the text item
""... | """
Definition of the plugin.
"""
from django.utils.html import format_html
from fluent_contents.extensions import ContentPlugin, plugin_pool, ContentItemForm
from fluent_contents.plugins.text.models import TextItem
class TextItemForm(ContentItemForm):
"""
Perform extra processing for the text item
"""
... | Python | 0 |
f48b3df88bb01edd8489f0d7f59794b2cd46bde8 | Make PY3 compatible | test/core/028-dynamic-hierarchy/local_hierarchy.py | test/core/028-dynamic-hierarchy/local_hierarchy.py | #!/usr/bin/env python
import os
import subprocess
import sys
from Pegasus.DAX3 import *
if len(sys.argv) != 2:
print("Usage: %s CLUSTER_PEGASUS_HOME" % sys.argv[0])
sys.exit(1)
cluster_pegasus_home = sys.argv[1]
# to setup python lib dir for importing Pegasus PYTHON DAX API
# pegasus_config = os.path.join... | #!/usr/bin/env python
import os
import sys
import subprocess
if len(sys.argv) != 2:
print "Usage: %s CLUSTER_PEGASUS_HOME" % (sys.argv[0])
sys.exit(1)
cluster_pegasus_home=sys.argv[1]
# to setup python lib dir for importing Pegasus PYTHON DAX API
#pegasus_config = os.path.join("pegasus-config") + "... | Python | 0.000001 |
919c2e5ea6a22ac7b24aa005e5ad3c7886b3feb7 | fix broadcaster display | panel/admin.py | panel/admin.py | from ccradio.panel.models import Broadcaster, Category, Stream
from django.contrib import admin
from django.contrib.auth.models import User
class BroadcasterAdmin(admin.ModelAdmin):
list_display = ('title', 'category', 'stream', 'url')
list_filter = ('category', 'stream')
ordering = ('title', 'category')
... | from ccradio.panel.models import Broadcaster, Category, Stream
from django.contrib import admin
from django.contrib.auth.models import User
class BroadcasterAdmin(admin.ModelAdmin):
list_display = ('title', 'category', 'active', 'stream')
list_filter = ('category', 'stream', 'active')
ordering = ('title', ... | Python | 0.000003 |
afe5e9a0a097d6b6615e01d574b42e6c996282d6 | Disable colore for @mrtazz | legit/core.py | legit/core.py | # -*- coding: utf-8 -*-
"""
legit.core
~~~~~~~~~~
This module provides the basic functionality of legit.
"""
# from clint import resources
import os
import clint.textui.colored
__version__ = '0.0.9'
__author__ = 'Kenneth Reitz'
__license__ = 'BSD'
if 'LEGIT_NO_COLORS' in os.environ:
clint.textui.colored.DIS... | # -*- coding: utf-8 -*-
"""
legit.core
~~~~~~~~~~
This module provides the basic functionality of legit.
"""
# from clint import resources
__version__ = '0.0.9'
__author__ = 'Kenneth Reitz'
__license__ = 'BSD'
# resources.init('kennethreitz', 'legit')
# resources.user.write('config.ini', "we'll get there.") | Python | 0 |
05cd983e108764d288798784508249726b0ffd70 | add version 0.6.2 to yaml-cpp (#7931) | var/spack/repos/builtin/packages/yaml-cpp/package.py | var/spack/repos/builtin/packages/yaml-cpp/package.py | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | Python | 0 |
58d3d5fb4ae8fc081e5e503e2b6316dc81deb678 | Rewrite views.py | gpbot/bot/views.py | gpbot/bot/views.py | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden
from django.conf import settings
from linebot import LineBotApi, WebhookParser
from linebot.exceptions import InvalidSignatureError, LineBotApiError
from linebot.models import (
MessageEvent,
... | from django.shortcuts import render
from django.http import HttpResponse
import os
import json
import requests
REPLY_ENDPOINT = 'https://api.line.me/v2/bot/message/reply'
CHANNEL_ACCESS_TOKEN = os.environ['LINE_CHANNEL_ACCESS_TOKEN']
HEADER = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + C... | Python | 0.000023 |
63f01e99acf8b365539c7d58d1acf86d70d03261 | Fix name-tests-test | pre_commit_hooks/tests_should_end_in_test.py | pre_commit_hooks/tests_should_end_in_test.py | from __future__ import print_function
import argparse
import sys
def validate_files(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*')
args = parser.parse_args(argv)
retcode = 0
for filename in args.filenames:
if (
not filename.ends... | from __future__ import print_function
import sys
def validate_files(argv=None):
retcode = 0
for filename in argv:
if (
not filename.endswith('_test.py') and
not filename.endswith('__init__.py') and
not filename.endswith('/conftest.py')
):
... | Python | 0.999993 |
edf96afa7045efa4d60d80edaef9a13226535892 | Fix typo in feature_blocksdir.py log message | test/functional/feature_blocksdir.py | test/functional/feature_blocksdir.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the blocksdir option.
"""
import os
import shutil
from test_framework.test_framework import BitcoinTe... | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the blocksdir option.
"""
import os
import shutil
from test_framework.test_framework import BitcoinTe... | Python | 0.000984 |
cb0b197ccad0b49baa24f3dff374de2ff2572cde | Make ua_comment test pass on 0.16.0 | test/functional/feature_uacomment.py | test/functional/feature_uacomment.py | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -uacomment option."""
from test_framework.test_framework import BitcoinTestFramework
from test_fra... | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -uacomment option."""
from test_framework.test_framework import BitcoinTestFramework
from test_fra... | Python | 0.000311 |
e41dde0874ff40dde175830618b40ae3828865d6 | Update file paths to new location for trac, inside of irrigator_pro | irrigator_pro/trac/cgi-bin/trac.wsgi | irrigator_pro/trac/cgi-bin/trac.wsgi | import os, os.path, site, sys, socket
# Add django root dir to python path
PROJECT_ROOT = '/prod/irrigator_pro'
print "PROJECT_ROOT=", PROJECT_ROOT
sys.path.append(PROJECT_ROOT)
# Add virtualenv dirs to python path
if socket.gethostname()=='gregs-mbp':
VIRTUAL_ENV_ROOT = os.path.join( PROJECT_ROOT, 'Virtual... | import os, os.path, site, sys, socket
# Add django root dir to python path
PROJECT_ROOT = '/prod/irrigator_pro'
print "PROJECT_ROOT=", PROJECT_ROOT
sys.path.append(PROJECT_ROOT)
# Add virtualenv dirs to python path
if socket.gethostname()=='gregs-mbp':
VIRTUAL_ENV_ROOT = os.path.join( PROJECT_ROOT, 'Virtual... | Python | 0 |
5148baee7f0cc5817af8dd366a91b93251c13b05 | Use dict instead of attidict as return result. | python-omega-client/omega_client/__init__.py | python-omega-client/omega_client/__init__.py | # -*- coding: utf-8 -*-
from beanbag.v2 import BeanBag, GET, POST, DELETE, BeanBagException
import requests
BASE_URL = '/api/v3'
class OmegaException(Exception):
pass
def check_return_code(function):
def with_code_check(*args, **kwargs):
# raise exception when omega get code big than zero;
... | # -*- coding: utf-8 -*-
from beanbag.v2 import BeanBag, GET, POST, DELETE, BeanBagException
import requests
BASE_URL = '/api/v3'
class OmegaException(Exception):
pass
def check_return_code(function):
def with_code_check(*args, **kwargs):
# raise exception when omega get code big than zero;
... | Python | 0 |
c0eec726986bdfad2f1830e9f8cb1ab1b5b7cc3c | Update pipeline.py | intelmq/lib/pipeline.py | intelmq/lib/pipeline.py | import redis
import time
class Pipeline():
def __init__(self, source_queue, destination_queues, host="127.0.0.1", port="6379", db=2):
self.host = host
self.port = port
self.db = db
if destination_queues and type(destination_queues) is not list:
destination_queue... | import pika
class Pipeline():
def __init__(self, source_queue, destination_queues, host=None, port=None):
self.source_queue = source_queue
self.destination_queues = destination_queues
# Documentation: http://pika.readthedocs.org/en/latest/modules/parameters.html
self.pika_... | Python | 0.000003 |
44e3643f9ddacce293feac2a2e9ca09799b7ff68 | Use options.rootdir instead of __file__ | citools/pavement.py | citools/pavement.py | import os
import sys
from os.path import join, abspath, dirname
from paver.easy import *
@task
@consume_args
@needs('unit', 'integrate')
def test():
""" Run whole testsuite """
def djangonize_test_environment(test_project_module):
sys.path.insert(0, options.rootdir)
sys.path.insert(0, join(options.root... | import os
import sys
from os.path import join, abspath, dirname
from paver.easy import *
@task
@consume_args
@needs('unit', 'integrate')
def test():
""" Run whole testsuite """
def djangonize_test_environment(test_project_module):
sys.path.insert(0, abspath(join(dirname(__file__))))
sys.path.insert(0, ... | Python | 0 |
8ff877fe82ced94582ca48cb066a9363995b09cd | Fix flake8 | recipes/metaphlan2/download_metaphlan2_db.py | recipes/metaphlan2/download_metaphlan2_db.py | #!/usr/bin/env python3
import argparse
import tarfile
import os
import urllib2
import shutil
METAPHLAN2_URL = 'https://bitbucket.org/biobakery/metaphlan2/get/2.6.0.tar.gz'
def download_file(url):
"""Download a file from a URL
Fetches a file from the specified URL.
Returns the name that the file is save... | #!/usr/bin/env python3
import argparse
import tarfile
import os
import urllib2
import shutil
METAPHLAN2_URL = 'https://bitbucket.org/biobakery/metaphlan2/get/2.6.0.tar.gz'
def download_file(url, target=None, wd=None):
"""Download a file from a URL
Fetches a file from the specified URL.
If 'target' is s... | Python | 0 |
26c24e6c0015e7f8730f3ce22fbdc63e46ae9f79 | Add help command to /setcommands | src/handler.py | src/handler.py | import telegram
import time
import pytesseract
import config
import os
try:
import Image
except ImportError:
from PIL import Image
help_text = """
Send me an image and I will run Google's Tesseract OCR tool on it and send you back the results.
You can change the language I use on Tesseract by sending me `/lang <co... | import telegram
import time
import pytesseract
import config
import os
try:
import Image
except ImportError:
from PIL import Image
help_text = """
Send me an image and I will run Google's Tesseract OCR tool on it and send you back the results.
You can change the language I use on Tesseract by sending me `/lang <co... | Python | 0.000002 |
c9b84efef4d472f6190ffbfea38a7b2eaf864257 | Add alias var for all commands | gbot/commands.py | gbot/commands.py | #!/usr/bin/env python3
# Goshubot IRC Bot
# written by Daniel Oaks <daniel@danieloaks.net>
# licensed under the BSD 2-clause license
from .users import USER_LEVEL_NOPRIVS, USER_LEVEL_ADMIN
class BaseCommand:
"""Provides for a generic command backend."""
standard_command_privs = USER_LEVEL_NOPRIVS
def __i... | #!/usr/bin/env python3
# Goshubot IRC Bot
# written by Daniel Oaks <daniel@danieloaks.net>
# licensed under the BSD 2-clause license
from .users import USER_LEVEL_NOPRIVS, USER_LEVEL_ADMIN
class BaseCommand:
"""Provides for a generic command backend."""
standard_command_privs = USER_LEVEL_NOPRIVS
def __i... | Python | 0.000001 |
d6432e9718a160bda79afe473adc9630d36a9ce5 | add v2.4.40 (#25065) | var/spack/repos/builtin/packages/bedops/package.py | var/spack/repos/builtin/packages/bedops/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Bedops(MakefilePackage):
"""BEDOPS is an open-source command-line toolkit that performs hi... | # 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 Bedops(MakefilePackage):
"""BEDOPS is an open-source command-line toolkit that performs hi... | Python | 0.000001 |
7b486fd84dfca220b1415fa2956a8c4bc32dc470 | add version 0.7 | var/spack/repos/builtin/packages/py-ics/package.py | var/spack/repos/builtin/packages/py-ics/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 *
class PyIcs(PythonPackage):
"""Ics.py : iCalendar for Humans
Ics.py is a pythonic and easy ... | # 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 *
class PyIcs(PythonPackage):
"""Ics.py : iCalendar for Humans
Ics.py is a pythonic and easy ... | Python | 0.000001 |
45e4ab12fbca553118ed36420e8267e9f94270a7 | use relative import path | twitter_korean/util/KoreanDictionaryProvider.py | twitter_korean/util/KoreanDictionaryProvider.py | # -*- encoding: utf-8 -*-
'''
*
* Twitter Korean Text - Scala library to process Korean text
*
* Copyright 2014 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* h... | # -*- encoding: utf-8 -*-
'''
*
* Twitter Korean Text - Scala library to process Korean text
*
* Copyright 2014 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* h... | Python | 0 |
4c5c7aa74b2dec2cbfb6b6bd7e24d5922e92c112 | Document 'repo status' output | subcmds/status.py | subcmds/status.py | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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 la... | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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 la... | Python | 0.000001 |
027632cbac1cfa42e2f66b53ae6c3f22bcce630e | Fix cdd package definition, dotted is a property (#2054) | var/spack/repos/builtin/packages/cdd/package.py | var/spack/repos/builtin/packages/cdd/package.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | Python | 0.007823 |
4bdf46a33bc86267247ea41824214454607f0084 | Simplify voltage display code | pcf8591read.py | pcf8591read.py | #! /usr/bin/env python3
import sys, time
from time import sleep
from quick2wire.parts.pcf8591 import *
from quick2wire.i2c import I2CMaster
#from vis import volt_plot
from writefile import *
from tkinter import *
class adc_reader():
def __init__(self):
self.address = int(sys.argv[1]) if len(sys.argv) > ... | #! /usr/bin/env python3
import sys, time
from time import sleep
from quick2wire.parts.pcf8591 import *
from quick2wire.i2c import I2CMaster
#from vis import volt_plot
from writefile import *
from tkinter import *
class adc_reader():
def __init__(self):
self.address = int(sys.argv[1]) if len(sys.argv) > ... | Python | 0.001085 |
59d7854b8988c6525df8eb1ef7f2cde58c63eb0a | add build_directory, remove old hack (#10112) | var/spack/repos/builtin/packages/clp/package.py | var/spack/repos/builtin/packages/clp/package.py | # Copyright 2013-2018 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 Clp(AutotoolsPackage):
"""Clp (Coin-or linear programming) is an open-source
linear ... | # Copyright 2013-2018 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 Clp(AutotoolsPackage):
"""Clp (Coin-or linear programming) is an open-source
linear ... | Python | 0 |
73ef49c54b1e928462a957aee196b70de0ec5d85 | revert data model for tests | tests/canonical_test.py | tests/canonical_test.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from itertools import combinations
import csv
import exampleIO
import dedupe
import os
import time
import optparse
import logging
optp = optparse.OptionParser()
optp.add_option('-v', '--verbose', dest='verbose', action='count',
help='Increase verbosity (specify... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from itertools import combinations
import csv
import exampleIO
import dedupe
import os
import time
import optparse
import logging
optp = optparse.OptionParser()
optp.add_option('-v', '--verbose', dest='verbose', action='count',
help='Increase verbosity (specify... | Python | 0 |
090ca0e14621d287e9f5d1d301589d99d95cd224 | Remove unused function | src/dynmen/cmd/__init__.py | src/dynmen/cmd/__init__.py | # -*- coding: utf-8 -*-
from collections import namedtuple as _namedtuple
ProcStatus = _namedtuple('ProcStatus', 'stdout stderr returncode')
| # -*- coding: utf-8 -*-
from collections import namedtuple as _namedtuple
ProcStatus = _namedtuple('ProcStatus', 'stdout stderr returncode')
def _to_bytes(obj, entry_sep=b''):
if isinstance(obj, bytes):
return obj
return entry_sep.join(obj)
| Python | 0.000004 |
5fbb4ff5d3427c8f4050fc5b75d4a6a2c15351c6 | Set pygments style to monokai. | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Donne Martin'
SITENAME = 'Donne Martin'
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 ... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Donne Martin'
SITENAME = 'Donne Martin'
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 ... | Python | 0 |
cde48aff408c0d2c413e4316a1ef5c808d2f444c | add DISPLAY_NAVBAR to configuration | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'jchen'
SITENAME = u'BURRITO 4 LYFE'
SITEURL = ''
TIMEZONE = 'ETC/UTC'
DEFAULT_LANG = u'en'
CSS_FILE = 'style.css'
# theme stuff
THEME = '/Users/jchen/git/pelican/burrito'
# plugins
PLUGIN_PATH = '/Users/jchen/git/pe... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'jchen'
SITENAME = u'BURRITO 4 LYFE'
SITEURL = ''
TIMEZONE = 'ETC/UTC'
DEFAULT_LANG = u'en'
CSS_FILE = 'style.css'
# theme stuff
THEME = '/Users/jchen/git/pelican/burrito'
# plugins
PLUGIN_PATH = '/Users/jchen/git/pe... | Python | 0 |
a6ea16ded53bb688113012114a25b7d75e6460c0 | Fix PVM dependencies (#20951) | var/spack/repos/builtin/packages/pvm/package.py | var/spack/repos/builtin/packages/pvm/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import subprocess
class Pvm(MakefilePackage):
"""PVM (Parallel Virtual Machine) is a software pa... | # 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 *
import subprocess
class Pvm(MakefilePackage):
"""PVM (Parallel Virtual Machine) is a software pa... | Python | 0 |
0ee55bd73369c69638a401f4beef551a79bc820c | remove unneeded conf options | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'jchen'
SITENAME = u'BURRITO 4 LYFE'
SITEURL = ''
TIMEZONE = 'ETC/UTC'
DEFAULT_LANG = u'en'
CSS_FILE = 'style.css'
# theme stuff
THEME = '/Users/jchen/git/pelican/burrito'
# plugins
PLUGIN_PATH = '/Users/jchen/git/pe... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'jchen'
SITENAME = u'BURRITO 4 LYFE'
SITEURL = ''
TIMEZONE = 'ETC/UTC'
DEFAULT_LANG = u'en'
CSS_FILE = 'style.css'
# theme stuff
THEME = '/Users/jchen/git/pelican/burrito'
# plugins
PLUGIN_PATH = '/Users/jchen/git/pe... | Python | 0.000025 |
0f671516ed129d4b51fac2eec88272d6ed56b314 | Make sure excluded file extension case does not error out | mopidy/backends/local/commands.py | mopidy/backends/local/commands.py | from __future__ import unicode_literals
import logging
import os
import time
from mopidy import commands, exceptions
from mopidy.audio import scan
from mopidy.utils import path
from . import translator
logger = logging.getLogger('mopidy.backends.local.commands')
class LocalCommand(commands.Command):
def __ini... | from __future__ import unicode_literals
import logging
import os
import time
from mopidy import commands, exceptions
from mopidy.audio import scan
from mopidy.utils import path
from . import translator
logger = logging.getLogger('mopidy.backends.local.commands')
class LocalCommand(commands.Command):
def __ini... | Python | 0.000001 |
1a44050dffb37a110346cf0809fc7e92234939e9 | raise an error when somebody sets hold on a show | mpf/config_players/show_player.py | mpf/config_players/show_player.py | from copy import deepcopy
from mpf.core.config_player import ConfigPlayer
class ShowPlayer(ConfigPlayer):
config_file_section = 'show_player'
show_section = 'shows'
device_collection = None
def play(self, settings, key=None, priority=0, **kwargs):
# todo should show_tokens be part of setting... | from copy import deepcopy
from mpf.core.config_player import ConfigPlayer
class ShowPlayer(ConfigPlayer):
config_file_section = 'show_player'
show_section = 'shows'
device_collection = None
def play(self, settings, key=None, priority=0, **kwargs):
# todo should show_tokens be part of setting... | Python | 0 |
41dea616b22379fa2b7c1d00e21fe0288dc61622 | Fix whitespace incoherence, causing pylint errors. | codereview/middleware.py | codereview/middleware.py | # Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0.999987 |
5dc4641a40ff25b439541f6c3c02639a53346985 | Fix name of 'Betty' comic | comics/crawlers/betty.py | comics/crawlers/betty.py | from comics.crawler.base import BaseComicsComComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Betty'
language = 'en'
url = 'http://comics.com/betty/'
start_date = '1991-01-01'
history_capable_date = '2008-10-13'
schedule = 'Mo,Tu,We,Th,Fr,Sa,Su'... | from comics.crawler.base import BaseComicsComComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Get Fuzzy'
language = 'en'
url = 'http://comics.com/betty/'
start_date = '1991-01-01'
history_capable_date = '2008-10-13'
schedule = 'Mo,Tu,We,Th,Fr,Sa... | Python | 0.999991 |
4180c1aa0314ee86356f99a7f209459189fb4a5d | Correct dicts comparison | jet/tests/test_utils.py | jet/tests/test_utils.py | import json
from django.test import TestCase
from jet.tests.models import TestModel
from jet.utils import JsonResponse, get_model_instance_label
class UtilsTestCase(TestCase):
def test_json_response(self):
response = JsonResponse({'str': 'string', 'int': 1})
response_dict = json.loads(response.con... | from django.test import TestCase
from jet.tests.models import TestModel
from jet.utils import JsonResponse, get_model_instance_label
class UtilsTestCase(TestCase):
def test_json_response(self):
response = JsonResponse({'str': 'string', 'int': 1})
self.assertEqual(response.content, '{"int": 1, "str... | Python | 0.000028 |
73866e1ea0066fe45fbbf8a654b438b554d18a26 | update hedwig version | hedwig/__init__.py | hedwig/__init__.py | """
(@,@)
_ _
/\ /\___ __| |_ _(_) __ _
/ /_/ / _ \/ _` \ \ /\ / / |/ _` |
/ __ / __/ (_| |\ V V /| | (_| |
\/ /_/ \___|\__,_| \_/\_/ |_|\__, |
|___/
"""
__title__ = 'Hedwig Python'
__version__ = '0.1.6'
__author__ = 'Piyush'
# Version synonym
VERSIO... | """
(@,@)
_ _
/\ /\___ __| |_ _(_) __ _
/ /_/ / _ \/ _` \ \ /\ / / |/ _` |
/ __ / __/ (_| |\ V V /| | (_| |
\/ /_/ \___|\__,_| \_/\_/ |_|\__, |
|___/
"""
__title__ = 'Hedwig Python'
__version__ = '0.1.5'
__author__ = 'Piyush'
# Version synonym
VERSIO... | Python | 0 |
c46dae64a8a257e3bd3b37aa1abd588de54584bf | Add missing self argument to handle method. | zerver/management/commands/fetch_tor_exit_nodes.py | zerver/management/commands/fetch_tor_exit_nodes.py | import os
from argparse import ArgumentParser
from typing import Any, Set
import orjson
from django.conf import settings
from requests.packages.urllib3.util.retry import Retry
from zerver.lib.management import ZulipBaseCommand
from zerver.lib.outgoing_http import OutgoingSession
class TorDataSession(OutgoingSession... | import os
from argparse import ArgumentParser
from typing import Any, Set
import orjson
from django.conf import settings
from requests.packages.urllib3.util.retry import Retry
from zerver.lib.management import ZulipBaseCommand
from zerver.lib.outgoing_http import OutgoingSession
class TorDataSession(OutgoingSession... | Python | 0 |
b9eb6bcd93eea3e8d0804b83197a6ada30b8a778 | Remove unecessary code path | lib/filters/__init__.py | lib/filters/__init__.py | from decimal import Decimal, InvalidOperation, ROUND_HALF_UP
import locale
from re import match, sub
NO_DECIMAL_PLACE = Decimal('1')
ONE_DECIMAL_PLACE = Decimal('0.1')
TWO_DECIMAL_PLACES = Decimal('0.01')
locale.setlocale(locale.LC_ALL, 'en_GB.utf-8')
path_prefix = '/'
def as_number(num):
if num:
ju... | from decimal import Decimal, InvalidOperation, ROUND_HALF_UP
import locale
from re import match, sub
NO_DECIMAL_PLACE = Decimal('1')
ONE_DECIMAL_PLACE = Decimal('0.1')
TWO_DECIMAL_PLACES = Decimal('0.01')
locale.setlocale(locale.LC_ALL, 'en_GB.utf-8')
path_prefix = '/'
def as_number(num):
if num:
ju... | Python | 0.0005 |
cb94f0c2c6445981933350927d7a2bb78439f98f | remove invalid comment | Contents/Libraries/Shared/subzero/history_storage.py | Contents/Libraries/Shared/subzero/history_storage.py | # coding=utf-8
import datetime
import logging
import traceback
import types
from constants import mode_map
logger = logging.getLogger(__name__)
class SubtitleHistoryItem(object):
item_title = None
section_title = None
rating_key = None
provider_name = None
lang_name = None
score = None
... | # coding=utf-8
import datetime
import logging
import traceback
import types
from constants import mode_map
logger = logging.getLogger(__name__)
class SubtitleHistoryItem(object):
item_title = None
section_title = None
rating_key = None
provider_name = None
lang_name = None
score = None
... | Python | 0 |
d8dda85c786c38ad2fbb2e40d44567b917431cb8 | Update zero_one_normalization.py | Data_collection_processing/zero_one_normalization.py | Data_collection_processing/zero_one_normalization.py | '''
Linearly scale the expression range of one gene to be between 0 and 1.
If a reference dataset is provided, then the scaling of one gene in the
target dataset in done using the minimun and range of that gene in the
reference dataset.
'''
import sys
import argparse
sys.path.insert(0, 'Data_collection_processing/')
f... | '''
Linearly scale the expression range of one gene to be between 0 and 1.
If a reference dataset is provided, then the scaling of one gene in the
target dataset in done using the minimun and range of that gene in the
reference dataset.
'''
import sys
import argparse
sys.path.insert(0, 'Data_collection_processing/')
f... | Python | 0.000004 |
3b212f6ea6ba1ed355250b587f3d1c1cc462c7ed | send ctrl+c signal | tests/test_apiserver.py | tests/test_apiserver.py | # -*- coding: utf-8 -*-
"""
tests.apiserver
~~~~~~~~~~~~
Tests cobra.api
:author: 40huo <git@40huo.cn>
:homepage: https://github.com/wufeifei/cobra
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2017 Feei. All rights reserved
"""
import requests
import json
... | # -*- coding: utf-8 -*-
"""
tests.apiserver
~~~~~~~~~~~~
Tests cobra.api
:author: 40huo <git@40huo.cn>
:homepage: https://github.com/wufeifei/cobra
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2017 Feei. All rights reserved
"""
import requests
import json
... | Python | 0.000006 |
759e50abb963fd854989cb79592f7cf6f9d0bc13 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/41b9d692dc31b2b95c47e8c56cb9cd4872adc511. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "41b9d692dc31b2b95c47e8c56cb9cd4872adc511"
TFRT_SHA256 = "b7ba9c34b81e53428a745453dc0ae0108a9510c6a7bd25... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "cbc81d9ef4bcea56e841c1b8a84d07db04a926bf"
TFRT_SHA256 = "804f98fab72aa814701e9bc2b56435fce5b0f64af01ccf... | Python | 0.000002 |
b17700b9878a3999c2ad64f622d2ca8566043b2e | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/fb895960cc796437c6d516cc19027c94f2319b4d. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "fb895960cc796437c6d516cc19027c94f2319b4d"
TFRT_SHA256 = "9c5c10fa7b516554c8a6725e13c3d959609ad5d8fab2c6... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "1b5317be3621f2f9b6415696edb912ef75f54187"
TFRT_SHA256 = "7f430ad049f7270b7dad98787f04d1259b8b2cd1a068c5... | Python | 0.000001 |
a3afc651ba0efeef17293fa1e688a901453e1f05 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/379d33d44c64d5bd83eb4ca4d7a0928eb79b5f54. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "379d33d44c64d5bd83eb4ca4d7a0928eb79b5f54"
TFRT_SHA256 = "7be6d4bc2d8ac5f2420249f2c2df645ad945ba5f51d2ef... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "ae8fb48248557568109089e96d1aaab760dada21"
TFRT_SHA256 = "fd64d9151ce25cda33a12ad1addbf52e853d2d13a74058... | Python | 0.000002 |
e6d4c2bb4ac83a5f573a2a6fc5ef77356cd70ef3 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/78c6401faaebc33df9cc2c78f21e5c235d1670f4. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "78c6401faaebc33df9cc2c78f21e5c235d1670f4"
TFRT_SHA256 = "6a17b2490d44b392ece0015bbc4d... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "6e9c9d0a5c1bea5568c7fd837da88da67e71e3c3"
TFRT_SHA256 = "ec37cf4d732794f4a4032e5f25e9... | Python | 0.000001 |
5c823e1197f73701811cf449337c0c8bb970bc5c | Improve readability of tests | tests/test_datadicts.py | tests/test_datadicts.py | """Tests for autogenerated data dictionaries.
A data dictionary contains the following:
* Variable Enum: An enum that contains all variables of the data dict as its members.
* Variable Value Enum: An enum containing all values of one variable. Only exists for variables
with a closed set of valu... | import pytest
from pytus2000 import diary, diaryepisode, individual, household, weightdiary, worksheet
@pytest.fixture(params=[
diary,
diaryepisode,
individual,
household,
weightdiary,
worksheet
])
def datadict_module(request):
return request.param
@pytest.fixture(params=[
diary,
... | Python | 0.000025 |
89844b7615e704410a9fa0dc6ae4cfe61ab8fefe | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/24d3f64ad78415f008af4bdde57079e331545dbf. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "24d3f64ad78415f008af4bdde57079e331545dbf"
TFRT_SHA256 = "00afec2e99d50a817a9a3bdea6f7... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "af2213b972c9f736109d4249089c9398c09a8add"
TFRT_SHA256 = "ce588cd5aa843316c6b759315cbc... | Python | 0 |
1ef4cc5ca233eabc8b7002b70b865aa0ed9ff409 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/f09caec27d101ea44157f209bcfdc62ab62da4e4. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "f09caec27d101ea44157f209bcfdc62ab62da4e4"
TFRT_SHA256 = "cda2b7652b72ecdd55f1a33a6c3126f403f3e0ac007014... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "ed84e5f6b49b52f7801e6030fb5ab26f41f2af28"
TFRT_SHA256 = "080d122bb57e5b5b51a8c8f3b1916d2f7ea768e09d9a29... | Python | 0.000003 |
d1bb3815f694da6bf867d7b171f02554f874a737 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/553df8c12e9ba5930b9b8065f1d012ea07c6044c. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "553df8c12e9ba5930b9b8065f1d012ea07c6044c"
TFRT_SHA256 = "477d0374b044c60cd018fdb17e7c... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "2db6a815bd262da6d96d2398c4049230548d8c33"
TFRT_SHA256 = "dcc0b3bc54740cabb370d0d773d8... | Python | 0 |
c4a4776a78b9f59bc52e799ffe28d17d0340278f | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/0af176c97ea8e57671df14444c4c759211c70b1a. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "0af176c97ea8e57671df14444c4c759211c70b1a"
TFRT_SHA256 = "be0251342fe9408261e10638787b... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "2f6de37d68a4c69e2ff9eec3cebbf1369e496940"
TFRT_SHA256 = "cf180c95c54d1132366996482a5c... | Python | 0.000002 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.