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 time
import sys
import shutil
import os
if (sys.version_info >= (2,7)):
import unittest
else:
import unittest2 as unittest
from resource_suite import ResourceBase
from pydevtest_common import assertiCmd, assertiCmdFail, interruptiCmd, getiCmdOutput
import pydevtest_sessions as s
import commands
import os... | leesab/irods | tests/pydevtest/test_workflow_suite.py | Python | bsd-3-clause | 3,135 |
import logging
log = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO,
filename='%s.log' % __name__,
filemode='a',
format='%(asctime)s %(levelname)s %(module)s %(message)s')
in_mask = 0
in_shift = 0
out_mask = 0
out_shift = 0
flow_mask = 0
... | chamaken/nurs | examples/python/filter/markif.py | Python | gpl-2.0 | 985 |
# Copyright (c) by it's authors.
# Some rights reserved. See LICENSE, AUTHORS.
import wallaby.FX as FX
import wallaby.FXUI as FXUI
from wallaby.qt_combat import *
import sys, re, copy
from wallaby.frontends.qt.meta import *
from wallaby.pf.room import House
from wallaby.pf.peer.viewer import *
from wallaby.pf.peer.... | FreshXOpenSource/wallaby-frontend-qt | wallaby/frontends/qt/widgets/baseWidget.py | Python | bsd-2-clause | 13,302 |
from util import testAttribute
from util import testIntAttribute
def test():
print 'testing source code syntax'
from xml.dom.html import HTMLBodyElement
from xml.dom import implementation
doc = implementation.createHTMLDocument('Title')
b = doc.createElement('Body');
print 'testing get/set '
... | Pikecillo/genna | external/PyXML-0.8.4/test/dom/html/test_body.py | Python | gpl-2.0 | 572 |
# -*- encoding: utf-8 -*-
# pilas engine: un motor para hacer videojuegos
#
# Copyright 2010-2014 - Hugo Ruscitti
# License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# Website - http://www.pilas-engine.com.ar
import sonido
from pilasengine import configuracion
class Sonidos(object):
def __init__(sel... | irvingprog/python-pilas-experimental | pilasengine/sonidos/__init__.py | Python | lgpl-3.0 | 607 |
#!/usr/bin/env python
#
# HoneyAgent.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY... | buffer/thug | thug/Analysis/honeyagent/HoneyAgent.py | Python | gpl-2.0 | 3,843 |
#!/usr/bin/python
# This script updates the database to handle version 0.4.0 stuff.
# Since this is the first change to the database schema, we don't really have to check anything
import sqlite3
db = sqlite3.connect('/etc/openstatus/openstatus.db', check_same_thread = False, isolation_level=None)
db.row_factory=sqlit... | nickmoeck/OpenStatus | update-db.py | Python | agpl-3.0 | 1,396 |
import kivy
kivy.require('1.4.0')
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.camera import Camera
from kivy.uix.button import Button
from kivy.core.window import Window
from tracking.feature_based.camera_tracker import CameraTracker
from tracking.feature_based.feature_tracker import Fe... | gusriobr/kvCameraTracker | lab/camera_detector.py | Python | mit | 1,299 |
import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
from testrail.base import TestRailBase
class TestBase(unittest.TestCase):
def setUp(self):
class Foo(TestRailBase):
def __init__(self, id):
self.id = id
self.base = Foo(123)
... | travispavek/testrail-python | tests/test_base.py | Python | mit | 480 |
import asyncio
from asyncio.subprocess import PIPE, STDOUT
from subprocess import CalledProcessError
capture_params = {
'stdout': (PIPE, None),
'stderr': (None, PIPE),
'both' : (PIPE, PIPE),
'combine':(PIPE, STDOUT),
'none' : (None, None)
}
class CompletedProcess:
# This feels familiar
d... | takluyver/vclurk | vclurk/git/cmd.py | Python | mit | 1,010 |
#!/usr/bin/env python
"""
Command line application for monitoring Tor relays, providing real time status
information. This is the starter for the application, handling and validating
command line parameters.
"""
import os
import sys
import time
import getopt
import getpass
import locale
import platform
import versio... | refnode/arm | src/starter.py | Python | gpl-3.0 | 20,694 |
# 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.
#
# This program is distributed in the hope that it will be useful,
# bu... | michel-slm/bodhi | bodhi/services/comments.py | Python | gpl-2.0 | 6,317 |
from typing import Any, Dict
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
from django.template import Library, Node, TemplateSyntaxError
if False:
# no need to add dependency
from django.template.base import Parser, Token
register = Library()
class Mini... | mahim97/zulip | zerver/templatetags/minified_js.py | Python | apache-2.0 | 1,943 |
#!/usr/bin/env python
# Copyright 2016 Jim Pivarski
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | diana-hep/transpiler-rules | setup.py | Python | apache-2.0 | 996 |
import _plotly_utils.basevalidators
class MaxpointsValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="maxpoints", parent_name="choropleth.stream", **kwargs
):
super(MaxpointsValidator, self).__init__(
plotly_name=plotly_name,
paren... | plotly/python-api | packages/python/plotly/plotly/validators/choropleth/stream/_maxpoints.py | Python | mit | 551 |
COMMANDS = {
'debian': [
'which pip || apt-get install -qy python-pip',
'apt-get install -qy supervisor'
],
'redhat': [
'which pip || (yum -y install python-setuptools && easy_install pip)',
'sudo pip install supervisor'
],
'unknown': [
'which pip || ... | ack/docket | docket/platforms.py | Python | mit | 781 |
# Copyright 2019 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... | tensorflow/tensorboard | tensorboard/uploader/uploader_test.py | Python | apache-2.0 | 81,709 |
def is_blank(s):
return set(s) in set('\n\t ')#FIXME
act = ''
def ask_yn(question):
yes = ['yes', 'y', 'sure', 'ok', 'of course']
no = ['no', 'nope', 'n', 'not now']
a = input(question + '\n').strip()
while a not in yes + no:
print('Could not understand you :(')
a = input(question ... | untergrunt/untergrunt | lore/for_robots/mat.py | Python | mit | 1,511 |
# 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... | RobinQuetin/CAIRIS-web | cairis/cairis/TransferEnvironmentProperties.py | Python | apache-2.0 | 1,188 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Xdbedizzy(AutotoolsPackage, XorgPackage):
"""xdbedizzy is a demo of the X11 Double Buffer ... | LLNL/spack | var/spack/repos/builtin/packages/xdbedizzy/package.py | Python | lgpl-2.1 | 740 |
# -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import test_quality_control_from_hr_contract
| alfredoavanzosc/odoo-addons | quality_control_from_hr_contract/tests/__init__.py | Python | agpl-3.0 | 184 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('calendars', '0014_auto_20150718_2121'),
('calendars', '0011_auto_20150718_2036'),
]
operations = [
]
| Fisiu/calendar-oswiecim | webapp/calendars/migrations/0015_merge.py | Python | agpl-3.0 | 301 |
# Copyright 2019 the gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | pszemus/grpc | examples/python/cancellation/client.py | Python | apache-2.0 | 3,376 |
import re
import subprocess
from os.path import join, exists
VREGEX = re.compile("version\s*=\s*'(\d+)\.(\d+)\.(\d+)([a-zA-Z0-9]*)'")
ISRELREGEX = re.compile("release\s*=\s*True")
ISDEVREGEX = re.compile("release\s*=\s*False")
RCEX = re.compile("rc(\d)")
def get_svn_version(chdir):
out = subprocess.Popen(['svn',... | DailyActie/Surrogate-Model | 01-codes/scipy-master/tools/win32/build_scripts/lib.py | Python | mit | 2,010 |
from .generate_report import generate_report
from .report_parameters import report_parameters
from .report_list import report_list
| botswana-harvard/edc-birt-reports | edc_birt_reports/views/__init__.py | Python | gpl-2.0 | 131 |
import os
import importlib
ENVIRONMENT_VARIABLE = 'RMAS_ADAPTER_SETTINGS'
class SettingsLoader(object):
'''
This class is used to import user settings into a standard loaction where
all packages and modules know how to find them based on the setting module
location being stored in an envi... | UoK-Psychology/rmas_adapter | rmas_adapter/conf/__init__.py | Python | mit | 1,037 |
#
# Copyright (c) 2010 Matteo Boscolo
#
# This file is part of PythonCAD.
#
# PythonCAD 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.... | Csega/PythonCAD3 | Generic/Kernel/Db/relationdb.py | Python | gpl-2.0 | 7,230 |
"""
import gen
import chunk
import document
import bar
import layouttable
import imagehtml
import menu
import form
import template
import htmldoc
import json
import js
"""
def Reload():
print "reloading all submodules"
reload(gen)
reload(chunk)
reload(document)
reload(bar)
reload(layouttable)
... | gandrewstone/yadog | PyHtmlGen/__init__.py | Python | gpl-3.0 | 545 |
###############################
# This file is part of PyLaDa.
#
# Copyright (C) 2013 National Renewable Energy Lab
#
# PyLaDa is a high throughput computational platform for Physics. It aims to make it easier to submit
# large numbers of jobs on supercomputers. It provides a python interface to physical input, suc... | pylada/pylada-light | src/pylada/crystal/binary.py | Python | gpl-3.0 | 2,322 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import configparser
from BeautifulSoup import BeautifulSoup
from Helpers import Download
from Helpers import Parser
from Helpers import helpers
# Class will have the following properties:
# 1) name / description
# 2) main name called "ClassName"
# 3) execute function (call... | killswitch-GUI/SimplyEmail | Modules/GitHubGistSearch.py | Python | gpl-3.0 | 3,603 |
#!/bin/env python
'''NCBI Gene Downloading Tool
This program downloads gene data from the ftp server and \
converts data to xml file by using linux.gene2xml tool.
This program checks the last modified time of the database in the server, \
when it tries to download the gene database from the server. \
If the same vers... | bjpop/annokey | annokey/get_ncbi_gene_snapshot_xml.py | Python | bsd-3-clause | 22,163 |
def makePalindrome(string):
"""
Try to make a palidrome out of provided string
return: the palindrome or -1 if you can't create the palindrome
"""
the_single = []
dupes = []
l_string = [x for x in string]
while l_string:
c = l_string.pop(0)
if c not in l_string:
... | sambev/hodgepodge | palindromize.py | Python | mit | 765 |
#read testing json rawdata
#simulate rawdata as realtime data stream
#connecting broker and send data
#docker command to run zookeeper container
#docker run -d -p 2181:2181 -p 2888:2888 -p 3888:3888 --name zookeeper confluent/zookeeper
# docker command to run kafka broker container
# docker run -d -p 9092:9092 -e K... | yjy1663/TIPPERS-Stream-Processing | data_producer.py | Python | mit | 2,543 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2018-02-12 08:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("registrations", "0009_auto_20171027_0928")]
operations = [
migrations.AlterField(
... | praekeltfoundation/ndoh-hub | registrations/migrations/0010_auto_20180212_0802.py | Python | bsd-3-clause | 1,824 |
#!/usr/bin/env python3
import datetime
import json
import os
import re
import tarfile
import tempfile
import pandas as pd
DATA_DIR = os.path.join(os.path.dirname(__name__), 'data')
SCDB_FILENAME = os.path.join(DATA_DIR, 'SCDB_2014_01_caseCentered_Citation.csv')
# only match cases between these terms (inclusive)
SCDB_... | ariddell/scdb-courtlistener | merge-scdb-courtlistener.py | Python | mpl-2.0 | 10,475 |
# Copyright 2014 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | CropCircleSys/bsd-cloudinit | cloudbaseinit/plugins/common/mtu.py | Python | apache-2.0 | 2,079 |
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from specification.views import SimulationListView, dashboard_view
urlpatterns = patterns('specification.views',
url(r'^simulations/$', login_required(SimulationListView.as_view(
template_name="specification/s... | nathangeffen/microsimulator | src/django-ui/interface/specification/urls.py | Python | gpl-3.0 | 466 |
from django.contrib import admin
from . models import Assignment, Chore, Person, Week
admin.site.register(Chore)
admin.site.register(Person)
admin.site.register(Week)
admin.site.register(Assignment)
| taylorschimek/WhatAChore | wac/admin.py | Python | mit | 202 |
from src.gameclasses.cplayer import *
from src.gameclasses.cmap import *
from src.utilclasses.caudiohandler import *
from src.utilclasses.cdialoguehandler import *
class Game(object):
def __init__(self):
"""
Erstellt ein neues GameObjekt, welches wiederum alle bestantteile des Games verwaltet und ... | JanikNex/adventure16 | src/gameclasses/cgame.py | Python | gpl-3.0 | 1,674 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('tags', '0004_auto_20160610_1624'),
]
operations = [
migrations.AddField(
mode... | HelloLily/hellolily | lily/tags/migrations/0005_tag_last_used.py | Python | agpl-3.0 | 515 |
# -*- coding: utf-8 -*-
# #
# Copyright 2021-2021 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://www.vscentrum.be),
# Flemi... | akesandgren/easybuild-framework | easybuild/tools/output.py | Python | gpl-2.0 | 5,524 |
# 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 __future__ import absolute_import
import unittest
from py_utils import camel_case
class CamelCaseTest(unittest.TestCase):
def testString(self):
... | catapult-project/catapult | common/py_utils/py_utils/camel_case_unittest.py | Python | bsd-3-clause | 1,740 |
__author__ = 'hkar'
import Vault.Crypto
import Vault.Key
from test_helpers import *
import os
def test_aes(tmpdir):
# make tmp text files
f = create_test_file(tmpdir)
text = str(f.read())
# define file names
file_in = str(f)
file_out = file_in + ".enc"
# generate random secret
secr... | hkar/get-vault | tests/test_crypto.py | Python | gpl-3.0 | 1,236 |
import datetime
import os
import sys
import time
import warnings
try:
import pytz
except ImportError:
pytz = None
from django.conf import settings
from django.core import serializers
from django.core.urlresolvers import reverse
from django.db import connection
from django.db.models import Min, Max
from django... | akaihola/django | tests/modeltests/timezones/tests.py | Python | bsd-3-clause | 49,481 |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | google-research/google-research | ged_tts/fdsd/eval/scorer.py | Python | apache-2.0 | 3,366 |
from .base import *
from .controller import *
| jdzero/foundation | foundation/backend/views/__init__.py | Python | mit | 46 |
import requests
import json
import hashlib
"""
subscriber status codes for use with API: (undocumented in API)
1 active
2 activation pending
3 not activated
4 resigned
5 soft bouncing
8 hard bouncing
"""
class FreshMail(object):
"""
Custom class for Freshmail REST API
author: Dariusz Stepniak <stepniak.da... | deasek/freshmail-python | freshmail.py | Python | mit | 6,906 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import os
import numpy as np
import tensorflow as tf
from niftynet.contrib.csv_reader.csv_reader import CSVReader
from niftynet.contrib.csv_reader.sampler_csvpatch import CSVPatchSampler
from niftynet.engine.image_window import ... | NifTK/NiftyNet | tests/sampler_csvpatch_v2_test.py | Python | apache-2.0 | 12,178 |
import pytest
from django.core import mail
from test_fixtures.users import user
from .utils import send_activation_email, send_password_reset_email
@pytest.mark.django_db
def test_send_activtion_email(user, rf):
request = rf.request()
send_activation_email(user, request)
assert len(mail.outbox) == 1
@... | creimers/graphene-auth-examples | src/apps/account/test_utils.py | Python | mit | 493 |
#
# Copyright 2011 Michael Larsen <mike.gh.larsen@gmail.com>
#
"""
Peers are the outside entities that each Node communicates with.
"""
import json
import logging
log = logging.getLogger('zht.peer')
class Peer(object):
"""
Construct a new Peer instance.
The synchronization process will also happen, but w... | mghlarsen/ZHT | zht/peer.py | Python | lgpl-3.0 | 3,099 |
#!/usr/bin/python
#
# very rough demo to test out ghost cells
# run with mpirun
#
from __future__ import print_function
try:
import matplotlib.pyplot as plt
from matplotlib.collections import PolyCollection
except ImportError:
print("matplotib is needed to run this demo. Import was not "
"succesf... | MiroK/dolfin | demo/undocumented/ghost-mesh/python/demo_ghost-mesh.py | Python | gpl-3.0 | 4,408 |
#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | diogocs1/comps | web/addons/hr_payroll/report/report_payslip_details.py | Python | apache-2.0 | 5,027 |
# ---------------------------------------------------------------------------
# clist_01o10_a_test.py
# Created on: 2012-11-26 13:12:37.00000
# (generated by ArcGIS/ModelBuilder)
# Description:
# ---------------------------------------------------------------------------
# Import arcpy module
import arcpy
# Check ... | bqb/contour_tooling | clist_01o10_a_test.py | Python | apache-2.0 | 746 |
from django.conf.urls import url
from django.views.generic import ListView, DateDetailView
from simple.articles.models import Article
from simple.articles.views import ArticleDetailView
urlpatterns = [
url(r'^$',
ListView.as_view(queryset=Article.objects.published()),
name='articles-index'),... | danirus/django-comments-xtd | example/simple/articles/urls.py | Python | bsd-2-clause | 502 |
"""
This will do until I can be bothered to create indicator applet to do battery level
"""
import logging
import threading
import datetime
import time
try:
import notify2
except ImportError:
notify2 = None
# TODO https://askubuntu.com/questions/110969/notify-send-ignores-timeout
INTERVAL_FREQ = 60 * 10
NOT... | z3ntu/razer-drivers | daemon/razer_daemon/misc/battery_notifier.py | Python | gpl-2.0 | 4,087 |
# (C) British Crown Copyright 2014 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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
# (at your option) any l... | decvalts/iris | lib/iris/tests/integration/test_pp_constrained_load_cubes.py | Python | gpl-3.0 | 2,825 |
# 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 version.
#
# This program is distributed in the hope that it will ... | soby/ParsePy | parse_rest/core.py | Python | gpl-3.0 | 1,308 |
# Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
# Copyright (c) 2012 Intel Corporation. All rights reserved.
# Copyright (c) 2013 University of Szeged. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, a... | teamfx/openjfx-9-dev-rt | modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/tool/commands/queries.py | Python | gpl-2.0 | 28,180 |
# -*- coding: utf-8 -*-
import unittest
import os
from pprint import pprint
from itertools import cycle
from .fixtures import Memo, PublicKey, PrivateKey
from graphenebase.memo import get_shared_secret, _pad, _unpad, encode_memo, decode_memo
test_cases = [
{
"from": "GPH7FPzbN7hnRk24T3Nh9MYM1xBaF5xyRYu8Wty... | xeroc/python-graphenelib | tests/test_memo.py | Python | mit | 8,217 |
#!/usr/bin/python
from icalendar import Calendar
import sys
if len(sys.argv) < 4:
print "Usage: missing_ics_uid.py source.ics target.ics missing.ics"
sys.exit(1)
cal_source = Calendar.from_ical(open(sys.argv[1], 'rb').read())
cal_target = Calendar.from_ical(open(sys.argv[2], 'rb').read())
cal_missing = Calen... | hhermsen/ics-tools | missing_uid_ics.py | Python | mit | 1,174 |
#
# LSST Data Management System
# See COPYRIGHT file at the top of the source tree.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# 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
#... | lsst/sphgeom | tests/test_HtmPixelization.py | Python | gpl-3.0 | 3,675 |
""" Relative Margin Machines (original and some variants) """
# the output is a prediction vector
import timeit
from pySPACE.missions.nodes.decorators import NoOptimizationParameter, BooleanParameter, QNormalParameter, \
ChoiceParameter, QLogUniformParameter, LogUniformParameter
from pySPACE.resources.data_types.... | MMKrell/pyspace | pySPACE/missions/nodes/classification/svm_variants/brmm.py | Python | gpl-3.0 | 72,528 |
# -*- encoding: utf-8 -*-
"""Test class for Trend UI
:Requirement: Trend
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: UI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from robottelo.constants import TREND_TYPES
from robottelo.decorators imp... | ares/robottelo | tests/foreman/ui/test_trend.py | Python | gpl-3.0 | 2,570 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
MellPlayer Player Deco
Created on 2017-03-08
@author: Mellcap
'''
# ===========================
# Deco
# ===========================
def show_changing_text(func):
'''
加载歌曲显示
'''
def wrapper(*args, **kw):
# args[0] == player
p = args[0... | Mellcap/MellPlayer | mellplayer/deco.py | Python | mit | 920 |
import os
import numpy as np
import pyglet
from pyglet.gl import *
import time,sys,random,math,os
import timeit
wall_clock = timeit.default_timer
from ..utils import glskeleton, gloffscreen, np_vbo, shader
from ..sphere import sphere
from ..utils.graphics_utils import make_unit_quad_tile
from ..sim.sim_rotation_man... | johnhw/pypuffersphere | pyspheregl/sim/sphere_sim.py | Python | bsd-2-clause | 14,225 |
# encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import division
from __future__ ... | klahnakoski/ActiveData-ETL | activedata_etl/transforms/fx_test_to_normalized.py | Python | mpl-2.0 | 2,201 |
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
import re
from openpyxl.compat import safe_string, basestring
from openpyxl.descriptors import Descriptor, Typed
from .hashable import HashableObject
from openpyxl.descriptors import String, Bool, MinMax, Integer
# Default Color Index as per 1... | saukrIppl/seahub | thirdpart/openpyxl-2.3.0-py2.7.egg/openpyxl/styles/colors.py | Python | apache-2.0 | 3,575 |
inp = input().split()
n = int(inp[0])
m = int(inp[1])
c = inp[2]
k = []
for i in range(n):
k.append(list(input()))
lt = (-1, -1)
rt = (-1, -1)
for i in range(n):
for j in range(m):
if k[i][j] == c:
rt = (i, j)
if lt[0] < 0:
lt = (i, j)
ans = set()
for i in range(lt[0], rt[0] + 1):
for j in range(lt[... | Blimeo/Java | out/production/matthew/Contests/CodeForces/pset6/President's Office.py | Python | apache-2.0 | 684 |
"""API for open discussions integration"""
import logging
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import transaction
from open_discussions_api.client import OpenDiscussionsApi
from open_discussions_api.constants import ROLE_STAFF
from requests.exceptions ... | mitodl/micromasters | discussions/api.py | Python | bsd-3-clause | 16,514 |
########################################################################
# $HeadURL$
# File : SiteSEMapping.py
########################################################################
""" The SiteSEMapping module performs the necessary CS gymnastics to
resolve site and SE combinations. These manipulations are... | Sbalbp/DIRAC | Core/Utilities/SiteSEMapping.py | Python | gpl-3.0 | 9,257 |
#!/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 shutil
import sys
import zipfile
from util import build_utils... | danakj/chromium | build/android/gyp/aar.py | Python | bsd-3-clause | 1,987 |
# Copyright (C) 2022 The Sipwise Team - http://sipwise.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 later version.
#
# This pr... | sipwise/repoapi | build/signals.py | Python | gpl-3.0 | 2,887 |
from multicorn import ForeignDataWrapper
from cassandra_provider import CassandraProvider
from properties import ISDEBUG
import properties
import schema_importer
import time
class CassandraFDW(ForeignDataWrapper):
def __init__(self, options, columns):
super(CassandraFDW, self).__init__(options, columns)
... | rankactive/cassandra-fdw | cassandra-fdw/__init__.py | Python | mit | 4,389 |
#!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... | amchoukir/ycmd | ycmd/tests/extra_conf_store_test.py | Python | gpl-3.0 | 1,404 |
# Copyright 2014 NeuroData (http://neurodata.io)
#
# 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... | neurodata/spdb | ndkvindex/rediskvindex.py | Python | apache-2.0 | 4,898 |
import sys
import random
from test_base import *
class TestStoreBuffer3(TestBase):
def get_random_addr(self):
tag = random.randint(0,8)
taddr = self.get_addr(tag,0,0,0)
return taddr
def generate(self):
self.clear_tag()
for n in range(20000):
taddr = self.get_random_addr()
rep... | litex-hub/pythondata-cpu-blackparrot | pythondata_cpu_blackparrot/system_verilog/black-parrot/external/basejump_stl/testing/bsg_cache/regression_v2/test_store_buffer3.py | Python | bsd-3-clause | 716 |
###########################################################
# OpenTSDB REST API session in a HTTPS connection example #
###########################################################
import json
import requests
# Place your token id here
token_id = 'w3eaaaqaa7pff'
# Place your token here
token_key = 'xyz123xyz123xyz123... | NicolasLM/iot-push-examples | Python/python-client-http.py | Python | apache-2.0 | 1,486 |
"""\
A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""
import os, urlparse, urllib, types
import io
import sys
import handler
import xmlreader
try:
_StringTypes = [types.StringType, types.UnicodeType]
except AttributeError:
_StringT... | kleientertainment/ds_mod_tools | pkg/win32/Python27/Lib/xml/sax/saxutils.py | Python | mit | 11,730 |
#
# Copyright (C) 2006 Red Hat, Inc.
# Author: Phil Knirsch
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; version 2 only
#
# This program is distributed in the hope that it will be u... | pombredanne/git-git.fedorahosted.org-git-pyrpm | pyrpm/cache.py | Python | gpl-2.0 | 12,613 |
class InvalidParameter(Exception):
pass
class ConfigurationError(Exception):
pass
| piwik/piwik-python-api | piwikapi/exceptions.py | Python | bsd-3-clause | 92 |
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from common import public
import time
import re
class qyxx_ck():
"""采矿许可证"""
need_check_ziduan = ['valid_from',
'validto'
]
def check_valid_from(self, indexstr, ustr):
... | mefly2012/platform | src/parse/qyxx_ck.py | Python | apache-2.0 | 1,153 |
"""API for persistent storage for the frontend."""
from __future__ import annotations
from collections.abc import Callable
from functools import wraps
from typing import Any
import voluptuous as vol
from homeassistant.components import websocket_api
from homeassistant.components.websocket_api.connection import Activ... | rohitranjan1991/home-assistant | homeassistant/components/frontend/storage.py | Python | mit | 2,757 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
from twisted.internet.protocol import DatagramProtocol
echonet_lite_group = '224.0.23.0'
# echonet_lite_group_IPv6 = 'ff02::1'
echonet_lite_port = 3610
class Receiver(DatagramProtocol):
def __init__(self, **kwargs):
super(Receiver, self).__init... | keiichishima/echonetlite | echonetlite/ipv4adapter.py | Python | bsd-2-clause | 1,669 |
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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/license... | HybridF5/jacket | jacket/api/compute/openstack/compute/views/images.py | Python | apache-2.0 | 5,753 |
# 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.utils import cint, cstr, flt, nowdate, comma_and, date_diff
from frappe import msgprint, _
from frappe.model.document import ... | bhupennewalkar1337/erpnext | erpnext/hr/doctype/leave_control_panel/leave_control_panel.py | Python | gpl-3.0 | 1,939 |
##
# Copyright (c) 2006-2014 Apple 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 l... | trevor/calendarserver | txdav/common/datastore/query/generator.py | Python | apache-2.0 | 5,327 |
#!/usr/bin/python
import os
import time
import subprocess
command = [
"certbot",
"-n", "--agree-tos", # non-interactive
"-d", os.environ["HOSTNAMES"],
"-m", "{}@{}".format(os.environ["POSTMASTER"], os.environ["DOMAIN"]),
"certonly", "--standalone",
"--server", "https://acme-v02.api.letsencryp... | whitef0x0/medforms | nginx/letsencrypt.py | Python | mit | 698 |
#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import os, subprocess, socket
BASE = '/srv/download/bw'
def main():
if ... | palerdot/calibre | setup/file-hosting-bw.py | Python | gpl-3.0 | 1,395 |
# Foremast - Pipeline Tooling
#
# Copyright 2018 Gogo, 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... | gogoair/foremast | src/foremast/elb/destroy_elb/__main__.py | Python | apache-2.0 | 1,302 |
class Triangle(object):
number_of_sides = 3
def __init__(self, angle1, angle2, angle3):
self.angle1 = angle1
self.angle2 = angle2
self.angle3 = angle3
def check_angles(self):
if self.angle1 + self.angle2 + self.angle3 == 180:
return True
else:
... | talapus/Ophidian | Academia/Classes/Triangle_class.py | Python | bsd-3-clause | 557 |
# 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-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status_list_result.py | Python | mit | 945 |
# -*- coding: utf-8 -*-
# Copyright (c) 2007-2008 by Enrique Pérez Arnaud <enriquepablo@gmail.com>
#
# This file is part of ln.
#
# ln 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... | enriquepablo/nlproject | src/nl/nl/nltime.py | Python | gpl-3.0 | 13,976 |
import re
import os
from datetime import datetime
from django.core.management.base import BaseCommand
from corehq.apps.export.export import get_export_file
from corehq.apps.export.utils import get_export
from corehq.util.view_utils import get_form_or_404
from corehq.apps.domain.models import Domain
from corehq.apps.... | dimagi/commcare-hq | hqscripts/management/commands/pull_exports.py | Python | bsd-3-clause | 3,740 |
import pydicom
import datetime
import numpy as np
from pathlib import Path
gyro = 42.58 # 1H gyromagnetic ratio
# Dictionary of DICOM tags
tagDict = {
'Image Type': 0x00080008,
'SOP Class UID': 0x00080016,
'SOP Instance UID': 0x00080018,
'Series Description': 0x0008103E,
'Slice Thickness': 0x00... | bretglun/fwqpbo | DICOM.py | Python | gpl-3.0 | 20,551 |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... | brodyberg/autorest | AutoRest/Generators/Python/Python.Tests/AcceptanceTests/duration_tests.py | Python | mit | 2,697 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courseevaluations', '0019_auto_20160108_1019'),
]
operations = [
migrations.CreateModel(
name='MELPEvaluation',
... | rectory-school/rectory-apps | courseevaluations/migrations/0020_melpevaluation.py | Python | mit | 681 |
# -*- coding: utf-8 -*-
import re
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
default_html_template = """Hello {{ person }}: <br />
You have a new message: <br />
<strong>subject:</strong> {{ subject }} <br />
<strong>cont... | TEDICpy/write-it | mailit/migrations/0007_blank_html_templates.py | Python | gpl-3.0 | 13,041 |
from datetime import datetime
from django.db import models
from django.utils.timezone import utc
class Character(models.Model):
""" character within eve """
lastrefresh = models.DateTimeField(null=True)
characterid = models.BigIntegerField(unique=True)
charactername = models.CharField(max_length=254... | Sult/daf | apps/bulk/models/characters.py | Python | mit | 1,225 |
"""Generic interface to all dbm clones.
Instead of
import dbm
d = dbm.open(file, 'w', 0666)
use
import anydbm
d = anydbm.open(file, 'w')
The returned object is a dbhash, gdbm, dbm or dumbdbm object,
dependent on the type of database being opened (determined by whichdb
... | DarioGT/OMS-PluginXML | org.modelsphere.sms/lib/jython-2.2.1/Lib/anydbm.py | Python | gpl-3.0 | 2,783 |
"""Support for AquaLogic switches."""
from aqualogic.core import States
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity
from homeassistant.const import CONF_MONITORED_CONDITIONS
import homeassistant.helpers.config_validation as cv
from . import DOMAIN, UPDATE_TOPIC
... | Danielhiversen/home-assistant | homeassistant/components/aqualogic/switch.py | Python | apache-2.0 | 2,763 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.