repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
Kefkius/encompass-mercury
src/deserialize.py
3
16148
# this code comes from ABE. it can probably be simplified # # import mmap import string import struct import types from utils import hash_160_to_pubkey_address, hash_160_to_script_address, public_key_to_pubkey_address, hash_encode,\ hash_160 import chainparams from chainparams import run_chainhook class Seriali...
agpl-3.0
wakatime/vim-wakatime
packages/wakatime/packages/pygments/lexers/smalltalk.py
31
7215
# -*- coding: utf-8 -*- """ pygments.lexers.smalltalk ~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for Smalltalk and related languages. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, bygroups, defa...
bsd-3-clause
AGG2017/diaphora
pygments/lexers/prolog.py
22
12044
# -*- coding: utf-8 -*- """ pygments.lexers.prolog ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Prolog and Prolog-like languages. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups from pyg...
gpl-2.0
Big-B702/python-for-android
python3-alpha/python3-src/Lib/test/test_multibytecodec.py
55
11487
#!/usr/bin/env python3 # # test_multibytecodec.py # Unit test for multibytecodec itself # from test import support from test.support import TESTFN import unittest, io, codecs, sys, os import _multibytecodec ALL_CJKENCODINGS = [ # _codecs_cn 'gb2312', 'gbk', 'gb18030', 'hz', # _codecs_hk 'big5hkscs', # _code...
apache-2.0
clero/parameter-framework
test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q3_4.py
2
11138
# -*-coding:utf-8 -* # Copyright (c) 2011-2015, Intel Corporation # 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 notice, thi...
bsd-3-clause
JostCrow/django-forms-builder
forms_builder/forms/fields.py
8
3149
from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured from django import forms from django.forms.extras import SelectDateWidget from django.utils.translation import ugettext_lazy as _ from forms_builder.forms.settings import USE_HTML5, EXTRA_FIELDS, EXTRA_WIDGETS from forms_b...
bsd-2-clause
perey/python-gsl
tests/test_gsl.py
1
1597
#!/usr/bin/env python3 """Tests for package-level objects in python-gsl.""" # Copyright © 2016 Timothy Pederick. # # Based on the GNU Scientific Library (GSL): # Copyright © 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 The GSL Team. #...
gpl-3.0
jasonwee/asus-rt-n14uhp-mrtg
tmp/ve_asus-rt-n14uhp-mrtg/lib/python3.4/site-packages/django/core/management/base.py
25
23999
# -*- coding: utf-8 -*- """ Base classes for writing management commands (named commands which can be executed through ``django-admin`` or ``manage.py``). """ from __future__ import unicode_literals import os import sys import warnings from argparse import ArgumentParser from optparse import OptionParser import djang...
apache-2.0
commial/miasm
miasm/arch/aarch64/regs.py
3
3680
#-*- coding:utf-8 -*- from builtins import range from miasm.expression.expression import ExprId from miasm.core.cpu import gen_reg, gen_regs exception_flags = ExprId('exception_flags', 32) interrupt_num = ExprId('interrupt_num', 32) gpregs32_str = ["W%d" % i for i in range(0x1f)] + ["WSP"] gpregs32_expr, gpregs32_i...
gpl-2.0
qifeigit/scikit-learn
examples/text/document_classification_20newsgroups.py
222
10500
""" ====================================================== Classification of text documents using sparse features ====================================================== This is an example showing how scikit-learn can be used to classify documents by topics using a bag-of-words approach. This example uses a scipy.spars...
bsd-3-clause
splunk/splunk-webframework
contrib/django/django/contrib/webdesign/templatetags/webdesign.py
232
2207
from __future__ import unicode_literals from django.contrib.webdesign.lorem_ipsum import words, paragraphs from django import template register = template.Library() class LoremNode(template.Node): def __init__(self, count, method, common): self.count, self.method, self.common = count, method, common ...
apache-2.0
tobegit3hub/keystone_docker
keystone/contrib/federation/migrate_repo/versions/007_add_remote_id_table.py
5
1590
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
lordmos/blink
Tools/Scripts/webkitpy/thirdparty/coverage/backward.py
64
4324
"""Add things to old Pythons so I can pretend they are newer.""" # This file does lots of tricky stuff, so disable a bunch of lintisms. # pylint: disable=F0401,W0611,W0622 # F0401: Unable to import blah # W0611: Unused import blah # W0622: Redefining built-in blah import os, sys # Python 2.3 doesn't have `set` try: ...
mit
coolharsh55/hdd-indexer
hdd_indexer/views.py
1
19442
"""Views for hdd-indexer / - homepage /crawler [GET/POST] - crawler interactions /loader [GET/POST] - loader interactions /settings [POST] - settings /setup [POST] - setup """ # TODO: refactor validations into separate methods # TODO: make validation a method of class # HDDRoot.validate(path): Tr...
mit
tianyang-li/de-novo-rna-seq-quant-1
boost_1_51_0/tools/regression/xsl_reports/report.py
29
12426
# Copyright (c) MetaCommunications, Inc. 2003-2004 # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import shutil import os.path import os import string import time import sys import utils import runner repo...
gpl-3.0
zorg/zorg-network-camera
zorg_network_camera/adaptor.py
2
2013
from zorg.adaptor import Adaptor import os # Check urllib for Python 2 or 3 compatability try: from urllib.parse import urlsplit from urllib import request as urllib_request except ImportError: from urlparse import urlsplit import urllib2 as urllib_request class Camera(Adaptor): def __init__(sel...
mit
ahmedbodi/AutobahnPython
examples/twisted/websocket/echo_httpheaders/server.py
18
2277
############################################################################### ## ## Copyright (C) 2013 Tavendo GmbH ## ## 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:/...
apache-2.0
yl365/ft-index
src/tests/run_powerfail_test.py
55
4328
#!/usr/local/bin/python2.6 # # Copyright (C) 2009 Tokutek, Inc. # import sys import os import optparse import getpass import pexpect import time from multiprocessing import Process # options parser = optparse.OptionParser() parser.add_option('--test', dest='test', type='string', default=None, help="name of stress tes...
gpl-2.0
google/report2bq
application/classes/sa360_report_validation/visit.py
1
1861
""" Copyright 2020 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
apache-2.0
scrollback/kuma
vendor/packages/sqlalchemy/examples/vertical/dictlike.py
7
7733
"""Mapping a vertical table as a dictionary. This example illustrates accessing and modifying a "vertical" (or "properties", or pivoted) table via a dict-like interface. These are tables that store free-form object properties as rows instead of columns. For example, instead of:: # A regular ("horizontal") table h...
mpl-2.0
nhomar/odoo
addons/base_geolocalize/models/res_partner.py
239
3743
# -*- 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
vhaupert/mitmproxy
test/filename_matching.py
2
2079
#!/usr/bin/env python3 import os import re import glob import sys def check_src_files_have_test(): missing_test_files = [] excluded = ['mitmproxy/contrib/', 'mitmproxy/io/proto/', 'mitmproxy/test/', 'mitmproxy/tools/', 'mitmproxy/platform/'] src_files = glob.glob('mitmproxy/**/*.py', rec...
mit
spektom/incubator-airflow
tests/providers/google/marketing_platform/operators/test_campaign_manager_system.py
4
1990
# # 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
gx1997/chrome-loongson
native_client_sdk/src/build_tools/tests/sdk_update_test.py
7
6623
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for sdk_update.py.""" import exceptions import mox import os import subprocess import sys import tempfile import uni...
bsd-3-clause
shuggiefisher/django-on-google-app-engine-base
django/contrib/gis/db/models/proxy.py
404
2512
""" The GeometryProxy object, allows for lazy-geometries. The proxy uses Python descriptors for instantiating and setting Geometry objects corresponding to geographic model fields. Thanks to Robert Coup for providing this functionality (see #4322). """ class GeometryProxy(object): def __init__(self, klass, field...
bsd-3-clause
vmp32k/litecoin
test/functional/feature_assumevalid.py
17
7640
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test logic for skipping signature validation on old blocks. Test logic for skipping signature validati...
mit
flaiker/libgdx
extensions/gdx-freetype/jni/freetype-2.5.5/src/tools/glnames.py
360
105239
#!/usr/bin/env python # # # FreeType 2 glyph name builder # # Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LI...
apache-2.0
scaramallion/pynetdicom3
pynetdicom/apps/storescp/storescp.py
2
6705
#!/usr/bin/env python """A Storage SCP application. Used for receiving DICOM SOP Instances transferred from an SCU. """ import argparse import os import sys from pydicom.dataset import Dataset from pydicom.uid import ( ExplicitVRLittleEndian, ImplicitVRLittleEndian, ExplicitVRBigEndian ) from pynetdicom import ...
mit
OneBitSoftware/jwtSample
src/Spa/env1/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py
1724
14031
"""Module for supporting the lxml.etree library. The idea here is to use as much of the native library as possible, without using fragile hacks like custom element names that break between releases. The downside of this is that we cannot represent all possible trees; specifically the following are known to cause proble...
mit
encbladexp/ansible
test/units/parsing/utils/test_yaml.py
159
1176
# -*- coding: utf-8 -*- # (c) 2017, Ansible Project # # 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...
gpl-3.0
pompiduskus/scikit-learn
sklearn/decomposition/sparse_pca.py
284
9424
"""Matrix factorization with Sparse PCA""" # Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort # License: BSD 3 clause import numpy as np from ..utils import check_random_state, check_array from ..utils.validation import check_is_fitted from ..linear_model import ridge_regression from ..base import BaseEstimat...
bsd-3-clause
blacklin/kbengine
kbe/src/lib/python/Lib/lib2to3/fixes/fix_filter.py
164
2102
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes filter(F, X) into list(filter(F, X)). We avoid the transformation if the filter() call is directly contained in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. NOTE: This...
lgpl-3.0
micahmicah/new-years-2016
_site/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/xml_fix.py
2767
2174
# Copyright (c) 2011 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. """Applies a fix to CR LF TAB handling in xml.dom. Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 Working around this: http://bugs.python.or...
mit
nmercier/linux-cross-gcc
win32/bin/Lib/lib-tk/test/test_tkinter/test_variables.py
2
6996
import unittest from Tkinter import (Variable, StringVar, IntVar, DoubleVar, BooleanVar, Tcl, TclError) class TestBase(unittest.TestCase): def setUp(self): self.root = Tcl() def tearDown(self): del self.root class TestVariable(TestBase): def info...
bsd-3-clause
mlperf/training_results_v0.7
Google/benchmarks/transformer/implementations/transformer-research-TF-tpu-v4-16/lingvo/core/ops/__init__.py
3
2684
# Lint as: python2, python3 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
apache-2.0
iamutkarshtiwari/sympy
sympy/integrals/tests/test_integrals.py
25
41049
from sympy import ( Abs, acos, acosh, Add, asin, asinh, atan, Ci, cos, sinh, cosh, tanh, Derivative, diff, DiracDelta, E, exp, erf, erfi, EulerGamma, factor, Function, I, Integral, integrate, Interval, Lambda, LambertW, log, Matrix, O, oo, pi, Piecewise, Poly, Rational, S, simplify, sin, tan, sqrt, ...
bsd-3-clause
FlashGordon95/Financial-Portfolio-Flask
venv/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py
359
33591
from __future__ import absolute_import import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket try: # Python 3 from queue import LifoQueue, Empty, Full except ImportError: from Queue import LifoQueue, Empty, Full # Queue is im...
mit
freezmeinster/teh-manis
django/contrib/localflavor/au/forms.py
309
1629
""" Australian-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ import re PHONE_DIGITS_RE ...
bsd-3-clause
jolevq/odoopub
addons/l10n_mx/__init__.py
975
1058
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
CTSRD-SOAAP/chromium-42.0.2311.135
third_party/webdriver/pylib/test/selenium/webdriver/common/connection_tests.py
24
1058
#Copyright 2007-2009 WebDriver committers #Copyright 2007-2009 Google Inc. # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required b...
bsd-3-clause
ramielrowe/magnum
magnum/conductor/template_definition.py
4
18822
# Copyright 2014 Rackspace Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
40223101/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/constants.py
603
15297
#!/usr/bin/env python '''Constants defined by SDL, and needed in pygame. Note that many of the flags for SDL are not needed in pygame, and are not included here. These constants are generally accessed from the `pygame.locals` module. This module is automatically placed in the pygame namespace, but you will usually ...
gpl-3.0
cdgallahue/atomic-turbine
web/lib/python2.7/site-packages/click/_termui_impl.py
136
16395
""" click._termui_impl ~~~~~~~~~~~~~~~~~~ This module contains implementations for the termui module. To keep the import time of Click down, some infrequently used functionality is placed in this module and only imported as needed. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, se...
mit
dannyboi104/SickRage
autoProcessTV/lib/requests/cookies.py
204
16791
# -*- coding: utf-8 -*- """ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import time import collections from .compat import cookielib, urlparse, urlunparse, Morsel try: import threading # grr, pyflakes: this fixes...
gpl-3.0
srm912/servo
tests/wpt/web-platform-tests/tools/py/testing/path/conftest.py
163
2692
import py import sys from py._path import svnwc as svncommon svnbin = py.path.local.sysfind('svn') repodump = py.path.local(__file__).dirpath('repotest.dump') from py.builtin import print_ def pytest_funcarg__repowc1(request): if svnbin is None: py.test.skip("svn binary not found") tmpdir = request.g...
mpl-2.0
mxOBS/deb-pkg_trusty_chromium-browser
media/cast/test/utility/netload.py
96
2633
#!/usr/bin/env python # 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. # # Simple client/server script for generating an unlimited TCP stream. # see shadow.sh for how it's intended to be used. import socket...
bsd-3-clause
sibson/vncdotool
tests/functional/test_send_events.py
2
2401
from unittest import TestCase import sys import os.path import pexpect DATADIR = os.path.join(os.path.dirname(__file__), 'data') KEYA_VDO = os.path.join(DATADIR, 'samplea.vdo') KEYB_VDO = os.path.join(DATADIR, 'sampleb.vdo') class TestSendEvents(TestCase): def setUp(self): cmd = 'vncev -rfbport 5933 -r...
mit
hyperwang/bitcoin
share/qt/extract_strings_qt.py
321
1873
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator import os import sys OUT_CPP="qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' for...
mit
guorendong/iridium-browser-ubuntu
testing/legion/task_registration_server.py
8
1814
# Copyright 2015 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. """The registration server used to register tasks. The registration server is started by the test controller and allows the tasks to register themselves whe...
bsd-3-clause
hryamzik/ansible
test/units/modules/network/netscaler/test_netscaler_service.py
18
14317
# Copyright (c) 2017 Citrix Systems # # 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
bdero/edx-platform
lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py
80
7637
# -*- 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): # Changing field 'StudentModuleHistory.version' db.alter_column('courseware_studentmodulehistory', 'version...
agpl-3.0
sudhirmishra/edx-dl
edx_dl/common.py
1
4327
# -*- coding: utf-8 -*- """ Common type definitions and constants for edx-dl The classes in this module represent the structure of courses in edX. The structure is: * A Course contains Sections * Each Section contains Subsections * Each Subsection contains Units Notice that we don't represent the full tree structu...
lgpl-3.0
aiyyoi/DevFest-MaxBond
MaxBond/env/lib/python2.7/site-packages/setuptools/tests/test_easy_install.py
111
15710
"""Easy install Tests """ import sys import os import shutil import tempfile import unittest import site import contextlib import textwrap import tarfile import logging import distutils.core from setuptools.compat import StringIO, BytesIO, next, urlparse from setuptools.sandbox import run_setup, SandboxViolation from ...
mit
maelnor/nova
nova/tests/servicegroup/test_zk_driver.py
42
2605
# Copyright (c) AT&T 2012-2013 Yun Mao <yunmao@gmail.com> # Copyright 2012 IBM Corp. # # 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
zh3036/graphql_flask_pony_crunchBase
flask_pony_graphne/lib/python3.5/site-packages/pip/_vendor/html5lib/filters/optionaltags.py
1727
10500
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def slider(self): previous1 = previous2 = None for token in self.source: if previous1 is not None: yield previous2, previous1, token previous2...
mit
opoplawski/StarCluster
starcluster/commands/completers.py
19
4704
# Copyright 2009-2014 Justin Riley # # This file is part of StarCluster. # # StarCluster 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 Foundation, either version 3 of the License, or (at your option) any # later ...
gpl-3.0
oli-kester/advanced-av-examples
amp-osc-lv2/.waf-1.8.5-3556be08f33a5066528395b11fed89fa/waflib/Tools/c_aliases.py
2
1334
#! /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 os,sys,re from waflib import Utils,Build from waflib.Configure import conf def get_extensions(lst): ret=[] for x in Utils.to_list(lst): try: if not isinstance(x,...
gpl-2.0
averrin/qutebrowser
tests/unit/misc/test_miscwidgets.py
8
3243
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
uc-cdis/cdis-python-utils
cdispyutils/profiling/profiler.py
1
8064
__all__ = ["Profiler"] from collections import defaultdict import cProfile import datetime import errno import functools import os import time from werkzeug.contrib.profiler import ProfilerMiddleware def profile(category, *profiler_args, **profiler_kwargs): """ Decorate a function to run a profiler on the e...
apache-2.0
jordanpotti/AWSBucketDump
AWSBucketDump.py
1
7239
#!/usr/bin/env python # AWSBucketDump is a tool to quickly enumerate AWS S3 buckets to look for loot. # It's similar to a subdomain bruteforcer but is made specifically to S3 # buckets and also has some extra features that allow you to grep for # delicous files as well as download interesting files if you're not # afr...
mit
adit-chandra/tensorflow
tensorflow/python/kernel_tests/division_past_test.py
27
2358
# 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
tdtrask/ansible
test/units/plugins/connection/test_connection.py
46
11277
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 later...
gpl-3.0
Synforge/err
errbot/core_plugins/health.py
2
3841
import gc import os import signal from datetime import datetime from errbot import BotPlugin, botcmd, arg_botcmd from errbot.plugin_manager import global_restart from errbot.utils import format_timedelta class Health(BotPlugin): @botcmd(template='status') def status(self, mess, args): """ If I am ali...
gpl-3.0
JizhouZhang/SDR
gr-blocks/python/blocks/qa_sample_and_hold.py
47
1754
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
pzia/keepmydatas
src/images_merge_datetree.py
1
4138
#!/usr/bin/env python # -*- coding: utf-8 -*- """Compare all photos within a tree with those stored in a date tree (yyyy/mm/dd/*) and remove already existing pictures""" import KmdImages import KmdCmd import PIL.Image as Image import os, sys import logging class KmdImagesMergeDateTree(KmdCmd.KmdCommand): def ext...
mit
Ialong/shogun
applications/msplicer/genomic.py
31
5567
# # 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. # # Written (W) 2006-2007 Soeren Sonnenburg # Written (W) 2006-2007 Mi...
gpl-3.0
7kbird/chrome
third_party/cython/src/Cython/Compiler/Tests/TestSignatureMatching.py
125
3408
import unittest from Cython.Compiler import PyrexTypes as pt from Cython.Compiler.ExprNodes import NameNode from Cython.Compiler.PyrexTypes import CFuncTypeArg def cfunctype(*arg_types): return pt.CFuncType(pt.c_int_type, [ CFuncTypeArg("name", arg_type, None) for arg_type in arg_types ]) def cppclasstyp...
bsd-3-clause
frenos/wireshark
tools/asn2wrs.py
14
308942
#!/usr/bin/env python # # asn2wrs.py # ASN.1 to Wireshark dissector compiler # Copyright 2004 Tomas Kukosa # # 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 # ...
gpl-2.0
hstarorg/HstarDemoProject
python_basic/02PythonBasis/05dict_set.py
2
1476
# 和list比较,dict有以下几个特点: # 查找和插入的速度极快,不会随着key的增加而增加; # 需要占用大量的内存,内存浪费多。 # 而list相反: # 查找和插入的时间随着元素的增加而增加; # 占用空间小,浪费内存很少。 # dict的key必须为不可变对象,如字符串和数字 # 申明字典对象 dict={'key1':'value1','key2':2} print(dict['key1']) print(dict['key2']) # 可以动态添加key value,如果key重复,则会覆盖 dict['key3']='value3' print(dict['key3']) dict['key2']='valu...
mit
javierag/samba
python/samba/tests/credentials.py
42
3667
# Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) a...
gpl-3.0
BT-fgarbely/odoo
addons/resource/faces/__init__.py
448
1325
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
ppries/tensorflow
tensorflow/python/training/input_test.py
3
76429
# 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
glovebx/odoo
openerp/report/interface.py
380
9868
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
tecwebjoao/TecWeb-TF-2T-B-SI
venv/Lib/site-packages/django/contrib/messages/storage/cookie.py
116
6560
import json from django.conf import settings from django.contrib.messages.storage.base import BaseStorage, Message from django.http import SimpleCookie from django.utils import six from django.utils.crypto import constant_time_compare, salted_hmac from django.utils.safestring import SafeData, mark_safe class Message...
apache-2.0
suto/infernal-twin
build/pip/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-3.0
vup1120/oq-hazardlib
openquake/hazardlib/tests/scalerel/strasser_test.py
2
3046
# The Hazard Library # Copyright (C) 2012-2016 GEM Foundation # # 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, either version 3 of the # License, or (at your option) any later version. #...
agpl-3.0
yongshengwang/hue
desktop/core/ext-py/Django-1.6.10/build/lib/django/contrib/contenttypes/generic.py
97
21616
""" Classes allowing "generic" relations through ContentType and object-id fields. """ from __future__ import unicode_literals from collections import defaultdict from functools import partial from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.db import models, router, ...
apache-2.0
ying-yee/Slackers
library/views.py
2
9580
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden from django import forms from django.contrib import auth from django.contrib.auth.decorators import login_required from django.core.pagina...
mit
NobleNoob/buildpack
tests/test_detect.py
12
3833
import shutil import tempfile import os.path from nose.tools import eq_ from nose.tools import with_setup from build_pack_utils import BuildPack class TestCompile(object): def setUp(self): self.build_dir = tempfile.mkdtemp(prefix='build-') self.cache_dir = tempfile.mkdtemp(prefix='cache-') ...
apache-2.0
dushu1203/chromium.src
tools/telemetry/telemetry/core/backends/chrome/extension_backend.py
12
1765
# 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 collections from telemetry.core import extension_page from telemetry.core.backends.chrome_inspector import inspector_backend_list class ExtensionBa...
bsd-3-clause
urandu/rethinkdb
external/v8_3.30.33.16/build/gyp/test/hard_dependency/gyptest-no-exported-hard-dependency.py
350
1226
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verify that a hard_dependency that is not exported is not pulled in as a dependency for a target if the target does not explicitly speci...
agpl-3.0
cameronmaske/skipper
tests/test_creds.py
1
1769
import pytest import mock from skipper.creds import Creds, JSONStorage @pytest.fixture() def creds(): storage = mock.MagicMock() storage.retrieve.return_value = {} creds = Creds(storage=storage) return creds def test_creds(creds): assert creds == {} creds['foo'] = 'bar' assert creds == ...
bsd-2-clause
greyshell/Exploit-Dev
find_safe_address/find_safe_address.py
1
3098
#!/usr/bin/env python3 # author: greyshell # description: find safe return address import argparse import sys from colorama import Fore # global constant variable PROGRAM_LOGO = """ ___ __ __ ___ ___ __ __ __ ___ __ __ |__ | |\ | | \ /__` /\ |__ |__ /\ | \ | ...
mit
T-002/python-project-template
tests/__init__.py
1
1370
# !/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2016-2017 Christian Schwarz # # 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 limitat...
mit
jokey2k/sentry
src/sentry/api/base.py
1
5659
from __future__ import absolute_import __all__ = ['DocSection', 'Endpoint', 'StatsMixin'] import logging from datetime import datetime, timedelta from django.utils.http import urlquote from django.views.decorators.csrf import csrf_exempt from enum import Enum from pytz import utc from rest_framework.authentication i...
bsd-3-clause
drawks/ansible
test/units/modules/network/onyx/test_onyx_config.py
52
4615
# # (c) 2016 Red Hat 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. # # Ansible is d...
gpl-3.0
StrikeForceZero/PJSip-CSharp
tests/pjsua/inc_sdp.py
59
1103
# $Id: inc_sdp.py 2392 2008-12-22 18:54:58Z bennylp $ # SDP template sdp_templ = \ """v=0\r o=- 1 1 $NET_TYPE $ADDR_TYPE $LOCAL_IP\r s=pjmedia\r t=0 0\r $SDP_LINES""" sdp_media_templ = \ """m=$MEDIA_TYPE $PORT $TRANSPORT 0\r c=$NET_TYPE $ADDR_TYPE $LOCAL_IP\r $SDP_LINES""" # Create SDP session def session(local_ip="...
gpl-2.0
provaleks/o8
addons/l10n_fr_hr_payroll/report/fiche_paye.py
303
3203
#!/usr/bin/env python #-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it...
agpl-3.0
JianfengXu/crosswalk-test-suite
webapi/tct-webdatabase-w3c-tests/inst.xpk.py
456
6809
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
bsd-3-clause
AdrianGaudebert/socorro-crashstats
vendor-local/lib/python/requests/packages/urllib3/__init__.py
33
1045
# urllib3/__init__.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (a...
mpl-2.0
sebastienc/kubernetes-py
kubernetes_py/models/v1/PodSpec.py
3
16809
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # from kubernetes_py.models.v1.Container import Container from kubernetes_py.models.v1.PodSecurityContext import PodSecurityContext from kuberne...
apache-2.0
alangwansui/mtl_ordercenter
openerp/report/preprocess.py
443
4700
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
xiaoyaozi5566/DiamondCache
src/arch/x86/isa/insts/x87/load_constants/load_0_1_or_pi.py
20
2164
# 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
Fat-Zer/FreeCAD_sf_master
src/Mod/Arch/Dice3DS/dom3ds.py
11
54654
# dom3ds.py """Slice and dice 3DS files. Provides for reading, writing, and manipulating 3DS files. It's called dom3ds because it's reminiscent of XML-DOM: it converts the 3DS file into a hierarchy of objects, in much the same way XML-DOM converts an XML file into a hierarchy of objects called the Document Object Mo...
lgpl-2.1
gorczynski/dotfiles
vim/bundle/powerline/powerline/bindings/ipython/pre_0_11.py
20
3832
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import re from weakref import ref from IPython.Prompts import BasePrompt from IPython.ipapi import get as get_ipython from IPython.ipapi import TryNext from powerline.ipython import IPythonPowerline, R...
gpl-3.0
foobarbazblarg/stayclean
stayclean-2019-december/serve-signups-with-flask.py
1
8591
#!/usr/bin/env python import subprocess import praw from hashlib import sha1 from flask import Flask from flask import Response from flask import request from cStringIO import StringIO from base64 import b64encode from base64 import b64decode from ConfigParser import ConfigParser import OAuth2Util import os import mar...
mit
traios/HarvesterPlugins
ckanext-harvest/ckanext/harvest/helpers.py
2
3069
from pylons import request from ckan import logic from ckan import model import ckan.lib.helpers as h import ckan.plugins as p from ckanext.harvest.model import UPDATE_FREQUENCIES from ckanext.harvest.plugin import DATASET_TYPE_NAME from ckanext.harvest.interfaces import IHarvester def package_list_for_source(source...
gpl-2.0
hezuoguang/ZGVL
WLServer/site-packages/requests/packages/urllib3/fields.py
1007
5833
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
apache-2.0
mattilyra/scikit-learn
benchmarks/bench_plot_omp_lars.py
28
4471
"""Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle regression (:ref:`least_angle_regression`) The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function import gc import sys from time import time import numpy as np from sklearn.linear_model impo...
bsd-3-clause
yencarnacion/jaikuengine
.google_appengine/lib/django-1.5/tests/modeltests/files/tests.py
42
4754
from __future__ import absolute_import import gzip import shutil import tempfile from django.core.cache import cache from django.core.files import File from django.core.files.base import ContentFile from django.core.files.uploadedfile import SimpleUploadedFile from django.test import TestCase from django.utils import...
apache-2.0