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
import os def test_output_file_get_filename_display_returns_correct_string_without_file(output_file, db): assert output_file.get_filename_display() == '' def test_output_file_get_filename_display_returns_correct_string(output_file_with_file, output_file_filename, db): output_file = output_file_with_file ...
geometalab/osmaxx
tests/excerptexport/models/test_output_file.py
Python
mit
1,468
''' Created on Oct 10, 2012 @author: Gary ''' from housemonitor.lib.base import Base from xbee.zigbee import ZigBee from housemonitor.lib.constants import Constants import abc import time class XBeeCommunications( Base, object ): ''' classdocs ''' __metaclass__ = abc.ABCMeta serial_id = None ...
gary-pickens/HouseMonitor
housemonitor/inputs/zigbeeinput/xbeecommunications.py
Python
mit
1,537
#!/usr/bin/env python # check_snmp_time2.py - Check # Copyright (C) 2016 Retakfual # 2016-2019 rsmuc <rsmuc@sec-dev.de> # This file is part of "Health Monitoring Plugins". # "Health Monitoring Plugins" is free software: you can redistribute it and/or modify # it under the terms of the GN...
rsmuc/health_monitoring_plugins
health_monitoring_plugins/check_snmp_time2/check_snmp_time2.py
Python
gpl-2.0
2,141
import pytest import numpy as np import six import pescador import test_utils as T @pytest.mark.parametrize('copy', [False, True]) @pytest.mark.parametrize('timeout', [None, 0.5, 2, 5]) def test_zmq(copy, timeout): stream = pescador.Streamer(T.finite_generator, 200, size=3, lag=0.001) reference = list(stream)...
bmcfee/pescador
tests/test_zmq_stream.py
Python
isc
2,096
# !/usr/bin/env python # coding: utf-8 # filter()把传入的函数依次作用于每个元素,然后根据返回值是True还是False决定保留还是丢弃该元素 def is_odd(n): return n % 2 == 1 l = [1, 2, 4, 5, 6, 8, 19] print filter(is_odd, l) def not_empty(s): return s and s.strip() l = ['A', ' ', None, 'C', ' '] print filter(not_empty, l)
snownothing/Python
liaoxuefeng.com/018-Filter.py
Python
mit
376
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Adam Števko <adam.stevko@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
hryamzik/ansible
lib/ansible/modules/network/illumos/dladm_linkprop.py
Python
gpl-3.0
7,835
# Copyright 2014 ETH Zurich # # 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, sof...
caterinaurban/Typpete
typpete/tests/scion/lib/path_store.py
Python
mpl-2.0
20,490
import pytest from kvpio import api_base def pytest_addoption(parser): parser.addoption( '--local', action='store_true', default=False, help='use localhost for testing rather than api.kvp.io' ) def pytest_generate_tests(metafunc): if 'api_base' in metafunc.fixturenames:...
kvpio/kvp.io-python
test/conftest.py
Python
mit
1,812
# Generated by Django 2.1.3 on 2018-11-23 06:57 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('drf_user', '0004_auto_20181015_1551'), ] operations =...
iamhssingh/django-userprofile
drf_user/migrations/0005_auto_20181123_0657.py
Python
gpl-3.0
1,309
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module def get_storage(import_path): """ Imports the message storage class described by import_path, where import_path is the full Python path to the class. """ try: ...
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.5/django/contrib/messages/storage/__init__.py
Python
bsd-3-clause
1,185
# -*- 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...
oliverhr/odoo
addons/sale_stock/sale_stock.py
Python
agpl-3.0
26,609
# # 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 # ...
pratikmallya/heat
heat/engine/resources/openstack/mistral/cron_trigger.py
Python
apache-2.0
4,295
# -*- coding: utf-8 -*- # Copyright (C) 2013-2014 Ivo Nunes/Vasco Nunes # 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 versio...
mskala/birdie
birdieapp/gui/userbox.py
Python
gpl-3.0
10,112
import enum class BugStatus(enum.Enum): new = 7 incomplete = 6 invalid = 5 wont_fix = 4 in_progress = 3 fix_committed = 2 fix_released = 1 print('\nMember name: {}'.format(BugStatus.wont_fix.name)) print('Member value: {}'.format(BugStatus.wont_fix.value))
jasonwee/asus-rt-n14uhp-mrtg
src/lesson_data_structures/enum_create.py
Python
apache-2.0
287
#!/usr/bin/python # -*- coding: utf-8 -*- """ Test the speed of rapidly updating multiple plot curves """ ## Add path to library (just for examples; you do not need this) import initExample from pyqtgraph.Qt import QtGui, QtCore import numpy as np import pyqtgraph as pg from pyqtgraph.ptime import time #QtGui.QAppli...
ibressler/pyqtgraph
examples/MultiPlotSpeedTest.py
Python
mit
1,754
import sys,os from pymongo import MongoClient import importlib import SwitchHandler import CameraHandler import SensorHandler from pprint import pprint class CommandHandler(object): """docstring for CommandHandler""" def __init__(self, dbconn, command): super(CommandHandler, self).__init__() self.dbconn = dbcon...
t1g0r/ramey
src/backend/command/CommandHandler.py
Python
gpl-3.0
1,966
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api, _ from odoo.exceptions import UserError, ValidationError import re from odoo.tools.misc import formatLang class AccountMove(models.Model): _inherit = "account.move" l10n_latam_amount_untaxed = f...
ddico/odoo
addons/l10n_latam_invoice_document/models/account_move.py
Python
agpl-3.0
14,050
from distutils.core import setup, Extension ext_modules = [ Extension( name = 'cthreading', sources = ['cthreading.c', 'src/threadpool.c', 'src/threading.c'], include_dirs = ['inc'], ) ] setup( name = 'cthreading', author = 'Continuum Analytics, Inc.', ext_modules = ext_mod...
pykit/pykit-threads
pykit_threads/threadpool/setup.py
Python
bsd-3-clause
328
# by TR from matplotlib.mlab import psd from numpy.fft.helper import fftfreq from obspy.core import Trace as ObsPyTrace from obspy.signal.util import nextpow2 from scipy.fftpack import fft, ifft import scipy.interpolate from sito import util from sito.util import filterResp, fillArray from sito.xcorr import timeNorm, ...
trichter/sito
trace.py
Python
mit
17,972
from uuid import uuid4 from django.test import TestCase, RequestFactory from shame.models import Store, StoreTemplate from shame.views import renderwithstoretemplate class RenderWithStoreTemplateTest(TestCase): def test_usefile(self): request = RequestFactory().get('/some/page') request.store = o...
tps12/freezing-shame
freezing/shame/tests/views/test_renderwithstoretemplate.py
Python
gpl-3.0
1,868
# -*- coding: utf-8 -*- # # Copyright (C) 2014-2015 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.com/license.html. # # This software consists ...
pkdevbox/trac
trac/versioncontrol/web_ui/tests/log.py
Python
bsd-3-clause
21,838
import numpy as np import pytest import scipy as sp from scipy.stats import shapiro import openmc import openmc.lib def test_t_percentile(): # Permutations include 1 DoF, 2 DoF, and > 2 DoF # We will test 5 p-values at 3-DoF values test_ps = [0.02, 0.4, 0.5, 0.6, 0.98] test_dfs = [1, 2, 5] # The...
nelsonag/openmc
tests/unit_tests/test_math.py
Python
mit
7,654
# Case Conductor is a Test Case Management system. # Copyright (C) 2011 uTest Inc. # # This file is part of Case Conductor. # # Case Conductor 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...
mozilla/caseconductor-ui
ccui/results/views.py
Python
gpl-3.0
5,180
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Race.size' db.alter_column('dnd_race', 'size_id', self.gf('django.db.models.fields.relat...
gregpechiro/dndtools
dndtools/dnd/migrations/0092_auto__chg_field_race_size__chg_field_race_space__chg_field_race_reach.py
Python
mit
43,290
# Copyright 2012 Nebula, 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 agree...
spandanb/horizon
horizon/browsers/views.py
Python
apache-2.0
1,982
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, 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 # # ...
1ukash/horizon
horizon/dashboards/admin/instances/tests.py
Python
apache-2.0
6,189
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
Azure/azure-sdk-for-python
sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_services_operations.py
Python
mit
7,843
import fresh_tomatoes import media toy_story = media.Movie("Toy Story", "A story of a boy and his toys that come to life", "http://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg", "https://www.youtube.com/watch?v=vwyZH85NQC4") #print(toy_sto...
tuanvu216/udacity-course
programming_foudations_with_python/entertainment_center.py
Python
mit
1,734
from logging.config import dictConfig from environs import Env from importlib.metadata import Distribution pkg = Distribution.from_name(__package__) class Config: """ Base configuration """ DEBUG = False TESTING = False SERVER_VERSION = pkg.version def __init__(self): # Environ...
FNNDSC/pman
pman/config.py
Python
mit
4,754
# # This file is part of Dragonfly. # (c) Copyright 2019 by David Zurow # Licensed under the LGPL. # # Dragonfly 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 3 of the License, or...
Versatilus/dragonfly
dragonfly/engines/backend_kaldi/audio.py
Python
lgpl-3.0
21,923
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: https://sickrage.github.io # Git: https://github.com/SickRage/SickRage.git # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free...
b0ttl3z/SickRage
sickbeard/search.py
Python
gpl-3.0
30,123
""" The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters of an estimator. """ from __future__ import print_function # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # ...
WangWenjun559/Weiss
summary/sumy/sklearn/grid_search.py
Python
apache-2.0
34,641
from common.models import Position, Region, TeamMember from django.contrib.auth import get_user_model from rest_framework import status from rest_framework.authtoken.models import Token from rest_framework.reverse import reverse from rest_framework.test import APIRequestFactory, APITestCase from teams.models import Tea...
prattl/teamfinder
api/common/api/tests.py
Python
apache-2.0
11,895
#!/usr/bin/python # Copyright 2018 Big Switch Networks, 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...
wolverineav/networking-bigswitch
build_packages/update_wiki.py
Python
apache-2.0
2,178
import sys from greenery.lego import parse regexes = sys.argv[1:] if len(regexes) < 2: print("Please supply several regexes to compute their intersection, union and concatenation.") print("E.g. \"19.*\" \"\\d{4}-\\d{2}-\\d{2}\"") else: p = parse(regexes[0]) for regex in regexes[1:]: p &= parse(regex) print("I...
AdeebNqo/sublimegen
src/greenery/main.py
Python
apache-2.0
562
import numpy as np NR_PER_CONDITION = 1000 neuro_sigma = 4 neuro_mean = 0 satis_sigma = 4 satis_mean = 0 print "Start drawing" bins = { 5: np.array([-6, -3, 0, 3, 6]), 7: np.array([-6, -4, -2, 0, 2, 4, 6]) } borders = { 5: np.array([-4.5,-1.5,1.5,4.5]), 7: np.array([-5.,-3.,-1.,1,3,5]) } 'outpu...
mpauly/psych-simulation
simulate.py
Python
apache-2.0
1,499
from .settings import * # NOQA DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(PROJECT_ROOT, 'db.sqlite3'), } } CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', } } DEBUG = True TASTYPIE_FULL_DEBUG = Tru...
phalt/pokeapi
config/local.py
Python
bsd-3-clause
322
# 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/v1beta1_flow_schema_spec.py
Python
apache-2.0
8,042
from openstatesapi.jurisdiction import make_jurisdiction J = make_jurisdiction('wa') J.url = 'http://wa.gov'
sunlightlabs/billy
billy2pupa/wa.py
Python
bsd-3-clause
110
# -*- coding: utf-8 -*- # Copyright 2012 OpenStack Foundation # Copyright 2013 IBM Corp. # # 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 # ...
yanheven/keystone
keystone/tests/unit/test_backend_ldap.py
Python
apache-2.0
134,073
import logging import os import numpy as np import parmap import networkx as nx from yass.cluster.getptp import GETPTP, GETCLEANPTP from yass import mfm # from yass import read_config # CONFIG = read_config() def run_split_on_ptp(savedir, fname_spike_index, CONFIG, ...
paninski-lab/yass
src/yass/cluster/ptp_split.py
Python
apache-2.0
8,988
""" Authorization rules related to content management. """ import user_tasks.rules user_tasks.rules.add_rules()
edx/edx-platform
cms/djangoapps/contentstore/rules.py
Python
agpl-3.0
115
import os # toolchains options ARCH='arm' CPU='cortex-m4' CROSS_TOOL='gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = r'...
aozima/rt-thread
bsp/frdm-k64f/rtconfig.py
Python
gpl-2.0
2,384
import unittest import utils from tree import TreeNode def height(root): if not root: return -1 return 1 + max(height(root.left), height(root.right)) def match(a, b): if not a: return not b if not b: return False return a.val == b.val and match(a.left, b.left) and match(...
chrisxue815/leetcode_python
problems/test_0572_recursive_dfs.py
Python
unlicense
1,389
from flask import current_app, flash, abort from willow.app import willow_signals from slugify import slugify from willow.models import db, mixins class Venue(db.Model, mixins.WLWMixin): pass
undergroundtheater/willow
willow/models/venue.py
Python
mpl-2.0
198
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # 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...
googleapis/python-securitycenter
google/cloud/securitycenter_v1/types/run_asset_discovery_response.py
Python
apache-2.0
1,567
# Copyright 2010-2015 RethinkDB, all rights reserved. import os, setuptools, sys modulePath = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'rethinkdb') sys.path.insert(0, modulePath) from version import version sys.path.remove(modulePath) conditionalPackages = [] if 'upload' in sys.argv: # ensure that u...
niieani/rethinkdb
drivers/python/setup.py
Python
agpl-3.0
1,483
# config.py --- # # Filename: config.py # Description: # Author: Subhasis Ray # Maintainer: # Created: Fri May 4 14:46:29 2012 (+0530) # Version: # Last-Updated: Fri May 4 21:05:04 2012 (+0530) # By: Subhasis Ray # Update #: 140 # URL: # Keywords: # Compatibility: # # # Commentary: # # # ...
dilawar/moose-full
moose-examples/traub_2005/py/trbconfig.py
Python
gpl-2.0
4,129
import serial PORT = "/dev/ttyACM3" beginStr = "101010101010101001" communication = serial.Serial(PORT, 115200, timeout=4) class Decodeur(object): def __init__(self): self.communication = serial.Serial(PORT, 115200, timeout=4) self.longueurMessage = 32 self.longueurEncapsulation = 18 ...
phil888/Design3
Livrable3/Remise/Code source et tests/source/Decodeur.py
Python
gpl-3.0
3,262
import os __version__ = (0, 2, 2) os.environ.setdefault('PGCLIENTENCODING', 'UTF-8') os.environ.setdefault('SHAPE_ENCODING', 'UTF-8') os.environ.setdefault('PG_USE_COPY', 'yes')
davisc/django-osgeo-importer
osgeo_importer/__init__.py
Python
gpl-3.0
179
#!/usr/bin/python # -*- coding:utf-8 -*- from scrapy.spider import Spider from scrapy.http import Request from scrapy.selector import Selector from scrapy import log from funs.items import FunsItem class FunsSpider(Spider): #log.start("log",loglevel='INFO') name="funs" allowed_domains = ["http://ent.sina.com.cn/"...
huran2014/huran.github.io
program_learning/python/Scrapy/funs/funs/spiders/funs_spider.py
Python
gpl-2.0
1,760
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import collections i...
pombredanne/pants
tests/python/pants_test/task/test_testrunner_task_mixin.py
Python
apache-2.0
16,660
from metakernel.tests.utils import get_kernel, get_log_text def test_reload_magics_magic(): kernel = get_kernel() kernel.do_execute("%reload_magics") text = get_log_text(kernel) for item in "%cd %connect_info %download %edit %help %html %install_magic %javascript %kernel %kx %latex %load %lsmagic %ma...
Calysto/metakernel
metakernel/magics/tests/test_reload_magics_magic.py
Python
bsd-3-clause
592
# # Cookie jar for sequence building # # Author: Gregory Fleischer (gfleischer@gmail.com) # # Copyright (c) 2011 RAFT Team # # This file is part of RAFT. # # RAFT 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...
chp1084/raft
core/web/SequenceBuilderCookieJar.py
Python
gpl-3.0
2,503
from io import StringIO import re import types import sys from contexts.plugins import argv_forwarder from contexts.plugins.reporting import cli from contexts.plugins.reporting import teamcity from contexts import setup, action, assertion from .. import tools class TeamCitySharedContext: def shared_context(self):...
benjamin-hodgson/Contexts
test/plugin_tests/reporting_tests/teamcity_tests.py
Python
mit
24,240
from django.core.management.base import NoArgsCommand from notifier.models import Notifier from sms.views import sendsms # OH NO COUPLING class Command(NoArgsCommand): """ Finds all notifications that can be sent out, updates them, and sends them out. This will only send notifications that haven't been tr...
hwayne/safehouse
notifier/management/commands/notify.py
Python
apache-2.0
1,149
import coloredlogs import logging import sys coloredlogs.install(fmt='%(message)s') def create_logger(): #logging.basicConfig(format='%(levelname)s - %(message)s') logging.basicConfig(format='%(message)s') root = logging.getLogger() root.setLevel(logging.getLevelName('INFO')) #Add handler for st...
ericforbes/post-review
postreview/logger.py
Python
mit
669
import yaml with open('config.yaml', 'r') as f: loaded = yaml.load(f.read()) locals().update(loaded)
b1naryth1ef/rowboat
rowboat/config.py
Python
mit
110
tickets = [] # allocate new tickets def make_tickets(): for i in range(10): tickets.append("ticket_" + str(i)) # log all tickets currently in the system to terminal def show_all_tickets(): for ticket in tickets: print ticket if '__main__' == __name__: make_tickets() show_all_t...
kouritron/uvs
examples/break_3way_merge/tickets_ca.py
Python
bsd-3-clause
328
# -*- coding: utf-8 -*- import time from modules.core.props import Property, StepProperty from modules.core.step import StepBase from modules import cbpi @cbpi.step class HERMSStep(StepBase): ''' Just put the decorator @cbpi.step on top of a method ''' # Properties target_temp = Property.Number("T...
tlareywi/HERMSStep
__init__.py
Python
mit
2,411
# -*- coding: utf-8 -*- """ Copyright (c) 2011 Lucas D'Avila - email lucassdvl@gmail.com / twitter @lucadavila This file is part of web2py-cms. web2py-cms is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL v3) as published by the Free Software F...
gilsondev/web2py-cms
models/t_post.py
Python
lgpl-3.0
1,900
#!/usr/bin/env python # # cloudlet infrastructure for mobile computing # # author: kiryong ha <krha@cmu.edu> # # copyright (c) 2011-2013 carnegie mellon university # licensed under the apache license, version 2.0 (the "license"); # you may not use this file except in compliance with the license. # you may ob...
cmusatyalab/elijah-provisioning
elijah/provisioning/stream_client.py
Python
apache-2.0
10,061
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for the file system implementation using pybde.""" import unittest from dfvfs.lib import definitions from dfvfs.path import factory as path_spec_factory from dfvfs.resolver import context from dfvfs.vfs import bde_file_system from tests import test_lib as shared...
joachimmetz/dfvfs
tests/vfs/bde_file_system.py
Python
apache-2.0
2,491
import logging import sys from easy_alert.entity.level import Level if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest class TestLevel(unittest.TestCase): def test_init_error(self): def assert_err(arg, expect): with self.assertRaises(KeyError) as cm: ...
mogproject/easy-alert
tests/easy_alert/entity/test_level.py
Python
apache-2.0
1,712
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 7, transform = "BoxCox", sigma = 0.0, exog_count = 0, ar_order = 0);
antoinecarme/pyaf
tests/artificial/transf_BoxCox/trend_ConstantTrend/cycle_7/ar_/test_artificial_1024_BoxCox_ConstantTrend_7__0.py
Python
bsd-3-clause
265
# # QAPI visitor generator # # Copyright IBM, Corp. 2011 # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # Michael Roth <mdroth@linux.vnet.ibm.com> # # This work is licensed under the terms of the GNU GPLv2. # See the COPYING.LIB file in the top-level directory. from ordereddict import OrderedDict from qapi ...
HusterWan/qemu-1.7.2-stable
scripts/qapi-visit.py
Python
gpl-2.0
14,043
#! /usr/bin/env python # Slightly modified copy of Lib/test/regrtest.py from Python 1.5.1 """Regression test. This will find all modules whose name is "test_*" in the test directory, and run them. Various command line options provide additional facilities. Command line options: -v: verbose -- run tests in verbose...
Pikecillo/genna
external/PyXML-0.8.4/test/regrtest.py
Python
gpl-2.0
6,734
from rcj_soccer.base import app, db from rcj_soccer.models import Competition from flask import render_template, jsonify, request from datetime import datetime from dateutil.parser import parse from rcj_soccer.util import config, obj_to_dict import logging logger = logging.getLogger(__name__) @app.route("/") def lis...
rcjaustralia/rcj-soccer-platform
rcj_soccer/views/competition.py
Python
mit
3,192
import enum class ColorTransfer(enum.Enum): UNSPECIFIED = 'UNSPECIFIED' BT709 = 'BT709' GAMMA22 = 'GAMMA22' GAMMA28 = 'GAMMA28' SMPTE170M = 'SMPTE170M' SMPTE240M = 'SMPTE240M' LINEAR = 'LINEAR' LOG = 'LOG' LOG_SQRT = 'LOG_SQRT' IEC61966_2_4 = 'IEC61966_2_4' BT1361_ECG = 'BT...
bitmovin/bitmovin-python
bitmovin/resources/enums/color_transfer.py
Python
unlicense
508
# ---------------------------------------------------------------------- # 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...
numenta/nupic.vision
src/nupic/vision/regions/PictureSensorExplorers/HorizontalBlock.py
Python
agpl-3.0
3,159
import copy from django.conf import settings from olympia.constants.promoted import RECOMMENDED import olympia.core.logger from olympia import amo from olympia.amo.indexers import BaseSearchIndexer from olympia.amo.utils import attach_trans_dict from olympia.amo.celery import create_chunked_tasks_signatures from olym...
bqbn/addons-server
src/olympia/addons/indexers.py
Python
bsd-3-clause
24,877
from Components.Harddisk import harddiskmanager from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection, ConfigText, ConfigNumber, ConfigSet, ConfigLocations, ConfigSelectionNumber, ConfigClock, ConfigSlider from Tools.Directories import resolveFilename, SCOPE_HDD, defaultRecordingLocation from enigma...
berny6969/enigma2
lib/python/Components/UsageConfig.py
Python
gpl-2.0
26,202
import math from rpython.rlib import rfloat from ..base import BaseTopazTest class TestMath(BaseTopazTest): def assert_float_equal(self, result, expected, eps=1e-15): assert abs(result - expected) < eps def test_domain_error(self, space): space.execute("Math::DomainError") def test_pi(...
babelsberg/babelsberg-r
tests/modules/test_math.py
Python
bsd-3-clause
9,799
# -*- 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...
OpusVL/odoo
addons/hr_attendance/hr_attendance.py
Python
agpl-3.0
9,132
import socket from os.path import basename from math import floor from i3pystatus import IntervalModule, formatp from i3pystatus.core.util import TimeWrapper class MPD(IntervalModule): """ Displays various information from MPD (the music player daemon) .. rubric:: Available formatters (uses :ref:`format...
plumps/i3pystatus
i3pystatus/mpd.py
Python
mit
5,190
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import random import re from datetime import datetime, timedelta from odoo import api, fields, models, modules, tools class ImLivechatChannel(models.Model): """ Livechat Channel Define a commun...
maxive/erp
addons/im_livechat/models/im_livechat_channel.py
Python
agpl-3.0
12,297
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest from _inherit3 import * class testInherit3(unittest.TestCase): def ...
NixaSoftware/CVis
venv/bin/libs/python/pyste/tests/inherit3UT.py
Python
apache-2.0
770
#! /usr/bin/env python import unittest import sys import os import re import decimal import shutil from subprocess import check_call, CalledProcessError # Ensure that Python can find and load the GSLab libraries #os.chdir(os.path.dirname(os.path.realpath(__file__))) sys.path.append('../..') from gslab_...
gslab-econ/gslab_python
gslab_fill/tests/test_tablefill.py
Python
mit
7,464
#!/usr/local/bin/python # # BitKeeper hook script. # # svn_buildbot.py was used as a base for this file, if you find any bugs or # errors please email me. # # Amar Takhar <amar@ntp.org> ''' /path/to/bk_buildbot.py --repository "$REPOS" --revision "$REV" --branch \ "<branch>" --bbserver localhost --bbport 9989 ''' im...
zozo123/buildbot
master/contrib/bk_buildbot.py
Python
gpl-3.0
4,579
# Copyright 2012-2016 The Meson development team # 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 agree...
QuLogic/meson
mesonbuild/backend/backends.py
Python
apache-2.0
77,063
""" Copyright 2006-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> 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 late...
sjmh/cobbler
cobbler/item_repo.py
Python
gpl-2.0
7,839
import re import sys import json import tensorflow as tf import optimizees as optim import util import util.paths as paths import util.tf_utils as tf_utils from opts import model_trainer, distributed def will_overwrite_snapshots(snapshots_path, eid): if not snapshots_path.exists(): return False sna...
justanothercoder/LSTM-Optimizer-TF
training.py
Python
mit
2,884
########################################################################## # # Copyright 2008-2010 VMware, Inc. # All Rights Reserved. # # 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 withou...
tuanthng/apitrace
wrappers/dlltrace.py
Python
mit
2,690
""" Main functions for generating ABED results """ from .cache import update_result_cache from .cv_tt import cvtt_tables from .assess import assess_tables from .export import export_tables from ..conf import settings from ..html.main import generate_html def make_results(task_dict, skip_cache=False): """ This i...
GjjvdBurg/ABED
abed/results/main.py
Python
gpl-2.0
832
import chatterbot from chatterbot import ChatBot # importing the chatbot from chatterbot.trainers import ListTrainer # importing the training list for the chatbot name = "PYSHA" chatbot = ChatBot(name, read_only=False) chatbot = ChatBot("PYSHA") # passing in the name for the chatbot conversations = ["Hello",...
shafaypro/PYSHA
Chatstuff/_sample.py
Python
gpl-3.0
651
try: from . import version except ImportError: # pragma: no cover from . import _version as version __version__ = version.version from .contact_map import ( ContactMap, ContactFrequency, ContactDifference, AtomMismatchedContactDifference, ResidueMismatchedContactDifference, OverrideTopologyContac...
dwhswenson/contact_map
contact_map/__init__.py
Python
lgpl-2.1
746
from django.apps import AppConfig class CoursesConfig(AppConfig): name = 'courses' verbose_name = "Course Administration"
gitsimon/tq_website
courses/apps.py
Python
gpl-2.0
132
"""Fetch NASA GPM data. IMERG-Early has at most 4 hour latency. IMERG-Late has about 14 hours. Replace HHE with HHL IMERG-Final is many months delayed Drop L in the above. 2001-today RUN from RUN_20AFTER.sh for 5 hours ago. """ import subprocess import json import datetime import os import sys import tempfile ...
akrherz/iem
scripts/dl/download_imerg.py
Python
mit
3,970
from ftplib import FTP, error_perm import os from os.path import dirname import re from transmat.util import do_it LIST_RE = re.compile('^(\S+).*\s+(20\d\d|\d\d\:\d\d)\s(.*?)$') class FTPSession(object): """An object representing a session with an FTP server. This attempts to implement a robust session. ...
cpressey/transmat
src/transmat/remote.py
Python
unlicense
6,155
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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...
tzpBingo/github-trending
codespace/python/tencentcloud/sms/v20190711/errorcodes.py
Python
mit
16,804
# -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # 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...
rogerthat-platform/rogerthat-backend
src-test/rogerthat_tests/mobicage/bizz/test_roles.py
Python
apache-2.0
5,001
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Trond Hindenes <trond@hindenes.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 L...
Nicop06/ansible
lib/ansible/modules/windows/win_chocolatey.py
Python
gpl-3.0
7,511
# -*- coding: utf-8 -*- from django.core.urlresolvers import reverse # view imports from django.shortcuts import get_object_or_404 from django.views.generic import DetailView from django.views.generic import RedirectView from django.views.generic import UpdateView from django.views.generic import ListView from django....
goldhand/onegreek
onegreek/users/views.py
Python
bsd-3-clause
12,581
#!/usr/bin/python """Test of push button output.""" from macaroon.playback import * import utils sequence = MacroSequence() sequence.append(KeyComboAction("<Control>f")) sequence.append(TypeAction("Button Boxes")) sequence.append(KeyComboAction("Return")) sequence.append(PauseAction(3000)) sequence.append(utils.St...
GNOME/orca
test/keystrokes/gtk3-demo/role_push_button.py
Python
lgpl-2.1
2,278
""" Support for the Meraki CMX location service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.meraki/ """ import asyncio import logging import json import voluptuous as vol import homeassistant.helpers.config_validation as cv from home...
ewandor/home-assistant
homeassistant/components/device_tracker/meraki.py
Python
apache-2.0
4,571
import unittest, time, sys, random, json sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_rf, h2o_util, h2o_import as h2i import h2o_browse as h2b import h2o_jobs OVERWRITE_RF_MODEL = False class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmeth...
rowhit/h2o-2
py/testdir_single_jvm/test_speedrf_big1_nopoll.py
Python
apache-2.0
3,630
# -*- coding: utf-8 -*- ## Comments and reviews for records. ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 ...
EUDAT-B2SHARE/invenio-old
modules/webcomment/lib/webcomment_templates.py
Python
gpl-2.0
133,333
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you m...
aristanetworks/arista-ovs-nova
nova/virt/fake.py
Python
apache-2.0
14,277
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
AutorestCI/azure-sdk-for-python
azure-servicefabric/azure/servicefabric/models/property_batch_description_list.py
Python
mit
1,084
# Copyright 2017 Rackspace, 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 ag...
NeCTAR-RC/horizon
openstack_dashboard/dashboards/project/cgroups/panel.py
Python
apache-2.0
1,844