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 |
|---|---|---|---|---|---|
ToontownUprising/src | toontown/safezone/TreasurePlannerAI.py | 4 | 4944 | from direct.distributed.ClockDelta import *
from direct.showbase import DirectObject
from direct.directnotify import DirectNotifyGlobal
from direct.task import Task
from DistributedTreasureAI import DistributedTreasureAI
import random
class TreasurePlannerAI(DirectObject.DirectObject):
notify = DirectNotifyGlobal.... | mit |
KarrLab/obj_model | tests/fixtures/migrate/wc_lang_fixture/wc_lang/transform/split_reversible_reactions.py | 1 | 5346 | """ Transform models.
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2018-06-19
:Copyright: 2018, Karr Lab
:License: MIT
"""
from .core import Transform
from wc_lang import Model, Reaction, RateLawDirection
from wc_onto import onto
from wc_utils.util.ontology import are_terms_equivalent
import copy
import re
class S... | mit |
MadManRises/Madgine | shared/assimp/contrib/gtest/scripts/pump.py | 2471 | 23673 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mit |
guardicore/monkey | monkey/tests/unit_tests/infection_monkey/system_info/windows_cred_collector/test_pypykatz_handler.py | 1 | 5948 | from unittest import TestCase
from infection_monkey.system_info.windows_cred_collector.pypykatz_handler import (
_get_creds_from_pypykatz_session,
)
class TestPypykatzHandler(TestCase):
# Made up credentials, but structure of dict should be roughly the same
PYPYKATZ_SESSION = {
"authentication_id... | gpl-3.0 |
blueskycoco/rt-thread | bsp/stm32/stm32l010-st-nucleo/rtconfig.py | 14 | 4031 | import os
# toolchains options
ARCH='arm'
CPU='cortex-m0'
CROSS_TOOL='gcc'
# bsp lib config
BSP_LIBRARY_TYPE = None
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute... | gpl-2.0 |
pelya/commandergenius | project/jni/python/src/Demo/tix/samples/Balloon.py | 37 | 2310 | # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Balloon.py 36560 2004-07-18 06:16:08Z tim_one $
#
# Tix Demostration Program
#
# This sample program is structured in such a way so that it can be
# executed from the Tix demo program "tixwidgets.py": it must have a
# procedure call... | lgpl-2.1 |
Anik1199/android_kernel_mediatek_sprout | 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 |
foss-transportationmodeling/rettina-server | flask/local/lib/python2.7/site-packages/sqlalchemy/testing/util.py | 21 | 5304 | # testing/util.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from ..util import jython, pypy, defaultdict, decorator, py2k
import decimal
import ... | apache-2.0 |
mihaic/brainiak | tests/io/test_io.py | 7 | 3078 | # Copyright 2017 Intel Corporation
#
# 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... | apache-2.0 |
rc/sfepy | sfepy/discrete/fem/utils.py | 4 | 9529 | from __future__ import absolute_import
import numpy as nm
import sfepy.linalg as la
from sfepy.discrete.integrals import Integral
from sfepy.discrete import PolySpace
from six.moves import range
def prepare_remap(indices, n_full):
"""
Prepare vector for remapping range `[0, n_full]` to its subset given
by... | bsd-3-clause |
mavenlin/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/kernel_tests/routing_function_op_test.py | 102 | 2327 | # 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 |
p4datasystems/CarnotKE | jyhton/lib-python/2.7/encodings/iso2022_jp_3.py | 816 | 1061 | #
# iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_3')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... | apache-2.0 |
PaddlePaddle/models | dygraph/mobilenet/imagenet_dataset.py | 1 | 1987 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
ShiYw/Sigil | 3rdparty/python/Lib/idlelib/idle_test/mock_tk.py | 8 | 11545 | """Classes that replace tkinter gui objects used by an object being tested.
A gui object is anything with a master or parent paramenter, which is
typically required in spite of what the doc strings say.
"""
class Event:
'''Minimal mock with attributes for testing event handlers.
This is not a gui object, but... | gpl-3.0 |
lillisgary/shiny-shame | theme/admin.py | 1 | 1252 | from django.contrib import admin
from .models import HomePage, Slide, IconBlurb, Portfolio, PortfolioItemImage, PortfolioItem, PortfolioItemCategory, TextSlider, DocumentListItem, DocumentList, DocumentListItemCategory
from mezzanine.core.admin import TabularDynamicInlineAdmin
from mezzanine.pages.admin import PageAdmi... | gpl-2.0 |
thientu/scikit-learn | sklearn/neighbors/graph.py | 208 | 7031 | """Nearest Neighbors graph functions"""
# Author: Jake Vanderplas <vanderplas@astro.washington.edu>
#
# License: BSD 3 clause (C) INRIA, University of Amsterdam
import warnings
from .base import KNeighborsMixin, RadiusNeighborsMixin
from .unsupervised import NearestNeighbors
def _check_params(X, metric, p, metric_... | bsd-3-clause |
sjdv1982/seamless | tests/lowlevel/module-package.py | 1 | 1611 | import seamless
from seamless.core import macro_mode_on
from seamless.core import context, cell, macro
mod_init = """
from .mod3 import testvalue
"""
mod1 = """
from . import testvalue
def func():
return testvalue
"""
mod2 = """
from .mod1 import func
"""
mod3 = """
testvalue = 42
"""
package = {
"__init_... | mit |
joequery/django | tests/model_fields/test_durationfield.py | 296 | 2724 | import datetime
import json
from django import forms
from django.core import exceptions, serializers
from django.db import models
from django.test import SimpleTestCase, TestCase
from .models import DurationModel, NullDurationModel
class TestSaveLoad(TestCase):
def test_simple_roundtrip(self):
duration... | bsd-3-clause |
twz915/django | django/core/serializers/json.py | 1 | 3709 | """
Serialize data to/from JSON
"""
import datetime
import decimal
import json
import sys
import uuid
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import (
Deserializer as PythonDeserializer, Serializer as PythonSerializer,
)
from django.utils import six
from d... | bsd-3-clause |
HOQTEC/MCP | jumpgate/compute/drivers/sl/quota_sets.py | 3 | 1091 | from oslo.config import cfg
class OSQuotaSetsV2(object):
def on_get(self, req, resp, tenant_id, account_id=None):
qs = {
"cores": cfg.CONF['compute']['default_cores'],
"floating_ips": cfg.CONF['compute']['default_floating_ips'],
"id": tenant_id,
"injected_fi... | mit |
mavit/ansible | lib/ansible/modules/monitoring/zabbix/zabbix_host.py | 12 | 37008 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013-2014, Epic Games, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
jusdng/odoo | openerp/tools/config.py | 178 | 36937 | #openerp.loggers.handlers. -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program... | agpl-3.0 |
LinErinG/foxsi-smex | pyfoxsi/src/pyfoxsi/response/response.py | 4 | 8272 | """
Response is a module to handle the response of the FOXSI telescopes
"""
from __future__ import absolute_import
import pandas as pd
import numpy as np
import warnings
import os
import matplotlib.pyplot as plt
import astropy.units as u
from scipy import interpolate
import pyfoxsi
import h5py
__all__ = ['Respons... | mit |
chirilo/kuma | kuma/users/tests/test_adapters.py | 13 | 4706 | from nose.plugins.attrib import attr
from nose.tools import eq_, ok_
from django.contrib import messages as django_messages
from django.test import RequestFactory
from allauth.exceptions import ImmediateHttpResponse
from allauth.socialaccount.models import SocialLogin, SocialAccount
from kuma.core.urlresolvers impor... | mpl-2.0 |
hyperized/ansible | lib/ansible/modules/network/ios/ios_lacp.py | 1 | 4046 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is au... | gpl-3.0 |
vv1133/home_web | tests/urlpatterns_reverse/views.py | 64 | 1511 | from functools import partial, update_wrapper
from django.http import HttpResponse
from django.views.generic import RedirectView
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.decorators import user_passes_test
def empty_view(request, *args, **kwargs):
return HttpResponse('')
def kwa... | bsd-3-clause |
havt/odoo | addons/account/wizard/account_statement_from_invoice.py | 224 | 4128 | # -*- 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 |
mikewiebe-ansible/ansible | lib/ansible/module_utils/xenserver.py | 14 | 30814 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, Bojan Vitnik <bvitnik@mainstream.rs>
# 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
import atexit
import time
import re
import traceback
... | gpl-3.0 |
aferr/TimingCompartments | tests/quick/se/00.hello/test.py | 19 | 1801 | # Copyright (c) 2006 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
2015fallhw/cptocadp | static/Brython3.2.3-20151122-082712/Lib/encodings/cp1255.py | 37 | 12773 | """ Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.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 d... | agpl-3.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/numpy-1.9.2/numpy/distutils/fcompiler/hpux.py | 229 | 1464 | from __future__ import division, absolute_import, print_function
from numpy.distutils.fcompiler import FCompiler
compilers = ['HPUXFCompiler']
class HPUXFCompiler(FCompiler):
compiler_type = 'hpux'
description = 'HP Fortran 90 Compiler'
version_pattern = r'HP F90 (?P<version>[^\s*,]*)'
executables... | mit |
theicfire/djangofun | djangotoolbox/fields.py | 6 | 11104 | # All fields except for BlobField written by Jonas Haag <jonas@lophus.org>
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.importlib import import_module
__all__ = ('RawField', 'ListField', 'DictField', 'SetField',
'BlobField', 'EmbeddedModelField')
class ... | bsd-3-clause |
schambers/civmarket | civmarket/lib/python2.7/site-packages/setuptools/tests/test_markerlib.py | 449 | 2506 | import os
import unittest
from setuptools.tests.py26compat import skipIf
try:
import ast
except ImportError:
pass
class TestMarkerlib(unittest.TestCase):
@skipIf('ast' not in globals(),
"ast not available (Python < 2.6?)")
def test_markers(self):
from _markerlib import interpret, defa... | apache-2.0 |
Mhynlo/SickRage | tests/sickrage_tests/__init__.py | 22 | 1273 | # coding=utf-8
# This file is part of SickRage.
#
# URL: https://SickRage.GitHub.io
# Git: https://github.com/SickRage/SickRage.git
#
# SickRage 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... | gpl-3.0 |
ramusus/django-vkontakte-groups-migration | vkontakte_groups_migration/migrations/0002_auto__add_field_groupmigration_hidden.py | 1 | 16399 | # -*- 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 'GroupMigration.hidden'
db.add_column('vkontakte_groups_groupstatmembers', 'hidden',
... | bsd-3-clause |
spaceboats/busbus | tests/test_provider_ctran.py | 1 | 1025 | import busbus
from busbus.provider.ctran import CTranProvider
from .conftest import mock_gtfs_zip
import arrow
import pytest
import responses
@pytest.fixture(scope='module')
@responses.activate
def ctran_provider(engine):
responses.add(responses.GET, CTranProvider.gtfs_url,
body=mock_gtfs_zip('... | mit |
ArcherSys/ArcherSys | eclipse/plugins/org.python.pydev.jython_4.5.5.201603221110/Lib/encodings/mac_croatian.py | 593 | 13889 | """ Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.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,inp... | mit |
doomsterinc/odoo | doc/_extensions/github_link.py | 229 | 3484 | import inspect
import importlib
import os.path
from urlparse import urlunsplit
"""
* adds github_link(mode) context variable: provides URL (in relevant mode) of
current document on github
* if sphinx.ext.linkcode is enabled, automatically generates github linkcode
links (by setting config.linkcode_resolve)
Settin... | agpl-3.0 |
muminoff/fabric-bolt | src/fabric_bolt/accounts/urls.py | 14 | 1297 | from django.conf.urls import url, patterns
from fabric_bolt.accounts import views
urlpatterns = patterns('',
url(r'^login/$', views.Login.as_view(), name='accounts_user_login'),
url(r'^logout/$', views.Logout.as_view(), name='accounts_user_logout'),
url(r'^users/$', views.UserList.as_view(), name='account... | mit |
mdanielwork/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/geometry/test_data.py | 364 | 2994 | """
This module has the mock object definitions used to hold reference geometry
for the GEOS and GDAL tests.
"""
import gzip
import os
from django.contrib import gis
from django.utils import simplejson
# This global used to store reference geometry data.
GEOMETRIES = None
# Path where reference test data is located... | apache-2.0 |
nexec/vkcopy2mp3p | vkcopy2mp3p.py | 1 | 4785 | #!/usr/bin/python2
# -*- coding: utf-8 -*-
import sqlite3 as db
import sys
import os
import pycurl
import StringIO
import re
import urllib
import json
from random import shuffle
PROFILE = 'default'
argc = len(sys.argv)
if argc < 3 or argc > 4:
sys.stderr.write('Usage: %s /path/to/dir count_of_songs [PROFILE]\n'... | gpl-2.0 |
cakeboss893/volatility | volatility/plugins/overlays/mac/mac.py | 44 | 33471 | # Volatility
# Copyright (C) 2010 Brendan Dolan-Gavitt
# Copyright (c) 2011 Michael Cohen <scudette@gmail.com>
#
# This file is part of Volatility.
#
# Volatility 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... | gpl-2.0 |
faircloth-lab/conda-recipes | recipes/mafft/run_test.py | 2 | 3625 | #!/usr/bin/env python
# encoding: utf-8
"""
File: run_test.py
Author: Brant Faircloth
Created by Brant Faircloth on 22 December 2013 08:12 PST (-0800)
Copyright (c) 2013 Brant C. Faircloth. All rights reserved.
"""
import os
import pdb
import difflib
import tempfile
import subprocess
import unittest
class TestAlign... | bsd-3-clause |
veveykocute/Spl | splc.py | 1 | 19239 | import sys
import math
"""A Shakespeare Compiler written in Python, splc.py
This is a compiler that implements the majority of the Shakespeare programming language
invented by Kalle Hasselstrom and Jon Aslund, I take no credit for inventing the language.
This software is free to edit or use, and though I doubt anyone ... | unlicense |
IndyMPO/IndyGeoTools | ConvertGeography/GetAreaConversionMatrix.py | 1 | 3774 | #This script copyright 2017 Indianapolis Metropolitan Planning Organization
from __future__ import division
import arcpy
import os
import pandas as pd
import numpy as np
from subprocess import Popen
import sys
def clear_temp():
'''
Clears the temporary directory that is created when running this tool
'''
... | apache-2.0 |
SDSG-Invenio/invenio | invenio/celery/tasks.py | 17 | 1196 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014 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 your option) any... | gpl-2.0 |
goliveirab/odoo | addons/base_gengo/__openerp__.py | 312 | 2117 | # -*- 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 |
shinglyu/moztrap | moztrap/model/core/migrations/0003_auto__add_field_productversion_cc_version__add_field_product.py | 5 | 13293 | # encoding: 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 'ProductVersion.cc_version'
db.add_column('core_productversion', 'cc_version', self.gf('django.db.... | bsd-2-clause |
pducks32/intergrala | python/sympy/sympy/physics/quantum/tests/test_operator.py | 7 | 6165 | from sympy import (Derivative, diff, Function, Integer, Mul, pi, sin, Symbol,
symbols)
from sympy.physics.quantum.qexpr import QExpr
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.hilbert import HilbertSpace
from sympy.physics.quantum.operator import (Operator, UnitaryOper... | mit |
neteler/QGIS | python/plugins/processing/algs/gdal/rgb2pct.py | 3 | 2612 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
rgb2pct.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************************... | gpl-2.0 |
D3f0/AutobahnPython | examples/websocket/echo/client.py | 19 | 1977 | ###############################################################################
##
## Copyright 2011,2012 Tavendo GmbH
##
## 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
##
## ... | apache-2.0 |
mission-peace/interview | python/dynamic/weighted_job_scheduling_max_profit.py | 1 | 1192 | """
Problem Statement
=================
Given set of jobs with start and end interval and profit, how to maximize profit such that jobs in subset do not
overlap.
Video
-----
* https://youtu.be/cr6Ip0J9izc
Complexity
----------
* Runtime Complexity: O(n^2)
* Space Complexity: O(n)
Reference Link
--------------
* ht... | apache-2.0 |
markeTIC/server-tools | base_suspend_security/base_suspend_security.py | 29 | 1308 | # -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | agpl-3.0 |
nthorne/xmppmote | configuration/test/test_commands.py | 1 | 7152 | #!/usr/bin/env python
#Copyright (C) 2012 Niklas Thorne.
#This file is part of XMPPMote.
#
#XMPPMote 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 la... | gpl-3.0 |
YYWen0o0/python-frame-django | django/forms/fields.py | 1 | 47569 | """
Field classes.
"""
from __future__ import unicode_literals
import copy
import datetime
import os
import re
import sys
import warnings
from decimal import Decimal, DecimalException
from io import BytesIO
from django.core import validators
from django.core.exceptions import ValidationError
from django.forms.utils ... | bsd-3-clause |
offbyone/Flexget | flexget/plugins/filter/exists_series.py | 6 | 5509 | from __future__ import unicode_literals, division, absolute_import
import logging
from path import Path
from flexget import plugin
from flexget.event import event
from flexget.config_schema import one_or_more
from flexget.utils.log import log_once
from flexget.utils.template import RenderError
from flexget.plugins.pa... | mit |
raven47git/flask | tests/test_ext.py | 149 | 5861 | # -*- coding: utf-8 -*-
"""
tests.ext
~~~~~~~~~~~~~~~~~~~
Tests the extension import thing.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import pytest
try:
from imp import reload as reload_module
except ImportError:
reload_module = r... | bsd-3-clause |
lyn1337/LinuxDSc2 | linux-2.6.x/arch/ia64/scripts/unwcheck.py | 916 | 1718 | #!/usr/bin/env python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthe... | gpl-2.0 |
finklabs/inquirer | examples/when.py | 2 | 1284 | # -*- coding: utf-8 -*-
"""
When example
"""
from __future__ import print_function, unicode_literals
from whaaaaat import style_from_dict, Token, prompt, print_json, default_style
style = style_from_dict({
Token.QuestionMark: '#FF9D00 bold',
Token.Selected: '#5F819D bold',
Token.Instruction: '', # defaul... | mit |
michelts/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/i18n/commands/tests.py | 55 | 1477 | import os
import re
from subprocess import Popen, PIPE
def find_command(cmd, path=None, pathext=None):
if path is None:
path = os.environ.get('PATH', []).split(os.pathsep)
if isinstance(path, basestring):
path = [path]
# check if there are funny path extensions for executables, e.g. Windows... | gpl-3.0 |
evidation-health/ContinuousTimeMarkovModel | examples/small_sample_example_main.py | 1 | 6795 | import numpy as np
from theano.tensor import as_tensor_variable
from ContinuousTimeMarkovModel.distributions import *
from pymc3 import Model, sample, Metropolis, Dirichlet, Potential, Binomial, Beta, Slice, NUTS
import theano.tensor as TT
from ContinuousTimeMarkovModel.samplers.forwardS import *
from ContinuousTimeMar... | mit |
Multi01/Arducopter-clone | Tools/LogAnalyzer/DataflashLog.py | 83 | 27803 | #
# Code to abstract the parsing of APM Dataflash log files, currently only used by the LogAnalyzer
#
# Initial code by Andrew Chapman (amchapman@gmail.com), 16th Jan 2014
#
from __future__ import print_function
import collections
import os
import numpy
import bisect
import sys
import ctypes
class Format(object):
... | gpl-3.0 |
dkubiak789/OpenUpgrade | addons/crm_profiling/crm_profiling.py | 40 | 10377 | # -*- 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 |
GoogleCloudPlatform/training-data-analyst | courses/ak8s/v1.0/16_Logging/query-custom-favicon-metric.py | 4 | 2473 | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
40223119/w16b_test | static/Brython3.1.3-20150514-095342/Lib/_abcoll.py | 688 | 5155 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
bootstrappin... | gpl-3.0 |
nbeck90/data_structures_2 | test_insert_sort.py | 1 | 1280 | # -*- coding: utf-8 -*-
import pytest
from insert_sort import insert_sort
def test_sorted():
my_list = list(range(100))
insert_sort(my_list)
assert my_list == list(range(100))
def test_reverse():
my_list = list(range(100))[::-1]
insert_sort(my_list)
assert my_list == list(range(100))
def t... | mit |
awkspace/ansible | lib/ansible/modules/files/archive.py | 6 | 18021 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ben Doherty <bendohmv@gmail.com>
# Sponsored by Oomph, Inc. http://www.oomphinc.com
# Copyright: (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_impor... | gpl-3.0 |
hoosteeno/mozillians | vendor-local/lib/python/tablib/packages/odf/attrconverters.py | 64 | 69451 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2010 Søren Roug, European Environment Agency
#
# This library 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 you... | bsd-3-clause |
dhanunjaya/neutron | neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py | 3 | 87886 | # Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 |
blaggacao/OpenUpgrade | addons/stock/partner.py | 375 | 1766 | # -*- 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 |
nelsonsar/ansible | lib/ansible/plugins/action/fetch.py | 28 | 7549 | # (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 |
Wyliodrin/wyliodrin-server | tests/debugging/sim_board.py | 1 | 3409 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Board
"""
import getpass
import logging
import os
import signal
import sleekxmpp
import ssl
import sys
import threading
import time
from sleekxmpp import Message, Presence
from sleekxmpp.xmlstream import ElementBase
from sleekxmpp.xmlstream import register_stanza_p... | lgpl-3.0 |
350dotorg/Django | django/contrib/gis/tests/geoapp/test_regress.py | 258 | 1500 | import os, unittest
from django.contrib.gis.tests.utils import no_mysql, no_oracle, no_postgis, no_spatialite
from django.contrib.gis.shortcuts import render_to_kmz
from models import City
class GeoRegressionTests(unittest.TestCase):
def test01_update(self):
"Testing GeoQuerySet.update(), see #10411."
... | bsd-3-clause |
JimCircadian/ansible | lib/ansible/modules/storage/purestorage/purefa_pgsnap.py | 26 | 4976 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',... | gpl-3.0 |
bratsche/Neutron-Drive | google_appengine/lib/django_1_2/django/contrib/localflavor/ro/forms.py | 273 | 6640 | # -*- coding: utf-8 -*-
"""
Romanian specific form helpers.
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError, Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
class ROCIFField(RegexField):
"""
A Romanian fiscal identity co... | bsd-3-clause |
KirillMysnik/ArcJail | srcds/addons/source-python/plugins/arcjail/modules/games/base_classes/map_game_team_based.py | 1 | 16195 | # This file is part of ArcJail.
#
# ArcJail 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.
#
# ArcJail is distributed in the hope that... | gpl-3.0 |
tlatzko/spmcluster | .tox/docs/lib/python2.7/site-packages/pygments/lexers/r.py | 72 | 23755 | # -*- coding: utf-8 -*-
"""
pygments.lexers.r
~~~~~~~~~~~~~~~~~
Lexers for the R/S languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, words, do_insertions
from ... | bsd-2-clause |
atomicobject/kinetic-c | vendor/protobuf-2.5.0/python/ez_setup.py | 454 | 10334 | #!python
# This file was obtained from:
# http://peak.telecommunity.com/dist/ez_setup.py
# on 2011/1/21.
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup... | lgpl-2.1 |
PhonologicalCorpusTools/PyAnnotationGraph | polyglotdb/io/exporters/csv.py | 3 | 1634 | import csv
def make_safe(value, delimiter):
"""
Recursively parse transcription lists into strings for saving
Parameters
----------
value : list or None
Object to make into string
delimiter : str
Character to mark boundaries between list elements
Returns
-------
... | mit |
mooseman/pdteco | test_parser.py | 1 | 1865 |
# test_parser.py
# Try a few things with creating tokens which know the
# kind of token that should follow them.
import string, itertools
class token(object):
def __init__(self):
self.type = self.next = self.stmttype = None
self.attrdict = vars(self)
# Set an attribute
# NOTE! Thi... | unlicense |
jtoppins/beaker | Client/src/bkr/client/task_watcher.py | 1 | 5411 | # -*- coding: utf-8 -*-
# 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 sys
import time
__all__ = (
"Task... | gpl-2.0 |
yamila-moreno/django | tests/admin_checks/models.py | 98 | 1724 | """
Tests of ModelAdmin system checks logic.
"""
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Album(models.Model):
title = models.CharFie... | bsd-3-clause |
chiotlune/ext | gnuradio-3.7.0.1/gr-blocks/python/blocks/qa_block_gateway.py | 10 | 8214 | #
# Copyright 2011-2013 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 your option)
# any later version... | gpl-2.0 |
MarekIgnaszak/econ-project-templates | .mywaflib/waflib/Tools/irixcc.py | 54 | 1350 | #! /usr/bin/env python
# encoding: utf-8
# imported from samba
"""
Compiler definition for irix/MIPSpro cc compiler
"""
from waflib import Errors
from waflib.Tools import ccroot, ar
from waflib.Configure import conf
@conf
def find_irixcc(conf):
v = conf.env
cc = None
if v.CC:
cc = v.CC
elif 'CC' in conf.enviro... | bsd-3-clause |
ct-23/home-assistant | homeassistant/components/switch/wake_on_lan.py | 8 | 3289 | """
Support for wake on lan.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.wake_on_lan/
"""
import logging
import platform
import subprocess as sp
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHE... | apache-2.0 |
golismero/golismero-devel | thirdparty_libs/shodan/api.py | 8 | 7427 | try:
from json import dumps, loads
except:
from simplejson import dumps, loads
try:
# Python 2
from urllib2 import urlopen
from urllib import urlencode
except:
# Python 3
from urllib.request import urlopen
from urllib.parse import urlencode
__all__ = ['WebAPI']
... | gpl-2.0 |
Lujeni/ansible | test/units/modules/network/fortios/test_fortios_router_prefix_list6.py | 21 | 7717 | # Copyright 2019 Fortinet, Inc.
#
# 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 program is distributed in the... | gpl-3.0 |
FATruden/boto | tests/integration/ec2/autoscale/__init__.py | 21 | 1099 | # Copyright (c) 2011 Reza Lotun http://reza.lotun.name
#
# 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 |
benjello/openfisca-france-indirect-taxation | openfisca_france_indirect_taxation/examples/transports/agregats_compte_transports/plot_transports_quantites.py | 4 | 2868 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 24 09:46:35 2015
@author: thomas.douenne
"""
# Ce script réalise des graphiques à partir des données des comptes des transports, i.e. nos agrégats de référence
# pour les transports : taille et composition du parc automobile, consommation des carburants, total des recett... | agpl-3.0 |
hachreak/invenio-ext | invenio_ext/sqlalchemy/engines/mysql.py | 5 | 3866 | # -*- 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 (a... | gpl-2.0 |
Sbalbp/DIRAC | RequestManagementSystem/Agent/RequestOperations/test/ForwardDISETTests.py | 19 | 2467 | ########################################################################
# $HeadURL $
# File: ForwardDISETTests.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/04/18 09:23:05
########################################################################
""" :mod: ForwardDISETTests
=======================
.... | gpl-3.0 |
catb0t/input_constrain | test/tests.py | 2 | 4034 | #!/usr/bin/env python3
import unittest
import subprocess as sp
from sys import executable as py, maxsize as MAXSIZE, version_info as VERINFO
from os import getcwd, path
TESTMOD_INFO = ("pmlr", path.join(getcwd(), "..", "pmlr", "pmlr", "__main__.py"))
TEST_HELP = path.join(getcwd(), "..", "pmlr", "test", "_tests_helpe... | gpl-3.0 |
sysadminmatmoz/OCB | addons/account/tests/test_search.py | 47 | 3999 | from openerp.addons.account.tests.account_test_users import AccountTestUsers
class TestSearch(AccountTestUsers):
"""Tests for search on name_search (account.account)
The name search on account.account is quite complexe, make sure
we have all the correct results
"""
def test_name_search(self):
... | agpl-3.0 |
huobaowangxi/scikit-learn | sklearn/metrics/tests/test_ranking.py | 75 | 40883 | from __future__ import division, print_function
import numpy as np
from itertools import product
import warnings
from scipy.sparse import csr_matrix
from sklearn import datasets
from sklearn import svm
from sklearn import ensemble
from sklearn.datasets import make_multilabel_classification
from sklearn.random_projec... | bsd-3-clause |
badpass/ansible-modules-core | source_control/git.py | 47 | 30762 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... | gpl-3.0 |
poiati/django | django/core/serializers/xml_serializer.py | 184 | 15662 | """
XML serializer.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from xml.dom import pulldom
from xml.sax import handler
from xml.sax.expatreader import ExpatParser as _ExpatParser
from django.apps import apps
from django.conf import settings
from django.core.serializers import bas... | bsd-3-clause |
mrquim/mrquimrepo | repo/script.module.youtube.dl/lib/youtube_dl/extractor/audimedia.py | 67 | 3924 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
sanitized_Request,
)
class AudiMediaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?audi-mediacenter\.com/(?:en|de)/audimediatv/(?P<id>[^/?#]+)'
_TEST =... | gpl-2.0 |
zimmermanncode/ganymede | ganymede/__init__.py | 2 | 2851 | # ganymede
#
# Hacking Jupyter's atmosphere
#
# Copyright (C) 2015 Stefan Zimmermann <zimmermann.code@gmail.com>
#
# ganymede 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... | gpl-3.0 |
bjorncooley/rainforest_makers | spirit/utils/forms.py | 2 | 1756 | #-*- coding: utf-8 -*-
from django import forms
from django.utils.html import conditional_escape, mark_safe
from django.utils.encoding import smart_text
class NestedModelChoiceField(forms.ModelChoiceField):
"""A ModelChoiceField that groups parents and childrens"""
# TODO: subclass ModelChoiceIterator, remov... | mit |
Superjom/models-1 | generate_sequence_by_rnn_lm/network_conf.py | 4 | 1897 | import paddle.v2 as paddle
def rnn_lm(vocab_dim,
emb_dim,
hidden_size,
stacked_rnn_num,
rnn_type="lstm",
is_infer=False):
"""
RNN language model definition.
:param vocab_dim: size of vocabulary.
:type vocab_dim: int
:param emb_dim: dimension ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.