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
Thrameos/jpype
test/jpypetest/test_ref.py
2
2285
# ***************************************************************************** # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
apache-2.0
slank/ansible
contrib/inventory/ssh_config.py
160
3979
#!/usr/bin/env python # (c) 2014, Tomas Karasek <tomas.karasek@digile.fi> # # 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 # (a...
gpl-3.0
gkarlin/django-jenkins
build/Django/django/contrib/messages/storage/__init__.py
116
1185
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module def get_storage(import_path): """ Imports the message storage class described by import_path, where import_path is the full Python path to the class. """ try: ...
lgpl-3.0
MatthewWilkes/django-oscar
tests/unit/offer/results_tests.py
62
1039
from decimal import Decimal as D from django.test import TestCase from oscar.apps.offer import models, results class TestOfferApplicationsObject(TestCase): def setUp(self): self.applications = results.OfferApplications() self.offer = models.ConditionalOffer() def test_is_countable(self): ...
bsd-3-clause
SGenheden/Scripts
Mol/parse_optq.py
1
2134
# Author: Samuel Genheden samuel.genheden@gmail.com """ Program to parse RESP charges and make Gromacs residue template file (.rtp) Atoms in the PDB file need to be in the same order as in the charge file The atom types file need to have an atomtype definition on each line NAME1 TYPE1 NAME2 TYPE2 ... Us...
mit
joliva/wiki-appengine
main.py
1
12161
#!/usr/bin/env python import cgi, re, os, logging, string import hmac, random from datetime import datetime import webapp2, jinja2 from google.appengine.ext import db from google.appengine.api import memcache template_dir = os.path.join(os.path.dirname(__file__), 'templates') jinja_env = jinja2.Environment(loader = ...
bsd-3-clause
huyang1532/python-data-mining-platform
pymining/classifier/naive_bayes.py
8
5954
import math import pickle from ..math.matrix import Matrix from ..math.text2matrix import Text2Matrix from ..nlp.segmenter import Segmenter from ..common.global_info import GlobalInfo from ..common.configuration import Configuration class NaiveBayes: def __init__(self, config, nodeName, loadFromFile = False): ...
bsd-3-clause
mm1ke/portage
pym/portage/package/ebuild/_config/features_set.py
16
3844
# Copyright 2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 __all__ = ( 'features_set', ) import logging from portage.const import SUPPORTED_FEATURES from portage.localization import _ from portage.output import colorize from portage.util import writemsg_level class featur...
gpl-2.0
dmitry-sobolev/ansible
lib/ansible/modules/network/nxos/nxos_acl_interface.py
19
9981
#!/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
vveerava/Openstack
neutron/openstack/common/fixture/moxstubout.py
73
1223
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2013 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except i...
apache-2.0
cedriclaunay/gaffer
python/GafferImageUI/ImageViewToolbar.py
2
5329
########################################################################## # # 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: # # * Redistrib...
bsd-3-clause
jamesr66a/cryptkernel
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
youdonghai/intellij-community
plugins/hg4idea/testData/bin/mercurial/sshrepo.py
88
8196
# sshrepo.py - ssh repository proxy class for mercurial # # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from node import bin, hex from i18n import _ import repo, util, error,...
apache-2.0
constantinius/YaaGame
kytten/override.py
2
4350
# kytten/override.py # Copyrighted (C) 2009 by Conrad "Lynx" Wong import pyglet KYTTEN_LAYOUT_GROUPS = {} KYTTEN_LAYOUT_GROUP_REFCOUNTS = {} def GetKyttenLayoutGroups(group): if not KYTTEN_LAYOUT_GROUPS.has_key(group): top_group = pyglet.text.layout.TextLayoutGroup(group) background_gr...
mit
schalkneethling/bedrock
bedrock/mozorg/tests/test_helper_misc.py
3
24457
# coding: utf-8 import os.path from datetime import datetime from django.conf import settings from django.test.client import RequestFactory from django.test.utils import override_settings from django_jinja.backend import Jinja2 from jinja2 import Markup from mock import patch from nose.tools import eq_, ok_ from pyq...
mpl-2.0
Jmainguy/ansible-modules-extras
cloud/amazon/sts_session_token.py
34
5257
#!/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
grap/OpenUpgrade
addons/marketing_campaign/marketing_campaign.py
51
41800
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
mayblue9/bokeh
bokeh/server/models/convenience.py
29
1566
def can_read_doc_api(doc, apikey): if can_write_doc_api(doc, apikey): return True return apikey == doc.readonlyapikey def can_write_doc_api(doc, apikey): return apikey == doc.apikey def can_read_doc(doc, bokehuser): return bokehuser.username in doc.r_users def can_write_doc(doc, bokehuser): ...
bsd-3-clause
thesquelched/libcloud
libcloud/compute/drivers/ecp.py
32
11705
# 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 use ...
apache-2.0
CamelBackNotation/CarnotKE
jyhton/Lib/test/zxjdbc/runner.py
19
5996
# Jython Database Specification API 2.0 # # Copyright (c) 2001 brian zimmer <bzimmer@ziclix.com> """ To run the tests, simply invoke this script from the commandline: jython runner.py <xml config file> [vendor, ...] If no vendors are given, then all vendors will be tested. If a vendor is given, then only that vend...
apache-2.0
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/python/Lib/numpy/polynomial/tests/test_hermite.py
24
17928
"""Tests for hermendre module. """ from __future__ import division import numpy as np import numpy.polynomial.hermite as herm import numpy.polynomial.polynomial as poly from numpy.testing import * H0 = np.array([ 1]) H1 = np.array([0, 2]) H2 = np.array([ -2, 0, 4]) H3 = np.array([0, -12, 0, 8]) H4...
agpl-3.0
psychopy/psychopy
psychopy/hardware/forp.py
1
6704
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2021 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). """fORP fibre optic (MR-compatible) response devices by CurrentDesigns: http://www.curdes....
gpl-3.0
axbaretto/beam
sdks/python/.tox/lint/lib/python2.7/site-packages/google/auth/compute_engine/credentials.py
14
4516
# Copyright 2016 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 or agreed to in writing,...
apache-2.0
Thingee/cinder
cinder/common/config.py
1
8272
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2012 Red Hat, Inc. # Copyright 2013 NTT corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file exc...
apache-2.0
tawsifkhan/scikit-learn
sklearn/datasets/tests/test_lfw.py
230
7880
"""This test for the LFW require medium-size data dowloading and processing If the data has not been already downloaded by running the examples, the tests won't run (skipped). If the test are run, the first execution will be long (typically a bit more than a couple of minutes) but as the dataset loader is leveraging ...
bsd-3-clause
AnishShah/tensorflow
tensorflow/python/eager/tensor_test.py
5
12902
# 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
ujenmr/ansible
lib/ansible/modules/storage/purestorage/purefa_ntp.py
14
3550
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Simon Dodsley (simon@purestorage.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1',...
gpl-3.0
cat9/shadowsocks
shadowsocks/encrypt.py
990
5180
#!/usr/bin/env python # # Copyright 2012-2015 clowwindy # # 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
nuchi/httpserver
httpserver.py
1
1065
#!/usr/bin/env python import socket from http_handler import Handler_thread MAX_CONNECTIONS = 5 class HTTPserver(object): def __init__(self, localOnly=False, port=80, max_connections=MAX_CONNECTIONS): self.port = port self.max_connections = max_connections if localOnly: self.hostname = '127.0.0.1' else: ...
mit
schumi2004/NOT_UPDATED_Sick-Beard-Dutch
lib/unidecode/x031.py
252
4125
data = ( '[?]', # 0x00 '[?]', # 0x01 '[?]', # 0x02 '[?]', # 0x03 '[?]', # 0x04 'B', # 0x05 'P', # 0x06 'M', # 0x07 'F', # 0x08 'D', # 0x09 'T', # 0x0a 'N', # 0x0b 'L', # 0x0c 'G', # 0x0d 'K', # 0x0e 'H', # 0x0f 'J', # 0x10 'Q', # 0x11 'X', # 0x12 'ZH', # 0x13 ...
gpl-3.0
CoDEmanX/ArangoDB
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/framework/editor/__init__.py
17
2824
# __init__ for the Pythonwin editor package. # # We used to support optional editors - eg, color or non-color. # # This really isnt necessary with Scintilla, and scintilla # is getting so deeply embedded that it was too much work. import win32ui, sys, win32con defaultCharacterFormat = (-402653169, 0, 200, 0, 0, 0, 49...
apache-2.0
elaeon/dsignature
creacion_firma/forms.py
1
3487
# -*- coding: utf-8 -*- from django import forms from django.forms import ModelForm from creacion_firma.models import FirmarCertificado, NominaSubida, User import datetime class UserForm(forms.Form): nombre = forms.CharField(max_length=150, widget=forms.TextInput(attrs={"style": "width: 400px"})) correo_elect...
gpl-3.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/django/urls/resolvers.py
39
21589
""" This module converts requested URLs to callback view functions. RegexURLResolver is the main class here. Its resolve() method takes a URL (as a string) and returns a ResolverMatch object which provides access to all attributes of the resolved URL match. """ from __future__ import unicode_literals import functools...
gpl-3.0
junneyang/taskflow
taskflow/examples/example_utils.py
4
3306
# -*- coding: utf-8 -*- # Copyright (C) 2013 Yahoo! 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...
apache-2.0
mdinacci/rtw
demos/proto2/src/proto2.py
1
15023
# -*- coding: utf-8-*- """ Author: Marco Dinacci <dev@dinointeractive.com> Copyright © 2008-2009 """ from pandac.PandaModules import * loadPrcFile("../res/Config.prc") #loadPrcFileData("", "want-directtools 1") #loadPrcFileData("", "want-tk 1") import direct.directbase.DirectStart from direct.gui.OnscreenText import...
mit
ayushagrawal288/zamboni
mkt/webapps/cron.py
3
19390
import logging import os import shutil import time from datetime import datetime from django.conf import settings from django.db.models import Q import commonware.log import cronjobs from celery import chord import mkt from lib.metrics import get_monolith_client from mkt.api.models import Nonce from mkt.developers.m...
bsd-3-clause
jeffzheng1/tensorflow
tensorflow/python/kernel_tests/io_ops_test.py
4
3342
# -*- coding: utf-8 -*- # 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 # # Un...
apache-2.0
wetek-enigma/enigma2
lib/python/Components/HdmiCec.py
20
13311
import struct import os from fcntl import ioctl from sys import maxint from enigma import eTimer, eHdmiCEC, eActionMap from config import config, ConfigSelection, ConfigYesNo, ConfigSubsection, ConfigText from Tools.StbHardware import getFPWasTimerWakeup from Tools.Directories import fileExists config.hdmicec = Confi...
gpl-2.0
cherokee/webserver
qa/159-RuleHeader2.py
8
1073
from base import * DIR = "header_test2_referer_match" REFERER = "example.159com" MAGIC = "Dealing with rule based headers (bis).." CONF = """ vserver!1!rule!1590!match = header vserver!1!rule!1590!match!header = Referer vserver!1!rule!1590!match!match = .+\.159com vserver!1!rule!1590!handler = file vserv...
gpl-2.0
xyzz/vcmi-build
project/jni/python/src/Lib/test/test_mimetypes.py
77
2581
import mimetypes import StringIO import unittest from test import test_support # Tell it we don't know about external files: mimetypes.knownfiles = [] mimetypes.inited = False mimetypes._default_mime_types() class MimeTypesTestCase(unittest.TestCase): def setUp(self): self.db = mimetypes.MimeTypes() ...
lgpl-2.1
GunnerJnr/_CodeInstitute
Stream-3/Full-Stack-Development/19.Djangos-Testing-Framework/5.How-To-Test-Forms/we_are_social/threads/templatetags/thread_extras.py
10
1438
import arrow from django import template from django.core.urlresolvers import reverse register = template.Library() @register.filter def get_total_subject_posts(subject): """ get_total_subject_posts(): """ total_posts = 0 for thread in subject.threads.all(): total_posts += thread.posts.co...
mit
sarthakmeh03/django
tests/model_options/test_tablespaces.py
43
5370
from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.db import connection from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from .models.tablespaces import ( Article, ArticleRef, Authors, Reviewers, Scientist, ScientistRef, ) def ...
bsd-3-clause
eXistenZNL/SickRage
lib/lockfile/pidlockfile.py
488
6221
# -*- coding: utf-8 -*- # pidlockfile.py # # Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au> # # This is free software: you may copy, modify, and/or distribute this work # under the terms of the Python Software Foundation License, version 2 or # later as published by the Python Software Foundation. # No ...
gpl-3.0
dokterbob/django-shopkit
shopkit/price/advanced/__init__.py
1
1338
# Copyright (C) 2010-2011 Mathijs de Bruin <mathijs@mathijsfietst.nl> # # This file is part of django-shopkit. # # django-shopkit 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; either version 2, or (at...
agpl-3.0
xforce/diorama-native-modding
tools/gyp/pylib/gyp/generator/cmake.py
148
44560
# Copyright (c) 2013 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. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMake...
bsd-3-clause
hantek/pylearn2
pylearn2/scripts/tutorials/deep_trainer/run_deep_trainer.py
44
9086
#!/usr/bin/env python from __future__ import print_function __author__ = "Li Yao" """ See readme.txt A small example of how to glue shining features of pylearn2 together to train models layer by layer. """ MAX_EPOCHS_UNSUPERVISED = 1 MAX_EPOCHS_SUPERVISED = 2 from pylearn2.config import yaml_parse from pylearn2.cor...
bsd-3-clause
postlund/home-assistant
homeassistant/components/opentherm_gw/sensor.py
3
3684
"""Support for OpenTherm Gateway sensors.""" import logging from homeassistant.components.sensor import ENTITY_ID_FORMAT from homeassistant.const import CONF_ID from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity,...
apache-2.0
UNINETT/nav
python/nav/eventengine/plugins/linkstate.py
2
8822
# # Copyright (C) 2012 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License version 3 as published by # the Free Software Foundation. # # This program is distributed in the hope...
gpl-2.0
40223137/2015abc
static/Brython3.1.0-20150301-090019/Lib/gc.py
743
3548
"""This module provides access to the garbage collector for reference cycles. enable() -- Enable automatic garbage collection. disable() -- Disable automatic garbage collection. isenabled() -- Returns true if automatic collection is enabled. collect() -- Do a full collection right now. get_count() -- Return the curren...
gpl-3.0
Kazade/NeHe-Website
google_appengine/lib/django_1_2/tests/modeltests/model_forms/models.py
38
52607
""" XX. Generating HTML forms from models This is mostly just a reworking of the ``form_for_model``/``form_for_instance`` tests to use ``ModelForm``. As such, the text may not make sense in all cases, and the examples are probably a poor fit for the ``ModelForm`` syntax. In other words, most of these tests should be r...
bsd-3-clause
valentin-krasontovitsch/ansible
lib/ansible/inventory/helpers.py
120
1293
# (c) 2017, Ansible by RedHat 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. # # Ans...
gpl-3.0
leppa/home-assistant
homeassistant/components/android_ip_webcam/switch.py
6
2752
"""Support for Android IP Webcam settings.""" from homeassistant.components.switch import SwitchDevice from . import ( CONF_HOST, CONF_NAME, CONF_SWITCHES, DATA_IP_WEBCAM, ICON_MAP, KEY_MAP, AndroidIPCamEntity, ) async def async_setup_platform(hass, config, async_add_entities, discovery_i...
apache-2.0
UrusTeam/URUS
Tools/autotest/pysim/aircraft.py
81
3985
import math import random import time import util from rotmat import Vector3, Matrix3 class Aircraft(object): """A basic aircraft class.""" def __init__(self): self.home_latitude = 0 self.home_longitude = 0 self.home_altitude = 0 self.ground_level = 0 self.frame_height...
gpl-3.0
samueldotj/TeeRISC-Simulator
src/arch/x86/isa/insts/simd128/floating_point/logical/__init__.py
91
2333
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
robinro/ansible
lib/ansible/modules/monitoring/monit.py
49
7071
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Darryl Stoflet <stoflet@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 Li...
gpl-3.0
duyetdev/openerp-6.1.1
openerp/addons/crm_claim/__init__.py
390
1078
# -*- 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
ryfeus/lambda-packs
Tensorflow/source/tensorflow/contrib/learn/python/learn/learn_io/generator_io.py
37
5360
# 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...
mit
40223234/w16b_test
static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/locals.py
603
1141
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License...
agpl-3.0
mtnman38/Aggregate
Executables/Aggregate 0.8.8 for Macintosh.app/Contents/Resources/lib/python2.7/requests/packages/urllib3/__init__.py
650
1701
# urllib3/__init__.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (a...
gpl-2.0
ObsidianBlk/GemRB--Unofficial-
gemrb/GUIScripts/bg2/QuitGame.py
7
1090
# -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2007 The GemRB Project # # 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 your option) ...
gpl-2.0
silentfuzzle/calibre
src/calibre/ebooks/pdf/outline_writer.py
14
2318
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
gpl-3.0
ArcherSys/ArcherSys
Lib/site-packages/pycparser/_ast_gen.py
78
8663
#----------------------------------------------------------------- # _ast_gen.py # # Generates the AST Node classes from a specification given in # a configuration file # # The design of this module was inspired by astgen.py from the # Python 2.5 code-base. # # Copyright (C) 2008-2015, Eli Bendersky # License: BSD #---...
mit
bop/hybrid
lib/python2.6/site-packages/django/contrib/formtools/tests/wizard/wizardtests/tests.py
93
16277
from __future__ import unicode_literals import os from django import forms from django.test import TestCase from django.test.client import RequestFactory from django.conf import settings from django.contrib.auth.models import User from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.formto...
gpl-2.0
ojengwa/oh-mainline
vendor/packages/scrapy/scrapy/utils/conf.py
40
2132
import sys import os from ConfigParser import SafeConfigParser from operator import itemgetter def build_component_list(base, custom): """Compose a component list based on a custom and base dict of components (typically middlewares or extensions), unless custom is already a list, in which case it's returne...
agpl-3.0
hlzz/dotfiles
graphics/cgal/Documentation/conversion_tools/markup_replacement.py
1
1846
#!/usr/bin/python2 #replace markup #, ## ,### by \section, \subsection, \subsubsection. #anchor names are preserved and generated from the section name otherwise #The script is not perfect and might miss some specific cases from sys import argv from os import path import string import re anchors={} def generate_anc...
bsd-3-clause
metaml/nupic
src/nupic/math/mvn.py
50
6412
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
crosslinks/XlinkAnalyzer
pytests/XlaGuiTests.py
1
2262
import chimera import unittest from os import path import xlinkanalyzer from xlinkanalyzer import gui RUNME = False description = "Base classes for testing gui" class XlaBaseTest(unittest.TestCase): def setUp(self, mPaths, cPath): mPath = xlinkanalyzer.__path__[0] xlaTestPath = path.join(path...
gpl-2.0
AlexHill/django
tests/raw_query/models.py
150
1034
from django.db import models class Author(models.Model): first_name = models.CharField(max_length=255) last_name = models.CharField(max_length=255) dob = models.DateField() def __init__(self, *args, **kwargs): super(Author, self).__init__(*args, **kwargs) # Protect against annotations...
bsd-3-clause
Sofcom/treeio
treeio/events/models.py
6
1430
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license """ Events module objects. Depends on: treeio.core, treeio.identities """ from django.db import models from django.core.urlresolvers import reverse from treeio.identities.models import Contact from treeio....
mit
bgris/ODL_bgris
lib/python3.5/site-packages/odl/util/pytest_plugins.py
2
5563
# Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL 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
Huyuwei/tvm
tests/python/unittest/test_pass_attrs_hash_equal.py
2
2138
# 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
cognitiveclass/edx-platform
cms/envs/dev.py
25
5958
""" This config file runs the simplest dev environment""" # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=wildcard-import, unused-wildcard-import from .common import * from openedx.core.lib.logsettings import get_logger_config...
agpl-3.0
WarrickJiang/linux-stable
scripts/analyze_suspend.py
1537
120394
#!/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
Aegeaner/spark
python/pyspark/testing/utils.py
1
3566
# # 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
Aorjoa/aiyara-ceph-dash
.tox/flake8/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py
353
3380
from __future__ import absolute_import import socket try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is...
bsd-2-clause
lfrdm/medpy
bin/medpy_intensity_range_standardization.py
2
9361
#!/usr/bin/python """ Standardizes the intensity range / profile of a number of similar images. Copyright (C) 2013 Oskar Maier 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 th...
gpl-3.0
ldts/zephyr
arch/x86/gen_gdt.py
2
6755
#!/usr/bin/env python3 # # Copyright (c) 2017 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 """Generate a Global Descriptor Table (GDT) for x86 CPUs. For additional detail on GDT and x86 memory management, please consult the IA Architecture SW Developer Manual, vol. 3. This script accepts as input the ze...
apache-2.0
rahulraj/web_projects
assignment2/src/photogallery/generator/galleryitemfactory.py
1
6059
import os import re import os.path from iptcinfo import IPTCInfo from galleryitem import JpegPicture, JpegDirectory, directory_name_to_html_file_name from ..utils.inject import assign_injectables def is_jpeg_file(file_name): """ Determine if a file is labeled as a JPEG. Args: file_name the name of the file....
mit
littlstar/chromium.src
tools/deep_memory_profiler/accumulate.py
100
9536
#!/usr/bin/env python # 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. # A script to accumulate values from the 'dmprof cat' command into CSV or else. # # Usage: # ./accumulate.py -f <format> -t <template...
bsd-3-clause
anntzer/scikit-learn
examples/model_selection/plot_confusion_matrix.py
8
2074
""" ================ Confusion matrix ================ Example of confusion matrix usage to evaluate the quality of the output of a classifier on the iris data set. The diagonal elements represent the number of points for which the predicted label is equal to the true label, while off-diagonal elements are those that ...
bsd-3-clause
FreeAgent/djangoappengine-starter
django/contrib/gis/geos/collections.py
311
4663
""" This module houses the Geometry Collection objects: GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon """ from ctypes import c_int, c_uint, byref from django.contrib.gis.geos.error import GEOSException, GEOSIndexError from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gi...
bsd-3-clause
rwl/muntjac
muntjac/addon/invient/demo/invient_demo_win.py
1
154853
# @INVIENT_COPYRIGHT@ # @MUNTJAC_LICENSE@ """Window for Invient charts demo.""" from StringIO \ import StringIO from random \ import random from threading \ import Thread from time \ import sleep from muntjac.addon.invient.invient_charts_util \ import getDate from datetime \ import dateti...
apache-2.0
jeffzheng1/tensorflow
tensorflow/contrib/learn/python/learn/utils/export_test.py
6
5141
# 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
GdZ/scriptfile
software/googleAppEngine/lib/django_1_3/django/contrib/gis/gdal/prototypes/ds.py
311
4244
""" This module houses the ctypes function prototypes for OGR DataSource related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*, OGR_Fld_* routines are relevant here. """ from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from djan...
mit
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/protobuf/python/google/protobuf/internal/containers.py
36
20173
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
gpl-3.0
paypal/keystone
keystone/middleware/auth_token.py
6
1278
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2012 OpenStack 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 r...
apache-2.0
mjtamlyn/archery-scoring
scores/migrations/0001_initial.py
1
2398
# -*- coding: utf-8 -*- from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('entries', '0001_initial'), ] operations = [ migrations.CreateModel( name='Arrow', fields=[ ('id', models.AutoField(verbose_n...
bsd-3-clause
wangyj1/depdep
lib/core/configparser.py
8
5921
try: import sys from xml.etree import ElementTree except ImportError,e: import sys sys.stdout.write("%s\n" %e) sys.exit(1) class ConfigParser: result = {} @staticmethod def parse(config_file): if not ConfigParser.result: try: with open(config_...
mit
bkahlert/seqan-research
raw/workshop13/workshop2013-data-20130926/trunk/extras/apps/gustaf/tests/run_tests.py
4
8141
#!/usr/bin/env python """Execute the tests for program gustaf. The golden test outputs are generated by the script generate_outputs.sh. You have to give the root paths to the source and the binaries as arguments to the program. These are the paths to the directory that contains the 'projects' directory. Usage: run...
mit
gemrb/gemrb
gemrb/GUIScripts/bg1/ImportFile.py
1
2330
# GemRB - Infinity Engine Emulator # Copyright (C) 2003 The GemRB Project # # 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 your option) any later versi...
gpl-2.0
pgmillon/ansible
lib/ansible/modules/web_infrastructure/sophos_utm/utm_proxy_auth_profile.py
36
12351
#!/usr/bin/python # Copyright: (c) 2018, Stephan Schwarz <stearz@gmx.de> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status'...
gpl-3.0
w1ll1am23/home-assistant
homeassistant/components/modbus/modbus.py
2
8002
"""Support for Modbus.""" import logging import threading from pymodbus.client.sync import ModbusSerialClient, ModbusTcpClient, ModbusUdpClient from pymodbus.transaction import ModbusRtuFramer from homeassistant.const import ( CONF_BINARY_SENSORS, CONF_COVERS, CONF_DELAY, CONF_HOST, CONF_METHOD, ...
apache-2.0
ChrisAntaki/phantomjs
src/breakpad/src/tools/gyp/test/dependencies/gyptest-lib-only.py
151
1091
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verify that a link time only dependency will get pulled into the set of built targets, even if no executable uses it. """ import TestGy...
bsd-3-clause
datafolklabs/cement
cement/core/extension.py
1
3997
"""Cement core extensions module.""" import sys from abc import abstractmethod from ..core import exc from ..core.interface import Interface from ..core.handler import Handler from ..utils.misc import minimal_logger LOG = minimal_logger(__name__) class ExtensionInterface(Interface): """ This class defines ...
bsd-3-clause
shipci/boto
boto/manage/__init__.py
271
1108
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
RydrDojo/Ridr
pylotVenv/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/mysqlconnector.py
59
5323
# mysql/mysqlconnector.py # Copyright (C) 2005-2015 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 """ .. dialect:: mysql+mysqlconnector :name: MySQL Connector/Python ...
mit
androidarmv6/android_external_chromium_org
tools/telemetry/telemetry/core/backends/chrome/chrome_browser_options.py
23
1115
# 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. from telemetry.core import browser_options from telemetry.core.backends.chrome import cros_interface def CreateChromeBrowserOptions(br_options): browser_...
bsd-3-clause
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/Stripe/Plans/DeletePlan.py
5
3090
# -*- coding: utf-8 -*- ############################################################################### # # DeletePlan # Deletes a specified plan. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in ...
apache-2.0
abseil/abseil-py
absl/testing/flagsaver.py
3
6577
# Copyright 2017 The Abseil Authors. # # 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 ...
apache-2.0
Curious72/sympy
sympy/polys/domains/old_polynomialring.py
68
13856
"""Implementation of :class:`PolynomialRing` class. """ from __future__ import print_function, division from sympy.polys.domains.ring import Ring from sympy.polys.domains.compositedomain import CompositeDomain from sympy.polys.domains.characteristiczero import CharacteristicZero from sympy.polys.domains.old_fractionf...
bsd-3-clause