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
jodal/pyspotify
tests/test_loadable.py
3
4094
from __future__ import unicode_literals import time import unittest import spotify from spotify.utils import load import tests from tests import mock class Foo(object): def __init__(self, session): self._session = session @property def is_loaded(self): return True def load(self, t...
apache-2.0
hdinsight/hue
apps/impala/setup.py
39
1222
# 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 may not use this file ex...
apache-2.0
Therp/odoo
addons/l10n_be/wizard/l10n_be_account_vat_declaration.py
309
10685
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # Adapted by Noviat to # - enforce correct vat number # - support negative balance # - assign...
agpl-3.0
appsembler/edx-platform
lms/djangoapps/course_blocks/transformers/tests/test_hidden_content.py
19
2598
""" Tests for HiddenContentTransformer. """ from datetime import timedelta import ddt from django.utils.timezone import now from nose.plugins.attrib import attr from ..hidden_content import HiddenContentTransformer from .helpers import BlockParentsMapTestCase, update_block @attr(shard=3) @ddt.ddt class HiddenConten...
agpl-3.0
spxtr/bazel
tools/android/merge_manifests_test.py
15
26371
# Copyright 2015 The Bazel 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 applicable la...
apache-2.0
smartforceplus/SmartForceplus
addons/hr/__openerp__.py
260
2372
# -*- 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
ewdurbin/raven-python
raven/utils/serializer/base.py
4
5351
# -*- coding: utf-8 -*- """ raven.utils.serializer.base ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import itertools import types from raven.utils import six from raven....
bsd-3-clause
meyerson/luigi
luigi/scheduler.py
2
41595
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
chrissmejia/SpreadLabs
facebook/urls.py
1
1025
""" SpreadLabs - Social media suite Copyright (C) 2015 Christopher Mejia Montoya - me@chrissmejia.com - chrissmejia.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, eit...
agpl-3.0
ISIFoundation/influenzanet-website
apps/contest/migrations/0002_auto__add_field_week_prediction.py
3
4561
# encoding: 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 field 'Week.prediction' db.add_column('contest_week', 'prediction', self.gf('django.db.models.fie...
agpl-3.0
sgruszka/iwlegacy
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
jorik041/shadowsocks-1
shadowsocks/udprelay.py
924
11154
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
skymanaditya1/numpy
doc/example.py
81
3581
"""This is the docstring for the example.py module. Modules names should have short, all-lowercase names. The module name may have underscores if this improves readability. Every module should have a docstring at the very top of the file. The module's docstring may extend over multiple lines. If your docstring doe...
bsd-3-clause
tik0/inkscapeGrid
share/extensions/generate_voronoi.py
6
8433
#!/usr/bin/env python """ Copyright (C) 2010 Alvin Penner, penner@vaxxine.com - Voronoi Diagram algorithm and C code by Steven Fortune, 1987, http://ect.bell-labs.com/who/sjf/ - Python translation to file voronoi.py by Bill Simons, 2005, http://www.oxfish.com/ This program is free software; you can redistribute it an...
gpl-2.0
chenruixuan/PopClip-Extensions
source/InstantTranslate/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
mit
UNINETT/nav
python/nav/web/machinetracker/urls.py
2
1512
# # Copyright (C) 2009-2011, 2019 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License version 3 as published by # the Free Software Foundation. # # This program is distributed ...
gpl-2.0
ngalin/Illumimateys
InterviewPrepScripts/byteSerialVideo.py
1
1343
import numpy as np import cv2 from time import sleep import serial #ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=1) ser = serial.Serial('/dev/ttyACM0', 115200, timeout=1) cap = cv2.VideoCapture(0) NUM_LEDS = 100 SEND_SERIAL = True while 1: ret,frame = cap.read() if frame == None: continue # ...
mit
koditr/xbmc-tr-team-turkish-addons
script.module.mechanize/lib/mechanize/_http.py
133
14354
"""HTTP related handlers. Note that some other HTTP handlers live in more specific modules: _auth.py, _gzip.py, etc. Copyright 2002-2006 John J Lee <jjl@pobox.com> This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt included w...
gpl-2.0
BIT-SYS/gem5-spm-module
src/arch/x86/isa/insts/general_purpose/data_conversion/bcd_adjust.py
91
2276
# 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
jonathanunderwood/numpy
numpy/distutils/fcompiler/pg.py
167
1940
# http://www.pgroup.com from __future__ import division, absolute_import, print_function from numpy.distutils.fcompiler import FCompiler from sys import platform compilers = ['PGroupFCompiler'] class PGroupFCompiler(FCompiler): compiler_type = 'pg' description = 'Portland Group Fortran Compiler' version...
bsd-3-clause
40223232/w16b_test
static/Brython3.1.1-20150328-091302/Lib/textwrap.py
745
16488
"""Text wrapping and filling. """ # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward <gward@python.net> import re __all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent'] # Hardcode the recognized whitespace characters to the US-ASCII # whit...
gpl-3.0
wscullin/spack
lib/spack/spack/cmd/common/arguments.py
2
5173
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
CptLemming/libsaas
libsaas/port.py
4
2951
""" Utilities for writing code compatible with different versions of Python. Mostly stolen from six, but we don't want to make it a dependency. """ import sys PY3 = sys.version_info[0] == 3 if PY3: text_type = str binary_type = bytes integer_types = int, numeric_types = int, float from urllib...
mit
pramasoul/micropython
tests/multi_net/uasyncio_tcp_server_client.py
15
1299
# Test uasyncio TCP server and client using start_server() and open_connection() try: import uasyncio as asyncio except ImportError: try: import asyncio except ImportError: print("SKIP") raise SystemExit PORT = 8000 async def handle_connection(reader, writer): # Test that pee...
mit
jordanemedlock/psychtruths
temboo/Library/Tumblr/Post/CreateAudioPostWithURL.py
5
7035
# -*- coding: utf-8 -*- ############################################################################### # # CreateAudioPostWithURL # Creates a new audio post using a specified external URL. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "Licens...
apache-2.0
valkjsaaa/sl4a
python/src/Tools/scripts/redemo.py
63
5769
"""Basic regular expression demostration facility (Perl style syntax).""" from Tkinter import * import re class ReDemo: def __init__(self, master): self.master = master self.promptdisplay = Label(self.master, anchor=W, text="Enter a Perl-style regular expression:") self.p...
apache-2.0
azumimuo/family-xbmc-addon
plugin.video.NJMSoccer/default.py
1
102470
import urllib import urllib2 import datetime import re import os import xbmcplugin import xbmcgui import xbmcaddon import xbmcvfs import traceback import cookielib from addon.common.net import Net from BeautifulSoup import BeautifulStoneSoup, BeautifulSoup, BeautifulSOAP try: import json except: import simplejs...
gpl-2.0
mcauser/micropython
tests/extmod/uctypes_sizeof_native.py
9
1081
try: import uctypes except ImportError: print("SKIP") raise SystemExit S1 = {} assert uctypes.sizeof(S1) == 0 S2 = {"a": uctypes.UINT8 | 0} assert uctypes.sizeof(S2) == 1 S3 = { "a": uctypes.UINT8 | 0, "b": uctypes.UINT8 | 1, } assert uctypes.sizeof(S3) == 2 S4 = { "a": uctypes.UINT8 | 0, ...
mit
Philippe12/external_chromium_org
build/android/symbolize_test.py
52
5015
#!/usr/bin/env python # # 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. """Unittest for symbolize.py. This test uses test libraries generated by the Android g++ toolchain. Should things break you can rec...
bsd-3-clause
m1ck/bookadoptions
django/utils/unittest/result.py
570
6105
"""Test result object""" import sys import traceback import unittest from StringIO import StringIO from django.utils.unittest import util from django.utils.unittest.compatibility import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'fail...
bsd-3-clause
cbrewster/servo
tests/wpt/web-platform-tests/tools/third_party/html5lib/html5lib/tests/support.py
30
6078
from __future__ import absolute_import, division, unicode_literals # pylint:disable=wrong-import-position import os import sys import codecs import glob import xml.sax.handler base_path = os.path.split(__file__)[0] test_dir = os.path.join(base_path, 'testdata') sys.path.insert(0, os.path.abspath(os.path.join(base_p...
mpl-2.0
sharpwhisper/shadowsocks
shadowsocks/manager.py
925
9692
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
nibanks/openthread
tests/scripts/thread-cert/Cert_5_1_05_RouterAddressTimeout.py
5
5912
#!/usr/bin/python # # 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 # not...
bsd-3-clause
fabianvf/osf.io
tests/base.py
3
10498
# -*- coding: utf-8 -*- '''Base TestCase class for OSF unittests. Uses a temporary MongoDB database.''' import os import re import shutil import logging import unittest import functools import datetime as dt from flask import g import blinker import httpretty from webtest_plus import TestApp import mock from faker im...
apache-2.0
conejoninja/xbmc-seriesly
seriesly/buscador.py
1
13145
# -*- coding: iso-8859-1 -*- #------------------------------------------------------------ # seriesly - XBMC Plugin # http://blog.tvalacarta.info/plugin-xbmc/seriesly/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import sys from core import config from core import log...
gpl-3.0
coursemdetw/2014c2
wsgi/programs/c2g7/__init__.py
1
37652
import cherrypy # 這是 C2G7 類別的定義 class C2G7(object): # 各組利用 index 引導隨後的程式執行 @cherrypy.expose def index(self, *args, **kwargs): outstring = ''' 這是 2014C2 協同專案下的 c2g7 分組程式開發網頁, 以下為 W12 的任務執行內容.<br /> <!-- 這裡採用相對連結, 而非網址的絕對連結 (這一段為 html 註解) --> <a href="fillpoly">c2g7 fillpoly 繪圖</a><br /> <a href="dra...
gpl-2.0
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/pyshared/apt/debfile.py
1
27001
# Copyright (c) 2005-2010 Canonical # # Author: Michael Vogt <michael.vogt@ubuntu.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 of the # License, or (at your opti...
gpl-3.0
TomBurnett/BlenderGameEngineJavabot
Scripts/Camera-Scripts/Mouselook.py
2
5772
###################################################### # # MouseLook.py Blender 2.55 # # Tutorial for using MouseLook.py can be found at # # www.tutorialsforblender3d.com # # Released under the Creative Commons Attribution 3.0 Unported License. # # If you use this code, please include this information ...
gpl-2.0
babbel/floto
floto/api/swf.py
1
6622
import json import logging import boto3 import botocore.exceptions from botocore.client import Config import floto.api import floto.specs logger = logging.getLogger(__name__) class Swf(object): def __init__(self, region_name=None, profile_name=None): self.init_client(region_name, profile_name) ...
mit
andmos/ansible
test/units/module_utils/basic/test_selinux.py
78
11565
# -*- coding: utf-8 -*- # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com> # (c) 2017 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 ...
gpl-3.0
yceruto/django
tests/migrations/test_optimizer.py
18
12842
# encoding: utf8 from django.test import TestCase from django.db.migrations.optimizer import MigrationOptimizer from django.db import migrations from django.db import models class OptimizerTests(TestCase): """ Tests the migration autodetector. """ def optimize(self, operations): """ ...
bsd-3-clause
feinheit/zipfelchappe
zipfelchappe/admin.py
1
13080
from __future__ import unicode_literals, absolute_import import csv import ast from datetime import datetime from django import forms from django.conf.urls import patterns, url from django.db import models from django.db.models.loading import get_model from django.contrib import admin from django.contrib.admin import ...
bsd-3-clause
agaffney/ansible
test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/lldp_interfaces/lldp_interfaces.py
47
5314
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The vyos lldp_interfaces fact class It is in this file the configuration is collected from the device for a given resource, parsed, and the facts tree is populated based ...
gpl-3.0
zbqf109/goodo
openerp/addons/point_of_sale/report/pos_payment_report.py
44
2603
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from openerp.osv import osv from openerp.report import report_sxw class pos_payment_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(pos_payment_report, self).__i...
gpl-3.0
neilLasrado/erpnext
erpnext/healthcare/report/lab_test_report/lab_test_report.py
14
1610
# Copyright (c) 2016, ESS # License: See license.txt from __future__ import unicode_literals import frappe from frappe import msgprint, _ def execute(filters=None): if not filters: filters = {} lab_test_list = get_lab_test(filters) columns = get_columns() if not lab_test_list: msgprint(_("No record found")) ...
gpl-3.0
SwissTPH/openmalaria
contrib/cxxtest/admin/virtualenv.py
109
115013
#!/usr/bin/env python """Create a "virtual" Python installation """ # If you change the version here, change it in setup.py # and docs/conf.py as well. __version__ = "1.9.1" # following best practices virtualenv_version = __version__ # legacy, again import base64 import sys import os import codecs import optparse i...
gpl-2.0
rutgers-apl/Atomicity-Violation-Detector
tdebug-llvm/llvm/test/CodeGen/SystemZ/Large/branch-range-04.py
9
3694
# Test 64-bit COMPARE AND BRANCH in cases where the sheer number of # instructions causes some branches to be out of range. # RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s # Construct: # # before0: # conditional branch to after0 # ... # beforeN: # conditional branch to after0 # main: # 0xffcc by...
gpl-2.0
3drobotics/MAVProxy
MAVProxy/modules/lib/mp_util.py
4
8141
#!/usr/bin/env python # -*- coding: utf-8 -*- '''common mavproxy utility functions''' import math import os # Some platforms (CYGWIN and others) many not have this library has_wxpython = False try: import wx has_wxpython = True except ImportError, e: pass radius_of_earth = 6378100.0 # in meters def gps_...
gpl-3.0
ashvina/heron
heron/instance/tests/python/network/mock_generator_client.py
5
6604
#!/usr/bin/env python # -*- encoding: utf-8 -*- # 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...
apache-2.0
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/numpy/core/generate_numpy_api.py
113
7629
from __future__ import division, print_function import os import genapi from genapi import \ TypeApi, GlobalVarApi, FunctionApi, BoolValuesApi import numpy_api # use annotated api when running under cpychecker h_template = r""" #if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_AR...
mit
kwierman/osf.io
website/addons/figshare/tests/test_views.py
44
11751
#!/usr/bin/env python # encoding: utf-8 import mock import unittest import httpretty from os.path import join as join_path from json import dumps from nose.tools import * # noqa import httplib as http from tests.base import OsfTestCase from tests.factories import ProjectFactory, AuthUserFactory from tests.test_add...
apache-2.0
lshain-android-source/external-chromium_org
build/android/provision_devices.py
23
3148
#!/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. """Provisions Android devices with settings required for bots. Usage: ./provision_devices.py [-d <device serial number>] """ ...
bsd-3-clause
oscaro/django
django/shortcuts.py
34
5973
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ from django.template import loader, RequestContext from django.http import HttpResponse, Http404 from django.http import HttpRespons...
bsd-3-clause
muntasirsyed/intellij-community
python/lib/Lib/wsgiref/validate.py
162
14737
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php # Licensed to PSF under a Contributor Agreement """ Middlew...
apache-2.0
wanghongjuan/crosswalk-test-suite
webapi/tct-canvas-html5-tests/inst.apk.py
1996
3186
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARAMETERS = None ADB_CMD = "adb" def doCMD(cmd): # Do not need handle timeout in this short script, let tool...
bsd-3-clause
BigDataforYou/movie_recommendation_workshop_1
big_data_4_you_demo_1/venv/lib/python2.7/site-packages/numpy/polynomial/tests/test_polynomial.py
21
16629
"""Tests for polynomial module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.polynomial as poly from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_module_suite) def trim(x): return poly.p...
mit
dyyi/moneybook
venv/Lib/site-packages/pip/_vendor/distlib/locators.py
129
50493
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except Impo...
apache-2.0
sergeimoiseev/othodi_code
old/bokeh_googlemaps_example.py
2
2494
from __future__ import print_function # from bokeh.util.browser import view # from bokeh.document import Document # from bokeh.embed import file_html from bokeh.plotting import show, save, output_file from bokeh.models.glyphs import Circle from bokeh.models import ( GMapPlot, Range1d, ColumnDataSource, Pan...
mit
Alwnikrotikz/cortex-vfx
python/IECoreMaya/SceneShapeUI.py
5
15276
########################################################################## # # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
bsd-3-clause
rekhajoshm/spark
python/pyspark/ml/util.py
15
19801
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
nathanborror/django-basic-apps
basic/flagging/views.py
10
3709
from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext from django.contrib.auth.decorators import login_required from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User from django.shortcuts import render_to_response, get_obje...
bsd-3-clause
nburn42/tensorflow
tensorflow/contrib/gan/python/features/python/clip_weights.py
74
1194
# 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...
apache-2.0
guoxiaolongzte/spark
python/pyspark/broadcast.py
3
7181
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
gena/qgis-earthengine-plugin
pavement.py
1
3481
# -*- coding: utf-8 -*- import os import platform import fnmatch import zipfile from paver.easy import * def get_extlibs(): if platform.system() == "Windows": return 'extlibs_windows' if platform.system() == "Darwin": return 'extlibs_macos' if platform.system() == "Linux": return...
mit
pyfa-org/Pyfa
gui/builtinViewColumns/attributeDisplayGraph.py
2
9675
# ============================================================================= # Copyright (C) 2010 Diego Duclos # # This file is part of pyfa. # # pyfa 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 ...
gpl-3.0
zooniverse/aggregation
experimental/paper/errorCheck.py
2
1134
#!/usr/bin/env python __author__ = 'greg' import pymongo from aggregation import base_directory from penguinAggregation import PenguinAggregation import os import sys import numpy as np import matplotlib.pyplot as plt import urllib import matplotlib.cbook as cbook # add the paths necessary for clustering algorithm and...
apache-2.0
lidaobing/itcc
itcc/tools/idx_verify.py
1
1557
import sys from itcc.molecule import read from itcc.tools import conffile def read_corr(ifile): res = [] for line in conffile(ifile): res.append([int(x)-1 for x in line.split()]) assert len(res[-1]) == 2 return res def verify_correspoding(mol1, mol2, corr): d = [None] * len(corr) ...
gpl-3.0
g8ecj/bertos
wizard/BCreationPage.py
8
6235
#!/usr/bin/env python # encoding: utf-8 # # This file is part of BeRTOS. # # Bertos 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. # #...
gpl-2.0
cjaymes/pyscap
src/scap/model/oval_5/sc/independent/FileHashItemElement.py
1
1550
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
gpl-3.0
quentinsf/ansible
lib/ansible/utils/module_docs.py
17
4605
#!/usr/bin/env python # (c) 2012, Jan-Piet Mens <jpmens () 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...
gpl-3.0
SatoshiNXSimudrone/sl4a-damon-clone
python/src/Lib/lib2to3/tests/test_pytree.py
50
15828
#!/usr/bin/env python2.5 # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Unit tests for pytree.py. NOTE: Please *don't* add doc strings to individual test methods! In verbose mode, printing of the module, class and method name is much more helpful than printing o...
apache-2.0
aroche/django
tests/basic/tests.py
117
29910
from __future__ import unicode_literals import threading import warnings from datetime import datetime, timedelta from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections from django.db.models.fields import Field from django.db.m...
bsd-3-clause
tomasreimers/tensorflow-emscripten
tensorflow/contrib/distributions/python/ops/laplace.py
11
6785
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
felix-d/boto
boto/rds/dbsubnetgroup.py
170
2825
# Copyright (c) 2013 Franc Carter - franc.carter@gmail.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 limitation the rights to use, copy, modif...
mit
rcharp/toyota-flask
venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py
619
2168
from io import BytesIO class CallbackFileWrapper(object): """ Small wrapper around a fp object which will tee everything read into a buffer, and when that file is closed it will execute a callback with the contents of that buffer. All attributes are proxied to the underlying file object. Thi...
apache-2.0
kingvuplus/Test-OBH
lib/python/Components/ConfigList.py
8
9047
from HTMLComponent import HTMLComponent from GUIComponent import GUIComponent from config import KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_OK, KEY_TOGGLEOW, KEY_ASCII, KEY_TIMEOUT, KEY_NUMBERS, ConfigElement, ConfigText, ConfigPassword from Components.ActionMap import NumberActionMap...
gpl-2.0
emon10005/scikit-image
skimage/restoration/uft.py
39
12563
# -*- coding: utf-8 -*- # uft.py --- Unitary fourier transform """Function of unitary fourier transform and utilities This module implements the unitary fourier transform, also known as the ortho-normal transform. It is especially useful for convolution [1], as it respects the Parseval equality. The value of the null...
bsd-3-clause
google/graphicsfuzz
gfauto/gfauto/run_amber_android.py
1
2782
# -*- coding: utf-8 -*- # Copyright 2019 The GraphicsFuzz Project 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
claranet/ssha
ssha/config.py
1
8786
from __future__ import unicode_literals import copy import os import re import subprocess import tempfile from cryptography.hazmat.primitives import serialization as crypto_serialization from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.backends import default_backend as crypto_defaul...
mit
kumarkrishna/sympy
sympy/parsing/tests/test_maxima.py
123
1647
from sympy.parsing.maxima import parse_maxima from sympy import Rational, Abs, Symbol, sin, cos, E, oo, log, factorial from sympy.abc import x n = Symbol('n', integer=True) def test_parser(): assert Abs(parse_maxima('float(1/3)') - 0.333333333) < 10**(-5) assert parse_maxima('13^26') == 917333301932686166583...
bsd-3-clause
karllessard/tensorflow
tensorflow/python/tools/optimize_for_inference_lib.py
18
20887
# pylint: disable=g-bad-file-header # 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/LICENS...
apache-2.0
40223119/w17test
static/Brython3.1.1-20150328-091302/Lib/unittest/util.py
794
4157
"""Various utility functions.""" from collections import namedtuple, OrderedDict __unittest = True _MAX_LENGTH = 80 def safe_repr(obj, short=False): try: result = repr(obj) except Exception: result = object.__repr__(obj) if not short or len(result) < _MAX_LENGTH: return result ...
gpl-3.0
asen6/amartyasenguptadotcom
django/contrib/gis/db/backends/postgis/adapter.py
311
1165
""" This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. """ from psycopg2 import Binary from psycopg2.extensions import ISQLQuote class PostGISAdapter(object): def __init__(self, geom): "Initializes on the geometry." # Getting the WKB (in string form, to allow easy pickling ...
bsd-3-clause
albhasan/modis2scidb
hdf2sdbbin.py
1
4747
import os import sys import fnmatch import subprocess import datetime import argparse import logging import re def isLeapYear(year): '''Returns TRUE if the given year (int) is leap and FALSE otherwise''' leapyear = False if year % 4 != 0: leapyear = False elif year % 100 != 0: leapyear = True elif year % 400...
mit
krafczyk/spack
var/spack/repos/builtin/packages/py-sncosmo/package.py
5
2131
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
davidgbe/scikit-learn
sklearn/externals/joblib/disk.py
320
3280
""" Disk management utilities. """ # Authors: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Lars Buitinck <L.J.Buitinck@uva.nl> # Copyright (c) 2010 Gael Varoquaux # License: BSD Style, 3 clauses. import errno import os import shutil import sys import time def disk_used(path): """ Return...
bsd-3-clause
mishbahr/django-connected
runtests.py
1
1235
import sys try: from django.conf import settings settings.configure( DEBUG=True, LANGUAGE_CODE='en-us', USE_TZ=True, DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'connected_accounts', } ...
bsd-3-clause
agitaretech/nsc-cloudproject-s22016
api/verify_oauth & blob/azure/storage/file/_chunking.py
4
9492
#------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://w...
apache-2.0
Havate/havate-openstack
proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/admin/users/panel.py
12
1054
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
gram526/VTK
Examples/VisualizationAlgorithms/Python/ColorIsosurface.py
27
2565
#!/usr/bin/env python # This example shows how to color an isosurface with other # data. Basically an isosurface is generated, and a data array is # selected and used by the mapper to color the surface. import vtk from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Read some data. The importa...
bsd-3-clause
citirex/affiliates
config/settings/production.py
1
7710
# -*- coding: utf-8 -*- ''' Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use mailgun to send emails - Use Redis on Heroku - Use sentry for error logging - Use opbeat for error reporting ''' from __future__ import absolute_import, unicode_literals fro...
bsd-3-clause
FactomProject/Testing
examples/python/createECaddressStanalone.py
1
1468
import sys sys.path.append('libs') import hashlib import base58 import ed25519djb as ed25519 import os # get a 32 byte random number. This is the raw ed25519 private key ECprivatekey = os.urandom(32) # if using an existing private key, uncomment and add your key here #ECprivatekey = "0000000000000000000000000000000...
mit
FenomenalMOD/FenomenalMOD_osprey
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
peiyuwang/pants
tests/python/pants_test/targets/test_unknown_arguments_integration.py
11
1972
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from conte...
apache-2.0
RadioFreeAsia/CharacterTransforms
maps.py
1
74142
# $Id: maps.py,v 1.3 2007-07-13 18:25:16 riverah Exp $ def getChineseMap(): map = { u'\u5167': u'\u5185', u'\u52FB': u'\u5300', u'\u5F14': u'\u540A', u'\u6236': u'\u6237', u'\u518A': u'\u518C', u'\u672E': u'\u672F', u'\u6C3E': u'\u6CDB', u'\u4E1F': u'\u4E22', u'\u4E99': u'\u4E98', u'\u4F15': u'\u5...
gpl-2.0
valentin-krasontovitsch/ansible
lib/ansible/modules/network/eos/eos_interface.py
13
15170
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, 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
wooga/airflow
airflow/jobs/local_task_job.py
1
6814
# # 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
boyuegame/kbengine
kbe/res/scripts/common/Lib/ctypes/test/test_prototypes.py
71
6738
from ctypes import * from ctypes.test import need_symbol import unittest # IMPORTANT INFO: # # Consider this call: # func.restype = c_char_p # func(c_char_p("123")) # It returns # "123" # # WHY IS THIS SO? # # argument tuple (c_char_p("123"), ) is destroyed after the function # func is called, but NOT before ...
lgpl-3.0
ThotAlion/FIRE
FIRELIB/CSVPlayer.py
1
2383
from numpy import * import Block from PyQt4.QtGui import * from PyQt4.QtCore import * from Connexion import * import Tools import time import csv class CSVPlayer(Block.Block,QWidget): """ this class describes a block """ def __init__(self,members): Block.Block.__init__(self) QWidget.__init...
mit
blaggacao/odoo
addons/portal_project/project.py
103
1769
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-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