repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
jumpstarter-io/horizon
openstack_dashboard/dashboards/admin/images/properties/forms.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 # d...
NeCTAR-RC/horizon
openstack_dashboard/dashboards/admin/rbac_policies/views.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 under t...
thomasem/nova
nova/objects/external_event.py
# Copyright 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 a...
mrknow/filmkodi
plugin.video.fanfilm/resources/lib/resolvers/sawlive.py
# -*- coding: utf-8 -*- ''' FanFilm Add-on Copyright (C) 2015 lambda 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 ...
jcfr/Midas
modules/visualize/python/pvw-plugins/midasvr.py
import pwsimple # Midas volume rendering ParaviewWeb plugin # Initialize the volume rendering state def InitViewState (cameraFocalPoint, cameraPosition, colorArrayName, colorMap, sofPoints, viewSize): if type(colorArrayName) is unicode: colorArrayName = colorArrayName.encode('ascii', 'ignore') activeView =...
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_group_norm.py
# Copyright (c) 2021 PaddlePaddle 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 ap...
eayunstack/python-neutronclient
neutronclient/tests/unit/qos/test_cli20_rule.py
# Copyright 2015 Huawei Technologies India Pvt Ltd. # 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 # # ...
luci/luci-py
appengine/swarming/swarming_bot/swarmingserver_bot_fake.py
# Copyright 2014 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. import base64 import copy import json import os import sys import threading BOT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.insert...
hehongliang/tensorflow
tensorflow/python/kernel_tests/signal/mfcc_ops_test.py
# Copyright 2017 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...
yufeldman/arrow
python/pyarrow/tests/test_types.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 u...
phonnz/azure-storage-python
tests/test_storage_queue.py
# coding: utf-8 #------------------------------------------------------------------------- # 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 #...
krocat/ToonHA
toon/switch.py
""" Support for Eneco Slimmer stekkers (Smart Plugs). This provides controls for the z-wave smart plugs Toon can control. """ import logging from homeassistant.components.switch import SwitchDevice import custom_components.toon as toon_main _LOGGER = logging.getLogger(__name__) def setup_platform(hass, config, add...
quattor/aquilon
lib/aquilon/worker/commands/unbind_client_cluster.py
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,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 ma...
riscmaster/risc_maap
risc_control/src/IRIS_DF_Controller.py
#!/usr/bin/env python '''====================================================== Created by: D. Spencer Maughan Last updated: May 2015 File name: IRIS_DF_Controller.py Organization: RISC Lab, Utah State University Notes: ======================================================''' import roslib;...
sklam/numba
numba/core/imputils.py
""" Utilities to simplify the boilerplate for native lowering. """ import collections import contextlib import inspect import functools from enum import Enum from numba.core import typing, types, utils, cgutils from numba.core.typing.templates import BaseRegistryLoader class Registry(object): """ A registr...
sjsrey/pysal_core
pysal_core/io/IOHandlers/tests/test_gwt.py
import unittest from ..gwt import GwtIO from ...FileIO import FileIO as psopen from .... import examples as pysal_examples import tempfile import os import warnings class test_GwtIO(unittest.TestCase): def setUp(self): self.test_file = test_file = pysal_examples.get_path('juvenile.gwt') self.obj =...
richardcornish/django-itunespodcast
podcast/tests/__init__.py
from __future__ import unicode_literals import os import datetime from django.test import TestCase, Client, override_settings from django.utils import timezone from ..models import Show, Episode, Enclosure try: from django.urls import reverse except ImportError: from django.core.urlresolvers import reverse ...
hellhovnd/dentexchange
dentexchange/apps/libs/mixins/views.py
# -*- coding:utf-8 -*- import urlparse from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.http.response import HttpResponseBadRequest from .base import Mixin from .. import strings class SuccessURLAliasViewMixin(Mixin): def get_success_url(self): return revers...
Joergen/olympia
sites/identitystage/settings_base.py
"""private_base will be populated from puppet and placed in this directory""" import logging import os import dj_database_url from lib.settings_base import ( CACHE_PREFIX, ES_INDEXES, KNOWN_PROXIES, LOGGING, CSP_SCRIPT_SRC, CSP_FRAME_SRC) from .. import splitstrip import private_base as private ENGAGE_ROBO...
youtube/cobalt
third_party/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
""" Test lldb-mi -var-xxx commands. """ from __future__ import print_function import lldbmi_testcase from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class MiVarTestCase(lldbmi_testcase.MiTestCaseBase): mydir = TestBase.compute_mydir(__file__) ...
JensGrabner/mpmath
mpmath/calculus/polynomials.py
from ..libmp.backend import xrange from .calculus import defun #----------------------------------------------------------------------------# # Polynomials # #----------------------------------------------------------------------------# # XXX: extra preci...
larsmans/numpy
numpy/lib/tests/test_io.py
from __future__ import division, absolute_import, print_function import sys import gzip import os import threading from tempfile import mkstemp, NamedTemporaryFile import time import warnings import gc from io import BytesIO from datetime import datetime import numpy as np import numpy.ma as ma from numpy.lib._iotool...
ajrichards/bayesian-examples
python/howto-logging.py
#!/usr/bin/env python import time,os,re,csv,sys,uuid,joblib from datetime import date import numpy as np from sklearn import svm from sklearn import datasets from sklearn.model_selection import train_test_split from sklearn.metrics import classification_report def train_model(X,y,saved_model): """ function t...
alexmoratalla/yambopy
yambopy/units.py
I = complex(0,1) ha2ev = 27.211396132 ev2cm1 = 8065.5440044136285 bohr2ang = 0.52917720859 atomic_mass = [ None, 1.00794, 4.002602, 6.941, 9.012182, 10.811, 12.0107, 14.0067, 15.9994, 18.9984032, 20.1797, 22.98976928, 24.305,26.9815386, 28.0855, ...
pombredanne/parakeet
parakeet/ndtypes/fn_type.py
from core_types import IncompatibleTypes, ImmutableT class FnT(ImmutableT): """Type of a typed function""" def __init__(self, input_types, return_type): self.input_types = tuple(input_types) self.return_type = return_type self._hash = hash(self.input_types + (return_type,)) def __str__(self): ...
standage/tag
tag/__init__.py
#!/usr/bin/env python # # ----------------------------------------------------------------------------- # Copyright (C) 2015 Daniel Standage <daniel.standage@gmail.com> # # This file is part of tag (http://github.com/standage/tag) and is licensed # under the BSD 3-clause license: see LICENSE. # ------------------------...
dekom/threepress-bookworm-read-only
bookworm/gdata/tests/all_tests_coverage.py
#!/usr/bin/env python # # Copyright (C) 2009 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...
Just-D/chromium-1
content/test/gpu/gpu_tests/gpu_test_expectations.py
# Copyright 2014 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 test_expectations # Valid expectation conditions are: # # Operating systems: # win, xp, vista, win7, mac, leopard, snowleopard, lion, mountainlio...
mvaled/sentry
tests/sentry/api/endpoints/test_monitor_checkins.py
from __future__ import absolute_import, print_function from datetime import timedelta from django.utils import timezone from freezegun import freeze_time from sentry.models import CheckInStatus, Monitor, MonitorCheckIn, MonitorStatus, MonitorType from sentry.testutils import APITestCase @freeze_time("2019-01-01") c...
nnrcschmdt/helsinki
program/management/commands/check_automation_ids.py
import json from os.path import join from django.conf import settings from django.core.management.base import NoArgsCommand from program.models import ProgramSlot class Command(NoArgsCommand): help = 'checks the automation_ids used by program slots against the exported' def handle_noargs(self, **options): ...
lfairchild/PmagPy
programs/core_depthplot.py
#!/usr/bin/env pythonw #from __future__ import print_function import sys import wx import os import matplotlib if matplotlib.get_backend() != "WXAgg": matplotlib.use("WXAgg") import matplotlib.pyplot as plt from pmagpy import pmagplotlib import pmagpy.command_line_extractor as extractor import pmagpy.ipmag as ipm...
FrancoisRheaultUS/dipy
doc/examples/sfm_reconst.py
""" .. _sfm-reconst: ============================================== Reconstruction with the Sparse Fascicle Model ============================================== In this example, we will use the Sparse Fascicle Model (SFM) [Rokem2015]_, to reconstruct the fiber Orientation Distribution Function (fODF) in every voxel. ...
thypad/brew
skensemble/selection/dynamic/dsknn.py
import numpy as np from brew.base import Ensemble from brew.metrics.diversity.paired import kuncheva_double_fault_measure from .base import DCS class DSKNN(DCS): """DS-KNN The DS-KNN selects an ensemble of classifiers based on their accuracy and diversity in the neighborhood of the test sample. ...
mosajjal/mitmproxy
mitmproxy/contrib/kaitaistruct/jpeg.py
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild # The source was jpeg.ksy from here - https://github.com/kaitai-io/kaitai_struct_formats/blob/24e2d00048b8084ceec30a187a79cb87a79a48ba/image/jpeg.ksy import array import struct import zlib from enum import Enum from kai...
KellyChan/python-examples
python/data_science/Titanic/complexHeuristic.py
import numpy import pandas import statsmodels.api as sm def complex_heuristic(file_path): ''' You are given a list of Titantic passengers and their associating information. More information about the data can be seen at the link below: http://www.kaggle.com/c/titanic-gettingStarted/data For this e...
b1naryth1ef/rowboat
rowboat/types/guild.py
import os from holster.enum import Enum from rowboat.types import Model, SlottedModel, Field, DictField, text, raw, rule_matcher CooldownMode = Enum( 'GUILD', 'CHANNEL', 'USER', ) class PluginConfigObj(object): client = None class PluginsConfig(Model): def __init__(self, inst, obj): s...
KnightOS/packages.knightos.org
packages/config.py
import logging try: from configparser import ConfigParser except ImportError: # Python 2 support from ConfigParser import ConfigParser logger = logging.getLogger("packges.knightos.org") logger.setLevel(logging.DEBUG) sh = logging.StreamHandler() sh.setLevel(logging.DEBUG) formatter = logging.Formatter("%...
Spiderlover/Toontown
otp/friends/PlayerFriendsManager.py
from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal from direct.directnotify.DirectNotifyGlobal import directNotify from otp.otpbase import OTPGlobals from otp.avatar.Avatar import teleportNotify from otp.friends import FriendResponseCodes class PlayerFriendsManager(DistributedObjectGlobal):...
JoshuaSkelly/TroubleInCloudLand
main.py
#!/usr/bin/python import pygame import enemies from core import balloon, bullet, game, gem, particle, player, world from scenes import credits, scene, splashscreen from ui import menu, text from utils import prettyprint, utility, vector from utils.settings import * pygame.init() utility.read_settings() if settings...
SohoTechLabs/django-ajax-changelist
ajax_changelist/admin.py
from django import http from django.conf.urls import patterns from django.contrib import admin from django.db import models from django.forms.models import modelform_factory from django.shortcuts import get_object_or_404 from django.template import loader, Context from django.views.generic import View def get_printab...
a113n/bcbio-nextgen
scripts/bcbio_setup_genome.py
#!/usr/bin/env python -Es """ Script to set up a custom genome for bcbio-nextgen """ from __future__ import print_function from argparse import ArgumentParser import collections import gzip import os from Bio import SeqIO import toolz as tz from bcbio.utils import safe_makedir, file_exists, chdir, is_gzipped from bcb...
sserrot/champion_relationships
venv/Lib/site-packages/jedi/api/file_name.py
import os from jedi._compatibility import FileNotFoundError, force_unicode, scandir from jedi.api import classes from jedi.api.strings import StringName, get_quote_ending from jedi.api.helpers import match from jedi.inference.helpers import get_str_or_none class PathName(StringName): api_type = u'path' def com...
EmanueleCannizzaro/scons
src/engine/SCons/Tool/mssdk.py
# # Copyright (c) 2001 - 2016 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 the Software without restriction, including # without limitation the rights to use, copy, modify, merge...
indro/t2c
apps/external_apps/django_openid/admin.py
from django.contrib.auth.models import User from django.contrib.auth.admin import UserAdmin from django.contrib import admin from django.contrib.admin.sites import NotRegistered from models import UserOpenidAssociation class OpenIDInline(admin.StackedInline): model = UserOpenidAssociation class UserAdminWithOpen...
Toilal/mailinabox
tools/mail.py
#!/usr/bin/python3 import sys, getpass, urllib.request, urllib.error, json def mgmt(cmd, data=None, is_json=False): # The base URL for the management daemon. (Listens on IPv4 only.) mgmt_uri = 'http://127.0.0.1:10222' setup_key_auth(mgmt_uri) req = urllib.request.Request(mgmt_uri + cmd, urllib.parse.urlencode(d...
kellinm/blivet
blivet/flags.py
# flags.py # # Copyright (C) 2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that...
lmotta/Roam
src/configmanager/editorwidgets/listwidget.py
import os from functools import partial from PyQt4.QtGui import QWidget from PyQt4.QtCore import Qt from qgis.core import QgsMapLayer from qgis.gui import QgsExpressionBuilderDialog from roam.api.utils import layer_by_name from configmanager.models import QgsLayerModel, QgsFieldModel from configmanager.editorwidget...
hanyassasa87/ns3-802.11ad
doc/manual/source/conf.py
# -*- coding: utf-8 -*- # # test documentation build configuration file, created by # sphinx-quickstart on Sun Jun 26 00:00:43 2016. # # 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 ...
AlbertoPeon/invenio
modules/bibupload/lib/batchuploader_engine.py
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011, 2012, 2013 CERN. ## ## Invenio 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 ...
codewarrior0/Shiboken
tests/py3kcompat.py
# -*- coding: utf-8 -*- # # This file is part of the Shiboken Python Bindings Generator project. # # Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). # # Contact: PySide team <contact@pyside.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Le...
Mellthas/quodlibet
quodlibet/qltk/tagsfrompath.py
# Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna # # 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. impor...
jazzmes/pyroute2
pyroute2/netlink/rtnl/ifaddrmsg.py
import socket from pyroute2.common import map_namespace from pyroute2.netlink import nlmsg from pyroute2.netlink import nla # address attributes # # Important comment: # For IPv4, IFA_ADDRESS is a prefix address, not a local interface # address. It makes no difference for normal interfaces, but # for point-to-point on...
pragmatux/systemd
src/python-systemd/journal.py
# -*- Mode: python; coding:utf-8; indent-tabs-mode: nil -*- */ # # This file is part of systemd. # # Copyright 2012 David Strauss <david@davidstrauss.net> # Copyright 2012 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> # Copyright 2012 Marti Raudsepp <marti@juffo.org> # # systemd is free software; you can redist...
tardyp/buildbot
master/buildbot/db/steps.py
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
ElectroCode/lurklib
lurklib/connection.py
# This file is part of Lurklib. # Copyright (C) 2011 LK- # # Lurklib 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....
Gustry/inasafe
safe/metadata/generic_layer_metadata.py
# -*- coding: utf-8 -*- """ InaSAFE Disaster risk assessment tool developed by AusAid - **metadata module.** Contact : ole.moller.nielsen@gmail.com .. 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 Sof...
ron1818/Singaboat_RobotX2016
robotx_nav/nodes/move_base_force_cancel.py
#! /usr/bin/env python import rospy import actionlib from move_base_msgs.msg import MoveBaseActionGoal from actionlib_msgs.msg import GoalID class ForceCancel(object): def __init__(self, nodename="force_cancel", is_newnode=True, repetition=10): self.repetition = rospy.get_param("~repetition", repetition) ...
Baloc/TouSIX-Manager
tousix_manager/Administration/adminsite.py
# Copyright 2015 Rémy Lapeyrade <remy at lapeyrade dot net> # Copyright 2015 LAAS-CNRS # # # This file is part of TouSIX-Manager. # # TouSIX-Manager 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 Founda...
stephane-caron/pymanoid
pymanoid/ik.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015-2020 Stephane Caron <stephane.caron@normalesup.org> # # This file is part of pymanoid <https://github.com/stephane-caron/pymanoid>. # # pymanoid is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public Lic...
iCarto/siga
extScripting/scripts/jython/Lib/xml/dom/html/HTMLStyleElement.py
######################################################################## # # File Name: HTMLStyleElement # # Documentation: http://docs.4suite.com/4DOM/HTMLStyleElement.html # ### This file is automatically generated by GenerateHtml.py. ### DO NOT EDIT! """ WWW: http://4suite.com/4DOM e-mail...
356255531/SpikingDeepRLControl
code/EnvBo/Q-Learning/Testing_Arm_4points/q_networks.py
#!/usr/bin/python import numpy as np import os import sys from keras.layers import Activation, Dense, Input from keras.layers.normalization import BatchNormalization from keras.models import Model, Sequential from keras.optimizers import RMSprop NUM_OF_HIDDEN_NEURONS = 100 QNETWORK_NAME = 'online_netw...
spbguru/repo1
nupic/support/__init__.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, 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...
reedloden/ansible
lib/ansible/executor/task_queue_manager.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...
DevinDewitt/pyqt5
examples/mainwindows/sdi/sdi_rc.py
# -*- coding: utf-8 -*- # Resource object code # # Created: Sun May 12 18:04:51 2013 # by: The Resource Compiler for PyQt (Qt v5.0.2) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x03\x54\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\...
dvitme/odoo-addons
portal_partner_fix/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/boto/exception.py
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # All rights reserved. # # 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 res...
abstract-open-solutions/l10n-italy
l10n_it_ricevute_bancarie/models/account_config.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012 Andrea Cometa. # Email: info@andreacometa.it # Web site: http://www.andreacometa.it # Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright (C) 2012 ...
rven/odoo
addons/microsoft_calendar/models/res_users.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging import requests from odoo.addons.microsoft_calendar.models.microsoft_sync import microsoft_calendar_token from datetime import timedelta from odoo import api, fields, models, _ from odoo.exceptions import...
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/sympy/utilities/tests/test_codegen.py
from StringIO import StringIO from sympy.core import symbols, Eq, pi, Catalan, Lambda, Dummy from sympy.utilities.codegen import CCodeGen, Routine, InputArgument, Result, \ CodeGenError, FCodeGen, codegen, CodeGenArgumentListError, OutputArgument, \ InOutArgument from sympy.utilities.pytest import XFAIL, raise...
voutilad/courtlistener
cl/corpus_importer/dup_helpers.py
import string from django.utils.text import slugify from django.utils.timezone import now from lxml import html from lxml.html import tostring from lxml.html.clean import Cleaner from cl.lib.string_utils import anonymize, trunc from cl.search.models import OpinionCluster from juriscraper.lib.string_utils import clean_...
FriedrichK/volunteer_planner
shiftmailer/management/commands/mailer.py
# coding: utf-8 import datetime from django.core.management.base import BaseCommand # from django.template.loader import render_to_string from django.db.models import Count from scheduler.models import Need from shiftmailer.models import Mailer from shiftmailer.excelexport import GenerateExcelSheet DATE_FORMAT = '...
josephhardinee/PyDisdrometer
pydsd/tests/testNasa2DVDReader_mc3e.py
import numpy as np import unittest from ..aux_readers import NASA_2DVD_reader class TestNasa2DvdReaderMc3eSubcase(unittest.TestCase): "Test module for the NASA_2DVD_reader class in pydsd.aux_io.NASA_2DVD_reader for mc3e files" def setUp(self): filename = "testdata/nasa_gv_mc3e_2dvd_test.txt" ...
x8lucas8x/python-zeroless
tests/test_client_server.py
import pytest from zeroless import (Server, Client) class TestClientServer: def test_server_port_property(self): port = 1050 server = Server(port=port) assert server.port == port def test_client_addresses_property(self): client = Client() addresses = (('10.0.0.1', 156...
ProfessorKaos64/openlierox
share/gamedir/scripts/tools/army_patterns/hungry_zombie_kittens.py
#!/usr/bin/python3 -u #---- Includes ----# from ..army_architect import Bot_blueprint, Army_blueprint #---- General Settings ----# army_name = "The Hungry Zombie Kittens" army_description = "Previously these kittens ate cat food. But now they wan't to eat your freakin' soul! (And your body to of course, after they rip...
jakirkham/volumina
volumina/layerwidget_plugin.py
############################################################################### # volumina: volume slicing and editing library # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/or # modify it und...
cwmartin/rez
src/rez/release_vcs.py
from rez.exceptions import ReleaseVCSError from rez.packages_ import get_developer_package from rez.util import which from rez.utils.system import popen from rez.utils.logging_ import print_debug from rez.utils.filesystem import walk_up_dirs from pipes import quote import subprocess def get_release_vcs_types(): "...
benfinke/ns_python
nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationradiuspolicy_authenticationvserver_binding.py
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
YoshikawaMasashi/magenta
magenta/music/notebook_utils.py
# Copyright 2016 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 ag...
PawarPawan/h2o-v3
h2o-py/tests/testdir_algos/kmeans/pyunit_ozoneKmeans.py
import sys sys.path.insert(1, "../../../") import h2o def ozoneKM(ip, port): # Connect to a pre-existing cluster # connect to localhost:54321 train = h2o.import_file(path=h2o.locate("smalldata/glm_test/ozone.csv")) # See that the data is ready print train.describe() # Run KMeans my_km = h2o.kmeans(x...
arju88nair/projectCulminate
venv/lib/python3.5/site-packages/astroid/raw_building.py
# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2014-2016 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2014 Google, Inc. # Copyright (c) 2015-2016 Cara Vinson <ceridwenv@gmail.com> # Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html ...
alex/flanker
flanker/mime/message/headers/encodedword.py
# coding:utf-8 import logging import regex as re import email.quoprimime import email.base64mime from base64 import b64encode from flanker.mime.message import charsets, errors log = logging.getLogger(__name__) #deal with unfolding foldingWhiteSpace = re.compile(r"(\n\r?|\r\n?)(\s*)") def unfold(value): """ ...
derekjchow/models
research/feelvos/utils/video_input_generator.py
# 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 applicab...
dakiri/splunk-app-twitter
twitter2/bin/twython/streaming/types.py
# -*- coding: utf-8 -*- """ twython.streaming.types ~~~~~~~~~~~~~~~~~~~~~~~ This module contains classes and methods for :class:`TwythonStreamer` to use. """ class TwythonStreamerTypes(object): """Class for different stream endpoints Not all streaming endpoints have nested endpoints. User Streams and S...
jawilson/home-assistant
homeassistant/components/hive/light.py
"""Support for Hive light devices.""" from datetime import timedelta from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, LightEntity, ) from homeassistant.helpers.entity import DeviceInfo import...
joelagnel/trappy
trappy/plotter/ILinePlot.py
# Copyright 2015-2017 ARM Limited # # 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 w...
mdrumond/tensorflow
tensorflow/contrib/eager/python/network_test.py
# Copyright 2017 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...
gunan/tensorflow
tensorflow/python/keras/engine/training_dataset_test.py
# 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...
dshlai/oyprojectmanager
oyProjectManager/db/__init__.py
# -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Erkan Ozgur Yilmaz # # This module is part of oyProjectManager and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause """ Database Module =============== This is where all the magic happens. .. versionadded:: 0.2.0 SQLite3 Datab...
shidasan/konoha2
src/vm/pygenlib2.py
import os, sys ########### def verbose_print(msg): print msg ########### def linetrim(s): return s.replace('\r', '').replace('\n','') ### def sublast(s, s2): return s[s.find(s2)+len(s2):] def parse_package(fpath): #p = fpath[:fpath.rfind('/')] p = fpath package = 'konoha' if p.find('/konoha/') != -1: ret...
spreg-git/pysal
pysal/esda/mapclassify.py
""" A module of classification schemes for choropleth mapping. """ __author__ = "Sergio J. Rey" __all__ = ['Map_Classifier', 'quantile', 'Box_Plot', 'Equal_Interval', 'Fisher_Jenks', 'Fisher_Jenks_Sampled', 'Jenks_Caspall', 'Jenks_Caspall_Forced', 'Jenks_Caspall_Sampled', 'Max_P_Classi...
sharad1126/owtf
tests/test_cases/framework/plugin/plugin_params_tests.py
from tests.testing_framework.base_test_cases import BaseTestCase from flexmock import flexmock from hamcrest import * from framework.plugin.plugin_params import PluginParams import re from hamcrest.library.text.stringmatches import matches_regexp class PluginParamsTests(BaseTestCase): def before(self): s...
toontownfunserver/Panda3D-1.9.0
direct/tkwidgets/Floater.py
""" Floater Class: Velocity style controller for floating point values with a label, entry (validated), and scale """ __all__ = ['Floater', 'FloaterWidget', 'FloaterGroup'] from direct.showbase.TkGlobal import * from Tkinter import * from Valuator import Valuator, VALUATOR_MINI, VALUATOR_FULL from dir...
QInfer/python-qinfer
src/qinfer/domains.py
#!/usr/bin/python # -*- coding: utf-8 -*- ## # domains.py: module for domains of model outcomes ## # © 2017, Chris Ferrie (csferrie@gmail.com) and # Christopher Granade (cgranade@cgranade.com). # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the...
fboers/jumeg
examples/connectivity/plot_degree_circle.py
#!/usr/bin/env python ''' Plot degree values for a given set of nodes in a simple circle plot. ''' import numpy as np import matplotlib.pyplot as plt import mne from jumeg import get_jumeg_path from jumeg.connectivity import plot_degree_circle import bct orig_labels_fname = get_jumeg_path() + '/data/desikan_label_...
suziesparkle/wagtail
wagtail/vendor/django-treebeard/treebeard/tests/test_treebeard.py
# -*- coding: utf-8 -*- """Unit/Functional tests""" from __future__ import with_statement, unicode_literals import datetime import os import sys from django.contrib.admin.sites import AdminSite from django.contrib.admin.views.main import ChangeList from django.contrib.auth.models import User from django.contrib.messa...
dcramer/django-db-log
djangodblog/helpers.py
from django.conf import settings from django.template import (Template, Context, TemplateDoesNotExist, TemplateSyntaxError) from django.utils.encoding import smart_unicode from django.utils.hashcompat import md5_constructor from django.views.debug import ExceptionReporter class ImprovedExceptionReporter(ExceptionR...
temmeand/scikit-rf
qtapps/skrf_qtwidgets/networkPlotWidget.py
from collections import OrderedDict from math import sqrt import numpy as np import pyqtgraph as pg from qtpy import QtWidgets import skrf from . import smith_chart, util class NetworkPlotWidget(QtWidgets.QWidget): S_VALS = OrderedDict(( ("decibels", "db"), ("magnitude", "mag"), ("phase ...
DudLab/nanshe
nanshe/__init__.py
""" ``nanshe`` package, an image processing toolkit. =============================================================================== Overview =============================================================================== The ``nanshe`` package is an image processing package that contains a variety of different techn...
catapult-project/catapult
telemetry/telemetry/core/memory_cache_http_server_unittest.py
# Copyright 2014 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 __future__ import absolute_import import os from telemetry.core import util from telemetry.core import memory_cache_http_server from telemetry.testing ...
witcxc/scipy
scipy/cluster/hierarchy.py
""" ======================================================== Hierarchical clustering (:mod:`scipy.cluster.hierarchy`) ======================================================== .. currentmodule:: scipy.cluster.hierarchy These functions cut hierarchical clusterings into flat clusterings or find the roots of the forest f...