repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
cedar101/quepy-ko | quepy/parsing.py | # coding: utf-8
# Copyright (c) 2012, Machinalis S.R.L.
# This file is part of quepy and is distributed under the Modified BSD License.
# You should have received a copy of license in the LICENSE file.
#
# Authors: Rafael Carrascosa <rcarrascosa@machinalis.com>
# Gonzalo Garcia Berrotaran <ggarcia@machinalis.... |
LubyRuffy/berlin-school-data | importer/setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='berlin-school-data-importer',
version='0.0.0',
description='Berlin school data importer',
long_description='Berlin school data importer',
author... |
hellhovnd/dentexchange | dentexchange/apps/libs/tests/auth/test_model_email_backend.py | # -*- coding:utf-8 -*-
import unittest
import mock
from django.core.exceptions import ObjectDoesNotExist
from ...auth.backends import ModelEmailBackend
class ModelEmailBackendTestCase(unittest.TestCase):
def setUp(self):
self.username = 'username'
self.password = 'password'
@mock.patch('lib... |
puttarajubr/commcare-hq | corehq/ex-submodules/casexml/apps/case/tests/test_dbcache.py | import uuid
from django.test import TestCase, SimpleTestCase
from casexml.apps.case.exceptions import IllegalCaseId
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.models import CommCareCase
from casexml.apps.case.util import post_case_blocks
from casexml.apps.case.xform import CaseDbCache
from case... |
edgewood/borg | src/borg/constants.py | # this set must be kept complete, otherwise the RobustUnpacker might malfunction:
ITEM_KEYS = frozenset(['path', 'source', 'rdev', 'chunks', 'chunks_healthy', 'hardlink_master',
'mode', 'user', 'group', 'uid', 'gid', 'mtime', 'atime', 'ctime', 'size',
'xattrs', 'bsdflags', ... |
StuartLittlefair/astropy | astropy/io/ascii/fixedwidth.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
fixedwidth.py:
Read or write a table with fixed width columns.
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
from . import core
from ... |
sgraham/nope | third_party/WebKit/Source/devtools/scripts/compile_frontend.py | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. 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 ... |
roadhead/satchmo | satchmo/shipping/modules/per/config.py | from django.utils.translation import ugettext_lazy as _
from satchmo.configuration import *
SHIP_MODULES = config_get('SHIPPING', 'MODULES')
# No need to add the choice, since it is in by default
# SHIP_MODULES.add_choice(('satchmo.shipping.modules.per', _('Per piece')))
SHIPPING_GROUP = config_get_group('SHIPPING')... |
fcitx/mozc | src/build_tools/test_tools/test_launcher.py | # -*- coding: utf-8 -*-
# Copyright 2010-2021, Google Inc.
# 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... |
youtube/cobalt | third_party/blink/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py | # Copyright (C) 2012 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... |
chippey/gaffer | python/GafferSceneTest/CustomOptionsTest.py | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... |
TwigWorld/django-configurations | configurations/base.py | from django.conf import global_settings
from django.core.exceptions import ImproperlyConfigured
from .utils import uppercase_attributes
__all__ = ['Settings']
install_failure = ("django-configurations settings importer wasn't "
"correctly installed. Please use one of the starter "
... |
SimonSapin/tinycss | tinycss/tests/test_fonts3.py | # coding: utf-8
"""
Tests for the Fonts 3 parser
----------------------------
:copyright: (c) 2016 by Kozea.
:license: BSD, see LICENSE for more details.
"""
from __future__ import unicode_literals
import pytest
from tinycss.fonts3 import CSSFonts3Parser
from . import assert_errors
from .test_token... |
jacobparra/redditclone | config/urls.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
urlpat... |
lucuma/allspeak | tests/test_reader.py | from os.path import join, dirname, abspath
from ..allspeak import Reader, parse_yaml
LOCALES_TEST = abspath(join(dirname(__file__), u'locales'))
LOCALES_TEST2 = LOCALES_TEST + u'2'
def test_reader_repr():
reader = Reader()
assert repr(reader) == 'Reader()'
def test_default_loaders():
reader = Reader(... |
azonenberg/yosys | techlibs/xilinx/brams_init.py | #!/usr/bin/env python3
with open("techlibs/xilinx/brams_init_18.vh", "w") as f:
for i in range(8):
init_snippets = ["INIT[%3d*9+8]" % (k+256*i,) for k in range(255, -1, -1)]
for k in range(4, 256, 4):
init_snippets[k] = "\n " + init_snippets[k]
print(".INITP_%02X({%s})... |
emmagordon/Axelrod | axelrod/tests/unit/test_memoryone.py | """Test for the memoryone strategies."""
import axelrod
from axelrod import Game
from .test_player import TestPlayer, test_four_vector
C, D = 'C', 'D'
class TestWinStayLoseShift(TestPlayer):
name = "Win-Stay Lose-Shift"
player = axelrod.WinStayLoseShift
expected_classifier = {
'memory_depth': 1... |
softEcon/course | lectures/economic_models/generalized_roy/private_package/grmpy/tools/clsMeta.py | """ Meta class for the grmpy package
"""
# standard library
import pickle as pkl
import copy
class MetaCls(object):
def __init__(self):
self.is_locked = False
''' Meta methods.
'''
def get_status(self):
""" Get status of class instance.
"""
return self.is_locked
... |
spacy-io/spaCy | spacy/tests/lang/en/test_exceptions.py | import pytest
def test_en_tokenizer_handles_basic_contraction(en_tokenizer):
text = "don't giggle"
tokens = en_tokenizer(text)
assert len(tokens) == 3
assert tokens[1].text == "n't"
text = "i said don't!"
tokens = en_tokenizer(text)
assert len(tokens) == 5
assert tokens[4].text == "!"
... |
neolynx/aptly | system/t05_snapshot/show.py | from lib import BaseTest
import re
class ShowSnapshot1Test(BaseTest):
"""
show snapshot: from mirror
"""
fixtureDB = True
fixtureCmds = ["aptly snapshot create snap1 from mirror wheezy-non-free"]
runCmd = "aptly snapshot show --with-packages snap1"
def outputMatchPrepare(_, s):
re... |
rnixx/kivy | kivy/animation.py | '''
Animation
=========
:class:`Animation` and :class:`AnimationTransition` are used to animate
:class:`~kivy.uix.widget.Widget` properties. You must specify at least a
property name and target value. To use an Animation, follow these steps:
* Setup an Animation object
* Use the Animation object on a Widget
... |
h2o/h2o | deps/quicly/misc/quictrace-adapter.py | #!/usr/bin/env python
from __future__ import print_function
import sys
import json
import base64
import time
import os
from collections import OrderedDict
from pprint import pprint
def usage():
print(r"""
Usage:
quictrace-adapter.py inTrace.jsonl outTrace.json cid
quictrace-adatper.py inTrace.jsonl outTrac... |
dcroc16/skunk_works | google_appengine/lib/django-1.4/docs/conf.py | # -*- coding: utf-8 -*-
#
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleab... |
tmlee/pyrollbar | rollbar/examples/flask/app.py | import logging
from flask import Flask
import rollbar
from rollbar.logger import RollbarHandler
ACCESS_TOKEN = 'ACCESS_TOKEN'
ENVIRONMENT = 'development'
rollbar.init(ACCESS_TOKEN, ENVIRONMENT)
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# report WARNING and above to Rollbar
rollbar_handle... |
benoitc/couchdbkit | examples/djangoapp/run.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008,2009 Benoit Chesneau <benoitc@e-engura.org>
#
# 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.or... |
manahl/mdf | mdf/tests/test_pickle.py | from mdf import (
MDFContext,
varnode,
evalnode,
queuenode,
shift,
now
)
import numpy as np
import pandas as pa
import unittest
import logging
import tempfile
import shutil
import os
import random
import pickle
A = varnode()
_b_num_calls = 0
@evalnode
def B():
global _b_num_calls
_b_n... |
SUSE/azure-sdk-for-python | azure-monitor/azure/monitor/models/usage_metric.py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
peastman/deepchem | deepchem/feat/tests/test_mol_graphs.py | """
Tests for Molecular Graph data structures.
"""
import unittest
import numpy as np
from deepchem.feat.mol_graphs import ConvMol
class TestMolGraphs(unittest.TestCase):
"""
Test mol graphs.
"""
def test_construct_conv_mol(self):
"""Tests that ConvMols can be constructed without crash."""
# Artifici... |
SUSE/azure-sdk-for-python | azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints.py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
alexgleith/Quantum-GIS | python/plugins/sextante/gdal/OgrAlgorithm.py | # -*- coding: utf-8 -*-
"""
***************************************************************************
OgrAlgorithm.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
************************... |
gautamMalu/rootfs_xen_arndale | usr/lib/python3.4/base64.py | #! /usr/bin/python3.4
"""Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
import re
import struct
... |
gilamsalem/pynfs | nfs4.0/lib/ops_gen.py | #!/usr/bin/env python
# ops_gen.py - generate nfs4_ops.py file from nfs4_const and nfs4_type
#
# Written by Fred Isaman <iisaman@citi.umich.edu>
# Copyright (C) 2004 University of Michigan, Center for
# Information Technology Integration
#
from nfs4_const import nfs_opnum4
import nfs4_type as nfs4_... |
Ziqi-Li/bknqgis | numpy/numpy/core/tests/test_print.py | from __future__ import division, absolute_import, print_function
import sys
import locale
import nose
import numpy as np
from numpy.testing import (
run_module_suite, assert_, assert_equal, SkipTest
)
if sys.version_info[0] >= 3:
from io import StringIO
else:
from StringIO import StringIO
_REF = {np.in... |
spiceqa/virt-test | qemu/tests/cpuid.py | """
Group of cpuid tests for X86 CPU
"""
import re
import sys
import os
import string
from autotest.client.shared import error, utils
from autotest.client.shared import test as test_module
from virttest import utils_misc, env_process, virt_vm
import logging
logger = logging.getLogger(__name__)
dbg = logger.debug
info ... |
chujieyang/ice | php/allTests.py | #!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... |
keshashah/GCompris | src/penalty-activity/penalty.py | # gcompris - penalty
#
# Copyright (C) 2008 Bruno Coudoin
#
# This program 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 option) any later version.
#
#... |
FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/test/test_tuple.py | from test import support, seq_tests
import unittest
import gc
import pickle
class TupleTest(seq_tests.CommonTest):
type2test = tuple
def test_getitem_error(self):
msg = "tuple indices must be integers or slices"
with self.assertRaisesRegex(TypeError, msg):
()['a']
def test_co... |
robotpilot/crazyflie-clients-python | lib/cflib/crazyflie/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... |
pmghalvorsen/gramps_branch | gramps/gen/plug/docbackend/__init__.py | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 B. Malengier
#
# This program 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 2 of the License, or
# (at your option) any... |
djo938/supershell | pyshell/register/result/command.py | #!/usr/bin/env python -t
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Jonathan Delvaux <pyshell@djoproject.net>
# This program 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... |
mhbu50/erpnext | erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe import _
def execute(filters=None):
columns = get_columns()
proj_details = get_project_details()
pr_item_map = get_purchased_items_cost()
se_item_map = get_issu... |
algobook/Algo_Ds_Notes | Counting_Sort/Counting_Sort.py | def counting_sort(input):
output = [0] * len(input)
max = input[0]
min = input[0]
for i in range(1, len(input)):
if input[i] > max:
max = input[i]
elif input[i] < min:
min = input[i]
k = max - min + 1
count_list = [0] * k
for i in range(0, len(inpu... |
SpaceKatt/CSPLN | apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/lib/python2.7/matplotlib/backends/backend_macosx.py | from __future__ import division
import os
import numpy
from matplotlib._pylab_helpers import Gcf
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, TimerBase
from matplotlib.backend_bases import ShowBase
from matplotlib.cbook import ... |
davisc/django-osgeo-importer | osgeo_importer/tests/handlers/geonode/test_publish_handler.py | from _collections import defaultdict
from django.test import TestCase
from mock import patch, Mock
from osgeo_importer.handlers.geonode import publish_handler
class TestGeoNodePublishHandler(TestCase):
@patch.object(publish_handler, 'Layer')
@patch('osgeo_importer.importers.OGRImport')
@patch.object(pu... |
rhyolight/NAB | nab/detectors/earthgecko_skyline/skyline_algorithms.py | """
All algorithms from the original skyline implementation are included below.
"""
import numpy as np
import scipy
from scipy.stats import t as scipy_stats_t
import statsmodels.api as sm
import traceback
def tail_avg(timeseries, debug, debug_path):
"""
This is a utility function used to calculate the averag... |
ncliam/serverpos | openerp/custom_modules/report_aeroo/ctt_languages/tr_TR/currencies/try.py | #!/usr/bin/python
# -*- coding: utf8 -*-
from openerp.addons.report_aeroo.ctt_objects import ctt_currency
class iso4217_try(ctt_currency):
def _init_currency(self):
self.language = u'tr_TR'
self.code = u'TRY'
self.fractions = 100
self.cur_singular = u' Lira'
# default plura... |
Shrhawk/edx-platform | common/test/acceptance/tests/lms/test_lms.py | # -*- coding: utf-8 -*-
"""
End-to-end tests for the LMS.
"""
from flaky import flaky
from textwrap import dedent
from unittest import skip
from nose.plugins.attrib import attr
from bok_choy.promise import EmptyPromise
from ..helpers import (
UniqueCourseTest,
EventsTestMixin,
load_data_str,
generate_... |
pepeportela/edx-platform | lms/djangoapps/certificates/views/xqueue.py | """
Views used by XQueue certificate generation.
"""
import json
import logging
from django.contrib.auth.models import User
from django.db import transaction
from django.http import Http404, HttpResponse, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http impor... |
osgcc/ryzom | ryzom/tools/build_gamedata/workspace/common/fonts/directories.py | #!/usr/bin/python
#
# \file directories.py
# \brief Directories configuration
# \date 2010-08-27 17:13GMT
# \author Jan Boon (Kaetemi)
# \date 2001-2005
# \author Nevrax
# Python port of game data build pipeline.
# Directories configuration.
#
# NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
# Copyright ... |
dvitme/odoo-addons | sale_contract_editable/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... |
AdamWill/blivet | blivet/dbus/device.py | #
# Copyright (C) 2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... |
ArcEye/MK-Qt5 | src/emc/usr_intf/stepconf/stepconf.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# This is stepconf, a graphical configuration editor for Machinekit
# Copyright 2007 Jeff Epler <jepler@unpythonic.net>
#
# stepconf 1.1 revamped by Chris Morley 2014
# replaced Gnome Druid as that is not available in future linux distributions
# and beca... |
TheTimmy/spack | var/spack/repos/builtin/packages/andi/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... |
rspavel/spack | var/spack/repos/builtin/packages/poppler-data/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 PopplerData(CMakePackage):
"""This package consists of encoding files for use with poppler... |
cloud9ers/gurumate | environment/lib/python2.7/site-packages/IPython/external/ssh/tunnel.py | """Basic ssh tunnel utilities, and convenience functions for tunneling
zeromq connections.
Authors
-------
* Min RK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full... |
rackerlabs/horizon | openstack_dashboard/dashboards/admin/roles/forms.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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.... |
mlperf/training_results_v0.7 | Google/benchmarks/transformer/implementations/transformer-research-TF-tpu-v4-16/google/trainer/base_runner.py | # Lint as: python2, python3
"""Base class for all jobs."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from REDACTED.tensorflow_models.mlperf.models.rough.transformer_lingvo.lingvo import base_runner as lingvo_base_runner
from REDACTED.tensorf... |
pybuilder/pybuilder | src/main/python/pybuilder/_vendor/importlib_resources/tests/test_read.py | import unittest
from ... import importlib_resources as resources
from . import data01
from . import util
from importlib import import_module
class CommonBinaryTests(util.CommonTests, unittest.TestCase):
def execute(self, package, path):
resources.files(package).joinpath(path).read_bytes()
class CommonT... |
ppwwyyxx/tensorflow | tensorflow/python/keras/utils/generic_utils.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
tylertian/Openstack | openstack F/keystone/keystone/contrib/s3/core.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
russellb/nova | nova/db/sqlalchemy/migrate_repo/versions/020_add_snapshot_id_to_volumes.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 MORITA Kazutaka.
# 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.or... |
twitter/heron | integration_test/src/python/integration_test/topology/fields_grouping/fields_grouping.py | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apach... |
richardliaw/ray | java/test/src/main/resources/test_cross_language_invocation.py | # This file is used by CrossLanguageInvocationTest.java to test cross-language
# invocation.
import ray
@ray.remote
def py_return_input(v):
return v
@ray.remote
def py_func_call_java_function():
try:
# None
r = ray.java_function("io.ray.test.CrossLanguageInvocationTest",
... |
dana-i2cat/felix | ofam/src/src/foam/sfa/rspecs/sfa_rspec_converter.py | #!/usr/bin/python
from foam.sfa.util.xrn import hrn_to_urn
from foam.sfa.rspecs.rspec import RSpec
from foam.sfa.rspecs.version_manager import VersionManager
class SfaRSpecConverter:
@staticmethod
def to_pg_rspec(rspec, content_type = None):
if not isinstance(rspec, RSpec):
sfa_rspec = RS... |
RealImpactAnalytics/airflow | airflow/operators/hive_to_samba_operator.py | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
tonyli71/designate | designate/tests/unit/test_objects/test_domain.py | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Author: Federico Ceratto <federico.ceratto@hp.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.or... |
jonparrott/google-cloud-python | logging/google/cloud/logging/resource.py | # Copyright 2017 Google LLC
#
# 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, s... |
isislab/CTFd | CTFd/utils/events/__init__.py | import json
from collections import defaultdict
from queue import Queue
from gevent import Timeout, spawn
from tenacity import retry, wait_exponential
from CTFd.cache import cache
from CTFd.utils import string_types
class ServerSentEvent(object):
def __init__(self, data, type=None, id=None):
self.data =... |
pschmitt/home-assistant | homeassistant/components/panel_custom/__init__.py | """Register a custom front end panel."""
import logging
import os
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.loader import bind_hass
_LOGGER = logging.getLogger(__name__)
DOMAIN = "panel_custom"
CONF_COMPONENT_NAME = "name"
CONF_SIDEBAR_TITLE = "sidebar_title"
C... |
GetAmbassador/django-cachalot | cachalot/settings.py | from django.conf import settings
class Settings(object):
CACHALOT_ENABLED = True
CACHALOT_CACHE = 'default'
CACHALOT_CACHE_RANDOM = False
CACHALOT_INVALIDATE_RAW = True
CACHALOT_UNCACHABLE_TABLES = frozenset(('django_migrations',))
CACHALOT_QUERY_KEYGEN = 'cachalot.utils.get_query_cache_key'
... |
dennisobrien/bokeh | bokeh/sampledata/us_holidays.py | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... |
oguzy/mycli | mycli/packages/completion_engine.py | from __future__ import print_function
import sys
import sqlparse
from sqlparse.sql import Comparison, Identifier, Where
from .parseutils import last_word, extract_tables, find_prev_keyword
from .special import parse_special_command
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY3:
string_types... |
htygithub/bokeh | examples/plotting/server/selection_histogram.py | # The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
import numpy as np
from bokeh.models import BoxSelectTool, LassoSelectTool, Paragraph
from bokeh.plotting import (
curdoc, figure, output_server, show, hplot, vplot
)
from bokeh.client import push_session
# create three normal... |
tomkralidis/pycsw | pycsw/ogc/api/util.py | # -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Angelos Tzotsos <tzotsos@gmail.com>
#
# Copyright (c) 2021 Tom Kralidis
# Copyright (c) 2021 Angelos Tzotsos
#
# Permission is hereby granted, free of charge, to any p... |
t0tec/dotfiles | vim/vim.symlink/plugin/snippets/ultisnips.py | import vim
import re
try:
from UltiSnips import UltiSnips_Manager
except:
from UltiSnips import SnippetManager
UltiSnips_Manager = SnippetManager(
vim.eval('g:UltiSnipsExpandTrigger'),
vim.eval('g:UltiSnipsJumpForwardTrigger'),
vim.eval('g:UltiSnipsJumpBackwardTrigger'))
def snippetsInit():
... |
teuben/masc | www/js/lib/js9-3.5/tests/threeways/threeways.py | import pyjs9
import time
import sys
timeout = 2
loadTimeout = 1
maxIter = 10
id = "threeJS9"
if len(sys.argv) > 1:
id = sys.argv[1]
def waitLoad():
iter = 0
done = False
while done == False:
x = j.GetLoadStatus()
if x == "complete":
done = True
else:
it... |
denny820909/builder | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/changes/hgbuildbot.py | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
cwyark/micropython | tests/basics/class_new.py | try:
# If we don't expose object.__new__ (small ports), there's
# nothing to test.
object.__new__
except AttributeError:
import sys
print("SKIP")
sys.exit()
class A:
def __new__(cls):
print("A.__new__")
return super(cls, A).__new__(cls)
def __init__(self):
pass
... |
ascott1/regulations-site | regulations/tests/layers_definitions_tests.py | from unittest import TestCase
from regulations.generator.layers.definitions import DefinitionsLayer
class DefinitionsLayerTest(TestCase):
def test_create_definition_link(self):
layer = {
'202-3': {'ref': 'account:202-2-a'},
'referenced': {'account:202-2-a': {'reference': '202-2-a'... |
flinz/nest-simulator | pynest/examples/CampbellSiegert.py | # -*- coding: utf-8 -*-
#
# CampbellSiegert.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 2 of the License... |
pexip/os-refpolicy-ubuntu | policy/flask/flask.py | #!/usr/bin/python -E
#
# Author(s): Caleb Case <ccase@tresys.com>
#
# Adapted from the bash/awk scripts mkflask.sh and mkaccess_vector.sh
#
import getopt
import os
import sys
import re
class ParseError(Exception):
def __init__(self, type, file, line):
self.type = type
self.file = file
self.line = line
def __s... |
tfroehlich82/EventGhost | languages/fr_FR.py | # -*- coding: UTF-8 -*-
class General:
apply = u"Appliquer"
autostartItem = u"Démarrage automatique"
browse = u"Parcourir..."
cancel = u"Annuler"
choose = u"Sélection"
configTree = u"Arbre de configuration"
deleteLinkedItems = u"Au moins un élément en dehors de votre sélection se réfère à un... |
makinacorpus/rdiff-backup | misc/librsync-many-files.py | #!/usr/bin/env python
"""Use librsync to transform everything in one dir to another"""
import sys, os, librsync
dir1, dir2 = sys.argv[1:3]
for i in xrange(1000):
dir1fn = "%s/%s" % (dir1, i)
dir2fn = "%s/%s" % (dir2, i)
# Write signature file
f1 = open(dir1fn, "rb")
sigfile = open("sig", "wb")
librsync.filesi... |
bruderstein/PythonScript | PythonLib/min/_osx_support.py | """Shared OS X support functions."""
import os
import re
import sys
__all__ = [
'compiler_fixup',
'customize_config_vars',
'customize_compiler',
'get_platform_osx',
]
# configuration variables that may contain universal build flags,
# like "-arch" or "-isdkroot", that may need customization for
# the... |
gltn/stdm | stdm/third_party/sqlalchemy/testing/suite/test_insert.py | from .. import config
from .. import engines
from .. import fixtures
from ..assertions import eq_
from ..config import requirements
from ..schema import Column
from ..schema import Table
from ... import Integer
from ... import literal
from ... import literal_column
from ... import select
from ... import String
class ... |
INM-6/nest-git-migration | pynest/examples/tsodyks_depressing.py | # -*- coding: utf-8 -*-
#
# tsodyks_depressing.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 2 of the Lice... |
xbmc/atv2 | xbmc/lib/libPython/Python/Mac/Tools/IDE/Splash.py | from Carbon import Dlg
from Carbon import Res
splash = Dlg.GetNewDialog(468, -1)
splash.DrawDialog()
from Carbon import Qd, TE, Fm
from Carbon import Win
from Carbon.Fonts import *
from Carbon.QuickDraw import *
from Carbon.TextEdit import teJustCenter
import string
import sys
_about_width = 440
_about_height = 340... |
magnunor/hyperspy | hyperspy/_signals/dielectric_function.py | # -*- coding: utf-8 -*-
# Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... |
fw1121/Pandoras-Toolbox-for-Bioinformatics | src/SPAdes/ext/src/python_libs/joblib2/numpy_pickle.py | ############################################################################
# Copyright (c) 2011-2014 Saint-Petersburg Academic University
# All Rights Reserved
# See file LICENSE for details.
############################################################################
"""
Utilities for fast persistence of big data, ... |
jhmadhav/pynopticon | src/pynopticon/tests/test_Pipeline.py | import unittest
import pynopticon.ImageDataset
import pynopticon.cluster
import pynopticon.tests
import pynopticon.histogram
import pynopticon.filter
import pynopticon.transforms
import pynopticon.features
import pynopticon.score
import pynopticon
import numpy
import os.path
import gc
class testAll(unittest.TestCase)... |
dati91/servo | tests/wpt/web-platform-tests/webdriver/tests/fullscreen_window/fullscreen.py | from tests.support.asserts import assert_error, assert_success
def fullscreen(session):
return session.transport.send(
"POST", "session/{session_id}/window/fullscreen".format(**vars(session)))
def is_fullscreen(session):
# At the time of writing, WebKit does not conform to the Fullscreen API specifi... |
codoo/vertical-community2 | membership_users/membership_users.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Buron. Copyright Yannick Buron
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by t... |
Atom-machinerule/OpenQbo | qbo_stereo_anaglyph/hrl_lib/src/hrl_lib/filters.py | #
# Copyright (c) 2009, Georgia Tech Research Corporation
# 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, thi... |
Kouloukos/mongo-connector | mongo_connector/doc_managers/mongo_doc_manager.py | # Copyright 2013-2014 MongoDB, 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 writin... |
moduloprime/experience-sampling | backend/export.py | """Export survey data to Cloud Storage.
This implements a new admin-only page that allows exporting survey data from
the App Engine Datastore into a file in Cloud Storage, for easy downloading.
Alternately, this can export the data from Datastore into a Spreadsheet in the
admin's Google Drive.
"""
import datetime
im... |
wowgeeker/mongo-connector | tests/test_oplog_manager_sharded.py | # Copyright 2013-2014 MongoDB, 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 writin... |
Yarrick13/hwasp | tests/asp/AllAnswerSets/nontight/example.hamiltonian.6.asp.gringo.test.py | input = """
1 2 1 1 3
1 3 1 1 2
1 4 1 1 5
1 6 1 1 7
1 5 1 1 4
1 7 1 1 6
1 8 1 0 5
1 9 2 0 8 2
1 8 2 0 9 7
1 1 2 0 5 7
1 1 1 1 8
1 1 1 1 9
0
8 reached(2)
9 reached(4)
3 out_hm(2,4)
4 out_hm(3,2)
6 out_hm(4,2)
2 in_hm(2,4)
5 in_hm(3,2)
7 in_hm(4,2)
0
B+
0
B-
1
0
1
"""
output = """
{in_hm(2,4), in_hm(3,2), out_hm(4,2), re... |
richardfergie/googleads-python-lib | examples/dfp/v201505/line_item_service/get_line_items_by_statement.py | #!/usr/bin/python
#
# Copyright 2015 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 b... |
uber/vertica-python | vertica_python/tests/unit_tests/__init__.py | # Copyright (c) 2018-2021 Micro Focus or one of its affiliates.
# Copyright (c) 2018 Uber Technologies, 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/licen... |
sdague/home-assistant | tests/components/modbus/test_modbus_switch.py | """The tests for the Modbus switch component."""
from datetime import timedelta
import pytest
from homeassistant.components.modbus.const import CALL_TYPE_COIL, CONF_COILS
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import CONF_NAME, CONF_SLAVE, STATE_OFF, STATE_ON
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.