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
tigersirvine/occtigerscricket
django/core/serializers/base.py
83
5607
""" Module for abstract serializer/unserializer base classes. """ from StringIO import StringIO from django.db import models from django.utils.encoding import smart_unicode class SerializerDoesNotExist(KeyError): """The requested serializer was not found.""" pass class SerializationError(Exception): """...
bsd-3-clause
Pearyman/webexamples
gitcheat.py
3
1183
# coding: utf-8 from datetime import date, timedelta import os, sys import random def dategenerator(start, end): current = start if start > end: print "Please input a valid start-end date." yield while current <= end: yield current current += timedelta(days=1) def everyda...
mit
BehavioralInsightsTeam/edx-platform
openedx/core/djangoapps/verified_track_content/models.py
12
7309
""" Models for verified track selections. """ import logging from config_models.models import ConfigurationModel from django.db import models from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from django.utils.translation import ugettext_lazy from opaque_keys.edx.django.mode...
agpl-3.0
Redmi-dev/android_kernel_xiaomi_msm8226
tools/perf/scripts/python/net_dropmonitor.py
4235
1554
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
met-office-lab/image-service-public
tests/test_data_processing.py
1
2457
import unittest import argparse as ap import subprocess as sp from iris.tests import IrisTest import imageservice from imageservice import serveupimage from imageservice import networking from imageservice import imageproc from imageservice import packer from imageservice import dataproc from imageservice import config...
gpl-3.0
flwh/KK_mt6589_iq451
prebuilts/python/darwin-x86/2.7.5/lib/python2.7/distutils/extension.py
250
10904
"""distutils.extension Provides the Extension class, used to describe C/C++ extension modules in setup scripts.""" __revision__ = "$Id$" import os, string, sys from types import * try: import warnings except ImportError: warnings = None # This class is really only used by the "build_ext" command, so it mig...
gpl-2.0
koditr/xbmc-tr-team-turkish-addons
script.module.urlresolver/lib/urlresolver/plugins/datemule.py
2
1310
''' urlresolver Kodi plugin Copyright (C) 2016 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Thi...
gpl-2.0
wdv4758h/ZipPy
edu.uci.python.benchmark/src/benchmarks/sympy/sympy/functions/special/tests/test_spec_polynomials.py
17
9725
from sympy import ( Symbol, diff, Derivative, Rational, roots, S, sqrt, hyper, cos, gamma, conjugate, factorial, pi, oo, zoo, binomial, RisingFactorial, legendre, assoc_legendre, chebyshevu, chebyshevt, chebyshevt_root, chebyshevu_root, laguerre, assoc_laguerre, laguerre_poly, hermite, gegenbauer, jacob...
bsd-3-clause
slisson/intellij-community
python/lib/Lib/site-packages/django/contrib/sessions/backends/file.py
91
5318
import errno import os import tempfile from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured class SessionStore(SessionBase): """ Implements a file based session store. """ ...
apache-2.0
xujun10110/golismero
thirdparty_libs/geopy/geohash.py
82
2525
from geopy import Point class Geohash(object): ENCODE_MAP = '0123456789bcdefghjkmnpqrstuvwxyz' DECODE_MAP = dict([(char, i) for i, char in enumerate(ENCODE_MAP)]) def __init__(self, point_class=Point, precision=12): self.point_class = point_class self.precision = precision def encode(...
gpl-2.0
imruahmed/microblog
flask/lib/python2.7/site-packages/migrate/tests/versioning/test_runchangeset.py
83
1708
#!/usr/bin/env python # -*- coding: utf-8 -*- import os,shutil from migrate.tests import fixture from migrate.versioning.schema import * from migrate.versioning import script class TestRunChangeset(fixture.Pathed,fixture.DB): level=fixture.DB.CONNECT def _setup(self, url): super(TestRunChangeset, se...
bsd-3-clause
memo/tensorflow
tensorflow/contrib/ffmpeg/__init__.py
82
1251
# 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
openstack/nova
nova/tests/unit/virt/libvirt/volume/test_remotefs.py
3
12222
# Copyright 2014 Cloudbase Solutions Srl # 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 r...
apache-2.0
pmghalvorsen/gramps_branch
gramps/gen/filters/rules/media/_changedsince.py
2
1893
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at you...
gpl-2.0
adrienverge/linux
scripts/analyze_suspend.py
171
160875
#!/usr/bin/python # # Tool for analyzing suspend/resume timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This prog...
gpl-2.0
adexin/Python-Machine-Learning-Samples
Other_samples/Regularization/reg_utils.py
1
10602
import numpy as np import matplotlib.pyplot as plt import h5py import sklearn import sklearn.datasets import sklearn.linear_model import scipy.io def sigmoid(x): """ Compute the sigmoid of x Arguments: x -- A scalar or numpy array of any size. Return: s -- sigmoid(x) """ s = 1 / (1 +...
mit
SCSSG/Odoo-SCS
addons/stock_account/res_config.py
315
2277
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
pb-/lgtd-core
lgtd/sync/client.py
1
4783
import logging import logging.handlers import os from argparse import ArgumentParser from collections import defaultdict from datetime import datetime, timedelta from json import dumps import pyinotify import requests from ..lib.db.syncable import Database from ..lib.util import (daemonize, ensure_lock_file, get_data...
gpl-3.0
gedare/GEMS
gems-2.1.1-gedare/opal/module/commands.py
6
7561
from cli import * # list format: # COMMAND_NAME ARGUMENT_LIST PYTHON_COMMAND DOCS opal_command_list = [ ### Parameter interfaces [ "init", [arg(filename_t(simpath = 1), "param-file", "?", "")], "Read a configuration file." ], [ "readparam", [arg(filename_t(simpath = 1), "param-file")], "J...
gpl-2.0
highfei2011/spark
python/pyspark/context.py
3
48348
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
TomTranter/OpenPNM
scripts/example_transient_PNP.py
1
4438
import openpnm as op from openpnm.phases import mixtures import numpy as np ws = op.Workspace() proj = ws.new_project() # ws.settings['loglevel'] = 20 # network, geometry, phase np.random.seed(0) net = op.network.Cubic(shape=[8, 8, 1], spacing=9e-4, project=proj) prs = (net['pore.back'] * net['pore.right'] + net['po...
mit
wchrisjohnson/python_koans
python3/koans/about_comprehension.py
56
2234
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutComprehension(Koan): def test_creating_lists_with_list_comprehensions(self): feast = ['lambs', 'sloths', 'orangutans', 'breakfast cereals', 'fruit bats'] comprehension = [delicacy.capitalize() for de...
mit
Muzer/python-xbee
xbee/tests/Fake.py
48
1476
#! /usr/bin/python """ Fake.py By Paul Malmsten, 2010 pmalmsten@gmail.com Provides fake device objects for other unit tests. """ import sys class FakeDevice(object): """ Represents a fake serial port for testing purposes """ def __init__(self): self.data = b'' def w...
mit
polyval/CNC
flask/Lib/site-packages/migrate/changeset/databases/oracle.py
140
3655
""" Oracle database specific implementations of changeset classes. """ import sqlalchemy as sa from sqlalchemy.databases import oracle as sa_base from migrate import exceptions from migrate.changeset import ansisql OracleSchemaGenerator = sa_base.OracleDDLCompiler class OracleColumnGenerator(OracleSchemaGenerat...
apache-2.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Markdown-2.6.2/markdown/extensions/footnotes.py
57
10656
""" Footnotes Extension for Python-Markdown ======================================= Adds footnote handling to Python-Markdown. See <https://pythonhosted.org/Markdown/extensions/footnotes.html> for documentation. Copyright The Python Markdown Project License: [BSD](http://www.opensource.org/licenses/bsd-license.php)...
mit
andrewschaaf/pyxc-pj
pj/transformations/forloops.py
1
4080
import ast from pj.js_ast import * #### Case: Ranges # Transform #<pre>for NAME in rage(BOUND): #for NAME in rage(START, BOUND):</pre> # to #<pre>for (var NAME = 0, __bound = BOUND; NAME < __bound; NAME++) #for (var NAME = START, __bound = BOUND; NAME < __bound; NAME++)</pre> def For_range(t, x): if ( ...
mit
nazo/ansible
lib/ansible/modules/storage/netapp/na_cdot_license.py
67
9643
#!/usr/bin/python # (c) 2017, NetApp, 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....
gpl-3.0
zenefits/sentry
src/sentry/interfaces/applecrash.py
7
1117
""" sentry.interfaces.applecrash ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2016 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import __all__ = ('AppleCrashReport',) from sentry.interfaces.base import Interface, InterfaceVal...
bsd-3-clause
tersmitten/ansible-modules-extras
monitoring/uptimerobot.py
58
4159
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
gpl-3.0
robmcmullen/peppy
peppy/third_party/pubsub/core/pubsub2.py
1
23495
''' This module provides publish-subscribe functions that allow your methods, functions, and any other callable object to subscribe to messages of a given topic, sent from anywhere in your application. It therefore provides a powerful decoupling mechanism, e.g. between GUI and application logic: senders and listener...
gpl-2.0
slohse/ansible
lib/ansible/modules/cloud/rackspace/rax_identity.py
151
2712
#!/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
DmitryADP/diff_qc750
vendor/nvidia/tegra/3rdparty/python-support-files/src/Lib/encodings/cp1255.py
593
12722
""" Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
gpl-2.0
pavelchristof/gomoku-ai
tensorflow/contrib/quantization/python/array_ops.py
178
1156
# 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
ms7s/tornado
tornado/util.py
56
12922
"""Miscellaneous utility functions and classes. This module is used internally by Tornado. It is not necessarily expected that the functions and classes defined here will be useful to other applications, but they are documented here in case they are. The one public-facing part of this module is the `Configurable` cl...
apache-2.0
datacratic/Diamond-old
src/collectors/xen_collector/xen_collector.py
8
2256
# coding=utf-8 """ The XENCollector grabs usage/allocation metrics using libvirt #### Dependencies * python-libvirt """ from diamond.collector import Collector import os try: import libvirt libvirt # workaround for pyflakes issue #13 except ImportError: libvirt = None class XENCollector(Collector):...
mit
xxd3vin/spp-sdk
opt/Python27/Lib/sqlite3/test/py25tests.py
127
2736
#-*- coding: ISO-8859-1 -*- # pysqlite2/test/regression.py: pysqlite regression tests # # Copyright (C) 2007 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages #...
mit
wuhengzhi/chromium-crosswalk
third_party/google_input_tools/third_party/closure_library/closure/bin/build/source_test.py
103
3128
#!/usr/bin/env python # # Copyright 2010 The Closure Library 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 ...
bsd-3-clause
ryfeus/lambda-packs
Tensorflow_LightGBM_Scipy_nightly/source/html5lib/html5parser.py
60
117335
from __future__ import absolute_import, division, unicode_literals from six import with_metaclass import types from . import inputstream from . import tokenizer from . import treebuilders from .treebuilders._base import Marker from . import utils from . import constants from .constants import spaceCharacters, ascii...
mit
Zorro666/renderdoc
docs/verify-docstrings.py
2
14261
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # import sys import re import os import glob import argparse import inspect from enum import EnumMeta from typing import List import struct os.chdir(os.path.realpath(os.path.dirname(__file__))) # path to module libraries for windows if struct.calcsize("P") == 8: bi...
mit
adityacs/ansible
lib/ansible/playbook/base.py
14
22553
# (c) 2012-2014, 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) an...
gpl-3.0
VirtueSecurity/aws-extender
BappModules/boto3/docs/client.py
23
1064
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
mit
racker/service-registry
node_modules/rproxy/node_modules/cluster2/node_modules/npm/node_modules/node-gyp/gyp/test/win/gyptest-cl-buffer-security-check.py
344
1612
#!/usr/bin/env python # 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. """ Make sure buffer security check setting is extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = Tes...
apache-2.0
ohagendorf/project_generator
tests/test_tools/test_coide.py
4
2565
# Copyright 2015 0xc0170 # # 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, soft...
apache-2.0
dstiert/Wox
PythonHome/Lib/site-packages/pip/_vendor/html5lib/constants.py
963
87346
from __future__ import absolute_import, division, unicode_literals import string import gettext _ = gettext.gettext EOF = None E = { "null-character": _("Null character in input stream, replaced with U+FFFD."), "invalid-codepoint": _("Invalid codepoint in stream."), "incorrectly-placed-so...
mit
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractVolareTranslations.py
1
15730
def extractVolareTranslations(item): """ 'Volare Translations' also 'Volare Novels' """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or 'preview' in item['title'].lower(): return None if 'Rotten Recommendations' in item['tags']: return None if 'volare Crea...
bsd-3-clause
penfold42/hyperion.ng
effects/trails.py
4
2349
import hyperion import time import colorsys import random min_len = int(hyperion.args.get('min_len', 3)) max_len = int(hyperion.args.get('max_len', 3)) #iHeight = int(hyperion.args.get('iHeight', 8)) trails = int(hyperion.args.get('int', 8)) sleepTime = float(hyperion.args.get('speed', 1)) / 1000.0 color = list(hyperi...
mit
varunarya10/oslo.middleware
oslo_middleware/sizelimit.py
2
3268
# Copyright (c) 2012 Red Hat, 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 ...
apache-2.0
suqinhuang/virt-test
qemu/tests/sr_iov_boot_negative.py
3
1325
import logging from autotest.client.shared import error from virttest import env_process @error.context_aware def run_sr_iov_boot_negative(test, params, env): """ KVM boot with negative paramter test: 1) Try to boot VM with negative parameters. 2) Verify that qemu could handle the negative paramters. ...
gpl-2.0
anryko/ansible
test/units/modules/network/ovs/test_openvswitch_db.py
24
7226
# # (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 d...
gpl-3.0
NaturalGIS/QGIS
scripts/widgets_tree.py
15
5517
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ *************************************************************************** widgets_tree.py --------------------- Date : May 2011 Copyright : (C) 2011 by Martin Dobias Email : wonder dot sk at gmail dot com...
gpl-2.0
arjunsinghy96/coala
tests/bearlib/abstractions/external_bear_wrap_testfiles/test_external_bear.py
29
1469
import os import sys import json # Start ignoring PycodestyleBear* as those imports may raise # import warnings sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..')) from coalib.results.Result import Result from coalib.results.SourceRange import SourceRange from...
agpl-3.0
willrogers/pytac
test/test_device.py
1
2733
import mock import pytest from constants import PREFIX, RB_PV, SP_PV import pytac from pytac.device import BasicDevice, EpicsDevice, PvEnabler # Not a test - epics device creation function used in tests. def create_epics_device(prefix=PREFIX, rb_pv=RB_PV, sp_pv=SP_PV, enabled=True): mock_cs = mock.MagicMock() ...
apache-2.0
rodynnz/python-osinfo
setup.py
2
1348
# -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('README.rst') as readme: long_desc = readme.read() setup( # Package info name='python_osinfo', version='0.2.2', description="Python OS information retriever.", author='Rodrigo Núñez Mujica', author_email='rnune...
gpl-3.0
nvoron23/hue
desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/sbcharsetprober.py
2927
4793
######################## 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
mehdidc/scikit-learn
sklearn/datasets/tests/test_base.py
39
5607
import os import shutil import tempfile import warnings import nose import numpy from sklearn.datasets import get_data_home from sklearn.datasets import clear_data_home from sklearn.datasets import load_files from sklearn.datasets import load_sample_images from sklearn.datasets import load_sample_image from sklearn.da...
bsd-3-clause
dbckz/ansible
lib/ansible/modules/cloud/cloudstack/cs_zone.py
48
11359
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
mou4e/zirconium
third_party/typ/typ/json_results.py
35
5787
# Copyright 2014 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 ag...
bsd-3-clause
ufaks/addons-yelizariev
import_framework/import_base.py
16
14556
# -*- coding: utf-8 -*- import mapper try: from pandas import DataFrame except ImportError: pass import logging _logger = logging.getLogger(__name__) class create_childs(object): def __init__(self, childs): # extend childs to same set of fields # collect fields fields = set() ...
lgpl-3.0
vu2swz/WORKSTATION
webserver/chatbox/wit2.py
1
4742
import sys from wit import Wit from random import randint from pprint import pprint import MySQLdb db = MySQLdb.connect(host="localhost", user="root", passwd="root", db="cabins") ...
gpl-3.0
dooma/Events
spec/repositories/test_person.py
1
3073
__author__ = 'Călin Sălăgean' import unittest from utils.IO import IO from events.repositories.person import PersonRepository from events.models.person import Person class TestPersonRepository(unittest.TestCase): def test_initialization(self): io = IO('test.json') io.set([]) repository = ...
mit
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.7.2/Lib/Cookie.py
65
25843
#!/usr/bin/env python # #### # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in ...
mit
iamutkarshtiwari/sympy
sympy/polys/specialpolys.py
87
9787
"""Functions for generating interesting polynomials, e.g. for benchmarking. """ from __future__ import print_function, division from sympy.core import Add, Mul, Symbol, sympify, Dummy, symbols from sympy.functions.elementary.miscellaneous import sqrt from sympy.core.singleton import S from sympy.polys.polytools impo...
bsd-3-clause
torchingloom/edx-platform
cms/djangoapps/contentstore/views/tests/test_user.py
16
12640
""" Tests for contentstore/views/user.py. """ import json from contentstore.tests.utils import CourseTestCase from django.contrib.auth.models import User from student.models import CourseEnrollment from xmodule.modulestore.django import loc_mapper from student.roles import CourseStaffRole, CourseInstructorRole from stu...
agpl-3.0
nilbody/h2o-3
h2o-py/tests/testdir_misc/pyunit_get_model.py
1
2487
from builtins import range import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils def get_model_test(): prostate = h2o.import_file(path=pyunit_utils.locate("smalldata/logreg/prostate.csv")) r = prostate[0].runif() train = prostate[r < 0.70] test = prostate[r >= ...
apache-2.0
msabramo/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_wait.py
27
4877
#!/usr/bin/python #coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # # 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 optio...
gpl-3.0
popazerty/obh-test1
lib/python/Tools/ISO639.py
79
23367
# -*- coding: iso-8859-2 -*- LanguageCodes = { } LanguageCodes["aar"] = LanguageCodes["aa"] = ("Afar", "Hamitic") LanguageCodes["abk"] = LanguageCodes["ab"] = ("Abkhazian", "Ibero-caucasian") LanguageCodes["ace"] = ("Achinese", "") LanguageCodes["ach"] = ("Acoli", "") LanguageCodes["ada"] = ("Adangme", "") LanguageCod...
gpl-2.0
AEdmunds/Vassall-Theme
Content/Bootstrap/test-infra/s3_cache.py
2166
5734
#!/usr/bin/env python2.7 # pylint: disable=C0301 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, chdir, remove as _delete_file from os.path import dirname, basename, abspath, realpath, expandvars from hashlib import sha256 from subpr...
bsd-2-clause
iamstarkov/bem-bootstrap-strict
test-infra/s3_cache.py
2166
5734
#!/usr/bin/env python2.7 # pylint: disable=C0301 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, chdir, remove as _delete_file from os.path import dirname, basename, abspath, realpath, expandvars from hashlib import sha256 from subpr...
mit
denny820909/builder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/internet/default.py
6
1982
# -*- test-case-name: twisted.internet.test.test_default -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ The most suitable default reactor for the current platform. Depending on a specific application's needs, some other reactor may in fact be better. """ __all__ = ["install"] from t...
mit
supriyantomaftuh/django
django/contrib/auth/middleware.py
258
5718
from django.contrib import auth from django.contrib.auth import load_backend from django.contrib.auth.backends import RemoteUserBackend from django.core.exceptions import ImproperlyConfigured from django.utils.functional import SimpleLazyObject def get_user(request): if not hasattr(request, '_cached_user'): ...
bsd-3-clause
PeterJCLaw/libkoki
site_scons/site_tools/doxygen/doxygen_boehme_2007-07-18.py
10
7610
# vim: set et sw=3 tw=0 fo=awqorc ft=python: # # Astxx, the Asterisk C++ API and Utility Library. # Copyright (C) 2005, 2006 Matthew A. Nicholson # Copyright (C) 2006 Tim Blechmann # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License ...
gpl-3.0
github-easyway/linux-1
scripts/gdb/linux/utils.py
630
4267
# # gdb helper commands and functions for Linux kernel debugging # # common utilities # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb class CachedType: def __init__(self, name): s...
gpl-2.0
manishpatell/erpcustomizationssaiimpex123qwe
openerp/tools/safe_eval.py
25
12157
# -*- coding: utf-8 -*- ############################################################################## # Copyright (C) 2004-2014 OpenERP s.a. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
agpl-3.0
zaufi/pluggable-output-processor
test/test_cpp.py
1
11922
# -*- coding: utf-8 -*- # # This file is a part of Pluggable Output Processor # # Copyright (c) 2013-2017 Alex Turbov <i.zaufi@gmail.com> # # Pluggable Output Processor 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 Foun...
gpl-3.0
cloudsigma/cloud-init
cloudinit/user_data.py
7
13143
# vi: ts=4 expandtab # # Copyright (C) 2012 Canonical Ltd. # Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # Copyright (C) 2012 Yahoo! Inc. # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # Author: Joshua Harlow <harlowja@yahoo-inc....
gpl-3.0
atsolakid/edx-platform
common/lib/xmodule/xmodule/progress.py
110
5066
''' Progress class for modules. Represents where a student is in a module. Useful things to know: - Use Progress.to_js_status_str() to convert a progress into a simple status string to pass to js. - Use Progress.to_js_detail_str() to convert a progress into a more detailed string to pass to js. In particular...
agpl-3.0
cognitiveclass/edx-platform
lms/djangoapps/courseware/tests/test_about.py
17
23662
""" Test the about xblock """ import datetime import pytz from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings from mock import patch from nose.plugins.attrib import attr from opaque_keys.edx.locations import SlashSeparatedCourseKey from course_...
agpl-3.0
hiptools/hiptools
slovenize.py
1
7741
#! /usr/bin/python # -*- coding: utf-8 -*- #import pygtk #pygtk.require('2.0') #import gtk import codecs import re import os import sys # formerly - ucs8conv, renamed #import hipconv #import hip_config #from hipview import Text #conv = hipconv.Repl() class Mn: def __init__(self): self.rg_stress = re.com...
gpl-2.0
Mickey32111/pogom
pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/GetMapObjectsMessage_pb2.py
16
4223
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Requests/Messages/GetMapObjectsMessage.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _mes...
mit
clarko1/Cramd
appengine/flexible/hello_world/main.py
12
1231
# Copyright 2015 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
dracos/django
tests/sitemaps_tests/base.py
69
1058
from django.apps import apps from django.contrib.sites.models import Site from django.core.cache import cache from django.test import TestCase, modify_settings, override_settings from .models import I18nTestModel, TestModel @modify_settings(INSTALLED_APPS={'append': 'django.contrib.sitemaps'}) @override_settings(ROO...
bsd-3-clause
Tobion/dbal
docs/en/conf.py
12
6462
# -*- coding: utf-8 -*- # # Doctrine DBAL documentation build configuration file, created by # sphinx-quickstart on Mon Nov 1 19:50:57 2010. # # 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. #...
mit
chidaobanjiu/works-on-LPTHW
hashmap.py
1
1637
def new(num_buckets=256): """Initializes a Map with the given number of buckets.""" aMap = [] for i in range(0, num_buckets): aMap.append([]) return aMap def hash_key(aMap, key): """Given a key this will create a number and then convert it to an index for the aMap's buckets.""" return ...
cc0-1.0
jjaner/essentia-musicbricks
test/src/unittest/sfx/test_flatnesssfx_streaming.py
10
1964
#!/usr/bin/env python # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation (FSF), e...
agpl-3.0
hellsgate1001/bookit
docs/env/Lib/encodings/iso8859_4.py
593
13632
""" Python Character Mapping Codec iso8859_4 generated from 'MAPPINGS/ISO8859/8859-4.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
mit
shifter/grr
lib/data_stores/http_data_store_test.py
4
4394
#!/usr/bin/env python """Tests the HTTP remote data store abstraction.""" import httplib import shutil import socket import threading import portpicker from grr.lib import config_lib from grr.lib import data_store from grr.lib import data_store_test from grr.lib import flags from grr.lib import test_lib from grr....
apache-2.0
eepalms/gem5-newcache
src/cpu/ozone/OzoneChecker.py
26
1969
# Copyright (c) 2007 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list ...
bsd-3-clause
TimofeyFox/S7270_kernel
4.6/x86/share/gdb/python/gdb/command/pretty_printers.py
89
14662
# Pretty-printer commands. # Copyright (C) 2010, 2011 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any l...
gpl-2.0
kbytesys/django_comuni_italiani
comuni_italiani/models.py
1
2390
# -*- coding: utf-8 -*- from django.db import models class Regione(models.Model): codice_regione = models.IntegerField(primary_key=True, verbose_name="codice Istat") name = models.CharField(max_length=300, db_index=True, verbose_name='nome') def __str__(self): return self.name class Meta: ...
lgpl-2.1
xinwu/horizon
openstack_dashboard/usage/quotas.py
18
14771
# 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 # distributed under t...
apache-2.0
twoerner/bitbake
lib/toaster/orm/migrations/0014_auto__chg_field_package_summary__chg_field_layer_summary__chg_field_re.py
4
26037
# -*- 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): # Changing field 'Package.summary' db.alter_column(u'orm_package', 'summ...
gpl-2.0
jayceyxc/hue
desktop/core/ext-py/Pygments-1.3.1/pygments/formatters/latex.py
59
12866
# -*- coding: utf-8 -*- """ pygments.formatters.latex ~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for LaTeX fancyvrb output. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.token import T...
apache-2.0
harmsm/pytc-gui
pytc_gui/main_window.py
1
9560
__description__ = \ """ pytc GUI using PyQt5. """ __author__ = "Hiranmyai Duvvuri" __date__ = "2017-01-06" from . import dialogs, widgets from .fit_container import FitContainer from pytc.global_fit import GlobalFit from PyQt5.QtCore import pyqtSignal from PyQt5 import QtWidgets as QW from matplotlib.backends.back...
unlicense
milinbhakta/flaskjinja
flask1/Lib/site-packages/flask/_compat.py
783
2164
# -*- coding: utf-8 -*- """ flask._compat ~~~~~~~~~~~~~ Some py2/py3 compatibility support based on a stripped down version of six so we don't have to depend on a specific version of it. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys PY...
gpl-2.0
segasai/astrolibpy
astrolib/cosmo_param.py
4
3641
def cosmo_param(omega_m=None, omega_lambda=None, omega_k=None, q0=None): """ NAME: COSMO_PARAM PURPOSE: Derive full set of cosmological density parameters from a partial set EXPLANATION: This procedure is called by LUMDIST and GALAGE to allow the user a choice in defining ...
gpl-3.0
utcoupe/coupe18
ros_ws/src/navigation_navigator/src/pathfinder/pathfinder_client.py
1
1544
#!/usr/bin/env python # -*-coding:Utf-8 -* import rospy from geometry_msgs.msg import Pose2D from navigation_pathfinder.srv import * class PathfinderClient(object): def __init__ (self): self.PATHFINDER_FINDPATH_SERVICE_NAME = "/navigation/pathfinder/find_path" self.pathfinderFindPathService = "" ...
gpl-3.0
Lab603/PicEncyclopedias
jni-build/jni-build/jni/include/tensorflow/contrib/learn/python/learn/tests/summary_writer_cache_test.py
12
2535
# pylint: disable=g-bad-file-header # 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/LICENS...
mit
pforret/python-for-android
python-modules/twisted/twisted/internet/iocpreactor/tcp.py
49
20271
# Copyright (c) 2008-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ TCP support for IOCP reactor """ import socket, operator, errno, struct from zope.interface import implements, directlyProvides from twisted.internet import interfaces, error, address, main, defer from twisted.internet.abstract im...
apache-2.0
firerszd/kbengine
kbe/src/lib/python/Lib/encodings/iso8859_13.py
272
13271
""" Python Character Mapping Codec iso8859_13 generated from 'MAPPINGS/ISO8859/8859-13.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
lgpl-3.0
mephaust/vagrant
test/buildbot/buildbot_config/master/status.py
8
1644
""" This module returns the given status handlers to enable for the buildbot master. """ from buildbot.status import html, words from buildbot.status.web.authz import Authz from buildbot.status.web.auth import BasicAuth def get_status(options): """ Returns a list of status targets for the build master. ""...
mit