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/python
#
# Parameters of the memory system
#
# log2 of the memory capacity, in bytes
param_capacity = 27
# log2 of the number of DRAM banks
param_banks = 2
# log2 of the size of a DRAM row, in 32-bit words
param_rowsize = 10
# burst length
param_burstlength = 4
# dead time, per transaction
param_deadtime = ... | fallen/milkymist-mmu | tools/memadr_stats.py | Python | lgpl-3.0 | 3,130 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Parameter file for the BD_trajectory.py program
"""
# Integer, Number of simulations for the mean trajectory
nb_simul=100
# Integer, Sample size
n=216
# Float, Starting frequency for the fixation trajectory
x0=0.01
# Float, time step for the fixation trajectory
dt=0.... | lapierreM/Yoruba_demography | Programs/BD_trajectory_parameters.py | Python | lgpl-2.1 | 464 |
'''@file leaky_dblstm.py
contains the DBLSTM with leak class'''
import tensorflow as tf
import model
from nabu.neuralnetworks.components import layer
class LeakyDBLSTM(model.Model):
'''A deep bidirectional LSTM classifier with memory leakage'''
def _get_outputs(self, inputs, input_seq_length, is_training):... | JeroenZegers/Nabu-MSSS | nabu/neuralnetworks/models/leaky_dblstm.py | Python | mit | 1,833 |
import RPi.GPIO as GPIO
import time
import sys
#pin=32 #12 on board
#pin=12 #18 on board, default hardware pwm port. in our case, it does not work
pin=16 #23 on board. does not support pwm
try:
GPIO.setmode(GPIO.BOARD)
GPIO.setup([pin], GPIO.OUT)
print("Setup Done !!!!! yay Woho")
#GPIO.output(pi... | melvinma/funbots | src/python-src/examples/motor.py | Python | apache-2.0 | 1,779 |
#!/usr/bin/python
#
# Bootstrap script for a new device. This uploads a configuration and installs
# the Bringup sketch.
#
import sys
import os
import argparse
import subprocess
import hmtl.portscan as portscan
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config", dest=... | aphelps/HMTL | python/Bootstrap.py | Python | mit | 3,352 |
"""
TranSPHIRE is supposed to help with the cryo-EM data collection
Copyright (C) 2017 Markus Stabrin
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 Licen... | mstabrin/transphire | transphire/mountcalculator.py | Python | gpl-3.0 | 10,332 |
# coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import kinow_client
from kinow_client.rest import A... | kinow-io/kinow-python-sdk | test/test_groups_api.py | Python | apache-2.0 | 1,382 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import... | bendykst/deluge | deluge/core/eventmanager.py | Python | gpl-3.0 | 2,071 |
import unittest
from unittest.mock import Mock, patch
from spresso.model.authentication.request import IdpInfoRequest
class IdpInfoRequestTestCase(unittest.TestCase):
@patch("spresso.model.authentication.request.GetRequest")
def test_get_content(self, request_mock):
netloc = "netloc"
setting... | lujung/python-spresso | tests/model/authentication/test_request.py | Python | mit | 1,865 |
from hashlib import md5
from re import sub
from counts import Counts
from google.appengine.ext import db
from google.appengine.api import users, memcache
from emend.const import DATE_SHORT
from pretty_timedelta import pretty_datetime_from_now
class User(db.Model, Counts):
user = db.UserProperty(required=True)
n... | tantalor/emend | app/emend/model/user.py | Python | mit | 1,928 |
import os
def copyrecursively(src_hdr, cpy_fldr, dest_fldr_list):
src_fldr = os.path.join(src_hdr, cpy_fldr)
err = 0
for root, dirs, files in os.walk(src_hdr):
for src_d in dirs:
src_d_full = os.path.join(root, src_d)
if len(src_d_full) >= len(src_fldr) and src_d_full.find(s... | daisyfox/RPi_dc3dd_Duplicator | test_save.py | Python | gpl-2.0 | 1,794 |
import cloudpassage
import datetime
import os
import pytest
from cloudpassage.utility import Utility as utility
config_file_name = "portal.yaml.local"
tests_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../"))
config_file = os.path.join(tests_dir, "configs/", config_file_name)
session_info = cloudpas... | cloudpassage/cloudpassage-halo-python-sdk | tests/integration/test_integration_scan.py | Python | bsd-3-clause | 13,263 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: J.Y Han
# start
# spawn-fcgi -d /users/hanjiyun/project/geeksoho -f /users/hanjiyun/project/geeksoho/application.py -a 127.0.0.1 -p 9001
#stop
# kill `pgrep -f "/users/hanjiyun/project/geeksoho/application.py"`
import os
import web
import rediswebpy
from web.... | naoyeye/geeksoho | application.py | Python | mit | 1,969 |
from .alignment import *
| SunghanKim/toga | toga/constants/__init__.py | Python | bsd-3-clause | 25 |
#============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | mikesun/xen-cow-checkpointing | tools/python/xen/xend/XendDomain.py | Python | gpl-2.0 | 58,761 |
class Solution:
def permuteUnique(self, nums):
if nums==None:
return None
if len(nums)==0:
return None
if len(nums)==1:
return [nums,]
first=nums[0]
result=[]
reduce_nums=nums[1:]
perm_result = self.permuteUnique(reduce_nums)
... | saai/LeetcodePythonSolutions | permute.py | Python | mit | 691 |
#!/usr/bin/env python
# encoding: utf-8
"""Add coloring to default logging module."""
import logging
class ColoredStreamHandler(logging.StreamHandler):
def __init__(self):
logging.StreamHandler.__init__(self)
def emit(self, record):
levelno = record.levelno
if(levelno>=50):
... | xarts19/Dugong | dugong/external/colorer.py | Python | gpl-3.0 | 3,669 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2007 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | mozilla/verbatim | vendor/lib/python/translate/storage/ts.py | Python | gpl-2.0 | 6,808 |
# 700-hPa Temperature Advection
tadv_700 = mpcalc.advection(tmpk_700s, (uwnd_700s, vwnd_700s), (dx, dy)).to_base_units()
# Laplacian of Temperature Advection
lap_tadv_700 = mpcalc.laplacian(tadv_700, deltas=(dy, dx))
# Final term B calculation with constants
term_B = (-Rd / (sigma * (700 * units.hPa)) * lap_tadv_700).... | julienchastang/unidata-python-workshop | notebooks/MetPy_Advanced/solutions/term_B_calc.py | Python | mit | 355 |
# Copyright (C) 2013-2021 Roland Lutz
#
# 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 ... | rlutz/xorn | tests/gaf/attrib.py | Python | gpl-2.0 | 9,184 |
#/usr/bin/python
import codecs
def correct(scriptfile):
script=codecs.open(scriptfile,'r','utf-16');
error=[];
index=0;
scriptlines=script.readlines();
for line in scriptlines:
if len(line)<4:
print '%s line: %d \n'%(scriptfile,index);
error.append(index);
ind... | drawfish/VAD_HTK | pyscrp/noneContex.py | Python | gpl-2.0 | 628 |
# -*- coding: utf-8 -*-
"""The :program:`celery events` command.
.. program:: celery events
.. seealso::
See :ref:`preload-options` and :ref:`daemon-options`.
.. cmdoption:: -d, --dump
Dump events to stdout.
.. cmdoption:: -c, --camera
Take snapshots of events using this camera.
.. cmdoption:: --det... | kawamon/hue | desktop/core/ext-py/celery-4.2.1/celery/bin/events.py | Python | apache-2.0 | 5,172 |
import math
from copy import copy
from pyglet.gl import *
from euclid import Matrix4, Vector3, Point3
from renderer import Renderer
class Node(object):
def __init__(self, parent=None):
self.model = Matrix4()
self.transform = Matrix4()
self.renderables = []
self.children = []
self._parent = None
... | swiftcoder/ashima-iv | src/node.py | Python | bsd-3-clause | 2,391 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""This file is part of the django ERP project.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND ... | mobb-io/django-erp | djangoerp/core/tests/test_decorators.py | Python | mit | 5,954 |
import platform
import subprocess
import sys
if platform.system() == 'Windows':
import ctypes
AdvAPI32 = ctypes.windll.Advapi32
from ctypes import POINTER
UNLEN = 256
GetUserNameW = AdvAPI32.GetUserNameW
GetUserNameW.argtypes = (
ctypes.c_wchar_p, # _In_Out_ lpBuffer
... | apple/swift | test/ModuleInterface/Inputs/make-unreadable.py | Python | apache-2.0 | 1,032 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from django.conf.urls.defaults import *
from . import views
urlpatterns = patterns('',
(r'^ajax/(?P<path>.*)$', views.proxy))
| ken-muturi/rapidsms | lib/rapidsms/contrib/ajax/urls.py | Python | bsd-3-clause | 185 |
from pyramid.httpexceptions import HTTPFound
# from pyramid.response import Response
from collections import defaultdict
from pyramid.renderers import get_renderer
from ..models import (
ConcisionReport,
)
import json
from ..lib import (
html_f,
consts,
report_f,
converters,
filter_funcs,
... | Teifion/concision | views/report.py | Python | bsd-2-clause | 3,385 |
# -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @Daddy_Blamo wrote this file. As long as you retain this notice you
# can do whatever you want wi... | RuiNascimento/krepo | script.module.lambdascrapers/lib/lambdascrapers/sources_placenta/en_placenta-1.7.8/movie4korg.py | Python | gpl-2.0 | 6,425 |
from fabric.api import *
from fabric.utils import *
from fabric.contrib import *
class Apt(object):
def __init__(self):
return
def update(self):
cmd = 'sudo apt update'
run(cmd)
print(cmd)
def purge(self, package):
cmd = 'sudo apt purge -y %(package)s' % {'packag... | stregatto/fabric_lib | apt.py | Python | gpl-2.0 | 651 |
# ----------------------------------------------------------------------------
# A Benchmark Dataset and Evaluation Methodology for Video Object Segmentation
#-----------------------------------------------------------------------------
# Copyright (c) 2016 Federico Perazzi
# Licensed under the BSD License [see LICENSE... | fperazzi/davis | python/lib/davis/config.py | Python | bsd-3-clause | 2,238 |
# pylint: disable=missing-docstring,import-error,unused-import, import-modules-only
import first
from first import second
from third import Fourth, Fifth # [multiple-import-items]
from sixth import Sixth, seventh, Eighth # [multiple-import-items]
import eighth
| Shopify/shopify_python | tests/functional/multiple_import_items.py | Python | mit | 264 |
#!/usr/bin/env python
import test_helper
import os
import re
test_path = os.path.dirname(__file__)
for root, dirs, files in os.walk(test_path):
modules = [file[:-3] for file in sorted(files) if file[-3:] == '.py' and re.match('\d{3,}', file)]
suite = test_helper.TestSuite()
for module_name in modules:
modul... | ethanrowe/thunderhead | t/runner.py | Python | gpl-3.0 | 480 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | david-ragazzi/nupic | nupic/research/monitor_mixin/metric.py | Python | gpl-3.0 | 2,865 |
# ======================================================================
# Given vtu/pvtu file(s) resulting from an MVR elasticity simulation
# (the solution files hence contain three scalar valued arrays named
# 'u0', 'u1' and 'u2' as PointData), this vtk-based python script
# warps the initial/original mesh geometr... | CognitionGuidedSurgery/msml | src/msml/ext/vonMisesStressComputation_mvrPostProcessingAnalytics.py | Python | gpl-3.0 | 6,424 |
# Copyright (c) 2014, Fundacion Dr. Manuel Sadosky
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... | programa-stic/barf-project | barf/core/reil/emulator/memory.py | Python | bsd-2-clause | 7,471 |
#!/usr/bin/env python
from __future__ import division
from __future__ import unicode_literals
import sys, math
import argparse
from volk_test_funcs import (create_connection, list_tables, get_results,
helper, timeit, format_results)
try:
import matplotlib
import matplotlib.pyplot ... | skoslowski/gnuradio | gnuradio-runtime/examples/volk_benchmark/volk_plot.py | Python | gpl-3.0 | 6,303 |
from sympy.core import (
Rational, Symbol, S, Float, Integer, Number, Pow,
Basic, I, nan, pi, symbols, oo, zoo)
from sympy.core.tests.test_evalf import NS
from sympy.functions.elementary.miscellaneous import sqrt, cbrt
from sympy.functions.elementary.exponential import exp, log
from sympy.functions.elementary.t... | wxgeo/geophar | wxgeometrie/sympy/core/tests/test_eval_power.py | Python | gpl-2.0 | 12,168 |
# coding=utf-8
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License");... | lukecwik/incubator-beam | sdks/python/apache_beam/examples/snippets/transforms/aggregation/cogroupbykey_test.py | Python | apache-2.0 | 1,975 |
"""
Tests validation functions in validate_extensions.py
validate_extensions.py:
http://www.github.com/samjabrahams/anchorhub/validation/validate_extensions.py
"""
from nose.tools import *
import anchorhub.validation.validate_extensions as v
from anchorhub.exceptions.validationexception import ValidationException
... | samjabrahams/anchorhub | anchorhub/validation/tests/test_validate_extensions.py | Python | apache-2.0 | 3,062 |
import pf
from Var import var
import numpy,string
from Glitch import Glitch
"""A faster version of nextTok(), using memory allocated (once only)
using numpy, and using functions written in C. The slow, pure
python module is NexusToken.py. This version is about twice as fast.
Which one is used is under the control o... | Linhua-Sun/p4-phylogenetics | p4/NexusToken2.py | Python | gpl-2.0 | 5,196 |
"""
Created on 22 Mar 2014
@author: Max Demian
"""
# 100% coverage
import unittest
from contactman import Contact, ContactList, Friend, Supplier, EmailableContact
class TestContactman(unittest.TestCase):
def setUp(self):
self.c = Contact("max", "demian@gmx.de")
self.d = Contact("1", "2")... | mikar/60-days-of-python | addressbook/test_contactman.py | Python | mit | 1,410 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutFrame.
.. note:: 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.
"""
__... | stevenmizuno/QGIS | tests/src/python/test_qgslayoutframe.py | Python | gpl-2.0 | 1,037 |
"""target_uid
Revision ID: 32df0b86c09a
Revises: 125dd1a9bab5
Create Date: 2015-07-14 12:44:15.990112
"""
# revision identifiers, used by Alembic.
revision = '32df0b86c09a'
down_revision = '125dd1a9bab5'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### c... | 18mr/call-congress | alembic/versions/32df0b86c09a_target_uid.py | Python | agpl-3.0 | 824 |
# Python code
from win32com . server . register import UseCommandLine
from win32api import MessageBox
from win32com . client import Dispatch
from win32ui import MessageBox
class StemmerFactory :
_reg_clsid_ = "{602D10EB-426C-4D6F-A4DF-C05572EB780B}"
_reg_desc_ = "LangTech Stemmer"
_reg_progid_ = "LangTech.... | ActiveState/code | recipes/Python/141602_Barebones_VC_code_invoking_PythCOM_factory/recipe-141602.py | Python | mit | 3,435 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .exceptions import MultipleObjectsReturned, YouTubeError, CipherError
from .jsinterp import JSInterpreter
from .models import Video
from .utils import safe_filename
try:
from urllib2 import urlopen
from urlparse import u... | DomainGroupOSS/pytube | pytube/api.py | Python | mit | 11,653 |
import datetime
import itertools
import unittest
from copy import copy
from django.db import (
DatabaseError, IntegrityError, OperationalError, connection,
)
from django.db.models import Model
from django.db.models.deletion import CASCADE
from django.db.models.fields import (
AutoField, BigIntegerField, Binary... | daniponi/django | tests/schema/tests.py | Python | bsd-3-clause | 79,293 |
from __future__ import absolute_import
from django.test import Client
from django.core.handlers.wsgi import WSGIRequest
from django.core.handlers.base import BaseHandler
class RequestFactory(Client):
"""Class that lets you create mock Request objects for use in testing.
Usage:
rf = RequestFactory()
... | mzdaniel/oh-mainline | vendor/packages/django-celery/djcelery/tests/req.py | Python | agpl-3.0 | 2,296 |
import os
#from datetime import timedelta
from celery.schedules import crontab
def bool_env(val):
"""Replaces string based environment values with Python booleans"""
return True if os.environ.get(val, False) == "True" else False
TIMEZONE = os.getenv("TIMEZONE", "US/Central")
########
# Amazon
#
MWS_ACCESS_... | MinnPost/salesforce-stripe | config.py | Python | mit | 4,316 |
from guardian.shortcuts import get_perms, get_users_with_perms, assign_perm, remove_perm
from rest_framework import serializers, viewsets
from rest_framework.decorators import detail_route
from rest_framework.response import Response
from rest_framework import status
from django.db import transaction
from django.contri... | OpenDroneMap/WebODM | app/api/projects.py | Python | agpl-3.0 | 5,953 |
#!/usr/bin/env python
"""
This script is used to run tests, create a coverage report and output the
statistics at the end of the tox run.
To run this script just execute ``tox``
"""
import re
from fabric.api import local, warn
from fabric.colors import green, red
if __name__ == '__main__':
local('flake8 --ignore... | bitmazk/cmsplugin-django-outlets | runtests.py | Python | mit | 1,030 |
from setuptools import setup
setup(name='pycon-tutorial-steve98654',
version = '0.1',
description='test proj',
py_modules=['wordcount_lib'],
scripts=['wordcount'],
setup_requires=[
'pytest-runner',
],
test_require=[
'pytest',
]
)
| steve98654/pycon-tutorial-steve98564 | setup.py | Python | bsd-3-clause | 310 |
from zeroconf import ServiceBrowser, Zeroconf
import time
class DeviceListener:
def remove_service(self, zeroconf, typ, name):
return
def add_service(self, zconf, typ, name):
service = None
tries = 0
while service is None and tries < 4:
service = zconf.get_service_i... | druzy/python-protocol | src/discovery.py | Python | mit | 799 |
#!/usr/bin/env python
import os
import sys
import pprint
import argparse
import pickle
import pylab as pl
import matplotlib.pyplot as plt
import networkx as nx
parser = argparse.ArgumentParser(description='Construct meshterm network for search criteria.')
parser.add_argument('--outfile', type=argparse.FileType('w'), r... | LC3-INMEGEN/pubmed-mining | plot_pickled_graph.py | Python | gpl-3.0 | 939 |
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson
#
# 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 ve... | N6UDP/cslbot | cslbot/commands/cve.py | Python | gpl-2.0 | 2,166 |
"""atom.py: ...
"""
import numpy as np
from numpy import nan
import scipy.linalg as spl
import sympy.physics.units as u
import piratechem as pc
class Atom(pc.atom.Atom):
"""Allow each atom to contain more specific quantum chemical
properties than piratechem can currently handle.
"""
def __init__(se... | berquist/orcaparse | orcaparse/atom.py | Python | mpl-2.0 | 7,226 |
"""Convenience module for backwards compatibility."""
from souliss import Souliss
from souliss.Macaco_frame import Macaco_frame
| maoterodapena/pysouliss | souliss/pysouliss.py | Python | mit | 128 |
# -*- coding: utf-8 -*-
from os import path
from gluon import *
from gluon.storage import Storage
from s3 import *
# =============================================================================
class index():
""" Custom Home Page """
def __call__(self):
request = current.request
response =... | flavour/tldrmp | private/templates/OCHA/controllers.py | Python | mit | 6,803 |
# -*- coding: utf-8 -*-
#--------------------------------------------------------------------#
# This file is part of Py-cnotify. #
# #
# Copyright (C) 2007, 2008 Paul Pogonyshev. #
# ... | kived/py-cnotify | cnotify/__init__.py | Python | lgpl-2.1 | 8,208 |
# 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... | sarvex/tensorflow | tensorflow/python/framework/tensor_shape.py | Python | apache-2.0 | 41,529 |
#
# Copyright 2006 The Apache Software 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 a... | moreus/hadoop | hadoop-0.11.2/src/contrib/abacus/examples/pyAbacus/JythonAbacus.py | Python | apache-2.0 | 2,577 |
# Copyright 2015, 2016 OpenMarket Ltd
# Copyright 2019 New Vector Ltd
# Copyright 2020 The Matrix.org Foundation C.I.C.
#
# 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.apac... | matrix-org/synapse | synapse/rest/client/keys.py | Python | apache-2.0 | 11,478 |
#import webget
#import filmarkivet
| pugo/filmarkivet-xbmc | lib/__init__.py | Python | gpl-3.0 | 36 |
"""
This is a very simple logger. It might evolve over time and add file support and stuff.
"""
import datetime
debugmode = False
separator = '::'
def printf(label, basestring, *args, **kw):
print(label, separator, datetime.datetime.now(), separator, basestring.format(*args, **kw))
def info(basestring, *args... | yukaritan/kawaiirc | util/logger.py | Python | gpl-2.0 | 562 |
import time
from libardrone import libardrone
from PID import PID
class Actuator(object):
def __init__(self, drone, picture_width, desired_move):
self.turn = PID(K_p=0.6, K_d=0.1)
self.move = PID(K_p=0.15, K_d=0.01)
self.height = PID(K_p=0.2, K_d=0.00)
self.picture_width = picture_... | PatrickChrist/CDTM-Deep-Learning-Drones | Yolonese/actuators.py | Python | mit | 1,409 |
from pastebin.testcase import CacheAwareTestCase
from freezegun import freeze_time
from django.core.urlresolvers import reverse
@freeze_time("2015-01-01")
class LatestPastesTests(CacheAwareTestCase):
def test_latest_pastes_empty(self):
"""
Test that latest pastes shows the "no pastes uploaded" me... | Matoking/pastebin-django | home/tests.py | Python | unlicense | 7,947 |
from cms.plugin_pool import plugin_pool
from cms.plugin_base import CMSPluginBase
from django.utils.translation import ugettext_lazy as _
import models
from django.conf import settings
class FilerTeaserPlugin(CMSPluginBase):
"""
TODO: this plugin is becoming very similar to the image plugin... code
... | mitar/cmsplugin-filer | src/cmsplugin_filer_teaser/cms_plugins.py | Python | mit | 2,802 |
# -*- mode: python; indent-tabs-mode: nil; tab-width: 2 -*-
"""
aria_api.py - implements handlers which are for the Aria to talk to helvetic.
"""
from __future__ import absolute_import
from base64 import b16encode
from crc16 import crc16xmodem
from datetime import timedelta
from decimal import Decimal
from django.cont... | micolous/helvetic | helvetic/views/aria_api.py | Python | agpl-3.0 | 5,411 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ModelerAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**************... | myarjunar/QGIS | python/plugins/processing/modeler/ModelerAlgorithmProvider.py | Python | gpl-2.0 | 4,267 |
# coding=utf-8
# Copyright 2022 The Tensor2Robot 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 ... | google-research/tensor2robot | predictors/ensemble_exported_savedmodel_predictor_test.py | Python | apache-2.0 | 3,441 |
# Copyright (C) 2011 Equinor ASA, Norway.
#
# This file is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 ... | Statoil/libecl | python/ecl/gravimetry/ecl_grav_calc.py | Python | gpl-3.0 | 3,182 |
"""
Script to autogenerate pyplot wrappers.
When this script is run, the current contents of pyplot are
split into generatable and non-generatable content (via the magic header
:attr:`PYPLOT_MAGIC_HEADER`) and the generatable content is overwritten.
Hence, the non-generatable content should be edited in the pyplot.py ... | yavalvas/yav_com | build/matplotlib/boilerplate.py | Python | mit | 10,009 |
# Copyright (c) 2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Tools for interpolating to a vertical slice/cross section through data."""
import numpy as np
import xarray as xr
from ..package_tools import Exporter
from ..units import units
... | dopplershift/MetPy | src/metpy/interpolate/slices.py | Python | bsd-3-clause | 6,857 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redis... | wbsavage/shinken | shinken/modules/ip_tag_arbiter/__init__.py | Python | agpl-3.0 | 1,728 |
# -*- coding: utf-8 -*-
# Import required libraries
import os
import pandas as pd
import numpy as np
import plotly.plotly as py
import flask
from flask_cors import CORS
import dash
from dash.dependencies import Input, Output, State, Event
import dash_core_components as dcc
import dash_html_components as html
# Setu... | timkpaine/lantern | experimental/dash/dash-yield-curve-master/app.py | Python | apache-2.0 | 11,392 |
''' pydevd - a debugging daemon
This is the daemon you launch for python remote debugging.
Protocol:
each command has a format:
id\tsequence-num\ttext
id: protocol command number
sequence-num: each request has a sequence number. Sequence numbers
originating at the debugger are odd, sequence numbers ori... | mrknow/filmkodi | plugin.video.mrknow/mylib/_pydevd_bundle/pydevd_comm.py | Python | apache-2.0 | 57,299 |
import select
import six
import unittest
from kazoo.client import KazooClient, KazooState
from kazoo.exceptions import NoNodeError, NodeExistsError
from kazoo.handlers.threading import SequentialThreadingHandler
from kazoo.protocol.states import KeeperState, ZnodeStat
from mock import Mock, PropertyMock, patch
from pa... | zalando/patroni | tests/test_zookeeper.py | Python | mit | 10,527 |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under t... | MDAnalysis/mdanalysis | package/MDAnalysis/analysis/hydrogenbonds/__init__.py | Python | gpl-2.0 | 1,353 |
# -*- coding: utf-8 -*-
# Copyright(C) 2016 Julien Veyssier
#
# This file is part of a weboob module.
#
# This weboob module 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 Lice... | laurentb/weboob | modules/parolesmusique/module.py | Python | lgpl-3.0 | 1,688 |
import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="surface.hoverlabel.font", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | plotly/plotly.py | packages/python/plotly/plotly/validators/surface/hoverlabel/font/_color.py | Python | mit | 470 |
import warnings
import chainer
import numpy as np
import onnx
from onnx.mapping import NP_TYPE_TO_TENSOR_TYPE
from onnx_chainer.functions.opset_version import support
from onnx_chainer import onnx_helper
TENSOR_TYPE_TO_NAME = {
0: 'UNDEFINED',
1: 'FLOAT',
2: 'UINT8',
3: 'INT8',
4: 'UINT16',
... | pfnet/chainer | onnx_chainer/functions/array.py | Python | mit | 23,717 |
# -*- coding:utf-8 -*-
from yepes.apps import apps
AbstractConfiguration = apps.get_class('thumbnails.abstract_models', 'AbstractConfiguration')
AbstractSource = apps.get_class('thumbnails.abstract_models', 'AbstractSource')
AbstractThumbnail = apps.get_class('thumbnails.abstract_models', 'AbstractThumbnail')
class... | samuelmaudo/yepes | yepes/contrib/thumbnails/models.py | Python | bsd-3-clause | 455 |
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2013 Vassilii Khachaturov
#
# 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 ... | pmghalvorsen/gramps_branch | gramps/gen/datehandler/test/datedisplay_test.py | Python | gpl-2.0 | 4,682 |
"""卷积操作的空间含义定义如下:如果输入数据是一个四维的 input ,卷积操作的步长stride是一个四维数组.
数据维度是 [batch, in_height, in_width, ...],卷积核也是一个四维的卷积核,数据维度是 [filter_height, filter_width, ...] ,那么:
shape(output) = [batch,
(in_height - filter_height + 1) / strides[1],
(in_width - filter_width + 1) / strides[2],
... | Asurada2015/TFAPI_translation | NeuralNekworks_function/Convolution/tf_nn_conv2d.py | Python | apache-2.0 | 4,208 |
master_doc = "index"
extensions = ["releases"]
releases_github_path = "bitprophet/releases"
| bitprophet/releases | integration/_support/conf.py | Python | bsd-2-clause | 92 |
#!/usr/bin/python2.4
# Copyright (c) 2011 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.
"""Tests exercising chromiumsync and SyncDataModel."""
import pickle
import unittest
import autofill_specifics_pb2
import bookmark... | Crystalnix/house-of-life-chromium | net/tools/testserver/chromiumsync_test.py | Python | bsd-3-clause | 26,921 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-13 16:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0003_auto_20171112_1806'),
]
operations = [
migratio... | we-inc/mms-snow-white-and-the-seven-pandas | webserver/apps/users/migrations/0004_auto_20171113_2328.py | Python | mit | 918 |
## begin license ##
#
# "Meresco Lucene" is a set of components and tools to integrate Lucene into Meresco
#
# Copyright (C) 2013-2016, 2019, 2021 Seecr (Seek You Too B.V.) https://seecr.nl
# Copyright (C) 2013-2014 Stichting Bibliotheek.nl (BNL) http://www.bibliotheek.nl
# Copyright (C) 2015-2016 Koninklijke Bibliothe... | seecr/meresco-lucene | meresco/lucene/fields2lucenedoc.py | Python | gpl-2.0 | 4,022 |
# Copyright 2018 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... | hehongliang/tensorflow | tensorflow/python/ops/ragged/ragged_from_tensor_op_test.py | Python | apache-2.0 | 13,524 |
from difflib import unified_diff
import filecmp
import glob
import hashlib
from optparse import OptionParser
import os
import shutil
import sys
import numpy as np
import openmc
from openmc.examples import pwr_core
from tests.regression_tests import config
class TestHarness(object):
"""General class for running ... | wbinventor/openmc | tests/testing_harness.py | Python | mit | 12,485 |
from __future__ import unicode_literals
import base64
import logging
import pickle
try:
from django.utils.timezone import now as datetime_now
datetime_now # workaround for pyflakes
except ImportError:
from datetime import datetime
datetime_now = datetime.now
from django.core.mail import EmailMessage... | jawed123/django-mailer | mailer/models.py | Python | mit | 7,585 |
from django.conf.urls import url, include
from django.views.generic import TemplateView
from .views import *
from django.conf.urls.static import static
from .import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^contact/$', views.contact, name='contact'),
url(r'^register/$', RegisterV... | TobiasKundig/CSCI491Project | portfolio/urls.py | Python | mit | 950 |
# -*- coding: utf-8 -*-
#
# COPYRIGHT (C) 2018 Mutnick <mutnick@techie.com>
# COPYRIGHT (C) 2016-2017 Michael Labouebe <gfarmerfr@free.fr>
# COPYRIGHT (C) 2008-2011 Quinox <quinox@users.sf.net>
# COPYRIGHT (C) 2009 Hedonist <ak@sensi.org>
# COPYRIGHT (C) 2006-2009 Daelstorm <daelstorm@gmail.com>
# COPYRIGHT (C) 2003-20... | eLvErDe/nicotine-plus | pynicotine/gtkgui/transferlist.py | Python | gpl-3.0 | 22,723 |
# Copyright (c) 2013 Mirantis 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 writ... | ekasitk/sahara | sahara/service/validations/edp/job_binary_internal.py | Python | apache-2.0 | 1,066 |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | openstack/heat | heat/engine/clients/os/heat_plugin.py | Python | apache-2.0 | 3,700 |
from typing import Any
import swagger_client as saltedge_client
def create_customer_in_saltedge(
profile: Any, api: saltedge_client.CustomersApi
) -> None:
data = saltedge_client.CustomerRequestBodyData(
identifier=str(profile.user.username)
)
body = saltedge_client.CustomerRequestBody(data)
... | ltowarek/budget-supervisor | budgetsupervisor/users/services.py | Python | mit | 645 |
from core.moduleguessbase import ModuleGuessBase
from core.moduleexception import ModuleException, ProbeException, ExecutionException, ProbeSucceed
class ModuleGuess(ModuleGuessBase):
'''Generic ModuleGuess class to inherit.
ModuleGuess object is a dynamically loaded Weevely extension that automatically guess... | jorik041/Weevely | core/moduleguess.py | Python | gpl-3.0 | 8,074 |
"""
You are given a square matrix of size N×N. Can you calculate the absolute difference of the sums across the main diagonal and the secondary diagonal?
"""
#!/bin/python
n = int(raw_input().strip())
mat = []
diagMain = 0
diagMinor = 0
# O(N)
for a_i in xrange(n):
a_temp = map(int,raw_input().strip().split(' ')... | codecakes/algorithms | algorithms/practice/diagonalMatrixDiff.py | Python | mit | 521 |
# The MIT License (MIT)
#
# Copyright (c) 2015 Brian Wray (brian@wrocket.org)
#
# 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
# ... | wrocket/Tulip-Chess | tests/search_tests/test_simple_attacks.py | Python | mit | 2,888 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Liblarch - a library to handle directed acyclic graphs
# Copyright (c) 2011-2012 - Lionel Dricot & Izidor Matušov
#
# This program is free software: you can redistribute it and/or modify it u... | getting-things-gnome/liblarch | setup.py | Python | lgpl-3.0 | 2,629 |
import io
import json
class Stream(object):
__shortname__ = "stream"
"""
This is a base class that should be inherited when implementing
different stream types. Should only be created by plugins.
"""
def __init__(self, session):
self.session = session
def __repr__(self):
... | ethanhlc/streamlink | src/streamlink/stream/stream.py | Python | bsd-2-clause | 915 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.