code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
"""
Created on Thu Jan 31 2018
Unit tests for the Balance game
@author: IvanPopov
"""
import unittest
from game import Game
class GameTest(unittest.TestCase):
def test_game_loads(self):
g=Game()
self.assertEqual(g.c.title(), "Balance") | ipopov13/Balance | legacy_code/tests.py | Python | gpl-3.0 | 259 |
'''
Author: Dr. John T. Hwang <hwangjt@umich.edu>
This package is distributed under New BSD license.
'''
from __future__ import print_function, division
import numpy as np
import unittest
import inspect
from six import iteritems
from collections import OrderedDict
from smt.problems import Sphere, TensorProduct
from... | hwangjt/SMT | smt/tests/test_low_dim.py | Python | bsd-3-clause | 4,984 |
# -*- coding:utf-8 -*-
""" PBox SIAP Server """
# !/usr/bin/python
# Python: 3.5.2
# Platform: Windows/Linux/ARMv7
# Author: Heyn
# Program: SIAP Server.
# History: 2017/01/19 V1.0.0 [Heyn]
# 2017/10/11 V1.0.1 [Heyn]
# 2017/12/22 V1.1.0 [Heyn] Optimization code.
# 2017/12/26 V1.1.1 [... | Heyn2016/Python | PBox/SIAP/PBoxSIAPs.py | Python | gpl-3.0 | 5,976 |
from qit.base.bool import Bool
from qit.base.struct import Struct
from qit.domains.domain import Domain
from qit.domains.iterator import Iterator
from qit.base.function import Function
from qit.functions.int import multiplication_n
class Product(Domain):
""" Cartesian product of domains """
def __init__(self... | spirali/qit | src/qit/domains/product.py | Python | gpl-3.0 | 3,854 |
DESCRIPTION = "kill a zombie by ID"
def autocomplete(shell, line, text, state):
pass
def help(shell):
shell.print_plain("")
shell.print_plain("Usage: kill #")
shell.print_plain(" kill all")
shell.print_plain(" kill dead")
shell.print_plain("")
def kill_zombie(shell, id):
forma... | zerosum0x0/koadic | core/commands/kill.py | Python | apache-2.0 | 1,269 |
"""
Test app that injects new values in a Redis HSET every X seconds.
"""
import asyncio
import asyncio_redis
import random
from time import sleep
choices = ['Alice', 'Bob', 'Charlie', 'Daniel', 'Einstein', 'Francis']
@asyncio.coroutine
def example():
# Create Redis connection
connection = yield from asyncio... | hoh/React-to-Redis | example_inject.py | Python | mit | 888 |
# doc-export: Splines
"""
An interactive spline demo.
"""
from pscript import window
from flexx import flx
SPLINES = ['linear', 'basis', 'cardinal', 'catmullrom', 'lagrange', 'lanczos']
GENERAL_TEXT = """
The splines in this example are used to interpolate a line between
control points. The range of influence is s... | zoofIO/flexx | flexxamples/demos/splines.py | Python | bsd-2-clause | 12,086 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from flexget import options, plugin
from flexget.event import event
from flexget.terminal import console
from flexget.manager import Session
try:
from flexget.plugins.inter... | oxc/Flexget | flexget/plugins/cli/t411.py | Python | mit | 4,537 |
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from djblets.util.fields import JSONField
class ChangeDescription(models.Model):
"""
The recorded set of changes, containing optional description text
and fields that have changed.
T... | atagar/ReviewBoard | reviewboard/changedescs/models.py | Python | mit | 3,822 |
"""
https://www.hackerrank.com/challenges/encryption
One classic method for composing secret messages is called a square code. The spaces are removed from the english text
and the characters are written into a square (or rectangle). The width and height of the rectangle have the constraint,
floor(sqrt( len(word) )) <... | algorhythms/HackerRankAlgorithms | Encryption.py | Python | apache-2.0 | 2,509 |
from django.conf import settings
from django.conf.urls import handler500, handler404, patterns, include, \
url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^example/$', 'cms.test_utils.project.placeholderapp.views.example... | pbs/django-cms | cms/test_utils/project/urls.py | Python | bsd-3-clause | 778 |
# -*- coding: utf-8 -*-
from dry_rest_permissions.generics import DRYPermissions
from rest_framework import filters
from rest_framework import status
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateAPIView, RetrieveAPIView, get_object_or_404
from rest_framework.permissions import IsAuthenticatedOrR... | DevHugo/zds-site | zds/member/api/views.py | Python | gpl-3.0 | 12,703 |
#! /usr/bin/env python3
################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015 Matthew Williams and David Williams
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation fi... | phiste/kengine | systems/polyvox/libs/polyvox/examples/Python/PythonExample.py | Python | mit | 10,172 |
#!/usr/bin/env python
#
# Copyright 2016 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.
"""Processes an Android AAR file."""
import argparse
import os
import posixpath
import re
import shutil
import sys
from xml.etree im... | geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/build/android/gyp/aar.py | Python | gpl-3.0 | 3,306 |
from nova.db.sqlalchemy import api as model_api
from nova.db.sqlalchemy.models import PciDevice, Instance, ComputeNode
import collections
#, VFAllocation
session = model_api.get_session()
WORK_LOAD = ["cp","cr"]
def execute_vf_allocation(req_vf,los,req_work,bus_list, *args,**kwargs):
"""This method is ... | khandavally/devstack | EPAQA/vf_allocation.py | Python | apache-2.0 | 4,020 |
# Copyright 2016 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 by applicable law or a... | GoogleCloudPlatformTraining/cpo200-Google-Cloud-Deployment-Manager | section-3/address.py | Python | apache-2.0 | 1,245 |
from collections import OrderedDict
from .feature_extractor import FeatureExtractor, calc
from .feature_params import FeatureParameters, NumericFeatureParameters
from ..model_util import UNKNOWN_VALUE, MISSING_VALUE, UnknownDict, save_dict, load_dict
FEATURE_TEMPLATES = (
"s0s1xd" "s1s0x" "s0b0xd" "b0s0x" # spec... | danielhers/tupa | tupa/features/dense_features.py | Python | gpl-3.0 | 6,508 |
"""A simple example of serving map data for overlay on a web-accessible 'slippy' map.
Run this script and go to http://localhost:8080/.
"""
import logging
import os
import sys
import foldbeam.renderer
from foldbeam.tests.renderer_tests import osm_map_renderer
import selector
import TileStache
logging.basicConfig(lev... | rjw57/foldbeam | examples/tilestache_provider_server.py | Python | apache-2.0 | 2,145 |
# Distance transform of binary image
import cv2
import os
from plantcv.plantcv._debug import _debug
from plantcv.plantcv import params
def distance_transform(bin_img, distance_type, mask_size):
"""Creates an image where for each object pixel, a number is assigned that corresponds to the distance to the
neare... | danforthcenter/plantcv | plantcv/plantcv/distance_transform.py | Python | mit | 1,551 |
# -*- coding:utf-8 -*-
"""
/***************************************************************************
Python Console for QGIS
-------------------
begin : 2012-09-10
copyright : (C) 2012 by Salvatore Larosa
email : lrssvtml (at) gmail (dot) com
***... | kiith-sa/QGIS | python/console/console_editor.py | Python | gpl-2.0 | 58,453 |
#
# Generated Thu Mar 17 13:49:32 2011 by generateDS.py version 2.4b.
#
import sys
import tardis.tardis_portal.schema.mets as supermod
etree_ = None
Verbose_import_ = False
(XMLParser_import_none, XMLParser_import_lxml,
XMLParser_import_elementtree
) = range(3)
XMLParser_import_library = None
try:
# lxml
f... | eresearchrmit/hpctardis | tardis/tardis_portal/schema/metssubs.py | Python | bsd-3-clause | 16,179 |
from string import ascii_lowercase as alphabet
def decode(message):
dictionary = str.maketrans(alphabet, alphabet[::-1])
return message.translate(dictionary)
| VladKha/CodeWars | 7 kyu/Decoding a message/solve.py | Python | gpl-3.0 | 168 |
# 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... | tomasreimers/tensorflow-emscripten | tensorflow/contrib/learn/python/learn/estimators/linear_test.py | Python | apache-2.0 | 64,221 |
from django_cyverse_auth.models import Token
from rest_framework import serializers
class TokenSerializer(serializers.ModelSerializer):
token = serializers.CharField(read_only=True, source='key')
username = serializers.CharField(read_only=True, source='user.username')
expires = serializers.CharField(read_... | CCI-MOC/GUI-Backend | api/v1/serializers/token_serializer.py | Python | apache-2.0 | 447 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import numpy as np
import pytest
from pandas.compat import product as cart_product, range
from pandas import DataFrame, MultiIndex, Period, Series, Timedelta, Timestamp
from pandas.util.testing import assert_frame_equal, assert_series_equal
class TestCo... | GuessWhoSamFoo/pandas | pandas/tests/groupby/test_counting.py | Python | bsd-3-clause | 7,838 |
# Copyright 2019 DeepMind Technologies 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | deepmind/deepmind-research | side_effects_penalties/training.py | Python | apache-2.0 | 5,751 |
import datetime
import itertools
import unittest
from copy import copy
from django.db import (
DatabaseError, IntegrityError, OperationalError, connection,
)
from django.db.models import Model
from django.db.models.deletion import CASCADE, PROTECT
from django.db.models.fields import (
AutoField, BigIntegerFiel... | sergei-maertens/django | tests/schema/tests.py | Python | bsd-3-clause | 97,924 |
###############################################################################
# actionAngle: a Python module to calculate actions, angles, and frequencies
#
# class: actionAngleSpherical
#
# methods:
# __call__: returns (jr,lz,jz)
# actionsFreqs: returns (jr,lz,jz,Or,Op,Oz)
# ... | jobovy/galpy | galpy/actionAngle/actionAngleSpherical.py | Python | bsd-3-clause | 23,406 |
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*-
### BEGIN LICENSE
# Copyright (C) 2010-2012 Kevin Mehall <km@kevinmehall.net>
#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 Foundati... | xenoxaos/pithos | pithos/util.py | Python | gpl-3.0 | 1,919 |
import sys, itertools, unittest
from test import test_support
import ast
def to_tuple(t):
if t is None or isinstance(t, (basestring, int, long, complex)):
return t
elif isinstance(t, list):
return [to_tuple(e) for e in t]
result = [t.__class__.__name__]
if hasattr(t, 'lineno')... | j5shi/Thruster | pylibs/test/test_ast.py | Python | gpl-2.0 | 25,341 |
from sympy import (
Abs, acos, Add, atan, Basic, besselsimp, binomial, collect,
collect_const, combsimp, cos, cosh, cot, coth, count_ops, denom,
Derivative, diff, Dummy, E, Eq, erf, exp, exp_polar, expand,
expand_multinomial, exptrigsimp, factor, factorial, FallingFactorial,
Float, fraction, Functio... | dennisss/sympy | sympy/simplify/tests/test_simplify.py | Python | bsd-3-clause | 72,312 |
import functools
import sys
import unittest
from test import test_support
from weakref import proxy
import pickle
@staticmethod
def PythonPartial(func, *args, **keywords):
'Pure Python approximation of partial()'
def newfunc(*fargs, **fkeywords):
newkeywords = keywords.copy()
newkeywords.update... | antb/TPT----My-old-mod | src/python/stdlib/test/test_functools.py | Python | gpl-2.0 | 15,450 |
# Copyright 2016 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.
import unittest
import common_util
class SerializeAttributesTestCase(unittest.TestCase):
class Foo(object):
def __init__(self, foo_fighters, whisky_... | axinging/chromium-crosswalk | tools/android/loading/common_util_unittest.py | Python | bsd-3-clause | 2,005 |
__all__ = ['WeatherReport']
| AaronGeist/Llama | biz/life/__init__.py | Python | gpl-3.0 | 28 |
import sys
import subprocess
from pybullet_utils.arg_parser import ArgParser
from pybullet_utils.logger import Logger
def main():
# Command line arguments
args = sys.argv[1:]
arg_parser = ArgParser()
arg_parser.load_args(args)
num_workers = arg_parser.parse_int('num_workers', 1)
assert (num_workers > 0)
... | MadManRises/Madgine | shared/bullet3-2.89/examples/pybullet/gym/pybullet_envs/deep_mimic/mpi_run.py | Python | mit | 601 |
import sys
import math
import time
from bzagents/bzrc import BZRC, Command
class DumbTank(object):
def __init__(self, bzrc, index):
self.bzrc = bzrc
self.agent = DumbAgent(bzrc, index)
def tick(self, time_diff):
self.agent.tick(time_diff)
class DumbAgent(object):
def __init... | craig8196/ai | src/dumb_agent.py | Python | gpl-3.0 | 3,729 |
"""
1D Math Functions.
Bruce Wernick
10 June 2021
"""
import math
__all__ = ['Quad', 'Cubic', 'PolyEval', 'PolyEvalH', 'ExpFunc',
'ModExpFunc', 'LogFunc', 'RecipLogFunc', 'VaporPressureFunc',
'PowerFunc', 'ModPowerFunc', 'ShiftPowerFunc', 'GeometricFunc',
'ModGeometricFunc', 'RootFunc', 'HoerlFunc... | bru32/magz | magz/funcs.py | Python | mit | 6,919 |
from LogReader import LogReader
import math
import json
import pickle
import numpy as np
import scipy as sp
import scipy.stats
def mean_confidence_interval(data, confidence=0.95):
a = 1.0*np.array(data)
n = len(a)
m, se = np.mean(a), scipy.stats.sem(a)
h = se * sp.stats.t._ppf((1+confidence)/2., n-1)
... | airballking/semrec | scripts/bstools/Beliefstate Tools/TimeConfidence.py | Python | bsd-2-clause | 1,442 |
# 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... | rew4332/tensorflow | tensorflow/python/kernel_tests/check_ops_test.py | Python | apache-2.0 | 24,539 |
# -*- coding: utf-8 -*-
##Copyright (C) [2003] [Jürgen Hamel, D-32584 Löhne]
##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... | CuonDeveloper/cuon | cuon_client/CUON/cuon/WebShop/SingleWebshop.py | Python | gpl-3.0 | 1,550 |
import sys, os
## make sure this pyqtgraph is importable before any others
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
from pyqtgraph.Qt import QtCore, QtGui
from exampleLoaderTemplate import Ui_Form
import os, sys
from collections import OrderedDict
examples = OrderedDict([
('Command-... | robertsj/poropy | pyqtgraph/examples/__main__.py | Python | mit | 4,039 |
from ._utils import TestCase
from .. import views
class DummyObject(object):
def __init__(self, *args, **kwargs):
pass
class TestableForm(DummyObject):
pass
class CustomForm(DummyObject):
pass
class TestableInlineFormset(DummyObject):
pass
class CustomFormset(DummyObject):
pass
... | tswicegood/cbv_utils | cbv_utils/tests/views.py | Python | apache-2.0 | 2,922 |
from smartmin.views import SmartCRUDL, SmartCreateView, SmartListView, SmartUpdateView
from django import forms
from dash.orgs.views import OrgPermsMixin, OrgObjPermsMixin
from .models import Category, CategoryImage
class CategoryImageForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
self.org... | peterayeni/dash | dash/categories/views.py | Python | bsd-3-clause | 3,019 |
#!/usr/bin/env python3
"""
test/unit_tests_d/ut_daemon.py: unit test for the MMGen suite's Daemon class
"""
from subprocess import run,DEVNULL
from mmgen.common import *
from mmgen.daemon import *
from mmgen.protocol import init_proto
def test_flags():
d = CoinDaemon('eth')
vmsg(f'Available opts: {fmt_list(d.avail... | mmgen/mmgen | test/unit_tests_d/ut_daemon.py | Python | gpl-3.0 | 4,118 |
from .signature import Signature
class Statement(object):
def __init__(self, text, **kwargs):
self.text = text
self.in_response_to = kwargs.get("in_response_to", [])
self.extra_data = {}
if "in_response_to" in kwargs:
del(kwargs["in_response_to"])
self.extra... | imminent-tuba/thesis | server/chatterbot/chatterbot/conversation/statement.py | Python | mit | 3,111 |
"""urlconf for the base application"""
from django.conf.urls import url, patterns
from base.views import HomePageView
urlpatterns = patterns('base.views',
url(r'^$', HomePageView.as_view(), name='home'),
)
| zenweasel/cashflow2 | base/urls.py | Python | bsd-3-clause | 214 |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the ... | obulpathi/cloud-translator | transformer/custom/hot/tosca_paypalpizzastore.py | Python | apache-2.0 | 1,050 |
##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided t... | davidsminor/gaffer | python/GafferSceneUI/FilterPlugValueWidget.py | Python | bsd-3-clause | 5,666 |
#
# Created as part of the StratusLab project (http://stratuslab.eu),
# co-funded by the European Commission under the Grant Agreement
# INFSO-RI-261552."
#
# Copyright (c) 2012, SixSq Sarl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | StratusLab/client | api/code/src/test/python/messaging/MsgClientTest.py | Python | apache-2.0 | 1,821 |
# -----------------------------------------------------------------------------
# IMPORTS
# Standard library imports
import unittest
# Related third party imports
# Local application/library specific imports
from py_vollib.black.greeks import analytical as c_analytical
from py_vollib.black.greeks import numerical as... | vollib/py_vollib | tests/test_vollib_vs_ref_python_values/black/test_greeks.py | Python | mit | 5,684 |
from flask.ext import restful
from person import People
def setup_api_routes(app):
api = restful.Api(app)
api.add_resource(People, '/api/people/') | wanderanimrod/family-tree | application/backend/api/routes.py | Python | gpl-2.0 | 156 |
from typing import Union, Optional
class BetfairError(Exception):
"""
Base class for Betfair Errors.
"""
pass
class PasswordError(BetfairError):
"""
Exception raised if password is not found.
"""
def __init__(self, username: str):
super(PasswordError, self).__init__(usernam... | liampauling/betfairlightweight | betfairlightweight/exceptions.py | Python | mit | 5,411 |
"""
Load geopotential heights/pt/sp hum and plot
22/05/14
"""
import os, sys
import numpy as np
import matplotlib
#matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
import matplotlib.pyplot as plt
import matplotlib.cm as mpl_cm
from matplotlib import rc
from matplotlib.ticker import M... | peterwilletts24/Python-Scripts | vertical_cross_sections/pressure_heights_plot_multiple.py | Python | mit | 4,160 |
#
# 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... | spektom/incubator-airflow | airflow/providers/docker/example_dags/example_docker_copy_data.py | Python | apache-2.0 | 3,520 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from resources.datatables import FactionStatus
from java.util import Vector
def addTemplate(co... | agry/NGECore2 | scripts/mobiles/generic/faction/imperial/nova_trooper_cadet.py | Python | lgpl-3.0 | 1,887 |
from kaneda import Metrics
from . import mark_benchmark
@mark_benchmark
class TestBenchmarksBackends(object):
def test_benchmark_elasticsearch(self, elasticsearch_backend, benchmark):
metrics = Metrics(backend=elasticsearch_backend)
benchmark(metrics.gauge, 'benchmark_elasticsearch', 1)
def... | APSL/kaneda | tests/integration/benchmarks/test_backends.py | Python | mit | 652 |
#==============================================================================
# post_client_model_content_example.py
# Python script that tests creating and posting content files under a client model
# using Exosite's provision device management system.
#
#=============================================================... | exosite-garage/utility_scripts | upload_content_for_client_model_example.py | Python | bsd-3-clause | 7,436 |
#!/usr/bin/python
# Copyright 2017 Google 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.0',
'status': ['preview'],
... | bearstech/ansible | lib/ansible/modules/cloud/google/gce_labels.py | Python | gpl-3.0 | 12,673 |
#!/usr/bin/env python
"""
Test module for fixed time stepping (serial)
This module solves equations of the form
.. _math::
u_t + \nabla \cdot \left( u \mathbf{v} - a(x) \nabla u \right) = 0
"""
from __future__ import absolute_import
import pytest
from proteus.iproteus import *
from proteus import Comm
from proteu... | erdc/proteus | proteus/tests/ci/test_systemStep.py | Python | mit | 7,424 |
# Aliex Cardona and Josep Casanovas
# Realitat aumentada practica 1
import cv2
import numpy as np
from matplotlib import pyplot as plt
from PyFiles.convolutionKernel import getMatchingMap
IMAGES_PATH = "../Images/"
#imageName = IMAGES_PATH + input("Source image: ")
#targetName = IMAGES_PATH + input("Target to search... | UndistinguishedFellows/RealitatAumentadaPractiques | Practica_1/MatchingImages.py | Python | mit | 1,447 |
##
# Copyright 2009-2013 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | omula/easybuild-easyblocks | easybuild/easyblocks/b/bisearch.py | Python | gpl-2.0 | 2,586 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 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 ve... | CERNDocumentServer/invenio | modules/bibrecord/lib/bibrecord_regression_tests.py | Python | gpl-2.0 | 10,828 |
from Screen import Screen
import ChannelSelection
from ServiceReference import ServiceReference
from Components.config import config, ConfigSelection, ConfigText, ConfigSubList, ConfigDateTime, ConfigClock, ConfigYesNo, getConfigListEntry
from Components.ActionMap import NumberActionMap
from Components.ConfigList impor... | IanSav/enigma2 | lib/python/Screens/TimerEntry.py | Python | gpl-2.0 | 25,248 |
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.comments import Comment
from openpyxl.workbook import Workbook
from openpyxl.worksheet import Worksheet
def test_init():
wb = Workbook()
ws = Worksheet(wb)
c = Comment("text", "author")
ws.cell(coordinate="A1").com... | Darthkpo/xtt | openpyxl/comments/tests/test_comment.py | Python | mit | 438 |
# -*- coding: utf-8 -*-
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
from datetime import datetime
from openerp import models
class TestHrExpense(TransactionCase):
def setUp(self, *args, **kwargs):
re... | VitalPet/hr | hr_expense_product_policy/tests/test_hr_expense.py | Python | agpl-3.0 | 9,394 |
#This script is an example for the nxt.server module. You need to run
#nxt.server.serve_forever() in another window. Or, if you want to use
#this across a network, pass the IP of the computer running the server
#as an argument in the command line.
import socket, sys
try:
server = sys.argv[1]
bindto =... | skorokithakis/nxt-python | examples/server_prompt.py | Python | gpl-3.0 | 808 |
from environment.SensoryEncoded import SensoryEncoded
import nltk
class LanguageEncoded(SensoryEncoded):
def __init__(self, data):
self.rawData = data
self.tokens = nltk.word_tokenize(self.rawData)
| randyhook/knynet | environment/LanguageEncoded.py | Python | mit | 231 |
# Copyright (C) 2015 Alexandre Teyar
# 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 writi... | AresS31/SCI | src/payloads/payload.py | Python | apache-2.0 | 6,079 |
from setup import codeopts, git_version, setup
if __name__ == '__main__':
__version__ = git_version()
codeopts['version'] = __version__
setup(**codeopts)
| gavinbeatty/mkvtomp4 | codesetup.py | Python | mit | 166 |
"""
YANK is a testbed for experimenting with algorithms for the efficient computation of small molecule binding free energies to biomolecular targets using alchemical methods.
YANK is built on OpenMM, the API for molecular simulation, and uses its GPU-accelerated library implementation for hardware acceleration.
"""
fr... | jchodera/yank | setup.py | Python | lgpl-3.0 | 4,913 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Deep learning via the distributed memory and distributed bag of words models from
[1]_, using either hierarchical softmax or negative ... | ziky90/gensim | gensim/models/doc2vec.py | Python | lgpl-2.1 | 38,510 |
#!/usr/bin/env python
'''
# Inbound Proxy Module developed by Bharadwaj Machiraju (blog.tunnelshade.in)
# as a part of Google Summer of Code 2013
'''
from tornado import ioloop
import ssl
from gen_cert import gen_signed_cert
def wrap_socket(socket, domain, ca_crt, ca_key, ca_pass, certs_folder, s... | sharad1126/owtf | framework/http/proxy/socket_wrapper.py | Python | bsd-3-clause | 2,606 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
from bindings import revisionstore
from edenscm.mercurial.node import hex
from . import shallowutil
class mutablebasestore(object):
def __init_... | facebookexperimental/eden | eden/scm/edenscm/hgext/remotefilelog/mutablestores.py | Python | gpl-2.0 | 4,466 |
# 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... | anish/buildbot | master/buildbot/test/unit/test_steps_cmake.py | Python | gpl-2.0 | 5,113 |
# -*- coding: utf-8 -*-
#
# Bauble documentation build configuration file, created by
# sphinx-quickstart on Sun Oct 19 13:24:19 2008.
# Updated by sphinx-quickstart on Sun Jul 26 21:04:58 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configura... | mfrasca/bauble.classic | doc/conf.py | Python | gpl-2.0 | 11,723 |
from server import models
from . import TestCase
class TestBiobrick(TestCase):
def test_get_biobrick_list(self):
for type in ['input', 'receptor', 'promoter', 'output', 'RBS',
'terminator', 'logic']:
result = self.client.get('/biobrick/' + type).json
self.asse... | igemsoftware/SYSU-Software_2014 | tests/test_biobrick.py | Python | lgpl-3.0 | 3,363 |
from flask import request, Response
from base64 import b64decode
from routersploit.modules.exploits.cameras.brickcom.users_cgi_creds_disclosure import Exploit
response = (
"""
size=4
User1.index=1
User1.username=admin
User1.password=test1234
User1.privilege=1
User2.index=2
User2.usern... | dasseclab/dasseclab | clones/routersploit/tests/exploits/cameras/brickcom/test_users_cgi_creds_disclosure.py | Python | gpl-2.0 | 1,382 |
from __future__ import absolute_import
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU Gener... | fmaguire/ete | ete3/treeview/drawer.py | Python | gpl-3.0 | 4,189 |
#!/usr/bin/env python
# Copyright (c) 2009 Technische Universitaet Muenchen, Informatik Lehrstuhl IX.
# Author: Federico Ruiz-Ugalde <memeruiz at 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... | arcoslab/vfl | vfl/vfl.py | Python | gpl-3.0 | 23,622 |
print("HelloWorld")
text="HelloWorld_Text"
print(text) | KuChanTung/Python | HelloWorld.py | Python | epl-1.0 | 55 |
from sympy import *
from sympy.integrals.quadrature import gauss_legendre
import numpy as np
import numpy.linalg as linalg
import math
Order = 2
CarVals = ['x','y','z']
Vals = ['r' , 's' , 't']
Coeffs = ['a','b','c']
Range = np.linspace(-1,1,Order)
Dims = len(Vals)
N = Order ** Dims # number of coeffs
Size = ... | JonHoy/FEA-Code | FEA/Python Scripts/ShapeFunction.py | Python | gpl-2.0 | 2,359 |
# -*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import models
| chienlieu2017/it_management | odoo/addons/l10n_be_hr_payroll/__init__.py | Python | gpl-3.0 | 113 |
#!/usr/bin/env python
import argparse
import Image, ImageDraw, ImageChops
import os
import sys
import util
# stitches a bunch of images together into a grid
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--x', type=int, default=3, help="output columns")
p... | matpalm/malmomo | stitch_imgs.py | Python | mit | 1,879 |
import functools
import html
import itertools
import pprint
from mondrian import term
from bonobo import settings
from bonobo.config import Configurable, Method, Option, use_context, use_no_input, use_raw_input
from bonobo.config.functools import transformation_factory
from bonobo.config.processors import ContextProc... | python-bonobo/bonobo | bonobo/nodes/basics.py | Python | apache-2.0 | 10,187 |
# -*- coding: utf-8 -*-
# Copyright 2007-2021 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | thomasaarholt/hyperspy | hyperspy/logger.py | Python | gpl-3.0 | 2,319 |
# Copyright 2015 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 by applicable law or a... | panmari/tensorflow | tensorflow/contrib/__init__.py | Python | apache-2.0 | 1,187 |
#! /usr/bin/python
'''
Created on Jul 27, 2013
@author: Marcin Czupryniak
@license: GPLv3
@copyright: ESOS Project - Marcin Czupryniak
This module is used for compacting the statistics in the database, computing averages and deleting the 5 seconds samples.
It uses native database drivers and not SQLAlchemy for optim... | feldsam/esos | scripts/db_compact.py | Python | gpl-3.0 | 11,805 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# This file is part of MAVlinkplug.
# MAVlinkplug 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 Soft... | sebastien17/MAVlink_plug | mavlinkplug/Message.py | Python | bsd-3-clause | 13,892 |
# Copyright 2013 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.
from telemetry import test
from telemetry.page import page
from telemetry.page import page_set
from telemetry.page import page_test
# pylint: disable=W0401,W0... | TeamEOS/external_chromium_org | content/test/gpu/gpu_tests/webgl_robustness.py | Python | bsd-3-clause | 2,603 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-20 15:45
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vtn', '0035_auto_20171116_1838'),
]
operations = [
migratio... | VOLTTRON/volttron-applications | kisensum/openadr/openadr/vtn/migrations/0036_auto_20171120_1545.py | Python | bsd-3-clause | 893 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web._auth}.
"""
from zope.interface import implements
from zope.interface.verify import verifyObject
from twisted.trial import unittest
from twisted.python.failure import Failure
from twisted.internet.error import Conne... | Kagami/kisa | lib/twisted/web/test/test_httpauth.py | Python | cc0-1.0 | 21,698 |
'''
Name: Monster-Fight-Simulation
Author: Kyle Everette
Date Last Modified: 2/17/16
Simulates a fight between multiple monsters with a loot system.
'''
import random
roll = input("Type f to begin or q to quit: ")
print("\n")
p_health = 100 #Initializes beginning variables
m_health =... | K-Everette123/Monster-Fight-Simulation | Monster-Fight-Simulation.py | Python | mit | 19,538 |
# THIS FILE IS SAFE TO EDIT. It will not be overwritten when rerunning go-raml.
from flask import jsonify, request
import json as JSON
import jsonschema
from jsonschema import Draft4Validator
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
User_schema = JSON.load(open(dir_path + '/schema/User_schem... | Jumpscale/go-raml | codegen/fixtures/congo/python_server/handlers/drones_postHandler.py | Python | bsd-2-clause | 747 |
#! /usr/bin/env python3
import sys, subprocess
try:
VERSION = subprocess.check_output(["git", "describe", "--match", "v[0-9]*", "--abbrev=0", "--tags", "HEAD"]).decode().strip()
except subprocess.CalledProcessError:
VERSION = "Zip"
def run():
if sys.argv[1] == '--client':
import poshc2.client as... | nettitude/PoshC2 | poshc2/__init__.py | Python | bsd-3-clause | 568 |
def solution(step):
for num in xrange(step, 999999999, step):
if all(num % n == 0 for n in range(1,20)):
return num
else:
pass
return None
print solution(20)
| ganesh-95/python-programs | project/5small.py | Python | mit | 208 |
# -*- coding: utf-8 -*-
"""Unittests for submodules of package 'nemoa.core'."""
__author__ = 'Patrick Michl'
__email__ = 'frootlab@gmail.com'
__license__ = 'GPLv3'
__docformat__ = 'google'
| fishroot/nemoa | nemoa/core/__test__.py | Python | gpl-3.0 | 190 |
import os
from scrapy import Spider
from totalStorage.items import TotalStorageItem
import json
import datetime
HOST = os.environ.get("DATASERV_HOST", "status.driveshare.org")
class TotalSpider(Spider):
name = "total"
allowed_domains = [HOST]
start_urls = [
"http://{0}/api/total".format(HOST)
]
def parse(se... | littleskunk/driveshare-graph | scrapers/totalStorage/totalStorage/spiders/total_spider.py | Python | mit | 618 |
from distutils.core import setup
setup(
name = 'pythonversiontest',
packages = ['pythonversiontest'], # this must be the same as the name above
version = '1.0.0',
description = 'A random test lib',
author = 'Prabhay Gupta',
author_email = 'guptaprabhay@yahoo.com',
url = 'https://github.com/prabhay759/pyth... | prabhay759/pythonversiontest | setup.py | Python | mit | 552 |
# Copyright 2015 The Tornado 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 in w... | jsjohnst/tornado | tornado/locks.py | Python | apache-2.0 | 15,234 |
HOST = "172.31.28.89"
PORT = "5432"
USER = "postgres"
PASSWORD = "enw1989"
DATABASE = "google"
READ_PREFERENCE = "primary"
COLLECTION_INPUT = "task_events"
COLLECTION_OUTPUT = "task_events_info"
PREFIX_COLUMN = "g_"
ATTRIBUTES = ["event type", "CPU request", "memory request"]
SORT = ["filepath", "numline"]
OPERATION_T... | elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 1B/instances/1_workflow_full_10files_primary_1sh_1rs_noannot_with_proj_1s/work/ubuntu/pegasus/example_workflow/20161220T015426+0000/ConfigDB_TaskEvent_0.py | Python | gpl-3.0 | 485 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.