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
alec-heif/MIT-Thesis
spark-bin/python/pyspark/profiler.py
77
5678
# # 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...
mit
StuartLittlefair/astropy
astropy/timeseries/periodograms/lombscargle/implementations/fastchi2_impl.py
3
4890
import numpy as np from .utils import trig_sum def lombscargle_fastchi2(t, y, dy, f0, df, Nf, normalization='standard', fit_mean=True, center_data=True, nterms=1, use_fft=True, trig_sum_kwds=None): """Lomb-Scargle Periodogram This implements a fast chi-squa...
bsd-3-clause
smac0628/android_kernel_huawei_angler
tools/perf/scripts/python/event_analyzing_sample.py
4719
7393
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
gpl-2.0
infobloxopen/infoblox-netmri
infoblox_netmri/api/broker/v2_5_0/rev_switch_fwd_neighbor_broker.py
17
40936
from ..broker import Broker class RevSwitchFwdNeighborBroker(Broker): controller = "rev_switch_fwd_neighbors" def show(self, **kwargs): """Shows the details for the specified rev switch fwd neighbor. **Inputs** | ``api version min:`` None | ``api version max:``...
apache-2.0
schettino72/nikola
nikola/plugins/compile/rest/soundcloud.py
9
2015
# -*- coding: utf-8 -*- """SoundCloud directive for reStructuredText.""" from docutils import nodes from docutils.parsers.rst import Directive, directives from nikola.plugin_categories import RestExtension class Plugin(RestExtension): """Plugin for soundclound directive.""" name = "rest_soundcloud" ...
mit
lukas-bednar/pytest
testing/test_genscript.py
194
1689
import pytest import sys @pytest.fixture(scope="module") def standalone(request): return Standalone(request) class Standalone: def __init__(self, request): self.testdir = request.getfuncargvalue("testdir") script = "mypytest" result = self.testdir.runpytest("--genscript=%s" % script) ...
mit
keithroe/vtkoptix
ThirdParty/Twisted/twisted/web/test/_util.py
33
2475
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ General helpers for L{twisted.web} unit tests. """ from twisted.internet.defer import succeed from twisted.web import server from twisted.trial.unittest import TestCase from twisted.python.failure import Failure from twisted.web._flatten imp...
bsd-3-clause
pataquets/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py
126
5449
# 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 ...
bsd-3-clause
johnwallace123/dx-toolkit
src/python/dxpy/utils/genomic_utils.py
3
1240
# Copyright (C) 2013-2016 DNAnexus, Inc. # # This file is part of dx-toolkit (DNAnexus platform client libraries). # # 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.a...
apache-2.0
dimroc/tensorflow-mnist-tutorial
lib/python3.6/site-packages/numpy/lib/nanfunctions.py
25
50595
""" Functions that ignore NaN. Functions --------- - `nanmin` -- minimum non-NaN value - `nanmax` -- maximum non-NaN value - `nanargmin` -- index of minimum non-NaN value - `nanargmax` -- index of maximum non-NaN value - `nansum` -- sum of non-NaN values - `nanprod` -- product of non-NaN values - `nancumsum` -- cumul...
apache-2.0
radicalbit/ambari
ambari-server/src/main/python/ambari_server/dbConfiguration.py
1
22431
#!/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 "License")...
apache-2.0
TeamTwisted/external_chromium_org
third_party/closure_compiler/processor.py
32
3381
# 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. """Process Chrome resources (HTML/CSS/JS) to handle <include> and <if> tags.""" from collections import defaultdict import re import os class LineNumber(o...
bsd-3-clause
bpsinc-native/src_third_party_pywebsocket_src
test/testdata/handlers/abort_by_user_wsh.py
496
1798
# Copyright 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
gmassei/wfrog
wfrender/datasource/accumulator.py
5
12486
## Copyright 2009 Laurent Bovet <laurent.bovet@windmaster.ch> ## Jordi Puigsegur <jordi.puigsegur@gmail.com> ## ## This file is part of wfrog ## ## wfrog is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Softwar...
gpl-3.0
SGenheden/lammps
python/examples/viz_atomeye.py
3
1953
#!/usr/bin/env python -i # preceeding line should have path for Python on your machine # viz_atomeye.py # Purpose: viz running LAMMPS simulation via AtomEye # Syntax: viz_atomeye.py in.lammps Nfreq Nsteps # in.lammps = LAMMPS input script # Nfreq = dump and viz shapshot every this many steps # ...
gpl-2.0
chirilo/mozillians
vendor-local/lib/python/celery/db/models.py
14
2231
# -*- coding: utf-8 -*- from __future__ import absolute_import from datetime import datetime import sqlalchemy as sa from .. import states from .session import ResultModelBase # See docstring of a805d4bd for an explanation for this workaround ;) if sa.__version__.startswith('0.5'): from .dfd042c7 import Pickle...
bsd-3-clause
DannyVim/shadowsocks
shadowsocks/local.py
1015
2248
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012-2015 clowwindy # # 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
BehavioralInsightsTeam/edx-platform
lms/djangoapps/certificates/management/commands/cert_whitelist.py
12
3674
""" Management command which sets or gets the certificate whitelist for a given user/course """ from __future__ import print_function from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError from opaque_keys.edx.keys import CourseKey from lms.djangoapps.certificate...
agpl-3.0
antgonza/qiime
scripts/validate_mapping_file.py
15
8042
#!/usr/bin/env python from __future__ import division __author__ = "William Walters" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["William Walters"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "William Walters" __email__ = "William.A.Walters@colorado.edu" from string import le...
gpl-2.0
yelongyu/chihu
venv/lib/python2.7/site-packages/sqlalchemy/orm/base.py
35
14668
# orm/base.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Constants and rudimental functions used throughout the ORM. """ from .. import util...
gpl-3.0
azureplus/chromium_depot_tools
third_party/boto/roboto/awsqueryrequest.py
70
18654
# Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # # 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 # withou...
bsd-3-clause
openmicroscopy/openmicroscopy
examples/Training/python/Task_Scripts/Raw_Data2.py
3
3011
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 University of Dundee & Open Microscopy Environment. # All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # """ FOR TRAINING PURPOSES ONLY! """ # This is a 'bare-bones' template to allow easy conversion...
gpl-2.0
vmlinz/python_koans
python2/koans/about_attribute_access.py
88
7140
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Partially based on AboutMessagePassing in the Ruby Koans # from runner.koan import * class AboutAttributeAccess(Koan): class TypicalObject(object): pass def test_calling_undefined_functions_normally_results_in_errors(self): typical = self.T...
mit
lowiki-org/localwiki-backend-server
localwiki/maps/migrations/0002_auto__add_field_mapdata_hist_region__add_field_mapdata_region.py
3
9163
# -*- 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 field 'MapData_hist.region' db.add_column('maps_mapdata_hist', 'region', self...
gpl-2.0
ruslanloman/nova
nova/tests/unit/api/openstack/compute/contrib/test_tenant_networks.py
18
12160
# Copyright 2014 IBM Corp. # # 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
Diti24/python-ivi
ivi/tektronix/tektronixMDOAFG.py
1
23718
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2016 Alex Forencich 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 righ...
mit
bamboohill/PixyFMU
Tools/mavproxy_modules/magcal_graph.py
108
3748
# Copyright (C) 2016 Intel Corporation. All rights reserved. # # This file 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. # # This fi...
gpl-3.0
tinkhaven-organization/odoo
openerp/addons/base/__openerp__.py
336
3703
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
cyanna/edx-platform
lms/djangoapps/course_wiki/editors.py
101
2244
from django import forms from django.forms.util import flatatt from django.utils.encoding import force_unicode from django.utils.html import conditional_escape from django.utils.safestring import mark_safe from django.template.loader import render_to_string from wiki.editors.base import BaseEditor from wiki.editors.m...
agpl-3.0
antoviaque/edx-platform
lms/djangoapps/certificates/management/commands/ungenerated_certs.py
73
7484
""" Management command to find all students that need certificates for courses that have finished, and put their cert requests on the queue. """ import logging import datetime from pytz import UTC from django.core.management.base import BaseCommand, CommandError from certificates.models import certificate_status_for_st...
agpl-3.0
beernarrd/gramps
gramps/gui/selectors/selectplace.py
1
2669
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2003-2006 Donald N. Allingham # Copyright (C) 2009-2010 Gary Burton # Copyright (C) 2010 Nick Hall # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by #...
gpl-2.0
MechCoder/scikit-learn
examples/neighbors/plot_kde_1d.py
60
5120
""" =================================== Simple 1D Kernel Density Estimation =================================== This example uses the :class:`sklearn.neighbors.KernelDensity` class to demonstrate the principles of Kernel Density Estimation in one dimension. The first plot shows one of the problems with using histogram...
bsd-3-clause
rajiteh/taiga-back
taiga/base/api/settings.py
15
6956
# Copyright (C) 2015 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2015 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2015 David Barragán <bameda@dbarragan.com> # 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 F...
agpl-3.0
txm/make-good
django/contrib/admin/sites.py
80
17398
import re from django import http, template from django.contrib.admin import ModelAdmin, actions from django.contrib.admin.forms import AdminAuthenticationForm from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.contenttypes import views as contenttype_views from django.views.decorators.csrf import ...
bsd-3-clause
Rositsazz/hack33
hack33/contrib/sites/migrations/0001_initial.py
378
1134
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.contrib.sites.models from django.contrib.sites.models import _simple_domain_name_validator from django.db import migrations, models class Migration(migrations.Migration): dependencies = [] operations = [ migrations.Create...
mit
z1gm4/desarrollo_web_udp
env/lib/python2.7/site-packages/faker/providers/person/de_DE/__init__.py
3
30301
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as PersonProvider class Provider(PersonProvider): formats = ( '{{first_name_male}} {{last_name}}', '{{first_name_male}} {{last_name}}', '{{first_name_male}} {{last_name}}', '{{first_name_male}} {{last_n...
gpl-3.0
virgilio/timtec
forum/admin.py
7
1027
# -*- coding: utf-8 -*- from django.contrib import admin from django.forms import TextInput, Textarea from django.db import models from suit.admin import SortableTabularInline from models import Question, Answer, AnswerVote, QuestionVote class ModelAdmin(admin.ModelAdmin): formfield_overrides = { models...
agpl-3.0
archtool/archtool
src/gui/styles.py
1
12145
''' Created on Feb 15, 2014 @author: EHWAAL Copyright (C) 2014 Evert van de Waal This program is released under the conditions of the GNU General Public License. ''' # FIXME: Font names containing spaces are not handled properly. # TODO: Allow style export & import. Use that to initialise the database i...
gpl-3.0
malelew/UCLA_Dining_Web_App
ENV/lib/python2.7/site-packages/pip/_vendor/lockfile/symlinklockfile.py
487
2613
from __future__ import absolute_import import time import os from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class SymlinkLockFile(LockBase): """Lock access to a file using symlink(2).""" def __init__(self, path, threaded=True, timeout=None): # s...
mit
minhtuancn/odoo
addons/account/account_cash_statement.py
283
15868
# encoding: utf-8 ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # i...
agpl-3.0
vrutkovs/gnome-news
gnomenews/post.py
2
3366
# Copyright (C) 2015 Felipe Borges <felipeborges@gnome.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This p...
gpl-3.0
rohitsm/spsoldboys
main.py
1
4255
"""`main` is the top level module for your Flask application.""" __author__ = 'rohitsm' __page__ = 'https://github.com/rohitsm/spsoldboys' # Python import urllib2 import json import sys import cgi # Flask from flask import Flask from flask import request, redirect, url_for from flask import render_template # App En...
mit
jbreitbart/fast-lib
vendor/mosquitto-1.3.5/test/lib/01-con-discon-success.py
19
1806
#!/usr/bin/env python # Test whether a client produces a correct connect and subsequent disconnect. # The client should connect to port 1888 with keepalive=60, clean session set, # and client id 01-con-discon-success # The test will send a CONNACK message to the client with rc=0. Upon receiving # the CONNACK and veri...
lgpl-3.0
tlepoint/NFLlib
doc/conf.py
2
9266
# -*- coding: utf-8 -*- # # nfllib documentation build configuration file, created by # sphinx-quickstart on Thu Mar 19 09:32:40 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
gpl-3.0
Fale/ansible
test/lib/ansible_test/_internal/cloud/opennebula.py
49
1908
"""OpenNebula plugin for integration tests.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type from . import ( CloudProvider, CloudEnvironment, CloudEnvironmentConfig, ) from ..util import ( display, ConfigParser, ) class OpenNebulaCloudProvider(CloudProvi...
gpl-3.0
arnif/CouchPotatoServer
couchpotato/core/notifications/notifymyandroid/__init__.py
7
1281
from .main import NotifyMyAndroid def start(): return NotifyMyAndroid() config = [{ 'name': 'notifymyandroid', 'groups': [ { 'tab': 'notifications', 'name': 'notifymyandroid', 'label': 'Notify My Android', 'options': [ { ...
gpl-3.0
AustinRoy7/Pomodoro-timer
venv/Lib/copyreg.py
165
6833
"""Helper to provide extensibility for pickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. """ __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extension_cache"] dispatch_table = {} def pickle(ob_typ...
mit
WayneKoorts/TornChat
Server/RequestHandlers/ChatWebSocketHandler.py
1
4249
import tornado.websocket from Server.Chat.SimpleTypes import Participant from Server.Tools.Response.Json import * class ChatWebSocketManager(tornado.websocket.WebSocketHandler): """ The main chat socket manager, which handles both server commands from the user as well as chat messages themselves. """ ...
apache-2.0
janko33bd/bitcoin
qa/rpc-tests/signmessages.py
1
1460
#!/usr/bin/env python2 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class SignM...
mit
mvs-org/metaverse
test/test-rpc-v3/TestCase/Asset/test_transfer_multisig_cert.py
3
2659
import time from utils import common from TestCase.MVSTestCase import * class TestTransferMultisigCert(MVSTestCaseBase): def test_0_transfer_multisig_cert(self): # Alice create asset domain_symbol, asset_symbol = Alice.create_random_asset(secondary=-1) Alice.mining() # create mult...
agpl-3.0
landrito/api-client-staging
generated/python/gapic-google-cloud-pubsub-v1/setup.py
7
1614
"""A setup module for the GAPIC Google Cloud Pub/Sub API library. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup, find_packages import sys install_requires = [ 'google-gax>=0.15.7, <0.16dev', 'oauth2client>=2.0.0, <4.0dev',...
bsd-3-clause
waytai/odoo
addons/auth_ldap/__openerp__.py
260
1516
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
annapowellsmith/openpresc
openprescribing/api/views_org_codes.py
1
2823
from rest_framework.decorators import api_view from rest_framework.response import Response import view_utils as utils from django.db.models import Q from frontend.models import PCT, Practice @api_view(['GET']) def org_codes(request, format=None): org_codes = utils.param_to_list(request.query_params.get('q', None)...
mit
FabriceSalvaire/PyDVI
unit_test/test_Encoding.py
1
1812
#################################################################################################### # # PyDvi - A Python Library to Process DVI Stream. # Copyright (C) 2011 Salvaire Fabrice # #################################################################################################### #########################...
gpl-3.0
PaddlePaddle/models
PaddleCV/image_classification/dali.py
1
9463
# Copyright (c) 2019 PaddlePaddle 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 appli...
apache-2.0
cmusv-sc/DIWD-Team4-Wei-Lin-Tsai
src/python/data_2015_fall/api/queryExperts.py
1
1307
from django.http import JsonResponse from data_2015_fall.models import * import simplejson from collections import defaultdict from operator import itemgetter # =================================================== # Classes # =================================================== class Expert(object): def __init__(se...
unlicense
nekulin/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/lib/win32evtlogutil.py
21
6500
"""Event Log Utilities - helper for win32evtlog.pyd """ import win32api, win32con, winerror, win32evtlog, string error = win32api.error # The error the evtlog module raises. langid = win32api.MAKELANGID(win32con.LANG_NEUTRAL, win32con.SUBLANG_NEUTRAL) def AddSourceToRegistry(appName, msgDLL = None, eventLogType = "...
apache-2.0
dgzurita/odoo
addons/purchase/wizard/purchase_line_invoice.py
177
5258
# -*- 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
soumith/fbthrift
thrift/tutorial/py.asyncio/PythonClient.py
13
1842
# @lint-avoid-pyflakes2 # @lint-avoid-python-3-compatibility-imports import asyncio import time from thrift.server.TAsyncioServer import ThriftClientProtocolFactory from tutorial import Calculator from tutorial.ttypes import Work, Operation, InvalidOperation @asyncio.coroutine def main(loop): (transport, proto...
apache-2.0
GISPPU/GrenadaLandInformation
geonode/security/views.py
2
3949
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2012 OpenPlans # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either versio...
gpl-3.0
hoelsner/product-database
app/productdb/models.py
1
40333
import hashlib import re from collections import Counter from datetime import timedelta from django.contrib.auth.models import User from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator, MaxVal...
mit
pershoot/android_kernel_asus_tf701t
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
hastexo/edx-platform
lms/djangoapps/grades/migrations/0013_persistentsubsectiongradeoverride.py
21
1201
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from coursewarehistoryextended.fields import UnsignedBigIntOneToOneField class Migration(migrations.Migration): dependencies = [ ('grades', '0012_computegradessetting'), ] operations = [ ...
agpl-3.0
VaibhavAgarwalVA/sympy
sympy/physics/unitsystems/prefixes.py
91
4190
# -*- coding: utf-8 -*- """ Module defining unit prefixe class and some constants. Constant dict for SI and binary prefixes are defined as PREFIXES and BIN_PREFIXES. """ from sympy import sympify class Prefix(object): """ This class represent prefixes, with their name, symbol and factor. Prefixes are ...
bsd-3-clause
caesar2164/edx-platform
openedx/core/djangoapps/theming/storage.py
23
13341
""" Comprehensive Theming support for Django's collectstatic functionality. See https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/ """ import posixpath import os.path from django.conf import settings from django.utils._os import safe_join from django.contrib.staticfiles.storage import StaticFilesStorage, Ca...
agpl-3.0
withorwithoutgod/tacozmq
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...
mit
google/contentbox
third_party/django/contrib/gis/tests/distapp/tests.py
109
19389
from __future__ import absolute_import from django.db import connection from django.db.models import Q from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.measure import D # alias for Distance from django.contrib.gis.tests.utils import ( HAS_SPATIAL_DB, mysql, oracle, postgis, spatialite, no_oracl...
apache-2.0
benpatterson/edx-platform
common/djangoapps/student/migrations/0003_auto__add_usertestgroup.py
188
8942
# 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 'UserTestGroup' db.create_table('student_usertestgroup', ( ('id', self.gf('django.db.m...
agpl-3.0
drufat/sympy
sympy/functions/special/tests/test_bessel.py
36
22192
from itertools import product from sympy import (jn, yn, symbols, Symbol, sin, cos, pi, S, jn_zeros, besselj, bessely, besseli, besselk, hankel1, hankel2, hn1, hn2, expand_func, sqrt, sinh, cosh, diff, series, gamma, hyper, Abs, I, O, oo, conjugate) from sympy.f...
bsd-3-clause
germn/python-for-android
pythonforandroid/pythonpackage.py
4
30760
""" This module offers highlevel functions to get package metadata like the METADATA file, the name, or a list of dependencies. Usage examples: # Getting package name from pip reference: from pytonforandroid.pythonpackage import get_package_name print(get_package_name("pillow")) # ...
mit
stshine/servo
tests/wpt/web-platform-tests/tools/py/py/_code/_assertionold.py
218
17863
import py import sys, inspect from compiler import parse, ast, pycodegen from py._code.assertion import BuiltinAssertionError, _format_explanation passthroughex = py.builtin._sysex class Failure: def __init__(self, node): self.exc, self.value, self.tb = sys.exc_info() self.node = node class View(...
mpl-2.0
HiSPARC/station-software
user/python/Lib/idlelib/idle_test/test_warning.py
49
2757
'''Test warnings replacement in PyShell.py and run.py. This file could be expanded to include traceback overrides (in same two modules). If so, change name. Revise if output destination changes (http://bugs.python.org/issue18318). Make sure warnings module is left unaltered (http://bugs.python.org/issue18081). ''' im...
gpl-3.0
CausalityLtd/ponyc
lib/gbenchmark/tools/compare.py
7
12626
#!/usr/bin/env python """ compare.py - versatile benchmark output compare tool """ import argparse from argparse import ArgumentParser import sys import gbench from gbench import util, report from gbench.util import * def check_inputs(in1, in2, flags): """ Perform checking on the user provided inputs and di...
bsd-2-clause
taktik/account-financial-tools
__unported__/account_move_batch_validate/__init__.py
46
1541
# -*- coding: utf-8 -*- ############################################################################### # # # Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # ...
agpl-3.0
mjgrav2001/scikit-learn
benchmarks/bench_plot_ward.py
290
1260
""" Benchmark scikit-learn's Ward implement compared to SciPy's """ import time import numpy as np from scipy.cluster import hierarchy import pylab as pl from sklearn.cluster import AgglomerativeClustering ward = AgglomerativeClustering(n_clusters=3, linkage='ward') n_samples = np.logspace(.5, 3, 9) n_features = n...
bsd-3-clause
Jenselme/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_http_header_util.py
496
3372
#!/usr/bin/env python # # Copyright 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...
mpl-2.0
mohamed--abdel-maksoud/chromium.src
third_party/cython/src/Cython/Distutils/build_ext.py
94
12955
"""Cython.Distutils.build_ext Implements a version of the Distutils 'build_ext' command, for building Cython extension modules.""" # This module should be kept compatible with Python 2.3. __revision__ = "$Id:$" import sys import os import re from distutils.core import Command from distutils.errors import DistutilsP...
bsd-3-clause
lvdongr/spark
python/pyspark/find_spark_home.py
34
2766
#!/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
ma314smith/home-assistant
homeassistant/components/media_player/kodi.py
3
11137
""" Support for interfacing with the XBMC/Kodi JSON-RPC API. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.kodi/ """ import logging import urllib import voluptuous as vol from homeassistant.components.media_player import ( SUPPORT_NEX...
mit
valentin-krasontovitsch/ansible
lib/ansible/modules/cloud/scaleway/scaleway_security_group_rule.py
28
7313
#!/usr/bin/python # # Scaleway Security Group Rule management module # # Copyright (C) 2018 Antoine Barbare (antoinebarbare@gmail.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...
gpl-3.0
yamahata/qemu
scripts/tracetool.py
111
3993
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Command-line wrapper for the tracetool machinery. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__...
gpl-2.0
RondaStrauch/landlab
landlab/grid/structured_quad/rectilinear.py
6
4954
#! /usr/bin/env python import numpy as np from .structured import StructuredQuadGrid class RectilinearGrid(StructuredQuadGrid): """ Parameters ---------- coord : tuple Coordinates of node rows and node columns. Examples -------- >>> import numpy as np >>> from landlab.grid.s...
mit
nkgilley/home-assistant
tests/testing_config/custom_components/test/alarm_control_panel.py
18
2966
""" Provide a mock alarm_control_panel platform. Call init before using it in your tests to ensure clean test data. """ from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity from homeassistant.components.alarm_control_panel.const import ( SUPPORT_ALARM_ARM_AWAY, SUPPORT_ALARM_ARM_HOM...
apache-2.0
sugarlabs/sugar
src/jarabe/testrunner.py
5
1607
# Copyright (C) 2013, Daniel Narvaez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-3.0
xiaobozi/boinc
py/Boinc/add_util.py
22
6256
#!/usr/bin/env python # $Id$ # add_util.py - code shared between add and xadd import database, tools import time, pprint import MySQLdb CREATE_TIME = ['?create_time', int(time.time())] TRANSITION_TIME = ['?transition_time', int(time.time())] class XAppVersion(database.AppVersion): def __init__(self,**kwargs): ...
gpl-3.0
bigzz/glibc
localedata/unicode-gen/ctype_compatibility.py
13
23044
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Copyright (C) 2014-2015 Free Software Foundation, Inc. # This file is part of the GNU C Library. # # The GNU C 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 Fo...
gpl-2.0
18F/regulations-parser
tests/commands/annual_editions_tests.py
3
3916
from datetime import date, timedelta import click import pytest from django.utils import timezone from mock import Mock from regparser.commands import annual_editions from regparser.history.versions import Version from regparser.index import dependency, entry from regparser.notice.citation import Citation from regpar...
cc0-1.0
hoosteeno/fjord
smoketests/pages/regions/date_filter.py
7
9651
#!/usr/bin/env python # 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/. from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from ...
bsd-3-clause
jhaux/tensorflow
tensorflow/contrib/cluster_resolver/python/training/__init__.py
8
1143
# 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 applicable ...
apache-2.0
loadimpact/loadimpact-sdk-python
examples/test_runner.py
1
2782
#!/usr/bin/env python # coding=utf-8 """ Copyright 2013 Load Impact 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
direvus/ansible
lib/ansible/plugins/cliconf/nos.py
10
3576
# # (c) 2018 Extreme Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ans...
gpl-3.0
vinicius-alves/InternetBanking
env/lib/python3.4/site-packages/django/core/checks/security/base.py
45
6645
from django.conf import settings from .. import Tags, Warning, register from ..utils import patch_middleware_message SECRET_KEY_MIN_LENGTH = 50 SECRET_KEY_MIN_UNIQUE_CHARACTERS = 5 W001 = Warning( "You do not have 'django.middleware.security.SecurityMiddleware' " "in your MIDDLEWARE so the SECURE_HSTS_SECOND...
gpl-3.0
yongtang/tensorflow
tensorflow/python/debug/lib/debug_events_writer.py
6
6377
# Copyright 2019 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
aherlihy/mongo-python-driver
test/mod_wsgi_test/test_client.py
2
4815
# Copyright 2012-2015 MongoDB, 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 writin...
apache-2.0
alxgu/ansible-modules-core
network/vyos/vyos_config.py
25
8988
#!/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
minhphung171093/GreenERP
openerp/addons/account_analytic_default/account_analytic_default.py
10
6499
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from openerp.osv import fields, osv from openerp import api class account_analytic_default(osv.osv): _name = "account.analytic.default" _description = "Analytic Distribution" _rec_name = "analyt...
gpl-3.0
gautamMalu/rootfs_xen_arndale
usr/lib/python2.7/Cookie.py
1
26311
#### # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> # # 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 bot...
gpl-2.0
piyueh/SEM-Toolbox
utils/poly/Jacobi.py
1
1612
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2016 Pi-Yueh Chuang <pychuang@gwu.edu> # # Distributed under terms of the MIT license. """Definition of Jacobi polynomial class""" import numpy from utils.poly.Polynomial import Polynomial from utils.poly.jacobi_operations import jacobi_...
mit
theguardian/JIRA-APPy
lib/pkg_resources/__init__.py
2
107034
""" Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipul...
gpl-2.0
tlangerak/Multi-Agent-Systems
build/lib.win-amd64-2.7/tlslite/integration/TLSAsyncDispatcherMixIn.py
86
4732
"""TLS Lite + asyncore.""" import asyncore from tlslite.TLSConnection import TLSConnection from AsyncStateMachine import AsyncStateMachine class TLSAsyncDispatcherMixIn(AsyncStateMachine): """This class can be "mixed in" with an L{asyncore.dispatcher} to add TLS support. This class essentially sits bet...
lgpl-2.1