repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
haowu4682/gem5
ext/ply/example/classcalc/calc.py
151
4058
#!/usr/bin/env python # ----------------------------------------------------------------------------- # calc.py # # A simple calculator with variables. This is from O'Reilly's # "Lex and Yacc", p. 63. # # Class-based example contributed to PLY by David McNab # --------------------------------------------------------...
bsd-3-clause
clinc/models
transformer/tf_utils.py
30
4153
# 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
coingraham/codefights
python/depositProfit/depositProfit.py
1
1577
"""You have deposited a specific amount of dollars into your bank account. Each year your balance increases at the same growth rate. Find out how long it would take for your balance to pass a specific threshold with the assumption that you don't make any additional deposits. Example For deposit = 100, rate = 20 and t...
mit
wrouesnel/ansible
lib/ansible/modules/network/dellos9/dellos9_command.py
5
7554
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # Copyright (c) 2016 Dell Inc. # 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
LoHChina/nova
nova/tests/unit/fake_block_device.py
63
1665
# Copyright 2013 Red Hat 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 ...
apache-2.0
wolfskaempf/ga_statistics
lib/python2.7/site-packages/setuptools/command/rotate.py
461
2038
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import os from setuptools import Command from setuptools.compat import basestring class rotate(Command): """Delete older distributions""" description = "delete older distributions, keeping N n...
mit
kmod/icbd
stdlib/python2.5/ctypes/test/test_arrays.py
15
3488
import unittest from ctypes import * formats = "bBhHiIlLqQfd" formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \ c_long, c_ulonglong, c_float, c_double class ArrayTestCase(unittest.TestCase): def test_simple(self): # create classes holding simple numeric types, and check # v...
mit
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_association_links_operations.py
1
4964
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
lodemo/CATANA
src/visualization/database.py
1
6195
# -*- coding: utf-8 -*- from sqlalchemy import Column, ForeignKey, Integer, BigInteger, String, Table, UnicodeText, Unicode, Boolean, LargeBinary, Float from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine from sqlalchemy import UniqueCons...
mit
luisibanez/vista-debian-med-package
Scripts/PrepareMComponentsForImport.py
7
2442
#--------------------------------------------------------------------------- # Copyright 2013 The Open Source Electronic Health Record Agent # # 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 # ...
apache-2.0
tungvx/deploy
.google_appengine/google/appengine/ext/mapreduce/context.py
2
7643
#!/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...
apache-2.0
iivic/BoiseStateX
lms/djangoapps/bulk_email/migrations/0001_initial.py
182
6854
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CourseEmail' db.create_table('bulk_email_courseemail', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True...
agpl-3.0
tobinsarah/tenshi
angel-player/src/chrome/content/angelic/tests/binary/correct_contents.py
11
1375
#!/usr/bin/env python # Licensed to Pioneers in Engineering under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Pioneers in Engineering licenses # this file to you under the Apache License, Version 2.0 (the #...
apache-2.0
alsrgv/tensorflow
tensorflow/python/training/checkpoint_utils_test.py
7
19686
# 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
techdragon/django
django/core/management/commands/runserver.py
64
6371
from __future__ import unicode_literals import errno import os import re import socket import sys from datetime import datetime from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.core.servers.basehttp import get_internal_wsgi_application, run from django.uti...
bsd-3-clause
MridulS/sympy
sympy/physics/quantum/dagger.py
116
2242
"""Hermitian conjugation.""" from __future__ import print_function, division from sympy.core import Expr from sympy.functions.elementary.complexes import adjoint __all__ = [ 'Dagger' ] class Dagger(adjoint): """General Hermitian conjugate operation. Take the Hermetian conjugate of an argument [1]_. Fo...
bsd-3-clause
idreamsi/wiobot
requests/packages/urllib3/__init__.py
650
1701
# urllib3/__init__.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (a...
gpl-3.0
googleapis/googleapis-gen
google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/services/services/campaign_experiment_service/transports/grpc.py
1
21057
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
Spoken-tutorial/spoken-website
events/migrations/0024_auto_20171023_1705.py
1
2124
# -*- coding: utf-8 -*- from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('events', '0023_auto_20171023_1545'), ] operations = [ migrations.AddField( model_name='inductioninterest', name='other_language', ...
gpl-3.0
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/watchdog/observers/inotify.py
2
6947
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> # Copyright 2012 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 # # ...
agpl-3.0
parpg/parpg
parpg/charactercreationview.py
1
3198
# This file is part of PARPG. # # PARPG 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. # # PARPG is distributed in the hop...
gpl-3.0
ueg1990/flask-restful
tests/test_reqparse.py
13
29848
# -*- coding: utf-8 -*- import unittest from mock import Mock, patch from flask import Flask from werkzeug import exceptions, MultiDict from werkzeug.wrappers import Request from werkzeug.datastructures import FileStorage from flask_restful.reqparse import Argument, RequestParser, Namespace import six import decimal i...
bsd-3-clause
brandonrobertz/namecoin-core
test/functional/rpcnamedargs.py
22
1211
#!/usr/bin/env python3 # Copyright (c) 2016-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test using named arguments for RPCs.""" from test_framework.test_framework import BitcoinTestFramework...
mit
thezawad/kivy
examples/widgets/unicode_textinput.py
27
11374
# -*- coding: utf-8 -*- from kivy.app import App from kivy.lang import Builder from kivy.properties import StringProperty, ObjectProperty from kivy.core.text import Label as CoreLabel from kivy.uix.boxlayout import BoxLayout from kivy.uix.floatlayout import FloatLayout from kivy.uix.spinner import SpinnerOption from k...
mit
aliyun/oss-ftp
python36/unix/lib/requests/compat.py
36
1782
# -*- coding: utf-8 -*- """ requests.compat ~~~~~~~~~~~~~~~ This module handles import compatibility issues between Python 2 and Python 3. """ import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] =...
mit
tornadozou/tensorflow
tensorflow/contrib/distributions/python/ops/mvn_linear_operator.py
18
12520
# 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
lllucius/climacast
requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
agpl-3.0
kakkyz81/buntan
src/evernote/edam/limits/constants.py
1
3923
# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # from thrift.Thrift import * from ttypes import * EDAM_ATTRIBUTE_LEN_MIN = 1 EDAM_ATTRIBUTE_LEN_MAX = 4096 EDAM_ATTRIBUTE_REGEX = "^[^\\p{Cc}\\p{Zl}\\p{Zp}]{1,4096}$" EDAM_ATTRIBUTE_LIST_MAX = 100 EDAM_GUID_LEN_MIN =...
mit
vendasta/appengine-pipelines
python/src/pipeline/models.py
24
9952
#!/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...
apache-2.0
theflofly/tensorflow
tensorflow/python/kernel_tests/padding_fifo_queue_test.py
8
59378
# 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
Gustry/inasafe
safe/common/test/test_minimum_needs.py
13
4089
# coding=utf-8 """InaSAFE Disaster risk assessment tool developed by AusAid - **Table Tests implementation.** Contact : ole.moller.nielsen@gmail.com .. note:: 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 Soft...
gpl-3.0
XiaodunServerGroup/medicalmooc
common/djangoapps/util/password_policy_validators.py
53
3649
# pylint: disable=E1101 """ This file exposes a number of password complexity validators which can be optionally added to account creation This file was inspired by the django-passwords project at https://github.com/dstufft/django-passwords authored by dstufft (https://github.com/dstufft) """ from __future__ import di...
agpl-3.0
PhiInnovations/mdp28-linux-bsp
bitbake/lib/bb/ui/crumbs/hoblistmodel.py
1
33658
# # BitBake Graphical GTK User Interface # # Copyright (C) 2011 Intel Corporation # # Authored by Joshua Lock <josh@linux.intel.com> # Authored by Dongxiao Xu <dongxiao.xu@intel.com> # Authored by Shane Wang <shane.wang@intel.com> # # This program is free software; you can redistribute it and/or modify # it unde...
mit
Panda3D-google-code-repositories/naith
game/plugins/particlemanager/particlemanager.py
1
3776
# -*- coding: utf-8 -*- # Copyright Tom SF Haines # # 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 ag...
apache-2.0
mbox/django
django/conf/locale/en/formats.py
394
1815
# -*- 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 = 'N j, Y' TIME_FORMAT = 'P' DATETIM...
bsd-3-clause
zhzDeveloper/Python_Study
other/ios_simple.py
3
2242
""" Simple iOS tests, showing accessing elements and getting/setting text from them. """ import unittest import os from random import randint from appium import webdriver from time import sleep class SimpleIOSTests(unittest.TestCase): def setUp(self): # set up appium app = os.path.abspath('../../a...
apache-2.0
pheanex/ansible
lib/ansible/plugins/action/debug.py
126
1919
# Copyright 2012, Dag Wieers <dag@wieers.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 versi...
gpl-3.0
keithmattix/west-tn-quizbowl
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_phpbuiltins.py
274
122046
# -*- coding: utf-8 -*- """ pygments.lexers._phpbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file loads the function names and their modules from the php webpage and generates itself. Do not alter the MODULES dict by hand! WARNING: the generation transfers quite much data over your ...
mit
huanpc/IoT-1
gui/controller/.venv/lib/python3.5/site-packages/django/contrib/auth/models.py
263
14879
from __future__ import unicode_literals from django.contrib import auth from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager from django.contrib.auth.signals import user_logged_in from django.contrib.contenttypes.models import ContentType from django.core import validators from django.core.excep...
mit
t0in4/django
tests/i18n/sampleproject/update_catalogs.py
344
1780
#!/usr/bin/env python """ Helper script to update sampleproject's translation catalogs. When a bug has been identified related to i18n, this helps capture the issue by using catalogs created from management commands. Example: The string "Two %% Three %%%" renders differently using trans and blocktrans. This issue i...
bsd-3-clause
ppanczyk/ansible
lib/ansible/utils/module_docs_fragments/tower.py
34
1971
# (c) 2017, Wayne Witzel III <wayne@riotousliving.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 la...
gpl-3.0
shahar-stratoscale/nova
nova/virt/fake.py
1
15938
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
apache-2.0
yanheven/console
openstack_dashboard/dashboards/project/networks/subnets/tables.py
8
3776
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 NEC 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 #...
apache-2.0
capitalaslash/libmesh
doc/statistics/github_traffic.py
15
1184
#!/usr/bin/env python from github_traffic_base import * # Derive from the PlotData to plot views. class PlotViews(PlotData): def __init__(self): super(PlotData, self).__init__() self.left_axis_label = 'Weekly page views' self.right_axis_label = 'Avg. Daily Unique Visitors' self.weekly_plot_filename =...
lgpl-2.1
MOA-2011/e2openplugin-OpenWebif
plugin/controllers/views/web/timeraddbyeventid.py
1
5250
#!/usr/bin/env python ################################################## ## DEPENDENCIES import sys import os import os.path try: import builtins as builtin except ImportError: import __builtin__ as builtin from os.path import getmtime, exists import time import types from Cheetah.Version import MinCompatib...
gpl-2.0
srvg/ansible
test/support/integration/plugins/modules/ec2.py
25
66532
#!/usr/bin/python # This file is part of Ansible # 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': ['stableinter...
gpl-3.0
srikk595/Multilingual-Search-System-for-tweets
partA/venv/lib/python2.7/site-packages/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
gpl-2.0
bigswitch/tempest
tempest/services/identity/v3/json/projects_client.py
1
2675
# Copyright 2013 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
diogocs1/comps
web/openerp/addons/base/ir/ir_http.py
27
6695
#---------------------------------------------------------- # ir_http modular http routing #---------------------------------------------------------- import logging import re import sys import werkzeug.exceptions import werkzeug.routing import werkzeug.urls import werkzeug.utils import openerp import openerp.excepti...
apache-2.0
Belgabor/django
django/contrib/auth/tokens.py
75
2393
from datetime import date from django.conf import settings from django.utils.http import int_to_base36, base36_to_int class PasswordResetTokenGenerator(object): """ Strategy object used to generate and check tokens for the password reset mechanism. """ def make_token(self, user): """ ...
bsd-3-clause
shellphish/rex
rex/exploit/techniques/rop_set_register.py
1
3146
import angrop import claripy import logging from rex import Vulnerability from rex.exploit import CannotExploit from ..cgc import CGCType1RopExploit from ..technique import Technique l = logging.getLogger("rex.exploit.techniques.rop_set_register") class RopSetRegister(Technique): ''' Very CGC specific registe...
bsd-2-clause
tammer123/discord-wow-armory-bot
constants.py
1
2186
#!/usr/bin/python3 # -*- coding: utf-8 -*- """Dictionary of constants used throughout the application.""" # Achievement Constants AC_CHALLENGING_LOOK = 11611 AC_KEYSTONE_MASTER = 11162 AC_KEYSTONE_CONQUEROR = 11185 AC_KEYSTONE_CHALLENGER = 11184 AC_ARENA_CHALLENGER = 2090 AC_ARENA_RIVAL = 2093 AC_ARENA_DUELIST = 2092...
mit
gixxi/comparareetpendere
example.py
1
1352
''' This piece of source demonstrates the MultisourceHtmlFormatter that takes three quicksort implementations (python, haskell, java) into account and produces html output of all implementations side-by-side. The output gets writen to stdout and file output.html :copyright: Copyright 2013 by christian.meichsner@inform...
bsd-2-clause
andrius-preimantas/odoo
addons/website_blog/wizard/__init__.py
373
1077
# -*- 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
Sodki/ansible-modules-extras
cloud/centurylink/clc_blueprint_package.py
40
10442
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
gpl-3.0
tiagocardosos/stoq
stoqlib/lib/template.py
2
2033
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2011 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## This program 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 F...
gpl-2.0
jayceyxc/hue
desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/chart/line_chart.py
10
4126
from __future__ import absolute_import #Autogenerated schema from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, Sequence, Alias, ) from openpyxl.descriptors.excel import ExtensionList from openpyxl.descriptors.nested import ( NestedSet, NestedBoo...
apache-2.0
potash/scikit-learn
examples/feature_selection/plot_f_test_vs_mi.py
75
1647
""" =========================================== Comparison of F-test and mutual information =========================================== This example illustrates the differences between univariate F-test statistics and mutual information. We consider 3 features x_1, x_2, x_3 distributed uniformly over [0, 1], the targ...
bsd-3-clause
jc0n/scrapy
conftest.py
30
1095
import glob import six import pytest from twisted import version as twisted_version def _py_files(folder): return glob.glob(folder + "/*.py") + glob.glob(folder + "/*/*.py") collect_ignore = [ # deprecated or moved modules "scrapy/conf.py", "scrapy/stats.py", "scrapy/project.py", "scrapy/uti...
bsd-3-clause
googleapis/python-documentai
google/cloud/documentai_v1/services/document_processor_service/async_client.py
1
19242
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
kmcnellis/twitter_nlp
hbc/python/Dictionaries.py
10
1543
import sys import os import string import re def normalize(s): s = re.sub(r" 's", "'s", s) #return re.sub(r'^the ', '', s.translate(string.maketrans("",""), string.punctuation), re.IGNORECASE) return re.sub(r'^the ', '', s.replace('.',''), re.IGNORECASE) class Dictionaries: def __init__(self, dictDir...
gpl-3.0
fengzhyuan/Halide
python_bindings/tutorial/lesson_14_types.py
9
9218
#!/usr/bin/python3 # Halide tutorial lesson 14: The Halide type system # This lesson more precisely describes Halide's type system. # On linux, you can compile and run it like so: # g++ lesson_14*.cpp -g -I ../include -L ../bin -lHalide -lpthread -ldl -o lesson_14 -std=c++11 # LD_LIBRARY_PATH=../bin ./lesson_14 # On...
mit
blighj/django
django/contrib/gis/geos/collections.py
22
4628
""" This module houses the Geometry Collection objects: GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon """ import json from ctypes import byref, c_int, c_uint from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos...
bsd-3-clause
heiher/libreoffice-core
wizards/com/sun/star/wizards/common/ConfigSet.py
13
2731
# # This file is part of the LibreOffice project. # # 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/. # # This file incorporates work covered by the following license noti...
gpl-3.0
nasirali1/CerebralCortex
cerebralcortex/kernel/DataStoreEngine/Data/LoadData.py
2
11439
# Copyright (c) 2017, MD2K Center of Excellence # 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 conditio...
bsd-2-clause
kleins11/intdatasci-byte2
lib/werkzeug/contrib/cache.py
252
27983
# -*- coding: utf-8 -*- """ werkzeug.contrib.cache ~~~~~~~~~~~~~~~~~~~~~~ The main problem with dynamic Web sites is, well, they're dynamic. Each time a user requests a page, the webserver executes a lot of code, queries the database, renders templates until the visitor gets the page he sees. ...
apache-2.0
slisson/intellij-community
plugins/hg4idea/testData/bin/mercurial/treediscovery.py
93
5172
# discovery.py - protocol changeset discovery functions # # Copyright 2010 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from node import nullid, short from i18n import _ import util, error def fi...
apache-2.0
RobertoMalatesta/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/commitinfo.py
118
4062
# Copyright (c) 2010 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
ohnorobo/pokemon
colors/ChangeHue.py
1
4325
#!/usr/local/bin/python3 from PIL import Image import colorsys import glob import os from collections import Counter from pprint import pprint # color, a rgb tuple # amount a number from 0 to 255 def shift(color, amount): r, g, b, a = color print(("rgb", r, g, b, a)) h, l, s = colorsys.rgb_to_hls(r, g, b) ...
mit
mydongistiny/external_chromium_org
tools/perf/metrics/power.py
25
7296
# 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. import time from metrics import Metric from telemetry.core.platform import process_statistic_timeline_data from telemetry.value import scalar class PowerM...
bsd-3-clause
wusung/ipython-notebook-tabs
kyper/nbformat/v3/tests/test_json.py
5
3443
import copy import json from base64 import decodestring from unittest import TestCase from IPython.utils.py3compat import unicode_type from ..nbjson import reads, writes from ..nbbase import from_dict from .. import nbjson from .nbexamples import nb0 from . import formattest from .nbexamples import nb0 class TestJ...
apache-2.0
stringertheory/names
syllables_en.py
6
2682
""" Fallback syllable counter This is based on the algorithm in Greg Fast's perl module Lingua::EN::Syllable. """ import string, re, os specialSyllables_en = """tottered 2 chummed 1 peeped 1 moustaches 2 shamefully 3 messieurs 2 satiated 4 sailmaker 4 sheered 1 disinterred 3 propitiatory 6 bepatched 2 particularized...
mit
hnzProjects/myBlog
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py
1534
3426
# 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. import collections import os import gyp import gyp.common import gyp.msvs_emulation import json import sys generator_supports_multiple_toolsets = True generator_...
apache-2.0
zerc/django
tests/custom_pk/tests.py
326
7481
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import IntegrityError, transaction from django.test import TestCase, skipIfDBFeature from django.utils import six from .models import Bar, Business, Employee, Foo class BasicCustomPKTests(TestCase): @classmethod def setUpTestData...
bsd-3-clause
kpdyer/fteproxy
fteproxy/cli.py
2
19009
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import signal import glob import argparse import threading import fte.encoder import fteproxy.conf import fteproxy.server import fteproxy.client import fteproxy.regex2dfa # do_managed_* from twisted.internet import reactor, error import obfspro...
apache-2.0
erikdejonge/youtube-dl
youtube_dl/extractor/eroprofile.py
61
3218
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urllib_parse_urlencode from ..utils import ( ExtractorError, unescapeHTML ) class EroProfileIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)' ...
unlicense
mmcminn/llvm-py
llvm/_intrinsic_ids.py
2
38109
# # Copyright (c) 2008-10, Mahadevan R 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 ...
bsd-3-clause
AkademieOlympia/sympy
sympy/parsing/mathematica.py
96
1996
from __future__ import print_function, division from re import match from sympy import sympify def mathematica(s): return sympify(parse(s)) def parse(s): s = s.strip() # Begin rules rules = ( # Arithmetic operation between a constant and a function (r"\A(\d+)([*/+-^])(\w+\[[^\]]+[^...
bsd-3-clause
genesi/linux-testing
tools/perf/python/twatch.py
3213
1338
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
moyaproject/moya
moya/pyversion.py
1
3224
"""Check a Python version specifier against a version of Python Examples of the version specifier syntax are as follows: "py" Any version of Python "py2" Any version in the 2.X series "py2.6" Only Python version 2.6 "py2.5+" Python version 2.5 onwards, but only in the Py2.X series "py3.2+" Pyth...
mit
sumedhasingla/VTK
Rendering/Core/Testing/Python/TestParallelCoordinates.py
20
1467
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # This example converts data to a field and then displays it using # parallel coordinates, # Create a reader and write out the field reader = vtk.vtkUnstructuredGridReader() reader.S...
bsd-3-clause
ChromiumWebApps/chromium
chrome/test/functional/perf.py
3
96325
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Basic pyauto performance tests. For tests that need to be run for multiple iterations (e.g., so that average and standard devia...
bsd-3-clause
shackra/thomas-aquinas
tests/test_rect.py
1
3515
# This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "s, t 3.1, s, t 6.1, s, t 9.1, s, q" tags = "get_rect, mouse_hit, collision" import summa from summa.director import director from summa.sprite ...
bsd-3-clause
amenonsen/ansible
test/units/modules/network/eos/test_eos_command.py
68
4231
# (c) 2016 Red Hat 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 dis...
gpl-3.0
wolfgangz2013/rt-thread
bsp/stm32f10x/rtconfig.py
7
3604
import os # toolchains options ARCH='arm' CPU='cortex-m3' CROSS_TOOL='gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') #device options # STM32_TYPE = # 'STM32F10X_LD','STM32F10X_LD_VL', # 'STM32F10X_MD','STM32F10X_MD_VL', # 'STM32F10X_HD','STM32F10X_HD_VL', # 'STM32F10X_XL','STM32F10X_CL' STM32_TYPE =...
apache-2.0
roadmapper/ansible
lib/ansible/modules/network/check_point/cp_mgmt_group_with_exclusion.py
20
5215
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage Check Point Firewall (c) 2019 # # 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 o...
gpl-3.0
cenkalti/kuyruk-manager
kuyruk_manager/__init__.py
1
12661
from __future__ import division import os import json import socket import logging import operator import threading from datetime import datetime, timedelta from time import sleep from functools import total_ordering, wraps, partial import amqp from flask import Flask, Blueprint from flask import render_template, redi...
mit
natanielruiz/android-yolo
jni-build/jni/include/tensorflow/contrib/session_bundle/constants.py
4
1313
# 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 or a...
apache-2.0
blackzw/openwrt_sdk_dev1
staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/lib2to3/fixes/fix_ws_comma.py
334
1095
"""Fixer that changes 'a ,b' into 'a, b'. This also changes '{a :b}' into '{a: b}', but does not touch other uses of colons. It does not touch other uses of whitespace. """ from .. import pytree from ..pgen2 import token from .. import fixer_base class FixWsComma(fixer_base.BaseFix): explicit = True # The use...
gpl-2.0
jabjoe/debian-openni2
Packaging/UpdateVersion.py
31
6521
#/**************************************************************************** #* * #* OpenNI 2.x Alpha * #* Copyright (C) 2012 PrimeSense Ltd. * #* ...
apache-2.0
delinhabit/django
django/contrib/sitemaps/views.py
352
2953
import datetime from calendar import timegm from functools import wraps from django.contrib.sites.shortcuts import get_current_site from django.core import urlresolvers from django.core.paginator import EmptyPage, PageNotAnInteger from django.http import Http404 from django.template.response import TemplateResponse fr...
bsd-3-clause
neiudemo1/django
django/db/backends/mysql/client.py
520
1518
import subprocess from django.db.backends.base.client import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'mysql' @classmethod def settings_to_cmd_args(cls, settings_dict): args = [cls.executable_name] db = settings_dict['OPTIONS'].get('db', settings_dic...
bsd-3-clause
ActiveLearningLab/funtool
funtool/reporter.py
2
2515
# Defines a reporter import collections import yaml import importlib import functools import os import funtool.lib.config_parse Reporter = collections.namedtuple('Reporter',['reporter_module','reporter_function','parameters']) # An reporter contains three attributes, # reporter_module this gives the location...
mit
mice-software/maus
tests/py_unit/test_maus_cpp/test_maths/test_polynomial_map.py
1
10671
# This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus # # MAUS 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. # ...
gpl-3.0
Pikecillo/genna
external/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/jt_20000808.py
1
1489
#Jeni Tennison <jeni.tennison@epistemics.co.uk>'s implementation of Oliver Becker's arbitrary sort/XPath conditionals trick. Aug 8 2000. from Xml.Xslt import test_harness sheet_1 = """<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version="1.0"> <xsl:output method="text"/> <xsl:template match="it...
gpl-2.0
pedersen/tgtools.tgext-admin
tests/model/__init__.py
2
8181
#most of this file was taken from turbogears default template from hashlib import sha1 import os import md5 import sha from datetime import datetime #from sqlalchemy.types import * from sqlalchemy import * from sqlalchemy.orm import relation, backref, synonym from sqlalchemy.ext.declarative import DeclarativeMeta, dec...
mit
msegado/edx-platform
common/djangoapps/third_party_auth/api/views.py
61
9007
""" Third Party Auth REST API views """ from django.contrib.auth.models import User from django.db.models import Q from django.http import Http404 from rest_framework.generics import ListAPIView from rest_framework_oauth.authentication import OAuth2Authentication from social.apps.django_app.default.models import UserSo...
agpl-3.0
shpark76/WhereHows
wherehows-etl/src/main/resources/jython/OozieExtract.py
4
10450
# # Copyright 2015 LinkedIn Corp. 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 ...
apache-2.0
j00bar/ansible
lib/ansible/modules/network/panos/panos_check.py
78
4114
#!/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
farvardin/txt2tags-test
targets/html.py
4
5516
""" A HTML 4.0 target. """ from targets import _ import targets from config import HTML_LOWER NAME = _('HTML page') TYPE = 'html' HEADER = """\ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <META NAME="generator" CONTENT="http://txt2tags.org"> <META HTTP-EQUIV="Content-Type" CONTENT="...
gpl-2.0