repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
ClimbsRocks/auto_ml
tests/core_tests/scoring_tests.py
1
1042
import os import sys sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path sys.path = [os.path.abspath(os.path.dirname(os.path.dirname(__file__)))] + sys.path os.environ['is_test_suite'] = 'True' from auto_ml import Predictor import numpy as np import utils_testing as utils def always_return_ten_thousa...
mit
tensorflow/probability
tensorflow_probability/python/distributions/mvn_diag_plus_low_rank_test.py
1
14194
# Copyright 2018 The TensorFlow Probability Authors. # # 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...
apache-2.0
pigletto/django-lfs
lfs/mail/listeners.py
4
1383
from django.conf import settings # lfs imports from lfs.core.signals import customer_added from lfs.core.signals import order_submitted from lfs.core.signals import order_sent from lfs.core.signals import order_paid from lfs.mail import utils as mail_utils # reviews imports from reviews.signals import review_added ...
bsd-3-clause
agdsn/pycroft
pycroft/lib/search.py
1
2767
import re from typing import Optional from sqlalchemy import or_, func, cast, Text from sqlalchemy.orm import Query from pycroft.helpers.net import mac_regex, ip_regex from pycroft.model.facilities import Room from pycroft.model.host import Host, Interface, IP from pycroft.model.user import User, Membership, Property...
apache-2.0
RomainBrault/scikit-learn
sklearn/neighbors/tests/test_nearest_centroid.py
305
4121
""" Testing for the nearest centroid module. """ import numpy as np from scipy import sparse as sp from numpy.testing import assert_array_equal from numpy.testing import assert_equal from sklearn.neighbors import NearestCentroid from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances # t...
bsd-3-clause
endorphinl/horizon-fork
openstack_dashboard/test/test_data/trove_data.py
48
6178
# Copyright 2013 Rackspace Hosting. # # 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...
apache-2.0
johankaito/fufuka
microblog/flask/venv/lib/python2.7/site-packages/pip/_vendor/requests/compat.py
1039
1469
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) try: import simplejson as json except (ImportError, SyntaxError): # si...
apache-2.0
juhi24/baecc
scripts/scr_velfitgroup.py
1
3594
# -*- coding: utf-8 -*- """ @author: Jussi Tiira """ from snowfall import * import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from os import path def rangecolor(rho, rholimits=(150, 300), colors=('r', 'b', 'c', 'g', 'm')): for i, rhomax in enumerate(rholimits): if rho < rhomax: ...
gpl-3.0
glamothe/ptools
bzrrev.py
1
1439
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from subprocess import Popen, PIPE import sys import shlex ################### bzrRev: uses bzr branch (if exists) information to # determine a unique revision number def bzrRev(): version_info = {} if os.path.exists(".git"): print "generating ...
gpl-3.0
yinglanma/AI-project
tensorpack/train/multigpu.py
1
5930
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: multigpu.py # Author: Yuxin Wu <ppwwyyxxc@gmail.com> import tensorflow as tf import itertools, re from six.moves import zip, range from ..models import TowerContext from ..utils import logger from ..utils.naming import * from ..utils.concurrency import LoopThread ...
apache-2.0
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32/test/test_exceptions.py
6
8554
"""Test pywin32's error semantics""" import sys import unittest import win32api, win32file, pywintypes import pythoncom import winerror class TestBase(unittest.TestCase): def _testExceptionIndex(self, exc, index, expected): # check the exception itself can be indexed if not py3k if sys.version_info...
apache-2.0
perimosocordiae/scipy
benchmarks/benchmarks/go_benchmark_functions/go_funcs_X.py
21
7769
# -*- coding: utf-8 -*- import numpy as np from numpy import abs, sum, sin, cos, pi, exp, arange, prod, sqrt from .go_benchmark import Benchmark class XinSheYang01(Benchmark): r""" Xin-She Yang 1 objective function. This class defines the Xin-She Yang 1 [1]_ global optimization problem. This is a mu...
bsd-3-clause
daenamkim/ansible
lib/ansible/plugins/shell/sh.py
69
4222
# (c) 2014, Chris Church <chris@ninemoreminutes.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) any lat...
gpl-3.0
darongliu/Lstm_Turing_LM
lstm-neural-turing-machines-lm/exp2/v1-one-weight-matrix/theano_lstm/masked_loss.py
43
28692
import numpy as np import theano.tensor as T from theano import gof from theano.gof import Apply from theano.gradient import grad_not_implemented class MaskedLossDx(gof.Op): def make_node(self, softmaxes, y_idxes, y_lengths, y_startidxes, g_costs, **kwargs): softmaxes = T.as_tensor_variable(softmaxes) ...
mit
HarborYuan/cashier
env/Lib/site-packages/pip/req/req_set.py
338
34462
from __future__ import absolute_import from collections import defaultdict from itertools import chain import logging import os from pip._vendor import pkg_resources from pip._vendor import requests from pip.compat import expanduser from pip.download import (is_file_url, is_dir_url, is_vcs_url, url_to_path, ...
mit
sparkslabs/kamaelia
Sketches/MPS/Axon.DSL/Axon/DSL/PassThrough.py
6
5383
#!/usr/bin/env python2.3 # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache Lice...
apache-2.0
fangxingli/hue
desktop/core/src/desktop/migrations/0010_auto__add_document2__chg_field_userpreferences_key__chg_field_userpref.py
35
13246
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Document2' db.create_table('desktop_document2', ( ('id', self.gf('django.db.mode...
apache-2.0
bakkou-badri/dataminingproject
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/escsm.py
2930
7839
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-2.0
vintol/listal-dl
L-dl.py
1
4216
# # Listal Downloader # vintol.github.io/listal # import urllib.request,ssl import argparse import time import queue import threading import os,sys # # Very Important. ssl._create_default_https_context = ssl._create_unverified_context def download(): global broken, failed, ls while not qq.empty(): m...
gpl-3.0
youprofit/kivy
examples/demo/touchtracer/main.py
29
4701
#!/usr/bin/kivy ''' Touch Tracer Line Drawing Demonstration ======================================= This demonstrates tracking each touch registered to a device. You should see a basic background image. When you press and hold the mouse, you should see cross-hairs with the coordinates written next to them. As you drag...
mit
magopian/olympia
sites/dev/settings_base.py
11
5537
"""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, HOSTNAME) from .. import splitstrip import private_base as private ENGAGE_RO...
bsd-3-clause
gem/oq-svir-qgis
svir/utilities/import_sv_data.py
1
10259
# -*- coding: utf-8 -*- # /*************************************************************************** # Irmt # A QGIS plugin # OpenQuake Integrated Risk Modelling Toolkit # ------------------- # begin : 2013-10-24 # copyright ...
agpl-3.0
edensparkles/FIRSTAID
FIRST_AID/venv/Lib/io.py
165
3395
"""The io module provides the Python interfaces to stream handling. The builtin open function is defined in this module. At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no separation between reading and writing to streams; impl...
mit
sultanxda/android_kernel_lge_v400
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
eeshangarg/oh-mainline
vendor/packages/twisted/twisted/internet/glib2reactor.py
80
1240
""" This module provides support for Twisted to interact with the glib mainloop. This is like gtk2, but slightly faster and does not require a working $DISPLAY. However, you cannot run GUIs under this reactor: for that you must use the gtk2reactor instead. In order to use this support, simply do the following:: ...
agpl-3.0
keshavdv/terraform
vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec/test.py
1138
3876
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
mpl-2.0
ualikhansars/Gwent
lib/python2.7/site-packages/django/db/backends/postgresql/schema.py
202
4100
import psycopg2 from django.db.backends.base.schema import BaseDatabaseSchemaEditor class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_alter_column_type = "ALTER COLUMN %(column)s TYPE %(type)s USING %(column)s::%(type)s" sql_create_sequence = "CREATE SEQUENCE %(sequence)s" sql_delete_sequence =...
mit
NeCTAR-RC/murano
murano/engine/system/common.py
2
1076
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
SUSE/azure-sdk-for-python
azure-mgmt-web/azure/mgmt/web/models/restore_response.py
3
1956
# 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 ...
mit
mccheung/kbengine
kbe/res/scripts/common/Lib/test/test_calendar.py
99
39625
import calendar import unittest from test import support from test.script_helper import assert_python_ok import time import locale import sys import datetime result_2004_01_text = """ January 2004 Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 ...
lgpl-3.0
kxliugang/edx-platform
lms/djangoapps/django_comment_client/management/commands/assign_role.py
251
1144
from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django_comment_common.models import Role from django.contrib.auth.models import User class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--remove', ac...
agpl-3.0
py-geek/City-Air
venv/lib/python2.7/site-packages/django/views/debug.py
98
44106
from __future__ import unicode_literals import datetime import os import re import sys import types from django.conf import settings from django.http import (HttpResponse, HttpResponseServerError, HttpResponseNotFound, HttpRequest, build_request_repr) from django.template import Template, Context, TemplateDoesNot...
mit
kongscn/pyctp
example/pyctp2/test/test_utils.py
7
6455
# -*- coding:utf-8 -*- import unittest import logging import time from ..common.utils import ( next_minute, pre_day, next_day, next_trading_day, weekday, second2time, TList, ...
mit
CaptTofu/ansible
lib/ansible/utils/module_docs_fragments/files.py
2
2270
# (c) 2014, Matt Martz <matt@sivel.net> # # 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. # ...
gpl-3.0
frontalnugity/atom-configs
node_modules/node-gyp/gyp/buildbot/buildbot_run.py
1467
4228
#!/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. """Argument-less script to select what to run on the buildbots.""" import os import shutil import subprocess import sys BUILDBOT_DIR = os....
mit
uniteddiversity/mediadrop
mediadrop/lib/storage/dailymotion.py
10
3242
# This file is a part of MediaDrop (http://www.mediadrop.net), # Copyright 2009-2015 MediaDrop contributors # For the exact contribution history, see the git revision log. # The source code contained in this file is licensed under the GPLv3 or # (at your option) any later version. # See LICENSE.txt in the main project ...
gpl-3.0
kozmikkick/KozmiKKerneL-M7
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
dragonfi/snowfall
main_circle.py
1
1417
#!/usr/bin/python2 import sys sys.path = ['', 'pyglet-1.1.4'] + sys.path import math import pyglet from pyglet.graphics import vertex_list from pyglet import gl from pyglet.window import key window = pyglet.window.Window(width=800, height=600, resizable=True) fps_display = pyglet.clock.ClockDisplay() num_points =...
mit
savoirfairelinux/OpenUpgrade
addons/l10n_fr_hr_payroll/__init__.py
430
1086
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
SVoxel/R7800
git_home/samba.git/buildtools/wafsamba/stale_files.py
44
4000
# encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) """ Add a pre-build hook to remove all build files which do not have a corresponding target This can be used for example to remove the targets that have changed name without performing a full 'waf clean' Of course, it will only work if there are no dynamically generat...
gpl-2.0
bobobox/ansible
test/units/modules/system/test_known_hosts.py
61
4114
import os import tempfile from ansible.compat.tests import unittest from ansible.module_utils._text import to_bytes from ansible.modules.system.known_hosts import compute_diff class KnownHostsDiffTestCase(unittest.TestCase): def _create_file(self, content): tmp_file = tempfile.NamedTemporaryFile(prefix...
gpl-3.0
doublebits/osf.io
tests/test_alternative_citations.py
23
3952
import unittest from nose.tools import * # PEP8 asserts from framework.auth.core import Auth from website.project.model import AlternativeCitation from modularodm.exceptions import ValidationError from tests.base import OsfTestCase from tests.factories import UserFactory, ProjectFactory class ModelTests(OsfTestC...
apache-2.0
aragos/tichu-tournament
python/openpyxl/chart/chartspace.py
1
13745
from __future__ import absolute_import # Copyright (c) 2010-2016 openpyxl """ Enclosing chart object. The various chart types are actually child objects. Will probably need to call this indirectly """ from openpyxl.compat import unicode from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descrip...
mit
maliciamrg/xbmc-addon-tvtumbler
resources/lib/unidecode/x060.py
250
4642
data = ( 'Huai ', # 0x00 'Tai ', # 0x01 'Song ', # 0x02 'Wu ', # 0x03 'Ou ', # 0x04 'Chang ', # 0x05 'Chuang ', # 0x06 'Ju ', # 0x07 'Yi ', # 0x08 'Bao ', # 0x09 'Chao ', # 0x0a 'Min ', # 0x0b 'Pei ', # 0x0c 'Zuo ', # 0x0d 'Zen ', # 0x0e 'Yang ', # 0x0f 'Kou ', # 0x10 ...
gpl-3.0
sbbic/core
pyuno/qa/pytests/insertremovecells.py
6
2679
import unittest from os import getenv, path try: from urllib.parse import quote except ImportError: from urllib import quote from org.libreoffice.unotest import pyuno, mkPropertyValue class InsertRemoveCells(unittest.TestCase): @classmethod def setUpClass(cls): cls.xContext = pyuno.getCompo...
gpl-3.0
BjoernT/python-openstackclient
openstackclient/identity/v3/endpoint.py
2
9047
# Copyright 2012-2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
savoirfairelinux/num2words
tests/test_sl.py
1
11819
# -*- coding: utf-8 -*- # Copyright (c) 2003, Taro Ogawa. All Rights Reserved. # Copyright (c) 2013, Savoir-faire Linux inc. All Rights Reserved. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Fo...
lgpl-2.1
mrquim/repository.mrquim
script.module.kodi65/lib/kodi65/kodiaddon.py
4
3864
# -*- coding: utf8 -*- # Copyright (C) 2016 - Philipp Temminghoff <phil65@kodi.tv> # This program is Free Software see LICENSE file for details import xbmcaddon import xbmc import os import xbmcgui import base64 import uuid import hashlib HOME = xbmcgui.Window(10000) class Addon(object): def __init__(self, *ar...
gpl-2.0
ucsc-mus-strain-cactus/Comparative-Annotation-Toolkit
tools/pipeline.py
1
44080
# Copyright 2006-2012 Mark Diekhans """ Process pipelines constructed as a DAG. """ import os, sys, fcntl, signal, errno, threading, traceback, pickle, time import fifo, trace, strOps from tools import PycbioException try: MAXFD = os.sysconf("SC_OPEN_MAX") except OSError: MAXFD = 256 def _getSigName(num): ...
apache-2.0
vivekananda/fbeats
django/contrib/admin/tests.py
35
4776
import sys from django.test import LiveServerTestCase from django.utils.importlib import import_module from django.utils.unittest import SkipTest from django.utils.translation import ugettext as _ class AdminSeleniumWebDriverTestCase(LiveServerTestCase): webdriver_class = 'selenium.webdriver.firefox.webdriver.Web...
bsd-3-clause
nmrao/robotframework
src/robot/writer/htmltemplate.py
28
1604
# Copyright 2008-2015 Nokia Solutions and Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
OCA/social
mass_mailing_list_dynamic/tests/test_dynamic_lists.py
1
7419
# Copyright 2017 Tecnativa - Jairo Llopis # Copyright 2021 Tecnativa - Víctor Martínez # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from mock import patch from odoo.exceptions import ValidationError from odoo.tests import common @common.at_install(False) @common.post_install(True) class DynamicLi...
agpl-3.0
wenderen/servo
tests/wpt/css-tests/tools/wptserve/wptserve/ranges.py
329
3003
from utils import HTTPException class RangeParser(object): def __call__(self, header, file_size): prefix = "bytes=" if not header.startswith(prefix): raise HTTPException(416, message="Unrecognised range type %s" % (header,)) parts = header[len(prefix):].split(",") rang...
mpl-2.0
emidln/django_roa
env/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/creation.py
28
6020
import os from django.conf import settings from django.core.cache import get_cache from django.core.cache.backends.db import BaseDatabaseCache from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.creation import DatabaseCreation class SpatiaLiteCreation(DatabaseCreation): def cr...
bsd-3-clause
BuildingLink/sentry
src/sentry/utils/zip.py
10
1916
from __future__ import absolute_import import os import six import shutil import zipfile def is_unsafe_path(path): if os.path.isabs(path): return True for segment in path.split(os.path.sep): if segment == os.path.pardir: return True return False def find_common_prefix(member...
bsd-3-clause
denovator/mochafac
lib/sqlalchemy/orm/unitofwork.py
33
23234
# orm/unitofwork.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """The internals for the unit of work system. The session's flush() process passe...
apache-2.0
AdamIsrael/PerfKitBenchmarker
tests/linux_benchmarks/hpcc_benchmark_test.py
3
1801
# Copyright 2014 PerfKitBenchmarker 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 appli...
apache-2.0
Dexhub/MTX
src/arch/x86/isa/insts/simd64/integer/arithmetic/addition.py
91
4737
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
extertioner/django-blog-zinnia
zinnia/tests/test_ping.py
8
6768
"""Test cases for Zinnia's ping""" try: from io import StringIO from urllib.error import URLError from urllib.response import addinfourl except ImportError: # Python 2 from urllib import addinfourl from urllib2 import URLError from cStringIO import StringIO from django.test import TestCase fr...
bsd-3-clause
caphrim007/ansible
lib/ansible/module_utils/network/fortimanager/fortimanager.py
64
3514
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
kevinstumpf/node-bunyan
tools/cutarelease.py
171
22043
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2012 Trent Mick """cutarelease -- Cut a release of your project. A script that will help cut a release for a git-based project that follows a few conventions. It'll update your changelog (CHANGES.md), add a git tag, push those changes, update your ver...
mit
playm2mboy/edx-platform
lms/lib/courseware_search/test/test_lms_result_processor.py
151
3235
""" Tests for the lms_result_processor """ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from courseware.tests.factories import UserFactory from lms.lib.courseware_search.lms_result_processor import LmsSearchResultProc...
agpl-3.0
CyanideL/android_kernel_htc_msm8974
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
imajes/Sick-Beard
cherrypy/lib/covercp.py
35
11672
"""Code-coverage tools for CherryPy. To use this module, or the coverage tools in the test suite, you need to download 'coverage.py', either Gareth Rees' original implementation: http://www.garethrees.org/2001/12/04/python-coverage/ or Ned Batchelder's enhanced version: http://www.nedbatchelder.com/code/modul...
gpl-3.0
rosmo/ansible
lib/ansible/modules/network/f5/bigip_log_destination.py
38
58451
#!/usr/bin/python # -*- 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
TieWei/nova
nova/virt/hyperv/driver.py
1
8616
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 Cloud.com, Inc # Copyright (c) 2012 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 # # ...
apache-2.0
westinedu/sovleit
django/contrib/gis/gdal/envelope.py
321
7044
""" The GDAL/OGR library uses an Envelope structure to hold the bounding box information for a geometry. The envelope (bounding box) contains two pairs of coordinates, one for the lower left coordinate and one for the upper right coordinate: +----------o Upper right; (max_x, max_y) ...
bsd-3-clause
Joukahainen/trading-with-python
lib/interactiveBrokers/tickLogger.py
78
5277
''' Created on May 5, 2013 Copyright: Jev Kuznetsov License: BSD Program to log tick events to a file example usage: > python ib_logQuotes.py SPY,VXX,XLE start with -v option to show all incoming events ''' import argparse # command line argument parser import datetime as dt # dat...
bsd-3-clause
c-store/icinga2checks
localChecks/check_mem.py
1
4189
#!/usr/bin/python3 # check_mem.py - Check Swap and RAM on linux systems # if warning or critical stage are reached, displays top processes from ps, # sorted by memory utilization # for nagios style monitoring systems # # copyright C-Store 2016 # Author Mattis Haase, Leon Kühn # # usage: check_mem.py -w ramWarnPct -c ra...
apache-2.0
jordanemedlock/psychtruths
temboo/Library/Google/Picasa/SearchPhotosByTag.py
5
5005
# -*- coding: utf-8 -*- ############################################################################### # # SearchPhotosByTag # Searches photos using tags that you specify. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may no...
apache-2.0
rjschof/gem5
tests/configs/realview-simple-atomic-checkpoint.py
37
2394
# Copyright (c) 2015 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
mbdevpl/maildaemon
maildaemon/gmail_imap_daemon.py
1
1245
import logging import oauth2 import oauth2.clients.imap from .imap_daemon import IMAPDaemon _LOG = logging.getLogger(__name__) class GmailIMAPDaemon(IMAPDaemon): def connect_oauth( self, consumer_key: str, consumer_secret: str, user_token: str, user_secret: str) -> None: if n...
apache-2.0
dohoangkhiem/ansible
lib/ansible/parsing/utils/jsonify.py
203
1451
# (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...
gpl-3.0
MarcusJones/ExergyUtilities
Migration/Custom/.jupyter/jupyter_notebook_config.py
2
27763
# Configuration file for jupyter-notebook. #------------------------------------------------------------------------------ # Application(SingletonConfigurable) configuration #------------------------------------------------------------------------------ ## This is an application. ## The date format used by logging f...
lgpl-3.0
AMOboxTV/AMOBox.LegoBuild
plugin.program.super.favourites/default.py
1
91570
# # Copyright (C) 2014- # Sean Poyser (seanpoyser@gmail.com) # # This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # Thi...
gpl-2.0
HurricaneLabs/machinae
src/machinae/sites/base.py
1
5677
from __future__ import absolute_import import gzip import io import warnings import zipfile from collections import OrderedDict import magic import pytz import relatime import requests from tzlocal import get_localzone try: #pylint: disable=ungrouped-imports from requests.packages.urllib3 import exceptions ex...
mit
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/VTK/ThirdParty/Twisted/twisted/test/test_policies.py
23
27720
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test code for policies. """ from __future__ import division, absolute_import from zope.interface import Interface, implementer, implementedBy from twisted.python.compat import NativeStringIO, _PY3 from twisted.trial import unittest from twi...
gpl-3.0
AmrThabet/CouchPotatoServer
libs/git/tag.py
111
1689
# Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com> # 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 li...
gpl-3.0
mitchrule/Miscellaneous
Django_Project/django/Lib/site-packages/pip/compat/__init__.py
18
3170
"""Stuff that differs in different Python versions and platform distributions.""" from __future__ import absolute_import, division import os import imp import sys from pip._vendor.six import text_type try: from logging.config import dictConfig as logging_dictConfig except ImportError: from pip.compat.dictcon...
mit
primiano/blink-gitcs
Tools/RebaselineLogServer/main_unittest.py
39
5399
# Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
idovear/odoo
addons/survey/__init__.py
385
1037
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
srimai/odoo
openerp/addons/test_inherit/models.py
69
2503
# -*- coding: utf-8 -*- from openerp import models, fields, api, osv # We just create a new model class mother(models.Model): _name = 'test.inherit.mother' _columns = { # check interoperability of field inheritance with old-style fields 'name': osv.fields.char('Name'), 'state': osv.fie...
agpl-3.0
th0mmeke/toyworld
reactor_model/charge_reaction_vessel.py
1
3165
""" Created on 22/03/2013 @author: thom """ import logging import os from parameters import Parameters from reactor_model.spatial_reaction_vessel import SpatialReactionVessel from ULPS import Float_t class ChargeReactionVessel(SpatialReactionVessel): """ n-dimensional structure of fixed size. Molecules b...
gpl-3.0
mjescobar/RF_Estimation
Clustering/helpers/gaussFitSTA/gaussFit.py
2
2992
#!/usr/bin/env python # -*- coding: utf-8 -*- # # gaussFit.py # # Copyright 2014 Carlos "casep" Sepulveda <casep@alumnos.inf.utfsm.cl> # # 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; ...
gpl-2.0
rbdavid/Distance_matrix
Test_Case1/plotting_functions.py
4
13432
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python # USAGE: # from fn_plotting.py import * # PREAMBLE: import numpy as np import sys import os import matplotlib.pyplot as plt import matplotlib.colors as mcolors import matplotlib as mpl from matplotlib.ticker import NullFormatter stdev = np.std sqrt = np....
gpl-3.0
lyft/incubator-airflow
airflow/providers/datadog/hooks/datadog.py
4
6235
# # 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...
apache-2.0
appcelerator/portal
client/node_modules/node-gyp/gyp/pylib/gyp/input_test.py
1841
3207
#!/usr/bin/env python # Copyright 2013 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 input.py file.""" import gyp.input import unittest import sys class TestFindCycles(unittest.TestCase): def setUp(self...
apache-2.0
girving/tensorflow
tensorflow/contrib/tfprof/tfprof_logger.py
92
1272
# 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...
apache-2.0
zstars/weblabdeusto
server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment2/experiment42/server_config.py
968
1526
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- weblab_xilinx_experiment_xilinx_device = 'FPGA' weblab_xilinx_experiment_port_number = 1 # This should be something like this: # import os as _os # xilinx_home = _os.getenv('XILINX_HOME') # if xilinx_home == None: # if _os.name == 'nt': # xilinx_home = r'C:...
bsd-2-clause
film42/heroku-buildpack-python-wkhtmltopdf
vendor/pip-1.3.1/pip/util.py
63
21828
import sys import shutil import os import stat import re import posixpath import pkg_resources import zipfile import tarfile import subprocess import textwrap from pip.exceptions import InstallationError, BadCommand, PipError from pip.backwardcompat import(WindowsError, string_types, raw_input, ...
mit
thierrydouez/livecode
gyp/pylib/gyp/xcode_ninja.py
1789
10585
# Copyright (c) 2014 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. """Xcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project i...
gpl-3.0
kennethgillen/ansible
lib/ansible/module_utils/f5_utils.py
45
10364
# # Copyright 2016 F5 Networks Inc. # # 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. # # An...
gpl-3.0
jefffohl/nupic
tests/integration/nupic/algorithms/knn_classifier_test/pca_knn_data.py
27
2567
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
gpl-3.0
johntauber/MITx6.00.2x
Unit2/pset2/ps2_visualize.py
2
4589
# Problem Set 2: # Visualization code for simulated robots. # See the problem set for instructions on how to use this code. import math import time from tkinter import * class RobotVisualization: def __init__(self, num_robots, width, height, delay = 0.2): "Initializes a visualization with the specified p...
mit
aanjhan/ubx
ask-position.py
1
2691
#!/usr/bin/python # Copyright (C) 2010 Timo Juhani Lindfors <timo.lindfors@iki.fi> # 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 right...
mit
cy/react-native-talk
node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py
1812
9537
# Copyright (c) 2013 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. """Utility functions shared amongst the Windows generators.""" import copy import os # A dictionary mapping supported target types to extensions. TARGET_TYPE_EX...
mit
mgagne/nova
nova/tests/unit/api/openstack/compute/contrib/test_extended_virtual_interfaces_net.py
6
3799
# Copyright 2013 IBM Corp. # 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 app...
apache-2.0
tequa/ammisoft
ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/lib-tk/turtle.py
5
139042
# # turtle.py: a Tkinter based turtle graphics module for Python # Version 1.0.1 - 24. 9. 2009 # # Copyright (C) 2006 - 2010 Gregor Lingl # email: glingl@aon.at # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from ...
bsd-3-clause
lpantano/bcbio-nextgen
bcbio/log/logbook_zmqpush.py
16
4230
"""Enable multiple processes to send logs to a central server through ZeroMQ. Thanks to Zachary Voase: https://github.com/zacharyvoase/logbook-zmqpush Slightly modified to support Logbook 0.4.1. """ import errno import json import socket import logbook.queues from logbook.base import LogRecord import zmq from zmq.uti...
mit
fizz-ml/pytorch-aux-reward-rl
main.py
1
3179
from environment import GymEnvironment from ddpg_agent import DDPGAgent import numpy as np import sys import random import os import json import pdb def main(): model_path = sys.argv[1] conf_path = os.path.join(model_path, 'config.json') json_data = open(conf_path).read() conf = json.loads(json_data) ...
mit