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 |
|---|---|---|---|---|---|
#!/usr/bin/env python3.6
if __name__ == '__main__':
pass
| prisonersDilemma/orionscripts | whois/whois/tests/__init__.py | Python | gpl-2.0 | 65 |
"""Unit tests for FrameHouseStatusMonitorEnableRequest."""
import unittest
from pyvlx.api.frame_creation import frame_from_raw
from pyvlx.api.frames import FrameHouseStatusMonitorEnableRequest
class TestFrameHouseStatusMonitorEnableRequest(unittest.TestCase):
"""Test class FrameHouseStatusMonitorEnableRequest.""... | Julius2342/pyvlx | test/frame_house_status_monitor_enable_req_test.py | Python | lgpl-3.0 | 1,101 |
import unittest
from vanilla_neural_nets.base.loss_function import BaseLossFunction
from vanilla_neural_nets.neural_network.loss_function import MeanSquaredError
from vanilla_neural_nets.neural_network.loss_function import BinaryCrossEntropyLoss
from vanilla_neural_nets.recurrent_neural_network.loss_function import Cr... | cavaunpeu/vanilla-neural-nets | tests/test_loss_functions.py | Python | mit | 998 |
# -*- coding: utf-8 -*-
#
# cloudbench documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values hav... | jayfk/cloudbench.io | docs/conf.py | Python | bsd-3-clause | 7,827 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# **************************************************************************
# Copyright © 2016 jianglin
# File Name: __init__.py
# Author: jianglin
# Email: mail@honmaple.com
# Created: 2016-12-12 00:14:07 (CST)
# Last Update: Wednesday 2018-09-26 10:52:51 (CST)
# ... | honmaple/flask-maple | flask_maple/translations/__init__.py | Python | bsd-3-clause | 479 |
import unittest
import modular_core.libfundamental as lfu
from modular_core.libsimcomponents import ensemble_manager as mng
import os, sys, pdb
#log = open(os.path.join(os.getcwd(), 'test_ensemble.log'), 'w')
#sys.stdout = log
import lattice as mod
class dummyTestCase(unittest.TestCase):
"""Tests for `dummy modul... | ctogle/lattice | tests/test_lattice.py | Python | mit | 1,022 |
from .. import AngularTerm, PowerTerm, memoize
from .P00 import Phh_mu0
class P22_mu4(AngularTerm):
"""
Implement P22[mu4]
"""
@memoize
def total(self, k):
b1, b1_bar = self.m._ib1, self.m._ib1_bar
b2_00, b2_00_bar = self.m.b2_00_d(b1), self.m.b2_00_d(b1_bar)
... | nickhand/pyRSD | pyRSD/rsd/power/biased/P22.py | Python | gpl-3.0 | 1,624 |
import sys
import os
from collections import OrderedDict
import lxml
from lxml import etree
schemaFile = os.path.join('schema_files','UtilDataProp39Report.xsd')
def getTextValues(node, valueConf, ns, defaultValue='' ):
out = []
for (xmlName, exportName) in valueConf:
#print xmlName, exportName
... | sborgeson/prop39schools | p39toCSV.py | Python | mit | 12,800 |
#coding=utf-8
import os,MySQLdb,re
path = os.path.split(os.path.realpath(__file__))[0]+"/"
f = open(path+"code.txt","r")
A = f.read()
db = MySQLdb.connect("127.0.0.1","root","root","0002" )
cursor = db.cursor()
arr = re.split("\s+",A)
cursor.execute("DROP TABLE IF EXISTS CODE")
sql = """CREATE TABLE CODE (
no ... | luoxufeiyan/python | NKUCodingCat/0002/0002.py | Python | mit | 493 |
from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from electrum_gui.kivy.i18n import _
Builder.load_string('''
<FeeDialog@Popup>
id: popup
title: _('Transaction Fees')
size_hint: 0.8, 0.8
pos_hint: {'top':0.9}
method:... | kyuupichan/electrum | gui/kivy/uix/dialogs/fee_dialog.py | Python | mit | 4,529 |
#!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for lkgm_manager. Needs to be run inside of chroot for mox."""
import mox
import os
import sys
import tempfile
from x... | espadrine/opera | chromium/src/third_party/chromite/buildbot/lkgm_manager_unittest.py | Python | bsd-3-clause | 22,708 |
#******************************************************************************
# (C) 2018, Stefan Korner, Austria *
# *
# The Space Python Library is free software; you can redistribute it and/or ... | Stefan-Korner/SpacePyLibrary | CS/EDENgui.py | Python | mit | 8,076 |
from cassandra.query import SimpleStatement
from dtest import TRACE, Tester, debug
from tools import no_vnodes
@no_vnodes()
class TestPendingRangeMovements(Tester):
def pending_range_test(self):
"""
@jira_ticket CASSANDRA-10887
"""
cluster = self.cluster
# If we are on 2.... | mambocab/cassandra-dtest | pending_range_test.py | Python | apache-2.0 | 2,669 |
#!/usr/bin/env python3
# Copyright 2021 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 ... | jtattermusch/grpc | tools/distrib/check_redundant_namespace_qualifiers.py | Python | apache-2.0 | 5,061 |
# Pizza.py toolkit, www.cs.sandia.gov/~sjplimp/pizza.html
# Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
#
# Copyright (2005) Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
# certain rights in this software. This software is... | sn-amber/mylpp | src/histo.py | Python | gpl-2.0 | 2,156 |
#!/usr/bin/env python
import json
import logging
import re
import unittest
import urllib2
from vtctl import vtctl_client
import environment
import tablet
import utils
# range '' - 80
shard_0_master = tablet.Tablet()
shard_0_replica = tablet.Tablet()
# range 80 - ''
shard_1_master = tablet.Tablet()
shard_1_replica =... | derekstavis/bluntly | vendor/github.com/youtube/vitess/test/vtctld_test.py | Python | mit | 5,968 |
# -*- coding: utf-8 -*-
import scrapy
from locations.items import GeojsonPointItem
DAYS = [
'Mo',
'Tu',
'We',
'Th',
'Fr',
'Sa',
'Su'
]
class SparNoSpider(scrapy.Spider):
name = "spar_no"
allowed_domains = ["spar.no"]
start_urls = (
'https://spar.no/Finn-butikk/',
... | iandees/all-the-places | locations/spiders/spar_no.py | Python | mit | 2,746 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
merge.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************************... | geopython/QGIS | python/plugins/processing/algs/gdal/merge.py | Python | gpl-2.0 | 7,767 |
import html
import re
import sys
import logging
import json
import requests
import datetime
import dateutil
import dateutil.parser
import plugin
from utils import str_utils
from utils import date_utils
from utils import number_utils
class Twitter(plugin.Plugin):
MAX_LINE_COUNT = 16
URL_REGEX = re.compile(... | Tigge/platinumshrimp | plugins/twitter/twitter.py | Python | mit | 2,449 |
"""
====================
SimpleFitter wrapper
====================
Adds a variable height (background) component to any model
"""
import numpy
from pyspeckit.mpfit import mpfit
from numpy.ma import median
from pyspeckit.spectrum.moments import moments
class SimpleFitter(object):
def __init__():
pass
... | vlas-sokolov/pyspeckit | pyspeckit/spectrum/models/fitter.py | Python | mit | 1,002 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""获取爱词霸单词信息
"""
import urlparse
import copy
import re
import requests
class Lciba(object):
"""从爱词霸获取单词信息
"""
def __init__(self, headers=None, audio=False, lang='en-US',
syllable=False, extra=False):
self.headers = copy.deepcopy(head... | mozillazg/PyShanb | pyshanb/iciba.py | Python | mit | 4,885 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.NORMAL
def dependencies():
pass
def tamper(payload, **kwargs):
"""
Replaces quote charact... | V11/volcano | server/sqlmap/tamper/unmagicquotes.py | Python | mit | 1,275 |
# configuration information for the users module
# pagination for index
exports = dict()
exports['POSTS_PER_PAGE'] = 6 | buckbaskin/flask-vertical | modules/users/server/config/user-server-config.py | Python | mit | 120 |
import os
from django.conf import settings as django_settings
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
from django.utils.datastructures import SortedDict
from setman import settings
from setman.helpers import get_config
from setman.utils.parsing import is... | playpauseandstop/setman | testproject-django/testapp/views.py | Python | bsd-3-clause | 3,659 |
# -*- coding: utf-8 -*-
#
# django-waffle documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 1 17:45:05 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | willkg/django-waffle | docs/conf.py | Python | bsd-3-clause | 7,796 |
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from wagtail.wagtailsnippets.models import register_snippet
# AlphaSnippet and ZuluSnippet are for testing ordering of
# snippets when registering. They are named as such to ensure
# thier ordering is clear. They are registe... | stevenewey/wagtail | wagtail/tests/snippets/models.py | Python | bsd-3-clause | 1,053 |
import pytest
import socket
from buildpal.common.beacon import Beacon, get_nodes_from_beacons
MULTICAST_PORT = 53334
@pytest.fixture(scope='module', params=(
(4, 31313), (5, 31314), (6, 31315), (7, 31316), (8, 31317), (9, 31318),
(4, 31313), (5, 31324), (6, 31335), (7, 31346), (8, 31357), (9, 31368)... | pkesist/buildpal | Python/test/test_beacon.py | Python | gpl-3.0 | 1,032 |
from itertools import chain
class Elevator(object):
def __init__(self, id, y, passengers, state, speed, floor, next_floor, time_on_floor, type):
self.id = id
self.y = y
self.passengers = [Passenger(**p) for p in passengers]
self.state = state
self.speed = speed
self... | Tairesh/aicups | clients/python2_client/client/core/api.py | Python | apache-2.0 | 3,688 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from blinker import signal, Namespace, NamedSignal
from yosaipy2.core.event.abcs import EventBus
from typing import Dict
from functools import wraps
class BlinkerEventBus(EventBus):
def __init__(self):
# type: (str) -> None
self.AUTO_TOPIC = "blinker_e... | jellybean4/yosaipy2 | yosaipy2/core/event/event_bus.py | Python | apache-2.0 | 1,390 |
import collections
import copy
import heapq
import traceback
import warnings
import weakref
import numpy
import chainer
from chainer import cuda
from chainer import initializers
from chainer.initializers import constant
from chainer.utils import argument
def _check_grad_type(func, x, gx):
if x.data is None or g... | kashif/chainer | chainer/variable.py | Python | mit | 43,186 |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozil... | SciViews/sciviewsk | pylib/cile_r.py | Python | lgpl-2.1 | 4,738 |
from numpy.testing import (
assert_allclose,
assert_array_equal,
)
import numpy as np
import pytest
from sklearn.datasets import make_classification
from sklearn.compose import make_column_transformer
from sklearn.exceptions import NotFittedError
from sklearn.linear_model import LogisticRegression
from sklearn... | huzq/scikit-learn | sklearn/metrics/_plot/tests/test_confusion_matrix_display.py | Python | bsd-3-clause | 13,312 |
# coding=utf-8
from __future__ import print_function
from builtins import range
from pyqtgraph_karl import PolyLineROI
import numpy as np
from fancytools.math.gridPointsFromEdges import gridPointsFromEdges
class UnregGridROI(PolyLineROI):
def __init__(self, nCells, edges=None, pos=(0, 0), size=(1, 1), **args):
... | radjkarl/dataArtist | dataArtist/items/UnregGridROI.py | Python | gpl-3.0 | 2,717 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | todaychi/hue | desktop/core/src/desktop/lib/tasks/compress_files/compress_utils.py | Python | apache-2.0 | 2,800 |
from clarent import certificate
from datetime import datetime
from inspect import getargspec
from OpenSSL import crypto, SSL
from twisted.trial.unittest import SynchronousTestCase
from twisted.python.filepath import FilePath
class FakePKey(object):
"""A fake key.
"""
def generate_key(self, keyType, keyLe... | crypto101/clarent | clarent/test/test_certificate.py | Python | isc | 9,182 |
__author__ = 'Neil Butcher'
from PyQt4 import QtCore, QtGui
from command_duration import CommandChangeDuration
from command_durations import CommandAddDuration, CommandRemoveDuration
from Rota_System.Duration import Duration
class DurationsModel(QtCore.QAbstractListModel):
commandIssued = QtCore.pyqtSignal(QtGui... | ergoregion/Rota-Program | Rota_System/UI/Duration/model_durations.py | Python | mit | 2,138 |
# -*- coding: utf-8 -*-
# author : alex fu
from Tkinter import *
from os.path import exists
root = Tk()
root.title("极简日记本")
def save_text():
t = entry.get()
text.insert(END, t)
# 一行显示一行
text.insert(END, "\n")
# 插入到显示区域后, 删除输入框中的文字
entry.delete(0, END)
l = open("log.txt", "a")
# 解决编码问... | fqlxxxxx/OMOOC2py | _src/om2py2w/2wex0/main_desk.py | Python | mit | 927 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 5, transform = "None", sigma = 0.0, exog_count = 20, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_None/trend_MovingMedian/cycle_5/ar_12/test_artificial_128_None_MovingMedian_5_12_20.py | Python | bsd-3-clause | 263 |
# Copyright (c) 2014, Salesforce.com, Inc. 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 of conditions... | priorknowledge/loom | examples/lending_club/test.py | Python | bsd-3-clause | 1,584 |
# -*- coding: utf-8 -*-
#
# Copyright (C) University College London, 2013, all rights reserved.
#
# This file is part of FabMD and is CONFIDENTIAL. You may not work
# with, install, use, duplicate, modify, redistribute or share this
# file, or any part thereof, other than as allowed by any agreement
# specifically m... | uschille/FabSim | deploy/fab.py | Python | lgpl-3.0 | 13,608 |
#!/usr/bin/env python
# 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.
"""A collection of utils used by slave unittests."""
import test_env # pylint: disable=W0403,W0611
import contextlib
import coverage... | eunchong/build | scripts/slave/unittests/utils.py | Python | bsd-3-clause | 500 |
# -*- coding: utf-8 -*-
import copy
import nose.tools as nt
from nbformat import validate
from .. import convert
from . import nbexamples
from nbformat.v3.tests import nbexamples as v3examples
from nbformat import v3, v4
def test_upgrade_notebook():
nb03 = copy.deepcopy(v3examples.nb0)
validate(nb03)
nb... | bdh1011/wau | venv/lib/python2.7/site-packages/nbformat/v4/tests/test_convert.py | Python | mit | 1,871 |
# coding: utf-8
# #verify pyEMU null space projection with the freyberg problem
# In[1]:
#get_ipython().magic(u'matplotlib inline')
import os
import shutil
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pyemu
# instaniate ```pyemu``` object and drop prior info. Then reorder the jac... | jtwhite79/pyemu | verification/Freyberg/verify_null_space_proj.py | Python | bsd-3-clause | 2,210 |
# Read from an MQTT queue and write events to Influxdb
import argparse
import asyncio
import time
import sys
from collections import namedtuple
from thingflow.base import Scheduler, SensorEvent
from thingflow.adapters.mqtt import MQTTReader
import thingflow.filters.select # adds select() method
import thingflow.filte... | jfischer/micropython-iot-hackathon | example_code/server_mqtt_to_influx.py | Python | mit | 2,908 |
# -*- coding: utf-8 -*-
#
# This file is part of GetTor, a Tor Browser distribution system.
#
# :authors: Israel Leiva <ilv@riseup.net>
# see also AUTHORS file
#
# :copyright: (c) 2008-2014, The Tor Project, Inc.
# (c) 2014, Israel Leiva
#
# :license: This is Free Software. See LICENSE for lic... | ilv/gettor | gettor/smtp.py | Python | bsd-3-clause | 17,953 |
from baseindex import Index
from pyflann import *
import abc
import numpy as np
class FlannIndex(Index):
"""Represents flann index"""
__metaclass__ = abc.ABCMeta
def __init__(self):
"""Initialize flann instance."""
self.flann = FLANN()
self.params = None
def query(self, querie... | pkariz/nnsearch | nnsearch/flannindex.py | Python | gpl-3.0 | 3,064 |
# -*- coding:UTF-8 -*-
def main():
print('main()')
if __name__ == '__main__':
main()
| QuietWoods/VIN | __init__.py | Python | mit | 96 |
from solutions import seconds_to_hours_minutes_seconds
import unittest
import random
class TestSecondsToHoursMinutesSeconds(unittest.TestCase):
def test_0(self):
sec = 0
expected = "00:00:00"
actual = seconds_to_hours_minutes_seconds(sec)
self.assertEqual(expected, actual... | lukin155/skola-programiranja | domaci-zadaci/05/test_seconds_to_hours_minutes_seconds.py | Python | mit | 1,086 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Mo. Jun 7 23:47:34 2010
# by: The Resource Compiler for PyQt (Qt v4.5.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x01\x7d\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x4... | lalinsky/picard-debian | picard/resources.py | Python | gpl-2.0 | 564,874 |
""" Client to interact with the S3Gateway """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from DIRAC.Core.Base.Client import Client, createClient
@createClient("DataManagement/S3Gateway")
class S3GatewayClient(Client):
"""Client code to the S3Gate... | ic-hep/DIRAC | src/DIRAC/DataManagementSystem/Client/S3GatewayClient.py | Python | gpl-3.0 | 1,282 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-11-10 23:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('elections', '0030_election_candidates_can_commit_everywhere'),
]
... | ciudadanointeligente/votainteligente-portal-electoral | medianaranja2/migrations/0001_initial.py | Python | gpl-3.0 | 735 |
ver = str(0.1)
print('My-Penguin | World Server ' + ver)
| Luiqes/My-Penguin | config/World.py | Python | gpl-2.0 | 58 |
'''
Created by auto_sdk on 2014-12-17 17:22:51
'''
from top.api.base import RestApi
class UserrecommendItemsGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.count = None
self.ext = None
self.recommend_type = None
def getapiname(se... | CooperLuan/devops.notes | taobao/top/api/rest/UserrecommendItemsGetRequest.py | Python | mit | 369 |
import logging
from cwpoliticl.database.base.mysql_db import MysqlDatabase
from cwpoliticl.items import CacheItem
class CacheDatabase(MysqlDatabase):
def __init__(self, host, port, user, passwd, db, collection_name):
super(CacheDatabase, self).__init__(host, port, user, passwd, db, collection_name)
... | trujunzhang/djzhang-targets | cwpoliticl/cwpoliticl/database/cache_db.py | Python | mit | 5,089 |
# Copyright (C) 2015 Renato Lima - Akretion #
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import stock
| kmee/l10n-brazil | l10n_br_stock/models/__init__.py | Python | agpl-3.0 | 166 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 ... | SCSSoftware/BlenderTools | addon/io_scs_tools/internals/preview_models/cache.py | Python | gpl-2.0 | 5,663 |
# 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/capabilities/interfaces/pwrpc_lock_base.py | Python | apache-2.0 | 1,410 |
#!/usr/bin/env python3
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# Author: Sathish Kuttan <sathish.k.kuttan@intel.com>
# This script is the top level script that an user can invoke to
# download a Zephyr application binary from a Linux host connected
# over SPI to Intel Sue Cre... | galak/zephyr | boards/xtensa/intel_s1000_crb/support/download.py | Python | apache-2.0 | 3,952 |
import sublime
import sublime_plugin
try:
from .sbtsettings import SBTSettings
from .util import maybe, OnePerWindow
except(ValueError):
from sbtsettings import SBTSettings
from util import maybe, OnePerWindow
import re
class SbtView(OnePerWindow):
settings = {
"line_numbers": False,
... | jarhart/SublimeSBT | sbtview.py | Python | mit | 5,229 |
# Copyright (c) 2013 OpenStack Foundation.
#
# 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... | projectcalico/calico-neutron | neutron/tests/unit/openvswitch/test_agent_scheduler.py | Python | apache-2.0 | 68,914 |
#!/usr/bin/env python
"""Simple Gtk example to manually test event loop integration.
This is meant to run tests manually in ipython as:
In [1]: %gui gtk3
In [2]: %run gui-gtk3.py
"""
from gi.repository import Gtk
def hello_world(wigdet, data=None):
print("Hello World")
def delete_event(widget, event, data=No... | pacoqueen/ginn | extra/install/ipython2/ipython-5.10.0/examples/IPython Kernel/gui/gui-gtk3.py | Python | gpl-2.0 | 773 |
from MuseParse.tests.testLilyMethods.lily import Lily
from MuseParse.classes.ObjectHierarchy.ItemClasses import Key
class testKey(Lily):
def setUp(self):
self.item = Key.Key()
self.lilystring = ""
class testKeyFifths(Lily):
def setUp(self):
self.item = Key.Key(fifths=1)
sel... | Godley/MuseParse | MuseParse/tests/testLilyMethods/testKey.py | Python | mit | 920 |
import os
from html import unescape
from typing import Any, Dict, List, Optional
import markdown
import markdown.extensions.admonition
import markdown.extensions.codehilite
import markdown.extensions.extra
import markdown.extensions.toc
import markdown_include.include
from django.conf import settings
from django.templ... | jackrzhang/zulip | zerver/templatetags/app_filters.py | Python | apache-2.0 | 6,764 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2017-10-02 12:41
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frontend', '0029_merge'),
]
operations = [
migrations.AddField(
m... | ebmdatalab/openprescribing | openprescribing/frontend/migrations/0030_measure_tags_focus.py | Python | mit | 528 |
import django
from django.http import Http404
from django.views.generic import DetailView
from repanier.const import DECIMAL_ZERO
from repanier.models.bankaccount import BankAccount
from repanier.models.invoice import ProducerInvoice
from repanier.models.offeritem import OfferItemReadOnly
from repanier.models.producer... | pcolmant/repanier | repanier/views/producer_invoice_class.py | Python | gpl-3.0 | 4,583 |
from collections import OrderedDict
import plotly.plotly as pl
import plotly.graph_objs as pl_graph_objs
from plotly_system_stats.plotting.plot_config import plot_config
from plotly_system_stats.plotting.plot import SubPlot
class Figure(object):
def __init__(self, **kwargs):
self.main = kwargs.get('main'... | nocarryr/plotly-system-stats | plotly_system_stats/plotting/figure.py | Python | gpl-2.0 | 3,793 |
# firebird/base.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: firebird
:name: Firebird
Firebird Dialects
-----------------... | gdimitris/FleetManagerBackend | virtual_env/lib/python2.7/site-packages/sqlalchemy/dialects/firebird/base.py | Python | mit | 28,170 |
import numpy as np
import matplotlib.pyplot as plt
class CanvasMatplot(object):
pad = 2.0
w_pad = 0.5
h_pad = 2.0
figsize = (15, 5)
num_row = 1
sharey = True
def __init__(self):
pass
def make_axes(self, len_sites):
nrow, ncol = self.num_row, int(np.ceil(len_sites/sel... | braysia/covertrace | covertrace/utils/canvas.py | Python | mit | 621 |
#encoding: utf-8
"""
images.py -- Toolbox functions for creating and handling image output
Exported namespace: image_blast, array_to_rgba, array_to_image
Written by Joe Monaco
Center for Theoretical Neuroscience
Copyright (c) 2007-2008 Columbia Unversity. All Rights Reserved.
This software is provided AS IS under ... | jdmonaco/vmo-feedback-model | src/tools/images.py | Python | mit | 3,196 |
# Copyright (c) 2019 Cisco and/or its affiliates.
#
# 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 v... | alxgu/ansible | test/units/module_utils/network/ftd/test_device.py | Python | gpl-3.0 | 6,155 |
"""knnector URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | tmkasun/Knnect | knnector/urls.py | Python | apache-2.0 | 1,113 |
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | sassoftware/mint | mint/django_rest/devel/loadtester/createxml.py | Python | apache-2.0 | 2,872 |
from . import graphics
from . import input
from . import util
from .controller import Controller
| toboso-team/toledo | toledo/__init__.py | Python | mit | 97 |
from utils import accept_nonce, cleanup_nonces
__all__ = ('accept_nonce', 'cleanup_nonces')
| adieu/authentic2 | authentic2/nonce/__init__.py | Python | agpl-3.0 | 93 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | ttrifonov/horizon | openstack-dashboard/dashboard/urls.py | Python | apache-2.0 | 1,645 |
from car_class import *
my_car = Car('ford','fusion',2009)
my_tesla = ECar('tesla', 'model s', 2016)
print(my_car.get_descriptive_name())
my_car.update_odometer(50000)
print(my_tesla.get_descriptive_name())
my_tesla.battery.get_size()
my_tesla.battery.get_range()
my_tesla.battery.upgrade(85)
m... | v00d00dem0n/PyCrashCourse | class/car.py | Python | gpl-3.0 | 378 |
"""OpenNebula plugin for integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from . import (
CloudProvider,
CloudEnvironment,
CloudEnvironmentConfig,
)
from ..util import (
display,
ConfigParser,
)
class OpenNebulaCloudProvider(CloudProvi... | aperigault/ansible | test/lib/ansible_test/_internal/cloud/opennebula.py | Python | gpl-3.0 | 1,836 |
"""
Utility functions and classes.
"""
from functools import wraps
def synchronized(method):
"""
Decorator that wraps a method with an acquire/release of self._lock.
"""
@wraps(method)
def synced(self, *args, **kwargs):
with self._lock:
return method(self, *args, **kwargs)
... | rolando/crochet | crochet/_util.py | Python | mit | 366 |
# 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... | husixu1/vimrc | custom/.ycm_extra_conf.py | Python | gpl-3.0 | 5,298 |
from .definitions import * | tictail/tictail-python | tictail/resource/__init__.py | Python | mit | 26 |
#***************************************************************************
#* *
#* Copyright (c) 2012 Sebastian Hoogen <github@sebastianhoogen.de> *
#* *
#* This pr... | yantrabuddhi/FreeCAD | src/Mod/OpenSCAD/OpenSCADUtils.py | Python | lgpl-2.1 | 24,151 |
from webob import Response
def rdf_view(request):
""" """
return Response('rdf')
def juri_view(request):
""" """
return Response('juri')
def includeme(config):
config.add_route('rdf', 'licenses/:license_code/:license_version/rdf')
config.add_route('juri',
'licenses/:licen... | danielpronych/pyramid-doxygen | pyramid/tests/pkgs/ccbugapp/__init__.py | Python | bsd-2-clause | 459 |
# Copyright 2013-2015 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | kastriothaliti/techstitution | venv/lib/python3.5/site-packages/bson/regex.py | Python | gpl-3.0 | 4,272 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 OpenStack LLC.
# 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/... | tylertian/Openstack | openstack F/nova/nova/api/openstack/compute/consoles.py | Python | apache-2.0 | 4,679 |
# coding=utf-8
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: 'user-{0}'.format(n))
email = factory.Sequence(lambda n: 'user-{0}@example.com'.format(n))
password = factory.PostGenerationMethodCall('set_password', 'password')
class Meta:
... | watchdogpolska/watchdog-id | watchdog_id/users/tests/factories.py | Python | mit | 390 |
# Generated by Django 2.0 on 2018-01-17 07:24
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Hoax',
fields=[
('id', models.AutoField(auto_... | barliant/fnc-id | django_project/old/hoaxdetector/hoax/migrations/0001_initial.py | Python | apache-2.0 | 666 |
#!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-admin-modify-user
# Author : Adrian Casajus
########################################################################
"""
Modify a user in the CS.
"""
__RCSID__ = "$Id$"
import DIRAC
from DIRAC... | avedaee/DIRAC | Interfaces/scripts/dirac-admin-modify-user.py | Python | gpl-3.0 | 2,307 |
_module_name = "sdf_helper"
_sdf_version = "2.2.0"
try:
from ._version import __version__ as v
from ._version import __commit_id__ as c
from ._version import __commit_date__ as d
__version__ = v
__commit_id__ = c
__commit_date__ = d
del v, c, d
except ImportError:
__version__ = "UNKNOWN... | keithbennett/SDF_utilities | sdf_helper/__init__.py | Python | gpl-3.0 | 1,462 |
import sys
from serial import Serial, SerialException
try:
import biu.configuration as configuration
except ImportError:
import configuration as configuration
class BIU(Serial):
state = dict()
def get_my_port(self, open_ports = []):
ports = configuration.PORTS
for port in open_ports:
ports.remove(port)
f... | daniel-kurushin/iisu | biu/biu.py | Python | gpl-3.0 | 1,711 |
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Our operations on the frame come here
#gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
hsv = cv2.cvtColor(frame,cv2.COLOR_BGR2HSV)
lower_lim = np.array([25,60,60])
upper_... | Burtt/IllumicatsVision | RaspberryPi/tests/cvtest6.py | Python | mit | 798 |
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_fr... | jschovan/ACSIS | acsis/acsisweb/services/views.py | Python | apache-2.0 | 2,095 |
# -*- coding: utf-8 -*-
import re
from tater import Node, matches
re_enum = re.compile(ur'\s*([\d\w\-\–\.\u2013]+)')
_divisions = u'''
title
tit.
division
div.
paragraph
par.
section
sec.
part
part.
clause
item
chapter
ch.
article
art.
headi... | twneale/visitors | visitors/ext/legal.py | Python | bsd-3-clause | 1,183 |
"""Support for tracking for iCloud devices."""
from typing import Dict
from homeassistant.components.device_tracker import SOURCE_TYPE_GPS
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import callback
from hom... | tboyce021/home-assistant | homeassistant/components/icloud/device_tracker.py | Python | apache-2.0 | 4,442 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-02-13 22:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registration', '0001_initial'),
]
operations = [
migrations.AlterField(
... | dimagi/commcare-hq | corehq/apps/registration/migrations/0002_alter_request_ip.py | Python | bsd-3-clause | 477 |
import time
import pytest
from cfme.markers.env_markers.provider import providers
from cfme.utils import conf
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.grafana import get_scenario_dashboard_urls
from cfme.utils.log import logger
from cfme.utils.providers import ProviderFilter
fro... | apagac/cfme_tests | cfme/tests/perf/workloads/test_memory_leak.py | Python | gpl-2.0 | 4,503 |
#
# MythBox for XBMC - http://mythbox.googlecode.com
# Copyright (C) 2011 analogue@yahoo.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 2
# of the License, or (at you... | GetSomeBlocks/Score_Soccer | resources/test/mythboxtest/mythtv/test_domain.py | Python | mit | 34,567 |
import requests
import yaml
class RequestsApi:
def __init__(self):
'init'
self.config = yaml.load(open("config/request_settings.yml", "r"))
def get_objects(self, sector):
'request to get objects'
objects_points = []
url = self.config['host'] + self.config['object_path'] % sector
response = requests.get... | veskopos/VMWare | api/requests_api.py | Python | gpl-2.0 | 1,010 |
# -*- 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-dialogflow | samples/generated_samples/dialogflow_v2beta1_generated_intents_update_intent_async.py | Python | apache-2.0 | 1,563 |
numVars = 2
numCons = 5
A = [#[4, 1],
[1, 4],
# [1, -1],
[-1, 0],
[0, -1]]
b = [#28,
27,
# 1,
0,
0]
c = [2, 5]
obj_val = 2
sense = ('Max', '<=')
integerIndices = [0, 1]
if __name__ == '__main__':
try:
from coinor.cuppy.cuttingPlanes import so... | tkralphs/CuPPy | src/cuppy/examples/MIP7.py | Python | epl-1.0 | 784 |
#
# Copyright (C) 2010-2017 Samuel Abels
# 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"), to deal in the Software without restriction,
# including without limitation the rights to use, copy,... | knipknap/exscript | Exscript/util/url.py | Python | mit | 7,356 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.