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
varunagrawal/azure-services
varunagrawal/VarunWeb/env/Lib/site-packages/django/test/html.py
196
7967
""" Comparing two html documents. """ from __future__ import unicode_literals import re from django.utils.encoding import force_text from django.utils.html_parser import HTMLParser, HTMLParseError from django.utils import six from django.utils.encoding import python_2_unicode_compatible WHITESPACE = re.compile('\s+...
gpl-2.0
hortonworks/hortonworks-sandbox
desktop/core/ext-py/Django-1.2.3/tests/modeltests/invalid_models/models.py
10
24416
""" 26. Invalid models This example exists purely to point out errors in models. """ from django.db import models class FieldErrors(models.Model): charfield = models.CharField() charfield2 = models.CharField(max_length=-1) charfield3 = models.CharField(max_length="bad") decimalfield = models.DecimalF...
apache-2.0
Arafatk/sympy
sympy/liealgebras/type_a.py
76
4403
from __future__ import print_function, division from sympy.core.compatibility import range from sympy.liealgebras.cartan_type import Standard_Cartan from sympy.matrices import eye class TypeA(Standard_Cartan): """ This class contains the information about the A series of simple Lie algebras. ==== ...
bsd-3-clause
proversity-org/edx-platform
lms/djangoapps/bulk_reset_attempts/tests/test_views.py
1
6441
""" Tests for the Bulk Enrollment views. """ import ddt import json from django.core.urlresolvers import reverse from rest_framework.test import \ APIRequestFactory, APITestCase, force_authenticate from bulk_reset_attempts.serializers import BulkResetStudentAttemptsSerializer from bulk_reset_attempts.views impor...
agpl-3.0
atopuzov/nitro-python
nssrc/com/citrix/netscaler/nitro/resource/config/vpn/vpnsessionpolicy_binding.py
3
4362
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
Averroes/statsmodels
statsmodels/genmod/families/varfuncs.py
38
5845
""" Variance functions for use with the link functions in statsmodels.family.links """ __docformat__ = 'restructuredtext' import numpy as np FLOAT_EPS = np.finfo(float).eps class VarianceFunction(object): """ Relates the variance of a random variable to its mean. Defaults to 1. Methods ------- c...
bsd-3-clause
undefx/delphi-epidata
src/acquisition/fluview/fluview_notify.py
2
1963
""" =============== === Purpose === =============== Checks the `fluview` table to see if new data is available. If so, it queues the automation flow 'New FluView Available'. This will cause, at least: - impute state ILI - predict next issue wILI (sar3 and arch) - score the last epicast round - send epicast ema...
mit
sumitsourabh/opencog
opencog/python/pln/examples/temporal/composition_agent.py
31
1096
""" A MindAgent to test the application of the temporal rules, specifically the composition of Allen Interval relations """ from opencog.cogserver import MindAgent from pln.chainers import Chainer from pln.rules.temporal_rules import create_composition_rules __author__ = 'Sebastian Ruder' composition_table = "compos...
agpl-3.0
listen-lavender/pholcus
gdc/task/news/toutiao.py
1
2955
#!/usr/bin/env python # coding=utf-8 from datetime import * from webcrawl.character import * from webcrawl.task import * from webcrawl.urlkit import URLParse from newsspider import * from webcrawl import request #_print, logger = logprint(modulename(__file__), modulepath(__file__)) class SpiderToutiao(SpiderNewsOrig...
mit
rdblue/Impala
thirdparty/gtest-1.6.0/scripts/pump.py
603
23316
#!/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
timkofu/gitstars
stars/migrations/0001_initial.py
1
1853
# Generated by Django 3.0.8 on 2020-07-04 10:01 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='ProgrammingLanguage', fiel...
mit
cortedeltimo/SickRage
lib/requests/adapters.py
69
20836
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket from urllib3.poolmanager import PoolManager, proxy_from_url from urllib3.response import HTTPResponse from urllib3.util ...
gpl-3.0
samuelfd/harpia
harpia/bpGUI/xor.py
1
5854
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org), # Guilh...
gpl-2.0
kmolab/kmolab.github.io
data/Brython-3.3.4/Lib/unittest/test/testmock/testmagicmethods.py
737
12145
import unittest import inspect import sys from unittest.mock import Mock, MagicMock, _magics class TestMockingMagicMethods(unittest.TestCase): def test_deleting_magic_methods(self): mock = Mock() self.assertFalse(hasattr(mock, '__getitem__')) mock.__getitem__ = Mock() self.asser...
agpl-3.0
dursk/django
tests/custom_pk/fields.py
379
1731
import random import string from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class MyWrapper(object): def __init__(self, value): self.value = value def __repr__(self): return "<%s: %s>" % (sel...
bsd-3-clause
vladikr/nova_drafts
nova/openstack/common/service.py
16
15336
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # 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
Communities-Communications/cc-odoo
addons/sale/report/__init__.py
370
1086
# -*- 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
2014c2g19/2014c2g19
exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/logging/handlers.py
736
55579
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
gpl-2.0
simonwydooghe/ansible
test/units/mock/vault_helper.py
206
1559
# 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 distributed in the hope that it will be useful, # but WITHOUT ...
gpl-3.0
marduk191/plugin.video.movie25
resources/libs/plugins/animetoon.py
2
16443
# -*- coding: utf-8 -*- import urllib,re,os,sys,json import xbmc, xbmcgui, xbmcaddon, xbmcplugin,time from resources.libs import main #Mash Up - by Mash2k3 2012. addon_id = 'plugin.video.movie25' selfAddon = xbmcaddon.Addon(id=addon_id) art = main.art smalllogo=art+'/smallicon.png' def AZAT(sec): import string ...
gpl-3.0
tomschr/sdsc
src/sdsc/__init__.py
1
1375
# # Copyright (c) 2017 SUSE Linux GmbH # # This program is free software; you can redistribute it and/or # modify it under the terms of version 3 of the GNU General Public License as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRAN...
lgpl-2.1
OMAP4-AOSP/android_kernel_omap4_common
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
goulu/networkx
networkx/algorithms/tests/test_graphical.py
22
4665
#!/usr/bin/env python from nose.tools import * from nose import SkipTest import networkx as nx def test_valid_degree_sequence1(): n = 100 p = .3 for i in range(10): G = nx.erdos_renyi_graph(n,p) deg = (d for n, d in G.degree()) assert_true( nx.is_valid_degree_sequence(deg, method='e...
bsd-3-clause
xq262144/hue
desktop/core/ext-py/Babel-0.9.6/babel/dates.py
67
38022
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software cons...
apache-2.0
zbyte64/django-hyperadmin
hyperadmin/models.py
2
1912
""" Helper function for logging all events that come through the API. """ # TODO Write logging model from contextlib import contextmanager import logging from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ class RelList(list): """ A list subclass that allow...
bsd-3-clause
MrLoick/python-for-android
python-modules/twisted/twisted/protocols/gps/rockwell.py
61
11638
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """Rockwell Semiconductor Zodiac Serial Protocol Coded from official protocol specs (Order No. GPS-25, 09/24/1996, Revision 11) Maintainer: Bob Ippolito The following Rockwell Zodiac messages are currently understood:: EARTHA\\r\...
apache-2.0
kkk669/mxnet
example/speech_recognition/stt_io_iter.py
44
5098
# 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
rizumu/django
tests/forms_tests/field_tests/test_multivaluefield.py
156
5661
from datetime import datetime from django.forms import ( CharField, Form, MultipleChoiceField, MultiValueField, MultiWidget, SelectMultiple, SplitDateTimeField, SplitDateTimeWidget, TextInput, ValidationError, ) from django.test import SimpleTestCase beatles = (('J', 'John'), ('P', 'Paul'), ('G', 'George'...
bsd-3-clause
3upperm2n/HMM_cuda
unit_test/gmock/gmock-1.7.0/gtest/scripts/pump.py
2471
23673
#!/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...
mit
javierlgroba/Eventer-gapp
django/core/management/commands/inspectdb.py
110
9570
from __future__ import unicode_literals import keyword import re from optparse import make_option from django.core.management.base import NoArgsCommand, CommandError from django.db import connections, DEFAULT_DB_ALIAS from django.utils import six class Command(NoArgsCommand): help = "Introspects the database tab...
lgpl-3.0
sumedh123/debatify
venv/lib/python2.7/site-packages/jinja2/parser.py
336
35442
# -*- coding: utf-8 -*- """ jinja2.parser ~~~~~~~~~~~~~ Implements the template parser. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2 import nodes from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError from jinja2.lexer impo...
mit
BellScurry/gem5-fault-injection
util/minorview/model.py
55
39193
# Copyright (c) 2013 ARM Limited # 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 implementation of the functionality o...
bsd-3-clause
ahoyosid/scikit-learn
sklearn/utils/arpack.py
265
64837
""" This contains a copy of the future version of scipy.sparse.linalg.eigen.arpack.eigsh It's an upgraded wrapper of the ARPACK library which allows the use of shift-invert mode for symmetric matrices. Find a few eigenvectors and eigenvalues of a matrix. Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/ """ #...
bsd-3-clause
Pi2-FGABreja/FGABreja-Pi
FGABrejaAPI/monitoring/views.py
2
1354
from django.views.generic import View from django.http import HttpResponse from .models import Sensor from django.core import serializers from controlling.models import Process import json class SensorView(View): http_method_names = [u'get'] def get(self, request, sensor_id=None): if sensor_id: ...
gpl-3.0
sdbonin/SOQresearch
SOQswapRK4.py
1
8364
# -*- coding: utf-8 -*- """ This code uses a loop along with our set of coupled differential equations and matrix math to create arrays of 4-vector quaternions. The old plotting functions need to be updated and incorperated into the end of this code or a better visualization solution needs to be found. """ ...
mit
benspaulding/django
django/views/generic/dates.py
7
25073
from __future__ import unicode_literals import datetime from django.conf import settings from django.db import models from django.core.exceptions import ImproperlyConfigured from django.http import Http404 from django.utils.encoding import force_unicode from django.utils.functional import cached_property from django.u...
bsd-3-clause
byterom/android_external_chromium_org
android_webview/buildbot/generate_local_manifest.py
114
3782
#!/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. """Generate local manifest in an Android repository. This is used to generate a local manifest in an Android repository. The purpo...
bsd-3-clause
wangxuan007/flasky
venv/lib/python2.7/site-packages/alembic/testing/provision.py
15
9382
"""NOTE: copied/adapted from SQLAlchemy master for backwards compatibility; this should be removable when Alembic targets SQLAlchemy 1.0.0 """ from sqlalchemy.engine import url as sa_url from sqlalchemy import text from sqlalchemy import exc from ..util import compat from . import config, engines from .compat impor...
gpl-3.0
Titan-C/sympy
sympy/functions/elementary/tests/test_miscellaneous.py
22
12136
import itertools as it from sympy.core.function import Function from sympy.core.numbers import I, oo, Rational from sympy.core.singleton import S from sympy.core.symbol import Symbol from sympy.functions.elementary.miscellaneous import (sqrt, cbrt, root, Min, Max, ...
bsd-3-clause
meteorcloudy/tensorflow
tensorflow/python/kernel_tests/decode_bmp_op_test.py
20
3131
# 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
Hope6537/hope-tactical-equipment
hope-python-script/network/ssh/simple_ssh_server.py
2
2224
# coding=utf-8 """ 创建SSH服务端 前置依赖:sudo pip install paramiko """ import socket import sys import threading import paramiko host_key = paramiko.RSAKey(filename='test_rsa.key') class Server(paramiko.ServerInterface): def __init__(self): self.event = threading.Event() def check_channel_request(self, kin...
apache-2.0
mapnik/mapnik
scons/scons-local-4.1.0/SCons/Variables/ListVariable.py
4
4340
# MIT License # # Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, ...
lgpl-2.1
AusTac/parma
b3/lib/yaml/composer.py
534
4921
__all__ = ['Composer', 'ComposerError'] from error import MarkedYAMLError from events import * from nodes import * class ComposerError(MarkedYAMLError): pass class Composer(object): def __init__(self): self.anchors = {} def check_node(self): # Drop the STREAM-START event. if se...
gpl-2.0
DMS-Aus/Roam
src/roam_tests/tests_editorwidgets/test_numberwidget.py
1
2390
import pytest from roam.editorwidgets.numberwidget import NumberWidget, DoubleNumberWidget config = { "prefix": "test_pre", "suffix": "test_suf", "max": 100, "min": 0 } def test_should_return_same_value(): widget = NumberWidget().createWidget(None) wrapper = NumberWidget(widget=widget) wr...
gpl-2.0
jwang98052/incubator-reef
dev/update_website.py
21
6141
# 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
tigwyk/eve-wspace
evewspace/Jabber/migrations/0001_initial.py
22
7000
# -*- 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): # Adding model 'JabberGroup' db.create_table('Jabber_jabbergroup', ( ('id', self.gf('django.db.m...
gpl-3.0
genialis/resolwe-bio
resolwe_bio/tools/make_report.py
1
13645
#!/usr/bin/env python3 """Generate amplicon report.""" import argparse import csv import re import subprocess DECIMALS = 2 # Decimal precision when presenting results: parser = argparse.ArgumentParser(description="Fill data into tex template file.") parser.add_argument("--sample", help="Sample name.") parser.add_arg...
apache-2.0
isyippee/ceilometer
ceilometer/tests/unit/dns/test_notifications.py
8
3721
# # Copyright (c) 2015 Hewlett Packard 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 t...
apache-2.0
supermari0/ironic
ironic/common/paths.py
6
2156
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2012 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the ...
apache-2.0
NeuralEnsemble/neuroConstruct
lib/jython/Lib/test/test_copy.py
14
17931
"""Unit tests for the copy module.""" import copy import copy_reg import unittest from test import test_support class TestCopy(unittest.TestCase): # Attempt full line coverage of copy.py from top to bottom def test_exceptions(self): self.assert_(copy.Error is copy.error) self.assert_(issubc...
gpl-2.0
vmax-feihu/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/tests/utils.py
114
1698
from django.conf import settings from django.db import DEFAULT_DB_ALIAS # function that will pass a test. def pass_test(*args): return def no_backend(test_func, backend): "Use this decorator to disable test on specified backend." if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend: ...
apache-2.0
tcpcloud/openvstorage
ovs/dal/hybrids/t_testemachine.py
1
1117
# Copyright 2014 Open vStorage NV # # 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
nongxiaoming/rt-thread
bsp/mm32l3xx/rtconfig.py
11
3674
# BSP Note: For TI EK-TM4C1294XL Tiva C Series Connected LancuhPad (REV D) import os import sys # toolchains options CROSS_TOOL = 'gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') # device options ARCH = 'arm' CPU = 'cortex-m3' # cross_tool provides the cross compiler # EXEC_PATH is the compiler ex...
apache-2.0
AutorestCI/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group.py
1
1777
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
neurosnap/modular-file-storage
mfs/__init__.py
1
1644
""" Abstract interface for multiple file storage services""" from tempfile import TemporaryFile def loader(backend, *args, **kwargs): """ Main entry point for all backends :param backend: File storage class that will be used for this instance """ return backend(*args, **kwargs) def detector(): """ Finds all su...
mit
GustavePate/lycheesync
lycheesync/sync.py
1
4223
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function # from __future__ import unicode_literals from lycheesync.lycheesyncer import LycheeSyncer from lycheesync.update_scripts import inf_to_lychee_2_6_2 import logging.config import click import os import sys import pwd import grp from lychee...
mit
seanwestfall/django
tests/file_storage/tests.py
199
31638
# -*- coding: utf-8 -*- from __future__ import unicode_literals import errno import os import shutil import sys import tempfile import threading import time import unittest import warnings from datetime import datetime, timedelta from django.core.cache import cache from django.core.exceptions import SuspiciousFileOpe...
bsd-3-clause
40223121/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/configparser.py
692
50025
"""Configuration file parser. A configuration file consists of sections, lead by a "[section]" header, and followed by "name: value" entries, with continuations and such in the style of RFC 822. Intrinsic defaults can be specified by passing them into the ConfigParser constructor as a dictionary. class: ConfigParse...
gpl-3.0
relictMarauder/kodi
plugin.video.relict.hdout.tv/default.py
1
5939
#!/usr/bin/python # -*- coding: utf-8 -*- import xbmcaddon, xbmc, xbmcgui, xbmcplugin import sys import os import traceback from resources.lib.debug import RemoteDebug import resources.lib.series as hdout_series import resources.lib.episodes as hdout_episodes import resources.lib.common as hdout_common debug = Remot...
apache-2.0
bobwalker99/Pydev
plugins/org.python.pydev.jython/Lib/compiler/symbols.py
134
14489
"""Module symbol-table generator""" from compiler import ast from compiler.consts import SC_LOCAL, SC_GLOBAL_IMPLICIT, SC_GLOBAL_EXPLICIT, \ SC_FREE, SC_CELL, SC_UNKNOWN from compiler.misc import mangle import types import sys MANGLE_LEN = 256 class Scope: # XXX how much information do I need about each na...
epl-1.0
Dino0631/RedRain-Bot
lib/youtube_dl/extractor/mailru.py
42
5086
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, remove_end, ) class MailRuIE(InfoExtractor): IE_NAME = 'mailru' IE_DESC = 'Видео@Mail.Ru' _VALID_URL = r'https?://(?:(?:www|m)\.)?my\.mail\.ru/(?:video/.*#video=...
gpl-3.0
Dekken/tick
tick/base/threadpool.py
2
1129
# License: BSD 3 clause import threading import queue class ThreadPool(object): def __init__(self, with_lock=False, max_threads=8): object.__init__(self) self._Qin = queue.Queue() self._max_threads = max_threads self._n_works = 0 self._Qerr = queue.Queue() if (with...
bsd-3-clause
0x0mar/king-phisher
tests/client/export.py
9
2721
#!/usr/bin/env python # -*- coding: utf-8 -*- # # tests/client/export.py # # 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...
bsd-3-clause
quantumlib/Cirq
cirq-core/cirq/contrib/graph_device/graph_device_test.py
1
7734
# Copyright 2018 The Cirq Developers # # 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 ...
apache-2.0
AudioHumLab/FIRtro
bin_custom.example/monitors_restore.py
2
2340
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Script custom para restaurar la conexión de la fuente de audio del FIRtro hacia los monitores de señal, por ejemplo: - monitor externo spdif (p.ej el RTA/VU-Meter Behringer Ultracurve 2496) - monitor (jack) de loudness Ebumeter de Fons Adriaensen """ import jack from ...
gpl-3.0
broferek/ansible
lib/ansible/modules/storage/purestorage/purefb_ds.py
19
14384
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Simon Dodsley (simon@purestorage.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
tiborsimko/invenio-webhooks
docs/conf.py
2
10729
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 CERN. # # Invenio 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...
gpl-2.0
jakevdp/scipy
scipy/optimize/_minimize.py
2
27478
""" Unified interfaces to minimization algorithms. Functions --------- - minimize : minimization of a function of several variables. - minimize_scalar : minimization of a function of one variable. """ from __future__ import division, print_function, absolute_import __all__ = ['minimize', 'minimize_scalar'] from wa...
bsd-3-clause
Ashstreet/BugScoreKeeper
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py
304
41695
# 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. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMake...
mit
Karkus476/pygame-tanks
entity.py
1
5935
import pygame, math, geom from vector import Vector mp = [0,0] class Entity: entities = [] bulletIds = [] bombIds = [] agentIds = [] trackIds = [] nextId = 0 def __init__(self, type, xywh = None, xyr = None): if xywh != None: self.rect = pygame.Rect(xywh[0...
gpl-3.0
SkRobo/Eurobot-2017
old year/RESET-master/FSM/packetParser.py
4
4413
import typeConvertor import packetBuilder import crc import binascii class ParsePacket(object): synchronization = 'FA' adress = 'FA' typeConvertor = typeConvertor.TypeConvertor() crcCalculator = crc.CrcCalculator() listOfComands = packetBuilder.CommandsList() def __init__(self, byteString): self.string =...
mit
thfield/sf-base-election-data
venv/lib/python3.4/site-packages/pip/_vendor/distlib/index.py
571
20976
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import hashlib import logging import os import shutil import subprocess import tempfile try: from threading import Thread except ImportErr...
bsd-3-clause
ruibarreira/linuxtrail
usr/lib/python2.7/dist-packages/numpy/distutils/lib2def.py
57
3487
from __future__ import division, absolute_import, print_function import re import sys import os import subprocess __doc__ = """This module generates a DEF file from the symbols in an MSVC-compiled DLL import library. It correctly discriminates between data and functions. The data is collected from the output of the...
gpl-3.0
ZJUZT/google-diff-match-patch
python2/diff_match_patch.py
337
67934
#!/usr/bin/python2.4 from __future__ import division """Diff Match and Patch Copyright 2006 Google Inc. http://code.google.com/p/google-diff-match-patch/ 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 Lice...
apache-2.0
chongtianfeiyu/kbengine
kbe/src/lib/python/Tools/freeze/makefreeze.py
37
2706
import marshal import bkfile # Write a file containing frozen code for the modules in the dictionary. header = """ #include "Python.h" static struct _frozen _PyImport_FrozenModules[] = { """ trailer = """\ {0, 0, 0} /* sentinel */ }; """ # if __debug__ == 0 (i.e. -O option given), set Py_OptimizeFlag in frozen...
lgpl-3.0
samuto/UnityOpenCV
opencv/samples/swig_python/squares.py
6
5931
#!/usr/bin/python # # The full "Square Detector" program. # It loads several images subsequentally and tries to find squares in # each image # from opencv.cv import * from opencv.highgui import * from math import sqrt thresh = 50; img = None; img0 = None; storage = None; wndname = "Square Detection Demo"; def angle(...
gpl-3.0
sanjeevtripurari/hue
desktop/libs/hadoop/src/hadoop/fs/upload.py
26
5786
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
sulaweyo/torrentflux-b4rt-php7
html/bin/clients/mainline/BTL/psapi.py
11
2555
# Windows PSAPI function wrappers. # http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/psapi_functions.asp # # The contents of this file are subject to the Python Software Foundation # License Version 2.3 (the License). You may not copy or use this file, in # either source code or executabl...
gpl-2.0
Denniskamau/Twitter-Sentiment-Analysis
stream.py
1
3946
import re import json import tweepy from config import * from tweepy import OAuthHandler from textblob import TextBlob class TwitterClient(object): ''' Generic Twitter Class for sentiment analysis. ''' def __init__(self): ''' Class constructor or initialization method. ''' ...
mit
VasuAgrawal/tartanHacks2015
site/flask/lib/python2.7/site-packages/whoosh/filedb/compound.py
87
11090
# Copyright 2011 Matt Chaput. 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, # this list of conditions and the...
mit
tempbottle/kbengine
kbe/res/scripts/common/Lib/unittest/test/test_assertions.py
82
16470
import datetime import warnings import weakref import unittest from itertools import product class Test_Assertions(unittest.TestCase): def test_AlmostEqual(self): self.assertAlmostEqual(1.00000001, 1.0) self.assertNotAlmostEqual(1.0000001, 1.0) self.assertRaises(self.failureException, ...
lgpl-3.0
slayerjain/servo
tests/wpt/css-tests/css21_dev/xhtml1print/reference/support/fonts/makegsubfonts.py
1616
14125
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
knkinnard/byte-2
lib/werkzeug/contrib/wrappers.py
181
10337
# -*- coding: utf-8 -*- """ werkzeug.contrib.wrappers ~~~~~~~~~~~~~~~~~~~~~~~~~ Extra wrappers or mixins contributed by the community. These wrappers can be mixed in into request objects to add extra functionality. Example:: from werkzeug.wrappers import Request as RequestBase fr...
apache-2.0
rschnapka/partner-contact
passport/tests/test_passport.py
1
6929
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or m...
agpl-3.0
milad-soufastai/ansible-modules-extras
cloud/vmware/vmware_vm_vss_dvs_migrate.py
71
5422
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
PaulWay/spacewalk
client/debian/packages-already-in-debian/python-ethtool/pifconfig.py
2
3217
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # Copyright (C) 2008--2013 Red Hat, Inc. # # Arnaldo Carvalho de Melo <acme@redhat.com> # # This application 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 Softw...
gpl-2.0
jcai19/smm_gem5
src/cpu/CheckerCPU.py
69
2022
# Copyright (c) 2007 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list ...
bsd-3-clause
NeuroDataDesign/seelviz
Cherrypy/cherrypyapp.py
1
2633
import os, os.path import random import sqlite3 import string import time import cherrypy DB_STRING = "my.db" class StringGenerator(object): @cherrypy.expose def index(self): return file('index.html') class StringGeneratorWebService(object): exposed = True @cherrypy.tools.accept(media='text/p...
apache-2.0
mxOBS/deb-pkg_trusty_chromium-browser
net/android/tools/proxy_test_cases.py
165
10640
#!/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. """Generator script for proxy tests. See AndroidProxySelectorTest.java and net/proxy/proxy_config_service_android_unittest.cc To ...
bsd-3-clause
icloudrnd/automation_tools
openstack_dashboard/dashboards/project/access_and_security/api_access/tests.py
29
3255
# Copyright 2012 Nebula 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 ...
apache-2.0
paolodedios/tensorflow
tensorflow/python/util/tf_stack.py
9
6644
# 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
scarcry/snm-mezzanine
mezzanine/twitter/models.py
3
6032
from datetime import datetime, timedelta from django.db import models from django.utils.html import urlize from django.utils.timezone import get_default_timezone, make_aware from django.utils.translation import ugettext_lazy as _ from mezzanine.conf import settings from mezzanine.twitter import QUERY_TYPE_CHOICES, QUE...
bsd-2-clause
red-hood/calendarserver
txweb2/dav/auth.py
1
6134
## # Copyright (c) 2005-2015 Apple 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 restriction, including without limitation the rights # to use, copy, mod...
apache-2.0
rainslytherin/ansible
lib/ansible/runner/lookup_plugins/env.py
154
1282
# (c) 2012, Jan-Piet Mens <jpmens(at)gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
gpl-3.0
whn09/tensorflow
tensorflow/python/kernel_tests/morphological_ops_test.py
138
18619
# 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
Ilhasoft/ureport
ureport/news/views.py
2
4300
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from dash.categories.fields import CategoryChoiceField from dash.categories.models import Category from dash.orgs.views import OrgObjPermsMixin, OrgPermsMixin from smartmin.views import SmartCreateView, SmartCRUD...
agpl-3.0
isaksky/selenium
py/selenium/webdriver/ie/webdriver.py
55
2093
#!/usr/bin/python # # Copyright 2008-2013 Software freedom conservancy # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
mccheung/kbengine
kbe/res/scripts/common/Lib/idlelib/PyParse.py
70
20491
import re import sys from collections import Mapping from functools import partial # Reason last stmt is continued (or C_NONE if it's not). (C_NONE, C_BACKSLASH, C_STRING_FIRST_LINE, C_STRING_NEXT_LINES, C_BRACKET) = range(5) if 0: # for throwaway debugging output def dump(*stuff): sys.__stdout__.write...
lgpl-3.0
pavle-batuta/djangoTDD
lists/migrations/0001_initial.py
1
1038
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Item', fields=[ ('id', models.AutoField(primary...
mit
h2oai/sparkling-water
py-scoring/src/ai/h2o/sparkling/ml/params/HasGamColsOnMOJO.py
1
1024
# # 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