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
wbc2010/django1.2.5
django1.2.5/tests/regressiontests/cache/tests.py
38
28208
# -*- coding: utf-8 -*- # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import os import tempfile import time import unittest import warnings from django.conf import settings from django.core import management from django.core.cache import get_cache from django.core.c...
bsd-3-clause
datakortet/django-cms
cms/apphook_pool.py
6
2605
# -*- coding: utf-8 -*- from cms.exceptions import AppAlreadyRegistered from cms.utils.conf import get_cms_setting from cms.utils.django_load import load, iterload_objects from django.conf import settings from django.core.exceptions import ImproperlyConfigured import warnings class ApphookPool(object): def __init_...
bsd-3-clause
sfjuocekr/PokeIV
pokeIV.py
1
7510
#!/usr/bin/env python #This software uses pgoapi - see pgoapi/LICENSE.txt import os import re import sys import json import time import struct import pprint import logging import requests import argparse import getpass import csv import time from tkinter import ttk import tkinter as tk from collections import Ordere...
mit
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.2/django/contrib/contenttypes/generic.py
44
16570
""" Classes allowing "generic" relations through ContentType and object-id fields. """ from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.db.models import signals from django.db import models, router from django.db.models.fields.related import RelatedField, Field, ManyTo...
bsd-3-clause
myang321/django
django/utils/tree.py
372
4883
""" A class for storing a tree graph. Primarily used for filter constructs in the ORM. """ import copy class Node(object): """ A single internal node in the tree graph. A Node should be viewed as a connection (the root) with the children being either leaf nodes or other Node instances. """ # ...
bsd-3-clause
webdev1001/ansible
v2/ansible/vars/__init__.py
11
11403
# (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
leandrotoledo/oppia
core/domain/rule_domain.py
9
6544
# coding: utf-8 # # 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 requi...
apache-2.0
ruibarreira/linuxtrail
usr/lib/python2.7/dist-packages/numpy/lib/tests/test_recfunctions.py
8
28717
from __future__ import division, absolute_import, print_function import sys import numpy as np import numpy.ma as ma from numpy.ma.testutils import * from numpy.ma.mrecords import MaskedRecords from numpy.lib.recfunctions import * get_names = np.lib.recfunctions.get_names get_names_flat = np.lib.recfunctions.get_na...
gpl-3.0
minlexx/pyevemon
esi_client/models/get_characters_character_id_mail_mail_id_internal_server_error.py
1
3191
# coding: utf-8 """ EVE Swagger Interface An OpenAPI for EVE Online OpenAPI spec version: 0.4.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class GetCharactersCharacterIdMailMailIdInternalServerError(obje...
gpl-3.0
openstack/manila
manila/tests/api/views/test_share_network_subnets.py
1
2945
# Copyright 2019 NetApp, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
don-github/edx-platform
openedx/core/djangoapps/content/course_structures/api/v0/serializers.py
65
1313
""" API Serializers """ from rest_framework import serializers class GradingPolicySerializer(serializers.Serializer): """ Serializer for course grading policy. """ assignment_type = serializers.CharField(source='type') count = serializers.IntegerField(source='min_count') dropped = serializers.IntegerF...
agpl-3.0
ShiYw/Sigil
3rdparty/python/Lib/test/test_importlib/frozen/test_finder.py
81
2209
from .. import abc from .. import util machinery = util.import_importlib('importlib.machinery') import unittest class FindSpecTests(abc.FinderTests): """Test finding frozen modules.""" def find(self, name, path=None): finder = self.machinery.FrozenImporter return finder.find_spec(name, pat...
gpl-3.0
ppiotr/Bibedit-some-refactoring
modules/webmessage/lib/webmessage_config.py
4
1821
# -*- coding: utf-8 -*- ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS 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 versio...
gpl-2.0
Jenselme/servo
tests/wpt/web-platform-tests/tools/html5lib/utils/spider.py
436
4157
#!/usr/bin/env python """Spider to try and find bugs in the parser. Requires httplib2 and elementtree usage: import spider s = spider.Spider() s.spider("http://www.google.com", maxURLs=100) """ import urllib.request, urllib.error, urllib.parse import urllib.robotparser import md5 import httplib2 import html5lib fro...
mpl-2.0
cancan101/tensorflow
tensorflow/python/kernel_tests/zero_division_test.py
139
2389
# 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
tpodowd/boto
tests/unit/ec2/test_instance.py
114
11050
#!/usr/bin/env python import base64 from tests.compat import unittest, mock from tests.unit import AWSMockServiceTestCase from boto.ec2.connection import EC2Connection DESCRIBE_INSTANCE_VPC = br"""<?xml version="1.0" encoding="UTF-8"?> <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2012-10-01/"> ...
mit
UCSBarchlab/PyRTL
examples/example8-verilog.py
1
5323
""" Example 8: Interfacing with Verilog. While there is much more about PyRTL design to discuss, at some point somebody might ask you to do something with your code other than have it print pretty things out to the terminal. We provide import from and export to Verilog of designs, export of waveforms...
bsd-3-clause
cmusatyalab/elijah-discovery-basic
elijah/discovery/monitor/file_cache.py
2
7495
#!/usr/bin/env python # # Cloudlet Infrastructure for Mobile Computing # # Author: Kiryong Ha <krha@cmu.edu> # # Copyright (C) 2011-2013 Carnegie Mellon University # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ob...
apache-2.0
Xeralux/tensorflow
tensorflow/python/framework/smart_cond.py
1
4733
# Copyright 2018 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
Aldriana/ShadowCraft-Engine
shadowcraft/objects/talents.py
1
2840
from shadowcraft.core import exceptions from shadowcraft.objects import talents_data class InvalidTalentException(exceptions.InvalidInputException): pass class Talents(object): def __init__(self, talent_string, game_class='rogue', level='90'): self.game_class = game_class self.class_talents ...
lgpl-3.0
yfried/ansible
lib/ansible/modules/cloud/cloudstack/cs_router.py
37
10470
#!/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
GustavoHennig/ansible
lib/ansible/modules/cloud/azure/azure.py
5
24573
#!/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 distributed...
gpl-3.0
MakesmithAccessibleTech/MakesmithGroundControl
CalibrationWidgets/enterDistanceBetweenMotors.py
2
1864
from kivy.uix.gridlayout import GridLayout from kivy.properties import ObjectProperty from kivy.properties import StringProperty from UIElements.touchNumberInput import TouchNumberInput from kivy.uix.popup import Popup f...
gpl-3.0
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/global_/route_selection_options/__init__.py
1
18286
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
coen-hyde/dotfiles
libs/eb/lib/aws/requests/packages/charade/euckrprober.py
2931
1675
######################## 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...
mit
cmvelo/ansible
lib/ansible/cli/adhoc.py
5
7287
# (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
pekeler/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_nis.py
58
1317
from test import test_support import unittest import nis class NisTests(unittest.TestCase): def test_maps(self): try: maps = nis.maps() except nis.error, msg: # NIS is probably not active, so this test isn't useful if test_support.verbose: print "...
apache-2.0
bjoshua/ansible
v1/ansible/inventory/group.py
136
3395
# (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
noam09/deluge-telegramer
telegramer/include/future/backports/email/utils.py
82
14270
# Copyright (C) 2001-2010 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Miscellaneous utilities.""" from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import utils from future.builtins import bytes, int, str...
gpl-3.0
ptcrypto/pycoin
pycoin/services/insight.py
12
4901
# provide support to insight API servers # see also https://github.com/bitpay/insight-api import decimal import json import logging import io try: from urllib2 import HTTPError, urlopen from urllib import urlencode except ImportError: from urllib.request import urlopen from urllib.error import HTTPErr...
mit
mSenyor/sl4a
python/src/Lib/ntpath.py
60
17131
# Module 'ntpath' -- common operations on WinNT/Win95 pathnames """Common pathname manipulations, WindowsNT/95 version. Instead of importing this module directly, import os and refer to this module as os.path. """ import os import sys import stat import genericpath import warnings from genericpath import * __all__ ...
apache-2.0
pombreda/swtoolkit
test/signing_test.py
18
4436
#!/usr/bin/python2.4 # Copyright 2009, 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...
bsd-3-clause
interline/xhtml2pdf
xhtml2pdf/turbogears.py
99
1449
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
alistairlow/tensorflow
tensorflow/contrib/signal/python/ops/spectral_ops.py
19
12619
# 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
mistercrunch/airflow
airflow/migrations/versions/561833c1c74b_add_password_column_to_user.py
8
1266
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
c0yote/AbstractControls
dep/FakeIt/generate_fakeit_single_header.py
2
2982
import io import os import sys import re import datetime fakeitPath = "." includesMatcher = re.compile( r'\s*#include\s*"(.*)"' ) pragmaOnceMatcher = re.compile( r'\s*#pragma\s*once\s*' ) processedHeaders = set([]) def write_line(out, line ): out.write( line + "\n") def parseFile(out, config, filename): pr...
mit
jayoshih/content-curation
contentcuration/contentcuration/dev_settings.py
2
1411
# flake8: noqa from .test_settings import * # noqa # These endpoints will throw an error on the django debug panel EXCLUDED_DEBUG_URLS = [ "/content/storage", ] def custom_show_toolbar(request): return not any(request.path.startswith(url) for url in EXCLUDED_DEBUG_URLS) LANGUAGES += (('ar', ugettext('Arab...
mit
Papa2k15/flask
scripts/flask-07-upgrade.py
148
10659
#!/usr/bin/env python # -*- coding: utf-8 -*- """ flask-07-upgrade ~~~~~~~~~~~~~~~~ This command line script scans a whole application tree and attempts to output an unified diff with all the changes that are necessary to easily upgrade the application to 0.7 and to not yield deprecation warnings. ...
bsd-3-clause
FireballDWF/cloud-custodian
tests/test_elb.py
5
21540
# Copyright 2015-2017 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
Nethertech/Intellectus
cocos2d/plugin/tools/toolsForGame/steps.py
255
2302
import sys, string, os from Tkinter import * # define class step class step: stepFrame = None def initStep(self, root): return def checkStep(self): return None # define class step1 class step1(step): step_entry = None def initStep(self, root): self.stepFrame = Frame(root) ...
mit
rupran/ansible
lib/ansible/modules/network/ldap_entry.py
28
9767
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Peter Sagerson <psagers@ignorare.net> # (c) 2016, Jiri Tyr <jiri.tyr@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 So...
gpl-3.0
aldian/tensorflow
tensorflow/python/framework/tensor_shape_div_test.py
178
1495
# 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
jochemdu/nyanchain
Abe/deserialize.py
6
12559
# # # from BCDataStream import * from enumeration import Enumeration from base58 import public_key_to_bc_address, hash_160_to_bc_address import logging import socket import time from util import short_hex, long_hex import struct def parse_CAddress(vds): d = {} d['nVersion'] = vds.read_int32() d['nTime'] = vds.r...
agpl-3.0
kosgroup/odoo
addons/mail/models/mail_channel.py
3
33607
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from email.utils import formataddr import re import uuid from odoo import _, api, fields, models, modules, tools from odoo.exceptions import UserError from odoo.osv import expression from odoo.tools import ormcache fro...
gpl-3.0
andyliuliming/azure-linux-extensions
DSC/azure/storage/blobservice.py
46
105417
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apac...
apache-2.0
russellb/nova
nova/virt/disk/api.py
1
11309
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # # Copyright 2011, Piston Cloud Computing, Inc. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License...
apache-2.0
ravwojdyla/incubator-beam
sdks/python/apache_beam/utils/profiler.py
7
4624
# # 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
averagehat/scikit-bio
skbio/sequence/_rna.py
3
10887
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
UQ-UQx/edx-platform_lti
lms/djangoapps/shoppingcart/migrations/0022_auto__add_field_registrationcoderedemption_course_enrollment__add_fiel.py
110
18922
# -*- 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): # Adding field 'RegistrationCodeRedemption.course_enrollment' db.add_column('shoppingcart_registrationcodere...
agpl-3.0
weimingtom/python-for-android
python-modules/twisted/twisted/names/authority.py
49
11053
# -*- test-case-name: twisted.names.test.test_names -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Authoritative resolvers. """ import os import time from twisted.names import dns from twisted.internet import defer from twisted.python import failure import common def getS...
apache-2.0
bgris/ODL_bgris
lib/python3.5/idlelib/StackViewer.py
10
4426
import os import sys import linecache import re import tkinter as tk from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem from idlelib.PyShell import PyShellFileList def StackBrowser(root, flist=None, tb=None, top=None): if top is ...
gpl-3.0
meganbkratz/acq4
acq4/util/InterfaceCombo.py
3
4622
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui from acq4.Manager import getManager import acq4.pyqtgraph.parametertree as parametertree import acq4.pyqtgraph.parametertree.parameterTypes as ptypes ### TODO: inherit from util/ComboBox instead. class InterfaceCombo(QtGui.QComboBox): """ ComboBox that d...
mit
FederatedAI/FATE
python/fate_flow/operation/job_tracker.py
1
29929
# # Copyright 2019 The FATE 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 appli...
apache-2.0
matejcik/weblate
weblate/trans/views/api.py
1
10715
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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
rvmoura96/projeto-almoxarifado
myvenv/Lib/site-packages/django/utils/dateparse.py
44
4235
"""Functions to parse datetime objects.""" # We're using regular expressions rather than time.strptime because: # - They provide both validation and parsing. # - They're more flexible for datetimes. # - The date/datetime/time constructors produce friendlier error messages. import datetime import re from django.utils...
mit
googleapis/proto-breaking-change-detector
src/detector/loader.py
1
4920
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
robingall2910/RobTheBoat
utils/tools.py
1
2926
import re import requests import discord import io from datetime import datetime _USER_ID_MATCH = re.compile(r"<@(\d+)>") _EMOTE_ID_MATCH = re.compile(r"<:(.+?):(\d+)>") py = "```py\n{}```" xl = "```xl\n{}```" diff = "```diff\n{}```" def write_file(filename, contents): with open(filename, "w"...
mit
ryszard/whoosh
src/whoosh/support/bitvector.py
2
3585
import operator from array import array # Table of the number of '1' bits in each byte (0-255) BYTE_COUNTS = array('B',[ 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, ...
apache-2.0
Captain-Coder/tribler
Tribler/Core/Modules/wallet/wallet.py
1
1837
from __future__ import absolute_import import abc import logging import random import string import six from Tribler.pyipv8.ipv8.taskmanager import TaskManager class InsufficientFunds(Exception): """ Used for throwing exception when there isn't sufficient funds available to transfer assets. """ pas...
lgpl-3.0
jonathanmarvens/pycco
pycco_resources/__init__.py
19
8075
css = """\ /*--------------------- Layout and Typography ----------------------------*/ body { font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; font-size: 16px; line-height: 24px; color: #252519; margin: 0; padding: 0; background: #f5f5ff; } a { color: #261a3b; } a:visited {...
mit
rjdp/Easynginedemoplugin
ee/core/aptget.py
1
4930
"""EasyEngine package installation using apt-get module.""" import apt import apt_pkg import sys import subprocess from ee.core.logging import Log from sh import apt_get from sh import ErrorReturnCode class EEAptGet(): """Generic apt-get intialisation""" def update(self): """ Similar to `apt-...
mit
Yubico/pkcs11test
googletest-release-1.8.0/googletest/test/gtest_color_test.py
3259
4911
#!/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...
apache-2.0
romain-li/edx-platform
common/lib/xmodule/xmodule/services.py
163
2772
""" Module contains various XModule/XBlock services """ from django.conf import settings class SettingsService(object): """ Allows server-wide configuration of XBlocks on a per-type basis XBlock settings are read from XBLOCK_SETTINGS settings key. Each XBlock is allowed access to single settings buck...
agpl-3.0
waseem18/oh-mainline
vendor/packages/twisted/twisted/python/test/test_fakepwd.py
18
7525
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.fakepwd}. """ try: import pwd except ImportError: pwd = None from operator import getitem from twisted.trial.unittest import TestCase from twisted.python.fakepwd import UserDatabase from twisted.python.co...
agpl-3.0
jshiv/turntable
test/lib/python2.7/site-packages/scipy/optimize/tests/test_optimize.py
7
35456
""" Unit tests for optimization routines from optimize.py Authors: Ed Schofield, Nov 2005 Andrew Straw, April 2008 To run it in its simplest form:: nosetests test_optimize.py """ from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy.testing import (a...
mit
EvanK/ansible
lib/ansible/modules/remote_management/ucs/ucs_disk_group_policy.py
21
16473
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
michaelhowden/eden
modules/unit_tests/s3/s3model.py
14
8372
# -*- coding: utf-8 -*- # # S3 Model Unit Tests # # To run this script use: # python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/s3model.py # import unittest from gluon import current from s3.s3fields import s3_meta_fields # =========================================================================...
mit
pvreman/cobbler
koan/sub_process.py
56
39931
# subprocess - Subprocesses with accessible I/O streams # # For more information about this module, see PEP 324. # # This module should remain compatible with Python 2.2, see PEP 291. # # Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se> # # Licensed to PSF under a Contributor Agreement. # See http://ww...
gpl-2.0
ProkopHapala/SimpleSimulationEngine
python/pyMeta/metaprograming.py
1
6665
#!/usr/bin/python import os import datetime import re lib_pre = 'lib' re_curly = re.compile( '(?:|{})', re.DOTALL) #re_currly = re.compile( '(?:|{})', re.DOTALL) # see https://docs.scipy.org/doc/numpy/user/basics.types.html array_types = { "float" : ( "float32" , "array1f" ), "double" : ( "float64" , ...
mit
taknevski/tensorflow-xsmm
tensorflow/contrib/graph_editor/select.py
75
28656
# 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
insiight/ddpclient
ddpclient/user_list_client_selector.py
1
1087
from .selector import Selector class UserListClientSelector(Selector): def __init__(self): super(UserListClientSelector, self).__init__() def from_date_range(self, min_date=None, max_date=None): if min_date is None: min_date = datetime.date(1990, 1, 1) if max_date is Non...
mit
GanjaCoinProject/ganjacoin
share/qt/extract_strings_qt.py
1294
1784
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by xgettext. Ret...
mit
snasoft/QtCreatorPluginsPack
Bin/3rdParty/vera/bin/lib/distutils/tests/test_install_headers.py
141
1269
"""Tests for distutils.command.install_headers.""" import sys import os import unittest import getpass from distutils.command.install_headers import install_headers from distutils.tests import support from test.test_support import run_unittest class InstallHeadersTestCase(support.TempdirManager, ...
lgpl-3.0
bdang2012/taiga-back
taiga/projects/services/stats.py
15
13047
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.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 # published by the F...
agpl-3.0
tqchen/tvm
python/tvm/rpc/__init__.py
5
1388
# 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
repotvsupertuga/tvsupertuga.repository
script.module.unidecode/lib/unidecode/x0fa.py
252
4406
data = ( 'Chey ', # 0x00 'Thak ', # 0x01 'Thak ', # 0x02 'Thang ', # 0x03 'Thayk ', # 0x04 'Thong ', # 0x05 'Pho ', # 0x06 'Phok ', # 0x07 'Hang ', # 0x08 'Hang ', # 0x09 'Hyen ', # 0x0a 'Hwak ', # 0x0b 'Wu ', # 0x0c 'Huo ', # 0x0d '[?] ', # 0x0e '[?] ', # 0x0f 'Zhong ', ...
gpl-2.0
chiamingyen/pygroup
wsgi/static/Brython2.2.0rc0-20140913-093500/Lib/tokenize.py
728
24424
"""Tokenization help for Python programs. tokenize(readline) is a generator that breaks a stream of bytes into Python tokens. It decodes the bytes according to PEP-0263 for determining source file encoding. It accepts a readline-like method which is called repeatedly to get the next line of input (or b"" for EOF). ...
gpl-2.0
Jayflux/servo
tests/wpt/web-platform-tests/tools/third_party/py/testing/root/test_xmlgen.py
55
4005
import py from py._xmlgen import unicode, html, raw import sys class ns(py.xml.Namespace): pass def test_escape(): uvalue = py.builtin._totext('\xc4\x85\xc4\x87\n\xe2\x82\xac\n', 'utf-8') class A: def __unicode__(self): return uvalue def __str__(self): x = self.__u...
mpl-2.0
BEUTIFULSKIN/python-design
Composite/yiwang_composite.py
1
1720
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2017-05-03 16:00:12 # @Author : Yi Wang (gzytemail@126.com) # @Link : https://github.com/wang2222qq # @des : 组合模式 # 主要用于树型结构让你可以优化处理递归或分级数据结构 class Material: def __init__(self, code): self.code = code def add(self, materia...
mit
wdwvt1/qiime
tests/test_beta_metrics.py
15
11751
#!/usr/bin/env python __author__ = "Justin Kuczynski" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Rob Knight", "Justin Kuczynski"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "justin kuczynski" __email__ = "justinak@gmail.com" """Contains tests for beta_metrics functions."...
gpl-2.0
juliushaertl/i3pystatus
i3pystatus/core/util.py
1
17760
import collections import functools import re import socket import string import inspect from threading import Timer, RLock def lchop(string, prefix): """Removes a prefix from string :param string: String, possibly prefixed with prefix :param prefix: Prefix to remove from string :returns: string with...
mit
willemneal/Docky
lib/unidecode/x029.py
165
3584
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
mit
michalliu/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python3.4/distutils/command/clean.py
205
2776
"""distutils.command.clean Implements the Distutils 'clean' command.""" # contributed by Bastian Kleineidam <calvin@cs.uni-sb.de>, added 2000-03-18 import os from distutils.core import Command from distutils.dir_util import remove_tree from distutils import log class clean(Command): description = "clean up tem...
gpl-2.0
impowski/servo
tests/wpt/css-tests/tools/wptserve/wptserve/router.py
316
5895
import itertools import re import types from logger import get_logger any_method = object() class RouteTokenizer(object): def literal(self, scanner, token): return ("literal", token) def slash(self, scanner, token): return ("slash", None) def group(self, scanner, token): return ...
mpl-2.0
kiyoto/statsmodels
statsmodels/sandbox/gam.py
33
15421
""" Generalized additive models Requirements for smoothers -------------------------- smooth(y, weights=xxx) : ? no return ? alias for fit predict(x=None) : smoothed values, fittedvalues or for new exog df_fit() : degress of freedom of fit ? Notes ----- - using PolySmoother works for AdditiveModel, and GAM with P...
bsd-3-clause
sysadminmatmoz/ingadhoc
project_issue_order/__openerp__.py
4
1664
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
agpl-3.0
40223105/2015cd_0512
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_discovery.py
785
13838
import os import re import sys import unittest class TestableTestProgram(unittest.TestProgram): module = '__main__' exit = True defaultTest = failfast = catchbreak = buffer = None verbosity = 1 progName = '' testRunner = testLoader = None def __init__(self): pass class TestDisc...
agpl-3.0
iwegner/MITK
Modules/Biophotonics/python/iMC/scripts/ipcai_to_theano/input_icai_data.py
6
3612
""" This tutorial introduces logistic regression using Theano and stochastic gradient descent. Logistic regression is a probabilistic, linear classifier. It is parametrized by a weight matrix :math:`W` and a bias vector :math:`b`. Classification is done by projecting data points onto a set of hyperplanes, the distance...
bsd-3-clause
SOKP/external_chromium_org
chrome/test/ispy/server/main_view_handler.py
88
4303
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Request handler to serve the main_view page.""" import jinja2 import json import os import re import sys import webapp2 import ispy_api from common impo...
bsd-3-clause
pkleimert/hrpt
apps/survey/spec.py
4
17104
import simplejson as json __all__ = ['Survey', 'Question', 'Profile', 'Response', 'Advise', 'If', 'ElseIf', 'Else', 'Empty', 'Equal', 'EqualIndex', 'In', 'And', 'Or', 'Not'] class Question(object): question = None type = None private = False blank = False ...
agpl-3.0
michellemorales/OpenMM
models/compression/entropy_coder/all_models/all_models_test.py
14
2447
# 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 applicab...
gpl-2.0
benoitsteiner/tensorflow-opencl
tensorflow/contrib/rnn/python/ops/lstm_ops.py
11
24027
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
sarutobi/ritmserdtsa
rynda/message/migrations/0001_initial.py
3
4623
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import jsonfield.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('geozones', '0001_initial'), migrations.swappable_dependency(settings.AUTH_US...
mit
prune998/ansible
lib/ansible/modules/clustering/pacemaker_cluster.py
27
7664
#!/usr/bin/python #coding: utf-8 -*- # (c) 2016, Mathieu Bultel <mbultel@redhat.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 option) any ...
gpl-3.0
F5Networks/f5-icontrol-rest-python
icontrol/session.py
1
28048
# Copyright 2019 F5 Networks 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 agreed to in writ...
apache-2.0
zhanqxun/cv_fish
pythonwin/pywin/Demos/openGLDemo.py
4
8939
# Ported from the win32 and MFC OpenGL Samples. from pywin.mfc import docview import sys try: from OpenGL.GL import * from OpenGL.GLU import * except ImportError: print "The OpenGL extensions do not appear to be installed." print "This Pythonwin demo can not run" sys.exit(1) import win32con import w...
apache-2.0
dataxu/ansible-modules-core
cloud/amazon/elasticache_subnet_group.py
51
5267
#!/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 distributed...
gpl-3.0
mikf/gallery-dl
scripts/man.py
1
7598
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2019-2020 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. """Generate man pages""" import re import dateti...
gpl-2.0
scripni/rethinkdb
packaging/osx/biplist/__init__.py
37
31532
"""biplist -- a library for reading and writing binary property list files. Binary Property List (plist) files provide a faster and smaller serialization format for property lists on OS X. This is a library for generating binary plists which can be read by OS X, iOS, or other clients. The API models the plistlib API,...
agpl-3.0
gregvonkuster/icqsol
bem/icqBaseLaplaceSolver.py
2
2956
#!/usr/bin/env python from __future__ import print_function import vtk import numpy from icqsol.bem.icqBaseSolver import BaseSolver from icqsol.bem.icqPotentialIntegrals import PotentialIntegrals from icqsol.bem.icqQuadrature import gaussPtsAndWeights from icqsol.util.icqSharedLibraryUtils import getSharedLibraryName ...
mit