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 |
|---|---|---|---|---|---|
# dr14_t.meter: compute the DR14 value of the given audiofiles
# Copyright (C) 2011 Simone Riva
#
# 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... | magicgoose/dr14_t.meter | dr14tmeter/wav_write.py | Python | gpl-3.0 | 1,401 |
import tensorflow as tf
import numpy as np
'''
tf.estimator is a high-level TensorFlow library that simplifies the
mechanics of machine learning, including the following:
1. running training loops
2. running evaluation loops
3. managing data sets
tf.estimator defines many common models.
'''
feature_columns = [tf.... | AppleFairy/machinelearning | framework_study/tensorflow/tutorial_r1.4/getting_started_with_tensorflow/estimator.py | Python | mit | 1,249 |
def connect(url, **kwargs):
"""Connect to remote server (default is tornado)"""
# dispatch to vaex.server.tornado package
from .tornado_client import connect
return connect(url, **kwargs)
| maartenbreddels/vaex | packages/vaex-server/vaex/server/__init__.py | Python | mit | 204 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# python import
import base64
# Djando import
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.conf import settings
class Cer(models.Model):
id = models.BigAutoField(primary_key=True)
codice = models.... | Vittorio92/IrpiniaRecuperiWeb | service/models.py | Python | apache-2.0 | 1,943 |
# DDE support for Pythonwin
#
# Seems to work fine (in the context that IE4 seems to have broken
# DDE on _all_ NT4 machines I have tried, but only when a "Command Prompt" window
# is open. Strange, but true. If you have problems with this, close all Command Prompts!
import win32ui
import win32api, win32con... | zhanqxun/cv_fish | pythonwin/pywin/framework/intpydde.py | Python | apache-2.0 | 1,390 |
'''
Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
This will just hold some common functions used for testing.
Created on Aug 15, 2014
@author: dfleck
'''
from twisted.internet import defer,reactor
from twisted.python import log
from gmu.chord.ChordNod... | danfleck/Class-Chord | network-client/src/tests/TestUtils.py | Python | apache-2.0 | 9,854 |
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import, division
from __future__ import division, absolute_import
import unittest
from SpiffWorkflow.bpmn.workflow import BpmnWorkflow
from SpiffWorkflow.exceptions import WorkflowException
from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import... | knipknap/SpiffWorkflow | tests/SpiffWorkflow/bpmn/AntiLoopTaskTest.py | Python | lgpl-3.0 | 1,753 |
# smartmirror.py
# requirements
# requests, feedparser, traceback, Pillow
from Tkinter import *
import locale
import threading
import time
import locale
import requests
import json
import traceback
import feedparser
import serial
import subprocess #checks if camera connected
from time import sleep
#from serial import ... | bennergarrett/TempleSmartMirror | smartmirror.py | Python | mit | 17,287 |
def hsd_inc_beh(rxd, txd):
'''|
| Specify the behavior, describe data processing; there is no notion
| of clock. Access the in/out interfaces via get() and append()
| methods. The "hsd_inc_beh" function does not return values.
|________'''
if rxd.hasPacket():
data = rxd.get() + 1
... | hnikolov/pihdf | examples/hsd_inc/src/hsd_inc_beh.py | Python | mit | 340 |
import sys
import unittest
import numpy
from chainer import backend
from chainer.backends import cuda
from chainer import dataset
from chainer import testing
from chainer.testing import attr
import chainer.testing.backend # NOQA
import chainerx
_inject_backend_tests = testing.backend.inject_backend_tests(
None... | tkerola/chainer | tests/chainer_tests/dataset_tests/test_convert.py | Python | mit | 15,856 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licen... | Tecnativa/website | website_logo/models/website.py | Python | agpl-3.0 | 1,221 |
# coding: utf-8
from django.http import HttpResponseRedirect, HttpResponse
from django.template import RequestContext
from django.shortcuts import get_object_or_404, render_to_response
from collections import defaultdict
from django.contrib.auth.decorators import login_required
from django.core.context_processors impo... | vadosl/photorganizer | photorganizer/photo/views__.py | Python | mit | 8,479 |
#
# Copyright 2010-2012 Fabric Engine Inc. All rights reserved.
#
import fabric
client = fabric.createClient()
cv = client.MR.createConstValue("Size", 100)
ago = client.KLC.createArrayGeneratorOperator("foo.kl", "operator foo(io Float64 output, Size index) { output = Float64(index+1); }", "foo")
ag = client.MR.cre... | ghostx2013/FabricEngine_Backup | Native/Test/Python/mr-sum-async.py | Python | agpl-3.0 | 986 |
# -*- coding: utf-8 -*-
import pygame #@UnresolvedImport
from vec2d import vec2d
from shots import BaseShot
import os
class PlayerShip(pygame.sprite.Sprite):
"""Player ship."""
def __init__(self, screen):
"""Konstruktorn."""
pygame.sprite.Sprite.__init__(self)
... | saintdragon2/python-3-lecture-2015 | civil-final/1st_presentation/6조/aa/player.py | Python | mit | 2,424 |
class APIError(Exception):
"""Represents an error returned in a response to a fleet API call
This exception will be raised any time a response code >= 400 is returned
Attributes:
code (int): The response code
message(str): The message included with the error response
http_error(goo... | cnelson/python-fleet | fleet/v1/errors.py | Python | apache-2.0 | 1,594 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('servo', '0015_auto_20150208_1629'),
]
operations = [
migrations.CreateModel(
name='Action',
... | filipp/Servo | servo/migrations/0016_auto_20150316_1152.py | Python | bsd-2-clause | 2,787 |
# -*- coding: utf-8 -*-
# Copyright(C) 2015 Matthieu Weber
#
# 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 ... | vicnet/weboob | modules/dpd/browser.py | Python | lgpl-3.0 | 1,136 |
import levelFetcher
a = levelFetcher.getLevel(1)
print(a)
print(a.overworld) | hnawner/The-Upside-Down | Levels/importTest.py | Python | mit | 77 |
import unittest
import pyxb_114.binding.datatypes as xsd
class Test_string (unittest.TestCase):
def testRange (self):
# Not really anything to test here.
pass
if __name__ == '__main__':
unittest.main()
| msherry/PyXB-1.1.4 | tests/datatypes/test-string.py | Python | apache-2.0 | 228 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Red Hat, Inc
# Written by Seth Vidal <skvidal at fedoraproject.org>
# Copyright: (c) 2014, Epic Games, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, p... | nitzmahone/ansible | lib/ansible/modules/yum.py | Python | gpl-3.0 | 72,676 |
"""
Created on Oct 31, 2011
@author: bolme and sohara
Original version by David Bolme.
Modified 2014 by Stephen O'Hara to support additional capabilities,
and an addition of an interface to capture polygons.
Modified 2017 by Stephen O'Hara to forward port to Pyvision3, PEP8 compliance
"""
import pyvision3 as pv3
import... | svohara/pyvision3 | pyvision3/dataset_tools/capture_clicks.py | Python | mit | 4,216 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | sysadminmatmoz/odoo-clearcorp | TODO-8.0/cash_flow_report/cash_flow_distribution.py | Python | agpl-3.0 | 4,621 |
#
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The iosxr_lacp class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necessary to bri... | resmo/ansible | lib/ansible/module_utils/network/iosxr/config/lacp/lacp.py | Python | gpl-3.0 | 5,221 |
#-------------------------------------------------------------------------------
# Name: AttributeExploration.py
# Purpose: class for attribute exploration
#
# Author: Jakob Kogler
#-------------------------------------------------------------------------------
class AttributeExploration:
def __ini... | jakobkogler/AttributeExploration | AttributeExploration.py | Python | mit | 2,401 |
# ##### 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 distrib... | pawkoz/dyplom | blender/build_files/buildbot/slave_pack.py | Python | gpl-2.0 | 7,424 |
from django.urls import include, re_path
from rest_framework.routers import SimpleRouter
from . import views
block = SimpleRouter()
block.register('block', views.BlockViewSet,
basename='blocklist-block')
urlpatterns = [
re_path(r'', include(block.urls)),
]
| eviljeff/olympia | src/olympia/blocklist/urls.py | Python | bsd-3-clause | 281 |
import numpy as np
import time, os, sys
import matplotlib.pyplot as plt
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/transformations/'))
import utilFunctions as UF
impo... | acmaheri/sms-tools | lectures/8-Sound-transformations/plots-code/stftFiltering-orchestra.py | Python | agpl-3.0 | 1,648 |
# Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
>>> import bienstman2_ext
'''
def run(args = None):
import sys
import doctest
if args is not None:
sys.argv = a... | satya-das/common | third_party/boost_tp/libs/python/test/bienstman2.py | Python | mit | 529 |
"""
test_api_api
~~~~~~~~~~~~
Tests for the :mod:`~ulid.api.api` module.
"""
import pytest
from ulid import providers
from ulid.api.api import ALL, Api
@pytest.fixture(scope='function')
def mock_provider(mocker):
"""
Fixture that yields a mock provider.
"""
provider = mocker.Mock(spec=pr... | ahawker/ulid | tests/test_api_api.py | Python | apache-2.0 | 2,354 |
import os
import tempfile
import shutil
from doublex import Spy
from expects import expect, have_key, raise_error, be
from doublex_expects import have_been_called_with
from pysellus import loader
from pysellus import integrations
from pysellus import integration_config
with description('the integration_config modul... | ergl/pysellus | spec/integration_config_spec.py | Python | mit | 11,715 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from argparse import ArgumentParser
from dataclasses import dataclass, field
from fairseq.dataclass import FairseqDataclass
f... | pytorch/fairseq | tests/test_dataclass_utils.py | Python | mit | 2,896 |
"""
This module contains the methods for the ``openxc-control`` command line
program.
`main` is executed when ``openxc-control`` is run, and all other callables in
this module are internal only.
"""
import argparse
import sys
import time
from openxc.formats.json import JsonFormatter
from .common import device_optio... | openxc/openxc-python | openxc/tools/control.py | Python | bsd-3-clause | 8,372 |
from io import BytesIO
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from PIL import Image, ImageDraw, ImageFont
from django.core.files.base import ContentFile
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.http import JsonResponse
from d... | chen2aaron/django-editormd | editormd/views.py | Python | mit | 3,749 |
from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'djarduino_mac_maker.views.home', name='home'),
# url(r'^djarduino_mac_maker/', inc... | ajfisher/arduino-mac-maker | djarduino_mac_maker/urls.py | Python | bsd-3-clause | 604 |
#-------------------------------------------------------------------------------
# htmlize-ast-dump.py: Turn a Clang AST dump (-ast-dump) into cross-linked HTML.
#
# Run with --help for usage information.
#
# Note: this script requires Python 3.4; earlier versions of Python 3 should
# work if you install the enum34 mod... | eliben/llvm-clang-samples | tools/htmlize-ast-dump.py | Python | unlicense | 13,724 |
import AZOrangeConfig as AZOC
from AZutilities import miscUtilities
import os
class config():
def __init__(self):
self.report = ""
def ConfigNFSScratchDir(self):
# Create the AZOrange scratch dir on the nfs system is if does not exist
if not os.path.exists(AZOC.NFS_SCRATCHDIR):
... | JonnaStalring/AZOrange | azorange/AutoConfig.py | Python | lgpl-3.0 | 6,443 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Sascha Silbe <sascha-pgp@silbe.org> (PGP signed emails only)
# Modified by: Daniel Francis <santiago.danielfrancis@gmail.com> for usage in the Sugar File Manager
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | Daksh/file-manager | mount_journal.py | Python | gpl-3.0 | 20,979 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-servicebus/azure/mgmt/servicebus/operations/subscriptions_operations.py | Python | mit | 15,254 |
# coding: utf-8
from werkzeug import urls
from .authorize_request import AuthorizeAPI
from datetime import datetime
import hashlib
import hmac
import logging
import time
from odoo import _, api, fields, models
from odoo.addons.payment.models.payment_acquirer import ValidationError
from odoo.addons.payment_authorize.c... | Aravinthu/odoo | addons/payment_authorize/models/payment.py | Python | agpl-3.0 | 16,745 |
"""Парсинг параметров из командной строки и конфигурационного файла."""
from os import linesep
from pathlib import Path
from typing import Tuple
from configargparse import ArgumentParser, Namespace, DefaultConfigFileParser
from codestyle import (__name__ as application_name,
__description__ as ... | webpp-studio/codestyle | codestyle/parameters_parse.py | Python | gpl-3.0 | 2,850 |
"""
Django settings for form_sab project.
Generated by 'django-admin startproject' using Django 1.11.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import o... | Pravandan/sab_lang | form_sab/settings.py | Python | mit | 3,160 |
__version__= '3.0.8' | kumar-physics/PyBMRB | pybmrb/__init__.py | Python | mit | 20 |
#!/usr/bin/python
#-*- coding:utf-8 -*-
def transformation(chaine):
"""Transforme une chaine de caractère selon l'algorithme de la transformée de Burrows-Wheeler"""
chaine = '^' + chaine #On met un délmiteur en début de chaine qui permettra de décoder par la suite
L = len(chaine)
tableau = ["" for i in range(L)] ... | LeProjetDeLaSemaine/Projet_ISN | BurrowsWheeler.py | Python | gpl-3.0 | 2,003 |
#
# Copyright (c) 2008--2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | colloquium/spacewalk | client/tools/spacewalk-koan/actions/kickstart.py | Python | gpl-2.0 | 1,215 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import common.models
class Migration(migrations.Migration):
dependencies = [
('fan', '0001_initial'),
]
operations = [
migrations.AddField(
m... | vivyly/fancastic_17 | fancastic_17/fan/migrations/0002_auto_20141013_2232.py | Python | bsd-3-clause | 858 |
from mbio.entities.entity import Entity
from mbio.utils import get_json
import datetime
import json
class Release(Entity):
def __init__(self, data, *args, **kwargs):
super(Release, self).__init__(*args, **kwargs)
if isinstance(data, str):
self.mbid = data
json_struct = get_... | LordSputnik/python-mbio | mbio/entities/release.py | Python | mit | 1,703 |
import glob
import re
import csv
import os
import sys
import argparse
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
SCRIPTS_DIR = os.path.normpath(os.path.join(FILE_DIR, "../../../Scripts"))
if SCRIPTS_DIR not in sys.path:
sys.path.append(SCRIPTS_DIR)
from CrossReference import CrossReference, Routine, Pac... | OSEHRA-Sandbox/VistA | Utilities/Dox/PythonScripts/InitCrossReferenceGenerator.py | Python | apache-2.0 | 11,935 |
var.doCheckForDuplicateSequences=False
read('d.nex')
a=var.alignments[0]
a.setCharPartition('cp1')
d = Data()
d.alignments[0].writePhylip()
oneBoot = d.bootstrap()
oneBoot.alignments[0].writePhylip()
| blaiseli/p4-phylogenetics | share/Examples/D_nexusSets/D_bootstrapPartitionedData/s.py | Python | gpl-2.0 | 203 |
#!/usr/bin/env python
#
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
... | gnychis/grforwarder | gr-vocoder/examples/g723_24_audio_loopback.py | Python | gpl-3.0 | 1,440 |
# 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"); you may not u... | apache/incubator-airflow | airflow/api/auth/backend/kerberos_auth.py | Python | apache-2.0 | 5,563 |
# Copyright 2016 EMC Corporation
# 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 ... | Hybrid-Cloud/cinder | cinder/tests/functional/test_groups.py | Python | apache-2.0 | 3,817 |
from decimal import Decimal
from mock import patch, Mock
from bs4 import BeautifulSoup
from unittest import TestCase
from amazon_payments import AmazonPaymentsAPI
from api_responses import RESPONSES
class APITestCase(TestCase):
def setUp(self):
self.api = AmazonPaymentsAPI("access_key", "secret_key", ... | britco/django-oscar-amazon-payments | tests/tests.py | Python | mit | 5,299 |
#!/usr/bin/python3
"""Punctuation rules around colons and semi-colons."""
import wlint.punctuation
def _colon_rule(name, colon):
rules = []
# a colon might be followed by a digit if it's time
if name == "colon":
rules.append(("{}.missing-space".format(name),
wlint.punctuati... | snewell/wlint | lib/wlint/punctuation/colon.py | Python | bsd-2-clause | 973 |
# -*- coding: utf-8 -*-
import random
import pygame
from math import fsum
import classes.board
import classes.drw.ratio_hq
import classes.game_driver as gd
import classes.level_controller as lc
import classes.extras as ex
class Board(gd.BoardGame):
def __init__(self, mainloop, speaker, config, screen_w, screen_h... | imiolek-ireneusz/eduActiv8 | game_boards/game033.py | Python | gpl-3.0 | 7,870 |
# Copyright 2013 IBM Corp.
# 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 app... | akash1808/nova_test_latest | nova/tests/unit/api/openstack/compute/contrib/test_extended_ips_mac.py | Python | apache-2.0 | 5,712 |
import logging
from oscar.core.loading import get_model, get_class
from premailer import transform
from ecommerce.extensions.analytics.utils import parse_tracking_context
log = logging.getLogger(__name__)
CommunicationEventType = get_model('customer', 'CommunicationEventType')
Dispatcher = get_class('customer.utils... | mferenca/HMS-ecommerce | ecommerce/notifications/notifications.py | Python | agpl-3.0 | 1,877 |
# raspistillWeb - web interface for raspistill
# Copyright (C) 2013 Tim Jungnickel
#
# 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 la... | bighead85/LivCam | raspistillweb/tests.py | Python | gpl-3.0 | 913 |
#
# Copyright 2014 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribu... | battlemidget/conjure-up | bundleplacer/state.py | Python | mit | 1,135 |
# =========================================================================
# Copyright 2012-present Yunify, Inc.
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the Licens... | daodewang/qingcloud-sdk-python | tests/test_lb_listener.py | Python | apache-2.0 | 4,811 |
from rest_framework import serializers
from constants import SLEEP_MINUTES_COLUMN, VERY_PRODUCTIVE_TIME_LABEL, PRODUCTIVITY_DRIVERS_KEYS
class ProductivityRequestParamsSerializer(serializers.Serializer):
correlation_lookback = serializers.IntegerField(default=60, min_value=1, max_value=365)
cumulative_lookba... | jeffshek/betterself | apis/betterself/v1/correlations/serializers.py | Python | mit | 1,183 |
# -*- coding: utf-8 -*-
"""
flask.module
~~~~~~~~~~~~
Implements a class that represents module blueprints.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from .helpers import _PackageBoundObject, _endpoint_from_view_func
def _register_module(module, st... | wxue/xiakelite | libs/flask/module.py | Python | mit | 8,422 |
#! /usr/bin/python2
# vim: set fileencoding=utf-8
"""Try to find low EMD distance regions fast."""
from collections import defaultdict
from scipy.spatial.distance import cdist, pdist, squareform
from scipy.spatial import ConvexHull, cKDTree
from sklearn.cluster import DBSCAN
from warnings import warn
import itertools
i... | daureg/illalla | approx_emd.py | Python | mit | 15,892 |
# coding: utf-8
import u3
ljh = u3.U3()
ljh.getCalibrationData()
get_ipython().run_line_magic('pinfo', 'ljh.getDIOState')
get_ipython().run_line_magic('pinfo', 'ljh.setDIOState')
get_ipython().run_line_magic('pinfo2', 'ljh.setDIOState')
ljh.setDIOState(8,1)
ljh.setDIOState(15,1)
ljh.setDIOState(8,0)
ljh.setDIOState(15... | ntbrewer/DAQ_1 | kick-u3/manualSession.py | Python | gpl-3.0 | 20,264 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2011 Jerome Rapinat
#
# 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) ... | pmghalvorsen/gramps_branch | gramps/gen/filters/rules/place/_matchessourceconfidence.py | Python | gpl-2.0 | 1,880 |
#!/usr/bin/python
import os
import sys
import argparse
dirSelf = os.path.dirname(os.path.realpath(__file__))
libDir = dirSelf.rstrip(os.sep).rstrip("toolsDevice").rstrip(os.sep).rstrip("bin").rstrip(os.sep) + os.sep + "lib"
sys.path.append(libDir)
# print("lib : "+ libDir)
import dbOuiDevices
parser ... | shrinidhi666/wtfBox | bin/toolsDevice/client_add.py | Python | gpl-3.0 | 3,276 |
from Liga import *
from os import path
import csv
stanjeLigeA={}
stanjeLigeB={}
stanjeLigeC={}
with open('zacetek.txt',encoding='utf-8') as f:
k=0
for line in f:
if k!=0:
a=line.split(';')
ime=a[1]
priimek=a[0]
klub=a[2]
kat=a[3]
to... | andrejborstnik/OLP | StanjeLige.py | Python | gpl-2.0 | 2,016 |
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 optio... | sam-m888/gprime | gprime/filters/rules/person/_incompletenames.py | Python | gpl-2.0 | 2,096 |
# https://oj.leetcode.com/problems/search-for-a-range/
# First use bisection to find the target, and then search for the upper and lower bound.
# # However, the second search is linear and the complexity can be potentially O(N)
class Solution:
# @param A, a list of integers
# @param target, an integer to be se... | lijunxyz/leetcode_practice | search_for_a_range_medium/Solution1.py | Python | mit | 1,397 |
import os
import osiris
class Page(osiris.IMainPage):
def __init__(self, session):
osiris.IMainPage.__init__(self, session)
if session.request.getUrlParam("mode") == "dialog":
self.ajax = True
def isMcpModeRequired(self):
return False
def getPageName(self):
return "main.pages.isis"
def onIni... | OsirisSPS/osiris-sps | client/data/extensions/148B613D055759C619D5F4EFD9FDB978387E97CB/scripts/main/isis.py | Python | gpl-3.0 | 4,201 |
import os
import sys
import sqlite3
import datetime
import requests
import json
import logging
import argparse
import pandas as pd
os.environ['TZ'] = 'US/Central'
insert = """
INSERT OR IGNORE INTO vehicles (
vid, tmstmp, lat, lon, hdg, pid, rt, des, pdist, dly, tatripid, tablockid, zone
) VALUES (
:vid, ... | spencerchan/ctabus | src/remote/scraper.py | Python | gpl-3.0 | 2,538 |
from superdesk import Resource, Service
from superdesk.utils import ListCursor
from superdesk.errors import AlreadyExistsError
from flask_babel import _
registered_search_providers = {}
allowed_search_providers = []
def register_search_provider(name, fetch_endpoint=None, provider_class=None, label=None):
"""Reg... | mdhaman/superdesk-core | apps/search_providers/registry.py | Python | agpl-3.0 | 2,908 |
numTilings = 8
offset = (0.6/8)
tileWidth = 0.6
#import numpy as np
# X = x + (i*offset); Y = y + (i*offset)
# X = int(x/0.6); Y = int(y/0.6)
def tilecode(x,y,tileIndices):
for i in range(0,numTilings):
X = int(x/0.6); Y = int(y/0.6)
index = ((Y*11)+X)+(121*i)
tileIndices[i] ... | smithe0/366Ass2 | Tilecoder.py | Python | artistic-2.0 | 661 |
#!/usr/bin/python3
#system includes
import os
import sys
import getopt
import time
import threading
import matplotlib.pyplot as plt
# Helper includes
import gbl
import socketHelper
import displacement as disp
import plotHelper as pltHelper
def usage():
print("Wrapper for plotting the displacement")
prin... | tass-belgium/EmbeddedMT | wrappers/remoteStreamDisplacement.py | Python | gpl-2.0 | 5,748 |
import json
from datetime import datetime
import logging
from tornado import web, gen
from lib.blinx.core.router.routestar import AddRoute
from lib.blinx.core.handlers import BaseHandler
app_log = logging.getLogger("tornado.application")
@AddRoute(r'/test/whoami')
class TestValidateHandler(BaseHandler):
"""
... | blinxin/blinx | blinx/routes/test_routes.py | Python | gpl-2.0 | 2,302 |
# Copyright (C) 2002-2007 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
"""Header encoding and decoding functionality."""
__all__ = [
'Header',
'decode_header',
'make_header',
]
import re
import binascii
import email.quoprimime
import email.base64m... | LaoZhongGu/kbengine | kbe/src/lib/python/Lib/email/header.py | Python | lgpl-3.0 | 22,711 |
#!/usr/bin/env python
# coding=utf-8
import random,os,sys,unittest,run_app,codecs
reload(sys)
sys.setdefaultencoding( "utf-8" )
class TestCaseUnit(unittest.TestCase):
def test_positive_manifest1(self):
self.assertEqual("PASS", run_app.tryRunApp("manifest1-positive", "/opt/wrt-manifest-android-tests/apks/... | pk-sam/crosswalk-test-suite | wrt/wrt-manifest-android-tests/tests.py | Python | bsd-3-clause | 47,245 |
from __future__ import absolute_import, division, print_function
import os
import fnmatch
import unittest
def get_modules():
# 只能添加test根目录下的 *_test.py 用例
modules = []
for _, _, f in os.walk(os.path.dirname(__file__) or '.'):
for i in filter(lambda x: fnmatch.fnmatch(x, '*_test.py'), f):
... | hellflame/qiniu_manager | qiniuManager/test/run.py | Python | mit | 723 |
from django.core.urlresolvers import resolve, reverse
import furl
from rest_framework import serializers as ser
import pytz
from modularodm import Q
from framework.auth.core import Auth, User
from website import settings
from website.files.models import FileNode
from website.project.model import Comment
from website... | SSJohns/osf.io | api/files/serializers.py | Python | apache-2.0 | 11,382 |
import socket
import threading
from pluginHelper.IPlugin import ICryptoPlugin
class tcpRelay():
# This Class is used directly with no modification on both proxy side
def __init__(self, pluginStack: list, uplink: socket.socket, downlink: socket.socket):
self.pluginStack = pluginStack
... | securesocketimproved/ssi | socksv/tcpRelay.py | Python | gpl-3.0 | 3,154 |
#This module initializes flags for optional dependencies
try:
import pandas
HAS_PANDAS = True
except ImportError:
HAS_PANDAS = False
| sandeepkrjha/pgmpy | pgmpy/base/OptionalDependency.py | Python | mit | 145 |
# Copyright (c) 2015-2019, Activision Publishing, 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:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of ... | ActivisionGameScience/assertpy | assertpy/dynamic.py | Python | bsd-3-clause | 3,623 |
"""
Utility classes and functions to handle connection to a libvirt host system
The entire contents of callables in this module (minus the names defined in
NOCLOSE below), will become methods of the Virsh and VirshPersistent classes.
A Closure class is used to wrap the module functions, lambda does not
properly store ... | clebergnu/avocado-vt | virttest/virsh.py | Python | gpl-2.0 | 152,004 |
# -*- coding: utf-8 -*-
import os,re
import xbmc,xbmcgui,xbmcplugin
import addon, requests
# Функция для получения подпапок контента
def getGroups(section,USER):
groups = {}
url = section + "/get_data.php"
values = {"user_id": USER['ID'],
"soho_user": USER['SOHO_USER']
}
html = requests.html_req(url... | Limeone/plugin.video.bonus | groups.py | Python | gpl-3.0 | 2,023 |
# coding: utf-8
"""zmq Socket class"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import errno as errno_mod
from ._cffi import (C, ffi, new_uint64_pointer, new_int64_pointer,
new_int_pointer, new_binary_data, value_uint64_pointer,
... | swn1/pyzmq | zmq/backend/cffi/socket.py | Python | bsd-3-clause | 8,000 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
CLASSIFIERS=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Framework :: Django',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming L... | michiya/django-pyodbc-azure | setup.py | Python | bsd-3-clause | 1,032 |
from __future__ import division
from sympy import (Abs, I, Dummy, Rational, Float, S, Symbol, cos, oo, pi,
simplify, sin, sqrt, symbols, Derivative, asin, acos)
from sympy.geometry import (Circle, Curve, Ellipse, GeometryError, Line, Point,
Polygon, Ray, RegularPolygon, S... | grevutiu-gabriel/sympy | sympy/geometry/tests/test_point.py | Python | bsd-3-clause | 8,076 |
LANGUAGE_CODE = 'en'
SECRET_KEY = 'ji2r2iGkZqJVbWDhXrgDKDR2qG#mmtvBZXPXDugA4H)KFLwLHy'
SITE_ID = 1
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = ['--nologcapture', '--with-id']
MEDIA_ROOT = '/tmp/cmsplugin-polls/media/'
STATIC_ROOT = '/tmp/cmsplugin-polls/static/'
ROOT_URLCONF = 'urls'
DATABASES = {
... | satyrius/cmsplugin-polls | tests/settings.py | Python | mit | 905 |
#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error, software_manager
sm = software_manager.SoftwareManager()
class lsof(test.test):
"""
Autotest module for testing basic functionality
of lsof
@author
"""
version = 1
... | rajashreer7/autotest-client-tests | linux-tools/lsof/lsof.py | Python | gpl-2.0 | 1,739 |
# webpageclassifier.py
import math
import re
import requests
import collections
import itertools
from bs4 import BeautifulSoup, SoupStrainer
from time import sleep
"""Categorizes urls as blog|wiki|news|forum|classified|shopping|undecided.
THE BIG IDEA: It is inherently confusing to classify pages as clasifieds, blo... | asitang/webpageclassifier | webpageclassifier.py | Python | apache-2.0 | 13,357 |
#!/usr/bin/env python
# coding=UTF-8
# Author: Dennis Lutter <lad1337@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Softwa... | AlexBoogaard/Sick-Beard-Torrent-Edition | tests/all_tests.py | Python | gpl-3.0 | 1,450 |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Aloomaio/googleads-python-lib | examples/adwords/v201809/misc/get_all_images_and_videos.py | Python | apache-2.0 | 2,852 |
import collections as c, numpy as n
class AgentStatistics:
def __init__(self,list_datastructures=None):
if not list_datastructures:
print("input datastructures, please")
self.list_datastructures=list_datastructures
self.author_messages_= author_messages_= c.OrderedDict(sorted(li... | ttm/gmaneLegacy | gmaneLegacy/agentStatistics.py | Python | unlicense | 2,241 |
import RPi.GPIO as GPIO
import time
BEEP = 11
def setup():
GPIO.setmode(GPIO.BOARD)
GPIO.setup(BEEP, GPIO.OUT)
def loop():
while True:
GPIO.output(BEEP, not(GPIO.input(BEEP)))
time.sleep(1)
def destroy():
GPIO.output(BEEP, 1)
GPIO.cleanup()
if __name__ == "__main__":
try:
setup()
loop()
except Keybo... | stevenvo/rpi-gpio-scripts | 05_buzzer.py | Python | gpl-2.0 | 346 |
'''
Created on Jun 6, 2012
@author: vr274
'''
import numpy as np
from generic import TakestepSlice, TakestepInterface
from pele.utils import rotations
__all__ = ["RandomDisplacement", "UniformDisplacement",
"RotationalDisplacement", "RandomCluster"]
class RandomDisplacement(TakestepSlice):
'''Random... | js850/pele | pele/takestep/displace.py | Python | gpl-3.0 | 2,126 |
# -*- coding: utf-8 -*-
"""
pydot example 1
@author: Federico Cáceres
@url: http://pythonhaven.wordpress.com/2009/12/09/generating_graphs_with_pydot
"""
import pydot # import pydot or you're not going to get anywhere my friend :D
# first you create a new graph, you do that with pydot.Dot()
graph = pydot.Dot(graph_type... | metaperl/karatbars-utils | k0de/upgraded/try.py | Python | mit | 1,616 |
# Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | SVilgelm/CloudFerry | tests/lib/os/actions/test_get_info_images.py | Python | apache-2.0 | 1,926 |
#!/usr/bin/python -OO
# This file is part of Archivematica.
#
# Copyright 2010-2012 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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, e... | artefactual/archivematica-history | src/MCPServer/lib/linkTaskManagerGetMicroserviceGeneratedListInStdOut.py | Python | agpl-3.0 | 5,022 |
###############################################################################
# Copyright 2017-2021 - Climate Research Division
# Environment and Climate Change Canada
#
# This file is part of the "fstd2nc" package.
#
# "fstd2nc" is free software: you can redistribute it and/or modify
# it under... | neishm/fstd2nc | fstd2nc/extra.py | Python | lgpl-3.0 | 12,951 |
# -*- coding:utf-8 -*-
"""
Description:
Contract Parameter Type in AntShares.Wallets
Usage:
from AntShares.Wallets.ContractParameterType import ContractParameterType
"""
class ContractParameterType(object):
Signature = 0x00 # 签名
Integer = 0x01 # 整数
Hash160 = 0x02 # 160位散列值... | AntSharesSDK/antshares-python | sdk/AntShares/Wallets/ContractParameterType.py | Python | apache-2.0 | 426 |
# -*- coding: utf-8 -*-
"""
:copyright: Copyright 2013-2014 by Łukasz Mierzwa
:contact: l.mierzwa@gmail.com
"""
from __future__ import unicode_literals
from mongoforms import MongoForm
from mongoforms.fields import MongoFormFieldGenerator
from IPy import IP
from django.forms import Form, GenericIPAddressFi... | prymitive/upaas-admin | upaas_admin/common/forms.py | Python | gpl-3.0 | 5,471 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.