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
from os import path from setuptools import setup version = "3.0.2" name = "test-hyphens" module_name = "test-hyphens" lab_ext_name = "test-hyphens" HERE = path.abspath(path.dirname(__file__)) lab_path = path.join(HERE, module_name, "labextension") data_files_spec = [("share/jupyter/labextensions/" + lab_ext_name, la...
jupyter/jupyterlab
jupyterlab/tests/mock_packages/test-hyphens/setup.py
Python
bsd-3-clause
841
from __future__ import unicode_literals from django.contrib import messages from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404, redirect from django.template.response import TemplateResponse from django.utils.http import is_safe_url from django.utils.translation import ugettext...
rodrigozn/CW-Shop
saleor/dashboard/product/views.py
Python
bsd-3-clause
11,140
#!/usr/bin/env python # Copyright (c) 2014 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Compiler version checking tool for gcc Print gcc version as XY if you are running gcc X.Y.*. This is used to tweak build f...
mxOBS/deb-pkg_trusty_chromium-browser
native_client/build/compiler_version.py
Python
bsd-3-clause
4,546
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # # Program Parameters # import os import...
Luobiny/bioconda-recipes
recipes/dinosaur/dinosaur.py
Python
mit
2,644
import base64 from base64 import b64encode from oauth2.test import unittest from mock import Mock from oauth2.client_authenticator import ClientAuthenticator, http_basic_auth, \ request_body from oauth2.datatype import Client from oauth2.error import OAuthInvalidNoRedirectError, ClientNotFoundError,\ OAuthInval...
RydrDojo/Ridr_app
pylotVenv/lib/python2.7/site-packages/oauth2/test/test_client_authenticator.py
Python
mit
7,652
import numpy from chainer import _backend # TODO(kmaehashi): `from chainer.backends import cuda` causes circular imports. # Surprisingly, `import chianer.backends` works as a workaround to avoid, but # we should fix circular dependencies themselves around `chainer.backends.*`. import chainer.backends import chainerx ...
pfnet/chainer
chainer/backends/_cpu.py
Python
mit
1,783
######################################################################## # # (C) 2013, James Cammarata <jcammarata@ansible.com> # # This file is part of Ansible # # Ansible 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 ...
veger/ansible
lib/ansible/galaxy/api.py
Python
gpl-3.0
11,051
# # webui.py # # Copyright (C) 2009 Damien Churchill <damoxc@gmail.com> # # Basic plugin template created by: # Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com> # Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com> # # Deluge is free software. # # You may redistribute it and/or modify it under the terms...
voltaicsca/deluge
deluge/plugins/Scheduler/deluge/plugins/scheduler/webui.py
Python
gpl-3.0
1,864
#!/usr/bin/env python """ Use cookiecutter to create a new XBlock project. """ import os import re import textwrap from cookiecutter.main import cookiecutter EXPLANATION = """\ This script will create a new XBlock project. You will be prompted for two pieces of information: * Short name: a single word, all lower-...
lovehhf/xblock-sdk
script/startnew.py
Python
agpl-3.0
1,834
#!/usr/bin/env python import time from video_listings import VideoListings from video_page import VideoPage class SearchResultsPage(VideoListings): """ Unisubs page contains common web elements found across all Universal Subtitles pages. Every new page class is derived from UnisubsPage so that ever...
ofer43211/unisubs
apps/webdriver_testing/pages/site_pages/search_results_page.py
Python
agpl-3.0
3,023
from django.test.utils import override_settings from xmodule.modulestore.xml_importer import import_from_xml from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.django import modulestore from contentstore.tests.modulestore_config import TEST_MODULESTORE # This test is in...
nanolearning/edx-platform
cms/djangoapps/contentstore/tests/test_import_draft_order.py
Python
agpl-3.0
2,829
# 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 Tskit(PythonPackage): """The tskit library provides the underlying functionality used to l...
LLNL/spack
var/spack/repos/builtin/packages/tskit/package.py
Python
lgpl-2.1
971
"""SCons.Executor A module for executing actions with specific lists of target and source Nodes. """ # # Copyright (c) 2001 - 2015 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in...
pnorman/mapnik
scons/scons-local-2.4.1/SCons/Executor.py
Python
lgpl-2.1
22,608
"""SCons.Tool.DCommon Common code for the various D tools. Coded by Russel Winder (russel@winder.org.uk) 2012-09-06 """ # # Copyright (c) 2001 - 2015 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Soft...
pnorman/mapnik
scons/scons-local-2.4.1/SCons/Tool/DCommon.py
Python
lgpl-2.1
1,930
"""Binary sensor support for the Skybell HD Doorbell.""" from __future__ import annotations from datetime import timedelta from typing import Any import voluptuous as vol from homeassistant.components.binary_sensor import ( DEVICE_CLASS_MOTION, DEVICE_CLASS_OCCUPANCY, PLATFORM_SCHEMA, BinarySensorEnt...
jawilson/home-assistant
homeassistant/components/skybell/binary_sensor.py
Python
apache-2.0
2,717
# Copyright 2012-2014 Red Hat, 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...
eharney/nova
nova/openstack/common/systemd.py
Python
apache-2.0
3,056
import h2o import h2o_test_utils def test(a_node, pp): #################################### # test schemas collection GET if h2o_test_utils.isVerbose(): print('Testing /Metadata/schemas. . .') schemas = a_node.schemas(timeoutSecs=240) assert 'schemas' in schemas, "FAIL: failed to find 'schemas' fie...
mathemage/h2o-3
py/rest_tests/test_metadata.py
Python
apache-2.0
2,832
"""The Brother component.""" import asyncio from datetime import timedelta import logging from brother import Brother, SnmpError, UnsupportedModel from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_HOST, CONF_TYPE from homeassistant.core import Config, HomeAssistant from homeass...
nkgilley/home-assistant
homeassistant/components/brother/__init__.py
Python
apache-2.0
2,382
# # 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...
raphaelamorim/fbthrift
thrift/lib/py/util/Decorators.py
Python
apache-2.0
4,816
#!/usr/bin/env python # # 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 # "...
bolkedebruin/airflow
scripts/ci/pre_commit/pre_commit_check_order_setup.py
Python
apache-2.0
5,405
from django.apps.registry import Apps from django.db import models from django.utils.encoding import python_2_unicode_compatible # Because we want to test creation and deletion of these as separate things, # these models are all inserted into a separate Apps so the main test # runner doesn't migrate them. new_apps = ...
cloudera/hue
desktop/core/ext-py/Django-1.11.29/tests/schema/models.py
Python
apache-2.0
4,672
# Generated by Django 2.2.12 on 2020-05-05 13:39 from django.db import migrations def remove_waffle_switch(apps, schema_editor): Switch = apps.get_model('waffle', 'Switch') Switch.objects.filter(name='es-use-classic-similarity').all().delete() class Migration(migrations.Migration): dependencies = [] ...
eviljeff/olympia
src/olympia/search/migrations/0001_remove-es-use-classic-similarity-waffle-switch.py
Python
bsd-3-clause
380
# Copyright (C) 2010 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 of conditions and the f...
chromium/chromium
third_party/blink/tools/blinkpy/web_tests/port/win_unittest.py
Python
bsd-3-clause
8,407
#!/usr/bin/python # android-build.py # Build android import sys import os, os.path from optparse import OptionParser CPP_SAMPLES = ['cpp-empty-test', 'cpp-tests', 'game-controller-test'] LUA_SAMPLES = ['lua-empty-test', 'lua-tests', 'lua-game-controller-test'] JS_SAMPLES = ['js-tests'] ALL_SAMPLES = CPP_SAMPLES + LUA...
martinmontane/cocos2dGame
frameworks/cocos2d-x/build/android-build.py
Python
mit
3,763
from autotest.client.shared import error from virttest import remote, libvirt_vm, virsh, libvirt_xml, utils_libvirtd def run(test, params, env): """ Test command: virsh start. 1) Get the params from params. 2) Prepare libvirtd's status. 3) Do the start operation. 4) Result check. 5) clean...
PandaWei/tp-libvirt
libvirt/tests/src/virsh_cmd/domain/virsh_start.py
Python
gpl-2.0
7,023
# Volatility # Copyright (C) 2007,2008 Volatile Systems # # Original Source: # Volatools Basic # Copyright (C) 2007 Komoku, Inc. # # 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 ...
py4n6/pyflag
src/plugins_old/MemoryForensics/Volatility-1.3_Linux_rc.1/vtypes.py
Python
gpl-2.0
24,576
""" Iterate over a file in chunks of the specified size --------------------------------------------------- Produces the following output:: 'green\neggs' '\nand\nspam\n' """ from XRootD import client with client.File() as f: f.open('root://localhost//tmp/eggs') for chunk in f.readchunks(offset=0, chunksize...
alja/xrootd
bindings/python/examples/readchunks.py
Python
gpl-3.0
349
# Unix SMB/CIFS implementation. # Test validity of smb.conf # Copyright (C) 2010-2011 Jelmer Vernooij <jelmer@samba.org> # # Based on the original in C: # Copyright (C) Karl Auer 1993, 1994-1998 # Extensively modified by Andrew Tridgell, 1995 # Converted to popt by Jelmer Vernooij (jelmer@nl.linux.org), 200...
urisimchoni/samba
python/samba/netcmd/testparm.py
Python
gpl-3.0
8,456
# -*- coding: utf-8 -*- # This script is shared under the # Creative Commons Attribution-ShareAlike 3.0 license (CC BY-SA 3.0) # Added clause to Attribution: # - You may not remove or hide the '<Bot_name> who created you?' functionality # and you may not modify the name given in the response. #CREDITS # Auth...
Perakp/-tg-station
bot/NanoTrasenBot.py
Python
agpl-3.0
70,686
"""Nearest Neighbor Regression""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # # License: BSD, (C) INRIA, University...
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/sklearn/neighbors/regression.py
Python
agpl-3.0
9,136
# Copyright (C) 2007, Red Hat, Inc. # Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/> # # This library 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 2 of the License, ...
tchx84/debian-pkg-sugar-toolkit-gtk3
src/sugar3/presence/buddy.py
Python
lgpl-2.1
8,264
# -*- coding: utf-8 -*- """ sphinx.versioning ~~~~~~~~~~~~~~~~~ Implements the low-level algorithms Sphinx uses for the versioning of doctrees. :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from uuid import uuid4 from operator impo...
axbaretto/beam
sdks/python/.tox/docs/lib/python2.7/site-packages/sphinx/versioning.py
Python
apache-2.0
4,638
# Copyright 2013 Red Hat, Inc. # Copyright 2015 Mirantis, 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/LICEN...
saeki-masaki/glance
glance/db/registry/api.py
Python
apache-2.0
19,214
from re import match from thread import start_new_thread from time import sleep from os import getpid, kill, environ from signal import SIGINT from django.conf import settings from django.core.handlers.wsgi import WSGIHandler from django.core.management.base import BaseCommand, CommandError from django.core.managemen...
freylis/django-socketio
django_socketio/management/commands/runserver_socketio.py
Python
bsd-2-clause
2,809
from __future__ import absolute_import, print_function import datetime from django.views.generic import View from sentry.security.emails import generate_security_email from .mail import MailPreview class DebugPasswordChangedEmailView(View): def get(self, request): email = generate_security_email( ...
JackDanger/sentry
src/sentry/web/frontend/debug/debug_password_changed_email.py
Python
bsd-3-clause
794
""" ================================================= Concatenating multiple feature extraction methods ================================================= In many real-world examples, there are many ways to extract features from a dataset. Often it is beneficial to combine several methods to obtain good performance. Th...
vortex-ape/scikit-learn
examples/compose/plot_feature_union.py
Python
bsd-3-clause
2,016
import time from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse from django.test import RequestFactory, SimpleTestCase, override_settings from django.test.utils import require_jinja2 from django.urls import resolve from django.views.generic import RedirectView, TemplateView, Vi...
wkschwartz/django
tests/generic_views/test_base.py
Python
bsd-3-clause
22,004
# You must first run "bokeh serve" to view this example from math import pi import numpy as np from bokeh.client import push_session from bokeh.driving import cosine from bokeh.models.widgets import Button from bokeh.layouts import row, column from bokeh.plotting import figure, curdoc x = np.linspace(0, 4*pi, 100) ...
percyfal/bokeh
examples/plotting/server/line_animate_widget.py
Python
bsd-3-clause
1,373
"""Example for GreenTransport and GreenClientCreator. In this example reactor is started implicitly upon the first use of a blocking function. """ from twisted.internet import ssl from twisted.internet.error import ConnectionClosed from eventlet.twistedutil.protocol import GreenClientCreator from eventlet.twistedutil....
JeremyGrosser/python-eventlet
examples/twisted/twisted_client.py
Python
mit
901
"""SCons.Tool.sgicc Tool-specific initialization for MIPSPro cc on SGI. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 201...
michalliu/OpenWrt-Firefly-Libraries
staging_dir/host/lib/scons-2.3.1/SCons/Tool/sgicc.py
Python
gpl-2.0
1,890
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import string from lib.core.enums import PRIORITY __priority__ = PRIORITY.LOWEST def dependencies(): pass def tamper(payload, **kwargs): """ Url-encodes all ch...
golismero/golismero
tools/sqlmap/tamper/charencode.py
Python
gpl-2.0
1,379
# This example assumes we have a mesh object in edit-mode import bpy import bmesh # Get the active mesh obj = bpy.context.edit_object me = obj.data # Get a BMesh representation bm = bmesh.from_edit_mesh(me) bm.faces.active = None # Modify the BMesh, can do anything here... for v in bm.verts: v.co.x += 1.0 #...
Microvellum/Fluid-Designer
win64-vc/2.78/scripts/templates_py/bmesh_simple_editmode.py
Python
gpl-3.0
425
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import sys from nose.plugins.skip import SkipTest i...
alexlo03/ansible
test/units/modules/network/f5/test_bigip_iapp_template.py
Python
gpl-3.0
6,461
# 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 appl...
sandeepdsouza93/TensorFlow-15712
tensorflow/examples/learn/text_classification.py
Python
apache-2.0
4,925
# Copyright (c) 2015 Mirantis 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, so...
realsystem/CloudFerry
cloudferrylib/os/actions/check_rabbitmq.py
Python
apache-2.0
812
# Copyright (c) 2013 OpenStack Foundation # # 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 ...
projectcalico/calico-neutron
neutron/tests/unit/ml2/drivers/brocade/test_brocade_mechanism_driver.py
Python
apache-2.0
3,928
import argparse parser = argparse.ArgumentParser() parser.add_argument("keyfile", help="file with list of valid authentication keys") args = parser.parse_args() with open(args.keyfile) as fh: AUTH_KEYS = [line.strip() for line in fh.readlines()] AUTH_KEYS = filter(None, AUTH_KEYS) print "valid keys:", AUTH...
maverick-long/trajopt
misc_scripts/run_server.py
Python
bsd-2-clause
3,286
from __future__ import unicode_literals from datetime import datetime, date import time from django.test import TestCase from django.test.utils import override_settings from django.utils.dateformat import format from django.utils import dateformat from django.utils.timezone import utc, get_fixed_timezone, get_default...
ZhaoCJ/django
tests/utils_tests/test_dateformat.py
Python
bsd-3-clause
6,222
# -*- coding: utf-8 -*- # # Foobar documentation build configuration file, created by # sphinx-quickstart on Wed Nov 11 10:37:39 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
shakna-israel/rst2pdf
rst2pdf/tests/input/sphinx-issue166/conf.py
Python
mit
8,446
# 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 ...
yaqiyang/autorest
src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/auto_rest_long_running_operation_test_service.py
Python
mit
5,523
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of Ansible # # Ansible 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. ...
emersonsoftware/ansiblefork
lib/ansible/modules/windows/win_lineinfile.py
Python
gpl-3.0
6,901
################################################################################ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # # Read the zproject/README.md for information about making permanent changes. # #############################################################################...
opedroso/czmq
bindings/python_cffi/czmq_cffi/Zlist.py
Python
mpl-2.0
6,691
""" Tests for cohorts """ # pylint: disable=no-member import ddt from mock import call, patch from nose.plugins.attrib import attr import before_after from django.contrib.auth.models import User from django.db import IntegrityError from django.http import Http404 from django.test import TestCase from opaque_keys.edx....
synergeticsedx/deployment-wipro
openedx/core/djangoapps/course_groups/tests/test_cohorts.py
Python
agpl-3.0
33,664
""" Tests for open ended grading interfaces ./manage.py lms --settings test test lms/djangoapps/open_ended_grading """ import json import logging from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test.utils import override_settings f...
geekaia/edx-platform
lms/djangoapps/open_ended_grading/tests.py
Python
agpl-3.0
20,321
hostname, username, password = "ivory", "root", "password" import XenAPI try: session=XenAPI.Session('https://'+hostname) session.login_with_password(username, password) except XenAPI.Failure, e: if e.details[0]=='HOST_IS_SLAVE': session=XenAPI.Session('https://'+e.details[1]) session.lo...
Kakadu/xcp-xapi
ocaml/idl/binding_sanity_checks/tutorial_examples/nagios_snippet2.py
Python
lgpl-2.1
401
(dp0 VOpera 9.7 p1 (dp2 S'summary_display' p3 S'97.5%' p4 sS'total_runs' p5 L1L sS'summary_score' p6 F97.504621072088725 sS'results' p7 (dp8 S'failed' p9 (dp10 S'score' p11 I50 sS'raw_score' p12 L54L sS'display' p13 S'54' p14 ssS'passed' p15 (dp16 g11 I95 sg12 L2110L sg13 S'2110' p17 ssssVOpera 9.6 p18 (dp19 S'summary_...
shivanikhosa/browserscope
static_mode/selectors_2.py
Python
apache-2.0
39,739
# 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...
karllessard/tensorflow
tensorflow/python/kernel_tests/morphological_ops_test.py
Python
apache-2.0
18,791
# 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...
AsimmHirani/ISpyPi
tensorflow/contrib/tensorflow-master/tensorflow/contrib/distributions/python/kernel_tests/relaxed_bernoulli_test.py
Python
apache-2.0
6,647
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_glm, h2o_import as h2i, h2o_exec as h2e def define_params(): paramDict = { 'standardize': [None, 0,1], 'beta_epsilon': [None, 0.0001], 'family': ['binomial'], 'n_folds': [0], ...
111t8e/h2o-2
py/testdir_single_jvm/notest_GLM2_binomial_goalies.py
Python
apache-2.0
2,690
# -*- coding: utf-8 -*- # # 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 ...
KL-WLCR/incubator-airflow
airflow/contrib/hooks/aws_lambda_hook.py
Python
apache-2.0
2,088
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import datetime import json import uuid from django.core.exceptions import NON_FIELD_ERRORS from django.core.files.uploadedfile import SimpleUploadedFile from django.core.validators import RegexValidator from django.forms import ( Boolean...
weiawe/django
tests/forms_tests/tests/test_forms.py
Python
bsd-3-clause
143,367
# encoding: utf-8 """ Temporary stand-in for main oxml module that came across with the PackageReader transplant. Probably much will get replaced with objects from the pptx.oxml.core and then this module will either get deleted or only hold the package related custom element classes. """ from __future__ import absolu...
cchanrhiza/python-pptx
pptx/opc/oxml.py
Python
mit
4,842
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase from django.contrib.auth import get_user_model from fabric_bolt.projects import models from fabric_bolt...
jproffitt/fabric-bolt
fabric_bolt/web_hooks/tests/test_forms.py
Python
mit
3,489
import sys from sympy.external import import_module matchpy = import_module("matchpy") if not matchpy: #bin/test will not execute any tests now disabled = True if sys.version_info[:2] < (3, 6): disabled = True from sympy.core.symbol import symbols, Symbol from sympy.functions import log from sympy import...
wxgeo/geophar
wxgeometrie/sympy/integrals/rubi/tests/test_rubi_integrate.py
Python
gpl-2.0
2,481
#!/usr/bin/env python def val(X): if(X<6000): return 1 elif(X>10000): return 3 else: return 2
rjferrier/fluidity
tests/region_id_extrude_bathymetry_1p1d/regions.py
Python
lgpl-2.1
122
import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils def test_in(): iris = h2o.import_file(pyunit_utils.locate("smalldata/iris/iris.csv")) assert 5.1 in iris[0], "expected 5.1 to be in the first column, but it wasn't" assert 1.7 in iris, "expected 1.7 to be in the dataset, b...
madmax983/h2o-3
h2o-py/tests/testdir_munging/pyunit_in.py
Python
apache-2.0
623
# DExTer : Debugging Experience Tester # ~~~~~~ ~ ~~ ~ ~~ # # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception class ValueIR: """Data class to stor...
endlessm/chromium-browser
third_party/llvm/debuginfo-tests/dexter/dex/dextIR/ValueIR.py
Python
bsd-3-clause
1,450
from django.db import models from django.db.models.fields import FieldDoesNotExist from django.db.models.sql.constants import JOIN_TYPE, LHS_ALIAS, LHS_JOIN_COL, \ TABLE_NAME, RHS_JOIN_COL from django.utils.tree import Node from djangotoolbox.fields import ListField from dbindexer.lookups import StandardLookup OR ...
bdelliott/wordgame
web/dbindexer/backends.py
Python
mit
18,306
# -*- coding: utf-8 -*- # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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,...
hkariti/ansible
lib/ansible/playbook/play_context.py
Python
gpl-3.0
25,476
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2013, Peter Sprygada <sprygada@gmail.com> # # 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 ...
gundalow/ansible-modules-extras
web_infrastructure/ejabberd_user.py
Python
gpl-3.0
7,573
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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) an...
benjixx/ansible
lib/ansible/plugins/strategy/linear.py
Python
gpl-3.0
17,537
#! /usr/bin/env python # Last Change: Mon Aug 20 02:00 PM 2007 J try: from functools import partial except ImportError: from myfunctools import partial
scipy/scipy-svn
scipy/io/arff/utils.py
Python
bsd-3-clause
161
from nose.tools import * import networkx as nx def _setUp(self): cnlti = nx.convert_node_labels_to_integers self.grid = cnlti(nx.grid_2d_graph(4, 4), first_label=1, ordering="sorted") self.cycle = nx.cycle_graph(7) self.directed_cycle = nx.cycle_graph(7, create_using=nx.DiGraph()) self.XG = nx.DiG...
jni/networkx
networkx/algorithms/shortest_paths/tests/test_weighted.py
Python
bsd-3-clause
13,379
#!/usr/bin/env python import sys, os, re, subprocess, json from collections import defaultdict import numpy as np def shcmd(cmd): subprocess.call(cmd, shell=True) def main( args ): # if len(args) < 2: # print "Usage: ./pa-stats.py <.json file>" # return # dictionary of lists # dict_o...
kolewu/sirius
sirius-suite/scripts/calc-throughput.py
Python
bsd-3-clause
1,922
from __future__ import unicode_literals import datetime import os from decimal import Decimal from unittest import skipUnless from django import forms from django.core.exceptions import FieldError, ImproperlyConfigured, NON_FIELD_ERRORS from django.core.files.uploadedfile import SimpleUploadedFile from django.core.va...
diegoguimaraes/django
tests/model_forms/tests.py
Python
bsd-3-clause
104,816
"""SCons.Tool.m4 Tool-specific initialization for m4. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation # # Permission is h...
makinacorpus/mapnik2
scons/scons-local-1.2.0/SCons/Tool/m4.py
Python
lgpl-2.1
2,239
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from .jwplatform import JWPlatformIE class BusinessInsiderIE(InfoExtractor): _VALID_URL = r'https?://(?:[^/]+\.)?businessinsider\.(?:com|nl)/(?:[^/]+/)*(?P<id>[^/?#&]+)' _TESTS = [{ 'url': 'http://uk.businessins...
vinegret/youtube-dl
youtube_dl/extractor/businessinsider.py
Python
unlicense
1,998
# Copyright 2014, Doug Wiegley (dougwig), A10 Networks # # 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...
samsu/neutron
tests/unit/services/loadbalancer/drivers/logging_noop/test_logging_noop_driver.py
Python
apache-2.0
4,697
########################################################################## # # Copyright (c) 2011, 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: # # * Redistribu...
code-google-com/cortex-vfx
test/IECoreHoudini/procedurals/primitiveParameters/meshRender/meshRender-1.py
Python
bsd-3-clause
2,359
from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.rename_doc import get_link_fields from frappe.model.dynamic_links import dynamic_link_queries from frappe.permissions import reset_perms def execute(): frappe.reload_doctype("DocType") frappe.reload_doctype("Communication") ...
bcornwellmott/frappe
frappe/patches/v6_19/comment_feed_communication.py
Python
mit
7,625
# Copyright (C) 2013 Sugar Labs # # 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 the...
samdroid-apps/sugar
src/jarabe/view/alerts.py
Python
gpl-2.0
2,095
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from functools import partial from PyQt5.Qt import QAbstractListModel, Qt, QKeySequ...
ashang/calibre
src/calibre/gui2/shortcuts.py
Python
gpl-3.0
9,977
#!/usr/bin/env python import sys, getopt, argparse from kazoo.client import KazooClient import json from subprocess import call from os import makedirs import os import math from filechunkio import FileChunkIO from shutil import copy from boto.s3.connection import S3Connection class SemanticVectorsError(Exception): ...
SeldonIO/seldon-server
offline-jobs/sv/docker/scripts/semantic-vectors.py
Python
apache-2.0
4,712
# Copyright (c) 2016 Cloudbase Solutions Srl # # 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 applicab...
openstack/compute-hyperv
nova/virt/__init__.py
Python
apache-2.0
676
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement from tornado.escape import utf8, _unicode from tornado import gen from tornado.httpclient import HTTPResponse, HTTPError, AsyncHTTPClient, main, _RequestProxy from tornado import httputil from tornado.http1connection...
KILLER-CHIEF/uqcs-hackathon-2016
tornado/simple_httpclient.py
Python
gpl-3.0
24,692
""" sentry.db.models.fields.node ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function import collections import logging import six import warnings from django.d...
llonchj/sentry
src/sentry/db/models/fields/node.py
Python
bsd-3-clause
3,456
#!/usr/bin/env python # # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Writes dependency ordered list of native libraries. The list excludes any Android system libraries, as those are not bundled with...
guorendong/iridium-browser-ubuntu
build/android/gyp/write_ordered_libraries.py
Python
bsd-3-clause
4,010
#!/usr/bin/env python # Based heavily on the Bowtie 2 data manager wrapper script by Dan Blankenberg from __future__ import print_function import argparse import json import os import shlex import subprocess import sys DEFAULT_DATA_TABLE_NAME = "hisat2_indexes" def get_id_name(params, dbkey, fasta_description=None)...
loraine-gueguen/tools-iuc
data_managers/data_manager_hisat2_index_builder/data_manager/hisat2_index_builder.py
Python
mit
3,619
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
fargalaxy1/geonode-leaflet
geonode/contrib/geosites/views.py
Python
gpl-3.0
8,883
import os import os.path import sys sys.path.insert(0, os.path.abspath('lib')) from ansible.release import __version__, __author__ try: from setuptools import setup, find_packages except ImportError: print("Ansible now needs setuptools in order to build. Install it using" " your package manager (us...
gptech/ansible
setup.py
Python
gpl-3.0
3,121
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt def execute(filters=None): if not filters: filters = {} columns = get_columns() iwq_map = get_item_ware...
gangadhar-kadam/verve_test_erp
erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py
Python
agpl-3.0
2,265
""" Code generator script to make the Cython BLAS and LAPACK wrappers from the files "cython_blas_signatures.txt" and "cython_lapack_signatures.txt" which contain the signatures for all the BLAS/LAPACK routines that should be included in the wrappers. """ from collections import defaultdict from operator import itemge...
WarrenWeckesser/scipy
scipy/linalg/_generate_pyx.py
Python
bsd-3-clause
25,052
# 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...
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tensorflow/models/street/python/decoder.py
Python
bsd-2-clause
10,069
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files...
faith0811/zerorpc-python
zerorpc/context.py
Python
mit
7,967
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 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...
sajuptpm/neutron-ipam
neutron/plugins/linuxbridge/common/config.py
Python
apache-2.0
3,056
# 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...
arborh/tensorflow
tensorflow/python/util/deprecation_test.py
Python
apache-2.0
35,464
#!/usr/bin/env python # Author: Alex Tereschenko <alext.mkrs@gmail.com> # Copyright (c) 2016 Alex Tereschenko. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, includin...
w4ilun/mraa
tests/mock/spi_checks_freq.py
Python
mit
2,175
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
rosmo/ansible
lib/ansible/modules/network/f5/bigip_file_copy.py
Python
gpl-3.0
21,666
"Helpers function for mpl module." #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #-----...
akloster/bokeh
bokeh/compat/mpl_helpers.py
Python
bsd-3-clause
5,287
import xml.dom.minidom import sys import codecs f = open('./data/po/gui_strings.h', 'w') f.write( codecs.BOM_UTF8 ) def traverse(file, node, isChallenge, isGP, isKart, isTrack, isAchievements, level=0): for e in node.childNodes: if e.localName == None: continue #print ' '*le...
SuicSoft/stk-code
data/po/extract_strings_from_XML.py
Python
gpl-3.0
4,011