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
ahmadio/edx-platform
lms/djangoapps/teams/serializers.py
9
7518
"""Defines serializers used by the Team API.""" from copy import deepcopy from django.contrib.auth.models import User from django.db.models import Count from django.conf import settings from rest_framework import serializers from openedx.core.lib.api.serializers import CollapsedReferenceSerializer, PaginationSerializ...
agpl-3.0
linjoahow/2015cdaa-week11
static/Brython3.1.0-20150301-090019/Lib/sre_parse.py
630
29657
# # Secret Labs' Regular Expression Engine # # convert re-style regular expression to sre pattern # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" # XXX: show string offset and offending ch...
gpl-3.0
SrNetoChan/QGIS
python/plugins/processing/algs/gdal/fillnodata.py
15
7376
# -*- coding: utf-8 -*- """ *************************************************************************** fillnodata.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ****************************...
gpl-2.0
lmiccini/sos
sos/reporting.py
5
3931
# Copyright (C) 2014 Red Hat, Inc., # Bryn M. Reeves <bmr@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version...
gpl-2.0
jaor/bigmler
bigmler/processing/samples.py
1
3680
# -*- coding: utf-8 -*- # # Copyright 2015-2020 BigML # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
CloudWareChile/OpenChile
openerp/addons/sale_crm/sale_crm.py
9
1429
# -*- 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
serge-sans-paille/pythran
pythran/tests/cases/fdtd.py
5
1107
#from http://stackoverflow.com/questions/19367488/converting-function-to-numbapro-cuda #pythran export fdtd(float[][], int) #runas import numpy ; a = numpy.ones((1000,1000)); fdtd(a,20) #bench import numpy ; a = numpy.arange(10000.).reshape(100,100); fdtd(a,25) import numpy as np def fdtd(input_grid, steps): grid ...
bsd-3-clause
gioman/QGIS
python/plugins/processing/tests/QgisAlgorithmsTest.py
1
1800
# -*- coding: utf-8 -*- """ *************************************************************************** QgisAlgorithmTests.py --------------------- Date : January 2016 Copyright : (C) 2016 by Matthias Kuhn Email : matthias@opengis.ch ***********************...
gpl-2.0
andy-c-jones/event-app-frontend
node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py
2736
1804
# Copyright (c) 2012 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml class Writer(object): """Visual Studio XML tool file writer.""" ...
mit
jlec/coot
pyrogen/tautomer.py
4
25160
#!/usr/bin/env python # -*- coding: utf-8 -*- import copy from itertools import tee, izip import logging from rdkit import Chem from rdkit.Chem.rdchem import BondType, BondStereo, BondDir __author__ = 'Matt Swain' __email__ = 'm.swain@me.com' __license__ = 'MIT' log = logging.getLogger('tautomer') BONDMAP = {'-': B...
gpl-3.0
klaashofman/lightblue-0.4
src/linux/_lightbluecommon.py
179
10831
# Copyright (c) 2009 Bea Lam. All rights reserved. # # This file is part of LightBlue. # # LightBlue 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 l...
gpl-3.0
RiccardoPecora/MP
Lib/site-packages/numpy/lib/index_tricks.py
53
26635
__all__ = ['unravel_index', 'mgrid', 'ogrid', 'r_', 'c_', 's_', 'index_exp', 'ix_', 'ndenumerate','ndindex', 'fill_diagonal','diag_indices','diag_indices_from'] import sys import numpy.core.numeric as _nx from numpy.core.numeric import ( asarray, Scalar...
gpl-3.0
pichuang/ryu
ryu/lib/packet/packet.py
5
6137
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # # 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
dhp-denero/LibrERP
office_automation/oa_sale/__openerp__.py
3
1482
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2010-2012 Elico Corp. All Rights Reserved. # Author: Yannick Gouin <yannick.gouin@elico-corp.com> # # This program is free software: you can red...
agpl-3.0
twdsilva/phoenix
bin/sqlline.py
4
4719
#!/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 A...
apache-2.0
matthdsm/bioconda-recipes
recipes/biopet-fastqsplitter/biopet-fastqsplitter.py
82
3377
#!/usr/bin/env python # # Wrapper script for starting the biopet-fastqsplitter JAR package # # This script is written for use with the Conda package manager and is copied # from the peptide-shaker wrapper. Only the parameters are changed. # (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shake...
mit
vitorio/bite-project
tools/bugs/server/appengine/providers/datastore/pusher.py
17
2142
# Copyright 2011 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
drpngx/tensorflow
tensorflow/contrib/grid_rnn/python/kernel_tests/grid_rnn_test.py
80
30148
# 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
furious-luke/django-supertest
supertest/helpers.py
1
2189
import random import logging from selenium.common.exceptions import StaleElementReferenceException STRATEGIES = [ 'empty', 'long', 'text', 'integer', 'real', ] logger = logging.getLogger(__name__) def autofill(form): done = set() while 1: # Sometimes the form gets screwed up a...
bsd-3-clause
Recoskie/netrealms
client/source/engine/network.py
1
1511
class Connection(): import socket import netcmd def __init__(address, port): connect(address, port) def connect(self, address, port): self.sock = socket.socket() self.sock.connect((address, port)) def disconnect(self): self.sock.close() pass def recieve(self, data): data = self.sock.re...
mit
MickSandoz/compassion-switzerland
child_sync_typo3/model/project_compassion.py
1
3722
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: David Coninckx # # The licence is in the file __openerp__.py # #######...
agpl-3.0
webscalesql/webscalesql-5.6
mysql-test/suite/innodb_stress/t/load_generator.py
3
14442
import cStringIO import hashlib import MySQLdb import os import random import signal import sys import threading import time import string CHARS = string.letters + string.digits def sha1(x): return hashlib.sha1(str(x)).hexdigest() # Should be deterministic given an idx def get_msg(do_blob, idx): random.seed(idx)...
gpl-2.0
adit-chandra/tensorflow
tensorflow/examples/adding_an_op/zero_out_1_test.py
5
1981
# 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
getsentry/freight
migrations/versions/106230ad9e69_migrate_task_to_deploy.py
1
3895
""" migrate task to deploy Revision ID: 106230ad9e69 Revises: 16c1b29dc47c Create Date: 2016-02-17 00:43:21.608658 """ # revision identifiers, used by Alembic. revision = "106230ad9e69" down_revision = "16c1b29dc47c" from alembic import op import sqlalchemy as sa MIGRATE_TASK_TO_DEPLOY = """ INSERT INTO deploy (ta...
apache-2.0
Jenselme/OWSLib
owslib/fgdc.py
23
10447
# -*- coding: ISO-8859-15 -*- # ============================================================================= # Copyright (c) 2010 Tom Kralidis # # Authors : Tom Kralidis <tomkralidis@gmail.com> # # Contact email: tomkralidis@gmail.com # ============================================================================= """...
bsd-3-clause
ProfessionalIT/professionalit-webiste
sdk/google_appengine/google/appengine/tools/appengine_rpc_httplib2.py
2
17155
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
lgpl-3.0
hoechenberger/psychopy
changelogUpdateMD.py
1
1949
#!/usr/bin/env python # this script replaces hashtags with a sphinx URL string (to the github issues or pull request) # written by Jon with regex code by Jeremy import re input_path = 'psychopy/CHANGELOG.txt' output_path = 'docs/source/changelog.md' def repl_link(match): name = match.group('name').strip() ...
gpl-3.0
nucleron/IDE
yaplcide.py
1
1737
#!/usr/bin/env python # -*- coding: utf-8 -*- __version__ = "$Revision$" import __builtin__ import gettext import os import sys gettext.install('yaplcide') # this is a dummy to prevent gettext falling down _dist_folder = os.path.split(sys.path[0])[0] _beremiz_folder = os.path.join(_dist_folder, "beremiz") #Ensure ...
gpl-3.0
Drooids/erpnext
erpnext/buying/doctype/quality_inspection/quality_inspection.py
61
2058
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class QualityInspection(Document): def get_item_specification_details(self): self.set('re...
agpl-3.0
cemoody/lda2vec
tests/test_topics.py
1
1528
from lda2vec import topics import numpy as np def exp_entropy(log_p): return -np.nansum(np.exp(log_p + 1e-12) * (log_p + 1e-12)) def test_prob_words(): context = np.random.randn(3) vocab = np.random.randn(10, 3) lo = topics.prob_words(context, vocab, temperature=1) hi = topics.prob_words(contex...
mit
Tokyo-Buffalo/tokyosouth
env/lib/python3.6/site-packages/wheel/signatures/ed25519py.py
565
1695
# -*- coding: utf-8 -*- import warnings import os from collections import namedtuple from . import djbec __all__ = ['crypto_sign', 'crypto_sign_open', 'crypto_sign_keypair', 'Keypair', 'PUBLICKEYBYTES', 'SECRETKEYBYTES', 'SIGNATUREBYTES'] PUBLICKEYBYTES=32 SECRETKEYBYTES=64 SIGNATUREBYTES=64 Keypair = n...
mit
apache/incubator-airflow
tests/secrets/test_secrets_backends.py
7
4277
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
nwjs/chromium.src
net/data/parse_certificate_unittest/authority_key_identifier/generate.py
3
3728
#!/usr/bin/python # Copyright 2019 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. """This script is called without any arguments to re-generate all of the *.pem files in the script's directory. The https://github.com/goog...
bsd-3-clause
altairpearl/scikit-learn
examples/manifold/plot_mds.py
88
2731
""" ========================= Multi-dimensional scaling ========================= An illustration of the metric and non-metric MDS on generated noisy data. The reconstructed points using the metric MDS and non metric MDS are slightly shifted to avoid overlapping. """ # Author: Nelle Varoquaux <nelle.varoquaux@gmail....
bsd-3-clause
theshadowx/enigma2
lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
12
6022
from Screens.Wizard import WizardSummary from Screens.WizardLanguage import WizardLanguage from Screens.Rc import Rc from VideoHardware import video_hw from Components.Pixmap import Pixmap, MovingPixmap, MultiPixmap from Components.config import config, ConfigBoolean, configfile from Tools.Directories import resolveF...
gpl-2.0
eranchetz/nupic
tests/integration/nupic/opf/opf_checkpoint_test/experiments/temporal_anomaly/a_plus_b/description.py
114
2100
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2011-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
agpl-3.0
GiedriusM/openthread
tools/harness-automation/cases/leader_9_2_2.py
16
1875
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 # notic...
bsd-3-clause
cjwagner/test-infra
hack/coalesce_test.py
14
3330
#!/usr/bin/env python3 # Copyright 2016 The Kubernetes Authors. # # 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 appl...
apache-2.0
mydongistiny/external_chromium_org
tools/roll_swarming_client.py
63
3878
#!/usr/bin/env python # 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. """Rolls swarming_client. While it is currently hard coded for swarming_client/, it is potentially modifiable to allow different depen...
bsd-3-clause
mabxsi/ice-cache-explorer
h5reader.py
1
7754
############################################################################### # ICE Explorer: A viewer and reader for ICE cache data # Copyright (C) 2010 M.A. Belzile # # 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-3.0
petewarden/tensorflow
tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py
9
19844
# 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
javierlgroba/Eventer-gapp
django/conf/locale/fr/formats.py
107
1315
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i:s' DATE...
lgpl-3.0
code-for-india/sahana_shelter_worldbank
modules/ClimateDataPortal/__init__.py
25
17261
# -*- coding: utf-8 -*- """ Climate Data Module @author: Mike Amy """ from datetime import date, timedelta from math import floor from calendar import isleap from gluon import current from gluon.contrib.simplejson.ordered_dict import OrderedDict # @ToDo: Nasty! db = current.db same = lambda x: x # keyed o...
mit
berquist/PyQuante
PyQuante/MINDO3_Parameters.py
3
4890
"""\ MINDO3.py: Dewar's MINDO/3 Semiempirical Method This program is part of the PyQuante quantum chemistry program suite. Copyright (c) 2004, Richard P. Muller. All Rights Reserved. PyQuante version 1.2 and later is covered by the modified BSD license. Please see the file LICENSE that is part of this distrib...
bsd-3-clause
mitchelljkotler/django
tests/admin_views/models.py
38
23206
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import os import tempfile from django.contrib.auth.models import User from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.core.e...
bsd-3-clause
zhenzhai/edx-platform
lms/djangoapps/instructor/tests/test_ecommerce.py
43
14968
""" Unit tests for Ecommerce feature flag in new instructor dashboard. """ import datetime import pytz from django.core.urlresolvers import reverse from nose.plugins.attrib import attr from course_modes.models import CourseMode from student.roles import CourseFinanceAdminRole from shoppingcart.models import Coupon,...
agpl-3.0
vojtechtrefny/anaconda
tests/pyanaconda_tests/localization_test.py
8
7827
# # Copyright (C) 2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will be...
gpl-2.0
victor-rene/MicroScada
archive/day-16-17/led.py
2
1294
import os, util from kivy.uix.image import Image from kivy.uix.gridlayout import GridLayout # from kivy.uix.popup import Popup # from variableselector import VariableSelector from datamgr import variables class Binding: def __init__(self, source, source_attr, target, target_attr): self.source = source self...
mit
sasukeh/cinder
cinder/volume/targets/fake.py
25
1235
# 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 # d...
apache-2.0
ThangBK2009/android-source-browsing.platform--external--chromium-trace
trace-viewer/third_party/pywebsocket/src/test/client_for_testing.py
29
39775
#!/usr/bin/env python # # Copyright 2012, 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...
bsd-3-clause
atsaki/ansible
lib/ansible/utils/listify.py
19
1629
# (c) 2014 Michael DeHaan, <michael@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 later ve...
gpl-3.0
AWPorter/aima-python
submissions/Haller/vaccuum.py
19
6469
import agents as ag import envgui as gui import random # ______________________________________________________________________________ loc_A, loc_B = (1, 1), (2, 1) # The two locations for the Vacuum world def RandomVacuumAgent(): "Randomly choose one of the actions from the vacuum environment." p = ag.Ra...
mit
qiuzhong/crosswalk-test-suite
misc/sampleapp-android-tests/sampleapp/webgl_install.py
3
2148
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
bsd-3-clause
akiokio/centralfitestoque
src/.pycharm_helpers/pydev/pydev_localhost.py
3
1249
import pydevd_constants if pydevd_constants.USE_LIB_COPY: import _pydev_socket as socket else: import socket _cache = None def get_localhost(): ''' Should return 127.0.0.1 in ipv4 and ::1 in ipv6 localhost is not used because on windows vista/windows 7, there can be issues where the resolving ...
bsd-2-clause
GauravSahu/odoo
addons/mrp_operations/report/mrp_workorder_analysis.py
312
3336
# -*- 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
ixiom/phantomjs
src/breakpad/src/tools/gyp/test/generator-output/gyptest-relocate.py
151
1604
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies that a project hierarchy created with the --generator-output= option can be built even when it's relocated to a different path....
bsd-3-clause
bgoli/pysces
pysces/core2/PyscesCore2Modules.py
1
25156
""" PySCeS - Python Simulator for Cellular Systems (http://pysces.sourceforge.net) Copyright (C) 2004-2019 B.G. Olivier, J.M. Rohwer, J.-H.S Hofmeyr all rights reserved, Brett G. Olivier (bgoli@users.sourceforge.net) Triple-J Group for Molecular Cell Physiology Stellenbosch University, South Africa. Permission to us...
bsd-3-clause
edmundgentle/schoolscript
SchoolScript/bin/Debug/pythonlib/Lib/test/test_coding.py
3
2158
import test.support, unittest from test.support import TESTFN, unlink, unload import os, sys class CodingTest(unittest.TestCase): def test_bad_coding(self): module_name = 'bad_coding' self.verify_bad_module(module_name) def test_bad_coding2(self): module_name = 'bad_coding2...
gpl-2.0
SaschaMester/delicium
build/android/gyp/write_ordered_libraries.py
15
4010
#!/usr/bin/env python # # 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. """Writes dependency ordered list of native libraries. The list excludes any Android system libraries, as those are not bundled with...
bsd-3-clause
Eric-Gaudiello/tensorflow_dev
tensorflow_home/tensorflow_venv/lib/python3.4/site-packages/numpy/core/tests/test_umath_complex.py
145
19800
from __future__ import division, absolute_import, print_function import sys import platform import numpy as np import numpy.core.umath as ncu from numpy.testing import ( TestCase, run_module_suite, assert_equal, assert_array_equal, assert_almost_equal, dec ) # TODO: branch cuts (use Pauli code) # TODO: conj ...
gpl-3.0
pixelspark/corespark
Libraries/Spirit/boost/miniboost/tools/build/v2/test/direct_request_test.py
1
1179
#!/usr/bin/python from BoostBuild import Tester, List import os from string import strip t = Tester() # First check some startup t.set_tree("direct-request-test") t.run_build_system(extra_args="define=MACROS") t.expect_addition("bin/$toolset/debug/" * (List("a.obj b.obj b.dll a.exe")...
lgpl-3.0
DoreeMoell3/Doreen
py/openage/convert/stringresource.py
46
1211
from collections import defaultdict from . import dataformat from .util import dbg class StringResource(dataformat.Exportable): name_struct = "string_resource" name_struct_file = "string_resource" struct_description = "string id/language to text mapping, extracted from language.dll file." dat...
gpl-3.0
nickhand/pyRSD
pyRSD/rsd/power/gal/Pcc/PcAcB.py
1
1101
from .. import TwoHaloTerm, DampedGalaxyPowerTerm from . import SOCorrection class PcAcB_2h(TwoHaloTerm): """ The 2-halo term for `PcAcB` """ name = 'PcAcB_2h' def __init__(self, model): super(PcAcB_2h, self).__init__(model, 'b1_cA', 'b1_cB') class PcAcB(DampedGalaxyPow...
gpl-3.0
timpalpant/KaggleTSTextClassification
scripts/plot_feature_label_correlations.py
1
1976
#!/usr/bin/env python ''' Compute mutual information between individual features and labels ''' import argparse import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from common import * def opts(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('feat...
gpl-3.0
googleapis/python-aiplatform
samples/snippets/get_model_evaluation_image_object_detection_sample.py
1
1553
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
akshaynayak/google-python-exercises
basic/solution/string2.py
208
3094
#!/usr/bin/python2.4 -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Additional basic string exercises # D. verbing # Given a string, if its length is a...
apache-2.0
jedie/django-cms-tools
django_cms_tools/fixture_helper/page_utils.py
1
1256
""" :created: 17.09.2018 by Jens Diemer :copyleft: 2018 by the django-cms-tools team, see AUTHORS for more details. :license: GNU GPL v3 or above, see LICENSE for more details. """ from cms.models import Page def get_public_cms_app_namespaces(): """ :return: a tuple() with all cms app namespaces ...
gpl-3.0
harlowja/networkx
examples/algorithms/blockmodel.py
32
3009
#!/usr/bin/env python # encoding: utf-8 """ Example of creating a block model using the blockmodel function in NX. Data used is the Hartford, CT drug users network: @article{, title = {Social Networks of Drug Users in {High-Risk} Sites: Finding the Connections}, volume = {6}, shorttitle = {Social Networks of Drug ...
bsd-3-clause
cfriedt/gnuradio
gr-channels/python/channels/phase_noise_gen.py
60
2769
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Phase Noise Generator # Author: mettus # Generated: Thu Aug 1 11:59:39 2013 ################################################## from gnuradio import analog from gnuradio import blocks from gnuradio import fil...
gpl-3.0
coolyangzc/ucore_os_lab
related_info/lab3/page-replacement-policy.py
50
7654
#! /usr/bin/env python import sys from optparse import OptionParser import random import math def hfunc(index): if index == -1: return 'MISS' else: return 'HIT ' def vfunc(victim): if victim == -1: return '-' else: return str(victim) # # main program # parser = Option...
gpl-2.0
afaheem88/rally
rally/common/db/sqlalchemy/api.py
8
12552
# Copyright 2013: Mirantis 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 b...
apache-2.0
DemocracyClub/UK-Polling-Stations
polling_stations/apps/addressbase/migrations/0006_auto_20170927_1215.py
1
2374
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("addressbase", "0005_auto_20170927_1128")] operations = [ migrations.CreateModel( name="Onsud", fields=[ ...
bsd-3-clause
MannyGrewal/Manny.CIFAR
Manny.CIFAR/CIFAR/CIFARPlotter.py
1
1321
import math import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import pylab ######################################################################## # 2017 - Manny Grewal # Purpose of this class is to visualise a list of images from the CIFAR dataset # How many columns to show...
mit
smarx/dropbox-sdk-python
setup.py
1
1572
# Don't import unicode_literals because of a bug in py2 setuptools # where package_data is expected to be str and not unicode. from __future__ import absolute_import, division, print_function # Ensure setuptools is available import sys try: from ez_setup import use_setuptools use_setuptools() except ImportErr...
mit
SummerLW/Perf-Insight-Report
third_party/gsutil/third_party/protorpc/protorpc/webapp/service_handlers_test.py
21
46517
#!/usr/bin/env python # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
bsd-3-clause
Beyond-Imagination/BlubBlub
ChatbotServer/ChatbotEnv/Lib/site-packages/jpype/_gui.py
1
1291
#***************************************************************************** # Copyright 2004-2008 Steve Menard # # 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....
gpl-3.0
eventql/eventql
deps/3rdparty/spidermonkey/mozjs/testing/mozbase/mozhttpd/tests/paths.py
6
3312
#!/usr/bin/env python # Any copyright is dedicated to the Public Domain. # http://creativecommons.org/publicdomain/zero/1.0/ from mozfile import TemporaryDirectory import mozhttpd import os import unittest import urllib2 class PathTest(unittest.TestCase): def try_get(self, url, expected_contents): f = ur...
agpl-3.0
adaur/SickRage
sickbeard/notifiers/nmj.py
3
7911
# coding=utf-8 # Author: Nico Berlee http://nico.berlee.nl/ # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 ve...
gpl-3.0
proxysh/Safejumper-for-Desktop
buildlinux/env64/lib/python2.7/site-packages/twisted/conch/scripts/tkconch.py
12
23189
# -*- test-case-name: twisted.conch.test.test_scripts -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Implementation module for the `tkconch` command. """ from __future__ import print_function from twisted.conch import error from twisted.conch.ui import tkvt100 from twisted.conch.ssh ...
gpl-2.0
xombiemp/CouchPotatoServer
libs/suds/xsd/query.py
202
6451
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 in the hope that it will ...
gpl-3.0
serviceagility/boto
boto/cloudfront/invalidation.py
78
8056
# Copyright (c) 2006-2010 Chris Moyer http://coredumped.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, mod...
mit
tmxdyf/PJSIP
tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_1.py
42
1281
# $Id$ import inc_sip as sip import inc_sdp as sdp # Torture message from RFC 4475 # 3.1.1. Valid Messages # 3.1.1.1. A Short Tortuous INVITE complete_msg = \ """INVITE sip:vivekg@chair-dnrc.example.com;unknownparam SIP/2.0 TO : sip:vivekg@chair-dnrc.example.com ; tag = 1918181833n from : "J Rosenberg \\\\\\...
gpl-2.0
Tisseo/navitia
source/jormungandr/jormungandr/street_network/geovelo.py
1
14245
# Copyright (c) 2001-2017, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public t...
agpl-3.0
mrknow/filmkodi
plugin.video.mrknow/mylib/stubs/_get_tips.py
88
8230
import os.path import inspect import sys # completion types. TYPE_IMPORT = '0' TYPE_CLASS = '1' TYPE_FUNCTION = '2' TYPE_ATTR = '3' TYPE_BUILTIN = '4' TYPE_PARAM = '5' def _imp(name, log=None): try: return __import__(name) except: if '.' in name: sub = name[0:name.rfind('.')] ...
apache-2.0
further-reading/Dicecord
code/stats.py
1
2058
# This file contains the default stats and general stat categories ATTRIBUTE_TYPE = {'mental': ['intelligence', 'wits', 'resolve'], 'physical': ['strength', 'dexterity', 'stamina'], 'social': ['presence', 'manipulation', 'composure'] } SKILL_TYPE = {'mental...
gpl-3.0
tedder/ansible
lib/ansible/plugins/action/net_interface.py
648
1057
# (c) 2017, Ansible 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. # # Ansible is di...
gpl-3.0
tyarkoni/pliers
pliers/converters/multistep.py
2
2335
''' Converter classes that wrap multiple conversion steps under one class. ''' from pliers.stimuli.base import Stim from pliers.stimuli.audio import AudioStim from pliers.stimuli.video import VideoStim from pliers.stimuli.text import TextStim, ComplexTextStim from .base import Converter, get_converter class MultiSte...
bsd-3-clause
DavidGuben/rcbplayspokemon
app/pywin32-220/com/win32comext/shell/demos/servers/column_provider.py
37
3886
# A sample shell column provider # Mainly ported from MSDN article: # Using Shell Column Handlers for Detailed File Information, # Raymond Chen, Microsoft Corporation, February 2000 # # To demostrate: # * Execute this script to register the namespace. # * Open Windows Explorer # * Right-click an explorer column head...
mit
zahodi/ansible
lib/ansible/plugins/connection/lxc.py
89
7955
# (c) 2015, Joerg Thalheim <joerg@higgsboson.tk> # # 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 ve...
gpl-3.0
mrukhlov/gamesagent
app.py
1
3157
#!/usr/bin/env python '''used as webhook''' import os from flask import ( Flask, request, make_response, jsonify ) app = Flask(__name__) log = app.logger def index_getter(letter): index = 0 index_list = [] for i in 'kitten'.upper(): if i == letter: index_list.append(index) index+=1 return index_list...
apache-2.0
trondhindenes/ansible
lib/ansible/modules/network/avi/avi_backup.py
20
4096
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # 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
ninjablocks/kernel-VAR-SOM-AMxx
tools/perf/util/setup.py
989
1543
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
Sensorino/SensorinoServer-legacy
server/coreEngine.py
1
7965
#!/usr/bin/python3 import logging import threading from threading import Timer import datetime import ConfigParser import sensorino import common import json import mqttThread from errors import * import singleton import traceback # create logger with 'spam_application' logger = logging.getLogger('sensorino_coreEngine...
gpl-2.0
HazardSJ/HazardBot
enwiki/cfdMultipleMerger.py
1
2343
import re import mwparserfromhell import pywikibot pywikibot.config.family = "wikipedia" pywikibot.config.mylang = "en" site = pywikibot.Site() #site.login() class CFDMultipleMergeBot(object): def __init__(self): self.getMerges() def getMerges(self): page = pywikibot.Page(site, "Wikipedia:...
mit
mach6/selenium
py/selenium/webdriver/edge/service.py
37
2161
# 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
andreivasiliu2211/upm
examples/python/uln200xa.py
16
2238
#!/usr/bin/python # Author: Jon Trulson <jtrulson@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 ...
mit
LandisTwo/veromix-plasmoid
gtk/Veromix.py
3
4748
# -*- coding: utf-8 -*- # Copyright (C) 2012 Nik Lutz <nik.lutz@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later vers...
gpl-3.0
majora2007/plexpy
lib/unidecode/x082.py
252
4649
data = ( 'Yao ', # 0x00 'Yu ', # 0x01 'Chong ', # 0x02 'Xi ', # 0x03 'Xi ', # 0x04 'Jiu ', # 0x05 'Yu ', # 0x06 'Yu ', # 0x07 'Xing ', # 0x08 'Ju ', # 0x09 'Jiu ', # 0x0a 'Xin ', # 0x0b 'She ', # 0x0c 'She ', # 0x0d 'Yadoru ', # 0x0e 'Jiu ', # 0x0f 'Shi ', # 0x10 'Tan ...
gpl-3.0
mitmedialab/MediaCloud-Web-Tools
server/views/test/test_user.py
1
3441
import unittest import time from server.views.test import BaseAppTest, TEST_USER_EMAIL class UserLoginTest(BaseAppTest): """ Make sure a user can login with the email and password, and can't if password is wrong """ def testWrongPassword(self): response = self.app.post( '/api/log...
apache-2.0
aspectron/jsx
build/tools/gyp/test/copies/gyptest-slash.py
249
1433
#!/usr/bin/env 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. """ Verifies file copies with a trailing slash in the destination directory. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('cop...
mit