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
import time
import subprocess
import unittest
import test
class LocalTestCase(test.VagrantTestCase):
"""Local tests for `t2m.py`."""
T2M_IP = '127.0.0.1'
T2M_PORT = 1999
python_proc = None
def setUp(self):
#os.system("rm -f /tmp/.t2m.log")
#proc = subprocess.Popen(['pyth... | origliante/t2m | test_local.py | Python | unlicense | 835 |
# coding: utf-8
# author: wie@ppi.co.jp
from PySide import QtGui, QtCore
class Link(QtGui.QGraphicsLineItem):
# QGraphicsLineItem ์ QObject ์ ํ์ํด๋์ค๊ฐ ์๋๋ฏ๋ก ์๊ทธ๋๊ณผ ์ฌ๋กฏ์ ๊ฐ์ง ์ ์์ง๋ง
# Link ์ ์๊ทธ๋๊ณผ ์ฌ๋กฏ์ด ํ์ํ๋ค๋ฉด, QtCore.QObject ๋ฅผ ๋ค์ค ์์ ๋ฐ์ผ๋ฉด ๋๋ค.
def __init__(self, fromeNode, toNode):
super(Link, self).__init__()
... | piexona/pyside-examples | pyside_281_Diagram.py | Python | apache-2.0 | 7,476 |
import sys
import numpy as np
import time
import torch
from torch.autograd import Variable
from torch import optim
from torch.nn import DataParallel
def train(epoch, net, loss_fn, data_loader, optimizer, get_lr, requires_control = True):
start_time = time.time()
net.eval()
if isinstance(net, DataParallel):... | lfz/Guided-Denoise | GD_train/train_cel.py | Python | apache-2.0 | 4,485 |
file_for_reading = open('somefile.txt', 'r') # 'r' read-only
file_for_writing = open('somefile.txt', 'w') # 'w' wrute, will destroy the file if it already exists
file_for_appending = open('somefile.txt', 'a') # 'a' adding to the end of the file
file_for_writing.close()
count = 0
# use 'with' block to close them aut... | xiaoleihuang/Books | Data Science from Scratch/chapter9/readfile.py | Python | gpl-2.0 | 732 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | openstack/python-openstackclient | openstackclient/tests/unit/network/v2/test_network_flavor_profile.py | Python | apache-2.0 | 15,681 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public Lice... | Arzie/deluge | deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py | Python | gpl-3.0 | 2,669 |
# pylint: disable=no-self-use
import numpy
from numpy.testing import assert_almost_equal
import keras.backend as K
from keras.layers import Input
from keras.models import Model
from deep_qa.layers import Overlap
class TestOverlap:
def test_batched_case(self):
tensor_a_len = 5
tensor_b_len = 4
... | DeNeutoy/deep_qa | tests/layers/overlap_test.py | Python | apache-2.0 | 2,216 |
from logging import getLogger
from eatsmart.celery import app
from eatsmart.locations.wake.management.commands.import_wake import Command
logger = getLogger(__file__)
@app.task
def import_wake_data():
"""Import Raleigh data"""
logger.info("Starting Raleigh Import")
cmd = Command()
cmd.handle()
l... | codefordurham/Durham-Restaurants | eatsmart/locations/wake/tasks.py | Python | bsd-3-clause | 358 |
"""Get an integer task ID number, either from a GridEngine array job
or a number given on the command line.
"""
import sys
import os
def getTaskID():
try:
taskID = int(os.environ['SGE_TASK_ID'])
except KeyError:
taskStr = sys.argv[1]
taskID = int(taskStr)
pass
return ... | rupertnash/subgrid | python/dqTools/getTaskID.py | Python | mit | 327 |
# 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 agreed to in writing, ... | google/gazoo-device | gazoo_device/tests/unit_tests/gazoo_device_base_test.py | Python | apache-2.0 | 36,575 |
"""Subpackage for the Archiver server."""
from ..envars import SRVURL_ARCHIVER as SERVER_URL
from .client import ClientArchiver
from .pvarch import PVDetails, PVData, PVDataSet
from .devices import Orbit, Correctors, TrimQuads
from .time import Time
from . import exceptions
del client, pvarch, devices
| lnls-sirius/dev-packages | siriuspy/siriuspy/clientarch/__init__.py | Python | gpl-3.0 | 306 |
# ===============================================================================
# Copyright 2017 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | UManPychron/pychron | pychron/hardware/gauges/granville_phillips/base_micro_ion_controller.py | Python | apache-2.0 | 4,553 |
# 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
#
# ... | neumerance/deploy | horizon/tables/__init__.py | Python | apache-2.0 | 1,651 |
# Some benchmarks proving better efficiency of certain C++ library functions
| estnltk/pfe | test/benchmark.py | Python | gpl-3.0 | 77 |
import pytest
from cfme import test_requirements
from cfme.common.candu_views import UtilizationZoomView
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.infrastructure.provider.rhevm import RHEVMProvider
from cfme.tests.candu import compare_data
from cfme.utils.appliance.implementations... | anurag03/integration_tests | cfme/tests/candu/test_cluster_graph.py | Python | gpl-2.0 | 3,673 |
#########################################
# AndroidSpeechRecognition.py
# more info @: http://myrobotlab.org/service/AndroidSpeechRecognition
#########################################
# start the service
androidspeechrecognition = Runtime.start("androidspeechrecognition","AndroidSpeechRecognition")
# start mouth
mary... | MyRobotLab/myrobotlab | src/main/resources/resource/AndroidSpeechRecognition/AndroidSpeechRecognition.py | Python | apache-2.0 | 802 |
# Orca
# Copyright (C) 2014-2015 Synthicity, LLC
# Copyright (C) 2015 Autodesk
# See full license in LICENSE.
from .orca import *
version = __version__ = '1.2dev'
| SANDAG/orca | orca/__init__.py | Python | bsd-3-clause | 165 |
# oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
# Copyright (c) 2016, Gluu
#
# Author: Yuriy Movchan
#
import java
from com.wikidsystems.client import wClient
from org.xdi.model.custom.script.type.auth import PersonAuthenticationType
from org.xdi.oxauth.securit... | madumlao/oxAuth | Server/integrations.deprecatred/wikid/WikidExternalAuthenticator.py | Python | mit | 9,370 |
from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import c... | mmottahedi/neuralnilm_prototype | scripts/e96.py | Python | mit | 5,860 |
#
#
# Nearest Neighbor Classifier for Pima dataset
#
#
# Code file for the book Programmer's Guide to Data Mining
# http://guidetodatamining.com
#
# Ron Zacharski
#
import heapq
import random
class Classifier:
def __init__(self, bucketPrefix, testBucketNumber, dataFormat, k):
""" a classifier will ... | ChaoSBYNN/Tools | Data Mining/A Programmer's Guide to Data Mining/code/chapter-5/pimaKNN.py | Python | gpl-3.0 | 7,916 |
#!/usr/bin/env python
__author__ = 'Adam R. Smith, Michael Meisinger'
import uuid
import os
import logging
import sys
from putil.logging import log
from pyon.core import log as logutil
import pyon
# NOTE: no other imports inside pyon
# @WARN: GLOBAL STATE
# ---------------------------------------------------------... | scionrep/scioncc | src/pyon/core/bootstrap.py | Python | bsd-2-clause | 6,705 |
# Copyright 2018 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | CanonicalLtd/subiquity | subiquity/server/controllers/ssh.py | Python | agpl-3.0 | 2,264 |
"""
Dump the current configuration into a docker compose YAML file
"""
from controller import COMPOSE_FILE, log
from controller.app import Application, Configuration
from controller.deploy.docker import Docker
@Application.app.command(help="Dump current config into docker compose YAML")
def dump() -> None:
Appli... | rapydo/do | controller/commands/dump.py | Python | mit | 583 |
"""This directory contains experimental and often unfinished stuff."""
from numcube.experimental.multiindex import MultiIndex
from numcube.experimental.multiaxis import MultiAxis
| vladimir-kraus/numcube | numcube/experimental/__init__.py | Python | mit | 179 |
# -*- coding: utf-8-*-
import os
import sys
import time
import socket
import subprocess
import pkgutil
import logging
import pip.req
import jarvispath
if sys.version_info < (3, 3):
from distutils.spawn import find_executable
else:
from shutil import which as find_executable
logger = logging.getLogger(__name__)... | affordablewindurbines/jarvisproject | client/diagnose.py | Python | gpl-3.0 | 5,854 |
# Copyright (C) 2019 Vasiliy Sheredeko
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
from __future__ import annotations
import itertools
from typing import MutableMapping, Callable, Iterator, TypeVar, Optional
K = TypeVar('K')
V = TypeVar('V... | orcinus-lang/orcinus | orcinus/collections.py | Python | mit | 1,955 |
from __future__ import print_function
__author__ = 'ragomez'
def f(data):
mylist = xrange(0, data,2)
for i in mylist:
yield i
number = int(raw_input('Enter a number:'))
for num in f(number):
print(num, end=',') | raygomez/python-exercise-4 | exercise4-3.py | Python | mit | 234 |
#!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgp... | nuclear-wizard/moose | python/MooseDocs/test/extensions/test_core.py | Python | lgpl-2.1 | 3,665 |
from __future__ import unicode_literals
from __future__ import print_function
import os
from . import syntax
class Frame(object):
def __init__(
self,
code,
location,
lineno,
path=None,
obj=None,
cols=None,
one_line=False,
libid=None,
... | moyaproject/moya | moya/traceframe.py | Python | mit | 2,070 |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... | jmcnamara/XlsxWriter | xlsxwriter/test/comparison/test_chart_data_labels42.py | Python | bsd-2-clause | 1,596 |
"""
Square path.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
from fabmetheus_utilities.geometry.creation import lineation
from fabmetheus_utilit... | makerbot/ReplicatorG | skein_engines/skeinforge-35/fabmetheus_utilities/geometry/creation/square.py | Python | gpl-2.0 | 4,020 |
# 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... | autotest/arc | arc/cli/actions/job.py | Python | gpl-2.0 | 5,385 |
"""
Tests for pika.channel.ContentFrameDispatcher
"""
import collections
import logging
try:
import mock
except ImportError:
from unittest import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
import warnings
from pika import channel
from pika import exceptions
from pika ... | shinji-s/pika | tests/unit/channel_tests.py | Python | bsd-3-clause | 55,916 |
# ===============================================================================
# Copyright 2016 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | USGSDenverPychron/pychron | pychron/hardware/eurotherm/__init__.py | Python | apache-2.0 | 1,078 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'src/chanToFbxUI.ui'
#
# Created: Thu Aug 25 14:56:15 2011
# by: PyQt4 UI code generator 4.8.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except... | justinfx/AtomSplitter | ui/chanToFbxUI.py | Python | gpl-3.0 | 36,351 |
# -*- coding: utf-8 -*-
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth import get_user_model
from .utils import get_esia_auth
def esia_connector_complete(code, state):
# TODO: ะฟะพัะธะฝะธัั ะฒะฐะปะธะดะฐัะธั ัะพะบะตะฝะฐ (ะฝัะถะฝะพ ะฟัะธะบัััะธัั ะบะปัั ัะตัะฒะตัะฐ ะะกะะ)
esia_auth = get_esia_auth()
return... | wolfstein9119/django-esia-auth | esia_auth/gears.py | Python | bsd-2-clause | 1,984 |
import json
import string
import random
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.db.models import Q
from django.db import IntegrityError
from bitpoll.base.autoc... | fsinfuhh/Bitpoll | bitpoll/base/views.py | Python | gpl-3.0 | 6,534 |
# 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... | orbitfp7/horizon | openstack_dashboard/dashboards/project/stacks/views.py | Python | apache-2.0 | 10,671 |
# -*- coding: utf-8 -*-
from ..internal.XFSAccount import XFSAccount
class HugefilesNet(XFSAccount):
__name__ = "HugefilesNet"
__type__ = "account"
__version__ = "0.07"
__status__ = "testing"
__description__ = """Hugefiles.net account plugin"""
__license__ = "GPLv3"
__authors__ = [("Walt... | Arno-Nymous/pyload | module/plugins/accounts/HugefilesNet.py | Python | gpl-3.0 | 392 |
# Snafu: Snake Functions - Main Module
import argparse
import os
import sys
#import pathlib
import ast
import importlib
import importlib.machinery
import types
import inspect
import time
import json
import hashlib
import base64
import glob
import subprocess
import shutil
import threading
parsermapping = {
"c": ["c",... | serviceprototypinglab/snafu | snafulib/snafu.py | Python | apache-2.0 | 16,130 |
#Created by Dmytro Konobrytskyi, 2013 (github.com/Akson/MoveMe)
from MoveMe.Canvas.Objects.Base.ConnectableObject import ConnectableObject
class ConnectableDestination(ConnectableObject):
def __init__(self):
super(ConnectableDestination, self).__init__()
self.connectableDestination = True
... | Akson/RemoteConsolePlus3 | RemoteConsolePlus3/MoveMe/Canvas/Objects/Base/ConnectableDestination.py | Python | lgpl-3.0 | 584 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# CPU-G is a program that displays information about your CPU,
# RAM, Motherboard and some general information about your System.
#
# Copyright ยฉ 2009 Fotis Tsamis <ftsamis at gmail dot com>.
# Copyright ยฉ 2016-2019 Lorenzo Carbonell (aka atareao)
# <lorenzo.carbonell.... | atareao/cpu-g | src/samples.py | Python | gpl-3.0 | 1,519 |
import pytest
from mock import Mock, call, patch
from rolit.server import *
from test_server import TestServer
@patch.object(random, 'shuffle', Mock())
class TestServerGame(TestServer):
def test_it_ensures_that_a_game_goes_game_over_once(self):
self.server.game_over = Mock(wraps=self.server.game_over)
... | tcoenraad/rolit | tests/test_server_game.py | Python | mit | 10,370 |
""" Test all things related to the ``jedi.api_classes`` module.
"""
from textwrap import dedent
from inspect import cleandoc
import pytest
from jedi import Script, defined_names, __doc__ as jedi_doc, names
from ..helpers import cwd_at
from ..helpers import TestCase
def test_is_keyword():
#results = Script('imp... | snakeleon/YouCompleteMe-x86 | third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/test_api/test_classes.py | Python | gpl-3.0 | 10,905 |
#!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import os
import shutil
import subprocess
import sys
import time
import unittest
from contextlib import contextmanager
import pytest
from sos import execut... | bpeng2000/SOS | test/test_task.py | Python | gpl-3.0 | 36,120 |
from p2pool.bitcoin import networks
PARENT = networks.nets['joulecoin']
SHARE_PERIOD = 20 # seconds
CHAIN_LENGTH = 12*60*60//10 # shares
REAL_CHAIN_LENGTH = 12*60*60//10 # shares
TARGET_LOOKBEHIND = 20 # shares
SPREAD = 10 # blocks
IDENTIFIER = 'ac556af4e900ca61'.decode('hex')
PREFIX = '16ac009e4fa655ac'.decode('hex')... | Rav3nPL/p2pool-rav | p2pool/networks/joulecoin.py | Python | gpl-3.0 | 568 |
#!/usr/bin/python
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# buffer = "A"*2606+"B"*4+"C"*90
buffer = 'A' * 2700
try:
print "\nSending evil buffer..."
s.connect(('10.11.10.12',110))
data = s.recv(1024)
s.send('USER username' +'r\n\')
print "\nDone!."
except:
print "Could not conn... | itiswiki/PWK | slmail-pop3.py | Python | mit | 337 |
# Copyright 2015-2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | wklken/yapf | yapf/yapflib/__init__.py | Python | apache-2.0 | 601 |
"""
Find the length of the longest substring T of a given string (consists of
lowercase letters only) such that every character in T appears no less than k
times.
Example 1:
Input:
s = "aaabb", k = 3
Output:
3
The longest substring is "aaa", as 'a' is repeated 3 times.
Example 2... | ufjfeng/leetcode-jf-soln | python/395_longest_substring_with_at_least_k_repeating_characters.py | Python | mit | 1,186 |
# Copyright (C) 2017 Daniel Fava. All Rights Reserved.
import myunittest
from mmgo import mmgo
class Common(myunittest.TestCase):
def test_k(self):
self.assertEqual(len(self.config.goroutines), 2)
self.assertEqual(self.config.goroutines[0].k, "42")
self.assertEqual(self.config.goroutines[1].k, "$unit")
... | dfava/mmgo | src/mmgo/tests/sel_sync_rec.py | Python | apache-2.0 | 2,091 |
# coding: utf-8
import os
PRODUCTION = os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Eng')
DEBUG = DEVELOPMENT = not PRODUCTION
try:
# This part is surrounded in try/except because the config.py file is
# also used in the run.py script which is used to compile/minify the client
# side files (*.l... | gmist/fix-5studio | main/config.py | Python | mit | 1,368 |
import click
from arrow.cli import pass_context, json_loads
from arrow.decorators import custom_exception, dict_output
@click.command('get_feature_sequence')
@click.argument("feature_id", type=str)
@click.option(
"--organism",
help="Organism Common Name",
type=str
)
@click.option(
"--sequence",
he... | galaxy-genome-annotation/python-apollo | arrow/commands/annotations/get_feature_sequence.py | Python | mit | 692 |
import stst
# Define Model
gb = stst.Classifier(stst.GradientBoostingRegression())
model = stst.Model('S1-gb', gb)
# Add features to the Model
model.add(stst.WeightednGramOverlapFeature(type='lemma'))
model.add(stst.BOWFeature(stopwords=False))
model.add(stst.AlignmentFeature())
model.add(stst.IdfAlignmentFeature())
... | rgtjf/Semantic-Texual-Similarity-Toolkits | demo.py | Python | mit | 1,227 |
# Filter EnergyPlus Construction
#
# Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Honeybee.
#
# Copyright (c) 2013-2020, Mostapha Sadeghipour Roudsari <mostapha@ladybug.tools>
# Honeybee is free software; you can redistribute it and/or modify
... | mostaphaRoudsari/Honeybee | src/Honeybee_Search EP Construction.py | Python | gpl-3.0 | 4,389 |
import logging
from aloe import step, world
from aloe.registry import STEP_REGISTRY
from aloe_webdriver.webdriver import contains_content
from nose.tools import assert_true, assert_equal
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.alert import Alert
from selenium.common.exceptions ... | muccg/rdrf | rdrf/rdrf/testing/behaviour/features/steps.py | Python | agpl-3.0 | 52,562 |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import requests
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
API_KEY = demisto.params()['apikey']
HEADERS = {
'Content-Type': 'application/json',
'Accept': 'applica... | demisto/content | Packs/C2sec/Integrations/C2sec/C2sec.py | Python | mit | 7,313 |
#drundoo class for handling web site
import requests
session = requests.session
#from requests2 import session
import bs4
URL = 'http://www.drundoo.com/users/login/'
#username=''
class drundoo:
def __init__(self,username,password):
self.c = session()
self.payload = [('email',username),('password',password)... | pesheto/plugin.video.oodnurdtv | resources/drundoo.py | Python | gpl-2.0 | 7,821 |
#!/usr/bin/env python
# coding=utf-8
'''
Created on Jun 15, 2012
@author: gf
'''
import wx
import Resource
import Util
import threading
import os
class TimeoutThread(threading.Thread):
def __init__(self, window):
threading.Thread.__init__(self)
self.window = window
self.cancel = False
... | xuweiliang/Codelibrary | hav-gclient-3.2_newton/ResolutionDialog.py | Python | apache-2.0 | 4,097 |
from enigma import eDVBVolumecontrol, eTimer
from Tools.Profile import profile
from Screens.Volume import Volume
from Screens.Mute import Mute
from GlobalActions import globalActionMap
from config import config, ConfigSubsection, ConfigInteger
from Components.HdmiCec import HdmiCec
profile("VolumeControl")
#TODO .. mo... | Ophiuchus1312/enigma2-master | lib/python/Components/VolumeControl.py | Python | gpl-2.0 | 2,618 |
#!/usr/bin/env python
import string
from simpleparse.common import numbers, strings, comments
from simpleparse.parser import Parser
#from lib.logger import log
class ExpParser():
def __init__(self):
declaration = r'''
fun := ( fun_name,'(',')' )/( fun_name,'(',exp_list,')' )
... | uhp/uhp | uhpalarm/lib/exp_parser.py | Python | gpl-2.0 | 4,868 |
import pandas as pd
import xgboost as xgb
import numpy as np;
from h2o.estimators.xgboost import *
from tests import pyunit_utils
from scipy.sparse import csr_matrix
def xgboost_categorical_zero_nan_handling_sparse_vs_native():
assert H2OXGBoostEstimator.available() is True
# Artificial data to be used thro... | h2oai/h2o-dev | h2o-py/tests/testdir_algos/xgboost/pyunit_xgboost_zero_nan_handling_native_comparison.py | Python | apache-2.0 | 3,326 |
from browser import console
import io
import math
print('Hello from Node !!')
| brython-dev/brython | small_node_app.py | Python | bsd-3-clause | 79 |
# make the other metrics work
# generate the txt files, then work on the pdf otuput
__version__ = "0.1.0"
import networkx as nx
import numpy as np
import pandas as pd
from glob import glob
import matplotlib
matplotlib.use('pdf')
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import matplotlib.pylab as pylab
pa... | nddsg/TreeDecomps | xplodnTree/tdec/plot_timestamped_graphs.py | Python | mit | 1,341 |
# -*- coding: cp1251 -*-
import os
import subprocess
import re
import commands
class sysInfo(object):
"""
describe a class for system information getting from local computer
"""
def __init__(self):
pass
def _getProcessData(self):
"""
Get list of proces... | avpakh/Python_courses | Home_task2/infosys.py | Python | gpl-2.0 | 5,940 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, ... | Jorge-Rodriguez/ansible | test/units/modules/network/f5/test_bigip_configsync_action.py | Python | gpl-3.0 | 3,910 |
from __future__ import print_function
import os
import subprocess
class PyRDF2Ntriples(object):
def __init__(self):
pass
def convertTTL2NT(self, filepath):
#Save to the same folder with .nt extension
(outputDir, outputFile) = os.path.split(os.path.abspath(filepath))
outputFil... | earthquakesan/pyrdf2nt | pyrdf2nt/converter.py | Python | mit | 1,329 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.contrib.auth.models import AbstractUser
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy... | ToGoBananas/test_work | users/models.py | Python | bsd-3-clause | 1,133 |
import os
import sys
import errno
import subprocess
import glob
import shutil
from contextlib import contextmanager
def normpath(path):
"""Normalize UNIX path to a native path."""
normalized = os.path.join(*path.split("/"))
if os.path.isabs(path):
return os.path.abspath("/") + normalized
else:
... | dmlc/xgboost | dev/prepare_jvm_release.py | Python | apache-2.0 | 4,314 |
"""Looks to see when a face angle turned too far away to be seen. You can
make your own images with a protractor and a rope. Measure to the wall and mark
with tape. Then look at the spot and take a photo with your webcam."""
import numpy as np
import cv2
import os
face_cascade = cv2.CascadeClassifier('/Users/and... | andrewjtimmons/selfieexpression | angle_tester.py | Python | mit | 1,497 |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010 by Joel Andersson, Moritz Diehl, K.U.Leuven. All rights reserved.
#
# CasADi is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Pub... | jgillis/casadi | experimental/joel/springSysId.py | Python | lgpl-3.0 | 9,538 |
from __future__ import absolute_import, division, unicode_literals
from . import base
from collections import OrderedDict
def _attr_key(attr):
"""Return an appropriate key for an attribute for sorting
Attributes have a namespace that can be either ``None`` or a string. We
can't compare the t... | ncos/lisa | src/lisa_drive/scripts/venv/lib/python3.5/site-packages/pip-10.0.1-py3.5.egg/pip/_vendor/html5lib/filters/alphabeticalattributes.py | Python | mit | 948 |
import sys
from PyQt5.QtWidgets import QDialog, QApplication
from SimpleFormDesigner import Ui_Dialog
class Simple(QDialog, Ui_Dialog):
def __init__(self):
super(Simple, self).__init__()
self.setupUi(self)
# this will connect the text box to label
self.edit.textEdited['QString'].connect(self.change.setText)... | akshaybabloo/Python-QT-5-Tutorial | 2_QTDesigner/2_8_SimpleFormDesigner/main_SimpleFormDesigner.py | Python | mit | 423 |
import pytest
from django.contrib.auth import get_user_model
from seleniumlogin import force_login
from test_.models import MyUser
pytestmark = [pytest.mark.django_db(transaction=True)]
@pytest.fixture
def base_url_(live_server, base_url):
port = live_server.url.split(':')[-1]
if base_url:
return f'... | feffe/django-selenium-login | tests.py | Python | mit | 1,370 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import nowdate
from erpnext.accounts.utils import get_fiscal_year
from erpnext.buying.doctype.purchase_order.test_purcha... | ovresko/erpnext | erpnext/accounts/doctype/budget/test_budget.py | Python | gpl-3.0 | 11,765 |
from django.test import TestCase
from django.contrib.auth.models import User
from avocado.columns.models import Column
__all__ = ('ColumnSearchTestCase',)
class ColumnSearchTestCase(TestCase):
fixtures = ['test_data.yaml']
def test_fulltext(self):
queryset1 = Column.objects.fulltext_search('[)roc#ks... | pombredanne/django-avocado | avocado/columns/tests/models.py | Python | bsd-3-clause | 2,979 |
""" Configuration for pdfssa4met
Created on Mar 1, 2010
@author: John Harrison
"""
# Path to pdf2xml executable
# this should have been downloaded from:
# http://sourceforge.net/projects/pdf2xml/
pdf2xmlexe = "/usr/local/bin/pdftoxml.linux.exe.1_2_4"
# API Key for OpenCalais Web Service
# You'll need to register fo... | leoman6/pdfssa4met | config.py | Python | gpl-3.0 | 429 |
# MIT License
#
# Copyright (c) 2016 David Sandberg
#
# 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... | lodemo/CATANA | src/face_recognition/facenet/test/train_test.py | Python | mit | 9,650 |
import base64
import json
import time
import responses
import six
from dach.signals import post_install, post_uninstall
from dach.storage import get_backend
from dach.structs import Tenant, Token
from django.apps import apps
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.util... | ffaraone/dach | dach/tests/test_install_flow.py | Python | apache-2.0 | 6,222 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
test_records = frappe.get_test_records('Earning Type') | indictranstech/focal-erpnext | hr/doctype/earning_type/test_earning_type.py | Python | agpl-3.0 | 200 |
import numpy as np
from becquerel.tools.isotope import Isotope
from becquerel.tools.isotope_qty import IsotopeQuantity, NeutronIrradiation
import datetime
from becquerel import Spectrum
import efficiencies as ef
from bs4 import BeautifulSoup
import urllib.request
import math
import NAA_Isotopes as na
from uncertainties... | bearing/radwatch-analysis | Isotope_composition_calculator.py | Python | mit | 7,740 |
๏ปฟ# Copyright 2014-2016 The ODL development group
#
# This file is part of ODL.
#
# ODL 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.
... | bgris/ODL_bgris | odl/operator/tensor_ops.py | Python | gpl-3.0 | 34,199 |
# coding: utf-8
"""
Telegram notifications.
"""
__all__ = ["notify_telegram"]
import threading
import six
from law.config import Config
from law.util import escape_markdown
from law.logger import get_logger
logger = get_logger(__name__)
def notify_telegram(title, content, token=None, chat=None, mention_user=N... | riga/law | law/contrib/telegram/notification.py | Python | bsd-3-clause | 2,570 |
# Django settings for celery_http_gateway project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
CARROT_BACKEND = "amqp"
CELERY_RESULT_BACKEND = "database"
BROKER_HOST = "localhost"
BROKER_VHOST = "/"
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
... | frac/celery | examples/celery_http_gateway/settings.py | Python | bsd-3-clause | 2,931 |
import os
import sys
from pkg_resources import resource_filename
import nose.tools as nt
import numpy as np
import numpy.testing as nptest
import pandas
import pandas.util.testing as pdtest
from wqio import Location
from wqreports import core
@nt.nottest
class mock_location(object):
def __init__(self):
... | phobson/wqreports | wqreports/tests/core_tests/test_pdfreports.py | Python | bsd-3-clause | 9,983 |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test initialization of angles not already covered by the API tests"""
import pickle
import pytest
import numpy as np
from ..earth import EarthLocation, ELLIPSOIDS
from ..angles import Longitude, Latitude
from ...tests.helper ... | DougBurke/astropy | astropy/coordinates/tests/test_earth.py | Python | bsd-3-clause | 15,947 |
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="pyslicer",
version="2.1.0",
author="SlicingDice LLC",
author_email="help@slicingdice.com",
description="Official Python client for SlicingDice, Data Warehou... | SlicingDice/slicingdice-python | setup.py | Python | mit | 843 |
# ยฉ 2017 Creu Blanca
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models, fields
class AccountInvoiceIntegration(models.Model):
_inherit = "account.invoice.integration"
integration_status = fields.Selection(selection_add=[
('face-1200', 'Registered on REC')... | factorlibre/l10n-spain | l10n_es_facturae_face/models/account_invoice_integration.py | Python | agpl-3.0 | 775 |
# pylint: disable=protected-access, missing-docstring
import unittest
from vprof import flame_graph
class StatProfilerUnittest(unittest.TestCase):
def setUp(self):
self._profiler = object.__new__(flame_graph._StatProfiler)
def testCallTreeProperty(self):
self.maxDiff = None
self._pr... | nvdv/vprof | vprof/tests/flame_graph_test.py | Python | bsd-2-clause | 1,662 |
#
# Copyright (c) 2013 Citrix Systems, Inc.
#
# 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 dist... | OpenXT/sync-database | sync_db_test/test_server.py | Python | gpl-2.0 | 9,950 |
from cpyMSpec import isotopePattern, InstrumentModel
from pyMSpec.pyisocalc import pyisocalc
import numpy as np
import logging
from collections import namedtuple
logger = logging.getLogger('engine')
ISOTOPIC_PEAK_N = 4
SIGMA_TO_FWHM = 2.3548200450309493 # 2 \sqrt{2 \log 2}
class IsocalcWrapper(object):
""" Wr... | METASPACE2020/sm-engine | sm/engine/isocalc_wrapper.py | Python | apache-2.0 | 2,264 |
from Plugins.Plugin import PluginDescriptor
from Screens.PluginBrowser import *
from Screens.Ipkg import Ipkg
from Components.SelectionList import SelectionList
from Screens.NetworkSetup import *
from enigma import *
from Screens.Standby import *
from Screens.MessageBox import MessageBox
from Components.ActionMap impor... | sklnet/openatv-enigma2 | lib/python/Plugins/Extensions/Infopanel/plugin.py | Python | gpl-2.0 | 39,795 |
"""
Functions useful across modules.
"""
import datetime as dt
from typing import Optional, Dict, List, Union, Callable
import pandas as pd
from pandas import DataFrame
import numpy as np
from shapely.geometry import LineString, Point
from shapely.ops import transform
import utm
import json2table as j2t
from . import... | araichev/gtfstk | gtfstk/helpers.py | Python | mit | 15,695 |
import json
import redis
import base64
class FlowRateFunctions():
def __init__(self , redis_handle):
self.redis_handle = redis_handle
self.flow_rate_sensors = self.get_flow_rate_sensor_names()
pass
#
# def get_flow_rate_sensor_names( self, data_file_path = "../system_data_files/global_s... | glenn-edgar/local_scda | flask_web/app/flow_rate_functions.py | Python | mit | 1,882 |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 27 10:08:25 2018
@author: cdeline
Using pytest to create unit tests for gencumulativesky.
Note that this can't be included in the repo until TravisCI has a Linux version of gencumsky
set up in .travis.yml
to run unit tests, run pytest from the command line in the bifaci... | NREL/bifacial_radiance | tests/test_gencumsky.py | Python | bsd-3-clause | 4,169 |
def test_regs(sim):
return sim.reg_value(5) == 0x45
def test_halted(sim):
return sim.halted
| eliben/luz-cpu | luz_asm_sim/tests_full/single_file_simple/_test.py | Python | unlicense | 103 |
import unittest
from mock import patch
import pytest
try:
from kazoo.handlers.eventlet import green_socket as socket
EVENTLET_HANDLER_AVAILABLE = True
except ImportError:
EVENTLET_HANDLER_AVAILABLE = False
class TestCreateTCPConnection(unittest.TestCase):
def test_timeout_arg(self):
from ka... | python-zk/kazoo | kazoo/tests/test_utils.py | Python | apache-2.0 | 3,629 |
import os
import csv
def get_value_or_default(value, default=None):
result = value.strip()
if len(result) == 0:
result = default
return result
def read_csv_file(csv_file_name,
delimiter,
quote_char='"',
skip_header=True,
e... | CALlanoR/virtual_environments | medical_etls/part1/etls/utils.py | Python | apache-2.0 | 607 |
#this model represents a Group in our system
from google.appengine.ext import ndb
from models.user import User
from models.groupLists import GroupLists
from models.list import List
class Group(ndb.Model):
GroupName = ndb.StringProperty(required=True)
GroupAdmin = ndb.StringProperty(required=True)
GroupID =... | snir-sh/Grosharies | grosharies-site/models/group.py | Python | mit | 4,486 |
##############################################################################
# Copyright 2016-2017 Rigetti Computing
#
# 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... | rigetticomputing/grove | grove/bernstein_vazirani/bernstein_vazirani.py | Python | apache-2.0 | 9,574 |
"""
WSGI config for DeepRobSite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | MediffRobotics/DeepRobotics | DeepRobSite/DeepRobSite/wsgi.py | Python | gpl-3.0 | 399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.