repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/Demos/security/set_file_owner.py
34
2045
fname=r'h:\tmp.txt' import win32security,win32file,win32api,ntsecuritycon,win32con new_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), (win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SHUTDOWN_NAME),win32con.SE_PRIVILEGE_ENABLED), ...
apache-2.0
ltilve/chromium
media/PRESUBMIT.py
21
6977
# 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. """Top-level presubmit script for Chromium media component. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details abo...
bsd-3-clause
LucaDiStasio/thinPlyMechanics
python/createAndAnalyzeStiffMatrixRVEs.py
1
611076
#!/usr/bin/python # -*- coding: utf-8 -*- ''' ===================================================================================== Copyright (c) 2016-2019 Université de Lorraine or Luleå tekniska universitet Author: Luca Di Stasio <luca.distasio@gmail.com> <luca.distasio@ingpec.eu> Redistribu...
apache-2.0
jim-thisplace/exercises-in-programming-style
29-dataspaces/tf-29.py
17
1558
#!/usr/bin/env python import re, sys, operator, Queue, threading # Two data spaces word_space = Queue.Queue() freq_space = Queue.Queue() stopwords = set(open('../stop_words.txt').read().split(',')) # Worker function that consumes words from the word space # and sends partial results to the frequency space def proces...
mit
miyosuda/intro-to-dl-android
ImageClassification/jni-build/jni/include/tensorflow/python/kernel_tests/fifo_queue_test.py
3
39552
# Copyright 2015 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 a...
apache-2.0
kemaswill/keras
keras/regularizers.py
5
4694
from __future__ import absolute_import from . import backend as K class Regularizer(object): def set_param(self, p): self.p = p def set_layer(self, layer): self.layer = layer def __call__(self, loss): return loss def get_config(self): return {'name': self.__class__._...
mit
Batterfii/django
tests/auth_tests/test_templates.py
328
2785
from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.contrib.auth.views import ( password_change, password_change_done, password_reset, password_reset_complete, password_reset_confirm, password_res...
bsd-3-clause
jondo/shogun
examples/undocumented/python_modular/graphical/converter_jade_bss.py
26
1089
""" Blind Source Separation using the Jade Algorithm with Shogun Based on the example from scikit-learn http://scikit-learn.org/ Kevin Hughes 2013 """ import numpy as np import pylab as pl from modshogun import RealFeatures from modshogun import Jade # Generate sample data np.random.seed(0) n_samples = 2000 time...
gpl-3.0
LarsFronius/ansible
lib/ansible/plugins/callback/foreman.py
20
7129
# -*- coding: utf-8 -*- # (C) 2015, 2016 Daniel Lobato <elobatocs@gmail.com> # 2016 Guido Günther <agx@sigxcpu.org> # # 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 Foundati...
gpl-3.0
fanghuaqi/mbed
tools/flash_algo/extract.py
31
3546
#!/usr/bin/env python """ mbed Copyright (c) 2017-2017 ARM Limited 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 applicab...
apache-2.0
ralphtheninja/compose
tests/integration/cli_test.py
9
20973
from __future__ import absolute_import from operator import attrgetter import sys import os import shlex from six import StringIO from mock import patch from .testcases import DockerClientTestCase from compose.cli.main import TopLevelCommand from compose.project import NoSuchService class CLITestCase(DockerClientTe...
apache-2.0
HydrelioxGitHub/home-assistant
homeassistant/components/meteo_france/__init__.py
3
4108
"""Support for Meteo-France weather data.""" import datetime import logging import voluptuous as vol from homeassistant.const import CONF_MONITORED_CONDITIONS, TEMP_CELSIUS import homeassistant.helpers.config_validation as cv from homeassistant.helpers.discovery import load_platform from homeassistant.util import Thr...
apache-2.0
lashwang/pyspider
tests/test_database.py
5
23410
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-08 22:37:13 from __future__ import unicode_literals, division import os import six import time import unittest2 as unittest from pyspider import ...
apache-2.0
directorlive/oppia
core/controllers/recent_commits.py
33
2031
# Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
sandipbgt/nodeshot
setup.py
8
1542
#!/usr/bin/env python from setuptools import setup, find_packages from nodeshot import get_version def get_install_requires(): """ parse requirements.txt, ignore links, exclude comments """ requirements = [] for line in open('requirements.txt').readlines(): # skip to next iteration if comm...
gpl-3.0
aznashwan/heat2arm
heat2arm/translators/instances/nova_server.py
1
2931
# Copyright 2015 Cloudbase Solutions Srl # 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 r...
apache-2.0
AutorestCI/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_stats.py
8
1682
# 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
dulems/hue
desktop/core/ext-py/tablib-develop/tablib/packages/odf3/number.py
56
3137
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # This library 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 you...
apache-2.0
JFriel/honours_project
networkx/networkx/algorithms/approximation/vertex_cover.py
63
2088
# -*- coding: utf-8 -*- """ ************ Vertex Cover ************ Given an undirected graph `G = (V, E)` and a function w assigning nonnegative weights to its vertices, find a minimum weight subset of V such that each edge in E is incident to at least one vertex in the subset. http://en.wikipedia.org/wiki/Vertex_cov...
gpl-3.0
home-assistant/home-assistant
tests/testing_config/custom_components/test/light.py
2
1589
""" Provide a mock light platform. Call init before using it in your tests to ensure clean test data. """ from homeassistant.components.light import LightEntity from homeassistant.const import STATE_OFF, STATE_ON from tests.common import MockToggleEntity ENTITIES = [] def init(empty=False): """Initialize the p...
apache-2.0
dsandeephegde/servo
components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py
241
6622
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface SpecialMethodSignatureMismatch1 { getter long long foo(long index); }; """) results = parser.finish() except: threw = True harness.ok(threw, "Should have...
mpl-2.0
corpnewt/CorpBot.py
Cogs/Errors.py
1
1559
import asyncio import discord import sys import traceback from discord.ext import commands from discord import errors from Cogs import Message def setup(bot): bot.add_cog(Errors()) class Errors(commands.Cog): def __init__(self): pass @commands.Cog.listener() async def on_command_error(s...
mit
the-gigi/project-euler
3/003_largest_prime_factor.py
1
1075
"""Largest Prime Factor The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? """ from collections import OrderedDict def find_next_prime(primes): last = primes[-1] candidates = OrderedDict((k, 1) for k in range(last + 1, last * 2 + 1)) for p in ...
mit
badock/nova
nova/tests/api/openstack/compute/contrib/test_deferred_delete.py
4
5504
# Copyright 2011 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
verilylifesciences/classifaedes
classifaedes/export.py
1
3902
# Copyright 2019 Verily Life Sciences 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 t...
apache-2.0
data-exp-lab/girder
plugins/oauth/server/rest.py
4
5537
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
apache-2.0
yoelk/kivy
kivy/tests/test_audio.py
51
1744
''' Audio tests =========== ''' import unittest import os SAMPLE_FILE = os.path.join(os.path.dirname(__file__), 'sample1.ogg') SAMPLE_LENGTH = 1.402 DELTA = SAMPLE_LENGTH * 0.01 DELAY = 0.2 class AudioTestCase(unittest.TestCase): def get_sound(self): import os assert os.path.exists(SAMPLE_FILE)...
mit
clk8908/pymc3
pymc3/distributions/special.py
13
3420
''' Created on Mar 17, 2011 @author: jsalvatier ''' from theano import scalar, tensor import numpy from scipy import special, misc from .dist_math import * __all__ = ['gammaln', 'multigammaln', 'psi', 'trigamma', 'factln'] class GammaLn(scalar.UnaryScalarOp): """ Compute gammaln(x) """ @staticmethod...
apache-2.0
experiencecoin/experiencecoin
contrib/devtools/check-doc.py
53
1820
#!/usr/bin/env python # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' This checks if all command line args are documented. Return value is 0 to indicate no error. Author: @Marc...
mit
stackforge/cloudbase-init
cloudbaseinit/utils/windows/ws2_32.py
12
1708
# Copyright 2014 Cloudbase Solutions Srl # # 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
samarthmed/emacs-config
.python-environments/default/lib/python2.7/site.py
784
27543
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** In earlier versions of Python (up to 1.5a3), scripts or...
gpl-2.0
dwagon/pymoo
moo/game/models.py
1
3173
from django.db import models import random import math from race.models import Race class GameSize(models.Model): name = models.CharField(max_length=50) numsystems = models.IntegerField(default=10) max_x = models.IntegerField(default=20) max_y = models.IntegerField(default=20) class Game(models.Mode...
gpl-2.0
kiyoto/statsmodels
statsmodels/examples/t_est_rlm.py
33
1127
# -*- coding: utf-8 -*- """ Example from robust test_rlm, fails on Mac Created on Sun Mar 27 14:36:40 2011 """ from __future__ import print_function import numpy as np import statsmodels.api as sm RLM = sm.RLM DECIMAL_4 = 4 DECIMAL_3 = 3 DECIMAL_2 = 2 DECIMAL_1 = 1 from statsmodels.datasets.stackloss import load d...
bsd-3-clause
finfish/scrapy
tests/test_downloadermiddleware_httpproxy.py
2
6474
import os import sys from functools import partial from twisted.trial.unittest import TestCase, SkipTest from scrapy.downloadermiddlewares.httpproxy import HttpProxyMiddleware from scrapy.exceptions import NotConfigured from scrapy.http import Response, Request from scrapy.spiders import Spider from scrapy.crawler imp...
bsd-3-clause
sebfung/yellowpillowcase
vendor/cache/gems/pygments.rb-0.6.3/vendor/simplejson/simplejson/tests/test_tuple.py
71
1842
import unittest from StringIO import StringIO import simplejson as json class TestTuples(unittest.TestCase): def test_tuple_array_dumps(self): t = (1, 2, 3) expect = json.dumps(list(t)) # Default is True self.assertEqual(expect, json.dumps(t)) self.assertEqual(expect, json....
mit
howepeng/cat
cat-agent/src/main/webapp/paas-monitor.py
22
7135
#!/usr/bin/python # -*- coding: utf-8 -*- import subprocess import json import re import urllib2 from datetime import datetime COMMAND_PATTERN = "nsenter --target %s --mount --uts --ipc --net --pid -- %s" def execute(command): p = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIP...
apache-2.0
wolfram74/numerical_methods_iserles_notes
venv/lib/python2.7/site-packages/IPython/html/terminal/api_handlers.py
6
1298
import json from tornado import web, gen from ..base.handlers import APIHandler, json_errors from ..utils import url_path_join class TerminalRootHandler(APIHandler): @web.authenticated @json_errors def get(self): tm = self.terminal_manager terms = [{'name': name} for name in tm.terminals] ...
mit
munyirik/python
cpython/Lib/email/message.py
9
45765
# Copyright (C) 2001-2007 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Basic message object for the email package object model.""" __all__ = ['Message'] import re import uu import quopri import warnings from io import BytesIO, StringIO # Intrapackage imports from email import...
bsd-3-clause
SwagColoredKitteh/servo
tests/wpt/css-tests/css-text-decor-3_dev/xhtml1print/reference/support/generate-text-emphasis-ruby-tests.py
829
3042
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-ruby-001 ~ 004 which tests emphasis marks with ruby in four directions. It outputs a list of all tests it generated in the format of Mozilla reftest.list to the stdout. """ from __future__ import unicode_literals TEST_FIL...
mpl-2.0
zmike/servo
components/script/dom/bindings/codegen/parser/tests/test_putForwards.py
142
2341
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface I { [PutForwards=B] readonly attribute long A; }; """) results = parser.finish() except: threw = True harness.ok(threw, "Should have thrown.") parse...
mpl-2.0
web30s/odoo-9.0c-20160402
hello/templates/openerp/addons/account/wizard/account_report_aged_partner_balance.py
24
1763
# -*- coding: utf-8 -*- import time from datetime import datetime from dateutil.relativedelta import relativedelta from openerp import api, fields, models, _ from openerp.exceptions import UserError class AccountAgedTrialBalance(models.TransientModel): _name = 'account.aged.trial.balance' _inherit = 'accoun...
gpl-3.0
impromptuartist/impromptuartist.github.io
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/dotnet.py
94
26751
# -*- coding: utf-8 -*- """ pygments.lexers.dotnet ~~~~~~~~~~~~~~~~~~~~~~ Lexers for .net languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ...
mit
cortedeltimo/SickRage
lib/mako/pygen.py
61
9952
# mako/pygen.py # Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """utilities for generating and formatting literal Python code.""" import re from mako import excep...
gpl-3.0
sushantgoel/Flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/packages/chardet/compat.py
2943
1157
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # This library 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 # versio...
apache-2.0
ping/youtube-dl
youtube_dl/extractor/ynet.py
64
1807
# coding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote_plus class YnetIE(InfoExtractor): _VALID_URL = r'https?://(?:.+?\.)?ynet\.co\.il/(?:.+?/)?0,7340,(?P<id>L(?:-[0-9]+)+),00\.html' _TESTS = [ ...
unlicense
ossdemura/django-miniblog
Lib/site-packages/django/contrib/postgres/fields/ranges.py
109
6308
import json from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange, Range from django.contrib.postgres import forms, lookups from django.db import models from django.utils import six from .utils import AttributeSetter __all__ = [ 'RangeField', 'IntegerRangeField', 'BigIntegerRangeField', 'Floa...
mit
aptivate/ihpresultsweb
ihp/submissions/migrations/0018_auto__add_agencyprofile__add_unique_agencyprofile_agency_language.py
1
20882
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'AgencyProfile' db.create_table('submissions_agencyprofile', ( ('id', self.gf('...
gpl-3.0
agaldona/odoomrp-wip-1
mrp_project_link_mto/__openerp__.py
10
1266
# -*- coding: utf-8 -*- ############################################################################## # # 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 L...
agpl-3.0
wenxer/peewee
playhouse/tests/test_apis.py
19
1170
from peewee import Node from peewee import * from playhouse.tests.base import PeeweeTestCase class TestNodeAPI(PeeweeTestCase): def test_extend(self): @Node.extend() def add(self, lhs, rhs): return lhs + rhs n = Node() self.assertEqual(n.add(4, 2), 6) delattr(N...
mit
curbthepain/android_kernel_htc_a11chl
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
Towerthousand/tvhack
server.py
1
2475
#!/usr/bin/env python3 from flask import Flask from flask import jsonify from flask import render_template from flask.ext.cors import CORS from firebase import firebase app = Flask(__name__) CORS(app) firebase = firebase.FirebaseApplication('https://tvhack.firebaseio.com', None) _calling = False @app.route('/') ...
mit
foone/7gen
code/basictexture.py
1
1894
#!/usr/env python from error import SaveError,LoadError,CompressedError from zipfs import fsopen,isZip,GetFileNameInZip import os import pygame class TextureConverter: def __init__(self,palette=None): if palette is not None: self.palette_surf=palette else: self.palette_surf=pygame.image.load('code/palette.bm...
gpl-2.0
cytec/SickRage
lib/chardet/euckrfreq.py
342
13546
######################## 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...
gpl-3.0
haihabi/simpy
simpy/core/tests_configuration.py
1
3303
from .base_function import read_enum, build_function_input_dict from simpy.core.result.container import ResultContainer, Result class TestConfiguration(object): def __init__(self, name, enable, config_name, overwrite): if not isinstance(enable, bool): raise Exception('enable must be a boolean'...
mit
pataquets/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/web_mock.py
184
2241
# Copyright (C) 2011 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...
bsd-3-clause
fawazn/Resume-Viewer
ResumeViewer/settings.py
1
2237
""" Django settings for ResumeView project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE...
mit
unidesigner/pyconto
pyconto/bct/bit32/old/bct.py
1
16561
# This file was automatically generated by SWIG (http://www.swig.org). # Version 1.3.40 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. # This file is compatible with both classic and new-style classes. from sys import version_info if version_info >= (...
gpl-3.0
botswana-harvard/edc-appointment
edc_appointment/migrations/0002_auto_20161126_1156.py
1
10997
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-26 11:56 from __future__ import unicode_literals from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion import django_extensions.db.fields import django_revision.revision_fi...
gpl-2.0
okfn/ofs
setup.py
1
1171
from setuptools import setup, find_packages try: fo = open('README.rst') long_description = fo.read() except: long_description="""OFS - provides plugin-orientated low-level blobstore. """, finally: fo.close() setup( name="ofs", version="0.4.3", description="OFS - provides plugin-orientated...
mit
goyalankit/po-compiler
object_files/networkx-1.8.1/networkx/algorithms/connectivity/connectivity.py
21
20381
# -*- coding: utf-8 -*- """ Flow based connectivity algorithms """ import itertools import networkx as nx __author__ = '\n'.join(['Jordi Torrents <jtorrents@milnou.net>']) __all__ = [ 'average_node_connectivity', 'local_node_connectivity', 'node_connectivity', 'local_edge_connectiv...
apache-2.0
RJVB/audacity
lib-src/lv2/sord/waflib/Logs.py
134
4714
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,re,traceback,sys try: import threading except ImportError: pass else: wlock=threading.Lock() class sync_stream(object): def __init__(self,stream): self.stre...
gpl-2.0
xyyangkun/git-repo
subcmds/help.py
23
5249
# # Copyright (C) 2008 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
keedio/hue
desktop/core/ext-py/python-openid-2.2.5/openid/test/test_association.py
85
6439
from openid.test import datadriven import unittest from openid.message import Message, BARE_NS, OPENID_NS, OPENID2_NS from openid import association import time from openid import cryptutil import warnings class AssociationSerializationTest(unittest.TestCase): def test_roundTrip(self): issued = int(time....
apache-2.0
jonparrott/gcloud-python
dlp/docs/conf.py
3
10194
# -*- coding: utf-8 -*- # # google-cloud-dlp documentation build configuration file # # 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. # # All configuration values have a default; values that ...
apache-2.0
alshedivat/tensorflow
tensorflow/python/kernel_tests/sparse_cross_op_test.py
8
16655
# 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
korrosivesec/crits
crits/core/management/commands/get_duplicate_targets.py
23
2145
from bson import Code from django.core.management.base import BaseCommand from optparse import make_option from crits.emails.email import Email from crits.targets.target import Target class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--delete', '-d', ...
mit
dims/heat
heat/engine/constraint/common_constraints.py
3
2856
# # 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 # ...
apache-2.0
midori1/midorinoblog
site-packages/django/contrib/gis/measure.py
93
12310
# Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz> # 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, #...
apache-2.0
tensorflow/models
official/recommendation/ncf_common.py
1
12278
# Copyright 2021 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
Salandora/OctoPrint
tests/server/util/test_webassets.py
3
1112
# coding=utf-8 """ Unit tests for ``octoprint.server.util.flask``. """ from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2016 The OctoPrint Project - Released under t...
agpl-3.0
pedrobaeza/OpenUpgrade
addons/resource/faces/observer.py
433
2328
#@+leo-ver=4 #@+node:@file observer.py #@@language python #@<< Copyright >> #@+node:<< Copyright >> ############################################################################ # Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # ...
agpl-3.0
robin-lai/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
286
2378
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
Vvucinic/Wander
venv_2_7/lib/python2.7/site-packages/pandas/core/indexing.py
9
64500
# pylint: disable=W0223 from pandas.core.index import Index, MultiIndex from pandas.compat import range, zip import pandas.compat as compat import pandas.core.common as com from pandas.core.common import (is_bool_indexer, is_integer_dtype, _asarray_tuplesafe, is_list_like, isnull, ...
artistic-2.0
alephu5/Soundbyte
environment/lib/python3.3/site-packages/sympy/physics/vector/frame.py
1
27712
from sympy import (diff, trigsimp, expand, sin, cos, solve, Symbol, sympify, eye, ImmutableMatrix as Matrix) from sympy.core.compatibility import string_types, u from sympy.physics.vector.vector import Vector, _check_vector __all__ = ['CoordinateSym', 'ReferenceFrame'] class CoordinateSym(Symbol):...
gpl-3.0
yosshy/nova
nova/virt/driver.py
29
58892
# 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 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
zsjohny/jumpserver
apps/perms/utils/database_app_permission.py
1
2832
# coding: utf-8 # from django.utils.translation import ugettext as _ from django.db.models import Q from orgs.utils import set_to_root_org from ..models import DatabaseAppPermission from common.tree import TreeNode from applications.models import DatabaseApp from assets.models import SystemUser __all__ = [ 'Dat...
gpl-2.0
dongjoon-hyun/spark
python/pyspark/tests/test_daemon.py
23
2950
# # 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
nirzari18/Query-Analysis-Application-on-Google-App-Engine_Extension
lib/simplejson/tests/test_bigint_as_string.py
122
2238
from unittest import TestCase import simplejson as json class TestBigintAsString(TestCase): # Python 2.5, at least the one that ships on Mac OS X, calculates # 2 ** 53 as 0! It manages to calculate 1 << 53 correctly. values = [(200, 200), ((1 << 53) - 1, 9007199254740991), ((1...
apache-2.0
jcoady9/python-for-android
python-build/python-libs/gdata/build/lib/gdata/tlslite/utils/keyfactory.py
361
8791
"""Factory functions for asymmetric cryptography. @sort: generateRSAKey, parseXMLKey, parsePEMKey, parseAsPublicKey, parseAsPrivateKey """ from compat import * from RSAKey import RSAKey from Python_RSAKey import Python_RSAKey import cryptomath if cryptomath.m2cryptoLoaded: from OpenSSL_RSAKey import OpenSSL_RSAK...
apache-2.0
curiosityio/taiga-docker
taiga-back/taiga-back/taiga/projects/notifications/mixins.py
2
10277
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can redistribute it and/or mo...
mit
shi2wei3/virt-test
virttest/storage.py
6
21105
""" Classes and functions to handle storage devices. This exports: - two functions for get image/blkdebug filename - class for image operates and basic parameters """ import logging import os import shutil import re from autotest.client import utils try: from virttest import iscsi except ImportError: from ...
gpl-2.0
iMyon/imageFilter
includes/uiControl.py
1
2301
#!/usr/bin/python #coding:utf-8 #Filename: test.py #Created: 2014-01-02 02:45:15 #Author: Myon, myon.cn@gmail.com from PyQt4 import QtGui,QtCore from mainwindow import Ui_MainWindow from PyQt4.QtCore import * from filter import filterImages class Widget(QtGui.QMainWindow, Ui_MainWindow): """QtGui.QWidget和界面设计时选择的类型...
gpl-2.0
hujiajie/pa-chromium
native_client_sdk/src/tools/tests/chrome_mock.py
107
1498
#!/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. import optparse import sys import time import urllib2 def PrintAndFlush(s): print s sys.stdout.flush() def main(args): pars...
bsd-3-clause
home-assistant/home-assistant
homeassistant/components/hue/sensor.py
2
4083
"""Hue sensor entities.""" from aiohue.sensors import ( TYPE_ZLL_LIGHTLEVEL, TYPE_ZLL_ROTARY, TYPE_ZLL_SWITCH, TYPE_ZLL_TEMPERATURE, ) from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorEntity from homeassistant.const import ( DEVICE_CLASS_BATTERY, DEVICE_CLASS_ILLUMINAN...
apache-2.0
dragon/dr_months_calendar
drCalendar.py
1
4598
import sublime, sublime_plugin, locale, datetime import calendar,locale,sys # view.run_command("dr_calendar_insert_month") def add_month(y,m,x): r_m = m + x r_y = y if (r_m < 1): r_y -= 1 r_m = 12 if (r_m > 12): r_m = 1 r_y += 1 r...
mit
sicily/qt4.8.4
src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/MSVSSettings_test.py
12
65283
#!/usr/bin/python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the MSVSSettings.py file. """ import sys import unittest import MSVSSettings import StringIO class TestSequenceFunctions(...
lgpl-2.1
buildbot/buildbot
worker/buildbot_worker/test/util/sourcecommand.py
17
3389
# This file is part of Buildbot. Buildbot 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 distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
schlueter/ansible
lib/ansible/modules/network/avi/avi_cluster.py
15
3916
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ANSIB...
gpl-3.0
jelly/calibre
src/calibre/gui2/device.py
2
88912
from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' # Imports {{{ import os, traceback, Queue, time, cStringIO, re, sys, weakref from threading import Thread, Event from PyQt5.Qt import ( QMenu, QAction, QActionGroup, QIcon, Qt, pyqtSignal, ...
gpl-3.0
sonaht/ansible
lib/ansible/plugins/connection/iocage.py
44
2394
# based on jail.py (c) 2013, Michael Scherer <misc@zarb.org> # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # (c) 2016, Stephan Lohse <dev-github@ploek.org> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU Ge...
gpl-3.0
Leoniela/nipype
nipype/interfaces/freesurfer/tests/test_auto_ApplyVolTransform.py
9
2611
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.freesurfer.preprocess import ApplyVolTransform def test_ApplyVolTransform_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), fs_ta...
bsd-3-clause
youprofit/NewsBlur
apps/analyzer/tfidf.py
17
1878
#!/usr/bin/env python """ The simplest TF-IDF library imaginable. Add your documents as two-element lists `[docname, [list_of_words_in_the_document]]` with `addDocument(docname, list_of_words)`. Get a list of all the `[docname, similarity_score]` pairs relative to a document by calling `similarities([list_of_words])`....
mit
pwittrock/apiserver-builder
vendor/github.com/ugorji/go/codec/test.py
1516
4019
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
apache-2.0
maxadamski/swift-corelibs-foundation
lib/product.py
5
7497
# This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of ...
apache-2.0
NathanW2/QGIS
python/user.py
7
4676
# -*- coding: utf-8 -*- """ *************************************************************************** user.py --------------------- Date : January 2015 Copyright : (C) 2015 by Nathan Woodrow Email : woodrow dot nathan at gmail dot com ********************...
gpl-2.0
NeCTAR-RC/nova
nova/api/openstack/compute/legacy_v2/ips.py
78
1929
# Copyright 2011 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
J861449197/edx-platform
common/lib/xmodule/xmodule/modulestore/tests/test_mongo_call_count.py
91
7866
""" Tests to verify correct number of MongoDB calls during course import/export and traversal when using the Split modulestore. """ from tempfile import mkdtemp from shutil import rmtree from unittest import TestCase, skip import ddt from xmodule.modulestore.xml_importer import import_course_from_xml from xmodule.mod...
agpl-3.0
minlexx/pyevemon
esi_client/models/get_universe_moons_moon_id_internal_server_error.py
1
3107
# coding: utf-8 """ EVE Swagger Interface An OpenAPI for EVE Online OpenAPI spec version: 0.4.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class GetUniverseMoonsMoonIdInternalServerError(object): """...
gpl-3.0
knnniggett/weewx
bin/weewx/test/test_templates.py
6
5670
# -*- coding: utf-8 -*- # # Copyright (c) 2009-2015 Tom Keffer <tkeffer@gmail.com> # # See the file LICENSE.txt for your full rights. # """Test tag notation for template generation.""" from __future__ import with_statement import os.path import shutil import sys import syslog import unittest import configobj os...
gpl-3.0
becm/meson
run_project_tests.py
1
52296
#!/usr/bin/env python3 # Copyright 2012-2019 The Meson development team # 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...
apache-2.0