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 |
|---|---|---|---|---|---|
# This module, which contains a Handler class whose go() method raises an
# exception, is meant for testing the error handling of Tangelo's web service
# module loader system.
def run():
raise RuntimeError("this is an example error, " +
"from web service 'exceptional'")
| ecohealthalliance/tangelo | tangelo/web/service/test/exceptional.py | Python | apache-2.0 | 300 |
from imager_images.models import Photo
from rest_framework import serializers
class PhotoSerializer(serializers.ModelSerializer):
class Meta:
model = Photo
fields = ('file', 'title', 'description', 'date_uploaded',
'date_modified', 'date_published', 'published')
| muniri92/django-imager | imagersite/imager_api/serializers.py | Python | mit | 303 |
# =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa 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 ... | pyfa-org/Pyfa | gui/viewColumn.py | Python | gpl-3.0 | 2,340 |
import ConfigParser
import StringIO
import sys
iniPath='../config/config.ini'
expectedVariables = ['host', 'port', 'user', 'pass']
config = {}
try:
iniAsStr = '[section]\n' + open(iniPath, 'r').read()
iniFp = StringIO.StringIO(iniAsStr)
configRead = ConfigParser.RawConfigParser()
configRead.readfp(ini... | chesteroni/iniread | imported/config_reader.py | Python | mit | 591 |
import os
import getopt
import sys
def GetFileLength(f):
if type(f) == file:
return os.fstat(f.fileno())[6]
if type(f) == str:
return os.stat(f)[6]
def main():
inputFile = ''
outputFile = ''
padSize=1024*128
try:
opts, args = getopt.getopt(sys.arg... | czc0713/Mst786 | pad_file.py | Python | gpl-2.0 | 1,242 |
from abc import ABCMeta, abstractmethod
from functools import partial
from itertools import product
from typing import Any, Callable, Dict, List, Optional, Union, cast
import numpy as np
import sklearn.metrics
from sklearn.utils.multiclass import type_of_target
from smac.utils.constants import MAXINT
from autosklea... | automl/auto-sklearn | autosklearn/metrics/__init__.py | Python | bsd-3-clause | 20,000 |
from .default import default
from ..compiler.compile_eval import compile_eval
import re
class angle(default):
def stat_value(self, prop):
if prop['value'] is None:
return None
m = re.match('(\-?[0-9]+(\.[0-9]+)?)$', prop['value'])
if m:
return m.group(1)
re... | plepe/pgmapcss | pgmapcss/types/angle.py | Python | agpl-3.0 | 330 |
"""Config flow for Yeelight integration."""
import asyncio
import logging
from urllib.parse import urlparse
import voluptuous as vol
import yeelight
from yeelight.aio import AsyncBulb
from yeelight.main import get_known_models
from homeassistant import config_entries, exceptions
from homeassistant.components import d... | rohitranjan1991/home-assistant | homeassistant/components/yeelight/config_flow.py | Python | mit | 12,399 |
# -*- coding: utf-8 -*-
"""
displays results from harness
TODO: save a testres variable so reloading and regenration becomes easier.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import six
import utool as ut
from six.moves import map, range
print, rrr, profi... | Erotemic/ibeis | ibeis/expt/experiment_printres.py | Python | apache-2.0 | 13,876 |
import mock
import unittest
import mycroft.stt
from mycroft.configuration import ConfigurationManager
class TestSTT(unittest.TestCase):
@mock.patch.object(ConfigurationManager, 'get')
def test_factory(self, mock_get):
mycroft.stt.STTApi = mock.MagicMock()
config = {'stt': {
'... | epaglier/Project-JARVIS | mycroft-core/test/unittests/stt/test_stt.py | Python | gpl-3.0 | 5,110 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# cRedditscore documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
... | gautsi/cRedditscore | docs/conf.py | Python | bsd-3-clause | 9,078 |
##
## Calculating the time intervals for Zabbix
##
def calcSeconds(secs):
q = secs[-1].lower()
m = None
if q == "m":
m = 60
elif q == "h":
m = 3600
elif q == "d":
m = 86400
elif q == "w":
m = 604800
else:
m = None
if m != None:
return floa... | vulogov/zlm-cython | src/pymodules/lib/ZLM_Interval.py | Python | gpl-2.0 | 1,999 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Adam.Dybbroe
# Author(s):
# Adam.Dybbroe <a000680@c14526.ad.smhi.se>
# 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, eith... | pytroll/trollduction | trollduction/tests/test_helper_functions.py | Python | gpl-3.0 | 6,296 |
"""Provides functionality to interact with image processing services."""
import asyncio
from datetime import timedelta
import logging
from typing import final
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_NAME,
CONF_ENTITY_ID,
CONF_NAME,
CONF_SOURCE,
)
from homeas... | rohitranjan1991/home-assistant | homeassistant/components/image_processing/__init__.py | Python | mit | 6,320 |
"""Tests for the Atag climate platform."""
from homeassistant.components.atag import CLIMATE, DOMAIN
from homeassistant.components.climate import (
ATTR_HVAC_ACTION,
ATTR_HVAC_MODE,
ATTR_PRESET_MODE,
HVAC_MODE_HEAT,
SERVICE_SET_HVAC_MODE,
SERVICE_SET_PRESET_MODE,
SERVICE_SET_TEMPERATURE,
)
... | tchellomello/home-assistant | tests/components/atag/test_climate.py | Python | apache-2.0 | 3,826 |
from ..utils import *
##
# Rogue
class HERO_03bp:
"""Dagger Mastery"""
activate = Find(FRIENDLY_WEAPON + ID("AT_034")) | Summon(CONTROLLER, "CS2_082")
# Sharpened (Unused)
CS2_083e = buff(atk=1)
##
# Minions
class EX1_131:
"""Defias Ringleader"""
combo = Summon(CONTROLLER, "EX1_131t")
class EX1_134:
"""S... | jleclanche/fireplace | fireplace/cards/classic/rogue.py | Python | agpl-3.0 | 3,905 |
#!/usr/bin/python
"""
sub2CrcTest by ThreeSixes (https://github.com/ThreeSixes)
This project is licensed under GPLv3. See COPYING for dtails.
This file is part of the airSuck project (https://github.com/ThreeSixes/airSUck).
"""
############
# Imports. #
############
import sys
sys.path.append("..")
try:
import ... | ThreeSixes/airSuck | test/sub2CrcTest.py | Python | gpl-3.0 | 4,411 |
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 01 17:34:29 2012
@author: Richard
"""
#import sys
#sys.path.append('C:\\python_modules')
#sys.path.append('C:\\itchy\code_repos\\src-working')
import numpy as nmp
import slip_rate_tools as srt
#om = srt.OffsetMarker(offsets = [])
def truncate_samples_t... | cossatot/slip_rate_calculator | tests/slip_rate_tools_tests.py | Python | mit | 927 |
from pyui.stack_images import Ui_StackImages
from PyQt5.QtWidgets import QDialog, QAction, QLineEdit, QProgressDialog, QApplication, QToolBar
from PyQt5.QtGui import QIcon, QStandardItemModel, QStandardItem
from PyQt5.QtCore import Qt, QObject, pyqtSignal, QStandardPaths, QByteArray
from pyspectrum_commons import *
fro... | GuLinux/PySpectrum | stack_images.py | Python | gpl-3.0 | 9,262 |
__version__ = '4.7.1'
| opencb/cellbase | cellbase-client/src/main/python/pycellbase/__init__.py | Python | apache-2.0 | 22 |
# -*- 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-appengine-admin | samples/generated_samples/appengine_v1_generated_instances_delete_instance_sync.py | Python | apache-2.0 | 1,530 |
# coding=utf-8
import copy
from mycodo.inputs.base_input import AbstractInput
from mycodo.utils.lockfile import LockFile
# Measurements
measurements_dict = {
0: {
'measurement': 'battery',
'unit': 'percent'
},
1: {
'measurement': 'electrical_conductivity',
'unit': 'uS_cm'
... | kizniche/Mycodo | mycodo/inputs/xiaomi_miflora.py | Python | gpl-3.0 | 3,771 |
''' utils.py
module for utils needed for the plugin frameworks. This module implemtents a
handler which searches for plugins and loads and removes them.
Programmer: Matts Bjorck
Last changed: 2008 07 23
'''
import os, wx
#==============================================================================
class PluginHan... | joshp123/genx | plugins/utils.py | Python | gpl-3.0 | 4,851 |
# A test suite for pdb; at the moment, this only validates skipping of
# specified test modules (RFE #5142).
import imp
import os
import sys
import doctest
import tempfile
from test import support
# This little helper class is essential for testing pdb under doctest.
from test.test_doctest import _FakeInput
class P... | mancoast/CPythonPyc_test | fail/312_test_pdb.py | Python | gpl-3.0 | 3,528 |
import argparse
import re
import urlparse
from collections import defaultdict, namedtuple
from datetime import date
import slumber
from utils.conf import env
from utils.providers import providers_data
from utils.version import get_stream
# regexen to match templates to streams and pull out the date
# stream names m... | thom-at-redhat/cfme_tests | utils/trackerbot.py | Python | gpl-2.0 | 10,889 |
#!/usr/bin/env python
import mc
def run(mc):
print('run')
mc.set('key', 'abc')
print(mc.get('key'))
print(mc.get_stats())
if __name__ == '__main__':
mc.run_tcp(run)
| christiangalsterer/execbeat | vendor/github.com/elastic/beats/packetbeat/tests/system/gen/memcache/tcp_stats.py | Python | apache-2.0 | 189 |
#!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2016 Christian Strassburg c.strassburg(a)gmx.de
#
#########################################################################
# This file ... | ohinckel/smarthome | lib/utils.py | Python | gpl-3.0 | 4,063 |
"""Base test suite for extension arrays.
These tests are intended for third-party libraries to subclass to validate
that their extension arrays and dtypes satisfy the interface. Moving or
renaming the tests should not be done lightly.
Libraries are expected to implement a few pytest fixtures to provide data
for the t... | harisbal/pandas | pandas/tests/extension/base/__init__.py | Python | bsd-3-clause | 2,015 |
from __future__ import with_statement
__license__ = 'GPL 3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from itertools import cycle
from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
ADOBE_OBFUSCATION = 'http://ns.adobe.com... | Eksmo/calibre | src/calibre/ebooks/conversion/plugins/epub_input.py | Python | gpl-3.0 | 8,835 |
#! ../environment/bin/python3.3
#This module provides the frequency monobit test and test within a
#block. Charmaine Kelly/NIST recommends testing a minimum of 100 bits
#with block sizes (M) such that:
# M>19
# M>0.1*bitlength if bitlength < 100
from math import erfc
from numpy import sqrt, floor
from sys import... | alephu5/Soundbyte | statistics/frequency.py | Python | gpl-3.0 | 1,270 |
"""
created on Sep 22, 2017
@author: Nikola Jajcay, jajcay(at)cs.cas.cz
"""
from datetime import date, datetime
from os.path import split
import numpy as np
from pyclits.geofield import DataField
def load_station_data(filename, start_date, end_date, anom, to_monthly=False, dataset='ECA-station', offset=1):
""... | jajcayn/pyclits | pyclits/data_loaders.py | Python | mit | 9,066 |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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... | userzimmermann/robotframework | src/robot/conf/settings.py | Python | apache-2.0 | 22,314 |
# Copyright (c) 2005 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | Dexhub/MTX | src/python/m5/__init__.py | Python | bsd-3-clause | 2,215 |
# coding: utf-8
"""
Harbor API
These APIs provide services for manipulating Harbor project.
OpenAPI spec version: 1.4.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
sys.path.append(os.environ["SWAGGER_CLIENT_... | steven-zou/harbor | tests/apitests/python/test_assign_role_to_ldap_group.py | Python | apache-2.0 | 7,937 |
import os
import pickle
import logging
import argparse
import sklearn.tree
from datetime import datetime
from pyActLearn.CASAS.data import CASASData
from pyActLearn.CASAS.fuel import CASASFuel
from pyActLearn.performance.record import LearningResult
from pyActLearn.performance import get_confusion_matrix
logger = logg... | TinghuiWang/pyActLearn | examples/CASAS_Single_Test/b1_sklearn_dt.py | Python | bsd-3-clause | 7,024 |
import urllib2
import urllib
import Image
import copy
import cStringIO as StringIO
import simplejson as json
from xml.dom import minidom
from django.template import RequestContext
from django.template.loader import render_to_string
from django.shortcuts import redirect, render_to_response, get_object_or_404
from djan... | Captricity/captricity-cloud-io | captricity_cloud_io/captricity_cloud_io/views.py | Python | mit | 8,053 |
#Accounting tests written in python should extend the class AccountingTestCase.
#See its doc for more info.
from . import test_account_customer_invoice
from . import test_account_move_closed_period
from . import test_account_supplier_invoice
from . import test_account_validate_account_move
from . import test_bank_stat... | minhphung171093/GreenERP_V9 | openerp/addons/account/tests/__init__.py | Python | gpl-3.0 | 651 |
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | aemal/westcat | amcat/models/article.py | Python | agpl-3.0 | 12,717 |
{
"name": """POS Advanced Order Notes""",
"summary": """Set predefined notes for separate product or entire order""",
"category": "Point of Sale",
# "live_test_url": "http://apps.it-projects.info/shop/product/pos-order-note?version=12.0",
"images": ["images/pos_order_note_main.png"],
"version": ... | it-projects-llc/pos-addons | pos_order_note/__manifest__.py | Python | mit | 1,298 |
# Copyright (c) 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | huntxu/neutron | neutron/db/external_net_db.py | Python | apache-2.0 | 11,621 |
CHAT_CREATE = {
'tags': ['채팅'],
'description': '채팅방 만들기',
'parameters': [
{
'name': 'title',
'description': '채팅방 제목',
'in': 'formData',
'type': 'str'
},
{
'name': 'Authorization',
'description': 'JWT Token',
... | JoMingyu/Daejeon-People | Server/routes/api/chat/chat_doc.py | Python | gpl-3.0 | 2,924 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Django settings for styrax project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproj... | johnjohndoe/Styrax | styrax/settings_global.py | Python | apache-2.0 | 2,666 |
#! /usr/bin/env python
from alexandra import Alexandra
from random import choice as randomchoice
from sys import argv
INDEX = int(argv[2])
NAME = 'opponent_random_%d' % (INDEX,)
WIDTH = 20
HEIGHT = 20
COLOUR = [255, 0, 0]
DELTAS = [(-20, 0), (20, 0), (0, -20), (0, 20)]
def init(alex):
alex.pubsub.publish('oppone... | douglassquirrel/alexandra | games/boxes/components/opponent_random_py/opponent_random.py | Python | mit | 1,576 |
# encoding: utf-8
# module PyKDE4.kdeui
# from /usr/lib/python2.7/dist-packages/PyKDE4/kdeui.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdecore as __PyKDE4_kdecore
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
import PyQt4.QtSvg as __PyQt4_QtSvg
from KComboBox import KComboB... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/PyKDE4/kdeui/KTimeComboBox.py | Python | gpl-2.0 | 3,363 |
# Copyright (C) 2010-2012 Red Hat, Inc.
# This work is licensed under the GNU GPLv2 or later.
# Define storage pool of 'rbd' type
from libvirt import libvirtError
from libvirttestapi.src import sharedmod
from libvirttestapi.repos.storage import storage_common
required_params = ('poolname', 'cephserver', 'cephpool')
o... | libvirt/libvirt-test-API | libvirttestapi/repos/storage/define_rbd_pool.py | Python | gpl-2.0 | 2,180 |
from django.core.urlresolvers import reverse
from django.db import models
from model_utils.models import TimeStampedModel
from contacts.models import Contact
# Artist is a special version of contact
class Artist(TimeStampedModel):
contact = models.OneToOneField(Contact, primary_key=True, limit_choices_to={'is_a... | drummonds/galleria | galleria/artists/models.py | Python | apache-2.0 | 1,043 |
#!/usr/bin/env python
import rospy
import tf
import math
from ar_track_alvar.msg import AlvarMarkers
from geometry_msgs.msg import PoseStamped, Quaternion, Point
import cv2.cv as cv
from swarming_turtles_detect.srv import *
odom = "/odom"
hive = "/hive"
base_frame = "/base_link"
RATE = 20
food_locations = {}
markers... | sjreggel/swarming_turtles | swarming_turtles_detect/scripts/detect_food.py | Python | gpl-2.0 | 7,009 |
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... | craighiller/osgoculusviewer | .ycm_extra_conf.py | Python | bsd-3-clause | 5,140 |
import logging
from miasm2.jitter.jitload import jitter, named_arguments
from miasm2.core import asmbloc
from miasm2.core.utils import *
from miasm2.arch.aarch64.sem import ir_aarch64b, ir_aarch64l
log = logging.getLogger('jit_aarch64')
hnd = logging.StreamHandler()
hnd.setFormatter(logging.Formatter("[%(levelname)s]... | rom1sqr/miasm | miasm2/arch/aarch64/jit.py | Python | gpl-2.0 | 2,085 |
#*-coding:Utf-8 -*
#!/usr/bin/python3.2
"""Fichier contenant la classe generale d'objet algébriques contenant + * et eventuellement /"""
class arith(object):
"""Classe generique contenant les methodes redondantes"""
def __ne__(self,autre):
"""Definition de !="""
return not(self == autre)
def __radd__(self,au... | kalaspa/mc-eliece | src/arith.py | Python | gpl-3.0 | 891 |
#!/adsc/DDEA_PROTO/bin/python
"""
@author: NGO Quang Minh Khiem
@contact: khiem.ngo@adsc.com.sg
"""
import urllib
import urllib2
from datetime import *
from pathos.multiprocessing import ProcessingPool
import pathos.multiprocessing as pmp
from toolset import dill_save_obj
airport_codes = {
'SDH' : ... | TinyOS-Camp/DDEA-DEV | [Python]Collection/retrieve_weather.py | Python | gpl-2.0 | 6,690 |
import asyncio
import pytest
import socket
import subprocess
import sys
import contextlib
import os
import ssl
import time
import logging
import tempfile
import atexit
from collections import namedtuple
from urllib.parse import urlencode, urlunparse
from async_timeout import timeout as async_timeout
import aioredis
i... | ymap/aioredis | tests/conftest.py | Python | mit | 22,698 |
#!/usr/bin/env python
#
import glob
import random
import test
import replika
import replika.assets
from replika.ingame import action
background = replika.assets.image('../assets/scroll.png')
game = replika.new_game()
scene = game.new_scene(auto_switch=True)
background = scene.add_asset(background)
test.start('"ac... | replica-con-k/retropi3d_engine | tests/28_mouse.py | Python | gpl-3.0 | 600 |
# -*- coding: utf-8 -*-
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | photoninger/ansible | lib/ansible/utils/module_docs_fragments/f5.py | Python | gpl-3.0 | 2,238 |
"""Module containing Lifemapper XML utilities
Note: Mainly wraps elementTree functionality to fit Lifemapper needs
"""
from types import (BuiltinFunctionType, BuiltinMethodType, FunctionType,
LambdaType, MethodType)
from LmCommon.common.attribute_object import LmAttList, LmAttObj
import xml.etree.E... | lifemapper/core | LmCommon/common/lm_xml.py | Python | gpl-3.0 | 14,471 |
"""
``numpy.linalg``
================
The NumPy linear algebra functions rely on BLAS and LAPACK to provide efficient
low level implementations of standard linear algebra algorithms. Those
libraries may be provided by NumPy itself using C versions of a subset of their
reference implementations but, when possible, high... | jorisvandenbossche/numpy | numpy/linalg/__init__.py | Python | bsd-3-clause | 1,825 |
"""
A simple hexdump.
Usage:
$ python -m dqutils.dq6.hexdump <address> <byte_count>... <record_count>
"""
from ..snescpu.hexdump import dump
if __name__ == '__main__':
dump('DRAGONQUEST6')
| showa-yojyo/dqutils | dqutils/dq6/hexdump.py | Python | mit | 196 |
largest = None
smallest = None
listONums = []
while True:
num = raw_input("Enter a number: ")
if num == "done" : break
try:
num = int(num)
#push into a list and sort the list
listONums.append(num)
listONums.sort()
smallest = listONums[0]
large... | peasfrog/coursera | Python/Programming 4 Everyone 1-5/week7/ch5/5.1.py | Python | mit | 496 |
# -*- coding: utf-8 -*-
# Copyright 2020 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-datacatalog | samples/generated_samples/datacatalog_generated_datacatalog_v1beta1_data_catalog_search_catalog_async.py | Python | apache-2.0 | 1,568 |
from keras.models import Model
from keras.layers import Input, Masking, Dense, LSTM
from keras.layers import Dropout, TimeDistributed, Bidirectional, merge
from keras.layers.embeddings import Embedding
from keras.utils import np_utils
from keras.optimizers import RMSprop
import numpy as np
import pandas as pd
import ... | danche354/Sequence-Labeling | chunk/senna-raw-hash-2-pos-128-64-rmsprop5.py | Python | mit | 7,370 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import shutil
import tempfile
import warnings
from collections import OrderedDict
from contextlib import contextmanager
from nose.tools import assert_raises
from nose.plugins.attrib import attr
impo... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/matplotlib/tests/test_style.py | Python | bsd-2-clause | 4,668 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under... | jmesteve/saas3 | openerp/addons_extra/account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py | Python | agpl-3.0 | 1,868 |
# cocos2d
# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must reta... | eevee/cocos2d-mirror | cocos/custom_clocks.py | Python | bsd-3-clause | 15,860 |
# © 2017 Creu Blanca
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models, fields
class ResCurrency(models.Model):
_inherit = 'res.currency'
def get_current_rate(self):
date = self._context.get('date') or fields.Datetime.now()
company_id = self._conte... | factorlibre/l10n-spain | l10n_es_facturae/models/res_currency.py | Python | agpl-3.0 | 1,050 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('orders', '0002_auto_20161224_1421'),
]
operations = [
migrations.AddField(
model_name='order',
name=... | mnahm5/django-estore | src/orders/migrations/0003_order_status.py | Python | mit | 485 |
#!/usr/bin/env python
import sys
import os
sys.path.append(
os.path.abspath(
os.path.join(os.path.dirname(__file__), os.path.pardir)))
from check_outboundCall import ElevatorCall as check
def main():
check().run_nagios_check()
if __name__=="__main__":
main()
| psywhale/pyswitchvox | bin/elevator_check.py | Python | bsd-3-clause | 285 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | Petr-Kovalev/nupic-win32 | tests/unit/py2/nupic/math/lgamma_test.py | Python | gpl-3.0 | 2,359 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 NOEL-BARON Léo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
#... | vlegoff/tsunami | src/primaires/salle/types/combustible.py | Python | bsd-3-clause | 3,785 |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
import warnings
warnings.filterwarnings('ignore') # ignore warnings: only use this once you are sure things are working
from IPython.html.widgets import *
from fromFatiand... | kinverarity1/gpgLabs | Mag/importMag.py | Python | mit | 415 |
# -*- coding: utf-8 -*-
import copy
import logging
import requests
import pdcupdater.handlers
import pdcupdater.services
import pdcupdater.utils
log = logging.getLogger(__name__)
session = requests.Session()
# These are the states of a pungi4 compose that we care about.
# There are other states that we don't care ... | fedora-infra/pdc-updater | pdcupdater/handlers/compose.py | Python | lgpl-2.1 | 5,928 |
#!/usr/bin/python
# Copyright 2013 the Neutrino authors (see AUTHORS).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
# Does what it says on the package really.
import json
import plistlib
import sys
in_file = sys.argv[1]
out_file = sys.argv[2]
data = json.load(open(in_file, "rt"))
plistlib.writePl... | plesner/neutrino | src/sh/json-to-plist.py | Python | apache-2.0 | 340 |
# -*- coding: utf-8 -*-
"""
Unit tests for the spike_train_correlation module.
:copyright: Copyright 2015-2016 by the Elephant team, see `doc/authors.rst`.
:license: Modified BSD, see LICENSE.txt for details.
"""
import sys
import unittest
import neo
import numpy as np
import quantities as pq
from numpy.testing.util... | apdavison/elephant | elephant/test/test_spike_train_correlation.py | Python | bsd-3-clause | 33,821 |
# Copyright 2015 Cloudbase Solutions Srl
# 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 r... | cloudbase/heat2arm | heat2arm/main.py | Python | apache-2.0 | 3,329 |
import os, sys, shutil, shlex, re
from urllib import urlretrieve
from subprocess import Popen, PIPE
from distutils.cmd import Command
class OSXPortableBuild(Command):
description = "custom build command that builds portable osx package"
user_options = [
('dist-dir=', None,
"pa... | nuigroup/pymt-widgets | pymt/tools/packaging/osx/build.py | Python | lgpl-3.0 | 9,375 |
# -*- coding: utf-8 -*-
import common
import sys, os, traceback
import time
import random
import re
import urllib
import string
from string import lower
from entities.CList import CList
from entities.CItemInfo import CItemInfo
from entities.CListItem import CListItem
from entities.CRuleItem import CRuleItem
import c... | Crach1015/plugin.video.superpack | zip/plugin.video.SportsDevil/lib/parser.py | Python | gpl-2.0 | 26,568 |
# Script for calculation of ferroelectric wall domain profile
from math import *
from numpy import *
import matplotlib.pyplot as plt
axes = plt.gca()
axes.set_xlim([-0.6,0.6])
axes.set_ylim([-0.8,0.8])
beta = -2.92e8
g = 0.54e-10
xi = 1.56e9
alpha0 = 7.6e5
q11 = 0.089
q12 = -0.026
s11 = -2.5
s12 = 9.0
e = 4.0/((8.8... | JoulesCESAR/domain_wall | polarization_three.py | Python | gpl-3.0 | 2,447 |
"""
You can store your app's configuration settings here.
Generate good secret keys: http://flask.pocoo.org/docs/quickstart/#sessions
>>> import os
>>> os.urandom(24)
'\xfd{H\xe5<\x95\xf9\xe3\x96.5\xd1\x01O<!\xd5\xa2\xa0\x9fR"\xa1\xa8'
"""
SECRET_KEY = 'this_obviously_should_be_changed_using_os.urandom()... | voidfiles/adn-beers | api/app/settings.py | Python | mit | 322 |
# Copyright 2014-2015 Luc Saffre
# This file is part of Lino Welfare.
#
# Lino Welfare 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 ve... | khchine5/lino-welfare | lino_welfare/modlib/badges/__init__.py | Python | agpl-3.0 | 1,857 |
# -*- coding: utf-8 -*-
#
# 程序主入口
#
import sys
import os.path
import traceback
from toolkit import *
from account import Account
from rate_history import RateHistory
#
# 加载存量数据
#
def load_balance_flow(data_file):
file_reader = open(data_file)
data = [line.strip().split(',') for line in file_reader.readli... | bourneli/benben_interest | python/main.py | Python | gpl-3.0 | 1,659 |
import tkinter.ttk as ttk
import tkinter as tk
import tkinter.scrolledtext as tkst
class SearchDiscount(ttk.Frame):
def __init__(self, master, model, ctrl):
ttk.Frame.__init__(self, master)
self.model = model
self.ctrl = ctrl
self.create_widgets()
def create_widgets(self):
... | rssalessio/MMSE15Project-RussoJohansson | mmse15project/views/subviews/SearchDiscount.py | Python | gpl-2.0 | 2,110 |
from Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ParentalControlSetup import ProtectedScreen
from Components.Sources.List import List
from Components.ActionMap import NumberActionMap, ActionMap
from Components.Sources.StaticText import StaticText
from Components.config import configfile
... | vuteam/BlackHole-New | lib/python/Screens/Menu.py | Python | gpl-2.0 | 17,520 |
# -*- coding: utf-8
# pylint: disable=line-too-long
import anvio
import anvio.tables as t
import anvio.utils as utils
import anvio.terminal as terminal
from anvio.dbops import DBClassFactory
from anvio.errors import ConfigError
from anvio.tables.tableops import Table
__author__ = "Developers of anvi'o (see AUTHORS.... | merenlab/anvio | anvio/tables/views.py | Python | gpl-3.0 | 6,287 |
import sys
if sys.version_info < (3, 7):
from ._zerolinewidth import ZerolinewidthValidator
from ._zerolinecolor import ZerolinecolorValidator
from ._zeroline import ZerolineValidator
from ._visible import VisibleValidator
from ._type import TypeValidator
from ._title import TitleValidator
... | plotly/plotly.py | packages/python/plotly/plotly/validators/layout/scene/zaxis/__init__.py | Python | mit | 5,691 |
from annual_settings import year_end
je_list=[]
# Income tax of 20000 was deducted from salary of 80000 and the balance was deposited in bank
sal = [(year_end, "Salary Income"),
('sbi',60000),
('income tax', 20000),
('salary', -80000)]
je_list += [sal]
# 10000 was withdrawn from bank and sp... | jrvarma/ledger-helper | example/make_je_list.py | Python | gpl-3.0 | 812 |
#!/usr/bin/env python
"""
runtests.py [OPTIONS] [-- ARGS]
Run tests, building the project first.
Examples::
$ python runtests.py
$ python runtests.py -s {SAMPLE_SUBMODULE}
$ python runtests.py -t {SAMPLE_TEST}
$ python runtests.py --ipython
$ python runtests.py --python somescript.py
"""
#
# Th... | juliantaylor/scipy | runtests.py | Python | bsd-3-clause | 8,870 |
import xml.etree.ElementTree as ET
import requests
from flask import Flask
import batalha
import pokemon
import ataque
class Cliente:
def __init__(self, execute = False, ip = '127.0.0.1', port = 5000, npc = False):
self.ip = ip
self.port = port
self.npc = npc
if (execute):
self.iniciaBatalha()
def writ... | QuartetoFantastico/projetoPokemon | cliente.py | Python | gpl-2.0 | 6,564 |
'''
Maze Generator
By Stephen Davies
Builds a maze using tree construction
'''
# Current idea:
# - Build maze and tree at the same time
# - Start at some square - say (0, 0) for now - and randomly add unused square to leaves of the tree
import random, json
from collections import namedtuple
SquareNode = namedtuple... | steve9164/maze-generator | maze.py | Python | mit | 6,550 |
# Analyze Color of Object
import os
import cv2
import numpy as np
from . import print_image
from . import plot_image
from . import fatal_error
from . import plot_colorbar
def _pseudocolored_image(device, histogram, bins, img, mask, background, channel, filename, resolution,
analysis_images, ... | AntonSax/plantcv | plantcv/analyze_color.py | Python | mit | 11,048 |
# Copyright 2015 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... | gunan/tensorflow | tensorflow/python/kernel_tests/sparse_ops_test.py | Python | apache-2.0 | 42,596 |
#!/bin/env python
""" create and put 'PutAndRegister' request with a single local file
warning: make sure the file you want to put is accessible from DIRAC production hosts,
i.e. put file on network fs (AFS or NFS), otherwise operation will fail!!!
"""
__RCSID__ = "$Id: $"
import os
from DIRAC.Core.Base... | Sbalbp/DIRAC | DataManagementSystem/scripts/dirac-dms-put-and-register-request.py | Python | gpl-3.0 | 2,952 |
from biotest import BioTest
from nfilter import make_filtered, write_filtered, fqs_excluding_indices, write_post_filter
import os
import mock
#
class TestNGSFilter(BioTest):
def setUp(self):
self.actualfn = 'tests/testoutput/filtered.1900_S118_L001_R2_001_2015_04_24.fastq'
self.expectedfn = 'tests/... | demis001/biopandas | tests/testfilter.py | Python | gpl-2.0 | 2,058 |
#!/usr/bin/env python
import rospy
import pygame
import random
import os, sys
from std_msgs.msg import Header
from geometry_msgs.msg import Twist, Point, PoseStamped, Pose, Quaternion
from tf import transformations as tf_trans
import math
import numpy as np
#constants
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 400
WAYPOINT_... | ufieeehw/IEEE2015 | ros/ieee2015_simulator/scripts/navigation_visualizer.py | Python | gpl-2.0 | 6,744 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-16 06:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('voximplant', '0008_auto_20160514_0800'),
]
operations = [
migrations.RemoveF... | telminov/django-voximplant | voximplant/migrations/0009_auto_20160516_0649.py | Python | mit | 813 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from unittest.mock import Mock, call
from tinyrpc.server import RPCServer
from tinyrpc.transports import ServerTransport
from tinyrpc.protocols import RPCProtocol, RPCResponse
from tinyrpc.dispatch import RPCDispatcher
CONTEXT='sapperdeflap'
RECMSG='out of... | mbr/tinyrpc | tests/test_server.py | Python | mit | 1,748 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 5, transform = "Logit", sigma = 0.0, exog_count = 20, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_Logit/trend_MovingAverage/cycle_5/ar_/test_artificial_32_Logit_MovingAverage_5__20.py | Python | bsd-3-clause | 263 |
import datetime
from django.contrib.auth.models import Group
from django.contrib.contenttypes.models import ContentType
from django.core import mail
from django.test import TestCase
from django.utils import timezone
from django_dynamic_fixture import G
from apps.authentication.models import AllowedUsername
from apps.... | dotKom/onlineweb4 | apps/events/tests/model_tests.py | Python | mit | 17,333 |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | polyaxon/polyaxon | platform/coredb/coredb/apps.py | Python | apache-2.0 | 774 |
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | boto/botocore | tests/functional/test_service_names.py | Python | apache-2.0 | 2,496 |
# Copyright (C) 2015 Randy Direen <nearside@direentech.com>
#
# This file is part of NearSide.
#
# NearSide 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 optio... | rdireen/nearside | nearside/probe.py | Python | gpl-3.0 | 2,109 |
"""Add Category#type
Revision ID: 22d3f8f2494c
Revises: 18e1e2aec298
Create Date: 2013-11-17 00:53:31.176635
"""
# revision identifiers, used by Alembic.
revision = '22d3f8f2494c'
down_revision = '18e1e2aec298'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('categories', sa.Colum... | vladan-m/ggrc-core | src/ggrc/migrations/versions/20131117005331_22d3f8f2494c_add_category_type.py | Python | apache-2.0 | 587 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.