code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
# Copyright 2018 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...
allenlavoie/tensorflow
tensorflow/contrib/tpu/python/tpu/tpu_system_metadata.py
Python
apache-2.0
5,758
''' Created on Jun 26, 2013 @author: Jonas Zaddach <zaddach@eurecom.fr> ''' import subprocess def get_process_list(): processes = [] ps_output = subprocess.check_output(["ps", "-A", "-w", "-w", "-o", "pid", "-o", "command"]) ps_output = ps_output.decode('latin-1') for line in ps_output.split("\n")[1:]...
jmatthed/avatar-python
avatar/util/processes.py
Python
apache-2.0
796
import datetime import time from django.http import HttpResponse from django.shortcuts import render_to_response, get_object_or_404 from django.utils.timezone import localtime, now from graphite.util import json from graphite.events import models from graphite.render.attime import parseATTime from django.core.urlresol...
dhtech/graphite-web
webapp/graphite/events/views.py
Python
apache-2.0
2,759
# Copyright 2015 Cisco Systems, 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...
meidli/yabgp
yabgp/message/attribute/atomicaggregate.py
Python
apache-2.0
1,948
# Copyright 2019 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. from PB.recipes.recipe_engine.engine_tests import proto_properties PYTHON_VERSION_COMPATIBILITY = 'PY2+3' DEPS = [ 'assertions', 'proper...
luci/recipes-py
recipes/engine_tests/proto_properties.py
Python
apache-2.0
1,095
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
cinderella/incubator-cloudstack
test/integration/component/test_snapshots.py
Python
apache-2.0
57,945
#!/usr/bin/env python2.6 # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2012,2013 Contributor # # 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...
stdweird/aquilon
tests/broker/test_usecase_hacluster.py
Python
apache-2.0
15,847
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Huyuwei/tvm
python/tvm/expr.py
Python
apache-2.0
17,385
# Copyright (c) 2020 Dell Inc. or its subsidiaries. # 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 # # ...
openstack/cinder
cinder/volume/drivers/dell_emc/powermax/provision.py
Python
apache-2.0
32,178
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
jtopjian/st2
st2actions/tests/unit/test_notifier.py
Python
apache-2.0
4,699
# Copyright (c) 2014 Cisco Systems, 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 r...
mikalstill/nova
nova/tests/unit/api/openstack/compute/test_server_groups.py
Python
apache-2.0
36,927
from .views import PageView from django.urls import path urlpatterns = [ path('<path:path>/', PageView.as_view(), name='page_detail'), ]
manhhomienbienthuy/pythondotorg
pages/urls.py
Python
apache-2.0
142
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # """ .. attention:: Fix the license string """ import os import socket import psutil import gevent from uve.cfgm_cpuinfo.ttypes import * from uve.cfgm_cpuinfo.cpuinfo.ttypes import * from buildinfo import build_info from sandesh_common.vns.ttypes impo...
srajag/contrail-controller
src/config/common/vnc_cpu_info.py
Python
apache-2.0
7,056
#!/usr/bin/env python """Small tool for copying android icons from material-design-icons repo to specified android gradle module. It copies all density versions of png files to appropriate res subdirectories. Usage: picon.py add <category> <name> [-i <path>] [-o <path>] [-c <color>] [-s <size>] ...
langara/MyBlocks
picon.py
Python
apache-2.0
3,366
# Copyright 2016 Bridgewater Associates # # 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 appli...
stackArmor/security_monkey
security_monkey/auditors/vpc/vpc.py
Python
apache-2.0
1,852
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os from textwrap import dedent from pants.backend.jvm.targets.java_library import...
twitter/pants
tests/python/pants_test/backend/jvm/tasks/test_checkstyle.py
Python
apache-2.0
5,076
# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). # # 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...
eProsima/Fast-DDS
test/communication/liveliness_assertion.py
Python
apache-2.0
2,185
from django.conf.urls.defaults import * from django.contrib import admin from django.conf import settings from expedient.common.rpc4django.utils import rpc_url from openflow.common.utils.OptinThemeManager import OptinThemeManager OptinThemeManager.initialize() admin.autodiscover() urlpatterns = patterns('', (r'...
dana-i2cat/felix
optin_manager/src/python/openflow/optin_manager/urls.py
Python
apache-2.0
2,782
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
varunarya10/ironic
ironic/api/config.py
Python
apache-2.0
1,302
# Copyright 2011 Luke Stone """Django forms for models.""" # This don't work in appengine, we use djangoforms instead. # from django.forms import ModelForm from django import forms # DateField, DateTimeInput from google.appengine.ext.db import djangoforms import common import models VENDOR_SELECTIONS = ( 'H...
tectronics/rebuildingtogethercaptain
room/forms.py
Python
apache-2.0
7,780
# Copyright 2016 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...
alshedivat/tensorflow
tensorflow/python/ops/check_ops.py
Python
apache-2.0
47,658
# Copyright 2009-2010 10gen, 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,...
couchbaselabs/litmus
lib/pymongo/database.py
Python
apache-2.0
28,121
# -*- coding: utf-8 -*- # # Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
tseaver/google-cloud-python
container/noxfile.py
Python
apache-2.0
5,050
config = { "interfaces": { "google.cloud.talent.v4beta1.TenantService": { "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], "non_idempotent": [], }, "retry_params": { "default": { "init...
tseaver/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/tenant_service_client_config.py
Python
apache-2.0
1,782
""" File: logmessages.py Author: Fernando Crespo Gravalos (cees.project.official@gmail.com) Date: 2014/06/16 """ ############## # LOG MESSAGES ############## ## GENERAL ## DB_ERROR = 'Database error. Check database log file.' STORE_NOT_FOUND = 'Could not find store in cees database.' TOKEN_NOT_FOUND = 'Could not fin...
fcgravalos/CEES-API-v1.0
logmessages.py
Python
apache-2.0
1,055
''' New Integration Test for hybrid. @author: Quarkonics ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.operations.hybrid_operations as hyb_ops import zstackwoodpecker.operations.resou...
zstackorg/zstack-woodpecker
integrationtest/vm/hybrid/test_attach_detach_oss_bucket.py
Python
apache-2.0
1,062
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
dmlc/tvm
tests/python/contrib/test_ethosu/cascader/test_ethosu_part_performance.py
Python
apache-2.0
6,531
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2009,2010,2011,2012,2013,2014,2016 Contributor # # 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...
quattor/aquilon
lib/aquilon/worker/commands/reconfigure_membersof.py
Python
apache-2.0
1,488
import json import httplib import requests from st2actions.runners.pythonrunner import Action __all__ = [ 'PostMessageAction' ] class PostMessageAction(Action): def run(self, message, username=None, icon_emoji=None, channel=None): config = self.config['post_message_action'] username = usern...
dennybaa/st2contrib
packs/slack/actions/post_message.py
Python
apache-2.0
1,186
import numpy as np import math from numpy.random import RandomState import pytest from cryptorandom.cryptorandom import SHA256 from ..stratified import stratified_permutationtest as spt from ..stratified import stratified_permutationtest_mean as sptm from ..stratified import corrcoef, sim_corr, stratified_two_sample ...
statlab/permute
permute/tests/test_stratified.py
Python
bsd-2-clause
3,861
import unittest from arc_utilities.conversions import parse_file_size class TestConversions(unittest.TestCase): def test_parse_file_size(self): self.assertEqual(parse_file_size('1'), 1) self.assertEqual(parse_file_size('12.2'), 12) self.assertEqual(parse_file_size('1k'), 1_000) s...
UM-ARM-Lab/arc_utilities
tests/test_conversions.py
Python
bsd-2-clause
681
# # Copyright 2014, NICTA # # This software may be distributed and modified according to the terms of # the BSD 2-Clause license. Note that NO WARRANTY is provided. # See "LICENSE_BSD2.txt" for details. # # @TAG(NICTA_BSD) # from camkestr import dedupe, parse_to_ast, resolve_imports, resolve_references, show, \ pr...
agacek/camkes-tool
camkes/parser/__init__.py
Python
bsd-2-clause
410
# encoding: utf-8 # module zipimport # from (built-in) # by generator 1.130 """ zipimport provides support for importing Python modules from Zip archives. This module exports three objects: - zipimporter: a class; its constructor takes a path to a Zip archive. - ZipImportError: exception raised by zipimporter objects....
akiokio/centralfitestoque
src/.pycharm_helpers/python_stubs/-1807332816/zipimport.py
Python
bsd-2-clause
4,893
from warnings import warn from bluesky.preprocessors import print_summary_wrapper def plot_raster_path(plan, x_motor, y_motor, ax=None, probe_size=None, lw=2): """Plot the raster path for this plan Parameters ---------- plan : iterable Must yield `Msg` objects and not be a co-routine x_mo...
ericdill/bluesky
bluesky/simulators.py
Python
bsd-3-clause
2,750
# -*- coding: utf-8 -*- """Python 2/3 compatibility module.""" import sys PY2 = int(sys.version[0]) == 2 if PY2: text_type = unicode # noqa binary_type = str string_types = (str, unicode) # noqa unicode = unicode # noqa basestring = basestring # noqa else: text_type = str binary_type =...
sriramsv/assist
my_assist/compat.py
Python
bsd-3-clause
400
# -*- coding: utf-8 -*- """URLs for all views.""" from django.urls import path from djmaidez.contact import views urlpatterns = [ path('form/', views.form, name='form'), path('populate/', views.populate, name='populate'), path('save/', views.save, name='save'), path('test/', views.test...
carthagecollege/django-djsani
djsani/emergency/urls.py
Python
bsd-3-clause
340
"""Here is defined the IndexArray class.""" from bisect import bisect_left, bisect_right from .node import NotLoggedMixin from .carray import CArray from .earray import EArray from . import indexesextension # Declarations for inheriting class CacheArray(indexesextension.CacheArray, NotLoggedMixin, EArray): ""...
avalentino/PyTables
tables/indexes.py
Python
bsd-3-clause
5,884
# -*- test-case-name: twisted.python.test.test_dist -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Distutils convenience functionality. Don't use this outside of Twisted. Maintainer: Christopher Armstrong """ from distutils.command import build_scripts, install_data, bui...
hlzz/dotfiles
graphics/VTK-7.0.0/ThirdParty/Twisted/twisted/python/dist.py
Python
bsd-3-clause
15,309
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the core module. """ import itertools from contextlib import nullcontext from astropy.modeling.models import Gaussian1D, Gaussian2D from astropy.utils.exceptions import AstropyUserWarning import numpy as np from numpy.testing import assert_...
astropy/photutils
photutils/centroids/tests/test_gaussian.py
Python
bsd-3-clause
4,408
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os def get_package_data(): paths = [os.path.join('data', '*.json')] return {'astroquery.sdss': paths}
imbasimba/astroquery
astroquery/sdss/setup_package.py
Python
bsd-3-clause
184
#!/usr/bin/env python import os from setuptools import setup setup(name='pymarkdown', version='0.1.4', description='Evaluate code in markdown', url='http://github.com/mrocklin/pymarkdown', author='Matthew Rocklin', author_email='mrocklin@gmail.com', license='BSD', keywords='...
leosartaj/pymarkdown
setup.py
Python
bsd-3-clause
599
""" Serialization ``django.core.serializers`` provides interfaces to converting Django ``QuerySet`` objects to and from "flat" data (i.e. strings). """ from decimal import Decimal from django.db import models class CategoryMetaDataManager(models.Manager): def get_by_natural_key(self, kind, name): retur...
mattseymour/django
tests/serializers/models/base.py
Python
bsd-3-clause
3,903
#----------------------------------------------------------------------------- # 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. #---------------------------------------------------...
Karel-van-de-Plassche/bokeh
bokeh/io/notebook.py
Python
bsd-3-clause
18,064
#Stage 2 Update (Python 3) import datetime from django.test import TestCase from django.core.exceptions import ImproperlyConfigured from dynamic_scraper.utils.scheduler import Scheduler class SchedulerTest(TestCase): def test_config_wrong_def(self): conf_dict_str = '\ "MIN_TIME" ---- 15,\n\ "MAX...
DeanSherwin/django-dynamic-scraper
tests/basic/scheduler_test.py
Python
bsd-3-clause
2,244
"""Write back all data it receives.""" import sys data = sys.stdin.read(1) while data: sys.stdout.write(data) sys.stdout.flush() data = sys.stdin.read(1) sys.stderr.write("byebye") sys.stderr.flush()
hlzz/dotfiles
graphics/VTK-7.0.0/ThirdParty/Twisted/twisted/test/process_echoer.py
Python
bsd-3-clause
225
#!/usr/bin/env python from dingus import Dingus, DingusTestCase, DontCare import nose.tools as nose_tools import sys import socket from stompy import simple from stompy.simple import Client, TransactionError class WhenUsingSimpleClient(DingusTestCase(Client, exclude=['TransactionError', 'Empty'])): def setup...
node/python-stomp
tests/test_simple.py
Python
bsd-3-clause
3,426
from __future__ import unicode_literals import copy from dateutil.relativedelta import relativedelta import six from dash.utils import get_month_range from django import forms from django.forms.forms import DeclarativeFieldsMetaclass from django.utils import timezone from django.utils.translation import ugettext_l...
xkmato/tracpro
tracpro/charts/filters.py
Python
bsd-3-clause
5,748
from .settings import DEFAULT_MEDIA_FILTERS from django.utils.encoding import smart_str from hashlib import sha1 from mediagenerator.settings import MEDIA_DEV_MODE from mediagenerator.utils import load_backend, find_file, read_text_file import os import time class Filter(object): takes_input = True def __init...
Crop-R/django-mediagenerator
mediagenerator/generators/bundles/base.py
Python
bsd-3-clause
8,535
########################################################################## # # Copyright (c) 2014, Image Engine Design 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: # # * Redistrib...
goddardl/gaffer
python/GafferUI/DotUI.py
Python
bsd-3-clause
4,789
import pytest import pandas.util.testing as tm @pytest.fixture def datetime_series(): """ Fixture for Series of floats with DatetimeIndex """ s = tm.makeTimeSeries() s.name = "ts" return s @pytest.fixture def string_series(): """ Fixture for Series of floats with Index of unique str...
toobaz/pandas
pandas/tests/series/conftest.py
Python
bsd-3-clause
595
#!/usr/bin/python3 import struct import sys if len(sys.argv) == 1: print("python karel_mdo_convert.py mundo.mdo") sys.exit(1) f = open(sys.argv[1], "rb") data = f.read() f.close() worldname = sys.argv[1] if '/' in worldname: worldname = worldname[worldname.rfind('/')+1:] if '.' in worldname: worldname = worldn...
samdsmx/omegaup
bin/karel_mdo_convert.py
Python
bsd-3-clause
4,150
from __future__ import absolute_import, unicode_literals import warnings from django.core.exceptions import ImproperlyConfigured from django.template.loader import render_to_string from django.utils.safestring import mark_safe from wagtail.utils.deprecation import RemovedInWagtail16Warning from wagtail.wagtailadmin....
hamsterbacke23/wagtail
wagtail/wagtailsnippets/edit_handlers.py
Python
bsd-3-clause
2,653
#!/usr/bin/env python from HTMLParser import HTMLParser, HTMLParseError import optparse from urllib2 import urlopen, URLError from searchengine.logger import Logging class TagSelector(HTMLParser): """ Strip all HTML tags from a string. """ def __init__(self, *args, **kwargs): self.reset() ...
binsina/python-searchengine
searchengine/scraper.py
Python
bsd-3-clause
3,070
#======================================================================= # bootstrap.py #======================================================================= from machine import State from pydgin.utils import r_uint #from pydgin.storage import Memory EMULATE_GEM5 = False EMULATE_SIMIT = True # Currently...
cornell-brg/pydgin
arm/bootstrap.py
Python
bsd-3-clause
8,853
#------------------------------------------------------------------------------- # Name: modulo1 # Purpose: # # Author: tasora # # Created: 14/02/2012 # Copyright: (c) tasora 2012 # Licence: <your licence> #------------------------------------------------------------------------------- #!/usr/bin/...
andrewseidl/chrono
src/demos/python/demo_solidworks_irrlicht.py
Python
bsd-3-clause
2,784
import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore from pyqtgraph.parametertree import Parameter, ParameterTree from pyqtgraph.parametertree import types as pTypes import pyqtgraph.configfile import numpy as np import user import collections import sys, os class RelativityGUI(QtGui.QWidget): def __ini...
UpSea/thirdParty
pyqtgraph-0.9.10/examples/relativity/relativity.py
Python
mit
28,282
# -*- coding: utf-8 -*- from uamobile.base import UserAgent, Display class EZwebUserAgent(UserAgent): carrier = 'EZweb' short_carrier = 'E' def supports_cookie(self): return True def make_display(self): """ create a Display object. """ env = self.environ ...
TheProjecter/wsgiuseragentmobile
uamobile/ezweb.py
Python
mit
1,678
import unittest from circular_buffer import ( CircularBuffer, BufferFullException, BufferEmptyException ) class CircularBufferTest(unittest.TestCase): def test_read_empty_buffer(self): buf = CircularBuffer(1) with self.assertRaises(BufferEmptyException): buf.read() de...
mweb/python
exercises/circular-buffer/circular_buffer_test.py
Python
mit
3,083
# -*- coding: utf-8 -*- from __future__ import print_function # Form implementation generated from reading ui file './acq4/devices/MockClamp/devTemplate.ui' # # Created: Thu May 29 10:20:36 2014 # by: PyQt4 UI code generator 4.9.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore,...
pbmanis/acq4
acq4/devices/MockClamp/devTemplate.py
Python
mit
8,324
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
sjsucohort6/openstack
python/venv/lib/python2.7/site-packages/openstack/tests/unit/network/v2/test_quota.py
Python
mit
1,695
HTML_OUTPUTS = { 'simple': ( b'<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><body>' b'<div id="impress"><div class="step step-level-1" step="0" ' b'data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" ' b'data-scale="1" data-x="0" data-y="0" data-z="0"><h1 ' b'...
alexAubin/hovercraft
hovercraft/tests/test_data/__init__.py
Python
mit
17,298
import id_feature as idf class BasicFeatures(idf.IDFeatures): def __init__(self, dataset): idf.IDFeatures.__init__(self, dataset) # def add_next_word_context_feature(self,next_word,tag,idx): # feat = "next_word:%s::%s"%(next_word,tag) # nr_feat = self.add_feature(feat) # idx....
LxMLS/lxmls-toolkit
lxmls/sequences/bak/basic_feature.py
Python
mit
2,225
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('regcore', '0012_migrate_documents'), ] operations = [ migrations.DeleteModel( name='Preamble', ), migrat...
cmc333333/regulations-core
regcore/migrations/0013_remove_models.py
Python
cc0-1.0
729
import sys try: try: from _pydevd_bundle_ext import pydevd_cython as mod except ImportError: from _pydevd_bundle import pydevd_cython as mod except ImportError: import struct try: is_python_64bit = (struct.calcsize('P') == 8) except: # In Jython this call fails, bu...
fabioz/Pydev
plugins/org.python.pydev.core/pysrc/_pydevd_bundle/pydevd_cython_wrapper.py
Python
epl-1.0
1,600
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
qrohlf/cf-client
lib/cfclient/utils/mux/__init__.py
Python
gpl-2.0
7,589
from unittest import TestCase from katello.client.core.base import Action from katello.client.i18n_optparse import OptionParser from katello.client.utils.option_validator import OptionValidator from katello.tests.test_utils import ColoredAssertionError import os class OptionValidatorTestCase(TestCase): failureEx...
iNecas/katello
cli/test/katello/tests/utils/option_validator_test.py
Python
gpl-2.0
11,718
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2007 Michael Howitz, gocept gmbh & co. kg # # This is free software. You may redistribute it under the terms # of the Apache license and the GNU General Public License Version # 2 or at your option any later version. # # This program is distributed in the h...
pacoqueen/odfpy
tests/testuserfields.py
Python
gpl-2.0
7,878
#!/usr/bin/env python3 #################################### # ACE3 automatic deployment script # # ================================ # # This is not meant to be run # # directly! # #################################### import os import sys import shutil import traceback import subprocess as ...
NemesisRE/ACE3
tools/deploy.py
Python
gpl-2.0
1,499
# $Id: 201_codec_l16_16000.py 369517 2012-07-01 17:28:57Z file $ # from inc_cfg import * # Call with L16/16000/1 codec test_param = TestParam( "PESQ codec L16/16000/1 (RX side uses snd dev)", [ InstanceParam("UA1", "--max-calls=1 --add-codec L16/16000/1 --clock-rate 16000 --play-file wavs/input.16.wav --null-au...
fluentstream/asterisk-p2p
res/pjproject/tests/pjsua/scripts-pesq/201_codec_l16_16000.py
Python
gpl-2.0
537
# # Copyright (C) 2014 Martin Owens # # 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 later version. # # This program is distributed in...
tik0/inkscapeGrid
share/extensions/Barcode/__init__.py
Python
gpl-2.0
1,757
#************************************************************************* #* Dionaea #* - catches bugs - #* #* #* #* Copyright (C) 2010 Markus Koetter #* #* This program is free software; you can redistribute it and/or #* modify it under the terms of the GNU Gen...
GovCERT-CZ/dionaea
modules/python/scripts/smb/include/asn1packet.py
Python
gpl-2.0
1,727
#!/usr/bin/env python # Copyright (c) 2009, 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 lis...
cattleprod/samsung-kernel-gt-i9100
external/webkit/WebKitTools/Scripts/webkitpy/patchcollection.py
Python
gpl-2.0
2,853
# -*- coding: utf-8 -*- # # Copyright (C) 2006, TUBITAK/UEKAE # # 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 later version. # # Plea...
SolusOS-discontinued/pisi
pisi/signalhandler.py
Python
gpl-2.0
1,553
""" SocksiPy - Python SOCKS module. Version 1.5.7 Copyright 2006 Dan-Haim. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this ...
hackersql/sq1map
thirdparty/socks/socks.py
Python
gpl-3.0
30,140
from __future__ import with_statement from sympy.printing.mathml import mathml import tempfile import os def print_gtk(x, start_viewer=True): """Print to Gtkmathview, a gtk widget capable of rendering MathML. Needs libgtkmathview-bin""" from sympy.utilities.mathml import c2p tmp = tempfile.mktemp()...
lidavidm/mathics-heroku
venv/lib/python2.7/site-packages/sympy/printing/gtk.py
Python
gpl-3.0
510
# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2017-08-14 16:15 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('parlamentares', '0004_auto_20170711_1305'), ] operations = [ migrations.AlterModelO...
cmjatai/cmj
sapl/parlamentares/migrations/0005_auto_20170814_1615.py
Python
gpl-3.0
480
""" Factorial Finder Name: Mr Gorman Date: 01/12/2016 """ def find_factorial_loop(n): """ Function to find factorial using iteration. For more info on range: https://docs.python.org/3/library/stdtypes.html#range """ factorial = 1 for i in range(n, 0, -1): # alternatively...
SHS-ComputerScience/A-Level_2016-18
2. Exemplars/Factorial_Finder/factorial.py
Python
gpl-3.0
853
# -*- coding: utf-8 -*- import random import re import threading import time from module.plugins.internal.Plugin import Plugin, Skip from module.plugins.internal.misc import Periodical, compare_time, decode, isiterable, lock, parse_size class Account(Plugin): __name__ = "Account" __type__ = "account" ...
kaarl/pyload
module/plugins/internal/Account.py
Python
gpl-3.0
12,347
from __future__ import unicode_literals from __future__ import absolute_import from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import Client from django.template import Context, Template try: from django.test import override_settings except ImportError: fro...
SoftwareExperiment4/SungkyunWiki
wiki/tests/base.py
Python
gpl-3.0
2,591
#!/usr/bin/python import os, re aliases = os.listdir('/Users/greg/Documents/freex/') aliases = [a.lower() for a in aliases if '.freex' in a] aliases.sort(reverse=True) aliases = [re.escape(a.lower()) for a in aliases] aliasRegexpStr = '\\b'+'\\b|\\b'.join(aliases)+'\\b' aliasRegexpStr = aliasRegexpStr.replace('\\ ', ...
PiRSquared17/emacs-freex
test_regex.py
Python
gpl-3.0
465
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com> # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file import os import re import logging import tempfile import argparse from twisted.internet.defer import inlineCallbacks import subprocess...
tlevine/alot
alot/commands/thread.py
Python
gpl-3.0
42,235
"""This module contains code for managing Redis-backed account sync allocation. Structurally, that works like this: Redis list Redis hash (acct ids to be (acct ids -> proc ids) synced) +------...
nylas/sync-engine
inbox/scheduling/queue.py
Python
agpl-3.0
6,779
import requests import urllib from bountyfunding.core.config import config from bountyfunding.core.models import db, Payment from bountyfunding.core.const import PaymentGateway from bountyfunding.core.errors import Error from bountyfunding.core.payment import get_paypal_url class PayPalStandardGateway: def cre...
bountyfunding/bountyfunding
bountyfunding/core/payment/paypal_standard.py
Python
agpl-3.0
2,667
# -*- coding: utf-8 -*- """ LMS index (home) page. """ from bok_choy.page_object import PageObject from . import BASE_URL BANNER_SELECTOR = 'section.home header div.outer-wrapper div.title hgroup h1' INTRO_VIDEO_SELECTOR = 'div.play-intro' VIDEO_MODAL_SELECTOR = 'section#video-modal.modal.home-page-video-modal.video-m...
antoviaque/edx-platform
common/test/acceptance/pages/lms/index.py
Python
agpl-3.0
1,731
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
mrcslws/nupic.research
projects/backprop_structure/runs/run_alexnet_binaryactivation_kwinners_gsc.py
Python
agpl-3.0
2,906
#! /usr/bin/env python # -*- coding: utf-8 -*- # Any Indian Language to any other Indian language transliterator # Copyright 2008-2010 Santhosh Thottingal <santhosh.thottingal@gmail.com> # http://www.smc.org.in # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Gene...
smc/silpa
src/silpa/modules/transliterator/cmudict.py
Python
agpl-3.0
5,575
""" Integration Tests for LMS instructor-initiated background tasks. Runs tasks on answers to course problems to validate that code paths actually work. """ import json import logging from mock import patch from nose.plugins.attrib import attr import textwrap from celery.states import SUCCESS, FAILURE from django.co...
louyihua/edx-platform
lms/djangoapps/instructor_task/tests/test_integration.py
Python
agpl-3.0
27,741
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it und...
jobiols/management-system
mgmtsystem_hazard/models/mgmtsystem_hazard_origin.py
Python
agpl-3.0
1,280
# 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 RCli(RPackage): """A suite of tools designed to build attractive command line interfaces ...
iulian787/spack
var/spack/repos/builtin/packages/r-cli/package.py
Python
lgpl-2.1
1,307
# # distutils/version.py # # Implements multiple version numbering conventions for the # Python Module Distribution Utilities. # # $Id$ # """Provides classes to represent module version numbers (one class for each style of version numbering). There are currently two such classes implemented: StrictVersion ...
prefetchnta/questlab
bin/x64bin/python/37/Lib/distutils/version.py
Python
lgpl-2.1
12,688
# -*- coding: utf-8 -*- ''' Test case for signal to signal connections.''' import unittest from PySide2.QtCore import * def cute_slot(): pass class TestSignal2SignalConnect(unittest.TestCase): '''Test case for signal to signal connections''' def setUp(self): #Set up the basic resources needed ...
BadSingleton/pyside2
tests/signals/signal2signal_connect_test.py
Python
lgpl-2.1
3,340
##Copyright 2011-2014 Thomas Paviot (tpaviot@gmail.com) ## ##This file is part of pythonOCC. ## ##pythonOCC is free software: you can redistribute it and/or modify ##it under the terms of the GNU Lesser General Public License as published by ##the Free Software Foundation, either version 3 of the License, or ##(at your...
sven-hm/pythonocc-core
src/addons/Display/WebGl/threejs_renderer.py
Python
lgpl-3.0
12,135
# Copyright 2019 Microsoft Corp # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 from .common import BaseTest from c7n.lookup import Lookup class LookupTest(BaseTest): def test_lookup_type(self): number_schema = {'type': 'number'} lookup_default_number = Lookup.loo...
alfredgamulo/cloud-custodian
tests/test_lookup.py
Python
apache-2.0
2,809
"""Fixtures for pywemo.""" import asyncio from unittest.mock import create_autospec, patch import pytest import pywemo from homeassistant.components.wemo import CONF_DISCOVERY, CONF_STATIC from homeassistant.components.wemo.const import DOMAIN from homeassistant.helpers import entity_registry as er from homeassistant...
home-assistant/home-assistant
tests/components/wemo/conftest.py
Python
apache-2.0
3,246
"""The tests for the manual Alarm Control Panel component.""" from datetime import timedelta import unittest from unittest.mock import patch from homeassistant.setup import setup_component from homeassistant.const import ( STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_...
MungoRae/home-assistant
tests/components/alarm_control_panel/test_manual.py
Python
apache-2.0
16,012
# Copyright 2020 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...
sarvex/tensorflow
tensorflow/python/dlpack/dlpack.py
Python
apache-2.0
2,227
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Views tests for the OSF.""" from __future__ import absolute_import import datetime as dt from rest_framework import status as http_status import json import time import unittest from future.moves.urllib.parse import quote from flask import request import mock import ...
mfraezz/osf.io
tests/test_views.py
Python
apache-2.0
220,173
# Copyright 2013 IBM Corp. # # 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 t...
takeshineshiro/nova
nova/tests/functional/v3/test_suspend_server.py
Python
apache-2.0
2,309
#!/usr/bin/python # # Copyright 2012 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 a...
tripleee/gmail-oauth2-tools
python/oauth2.py
Python
apache-2.0
12,198
input = """ g(1). g(2). g(3). f(a,b). f(A,B):- g(A), g(B). f(a,a). """ output = """ {f(1,1), f(1,2), f(1,3), f(2,1), f(2,2), f(2,3), f(3,1), f(3,2), f(3,3), f(a,a), f(a,b), g(1), g(2), g(3)} """
Yarrick13/hwasp
tests/wasp1/AllAnswerSets/edbidb_3.test.py
Python
apache-2.0
199