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
pfilsx/calamares
src/modules/displaymanager/main.py
2
25040
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # === This file is part of Calamares - <http://github.com/calamares> === # # Copyright 2014-2017, Philip Müller <philm@manjaro.org> # Copyright 2014-2015, Teo Mrnjavac <teo@kde.org> # Copyright 2014, Kevin Kofler <kevin.kofler@chello.at> # Copyright 2017, Alf Gai...
gpl-3.0
milinbhakta/flaskjinja
flask1/Lib/site-packages/flask/testsuite/reqctx.py
557
5960
# -*- coding: utf-8 -*- """ flask.testsuite.reqctx ~~~~~~~~~~~~~~~~~~~~~~ Tests the request context. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest try: from greenlet import greenlet except ImportError: greenlet = None...
gpl-2.0
tysonclugg/django
tests/validation/test_picklable.py
576
2010
import pickle from unittest import TestCase from django.core.exceptions import ValidationError class PickableValidationErrorTestCase(TestCase): def test_validationerror_is_picklable(self): original = ValidationError('a', code='something') unpickled = pickle.loads(pickle.dumps(original)) ...
bsd-3-clause
ric2b/Vivaldi-browser
chromium/testing/scripts/run_devtools_check.py
10
2038
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs a python script under an isolate This script attempts to emulate the contract of gtest-style tests invoked via recipes. The ma...
bsd-3-clause
yephper/django
tests/generic_relations_regress/tests.py
1
23296
<<<<<<< HEAD from django.db.models import Q, Sum from django.db.models.deletion import ProtectedError from django.db.utils import IntegrityError from django.forms.models import modelform_factory from django.test import TestCase, skipIfDBFeature from .models import ( A, B, C, D, Address, Board, CharLink, Com...
bsd-3-clause
horance-liu/tensorflow
tensorflow/python/estimator/run_config.py
6
22046
# 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
blrm/openshift-tools
openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_openshift/src/ansible/oc_label.py
84
1037
# pylint: skip-file # flake8: noqa def main(): ''' ansible oc module for labels ''' module = AnsibleModule( argument_spec=dict( kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'), state=dict(default='present', type='str', choices=[...
apache-2.0
GarrettHoffman/ThinkStats2
code/nsfg2.py
74
2153
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import numpy as np import thinkstats2 def MakeFrames(): """Reads pregnancy data...
gpl-3.0
JesseLivezey/plankton
pylearn2/optimization/minres.py
42
15929
""" Note: this code is inspired from the following matlab source : http://www.stanford.edu/group/SOL/software/minres.html """ import theano import theano.tensor as TT from theano.sandbox.scan import scan import numpy from pylearn2.utils import constantX from pylearn2.expr.basic import multiple_switch, symGivens2, ...
bsd-3-clause
hastexo/edx-platform
common/lib/xmodule/xmodule/modulestore/tests/test_asides.py
4
2085
""" Tests for Asides """ from web_fragments.fragment import Fragment from xblock.core import XBlockAside from xblock.fields import Scope, String from unittest import TestCase from xmodule.modulestore.tests.utils import XmlModulestoreBuilder from mock import patch class AsideTestType(XBlockAside): """ Test Asi...
agpl-3.0
s142857/servo
tests/wpt/harness/wptrunner/browsers/webdriver.py
194
4219
# 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 errno import socket import time import traceback import urlparse import mozprocess from .base import get_free_p...
mpl-2.0
josenavas/QiiTa
qiita_pet/handlers/api_proxy/util.py
5
2194
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
bsd-3-clause
CredoReference/edx-platform
common/test/acceptance/tests/lms/test_lms_courseware.py
9
42019
# -*- coding: utf-8 -*- """ End-to-end tests for the LMS. """ import json from datetime import datetime, timedelta import ddt from nose.plugins.attrib import attr from ...fixtures.course import CourseFixture, XBlockFixtureDesc from ...pages.common.auto_auth import AutoAuthPage from ...pages.common.logout import Logo...
agpl-3.0
JimCircadian/ansible
lib/ansible/modules/net_tools/cloudflare_dns.py
22
24678
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016 Michael Gruener <michael.gruener@chaosmoon.net> # 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_versio...
gpl-3.0
MSMBA/msmba-workflow-winter2016
msmba-workflow-winter2016-team5/src/healthcare/PhysicianAsstApplication.py
10
1133
# This code is part of the MWP System # Copyright (c) 2012 Benjamin Lubin (blubin@bu.com) # Published under and subject to the GPLv2 license available at http://www.gnu.org/licenses/gpl-2.0.html ''' Created on Dec 18, 2012 @author: blubin ''' from frontend.roleApplication import RoleApplication; from front...
gpl-2.0
takeshineshiro/nova
nova/api/openstack/compute/hide_server_addresses.py
36
2997
# 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
edgarli/proj8
env/lib/python3.4/site-packages/simplejson/tests/test_for_json.py
143
2767
import unittest import simplejson as json class ForJson(object): def for_json(self): return {'for_json': 1} class NestedForJson(object): def for_json(self): return {'nested': ForJson()} class ForJsonList(object): def for_json(self): return ['list'] class DictForJson(dict): ...
artistic-2.0
zerotired/kotori
kotori/daq/decoder/__init__.py
1
1246
# -*- coding: utf-8 -*- # (c) 2019-2020 Andreas Motl <andreas@getkotori.org> from kotori.daq.decoder.airrohr import AirrohrDecoder from kotori.daq.decoder.tasmota import TasmotaSensorDecoder, TasmotaStateDecoder from kotori.daq.decoder.schema import MessageType class DecoderInfo: def __init__(self): self...
agpl-3.0
apache/incubator-allura
ForgeDiscussion/forgediscussion/tasks.py
3
1544
# 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 (t...
apache-2.0
yencarnacion/jaikuengine
.google_appengine/lib/django-1.4/tests/modeltests/custom_columns/models.py
34
1244
""" 17. Custom column/table names If your database column name is different than your model attribute, use the ``db_column`` parameter. Note that you'll use the field's name, not its column name, in API usage. If your database table name is different than your model name, use the ``db_table`` Meta attribute. This has...
apache-2.0
sadaf2605/django
tests/gis_tests/gdal_tests/test_ds.py
44
11126
import os import unittest from unittest import skipUnless from django.contrib.gis.gdal import HAS_GDAL from ..test_data import TEST_DATA, TestDS, get_ds_file if HAS_GDAL: from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, GDALException, OGRIndexError, GDAL_VERSION from django.contrib.gis....
bsd-3-clause
tinyms/ArchiveX
tinyms/core/common.py
1
14690
__author__ = 'tinyms' #coding=UTF8 import os import sys import re import codecs import hashlib import json #import urllib.request #import urllib.parse import time import datetime import decimal import uuid from imp import find_module, load_module, acquire_lock, release_lock from tornado.template import Template # impor...
bsd-3-clause
AlecAivazis/nautilus
nautilus/auth/primitives/passwordHash.py
2
2685
# from: http://variable-scope.com/posts/storing-and-verifying-passwords-with-sqlalchemy import bcrypt class PasswordHash: """ This is a wrapper class over password hashes that abstracts equality """ def __init__(self, hash_, rounds=None): # make sure the hash is valid if len(hash_) != 60: ...
mit
theguardian/vanilla2tender
cherrypy/lib/jsontools.py
39
3666
import sys import cherrypy from cherrypy._cpcompat import basestring, ntou, json, json_encode, json_decode def json_processor(entity): """Read application/json data into request.json.""" if not entity.headers.get(ntou("Content-Length"), ntou("")): raise cherrypy.HTTPError(411) body = entity.fp.rea...
gpl-2.0
tarasane/h2o-3
h2o-py/tests/testdir_munging/pyunit_countmatches.py
4
1388
import sys sys.path.insert(1, "../../") import h2o, tests def countmatches_check(): # Connect to a pre-existing cluster frame = h2o.import_file(path=h2o.locate("smalldata/iris/iris.csv")) # single column (frame) result = frame["C5"].countmatches("o") assert result.nrow == 150 and result.ncol == 1...
apache-2.0
KurtDeGreeff/infernal-twin
build/pip/build/lib.linux-i686-2.7/pip/_vendor/colorama/ansitowin32.py
442
9262
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import re import sys import os from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style from .winterm import WinTerm, WinColor, WinStyle from .win32 import windll winterm = None if windll is not None: winterm = WinTerm() def is_a_tty(stre...
gpl-3.0
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_subscription_commands.py
3
4818
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
epaglier/Project-JARVIS
mycroft-core/mycroft/client/speech/hotword_factory.py
1
5746
# Copyright 2017 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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...
gpl-3.0
benranco/SNPpipeline
tools/vcflib/googletest/googletest/test/gtest_break_on_failure_unittest.py
2140
7339
#!/usr/bin/env python # # Copyright 2006, 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
flotre/Sick-Beard
lib/requests/compat.py
49
2471
# -*- coding: utf-8 -*- """ pythoncompat """ import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and _ver[1] == 0) #: Python 3.1.x is_py31 = (is_py3 and _ver[1] == 1) #:...
gpl-3.0
aclifton/cpeg853-gem5
tests/configs/pc-simple-timing.py
52
2346
# Copyright (c) 2012 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 ...
bsd-3-clause
beetbox/beets
beetsplug/replaygain.py
1
49627
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Fabrice Laporte, Yevgeny Bezman, and Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restrict...
mit
abantam/pmtud
nsc/scons-local-1.2.0.d20090223/SCons/Scanner/D.py
19
2560
"""SCons.Scanner.D Scanner for the Digital Mars "D" programming language. Coded by Andy Friesen 17 Nov 2003 """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associat...
gpl-2.0
renyi533/tensorflow
tensorflow/python/data/kernel_tests/from_sparse_tensor_slices_test.py
8
4186
# 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
Kongsea/tensorflow
tensorflow/contrib/fused_conv/python/ops/fused_conv2d_bias_activation_op.py
35
4876
# 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 applicab...
apache-2.0
perfidia/regexpgen
tests/Date.py
1
10848
''' Created on Mar 16, 2012 @author: Bartosz Alchimowicz ''' import unittest import regexpgen import re class Test(unittest.TestCase): def testDefault(self): regexp = regexpgen.date("%Y") self.assertTrue(re.match(regexp, "1990")) self.assertTrue(re.match(regexp, "2099")) self.assertTrue(re.match(regexp, "1...
mit
YantaiGao/learn_Python_The-Hard-Way
No38_ListOp.py
1
1059
# -*- coding:utf-8 -*- #注意类的声明方法: class Thing(object): #self是需要有的 否则报错 def test(self,hi): print hi a = Thing()#这是声明类的一个对象 a.test("hahaha") print "---------------------------------" test_things = "Apple Orange Crows Telephone Light Suger" print "There is not 10 things in that list,let's fix it." stuff = test_t...
gpl-3.0
jr-garcia/Engendro3D
e3d/model_management/interpolation.py
1
1562
# import numpy # from cycgkit.cgtypes import vec3, quat def getClosest(keys, time, chrid, sortedKeys): def getfrom(keys1, time, ch): try: if ch == 'p': return keys1[time].position elif ch == 's': return keys1[time].scale else: ...
mit
NetApp/manila
manila/tests/share/drivers/emc/plugins/vnx/test_object_manager.py
1
125573
# Copyright (c) 2015 EMC Corporation. # 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
Agiliza/AgilizaFramework
tests/agiliza/core/utils/patterns/test_singleton.py
1
1894
""" This file is part of Agiliza. Agiliza 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. Agiliza is distributed in the hope that it will b...
gpl-3.0
Giftingnation/GN-Oscar-Custom
oscar/profiling/middleware.py
6
3427
import sys import tempfile import hotshot import hotshot.stats from cStringIO import StringIO import cProfile import pstats def profile_this(fn): def profiled_fn(*args, **kwargs): filepath = "/tmp/%s.profile" % fn.__name__ prof = cProfile.Profile() ret = prof.runcall(fn, *args, **kwargs) ...
bsd-3-clause
adamjmcgrath/glancydesign
src/django-nonrel/django/contrib/gis/maps/google/zoom.py
327
6628
from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point from django.contrib.gis.maps.google.gmap import GoogleMapException from math import pi, sin, cos, log, exp, atan # Constants used for degree to radian conversion, and vice-versa. DTOR = pi / 180. RTOD = 180. / pi class GoogleZoom(object): ...
bsd-3-clause
varunarya10/python-novaclient
novaclient/tests/v1_1/test_quota_classes.py
5
1413
# 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
dhalleine/tensorflow
tensorflow/contrib/learn/python/learn/experiment.py
1
6100
# Copyright 2016 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 o...
apache-2.0
chinesebear/NB-IOT
rtt2.1/bsp/smartloong/rtconfig.py
3
1461
import os # CPU options ARCH='mips' CPU ='loongson_1c' # toolchains options CROSS_TOOL = 'gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = r'D:\mgc\embedded\codebench\bin' else: print '================ERROR===========================' ...
mit
kalvdans/scipy
scipy/special/__init__.py
3
27099
""" ======================================== Special functions (:mod:`scipy.special`) ======================================== .. module:: scipy.special Nearly all of the functions below are universal functions and follow broadcasting and automatic array-looping rules. Exceptions are noted. .. seealso:: `scipy.s...
bsd-3-clause
vivekmishra1991/scikit-learn
sklearn/linear_model/randomized_l1.py
68
23405
""" Randomized Lasso/Logistic: feature selection based on Lasso and sparse Logistic Regression """ # Author: Gael Varoquaux, Alexandre Gramfort # # License: BSD 3 clause import itertools from abc import ABCMeta, abstractmethod import warnings import numpy as np from scipy.sparse import issparse from scipy import spar...
bsd-3-clause
angelapper/edx-platform
cms/djangoapps/contentstore/views/preview.py
6
12359
from __future__ import absolute_import import logging from functools import partial from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import Http404, HttpResponseBadRequest from django.utils.translation import ugett...
agpl-3.0
osuripple/pep.py
constants/packetIDs.py
1
2252
"""Contain server and client packet IDs""" client_changeAction = 0 client_sendPublicMessage = 1 client_logout = 2 client_requestStatusUpdate = 3 server_userID = 5 server_sendMessage = 7 server_userStats = 11 server_userLogout = 12 server_spectatorJoined = 13 server_spectatorLeft = 14 server_spectateFrames = 15 client_s...
agpl-3.0
nkfly/vm-hw1
QMP/qmp.py
13
2083
# QEMU Monitor Protocol Python class # # Copyright (C) 2009 Red Hat Inc. # # Authors: # Luiz Capitulino <lcapitulino@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. import socket, json class QMPError(Exception): pass class QMP...
gpl-2.0
faroit/loudness
python/tests/test_OME.py
1
2084
import numpy as np import matplotlib.pyplot as plt import loudness as ln def plotResponse(freqPoints, dataPoints, freqsInterp, responseInterp, ylim=(-40, 10), title = ""): if np.any(dataPoints): plt.semilogx(freqPoints, dataPoints, 'o') plt.semilogx(freqsInterp, resp...
gpl-3.0
SteveXiSong/ECE757-SnoopingPredictions
src/mem/slicc/ast/MethodCallExprAST.py
32
8372
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
ThinkOpen-Solutions/odoo
addons/survey/wizard/__init__.py
385
1026
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
nelsonsar/ansible
lib/ansible/module_utils/splitter.py
372
8425
# (c) 2014 James Cammarata, <jcammarata@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
moto-timo/ironpython3
Src/StdLib/Lib/_dummy_thread.py
106
4872
"""Drop-in replacement for the thread module. Meant to be used as a brain-dead substitute so that threaded code does not need to be rewritten for when the thread module is not present. Suggested usage is:: try: import _thread except ImportError: import _dummy_thread as _thread """ # Exports ...
apache-2.0
amit0701/rally
rally/plugins/openstack/scenarios/ceilometer/events.py
14
2958
# 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 agreed to in...
apache-2.0
yestech/gae-django-template
djangoappengine/management/commands/runserver.py
6
6549
from optparse import make_option import logging import sys from django.db import connections from ...boot import PROJECT_DIR from ...db.base import DatabaseWrapper, get_datastore_paths from django.core.management.base import BaseCommand from django.core.management.commands.runserver import BaseRunserverCommand from dj...
bsd-3-clause
TRESCLOUD/odoo
openerp/report/render/rml2pdf/utils.py
48
7022
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2003, Fabien Pinckaers, UCL, FSA # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesse...
agpl-3.0
lukeiwanski/tensorflow
tensorflow/contrib/copy_graph/__init__.py
55
1187
# 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
amenonsen/ansible
lib/ansible/modules/cloud/misc/xenserver_facts.py
52
5155
#!/usr/bin/python # # Copyright: Ansible Project # 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', 'status': ['preview'],...
gpl-3.0
sanyaade-iot/Arduino-1
arduino-core/src/processing/app/i18n/python/requests/packages/charade/mbcssm.py
168
17866
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
lgpl-2.1
benjaminpope/whisky
Seeing/ex_atmosphere.py
2
4261
# ---------------------------------------------------- ex_atmosphere.py ---------------------------------------------- # Author: Alexey Latyshev -------------------------------------------------------------------------------------------- # ------------------- This file contains an example of atmospheric seeing modellin...
gpl-3.0
Boussadia/SimpleScraper
scraper.py
1
6078
#!/usr/bin/python # -*- coding: utf-8 -*- import time import logging import sys import urllib import mechanize import cookielib import urlparse class Singleton(object): _instances = {} def __new__(class_, *args, **kwargs): if class_ not in class_._instances: class_._instances[class_] = super(Singleto...
mit
abhikumar22/MYBLOG
blg/Lib/site-packages/django-1.11.7-py3.6.egg/django/middleware/http.py
64
1670
from django.utils.cache import ( cc_delim_re, get_conditional_response, set_response_etag, ) from django.utils.deprecation import MiddlewareMixin from django.utils.http import parse_http_date_safe class ConditionalGetMiddleware(MiddlewareMixin): """ Handles conditional GET operations. If the response has ...
gpl-3.0
lifenggg/assaydata
get_NDCG_test.py
1
4798
import math import numpy from os import path def get_ndcg(test_path, pred_path): test_rank = [] pred_rank = [] # all the return value ndcg10 = 0 ndcg5 = 0 ndcgall = 0 if path.isfile(pred_path) == False: return [0, 0, 0, 0] with open(test_path) as fp: for line in f...
gpl-2.0
michalliu/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/test/test_threaded_import.py
136
2578
# This is a variant of the very old (early 90's) file # Demo/threads/bug.py. It simply provokes a number of threads into # trying to import the same module "at the same time". # There are no pleasant failure modes -- most likely is that Python # complains several times about module random having no attribute # randran...
gpl-2.0
awemulya/fieldsight-kobocat
onadata/apps/fsforms/models.py
1
37515
from __future__ import unicode_literals import datetime import os import json import re from django.contrib.auth.models import User from django.contrib.contenttypes.fields import GenericRelation from django.contrib.postgres.fields import ArrayField from django.core.exceptions import ValidationError from django.core.ur...
bsd-2-clause
marcel-dancak/QGIS
python/plugins/processing/tests/ToolsTest.py
11
3325
# -*- coding: utf-8 -*- """ *************************************************************************** ToolsTest --------------------- Date : July 2016 Copyright : (C) 2016 by Nyall Dawson Email : nyall dot dawson at gmail dot com *************************...
gpl-2.0
nazo/ansible
lib/ansible/modules/commands/raw.py
56
3569
# this is a virtual module that is entirely implemented server side # 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 op...
gpl-3.0
arpitn30/open-event-orga-server
app/views/public/explore.py
7
5070
import json import requests from flask import Blueprint from flask import render_template from flask import request, redirect, url_for, jsonify from flask.ext.restplus import abort from flask_restplus import marshal from requests import ConnectionError from app.api.events import EVENT, EVENT_PAGINATED from app.api.he...
gpl-3.0
ASOdesk/selenium-pytest-fix
py/test/selenium/webdriver/common/click_scrolling_tests.py
9
7393
# 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
tykling/django-swingtime
swingtime/conf/swingtime_settings.py
3
1436
import datetime # A "strftime" string for formatting start and end time selectors in forms TIMESLOT_TIME_FORMAT = '%I:%M %p' # Used for creating start and end time form selectors as well as time slot grids. # Value should be datetime.timedelta value representing the incremental # differences between temporal options...
mit
mahak/neutron
neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py
2
57873
# # 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
hujiajie/chromium-crosswalk
tools/perf/page_sets/startup_pages.py
18
2069
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import shared_page_state from telemetry import story class BrowserStartupSharedState(shar...
bsd-3-clause
antworteffekt/EDeN
graphprot/prepare_graphprot_seqs.py
1
10394
#!/usr/bin/env python # draft implementation # * TODO: # * centering should be optional # * viewpoint should be optional # * check for nonunique ids and warn # * check for bedtools version # * write bed files for sequence coordinates # * set rnd init for shuffling to have reproducible results # * use my ...
mit
fnp/pylucene
samples/LuceneInAction/lia/analysis/stopanalyzer/StopAnalyzer2.py
2
1203
# ==================================================================== # 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 re...
apache-2.0
wshallum/ansible
lib/ansible/modules/windows/win_file.py
25
2790
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # # 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, eith...
gpl-3.0
vnaydionov/card-proxy
tests/secvault_tests.py
1
3752
# -*- coding: utf-8 -*- import os import sys import unittest import datetime as dt from utils import generate_random_string, generate_random_number from secvault_api import SecureVaultApi import logger log = logger.get_logger('/tmp/secvault_tests-%s.log' % os.environ['USER']) SERVER_URI = 'http://localhost:17113/' ...
mit
rwightman/tensorflow-litterbox
litterbox/models/sdc/model_sdc.py
1
8350
# Copyright (C) 2016 Ross Wightman. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # =================================...
apache-2.0
chrismeyersfsu/ansible
lib/ansible/modules/network/panos/panos_commit.py
32
3639
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
jcsp/manila
manila/api/v1/share_types.py
2
4036
# Copyright (c) 2014 NetApp, 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 writing,...
apache-2.0
gitprouser/appengine-bottle-skeleton
lib/cryptography/hazmat/primitives/ciphers/modes.py
37
5517
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import six from cryptography import utils @six.add_metacla...
apache-2.0
carmark/vbox
src/libs/libxml2-2.6.31/python/setup.py
19
6680
#!/usr/bin/python -u # # Setup script for libxml2 and libxslt if found # import sys, os from distutils.core import setup, Extension # Below ROOT, we expect to find include, include/libxml2, lib and bin. # On *nix, it is not needed (but should not harm), # on Windows, it is set by configure.js. ROOT = r'/usr' # Thre...
gpl-2.0
OpusVL/odoo
addons/hw_proxy/__openerp__.py
8
1608
# -*- 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
proxysh/Safejumper-for-Desktop
buildlinux/env64/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py
2965
12784
######################## 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-2.0
bittner/django-allauth
allauth/socialaccount/providers/xing/tests.py
7
1942
# -*- coding: utf-8 -*- from __future__ import unicode_literals from allauth.socialaccount.tests import OAuthTestsMixin from allauth.tests import MockedResponse, TestCase from .provider import XingProvider class XingTests(OAuthTestsMixin, TestCase): provider_id = XingProvider.id def get_mocked_response(sel...
mit
apanju/GMIO_Odoo
addons/stock_dropshipping/stock_dropshipping.py
160
2228
# coding: utf-8 from openerp import models, api, _ from openerp.exceptions import Warning class sale_order_line(models.Model): _inherit = 'sale.order.line' @api.multi def _check_routing(self, product, warehouse): """ skip stock verification if the route goes from supplier to customer ...
agpl-3.0
franbull/didthattoday
didthattoday/didthattoday/tests/test_step_views.py
1
2921
import simplejson from base import IntegrationTestBase from didthattoday.models import Step from didthattoday.models import Habit class TestStepViews(IntegrationTestBase): def create_habit(self): assert(self.session.query(Habit).count() == 0) habit = {'name': 'woo', 'description': 'hoo'} r...
apache-2.0
smallyear/linuxLearn
salt/salt/states/npm.py
3
9384
# -*- coding: utf-8 -*- ''' Installation of NPM Packages ============================ These states manage the installed packages for node.js using the Node Package Manager (npm). Note that npm must be installed for these states to be available, so npm states should include a requisite to a pkg.installed state for the ...
apache-2.0
Flexget/Flexget
flexget/plugins/filter/content_filter.py
3
4772
from fnmatch import fnmatch from loguru import logger from flexget import plugin from flexget.config_schema import one_or_more from flexget.event import event logger = logger.bind(name='content_filter') class FilterContentFilter: """ Rejects entries based on the filenames in the content. Torrent files only...
mit
wcmitchell/insights-core
insights/combiners/tests/test_virt_who_conf.py
1
4088
from insights.combiners.virt_who_conf import AllVirtWhoConf from insights.parsers.virt_who_conf import VirtWhoConf from insights.parsers.sysconfig import VirtWhoSysconfig from insights.tests import context_wrap VWHO_D_CONF_ESX = """ ## This is a template for virt-who configuration files. Please see ## virt-who-config(...
apache-2.0
EnerNOC/smallfoot-sleekxmpp
sleekxmpp/xmlstream/handler/callback.py
2
2874
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz This file is part of SleekXMPP. See the file LICENSE for copying permission. """ from sleekxmpp.xmlstream.handler.base import BaseHandler class Callback(BaseHandler): """ The Callback handler will execute a callbac...
mit
grevutiu-gabriel/sympy
sympy/core/tests/test_diff.py
115
2793
from sympy import Symbol, Rational, cos, sin, tan, cot, exp, log, Function, \ Derivative, Expr, symbols, pi, I, S from sympy.utilities.pytest import raises def test_diff(): x, y = symbols('x, y') assert Rational(1, 3).diff(x) is S.Zero assert I.diff(x) is S.Zero assert pi.diff(x) is S.Zero ass...
bsd-3-clause
shsingh/ansible
lib/ansible/modules/network/nxos/nxos_pim.py
18
6260
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
dbcls/dbcls-galaxy
tools/metag_tools/short_reads_figure_score.py
2
9229
#! /usr/bin/python """ boxplot: - box: first quartile and third quartile - line inside the box: median - outlier: 1.5 IQR higher than the third quartile or 1.5 IQR lower than the first quartile IQR = third quartile - first quartile - The smallest/largest value that is not an outlier is connected to the box b...
mit
andris210296/andris-projeto
backend/venv/lib/python2.7/site-packages/unidecode/x08f.py
252
4651
data = ( 'Er ', # 0x00 'Qiong ', # 0x01 'Ju ', # 0x02 'Jiao ', # 0x03 'Guang ', # 0x04 'Lu ', # 0x05 'Kai ', # 0x06 'Quan ', # 0x07 'Zhou ', # 0x08 'Zai ', # 0x09 'Zhi ', # 0x0a 'She ', # 0x0b 'Liang ', # 0x0c 'Yu ', # 0x0d 'Shao ', # 0x0e 'You ', # 0x0f 'Huan ', # 0x1...
mit
jrshust/spark
python/setup.py
25
9659
#!/usr/bin/env python # # 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 "Li...
apache-2.0
cbrewster/servo
tests/wpt/web-platform-tests/mixed-content/generic/expect.py
26
4156
import json, os, urllib, urlparse def redirect(url, response): response.add_required_headers = False response.writer.write_status(301) response.writer.write_header("access-control-allow-origin", "*") response.writer.write_header("location", url) response.writer.end_headers() response.writer.wri...
mpl-2.0
hkariti/ansible
lib/ansible/module_utils/network/fortios/fortios.py
89
8000
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
rhelmer/socorro
socorro/external/postgresql/bugs.py
9
2591
# 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/. """Deprecated by socorro/external/postgresql/bugs_service.py""" import logging from socorro.external import MissingArg...
mpl-2.0