repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
daeilkim/refinery
refinery/bnpy/bnpy-dev/tests/merge/TestMathForHDPMerges.py
1
14053
''' Unit tests for applying MergeMove.py to HDPModel.py Verification of math behind merge evidence bound (ELBO) calculation. Attributes ----------- self.Data : K=4 simple WordsData object from AbstractBaseTestForHDP self.hmodel : K=4 simple bnpy model from AbstractBaseTestForHDP Coverage ----------- * ELBO Z terms *...
mit
hujiajie/chromium-crosswalk
third_party/pycoverage/coverage/debug.py
211
1706
"""Control of and utilities for debugging.""" import os # When debugging, it can be helpful to force some options, especially when # debugging the configuration mechanisms you usually use to control debugging! # This is a list of forced debugging options. FORCED_DEBUG = [] class DebugControl(object): """Contro...
bsd-3-clause
ryfeus/lambda-packs
Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/cluster_resolver/python/training/cluster_resolver.py
49
6769
# 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 ...
mit
Sjors/bitcoin
test/functional/test_framework/descriptors.py
51
2257
#!/usr/bin/env python3 # Copyright (c) 2019 Pieter Wuille # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Utility functions related to output descriptors""" import re INPUT_CHARSET = "0123456789()[],'/*abcdefgh@:$%{}IJKLMNOPQR...
mit
lenstr/rethinkdb
test/memcached_workloads/multi_serial_mix.py
29
3527
#!/usr/bin/env python # Copyright 2010-2012 RethinkDB, all rights reserved. from __future__ import print_function import sys, os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common'))) import multiprocessing, time, pickle import memcached_workload_common, serial_mix from v...
agpl-3.0
jgcaaprom/android_external_chromium_org
tools/perf/measurements/screenshot.py
32
1640
# 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 os from telemetry.page import page_test from telemetry.page import page_test from telemetry.value import scalar class Screenshot(page_test.PageTest)...
bsd-3-clause
syreal17/Cardinal
dev/feature_extraction/benchmarks/machine_code.py
2
2005
#----------------------------------------------------------------------------- # A Three-Pronged Approach to Exploring the Limits of Static Malware Analyses: # Callsite Parameter Cardinality (CPC) Counting: machine_code.py # # This is a generic implementation of Bitshred which extracts machine code as # n-grams and put...
mit
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/zope.interface-3.6.1-py2.7-macosx-10.10-x86_64.egg/zope/interface/declarations.py
50
41524
############################################################################## # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTW...
gpl-2.0
gandreello/openthread
tests/scripts/thread-cert/Cert_7_1_05_BorderRouterAsRouter.py
3
5808
#!/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 # ...
bsd-3-clause
Beeblio/django
django/contrib/flatpages/templatetags/flatpages.py
2
3629
from django import template from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import get_current_site register = template.Library() class FlatpageNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): self....
bsd-3-clause
jfarrell/thrift
lib/py/src/protocol/TBinaryProtocol.py
32
9102
# # 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 u...
apache-2.0
RO-ny9/python-for-android
python-modules/twisted/twisted/web/distrib.py
52
11667
# -*- test-case-name: twisted.web.test.test_distrib -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Distributed web servers. This is going to have to be refactored so that argument parsing is done by each subprocess and not by the main web server (i.e. GET, POST etc.). """ #...
apache-2.0
cpplucifer/json-parser
googletest/test/gtest_xml_outfiles_test.py
2526
5340
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
mit
maoy/zknova
nova/tests/test_quota.py
1
76720
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
sibson/vncdotool
tests/functional/test_screen.py
2
2968
from unittest import TestCase import sys import os.path import tempfile import pexpect DATADIR = os.path.join(os.path.dirname(__file__), 'data') SIMPLE_PNG = os.path.join(DATADIR, 'simple.png') EXAMPLE_PNG = os.path.join(DATADIR, 'example.png') EXAMPLE_NOCURSOR_PNG = os.path.join(DATADIR, 'example_nocursor.png') ...
mit
MohammedWasim/scikit-learn
examples/mixture/plot_gmm_sin.py
248
2747
""" ================================= Gaussian Mixture Model Sine Curve ================================= This example highlights the advantages of the Dirichlet Process: complexity control and dealing with sparse data. The dataset is formed by 100 points loosely spaced following a noisy sine curve. The fit by the GMM...
bsd-3-clause
imtapps/django-imt-fork
tests/regressiontests/middleware/tests.py
41
30553
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import gzip import re import random from io import BytesIO from django.conf import settings from django.core import mail from django.db import (transaction, connections, DEFAULT_DB_ALIAS, IntegrityError) from djang...
bsd-3-clause
elkingtowa/pyrake
pyrake/contrib/spidermiddleware/depth.py
2
1895
""" Depth Spider Middleware See documentation in docs/topics/spider-middleware.rst """ from pyrake import log from pyrake.http import Request class DepthMiddleware(object): def __init__(self, maxdepth, stats=None, verbose_stats=False, prio=1): self.maxdepth = maxdepth self.stats = stats ...
mit
kosova-holy/Ant
run.py
1
1335
# Copyright 2016 RunSugarRun authors. # See the AUTHORS file found in the top-level directory of this # distribution and at https://github.com/kosova-holy/Ant. # # Licensed under the MIT License. See the LICENSE file found in the # top-level directory of this distribution and at # https://github.com/kosova-holy/Ant. No...
mit
nizox/circuits
tests/web/websocket.py
3
15486
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, ...
mit
lixt/lily2-gem5
src/arch/x86/isa/insts/simd128/integer/logical/por.py
91
2658
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
atuljain/odoo
addons/payment_adyen/models/adyen.py
136
7759
# -*- coding: utf-'8' "-*-" import base64 try: import simplejson as json except ImportError: import json from hashlib import sha1 import hmac import logging import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment_adyen.controllers.main import Adye...
agpl-3.0
dgarros/ansible
lib/ansible/cli/pull.py
27
13088
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.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 lat...
gpl-3.0
grahamhayes/designate
functionaltests/api/v2/clients/zone_import_client.py
2
2417
""" Copyright 2015 Rackspace 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 dist...
apache-2.0
gojira/tensorflow
tensorflow/tools/docs/generate_lib.py
3
19262
# 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
williexing/google-appengine-wx-launcher
launcher/prefcontroller.py
28
5357
#!/usr/bin/env python # # Copyright 2008 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
ddurst/zamboni
mkt/regions/tests/test_middleware.py
19
6147
import socket from django.conf import settings import mock from nose.tools import eq_, ok_ import mkt.site.tests from mkt.users.models import UserProfile import mkt from mkt.api.tests.test_oauth import RestOAuth _langs = ['cs', 'de', 'en-US', 'es', 'fr', 'pl', 'pt-BR', 'pt-PT'] @mock.patch.object(settings, 'LAN...
bsd-3-clause
mtlchun/edx
common/djangoapps/student/migrations/0030_auto__chg_field_anonymoususerid_anonymous_user_id.py
167
10765
# -*- 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): # Changing field 'AnonymousUserId.anonymous_user_id' db.alter_column('student_anonymoususerid', 'anonymous_...
agpl-3.0
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/theano/tensor/nnet/abstract_conv.py
3
46453
""" Abstract conv interface """ import numpy as np import logging from six import reraise, integer_types import sys import theano from theano.tensor import as_tensor_variable, patternbroadcast from theano.tensor import get_scalar_constant_value, NotScalarConstantError from theano.gof import Apply, Op from six.moves...
mit
kalomj/Pollution
node_modules/meanio/node_modules/mean-cli/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py
2736
6387
# 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 #-------------------------------------------------------------------...
mit
varunnaganathan/django
django/contrib/staticfiles/handlers.py
581
2328
from django.conf import settings from django.contrib.staticfiles import utils from django.contrib.staticfiles.views import serve from django.core.handlers.wsgi import WSGIHandler, get_path_info from django.utils.six.moves.urllib.parse import urlparse from django.utils.six.moves.urllib.request import url2pathname clas...
bsd-3-clause
ReconCell/smacha
smacha/test/smacha_generated_py/smacha_test_examples/rosbag_api_recording_1_generate_output.py
2
29795
#!/usr/bin/env python import roslib import rospy import smach import smach_ros from geometry_msgs.msg import Point from geometry_msgs.msg import Point32 from geometry_msgs.msg import PointStamped from geometry_msgs.msg import Pose from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Quate...
bsd-3-clause
mrucci/moto
moto/sqs/utils.py
10
2050
from __future__ import unicode_literals import random import string from .exceptions import MessageAttributesInvalid def generate_receipt_handle(): # http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/ImportantIdentifiers.html#ImportantIdentifiers-receipt-handles length = 185 retur...
apache-2.0
fkolacek/FIT-VUT
bp-revok/python/lib/python2.7/test/test_posix.py
3
13330
"Test posix functions" from test import test_support # Skip these tests if there is no posix module. posix = test_support.import_module('posix') import errno import time import os import pwd import shutil import unittest import warnings warnings.filterwarnings('ignore', '.* potential security risk .*', ...
apache-2.0
wazeerzulfikar/scikit-learn
examples/feature_selection/plot_feature_selection_pipeline.py
58
1049
""" ================== Pipeline Anova SVM ================== Simple usage of Pipeline that runs successively a univariate feature selection with anova and then a C-SVM of the selected features. """ from sklearn import svm from sklearn.datasets import samples_generator from sklearn.feature_selection import SelectKBest,...
bsd-3-clause
alexteodor/odoo
addons/pad/pad.py
14
4194
# -*- coding: utf-8 -*- from openerp.osv import fields, osv import random import re import string import urllib2 import logging from openerp import SUPERUSER_ID from openerp.tools.translate import _ from openerp.tools import html2plaintext from py_etherpad import EtherpadLiteClient _logger = logging.getLogger(__name__...
agpl-3.0
jordiclariana/ansible
lib/ansible/modules/cloud/openstack/os_user_role.py
16
6332
#!/usr/bin/python # Copyright (c) 2016 IBM # # This module 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 software is distrib...
gpl-3.0
scrollback/kuma
vendor/packages/pyparsing/docs/examples/stackish.py
16
2994
# stackish.py # # Stackish is a data representation syntax, similar to JSON or YAML. For more info on # stackish, see http://www.savingtheinternetwithhate.com/stackish.html # # Copyright 2008, Paul McGuire # """ NUMBER A simple integer type that's just any series of digits. FLOAT A simple floating point t...
mpl-2.0
lctseng/NCTU-SDN-Project
openvswitch-2.3.0/tests/test-unix-socket.py
5
1860
# # Copyright (c) 2010, 2012, 2013 Nicira, 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 ag...
apache-2.0
New-Bamboo/mapit
setup.py
1
1464
from setuptools import setup, find_packages import os file_dir = os.path.abspath(os.path.dirname(__file__)) def read_file(filename): filepath = os.path.join(file_dir, filename) return open(filepath).read() def install_requires(): reqs = read_file('requirements.txt') reqs = reqs.splitlines() reqs ...
agpl-3.0
facebook/redex
tools/hprof/dump_classes_from_hprof.py
1
50138
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # Parses Android hprof dumps. # Example usage: # In [1]: import hprof # In [2]: hprof.parse_filename('/Users/tcm/Docume...
mit
AF83/social_auth_py
socialauth/middleware.py
1
3702
import webob import socialauth from socialauth import fb from socialauth import openid_ as openid from socialauth import twitter from socialauth import utils utils.LOGIN_PATH = '/socialauth/login' class SocialAuthMiddleware(object): def __init__(self, app, config, User, prefix=''): """Init the mid...
agpl-3.0
aminert/scikit-learn
benchmarks/bench_lasso.py
297
3305
""" Benchmarks of Lasso vs LassoLars First, we fix a training set and increase the number of samples. Then we plot the computation time as function of the number of samples. In the second benchmark, we increase the number of dimensions of the training set. Then we plot the computation time as function of the number o...
bsd-3-clause
jemekite/youtube-dl
youtube_dl/extractor/izlesene.py
117
4307
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote from ..utils import ( determine_ext, float_or_none, get_element_by_id, int_or_none, parse_iso8601, str_to_int, ) class IzleseneIE(InfoExtractor...
unlicense
Mitchkoens/sympy
sympy/ntheory/bbp_pi.py
50
3810
''' This implementation is a heavily modified fixed point implementation of BBP_formula for calculating the nth position of pi. The original hosted at: http://en.literateprograms.org/Pi_with_the_BBP_formula_(Python) # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and a...
bsd-3-clause
kangareuben/PuppysPen
example/test/TestGame.py
3
2545
#!/usr/bin/python import pygame from gi.repository import Gtk class TestGame: def __init__(self): # Set up a clock for managing the frame rate. self.clock = pygame.time.Clock() self.x = -100 self.y = 100 self.vx = 10 self.vy = 0 self.paused = False ...
mit
Omgitsu/fastrabbit
fastrabbit.py
1
2507
#!/usr/bin/python import os import requests import bitly_api import blower import tweet import twilio_sms from log import log_job from rq import Queue from worker import conn from datetime import datetime from pytz import timezone tz = timezone('US/Pacific') price_target = 35 earliest = 8 latest = 23 _blower = False ...
apache-2.0
slevenhagen/odoo-npg
addons/report_webkit/webkit_report.py
234
16702
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Nicolas Bessi (Camptocamp) # Contributor(s) : Florent Xicluna (Wingo SA) # # WARNING: This program as such is intended...
agpl-3.0
brianmay/karaage
karaage/datastores/ldap.py
2
8621
# Copyright 2010-2017, The University of Melbourne # Copyright 2010-2017, Brian May # # This file is part of Karaage. # # Karaage 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...
gpl-3.0
hatchetation/freeipa
ipalib/plugins/sudorule.py
2
26138
# Authors: # Jr Aquino <jr.aquino@citrixonline.com> # # Copyright (C) 2010 Red Hat # see file 'COPYING' for use and warranty information # # 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, eith...
gpl-3.0
PeterHo/mysite
lists/views.py
1
1052
from django.contrib.auth import get_user_model from django.shortcuts import render, redirect from lists.forms import ItemForm, ExistingListItemForm, NewListForm from .models import Item, List User = get_user_model() def home_page(request): return render(request, 'home.html', {'form': ItemForm()}) def view_lis...
apache-2.0
raeeschachar/edx-e2e-mirror
regression/pages/studio/unit_page.py
1
2615
""" Unit Page for Studio """ from edxapp_acceptance.pages.studio.container import ContainerPage class UnitPageExtended(ContainerPage): """ Unit Page for Studio """ def view_live_version(self): """ Clicks View live version button on Units page which opens a new browser window a...
agpl-3.0
UXE/local-edx
lms/djangoapps/django_comment_client/tests/test_utils.py
12
26847
# -*- coding: utf-8 -*- from datetime import datetime import json from pytz import UTC from django.core.urlresolvers import reverse from django.test import TestCase from django.test.utils import override_settings from edxmako import add_lookup import mock from xmodule.modulestore.tests.django_utils import TEST_DATA_M...
agpl-3.0
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/VTK/Filters/General/Testing/Python/dicer.py
20
1456
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Create the RenderWindow, Renderer and both Actors # ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor() iren.SetR...
gpl-3.0
akita8/risparmi
core.py
1
15428
# -*- coding: utf-8 -*- """ Created on Fri Mar 25 15:33:17 2016 @author: marco """ from requests.exceptions import ConnectionError import datetime as dt import numpy as np from pandas import DataFrame, Series, set_option from pandas_datareader import data from shutil import copytree from os import path, stat class ...
mit
sinbazhou/odoo
addons/l10n_hn/__openerp__.py
343
2260
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2009-2010 Salvatore Josué Trimarchi Pinto <salvatore@trigluu.com> # (http://trigluu.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gen...
agpl-3.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/xml/sax/expatreader.py
82
14675
""" SAX driver for the pyexpat C module. This driver works with pyexpat.__version__ == '2.22'. """ version = "0.20" from xml.sax._exceptions import * from xml.sax.handler import feature_validation, feature_namespaces from xml.sax.handler import feature_namespace_prefixes from xml.sax.handler import feature_external_...
gpl-2.0
toomoresuch/pysonengine
app/distlib/pytz/gae.py
8
2880
""" A pytz version that runs smoothly on Google App Engine. Based on http://appengine-cookbook.appspot.com/recipe/caching-pytz-helper/ To use, add pytz to your path normally, but import it from the gae module: from pytz.gae import pytz Applied patches: - The zoneinfo dir is removed fr...
mit
acshan/odoo
addons/hr_timesheet/hr_timesheet.py
291
10253
# -*- 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
louiskun/flaskGIT
venv/lib/python2.7/site-packages/flask/testsuite/__init__.py
564
7022
# -*- coding: utf-8 -*- """ flask.testsuite ~~~~~~~~~~~~~~~ Tests Flask itself. The majority of Flask is already tested as part of Werkzeug. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import print_function import os import sys im...
mit
ChanduERP/odoo
addons/l10n_be_coda/l10n_be_coda.py
340
1253
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
mcgachey/edx-platform
openedx/core/lib/api/authentication.py
36
3458
""" Common Authentication Handlers used across projects. """ from rest_framework.authentication import SessionAuthentication from rest_framework_oauth.authentication import OAuth2Authentication from rest_framework.exceptions import AuthenticationFailed from rest_framework_oauth.compat import oauth2_provider, provider_n...
agpl-3.0
inspirehep/invenio
modules/bibcirculation/lib/bibcirculation_utils.py
24
30859
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 CERN. ## ## Invenio 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 ## ...
gpl-2.0
kevinastone/sentry
src/sentry/migrations/0085_auto__del_unique_project_slug__add_unique_project_slug_team.py
36
23551
# -*- 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): # Removing unique constraint on 'Project', fields ['slug'] db.delete_unique('sentry_project', ['slug']) ...
bsd-3-clause
jballanc/openmicroscopy
components/tools/OmeroPy/src/omero_fuse.py
5
7805
#!/usr/bin/env python # -*- coding: utf-8 -*- # # omero_fuse.py - FUSE based OMERO client # # Copyright (c) 2009 Glencoe Software, Inc. All rights reserved. # # This software is distributed under the terms described by the LICENCE file # you can find at the root of the distribution bundle, which states you are # fre...
gpl-2.0
avolkov1/keras_experiments
examples/resnet/resnet50_tfrecord_horovod.py
1
9501
''' Run Resnet50 on Imagenet data. Generate TFrecords for Imagenet data by following instructions in: examples/build_imagenet_data/README.md run: # 4 GPU machine 2 sockets typically --map-by ppr:2:socket works well. TMPDIR=/tmp mpirun --report-bindings \ --map-by ppr:2:socket -oversubscribe -np 4 p...
unlicense
yograterol/django
tests/auth_tests/test_validators.py
229
7546
from __future__ import unicode_literals import os from django.contrib.auth.models import User from django.contrib.auth.password_validation import ( CommonPasswordValidator, MinimumLengthValidator, NumericPasswordValidator, UserAttributeSimilarityValidator, get_default_password_validators, get_password_val...
bsd-3-clause
cockroachdb/examples-orms
python/django/cockroach_example/migrations/0001_initial.py
1
1458
# -*- coding: utf-8 -*- # Generated by Django 1.11.25 on 2019-10-14 18:21 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Cre...
apache-2.0
cs-au-dk/Artemis
WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
1
50829
#!/usr/bin/env python # 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 ...
gpl-3.0
lafayette/JBTT
framework/python/Lib/encodings/big5hkscs.py
816
1039
# # big5hkscs.py: Python Unicode Codec for BIG5HKSCS # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_hk, codecs import _multibytecodec as mbc codec = _codecs_hk.getcodec('big5hkscs') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.Multib...
mit
itkvideo/ITK
Examples/Filtering/CurvatureFlowImageFilter.py
13
1643
#========================================================================== # # Copyright Insight Software Consortium # # 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...
apache-2.0
armando-migliaccio/tempest
tempest/services/compute/xml/flavors_client.py
3
8492
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
apache-2.0
yencarnacion/jaikuengine
.google_appengine/lib/django-1.4/django/conf/locale/it/formats.py
99
1838
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' # 25 Ottobre 2006 TIME_FORMAT = 'H:i:s' # 14:30:59 DATETIME_FORMAT...
apache-2.0
HackerspaceWroclaw/wlokalu
wlokalu/api/v1/views.py
1
4880
#!/usr/bin/python from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt import django.shortcuts import json from wlokalu.api import presence #----------------------------------------------------------------------------- from wlokalu.logging import getLogger, message as log logger...
gpl-3.0
mattrobenolt/django
tests/project_template/test_settings.py
67
1087
import sys import unittest from django.test import TestCase @unittest.skipIf(sys.version_info < (3, 3), 'Python < 3.3 cannot import the project template because ' 'django/conf/project_template doesn\'t have an __init__.py file.') class TestStartProjectSettings(TestCase): def test_middleware_classes_head...
bsd-3-clause
ychfan/tensorflow
tensorflow/python/keras/_impl/keras/preprocessing/sequence.py
17
7940
# 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
traveloka/ansible
lib/ansible/utils/module_docs_fragments/ovirt.py
5
3302
# -*- coding: utf-8 -*- # # Copyright (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) ...
gpl-3.0
pcrews/kewpie
lib/modes/native/native_test_execution.py
22
3508
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2011 Patrick Crews # # # 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 Softwar...
apache-2.0
blogen5minutos/blog_template
pelican-plugins/liquid_tags/gram.py
41
3590
""" Instagram Image Tag ------------------- By `Tom Spalding <https://github.com/digitalvapor>`_ You can see a working example at `antivapor.net/instagram-tag.html <http://antivapor.net/instagram-tag.html>`_. Based on `Liquid Image Tag <https://github.com/getpelican/pelican-plugins/blob/master/liquid_tags/img.py>`_ ...
apache-2.0
blockcypher/blockcypher-python
blockcypher/constants.py
1
9148
from collections import defaultdict # Ordered List of Coin Symbol Dictionaries COIN_SYMBOL_ODICT_LIST = [ { 'coin_symbol': 'btc', 'display_name': 'Bitcoin', 'display_shortname': 'BTC', 'blockcypher_code': 'btc', 'blockcypher_network': 'main', ...
apache-2.0
knandya/ursula
library/sefcontext.py
12
8532
#!/usr/bin/python # (c) 2016, 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) an...
mit
Karm/qpid-proton
tests/tools/apps/python/msgr-recv.py
8
7163
#!/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 # ...
apache-2.0
pdellaert/ansible
lib/ansible/modules/cloud/vmware/vmware_portgroup_info.py
21
8479
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de> # 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_fu...
gpl-3.0
gqwest-erp/server
openerp/addons/sale_margin/__openerp__.py
171
1634
############################################################################## # # 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
zero-db/zerodb
tests/test_db.py
2
9380
import logging import mock import transaction from itertools import islice from db import Page, Salary, Department from zerodb.catalog.query import Contains, InRange, Eq, Gt # Also need to test optimize, Lt(e), Gt(e) logging.basicConfig(level=logging.DEBUG) def test_query(db): pre_request_count = db._storage._de...
agpl-3.0
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/git/refs/reference.py
6
3987
from symbolic import SymbolicReference import os from git.objects import Object from git.util import ( LazyMixin, Iterable, ) from gitdb.util import ( isfile, hex_to_bin ) __all__ = ["Reference"] #{ Utilities def require_remote_ref_path(func): """A decorator raising a TypeError ...
agpl-3.0
moto-timo/ironpython3
Tests/test_ironmath.py
1
10418
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of th...
apache-2.0
rahushen/ansible
lib/ansible/modules/network/eos/eos_l2_interface.py
25
10611
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, 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_version': '1.1', ...
gpl-3.0
google/tf-quant-finance
tf_quant_finance/experimental/local_stochastic_volatility/__init__.py
1
1112
# Lint as: python3 # 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 agr...
apache-2.0
ztemt/V5s_N918St_KitKat_kernel
scripts/build-all.py
236
11419
#! /usr/bin/env python # Copyright (c) 2009-2014, The Linux Foundation. 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 # ...
gpl-2.0
umitanuki/chainer
chainer/functions/cross_covariance.py
21
2062
import numpy from chainer import cuda from chainer import function from chainer import utils from chainer.utils import type_check class CrossCovariance(function.Function): """Cross-covariance loss.""" def __init__(self): self.y_centered = None self.z_centered = None self.covariance ...
mit
nikolas/django-threadedcomments
threadedcomments/migrations/0001_initial.py
2
1459
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations, connection import django.db.models.deletion is_index = connection.vendor != 'mysql' class Migration(migrations.Migration): dependencies = [ ('django_comments', '__first__'), ] operations =...
bsd-3-clause
kustomzone/Fuzium
core/plugins/Zeroname/SiteManagerPlugin.py
5
3086
import logging import re import time from Config import config from Plugin import PluginManager allow_reload = False # No reload supported log = logging.getLogger("ZeronamePlugin") @PluginManager.registerTo("SiteManager") class SiteManagerPlugin(object): site_zeroname = None db_domains = None db_domai...
mit
yuewko/neutron
neutron/tests/tempest/services/identity/v3/json/token_client.py
23
6596
# Copyright 2015 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
neopack1/xbmc
lib/gtest/test/gtest_filter_unittest.py
2826
21261
#!/usr/bin/env python # # Copyright 2005 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...
gpl-2.0
keyurpatel076/MissionPlannerGit
Lib/distutils/log.py
255
1686
"""A simple log mechanism styled after PEP 282.""" # The class here is styled after PEP 282 so that it could later be # replaced with a standard Python logging implementation. DEBUG = 1 INFO = 2 WARN = 3 ERROR = 4 FATAL = 5 import sys class Log: def __init__(self, threshold=WARN): self.threshold = thre...
gpl-3.0
DezG/buildroot-linux-kernel-m3
tools/perf/scripts/python/syscall-counts.py
944
1429
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
jsanjuas/py-hyperleveldb
test/try.py
43
2259
#!/usr/bin/python # Copyright (c) Arni Mar Jonsson. # See LICENSE for details. import leveldb, pointless, random, string, itertools, collections from twisted.internet import reactor, defer, threads def compare(a, b): return cmp(a, b) c = 'bytewise' c = ('leveldb.BytewiseComparator', compare) kw = { 'create_if_m...
bsd-3-clause
jakubbrindza/gtg
GTG/backends/generictomboy.py
1
24756
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
gpl-3.0
e-schumann/proxy_doodle
external/boost/tools/build/test/builtin_glob_archive.py
14
7339
#!/usr/bin/python # Copyright 2014 Steven Watanabe # Copyright 2015 Artur Shepilko # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # This tests the GLOB_ARCHIVE rule. import os import sys import StringIO import BoostBuild ...
mit