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
auready/django
tests/forms_tests/widget_tests/test_splitdatetimewidget.py
202
1943
from datetime import date, datetime, time from django.forms import SplitDateTimeWidget from .base import WidgetTest class SplitDateTimeWidgetTest(WidgetTest): widget = SplitDateTimeWidget() def test_render_empty(self): self.check_html(self.widget, 'date', '', html=( '<input type="text" ...
bsd-3-clause
kevinmel2000/sl4a
python/src/Lib/ctypes/test/test_functions.py
51
12814
""" Here is probably the place to write the docs, since the test-cases show how the type behave. Later... """ from ctypes import * import sys, unittest try: WINFUNCTYPE except NameError: # fake to enable this test on Linux WINFUNCTYPE = CFUNCTYPE import _ctypes_test dll = CDLL(_ctypes_test.__file__) if ...
apache-2.0
zhjunlang/kbengine
kbe/src/lib/python/Lib/test/test_rlcompleter.py
173
2809
from test import support import unittest import builtins import rlcompleter class CompleteMe: """ Trivial class used in testing rlcompleter.Completer. """ spam = 1 class TestRlcompleter(unittest.TestCase): def setUp(self): self.stdcompleter = rlcompleter.Completer() self.completer = rlcom...
lgpl-3.0
dendisuhubdy/tensorflow
tensorflow/contrib/distribute/python/values_test.py
3
37698
# 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
eXcomm/namecoin
client/jsonrpc/__init__.py
67
1125
""" Copyright (c) 2007 Jan-Klaas Kollhof This file is part of jsonrpc. jsonrpc is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later...
mit
sorgerlab/belpy
indra/sources/geneways/processor.py
2
7555
""" This module provides an input processor for information extracted using the Geneways software suite, converting extraction data in Geneways format into INDRA statements. See publication: Rzhetsky, Andrey, Ivan Iossifov, Tomohiro Koike, Michael Krauthammer, Pauline Kra, Mitzi Morris, Hong Yu et al. "GeneWays: a sys...
mit
intfrr/shaka-player
third_party/gjslint/closure_linter-2.3.13/setup.py
23
1324
#!/usr/bin/env python # # Copyright 2010 The Closure Linter 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 #...
apache-2.0
nhicher/ansible
lib/ansible/plugins/cliconf/ironware.py
18
2790
# # (c) 2017 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
c0cky/mediathread
mediathread/projects/admin.py
1
1386
from django.contrib import admin from django.contrib.auth.models import User from mediathread.projects.models import Project class ProjectAdmin(admin.ModelAdmin): search_fields = ("title", "participants__last_name", "author__username", "participants__last_name") list...
gpl-2.0
ocampocj/cloud-custodian
tools/c7n_gcp/c7n_gcp/resources/pubsub.py
3
2336
# Copyright 2018 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 to in...
apache-2.0
polimediaupv/edx-platform
lms/djangoapps/notifier_api/serializers.py
86
2661
from django.contrib.auth.models import User from django.http import Http404 from rest_framework import serializers from openedx.core.djangoapps.course_groups.cohorts import is_course_cohorted from notification_prefs import NOTIFICATION_PREF_KEY from lang_pref import LANGUAGE_KEY class NotifierUserSerializer(serializ...
agpl-3.0
FirmlyReality/docklet
meter/policy/quota.py
4
1527
from intra.system import system_manager from intra.cgroup import cgroup_manager import subprocess class identify_policy: def get_score_by_uuid(uuid): return 1.0 class etime_rev_policy(identify_policy): def get_score_by_uuid(uuid): pid = cgroup_manager.get_container_pid(uuid) etime = system_manager.get_pro...
bsd-3-clause
jiwang576/incubator-airflow
tests/contrib/operators/test_emr_terminate_job_flow_operator.py
56
1676
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
Therp/odoo
addons/sale/wizard/sale_make_invoice_advance.py
22
10812
############################################################################## # # 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 Affero General Public L...
agpl-3.0
malin1993ml/h-store
third_party/python/boto/ec2/spotdatafeedsubscription.py
46
2371
# 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...
gpl-3.0
amchoukir/YouCompleteMe
python/ycm/diagnostic_interface.py
33
8511
#!/usr/bin/env python # # Copyright (C) 2013 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 you...
gpl-3.0
seem-sky/kbengine
kbe/src/lib/python/Lib/encodings/koi8_u.py
272
13762
""" Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.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='stri...
lgpl-3.0
romanornr/viacoin
test/functional/test_framework/socks5.py
56
5713
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Dummy Socks5 server for testing.""" import socket, threading, queue import logging logger = logging.g...
mit
Silight/ComicEnv
ComicEnv/lib/python3.2/site-packages/pip/baseparser.py
149
9643
"""Base option parser setup""" from __future__ import absolute_import import sys import optparse import os import re import textwrap from distutils.util import strtobool from pip._vendor.six import string_types from pip._vendor.six.moves import configparser from pip.locations import ( legacy_config_file, config_b...
mit
ZxlAaron/mypros
python/pyspark/mllib/linalg/distributed.py
17
46509
# # 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
ahmed-mahran/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/tests/geoapp/models.py
109
1890
from django.contrib.gis.db import models from django.contrib.gis.tests.utils import mysql, spatialite from django.utils.encoding import python_2_unicode_compatible # MySQL spatial indices can't handle NULL geometries. null_flag = not mysql @python_2_unicode_compatible class Country(models.Model): name = models.Ch...
apache-2.0
lorensen/VTKExamples
src/Python/Deprecated/GeometricObjects/ParametricObjectsDemo.py
1
5485
# !/usr/bin/env python # -*- coding: utf-8 -*- import vtk def main(): colors = vtk.vtkNamedColors() colors.SetColor("BkgColor", [26, 51, 102, 255]) parametricObjects = list() parametricObjects.append(vtk.vtkParametricBoy()) parametricObjects.append(vtk.vtkParametricConicSpiral()) parametric...
apache-2.0
android-ia/platform_external_chromium_org
tools/metrics/histograms/extract_histograms.py
36
15042
# 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. """Extract histogram names from the description XML file. For more information on the format of the XML file, which is self-documenting, see histograms.xml;...
bsd-3-clause
RyanPSullivan/RyanPSullivan.github.io
app/bower_components/highlight/tools/build.py
14
9470
# -*- coding:utf-8 -*- ''' Function for building whole packed version of highlight.js out of pre-packed modules. ''' import os import shutil import sys import re import optparse import subprocess import json from functools import partial REPLACES = { 'defaultMode': 'dM', 'case_insensitive': 'cI', 'lexems'...
mit
jamielennox/python-keystoneclient
keystoneclient/tests/test_cms.py
1
6122
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
rmed/textventures
src/textventures/instances/key_navigation.py
1
4144
# -*- coding: utf-8 -*- # This file is part of TextVentures - https://github.com/RMed/textventures # # Copyright (C) 2013 Rafael Medina García <rafamedgar@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free...
gpl-2.0
banansson/cask
cask.py
1
3281
#!/usr/bin/python import sys import argparse from os import path from src.bag import Bag from src.package import Package from src.task import Task from src.message import Message from src.application import Application from src.application_info import ApplicationInfo from src.bootstrap import Bootstrap from src impor...
mit
noslenfa/tdjangorest
uw/lib/python2.7/site-packages/IPython/testing/_paramtestpy3.py
5
2382
"""Implementation of the parametric test support for Python 3.x. Thanks for the py3 version to Robert Collins, from the Testing in Python mailing list. """ #----------------------------------------------------------------------------- # Copyright (C) 2009-2011 The IPython Development Team # # Distributed under the...
apache-2.0
ksrajkumar/openerp-6.1
openerp/addons/idea/idea.py
9
13789
# -*- 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
ojengwa/grr
lib/flows/general/transfer_test.py
4
5866
#!/usr/bin/env python """Test the file transfer mechanism.""" import os from grr.client.client_actions import standard from grr.lib import action_mocks from grr.lib import aff4 from grr.lib import flags from grr.lib import rdfvalue from grr.lib import test_lib from grr.lib import utils from grr.lib.flows.general im...
apache-2.0
yongshengwang/hue
desktop/core/ext-py/pycrypto-2.6.1/build/lib.linux-x86_64-2.7/Crypto/SelfTest/PublicKey/test_importKey.py
112
14943
# -*- coding: utf-8 -*- # # SelfTest/PublicKey/test_importKey.py: Self-test for importing RSA keys # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone i...
apache-2.0
singingwolfboy/webhookdb
docs/conf.py
1
7995
# -*- coding: utf-8 -*- # # WebhookDB documentation build configuration file, created by # sphinx-quickstart on Wed Feb 25 10:08:26 2015. # # 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. # # A...
agpl-3.0
gsehub/edx-platform
cms/djangoapps/contentstore/views/tests/test_group_configurations.py
11
44171
#-*- coding: utf-8 -*- """ Group Configuration Tests. """ import json import ddt from mock import patch from operator import itemgetter from contentstore.utils import reverse_course_url, reverse_usage_url from contentstore.course_group_config import GroupConfiguration, CONTENT_GROUP_CONFIGURATION_NAME from contentsto...
agpl-3.0
mrquim/repository.mrquim
script.module.exodus/lib/resources/lib/sources/en/gogoanime.py
5
3807
# -*- coding: utf-8 -*- ''' Exodus Add-on 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. This progra...
gpl-2.0
ghickman/django
django/contrib/gis/db/backends/spatialite/operations.py
24
10581
""" SQL functions reference lists: http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html https://web.archive.org/web/20130407175746/http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.0.0.html http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html """ import re import sys from django.contrib.gis.db....
bsd-3-clause
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Tools/scripts/pep384_macrocheck.py
4
4720
""" pep384_macrocheck.py This programm tries to locate errors in the relevant Python header files where macros access type fields when they are reachable from the limided API. The idea is to search macros with the string "->tp_" in it. When the macro name does not begin with an underscore, then we have found a dorman...
apache-2.0
flgiordano/netcash
+/google-cloud-sdk/lib/third_party/requests/adapters.py
573
16810
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib3.response impo...
bsd-3-clause
kaixinjxq/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_font-src_asterisk_allowed_int-manual.py
30
2629
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) response.headers.set("Content-Security-Policy", "font-src *") response.headers.set("X-Content...
bsd-3-clause
ujjvala-addsol/addsol_hr
openerp/report/render/render.py
457
2524
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
idncom/odoo
addons/portal/wizard/portal_wizard.py
260
11847
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
KaiSzuttor/espresso
testsuite/python/rotation.py
1
5271
import numpy as np import unittest as ut try: import scipy.spatial.transform as sst except ImportError: pass import espressomd.rotation import unittest_decorators as utx @utx.skipIfUnmetModuleVersionRequirement('scipy', '>=1.4.0') class TestRotation(ut.TestCase): """ Tests for the rotation utility f...
gpl-3.0
yongfuyang/vnpy
vn.trader/ctaAlgo/ctaBase.py
1
5912
# encoding: UTF-8 ''' 本文件中包含了CTA模块中用到的一些基础设置、类和常量等。 ''' from __future__ import division # 把vn.trader根目录添加到python环境变量中 import sys sys.path.append('..') # 常量定义 # CTA引擎中涉及到的交易方向类型 CTAORDER_BUY = u'买开' CTAORDER_SELL = u'卖平' CTAORDER_SELLTODAY = u'卖平今' CTAORDER_SELLYESTERDAY = u'卖平昨' CTAORDER_SHORT = u'卖开' CTAORDER_CO...
mit
tiqiheng/pyspider
pyspider/database/mysql/mysqlbase.py
75
1880
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-11-05 10:42:24 import time import mysql.connector class MySQLMixin(object): @property def dbcur(self): try: if self.con...
apache-2.0
SaganBolliger/nupic
src/nupic/test/abstract_temporal_memory_test.py
27
2758
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, 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
georgestarcher/TA-SyncKVStore
bin/ta_synckvstore/solnlib/utils.py
4
5592
# Copyright 2016 Splunk, 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,...
mit
chrisidefix/visvis
functions/kde.py
3
1526
# -*- coding: utf-8 -*- # Copyright (C) 2012, Almar Klein # # Visvis is distributed under the terms of the (new) BSD License. # The full license can be found in 'license.txt'. import visvis as vv import numpy as np def kde(data, bins=None, kernel=None, **kwargs): """ kde(a, bins=None, range=None, **kwargs) ...
bsd-3-clause
keon/algorithms
algorithms/backtrack/array_sum_combinations.py
3
2356
""" WAP to take one element from each of the array add it to the target sum. Print all those three-element combinations. /* A = [1, 2, 3, 3] B = [2, 3, 3, 4] C = [2, 3, 3, 4] target = 7 */ Result: [[1, 2, 4], [1, 3, 3], [1, 3, 3], [1, 3, 3], [1, 3, 3], [1, 4, 2], [2, 2, 3], [2, 2, 3], [2, 3, 2], [2, 3, 2], [3, 2, 2]...
mit
Harmon758/discord.py
discord/file.py
2
4424
""" The MIT License (MIT) Copyright (c) 2015-present Rapptz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merg...
mit
hroark13/android_kernel_lge_f6x
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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. # import os import sys import getopt import sh...
gpl-2.0
titasakgm/brc-stock
openerp/addons/hr_contract/__openerp__.py
52
1806
# -*- 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
peixiaobin/viewfinder
marketing/tornado/test/web_test.py
21
60748
from __future__ import absolute_import, division, print_function, with_statement from tornado import gen from tornado.escape import json_decode, utf8, to_unicode, recursive_unicode, native_str, to_basestring from tornado.httputil import format_timestamp from tornado.iostream import IOStream from tornado.log import app_...
apache-2.0
OpenToAllCTF/OTA-Challenge-Bot
server/consolethread.py
1
1960
import threading from bottypes.invalid_console_command import InvalidConsoleCommand from util.loghandler import log class ConsoleThread(threading.Thread): def __init__(self, botserver): self.botserver = botserver threading.Thread.__init__(self) def update_config(self, option, value): ...
mit
caioserra/apiAdwords
tests/adspygoogle/adwords/__init__.py
2
1271
#!/usr/bin/python # -*- coding: UTF-8 -*- # # Copyright 2010 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...
apache-2.0
Thomasvdw/ProgProject
Data/PVdata/add_sum_capacity_perdate.py
1
4323
# -*- coding: utf-8 -*- """ Created on Wed May 27 20:06:01 2015 @author: Thomas """ # Python standard library imports import csv import os def main(): sizes = [] for file in os.listdir("reformatted/"): print file size_total = [] size_2000 = [] size_2001 = [] ...
mit
hj3938/panda3d
contrib/src/sceneeditor/seTree.py
8
14334
################################################################# # seTree.py # Originally from Tree.py # Altered by Yi-Hong Lin, yihhongl@andrew.cmu.edu, 2004 # # This class actually decides the behavior of the sceneGraphExplorer # You might feel it realy looks like the original one, but we actually did a lots of chan...
bsd-3-clause
argvk/lastfmloved-syncer
update_banshee.py
1
1928
import sqlite3 import sys import requests import xml.dom.minidom from os import path con = None artists = {} url_params = {} total_pages = -1 page_no = 0 user_name = sys.argv[1] banshee_db = path.expanduser("~/.config/banshee-1/banshee.db") con = sqlite3.connect(banshee_db) cur = con.cursor() while True: if tot...
mit
hxfxjun/ImageMagick-6.9.1
libxml/python/tests/xpathret.py
37
1319
#!/usr/bin/python -u import sys import libxml2 #memory debug specific libxml2.debugMemory(1) # # A document hosting the nodes returned from the extension function # mydoc = libxml2.newDoc("1.0") def foo(ctx, str): global mydoc # # test returning a node set works as expected # parent = mydoc.newD...
apache-2.0
proxysh/Safejumper-for-Mac
buildlinux/env32/lib/python2.7/site-packages/Crypto/SelfTest/Hash/test_MD5.py
116
2368
# -*- coding: utf-8 -*- # # SelfTest/Hash/MD5.py: Self-test for the MD5 hash function # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication ...
gpl-2.0
Danielhiversen/home-assistant
homeassistant/components/device_tracker/__init__.py
2
26877
""" Provide functionality to keep track of devices. For more details about this component, please refer to the documentation at https://home-assistant.io/components/device_tracker/ """ import asyncio from datetime import timedelta import logging from typing import Any, List, Sequence, Callable import voluptuous as vo...
mit
googleads/googleads-python-lib
examples/adwords/adwords_appengine_demo/views/add_campaign_view.py
1
2373
#!/usr/bin/env python # # 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 requir...
apache-2.0
MattsFleaMarket/python-for-android
python-build/python-libs/gdata/src/gdata/blogger/__init__.py
140
6426
#!/usr/bin/python # # Copyright (C) 2007, 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
quickresolve/accel.ai
flask-aws/lib/python2.7/site-packages/boto/rds/dbsecuritygroup.py
185
6651
# Copyright (c) 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, modify, m...
mit
peixuan/gegl-0.2
examples/gi-test.py
6
1414
#!/usr/bin/env python import gi from gi.repository import Gegl # extend GEGL binding with some utility function, making it possible to lookup # a node among the children of a node giving one with a specified name. A # GEGL binding based on gobject introspection could contain some other such, # that makes << and other...
gpl-3.0
xfaxca/pymlkit
pymlkit/models/regressors.py
1
4199
""" Module for custom regression model classes. """ from sklearn.base import BaseEstimator, RegressorMixin """ Rolling todo: 1. For AvgReg: Modify how parameters are used. Put them all into a dict. Also change X_train, y_train to just X,y """ class AveragingRegressor(BaseEstimator, RegressorMixin): """ S...
gpl-3.0
welex91/ansible-modules-core
network/eos/eos_template.py
28
7065
#!/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
AlexeyKruglov/Skeinforge-fabmetheus
skeinforge_application/skeinforge_plugins/craft_plugins/multiply.py
1
12265
""" This page is in the table of contents. The multiply plugin will take a single object and create an array of objects. It is used when you want to print single object multiple times in a single pass. You can also position any object using this plugin by setting the center X and center Y to the desired coordinates (...
agpl-3.0
ryanahall/django
tests/template_tests/syntax_tests/test_template_tag.py
521
2594
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class TemplateTagTests(SimpleTestCase): @setup({'templatetag01': '{% templatetag openblock %}'}) def test_templatetag01(self): output = self.engine.render_to_string('templatetag01') ...
bsd-3-clause
chamikaramj/beam
sdks/python/apache_beam/error.py
8
1406
# # 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
Senseg/Py4A
python-build/python-libs/python-twitter/simplejson/scanner.py
928
2227
"""JSON token scanner """ import re try: from simplejson._speedups import make_scanner as c_make_scanner except ImportError: c_make_scanner = None __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', (re.VERBOSE | re.MULTILINE | re.DOTALL)) def py_make_scan...
apache-2.0
phihag/youtube-dl
youtube_dl/extractor/go.py
29
8340
# coding: utf-8 from __future__ import unicode_literals import re from .adobepass import AdobePassIE from ..utils import ( int_or_none, determine_ext, parse_age_limit, urlencode_postdata, ExtractorError, ) class GoIE(AdobePassIE): _SITE_INFO = { 'abc': { 'brand': '001', ...
unlicense
russss/Diamond
src/collectors/flume/flume.py
63
3401
# coding=utf-8 """ Collect statistics from Flume #### Dependencies * urllib2 * json or simplejson """ import urllib2 import diamond.collector try: import simplejson as json except ImportError: import json class FlumeCollector(diamond.collector.Collector): # items to collect _metrics_collect =...
mit
QQuick/Transcrypt
transcrypt/development/automated_tests/transcrypt/module_itertools/__init__.py
1
2899
from itertools import * from math import pow def fibonacci(): a, b = 0, 1 for i in range (10): yield a a, b = b, a + b squares = [i * i for i in range (10)] chars = 'thequickbrownfoxjumpsoverthelazydog' def run (autoTester): autoTester.check ('islice count', list (i...
apache-2.0
titasakgm/brc-stock
openerp/addons/share/__openerp__.py
56
2419
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2011 OpenERP SA (<http://www.openerp.com>). # # This program is free software: you ...
agpl-3.0
KempfCreative/KempfCreative.github.io
node_modules/node-gyp/gyp/tools/pretty_gyp.py
2618
4756
#!/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. """Pretty-prints the contents of a GYP file.""" import sys import re # Regex to remove comments when we're counting braces. COMMENT_RE = ...
mit
lorentey/swift
utils/rusage.py
30
6186
#!/usr/bin/python # utils/rusage.py - Utility to measure resource usage -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.t...
apache-2.0
ericfc/django
tests/utils_tests/test_termcolors.py
337
6461
import unittest from django.utils.termcolors import ( DARK_PALETTE, DEFAULT_PALETTE, LIGHT_PALETTE, NOCOLOR_PALETTE, PALETTES, colorize, parse_color_setting, ) class TermColorTests(unittest.TestCase): def test_empty_string(self): self.assertEqual(parse_color_setting(''), PALETTES[DEFAULT_PALETTE...
bsd-3-clause
Changaco/oh-mainline
vendor/packages/sphinx/sphinx/ext/todo.py
16
5818
# -*- coding: utf-8 -*- """ sphinx.ext.todo ~~~~~~~~~~~~~~~ Allow todos to be inserted into your documentation. Inclusion of todos can be switched of by a configuration variable. The todolist directive collects all todos of your project and lists them along with a backlink to the original loc...
agpl-3.0
nwchandler/ansible
lib/ansible/module_utils/facts/hardware/base.py
60
1746
# 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 in the hope that ...
gpl-3.0
zbqf109/goodo
openerp/addons/sale/sales_team.py
7
2924
# -*- coding: utf-8 -*- import calendar from datetime import date from dateutil import relativedelta import json from openerp import tools from openerp.osv import fields, osv from openerp.tools.float_utils import float_repr class crm_team(osv.Model): _inherit = 'crm.team' def _get_sales_to_invoice_amount(se...
gpl-3.0
SuperMass/distOS-lab2
src/part2/frontend1/frontend.py
2
9453
#!/usr/bin/env python """ Python source code - replace this with a description of the code and write the code below this text. """ # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 import time import threading import SocketServer from SimpleXMLRPCServer import SimpleXMLRPCServer,SimpleXMLRPCRequestHandler #impor...
gpl-3.0
eburkitt/flatbuffers
python/flatbuffers/number_types.py
20
3680
# 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 a...
apache-2.0
hurricup/intellij-community
python/lib/Lib/site-packages/django/contrib/auth/views.py
71
10263
import re import urlparse from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME # Avoid shadowing the login() view below. from django.contrib.auth import login as auth_login from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm ...
apache-2.0
talha81/TACTIC-DEV
src/tactic/ui/table/sobject_detail_wdg.py
1
4954
########################################################### # # Copyright (c) 2005-2008, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written ...
epl-1.0
mlperf/inference_results_v0.5
closed/CentaurTechnology/code/gnmt/0/nmt/utils/iterator_utils.py
4
9598
# Copyright 2017 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
zbraniecki/translate
translate/tools/poconflicts.py
24
8578
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2005-2008,2010 Zuza Software Foundation # # This file is part of translate. # # translate 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 vers...
gpl-2.0
cogmission/nupic
src/nupic/frameworks/opf/client.py
40
3158
# ---------------------------------------------------------------------- # 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
tfroehlich82/saleor
saleor/product/migrations/0020_attribute_data_to_class.py
10
1072
from __future__ import unicode_literals from django.db import migrations, models def move_data(apps, schema_editor): Product = apps.get_model('product', 'Product') ProductClass = apps.get_model('product', 'ProductClass') for product in Product.objects.all(): attributes = product.attributes.all()...
bsd-3-clause
JungeAlexander/cocoscore
setup.py
1
2522
#!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function import io import re from glob import glob from os.path import basename from os.path import dirname from os.path import join from os.path import splitext from setuptools import find_packages fro...
mit
MikhailMS/Final_Project
music_generation_module/output_to_input.py
1
1066
# Import packages import theano, theano.tensor as T import numpy as np # Import modules from model_data import noteStateSingleToInputForm # Main class class OutputFormToInputFormOp(theano.Op): # Properties attribute __props__ = () def make_node(self, state, time): state = T.as_tensor_variable(sta...
bsd-2-clause
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/Facebook/Publishing/PublishLink.py
5
5131
# -*- coding: utf-8 -*- ############################################################################### # # PublishLink # Publishes a link on a given profile. # # 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 fil...
apache-2.0
wido/cloudstack
scripts/vm/systemvm/injectkeys.py
7
4060
#!/bin/bash # 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"); y...
apache-2.0
Ophiuchus1312/enigma2-master
lib/python/Components/RcModel.py
1
6258
from enigma import getBoxType from Tools.StbHardware import getFPVersion import os class RcModel: RCTYPE_DMM = 0 RCTYPE_DMM1 = 1 RCTYPE_DMM2 = 2 RCTYPE_E3HD = 3 RCTYPE_EBOX5000 = 4 RCTYPE_ET4X00 = 5 RCTYPE_ET6X00 = 6 RCTYPE_ET6500 = 7 RCTYPE_ET9X00 = 8 RCTYPE_ET9500 = 9 RCTYPE_GB = 10 RCTYPE_INI0 = 11 ...
gpl-2.0
jfly/libtnoodle
tools/c_to_emscripten.py
1
3643
#!/usr/bin/env python2 import json import argparse import collections import clang.cindex from clang.cindex import TypeKind from clang.cindex import CursorKind Function = collections.namedtuple('Function', ['name', 'returnType', 'argumentTypes']) Constant = collections.namedtuple('Constant', ['name', 'value']) def g...
gpl-3.0
oandrew/home-assistant
homeassistant/components/switch/rpi_gpio.py
21
2447
""" Allows to configure a switch using RPi GPIO. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.rpi_gpio/ """ import logging import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA import homeassistant.components.rpi...
mit
jonathanslenders/python-prompt-toolkit
prompt_toolkit/key_binding/digraphs.py
2
32798
# encoding: utf-8 """ Vi Digraphs. This is a list of special characters that can be inserted in Vi insert mode by pressing Control-K followed by to normal characters. Taken from Neovim and translated to Python: https://raw.githubusercontent.com/neovim/neovim/master/src/nvim/digraph.c """ from typing import Dict, Tuple...
bsd-3-clause
adw0rd/lettuce-py3
tests/unit/test_step_parsing.py
1
9558
# -*- coding: utf-8 -*- # <Lettuce - Behaviour Driven Development for python> # Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.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 Foundatio...
gpl-3.0
Crexfu/tgstation
tools/linux_build.py
82
2665
#!/usr/bin/env python import subprocess import os import sys import argparse import time from subprocess import PIPE, STDOUT null = open("/dev/null", "wb") def wait(p): rc = p.wait() if rc != 0: p = play("sound/misc/compiler-failure.ogg") p.wait() assert p.returncode == 0 sys....
agpl-3.0
foodszhang/kbengine
kbe/res/scripts/common/Lib/distutils/msvccompiler.py
140
23479
"""distutils.msvccompiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for the Microsoft Visual Studio. """ # Written by Perry Stoll # hacked by Robin Becker and Thomas Heller to do a better job of # finding DevStudio (through the registry) import sys, os from distutils.errors import \ ...
lgpl-3.0
Asana/bazel
third_party/py/gflags/tests/flags_modules_for_testing/module_bar.py
139
4840
#!/usr/bin/env python # Copyright (c) 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 l...
apache-2.0
eyeseast/django-scrivo
scrivo/tests/views.py
1
3316
import datetime import os from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from scrivo.models import Post from scrivo.settings import DEFAULT_PAGINATE_BY, INDEX_POST_COUNT from scrivo.tests.base import BlogPostTest, f class PostViewTest(BlogPos...
mit