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 |
|---|---|---|---|---|---|
thomas-krenn/TKperf | src/perfTest/StdyState.py | 1 | 5481 | '''
Created on Aug 26, 2014
@author: gschoenb
'''
import logging
import numpy as np
import json
from lxml import etree
class StdyState(object):
'''
Used to define a stable state of a device
'''
## Max number of carried out test rounds.
testRnds = 25
## Always use a sliding window of 4 to meas... | gpl-3.0 |
HugoJH/HideIntoPNG | Tests/test_embedder.py | 1 | 1476 | from os import makedirs
from os.path import exists, join, dirname, basename
from shutil import rmtree
from ..hideintopng.embedder import Embedder
def test_insert_payload():
_resetResultsFolder()
embedder = Embedder()
containerFilePath = join(dirname(__file__), "mock/ninja.png")
payloadFilePath = join... | mit |
ksrajkumar/openerp-6.1 | openerp/addons/itara_crm_lead/dms_crm_lead.py | 1 | 3635 | # -*- 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 |
perlygatekeeper/glowing-robot | Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/pip/_internal/commands/__init__.py | 9 | 2295 | """
Package containing all pip commands
"""
from __future__ import absolute_import
from pip._internal.commands.completion import CompletionCommand
from pip._internal.commands.configuration import ConfigurationCommand
from pip._internal.commands.debug import DebugCommand
from pip._internal.commands.download import Down... | artistic-2.0 |
stormsson/procedural_city_generation_wrapper | vendor/josauder/procedural_city_generation/roadmap/growth_rules/organic.py | 2 | 1707 | from __future__ import division
import numpy as np
import random
from procedural_city_generation.roadmap.Vertex import Vertex
from procedural_city_generation.additional_stuff.rotate import rotate
from procedural_city_generation.additional_stuff.Singleton import Singleton
singleton=Singleton("roadmap")
def organic(... | mpl-2.0 |
hassoon3/odoo | addons/sale_margin/sale_margin.py | 31 | 4691 | ##############################################################################
#
# 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 GNU Affero General Public L... | agpl-3.0 |
public-ink/public-ink | server/appengine-staging/lib/unidecode/x086.py | 252 | 4614 | data = (
'Tuo ', # 0x00
'Wu ', # 0x01
'Rui ', # 0x02
'Rui ', # 0x03
'Qi ', # 0x04
'Heng ', # 0x05
'Lu ', # 0x06
'Su ', # 0x07
'Tui ', # 0x08
'Mang ', # 0x09
'Yun ', # 0x0a
'Pin ', # 0x0b
'Yu ', # 0x0c
'Xun ', # 0x0d
'Ji ', # 0x0e
'Jiong ', # 0x0f
'Xian ', # 0x10
'Mo ',... | gpl-3.0 |
zhounanshu/Flask-AppBuilder | examples/masterdetail/testdata.py | 3 | 1443 | from app import db
from app.models import ContactGroup, Gender, Contact
import random
from datetime import datetime
def get_random_name(names_list, size=1):
name_lst = [names_list[random.randrange(0, len(names_list))].capitalize() for i in range(0, size)]
return " ".join(name_lst)
try:
db.session.add(Co... | bsd-3-clause |
yjmade/odoo | openerp/addons/test_workflow/models.py | 337 | 2268 | # -*- coding: utf-8 -*-
import openerp.osv.orm
class m(openerp.osv.orm.Model):
""" A model for which we will define a workflow (see data.xml). """
_name = 'test.workflow.model'
def print_(self, cr, uid, ids, s, context=None):
print ' Running activity `%s` for record %s' % (s, ids)
return ... | agpl-3.0 |
rclmenezes/sqlalchemy | examples/dynamic_dict/dynamic_dict.py | 1 | 2521 | class ProxyDict(object):
def __init__(self, parent, collection_name, childclass, keyname):
self.parent = parent
self.collection_name = collection_name
self.childclass = childclass
self.keyname = keyname
@property
def collection(self):
return getattr(self.par... | mit |
ATIX-AG/ansible | lib/ansible/plugins/lookup/dict.py | 7 | 1954 | # (c) 2014, Kent R. Spillner <kspillner@acm.org>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: dict
version_added: "1.5"
... | gpl-3.0 |
Kazade/NeHe-Website | google_appengine/lib/django-1.2/django/contrib/localflavor/in_/in_states.py | 296 | 1859 | """
A mapping of state misspellings/abbreviations to normalized abbreviations, and
an alphabetical list of states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
STATE_CHOICES = (
('KA', 'Karnataka'),
('AP', 'Andhra Pr... | bsd-3-clause |
abhattad4/Digi-Menu | digimenu2/tests/custom_pk/fields.py | 379 | 1731 | import random
import string
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class MyWrapper(object):
def __init__(self, value):
self.value = value
def __repr__(self):
return "<%s: %s>" % (sel... | bsd-3-clause |
earsneyes/ardupilot | Tools/LogAnalyzer/tests/TestVibration.py | 261 | 3069 | from LogAnalyzer import Test,TestResult
import DataflashLog
import numpy
class TestVibration(Test):
'''test for accelerometer vibration (accX/accY/accZ) within recommendations'''
def __init__(self):
Test.__init__(self)
self.name = "Vibration"
def run(self, logdata, verbose):
se... | gpl-3.0 |
ryanj/origin | vendor/github.com/google/certificate-transparency/python/demo/vdb/verifiable_log.py | 30 | 2096 | import hashlib, base64
# Basic verifiable log, for demo purposes only
class VerifiableLog:
def __init__(self):
self._entries = []
self._cache = {}
def append(self, val):
self._entries.append(val)
def get_entries(self, start, end):
return self._entries[start:end + 1]
def get_tree_head(self, s... | apache-2.0 |
seecr/meresco-harvester | test/datastoretest.py | 1 | 2742 | ## begin license ##
#
# "Meresco Harvester" consists of two subsystems, namely an OAI-harvester and
# a web-control panel.
# "Meresco Harvester" is originally called "Sahara" and was developed for
# SURFnet by:
# Seek You Too B.V. (CQ2) http://www.cq2.nl
#
# Copyright (C) 2021 Seecr (Seek You Too B.V.) https://seecr.nl... | gpl-2.0 |
jasonzzz/ansible-modules-core | cloud/rackspace/rax_cdb_database.py | 51 | 4856 | #!/usr/bin/python -tt
# 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 distrib... | gpl-3.0 |
onecloud/neutron | neutron/openstack/common/lockutils.py | 16 | 9941 | # Copyright 2011 OpenStack Foundation.
# 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 req... | apache-2.0 |
tomersamara/InfoSec | HW4/assemble.py | 1 | 1844 | #!/usr/bin/python
import subprocess
ASSEMBLY_TEMPLATE = '''
.intel_syntax noprefix
.globl main
main:
%s
'''
ASSEMBLE = 'gcc -xassembler - -o /dev/stdout -m32 -nostdlib -emain -Xlinker --oformat=binary'
def run(command, stdin):
proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, st... | mit |
wisechengyi/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/zinc/test_zinc_compile.py | 1 | 2016 | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.jvm.targets.java_library import JavaLibrary
from pants.backend.jvm.tasks.jvm_compile.compile_context import CompileContext
from pants.backend.jvm.tasks.jvm_compile.zinc... | apache-2.0 |
pombredanne/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_cache_compile_integration.py | 1 | 9202 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from colle... | apache-2.0 |
40223104/2015cd_0512 | static/Brython3.1.1-20150328-091302/Lib/browser/local_storage.py | 617 | 2786 | # local storage in browser
import sys
from javascript import JSObject
class __UnProvided():
pass
class LocalStorage():
storage_type = "local_storage"
def __init__(self):
if not sys.has_local_storage:
raise EnvironmentError("LocalStorage not available")
self.store = JSObject(__... | agpl-3.0 |
mlperf/training_results_v0.7 | Google/benchmarks/maskrcnn/implementations/maskrcnn-research-TF-tpu-v4-512/object_detection/preprocessor.py | 2 | 17746 | # 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 |
krishna-pandey-git/django | tests/utils_tests/test_datetime_safe.py | 207 | 2371 | import unittest
from datetime import (
date as original_date, datetime as original_datetime,
time as original_time,
)
from django.utils.datetime_safe import date, datetime, time
class DatetimeTests(unittest.TestCase):
def setUp(self):
self.just_safe = (1900, 1, 1)
self.just_unsafe = (189... | bsd-3-clause |
haxoza/django | tests/get_or_create/tests.py | 282 | 15058 | from __future__ import unicode_literals
import traceback
from datetime import date
from django.db import DatabaseError, IntegrityError
from django.test import TestCase, TransactionTestCase, ignore_warnings
from django.utils.encoding import DjangoUnicodeDecodeError
from .models import (
Author, Book, DefaultPerso... | bsd-3-clause |
btabibian/scikit-learn | examples/linear_model/plot_multi_task_lasso_support.py | 102 | 2319 | #!/usr/bin/env python
"""
=============================================
Joint feature selection with multi-task Lasso
=============================================
The multi-task lasso allows to fit multiple regression problems
jointly enforcing the selected features to be the same across
tasks. This example simulates... | bsd-3-clause |
genehuangtaiwan/common | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
pyecs/servo | tests/wpt/web-platform-tests/2dcontext/tools/specextract.py | 132 | 2100 | import html5lib
import html5lib.treebuilders.dom
# Expected use:
# curl --compressed http://www.whatwg.org/specs/web-apps/current-work/ >current-work
# python specextract.py
#
# Generates current-work-canvas.xhtml, for use by gentest.py to create the annotated spec document
def extract():
parser = html5lib.ht... | mpl-2.0 |
gaolichuang/py-task-framework | nova/api/openstack/compute/plugins/__init__.py | 13 | 2060 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 IBM Corp.
#
# 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 |
nickBumgarner/wwf | node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py | 1789 | 10585 | # Copyright (c) 2014 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.
"""Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project i... | gpl-2.0 |
odejesush/tensorflow | tensorflow/contrib/layers/python/layers/utils.py | 71 | 10875 | # 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 |
jasonyaw/SFrame | oss_src/unity/python/sframe/util/file_util.py | 8 | 27988 | '''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
'''
This package provides commonly used methods for dealing with file operation,
including working with network file system like S3, http, etc... | bsd-3-clause |
haoyuchen1992/osf.io | scripts/box/connect_external_accounts.py | 31 | 1562 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
First run
rm -rf website/addons/box/views/
to remove old .pyc files that would interfere.
"""
import sys
import logging
from modularodm import Q
from website.app import init_app
from scripts import utils as script_utils
from framework.transactions.context import T... | apache-2.0 |
ypcs/avoin | src/avoin/core.py | 1 | 1173 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
from avoin.scraper.scraper import DefaultScraper, xpath_parser, ScraperMissingElementError
from avoin.data.utils import read, write
def main(args):
if args.command == 'xpath':
scraper = DefaultScraper()
xpath = args.xpath
... | gpl-3.0 |
marcel-dancak/QGIS | python/plugins/processing/algs/gdal/hillshade.py | 4 | 8475 | # -*- coding: utf-8 -*-
"""
***************************************************************************
hillshade.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
***************... | gpl-2.0 |
40223114/w16 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/image.py | 603 | 19603 | #!/usr/bin/env python
'''Pygame module for image transfer.
The image module contains functions for loading and saving pictures, as
well as transferring Surfaces to formats usable by other packages.
Note that there is no Image class; an image is loaded as a
Surface object. The Surface class allows manipulation (drawi... | agpl-3.0 |
ssaeger/scikit-learn | sklearn/covariance/__init__.py | 389 | 1157 | """
The :mod:`sklearn.covariance` module includes methods and algorithms to
robustly estimate the covariance of features given a set of points. The
precision matrix defined as the inverse of the covariance is also estimated.
Covariance estimation is closely related to the theory of Gaussian Graphical
Models.
"""
from ... | bsd-3-clause |
kylerbrown/scikit-learn | sklearn/cross_decomposition/cca_.py | 209 | 3150 | from .pls_ import _PLS
__all__ = ['CCA']
class CCA(_PLS):
"""CCA Canonical Correlation Analysis.
CCA inherits from PLS with mode="B" and deflation_mode="canonical".
Read more in the :ref:`User Guide <cross_decomposition>`.
Parameters
----------
n_components : int, (default 2).
numb... | bsd-3-clause |
PythonMilano/pillole-di-python-01 | pdb_in_action/sources/estimate.py | 1 | 1274 | #!/usr/bin/env python3
""" Estimator 1.0
The estimator helps you find those hard estimations they ask you.
Just call the script, it will ask you a brief feature descrition,
then it will show you the estimation.
Press CTRL-C when you're done.
"""
import sys
from random import randrange
fib_n = [1, 1,... | mit |
djtotten/workbench | workbench/clients/pcap_meta_indexer.py | 2 | 1303 | """This client pushes PCAPs -> MetaDaa -> ELS Indexer."""
import zerorpc
import os
import client_helper
def run():
"""This client pushes PCAPs -> MetaDaa -> ELS Indexer."""
# Grab server args
args = client_helper.grab_server_args()
# Start up workbench connection
workbench = zerorpc.Client(ti... | mit |
sgmap/openfisca-france | openfisca_france/model/prestations/minima_sociaux/aah.py | 1 | 21212 |
# -*- coding: utf-8 -*-
from openfisca_france.model.base import *
from numpy import datetime64
# Références juridiques - Code de la sécurité sociale
#
# Article L821-1 / 821-8
# https://www.legifrance.gouv.fr/affichCode.do;jsessionid=0E604431776A4B1ED8D2F8EB55A1A99C.tplgfr35s_1?idSectionTA=LEGISCTA000006141693&cidTe... | agpl-3.0 |
Meriipu/quodlibet | quodlibet/session/_xsmp.py | 2 | 9125 | # Copyright 2018 Christoph Reiter
#
# 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 version.
import enum
import ctypes
from gi.... | gpl-2.0 |
b-kolodziej/cookiecutter-django | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/tests/test_admin.py | 264 | 1308 | from test_plus.test import TestCase
from ..admin import MyUserCreationForm
class TestMyUserCreationForm(TestCase):
def setUp(self):
self.user = self.make_user()
def test_clean_username_success(self):
# Instantiate the form with a new username
form = MyUserCreationForm({
... | bsd-3-clause |
kaichogami/scikit-learn | sklearn/manifold/t_sne.py | 7 | 34867 | # Author: Alexander Fabisch -- <afabisch@informatik.uni-bremen.de>
# Author: Christopher Moody <chrisemoody@gmail.com>
# Author: Nick Travers <nickt@squareup.com>
# License: BSD 3 clause (C) 2014
# This is the exact and Barnes-Hut t-SNE implementation. There are other
# modifications of the algorithm:
# * Fast Optimi... | bsd-3-clause |
VitalPet/sale-workflow | sale_quotation_sourcing/model/sale_order.py | 34 | 6276 | # -*- coding: utf-8 -*-
#
# Author: Alexandre Fayolle, Leonardo Pistone, Yannick Vaucher
# Copyright 2014-2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundatio... | agpl-3.0 |
brianlsharp/MissionPlanner | Lib/site-packages/numpy/f2py/capi_maps.py | 51 | 29016 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
"""
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED... | gpl-3.0 |
Archcady/mbed-os | tools/host_tests/midi.py | 111 | 1933 | from __future__ import print_function
import sys
import re
import time
import mido
from mido import Message
def test_midi_in(port):
expected_messages_count=0
while expected_messages_count < 7:
for message in port.iter_pending():
if message.type in ('note_on', 'note_off', 'program_change', 'sysex'):
yield m... | apache-2.0 |
moylop260/odoo-dev | addons/base_iban/__init__.py | 447 | 1073 | # -*- 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... | agpl-3.0 |
porduna/weblabdeusto | server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment1/experiment55/server_config.py | 968 | 1526 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
weblab_xilinx_experiment_xilinx_device = 'FPGA'
weblab_xilinx_experiment_port_number = 1
# This should be something like this:
# import os as _os
# xilinx_home = _os.getenv('XILINX_HOME')
# if xilinx_home == None:
# if _os.name == 'nt':
# xilinx_home = r'C:... | bsd-2-clause |
jamespcole/home-assistant | homeassistant/components/lcn/sensor.py | 1 | 4063 | """Support for LCN sensors."""
from homeassistant.const import CONF_ADDRESS, CONF_UNIT_OF_MEASUREMENT
from . import LcnDevice, get_connection
from .const import (
CONF_CONNECTIONS, CONF_SOURCE, DATA_LCN, LED_PORTS, S0_INPUTS, SETPOINTS,
THRESHOLDS, VARIABLES)
DEPENDENCIES = ['lcn']
async def async_setup_pla... | apache-2.0 |
queenp/wakatime | wakatime/packages/pygments_py3/pygments/lexers/foxpro.py | 134 | 26236 | # -*- coding: utf-8 -*-
"""
pygments.lexers.foxpro
~~~~~~~~~~~~~~~~~~~~~~
Simple lexer for Microsoft Visual FoxPro source code.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer
from pygm... | bsd-3-clause |
Bulochkin/tensorflow_pack | tensorflow/contrib/keras/python/keras/metrics_test.py | 36 | 2470 | # 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 |
mbj4668/pyang | pyang/plugins/jtox.py | 1 | 4332 | # Copyright (c) 2015 by Ladislav Lhotka, CZ.NIC <lhotka@nic.cz>
#
# Pyang plugin generating a driver file for JSON->XML translation.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permissio... | isc |
Jumpscale/jumpscale_core8 | lib/JumpScale/sal/fs/SystemFS.py | 1 | 84169 | import sys
import os
import os.path
import hashlib
import re
import fnmatch
import time
import shutil
import errno
import tempfile
import codecs
import pickle as pickle
import stat
from stat import ST_MTIME
from SystemFSWalker import *
# We import only jumpscale as the j.sal.fs is used before jumpscale is
# initializ... | apache-2.0 |
franckverrot/live-note | waveapi/commandline_robot_runner_test.py | 10 | 2549 | #!/usr/bin/python2.4
#
# Copyright 2009 Google Inc. All Rights Reserved.
"""Tests for google3.walkabout.externalagents.api.commandline_robot_runner."""
__author__ = 'douwe@google.com (Douwe Osinga)'
import StringIO
from google3.pyglib import app
from google3.pyglib import flags
from google3.testing.pybase import g... | gpl-3.0 |
SVilgelm/CloudFerry | cloudferry/actions/compute/get_info_instances.py | 1 | 1047 | # Copyright (c) 2014 Mirantis 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, so... | apache-2.0 |
danny200309/anaconda | anaconda_lib/autopep/autopep8_lib/lib2to3/pgen2/parse.py | 569 | 8053 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser engine for the grammar tables generated by pgen.
The grammar table must be loaded first.
See Parser/parser.c in the Python distribution for additional info on
how this parsing engine works.
... | gpl-3.0 |
vegeclic/django-regularcom | carts/migrations/0043_auto__del_field_carriertranslation_name__del_field_carriertranslation_.py | 1 | 27698 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.rename_column('carts_carrier_translation', 'name', 'old_name')
db.rena... | agpl-3.0 |
whuaegeanse/mapnik | scons/scons-local-2.3.6/SCons/Tool/MSCommon/common.py | 4 | 9199 | #
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# 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, merge... | lgpl-2.1 |
VcamX/pywikibot-core | scripts/revertbot.py | 2 | 5150 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script can be used for reverting certain edits.
The following command line parameters are supported:
¶ms;
-username Edits of which user need to be reverted.
-rollback Rollback edits instead of reverting them.
Note that in roll... | mit |
ricardog/raster-project | projections/r2py/lm.py | 1 | 1635 | from rpy2.robjects import Formula
from rpy2.robjects import pandas2ri
from rpy2.robjects.packages import importr
class LM(object):
'''Class for fitting (simple) linear models using rpy2. When extracting
the coefficients for a model (lmerMod or glmerMod) that uses orthogonal
polynomials (poly in R syntax), it is nec... | apache-2.0 |
syapse/django-storages | docs/conf.py | 6 | 8336 | # -*- coding: utf-8 -*-
#
# django-storages documentation build configuration file, created by
# sphinx-quickstart on Sun Aug 28 13:44:45 2011.
#
# 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.... | bsd-3-clause |
Khan/gae_bingo | cache.py | 1 | 15801 | import logging
import pickle
import random
from google.appengine.ext import db
from google.appengine.ext import deferred
from google.appengine.api import memcache
from google.appengine.datastore import entity_pb
from google.appengine.ext.webapp import RequestHandler
from .models import _GAEBingoExperiment, _GAEBingoA... | mit |
MSOpenTech/edx-platform | lms/djangoapps/shoppingcart/migrations/0004_auto__add_field_orderitem_fulfilled_time.py | 114 | 8621 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'OrderItem.fulfilled_time'
db.add_column('shoppingcart_orderitem', 'fulfilled_time',
... | agpl-3.0 |
Geoion/AutobahnPython | examples/twisted/wamp/app/klein/example2/server.py | 11 | 2728 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit |
diraimondo/osmc | package/mediacenter-addon-osmc/src/service.osmc.settings/resources/lib/osmc_slideshow.py | 7 | 4863 | # XBMC modules
import xbmc
import xbmcaddon
import xbmcgui
# STANDARD library modules
import os
import sys
import threading
path = xbmcaddon.Addon().getAddonInfo('path')
lib = os.path.join(path, 'resources','lib')
media = os.path.join(path, 'resources','skins','Default','media')
sys.path.append(xbm... | gpl-2.0 |
marco-lancini/Showcase | django/contrib/auth/context_processors.py | 152 | 2229 | from django.utils.functional import lazy, memoize, SimpleLazyObject
from django.contrib import messages
# PermWrapper and PermLookupDict proxy the permissions system into objects that
# the template system can understand.
class PermLookupDict(object):
def __init__(self, user, module_name):
self.user, self... | mit |
LIKAIMO/MissionPlanner | Lib/lib2to3/fixes/fix_map.py | 61 | 3153 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes map(F, ...) into list(map(F, ...)) unless there
exists a 'from future_builtins import map' statement in the top-level
namespace.
As a special case, map(None, X) is changed into list(X). (T... | gpl-3.0 |
Metaswitch/calico-neutron | neutron/agent/dhcp_agent.py | 2 | 26429 | # Copyright 2012 OpenStack Foundation
# 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 requ... | apache-2.0 |
synasius/django | tests/migrations/test_executor.py | 80 | 26645 | from django.apps.registry import apps as global_apps
from django.db import connection
from django.db.migrations.exceptions import InvalidMigrationPlan
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.graph import MigrationGraph
from django.db.migrations.recorder import MigrationReco... | bsd-3-clause |
wbc2010/django1.2.5 | django1.2.5/tests/regressiontests/forms/localflavor/generic.py | 89 | 4326 | import datetime
from django.contrib.localflavor.generic.forms import DateField, DateTimeField
from utils import LocalFlavorTestCase
class GenericLocalFlavorTests(LocalFlavorTestCase):
def test_GenericDateField(self):
error_invalid = [u'Enter a valid date.']
valid = {
datetime.date(20... | bsd-3-clause |
doug-fish/horizon | openstack_dashboard/test/settings.py | 7 | 6317 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
1200wd/1200wd_addons | stock_forecasted/models/sale.py | 1 | 1283 | # -*- coding: utf-8 -*-
##############################################################################
#
# Stock Forecasted
# 1200 Web Development
# http://1200wd.com/
# Copyright (C) 2016 January
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | agpl-3.0 |
sfumato77/Kernel-4.8_Android-x86_BayTrail | tools/perf/scripts/python/compaction-times.py | 958 | 7950 | # report time spent in compaction
# Licensed under the terms of the GNU GPL License version 2
# testing:
# 'echo 1 > /proc/sys/vm/compact_memory' to force compaction of all zones
import os
import sys
import re
import signal
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
usage = "usage: perf script report compaction-... | gpl-2.0 |
hoho/dosido | nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
delta2323/chainer | tests/chainer_tests/functions_tests/loss_tests/test_sigmoid_cross_entropy.py | 3 | 7799 | import math
import unittest
import mock
import numpy
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parameterize(
{'shape': (8, 7), 'no... | mit |
pigletto/django-lfs | lfs/portlet/migrations/0001_initial.py | 5 | 5932 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='AverageRatingPortlet',
fields=[
('id', models.A... | bsd-3-clause |
mmnelemane/nova | nova/api/openstack/compute/legacy_v2/contrib/scheduler_hints.py | 97 | 2066 | # Copyright 2011 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 ... | apache-2.0 |
CPFL/gxen | tools/libxl/gentest.py | 2 | 9390 | #!/usr/bin/python
import os
import sys
import re
import random
import idl
def randomize_char(c):
if random.random() < 0.5:
return str.lower(c)
else:
return str.upper(c)
def randomize_case(s):
r = [randomize_char(c) for c in s]
return "".join(r)
def randomize_enum(e):
return rand... | gpl-2.0 |
shroman/ignite | modules/platforms/python/tests/test_sql.py | 7 | 4551 | # 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 |
wkentaro/termsaver | termsaverlib/common.py | 1 | 4621 | ###############################################################################
#
# file: common.py
#
# Purpose: holds common helper functions used by termsaver code.
#
# Note: This file is part of Termsaver application, and should not be used
# or executed separately.
#
#############################... | apache-2.0 |
rickmce/testlink-code | third_party/fckeditor/editor/filemanager/connectors/py/fckcommands.py | 48 | 6335 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.or... | gpl-2.0 |
Arno-Nymous/pyload | module/plugins/accounts/FastixRu.py | 7 | 1982 | # -*- coding: utf-8 -*-
from ..internal.misc import json
from ..internal.MultiAccount import MultiAccount
class FastixRu(MultiAccount):
__name__ = "FastixRu"
__type__ = "account"
__version__ = "0.12"
__status__ = "testing"
__config__ = [("mh_mode", "all;listed;unlisted", "Filter hosters to use",... | gpl-3.0 |
prheenan/prhUtil | python/IgorUtil.py | 2 | 8803 | # force floating point division. Can still use integer with //
from __future__ import division
# This file is used for importing the common utilities classes.
import numpy as np
import matplotlib.pyplot as plt
# import the patrick-specific utilities
import GenUtilities as pGenUtil
import PlotUtilities as pPlotUtil
imp... | gpl-2.0 |
diplomacy/research | diplomacy_research/players/player.py | 1 | 20892 | # ==============================================================================
# Copyright 2019 - Philip Paquette
#
# NOTICE: 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 rest... | mit |
adaxi/freeciv-web | pbem/mailstatus.py | 1 | 3008 | '''**********************************************************************
Copyright (C) 2009-2016 The Freeciv-web project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, eithe... | agpl-3.0 |
labsanmartin/Bika-LIMS | bika/lims/upgrade/to3018.py | 3 | 1249 | from Acquisition import aq_inner
from Acquisition import aq_parent
from bika.lims import logger
from bika.lims.permissions import *
from Products.CMFCore import permissions
from Products.CMFCore.utils import getToolByName
from zExceptions import BadRequest
def upgrade(tool):
# Hack prevent out-of-date upgrading
... | agpl-3.0 |
MoRgUiJu/morguiju.repo | plugin.video.pelisalacarta/lib/requests/packages/urllib3/packages/six.py | 2375 | 11628 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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 l... | gpl-2.0 |
sudheesh001/oh-mainline | vendor/packages/Django/tests/regressiontests/generic_views/views.py | 47 | 6507 | from __future__ import absolute_import
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse, reverse_lazy
from django.utils.decorators import method_decorator
from django.views import generic
from .forms import AuthorForm, C... | agpl-3.0 |
Myasuka/scikit-learn | setup.py | 143 | 7364 | #! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# License: 3-clause BSD
descr = """A set of python modules for machine learning and data mining"""
import sys
import os
import shutil
from distutils.command.clean ... | bsd-3-clause |
garthomp/ruby_blog | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/agile.py | 197 | 100441 | # -*- coding: utf-8 -*-
"""
pygments.lexers.agile
~~~~~~~~~~~~~~~~~~~~~
Lexers for agile languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \
Le... | mit |
dqnykamp/sympy | sympy/assumptions/handlers/matrices.py | 71 | 13732 | """
This module contains query handlers responsible for calculus queries:
infinitesimal, bounded, etc.
"""
from __future__ import print_function, division
from sympy.logic.boolalg import conjuncts
from sympy.assumptions import Q, ask
from sympy.assumptions.handlers import CommonHandler, test_closed_group
from sympy.ma... | bsd-3-clause |
utecuy/edx-platform | cms/djangoapps/models/settings/course_grading.py | 143 | 8907 | from datetime import timedelta
from xmodule.modulestore.django import modulestore
class CourseGradingModel(object):
"""
Basically a DAO and Model combo for CRUD operations pertaining to grading policy.
"""
# Within this class, allow access to protected members of client classes.
# This comes up wh... | agpl-3.0 |
vipul-sharma20/oh-mainline | vendor/packages/django-assets/test/test_filters.py | 16 | 4301 | import os
from nose.tools import assert_raises
from django.conf import settings
from django_assets.filter import Filter, get_filter, register_filter
# TODO: Add tests for all the builtin filters.
class TestFilter:
"""Test the API ``Filter`` provides to descendants.
"""
def test_auto_name(self):
... | agpl-3.0 |
JIMyungSik/uftrace | tests/t137_kernel_tid_update.py | 2 | 1270 | #!/usr/bin/env python
from runtest import TestBase
import os
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'fork2', """
# DURATION TID FUNCTION
[19227] | main() {
328.451 us [19227] | fork();
[19227] | wait() {
[19231] | } /* fork *... | gpl-2.0 |
libracore/erpnext | erpnext/education/report/assessment_plan_status/assessment_plan_status.py | 24 | 4374 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from itertools import groupby
from frappe.utils import cint
DOCSTATUS = {
0: "saved",
1: "submitted",
}
def execute(filte... | gpl-3.0 |
Abhinav117/pymtl | accel/strsearch/StrSearchOO_test.py | 7 | 16705 | #=========================================================================
# StrSearchOO_test.py
#=========================================================================
#
# Object-Oriented implementation of strsearch.
#
# This dataset is borrowed from the stringsearch implementation provided
# the MiBench embedded s... | bsd-3-clause |
thjashin/tensorflow | tensorflow/tools/test/run_and_gather_logs.py | 137 | 4918 | # 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 |
mcanthony/rethinkdb | packaging/osx/biplist/__init__.py | 37 | 31532 | """biplist -- a library for reading and writing binary property list files.
Binary Property List (plist) files provide a faster and smaller serialization
format for property lists on OS X. This is a library for generating binary
plists which can be read by OS X, iOS, or other clients.
The API models the plistlib API,... | agpl-3.0 |
mit-ll/LO-PHI | lophi-automation/lophi_automation/configs/controllerconfig.py | 1 | 5240 | """
Class for handling configuration files for controller nodes
(c) 2015 Massachusetts Institute of Technology
"""
# Native
import socket
import logging
logger = logging.getLogger(__name__)
from time import sleep
# LO-PHI
import lophi.globals as G
# LO-PHI Automation
import lophi_automation.protobuf.helper a... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.