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
dang03/son-cli
src/son/package/package.py
5
37530
# Copyright (c) 2015 SONATA-NFV, UBIWHERE # 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 app...
apache-2.0
datenbetrieb/odoo
addons/account/ir_sequence.py
336
2454
# -*- 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
sugarsweetrobotics/wasanbon
wasanbon/core/plugins/admin/wsconverter_plugin/host/outport_converter.py
1
2057
import os, sys from common_converter import * _template = """ import yaml, traceback import RTC import OpenRTM_aist _data = $CONSTRUCTOR _port = OpenRTM_aist.OutPort("$NAME", _data) def convert(data, d_list): it = iter(d_list) $CODE print 'converted:', data return data def _sendData(d_list): convert(_dat...
gpl-3.0
tsdmgz/ansible
test/runner/lib/sanity/ansible_doc.py
8
2303
"""Sanity test for ansible-doc.""" from __future__ import absolute_import, print_function from lib.sanity import ( SanityMultipleVersion, SanityFailure, SanitySuccess, SanitySkipped, ) from lib.util import ( SubprocessError, display, intercept_command, ) from lib.ansible_util import ( ...
gpl-3.0
alonisser/Open-Knesset
persons/migrations/0008_auto__add_field_role_start_date__add_field_role_end_date__add_field_ro.py
14
16326
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Role.start_date' db.add_column(u'persons_role', 'start_da...
bsd-3-clause
ShownX/incubator-mxnet
python/mxnet/executor_manager.py
38
17449
# 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
slohse/ansible
lib/ansible/modules/windows/win_hotfix.py
28
4410
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub, actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview']...
gpl-3.0
JVillella/tensorflow
tensorflow/contrib/training/python/training/training.py
50
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 applicable ...
apache-2.0
bspink/django
django/db/migrations/recorder.py
478
2868
from __future__ import unicode_literals from django.apps.registry import Apps from django.db import models from django.db.utils import DatabaseError from django.utils.encoding import python_2_unicode_compatible from django.utils.timezone import now from .exceptions import MigrationSchemaMissing class MigrationRecor...
bsd-3-clause
bartvm/GroundHog
experiments/nmt/web-demo/sample_server.py
11
6918
#!/usr/bin/env python import argparse import cPickle import traceback import logging import time import sys import os import numpy import experiments.nmt from experiments.nmt import\ RNNEncoderDecoder,\ prototype_state,\ parse_input from experiments.nmt.sample import sample, BeamSearch import BaseHTTPSe...
bsd-3-clause
volaya/processing_pysal
ext-libs/pysal/esda/mixture_smoothing.py
7
11182
""" Emprical Bayesian smoother using non-parametric mixture models to specify the prior distribution of risks This module is a python translation of mixlag function in CAMAN R package that is originally written by Peter Schlattmann. """ __author__ = "Myunghwa Hwang <mhwang4@gmail.com>, Luc Anselin <luc.anselin@asu.ed...
gpl-2.0
bq/web2board
res/common/Scons/sconsFiles/SCons/Taskmaster.py
6
40565
# # Copyright (c) 2001 - 2015 The SCons Foundation # # 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, modify, merge...
lgpl-3.0
resmo/ansible
lib/ansible/modules/network/onyx/onyx_lldp_interface.py
118
7407
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
jmhsi/justin_tinker
data_science/courses/learning_dl_packages/models/research/object_detection/utils/object_detection_evaluation.py
21
10478
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
ubc/edx-platform
lms/djangoapps/mobile_api/social_facebook/__init__.py
128
1714
""" Social Facebook API """ # TODO # There are still some performance and scalability issues that should be # addressed for the various endpoints in this social_facebook djangoapp. # # For the Courses and Friends API: # For both endpoints, we are retrieving the same data from the Facebook server. # We are then simply ...
agpl-3.0
M4rtinK/tsubame
core/bundle/requests/packages/chardet/euctwprober.py
2994
1676
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-3.0
rajalokan/keystone
keystone/identity/mapping_backends/sql.py
3
4720
# Copyright 2014 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
malconis/deproxy
docs/conf.py
3
7768
# -*- coding: utf-8 -*- # # deproxy documentation build configuration file, created by # sphinx-quickstart on Mon Apr 15 16:14:10 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
mit
spmjc/plugin.video.freplay
resources/lib/channels/rmcd.py
1
1233
#-*- coding: utf-8 -*- import urllib2 import re import CommonFunctions common = CommonFunctions from resources.lib import utils from resources.lib import globalvar import json title=['RMC Decouverte'] img=['rmcd'] readyForUse=True url_video_json='https://edge.api.brightcove.com/playback/v1/accounts/%s/vi...
gpl-2.0
michaelni/audacity
lib-src/lv2/lilv/waflib/Tools/ldc2.py
330
1029
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import sys from waflib.Tools import ar,d from waflib.Configure import conf @conf def find_ldc2(conf): conf.find_program(['ldc2'],var='D') out=conf.cmd_and_log([conf.env.D,'-...
gpl-2.0
imitrichev/cantera
interfaces/cython/cantera/examples/onedim/flamespeed_sensitivity.py
3
2109
""" Sensitivity analysis for a freely-propagating, premixed methane-air flame. Computes the sensitivity of the laminar flame speed with respect to each reaction rate constant. """ from __future__ import print_function import cantera as ct import numpy as np # Simulation parameters p = ct.one_atm # pressure [Pa] Tin...
bsd-3-clause
jplana/python-etcd
setup.py
1
1239
from setuptools import setup, find_packages import sys, os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.4.5' install_requires = [ 'urllib3>=1.7.1', 'dnspython>=1.13.0' ] test_requires...
mit
gifford-lab/bcbio-nextgen
bcbio/heterogeneity/bubbletree.py
3
17272
"""Estimate tumor purity and frequency using copy number and allele freqencies with BubbleTree. http://www.bioconductor.org/packages/release/bioc/html/BubbleTree.html http://www.bioconductor.org/packages/release/bioc/vignettes/BubbleTree/inst/doc/BubbleTree-vignette.html """ import collections import csv import os imp...
mit
GreenGear5/planet-wars
bots/ml-rfc/ml-rfc.py
1
4276
#!/usr/bin/env python """ Uses the Random Forest classifier """ from api import State, util import random, os from sklearn.externals import joblib DEFAULT_MODEL = os.path.dirname(os.path.realpath(__file__)) + '/model.pkl' class Bot: __max_depth = -1 __randomize = True __model = None def __init__...
mit
Flavsditz/projects
eyeTracking/pupil/pupil_src/capture/recorder.py
1
4963
import os, sys import cv2 import atb import numpy as np from plugin import Plugin from time import strftime,localtime,time,gmtime from ctypes import create_string_buffer from git_version import get_tag_commit class Recorder(Plugin): """Capture Recorder""" def __init__(self, session_str, fps, img_shape, shared_...
gpl-2.0
pratikmallya/hue
desktop/core/ext-py/pytidylib-0.2.1/tidylib/sink.py
50
3603
# Copyright 2009 Jason Stitt # # 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, modify, merge, publish, distribute...
apache-2.0
eicher31/compassion-modules
message_center_compassion/__manifest__.py
4
2053
# -*- coding: utf-8 -*- ############################################################################## # # ______ Releasing children from poverty _ # / ____/___ ____ ___ ____ ____ ___________(_)___ ____ # / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \ # / /___/ /_/ / / / / / / /_/...
agpl-3.0
Fusion-Rom/android_external_chromium_org
tools/telemetry/telemetry/unittest/gtest_progress_reporter_unittest.py
26
3769
# 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 sys import unittest from telemetry.core import exceptions from telemetry.unittest import gtest_progress_reporter from telemetry.unittest import simpl...
bsd-3-clause
alicianoel/InstaMap
lib/werkzeug/useragents.py
317
5300
# -*- coding: utf-8 -*- """ werkzeug.useragents ~~~~~~~~~~~~~~~~~~~ This module provides a helper to inspect user agent strings. This module is far from complete but should work for most of the currently available browsers. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more deta...
apache-2.0
tod31/pyload
module/plugins/hoster/UpstoreNet.py
5
3247
# -*- coding: utf-8 -*- import re from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster class UpstoreNet(SimpleHoster): __name__ = "UpstoreNet" __type__ = "hoster" __version__ = "0.11" __status__ = "testing" __pattern__ = r'h...
gpl-3.0
skullface1/android_kernel_samsung_i9105
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
leosongwei/mutagen
tests/test_aac.py
4
3166
import os from tempfile import mkstemp import shutil from mutagen.id3 import ID3, TIT1 from mutagen.aac import AAC, AACError from tests import TestCase class TADTS(TestCase): def setUp(self): original = os.path.join("tests", "data", "empty.aac") fd, self.filename = mkstemp(suffix='.aac') ...
gpl-2.0
taaviteska/django
django/db/models/functions/datetime.py
23
9441
from datetime import datetime from django.conf import settings from django.db.models import ( DateField, DateTimeField, IntegerField, TimeField, Transform, ) from django.db.models.lookups import ( YearExact, YearGt, YearGte, YearLt, YearLte, ) from django.utils import timezone from django.utils.functional impo...
bsd-3-clause
li282886931/apistore
server/controllers/novelhandler.py
1
8379
# -*- coding: utf-8 -*- import json import datetime import urllib import hashlib import tornado.gen import tornado.web import tornado.httpclient from controllers.basehandler import BaseHandler from models.novelmodel import NovelModel import utils from utils import json_success, json_failed, cache_error import const ...
gpl-2.0
txemi/ansible
contrib/inventory/abiquo.py
52
8799
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' External inventory script for Abiquo ==================================== Shamelessly copied from an existing inventory script. This script generates an inventory that Ansible can understand by making API requests to Abiquo API Requires some python libraries, ensure ...
gpl-3.0
pratikone/videoVenom
moviepy/video/fx/painting.py
19
1412
#------- CHECKING DEPENDENCIES ----------------------------------------- painting_possible = True try: from skimage.filter import sobel except: try: from scipy.ndimage.filters import sobel except: painting_possible = False #-------------------------------------------------------------------...
gpl-3.0
goblinhack/MundusMeus
python/things/rock.py
1
1729
import tp import mm def thing_init(t): return def rock_init(name, short_name, tiles=[]): x = tp.Tp(name) x.set_is_shadow_caster_soft(True) x.set_is_shadow_caster(True) x.set_short_name(short_name) x.set_is_movement_blocking(True) x.set_is_rock(True) x.set_z_depth(mm.Z_DEPTH_ROCK) ...
lgpl-3.0
jeremi/couchdbkit
couchdbkit/ext/django/loading.py
1
5298
# -*- coding: utf-8 -*- # # Copyright (c) 2008-2009 Benoit Chesneau <benoitc@e-engura.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTW...
isc
zanderle/django
tests/validation/test_error_messages.py
398
3642
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from unittest import TestCase from django.core.exceptions import ValidationError from django.db import models class ValidationMessagesTest(TestCase): def _test_validation_messages(self, field, value, expected): with self.assertRaises(Val...
bsd-3-clause
fly19890211/edx-platform
lms/djangoapps/shoppingcart/tests/test_pdf.py
165
11086
""" Tests for Pdf file """ from datetime import datetime from django.test.utils import override_settings from django.conf import settings import unittest from io import BytesIO from shoppingcart.pdf import PDFInvoice from shoppingcart.utils import parse_pages PDF_RECEIPT_DISCLAIMER_TEXT = "THE SITE AND ANY INFORMATION...
agpl-3.0
elventear/ansible-modules-extras
packaging/os/pacman.py
19
8523
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2012, Afterburn <http://github.com/afterburn> # (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.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
dgies/incubator-airflow
airflow/hooks/webhdfs_hook.py
44
3983
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
jacobmetrick/Flexget
flexget/plugins/filter/duplicates.py
8
1382
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.event import event log = logging.getLogger('duplicates') class Duplicates(object): """ Take action on entries with duplicate field values Example:: duplicates: field:...
mit
RaspberryPiFi/PiCode
lib/eyed3/plugins/__init__.py
3
7444
# -*- coding: utf-8 -*- ################################################################################ # Copyright (C) 2012 Travis Shirk <travis@pobox.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 So...
gpl-2.0
android-ia/platform_external_chromium_org
chrome/browser/web_dev_style/html_checker.py
36
1536
# 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. """ Presubmit for Chromium HTML resources. See chrome/browser/PRESUBMIT.py. """ import regex_check class HtmlChecker(object): def __init__(self, input_a...
bsd-3-clause
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/google/appengine/ext/db/stats.py
12
13681
#!/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...
bsd-3-clause
EricMuller/mywebmarks-backend
requirements/twisted/Twisted-17.1.0/src/twisted/web/rewrite.py
83
1852
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # from twisted.web import resource class RewriterResource(resource.Resource): def __init__(self, orig, *rewriteRules): resource.Resource.__init__(self) self.resource = orig self.rewriteRules = list(rewriteRules) ...
mit
conwayje/ase-python
ase/test/COCu111_2.py
10
1850
from math import sqrt from ase import Atoms, Atom from ase.constraints import FixAtoms from ase.optimize import FIRE, QuasiNewton, BFGS from ase.neb import SingleCalculatorNEB from ase.calculators.emt import EMT Optimizer = BFGS # Distance between Cu atoms on a (111) surface: a = 3.6 d = a / sqrt(2) fcc111 = Atoms(sy...
gpl-2.0
brownharryb/erpnext
erpnext/hr/doctype/leave_encashment/leave_encashment.py
9
3654
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import getdate, nowdate, flt from erpnex...
gpl-3.0
adobe-type-tools/fontlab-scripts
MM Designs/SaveFilesForMakeInstances.py
2
17235
#FLM: Save Files for MakeInstances ################################################### ### THE VALUES BELOW CAN BE EDITED AS NEEDED ###### ################################################### kDefaultMMFontFileName = "mmfont.pfa" kInstancesDataFileName = "instances" kCompositeDataName = "temp.composite.dat" #########...
mit
insilichem/ommprotocol
ommprotocol/md.py
1
30554
#!/usr/bin/env python # -*- coding: utf-8 -*- # ommprotocol: A command line application to launch # MD protocols with OpenMM # By Jaime RGP <@jaimergp> """ ommprotocol.md -------------- All the logic that governs the simulation of a MD protocol, stage by stage. A protocol is a chained list of stages, w...
lgpl-3.0
pyparallel/numpy
numpy/lib/tests/test_io.py
5
72628
from __future__ import division, absolute_import, print_function import sys import gzip import os import threading from tempfile import mkstemp, NamedTemporaryFile import time import warnings import gc from io import BytesIO from datetime import datetime import numpy as np import numpy.ma as ma from numpy.lib._iotool...
bsd-3-clause
pleaseproject/python-for-android
python3-alpha/python3-src/Lib/ctypes/test/test_internals.py
53
2626
# This tests the internal _objects attribute import unittest from ctypes import * from sys import getrefcount as grc # XXX This test must be reviewed for correctness!!! """ ctypes' types are container types. They have an internal memory block, which only consists of some bytes, but it has to keep references to other...
apache-2.0
freedomtan/workload-automation
wlauto/workloads/glbcorp/__init__.py
2
7939
# Copyright 2013-2015 ARM Limited # # 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 w...
apache-2.0
aselle/tensorflow
tensorflow/tools/git/gen_git_source.py
16
11674
#!/usr/bin/env python # 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 # # Unle...
apache-2.0
zouyapeng/horizon
openstack_dashboard/test/integration_tests/pages/loginpage.py
13
3353
# 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
tgibson37/tiny-c
cairopy.py
1
2552
import sys import os import cairo import shlex def comment(cmt): cmt = cmt[:-1] #print "in comment: ", cmt def draw(x): global ctx ''' hard way: very long list of if-elif's if x[0] == "moveto": ctx.move_to( int(x[1]), int(x[2]) ) elif x[0] == "lineto": ctx.line_to( int(x[1]), int(x[2]) ) ctx.stroke(...
gpl-3.0
glenngillen/dotfiles
.vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/server/cli.py
1
14441
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals import json import os import re import runpy import sys # debugpy.__m...
mit
mitsuhiko/sqlalchemy
lib/sqlalchemy/orm/instrumentation.py
4
16908
# orm/instrumentation.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Defines SQLAlchemy's system of class instrumentation. This module is usuall...
mit
praba230890/frappe
frappe/website/render.py
10
5873
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import cstr import mimetypes, json from werkzeug.wrappers import Response from werkzeug.routing import Map, Rule, NotFound fr...
mit
jacksonwilliams/arsenalsuite
cpp/lib/PyQt4/examples/tools/qtdemo/displayshape.py
11
13516
############################################################################ ## ## Copyright (C) 2004-2005 Trolltech AS. All rights reserved. ## ## This file is part of the example classes of the Qt Toolkit. ## ## This file may be used under the terms of the GNU General Public ## License version 2.0 as published by the...
gpl-2.0
jangle789/git-repo
subcmds/checkout.py
48
1747
# # Copyright (C) 2009 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
ABaldwinHunter/flask-clone-classic
examples/flaskr/flaskr.py
157
2893
# -*- coding: utf-8 -*- """ Flaskr ~~~~~~ A microblog example application written as Flask tutorial with Flask and sqlite3. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os from sqlite3 import dbapi2 as sqlite3 from flask import Flask, request...
bsd-3-clause
drnextgis/mapproxy
mapproxy/test/unit/test_util_conf_utils.py
6
2557
# -:- encoding: utf-8 -:- # This file is part of the MapProxy project. # Copyright (C) 2013 Omniscale <http://omniscale.de> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.a...
apache-2.0
nettrom/importance
python/wikiproject/confusion-matrix.py
1
8866
#!/usr/env/python # -*- coding: utf-8 -*- ''' Script to predict articles for an entire WikiProject using its trained model and the entire snapshot dataset. Copyright (c) 2017 Morten Wang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (t...
mit
kerneltask/micropython
tests/extmod/framebuf1.py
15
2168
try: import framebuf except ImportError: print("SKIP") raise SystemExit w = 5 h = 16 size = w * h // 8 buf = bytearray(size) maps = { framebuf.MONO_VLSB: "MONO_VLSB", framebuf.MONO_HLSB: "MONO_HLSB", framebuf.MONO_HMSB: "MONO_HMSB", } for mapping in maps.keys(): for x in range(size): ...
mit
IITBinterns13/edx-platform-dev
lms/djangoapps/instructor/tests/test_forum_admin.py
5
7953
""" Unit tests for instructor dashboard forum administration """ from django.test.utils import override_settings # Need access to internal func to put users in the right group from django.contrib.auth.models import Group, User from django.core.urlresolvers import reverse from django_comment_common.models import Rol...
agpl-3.0
JoaoRodrigues/pdb-tools
pdbtools/pdb_b.py
2
4773
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 João Pedro Rodrigues # # 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 # # Unl...
apache-2.0
MarkusHackspacher/unknown-horizons
horizons/gui/tabs/residentialtabs.py
1
5161
# ################################################### # Copyright (C) 2008-2017 The Unknown Horizons Team # team@unknown-horizons.org # This file is part of Unknown Horizons. # # Unknown Horizons is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
gpl-2.0
helenst/django
tests/cache/tests.py
11
84598
# -*- coding: utf-8 -*- # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. from __future__ import unicode_literals import os import re import copy import shutil import tempfile import threading import time import unittest import warnings from django.conf import settings ...
bsd-3-clause
davidsminor/gaffer
python/GafferRenderManTest/RenderManShaderTest.py
1
61179
########################################################################## # # Copyright (c) 2013, Image Engine Design 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: # # * Red...
bsd-3-clause
proxysh/Safejumper-for-Desktop
buildlinux/env64/lib/python2.7/site-packages/pyasn1_modules/pem.py
127
1893
import base64, sys stSpam, stHam, stDump = 0, 1, 2 # The markers parameters is in form ('start1', 'stop1'), ('start2', 'stop2')... # Return is (marker-index, substrate) def readPemBlocksFromFile(fileObj, *markers): startMarkers = dict(map(lambda x: (x[1],x[0]), enumerate(map(lambda x: ...
gpl-2.0
agiliq/django
tests/nested_foreign_keys/tests.py
45
9417
from __future__ import unicode_literals from django.test import TestCase from .models import Person, Movie, Event, Screening, ScreeningNullFK, Package, PackageNullFK # These are tests for #16715. The basic scheme is always the same: 3 models with # 2 relations. The first relation may be null, while the second is no...
bsd-3-clause
Mozhuowen/brython
www/src/Lib/xml/etree/ElementTree.py
730
61800
# # ElementTree # $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $ # # light-weight XML support for Python 2.3 and later. # # history (since 1.2.6): # 2005-11-12 fl added tostringlist/fromstringlist helpers # 2006-07-05 fl merged in selected changes from the 1.3 sandbox # 2006-07-05 fl removed support for ...
bsd-3-clause
nttks/edx-platform
common/lib/xmodule/xmodule/partitions/partitions.py
59
7569
"""Defines ``Group`` and ``UserPartition`` models for partitioning""" from collections import namedtuple from stevedore.extension import ExtensionManager # We use ``id`` in this file as the IDs of our Groups and UserPartitions, # which Pylint disapproves of. # pylint: disable=redefined-builtin class UserPartitionEr...
agpl-3.0
alimony/django
tests/admin_utils/test_logentry.py
15
11499
import json from datetime import datetime from django.contrib.admin.models import ADDITION, CHANGE, DELETION, LogEntry from django.contrib.admin.utils import quote from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.test import TestCase, override_settings ...
bsd-3-clause
MattsFleaMarket/python-for-android
python-modules/twisted/twisted/persisted/crefutil.py
61
4644
# -*- test-case-name: twisted.test.test_persisted -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Utility classes for dealing with circular references. """ from twisted.python import log, reflect try: from new import instancemethod except: from org.python.core impo...
apache-2.0
ferabra/edx-platform
cms/djangoapps/contentstore/management/commands/reindex_course.py
94
4580
""" Management command to update courses' search index """ import logging from django.core.management import BaseCommand, CommandError from optparse import make_option from textwrap import dedent from contentstore.courseware_index import CoursewareSearchIndexer from search.search_engine_base import SearchEngine from e...
agpl-3.0
Lokke/eden
modules/tests/asset/asset_search.py
24
3143
# -*- coding: utf-8 -*- """ Sahana Eden Asset Module Automated Tests @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to de...
mit
caidongyun/WinObjC
deps/3rdparty/icu/icu/source/tools/icu-svnprops-check.py
388
9251
#! /usr/bin/python # Copyright (C) 2009-2011, International Business Machines Corporation, Google and Others. # All rights reserved. # # Script to check and fix svn property settings for ICU source files. # Also check for the correct line endings on files with svn:eol-style = native # # THIS SCRIPT DOES NOT WORK O...
mit
vFense/vFenseAgent-nix
agent/deps/mac/Python-2.7.5/lib/python2.7/distutils/tests/test_build_scripts.py
95
3600
"""Tests for distutils.command.build_scripts.""" import os import unittest from distutils.command.build_scripts import build_scripts from distutils.core import Distribution import sysconfig from distutils.tests import support from test.test_support import run_unittest class BuildScriptsTestCase(support.TempdirMana...
lgpl-3.0
olandese/azure-quickstart-templates
201-vmss-bottle-autoscale/workserver.py
103
1704
# workserver.py - simple HTTP server with a do_work / stop_work API # GET /do_work activates a worker thread which uses CPU # GET /stop_work signals worker thread to stop import math import socket import threading import time from bottle import route, run hostname = socket.gethostname() hostport = 9000 keepworking = ...
mit
yceruto/django
tests/forms_tests/tests/test_regressions.py
7
8127
# -*- coding: utf-8 -*- from __future__ import unicode_literals import warnings from django.forms import ( CharField, ChoiceField, Form, HiddenInput, IntegerField, ModelForm, ModelMultipleChoiceField, MultipleChoiceField, RadioSelect, Select, TextInput, ) from django.test import TestCase from django.utils...
bsd-3-clause
foobacca/django-cms
cms/plugins/inherit/migrations/0002_fieldchanges.py
18
2700
# -*- coding: utf-8 -*- from south.db import db from django.db import models from cms.plugins.flash.models import * class Migration: def forwards(self, orm): "Write your forwards migration here" def backwards(self, orm): "Write your backwards migration here" models = { ...
bsd-3-clause
double-y/django
tests/utils_tests/test_timesince.py
293
6089
from __future__ import unicode_literals import datetime import unittest from django.test.utils import requires_tz_support from django.utils import timezone from django.utils.timesince import timesince, timeuntil class TimesinceTests(unittest.TestCase): def setUp(self): self.t = datetime.datetime(2007, ...
bsd-3-clause
iocube/Gimme-JSON-backend
app/fields.py
1
1417
import re import json from marshmallow import fields, ValidationError from bson.objectid import ObjectId class JSONStringField(fields.Field): def _serialize(self, value, attr, obj): return value def _deserialize(self, value, attr, data): try: json.loads(value) return ...
mit
hiseh/yinanan
tps/converter/formats.py
1
2208
#!/usr/bin/env python class BaseFormat(object): """ Base format class. Supported formats are: ogg, avi, mkv, webm, flv, mov, mp4, mpeg """ format_name = None ffmpeg_format_name = None def parse_options(self, opt): if 'format' not in opt or opt.get('format') != self.format_name: ...
mit
JazzeYoung/VeryDeepAutoEncoder
theano/gpuarray/tests/test_basic_ops.py
1
17095
from __future__ import absolute_import, print_function, division import unittest from theano.compat import izip from six import iteritems import numpy import theano import theano.tensor as T from theano.tensor import TensorType from theano.tensor.basic import alloc # Don't import test classes otherwise they get test...
bsd-3-clause
Optimus-L90/caf-kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
pulilab/rapidpro
temba/flows/migrations/0105_populate_flow_start_uuid.py
3
1094
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-22 15:32 from __future__ import unicode_literals from django.db import migrations from uuid import uuid4 def populate_flow_start_uuid(FlowStart): start_ids = list(FlowStart.objects.values_list('id', flat=True)) if not start_ids: return ...
agpl-3.0
DanWBR/dwsim5
DWSIM/Lib/_MozillaCookieJar.py
73
5797
"""Mozilla / Netscape cookie loading / saving.""" import re, time from cookielib import (_warn_unhandled_exception, FileCookieJar, LoadError, Cookie, MISSING_FILENAME_TEXT) class MozillaCookieJar(FileCookieJar): """ WARNING: you may want to backup your browser's cookies file if you us...
gpl-3.0
zzxuanyuan/root-compressor-dummy
tutorials/tmva/keras/MulticlassKeras.py
15
2346
#!/usr/bin/env python from ROOT import TMVA, TFile, TTree, TCut, gROOT from os.path import isfile from keras.models import Sequential from keras.layers.core import Dense, Activation from keras.regularizers import l2 from keras import initializations from keras.optimizers import SGD # Setup TMVA TMVA.Tools.Instance()...
lgpl-2.1
ColdSauce/IsSittingOnButt
server/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py
2936
3291
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
apache-2.0
davidcusatis/horizon
openstack_dashboard/dashboards/project/access_and_security/keypairs/forms.py
23
3156
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
draklaw/lair
src/sys_sdl2/sys_sdl2.py
1
2854
#!/usr/bin/env python3 ## ## Copyright (C) 2015 Simon Boyé ## ## This file is part of lair. ## ## lair 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...
lgpl-3.0
asandyz/oppia
main.py
8
14279
# Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
lakshmi-kannan/st2
st2actions/tests/unit/test_remote_runners.py
6
1658
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
apache-2.0
tersmitten/ansible
lib/ansible/modules/network/nxos/nxos_gir_profile_management.py
34
6062
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
zerobatu/edx-platform
common/djangoapps/performance/views/__init__.py
100
1765
import datetime import json import logging from django.http import HttpResponse from track.utils import DateTimeJSONEncoder perflog = logging.getLogger("perflog") def _get_request_header(request, header_name, default=''): """Helper method to get header values from a request's META dict, if present.""" if ...
agpl-3.0
muatik/dahi
dahi/document.py
1
1446
from bson import ObjectId from dahi.statement import Statement class InvalidDocument(Exception): pass class Document(object): def __init__(self, docID=None, botSay=None, humanSay=None, onMatch=None): super(Document, self).__init__() self.botSay = botSay self.humanSay = humanSay ...
mit