repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
DinoCow/airflow
airflow/contrib/operators/gcs_list_operator.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...
jackylk/incubator-carbondata
python/pycarbon/core/carbon_reader.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 use ...
flimzy/couchapp
couchapp/errors.py
# -*- coding: utf-8 -*- # # This file is part of couchapp released under the Apache 2 license. # See the NOTICE for more information. from restkit import ResourceError class AppError(Exception): """ raised when a application error appear """ class MacroError(Exception): """ raised for macro errors""" cl...
kennedyshead/home-assistant
homeassistant/components/uvc/camera.py
"""Support for Ubiquiti's UVC cameras.""" from __future__ import annotations from datetime import datetime import logging import re import requests from uvcclient import camera as uvc_camera, nvr import voluptuous as vol from homeassistant.components.camera import PLATFORM_SCHEMA, SUPPORT_STREAM, Camera from homeass...
christi3k/zulip
analytics/tests/test_views.py
from __future__ import absolute_import from django.utils.timezone import get_fixed_timezone, utc from zerver.lib.test_classes import ZulipTestCase from zerver.lib.timestamp import ceiling_to_hour, ceiling_to_day, \ datetime_to_timestamp from zerver.models import Realm, UserProfile, Client, get_realm, \ get_use...
danielpronych/pyramid-doxygen
pyramid/location.py
############################################################################## # # Copyright (c) 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
berquist/PyQuante
Tests/h_dft.py
#!/usr/bin/env python import unittest, sciunittest from PyQuante.dft import dft from PyQuante.Molecule import Molecule name = "H atom/DFT" energy = -0.4415033 # open shell average occupation def main(): atomlist = Molecule('H',atomlist = [(1,(0,0,0))],multiplicity=2) en,orbe,orbs = dft(atomlist) return e...
saullocastro/compmech
theory/conecyl/clpt/clpt_donnell_bcn/print_linear_sparse.py
import os import glob import numpy as np import sympy from sympy import pi, sin, cos, var from compmech.conecyl.sympytools import mprint_as_sparse var('i1, k1, i2, j2, k2, l2', integer=True) var('i1a, i1b, i1c, i2a, i2b, i2c, j2a, j2b, j2c', integer=True) var('x, t, xa, xb, L, r, r1, r2, sina, cosa') var('A11, A12, ...
mvaled/sentry
tests/acceptance/test_organization_events.py
from __future__ import absolute_import from sentry.testutils import AcceptanceTestCase FEATURE_NAME = "organizations:events" class OrganizationEventsTest(AcceptanceTestCase): def setUp(self): super(OrganizationEventsTest, self).setUp() self.user = self.create_user("foo@example.com") self...
Alwnikrotikz/los-cocos
cocos/sprite.py
# ---------------------------------------------------------------------------- # cocos2d # Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa, # Lucio Torre # Copyright (c) 2009-2014 Richard Jones, Claudio Canepa # All rights reserved. # # Redistribution and use in source and binary forms, with o...
jwhui/openthread
tests/scripts/thread-cert/Cert_7_1_04_BorderRouterAsRouter.py
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
Crystalnix/house-of-life-chromium
chrome/test/data/autofill/merge/tools/reserialize_profiles_from_query.py
# Copyright (c) 2011 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 sys from autofill_merge_common import SerializeProfiles, ColumnNameToFieldType def main(): """Serializes the output of the query 'SELECT * fro...
mishbahr/django-users2
users/admin.py
from django.contrib import admin, messages from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.utils.translation import ugettext_lazy as _ from .conf import settings from .forms import UserChangeForm, UserCreationForm from .models import User from .utils import send_activation_email try: ...
Ketouem/flask-web-development
src/chapter-9-user-roles/flasky/config.py
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY') or 'supersecretkey' SQLALCHEMY_COMMIT_ON_TEARDOWN = True FLASKY_MAIL_SUBJECT_PREFIX = '[Flasky]' FLASKY_MAIL_SENDER = 'Flasky Admin <flasky@example.com>' FLASKY_ADMIN = os.envir...
CospanDesign/nysa-tx1-pcie-platform
tx1_pcie/demo/tx1_pcie/site_scons/site_tools/map.py
#Distributed under the MIT licesnse. #Copyright (c) 2013 Cospan Design (dave.mccoy@cospandesign.com) #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 limit...
wsy1607/Data-Analysis-of-Campus-Crime-Index
website/plugins/github_activity/github_activity.py
# -*- coding: utf-8 -*- # NEEDS WORK """ Copyright (c) Marco Milanesi <kpanic@gnufunk.org> Github Activity --------------- A plugin to list your Github Activity """ from __future__ import unicode_literals, print_function import logging logger = logging.getLogger(__name__) from pelican import signals class GitHub...
moorescloud/holideck
requests/utils.py
# -*- coding: utf-8 -*- """ requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import cgi import codecs import os import platform import re import sys import zlib from netrc import netrc, NetrcParseError from . impor...
maxrothman/aws-alfred-workflow
venv/lib/python2.7/site-packages/botocore/auth.py
# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ # Copyright 2012-2014 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...
aperson/TweetPoster
run.py
import os import json import sys default_conf = { 'database': 'tp.db', 'sentry': { 'dsn': '' }, 'reddit': { 'username': '', 'password': '', }, 'twitter': { 'consumer_key': '', 'consumer_secret': '', 'access_token': '', 'access_secret': '',...
SUSE/azure-sdk-for-python
azure-mgmt-logic/azure/mgmt/logic/models/x12_framing_settings.py
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
grhawk/ASE
tools/ase/lattice/bulk.py
from math import sqrt from ase.atoms import Atoms, string2symbols from ase.data import reference_states, atomic_numbers, chemical_symbols def bulk(name, crystalstructure=None, a=None, c=None, covera=None, orthorhombic=False, cubic=False): """Creating bulk systems. Crystal structure and lattice cons...
tobikausk/nest-simulator
pynest/nest/lib/hl_api_helper.py
# -*- coding: utf-8 -*- # # hl_api_helper.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, ...
mrquim/mrquimrepo
repo/plugin.video.salts/scrapers/directdl_scraper.py
""" Stream All The Sources Addon Copyright (C) 2017 k3l3vra 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 vers...
chubbymaggie/reverse
plasma/lib/fileformat/pefile2.py
#!/usr/bin/env python3 # # PLASMA : Generate an indented asm code (pseudo-C) with colored syntax. # Copyright (C) 2015 Joel # # 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 ...
nicolasmoreau/NodeSoftware
nodes/tipbase/node/util_models.py
class XsamsDataset: def __init__(self): self.dataDescription = None self.TabData = None class Result: def __init__(self): self.header = {} self._headerFields = { 'COUNT-SOURCES':None, 'COUNT-ATOMS' : None, 'COUNT-MOLECULES':None, 'CO...
tojon/treeherder
treeherder/config/wsgi.py
""" WSGI config for webapp project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...
VitalPet/c2c-rd-addons
table_generate_xml/ir_model.py
# -*- coding: utf-8 -*- ############################################## # # Swing Entwicklung betrieblicher Informationssysteme GmbH # (<http://www.swing-system.com>) # Copyright (C) ChriCar Beteiligungs- und Beratungs- GmbH # all rights reserved # 24-MAY-2011 (GK) created # # WARNING: This program as such is intende...
thomasdouenne/openfisca-france-indirect-taxation
openfisca_france_indirect_taxation/tests/test_depenses_caburants_ht.py
# -*- coding: utf-8 -*- """ Created on Wed Feb 10 18:40:27 2016 @author: thomas.douenne """ from __future__ import division from openfisca_france_indirect_taxation.examples.utils_example import simulate simulated_variables = [ 'pondmen', 'decuc', 'depenses_diesel_ht', 'depenses_diesel_htva', 'di...
jmartinezchaine/OpenERP
openerp/addons/users_ldap/users_ldap.py
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
Jaden-J/androidbible
publication/prog/en-leb-processor/extractfootnote.py
# coding=utf-8 import re fns = [] out = open('/tmp/out3.yet', 'w') for line in open('/tmp/out2b.yet').readlines(): line = line.strip() m = re.match(r'^verse\t(\d+)\t(\d+)\t(\d+)\t(.*)$', line) if m: text = m.group(4) field = 0 def f(n): global field field += 1 fns.append((int(m.group(1)), int(m....
ppwwyyxx/tensorflow
tensorflow/python/framework/random_seed.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...
wiltonlazary/arangodb
3rdParty/V8/gyp/unit_tests/generator_msvs_test.py
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the msvs.py file. """ import gyp.generator.msvs as msvs import unittest from io import StringIO class TestSequenceFunct...
noironetworks/neutron
neutron/db/migration/alembic_migrations/versions/mitaka/contract/1b294093239c_remove_embrane_plugin.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...
erickt/hue
desktop/libs/hadoop/src/hadoop/hdfs_site.py
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
laurenrevere/osf.io
website/notifications/tasks.py
""" Tasks for making even transactional emails consolidated. """ import itertools from django.db import connection from framework.celery_tasks import app as celery_app from framework.sentry import log_exception from osf.models import OSFUser from osf.models import NotificationDigest from website import mails from web...
zstackio/zstack-woodpecker
integrationtest/vm/virt_plus/clone/test_pause_local_full_clone_3vms_two_data_volume.py
''' Test for full clone 3vms with two data volume on local @author: yetian ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoodpecker.operati...
ddepaoli3/fuel-main-dev
fuelweb_ui_test/browser.py
from selenium import webdriver from selenium.webdriver import DesiredCapabilities from fuelweb_ui_test.settings import BROWSER from fuelweb_ui_test.settings import CHROME_EXECUTABLE_PATH from fuelweb_ui_test.settings import SELENIUM_IMPLICIT_WAIT from pyvirtualdisplay import Display driver = None def start_driver(br...
stackforge/cloudbase-init
cloudbaseinit/plugins/common/userdataplugins/heat.py
# Copyright 2013 Mirantis Inc. # Copyright 2014 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 # # ...
CodeRiderz/rojak
rojak-pantau/rojak_pantau/spiders/tirtoid.py
# -*- coding: utf-8 -*- from datetime import datetime from scrapy import Request from scrapy.loader import ItemLoader from scrapy.exceptions import CloseSpider from rojak_pantau.items import News from rojak_pantau.util.wib_to_utc import wib_to_utc from rojak_pantau.util.month import sanitize from rojak_pantau.spiders....
tobias47n9e/social-core
social_core/tests/backends/test_quizlet.py
import json from .oauth import OAuth2Test class QuizletOAuth2Test(OAuth2Test): backend_path = 'social_core.backends.quizlet.QuizletOAuth2' expected_username = 'foo_bar' access_token_body = json.dumps({ "access_token": "EE1IDxytP04tJ767GbjH7ED9PpGmYvL", "token_type": "Bearer", "ex...
lhilt/scipy
scipy/optimize/_lsq/common.py
"""Functions used by least-squares algorithms.""" from __future__ import division, print_function, absolute_import from math import copysign import numpy as np from numpy.linalg import norm from scipy.linalg import cho_factor, cho_solve, LinAlgError from scipy.sparse import issparse from scipy.sparse.linalg import L...
unomena/unobase
unobase/serializers/python.py
""" Full Python serializer for Django. """ import base from django.utils.encoding import smart_unicode, is_protected_type from django.core.serializers.python import Deserializer as PythonDeserializer class Serializer(base.Serializer): """ Python serializer for Django modelled after Ruby on Rails. Default b...
hexxter/home-assistant
homeassistant/components/alarm_control_panel/mqtt.py
""" This platform enables the possibility to control a MQTT alarm. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/alarm_control_panel.mqtt/ """ import logging import voluptuous as vol import homeassistant.components.alarm_control_panel as alarm import ...
lmazuel/azure-sdk-for-python
azure-mgmt-search/azure/mgmt/search/models/__init__.py
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
azverkan/scons
test/option/repository.py
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
timj/scons
test/Glob/basic.py
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
mhugent/Quantum-GIS
python/plugins/processing/algs/qgis/ftools/ExportGeometryInfo.py
# -*- coding: utf-8 -*- """ *************************************************************************** ExportGeometryInfo.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ********************...
Sheeo/pygit2
pygit2/_run.py
# -*- coding: utf-8 -*- # # Copyright 2010-2015 The pygit2 contributors # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, # as published by the Free Software Foundation. # # In addition to the permissions in the GNU General Public Li...
mrquim/repository.mrquim
script.module.exodus/lib/resources/lib/sources/de/iload.py
# -*- coding: utf-8 -*- """ Exodus Add-on 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...
jkonecny12/anaconda
tests/unit_tests/pyanaconda_tests/modules/storage/test_module_storage.py
# # Copyright (C) 2018 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will be...
eliasp/systemd
test/networkd-test.py
#!/usr/bin/env python3 # # networkd integration test # This uses temporary configuration in /run and temporary veth devices, and # does not write anything on disk or change any system configuration; # but it assumes (and checks at the beginning) that networkd is not currently # running. # # This can be run on a normal ...
mrquim/repository.mrquim
script.module.pycryptodome/lib/Crypto/Util/py3compat.py
# -*- coding: utf-8 -*- # # Util/py3compat.py : Compatibility code for handling Py3k / Python 2.x # # Written in 2010 by Thorsten Behrens # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the publi...
cs2c-zhangchao/nkwin1.0-anaconda
utils/log_picker/sending/stratasender.py
import xml.dom.minidom from log_picker.sending.senderbaseclass import SenderBaseClass from log_picker.sending.senderbaseclass import SenderError from report.plugins.strata import send_report_to_existing_case from report.plugins.strata import strata_client_strerror class StrataSender(SenderBaseClass): _URL = ...
sem-geologist/hyperspy
hyperspy/tests/signal/test_find_peaks1D_ohaver.py
import os from hyperspy.api import load from hyperspy.decorators import lazifyTestClass my_path = os.path.dirname(__file__) @lazifyTestClass class TestFindPeaks1DOhaver(): def setup_method(self, method): self.signal = load( my_path + "/test_find_peaks1D_ohaver/test_find_peaks1D_o...
cpennington/edx-platform
lms/djangoapps/course_api/forms.py
""" Course API forms """ from collections import namedtuple import six from django.core.exceptions import ValidationError from django.forms import CharField, Form from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from openedx.core.djangoapps.util.forms import ExtendedNullBooleanFiel...
danielbair/aeneas
aeneas/tests/net_test_tool_download.py
#!/usr/bin/env python # coding=utf-8 # aeneas is a Python/C library and a set of tools # to automagically synchronize audio and text (aka forced alignment) # # Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it) # Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it) # Copyright (C) 2015-2017, A...
humdings/zipline
tests/events/test_events.py
# # Copyright 2016 Quantopian, 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 wr...
darkonie/dcos
packages/bootstrap/extra/tests/test_bootstrap.py
import getpass import logging import pwd import random import string import subprocess import pytest from kazoo.client import KazooClient, KazooRetry from dcos_internal_utils import bootstrap from test_util.cluster import zookeeper_docker_image, zookeeper_docker_run_args logging.basicConfig(format='[%(levelname)s] %...
Kongsea/tensorflow
tensorflow/contrib/bayesflow/python/ops/layers_dense_variational_impl.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...
tonyli71/designate
designate/api/v2/controllers/rest.py
# flake8: noqa # Copyright (c) <2011>, Jonathan LaCour # 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...
jordanemedlock/psychtruths
temboo/core/Library/Instapaper/Authenticate.py
# -*- coding: utf-8 -*- ############################################################################### # # Authenticate # Validate an Instapaper account. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file ex...
frreiss/tensorflow-fred
tensorflow/python/distribute/one_device_strategy.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...
thebigbrain/qfs
webui/browse.py
# # $Id$ # # Copyright 2012 Quantcast Corp. # # Author: Thilee Subramaniam (Quantcast Corp.) # # This file is part of Kosmos File System (KFS). # # 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...
botify-labs/moto
moto/opsworks/models.py
from __future__ import unicode_literals from moto.core import BaseBackend, BaseModel from moto.ec2 import ec2_backends import uuid import datetime from random import choice from .exceptions import ResourceNotFoundException, ValidationException class OpsworkInstance(BaseModel): """ opsworks maintains its own ...
hmgaudecker/econ-project-templates
{{cookiecutter.project_slug}}/.mywaflib/waflib/extras/xcode6.py
#! /usr/bin/env python # encoding: utf-8 # XCode 3/XCode 4/XCode 6/Xcode 7 generator for Waf # Based on work by Nicolas Mercier 2011 # Extended by Simon Warg 2015, https://github.com/mimon # XCode project file format based on http://www.monobjc.net/xcode-project-file-format.html """ See playground/xcode6/ for usage ex...
wmvanvliet/mne-python
mne/minimum_norm/tests/test_snr.py
# -*- coding: utf-8 -*- # Authors: Eric Larson <larson.eric.d@gmail.com> # Matti Hämäläinen <msh@nmr.mgh.harvard.edu> # # License: BSD-3-Clause import os from os import path as op import numpy as np from numpy.testing import assert_allclose from mne import read_evokeds from mne.datasets import testing from m...
frankyao47/open-hackathon
open-hackathon-server/src/hackathon/user/__init__.py
# -*- coding: utf-8 -*- # # ----------------------------------------------------------------------------------- # Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this softw...
nathangeffen/tbonline-old
tbonlineproject/external/filebrowser/management/commands/fb_version_generate.py
# coding: utf-8 # Python import os, re # Django from django.core.management.base import BaseCommand, CommandError # filebrowser from filebrowser.settings import EXTENSION_LIST, EXCLUDE, MEDIA_ROOT, DIRECTORY, VERSIONS, EXTENSIONS from filebrowser.functions import version_generator class Command(BaseCommand): ar...
sauloal/pycluster
venvlin64/site-packages/simplejson-3.1.0-py2.7.egg/simplejson/tests/test_float.py
import math from unittest import TestCase from simplejson.compat import long_type, text_type import simplejson as json from simplejson.decoder import NaN, PosInf, NegInf class TestFloat(TestCase): def test_degenerates(self): for inf in (PosInf, NegInf): self.assertEqual(json.loads(json.dumps(in...
fuzeman/trakt.py
trakt/__init__.py
from __future__ import absolute_import, division, print_function from trakt.client import TraktClient from trakt.core.errors import ERRORS from trakt.core.exceptions import RequestError, ClientError, ServerError from trakt.helpers import has_attribute from trakt.version import __version__ # NOQA from six import add_...
wederw/bitcoin
qa/rpc-tests/zapwallettxes.py
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework import BitcoinTestFramework from util import * class ZapWalletTXesTest (BitcoinTestFrame...
elijah513/ice
js/test/Ice/inheritanceBidir/run.py
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
akibsayyed/paimei
console/modules/_PAIMEIpeek/ProcessListCtrl.py
# # PaiMei # Copyright (C) 2006 Pedram Amini <pedram.amini@gmail.com> # # $Id: ProcessListCtrl.py 194 2007-04-05 15:31:53Z cameron $ # # 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...
LLNL/spack
var/spack/repos/builtin/packages/zip/package.py
# 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) class Zip(MakefilePackage): """Zip is a compression and file packaging/archive utility.""" homepage = 'https://w...
M4rtinK/pyside-android
tests/QtCore/bug_931.py
import unittest from PySide.QtCore import QObject, Signal o = QObject() class MyObject(QObject): s = Signal(int) class CheckSignalType(unittest.TestCase): def testSignal(self): self.assertTrue(isinstance(QObject.destroyed, Signal)) self.assertEqual(type(QObject.destroyed), Signal) sel...
LLNL/spack
var/spack/repos/builtin.mock/packages/cmake-client/package.py
# 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) import os from spack import * def check(condition, msg): """Raise an install error if condition is False.""" if...
tensorflow/tensorflow
tensorflow/python/data/experimental/ops/unique.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...
diogocs1/comps
web/addons/website_forum/controllers/main.py
# -*- coding: utf-8 -*- import werkzeug.urls import werkzeug.wrappers import simplejson from openerp import tools from openerp import SUPERUSER_ID from openerp.addons.web import http from openerp.addons.web.controllers.main import login_redirect from openerp.addons.web.http import request from openerp.addons.website....
Metaswitch/calico-nova
nova/api/openstack/compute/plugins/v3/quota_classes.py
# Copyright 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.apache.org/licenses/LICENSE-2.0 # # Unless requ...
tensorflow/tensorflow
tensorflow/python/tpu/device_assignment.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...
pombredanne/MOG
nova/tests/cells/test_cells_weights.py
# 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.apache.org/licenses/LICENSE-2.0 # # Unless ...
UK992/saltfs
tests/lint/flake8.py
import os import subprocess from tests.util import Failure, Success, project_path def run(): paths = ['test.py', 'tests'] paths = [os.path.join(project_path(), path) for path in paths] command = ['flake8'] + paths ret = subprocess.run(command, stdout=subprocess.PIPE, ...
xenigmax/seqan
apps/yara/tests/run_tests.py
#!/usr/bin/env python2 """Execute the tests for Yara. The golden test outputs are generated by the script generate_outputs.sh. You have to give the root paths to the source and the binaries as arguments to the program. These are the paths to the directory that contains the 'projects' directory. Usage: run_tests.py...
broadinstitute/hellbender
src/main/python/org/broadinstitute/hellbender/gcnvkernel/tasks/task_case_ploidy_determination.py
import logging from .inference_task_base import HybridInferenceTask, HybridInferenceParameters from ..inference.fancy_optimizers import FancyAdamax from ..io.io_ploidy import PloidyModelReader from ..models.model_ploidy import PloidyModelConfig, PloidyModel, PloidyWorkspace _logger = logging.getLogger(__name__) cla...
7kbird/chrome
tools/telemetry/telemetry/core/platform/proc_supporting_platform_backend.py
# 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. try: import resource # pylint: disable=F0401 except ImportError: resource = None # Not available on all platforms from telemetry import decorators fro...
VisTrails/vistrails-contrib-legacy
titan/inspectors.py
############################################################################ ## ## Copyright (C) 2006-2010 University of Utah. All rights reserved. ## ## This file is part of VisTrails. ## ## This file may be used under the terms of the GNU General Public ## License version 2.0 as published by the Free Software Foundat...
junmin-zhu/chromium-rivertrail
tools/json_schema_compiler/compiler.py
#!/usr/bin/env python # Copyright (c) 2012 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. """Generator for C++ structs from api json files. The purpose of this tool is to remove the need for hand-written code that convert...
vishwa91/ewaste_printer
tools/arm/arm-none-eabi/lib/armv7e-m/fpu/libstdc++.a-gdb.py
# -*- python -*- # Copyright (C) 2009-2013 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 versio...
ales-erjavec/orange-canvas
orangecanvas/registry/cache.py
""" Widget Registry cache. """ import os import pickle import logging from .. import config log = logging.getLogger(__name__) def registry_cache_filename(): """Return the pickled registry cache filename. Also make sure the containing directory is created if it does not exists. """ cache_dir = con...
romain-dartigues/ansible-modules-core
cloud/amazon/iam_policy.py
#!/usr/bin/python # 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. # # Ansible is distributed...
pepeportela/edx-platform
scripts/hotfix.py
#!/usr/bin/env python """ Script to generate alton and git commands for executing hotfixes Commands for: - cutting amis - creating hotfix tag The script should be run with the hotfix's git hash as a command-line argument. i.e. `python scripts/hotfix.py <hotfix hash>` """ from __future__ import print_function impo...
MakeHer/edx-platform
common/test/acceptance/pages/lms/video/video.py
""" Video player in the courseware. """ import time import json import requests from selenium.webdriver.common.action_chains import ActionChains from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise, Promise from bok_choy.javascript import wait_for_js, js_defined import logging log = l...
dbbhattacharya/kitsune
vendor/packages/translate-toolkit/translate/tools/podebug.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2006,2008-2009 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # 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 Fou...
JulienMcJay/eclock
windows/Python27/Lib/site-packages/pygame/docs/__main__.py
# python -m pygame.docs import os import webbrowser try: from urllib.parse import urlunparse, quote except ImportError: from urlparse import urlunparse from urllib import quote def iterpath(path): path, last = os.path.split(path) if last: for p in iterpath(path): yield p ...
teeple/pns_server
work/install/Python-2.7.4/Demo/threads/sync.py
# Defines classes that provide synchronization objects. Note that use of # this module requires that your Python support threads. # # condition(lock=None) # a POSIX-like condition-variable object # barrier(n) # an n-thread barrier # event() # an event object # semap...
sephiroth6/nodeshot
nodeshot/networking/connectors/admin.py
import os from django.contrib import admin from django.conf import settings from nodeshot.core.base.admin import BaseAdmin, BaseStackedInline from .models import DeviceConnector class DeviceConnectorAdmin(BaseAdmin): list_display = ( 'host', 'device', 'node', 'port', 'backend', 'added', 'update...
tta/gnuradio-tta
gr-msdd6000/src/python_test/halt.py
#!/usr/bin/python from socket import * import string import time import struct; import random; import array; import cmath; from numpy import *; from numpy.fft import *; from pylab import *; myport = random.randint(1025,65535); filename = "output.dat"; msdd_port = 10001 msdd_host = "10.45.4.43" buf = 100000; my_udp...
rthill/smarthome
lib/plugin.py
#!/usr/bin/env python3 # vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab ######################################################################### # Copyright 2011-2013 Marcus Popp marcus@popp.mx ######################################################################### # ...
opencloudinfra/orchestrator
venv/Lib/site-packages/registration/backends/default/urls.py
""" Backwards-compatible support for include()-ing the model-based activation workflow's URLconf. The new location for that URLconf is registration.backends.model_activation.urls. Using include() with registration.backends.default.urls will raise deprecation warnings, and support for it will be removed in a future rel...
tylertian/Openstack
openstack F/nova/nova/tests/api/openstack/compute/contrib/test_rescue.py
# Copyright 2011 OpenStack LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...