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
ThomasFeher/audacity
lib-src/lv2/serd/waflib/Tools/dmd.py
316
1511
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import sys from waflib.Tools import ar,d from waflib.Configure import conf @conf def find_dmd(conf): conf.find_program(['dmd','dmd2','ldc'],var='D') out=conf.cmd_and_log([co...
gpl-2.0
vukasinmilosevic/root
main/python/cmdLineUtils.py
8
47833
#!/usr/bin/env python # ROOT command line tools module: cmdLineUtils # Author: Julien Ripoche # Mail: julien.ripoche@u-psud.fr # Date: 20/08/15 """Contain utils for ROOT command line tools""" ########## # Stream redirect functions # The original code of the these functions can be found here : # http://stackoverflow....
lgpl-2.1
hbrunn/bank-payment
account_payment_blocking/__openerp__.py
5
1656
# -*- encoding: utf-8 -*- ############################################################################## # # Account Payment Blocking module for Odoo # Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu) # @author Stéphane Bidoul <stephane.bidoul@acsone.eu> # @author Adrien Peiffer <adrien.peiffer@acson...
agpl-3.0
junghans/espressopp
contrib/mpi4py/mpi4py-1.3/test/test_threads.py
3
2333
try: import threading as _threading _HAS_THREADING = True except ImportError: import dummy_threading as _threading _HAS_THREADING = False Thread = _threading.Thread try: current_thread = _threading.current_thread # Py 3.X except AttributeError: current_thread = _threading.currentThread # Py 2....
gpl-3.0
MjnMixael/knossos
knossos/progress.py
1
13478
## Copyright 2017 Knossos authors, see NOTICE file ## ## 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...
apache-2.0
njoyce/pyamf
doc/tutorials/examples/actionscript/recordset/python/init.py
8
1612
# Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ Creates the database for the RecordSet example. @since: 0.1.0 """ import db def init_data(engine): languages = [ (".java", "Sun Java programming language", "Java",), (".py", "Python programming language", "Python",), (...
mit
kursitet/edx-platform
lms/djangoapps/course_blocks/api.py
32
3789
""" API entry point to the course_blocks app with top-level get_course_blocks and clear_course_from_cache functions. """ from django.core.cache import cache from openedx.core.lib.block_cache.block_cache import get_blocks, clear_block_cache from xmodule.modulestore.django import modulestore from .transformers import (...
agpl-3.0
goodwinnk/intellij-community
python/lib/Lib/site-packages/django/utils/datetime_safe.py
496
2685
# Python's datetime strftime doesn't handle dates before 1900. # These classes override date and datetime to support the formatting of a date # through its full "proleptic Gregorian" date range. # # Based on code submitted to comp.lang.python by Andrew Dalke # # >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was...
apache-2.0
physycom/QGIS
tests/src/python/test_qgshighlight.py
45
2873
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsHighlight. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __au...
gpl-2.0
onshape-public/onshape-clients
python/onshape_client/oas/models/bt_insertables_list_response.py
1
5825
# coding: utf-8 """ Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 im...
mit
22i/minecraft-voxel-blender-models
models/extra/blender-scripting/lib/enderdragon.py
1
1326
import bpy import os # join them together ctrl+j bpy.ops.object.join() def get_override(area_type, region_type): for area in bpy.context.screen.areas: if area.type == area_type: for region in area.regions: if region.type == region_type: ...
gpl-3.0
jakejhansen/minesweeper_solver
evolutionary/hpcjobs/Minesweeper01/run-minesweeper.py
1
9801
import argparse import cProfile import multiprocessing as mp import pstats import time import gym import IPython import numpy as np from keras.layers import Dense from keras.models import Input, Model, Sequential, clone_model, load_model from keras.optimizers import Adam from context import core from core.strategies ...
mit
Jump1556/google-python-class
basic/solution/list1.py
209
3656
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Basic list exercises # Fill in the code for the functions below. main() is already set ...
apache-2.0
ChameleonCloud/horizon
openstack_dashboard/dashboards/project/floating_ips/panel.py
2
1037
# Copyright 2017 Cisco 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 law o...
apache-2.0
lazywei/scikit-learn
benchmarks/bench_multilabel_metrics.py
86
7286
#!/usr/bin/env python """ A comparison of multilabel target formats and metrics over them """ from __future__ import division from __future__ import print_function from timeit import timeit from functools import partial import itertools import argparse import sys import matplotlib.pyplot as plt import scipy.sparse as...
bsd-3-clause
BioDynaMo/biodynamo
src/core/visualization/paraview/generate_pv_state.py
1
5104
# ----------------------------------------------------------------------------- # # Copyright (C) 2021 CERN & Newcastle University for the benefit of the # BioDynaMo collaboration. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance w...
apache-2.0
c-amr/camr
stanfordnlp/unidecode/x05c.py
252
4612
data = ( 'Po ', # 0x00 'Feng ', # 0x01 'Zhuan ', # 0x02 'Fu ', # 0x03 'She ', # 0x04 'Ke ', # 0x05 'Jiang ', # 0x06 'Jiang ', # 0x07 'Zhuan ', # 0x08 'Wei ', # 0x09 'Zun ', # 0x0a 'Xun ', # 0x0b 'Shu ', # 0x0c 'Dui ', # 0x0d 'Dao ', # 0x0e 'Xiao ', # 0x0f 'Ji ', # 0x10...
gpl-2.0
jregovic/python-driver
tests/integration/cqlengine/model/test_model_io.py
7
16502
# Copyright 2015 DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
trailofbits/iverify-oss
vendor/iphone-dataprotection/python_scripts/nand/yaftl.py
1
14845
from array import array from construct.core import Struct, Union from construct.macros import * from progressbar import ProgressBar from structs import * import struct #https://github.com/iDroid-Project/openiBoot/blob/master/openiboot/ftl-yaftl/yaftl.c YAFTL_CXT = Struct("YAFTL_CXT", String("version", 4...
bsd-2-clause
takeshineshiro/python-mode
pymode/libs/logilab/common/configuration.py
85
42160
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
lgpl-3.0
jeromez80/python-gsmmodem
gsmmodem/exceptions.py
13
4484
""" Module defines exceptions used by gsmmodem """ class GsmModemException(Exception): """ Base exception raised for error conditions when interacting with the GSM modem """ class TimeoutException(GsmModemException): """ Raised when a write command times out """ def __init__(self, data=None): ...
lgpl-3.0
MathieuDuponchelle/grilo
tests/python/test_metadata_source.py
2
3725
import unittest import logging import constants try: from gi.repository import Grl except: logging.warning("Unable to import Grilo's introspection bindings") class TestMetadataSource(unittest.TestCase): MEDIA = Grl.Media() METADATA_FLAGS = Grl.MetadataResolutionFlags(Grl.MetadataResolutionFlags.FULL ...
lgpl-2.1
v6ak/qubes-core-admin
core/notify.py
3
2781
# -*- coding: utf-8 -*- # # The Qubes OS Project, http://www.qubes-os.org # # Copyright (C) 2014 Marek Marczykowski-Górecki <marmarek@invisiblethingslab.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 Softwar...
gpl-2.0
willhardy/django
django/contrib/auth/handlers/modwsgi.py
537
1344
from django import db from django.contrib import auth from django.utils.encoding import force_bytes def check_password(environ, username, password): """ Authenticates against Django's auth database mod_wsgi docs specify None, True, False as return value depending on whether the user exists and authen...
bsd-3-clause
cyjia/linux
tools/perf/scripts/python/net_dropmonitor.py
1812
1749
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
zwadar/pyqode.core
test/helpers.py
2
6852
# -*- coding: utf-8 -*- """ A helper module for testing, introducing some helper functions. Inspired by the jedi helper module for their testing package """ import os import functools import platform from os.path import abspath from os.path import dirname from pyqode.core.cache import Cache from pyqode.qt import QtWidg...
mit
eieio/pyy
modules/default.py
1
1423
''' default.py Default module responsible for the basic bootstrap and protocol Copyright 2008 Corey Tabaka Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.a...
apache-2.0
flipchan/LayerProx
marionette_tg/updater.py
10
3403
import os import sys import tarfile import tempfile import threading from twisted.internet import threads from twisted.internet import defer import pycurl sys.path.append('.') import marionette_tg.conf import marionette_tg.dsl class Downloader(threading.Thread): def __init__(self, src_url, dst_path, ...
apache-2.0
devendermishrajio/nova_test_latest
nova/api/openstack/compute/schemas/v3/flavor_access.py
110
1710
# Copyright 2013 NEC Corporation. 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 ...
apache-2.0
salguarnieri/intellij-community
python/helpers/pycharm/buildout_engulfer.py
85
1225
# Expects two env variables: # PYCHARM_ENGULF_SCRIPT = which script should be engulfed. # PYCHARM_PREPEND_SYSPATH = which entries should be added to the beginning of sys.path; # items must be separated by path separator. May be unset. # # Given script is loaded and compiled, then sys.path is prepended as requested....
apache-2.0
handspring/bite-project
deps/gdata-python-client/samples/apps/marketplace_sample/appengine_utilities/cache.py
26
12235
# -*- coding: utf-8 -*- """ Copyright (c) 2008, appengine-utilities project 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 ...
apache-2.0
eino-makitalo/odoo
addons/website_mail/models/mail_message.py
264
4705
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
AndroidOpenDevelopment/android_external_chromium_org
tools/perf/measurements/smooth_gesture_util_unittest.py
14
3029
# 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 unittest from telemetry.timeline import model as model_module from telemetry.web_perf import timeline_interaction_record as tir_module from measuremen...
bsd-3-clause
weimingtom/python-for-android
python3-alpha/python3-src/Lib/encodings/iso8859_16.py
272
13557
""" Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
apache-2.0
Fireblend/chromium-crosswalk
chrome/test/chromedriver/cpp_source.py
21
2481
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Writes C++ header/cc source files for embedding resources into C++.""" import datetime import os import sys def WriteSource(base_name, ...
bsd-3-clause
google/google-ctf
third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_operator.py
61
3568
"""Fixer for operator functions. operator.isCallable(obj) -> hasattr(obj, '__call__') operator.sequenceIncludes(obj) -> operator.contains(obj) operator.isSequenceType(obj) -> isinstance(obj, collections.Sequence) operator.isMappingType(obj) -> isinstance(obj, collections.Mapping) operator.isNumberType...
apache-2.0
vladimir-v-diaz/securesystemslib
securesystemslib/interface.py
1
28823
#!/usr/bin/env python """ <Program Name> interface.py <Author> Vladimir Diaz <vladimir.v.diaz@gmail.com> <Started> January 5, 2017. <Copyright> See LICENSE for licensing information. <Purpose> Provide an interface to the cryptography funtions available in securesystemslib. The interface can be used wi...
mit
vially/googlemusic-xbmc
resources/Lib/gmusicapi/session.py
1
10798
# -*- coding: utf-8 -*- """ Sessions handle the details of authentication and transporting requests. """ from collections import namedtuple #from contextlib import closing import json #import gpsoauth import httplib2 # included with oauth2client #import mechanicalsoup import oauth2client from oauth2client.client imp...
gpl-3.0
blacklin/kbengine
kbe/src/lib/python/Lib/unittest/__init__.py
900
2718
""" Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's Smalltalk testing framework. This module contains the core framework classes that form the basis of specific test cases and suites (TestCase, TestSuite etc.), and also a text-based utility class for running the tests and reporting the resu...
lgpl-3.0
patrioticcow/MessagesForSkype
packages/win32/bundle/MessagesForSkype/modules/python/1.3.1-beta/Lib/macpath.py
87
7601
"""Pathname and path-related operations for the Macintosh.""" import os from stat import * __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","getctime", "islink","exists","lexists","isdir","isfile", ...
mit
dblodgett-usgs/OWSLib
owslib/dif.py
23
19593
# -*- coding: ISO-8859-15 -*- # ============================================================================= # Copyright (c) 2009 Tom Kralidis # # Authors : Tom Kralidis <tomkralidis@gmail.com> # # Contact email: tomkralidis@gmail.com # ============================================================================= """...
bsd-3-clause
cloudbotio/spidey
node_modules/nodeunit/deps/ejs/node_modules/expresso/deps/jscoverage/js/build/win32/pgomerge.py
79
1628
#!/usr/bin/python # Usage: pgomerge.py <binary basename> <dist/bin> # Gathers .pgc files from dist/bin and merges them into # $PWD/$basename.pgd using pgomgr, then deletes them. # No errors if any of these files don't exist. import sys, os, os.path, subprocess if not sys.platform == "win32": raise Exception("This ...
mit
wikkiewikkie/elizabeth
elizabeth/intd/net.py
1
34724
HTTP_METHODS = [ 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS' ] HTTP_STATUS_CODES = [ "100 Continue", "101 Switching Protocols", "200 OK", "201 Created", "202 Accepted", "203 Non Authoritative Information", "204 No Content", "205 Reset Content", "206 Partial Content...
mit
andrewjrobinson/FreeCAD_sf_master
src/Mod/Cam/Init.py
3
2386
# FreeCAD init script of the Cam module # (c) 2007 Juergen Riegel #*************************************************************************** #* (c) Juergen Riegel (juergen.riegel@web.de) 2002 * #* * #* This f...
lgpl-2.1
rrmartins/eventex
south/build/lib.linux-i686-2.7/south/db/oracle.py
8
8392
import os.path import re import cx_Oracle from django.db import connection, models from django.db.backends.util import truncate_name from django.core.management.color import no_style from django.db.backends.oracle.base import get_sequence_name from django.db.models.fields import NOT_PROVIDED from south.db imp...
apache-2.0
Haynie-Research-and-Development/jarvis
deps/lib/python3.4/site-packages/Cryptodome/Signature/PKCS1_v1_5.py
3
1993
# =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@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: # # 1. Redistributio...
gpl-2.0
quamilek/django
django/contrib/gis/gdal/srs.py
366
12043
""" The Spatial Reference class, represents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print(srs) GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY...
bsd-3-clause
40223114/2015_g4
static/Brython3.1.1-20150328-091302/Lib/_dummy_thread.py
742
4769
"""Drop-in replacement for the thread module. Meant to be used as a brain-dead substitute so that threaded code does not need to be rewritten for when the thread module is not present. Suggested usage is:: try: import _thread except ImportError: import _dummy_thread as _thread """ # Exports ...
gpl-3.0
DougBurke/astropy
astropy/extern/ply/cpp.py
22
33538
# ----------------------------------------------------------------------------- # cpp.py # # Author: David Beazley (http://www.dabeaz.com) # Copyright (C) 2007 # All rights reserved # # This module implements an ANSI-C style lexical preprocessor for PLY. # -------------------------------------------------------------...
bsd-3-clause
caphrim007/ansible
lib/ansible/modules/cloud/amazon/ecs_task.py
25
13623
#!/usr/bin/python # Copyright: Ansible Project # 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', 'status': ['preview'], ...
gpl-3.0
mancoast/CPythonPyc_test
fail/312_test___future__.py
4
2520
#! /usr/bin/env python import unittest from test import support import __future__ GOOD_SERIALS = ("alpha", "beta", "candidate", "final") features = __future__.all_feature_names class FutureTest(unittest.TestCase): def test_names(self): # Verify that all_feature_names appears correct. given_featu...
gpl-3.0
mdaif/olympia
apps/addons/tests/test_update.py
14
31922
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from email import utils from django.db import connection from nose.tools import eq_ import amo import amo.tests from addons.models import (Addon, CompatOverride, CompatOverrideRange, IncompatibleVersions) from applications.mo...
bsd-3-clause
niboshi/chainer
tests/chainer_tests/functions_tests/array_tests/test_dstack.py
8
3262
import unittest import numpy import six from chainer import functions from chainer import testing from chainer.testing import attr from chainer.utils import type_check @testing.parameterize(*testing.product_dict( [ {'shape': (2, 3, 4), 'y_shape': (2, 3, 8), 'xs_length': 2}, {'shape': (3, 4), 'y_...
mit
RaoUmer/django
django/contrib/localflavor/jp/jp_prefectures.py
543
2089
from django.utils.translation import ugettext_lazy JP_PREFECTURES = ( ('hokkaido', ugettext_lazy('Hokkaido'),), ('aomori', ugettext_lazy('Aomori'),), ('iwate', ugettext_lazy('Iwate'),), ('miyagi', ugettext_lazy('Miyagi'),), ('akita', ugettext_lazy('Akita'),), ('yamagata', ugettext_lazy('Yamagat...
bsd-3-clause
datenbetrieb/odoo
addons/purchase_double_validation/__init__.py
441
1090
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
rhinstaller/blivet
tests/formats_test/fs_test.py
2
3933
import os import tempfile import unittest import blivet.formats.fs as fs from blivet.size import Size, ROUND_DOWN from tests import loopbackedtestcase from . import fstesting class Ext2FSTestCase(fstesting.FSAsRoot): _fs_class = fs.Ext2FS class Ext3FSTestCase(Ext2FSTestCase): _fs_class = fs.Ext3FS clas...
lgpl-2.1
dplorimer/osf
api/base/utils.py
8
1783
# -*- coding: utf-8 -*- import furl from modularodm import Q from rest_framework.reverse import reverse from rest_framework.exceptions import NotFound from modularodm.exceptions import NoResultsFound from website import util as website_util # noqa from website import settings as website_settings def absolute_reve...
apache-2.0
lizardsystem/flooding-lib
lizard_worker/tests.py
3
4735
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.txt. import mock from django.test import TestCase from lizard_worker import models as w_models from lizard_worker.worker.action import Action from lizard_worker.worker.action_task import ActionTask from lizard_worker.worker.messaging_body import Body class Exampl...
gpl-3.0
digimarc/django
tests/many_to_many/tests.py
22
20920
from __future__ import unicode_literals from django.db import transaction from django.test import TestCase from django.utils import six from .models import Article, Publication class ManyToManyTests(TestCase): def setUp(self): # Create a couple of Publications. self.p1 = Publication.objects.cre...
bsd-3-clause
spoki0/AI3
AI3/opencv/sources/samples/python/demhist.py
7
2704
#!/usr/bin/python import cv2.cv as cv import sys import urllib2 hist_size = 64 range_0 = [0, 256] ranges = [ range_0 ] class DemHist: def __init__(self, src_image): self.src_image = src_image self.dst_image = cv.CloneMat(src_image) self.hist_image = cv.CreateImage((320, 200), 8, 1) ...
mit
40223101/w16b_test
static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/__init__.py
603
6082
## pygame - Python Game Library ## Copyright (C) 2000-2001 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
agpl-3.0
rh-s/heat
heat/tests/test_software_component.py
11
10430
# # 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 # ...
apache-2.0
jkonecny12/anaconda
pyanaconda/modules/storage/partitioning/interactive/interactive_interface.py
6
1424
# # DBus interface for the interactive partitioning module # # Copyright (C) 2019 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....
gpl-2.0
marcoantoniooliveira/labweb
oscar/lib/python2.7/site-packages/coverage/bytecode.py
6
2326
"""Bytecode manipulation for coverage.py""" import opcode, sys, types class ByteCode(object): """A single bytecode.""" def __init__(self): # The offset of this bytecode in the code object. self.offset = -1 # The opcode, defined in the `opcode` module. self.op = -1 # T...
bsd-3-clause
BigDataforYou/movie_recommendation_workshop_1
big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pandas/tseries/tests/test_timedeltas.py
1
73366
# pylint: disable-msg=E1101,W0612 from __future__ import division from datetime import timedelta, time import nose from distutils.version import LooseVersion import numpy as np import pandas as pd from pandas import (Index, Series, DataFrame, Timestamp, Timedelta, TimedeltaIndex, isnull, date_ran...
mit
edisonlz/fruit
web_project/base/site-packages/Captcha/Base.py
5
4307
""" Captcha.Base Base class for all types of CAPTCHA tests. All tests have one or more solution, determined when the test is generated. Solutions can be any python object, All tests can be solved by presenting at least some preset number of correct solutions. Some tests may only have one solution and require one solu...
apache-2.0
mclaughlin6464/pylearn2
pylearn2/expr/tests/test_preprocessing.py
49
1461
import numpy from pylearn2.expr.preprocessing import global_contrast_normalize def test_basic(): rng = numpy.random.RandomState(0) X = abs(rng.randn(50, 70)) Y = global_contrast_normalize(X) numpy.testing.assert_allclose((Y ** 2).sum(axis=1), 1) numpy.testing.assert_allclose(Y.mean(axis=1), 0, ato...
bsd-3-clause
mecax/pyrobotlab
home/wkinne/InMoov2.wkinne.py
4
30750
# this script is provided as a basic guide # most parts can be run by uncommenting them # InMoov now can be started in modular pieces leftPort = "COM6" rightPort = "COM5" i01 = Runtime.createAndStart("i01", "InMoov") # starts everything #i01.startAll(leftPort, rightPort) # starting parts i01.startMouth() i01.start...
apache-2.0
kevincox/wireshark
tools/make-services.py
42
4282
#!/usr/bin/env python # # Parses the CSV version of the IANA Service Name and Transport Protocol Port Number Registry # and generates a services(5) file. # # Wireshark - Network traffic analyzer # By Gerald Combs <gerald@wireshark.org> # Copyright 2013 Gerald Combs # # This program is free software; you can redistribut...
gpl-2.0
xinjiguaike/edx-platform
lms/lib/comment_client/utils.py
147
4647
from contextlib import contextmanager import dogstats_wrapper as dog_stats_api import logging import requests from django.conf import settings from time import time from uuid import uuid4 from django.utils.translation import get_language log = logging.getLogger(__name__) def strip_none(dic): return dict([(k, v) ...
agpl-3.0
ench0/external_skia
bench/tile_analyze.py
198
12134
#!/usr/bin/env python # Copyright (c) 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. """ Analyze per-tile and viewport bench data, and output visualized results. """ __author__ = 'bensong@google.com (Ben Chen)' imp...
bsd-3-clause
bensk/CS9
_site/Code Examples/RockPaperScissors.py
3
1280
# Play Rock || Paper || Scissors score = 0 turns = input('best of...?') moves = ['rock','paper','scissors'] import random print "Let's play a game of rock paper scissors" # user_gesture = raw_input("What's your move- rock, paper or scissors?") for n in range(0,turns): user_gesture = raw_input("What's your move- ...
mit
twobob/buildroot-kindle
output/build/host-python-2.7.2/Lib/test/test_anydbm.py
93
2288
#! /usr/bin/env python """Test script for the anydbm module based on testdumbdbm.py """ import os import unittest import glob from test import test_support _fname = test_support.TESTFN # Silence Py3k warning anydbm = test_support.import_module('anydbm', deprecated=True) def _delete_files(): # we don't know t...
gpl-2.0
qedsoftware/commcare-hq
corehq/apps/app_manager/detail_screen.py
1
19849
from corehq.apps.app_manager import id_strings from corehq.apps.app_manager.suite_xml import xml_models as sx from corehq.apps.app_manager.suite_xml import const from corehq.apps.app_manager.xpath import ( CaseXPath, CommCareSession, IndicatorXpath, LedgerdbXpath, LocationXpath, XPath, dot_i...
bsd-3-clause
edxnercel/edx-platform
lms/djangoapps/student_profile/test/test_views.py
34
3367
# -*- coding: utf-8 -*- """ Tests for student profile views. """ from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import RequestFactory from util.testing import UrlResetMixin from student.tests.factories import UserFactory from stu...
agpl-3.0
abhattad4/Digi-Menu
tests/delete/models.py
148
3676
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class R(models.Model): is_default = models.BooleanField(default=False) def __str__(self): return "%s" % self.pk get_default_r = lambda: R....
bsd-3-clause
grevutiu-gabriel/sympy
sympy/physics/unitsystems/units.py
57
13509
# -*- coding: utf-8 -*- """ Unit system for physical quantities; include definition of constants. """ from __future__ import division import numbers from sympy import sympify, Expr, Number, Pow, Mul from .dimensions import Dimension, DimensionSystem class Unit(Expr): """ Class for the units. A unit is...
bsd-3-clause
dyyi/moneybook
venv/Lib/site-packages/django/contrib/gis/db/models/aggregates.py
414
2395
from django.contrib.gis.db.models.fields import ExtentField from django.db.models.aggregates import Aggregate __all__ = ['Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union'] class GeoAggregate(Aggregate): function = None is_extent = False def as_sql(self, compiler, connection): # this will be c...
apache-2.0
trishnaguha/ansible
lib/ansible/modules/network/f5/bigip_software_install.py
21
15248
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
kidburglar/youtube-dl
youtube_dl/extractor/firsttv.py
23
6457
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( int_or_none, qualities, unified_strdate, url_or_none, ) class FirstTVIE(InfoExtractor): IE_NAME = '1tv' IE_DESC = 'Перв...
unlicense
Celthi/youtube-dl-GUI
youtube_dl/extractor/atttechchannel.py
155
1961
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import unified_strdate class ATTTechChannelIE(InfoExtractor): _VALID_URL = r'https?://techchannel\.att\.com/play-video\.cfm/([^/]+/)*(?P<id>.+)' _TEST = { 'url': 'http://techchannel.att.com/play-video.cfm/2014/1/27...
mit
carljm/django
django/forms/utils.py
241
6131
from __future__ import unicode_literals import json import sys from django.conf import settings from django.core.exceptions import ValidationError # backwards compatibility from django.utils import six, timezone from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.html import e...
bsd-3-clause
kustodian/ansible
lib/ansible/module_utils/identity/keycloak/keycloak.py
17
21789
# Copyright (c) 2017, Eike Frost <ei@kefro.st> # # 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 ...
gpl-3.0
basicthinker/Sexain-MemController
gem5-stable/src/dev/sparc/T1000.py
66
5810
# Copyright (c) 2006-2007 The Regents of The University of Michigan # 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 ...
apache-2.0
Rashminadig/SDN
ryu/contrib/ovs/unixctl/__init__.py
55
2902
# Copyright (c) 2011, 2012 Nicira, 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 ...
apache-2.0
mdpradeep/JuliaBox
container/interactive/IJulia/tornado/src/gdrivesync.py
4
9487
import base64 import shutil import os import hashlib import time import datetime import pytz import isodate from oauth2client.client import OAuth2Credentials from oauth2client import GOOGLE_REVOKE_URI, GOOGLE_TOKEN_URI, GOOGLE_AUTH_URI from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive class G...
mit
mahendra-r/edx-platform
common/djangoapps/terrain/stubs/ora.py
119
17323
""" Stub implementation of ORA service. This is an extremely simple version of the service, with most business logic removed. In particular, the stub: 1) Provides an infinite number of peer and calibration essays, with dummy data. 2) Simulates a set number of pending submissions for each student; grades submi...
agpl-3.0
Livit/Livit.Learn.EdX
common/djangoapps/student/management/commands/set_superuser.py
95
1611
"""Management command to grant or revoke superuser access for one or more users""" from optparse import make_option from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): """Management command to grant or revoke superuser access f...
agpl-3.0
shaobin/pygments.rb
vendor/simplejson/simplejson/tests/test_decode.py
93
3287
import decimal from unittest import TestCase from StringIO import StringIO import simplejson as json from simplejson import OrderedDict class TestDecode(TestCase): if not hasattr(TestCase, 'assertIs'): def assertIs(self, a, b): self.assertTrue(a is b, '%r is %r' % (a, b)) def test_decimal...
mit
rajsadho/django
tests/migrations/test_optimizer.py
118
22678
# -*- coding: utf-8 -*- from django.db import migrations, models from django.db.migrations.optimizer import MigrationOptimizer from django.test import SimpleTestCase from .models import CustomModelBase, EmptyManager class OptimizerTests(SimpleTestCase): """ Tests the migration autodetector. """ def...
bsd-3-clause
orgito/ansible
lib/ansible/executor/stats.py
27
3148
# (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
FujitsuEnablingSoftwareTechnologyGmbH/tempest
tempest/api/network/test_ports.py
3
17922
# Copyright 2014 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...
apache-2.0
gene1wood/security_monkey
security_monkey/views/whitelist.py
7
10650
# Copyright 2014 Netflix, 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...
apache-2.0
azatoth/scons
test/option-r.py
5
1473
#!/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, ...
mit
web30s/odoo-9.0c-20160402
hello/templates/openerp/addons/payment_buckaroo/controllers/main.py
29
1107
# -*- coding: utf-8 -*- import json import logging import pprint import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class BuckarooController(http.Controller): _return_url = '/payment/buckaroo/return' _cancel_url = '/payment/buckaroo/...
gpl-3.0
jernsthausen/datesplitter
lib/python2.7/site-packages/pip/commands/wheel.py
68
9184
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import os import warnings from pip.basecommand import Command from pip.index import PackageFinder from pip.exceptions import CommandError, PreviousBuildDirError from pip.req import InstallRequirement, RequirementSet, parse_requirements from...
mit
nimzco/Environment
Sublime/Packages/pyyaml/st3/yaml/tokens.py
985
2573
class Token(object): def __init__(self, start_mark, end_mark): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in self.__dict__ if not key.endswith('_mark')] attributes.sort() arguments = ', '.join(['%s=...
mit
ropable/resource_tracking
tracking/dbutils.py
1
3126
import traceback from django.db import connections,connection,transaction def table_exists(cur,schema,table_name,log=False): cur.execute("SELECT count(*) FROM pg_catalog.pg_class a join pg_catalog.pg_namespace b on a.relnamespace = b.oid WHERE b.nspname='{}' and a.relname='{}' and a.relkind='r'".format(schema,ta...
bsd-3-clause
phdowling/scikit-learn
sklearn/cross_decomposition/pls_.py
187
28507
""" The :mod:`sklearn.pls` module implements Partial Least Squares (PLS). """ # Author: Edouard Duchesnay <edouard.duchesnay@cea.fr> # License: BSD 3 clause from ..base import BaseEstimator, RegressorMixin, TransformerMixin from ..utils import check_array, check_consistent_length from ..externals import six import w...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pip/_vendor/requests/utils.py
24
30156
# -*- coding: utf-8 -*- """ requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import codecs import contextlib import io import os import re import socket import struct import sys import tempfile import warnings import...
gpl-3.0