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 |
|---|---|---|---|---|---|
shikhar413/openmc | tests/regression_tests/filter_energyfun/test.py | 8 | 1854 | import openmc
import pytest
from tests.testing_harness import PyAPITestHarness
@pytest.fixture
def model():
model = openmc.model.Model()
m = openmc.Material()
m.set_density('g/cm3', 10.0)
m.add_nuclide('Am241', 1.0)
model.materials.append(m)
s = openmc.Sphere(r=100.0, boundary_type='vacuum'... | mit |
drbild/boto | boto/sdb/db/property.py | 153 | 25086 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy,... | mit |
goroboro/TVHeadFish | qml/pages/helper/tsreader.py | 7 | 4957 | from dvb_charset_tables import conv_8859_table
def str2hex ( s, n = None ):
r = ''
i = 0
for c in s:
r = r + ('%02X ' % ord(c))
i = i + 1
if n is not None and i % n == 0:
r = r + '\n'
return r
def dvb_convert_date ( data ):
return 0
convert_iso_8859 = [
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9... | apache-2.0 |
shashank971/edx-platform | openedx/core/djangoapps/course_groups/partition_scheme.py | 105 | 4510 | """
Provides a UserPartition driver for cohorts.
"""
import logging
from courseware.masquerade import ( # pylint: disable=import-error
get_course_masquerade,
get_masquerading_group_info,
is_masquerading_as_specific_student,
)
from xmodule.partitions.partitions import NoSuchUserPartitionGroupError
from .c... | agpl-3.0 |
pcm17/tensorflow | tensorflow/contrib/distributions/python/ops/inverse_gamma.py | 1 | 10539 | # 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 |
larrybradley/astropy | astropy/modeling/tests/test_models.py | 4 | 29753 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for model evaluation.
Compare the results of some models with other programs.
"""
# pylint: disable=invalid-name, no-member
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from astropy import units as u... | bsd-3-clause |
WorldViews/Spirals | YEI/foo_api.py | 1 | 146347 | #!/usr/bin/env python2.7
from __future__ import print_function
""" This module is an API module for ThreeSpace devices.
The ThreeSpace API module is a collection of classes, functions, structures,
and static variables use exclusivly for ThreeSpace devices. This module can
be used with a system running... | mit |
eckhart/himlar | profile/files/openstack/horizon/overrides.py | 1 | 1079 | # Disable Floating IPs
from openstack_dashboard.dashboards.project.access_and_security import tabs
from openstack_dashboard.dashboards.project.instances import tables
import horizon
NO = lambda *x: False
tabs.FloatingIPsTab.allowed = NO
tabs.APIAccessTab.allowed = NO
tables.AssociateIP.allowed = NO
tables.SimpleAssoc... | apache-2.0 |
chuan9/chromium-crosswalk | ui/base/ime/chromeos/generate_character_composer_data.py | 45 | 13558 | #!/usr/bin/env python
# Copyright 2015 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.
"""Generate a compact character composition table.
Normal use:
./generate_character_composer_data.py \
--output character_comp... | bsd-3-clause |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/django/contrib/auth/hashers.py | 78 | 17327 | from __future__ import unicode_literals
import base64
import binascii
import hashlib
import importlib
from collections import OrderedDict
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.signals import setting_changed
from django.dispatch import receiver
from d... | bsd-3-clause |
gdm/aws-cfn-resource-bridge | aws/cfn/bridge/processes.py | 4 | 2596 | #==============================================================================
# Copyright 2013 Amazon.com, Inc. or its affiliates. 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 ... | apache-2.0 |
lioncui/pybix | client/plugin/RedisPlugin.py | 1 | 3753 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from lib import pybixlib
import traceback
from p_class import plugins
import redis
class RedisPlugin(plugins.plugin):
def __init__(self, uuid, taskConf, agentType):
plugins.plugin.__init__(
self, uuid, taskConf, agentType)
def data_format_MB(sel... | gpl-3.0 |
kobejean/tensorflow | tensorflow/python/keras/applications/applications_test.py | 16 | 1932 | # 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 |
goodhanrry/updaten_915s_to_lollipop | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
kernsuite-debian/lofar | SAS/ResourceAssignment/ResourceAssignmentEditor/lib/webservice.py | 1 | 39598 | #!/usr/bin/env python3
# Copyright (C) 2012-2015 ASTRON (Netherlands Institute for Radio Astronomy)
# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU Gen... | gpl-3.0 |
ryfeus/lambda-packs | Tensorflow/source/tensorflow/contrib/kernel_methods/python/losses.py | 31 | 5600 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mit |
caesar2164/edx-platform | lms/djangoapps/instructor_task/api.py | 11 | 20895 | """
API for submitting background tasks by an instructor for a course.
Also includes methods for getting information about tasks that have
already been submitted, filtered either by running state or input
arguments.
"""
from collections import Counter
import hashlib
from celery.states import READY_STATES
from xmodu... | agpl-3.0 |
ambitioninc/django-query-builder | querybuilder/tests/models.py | 2 | 1679 | try:
from django.db.models import JSONField
except ImportError:
try:
from django.contrib.postgres.fields import JSONField
except ImportError:
from jsonfield import JSONField
from django.db import models
class User(models.Model):
"""
User model
"""
email = models.CharField(m... | mit |
pytroll/mpop | mpop/satin/nwcsaf_msg.py | 2 | 115697 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010, 2012, 2014.
# SMHI,
# Folkborgsvägen 1,
# Norrköping,
# Sweden
# Author(s):
# Martin Raspaud <martin.raspaud@smhi.se>
# Marco Sassi <marco.sassi@meteoswiss.ch> for CRR, PC (partly), SPhR, PCPh, CRPh
# Jörg Asmus <joerg.asmus@dwd.de> for CRR, P... | gpl-3.0 |
Cito/sqlalchemy | lib/sqlalchemy/connectors/pyodbc.py | 80 | 5896 | # connectors/pyodbc.py
# Copyright (C) 2005-2014 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 Connector
from .. import util
import sys
import re
class PyODBC... | mit |
vjpai/grpc | test/cpp/qps/qps_json_driver_scenario_gen.py | 5 | 2296 | #!/usr/bin/env python2.7
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
kawamon/hue | desktop/core/ext-py/lxml-3.3.6/src/lxml/tests/test_htmlparser.py | 16 | 18693 | # -*- coding: utf-8 -*-
"""
HTML parser test cases for etree
"""
import unittest
import tempfile, os, os.path, sys
this_dir = os.path.dirname(__file__)
if this_dir not in sys.path:
sys.path.insert(0, this_dir) # needed for Py3
from common_imports import etree, StringIO, BytesIO, fileInTestDir, _bytes, _str
from... | apache-2.0 |
codepantry/django | tests/multiple_database/tests.py | 107 | 93762 | from __future__ import unicode_literals
import datetime
import pickle
import warnings
from operator import attrgetter
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core import management
from django.db import DEFAULT_DB_ALIAS, connections, router, t... | bsd-3-clause |
elioth010/lugama | venv/lib/python2.7/site-packages/sqlalchemy/util/queue.py | 55 | 6548 | # util/queue.py
# Copyright (C) 2005-2016 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
"""An adaptation of Py2.3/2.4's Queue module which supports reentrant
behavior, using ... | gpl-2.0 |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Tools/pybench/Exceptions.py | 92 | 13400 | from pybench import Test
class TryRaiseExcept(Test):
version = 2.0
operations = 2 + 3 + 3
rounds = 80000
def test(self):
error = ValueError
for i in range(self.rounds):
try:
raise error
except:
pass
try:
... | apache-2.0 |
mmarch/azure-quickstart-templates | cloudera-tableau/scripts/cmxDeployOnIbiza.py | 140 | 88056 | #!/usr/bin/env python
#
__version__ = '0.11.2803'
import socket
import re
import urllib
import urllib2
from optparse import OptionParser
import hashlib
import os
import sys
import random
import paramiko
from paramiko import SSHClient
from time import sleep
from cm_api.api_client import ApiResource, ApiException
fro... | mit |
benoitsteiner/tensorflow | tensorflow/contrib/slim/python/slim/nets/resnet_v1_test.py | 49 | 18431 | # 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 |
berth64/modded_modded_1257ad | source/header_operations.py | 1 | 319871 | # -*- coding: utf-8 -*-
################################################################################
# header_operations expanded v.1.0.1 #
################################################################################
# TABLE OF CONTENTS
############################... | agpl-3.0 |
BPI-SINOVOIP/BPI-Mainline-kernel | linux-5.4/scripts/gdb/linux/timerlist.py | 520 | 7731 | # SPDX-License-Identifier: GPL-2.0
#
# Copyright 2019 Google LLC.
import binascii
import gdb
from linux import constants
from linux import cpus
from linux import rbtree
from linux import utils
timerqueue_node_type = utils.CachedType("struct timerqueue_node").get_type()
hrtimer_type = utils.CachedType("struct hrtimer... | gpl-2.0 |
sgraham/nope | third_party/webpagereplay/servermanager.py | 5 | 4782 | #!/usr/bin/env python
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | bsd-3-clause |
prampey/servo | tests/wpt/web-platform-tests/tools/wptserve/docs/conf.py | 467 | 7855 | # -*- coding: utf-8 -*-
#
# wptserve documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 14 17:23:24 2013.
#
# 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.
#
# Al... | mpl-2.0 |
ajylee/gpaw-rtxs | gpaw/coding_style.py | 3 | 3198 | # Copyright (C) 2008 CAMd
# Please see the accompanying LICENSE file for further information.
"""This module is an example of good coding style.
This docstring should begin with a one-line description followed by a
blank line, and then this paragraph describing in more word what kind
of functionality this module imp... | gpl-3.0 |
SebDieBln/QGIS | python/ext-libs/nose2/tests/unit/test_failfast.py | 16 | 1681 | from nose2.tests._common import TestCase
from nose2.plugins import failfast
from nose2 import result, session
from nose2.compat import unittest
class TestFailFast(TestCase):
tags = ['unit']
def setUp(self):
self.session = session.Session()
self.result = result.PluggableTestResult(self.session... | gpl-2.0 |
georgepar/rosdep | test/test_rosdep_arch.py | 5 | 2807 | # Copyright (c) 2011, Willow Garage, 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 co... | bsd-3-clause |
2014c2g9/c2g9 | wsgi/static/Brython2.1.0-20140419-113919/Lib/xml/dom/minicompat.py | 781 | 3228 | """Python version compatibility support for minidom."""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# NodeList -- lightest possible NodeList implementation
#
# EmptyNodeList -- lightest possible NodeList that is guaranteed to
# remain empty... | gpl-2.0 |
frreiss/tensorflow-fred | tensorflow/python/data/experimental/kernel_tests/optimize_dataset_test.py | 1 | 18438 | # 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 |
trishnaguha/ansible | lib/ansible/modules/storage/netapp/netapp_e_snapshot_images.py | 31 | 8776 | #!/usr/bin/python
# (c) 2016, NetApp, 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',
'status': ['preview'],
... | gpl-3.0 |
BobBuildTool/bob | pym/bob/scm/scm.py | 2 | 13149 | # Bob build tool
# Copyright (C) 2017 Jan Klötzke
#
# SPDX-License-Identifier: GPL-3.0-or-later
from ..errors import ParseError
from ..utils import joinLines
from abc import ABCMeta, abstractmethod
from enum import Enum
from shlex import quote
import fnmatch
import re
SYNTHETIC_SCM_PROPS = frozenset(('__source', 're... | gpl-3.0 |
osvalr/odoo | addons/account_bank_statement_extensions/__openerp__.py | 378 | 2357 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it u... | agpl-3.0 |
ulodciv/cluster_deployer | src/pgha_deployer.py | 2 | 6541 | import logging
import json
from argparse import ArgumentParser
from datetime import timedelta
from functools import partial
from ipaddress import IPv4Interface, ip_interface, IPv4Address
from pathlib import PurePosixPath, Path
from time import time
from deployerlib.cluster import Cluster
from deployerlib.ha ... | mit |
FreekingDean/home-assistant | homeassistant/components/binary_sensor/trend.py | 9 | 4571 | """
A sensor that monitors trands in other components.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.trend/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback
import homeassistant.helpers.config_va... | mit |
pyfa-org/eos | tests/integration/stats/slot/test_launcher.py | 1 | 5726 | # ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | lgpl-3.0 |
xasos/crowdsource-platform | crowdsourcing/serializers/message.py | 10 | 2784 | from crowdsourcing import models
from datetime import datetime
from rest_framework import serializers
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from crowdsourcing.serializers.dynamic import DynamicFieldsModelSerializer
from rest_framework.exceptions import Validat... | mit |
Theer108/invenio | invenio/modules/deposit/fields/notes.py | 15 | 1283 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 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 optio... | gpl-2.0 |
lillian-lemmer/hypatia | hypatia/resources.py | 3 | 8680 | # This module is part of Hypatia and is released under the
# MIT license: http://opensource.org/licenses/MIT
"""These are utilities which are commonly utilized
by all modules in Hypatia. It serves for the ugly,
underlying components of miscellaneous actions which
assist other modules, and does not do much on its own.
... | mit |
moschlar/SAUCE | migration/versions/530b45f11128_public_submission.py | 1 | 1291 | """public_submission
Revision ID: 530b45f11128
Revises: 282efa88cdbc
Create Date: 2013-10-02 18:31:40.722832
"""
#
# # SAUCE - System for AUtomated Code Evaluation
# # Copyright (C) 2013 Moritz Schlarb
# #
# # This program is free software: you can redistribute it and/or modify
# # it under the terms of the GNU Affer... | agpl-3.0 |
40223143/cda-w15 | static/Brython3.1.3-20150514-095342/Lib/tarfile.py | 728 | 88474 | #!/usr/bin/env python3
#-------------------------------------------------------------------
# tarfile.py
#-------------------------------------------------------------------
# Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de>
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any pers... | agpl-3.0 |
AustereCuriosity/astropy | astropy/units/format/vounit.py | 2 | 8246 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles the "VOUnit" unit format.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ...extern import six
from ...extern.six.moves import zip
import copy
import keyword
import operato... | bsd-3-clause |
DSLituiev/scikit-learn | sklearn/gaussian_process/tests/test_gaussian_process.py | 267 | 6813 | """
Testing for Gaussian Process module (sklearn.gaussian_process)
"""
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# Licence: BSD 3 clause
from nose.tools import raises
from nose.tools import assert_true
import numpy as np
from sklearn.gaussian_process import GaussianProcess
from sklearn.gaussian_process ... | bsd-3-clause |
moyogo/mutatormath | Lib/mutatorMath/test/ufo/test.py | 2 | 20386 | # -*- coding: utf-8 -*-
from __future__ import print_function
"""
These are tests for writing and processing designspace.designspace documents
- write various designspaces
- read them
- process them using the test fonts
- show masters can be read from different directories
... | bsd-3-clause |
AloneRoad/Inforlearn | vendor/gdata/tlslite/integration/TLSSocketServerMixIn.py | 320 | 2203 | """TLS Lite + SocketServer."""
from gdata.tlslite.TLSConnection import TLSConnection
class TLSSocketServerMixIn:
"""
This class can be mixed in with any L{SocketServer.TCPServer} to
add TLS support.
To use this class, define a new class that inherits from it and
some L{SocketServer.TCPServer} (wi... | apache-2.0 |
mkrautz/gyp-libmumble | pylib/gyp/generator/xcode.py | 126 | 54475 | # 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 filecmp
import gyp.common
import gyp.xcodeproj_file
import errno
import os
import sys
import posixpath
import re
import shutil
import subprocess
import temp... | bsd-3-clause |
fowode/pychess | lib/pychess/Utils/lutils/ldraw.py | 22 | 2455 | from __future__ import absolute_import
from .ldata import BLACK_SQUARES
from pychess.Utils.const import *
def testFifty (board):
if board.fifty >= 100:
return True
return False
drawSet = set((
(0, 0, 0, 0, 0, 0, 0, 0), #KK
(0, 1, 0, 0, 0, 0, 0, 0), #KBK
(1, 0, 0, 0, 0, 0, 0, 0), #KNK... | gpl-3.0 |
glovebx/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py | 293 | 3815 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
andeplane/lammps | python/examples/matplotlib_plot.py | 22 | 2270 | #!/usr/bin/env python -i
# preceding line should have path for Python on your machine
# matplotlib_plot.py
# Purpose: plot Temp of running LAMMPS simulation via matplotlib
# Syntax: plot.py in.lammps Nfreq Nsteps compute-ID
# in.lammps = LAMMPS input script
# Nfreq = plot data point every this many ... | gpl-2.0 |
felipesanches/linux-media | tools/perf/scripts/python/check-perf-trace.py | 1997 | 2539 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
dmitry-sobolev/ansible | lib/ansible/modules/network/nxos/_nxos_template.py | 67 | 5984 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
diogoosorio/blog | src/blog_app/blog_app.py | 1 | 2792 | import uuid
import re
from flask import Flask, redirect, render_template, g, abort, request, make_response
from flask_ink.ink import Ink
from flask_caching import Cache
from .settings import SETTINGS, CACHE_SETTINGS
from .repository import LocalRepository
from .parsers import BlogParser
from .pagination import BlogPa... | mit |
Belgabor/django | tests/regressiontests/generic_inline_admin/tests.py | 14 | 13276 | # coding: utf-8
from django.test import TestCase
from django.conf import settings
from django.contrib.contenttypes.generic import generic_inlineformset_factory
# local test models
from models import Episode, EpisodeExtra, EpisodeMaxNum, EpisodeExclude, \
Media, EpisodePermanent, MediaPermanentInlin... | bsd-3-clause |
anurag03/integration_tests | cfme/configure/access_control/__init__.py | 1 | 58461 | import attr
import six
from navmazing import NavigateToSibling, NavigateToAttribute
from widgetastic.widget import Checkbox, View, Text, ConditionalSwitchableView
from widgetastic_patternfly import (
BootstrapSelect, Button, Input, Tab, CheckableBootstrapTreeview as CbTree,
BootstrapSwitch, CandidateNotFound, ... | gpl-2.0 |
korrosivesec/crits | crits/core/management/commands/create_locations.py | 26 | 2050 | import json
import os
from django.conf import settings
from django.core.management.base import BaseCommand
from crits.locations.location import Location
class Command(BaseCommand):
"""
Script Class.
"""
help = 'Creates location objects in MongoDB.'
def handle(self, *args, **optio... | mit |
YinongLong/scikit-learn | examples/missing_values.py | 71 | 3055 | """
======================================================
Imputing missing values before building an estimator
======================================================
This example shows that imputing the missing values can give better results
than discarding the samples containing any missing value.
Imputing does not ... | bsd-3-clause |
shastah/spacewalk | backend/server/action/utils.py | 10 | 11613 | #
# Copyright (c) 2008--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
albertjan/pypyjs | website/js/pypy.js-0.2.0/lib/modules/rexec.py | 228 | 20148 | """Restricted execution facilities.
The class RExec exports methods r_exec(), r_eval(), r_execfile(), and
r_import(), which correspond roughly to the built-in operations
exec, eval(), execfile() and import, but executing the code in an
environment that only exposes those built-in operations that are
deemed safe. To t... | mit |
uksf/modpack | tools/build.py | 1 | 3612 | #!/usr/bin/env python3
import os
import sys
import subprocess
######## GLOBALS #########
MAINPREFIX = "u"
PREFIX = "uksf_"
##########################
def tryHemttBuild(projectpath):
hemttExe = os.path.join(projectpath, "hemtt.exe")
if os.path.isfile(hemttExe):
os.chdir(projectpath)
ret = subp... | gpl-3.0 |
yeldartoktasynov/app-landing-page | vendor/bundle/ruby/2.2.0/gems/pygments.rb-0.6.3/vendor/pygments-main/tests/test_lexers_other.py | 29 | 2305 | # -*- coding: utf-8 -*-
"""
Tests for other lexers
~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import glob
import os
import unittest
from pygments.lexers import guess_lexer
from pygments.lexers.other import Rexx... | mit |
jacobgilroy/FinalYearProject | MainView.py | 1 | 2934 | from PyQt5.QtWidgets import QWidget, QSplitter, QVBoxLayout, QFrame, QFileDialog, QScrollArea, QMenuBar, QAction, QToolBar
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon
from JamSpace.Views.LaneSpaceView import LaneSpaceView
from JamSpace.Views.ControlBar import ControlBar
class MainView(QWidget):
... | gpl-3.0 |
blckshrk/Weboob | weboob/capabilities/cinema.py | 4 | 5307 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | agpl-3.0 |
BigEgg/LeetCode | Python/LeetCode.Test/_051_100/Test_068_TextJustification.py | 1 | 1357 | import unittest
import sys
sys.path.append('LeetCode/_051_100')
sys.path.append('LeetCode.Test')
from _068_TextJustification import Solution
import AssertHelper
class Test_068_TextJustification(unittest.TestCase):
def test_fullJustify_1(self):
solution = Solution()
result = solution.fullJustify([... | mit |
foss-transportationmodeling/rettina-server | flask/local/lib/python2.7/encodings/big5hkscs.py | 816 | 1039 | #
# big5hkscs.py: Python Unicode Codec for BIG5HKSCS
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_hk, codecs
import _multibytecodec as mbc
codec = _codecs_hk.getcodec('big5hkscs')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.Multib... | apache-2.0 |
kevingu1003/python-pptx | tests/test_shared.py | 5 | 2584 | # encoding: utf-8
"""
Test suite for the docx.shared module
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import pytest
from pptx.opc.package import XmlPart
from pptx.shared import ElementProxy, ParentedElementProxy
from .unitutil.cxml import element
from .unitutil.... | mit |
heromod/migrid | mig/cgi-bin/find.py | 1 | 1096 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# find - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the terms of the ... | gpl-2.0 |
quanvm009/codev7 | openerp/addons/auth_ldap/__openerp__.py | 108 | 4839 | ##############################################################################
#
# 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 |
evanbiederstedt/CMBintheLikeHoodz | source_code/CAMB_vary_OmegaB_lmax1100_Feb2016.py | 1 | 137613 |
# coding: utf-8
# In[1]:
#
#
# hundred_samples = np.linspace(0.05, 0.5, num=100)
#
# Planck found \Omega_CDM
# GAVO simulated map set at \Omega_CDM = 0.122
# CAMB default below at omch2=0.122
#
# In[2]:
#
# First output 200 CAMB scalar outputs
#
# 0.005 to 0.05
#
# In[3]:
from matplotlib import pyplot as plt
... | mit |
pratikmallya/hue | desktop/core/ext-py/boto-2.38.0/boto/mashups/interactive.py | 148 | 2783 | # Copyright (C) 2003-2007 Robey Pointer <robey@lag.net>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your op... | apache-2.0 |
anish/buildbot | master/buildbot/reporters/gerrit_verify_status.py | 1 | 8571 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
novafloss/jenkins-github-poller | jenkins_epo/rest.py | 2 | 3207 | # This file is part of jenkins-epo
#
# jenkins-epo 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 any later version.
#
# jenkins-epo is distributed in the hope that it will... | gpl-3.0 |
tfmoraes/invesalius3 | invesalius/gui/widgets/slice_menu.py | 4 | 11800 | # -*- coding: UTF-8 -*-
#--------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.go... | gpl-2.0 |
hanxi/cocos2d-x-v3.1 | frameworks/cocos2d-x/tools/tolua/genbindings.py | 1 | 5253 | #!/usr/bin/python
# This script is used to generate luabinding glue codes.
# Android ndk version must be ndk-r9b.
import sys
import os, os.path
import shutil
import ConfigParser
import subprocess
import re
from contextlib import contextmanager
def _check_ndk_root_env():
''' Checking the environment NDK_ROOT, w... | mit |
gooftroop/Zeus | contrib/sqlalchemy/dialects/sqlite/base.py | 45 | 54601 | # sqlite/base.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sqlite
:name: SQLite
.. _sqlite_datetime:
Date and Time Types
... | mit |
lixiangning888/whole_project | modules/signatures_orginal_20151110/dyre_apis.py | 1 | 6073 | # Copyright (C) 2015 Optiv, Inc. (brad.spengler@optiv.com), KillerInstinct
#
# 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 vers... | lgpl-3.0 |
cdrttn/samba-regedit | lib/ntdb/test/python-api.py | 7 | 4389 | #!/usr/bin/env python
# Some simple tests for the Python bindings for TDB
# Note that this tests the interface of the Python bindings
# It does not test tdb itself.
#
# Copyright (C) 2007-2013 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU LGPLv3 or later
import ntdb
from unittest import TestCase
import ... | gpl-3.0 |
junmin-zhu/chromium-rivertrail | third_party/closure_linter/closure_linter/requireprovidesorter.py | 137 | 9826 | #!/usr/bin/env python
#
# Copyright 2011 The Closure Linter Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | bsd-3-clause |
dmccue/ansible | v1/ansible/inventory/host.py | 132 | 2084 | # (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 |
mcanthony/nupic | src/nupic/datafiles/extra/secondOrder/makeDataset.py | 34 | 18958 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | agpl-3.0 |
Nic30/hwtLib | hwtLib/tests/all.py | 1 | 22364 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from unittest import TestLoader, TextTestRunner, TestSuite
from hwt.simulator.simTestCase import SimTestCase
from hwtLib.abstract.busEndpoint_test import BusEndpointTC
from hwtLib.abstract.frame_utils.alignment_utils_test import FrameAlignmentUtilsTC
from hwtL... | mit |
alexlo03/ansible | test/units/modules/network/f5/test_bigip_gtm_global.py | 8 | 4025 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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
import os
import json
import pytest
import sys
from nose.plugins.skip i... | gpl-3.0 |
zeraien/comcon | ampcon/ampcon.py | 1 | 1866 | import yaml
import os
from flask import Flask, render_template, jsonify, request
from amplifier import Amplifier, SOURCES
app = Flask(__name__)
with open(os.path.join(os.path.dirname(__file__),"config.yaml")) as f:
config = yaml.load(f)
amplifier_obj = Amplifier(serial_port=config["serial_port"], logger=app.logger)
... | gpl-2.0 |
linostar/timeline-clone | test/specs/utils.py | 1 | 17794 | # Copyright (C) 2009, 2010, 2011 Rickard Lindberg, Roger Lindberg
#
# This file is part of Timeline.
#
# Timeline 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... | gpl-3.0 |
ESSolutions/ESSArch_Core | ESSArch_Core/WorkflowEngine/__init__.py | 1 | 1392 | """
ESSArch is an open source archiving and digital preservation system
ESSArch
Copyright (C) 2005-2019 ES Solutions AB
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... | gpl-3.0 |
karlito40/servo | components/script/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py | 106 | 3835 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestNullableEquivalency1 {
attribute long a;
attribute long? b;
};
interface TestNullableEquivalency2 {
attribute ArrayBuffer a;
attribute ArrayBuffer? b;
};
... | mpl-2.0 |
pdellaert/ansible | lib/ansible/plugins/action/package.py | 36 | 3474 | # (c) 2015, Ansible Inc,
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is di... | gpl-3.0 |
chokribr/invenioold | modules/websession/lib/inveniogc.py | 9 | 30780 | ## -*- mode: python; coding: utf-8; -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2010, 2011, 2012 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 ... | gpl-2.0 |
mwmuni/LIGGGHTS_GUI | networkx/algorithms/centrality/current_flow_closeness.py | 54 | 3615 | """Current-flow closeness centrality measures.
"""
# Copyright (C) 2010-2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.algorithms.centrality.flow_matrix import *
__au... | gpl-3.0 |
eli-b/mongoengine | tests/test_datastructures.py | 23 | 3606 | import unittest
from mongoengine.base.datastructures import StrictDict, SemiStrictDict
class TestStrictDict(unittest.TestCase):
def strict_dict_class(self, *args, **kwargs):
return StrictDict.create(*args, **kwargs)
def setUp(self):
self.dtype = self.strict_dict_class(("a", "b", "c"))
d... | mit |
lafranceinsoumise/api-django | agir/people/management/commands/mailtrain_update.py | 1 | 1382 | from datetime import datetime
import string
from uuid import UUID
from django.core.management import BaseCommand
from django.utils import timezone
from agir.lib.mailtrain import update_person
from agir.people.models import Person
PADDING = "0000000-0000-0000-0000-000000000000"
class Command(BaseCommand):
help ... | agpl-3.0 |
DayGitH/Python-Challenges | DailyProgrammer/DP20140625B.py | 1 | 4512 | """
[6/25/2014] Challenge #168 [Intermediate] Block Count, Length & Area
https://www.reddit.com/r/dailyprogrammer/comments/291x9h/6252014_challenge_168_intermediate_block_count/
#Description:
In construction there comes a need to compute the length and area of a jobsite. The areas and lengths computed are used
by est... | mit |
newemailjdm/pybrain | pybrain/rl/environments/classic/mountaincar.py | 26 | 3378 | __author__ = 'Tom Schaul, tom@idsia.ch'
"""
Adaptation of the MountainCar Environment
from the "FAReinforcement" library
of Jose Antonio Martin H. (version 1.0).
"""
from scipy import array, cos
from pybrain.rl.environments.episodic import EpisodicTask
class MountainCar(EpisodicTask):
# The current real va... | bsd-3-clause |
kxliugang/edx-platform | common/test/acceptance/pages/studio/video/video.py | 45 | 22324 | """
CMS Video
"""
import time
import os
import requests
from bok_choy.promise import EmptyPromise, Promise
from bok_choy.javascript import wait_for_js, js_defined
from ....tests.helpers import YouTubeStubConfig
from ...lms.video.video import VideoPage
from ...common.utils import wait_for_notification
from selenium.webd... | agpl-3.0 |
tiborsimko/invenio-ext | invenio_ext/logging/backends/fs.py | 5 | 2497 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 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 your option) any... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.