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
tonybaloney/st2contrib
packs/lastline/actions/submit_file_hash.py
10
2392
from lib import actions class SubmitFileHashAction(actions.BaseAction): def run(self, md5=None, sha1=None, download_ip=None, download_port=None, download_url=None, download_host=None, download_path=None, download_agent=None, download_referer=None, download_request=None, full_re...
apache-2.0
IllusionRom-deprecated/android_platform_external_chromium_org_tools_gyp
test/win/gyptest-link-mapfile.py
254
1391
#!/usr/bin/env python # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Make sure mapfile settings are extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.TestGyp...
bsd-3-clause
hatwar/focal-erpnext
erpnext/stock/doctype/material_request/test_material_request.py
24
13654
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # ERPNext - web based ERP (http://erpnext.com) # For license information, please see license.txt from __future__ import unicode_literals import frappe, unittest from frappe.utils import fl...
agpl-3.0
raviflipsyde/servo
components/script/dom/bindings/codegen/parser/tests/test_distinguishability.py
134
5560
def firstArgType(method): return method.signatures()[0][1][0].type def WebIDLTest(parser, harness): parser.parse(""" dictionary Dict { }; callback interface Foo { }; interface Bar { // Bit of a pain to get things that have dictionary types void passDict(optional Di...
mpl-2.0
kubeflow/kfp-tekton
backend/api/python_http_client/kfp_server_api/models/api_cron_schedule.py
2
4723
# coding: utf-8 """ Kubeflow Pipelines API This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition. Contact: kubeflow-pipelines@google.com Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import s...
apache-2.0
EBI-Metagenomics/emgapi
emgapi/migrations/0028_auto_20200706_1823.py
1
1069
# -*- coding: utf-8 -*- # Generated by Django 1.11.25 on 2020-06-16 12:02 from __future__ import unicode_literals from django.db import migrations def add_checksum_algorithms(apps, schema_editor): """ Add hash algorithms: - SHA1 - SHA256 - MD5 """ ChecksumAlgorithms = apps.get_model("emga...
apache-2.0
srvg/ansible-modules-extras
clustering/consul_kv.py
23
9797
#!/usr/bin/python # # (c) 2015, Steve Gargan <steve.gargan@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
allenlavoie/tensorflow
tensorflow/contrib/autograph/pyct/static_analysis/activity.py
2
10778
# 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
keithroe/vtkoptix
ThirdParty/Twisted/twisted/test/testutils.py
56
5318
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ I{Private} test utilities for use throughout Twisted's test suite. Unlike C{proto_helpers}, this is no exception to the don't-use-it-outside-Twisted-we-won't-maintain-compatibility rule! @note: Maintainers be aware: things in this module sho...
bsd-3-clause
itoijala/pyfeyner
examples/pyfeyn-test3.py
1
2416
#!/usr/bin/env python2 # # pyfeyner - a simple Python interface for making Feynman diagrams. # Copyright (C) 2005-2010 Andy Buckley, Georg von Hippel # Copyright (C) 2013 Ismo Toijala # # pyfeyner is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publishe...
gpl-2.0
Gitlab11/odoo
addons/website_event_track/models/event.py
300
8344
# -*- 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
mapr/impala
tests/comparison/model.py
2
18288
# Copyright (c) 2014 Cloudera, 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 o...
apache-2.0
jhjguxin/blogserver
lib/python2.7/site-packages/django/template/loaders/eggs.py
229
1432
# Wrapper for loading templates from eggs via pkg_resources.resource_string. try: from pkg_resources import resource_string except ImportError: resource_string = None from django.template.base import TemplateDoesNotExist from django.template.loader import BaseLoader from django.conf import settings class Loa...
mit
guillaume-philippon/aquilon
lib/aquilon/worker/commands/show_domain_domain.py
2
1151
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2013,2016 Contributor # # 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...
apache-2.0
Sidney84/pa-chromium
chrome/common/extensions/docs/server2/object_store_creator_test.py
7
2362
#!/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. import unittest from appengine_wrappers import GetAppVersion from test_object_store import TestObjectStore from object_store_creator i...
bsd-3-clause
IITBinterns13/edx-platform-dev
lms/djangoapps/lms_migration/management/commands/create_groups.py
86
1761
#!/usr/bin/python # # File: create_groups.py # # Create all staff_* groups for classes in data directory. import os from django.core.management.base import BaseCommand from django.conf import settings from django.contrib.auth.models import Group from path import path from lxml import etree def create_groups(): ...
agpl-3.0
bryanph/OIPA
OIPA/api/country/serializers.py
2
1995
from rest_framework import serializers import geodata from api.generics.serializers import DynamicFieldsModelSerializer from api.region.serializers import RegionSerializer from api.fields import JSONField from api.activity.aggregation import AggregationsSerializer class CountrySerializer(DynamicFieldsModelSerializer)...
agpl-3.0
ShassAro/ShassAro
DockerAdmin/dockerVirtualEnv/lib/python2.7/site-packages/django/conf/locale/hr/formats.py
82
2108
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y.' TIME_FORMAT = 'H:i:s' DA...
gpl-2.0
dreamsxin/kbengine
kbe/res/scripts/common/Lib/test/test_descrtut.py
119
11778
# This contains most of the executable examples from Guido's descr # tutorial, once at # # http://www.python.org/2.2/descrintro.html # # A few examples left implicit in the writeup were fleshed out, a few were # skipped due to lack of interest (e.g., faking super() by hand isn't # of much interest anymore), and a f...
lgpl-3.0
johnloucaides/chipsec
chipsec/module_common.py
1
3593
#!/usr/bin/python #CHIPSEC: Platform Security Assessment Framework #Copyright (c) 2010-2015, Intel Corporation # #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; Version 2. # #This program is distr...
gpl-2.0
Teamxrtc/webrtc-streaming-node
third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/httplib2/python2/httplib2/test/miniserver.py
303
3327
import logging import os import select import SimpleHTTPServer import SocketServer import threading HERE = os.path.dirname(__file__) logger = logging.getLogger(__name__) class ThisDirHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def translate_path(self, path): path = path.split('?', 1)[0].split('#'...
mit
mbollmann/perceptron
mmb_perceptron/feature_extractor/generator/generative_extractor.py
1
3342
# -*- coding: utf-8 -*- import numpy as np from .. import FeatureExtractor class GenerativeExtractor(FeatureExtractor): """Abstract base class for a generative feature extractor. Compared to simple feature extractors, generators perform the additional task of generating class label candidates. This mean...
mit
phantomnat/my-cf-client-python
lib/cfclient/ui/dialogs/inputconfigdialogue.py
8
18025
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
gpl-2.0
openstack/cliff
cliff/help.py
1
4846
# 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 u...
apache-2.0
python-recsys/django-recommends
recommends/storages/djangoorm/routers.py
4
1192
from .settings import RECOMMENDS_STORAGE_DATABASE_ALIAS class RecommendsRouter(object): def db_for_read(self, model, **hints): "Point all operations on recommends models to RECOMMENDS_STORAGE_DATABASE_NAME" if model._meta.app_label == 'recommends': return RECOMMENDS_STORAGE_DATABASE_AL...
mit
ua-snap/downscale
old/bin/hur_cru_ts31_to_cl20_downscaling.py
3
22421
# # # # Current implementation of the cru ts31 (ts32) delta downscaling procedure # # Author: Michael Lindgren (malindgren@alaska.edu) # # # import numpy as np def write_gtiff( output_arr, template_meta, output_filename, compress=True ): ''' DESCRIPTION: ------------ output a GeoTiff given a numpy ndarray, rasterio...
mit
ramadhane/odoo
addons/account_analytic_default/__openerp__.py
264
1831
# -*- 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
cynicaldevil/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/sub/exception_in_transfer_wsh.py
499
1816
# Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
eduNEXT/edunext-platform
common/test/acceptance/pages/studio/course_info.py
4
4873
""" Course Updates page. """ from common.test.acceptance.pages.common.utils import click_css, confirm_prompt from common.test.acceptance.pages.studio.course_page import CoursePage from common.test.acceptance.pages.studio.utils import set_input_value, type_in_codemirror class CourseUpdatesPage(CoursePage): """ ...
agpl-3.0
gannetson/sportschooldeopenlucht
env/lib/python2.7/site-packages/setuptools/tests/test_bdist_egg.py
286
1954
"""develop tests """ import sys import os, re, shutil, tempfile, unittest import tempfile import site from distutils.errors import DistutilsError from setuptools.compat import StringIO from setuptools.command.bdist_egg import bdist_egg from setuptools.command import easy_install as easy_install_pkg from setuptools.dis...
bsd-3-clause
ychen820/microblog
y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/s3/test_mfa.py
136
3629
# Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # All rights reserved. # # 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 restrict...
bsd-3-clause
cupcicm/git-repo
tests/test_git_config.py
83
1349
import os import unittest import git_config def fixture(*paths): """Return a path relative to test/fixtures. """ return os.path.join(os.path.dirname(__file__), 'fixtures', *paths) class GitConfigUnitTest(unittest.TestCase): """Tests the GitConfig class. """ def setUp(self): """Create ...
apache-2.0
bcheung92/Paperproject
gem5/src/arch/x86/isa/insts/simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py
91
5873
# 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...
mit
TheNameIsNigel/android_kernel_huawei_msm8916
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
NathanW2/QGIS
python/PyQt/PyQt5/QtWidgets.py
17
1207
# -*- coding: utf-8 -*- """ *************************************************************************** QtWidgets.py --------------------- Date : November 2015 Copyright : (C) 2015 by Matthias Kuhn Email : matthias at opengis dot ch ************************...
gpl-2.0
isaac-s/cloudify-plugins-common
cloudify/tests/test_ctx_relationships.py
2
15218
######### # Copyright (c) 2014 GigaSpaces Technologies Ltd. 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...
apache-2.0
osh/gnuradio
gr-audio/examples/python/dial_tone_daemon.py
58
2196
#!/usr/bin/env python # # Copyright 2004,2005,2007,2008,2012 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...
gpl-3.0
brchiu/tensorflow
tensorflow/python/data/util/sparse_test.py
2
12032
# 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
ApproxEng/approxeng.input
src/python/approxeng/input/selectbinder.py
1
6065
from functools import reduce from select import select from threading import Thread import approxeng.input.sys as sys from approxeng.input.controllers import * EV_KEY = 1 EV_REL = 2 EV_ABS = 3 class ControllerResource: """ General resource which binds one or more controllers on entry and unbinds the event l...
apache-2.0
hieukypc/ERP
openerp/addons/mass_mailing/controllers/web_editor.py
45
1343
# -*- coding: utf-8 -*- from openerp import http from openerp.http import request from openerp.addons.web_editor.controllers.main import Web_Editor class Web_Editor(Web_Editor): @http.route(["/website_mass_mailing/field/popup_content"], type='http', auth="user") def mass_mailing_FieldTextHtmlPopupTemplate(s...
gpl-3.0
ramadhane/odoo
openerp/addons/base/tests/test_ir_attachment.py
433
3536
import hashlib import os import openerp import openerp.tests.common HASH_SPLIT = 2 # FIXME: testing implementations detail is not a good idea class test_ir_attachment(openerp.tests.common.TransactionCase): def setUp(self): super(test_ir_attachment, self).setUp() registry, cr, uid = self.regi...
agpl-3.0
lwiecek/django
tests/view_tests/models.py
281
1329
""" Regression tests for Django built-in views. """ from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) def __str__(self): return self.name def get_absolute_ur...
bsd-3-clause
hacpai/show-me-the-code
Algorithm/0001/sort.py
3
1350
def insertion_sort(lst): """"Processes an element one by one. Compares sorted elements and move to right sort position until processes last element. """ for i in range(1, len(lst)): current_value = lst[i] compares_index = i - 1 while compares_index > -1 and lst[compares_inde...
gpl-2.0
Ali-aqrabawi/ezclinic
lib/djangae/apps.py
4
2056
from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ImproperlyConfigured class DjangaeConfig(AppConfig): name = 'djangae' verbose_name = _("Djangae") def ready(self): from .patches import json json.patch() f...
mit
r-mart/scikit-learn
sklearn/metrics/tests/test_ranking.py
127
40813
from __future__ import division, print_function import numpy as np from itertools import product import warnings from scipy.sparse import csr_matrix from sklearn import datasets from sklearn import svm from sklearn import ensemble from sklearn.datasets import make_multilabel_classification from sklearn.random_projec...
bsd-3-clause
moondrop-entertainment/django-nonrel-drawp
tests/regressiontests/forms/localflavor/ca.py
49
3636
import warnings from django.contrib.localflavor.ca.forms import (CAPostalCodeField, CAPhoneNumberField, CAProvinceField, CAProvinceSelect, CASocialInsuranceNumberField) from utils import LocalFlavorTestCase class CALocalFlavorTests(LocalFlavorTestCase): def setUp(self): self.save_warning...
bsd-3-clause
bcgov/gwells
app/backend/submissions/data_migrations.py
1
1059
""" 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 distri...
apache-2.0
levilucio/SyVOLT
tests/TestModules/nacExampleRule_MDL.py
1
28438
""" __nacExampleRule_MDL.py_____________________________________________________ Automatically generated AToM3 Model File (Do not modify directly) Author: levi Modified: Fri Dec 5 11:39:28 2014 ____________________________________________________________________________ """ from stickylink import * from widthXfillXde...
mit
stanley-cheung/grpc
src/python/grpcio/support.py
10
4388
# Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
brett-patterson/pyface
examples/file_tree.py
5
2675
#------------------------------------------------------------------------------ # Copyright (c) 2005, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions describe...
bsd-3-clause
jiangwei1221/django-virtualenv-demo
env/lib/python2.7/site-packages/django/contrib/comments/forms.py
218
8080
import time from django import forms from django.forms.util import ErrorDict from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.comments.models import Comment from django.utils.crypto import salted_hmac, constant_time_compare from django.utils.encoding import...
unlicense
popazerty/openblackhole-SH4
lib/python/Components/Converter/DMCHDSmartInfo.py
11
10292
# # Coded by Vali # from enigma import iServiceInformation from Components.Converter.Converter import Converter from Components.Element import cached from Components.config import config from Poll import Poll class DMCHDSmartInfo(Poll, Converter, object): SMART_INFO_H = 1 def __init__(self, type): Converter....
gpl-2.0
adam111316/SickGear
lib/unidecode/x091.py
252
4655
data = ( 'Ruo ', # 0x00 'Bei ', # 0x01 'E ', # 0x02 'Yu ', # 0x03 'Juan ', # 0x04 'Yu ', # 0x05 'Yun ', # 0x06 'Hou ', # 0x07 'Kui ', # 0x08 'Xiang ', # 0x09 'Xiang ', # 0x0a 'Sou ', # 0x0b 'Tang ', # 0x0c 'Ming ', # 0x0d 'Xi ', # 0x0e 'Ru ', # 0x0f 'Chu ', # 0x10 'Zi ...
gpl-3.0
rbian/tp-libvirt
libvirt/tests/src/virsh_cmd/domain/virsh_setmaxmem.py
8
7485
import logging from autotest.client.shared import utils, error from virttest import virsh, virt_vm from virttest.libvirt_xml import vm_xml def run(test, params, env): """ Test command: virsh setmaxmem. 1) Prepare vm environment. 2) Handle params 3) Run test command and get vm started then get max...
gpl-2.0
fmv1992/python-mode
pymode/_compat.py
26
2938
""" Compatibility. Some py2/py3 compatibility support based on a stripped down version of six so we don't have to depend on a specific version of it. :copyright: (c) 2014 by Armin Ronacher. :license: BSD """ import sys PY2 = sys.version_info[0] == 2 _identity = lambda x: x if not PY2: text_...
lgpl-3.0
terbolous/SickRage
lib/hachoir_parser/archive/gzip_parser.py
95
4742
""" GZIP archive parser. Author: Victor Stinner """ from hachoir_parser import Parser from hachoir_core.field import ( UInt8, UInt16, UInt32, Enum, TimestampUnix32, Bit, CString, SubFile, NullBits, Bytes, RawBytes) from hachoir_core.text_handler import textHandler, hexadecimal, filesizeHandler from hachoi...
gpl-3.0
miguelsousa/robofab
Scripts/Contributed/FontLabTokenize.py
9
2435
# -*- coding: utf-8 -*- """FontLab Tokenize Tokenize FontLab’s preview/metrics text into single characters respecting escaped glyph names (eg. “/A.smcp”) and providing a lossless reverse function. Sample usage (and actual test suite): >>> tokenize('/A/B/C') ['/A', '/B', '/C'] >>> tokenize('abcde/B/C') ['a', 'b', 'c'...
bsd-3-clause
XileForce/Vindicator-Rebase
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
pylayers/pylayers
pylayers/simul/tests/test_espoo.py
3
2820
from pylayers.simul.link import * from pylayers.antprop.channel import * from pylayers.antprop.antenna import * from pylayers.util.geomutil import * # parameters fmin = 31.8 # GHz fmax = 33.4 # GHz bw = fmax - fmin # bandwidth in GHz nf = 10001 # sweep frequency points fc = (fmin + fmax)/...
mit
pierdebeer/AudaxPlus_M_Kernel
Documentation/target/tcm_mod_builder.py
2358
40707
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
double12gzh/nova
nova/tests/unit/db/test_sqlite.py
83
1932
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
akshmakov/Dolfin-Fijee-Fork
test/unit/book/python/chapter_1_files/stationary/poisson/d2_p2D.py
1
1457
""" FEniCS tutorial demo program: Poisson equation with Dirichlet conditions. As d1_p2D.py, but chosing linear solver and preconditioner is demonstrated. -Laplace(u) = f on the unit square. u = u0 on the boundary. u0 = u = 1 + x^2 + 2y^2, f = -6. """ from dolfin import * # Create mesh and define function space mesh ...
gpl-3.0
alheinecke/tensorflow-xsmm
tensorflow/contrib/saved_model/python/saved_model/signature_def_utils.py
113
1664
# 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
ChinaQuants/zipline
zipline/pipeline/visualize.py
3
5796
""" Tools for visualizing dependencies between Terms. """ from __future__ import unicode_literals from contextlib import contextmanager import errno from functools import partial from io import BytesIO from subprocess import Popen, PIPE from networkx import topological_sort from six import iteritems from zipline.pip...
apache-2.0
danielfaust/AutobahnPython
autobahn/autobahn/websocket.py
1
140218
############################################################################### ## ## Copyright 2011,2012 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 ## ## ...
apache-2.0
bruno-briner/plugin.video.brplay
resources/lib/hlsproxy/decrypter.py
1
16632
#!/usr/bin/env python # -*- coding: utf-8 -*- """Simple AES cipher implementation in pure Python following PEP-272 API Based on: https://bitbucket.org/intgr/pyaes/ to compatible with PEP-8. The goal of this module is to be as fast as reasonable in Python while still being Pythonic and readable/understandable. It is ...
gpl-3.0
yeatmanlab/pyAFQ
AFQ/utils/tests/test_streamlines.py
2
4057
import os.path as op import numpy as np import numpy.testing as npt import nibabel as nib import nibabel.tmpdirs as nbtmp from AFQ.utils import streamlines as aus import dipy.tracking.utils as dtu import dipy.tracking.streamline as dts from dipy.io.stateful_tractogram import StatefulTractogram, Space def test_bundles...
bsd-2-clause
ktorti/CWWN
lib/utils.py
2
4078
import requests import json import re import certifi from netifaces import ifaddresses from sh import grep, netstat from urlparse import urlparse from datetime import timedelta from settings import settings from datetime import datetime import pytz from platform import machine arch = machine() HTTP_OK = xrange(200, 2...
gpl-2.0
MyAOSP/external_chromium_org
chrome/common/extensions/docs/server2/test_data/api_data_source/canned_trunk_fs.py
25
4941
# 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. import json CANNED_TRUNK_FS_DATA = { 'api': { '_api_features.json': json.dumps({ 'add_rules_tester': { 'dependencies': ['permission:add_rules_t...
bsd-3-clause
sumonchai/tough
toughradius/manage/api/v1/api_product_del.py
2
1565
#!/usr/bin/env python #coding=utf-8 import time import traceback from toughlib.btforms import dataform from toughlib.btforms import rules from toughlib import utils, apiutils, dispatch from toughlib.permit import permit from toughradius.manage.api.apibase import ApiHandler from toughradius.manage import models """ 删除产...
agpl-3.0
timduru/platform-external-chromium_org
native_client_sdk/src/tools/fix_deps.py
95
3055
#!/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. """Fixup GCC-generated dependency files. Modify GCC generated dependency files so they are more suitable for including in a GNU Ma...
bsd-3-clause
jjmiranda/edx-platform
pavelib/paver_tests/test_i18n.py
16
5264
""" Tests for pavelib/i18n.py. """ import os import textwrap import unittest from mock import mock_open, patch from paver.easy import task, call_task import pavelib.i18n from pavelib.paver_tests.utils import PaverTestCase TX_CONFIG_SIMPLE = """\ [main] host = https://www.transifex.com [edx-platform.django-partial...
agpl-3.0
CollabQ/CollabQ
.google_appengine/lib/django/django/contrib/admin/models.py
33
1951
from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User from django.utils.translation import gettext_lazy as _ ADDITION = 1 CHANGE = 2 DELETION = 3 class LogEntryManager(models.Manager): def log_action(self, user_id, content_type_id, obje...
apache-2.0
SaTa999/pyPanair
pyPanair/postprocess/agps_converter.py
1
10619
#!/usr/bin/env python import numpy as np import os def read_column(file, firstline): """read a column from first line (e.g. n01c001) to *eof""" column = list() line = firstline # register methods for faster evaluation f_readline = file.readline column_append = column.append # r...
mit
jarod-w/ocsetup
ocsetup/plugins/storage_tab.py
1
2968
#!/usr/bin/python # storage_tab.py - Copyright (C) 2012 CloudTimes, Inc. # Written by Jarod.W <work.iec23801@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License...
gpl-2.0
druuu/django
tests/utils_tests/test_termcolors.py
337
6461
import unittest from django.utils.termcolors import ( DARK_PALETTE, DEFAULT_PALETTE, LIGHT_PALETTE, NOCOLOR_PALETTE, PALETTES, colorize, parse_color_setting, ) class TermColorTests(unittest.TestCase): def test_empty_string(self): self.assertEqual(parse_color_setting(''), PALETTES[DEFAULT_PALETTE...
bsd-3-clause
mtaufen/test-infra
gubernator/third_party/cloudstorage/storage_api.py
75
28161
# Copyright 2012 Google 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 or ag...
apache-2.0
lhilt/scipy
scipy/sparse/linalg/tests/test_matfuncs.py
4
20306
# # Created by: Pearu Peterson, March 2002 # """ Test functions for scipy.linalg.matfuncs module """ from __future__ import division, print_function, absolute_import import math import numpy as np from numpy import array, eye, exp, random from numpy.linalg import matrix_power from numpy.testing import ( asse...
bsd-3-clause
marcusramberg/dotfiles
bin/.venv-ansible-venv/lib/python2.6/site-packages/ansible/modules/extras/network/f5/bigip_monitor_tcp.py
33
16829
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, serge van Ginderachter <serge@vanginderachter.be> # # 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 vers...
mit
sumeetsk/NEXT-1
apps/PoolBasedTripletMDS/algs/ValidationSampling/utilsMDS.py
3
14387
""" utilsMDS.py author: Kevin Jamieson (kevin.g.jamieson@gmail.com) edited: 1/18/15 This module has methods that assist with non-metric multidimensional scaling. If you're trying to COMPUTE an embedding, you might simply call: X,emp_loss = computeEmbedding(n,d,S) You may also consider getLoss to check how well...
apache-2.0
shashank971/edx-platform
openedx/core/lib/cache_utils.py
75
1578
""" Utilities related to caching. """ import functools from xblock.core import XBlock def memoize_in_request_cache(request_cache_attr_name=None): """ Memoize a method call's results in the request_cache if there's one. Creates the cache key by joining the unicode of all the args with &; so, if your arg m...
agpl-3.0
cqychen/quants
quants/loaddata/skyeye_ods_invest_refer_sh_margins_detail.py
1
2670
#coding=utf8 import tushare as ts; import pymysql; import time as dt from datashape.coretypes import string from pandas.io.sql import SQLDatabase import sqlalchemy import datetime from sqlalchemy import create_engine from pandas.io import sql import threading import pandas as pd; import sys sys.path.append('../') #添加配...
epl-1.0
atodorov/pykickstart
tests/commands/iscsiname.py
3
1567
# # Martin Gracik <mgracik@redhat.com> # # Copyright 2009 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. This program is distributed in the hope that it # will be use...
gpl-2.0
beni55/django
django/utils/lru_cache.py
270
7647
try: from functools import lru_cache except ImportError: # backport of Python's 3.3 lru_cache, written by Raymond Hettinger and # licensed under MIT license, from: # <http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/> # Should be removed when Django only sup...
bsd-3-clause
ddd332/presto
presto-docs/target/sphinx/sphinx/ext/intersphinx.py
5
9445
# -*- coding: utf-8 -*- """ sphinx.ext.intersphinx ~~~~~~~~~~~~~~~~~~~~~~ Insert links to objects documented in remote Sphinx documentation. This works as follows: * Each Sphinx HTML build creates a file named "objects.inv" that contains a mapping from object names to URIs relative to the H...
apache-2.0
Split-Screen/android_kernel_samsung_galaxys2plus-common
Documentation/target/tcm_mod_builder.py
3119
42754
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
ehashman/oh-mainline
vendor/packages/Django/django/contrib/localflavor/ru/forms.py
109
2219
""" Russian-specific forms helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.ru.ru_regions import RU_COUNTY_CHOICES, RU_REGIONS_CHOICES from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy as _ phone_digits...
agpl-3.0
msimacek/fedmsg_meta_fedora_infrastructure
fedmsg_meta_fedora_infrastructure/tests/tagger.py
5
15879
# This file is part of fedmsg. # Copyright (C) 2013 Red Hat, Inc. # # fedmsg 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 2.1 of the License, or (at your option) any later version. #...
lgpl-2.1
pierreg/tensorflow
tensorflow/models/image/cifar10/cifar10_input.py
20
9629
# 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
2014c2g12/c2g12
wsgi/exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/copy.py
113
8787
"""Generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised. The difference between shallow and deep copying is only relev...
gpl-2.0
songfj/calibre
src/calibre/ebooks/conversion/plugins/rtf_input.py
18
11365
from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' import os, glob, re, textwrap from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation border_style_map = { 'single' : 'solid', 'double-thickness-border...
gpl-3.0
pfjel7/housing-insights
python/housinginsights/sources/cama.py
1
8713
# Script is deprecated, as of September 18, 2017. # zoneUnitCount now calculated with LoadData's _get_residential_units() # from pprint import pprint import os import sys import requests from collections import OrderedDict import csv import datetime PYTHON_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__)...
mit
jstoxrocky/statsmodels
statsmodels/sandbox/distributions/tests/check_moments.py
33
5473
'''script to test expect and moments in distributions.stats method not written as a test, prints results, renamed to prevent nose from running it ''' from statsmodels.compat.python import iteritems import numpy as np from scipy import stats #from statsmodels.stats.moment_helpers import mnc2mvsk from statsmodels.sand...
bsd-3-clause
dxwu/BinderFilter
resources/android-toolchain-16/lib/python2.7/bsddb/__init__.py
98
15988
#---------------------------------------------------------------------- # Copyright (c) 1999-2001, Digital Creations, Fredericksburg, VA, USA # and Andrew Kuchling. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following c...
mit
pnedunuri/scipy
scipy/special/tests/test_orthogonal.py
43
28266
from __future__ import division, print_function, absolute_import from numpy.testing import (rand, TestCase, assert_array_almost_equal, assert_almost_equal, assert_allclose, assert_raises, run_module_suite) from scipy._lib.six import xrange import numpy as np from ...
bsd-3-clause
testmana2/test
E5Gui/E5Action.py
2
7141
# -*- coding: utf-8 -*- # Copyright (c) 2006 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing an Action class extending QAction. This extension is necessary in order to support alternate keyboard shortcuts. """ from __future__ import unicode_literals from PyQt5.QtGui import QIcon, QKeyS...
gpl-3.0
MobinRanjbar/hue
desktop/core/ext-py/boto-2.38.0/boto/mturk/notification.py
170
4194
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
apache-2.0
18F/regulations-parser
regparser/commands/fetch_sxs.py
3
1630
# @todo - this is almost identical to parse_rule_changes as both are # processing the parsed notice the same way. Once the concept of "changes" and # SxS are split, the two programs will diverge import click from regparser.commands.dependency_resolver import DependencyResolver from regparser.federalregister import FUL...
cc0-1.0
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/numpy/linalg/info.py
264
1198
"""\ Core Linear Algebra Tools ------------------------- Linear algebra basics: - norm Vector or matrix norm - inv Inverse of a square matrix - solve Solve a linear system of equations - det Determinant of a square matrix - lstsq Solve linear least-squares problem...
mit
pmalczuk/python_scripts
disk.py
1
7360
#!/usr/bin/python2 import os, sys import getopt, datetime import platform #automatyczne przeliczenie wartosci od Bajtow w gore def GetHumanReadable(size,precision=2): suffixes=['B','KB','MB','GB','TB'] suffixIndex = 0 while size > 1024 and suffixIndex < 3: suffixIndex += 1 #increment the index of ...
gpl-3.0