repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
irwinlove/django
tests/template_tests/filter_tests/test_linebreaks.py
310
1920
from django.template.defaultfilters import linebreaks_filter from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LinebreaksTests(SimpleTestCase): """ The contents in "linebreaks" are escaped according to the current autoescape setting. ...
bsd-3-clause
kevthehermit/SpearPhisher
testdata.py
2
3851
# This file will generate random test data and write it to a database. import os import sys import string import django import random # Fake Factory from faker import Faker fake = Faker() # Connect to the Django Database sys.path.insert(1,'/home/spearphisher/spearphisher') script_path = os.path.dirname(__file__) sys...
gpl-3.0
yanheven/cinder
cinder/volume/drivers/block_device.py
3
8381
# Copyright (c) 2013 Mirantis, 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
YosaiProject/yosai_account_alchemy
yosai_alchemystore/accountstore/accountstore.py
2
10153
""" 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 this ...
apache-2.0
matthewoliver/swift
test/unit/common/test_utils.py
2
275026
# Copyright (c) 2010-2012 OpenStack Foundation # # 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 agree...
apache-2.0
varunarya10/python-ironicclient
ironicclient/client.py
3
4613
# -*- 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 i...
apache-2.0
amohanta/miasm
miasm2/expression/expression_helper.py
5
18131
# # Copyright (C) 2011 EADS France, Fabrice Desclaux <fabrice.desclaux@eads.net> # # 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 late...
gpl-2.0
owaiskhan/Retransmission-Combining
gnuradio-core/src/python/gnuradio/gr/qa_nlog10.py
11
1510
#!/usr/bin/env python # # Copyright 2005,2007,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at you...
gpl-3.0
Hoekz/hackness-monster
venv/lib/python2.7/site-packages/jinja2/parser.py
336
35442
# -*- coding: utf-8 -*- """ jinja2.parser ~~~~~~~~~~~~~ Implements the template parser. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2 import nodes from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError from jinja2.lexer impo...
mit
patrioticcow/MessagesForSkype
packages/win32/bundle/MessagesForSkype/modules/python/1.3.1-beta/Lib/idlelib/PyParse.py
185
19510
import re import sys # Reason last stmt is continued (or C_NONE if it's not). (C_NONE, C_BACKSLASH, C_STRING_FIRST_LINE, C_STRING_NEXT_LINES, C_BRACKET) = range(5) if 0: # for throwaway debugging output def dump(*stuff): sys.__stdout__.write(" ".join(map(str, stuff)) + "\n") # Find what looks like the...
mit
davidvon/pipa-pay-server
site-packages/sqlalchemy/orm/scoping.py
18
6109
# orm/scoping.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from .. import exc as sa_exc from ..util import ScopedRegistry, ThreadLocalRegistry, wa...
apache-2.0
zjuchenyuan/BioWeb
Lib/Bio/Index.py
1
4980
# Copyright 1999 by Jeffrey Chang. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Index.py This module provides a way to create indexes to text files. Classes: Index D...
mit
wyc/django
django/contrib/syndication/views.py
192
8680
from __future__ import unicode_literals from calendar import timegm from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import Http404, HttpResponse from django.template import Templat...
bsd-3-clause
royredman4/Rubik_Cube
Rubik_Info.py
1
7722
try: # for Python 2 from Tkinter import * except ImportError: # for Python 3 from tkinter import * import time import Solving_algorithm # Converts a set of coordinates into indexes in the cube # returns square index horizontally and vertically (x,y) def CoordinatesToIndex(coordinates): t = (coordi...
gpl-3.0
MrNuggles/HeyBoet-Telegram-Bot
temboo/Library/Uber/Estimates/GetPriceEstimates.py
5
4198
# -*- coding: utf-8 -*- ############################################################################### # # GetPriceEstimates # Returns an estimated price range for each product offered at a given location. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version...
gpl-3.0
lbeltrame/bcbio-nextgen
bcbio/structural/gatkcnv.py
2
17264
"""Support for Copy Number Variations (CNVs) with GATK4 https://software.broadinstitute.org/gatk/documentation/article?id=11682 https://gatkforums.broadinstitute.org/dsde/discussion/11683/ """ import glob import os import shutil import numpy as np import toolz as tz from bcbio import broad, utils from bcbio.distribu...
mit
bemcdonnell/SWMMOutputAPI
swmmoutputapi/swmmbinreader.py
1
24788
""" SWMM Output File Wrapper for the New OutputAPI. Author: Bryant E. McDonnell Date: 1/10/2016 """ from ctypes import * from _toolkitpyswmm import * from datetime import datetime, timedelta import os __author__ = 'Bryant E. McDonnell (bemcdonnell@gmail.com)' __copyright__ = 'Copyright (c) 2016 Bryant E. McDonnell' ...
bsd-2-clause
geokala/cloudify-plugins-common
cloudify/workflows/tasks.py
2
24871
######## # Copyright (c) 2014 GigaSpaces Technologies Ltd. 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...
apache-2.0
akintolga/superdesk-aap
server/aap/commands/import_text_archive.py
2
15489
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from bson im...
agpl-3.0
updateing/android_kernel_sony_msm8960
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
dawran6/zulip
zerver/management/commands/generate_invite_links.py
22
2688
from __future__ import absolute_import from __future__ import print_function from typing import Any from argparse import ArgumentParser from django.core.management.base import BaseCommand from confirmation.models import Confirmation from zerver.models import UserProfile, PreregistrationUser, \ get_user_profile_by...
apache-2.0
igemsoftware/SYSU-Software2013
project/Python27_32/Lib/test/test_anydbm.py
93
2288
#! /usr/bin/env python """Test script for the anydbm module based on testdumbdbm.py """ import os import unittest import glob from test import test_support _fname = test_support.TESTFN # Silence Py3k warning anydbm = test_support.import_module('anydbm', deprecated=True) def _delete_files(): # we don't know t...
mit
stevemao/brackets-shell
gyp/pylib/gyp/generator/msvs.py
17
118480
# 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. import copy import ntpath import os import posixpath import re import subprocess import sys import gyp.common import gyp.easy_xml as easy_xml import gyp.MSVSNew a...
mit
CyanogenMod/android_kernel_motorola_msm8974
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
christian-bromann/electron
script/create-dist.py
65
5723
#!/usr/bin/env python import os import re import shutil import subprocess import sys import stat from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ get_target_arch, get_chromedriver_version from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \ ...
mit
dulems/hue
desktop/core/ext-py/configobj/validate.py
42
46768
# validate.py # A Validator object # Copyright (C) 2005 Michael Foord, Mark Andrews, Nicola Larosa # E-mail: fuzzyman AT voidspace DOT org DOT uk # mark AT la-la DOT com # nico AT tekNico DOT net # This software is licensed under the terms of the BSD license. # http://www.voidspace.org.uk/python/licens...
apache-2.0
wuzhy/autotest
client/tests/linus_stress/linus_stress.py
5
1435
import os from autotest_lib.client.bin import test, utils class linus_stress(test.test): version = 1 def setup(self): os.mkdir(self.srcdir) os.chdir(self.bindir) utils.system('cp linus_stress.c src/') os.chdir(self.srcdir) utils.system(utils.get_cc() + ' linus_stress.c...
gpl-2.0
garbear/EventGhost
plugins/RadioSure/__init__.py
1
248696
version="0.2.13" # plugins/RadioSure/__init__.py # # Copyright (C) 2009, 2010, 2011 Pako (lubos.ruckl@quick.cz) # # This file is a plugin for EventGhost. # # EventGhost 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
scikit-learn-contrib/py-earth
examples/plot_feature_importance.py
3
2142
""" =========================== Plotting feature importance =========================== A simple example showing how to compute and display feature importances, it is also compared with the feature importances obtained using random forests. Feature importance is a measure of the effect of the features on the outputs....
bsd-3-clause
makerbot/ReplicatorG
skein_engines/skeinforge-47/fabmetheus_utilities/vector3index.py
12
8587
""" Vector3 is a three dimensional vector class. Below are examples of Vector3 use. >>> from vector3 import Vector3 >>> origin = Vector3() >>> origin 0.0, 0.0, 0.0 >>> pythagoras = Vector3( 3, 4, 0 ) >>> pythagoras 3.0, 4.0, 0.0 >>> pythagoras.magnitude() 5.0 >>> pythagoras.magnitudeSquared() 25 >>> triplePythagoras ...
gpl-2.0
Pasithea/Flask-RESTFul-Sample
sample/exception.py
1
1163
from flask import jsonify class NotUniqueException(Exception): pass class ExistedException(Exception): pass class DoesNotExistsException(Exception): pass class HttpException(Exception): pass except_dict = { 'LoginFailed': { 'code': 403, 'message': "Login Failed" }, 'Ne...
mit
akosel/servo
python/servo/devenv_commands.py
31
4939
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
willthames/ansible
test/units/parsing/vault/test_vault.py
13
18751
# -*- coding: utf-8 -*- # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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
alphatwirl/alphatwirl
alphatwirl/collector/ToDataFrameWithDatasetColumn.py
1
1326
# Tai Sakuma <tai.sakuma@gmail.com> import pandas as pd from .ToTupleListWithDatasetColumn import ToTupleListWithDatasetColumn ##__________________________________________________________________|| class ToDataFrameWithDatasetColumn: def __init__(self, summaryColumnNames, datasetColumnName = 'co...
bsd-3-clause
FilipDominec/python-meep-utils
scripts_postpro/plot_TY.py
1
4307
#!/usr/bin/env python #-*- coding: utf-8 -*- simtime = 80e-12 size_y = 1400e-6 c = 3e8 maxfreq = 2e12 ## Import common moduli import numpy as np from scipy.constants import c, hbar, pi import matplotlib, sys, os, time import matplotlib.pyplot as plt ## Start figure + subplot (interactive) fig = plt.figure(figsize=(1...
gpl-2.0
danielharbor/openerp
addons/stock_picking_wave/__init__.py
374
1105
# -*- 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
xzturn/tensorflow
tensorflow/python/distribute/input_lib.py
2
49393
# 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
bloomberg/phabricator-tools
py/aon/aoncmd_taskquery.py
4
8598
"""display and filter the list of maniphest tasks. you can use the 'task id' output from this command as input to the 'arcyon task-update' command. usage examples: list all tasks: $ arcyon task-query output formats: --format-ids 3 2 1 --format-short 8 / Open / High / ...
apache-2.0
fkie-cad/FACT_core
src/objects/firmware.py
1
2206
from objects.file import FileObject from helperFunctions.hash import get_md5 from helperFunctions.tag import TagColor from contextlib import suppress class Firmware(FileObject): ''' This objects represents a firmware ''' def __init__(self, binary=None, file_name=None, file_path=None, scheduled_analys...
gpl-3.0
asendecka/djangae
djangae/tests/test_transactional.py
7
6364
from djangae.test import TestCase from djangae.db import transaction from djangae.contrib import sleuth class TransactionTests(TestCase): def test_repeated_usage_in_a_loop(self): from .test_connector import TestUser pk = TestUser.objects.create(username="foo").pk for i in xrange(4): ...
bsd-3-clause
ryuunosukeyoshi/PartnerPoi-Bot
lib/aiohttp/multipart.py
20
32684
import asyncio import base64 import binascii import io import json import mimetypes import os import re import sys import uuid import warnings import zlib from collections import Mapping, Sequence, deque from pathlib import Path from urllib.parse import parse_qsl, quote, unquote, urlencode from multidict import CIMult...
gpl-3.0
TacticalGoat/reddit
ErroneousQuotes/erroneousquotes.py
3
3063
#/u/GoldenSights import praw # simple interface to the reddit API, also handles rate limiting of requests import time import sqlite3 import random '''USER CONFIGURATION''' USERNAME = "" #This is the bot's Username. In order to send mail, he must have some amount of Karma. PASSWORD = "" #This is the bot's Password. ...
mit
jkorell/PTVS
Python/Product/PythonTools/visualstudio_py_repl.py
19
51102
 # ############################################################################ # # Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of this distribution...
apache-2.0
atopuzov/nitro-python
nssrc/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlerrorpage.py
3
6286
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
mavteam13/paparazzi
sw/tools/tcp_aircraft_server/phoenix/xmlobject.py
86
17644
#Copyright 2014, Antoine Drouin """ Allows XML files to be operated on like Python objects. Features: - load XML source from file pathnames, readable file objects or raw strings - add, get and set tag attributes like with python attributes - iterate over nodes - save the modified XMLFile or XMLObject t...
gpl-2.0
grani/grpc
src/python/grpcio_tests/tests/unit/_rpc_test.py
21
36230
# Copyright 2016, 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 conditions and the f...
bsd-3-clause
abadger/ansible
lib/ansible/module_utils/facts/virtual/linux.py
15
17328
# 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
cgalleguillosm/accasim
accasim/utils/plot_factory.py
1
51706
""" MIT License Copyright (c) 2017 cgalleguillosm, AlessioNetti 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, ...
mit
dmsimard/ansible
test/support/windows-integration/plugins/action/win_template.py
269
1198
# (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
asterisk/ari-py
ari/client.py
1
11612
# # Copyright (c) 2013, Digium, Inc. # """ARI client library. """ import json import logging import urlparse import swaggerpy.client from ari.model import * log = logging.getLogger(__name__) class Client(object): """ARI Client object. :param base_url: Base URL for accessing Asterisk. :param http_clie...
bsd-3-clause
KISSMonX/micropython
tests/extmod/uctypes_native_le.py
10
2037
# This test is exactly like uctypes_le.py, but uses native structure layout. # Codepaths for packed vs native structures are different. This test only works # on little-endian machine (no matter if 32 or 64 bit). import sys import uctypes if sys.byteorder != "little": print("SKIP") sys.exit() desc = { "s...
mit
williamsandrew/kubernetes
hack/jenkins/test-history/gen_html_test.py
12
2491
#!/usr/bin/env python # Copyright 2016 The Kubernetes Authors All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
apache-2.0
cjhak/b2share
invenio/ext/session/legacy_session.py
12
3341
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2011, 2012, 2013, 2014, 2015 CERN. # # 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 version 2 of the # License, or (at...
gpl-2.0
motion2015/a3
openedx/core/djangoapps/course_groups/migrations/0003_auto__add_coursecohort__add_coursecohortssettings.py
100
7464
# -*- 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 model 'CourseCohort' db.create_table('course_groups_coursecohort', ( ('id', self.gf('dj...
agpl-3.0
JamesLiAndroid/django-blog-practice
blogproject/blog/migrations/0001_initial.py
1
1880
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-07-14 06:16 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
gpl-3.0
drufat/sympy
sympy/geometry/tests/test_point.py
17
8537
from __future__ import division from sympy import I, Rational, Symbol, pi, sqrt from sympy.geometry import Line, Point, Point2D, Point3D, Line3D from sympy.geometry.entity import rotate, scale, translate from sympy.matrices import Matrix from sympy.utilities.pytest import raises def test_point(): x = Symbol('x',...
bsd-3-clause
sfinktah/iTerm2
tools/ply/ply-3.4/test/yacc_error4.py
174
1562
# ----------------------------------------------------------------------------- # yacc_error4.py # # Attempt to define a rule named 'error' # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex i...
gpl-2.0
grocsvs/grocsvs
src/grocsvs/stages/refine_grid_search_breakpoints.py
1
13463
# FOR GRID SEARCH CANDIDATES import itertools import numpy import os import pandas import scipy.stats from grocsvs import step from grocsvs import structuralvariants from grocsvs.stages import sv_candidates class CombineRefinedBreakpointsStep(step.StepChunk): @staticmethod def get_steps(options): y...
mit
henn/hil
haas/cli.py
2
22801
# Copyright 2013-2014 Massachusetts Open Cloud Contributors # # 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...
apache-2.0
brayan15/Events
events/users/tests/test_admin.py
117
1391
from test_plus.test import TestCase from ..admin import MyUserCreationForm class TestMyUserCreationForm(TestCase): def setUp(self): self.user = self.make_user('notalamode', 'notalamodespassword') def test_clean_username_success(self): # Instantiate the form with a new username form ...
mit
zarlant/ansible_core
cloud/rackspace/rax_cbs.py
37
7072
#!/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
Xeralux/tensorflow
tensorflow/contrib/receptive_field/python/util/receptive_field.py
34
17297
# 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
melipharo/stru-python19
generator/contact.py
1
3075
import os import jsonpickle import argparse from model import Contact from model.utils import random_phone, random_email, random_string class ContactGenerator: def __init__(self, name_max_len=10, tel_max_len=10, email_max_len=15, data_max_len=15): self.name_max_len = name_max_len self.tel_max_len =...
bsd-2-clause
hbrunn/OpenUpgrade
addons/account/tests/test_tax.py
449
1740
from openerp.tests.common import TransactionCase class TestTax(TransactionCase): """Tests for taxes (account.tax) We don't really need at this point to link taxes to tax codes (account.tax.code) nor to companies (base.company) to check computation results. """ def setUp(self): super(T...
agpl-3.0
hugobowne/scikit-learn
sklearn/metrics/tests/test_regression.py
272
6066
from __future__ import division, print_function import numpy as np from itertools import product from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils....
bsd-3-clause
ROMFactory/android_external_chromium_org
net/tools/testserver/echo_message.py
187
13195
# Copyright (c) 2011 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. """Provides utility functions for TCP/UDP echo servers and clients. This program has classes and functions to encode, decode, calculate checksum and ver...
bsd-3-clause
drbobrinkman/LIFX-Stock-Orb
stockOrb.py
1
3206
import requests import sys import colorsys ###################### #Configuration constants DAILY_STD_DEV = 1.120 #In %, what is the standard deviation of stock price change? CALL_FREQUENCY = 5 #How often this script will be called, in minutes STOCK_TO_TRACK = '.dji' GOOD_HUE = 120 ...
mit
joshsmith2/twitter-image-cloud
tests/python/frontend_tests.py
1
3611
from base import * import re class DatabaseTests(GeneralTest): def setUp(self): super().setUp() self.cloud = main.ImageCloud(self.test_csv_in, self.database, 'media_urls') self.cloud.write_csv_file_to_database() ...
gpl-3.0
ehashman/oh-mainline
vendor/packages/twisted/twisted/spread/util.py
60
6340
# -*- test-case-name: twisted.test.test_pb -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Utility classes for spread. """ from twisted.internet import defer from twisted.python.failure import Failure from twisted.spread import pb from twisted.protocols import basic from twisted.inte...
agpl-3.0
shawnadelic/shuup
shuup_tests/front/test_basket.py
1
7407
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import pytest from django.conf import settings from django.db.models import ...
agpl-3.0
Hasimir/cryptography
src/cryptography/hazmat/primitives/padding.py
13
3635
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import six from cryptography import utils from cryptography....
bsd-3-clause
lanfker/tdma_imac
src/aodv/bindings/modulegen__gcc_ILP32.py
29
433522
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
babelsberg/babelsberg-r
topaz/objects/threadobject.py
2
1802
import copy from topaz.module import ClassDef from topaz.objects.objectobject import W_Object class W_ThreadObject(W_Object): classdef = ClassDef("Thread", W_Object.classdef) def __init__(self, space): W_Object.__init__(self, space) # TODO: This should be a map dict. self.local_stora...
bsd-3-clause
tafaRU/odoo
addons/l10n_co/__init__.py
313
1180
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) David Arnold (devCO). # Author David Arnold (devCO), dar@devco.co # Co-Authors Juan Pablo Aries (devCO), jpa@devco.co # Hector Iva...
agpl-3.0
moijes12/oh-mainline
vendor/packages/beautifulsoup4/bs4/dammit.py
408
29302
# -*- coding: utf-8 -*- """Beautiful Soup bonus library: Unicode, Dammit This library converts a bytestream to Unicode through any means necessary. It is heavily based on code from Mark Pilgrim's Universal Feed Parser. It works best on XML and XML, but it does not rewrite the XML or HTML to reflect a new encoding; tha...
agpl-3.0
n0max/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorservodriver.py
9
8679
import json import os import socket import threading import time import traceback from .base import (Protocol, RefTestExecutor, RefTestImplementation, TestharnessExecutor, strip_server) from ..testrunner import Stop webdriver = None here = o...
mpl-2.0
shosca/django-rest-witchcraft
rest_witchcraft/filters.py
1
3474
"""Provides generic filtering backends that can be used to filter the results returned by list views.""" from sqlalchemy import func, or_ from sqlalchemy.sql import operators from django.template import loader from django.utils.encoding import force_text from django.utils.translation import gettext_lazy from rest_f...
mit
radremedy/radremedy
remedy/rad/searchutils.py
2
4301
""" searchutils.py Contains utility functions for adding normalized searching values to dictionaries of search parameters. """ def add_string(search_params, key, value): """ Adds a string value to the provided search parameters dictionary if it is non-empty. Args: search_params: The parame...
mpl-2.0
henriquesouza/toply
src/view/Sync.py
1
5379
import urllib import os import gi import threading #simport src.SettingsManager from SettingsManager import SettingsManager gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk, GObject import html GObject.threads_init() class Sync: _window = None _100th_counting = 0 _phrase_list = None ...
gpl-3.0
ofcourseican/django-openid-auth
example_consumer/urls.py
13
1793
# django-openid-auth - OpenID integration for django.contrib.auth # # Copyright (C) 2007 Simon Willison # Copyright (C) 2008-2010 Canonical Ltd. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions o...
bsd-2-clause
Adnn/django
tests/custom_pk/models.py
282
1272
# -*- coding: utf-8 -*- """ Using a custom primary key By default, Django adds an ``"id"`` field to each model. But you can override this behavior by explicitly adding ``primary_key=True`` to a field. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_...
bsd-3-clause
SerCeMan/intellij-community
python/helpers/profiler/thriftpy3/Thrift.py
253
4543
# # 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
icomms/wqmanager
apps/django_rest_interface/responder.py
4
12224
""" MORE INFO AT: http://code.google.com/p/django-rest-interface/wiki/RestifyDjango Data format classes ("responders") that can be plugged into model_resource.ModelResource and determine how the objects of a ModelResource instance are rendered (e.g. serialized to XML, rendered by templates, ...). """ from django.core ...
bsd-3-clause
mbernasocchi/inasafe
safe_extras/raven/processors.py
11
5388
""" raven.core.processors ~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import re import warnings from raven.utils.compat import string_types, text_type, PY3 from raven.utils im...
gpl-3.0
kenda/codingcontest2012
tastypie/utils/formatting.py
3
1090
import email import datetime from django.utils import dateformat from tastypie.utils.timezone import make_aware, make_naive, aware_datetime # Try to use dateutil for maximum date-parsing niceness. Fall back to # hard-coded RFC2822 parsing if that's not possible. try: from dateutil.parser import parse as mk_datetim...
gpl-3.0
rado0x54/project-euler
python/problem0067.py
1
1818
#!/usr/bin/env python3 """Project Euler - Problem 67 Module""" import os def problem67(triangle_fileloc): """Problem 67 - Maximum path sum II""" # We model tree node with dict: # node = { 'value':123, 'left': {}, 'right': {}, 'depth':1} root = {} cur_depth = [root] d = 0 d_nodelist = [...
mit
tedelhourani/ansible
lib/ansible/modules/packaging/os/apt.py
7
39021
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Flowroute LLC # Written by Matthew Williams <matthew@flowroute.com> # Based on yum module written by Seth Vidal <skvidal at fedoraproject.org> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import abs...
gpl-3.0
robertmattmueller/sdac-compiler
sympy/utilities/benchmarking.py
24
6483
"""benchmarking through py.test""" from __future__ import print_function, division import py from py.__.test.item import Item from py.__.test.terminal.terminal import TerminalSession from math import ceil as _ceil, floor as _floor, log10 import timeit from inspect import getsource from sympy.core.compatibility imp...
gpl-3.0
Wilee999/panda3d
contrib/src/sceneeditor/quad.py
8
26662
######################################################################################################################################### # This file implements a Quad View for the level editor # This feature is not yet enabled in the level editor because picking objects in quad view doesnt work # I have tried to send ...
bsd-3-clause
sunsettrack4/android_kernel_oneplus_msm8996
scripts/rt-tester/rt-tester.py
1106
5305
#!/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
vmware/ansible-module-chaperone
nsxt/nsxt_transport_node_edge_details.py
1
2088
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2019 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import yaml import yamlordereddictloader from collections import OrderedDict import logging logger = logging.getLogger('vswitch') hdlr = logging.FileHandler('/var/log/chaperone/Ch...
apache-2.0
adieu/django-nonrel
tests/regressiontests/requests/tests.py
26
8301
import time from datetime import datetime, timedelta from StringIO import StringIO from django.core.handlers.modpython import ModPythonRequest from django.core.handlers.wsgi import WSGIRequest, LimitedStream from django.http import HttpRequest, HttpResponse, parse_cookie from django.utils import unittest from django.u...
bsd-3-clause
sss/calibre-at-bzr
src/calibre/ebooks/oeb/polish/replace.py
3
3150
#!/usr/bin/env python # 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__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
gpl-3.0
SnakeJenny/TensorFlow
tensorflow/python/ops/control_flow_grad.py
48
8960
# 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
c86j224s/snippet
Python_asyncio_binary_echo/pyclient2/Lib/site-packages/setuptools/_vendor/packaging/specifiers.py
1107
28025
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import functools import itertools import re from ._compat impo...
apache-2.0
rmcgibbo/msmbuilder3
msmbuilder3/command/kcentersapp.py
1
5928
import os import sys import numpy as np import mdtraj as md import tables from IPython.utils.traitlets import Int, Enum, Instance, Bool, List from msmbuilder3.config.app import MSMBuilderApp from msmbuilder3.cluster import KCenters from msmbuilder3 import DataSet from .ticaapp import TICAApp from .vectorapp import Vec...
gpl-3.0
hbutau/vimdotfiles
pymode/libs2/rope/refactor/importutils/importinfo.py
22
5759
class ImportStatement(object): """Represent an import in a module `readonly` attribute controls whether this import can be changed by import actions or not. """ def __init__(self, import_info, start_line, end_line, main_statement=None, blank_lines=0): self.start_line = st...
lgpl-3.0
zittix/cappuccino
Tools/Documentation/support/massage_text.py
24
1378
#!/usr/bin/env python # # $1 Generated documentation directory # The following transforms are performed: # - Strip useless "[implementation]" littering the docs # - Change "Static Public Member Functions" to "Class Methods" # - Change "Public Member Functions" to "Instance Methods" # - Change "Member Function Document...
lgpl-2.1
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/trial/unittest.py
3
1040
# -*- test-case-name: twisted.trial.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Things likely to be used by writers of unit tests. """ from __future__ import division, absolute_import # Define the public API from the two implementation modules from twisted.trial._synctest imp...
mit
ljschumacher/tierpsy-tracker
tierpsy/analysis/ske_create/segWormPython/cleanWorm.py
2
22911
# -*- coding: utf-8 -*- """ Created on Fri May 22 18:10:04 2015 @author: ajaver """ from .cython_files.cleanWorm_cython import extremaPeaksCircDist, removeSmallSegments, cleanContour from .cython_files.circCurvature import circCurvature import numpy as np def circCurvature_old(points, edgeLength): ''' TODO...
mit