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 |
|---|---|---|---|---|---|
pandegroup/osprey | osprey/tests/test_strategies.py | 2 | 3998 | from __future__ import print_function, absolute_import, division
import sys
from six import iteritems
import numpy as np
from numpy.testing.decorators import skipif
from osprey.search_space import SearchSpace
from osprey.search_space import IntVariable, EnumVariable, FloatVariable
from osprey.strategies import Random... | apache-2.0 |
r-o-b-b-i-e/pootle | tests/commands/pootle_runner.py | 3 | 1506 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from subprocess import call
import pytest
... | gpl-3.0 |
Yaribz/SPADS | plugins/templates/commented/myconfigurableplugin.py | 1 | 1698 | # Import the perl module so we can call the SPADS Plugin API
import perl
# perl.MyConfigurablePlugin is the Perl representation of the MyConfigurablePlugin plugin module
# We will use this object to call the plugin API
spads=perl.MyConfigurablePlugin
# This is the first version of the plugin
pluginVersion='0.1'
# T... | gpl-3.0 |
natetrue/ReplicatorG | skein_engines/skeinforge-31/fabmetheus_utilities/svg_writer.py | 2 | 10274 | """
Svg_writer is a class and collection of utilities to read from and write to an svg file.
Svg_writer uses the layer_template.svg file in the templates folder in the same folder as svg_writer, to output an svg file.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to wo... | gpl-2.0 |
thomasvincent/utilities | NagiosPlugins/check_procs/pexpect/examples/bd_serv.py | 16 | 10268 | #!/usr/bin/env python
"""Back door shell server
This exposes an shell terminal on a socket.
--hostname : sets the remote host name to open an ssh connection to.
--username : sets the user name to login with
--password : (optional) sets the password to login with
--port : set the local port for th... | apache-2.0 |
hpbader42/Klampt | Python/klampt/vis/glinterface.py | 1 | 2832 |
class GLPluginInterface:
"""Users can add their own hooks into the visualizer by overloading this
class's methods. Each method should return True if the user event was
processed. A return value of True stops cascading
events to a parent interface."""
def __init__(self):
self.window = None... | bsd-3-clause |
jasonseminara/OpenSourceFinal | myvenv/lib/python3.5/site-packages/pip/_vendor/packaging/_structures.py | 906 | 1809 | # Copyright 2014 Donald Stufft
#
# 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... | mit |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_1_0/ip_routed_neighbor_broker.py | 17 | 41203 | from ..broker import Broker
class IpRoutedNeighborBroker(Broker):
controller = "ip_routed_neighbors"
def show(self, **kwargs):
"""Shows the details for the specified ip routed neighbor.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
... | apache-2.0 |
domesticduck/MenuConciergeServer | vendor/bundle/ruby/2.0.0/gems/libv8-3.16.14.3/vendor/v8/test/sputnik/testcfg.py | 11 | 4083 | # Copyright 2009 the V8 project authors. 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 conditi... | apache-2.0 |
wasit7/labeller | lib/werkzeug/testsuite/contrib/sessions.py | 146 | 2325 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.sessions
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Added tests for the sessions.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import unittest
import shutil
from tempfile import mkdtemp, gettempdir
from werkzeug... | gpl-2.0 |
ismailsunni/healthsites | django_project/core/settings/prod.py | 1 | 2660 | # -*- coding: utf-8 -*-
from .project import * # noqa
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['*']
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
... | bsd-2-clause |
auduny/home-assistant | tests/components/mqtt_json/test_device_tracker.py | 6 | 6255 | """The tests for the JSON MQTT device tracker platform."""
import json
from asynctest import patch
import logging
import os
import pytest
from homeassistant.setup import async_setup_component
from homeassistant.components import device_tracker
from homeassistant.const import CONF_PLATFORM
from tests.common import asy... | apache-2.0 |
blighj/django | tests/forms_tests/field_tests/test_multiplechoicefield.py | 28 | 3478 | from django.forms import MultipleChoiceField, ValidationError
from django.test import SimpleTestCase
class MultipleChoiceFieldTest(SimpleTestCase):
def test_multiplechoicefield_1(self):
f = MultipleChoiceField(choices=[('1', 'One'), ('2', 'Two')])
with self.assertRaisesMessage(ValidationError, "'... | bsd-3-clause |
wwj718/edx-platform | common/lib/xmodule/xmodule/modulestore/search.py | 52 | 5832 | ''' useful functions for finding content and its position '''
from logging import getLogger
from .exceptions import (ItemNotFoundError, NoPathToItem)
LOGGER = getLogger(__name__)
def path_to_location(modulestore, usage_key, full_path=False):
'''
Try to find a course_id/chapter/section[/position] path to loc... | agpl-3.0 |
tecan/xchat-rt | plugins/scripts/Supybot-0.83.4.1-bitcoinotc-bot/src/shlex.py | 14 | 8159 | """A lexical analyzer class for simple shell-like syntaxes."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
# Input stacking and error message cleanup added by ESR, March 2000
# push_source() and pop_source() made explicit by ESR, January 2001.
import os.path
import sys
__all__ = ["shlex"]
class shlex... | gpl-2.0 |
ruffsl/ros_buildfarm | scripts/status/build_blocked_releases_page.py | 2 | 1506 | #!/usr/bin/env python3
# Copyright 2016 Open Source Robotics Foundation, 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 re... | apache-2.0 |
armpc/repo | subcmds/manifest.py | 15 | 2306 | #
# Copyright (C) 2009 The Android Open Source Project
#
# 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 la... | apache-2.0 |
0-wiz-0/audacity | lib-src/lv2/suil/waflib/Tools/suncxx.py | 196 | 1487 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os
from waflib import Utils
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_sxx(conf):
v=conf.env
cc=None
if v['CXX']:cc=v['CXX']... | gpl-2.0 |
pwil3058/pysm_wsm | scm/scm_events.py | 1 | 1384 | ### -*- coding: utf-8 -*-
###
### Copyright (C) 2016 Peter Williams <pwil3058@gmail.com>
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; version 2 of the License only.
###
### This pr... | gpl-2.0 |
ixdy/kubernetes-test-infra | gubernator/github/models.py | 16 | 7755 | # Copyright 2016 The Kubernetes 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 law or agreed to ... | apache-2.0 |
MridulS/sympy | sympy/matrices/expressions/matexpr.py | 14 | 12894 | from __future__ import print_function, division
from functools import wraps
from sympy.core import S, Symbol, sympify, Tuple, Integer, Basic, Expr
from sympy.core.decorators import call_highest_priority
from sympy.core.sympify import SympifyError, sympify
from sympy.functions import conjugate, adjoint
from sympy.matr... | bsd-3-clause |
LaboratoireMecaniqueLille/crappy | crappy/tool/GUI_Arduino/frame_objects.py | 1 | 6752 | # coding: utf-8
import tkinter as tk
from tkinter import ttk
class FrameObjects(tk.Frame):
"""A very simple class that should be inherited by frames, to help create and
maintain in order the file.
How it works:
- After frames defined, create a dict (or an orderedDict, for convenience),
that will contain e... | gpl-2.0 |
odoousers2014/odoo | addons/mail/tests/test_mail_features.py | 3 | 60081 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
wathen/PhD | MHD/FEniCS/ShiftCurlCurl/CppGradient/Efficient/CurlCurlSecondOrder.py | 1 | 5726 | import petsc4py, sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
import os, inspect
from dolfin import *
import numpy
import ExactSol
import MatrixOperations as MO
import CheckPetsc4py as CP
import HiptmairPrecond
import HiptmairSetup
from timeit import default_timer as timer
m = 8
errL2b =numpy.zeros((m-1,1))... | mit |
steedos/odoo7 | openerp/addons/document/__init__.py | 434 | 1128 | # -*- 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 |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/transformer/implementations/implementation_closed/tests/test_convtbc.py | 6 | 1787 | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
import unittest
from ... | apache-2.0 |
heran7/edx-platform | common/lib/xmodule/xmodule/static_content.py | 14 | 6505 | # /usr/bin/env python
"""
This module has utility functions for gathering up the static content
that is defined by XModules and XModuleDescriptors (javascript and css)
"""
import logging
import hashlib
import os
import errno
import sys
from collections import defaultdict
from docopt import docopt
from path import path... | agpl-3.0 |
ivandevp/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 |
CarlosRA97/explorer-interface | GPIO/ventanas.py | 1 | 1952 | #!/usr/bin/env python2.7
from Tkinter import *
import tkMessageBox
# from RPi.GPIO import *
# # from wiringpi2 import *
from time import sleep
pinesGPIO = [2,3,4,17,27,22,10,9,11,14,15,18,23,24,25,8,7]
pinesGPIO
# setmode(BCM)
# setwarnings(False)
def stp(pin):
setup(pin, OUT)
def on(pin):
output(pin,1)
def... | gpl-2.0 |
onitake/ansible | lib/ansible/plugins/cliconf/__init__.py | 7 | 20946 | #
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
mzdaniel/oh-mainline | mysite/profile/migrations/0034_create_data_import_attempt_model.py | 17 | 19454 | # This file is part of OpenHatch.
# Copyright (C) 2009 OpenHatch, Inc.
#
# 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, either version 3 of the License, or
# (at your option) any later v... | agpl-3.0 |
robcarver17/pysystemtrade | systems/provided/futures_chapter15/rules.py | 1 | 4311 | """
Trading rules for futures system
"""
from syscore.dateutils import ROOT_BDAYS_INYEAR
import pandas as pd
from sysquant.estimators.vol import robust_vol_calc
def ewmac(price, vol, Lfast, Lslow):
"""
Calculate the ewmac trading rule forecast, given a price and EWMA speeds Lfast, Lslow and vol_lookback
... | gpl-3.0 |
tarzan0820/odoo | addons/account/tests/test_account_move_closed_period.py | 127 | 1623 | from datetime import date
from openerp.tests.common import TransactionCase
from openerp.osv.orm import except_orm
class TestPeriodState(TransactionCase):
"""
Forbid creation of Journal Entries for a closed period.
"""
def setUp(self):
super(TestPeriodState, self).setUp()
cr, uid = sel... | agpl-3.0 |
amirfefer/Cyber-Camera | server.py | 1 | 4344 | from flask import Flask, render_template, Response,send_file, request, session, redirect, url_for
import camera
import flask_httpauth
import config
import os
import io
import threading
import time
import hashlib
import logging
import datetime
import ssl
import cloud
app = Flask(__name__)
conf = config.Configuration()
... | gpl-3.0 |
whiteear/cloudbase-init | cloudbaseinit/tests/utils/test_dhcp.py | 7 | 7611 | # Copyright 2014 Cloudbase Solutions Srl
#
# 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 |
leedm777/ansible | lib/ansible/playbook/play.py | 6 | 12420 | # (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 |
q1ang/scikit-learn | sklearn/neighbors/tests/test_kd_tree.py | 159 | 7852 | import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dist_metrics import Dista... | bsd-3-clause |
owais/Fogger | fogger/FoggerWindow.py | 3 | 10132 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2012 Owais Lone <hello@owaislone.org>
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software ... | gpl-3.0 |
ligovirgo/seismon | seismon/input/__init__.py | 4 | 1034 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) Michael Coughlin (2013)
#
# This file is part of SeisMon
#
# SeisMon 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 Licens... | gpl-3.0 |
shaunbrady/boto | boto/beanstalk/response.py | 153 | 28051 | """Classify responses from layer1 and strict type values."""
from datetime import datetime
from boto.compat import six
class BaseObject(object):
def __repr__(self):
result = self.__class__.__name__ + '{ '
counter = 0
for key, value in six.iteritems(self.__dict__):
# first iter... | mit |
cginternals/gloperate | source/tests/googletest/googletest/scripts/upload_gtest.py | 1963 | 2851 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mit |
iut-ibk/DynaMind-ToolBox | DynaMind/scripts/TestModules/advanced_data_types.py | 2 | 1395 | from osgeo import ogr
from pydynamind import *
class AdvancedDataTypes(Module):
def __init__(self):
Module.__init__(self)
self.setIsGDALModule(True)
self.createParameter("elements", INT, "Number of elements")
self.elements = 100000
self.createParamet... | gpl-2.0 |
zhjunlang/kbengine | kbe/src/lib/python/Tools/ssl/make_ssl_data.py | 34 | 2163 | #! /usr/bin/env python3
"""
This script should be called *manually* when we want to upgrade SSLError
`library` and `reason` mnemnonics to a more recent OpenSSL version.
It takes two arguments:
- the path to the OpenSSL include files' directory
(e.g. openssl-1.0.1-beta3/include/openssl/)
- the path to the C file to ... | lgpl-3.0 |
slitvinov/lammps-sph-multiphase | tools/moltemplate/src/nbody_Impropers.py | 35 | 2079 | from nbody_graph_search import Ugraph
# To find 4-body "improper" interactions,
# (by default, most of the time), we would use this subgraph:
# 3
# * 1st bond connects atoms 0 and 1
# | => 2nd bond connects atoms 0 and 2
# _.*._ ... | gpl-2.0 |
auag92/n2dm | Asap-3.8.4/Projects/NanoparticleMC/resume_amc_gas.py | 1 | 2557 | #PBS -l nodes=20:ppn=4:opteron4
#PBS -q verylong
#PBS -N amc_n100_conv1
#PBS -m ae
import os
from montecarlo import SurfaceMonteCarloData
from ase.cluster.cubic import FaceCenteredCubic
from ase.cluster import data
from asap3.MonteCarlo.Metropolis import Metropolis
from asap3.MonteCarlo.Moves import SurfaceMove
from as... | mit |
nanditav/15712-TensorFlow | tensorflow/python/ops/nn_fused_batchnorm_test.py | 19 | 8762 | # 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 |
xin3liang/platform_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/thirdparty/coverage/control.py | 64 | 26459 | """Core control stuff for Coverage."""
import atexit, os, random, socket, sys
from coverage.annotate import AnnotateReporter
from coverage.backward import string_class
from coverage.codeunit import code_unit_factory, CodeUnit
from coverage.collector import Collector
from coverage.config import CoverageConfig
from cov... | bsd-3-clause |
gaurav/phylo2owl | tests/test_alt_inputs.py | 1 | 2038 | #!/usr/bin/env python
"""
test_alt_inputs.py: Test whether phylo2owl supports multiple input types,
including NEXUS and NexML. All of these file types should return exactly the
same RDF/XML output.
"""
import libphylo2owl
import pytest
import os
def test_newick_convert_to_OWL(path_tre):
""" Test all .tre files... | mit |
Adward-R/SwayMini | lib/python2.7/site-packages/pip/locations.py | 117 | 7778 | """Locations where we look for configs, install stuff, etc"""
from __future__ import absolute_import
import getpass
import os
import os.path
import site
import sys
import tempfile
from distutils import sysconfig
from distutils.command.install import install, SCHEME_KEYS
from pip.compat import get_path_uid, WINDOWS
f... | apache-2.0 |
precedenceguo/mxnet | python/mxnet/contrib/text/embedding.py | 12 | 34598 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
anrl/gini | backend/src/gloader/xml/dom/ext/reader/Sgmlop.py | 10 | 10310 | import string, re, types, sys
from xml.parsers import sgmlop
from xml.dom import implementation
from xml.dom import Node
from xml.dom import NotSupportedErr
from xml.dom import EMPTY_NAMESPACE
from xml.dom.html import HTML_DTD, HTML_CHARACTER_ENTITIES
DEFAULT_CHARSET = 'ISO-8859-1'
_root = '(?P<root>[a-zA-Z][a-zA-Z0-... | mit |
rshriram/api | python/istio_api/mcp/v1alpha1/resource_pb2.py | 1 | 3194 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mcp/v1alpha1/resource.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflec... | apache-2.0 |
blacklin/kbengine | kbe/src/lib/python/Lib/test/test_unpack.py | 174 | 2619 | doctests = """
Unpack tuple
>>> t = (1, 2, 3)
>>> a, b, c = t
>>> a == 1 and b == 2 and c == 3
True
Unpack list
>>> l = [4, 5, 6]
>>> a, b, c = l
>>> a == 4 and b == 5 and c == 6
True
Unpack implied tuple
>>> a, b, c = 7, 8, 9
>>> a == 7 and b == 8 and c == 9
True
Unpa... | lgpl-3.0 |
abloomston/sympy | sympy/integrals/tests/test_quadrature.py | 82 | 20020 | from sympy.core import S
from sympy.integrals.quadrature import (gauss_legendre, gauss_laguerre,
gauss_hermite, gauss_gen_laguerre,
gauss_chebyshev_t, gauss_chebyshev_u,
gauss_jacobi)
def test_legend... | bsd-3-clause |
mozilla/verbatim | vendor/lib/python/django/contrib/flatpages/models.py | 410 | 1134 | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
class FlatPage(models.Model):
url = models.CharField(_('URL'), max_length=100, db_index=True)
title = models.CharField(_('title'), max_length=200)
content = models.TextField(_(... | gpl-2.0 |
FHannes/intellij-community | python/testData/inspections/PyCompatibilityInspection/asyncComprehensions.py | 12 | 2070 | <warning descr="Python versions < 3.5 do not support this syntax">async</warning> def asyncgen():
<warning descr="Python version 3.5 does not support 'yield' inside async functions">yield 10</warning>
<warning descr="Python versions < 3.5 do not support this syntax">async</warning> def run():
<warning descr="Py... | apache-2.0 |
chandrikas/sm | tests/test_LVHDoISCSISR.py | 2 | 3031 | import unittest
import mock
import SR
import LVHDoISCSISR
import xs_errors
import testlib
from test_ISCSISR import NonInitingISCSISR
class RandomError(Exception):
pass
class NonInitingLVHDoISCSISR(LVHDoISCSISR.LVHDoISCSISR):
"""
Helper class; Creates dummy LVHDoISCSISR object.
Add attributes/meth... | lgpl-2.1 |
garvitr/sympy | sympy/vector/scalar.py | 42 | 1640 | from sympy.core.symbol import Symbol
from sympy.core.compatibility import u, range
from sympy.printing.pretty.stringpict import prettyForm
class BaseScalar(Symbol):
"""
A coordinate symbol/base scalar.
Ideally, users should not instantiate this class.
"""
def __new__(cls, name, index, system, p... | bsd-3-clause |
channsoden/hannsoden-bioinformatics | WholeGenomePhylogeny/partition_finder_tools.py | 1 | 5531 | # defunct partion finder functions
def configure_PF(alignment_file, user_tree = '', branchlengths = 'linked', models='GTR+G', criteria = 'aicc', partition = '', search = 'kmeans'):
# Create a partition_finder.cfg file
cfg = open('partition_finder.cfg', 'w')
cfg.write("# ALIGNMENT FILE #\n")
cfg.write(... | gpl-3.0 |
GeoCat/QGIS | python/plugins/processing/algs/grass7/ext/r_li_padrange_ascii.py | 5 | 1412 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_padrange_ascii.py
----------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**************... | gpl-2.0 |
erget/tnsmaster | tests/test_aliasFinder.py | 2 | 1116 | import os
from unittest import TestCase
from antlr4 import FileStream, CommonTokenStream, ParseTreeWalker
from tnsnames.aliasFinder import AliasFinder
from tnsnames.tnsnamesLexer import tnsnamesLexer
from tnsnames.tnsnamesParser import tnsnamesParser
__author__ = 'dirkfuchs'
class TestAliasFinder(TestCase):
_... | mit |
DualSpark/ansible | lib/ansible/parsing/yaml/loader.py | 234 | 1877 | # (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 |
Panos512/invenio | modules/bibcatalog/lib/bibcatalog_system.py | 17 | 8332 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 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 yo... | gpl-2.0 |
doug-fish/horizon | openstack_dashboard/test/integration_tests/tests/test_sahara_job_binaries.py | 50 | 3397 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
jounex/hue | desktop/core/ext-py/Django-1.6.10/django/db/backends/__init__.py | 41 | 47980 | import datetime
import time
from django.db.utils import DatabaseError
try:
from django.utils.six.moves import _thread as thread
except ImportError:
from django.utils.six.moves import _dummy_thread as thread
from collections import namedtuple
from contextlib import contextmanager
from django.conf import setti... | apache-2.0 |
gdietz/OpenMEE | edit_funnel_plot_form.py | 1 | 1408 | '''
Created on Dec 12, 2013
@author: george
'''
import sys
from PyQt4 import QtCore, QtGui
from PyQt4.Qt import *
from common_wizard_pages.funnel_page import FunnelPage
class EditFunnelPlotForm(QDialog):
def __init__(self, funnel_params, parent=None):
super(EditFunnelPlotForm, self).__init__(parent)
... | gpl-3.0 |
errx/django | django/db/migrations/writer.py | 7 | 11484 | from __future__ import unicode_literals
import datetime
import inspect
import decimal
import collections
from importlib import import_module
import os
import types
from django.apps import apps
from django.db import models
from django.db.migrations.loader import MigrationLoader
from django.utils.encoding import force_... | bsd-3-clause |
Opticalp/instrumentall | testsuite/python/dataBufferTest.py | 1 | 4601 | # -*- coding: utf-8 -*-
## @file testsuite/python/dataBufferTest.py
## @date jul. 2016
## @author PhRG - opticalp.fr
##
## Test the features of the DataProxy
#
# Copyright (c) 2016 Ph. Renaud-Goud / Opticalp
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and as... | mit |
rabipanda/tensorflow | tensorflow/python/ops/distributions/special_math.py | 14 | 15497 | # 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 |
CatoTH/OpenSlides | server/tests/example_data_generator/management/commands/create-example-data.py | 7 | 12105 | from textwrap import dedent
from typing import Optional
from django.contrib.auth.hashers import make_password
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from django.db.utils import IntegrityError
from django.utils.crypto import get_random_string
from openslides... | mit |
pcm17/tensorflow | tensorflow/python/kernel_tests/dynamic_partition_op_test.py | 97 | 6138 | # 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 |
apehua/pilas | pilas/colisiones.py | 5 | 4860 | # -*- encoding: utf-8 -*-
# pilas engine - a video game framework.
#
# copyright 2010 - hugo ruscitti
# license: lgplv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# website - http://www.pilas-engine.com.ar
from . import utils
import pilas
class Colisiones:
"Administra todas las colisiones entre actores."
... | lgpl-3.0 |
jmesteve/openerp | openerp/tests/test_osv.py | 446 | 4722 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP S.A. http://www.openerp.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
adityacs/ansible | lib/ansible/modules/cloud/vmware/vmware_vsan_cluster.py | 48 | 4083 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Russell Teague <rteague2 () csc.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 ... | gpl-3.0 |
UManPychron/pychron | pychron/image/video.py | 2 | 10139 | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... | apache-2.0 |
softak/webfaction_demo | vendor-local/lib/python/celery/tests/test_app/test_app_amqp.py | 32 | 3364 | from __future__ import absolute_import
from __future__ import with_statement
from mock import Mock
from celery.app.amqp import MSG_OPTIONS, extract_msg_options
from celery.tests.utils import AppCase
class TestMsgOptions(AppCase):
def test_MSG_OPTIONS(self):
self.assertTrue(MSG_OPTIONS)
def test_ex... | bsd-3-clause |
anitahitouch/mediadrop | mediadrop/lib/compat/__init__.py | 10 | 10467 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | gpl-3.0 |
yesudeep/mils-secure | app/rapi.py | 2 | 18254 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import configuration as config
import logging
from google.appengine.api import users, memcache
from google.appengine.ext import webapp, db
from google.appengine.ext.webapp.util import run_wsgi_app
from lovely.jsonrpc import wsgi
import models
from utils import dec, parse_i... | mit |
dezynetechnologies/odoo | addons/auth_crypt/__init__.py | 435 | 1050 | ##############################################################################
#
# 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 Publ... | agpl-3.0 |
keerts/home-assistant | homeassistant/components/zoneminder.py | 3 | 3271 | """
Support for ZoneMinder.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zoneminder/
"""
import logging
from urllib.parse import urljoin
import requests
import voluptuous as vol
from homeassistant.const import (
CONF_PATH, CONF_HOST, CONF_SSL, C... | apache-2.0 |
zubair-arbi/edx-platform | common/lib/xmodule/xmodule/tests/test_annotatable_module.py | 172 | 5909 | """Module annotatable tests"""
import unittest
from lxml import etree
from mock import Mock
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.annotatable_module import AnnotatableModule
from opaque_keys.edx.locations import Location
from . import get_test_system
class Ann... | agpl-3.0 |
yaybu/touchdown | touchdown/goals/get_signin_url.py | 1 | 1515 | # Copyright 2015 Isotoma Limited
#
# 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 |
kdeloach/GeositeFramework | tools/JsTestTools/phantomjs/python/phantom.py | 14 | 13346 | '''
This file is part of the PyPhantomJS project.
Copyright (C) 2011 James Roe <roejames12@hotmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
... | gpl-3.0 |
iivic/BoiseStateX | cms/djangoapps/contentstore/views/tests/test_course_index.py | 7 | 35847 | """
Unit tests for getting the list of courses and the course outline.
"""
import ddt
import json
import lxml
import datetime
import mock
import pytz
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.utils.translation import ugettext as _
from contentstore.courseware_ind... | agpl-3.0 |
nfjinjing/shadowsocks | shadowsocks/crypto/openssl.py | 1038 | 5414 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 ... | apache-2.0 |
elijah513/django | tests/check_framework/test_security.py | 242 | 17428 | from django.conf import settings
from django.core.checks.security import base, csrf, sessions
from django.test import SimpleTestCase
from django.test.utils import override_settings
class CheckSessionCookieSecureTest(SimpleTestCase):
@property
def func(self):
from django.core.checks.security.sessions i... | bsd-3-clause |
hawkrives/project-e.a.s.t. | syllogizmos/truthfinder.py | 1 | 1254 | """
truthfinder.py - given a statement and a list of truths, determine whether or
not the statement is confirmed (always true), plausible
(sometimes true), or busted (never true). Thanks Mythbusters.
"""
from .constants import CONFIRMED, BUSTED, PLAUSIBLE
from .utils import invert
de... | mit |
zycdragonball/tensorflow | tensorflow/python/framework/subscribe_test.py | 46 | 9259 | # 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 |
miconof/CouchPotatoServer | libs/tornado/platform/posix.py | 352 | 1859 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | gpl-3.0 |
jordotech/sherri_satchmo | satchmo/apps/payment/modules/cybersource/processor.py | 5 | 10404 | from django.template import Context, loader
from payment.modules.base import BasePaymentProcessor, ProcessorResult
from satchmo_utils.numbers import trunc_decimal
from django.utils.translation import ugettext_lazy as _
import urllib2
try:
from xml.etree.ElementTree import fromstring
except ImportError:
from el... | bsd-3-clause |
flavioarchilli/root-web-monitoring | webmonitor/FlaskWithJobResolvers.py | 2 | 2887 | from flask import Flask
class ExistingJobResolverError(Exception):
pass
class FlaskWithJobResolvers(Flask):
"""A Flask app that manages the resolution of task names in to job names.
A task name is that received by the Jobs API from the client.
The workers need to know where this job actually is tho... | mit |
C00kiie/Youtube-Mp3-telegram-bot | youtube_dl/extractor/buzzfeed.py | 47 | 3655 | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from .facebook import FacebookIE
class BuzzFeedIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?buzzfeed\.com/[^?#]*?/(?P<id>[^?#]+)'
_TESTS = [{
'url': 'http://www.buzzfeed.com/abagg/... | mit |
yamila-moreno/django | tests/generic_relations/tests.py | 62 | 26688 | from __future__ import unicode_literals
from django import forms
from django.contrib.contenttypes.forms import generic_inlineformset_factory
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.db.models import Q
from django.test import SimpleTestCase, Te... | bsd-3-clause |
vileopratama/vitech | src/addons/lunch/tests/test_lunch.py | 47 | 3259 | # -*- coding: utf-8 -*-
from openerp.tests import common
class Test_Lunch(common.TransactionCase):
def setUp(self):
"""*****setUp*****"""
super(Test_Lunch, self).setUp()
self.demo_user = self.env['res.users'].search([('name', '=', 'Demo User')])
self.product_bolognese_ref = self... | mit |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/pip/_vendor/html5lib/filters/lint.py | 328 | 3365 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from . import base
from ..constants import namespaces, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class Filter(base.Filter):
def __init__(self, source, r... | mit |
catinred2/obfsproxy | obfsproxy/transports/scramblesuit/message.py | 16 | 7118 | """
This module provides code to handle ScrambleSuit protocol messages.
The exported classes and functions provide interfaces to handle protocol
messages, check message headers for validity and create protocol messages out
of application data.
"""
import obfsproxy.common.log as logging
import obfsproxy.common.seriali... | bsd-3-clause |
bartosh/zipline | tests/pipeline/test_downsampling.py | 4 | 24457 | """
Tests for Downsampled Filters/Factors/Classifiers
"""
import pandas as pd
from pandas.util.testing import assert_frame_equal
from zipline.pipeline import (
Pipeline,
CustomFactor,
CustomFilter,
CustomClassifier,
)
from zipline.pipeline.data.testing import TestingDataSet
from zipline.pipeline.factor... | apache-2.0 |
TsinghuaX/edx-platform | common/lib/calc/calc/preview.py | 17 | 12271 | """
Provide a `latex_preview` method similar in syntax to `evaluator`.
That is, given a math string, parse it and render each branch of the result,
always returning valid latex.
Because intermediate values of the render contain more data than simply the
string of latex, store it in a custom class `LatexRendered`.
"""... | agpl-3.0 |
edoko/Air_Kernel-N5 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
midma101/AndIWasJustGoingToBed | .venv/lib/python2.7/site-packages/werkzeug/testsuite/formparser.py | 63 | 16107 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.formparser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the form parsing facilities.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import unittest
from StringIO import StringIO
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.