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 |
|---|---|---|---|---|---|
from __future__ import unicode_literals
from __future__ import absolute_import
from ..packages.docker import Client
from requests.exceptions import ConnectionError
import errno
import logging
import os
import re
import yaml
from ..packages import six
from ..project import Project
from ..service import ConfigError
from... | waynedovey/fig | fig/cli/command.py | Python | apache-2.0 | 3,878 |
import util
| mtmarsh2/vislab | vislab/ui/__init__.py | Python | bsd-2-clause | 12 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | be-cloud-be/horizon-addons | server-tools/auth_dynamic_groups/model/res_users.py | Python | agpl-3.0 | 2,115 |
#!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests the includeconf argument
Verify that:
1. adding includeconf to the configuration file causes th... | Sjors/bitcoin | test/functional/feature_includeconf.py | Python | mit | 4,066 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright (C) 2014 René Kijewski <rene.kijewski@fu-berlin.de>
# Copyright (C) 2015 Philipp Rosenkranz <philipp.rosenkranz@fu-berlin.de>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# L... | daniel-k/RIOT | dist/tools/compile_test/compile_test.py | Python | lgpl-2.1 | 10,074 |
import myhdl
import pihdf
from pihdf import Testable
import os, sys
sys.path.append(os.path.dirname(__file__) + "/../..")
from ParamStruct.ParamStruct import ParamStruct
class t_ParamStruct(Testable):
'''|
| Automatically generated. Do not modify this file.
|________'''
pihdf.head("T E S T S")
p... | hnikolov/pihdf | test/ParamStruct/test/t_ParamStruct.py | Python | mit | 1,864 |
# -*- coding: utf-8 -*-
"""
flask.ext.security.core
~~~~~~~~~~~~~~~~~~~~~~~
Flask-Security core module
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
from flask import current_app
from flask.ext.login import AnonymousUser as AnonymousUserBase, \
UserMix... | 100grams/flask-security | flask_security/core.py | Python | mit | 14,213 |
# Copyright (c) 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | olivierlemasle/murano | murano/opts.py | Python | apache-2.0 | 2,494 |
import json
import pprint
pp = pprint.PrettyPrinter(indent=4)
def main():
doc_fields = ['name',
'email',
'alt_email',
'city',
'realm',
'coins',
'category',
'achievements',
... | couchbase/perfrunner | scripts/index_mapper.py | Python | apache-2.0 | 1,220 |
#!/usr/bin/python3
from distutils.core import setup
import cmglib.common
setup(name = 'CMGlue',
version = cmglib.common.VERSION,
description = 'Configuration Management Glue: a better git-submodule',
author = 'Dong Yue',
author_email = 'me@dongyue.name',
url = '(TBD)',
platforms = 'all popula... | dongyue/cmglue | setup.py | Python | bsd-3-clause | 792 |
import os
import zipfile
from utils import run, dpath, rm, symlink_in_tempdir
def test_fastqc(sample1_se_fq, tmpdir):
snakefile = '''
rule fastqc:
input:
fastq='sample1_R1.fastq.gz'
output:
html='results/sample1_R1.html',
zip='sample1_R1.zip'
wrapper:... | lcdb/lcdb-wrapper-tests | test/test_fastqc.py | Python | mit | 1,788 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorkit.base import ObjectiveBase
import tensorflow as tf
class Objective(ObjectiveBase):
def loss(self, hypes, logits, labels):
labels = tf.reshape(labels, [-1, 1])
error = tf.subt... | nghiattran/self-steering | models/objective.py | Python | mit | 1,330 |
from collections import deque
import os.path
import pygame
from pygame.locals import QUIT, KEYDOWN, K_a, K_s, K_d, K_w, KEYUP, K_p, K_ESCAPE, K_y, K_n, K_g
from pygame import time, display, mixer, transform
from img import load_img
from render import update_display
from player import Player
from background import Bac... | Roolymoo/comprev | src/main.py | Python | gpl-3.0 | 18,714 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2014 Carleton Coffrin
#
# 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 wit... | discreteoptimization/setcover | greedy_001/solver.py | Python | mit | 2,794 |
import collections
from rdflib import URIRef, Graph, Literal
from rdflib.namespace import VOID, RDF
def generateVoID(g, dataset=None, res=None, distinctForPartitions=True):
"""
Returns a new graph with a VoID description of the passed dataset
For more info on Vocabulary of Interlinked Datasets (VoID), s... | RDFLib/rdflib | rdflib/void.py | Python | bsd-3-clause | 4,001 |
"""Markov Decision Processes (Chapter 17)
First we define an MDP, and the special case of a GridMDP, in which
states are laid out in a 2-dimensional grid. We also represent a policy
as a dictionary of {state:action} pairs, and a Utility function as a
dictionary of {state:number} pairs. We then define the value_itera... | gokul-uf/aima-python | aimaPy/mdp.py | Python | mit | 7,240 |
# packet.py
#
# Copyright 2002-2005,2007 Wichert Akkerman <wichert@wiggy.net>
#
# A RADIUS packet as defined in RFC 2138
import struct, types, random, UserDict
try:
import hashlib
md5_constructor = hashlib.md5
except ImportError:
# BBB for python 2.4
import md5
md5_constructor = md5.new
import too... | shanghai-edu/radius-1xtest | lib/packet.py | Python | apache-2.0 | 15,968 |
import unittest
from nose.tools import assert_equals, assert_true, assert_false
from robotide.robotapi import TestCaseFile
from robotide.controller.filecontrollers import TestCaseFileController
from robotide.controller.macrocontrollers import (
TestCaseController, UserKeywordController)
from robotide.controller.ta... | fingeronthebutton/RIDE | utest/controller/test_macro_controllers.py | Python | apache-2.0 | 4,898 |
import json
import logging
import requests
import os
import pexpect
import yaml
from cStringIO import StringIO
from tempfile import NamedTemporaryFile
from teuthology.config import config as teuth_config
from teuthology.exceptions import CommandFailedError
from teuthology.repo_utils import fetch_repo
from . import T... | ivotron/teuthology | teuthology/task/ansible.py | Python | mit | 10,845 |
import unittest
from IPython.display import Markdown, display
import numpy as np
def printmd(string):
display(Markdown(string))
V_opt = np.zeros((4,12))
V_opt[0:13][0] = -np.arange(3, 15)[::-1]
V_opt[0:13][1] = -np.arange(3, 15)[::-1] + 1
V_opt[0:13][2] = -np.arange(3, 15)[::-1] + 2
V_opt[3][0] = -13
pol_opt = ... | hetaodie/hetaodie.github.io | assets/media/uda-ml/qinghua/shijianchafenfangfa/迷你项目:时间差分方法(第 0 部分和第 1 部分)/check_test.py | Python | mit | 1,352 |
'''Test animation of a group of objects making a face.
This version replaces moveAllOnLine by moveAllOnLineFlush,
to only update thescreen once for each animation step,
after multiple individual graphics instructions are given.'''
from graphics import *
import time
def moveAll(shapeList, dx, dy):
''' Move all sh... | hwheeler01/comp150 | examples/backAndForth2Flush.py | Python | mit | 1,955 |
"""
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... | ESSolutions/ESSArch_Core | ESSArch_Core/essxml/ProfileMaker/migrations/0007_auto_20160908_1428.py | Python | gpl-3.0 | 1,696 |
'''
Unit tests for simpletable.py.
:see: http://docs.python.org/lib/minimal-example.html for an intro to unittest
:see: http://agiletesting.blogspot.com/2005/01/python-unit-testing-part-1-unittest.html
:see: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/305292
'''
from __future__ import absolute_import
impor... | alan-isaac/SimpleTable | test_table.py | Python | mit | 4,499 |
# coding: utf-8
from .common import CommonTestCase
class SuggestionsTest(CommonTestCase):
def test_suggestion_url(self):
client = self.client
# self.assertEqual(client.suggestions.address.url, "https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address")
self.assertEqual(client.s... | tigrus/dadata-python | tests/test_suggestions.py | Python | mit | 674 |
#!/usr/bin/env python
from tools.load import LoadMatrix
from numpy import where
import shogun as sg
lm=LoadMatrix()
traindat = lm.load_numbers('../data/fm_train_real.dat')
testdat = lm.load_numbers('../data/fm_test_real.dat')
parameter_list=[[traindat,testdat, 1.0],[traindat,testdat, 10.0]]
def kernel_wave (fm_train... | shogun-toolbox/shogun | examples/undocumented/python/kernel_wave.py | Python | bsd-3-clause | 846 |
# -*- coding: utf-8 -*
#
# Test links:
# https://www.androidfilehost.com/?fid=95916177934518197
import re
from module.plugins.internal.SimpleHoster import SimpleHoster
class AndroidfilehostCom(SimpleHoster):
__name__ = "AndroidfilehostCom"
__type__ = "hoster"
__version__ = "0.05"
__status__ ... | Guidobelix/pyload | module/plugins/hoster/AndroidfilehostCom.py | Python | gpl-3.0 | 2,454 |
from spock.mcp import datautils
from spock.utils import BoundBuffer
def test_unpack_varint():
largebuff = BoundBuffer(b'\x80\x94\xeb\xdc\x03')
smallbuff = BoundBuffer(b'\x14')
assert datautils.unpack_varint(smallbuff) == 20
assert datautils.unpack_varint(largebuff) == 1000000000
def test_pack_varint... | MrSwiss/SpockBot | tests/mcp/test_datautils.py | Python | mit | 1,065 |
'''
Copyright 2015-2016 GoodCrypto.
Last modified: 2016-10-30
This file is open source, licensed under GPLv3 <http://www.gnu.org/licenses/>.
Manage logging messages encrypted and decrypted by the GoodCrypto server to
prevent others spoofing the security of a message.
'''
import json, os, re
from d... | goodcrypto/goodcrypto-mail | goodcrypto/mail/message/history.py | Python | gpl-3.0 | 16,318 |
from django.contrib import admin
from organization.models import Organization
class OrganizationAdmin(admin.ModelAdmin):
pass
admin.site.register(Organization, OrganizationAdmin)
| KokareIITP/vms | vms/organization/admin.py | Python | gpl-2.0 | 185 |
"""
This module is in charge of handling URLs in lectio.
"""
from .config import BASE_URL
def _make_url(school_id, endpoint):
"""
Crafts an URL based on the ``school_id``, ``endpoint``, and ``query``.
``school_id`` is a number as a string object
Example:
``school_id = "248"``
``endpoint`... | dkkline/pylectio | lectio/urls.py | Python | mit | 1,118 |
AR3[AR3 == -99.] = np.nan
AR3 | stijnvanhoey/course_gis_scripting | notebooks/_solutions/02-scientific-python-introduction58.py | Python | bsd-3-clause | 29 |
from z3 import *
import itertools, collections
class SolverGen:
def __init__(self):
self.varCount = 0
def genVar(self, i):
self.varCount += 1
return Int("%s_%d" % ("abc"[i], self.varCount))
def addSolver(self, solver, i, n, vs):
if i == 0: return
myIndex, unknownInde... | u-tokyo-gps-tanaka-lab/three_wise_men | 3.py | Python | gpl-3.0 | 1,400 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
from scripttest import TestFileEnvironment
current_dir = os.path.dirname(__file__)
def test_cli():
env = TestFileEnvironment('./test-output')
img1 = os.path.join(current_dir, 'test1.png')
img2 = os.path.join(current_dir, 'test2.png')
... | mozillazg/bild.me-cli | tests/test_cli.py | Python | mit | 1,099 |
# coding=utf-8
__author__ = "AstroPrint Product Team <product@astroprint.com>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2017 3DaGoGo, Inc - Released under terms of the AGPLv3 License"
# singleton
_instance = None
DEFAULT_MANAGER = 'marlin'
... | AstroPrint/AstroBox | src/astroprint/printer/manager.py | Python | agpl-3.0 | 1,517 |
import sys
def count(value, last_coin=50):
if value == 0:
return 1
result = 0
for coin in [50, 25, 10, 5, 1]:
if coin <= value and coin <= last_coin:
result += count(value - coin, coin)
return result
def main():
test_cases = open(sys.argv[1], 'r')
for test in test... | mpillar/codeeval | 1-moderate/alternative-reality/main.py | Python | unlicense | 507 |
"""Django settings for jiggety project."""
#import os, sys
#sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add ... | lukmdo/Jiggety | jiggety/settings.py | Python | mit | 5,912 |
#!/usr/bin/env python
"""t is for people that want do things, not organize their tasks."""
from __future__ import with_statement
import os, re, sys, hashlib
from operator import itemgetter
from optparse import OptionParser, OptionGroup
class InvalidTaskfile(Exception):
"""Raised when the path to a task file al... | nafigator/dotfiles | tasks/.tasks/t.py | Python | mit | 11,581 |
from pathlib import Path
from test.yara_signature_testing import SignatureTestingMatching, SignatureTestingMeta
TEST_DATA_DIR = Path(__file__).parent / 'data'
SIGNATURE_PATH = Path(__file__).parent.parent / 'signatures/'
TEST_SIGNATURE_PATH = Path(__file__).parent.parent / 'test/data/signatures/'
class TestSoftware... | fkie-cad/FACT_core | src/plugins/analysis/software_components/test/test_plugin_software_components_signatures.py | Python | gpl-3.0 | 1,349 |
# -*- coding: utf-8 -*-
from gitlint.rules import LineRule
class MyUserLineRule(LineRule):
id = "UC2"
name = "my-lïne-rule"
# missing validate method, missing target attribute
| jorisroovers/gitlint | gitlint-core/gitlint/tests/samples/user_rules/incorrect_linerule/my_line_rule.py | Python | mit | 193 |
# Check the behavior of the ALLOW_RETRIES keyword.
# This test uses a file that's stable across retries of the test to fail and
# only succeed the fourth time it is retried.
#
# RUN: rm -f %t.counter
# RUN: %{lit} -j 1 %{inputs}/allow-retries/succeeds-within-limit.py -Dcounter=%t.counter -Dpython=%{python} | FileCheck... | google/llvm-propeller | llvm/utils/lit/tests/allow-retries.py | Python | apache-2.0 | 1,984 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | kubernetes-client/python | kubernetes/client/models/v1_daemon_set_update_strategy.py | Python | apache-2.0 | 5,285 |
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | affo/nova | nova/scheduler/filters/disk_filter.py | Python | apache-2.0 | 3,530 |
"""
Class which embellishes the DataCollectionView with buttons and actions for
editing the data collection
"""
import operator
from ...external.qt.QtGui import (QWidget, QMenu,
QAction, QKeySequence, QFileDialog)
from ...external.qt.QtCore import Qt, Signal, QObject
from ..ui.laye... | bsipocz/glue | glue/qt/widgets/layer_tree_widget.py | Python | bsd-3-clause | 14,225 |
# -*- coding: UTF-8 -*-
# Copyright (C) 2011 Juan David Ibáñez Palomar <jdavid@itaapy.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
# (at your option... | bepatient-fr/ikaaro | ikaaro/config_seo.py | Python | gpl-3.0 | 2,060 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '11.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from __future__ import print_function
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.laye... | nstustudent/krotyuk_social_network_sa | Interface.py | Python | apache-2.0 | 14,186 |
# encoding=utf8
import datetime
from distutils.version import StrictVersion
import hashlib
import os.path
import random
from seesaw.config import realize, NumberConfigValue
from seesaw.item import ItemInterpolation, ItemValue
from seesaw.task import SimpleTask, LimitConcurrent
from seesaw.tracker import GetItemFromTrac... | ArchiveTeam/musicbrainz-grab | pipeline.py | Python | unlicense | 9,152 |
"""
$Id: __init__.py,v 1.2 2005/02/26 17:56:10 sidnei Exp $
"""
from opencore.interfaces import IProject
| socialplanning/opencore | Products/OpenPlans/interfaces/project.py | Python | gpl-3.0 | 105 |
"""This package contains implementations of models of cache replacement
policies and caching and routing strategies.
"""
from .cache import *
from .cachenet import *
from .strategy import * | FilWisher/distributed-project | icarus/icarus/models/__init__.py | Python | mit | 190 |
"""
Test settings for ``timezone`` app.
"""
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
INSTALLED_APPS = (
'django_nose',
'timezone.tests'
)
SECRET_KEY = 'secret-key'
STATIC_URL = '/static/'
TEST_RUNNER = 'django_nose.NoseTestSuiteRunne... | ixc/django-timezone | timezone/tests/settings.py | Python | mit | 368 |
"""Unit test `MiddlewareComposer()`."""
import twill
import selector
def test_middleware_composer():
"""Middleware stack should alter return in order.."""
def make_middleware(txt):
def middleware(app):
def wrappedapp(environ, start_response):
res = app(environ, start_res... | lukearno/selector | tests/unit/test_middleware_composer.py | Python | mit | 1,141 |
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
count = 0
var = raw_input("GPIO TO TEST ")
var = int(var)
totaltime = raw_input("HOW MANY SECONDS? ")
print "YOU ENTERED: ", var
print "IT WILL BE ACTIVE FOR: ", totaltime, "SECONDS"
totaltime = int(totaltime)
GPIO.setup(var, GPIO.OUT)
GP... | will-davis/fishtank | gpio.py | Python | mit | 496 |
from settings.default import *
# neonion specific
ANNOTATION_STORE_URL = "http://127.0.0.1:5100"
ELASTICSEARCH_URL = "http://127.0.0.1:9200"
DEFAULT_USER_ACTIVE_STATE = True
| Taraka16/neonion | settings/demo.py | Python | gpl-2.0 | 175 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Integration Service')
class TestIntegrationService(unittest.TestCase):
pass
| vqw/frappe | frappe/integration_broker/doctype/integration_service/test_integration_service.py | Python | mit | 293 |
__author__ = 'scidb'
| gqueiroz/scigws | src/server/server/management/commands/__init__.py | Python | gpl-3.0 | 21 |
import jingo
from django.test.client import RequestFactory
from nose.tools import eq_
from pyquery import PyQuery as pq
from bedrock.mozorg.tests import TestCase
def render(s, context=None):
t = jingo.env.from_string(s)
return t.render(context or {})
class TestDownloadButtons(TestCase):
def test_thun... | Jobava/bedrock | bedrock/thunderbird/tests/test_helpers.py | Python | mpl-2.0 | 2,449 |
import click
import sys
from collections import namedtuple
from random import randint
Ctx = namedtuple('Ctx', ['ctl', 'ssh', 'ssh_cfg'])
@click.group()
@click.pass_context
@click.option('--host', default='vdi.nci.org.au', help='Customize vdi login node')
@click.option('--user', help='SSH user name, if not given will... | Kirill888/nci-tools | ncitools/_vdimain.py | Python | mit | 6,475 |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | polyaxon/polyaxon | platform/coredb/coredb/abstracts/stage.py | Python | apache-2.0 | 1,201 |
#!/usr/bin/python
import numpy as np
import sys
from getData import *
import matplotlib.pylab as plt
def effEpsilon(epsv1,epsv2,f):
epsw1=[]
epsw2=[]
for eps1,eps2 in zip(epsv1,epsv2):
epsw1.append( f * eps1 + (1-f) * eps2)
epsw2.append( 1./(f/eps1 + (1-f)/eps2))
return (epsw1,epsw2)
if len(sys.argv)!=3:... | cinek810/refractiveindex.info | effEpsilon.py | Python | gpl-2.0 | 5,763 |
# -*- coding: utf-8 -*-
from flask_restful import Resource, reqparse, marshal_with
from flask_restful_swagger import swagger
from app.mod_shared.models import db
from app.mod_profiles.models import *
from app.mod_profiles.resources.fields.measurementUnitFields import MeasurementUnitFields
parser = reqparse.RequestPar... | coco19/salud-api | app/mod_profiles/resources/views/measurementUnitView.py | Python | gpl-2.0 | 4,223 |
from django.conf import settings
PROMOTERSCORE_USER_RANGES_DEFAULT = {
'promoters': [9, 10],
'passive': [7, 8],
'detractors': [1, 2, 3, 4, 5, 6],
'skipped': [-1]
}
PROMOTERSCORE_PERMISSION_VIEW = getattr(settings, 'PROMOTERSCORE_PERMISSION_VIEW', lambda u: u.is_staff)
PROMOTERSCORE_USER_RANGES = getat... | epantry/django-netpromoterscore | netpromoterscore/app_settings.py | Python | mit | 396 |
import unittest
import productsvd
import numpy
class TestReduceusv(unittest.TestCase):
def test_1(self):
Ui = numpy.array([[1,0,0],[0,1,0],[0,0,1],[0,0,0]])
si = numpy.array([3,2,1])
Vit = numpy.array([[1,0,0],[0,1,0],[0,0,1]])
p = 2
Ue = numpy.array([[1,0],[0,1],[0,0],[0,0]])
se = numpy.array(... | phenology/infrastructure | applications/modules/python/productsvd.ut.py | Python | apache-2.0 | 2,494 |
# coding=utf-8
""" Module holding tools for ee.Collection """
import ee
def enumerate(collection):
""" Create a list of lists in which each element of the list is:
[index, element]. For example, if you parse a FeatureCollection with 3
Features you'll get: [[0, feat0], [1, feat1], [2, feat2]]
:param c... | gee-community/gee_tools | geetools/tools/collection.py | Python | mit | 2,120 |
from .lsm import *
| WeKeyPedia/toolkit-python | wekeypedia/metrics/__init__.py | Python | mit | 19 |
"""Provide a way to work with pandas data frames in Spark"""
#
# 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 ... | michalmonselise/sparklingpandas | sparklingpandas/prdd.py | Python | apache-2.0 | 5,745 |
# -*- coding: utf-8 -*-
# Code for Life
#
# Copyright (C) 2016, Ocado Innovation Limited
#
# 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 o... | CelineBoudier/rapid-router | game/migrations/0044_auto_20150615_1156.py | Python | agpl-3.0 | 2,499 |
import logging
import pandas
from netort.data_manager import DataSession, thread_safe_property
from yandextank.plugins.Phantom.reader import string_to_df_microsec
from yandextank.common.interfaces import AbstractPlugin,\
MonitoringDataListener
logger = logging.getLogger(__name__) # pylint: disable=C0103
class... | nettorta/yandex-tank | yandextank/plugins/NeUploader/plugin.py | Python | lgpl-2.1 | 9,248 |
# -*- coding: utf8 -*-
import ConfigParser
import logging
log = logging.getLogger(__name__)
__author__ = "Stinger <neo3land@gmail.com>"
__license__ = "GNU Lesser General Public License (LGPL)"
class MyDict(dict):
def __init__(self, parent, name, seq, **kwargs):
self.name = name
self.parent = pare... | neo4land/numlex | config.py | Python | gpl-3.0 | 4,196 |
# /usr/bin/env python
'''
Written by Kong Xiaolu and CBIG under MIT license:
https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
'''
import os
import numpy as np
import torch
import CBIG_pMFM_basic_functions as fc
import warnings
def CBIG_mfm_validation_desikan_fccost(gpu_index=0):
'''
This function ... | ThomasYeoLab/CBIG | stable_projects/fMRI_dynamics/Kong2021_pMFM/part2_pMFM_control_analysis/FC_cost/scripts/CBIG_pMFM_step2_validation_fccost.py | Python | mit | 3,265 |
"""Demonstrates the use of callbacks. Press the onboard button S2 to toggle led.
"""
from robovero.LPC17xx import IRQn_Type
from robovero.core import NVIC_EnableIRQ
from robovero.arduino import pinMode, digitalWrite, digitalRead, BTN, LED, OUTPUT
from robovero.extras import heartbeatOff, registerCallback
from robovero... | robovero/python | callback.py | Python | bsd-2-clause | 1,488 |
# -*- coding: utf-8 -*-
import gitmesh
import six
def test_version_string():
assert isinstance(gitmesh.version, six.text_type)
| smartmob-project/gitmesh | tests/test_version.py | Python | mit | 135 |
# -*- coding: utf-8 -*-
# Copyright 2012 Guewen Baconnier (Camptocamp SA)
# Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Web Translate Dialog",
"summary": "Easy-to-use pop-up to translate fields in several languages",... | be-cloud-be/horizon-addons | web/web_translate_dialog/__openerp__.py | Python | agpl-3.0 | 752 |
# -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.tools.translate import _
from openerp.addons.web.http import request
from openerp.addons.website_partner.controllers import main as website_partner
import werkzeug.urls
class WebsiteCrmPartnerAssig... | trabacus-softapps/openerp-8.0-cc | openerp/addons/website_crm_partner_assign/controllers/main.py | Python | agpl-3.0 | 4,993 |
#!/usr/bin/env python
import rospy
from slaw_smach.ArmStates import *
from slaw_smach.MoveStates import *
from slaw_smach.ObjectDetectState import *
def btt():
rospy.init_node('btt_smach_test')
sm = smach.StateMachine(outcomes=['end'])
#sm.userdata.pose = "D2"
locations = rospy.get_param('locations'... | smARTLab-liv/smartlabatwork-release | slaw_btt/scripts/btt.py | Python | mit | 7,123 |
# -*- coding: utf-8 -*-
#
# dipy documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 4 15:23:20 2010.
#
# 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.
#
# All co... | maurozucchelli/dipy | doc/conf.py | Python | bsd-3-clause | 7,939 |
import re
def parse_point_script_output(script_output):
"""
Parse the output from Praat into a dictionary of acoustic measurements.
See docstring of analyze_script for formatting requirements.
Prints the Praat script output if it doesn't fit the specified format (usually because the Praat script crash... | mmcauliffe/python-praat-scripts | pyraat/parse_outputs.py | Python | gpl-3.0 | 2,514 |
"""Support for ESPHome climate devices."""
import logging
from typing import List, Optional
from aioesphomeapi import (
ClimateAction,
ClimateFanMode,
ClimateInfo,
ClimateMode,
ClimateState,
ClimateSwingMode,
)
from homeassistant.components.climate import ClimateDevice
from homeassistant.compo... | qedi-r/home-assistant | homeassistant/components/esphome/climate.py | Python | apache-2.0 | 9,432 |
#!/usr/bin/env python2.7
# coding: utf-8
## Use of swig and numpy to compute the evolution of internal energy in a vNR scheme
from IPython import get_ipython
import os
##### We will use numpy extensively
import numpy as np
##### Import the module created by swig as a classical python module
import vnrinternalener... | hippo91/nonlinear_solver | doc/swig_vs_numpy_comparison.py | Python | gpl-2.0 | 3,539 |
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | deepmind/xmanager | __init__.py | Python | apache-2.0 | 610 |
# -*- coding: utf-8 -*-
# File: __init__.py
from tensorpack.libinfo import __version__, _HAS_TF
from tensorpack.utils import *
from tensorpack.dataflow import *
# dataflow can be used alone without installing tensorflow
# TODO maybe separate dataflow to a new project if it's good enough
# https://github.com/celery... | eyaler/tensorpack | tensorpack/__init__.py | Python | apache-2.0 | 791 |
# Copyright (C) 2015-2018 East Asian Observatory
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version... | eaobservatory/hedwig | lib/hedwig/publication/arxiv.py | Python | gpl-3.0 | 4,543 |
class LineIntersection(object):
""" Line Intersection Class. initiates with lines
[(x1,y1), (x2, y2)] to be converted to labeled
endpoints [(x,y), label]. Main test for gen.
line intersection uses sweep-line algorithm.
"""
def __init__(self, data):
self.count = 0
self.lines = {}
self.sweeps = [... | n17r4m/mmm.coffee | old-lib/geometry/xxx-LineIntersection.py | Python | lgpl-3.0 | 2,196 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | redhat-cip/dci-control-server | dci/db/declarative.py | Python | apache-2.0 | 5,019 |
#/!/usr/bin/env python
# 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 require... | obulpathi/cloud | ml/tensorflow/iris/pipeline.py | Python | apache-2.0 | 12,718 |
# 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 th... | Eseoghene/bite-project | deps/mrtaskman/server/handlers/taskresultfiles.py | Python | apache-2.0 | 2,001 |
# -*- coding: utf-8 -*-
from tests.functional_tests import isolate
from tuttle.resource import FileResource
import os
# TODO what about symlinks ?
class TestFile():
@isolate
def test_directory_should_be_removable(self):
""" if a file resource is a directory it should be removable """
os.mkd... | lexman/tuttle | tests/test_file.py | Python | mit | 1,257 |
from grappa.engine import Engine, isoperator
def test_engine(should):
Engine | should.be.a('class')
Engine | should.have.property('register') > should.be.a('function')
class FakeOperator(object):
operators = tuple()
kind = 'accessor'
def run(self):
pass
def test_isoperator(should):
... | grappa-py/grappa | tests/engine_test.py | Python | mit | 373 |
# 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... | elviswf/yapf | yapf/yapflib/yapf_api.py | Python | apache-2.0 | 7,978 |
from typing import Dict, List, Union
from typeguard import check_argument_types
import tensorflow as tf
import numpy as np
from neuralmonkey.decoders.autoregressive import AutoregressiveDecoder
from neuralmonkey.decoders.sequence_labeler import SequenceLabeler
from neuralmonkey.decorators import tensor
from neuralmon... | ufal/neuralmonkey | neuralmonkey/runners/xent_runner.py | Python | bsd-3-clause | 1,344 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, scrub
from erpnext.stock.utils import get_incoming_rate
from erpnext.controllers.queries import get_match_cond
from ... | ESS-LLP/erpnext-medical | erpnext/accounts/report/gross_profit/gross_profit.py | Python | gpl-3.0 | 13,761 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | bmaggard/luigi | luigi/scheduler.py | Python | apache-2.0 | 42,021 |
from datetime import datetime, timedelta
from corehq.apps.locations.dbaccessors import get_users_by_location_id
from corehq.apps.sms.api import send_sms_to_verified_number
from corehq.util.translation import localize
from dimagi.utils.dates import get_business_day_of_month_before
from corehq.apps.locations.models impo... | qedsoftware/commcare-hq | custom/ilsgateway/tanzania/handlers/messageinitiator.py | Python | bsd-3-clause | 7,307 |
'''
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Luigi Pirelli (luipir@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, either version 3 of the License, or
# (at your option) any lat... | faunalia/rt_geosisma_inizializzaevento | ExportDBThread.py | Python | gpl-3.0 | 18,122 |
# Copyright (c) 2014 - 2016 townhallpinball.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, modify, merge, p... | town-hall-pinball/project-omega | pin/machine/gi.py | Python | mit | 1,728 |
from werkzeug.wrappers import Response
import sqlite3
def page(config,template_name,context={},mimetype='text/html'):
t = config['jinja_env'].get_template(template_name)
return Response(t.render(context), mimetype=mimetype)
def db_connect(config):
conn=sqlite3.connect(config['db'])
conn.row_factory = sqlite3.Row
... | zbanks/landfill | landfill/common.py | Python | mit | 333 |
#! /usr/bin/env python
# Copyright 2019 John Hanley.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, me... | jhanley634/testing-tools | problem/numeric/sqrt_test.py | Python | mit | 1,740 |
#!/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 distributed... | cmelange/ansible | lib/ansible/modules/cloud/amazon/ec2_lc.py | Python | gpl-3.0 | 13,170 |
#
# rpclib - Copyright (C) rpclib contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This lib... | martijnvermaat/rpclib | src/rpclib/test/wsdl/defult_services.py | Python | lgpl-2.1 | 1,359 |
# ----------------------------------------------------------------------
# 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 apply:
#
# This progra... | 0x0all/nupic | examples/opf/clients/hotgym/anomaly/model_params.py | Python | gpl-3.0 | 9,110 |
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from time import time
from sklearn.datasets import fetch_openml
from sklearn_extra.kernel_methods import EigenProClassifier
from sklearn.svm import SVC
rng = np.random.RandomState(1)
# Generate sample data from mnist
mnist = fetch_openml("mnist_784... | scikit-learn-contrib/scikit-learn-extra | benchmarks/_bench/eigenpro_plot_noisy_mnist.py | Python | bsd-3-clause | 3,479 |
import unittest
from parser import parseFeatures
from writers.baseWriter import AbstractFeatureWriter
class TestFeatureWriter(AbstractFeatureWriter):
def __init__(self, name=None):
self._name = name
self._instructions = []
def getData(self):
data = []
for token, obj in self._... | jamesgk/feaTools | Lib/feaTools/test.py | Python | mit | 28,027 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.