repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
Yarrick13/hwasp
tests/asp/AllAnswerSets/tight/bug.learning.03.asp.test.py
input = """ 1 2 2 1 3 4 1 3 2 1 2 4 1 4 0 0 1 5 2 1 6 7 1 6 2 1 5 7 1 7 0 0 1 8 2 1 9 10 1 9 2 1 8 10 1 10 0 0 1 11 2 1 12 13 1 12 2 1 11 13 1 13 0 0 1 14 1 0 2 1 15 1 0 5 1 16 1 0 8 1 17 1 0 11 1 18 1 0 2 1 19 1 0 5 1 20 1 0 2 1 21 1 0 5 1 22 1 0 8 1 23 1 0 11 1 21 2 1 19 20 1 24 1 1 18 1 23 1 0 8 1 25 1 1 18 1 26 1 0...
cloudera/hue
desktop/core/ext-py/Django-1.11.29/tests/gis_tests/gdal_tests/test_raster.py
""" gdalinfo tests/gis_tests/data/rasters/raster.tif: Driver: GTiff/GeoTIFF Files: tests/gis_tests/data/rasters/raster.tif Size is 163, 174 Coordinate System is: PROJCS["NAD83 / Florida GDL Albers", GEOGCS["NAD83", DATUM["North_American_Datum_1983", SPHEROID["GRS 1980",6378137,298.2572221010002...
mlperf/training_results_v0.7
NVIDIA/benchmarks/maskrcnn/implementations/pytorch/maskrcnn_benchmark/utils/c2_model_loading.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import logging import pickle from collections import OrderedDict import torch from maskrcnn_benchmark.utils.model_serialization import load_state_dict from maskrcnn_benchmark.utils.registry import Registry def _rename_basic_resnet_weights(layer...
wubr2000/googleads-python-lib
examples/dfa/v1_20/add_advertiser_user_filter.py
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
ShaneHarvey/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...
froyobin/horizon
openstack_dashboard/test/test_data/sahara_data.py
# 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 unde...
weblabdeusto/weblabdeusto
server/src/experiments/vm/user_manager/manager.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2005 onwards University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individual...
axinging/chromium-crosswalk
tools/android/loading/common_util_unittest.py
# Copyright 2016 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. import unittest import common_util class SerializeAttributesTestCase(unittest.TestCase): class Foo(object): def __init__(self, foo_fighters, whisky_...
andyzsf/django
django/db/models/fields/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import collections import copy import datetime import decimal import math import uuid import warnings from base64 import b64decode, b64encode from itertools import tee from django.apps import apps from django.db import connection from django.db.models.lo...
andrzejgorski/whylog
whylog/log_reader/read_utils.py
import os from whylog.log_reader.exceptions import EmptyFile, OffsetBiggerThanFileSize class ReadUtils(object): STANDARD_BUFFER_SIZE = 512 @classmethod def size_of_opened_file(cls, fh): prev_position = fh.tell() fh.seek(0, os.SEEK_END) size = fh.tell() fh.seek(prev_positi...
josenavas/QiiTa
qiita_db/handlers/tests/oauthbase.py
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
schoolie/bokeh
examples/howto/layouts/dashboard.py
import numpy as np from bokeh.layouts import layout from bokeh.models import CustomJS, Slider, ColumnDataSource, WidgetBox from bokeh.plotting import figure, output_file, show output_file('dashboard.html') tools = 'pan' def bollinger(): # Define Bollinger Bands. upperband = np.random.random_integers(100, 1...
mstriemer/amo-validator
validator/testcases/javascript/call_definitions.py
import math import re import actions import predefinedentities from jstypes import JSArray, JSObject, JSWrapper # Function prototypes should implement the following: # wrapper : The JSWrapper instace that is being called # arguments : A list of argument nodes; untraversed # traverser : The current traverser object...
lmazuel/azure-sdk-for-python
azure-servicebus/azure/servicebus/_common_serialization.py
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apa...
LockScreen/Backend
venv/lib/python2.7/site-packages/boto3/s3/transfer.py
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
ininex/geofire-python
resource/lib/python2.7/site-packages/gcloud/bigtable/test_instance.py
# 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 by applicable law or a...
Distrotech/PyQt-x11
examples/graphicsview/dragdroprobot/dragdroprobot_rc2.py
# -*- coding: utf-8 -*- # Resource object code # # Created: Wed Mar 20 13:39:06 2013 # by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x3a\x7c\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x...
mhugent/Quantum-GIS
tests/src/python/test_qgscomposershapes.py
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsComposerShape. .. note:: 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. """ ...
FFMG/myoddweb.piger
monitor/api/python/Python-3.7.2/Lib/idlelib/rpc.py
"""RPC Implementation, originally written for the Python Idle IDE For security reasons, GvR requested that Idle's Python execution server process connect to the Idle process, which listens for the connection. Since Idle has only one client per server, this was not a limitation. +---------------------------------+...
HBPNeurorobotics/nest-simulator
pynest/nest/tests/test_quantal_stp_synapse.py
# -*- coding: utf-8 -*- # # test_quantal_stp_synapse.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 th...
n4hy/gnuradio
volk/gen/make_c.py
# # Copyright 2010-2011 Free Software Foundation, 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 3 of the License, or # (at your option) any later version. # # This progra...
eduNEXT/edx-platform
common/lib/xmodule/xmodule/video_module/video_xfields.py
""" # lint-amnesty, pylint: disable=cyclic-import XFields for video module. """ import datetime from xblock.fields import Boolean, DateTime, Dict, Float, List, Scope, String from xmodule.fields import RelativeTime # Make '_' a no-op so we can scrape strings. Using lambda instead of # `django.utils.translation.ug...
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/scipy/stats/tests/test_kdeoth.py
from __future__ import division, print_function, absolute_import from scipy import stats import numpy as np from numpy.testing import assert_almost_equal, assert_, assert_raises, \ assert_array_almost_equal, assert_array_almost_equal_nulp, run_module_suite def test_kde_1d(): #some basic tests comparing to no...
hzj123/56th
pombola/place_data/bin/import_place_data.py
#!/usr/bin/env python import sys import csv import os import decimal os.environ['DJANGO_SETTINGS_MODULE'] = 'pombola.settings' sys.path.append('../../../') sys.path.append('../../') from django.utils.text import slugify from pombola.core.models import Place from pombola.place_data.models import Entry place_kind_sl...
rrooij/youtube-dl
youtube_dl/extractor/asiancrush.py
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .kaltura import KalturaIE from ..utils import ( extract_attributes, remove_end, ) class AsianCrushIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?asiancrush\.com/video/(?:[^/]+/)?0+(?P<id>\d+)v\...
leppa/home-assistant
tests/components/rfxtrx/test_light.py
"""The tests for the Rfxtrx light platform.""" import unittest import RFXtrx as rfxtrxmod import pytest from homeassistant.components import rfxtrx as rfxtrx_core from homeassistant.setup import setup_component from tests.common import get_test_home_assistant, mock_component @pytest.mark.skipif("os.environ.get('RF...
kawamon/hue
desktop/core/ext-py/eventlet-0.24.1/tests/subprocess_test.py
import sys import time import eventlet from eventlet.green import subprocess import eventlet.patcher import tests original_subprocess = eventlet.patcher.original('subprocess') def test_subprocess_wait(): # https://bitbucket.org/eventlet/eventlet/issue/89 # In Python 3.3 subprocess.Popen.wait() method acquire...
ewbankkit/cloud-custodian
tools/c7n_azure/c7n_azure/resources/vm.py
# Copyright 2018 Capital One Services, 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...
lukeiwanski/tensorflow-opencl
tensorflow/python/ops/image_ops_impl.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...
tempbottle/ironpython3
Src/StdLib/Lib/xml/dom/expatbuilder.py
"""Facility to use the Expat parser to load a minidom instance from a string or file. This avoids all the overhead of SAX and pulldom to gain performance. """ # Warning! # # This module is tightly bound to the implementation details of the # minidom DOM and can't be used with other DOM implementations. This # is due...
TomBaxter/osf.io
osf/models/nodelog.py
from include import IncludeManager from django.apps import apps from django.db import models from django.utils import timezone from osf.models.base import BaseModel, ObjectIDMixin from osf.utils.datetime_aware_jsonfield import DateTimeAwareJSONField from osf.utils.fields import NonNaiveDateTimeField from website.util ...
hinesmr/mica
util/pydevd/pysrc/pydevd_constants.py
''' This module holds the constants used for specifying the states of the debugger. ''' DEBUG_TRACE_LEVEL = -1 DEBUG_TRACE_BREAKPOINTS = -1 STATE_RUN = 1 STATE_SUSPEND = 2 try: __setFalse = False except: import __builtin__ setattr(__builtin__, 'True', 1) setattr(__builtin__, 'False', 0) class Deb...
mindriot101/bokeh
examples/plotting/file/pie.py
from math import pi import pandas as pd from bokeh.io import output_file, show from bokeh.palettes import Category20c from bokeh.plotting import figure from bokeh.transform import cumsum output_file("pie.html") x = { 'United States': 157, 'United Kingdom': 93, 'Japan': 89, 'China': 63, 'Germany'...
spilgames/mysql-statsd
mysql_statsd/mysql_statsd.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import Queue import signal import sys import os import threading import time from ConfigParser import ConfigParser from thread_manager import ThreadManager from thread_mysql import ThreadMySQL from thread_statsd import ThreadStatsd, ThreadFakeStatsd clas...
appleseedhq/cortex
python/IECoreMaya/FileSequenceParameterUI.py
########################################################################## # # Copyright (c) 2010, 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...
joshlk/scrapy
scrapy/tests/test_spidermiddleware_offsite.py
from unittest import TestCase from scrapy.http import Response, Request from scrapy.spider import Spider from scrapy.contrib.spidermiddleware.offsite import OffsiteMiddleware from scrapy.utils.test import get_crawler class TestOffsiteMiddleware(TestCase): def setUp(self): self.spider = self._get_spider(...
manevant/django-oscar
src/oscar/forms/widgets.py
import re from django import forms from django.core.files.uploadedfile import InMemoryUploadedFile from django.forms.util import flatatt from django.forms.widgets import FileInput from django.template import Context from django.template.loader import render_to_string from django.utils import formats, six from django.ut...
PermeAgility/FrameworkBenchmarks
toolset/run-tests.py
#!/usr/bin/env python import argparse import ConfigParser import sys import os import multiprocessing import itertools import copy import subprocess from pprint import pprint from benchmark.benchmarker import Benchmarker from setup.linux.unbuffered import Unbuffered from setup.linux import setup_util from ast import l...
okuta/chainer
chainer/functions/connection/bilinear.py
import numpy import chainer from chainer import backend from chainer import function_node from chainer.utils import type_check def _as_mat(x): if x.ndim == 2: return x return x.reshape(len(x), -1) def _ij_ik_il_to_jkl(a, b, c): ab = chainer.functions.matmul(a[:, :, None], b[:, None, :]) # ijk ...
mujin/jhbuild
jhbuild/commands/autobuild.py
# jhbuild - a tool to ease building collections of source packages # Copyright (C) 2001-2004 James Henstridge # # autobuild.py: non-interactive build that generates a report # # 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...
makerbot/ReplicatorG
skein_engines/skeinforge-35/skeinforge_application/skeinforge_plugins/craft_plugins/temperature.py
""" This page is in the table of contents. Temperature is a script to set the temperature for the object and raft. ==Operation== The default 'Activate Temperature' checkbox is on. When it is on, the functions described below will work, when it is off, the functions will not be called. ==Settings== ===Rate=== The def...
geodynamics/gale
gLucifer/config/SConfig/Platform.py
import os, platform import SCons.Script import SConfig class Platform(SConfig.Node): def __init__(self, scons_env, scons_opts, required=False): SConfig.Node.__init__(self, scons_env, scons_opts, required) self.checks = [self.print_results] # Will be set after successful configuration. ...
MiroK/dolfin
demo/undocumented/extrapolation/python/demo_extrapolation.py
# Copyright (C) 2010 Anders Logg # # This file is part of DOLFIN. # # DOLFIN 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 option) any later version. # #...
vguerci/Deluge.app
deluge/plugins/pluginbase.py
# # pluginbase.py # # Copyright (C) 2007-2010 Andrew Resch <andrewresch@gmail.com> # # Deluge is free software. # # You may 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 lat...
yzl0083/orange
Orange/OrangeWidgets/Visualize/__init__.py
""" ========= Visualize ========= Widgets for data visualization. """ # Category description for the widget registry NAME = "Visualize" DESCRIPTION = "Widgets for data visualization." BACKGROUND = "#FFB7B1" ICON = "icons/Category-Visualize.svg" PRIORITY = 2
mcltn/ansible
lib/ansible/inventory/__init__.py
# (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...
wwj718/ANALYSE
common/lib/xmodule/xmodule/modulestore/mixed.py
""" MixedModuleStore allows for aggregation between multiple modulestores. In this way, courses can be served up both - say - XMLModuleStore or MongoModuleStore """ import logging from contextlib import contextmanager import itertools import functools from contracts import contract, new_contract from opaque_keys im...
cactusbin/nyt
matplotlib/examples/pylab_examples/webapp_demo.py
#!/usr/bin/env python # -*- noplot -*- """ This example shows how to use the agg backend directly to create images, which may be of use to web application developers who want full control over their code without using the pyplot interface to manage figures, figure closing etc. .. note:: It is not necessary to avo...
brightchen/h2o-3
h2o-py/tests/testdir_hdfs/pyunit_HDFS_kmeans.py
#---------------------------------------------------------------------- # Purpose: This tests k-means on a large dataset. #---------------------------------------------------------------------- import sys sys.path.insert(1, "../../") import h2o, tests def hdfs_kmeans(): # Check if we are running inside the...
tensorflow/tensorflow
tensorflow/compiler/mlir/tfr/define_op_template.py
# 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...
duke8253/trafficserver
tests/gold_tests/pluginTest/cookie_remap/substitute.test.py
''' ''' # 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");...
cosmicAsymmetry/zulip
api/integrations/trac/zulip_trac.py
# -*- coding: utf-8 -*- # Copyright © 2012 Zulip, Inc. # # 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, including without limitation the rights # to use, copy, modify, ...
alexandrul-ci/robotframework
utest/utils/test_etreesource.py
import os import unittest from robot.utils.asserts import assert_equal, assert_true from robot.utils.etreewrapper import ETSource, ET from robot.utils import IRONPYTHON, PY3 PATH = os.path.join(os.path.dirname(__file__), 'test_etreesource.py') if PY3: unicode = str class TestETSource(unittest.TestCase): d...
huntxu/neutron
neutron/db/l3_dvr_ha_scheduler_db.py
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P. # 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/lic...
while519/SME
Tensor_exp.py
#! /usr/bin/python from model import * # Utils ---------------------------------------------------------------------- def load_file(path): return scipy.sparse.csr_matrix(cPickle.load(open(path)), dtype=theano.config.floatX) def compute_prauc(pred, lab): pred = np.asarray(pred) lab = np.asar...
rubenk/cobbler
cobbler/server/xmlrpclib2.py
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
backupManager/pyflag
src/plugins_old/NetworkForensics/ProtocolHandlers/POP.py
""" This module implements features specific for POP Processing """ # Michael Cohen <scudette@users.sourceforge.net> # Gavin Jackson <Gavz@users.sourceforge.net> # # ****************************************************** # Version: FLAG $Version: 0.87-pre1 Date: Thu Jun 12 00:48:38 EST 2008$ # ************************...
renesas-rz/u-boot-2013.04
tools/patman/patman.py
#!/usr/bin/python # # Copyright (c) 2011 The Chromium OS Authors. # # See file CREDITS for list of people who contributed to this # project. # # 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; eit...
VerifiableRobotics/LTLMoP
src/lib/execute.py
#!/usr/bin/env python """ ================================================= execute.py - Top-level hybrid controller executor ================================================= This module executes a hybrid controller for a robot in a simulated or real environment. :Usage: ``execute.py [-hn] [-p liste...
odoousers2014/odoo
addons/l10n_co/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) David Arnold (devCO). # Author David Arnold (devCO), dar@devco.co # Co-Authors Juan Pablo Aries (devCO), jpa@devco.co # Hector Ivan ...
cactusbin/nyt
matplotlib/examples/axes_grid/demo_colorbar_with_inset_locator.py
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes fig, (ax1, ax2) = plt.subplots(1, 2, figsize=[6, 3]) axins1 = inset_axes(ax1, width="50%", # width = 10% of parent_bbox width height="5%", # height : 50% loc=1) im...
showell/zulip
zilencer/migrations/0016_remote_counts.py
# Generated by Django 1.11.18 on 2019-02-02 06:02 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zilencer', '0015_delete_billing'), ] operations = [ migrations.CreateModel( name='RemoteInsta...
tylertian/Openstack
openstack F/python-novaclient/novaclient/crypto.py
# Copyright 2013 Nebula, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
KL-WLCR/incubator-airflow
airflow/default_login.py
# -*- 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 ...
jessicalucci/NovaOrc
nova/tests/api/openstack/compute/contrib/test_admin_actions_with_cells.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 Openstack Foundation # 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.a...
chandler14362/panda3d
contrib/src/sceneeditor/seBlendAnimPanel.py
################################################################# # collisionWindow.py # Written by Yi-Hong Lin, yihhongl@andrew.cmu.edu, 2004 ################################################################# # Import Tkinter, Pmw, and the floater code from this directory tree. from direct.tkwidgets.AppShell import * f...
ktan2020/legacy-automation
win/Lib/unittest/case.py
"""Test case implementation""" import collections import sys import functools import difflib import pprint import re import warnings from . import result from .util import ( strclass, safe_repr, unorderable_list_difference, _count_diff_all_purpose, _count_diff_hashable ) __unittest = True ...
ctrlaltdel/neutrinator
vendor/urllib3/util/ssl_.py
from __future__ import absolute_import import errno import warnings import hmac import re from binascii import hexlify, unhexlify from hashlib import md5, sha1, sha256 from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning from ..packages import six from ..packages.rfc3986 import abnf_regexp ...
alexlo03/ansible
test/units/modules/network/f5/test_bigip_gtm_pool.py
# -*- 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...
pankajn17/intern
web/db.py
""" Database API (part of web.py) """ __all__ = [ "UnknownParamstyle", "UnknownDB", "TransactionError", "sqllist", "sqlors", "reparam", "sqlquote", "SQLQuery", "SQLParam", "sqlparam", "SQLLiteral", "sqlliteral", "database", 'DB', ] import time try: import datetime except ImportError: datetime = Non...
israeltobias/DownMedia
youtube-dl/setup.py
#!/usr/bin/env python # coding: utf-8 from __future__ import print_function import os.path import warnings import sys try: from setuptools import setup, Command setuptools_available = True except ImportError: from distutils.core import setup, Command setuptools_available = False from distutils.spawn ...
gavioto/fiware-orion
test/acceptance/lettuce/integration/steps_lib/ngsi_request.py
# -*- coding: utf-8 -*- """ # Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U # # This file is part of Orion Context Broker. # # Orion Context Broker is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License as # published by the Free Software Foun...
xdevelsistemas/taiga-back-community
taiga/projects/userstories/migrations/0011_userstory_tribe_gig.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import picklefield.fields class Migration(migrations.Migration): dependencies = [ ('userstories', '0010_remove_userstory_watchers'), ] operations = [ migrations.AddField( ...
hj3938/FPGA-Imaging-Library
LocalFilter/ThresholdLocal/SoftwareSim/MeanFilter.py
""" Project FPGA-Imaging-Library Design MeanFilter Function Local filter - Mean filter, it always used for smoothing images. Module Software simulation. Version 1.0 Modified 2015-05-19 Copyright (C) 2015 Tianyu Dai (dtysky) <dtysky@outlook.com> This library is free software; you can redistribute it and/or modif...
kennedyshead/home-assistant
homeassistant/components/yi/camera.py
"""Support for Xiaomi Cameras (HiSilicon Hi3518e V200).""" import asyncio import logging from aioftp import Client, StatusCodeError from haffmpeg.camera import CameraMjpeg from haffmpeg.tools import IMAGE_JPEG, ImageFrame import voluptuous as vol from homeassistant.components.camera import PLATFORM_SCHEMA, Camera fro...
practice-vishnoi/dev-spark-1
examples/src/main/python/ml/simple_text_classification_pipeline.py
# # 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 us...
bp-kelley/rdkit
rdkit/Chem/test_data/BuildDescrsTestSet.Crippen.py
from rdkit import RDConfig import os.path import pickle from rdkit import Chem from rdkit.Chem import Descriptors descrs = ['SMR_VSA1', 'SMR_VSA10', 'SMR_VSA2', 'SMR_VSA3', 'SMR_VSA4', 'SMR_VSA5', 'SMR_VSA6', 'SMR_VSA7', 'SMR_VSA8', 'SMR_VSA9', 'SlogP_VSA1', 'SlogP_VSA10', 'SlogP_VSA11', 'SlogP_VS...
pbfy0/visvis
examples/surfaceFromRandomPoints.py
#!/usr/bin/env python """ Examples of using qhull via scipy to generate 3D plots in visvis. Requires numpy ver 1.5, scipy ver 0.9 and qhull from http://www.qhull.org/ (on Windows this comes with Scipy). plot3D meshes and plots random convex transformable data in both cartesian and spherical coordinates Play around wi...
JackDanger/sentry
src/sentry/templatetags/sentry_assets.py
from __future__ import absolute_import from django.conf import settings from django.template import Library from sentry import options from sentry.utils.assets import get_asset_url from sentry.utils.http import absolute_uri register = Library() register.simple_tag(get_asset_url, name='asset_url') @register.simpl...
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/google/appengine/ext/mapreduce/operation/counters.py
#!/usr/bin/env python # # Copyright 2007 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 o...
yongwen/makahiki
makahiki/apps/managers/log_mgr/admin.py
"""log model admin.""" from django.contrib import admin from django.db import models from django.forms.widgets import TextInput from apps.managers.challenge_mgr import challenge_mgr from apps.managers.log_mgr.models import MakahikiLog from apps.admin.admin import challenge_designer_site, challenge_manager_site, develop...
gunan/tensorflow
tensorflow/python/kernel_tests/pool_test.py
# 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...
rvs/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/basebackup/test_filespace.py
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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 ...
ChinaQuants/bokeh
bokeh/server/tests/test_auth.py
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2015, 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. #----------------------------------------...
scheib/chromium
tools/perf/contrib/cluster_telemetry/ct_benchmarks_unittest.py
# Copyright 2015 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. from optparse import OptionParser import unittest import six from telemetry.page import shared_page_state from contrib.cluster_telemetry import rasterize_...
GeassDB/xunlei-lixian
lixian_plugins/commands/get_torrent.py
from lixian_plugins.api import command from lixian_cli_parser import command_line_parser, command_line_option from lixian_cli_parser import with_parser from lixian_cli import parse_login from lixian_commands.util import create_client @command(name='get-torrent', usage='get .torrent by task id or info hash') @command...
sgerhart/ansible
lib/ansible/modules/cloud/pubnub/pubnub_blocks.py
#!/usr/bin/python # # PubNub Real-time Cloud-Hosted Push API and Push Notification Client # Frameworks # Copyright (C) 2016 PubNub Inc. # http://www.pubnub.com/ # http://www.pubnub.com/terms # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_i...
megaserg/pants
src/python/pants/util/osutil.py
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
jaeilepp/mne-python
tutorials/plot_brainstorm_phantom_ctf.py
# -*- coding: utf-8 -*- """ ======================================= Brainstorm CTF phantom tutorial dataset ======================================= Here we compute the evoked from raw for the Brainstorm CTF phantom tutorial dataset. For comparison, see [1]_ and: http://neuroimage.usc.edu/brainstorm/Tutorials/Phan...
agustinhenze/nikola.debian
tests/test_rst_compiler.py
# coding: utf8 # Author: Rodrigo Bistolfi # Date: 03/2013 """ Test cases for Nikola ReST extensions. A base class ReSTExtensionTestCase provides the tests basic behaivor. Subclasses must override the "sample" class attribute with the ReST markup. The sample will be rendered as HTML using publish_parts() by setUp(). O...
hip-odoo/odoo
addons/crm/models/crm_team.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models from odoo.tools.safe_eval import safe_eval class Team(models.Model): _name = 'crm.team' _inherit = ['mail.alias.mixin', 'crm.team'] resource_calendar_id = fields.Many2o...
AndrBecker/conference-central
utils.py
import json import os import time import uuid from google.appengine.api import urlfetch from models import Profile def getUserId(user, id_type="email"): if id_type == "email": return user.email() if id_type == "oauth": """A workaround implementation for getting userid.""" auth = os.g...
tylertian/Openstack
openstack F/nova/nova/scheduler/filters/extra_specs_ops.py
# Copyright (c) 2011 OpenStack, LLC. # 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 requi...
RackHD/RackHD
test/stream-monitor/sm_plugin/stream_monitor.py
""" Copyright (c) 2016-2017 Dell Inc. or its subsidiaries. All Rights Reserved. """ import logging import os from nose.plugins import Plugin from stream_sources import LoggingMarker, SelfTestStreamMonitor, AMQPStreamMonitor, SSHHelper import sys from nose.pyversion import format_exception from nose.plugins.xunit import...
chrsrds/scikit-learn
sklearn/feature_selection/univariate_selection.py
"""Univariate features selection.""" # Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay. # L. Buitinck, A. Joly # License: BSD 3 clause import numpy as np import warnings from scipy import special, stats from scipy.sparse import issparse from ..base import BaseEstimator from ..prepr...
crosswalk-project/crosswalk-test-suite
apptools/apptools-android-tests/apptools/manifest_xwalk_target_platforms.py
#!/usr/bin/env python # # Copyright (c) 2016 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
samvarankashyap/googlecloudutility2
lib/simplejson/simplejson/encoder.py
"""Implementation of JSONEncoder """ from __future__ import absolute_import import re from operator import itemgetter # Do not import Decimal directly to avoid reload issues import decimal from .compat import u, unichr, binary_type, string_types, integer_types, PY3 def _import_speedups(): try: from . import...
pior/moto
tests/test_ec2/test_key_pairs.py
from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises import boto import six import sure # noqa from boto.exception import EC2ResponseError from moto import mock_ec2 @mock_ec2 def test_key_pai...
vicky2135/lucious
src/oscar/apps/basket/migrations/0002_auto_20140827_1705.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('partner', '0001_initial'), ('catalogue', '0001_initial'), ('basket', '0001_initial'), ...
particl/particl-core
test/functional/feature_maxtipage.py
#!/usr/bin/env python3 # Copyright (c) 2022 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test logic for setting nMaxTipAge on command line. Nodes don't consider themselves out of "initial block do...