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 |
|---|---|---|---|---|---|
#
# Stochastic logistic model.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import numpy as np
from scipy.interpolate import interp1d
import pints
from . import To... | martinjrobins/hobo | pints/toy/_stochastic_logistic_model.py | Python | bsd-3-clause | 5,807 |
from contextlib import suppress
from raptiformica.actions.mesh import raise_if_shared_secret_changed, ConsulSharedSecretChanged
from tests.testcase import TestCase
class TestRaiseIfSharedSecretChanged(TestCase):
def setUp(self):
self.consul_shared_secret_changed = self.set_up_patch(
'raptifor... | vdloo/raptiformica | tests/unit/raptiformica/actions/mesh/test_raise_if_shared_secret_changed.py | Python | mit | 1,698 |
"""Support for LimitlessLED bulbs."""
import logging
import voluptuous as vol
from homeassistant.const import CONF_NAME, CONF_HOST, CONF_PORT, CONF_TYPE, STATE_ON
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_EFFECT,
ATTR_FLASH,
ATTR_HS_COLOR,
ATTR_TRANSIT... | fbradyirl/home-assistant | homeassistant/components/limitlessled/light.py | Python | apache-2.0 | 12,679 |
# -*- coding: utf-8 -*-
__author__ = """Tormod Haugland"""
__email__ = 'tormod.haugland@gmail.com'
__version__ = '1.0.0-rc2'
| Typecraft/norsourceparser | norsourceparser/__init__.py | Python | mit | 126 |
from fabric.api import env, local, lcd
from fabric.colors import red, green
from fabric.decorators import task, runs_once
from fabric.operations import prompt
from fabric.utils import abort
from zipfile import ZipFile
import datetime
import fileinput
import importlib
import os
import random
import re
import subprocess... | CENDARI/dblookup | fabfile.py | Python | mit | 2,134 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, cint, getdate
def execute(filters=None):
if not filters: filters = {}
float_precis... | shitolepriya/test-erp | erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py | Python | agpl-3.0 | 3,286 |
# -*- coding: utf-8 -*-
"""
jsongit.author
"""
from time import altzone, daylight, timezone
from time import time as curtime
from pygit2 import Signature
import subprocess
from .exceptions import NoGlobalSettingError
def global_config(name):
"""Find the value of a `git --global` setting.
>>> jsongit.global... | talos/jsongit | jsongit/utils.py | Python | bsd-3-clause | 1,977 |
"""
Builds a simple dirt hut to shelter you from the enemies at night.
"""
from botchallenge import *
USERNAME = "" # Put your minecraft username here
SERVER = "" # Put the address of the minecraft server here
robot = Robot(USERNAME, SERVER)
hut_layout = """
xxxxx
x x
x x
x x
x x
x x
xx xx ... | Rafiot/botchallenge | client/examples/hut_builder.py | Python | mit | 1,294 |
from .gsea import *
| mrcinv/GSEA.py | gsea/__init__.py | Python | mit | 20 |
from flask import url_for
from sqlalchemy import Column, func, String, Unicode
from sqlalchemy.sql.expression import and_, bindparam
from pokr.database import Base
from .person import Person
from .election import Election
from .candidacy import Candidacy
class Region(Base):
__tablename__ = 'region'
id = Col... | teampopong/pokr.kr | pokr/models/region.py | Python | apache-2.0 | 2,440 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013-2019 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import loggin... | superdesk/superdesk-core | superdesk/text_checkers/spellcheckers/__init__.py | Python | agpl-3.0 | 6,324 |
import os
import logging
import pymongo
from bson.objectid import ObjectId
from flask import current_app as app
from superdesk import get_resource_service
from superdesk.notification import push_notification
from .app_settings import BLOGSLIST_ASSETS_DIR
from .exceptions import MediaStorageUnsupportedForBlogPublishing... | superdesk/liveblog | server/liveblog/blogs/utils.py | Python | agpl-3.0 | 4,307 |
"""
Misago default settings
This fille sets everything Misago needs to run.
If you want to add custom app, middleware or path, please update setting vallue
defined in this file instead of copying setting from here to your settings.py.
Yes:
#yourproject/settings.py
INSTALLED_APPS += (
'myawesomeapp',
)
No:
#yo... | 390910131/Misago | misago/conf/defaults.py | Python | gpl-2.0 | 12,306 |
from __future__ import unicode_literals
import codecs
import subprocess
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.utils import intlist_to_bytes
from youtube_dl.aes import aes_encrypt, key_expansion
secret_msg = b'Secret message goes here'
... | israeltobias/DownMedia | youtube-dl/devscripts/generate_aes_testdata.py | Python | gpl-3.0 | 1,137 |
# Copyright (C) 2011 Michal Zielinski (michal@zielinscy.org.pl)
#
# 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, or (at your option)
# any later version.
#
# This program is d... | javaxubuntu/freeciv-android | lib/freeciv/menus.py | Python | gpl-2.0 | 6,602 |
from enum import IntEnum
class FileType(IntEnum):
"""
Enumerates the different source file types:
- executable (.exe)
- module (.dll)
"""
#: Executable file (produces an executable binary that can be run)
EXECUTABLE = 0
#: Module file (produces a shared library that can be used... | loic-talon/OpenCobolIDE | open_cobol_ide/enums.py | Python | gpl-3.0 | 578 |
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import user_passes_test
from django.shortcuts import get_object_or_404
from django import forms
from django.db.models import Max, Avg, Sum
from opos.models import Customers
from opos.forms import CustomerAddForm, CustomerForm
def is_... | kradalby/O2 | opos/views.py | Python | mit | 2,687 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/camera.ui'
#
# Created: Thu Aug 27 22:39:01 2015
# by: PyQt4 UI code generator 4.11.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attr... | argenortega/AUI | aui/gui/views/sources/ui_camera.py | Python | mit | 2,664 |
from stompy.grid import orthogonalize, front, unstructured_grid, exact_delaunay,shadow_cdt
from stompy.model.delft import dfm_grid
from stompy import utils
import scipy.optimize as opt
import matplotlib.pyplot as plt
from matplotlib import collections, patches
import six
##
six.moves.reload_module(unstructured_grid... | rustychris/stompy | test/test_quad_front.py | Python | mit | 10,760 |
import os
import LeenoUtils
import DocUtils
import SheetUtils
import Dialogs
import LeenoSettings
import LeenoConfig
_EXPORTSETTINGSITEMS = (
'npElencoPrezzi',
'npComputoMetrico',
'npCostiManodopera',
'npQuadroEconomico',
'cbElencoPrezzi',
'cbComputoMetrico',
'cbCostiManodopera',
'cbQua... | giuserpe/leeno | src/Ultimus.oxt/python/pythonpath/LeenoPdf.py | Python | lgpl-2.1 | 8,880 |
# (c) 2005-2012 Divmod, Inc.
# See LICENSE file for details
import sys
try:
u = unicode
except NameError:
u = str
class Reporter(object):
"""
Formats the results of pyflakes checks to users.
"""
def __init__(self, warningStream, errorStream):
"""
Construct a L{Reporter}.
... | c0710204/mirrorsBistu | pypi/bandersnatch/lib/python2.7/site-packages/pyflakes/reporter.py | Python | mit | 2,556 |
#!/usr/bin/python3.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
from glob import glob
from setuptools import setup, find_packages
NAME = "pycopia3-net"
VERSION = "1.0"
import platform
if platform.system() == "Linux":
DATAFILES = [
('/etc/pycopia/ssl', glob("etc/ssl/*")),
]
SCRIPTS = glob(... | kdart/pycopia3 | net/setup.py | Python | apache-2.0 | 1,665 |
from atomic import AtomicLong
class Counter(object):
"""
A counter is like a gauge, but you can increment or decrement its value ::
counter = Metrology.counter('pending-jobs')
counter.increment()
counter.decrement()
counter.count
"""
def __init__(self):
self._count = ... | cyberdelia/metrology | metrology/instruments/counter.py | Python | mit | 910 |
"""
py2app/py2exe build script for Electrum Litecoin
Usage (Mac OS X):
python setup.py py2app
Usage (Windows):
python setup.py py2exe
"""
from setuptools import setup
import os
import re
import shutil
import sys
from lib.util import print_error
from lib.version import ELECTRUM_VERSION as version
name = ... | amaivsimau/electrum-ltc | setup-release.py | Python | gpl-3.0 | 2,894 |
from paypal.express.models import *
from paypal.payflow.models import * | canhhs91/greenpointtrees | src/paypal/models.py | Python | mit | 71 |
import math
import shm
from gi.repository import Gdk
from misc.log import with_logging
from cave.libcave.tags.tagtype import TagType
from cave.libcave.tags.registered_tags import register_tag_type, \
require_mission_elements_to_implement
MIN_RADIUS = 20
MAX_RADIUS = 450... | cuauv/software | cave/libcave/tags/centerpointvisible.py | Python | bsd-3-clause | 3,334 |
"""
Support for MQTT Template lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.mqtt_template/
"""
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components import mqtt
from homeassistant.co... | tinloaf/home-assistant | homeassistant/components/light/mqtt/schema_template.py | Python | apache-2.0 | 16,276 |
# coding: utf-8
from qgis.gui import QgsGlowWidget
glow_widget = QgsGlowWidget()
glow_widget.show()
| webgeodatavore/pyqgis-samples | gui/qgis-sample-QgsGlowWidget.py | Python | gpl-2.0 | 102 |
# -*- coding: utf-8 -*-
# * Copyright (C) 2012-2013 Croissance Commune
# * Authors:
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
# * Pettier Gabriel;
# * TJEBBES Gaston <g.t@majerti.fr>
#
# This file is part of Autonomie : Progiciel de gestion de CAE.
#
# Autonomie is... | CroissanceCommune/autonomie | autonomie/tests/panels/test_menu.py | Python | gpl-3.0 | 2,282 |
from conans import ConanFile, CMake
import os
# This easily allows to copy the package in other user or channel
channel = os.getenv("CONAN_CHANNEL", "testing")
username = os.getenv("CONAN_USERNAME", "demo")
class HelloReuseConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = ("hello... | willir/cppconf2017-mc1 | test_package/conanfile.py | Python | apache-2.0 | 1,130 |
from __future__ import generators
from rdflib import BNode
from rdflib.Literal import Literal
from pprint import pprint
from pysqlite2 import dbapi2
import sha,sys,re,os
from rdflib.term_utils import *
from rdflib.Graph import QuotedGraph
from rdflib.store.REGEXMatching import REGEXTerm, NATIVE_REGEX, PYTHON_REGEX
from... | aaronsw/watchdog | vendor/rdflib-2.4.0/rdflib/store/SQLite.py | Python | agpl-3.0 | 18,855 |
# coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from abc import abst... | peiyuwang/pants | src/python/pants/backend/jvm/tasks/scalafmt.py | Python | apache-2.0 | 5,246 |
import datetime
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.utils.encoding import smart_str
from django.utils.translation import ugettext_lazy as _
from django_hosts.resolvers import reverse
from docutils.core import publish_parts
BLOG_DOCUTILS_SETTINGS ... | gnarf/djangoproject.com | blog/models.py | Python | bsd-3-clause | 4,652 |
import mcpi.minecraft as minecraft
mc = minecraft.Minecraft.create("10.52.5.17")
import random
import time
r = 5
while r == 5:
x = random.randint(-130,130)
y = random.randint(-70,70)
z = random.randint(-130,130)
mc.setBlock(x,y,z,46,1)
| mohsraspi/mhscs14 | liam/tnt random.py | Python | gpl-2.0 | 257 |
import numpy as np
import pandas as pd
import xarray as xr
from . import randint, randn, requires_dask
nx = 3000
ny = 2000
nt = 1000
basic_indexes = {
"1slice": {"x": slice(0, 3)},
"1slice-1scalar": {"x": 0, "y": slice(None, None, 3)},
"2slicess-1scalar": {"x": slice(3, -3, 3), "y": 1, "t": slice(None, ... | shoyer/xarray | asv_bench/benchmarks/indexing.py | Python | apache-2.0 | 4,599 |
# coding=utf-8
import os
import tempfile
from destral.testing import get_spec_suite, run_spec_suite
from destral.patch import RestorePatchedRegisterAll
from expects import *
from doublex_expects import *
from doublex import Spy, method_returning
from mamba.runners import BaseRunner
from mamba.reporter import Reporter
... | gisce/destral | spec/testing_spec.py | Python | gpl-3.0 | 1,821 |
from AZutilities import dataUtilities
import unittest
import os
import time
import orange
from trainingMethods import AZorngCvSVM
from AZutilities import miscUtilities
from AZutilities import evalUtilities
import AZOrangeConfig as AZOC
import AZorngTestUtil
import orngTest
class SVMClassifierTest(AZorngTestUtil.AZorn... | JonnaStalring/AZOrange | tests/source/AZorngCvSVMTest.py | Python | lgpl-3.0 | 28,118 |
# -*- coding: utf-8 -*-
"""
direct PAS
Python Application Services
----------------------------------------------------------------------------
(C) direct Netware Group - All rights reserved
https://www.direct-netware.de/redirect?pas;upnp
The following license agreement remains valid unless any additions or
changes a... | dNG-git/pas_upnp | src/dNG/data/upnp/services/abstract_service.py | Python | gpl-2.0 | 20,705 |
# THIS FILE IS GENERATED FROM THE PERMUTE SETUP.PY
version='0.1.alpha5'
| kellieotto/permute | permute/version.py | Python | bsd-2-clause | 72 |
import glob
from os.path import isfile
from subprocess import check_output
class Aggregator:
def __init__(self, platform_config):
self.platform_config = platform_config
def get_logs(self):
log_files = glob.glob(self.platform_config.get_log_sender_pattern())
log_files.append('/var/log... | syncloud/platform | src/syncloud_platform/log/aggregator.py | Python | gpl-3.0 | 1,387 |
import json
from aws import awsutils
from models import db, Clients, Station
# Map of every genres with their text representation.
genres_map = {
'3.1.1': 'News',
'3.1.1.11': 'Local/Regional',
'3.6': 'Other Music',
'3.6.1': 'Classical music',
'3.6.1.5': 'Light Classical music',
'3.6.1.2': 'Ser... | ebu/radiodns-plugit | RadioDns-PlugIt/stations/utils.py | Python | bsd-3-clause | 7,873 |
# -*- coding: utf-8 -*-
#
# test_recording_backend_ascii.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 o... | lekshmideepu/nest-simulator | testsuite/pytests/test_recording_backend_ascii.py | Python | gpl-2.0 | 6,863 |
#!/usr/bin/env python3
"""
Generate all the xml files for each actions, the module are
defined in the src directory
Example :
build_directory.py -m map
"""
import os
import sys
from optparse import OptionParser
__version__ = "0.0.2"
def arg_parse():
""" Parse command line arguments """
arg_list = "-m mod... | rodo/tsung-gis | build_scenario.py | Python | gpl-3.0 | 3,719 |
__version__ = '2.0a10'
| kkanahin/django-avatar | avatar/__init__.py | Python | bsd-3-clause | 23 |
import cv2
import numpy as np
import math
import time
#
# Shows two video streams at the same time
#
# if you get memory errors (especially on linux), make sure your cameras
# are on different USB hubs
#
if __name__ == "__main__":
# open the camera
c1 = cv2.VideoCapture(0)
time.sleep(2)
c2 = cv2.VideoCapture... | UkyVision/vision-demos | stereo/stereo.py | Python | gpl-2.0 | 697 |
#
# Font derived from LED Matrix Studio file: fontv.h
#
# The first element in each array variable is the width of the character
# The remaining 8 elements are the decimal value for each row of
# the character to display
#
# EG for the 'A' character
#
# | *** | = 011100(28)
# |* * | = 100010(34)
# |* * | = 100010... | jpwsutton/raspberry_pi_matrix | ldp/fontv.py | Python | mit | 6,131 |
# Copyright (c) 2016 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality o... | HwisooSo/gemV-update | util/cpt_upgraders/arm-gicv2-banked-regs.py | Python | bsd-3-clause | 3,968 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Romeo Theriault <romeot () hawaii.edu>
#
# 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 th... | sivel/ansible-modules-core | network/basics/uri.py | Python | gpl-3.0 | 17,547 |
"""
A Django command that exports a course to a tar.gz file.
"""
import shutil
import tarfile
from tempfile import mkdtemp
from textwrap import dedent
from path import path
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.... | abo-abo/edx-platform | lms/djangoapps/courseware/management/commands/export_course.py | Python | agpl-3.0 | 1,832 |
#!/usr/bin/env python
"""
Usage:
$ sentoscraper.py ID1 ID2 ...
In Cygwin, run this script as follows:
$ getclip
590
591
592
593
594
595
596
597
598
$ getclip | dos2unix | xargs sentoscraper.py --cache-dir D:/home/yojyo/data/sento
"""
import asyncio
import re
import os.path
import sys
from argparse import ArgumentPars... | showa-yojyo/bin | sentoscraper.py | Python | mit | 3,661 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import local.minecraft as minecraft # import modułu minecraft
import local.block as block # import modułu block
os.environ["USERNAME"] = "Steve" # nazwa użytkownika
os.environ["COMPUTERNAME"] = "mykomp" # nazwa komputera
# utworzenie połaczenia z symulatore... | koduj-z-klasa/python101 | docs/mcpi/figury/mcsim-2dKzK.py | Python | mit | 1,853 |
from django_evolution.mutations import AddField, ChangeField
from django.db import models
MUTATIONS = [
AddField('ReviewRequest', 'local_site', models.ForeignKey, null=True,
related_model='site.LocalSite'),
AddField('ReviewRequest', 'local_id', models.IntegerField, initial=None,
null... | reviewboard/reviewboard | reviewboard/reviews/evolutions/localsite.py | Python | mit | 503 |
'''
New Integration test for testing vm migration between hosts with libvirt reboot
@author: Jiajun
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import os
vm = None
test_stub = test_lib.lib_get_specific_stub()
def test():
global vm
ps = r... | zstackio/zstack-woodpecker | integrationtest/vm/multihosts/migrate/test_migrate_vm_with_libvirt_reboot.py | Python | apache-2.0 | 1,827 |
from plat import twitter_connect as soc
from steg import outguess as stg
infile = 'testfiles/base.jpg'
datafile = 'testfiles/stegin.txt'
upfile = 'testfiles/upload.jpg'
downfile = 'testfiles/download.jpg'
outsteg = 'testfiles/stegout.txt'
stg.hide(datafile, infile, upfile)
soc.cycle_media(downfile, 'Outguess', upfile... | KULinacs/stegprobe | stegprobe.py | Python | gpl-3.0 | 360 |
# Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program... | Yubico/yubioath-desktop-dpkg | yubioath/yubicommon/qt/utils.py | Python | gpl-3.0 | 3,594 |
import uuid
import time
from django.core.mail import send_mail
from django.db import transaction
from django.contrib.auth.models import User
from notifications.services import notify_slack
@transaction.atomic
def create_user(*,
username: str,
email: str,
password: s... | RadoRado/EuroPython2017 | run_python_run/users/services.py | Python | mit | 1,367 |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import, unicode_literals
import os
import time
import threading
import tempfile
from mog_commons.command import *
from mog_commons import unittest
class TestCommand(unittest.TestCase):
def test_execute_command(self):
self.a... | mogproject/mog-commons-python | tests/mog_commons/test_command.py | Python | apache-2.0 | 2,719 |
#!/usr/bin/env python3
import sys
import os
def main():
return os.system('open {{app_path}}')
if __name__ == '__main__':
sys.exit(main())
| fokusov/moneyguru | run_template_cocoa.py | Python | gpl-3.0 | 150 |
LOGGING = {
'version': 1,
#'disable_existing_loggers': True,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
},
},
'handlers': {
'console': {
'level':'DEBUG',
'clas... | mabotech/maboss.py | maboss/conf/logging_config1.py | Python | mit | 2,335 |
# rhnRepository.py - Perform local repository functions.
#-------------------------------------------------------------------------------
# This module contains the functionality for providing local packages.
#
# Copyright (c) 2008--2014 Red Hat, Inc.
#
# This software is licensed to you under t... | moio/spacewalk | proxy/proxy/broker/rhnRepository.py | Python | gpl-2.0 | 19,738 |
"""Admin interface for the util app. """
from __future__ import absolute_import
from django.contrib import admin
from util.models import RateLimitConfiguration
admin.site.register(RateLimitConfiguration)
| ESOedX/edx-platform | common/djangoapps/util/admin.py | Python | agpl-3.0 | 208 |
'''REPL, an interactive console'''
import code
def Repl(target):
'''Run a REPL (interactive console) with local variables'''
code.InteractiveConsole(target).interact(r'''
--------------------------
| MAVC Interactive Console |
--------------------------''')
| hczhcz/mavc | init/repl.py | Python | gpl-2.0 | 272 |
#!/usr/bin/env python
__author__ = 'greghines'
import pymongo
import numpy as np
import matplotlib.pyplot as plt
import re
goldX_1 = [331807.4, 3556826.0, 20072830.4, 20366014.0, 21147836.6, 24079671.8, 24666038.8, 31506987.4, 32288810.0, 38543391.6, 71282217.0, 140180342.0]
goldY_1 = [0.4605457, 0.5014045,... | camallen/aggregation | experimental/cancer/gold.py | Python | apache-2.0 | 1,697 |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Byron/btank | src/python/btank/tests/utility/patch/06nested/pyglet/font/win32.py | Python | lgpl-3.0 | 9,698 |
import sys as _sys
from .ansi import Fore as _Fore, Style as _Style
_color_policy = 'default'
_module = _sys.modules[__name__]
def _using_colors():
return (_color_policy == 'default' and _sys.stdout.isatty()
) or _color_policy == 'yes'
def _gen_col(ansi, name, is_bright=False):
name = name if n... | jdevera/subdue | subdue/core/color/__init__.py | Python | mit | 1,092 |
#
# Wrappers for Coinkite objects which you might see.
#
# Full docs at: https://docs.coinkite.com/
#
# Copyright (C) 2014 Coinkite Inc. (https://coinkite.com) ... See LICENSE.md
#
import re
from dateutil.parser import parse as iso_parse
CK_DB_OBJECTS = [
'CKUser', 'CKEvent', 'CKUserRequest', 'CKCard', 'CKActivit... | coinkite/coinkite-python | ckapi/objs.py | Python | mit | 3,218 |
"""
WSGI config for example_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLIC... | yetty/django-embed-video | example_project/example_project/wsgi.py | Python | mit | 1,447 |
import json
import os
import datetime
import tempfile
import shutil
from django.test import TestCase
from django.contrib.auth.models import User, Group, Permission
from django.conf import settings
from django.utils import timezone
from django.utils.timezone import utc
from django.core import mail
from django.core.file... | bugzPDX/airmozilla | airmozilla/suggest/tests/test_views.py | Python | bsd-3-clause | 57,761 |
# Copyright 2014-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... | chrislit/abydos | tests/phonetic/test_phonetic_soundex.py | Python | gpl-3.0 | 6,370 |
from __future__ import unicode_literals
try:
from urllib import parse as urlparse
except ImportError:
import urlparse # Python 2
from django.db.models.fields import CharField
from django.utils.encoding import force_text, python_2_unicode_compatible
from django_countries import countries
from django_countrie... | maximzxc/django-countries | django_countries/fields.py | Python | mit | 4,044 |
# Copyright (c) 2010 Philip Taylor
# Released under the BSD license and W3C Test Suite License: see LICENSE.txt
# Current code status:
#
# This was originally written for use at
# http://philip.html5.org/tests/canvas/suite/tests/
#
# It has been adapted for use with the Web Platform Test Suite suite at
# https://githu... | dsandeephegde/servo | tests/wpt/web-platform-tests/2dcontext/tools/gentestutils.py | Python | mpl-2.0 | 23,249 |
"""Amazon Simple Storage Service (S3) datastore.
.. note::
**Installation**: Use of this module requires the open source boto_
package.
.. _boto: http://code.google.com/p/boto/
"""
import base64
import datetime
import hashlib
import hmac
import json
from cloud_browser.cloud import boto_base as base
from clou... | lantip/aws-filemanager | cloud_browser/cloud/aws.py | Python | mit | 4,505 |
from ..Module import Module
class oxrs(Module):
def parse_xcp(self, response, tag):
response.set('result_reason', tag.text)
| hiqdev/reppy | heppy/modules/oxrs.py | Python | bsd-3-clause | 139 |
from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
def load_license():
with open('LICENSE.rst') as f:
return f.read()
setup(name='ur_cb2',
version='0.2',
description='A package to interface with a UR CB2 Robot over TCP/IP',
long_descri... | IRIM-Technology-Transition-Lab/ur_cb2 | setup.py | Python | mit | 1,381 |
from sklearn.svm import SVR
import numpy as np
n_samples, n_features = 10, 0
np.random.seed(0)
y = np.random.randn(n_samples)
x = np.random.randn(n_samples, n_features)
clf = SVR(C=1.0, epsilon=0.2)
clf.fit(x,y)
print clf.score(x,y)
| moriarty/csci-homework | 4155/assignments/a4/svr_example.py | Python | mit | 233 |
from __future__ import unicode_literals
from django.http import Http404
class Resolver404(Http404):
pass
class NoReverseMatch(Exception):
pass
| yephper/django | django/urls/exceptions.py | Python | bsd-3-clause | 167 |
# -*- coding: utf-8 -*-
def fibonacci(max): # генератор (а не функция, т.к. оператор return заменён на yield)
a, b = 0, 1
while a < max:
yield a # return a, + запоминаем место рестарта для следующего вызова
a, b = b, a + b # параллельное присваивание, которое выполняется од... | exbluesbreaker/csu-code-analysis | logilab-astng XML Generator/src/Tests/05-fibonacci.py | Python | gpl-2.0 | 725 |
from DataStructures import *
def widen_meet(op):
"""This is the meet operator of the growth analysis. The growth analysis
will change the bounds of each variable, if necessary. Initially, each
variable is bound to either the undefined interval, e.g. [., .], or to
a constant interval, e.g., [3, 15]. Af... | vhscampos/range-analysis | prototype/PythonRangeAnalysis/Cousot.py | Python | gpl-2.0 | 3,893 |
'''
Created on 10.08.2017
@author: sebastian
'''
from datetime import date
import pandas as pd
from butler_offline.viewcore import viewcore
from butler_offline.core.database.database_object import DatabaseObject
class Einzelbuchungen(DatabaseObject):
STATIC_TABLE_HEADER = ['Datum', 'Kategorie', 'Name', 'Wert',... | RosesTheN00b/BudgetButlerWeb | butler_offline/core/database/einzelbuchungen.py | Python | agpl-3.0 | 5,619 |
#!/usr/bin/env python
#
# Copyright 2018 Espressif Systems (Shanghai) PTE LTD
#
# 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 req... | krzychb/rtd-test-bed | tools/unit-test-app/unit_test.py | Python | apache-2.0 | 31,207 |
#
# iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_1')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
c... | zwChan/VATEC | ~/eb-virt/Lib/encodings/iso2022_jp_1.py | Python | apache-2.0 | 1,100 |
#===============================================================================
# Copyright 2009 Matt Chaput
#
# 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/li... | dokipen/whoosh | src/whoosh/filedb/filetables.py | Python | apache-2.0 | 15,577 |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import json
from frappe.model.document import Document
from frappe.custom.doctype.custom_field.custom... | gsnbng/erpnext | erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py | Python | agpl-3.0 | 7,113 |
"""
test .agg behavior / note that .apply is tested generally in test_groupby.py
"""
import functools
import numpy as np
import pytest
from pandas.core.dtypes.common import is_integer_dtype
import pandas as pd
from pandas import DataFrame, Index, MultiIndex, Series, concat
import pandas._testing as tm
from pandas.co... | TomAugspurger/pandas | pandas/tests/groupby/aggregate/test_aggregate.py | Python | bsd-3-clause | 31,398 |
import common
import threading
class Revolutions:
"""Stores the timestamps of wind sensor revolutions."""
def __init__(self, edges_per_rev):
self._edges_per_rev = edges_per_rev
self._lock = threading.RLock() # re-entrant for use in calibration_add_edge_and_log
# Edges seen in the current r... | zieren/ip-anemometer | client/ipa/wind_revolutions.py | Python | gpl-3.0 | 1,497 |
"""
This module implements clustering functionality.
:author:
moritz.maus@hm10.net
:date:
July 15, 2014
:synopsis:
This module currently implements a variant of the Rodriguez-Laio
clustering algorithm, described in
Alex Rodriguez and Alessandro Laio:
*Clustering by fast search and find o... | MMaus/mutils | mutils/clustering.py | Python | gpl-2.0 | 11,138 |
from base_ui import BaseView
from models.invitation import InvitationCode
class IndexView(BaseView):
def template_context(self):
count_format_str = "{:,}".format(InvitationCode.unused_count())
return {"unused_code_count": count_format_str}
def template_name(self):
return "index.html"... | candyan/strawberry-web | app/views/index_ui.py | Python | gpl-3.0 | 321 |
from flask import Flask, redirect, render_template, request, url_for
from flask.ext.login import (AnonymousUser, LoginManager, UserMixin,
login_required, login_user, logout_user)
from flask.ext.simon import Simon, Model
app = Flask(__name__)
app.secret_key = 'Keep this value secret'
Simon(... | dirn/Flask-Simon | examples/flask-login/login.py | Python | bsd-3-clause | 2,283 |
#
# Copyright (c) 2009-2015 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""Classes for implementing the weewx tag 'code' codes."""
import weeutil.weeutil
from weeutil.weeutil import to_int
import weewx.units
from weewx.units import ValueTuple
#============================... | tony-rasskazov/meteo | weewx/bin/weewx/tags.py | Python | mit | 21,686 |
import ConfigParser
import logging
import logging.config
import Queue
import threading
import time
import datetime
import sys
from Tkinter import *
class MessageThread:
""" Since the tkinter thread wants to be the main loop, create a thread
to handle messages
"""
def config_gui(self, root):
self.root ... | bvesperman/Sector67RaspberryPiAccessControl | space_machines/main.py | Python | mit | 3,819 |
import numpy as np
import dynesty
from utils import get_rstate, get_printing
"""
This is a hard test of dynamic sampling with the 2d eggbox
"""
nlive = 500
printing = get_printing()
# EGGBOX
# see 1306.2144
def loglike_egg(x):
logl = ((2 + np.cos(x[0] / 2) * np.cos(x[1] / 2))**5)
return logl
def prior_tra... | joshspeagle/dynesty | tests/test_dyn.py | Python | mit | 1,083 |
# Copyright (C) 1993-2002, by Peter I. Corke
# $Log: rttrdemo.m,v $
# Revision 1.2 2002/04/01 11:47:18 pic
# General cleanup of code: help comments, see also, copyright, remnant dh/dyn
# references, clarification of functions.
#
# $Revision: 1.2 $
import sys
sys.path.append("../robot/")
import parsedemo as p;
print... | MediffRobotics/DeepRobotics | rpiRobotArm/InverseKine/robotics-toolbox-python1/trunk/robotics-toolbox-python/demo/transform.py | Python | gpl-3.0 | 1,684 |
import subprocess
import os
import sys
CMD = None
EXPECTED = None
SEGFAULT = False
FILE = None
BACKUPFILE = None
for arg in sys.argv[1:]:
if arg.startswith('--cmd='):
CMD = arg[arg.find('=') + 1:]
elif arg.startswith('--expected='):
EXPECTED = arg[arg.find('=') + 1:]
elif arg.startswith('-... | JIghtuse/cppcheck | tools/reduce.py | Python | gpl-3.0 | 6,944 |
###############################################################################
# surfaceSigmaProfile: classes that implement different surface-mass and
# radial velocity dispersion profiles
#
# Includes the following:
# surfaceSigmaProfile - top-level class that represents a surface
... | jobovy/galpy | galpy/df/surfaceSigmaProfile.py | Python | bsd-3-clause | 5,695 |
# -*- encoding: utf-8 -*-
from abjad import *
def test_scoretools_Container___contains___01():
note = Note("c'4")
voice = Voice([Note("c'4")])
assert not note in voice | mscuthbert/abjad | abjad/tools/scoretools/test/test_scoretools_Container___contains__.py | Python | gpl-3.0 | 183 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
import re
import time
from requests import RequestException
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flex... | qvazzler/Flexget | flexget/plugins/input/rlslog.py | Python | mit | 3,614 |
#!/usr/bin/env python
from setuptools import setup, find_packages
with open('fs_s3fs/_version.py') as f:
exec(f.read())
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Program... | geoffjukes/s3fs | setup.py | Python | mit | 1,311 |
print('Lower your expectations')
import test
test.circumference(1)
test.area(1)
import matplotlib.pyplot as plt
circle1 = plt.Circle((0, 0), 0.2, color='r')
plt.show(circle1)
print('this is so much fun!!')
print('enjoy the randomness') | anthonyanthonyanthony/Casimir-programming | script.py | Python | mit | 239 |
../../../../../../share/pyshared/papyon/service/OfflineIM/oim.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/papyon/service/OfflineIM/oim.py | Python | gpl-3.0 | 64 |
import pic14_sim
import pic_lst_scan
import watch_panel
Sim = pic14_sim.SimPic
rst_scan = pic_lst_scan.pic_lst_scan
WatchPanel = watch_panel.WatchPanel | athenajc/XideSDCC | ide/sim/pic14/__init__.py | Python | gpl-2.0 | 152 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.