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
codeaudit/gpss-research
experiments/2014-04-16-class-liver-aic.py
4
1443
Experiment(description='Classification experiment', data_dir='../data/add-class/r_liver', max_depth=10, random_order=False, k=1, debug=False, local_computation=False, n_rand=9, sd=2, jitter_sd=0.1, max_jobs...
mit
songmonit/CTTMSONLINE_V8
addons/membership/wizard/__init__.py
432
1071
# -*- 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
aisipos/django
django/db/models/lookups.py
45
20247
import math import warnings from copy import copy from django.db.models.expressions import Func, Value from django.db.models.fields import DateTimeField, Field, IntegerField from django.db.models.query_utils import RegisterLookupMixin from django.utils.deprecation import RemovedInDjango20Warning from django.utils.func...
bsd-3-clause
Jaesin/OctoPrint
tests/plugin/test_core.py
1
12641
import unittest import mock import ddt import octoprint.plugin import octoprint.plugin.core ##~~ Helpers for testing mixin type extraction class A(object): pass class A_1(A): pass class A_2(A): pass class A_3(A): pass class A1_1(A_1): pass class B(object): pass class B_1(B): pass class C(object)...
agpl-3.0
ironmagma/pumpkinpy
gentests.py
1
6418
# Legal boring crap follows. In simple english, you can use this # code in your own project, be your project commercial or free. # Just be sure to include the license and stuff. The "copyright" # here is just for technical reasons. # # Copyright 2011, Philip Peterson. # # This file is part of Pumpkinpy. # # Pumpkinpy ...
gpl-3.0
genialis/resolwe
resolwe/permissions/tests/test_data.py
1
16467
# pylint: disable=missing-docstring import shutil import unittest from datetime import timedelta from django.utils.timezone import now from guardian.shortcuts import remove_perm from rest_framework import exceptions, status from resolwe.flow.models import Collection, Data from resolwe.flow.serializers import Contrib...
apache-2.0
yati-sagade/RyDyrect
django/views/i18n.py
188
9673
import os import gettext as gettext_module from django import http from django.conf import settings from django.utils import importlib from django.utils.translation import check_for_language, activate, to_locale, get_language from django.utils.text import javascript_quote from django.utils.encoding import smart_unicod...
bsd-3-clause
mzp/iTerm2
tests/esctest/tests/ech.py
31
2426
from esc import NUL, blank import escargs import esccmd import escio from esctypes import Point, Rect from escutil import AssertEQ, AssertScreenCharsInRectEqual, GetCursorPosition, GetScreenSize, knownBug class ECHTests(object): def test_ECH_DefaultParam(self): """Should erase the character under the cursor.""" ...
gpl-2.0
ningchi/scikit-learn
sklearn/cluster/tests/test_spectral.py
262
7954
"""Testing for Spectral Clustering methods""" from sklearn.externals.six.moves import cPickle dumps, loads = cPickle.dumps, cPickle.loads import numpy as np from scipy import sparse from sklearn.utils import check_random_state from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_a...
bsd-3-clause
mccheung/kbengine
kbe/res/scripts/common/Lib/test/test_userlist.py
116
1896
# Check every path through every method of UserList from collections import UserList from test import support, list_tests class UserListTest(list_tests.CommonTest): type2test = UserList def test_getslice(self): super().test_getslice() l = [0, 1, 2, 3, 4] u = self.type2test(l) ...
lgpl-3.0
lesina/Hack70
env/lib/python3.5/site-packages/pip/_vendor/lockfile/sqlitelockfile.py
536
5506
from __future__ import absolute_import, division import time import os try: unicode except NameError: unicode = str from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked class SQLiteLockFile(LockBase): "Demonstrate SQL-based locking." testdb = None def __init__(self, path, ...
gpl-3.0
looker/sentry
src/sentry/south_migrations/0250_auto__add_unique_userreport_project_event_id.py
2
74893
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): if not db.dry_run: UserReport = orm['sentry.UserReport'] ...
bsd-3-clause
mmpagani/oq-hazardlib
openquake/hazardlib/mfd/truncated_gr.py
2
9984
# The Hazard Library # Copyright (C) 2012-2014, 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
fluentstream/asterisk-p2p
res/pjproject/tests/pjsua/scripts-sendto/252_multipart_ok_clutter.py
3
1121
# $Id: 252_multipart_ok_clutter.py 369517 2012-07-01 17:28:57Z file $ import inc_sip as sip import inc_sdp as sdp body = \ """ This is the preamble. It is to be ignored, though it is a handy place for composition agents to include an explanatory note to non-MIME conformant readers. --123:45 Content-Type: text/plain ...
gpl-2.0
jspargo/AneMo
django/lib/python2.7/site-packages/django/contrib/gis/db/models/lookups.py
48
1423
from django.db.models.lookups import Lookup from django.db.models.sql.expressions import SQLEvaluator class GISLookup(Lookup): def as_sql(self, qn, connection): from django.contrib.gis.db.models.sql import GeoWhereNode # We use the same approach as was used by GeoWhereNode. It would # be a...
gpl-2.0
chamikaramj/incubator-beam
sdks/python/apache_beam/runners/dataflow/internal/clients/dataflow/dataflow_v1b3_client.py
15
28548
# # 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
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py
1730
2746
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def __init__(self, source, encoding): _base.Filter.__init__(self, source) self.encoding = encoding def __iter__(self): state = "pre_head" meta_found = (self.enco...
gpl-2.0
SebasSBM/django
tests/lookup/tests.py
89
37440
from __future__ import unicode_literals import collections from datetime import datetime from operator import attrgetter from unittest import skipUnless from django.core.exceptions import FieldError from django.db import connection from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from .mode...
bsd-3-clause
babyliynfg/cross
tools/project-creator/Python2.6.6/Lib/test/test_site.py
1
10065
"""Tests for 'site'. Tests assume the initial paths in sys.path once the interpreter has begun executing have not been removed. """ import unittest from test.test_support import TestSkipped, run_unittest, TESTFN, EnvironmentVarGuard import __builtin__ import os import sys import encodings import subproces...
mit
disqus/graphite-web
docs/conf.py
27
7754
# -*- coding: utf-8 -*- # # Graphite documentation build configuration file, created by # sphinx-quickstart on Mon Mar 21 12:31:35 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
apache-2.0
styxit/CouchPotatoServer
libs/subliminal/services/subswiki.py
105
5182
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal 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...
gpl-3.0
ykim362/mxnet
example/ssd/symbol/legacy_vgg16_ssd_300.py
41
10127
# 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 u...
apache-2.0
blademainer/intellij-community
plugins/hg4idea/testData/bin/mercurial/store.py
90
16865
# store.py - repository store handling for Mercurial # # Copyright 2008 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import _ import scmutil, util, parsers import os, stat, errno _sha =...
apache-2.0
splbio/openobject-server
openerp/addons/base/tests/test_ir_attachment.py
68
3224
import hashlib import os import unittest2 import openerp import openerp.tests.common class test_ir_attachment(openerp.tests.common.TransactionCase): def test_00_attachment_flow(self): registry, cr, uid = self.registry, self.cr, self.uid root_path = openerp.tools.config['root_path'] ira =...
agpl-3.0
ssgeejr/mitropm
emailer/common/sendmail.py
24
3169
import cStringIO import smtplib import email.Charset import email.generator from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from tornado import options options.define('smtp_user', '', help='User for SMTP (currently unused)') options.define('smtp_password', '', help='Password for SM...
gpl-3.0
hamonikr-root/blueman
blueman/plugins/applet/NMDUNSupport.py
3
3781
# Copyright (C) 2009 Valmantas Paliksa <walmis at balticum-tv dot lt> # # Licensed under the GNU General Public License Version 3 # # 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...
gpl-3.0
piotroxp/scibibscan
scib/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/langthaimodel.py
2930
11275
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
mit
supertask/UnitX
doc/tools/extensions/patchlevel.py
50
1942
# -*- coding: utf-8 -*- """ patchlevel.py ~~~~~~~~~~~~~ Extract version info from Include/patchlevel.h. Adapted from Doc/tools/getversioninfo. :copyright: 2007-2008 by Georg Brandl. :license: Python license. """ import os import re import sys def get_header_version_info(srcdir): patchlev...
mit
Hybrid-Cloud/badam
patches_tool/aws_patch/aws_deps/libcloud/test/compute/test_ecp.py
1
5290
# 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
JamesDickenson/aima-python
submissions/aartiste/myNN.py
4
3659
from sklearn import datasets from sklearn.neural_network import MLPClassifier import traceback from submissions.aartiste import election from submissions.aartiste import county_demographics class DataFrame: data = [] feature_names = [] target = [] target_names = [] trumpECHP = DataFrame() ''' Extract...
mit
frbapolkosnik/jsunpack-n
exampleImport.py
23
4525
#!/usr/bin/python ''' Jsunpackn - A generic JavaScript Unpacker Network Edition Copyright (C) 2010 Blake Hartstein http://jsunpack.jeek.org/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Softwar...
gpl-2.0
mibanescu/pulp
playpen/deploy/deploy-environment.py
10
2701
#!/usr/bin/env python import argparse import sys import time import traceback from utils import os1_utils, setup_utils, config_utils # Setup the CLI description = 'Deploy a Pulp environment; this can be used in conjunction with the run-integrations-tests.py script' parser = argparse.ArgumentParser(description=descr...
gpl-2.0
mluo613/osf.io
addons/box/tests/test_models.py
32
1889
import mock import unittest import pytest from addons.base.tests.models import OAuthAddonNodeSettingsTestSuiteMixin from addons.base.tests.models import OAuthAddonUserSettingTestSuiteMixin from addons.box.models import NodeSettings from addons.box.tests import factories pytestmark = pytest.mark.django_db class Te...
apache-2.0
onitake/ansible
lib/ansible/modules/cloud/vultr/vultr_startup_script_facts.py
27
3440
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2018, Yanis Guenane <yanis+ansible@guenane.org> # 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':...
gpl-3.0
breznak/NAB
nab/labeler.py
8
16181
# ---------------------------------------------------------------------- # Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/...
agpl-3.0
yishayv/lyacorr
bins_3d.py
1
6348
import numpy as np from flux_accumulator import AccumulatorBase class Bins3D(AccumulatorBase): def __init__(self, dims, ranges, ar_existing_data=None, filename=''): """ :param dims: the shape of the bins :param ranges: a 2-by-3 array representing the minimum and maximum ranges of the 3 co...
mit
enkaskal/hello
gtest/test/gtest_color_test.py
3259
4911
#!/usr/bin/env python # # Copyright 2008, 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...
apache-2.0
Zhongqilong/mykbengineer
kbe/res/scripts/common/Lib/shelve.py
83
8428
"""Manage shelves of pickled objects. A "shelf" is a persistent, dictionary-like object. The difference with dbm databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects -- anything that the "pickle" module can handle. This includes most class instances, recursive data type...
lgpl-3.0
thefactory/marathon-logger
stores.py
1
1282
import collections import logging import logging.handlers import urlparse class InMemoryStore(object): def __init__(self, url): qa = urlparse.parse_qs(url.query) max_length = int(qa.get('max_length', ['100'])[0]) print 'Configuring in-memory store with {settings}'.format(settings={"max_l...
mit
Averroes/raft
thirdparty/pdfminer/pdfminer/arcfour.py
11
1141
#!/usr/bin/env python2 """ Python implementation of Arcfour encryption algorithm. This code is in the public domain. """ ## Arcfour ## class Arcfour(object): """ >>> Arcfour('Key').process('Plaintext').encode('hex') 'bbf316e8d940af0ad3' >>> Arcfour('Wiki').process('pedia').encode('hex') '1021b...
gpl-3.0
heran7/edx-platform
common/lib/extract_tar.py
15
2148
""" Safe version of tarfile.extractall which does not extract any files that would be, or symlink to a file that is, outside of the directory extracted in. Adapted from: http://stackoverflow.com/questions/10060069/safely-extract-zip-or-tar-using-python """ from os.path import abspath, realpath, dirname, join as joinpa...
agpl-3.0
switchboardOp/ansible
lib/ansible/modules/network/lenovo/cnos_template.py
59
7077
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, 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 # ...
gpl-3.0
knowsis/django-allauth
allauth/socialaccount/south_migrations/0008_client_id.py
78
6323
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." for app in orm.SocialApp.objects.all(): app.client_id = app.key ...
mit
dafei2015/hugula
Client/tools/site-packages/PIL/OleFileIO.py
13
16301
# # THIS IS WORK IN PROGRESS # # The Python Imaging Library # $Id: OleFileIO.py 2339 2005-03-25 08:02:17Z fredrik $ # # stuff to deal with OLE2 Structured Storage files. this module is # used by PIL to read Image Composer and FlashPix files, but can also # be used to read other files of this type. # # History: # 1997-...
mit
joram/sickbeard-orange
lib/unidecode/x0d3.py
253
4705
data = ( 'tim', # 0x00 'tib', # 0x01 'tibs', # 0x02 'tis', # 0x03 'tiss', # 0x04 'ting', # 0x05 'tij', # 0x06 'tic', # 0x07 'tik', # 0x08 'tit', # 0x09 'tip', # 0x0a 'tih', # 0x0b 'pa', # 0x0c 'pag', # 0x0d 'pagg', # 0x0e 'pags', # 0x0f 'pan', # 0x10 'panj', # 0x11 ...
gpl-3.0
dezelin/vbox-haiku
src/VBox/Additions/common/crOpenGL/defs64.py
2
8822
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. import sys import apiutil apiutil.CopyrightDef() print "LIBRARY VBoxOGL" print "DESCRIPTION \"\"" print "EXPORTS" # XXX can't these values be automatically computed by anal...
gpl-2.0
jooddang/Boxpedia
web/dropbox-python-sdk-1.6/build/lib/dropbox/client.py
6
53823
from __future__ import absolute_import import base64 import re import os import sys import urllib from StringIO import StringIO try: import json except ImportError: import simplejson as json from .rest import ErrorResponse, RESTClient from .session import BaseSession, DropboxSession, DropboxOAuth2Session def...
mit
hale36/SRTV
lib/html5lib/inputstream.py
618
30855
from __future__ import absolute_import, division, unicode_literals from six import text_type from six.moves import http_client import codecs import re from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase from .constants import encodings, ReparseException from . import utils from io import String...
gpl-3.0
Ban3/Limnoria
src/drivers/Twisted.py
4
6196
### # Copyright (c) 2002-2004, Jeremiah Fincher # Copyright (c) 2009, James McCoy # 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 copyr...
bsd-3-clause
aalba6675/pyopenssl
examples/certgen.py
3
2736
# -*- coding: latin-1 -*- # # Copyright (C) AB Strakt # Copyright (C) Jean-Paul Calderone # See LICENSE for details. """ Certificate generation module. """ from OpenSSL import crypto TYPE_RSA = crypto.TYPE_RSA TYPE_DSA = crypto.TYPE_DSA def createKeyPair(type, bits): """ Create a public/private key pair. ...
apache-2.0
mindw/python-qwt
qwt/plot_canvas.py
2
23653
# -*- coding: utf-8 -*- # # Licensed under the terms of the Qwt License # Copyright (c) 2002 Uwe Rathmann, for the original C++ code # Copyright (c) 2015 Pierre Raybaut, for the Python translation/optimization # (see LICENSE file for more details) from qwt.null_paintdevice import QwtNullPaintDevice from qwt.pa...
lgpl-2.1
irwinlove/django
tests/template_tests/syntax_tests/test_firstof.py
199
3728
from django.template import TemplateSyntaxError from django.test import SimpleTestCase, ignore_warnings from django.utils.deprecation import RemovedInDjango110Warning from ..utils import setup class FirstOfTagTests(SimpleTestCase): libraries = {'future': 'django.templatetags.future'} @setup({'firstof01': '{...
bsd-3-clause
aperigault/ansible
lib/ansible/modules/cloud/azure/azure_rm_image.py
26
14444
#!/usr/bin/python # # Copyright (c) 2017 Yuwei Zhou, <yuwzho@microsoft.com> # # 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
ppwwyyxx/tensorflow
tensorflow/python/kernel_tests/boosted_trees/training_ops_test.py
5
127245
# 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 # # Unless required by applica...
apache-2.0
TobiasNils/python-seabreeze
seabreeze/pyseabreeze/interfaces/nonlinearity.py
1
1329
from .common import SeaBreezeError, get_pyseabreeze_decorator from .eeprom import EEPromFeature from .communication import USBCommOBP import struct convert_exceptions = get_pyseabreeze_decorator('interfaces.nonlinearity') class NonlinearityCoefficientsEEPromFeature(EEPromFeature): def has_nonlinearity_coeffs_...
mit
sunze/py_flask
venv/lib/python3.4/site-packages/kombu/compression.py
32
1986
""" kombu.compression ================= Compression utilities. """ from __future__ import absolute_import from kombu.utils.encoding import ensure_bytes import zlib _aliases = {} _encoders = {} _decoders = {} __all__ = ['register', 'encoders', 'get_encoder', 'get_decoder', 'compress', 'decompress'] de...
mit
damix911/flask-bees
bees/bees.py
1
8469
from flask import jsonify, request, Response from pkg_resources import resource_string from jinja2 import Template try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse _sessions = {} def _bind(func): def f(): try: data = request.get_data() ...
mit
TinLe/Diamond
src/collectors/udp/udp.py
30
2659
# coding=utf-8 """ The UDPCollector class collects metrics on UDP stats (surprise!) #### Dependencies * /proc/net/snmp """ import diamond.collector import os class UDPCollector(diamond.collector.Collector): PROC = [ '/proc/net/snmp' ] def process_config(self): super(UDPCollector, s...
mit
saurabh6790/pow-app
setup/doctype/email_settings/email_settings.py
29
2140
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import cint class DocType: def __init__(self,doc,doclist): self.doc,self.doclist = doc,doclist def valida...
agpl-3.0
etuna-SBF-kog/Stadsparken
env/lib/python2.7/site-packages/django/core/cache/backends/dummy.py
209
1229
"Dummy cache backend" from django.core.cache.backends.base import BaseCache class DummyCache(BaseCache): def __init__(self, host, *args, **kwargs): BaseCache.__init__(self, *args, **kwargs) def add(self, key, value, timeout=None, version=None): key = self.make_key(key, version=version) ...
gpl-3.0
kustomzone/Rusthon
regtests/c++/cyclic.py
5
1252
''' detect cyclic parent/child, and insert weakref ''' class Parent: def __init__(self, y:int, children:[]Child ): self.children = children self.y = y def create_child(self, x:int, parent:Parent) ->Child: child = Child(x, parent) self.children.push_back( child ) return child def say(self, msg:string): ...
bsd-3-clause
OptiPop/external_chromium_org
build/android/pylib/base/base_test_runner.py
36
7537
# 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. """Base class for running tests on a single device.""" import logging import time from pylib import ports from pylib.chrome_test_server_spawner import ...
bsd-3-clause
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/resources/types/ad_group_criterion.py
1
19851
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
flh/odoo
addons/website/models/ir_qweb.py
26
18823
# -*- coding: utf-8 -*- """ Website-context rendering needs to add some metadata to rendered fields, as well as render a few fields differently. Also, adds methods to convert values back to openerp models. """ import cStringIO import datetime import itertools import logging import os import urllib2 import urlparse im...
agpl-3.0
Srisai85/scipy
scipy/linalg/_matfuncs_inv_ssq.py
36
28127
""" Matrix functions that use Pade approximation with inverse scaling and squaring. """ from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy.linalg._matfuncs_sqrtm import SqrtmError, _sqrtm_triu from scipy.linalg.decomp_schur import schur, rsf2csf from scipy...
bsd-3-clause
wirwolf/minexcoin
qa/rpc-tests/proxy_test.py
39
8489
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import socket import os from test_framework.socks5 import Socks5Configuration, Socks5Command, Socks5Serv...
mit
skoslowski/gnuradio
gr-filter/examples/fir_filter_fff.py
3
3371
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from __future__ import print_function from __future__ import division from __future__ import unicode_literals from gnuradio import gr, filter from gnuradio import...
gpl-3.0
joelddiaz/openshift-tools
scripts/monitoring/cron-send-cluster-capacity.py
12
18329
#!/usr/bin/env python # vim: expandtab:tabstop=4:shiftwidth=4 ''' Send Openshift cluster capacity to MetricSender ''' # # Copyright 2016 Red Hat 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 o...
apache-2.0
PsychoTV/PsychoTeam.repository
plugin.video.SportsDevil/lib/utils/pyDes.py
54
32294
############################################################################# # Documentation # ############################################################################# # Author: Todd Whiteman # Date: 16th March, 2009 # Verion: 2.0.0 # License: Public Domain - free to d...
gpl-2.0
vmahuli/tempest
tempest/api/identity/admin/test_services.py
2
4564
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
stormpath/stormpath-django
django_stormpath/urls.py
2
2179
from django.conf.urls import url from django.conf import settings from django_stormpath import views urlpatterns = [ url(r'^login/$', views.stormpath_id_site_login, name='stormpath_id_site_login'), url(r'^logout/$', views.stormpath_id_site_logout, name='stormpath_id_site_logout'), url(r'^register/$', vie...
apache-2.0
0xCCD/mitro
browser-ext/third_party/firefox-addon-sdk/python-lib/mozrunner/__init__.py
36
27264
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import sys import copy import tempfile import signal import commands import zipfile import optparse import kil...
gpl-3.0
rrussell39/selenium
py/selenium/webdriver/support/event_firing_webdriver.py
71
13011
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
simonwydooghe/ansible
test/units/modules/network/check_point/test_cp_mgmt_service_tcp_facts.py
19
2854
# Ansible module to manage CheckPoint Firewall (c) 2019 # # 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 dist...
gpl-3.0
elthariel/dff
api/taskmanager/scheduler.py
1
2094
# DFF -- An Open Source Digital Forensics Framework # Copyright (C) 2009-2010 ArxSys # This program is free software, distributed under the terms of # the GNU General Public License Version 2. See the LICENSE file # at the top of the source tree. # # See http://www.digital-forensic.org for more information about this...
gpl-2.0
acdh-oeaw/dig_ed_cat
editions/gexf.py
1
2221
import lxml.etree as ET gexf_doc = """ <gexf xmlns="http://www.gexf.net/1.2draft" version="1.2"> <meta lastmodifieddate="{}"> <creator>https://dig-ed-cat.acdh.oeaw.ac.at</creator> <description>The dig-ed-cat-net</description> </meta> <graph defaultedgetype="directed"> <attributes cl...
mit
LLNL/spack
lib/spack/spack/schema/mirrors.py
5
1230
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """Schema for mirrors.yaml configuration file. .. literalinclude:: _spack_root/lib/spack/spack/schema/mirrors.py :line...
lgpl-2.1
PolicyStat/selenium-old
py/selenium/webdriver/firefox/webdriver.py
1
4132
# Copyright 2008-2009 WebDriver committers # Copyright 2008-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 requ...
apache-2.0
sungjuly/pinball
tests/pinball/repository/repository_test.py
6
5251
# Copyright 2015, Pinterest, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
RAPD/RAPD
src/plugins/subcontractors/aimless.py
1
39406
"""Functions for parsing aimless logs""" """ This file is part of RAPD Copyright (C) 2017, Cornell University All rights reserved. RAPD 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, version 3. RAPD is...
agpl-3.0
elky/django
django/templatetags/static.py
122
4502
from urllib.parse import quote, urljoin from django import template from django.apps import apps from django.utils.encoding import iri_to_uri from django.utils.html import conditional_escape register = template.Library() class PrefixNode(template.Node): def __repr__(self): return "<PrefixNode for %r>" ...
bsd-3-clause
igboyes/virtool
tests/fixtures/history.py
2
10972
import pytest import datetime @pytest.fixture def test_change(static_time): return { "_id": "6116cba1.1", "method_name": "edit", "description": "Edited Prunus virus E", "created_at": static_time.datetime, "diff": [ ["change", "abbreviation", ["PVF", ""]], ...
mit
double12gzh/nova
nova/api/openstack/compute/contrib/consoles.py
60
7022
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
amarlearning/InternetBots
Internet Bots/InstaFollowerHike.py
1
4950
# Importing all library that are used! from random import randint from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait import time def main(): # Yeah, I know it consumes a lot of RAM. # But still i don't know why i always use th...
mit
jjspierx/imuduino-btle
Arduino/libraries/FreeIMU/debug/log.py
25
2898
#!/usr/bin/python # -*- coding: utf-8 -*- """ log.py - Logs data to a text file. Load the Arduino with the FreeIMU_serial program. Copyright (C) 2012 Fabio Varesano <fvaresano@yahoo.it> Development of this code has been supported by the Department of Computer Science, Universita' degli Studi di Torino, Italy within ...
apache-2.0
Hackplayers/Empire-mod-Hpys-tests
lib/modules/powershell/privesc/sherlock.py
1
3385
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): # metadata info about the module, not modified during runtime self.info = { # name for the module that will appear in module menus 'Name': 'Sherlock', # list of one or more a...
bsd-3-clause
Opshun/API
venv/lib/python2.7/site-packages/pip/_vendor/colorama/winterm.py
442
5732
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. from . import win32 # from wincon.h class WinColor(object): BLACK = 0 BLUE = 1 GREEN = 2 CYAN = 3 RED = 4 MAGENTA = 5 YELLOW = 6 GREY = 7 # from wincon.h class WinStyle(object): NORMAL ...
mit
kholidfu/django
django/contrib/gis/gdal/prototypes/geom.py
450
4735
from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal from django.contrib.gis.gdal.prototypes.errcheck import check_envelope from django.contrib.gis.gdal.prototypes.generation import ( const_string_...
bsd-3-clause
tweakoz/micro_ork
ork.build/scripts/ork/build/localopts.py
1
3830
#!python ############################################################################### # Orkid SCONS Build System # Copyright 2010, Michael T. Mayers # email: michael@tweakoz.com # The Orkid Build System is published under the GPL 2.0 license # see http://www.gnu.org/licenses/gpl-2.0.html #####################...
mit
google/glome
python/test/test_vectors.py
1
2619
# 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,...
apache-2.0
sgerhart/ansible
lib/ansible/utils/module_docs_fragments/url.py
66
2627
# (c) 2018, John Barker<gundalow@redhat.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 versio...
mit
dxwu/BinderFilter
resources/android-toolchain-16/lib/python2.7/test/test_typechecks.py
136
3166
"""Unit tests for __instancecheck__ and __subclasscheck__.""" import unittest from test import test_support class ABC(type): def __instancecheck__(cls, inst): """Implement isinstance(inst, cls).""" return any(cls.__subclasscheck__(c) for c in set([type(inst), inst.__class__]))...
mit
nelmiux/CarnotKE
jyhton/lib-python/2.7/__future__.py
146
4380
"""Record of phased-in incompatible language changes. Each line is of the form: FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease "," CompilerFlag ")" where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples of the same form as sys.version_info: (...
apache-2.0
simondlevy/RealtimePlotter
serialplot.py
1
1736
#!/usr/bin/env python3 ''' Real-time plot demo using serial input Copyright (C) 2015 Simon D. Levy This program 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...
lgpl-3.0
jpodeszwik/linux_screenshoter
linux_screenshoter.py
1
1512
import sys from PyQt5.QtWidgets import QApplication, QSystemTrayIcon, QMenu, QAction from PyQt5.QtGui import QGuiApplication, QIcon from paramiko import SSHClient from scp import SCPClient import paramiko from datetime import date import time import configparser class Screenshoter: def __init__(self): conf...
mit
atodorov/blivet
blivet/devicelibs/edd.py
1
31887
# # edd.py # BIOS EDD data parsing functions # # Copyright 2010-2015 Red Hat, Inc. # # 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 la...
gpl-2.0
wzbozon/statsmodels
statsmodels/stats/tabledist.py
34
11643
# -*- coding: utf-8 -*- """ Created on Sat Oct 01 20:20:16 2011 Author: Josef Perktold License: BSD-3 TODO: check orientation, size and alpha should be increasing for interp1d, but what is alpha? can be either sf or cdf probability change it to use one consistent notation check: instead of bound checking I could us...
bsd-3-clause
hshindo/POS-Tagging-benchmark
Theano/lstm.py
1
3354
__author__ = 'hiroki' import numpy as np import theano import theano.tensor as T from nn_utils import sigmoid, tanh, sample_weights class LSTM(object): def __init__(self, w, d, n_layer, vocab_size, n_in, n_hid...
mit
t-woerner/firewalld
src/firewall/core/io/zone.py
1
39512
# -*- coding: utf-8 -*- # # Copyright (C) 2011-2016 Red Hat, Inc. # # Authors: # Thomas Woerner <twoerner@redhat.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 Li...
gpl-2.0
soarpenguin/ansible
lib/ansible/modules/network/aos/aos_rack_type.py
36
7617
#!/usr/bin/python # # (c) 2017 Apstra Inc, <community@apstra.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 opt...
gpl-3.0