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 |
|---|---|---|---|---|---|
import pitouch
from time import sleep
from random import randint
pit = pitouch.PiTouch()
pit.all(0) # Reset LEDs
sequence = []
response = []
count = 0
go = 0
start = 1
def checkseq():
global sequence, response
print sequence
print response
x = 0
while len(sequence) > len(response):
response.append(pit... | CyntechUK/touch4pi | test-simon.py | Python | mit | 1,695 |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | viranch/exodus | resources/lib/sources/dailyrls.py | Python | gpl-3.0 | 6,250 |
import multiprocessing,os
APP_NAME = 'graphics'
bind = "0.0.0.0:80"
#bind = "unix:/tmp/gunicorn-%s.sock" % APP_NAME
workers = multiprocessing.cpu_count() * 2 + 1
max_requests = 200
preload_app = True
chdir = os.path.dirname(__file__)
daemon = True
debug = False
errorlog = '/tmp/gunicorn-%s.error.log' % APP_NAME
acc... | adsabs/adsabs-vagrant | dockerfiles/graphics/gunicorn.conf.py | Python | bsd-3-clause | 430 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 9 14:10:39 2017
NAME;
Monthly time series of precipitation from May 2000 - March 2017 for the Rondonia region
PURPOSE;
This program processes monthly precipitation data (mm/hr) for the Rondonia region (11S,63W).
Plots:
1. Precipitation rate vs mon... | fe114/CCI_LAND | precipitation.py | Python | gpl-3.0 | 6,560 |
# -*- coding: utf-8 -*-
"""
Created on Wed May 10 11:15:22 2017
@author: lracuna
"""
from vision.camera import Camera
from vision.plane import Plane
from vision.screen import Screen
import numpy as np
import matplotlib.pyplot as plt
from mayavi import mlab
import cv2
#%% Create a camera
cam = Camera()
#Set camera ... | raultron/ivs_sim | python/old_experiments/screen_calibration_3cam_views.py | Python | mit | 3,386 |
import parameters
from matplotlib import pyplot, animation, rcParams
def generate_writer():
FFMpegWriter = animation.writers['ffmpeg']
writer = FFMpegWriter(fps=parameters.frames_per_second, metadata=parameters.metadata)
fig = pyplot.figure()
fig.subplots_adjust(left=0, bottom=0, right=1, top=1, wspac... | beardeer/neural-network-animation | video.py | Python | mit | 1,726 |
import sys
import os
import shutil
from decimal import *
import simulations
import BP_graph
import params
import numpy
import time
import scores
from BP_graph import *
from params import *
def dir2int(dir_chr):
if dir_chr=='+':
return 0
if dir_chr=='-':
return 1
def int2dir(dir_int):
if... | Shamir-Lab/Karyotype-reconstruction | CreateGraph.py | Python | gpl-3.0 | 20,810 |
from panda3d.core import *
from panda3d.direct import *
from toontown.toonbase import ToontownGlobals
import Playground
import random
from toontown.launcher import DownloadForceAcknowledge
from direct.task.Task import Task
from toontown.hood import ZoneUtil
class TTPlayground(Playground.Playground):
def __init__(... | silly-wacky-3-town-toon/SOURCE-COD | toontown/safezone/TTPlayground.py | Python | apache-2.0 | 1,970 |
from django.db import models
from django.db.models.fields.related import ManyToOneRel, ForeignObjectRel
from elasticsearch_dsl.mapping import Mapping
from elasticsearch_dsl.field import Field
from djes.conf import settings
FIELD_MAPPINGS = {
"AutoField": {"type": "long"},
"BigIntegerField": {"type": "long"},... | theonion/djes | djes/mapping.py | Python | mit | 5,823 |
#!/usr/bin/env python
#8. Write a Python program using ciscoconfparse that parses cisco_crypto.txt. Note, this config file is not fully valid (i.e. parts of the configuration are missing). The script should find all of the crypto map entries in the file (lines that begin with 'crypto map CRYPTO') and for each crypto m... | joeyb182/pynet_ansible | pynet_ansible/exercise_1_8.py | Python | apache-2.0 | 615 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from google.appengine.ext import ndb
from gaegraph.model import Node
from gaeforms.ndb import property
class Aluno(Node):
nome = ndb.StringProperty(required=True)
data_nascimento = ndb.DateProperty(required=True)
telefone = n... | SamaraCardoso27/eMakeup | backend/apps/aluno_app/model.py | Python | mit | 354 |
# Copyright 2021 DeepMind Technologies Limited. 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 ... | deepmind/dm-haiku | haiku/_src/integration/check_tracer_leaks_test.py | Python | apache-2.0 | 1,872 |
import asyncio
import functools
import toolz
import aioredux
import aioredux.middleware
from aioredux.tests import base
import aioredux.utils
try:
from types import coroutine
except ImportError:
from asyncio import coroutine
class TestThunk(base.TestCase):
def setUp(self):
self.loop = asyncio.... | ariddell/aioredux | aioredux/tests/test_thunk.py | Python | mpl-2.0 | 5,061 |
import os
from django.core.urlresolvers import reverse
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from easy_thumbnails.fields import ThumbnailerImageField
class VisibilityModel(models.Model):
is_active = models.BooleanField(_('is active... | matthiask/django-chet | chet/models.py | Python | bsd-3-clause | 2,741 |
"""enable ui.log output in tests
Wraps the ``ui.log`` method, printing out events which are enabled.
To enable events add them to the ``extralog.events`` config list.
"""
from __future__ import absolute_import
from edenscm.mercurial import extensions, util
def logevent(ui, event, *msg, **opts):
items = ui.con... | facebookexperimental/eden | eden/scm/tests/extralog.py | Python | gpl-2.0 | 1,272 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2016 "Neo Technology,"
# Network Engine for Objects in Lund AB [http://neotechnology.com]
#
# This file is part of Neo4j.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | nigelsmall/py2neo | py2neo/packages/neo4j/util.py | Python | apache-2.0 | 2,699 |
# Copyright (c) 2020 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.
"""Export chromeperf dashboard data to BigQuery with Beam & Cloud Dataflow."""
from __future__ import absolute_import
from __future__ import division
fro... | endlessm/chromium-browser | third_party/catapult/dashboard/bq_export/bq_export/bq_dash.py | Python | bsd-3-clause | 6,517 |
from Networking import Networking
from Model import Playlist
from SpotifyAPI import SpotifyAPI
import Security
import json
class PlaylistAPI(SpotifyAPI):
base_url = "https://api.spotify.com"
def __init__(self, categoryID):
super(PlaylistAPI, self).__init__()
self.list_of_playlist = []
... | fbuitron/FBMusic_ML_be | BATCH/PlaylistAPI.py | Python | apache-2.0 | 1,427 |
# -*- coding: utf-8 -*-
from django.test import TestCase, Client
from django.contrib.auth.models import User
from djangobb_forum.models import Post, Reputation
class TestReputation(TestCase):
fixtures = ['test_forum.json']
def setUp(self):
self.from_user = User.objects.get(pk=1)
self.to_... | jokey2k/ShockGsite | djangobb_forum/tests/test_reputation.py | Python | bsd-3-clause | 1,333 |
# antioch
# Copyright (c) 1999-2019 Phil Christensen
#
#
# See LICENSE for details
"""
Default database bootstrap.
"""
from antioch.core import interface, bootstrap
from antioch.util import sql
for name in interface.default_permissions:
exchange.connection.runOperation(sql.build_insert('permission', name=name)... | philchristensen/antioch | antioch/core/bootstrap/default.py | Python | mit | 7,958 |
"""This example showcase point queries by highlighting the shape under the
mouse pointer.
"""
__version__ = "$Id:$"
__docformat__ = "reStructuredText"
import random
import pygame
from pygame.locals import *
from pygame.color import *
import pymunk as pm
from pymunk import Vec2d
import pymunk.pygame_... | cfobel/python___pymunk | examples/point_query.py | Python | mit | 3,003 |
#!/usr/bin/env python
# File created on 30 Mar 2011
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.8.0-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcaporaso@gmail.com"
from ... | wasade/qiime | scripts/process_iseq.py | Python | gpl-2.0 | 5,053 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'nyc_records.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| NYPDVisionZeroAccountability/nyc-records | nyc_records/nyc_records/urls.py | Python | gpl-2.0 | 280 |
from django.db import models
from django.utils.encoding import smart_unicode
from complejos.models import Complejo
# Create your models here.
class Equipo(models.Model):
nombre = models.CharField(max_length=120, null=False)
timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
updated = model... | diegonalvarez/tournament-stats | equipos/models.py | Python | mit | 486 |
#!/usr/bin/env python
# coding: utf-8
# Potentials
# ============================
#
# PHOEBE 2.0.x's rpole and pot are replaced with [requiv](requiv.ipynb) in PHOEBE 2.1+.
| phoebe-project/phoebe2-docs | development/tutorials/pot.py | Python | gpl-3.0 | 174 |
# -*- coding: utf-8 -*-
#
# 2015-04-08 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Add options ROUNDS to avoid timeouts during OTP hash calculation
# 2015-04-03 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Use pbkdf2 for OTP hashing
# 2015-03-13 Cornelius Kölbel, <cornelius@p... | privacyidea/privacyidea | privacyidea/lib/applications/offline.py | Python | agpl-3.0 | 8,159 |
import numpy as np
######## Special Matrices ###########
#Mixing
class Vandermonde_Matrix(object):
""" Vandermonde Matrix """
z=None
@property
def H(self):
return np.matrix(np.vander(self.z,self.N, increasing=True)).T
| vincentchoqueuse/parametrix | parametrix/core/special_matrices.py | Python | bsd-3-clause | 265 |
#!/usr/bin/python3
# -*-coding:utf-8 -*
import json
from os.path import expanduser
def relativeToAbsoluteHomePath(path):
""" Transforms a relative home path into an absolute one
Argument:
path -- the path that may need transformation"""
if "~" in path:
return path.replace("~",expanduser("~"))
... | plaperdr/blink-docker | docker/os/fedora/ubuntu/scripts/utils.py | Python | mit | 667 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This file contains everything needed to interface with JUnit"""
#####
# pyCheck
#
# Copyright 2012, erebos42 (https://github.com/erebos42/miscScripts)
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public... | m-wichmann/pyCheck | src/ifJUnit.py | Python | lgpl-3.0 | 1,199 |
# -*- test-case-name: twisted.conch.test.test_manhole -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.manhole}.
"""
import traceback
from twisted.trial import unittest
from twisted.internet import error, defer
from twisted.test.proto_helpers import StringTran... | bdh1011/wau | venv/lib/python2.7/site-packages/twisted/conch/test/test_manhole.py | Python | mit | 10,909 |
# -*- coding: utf-8 -*-
"""
:copyright: (c) 2016 by the mediaTUM authors
:license: GPL3, see COPYING for details
"""
from __future__ import absolute_import
from utils.date import parse_date
from core.test.factories import DocumentFactory
# adding more test functions may fail, see the comments for the following... | mediatum/mediatum | core/test/test_legacy_update_create.py | Python | gpl-3.0 | 1,051 |
# 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... | gunan/tensorflow | tensorflow/python/compiler/tensorrt/test/quantization_mnist_test.py | Python | apache-2.0 | 10,954 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import time, sys, pprint, config
from mysql.connector import (connection)
import msgParse
cnx = connection.MySQLConnection(user=config.MYSQL_USER, password=config.MYSQL_PASSWORD, host= config.MYSQL_HOST, database=config.MYSQL_DB)
inTxt=' '.join(sys.argv[1:])
outTxt= msgParse... | tabacha/WoIstDerWagen | pythonBot/test-cli.py | Python | apache-2.0 | 380 |
"""
A micro wx App with a list of the things checked on the checklist.
"""
import datetime
import random
import wx
import hotmodel
from hotwidgets import (
MVCList,
)
import production
class ProductionView(wx.Frame):
def __init__(self, parent, dummy_app, title, model):
""" Creat... | petrblahos/modellerkit | step07/view01.py | Python | mit | 4,441 |
import getActivities as ga
import tripParse as tp
import numpy as np
import pandas as pd
import pprint
import process
import json
def reconstructTrips(trips, stops, poi_dwell_time=900):
def dwell_time(stop):
"""Return time spend in a stopped location in seconds"""
start_time, end_time = stop[3], st... | SUTDMEC/TripInference | mainDirections.py | Python | mit | 3,034 |
import os
from os.path import join
from unittest import TestCase
import numpy as np
from scilmm import IBDCompute
class TestIBDCompute(TestCase):
def setUp(self):
self.ibd_compute = IBDCompute()
def test_compute_relationships(self):
pedigree, entries_list = self.ibd_compute.compute_relation... | TalShor/SciLMM | scilmm/Tests/test_IBDCompute.py | Python | gpl-3.0 | 2,451 |
# -*- coding: utf-8 -*-
import os
import sys
import json
import getpass
from pyethapp.accounts import Account
def find_datadir():
home = os.path.expanduser('~')
if home == '~': # Could not expand user path
return None
datadir = None
if sys.platform == 'darwin':
datadir = os.path.joi... | tomaaron/raiden | raiden/accounts.py | Python | mit | 3,027 |
__version__ = "2.0.0"
| emmanvg/cti-stix-elevator | stix2elevator/version.py | Python | bsd-3-clause | 22 |
# Copyright 2014-2015 VPAC
# Copyright 2014 The University of Melbourne
#
# This file is part of Karaage.
#
# Karaage 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 y... | Karaage-Cluster/karaage-debian | karaage/tests/common/test_forms.py | Python | gpl-3.0 | 2,626 |
"""
/*
* Copyright (c) 2009, 3M
* 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 conditions a... | brontes3d/wrtctl | src/libwrtctl/__init__.py | Python | gpl-3.0 | 1,707 |
from __future__ import unicode_literals
from django.apps import AppConfig
class MailConfig(AppConfig):
name = 'mail'
| jnayak1/osf-meetings | meetings/mail/apps.py | Python | apache-2.0 | 124 |
from contrib import *
import re
def tokenize(text):
tokens = re.findall('(?u)[\w.-]+',text)
tokens = [t for t in tokens if not re.match('[\d.-]+$',t)]
#tokens = [t for t in tokens if len(t)>2]
# TODO remove stopwords
return u' '.join(tokens)
## text = KV('data/text.db',5)
## tokens = KV('data/tokens.db',5)
text... | mobarski/sandbox | topic/tokens.py | Python | mit | 455 |
import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="color", parent_name="contour.line", **kwargs):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/contour/line/_color.py | Python | mit | 405 |
"""
Django settings for central_service project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR,... | Antikythera/hoot | Application/central_service/settings.py | Python | gpl-2.0 | 3,154 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""pythonfile.py: Description of pythonfile.py"""
__author__ = ""
__copyright__ = ""
__credits__ = ""
__license__ = ""
__version__ = ""
__email__ = ""
__status__ = ""
def printer():
"""
:return:
"""
pass
def netscan():
"""
:return:
"""
... | Cbetron/VIS_SYSTEM | .debris/2016-11-19/VIS_SERVER/modules/nettools.py | Python | gpl-3.0 | 385 |
import discord
from discord.ext import commands
extensions = (
"cogs.Watchafaboulas"
)
Human_Boi = commands.Bot(command_prefix="*")
def main():
@Human_Boi.event
async def on_ready():
print("logged in as {},id = {}".format(Human_Boi.user.name, Human_Boi.user.name))
print("User... | Ree23/Discord-bot | Main.py | Python | mit | 777 |
# -*- 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
#... | subodhchhabra/airflow | tests/contrib/operators/test_emr_create_job_flow_operator.py | Python | apache-2.0 | 3,850 |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import h5py
import numpy as np
import argparse
import uuid
import model_pb2
def quantize_arr(arr):
"""Quantization based on linear rescaling over min/max range.
"""
... | transcranial/keras-js | python/encoder.py | Python | mit | 4,226 |
# 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-datalake-analytics/azure/mgmt/datalake/analytics/job/models/job_information.py | Python | mit | 6,107 |
from HTMLComponent import HTMLComponent
from GUIComponent import GUIComponent
from skin import parseColor, parseFont
from enigma import eListboxServiceContent, eListbox, eServiceCenter, eServiceReference, gFont, eRect, eSize
from Tools.LoadPixmap import LoadPixmap
from Tools.Directories import resolveFilename, SCOPE_... | devclone/enigma2-9f38fd6 | lib/python/Components/ServiceList.py | Python | gpl-2.0 | 15,005 |
#!/usr/bin/env LC_ALL=ja_JP.utf-8 python
# -*- coding: utf-8 -*-
import sqlite3
import urllib
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import re
from bs4 import BeautifulSoup
# Yahoo! Developer Network Application ID
appid = ''
# Yahoo!形態素解析API
pageurl = 'http://jlp.yahooapis.jp/MAService/V1/parse'
# ... | uraway/SenryuGenerator | make_morph_db.py | Python | mit | 2,754 |
# Copyright 2018-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 | abydos/distance/_gini_ii.py | Python | gpl-3.0 | 6,028 |
# Example similar to line.py, but demoing special data
# values: masked arrays, nans, and inf
import numpy as np
from bokeh.plotting import figure, output_file, show
x = np.linspace(0, 4*np.pi, 200)
y1 = np.sin(x)
y2 = np.cos(x)
# Set high/low values to infinity
y1[y1>+0.9] = +np.inf
y1[y1<-0.9] = -np.inf
# Set hi... | percyfal/bokeh | examples/plotting/file/line_missing_data.py | Python | bsd-3-clause | 640 |
from whatportis.db import merge_protocols
def test_merge_protocols_different_ports():
ports = [
{
"description": "My description 1",
"name": "MyName 1",
"port": "1234",
"protocol": "udp",
},
{
"description": "My description 2",
... | ncrocfer/whatportis | tests/test_utils.py | Python | mit | 1,163 |
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright © 2014 Tim Bielawa <timbielawa@gmail.com>
#
# 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 with... | pombredanne/bitmath | tests/test_progressbar.py | Python | mit | 3,741 |
# !/usr/bin/python3
# coding: utf-8
# Copyright 2015-2018
#
# 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... | mre/receipt-parser | receipt_parser_core/receipt.py | Python | apache-2.0 | 5,814 |
from setuptools import setup, find_packages
import os
DIRNAME = os.path.dirname(os.path.abspath(__file__))
execfile(os.path.join(DIRNAME, 'huxley', 'version.py'))
setup(
name = 'Huxley',
version = __version__,
packages = find_packages(),
install_requires = [
'selenium==2.35.0',
'plac=... | Lanzafame/huxley | setup.py | Python | apache-2.0 | 824 |
import i18n as i
_ = i.i18n()
| CodeRiderz/rojak | rojak-pantau/rojak_pantau/i18n/__init__.py | Python | bsd-3-clause | 31 |
# -*- coding: utf-'8' "-*-"
import base64
try:
import simplejson as json
except ImportError:
import json
import logging
import urlparse
import werkzeug.urls
import urllib2
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment_paypal.controllers.main import Payp... | funkring/fdoo | addons/payment_paypal/models/paypal.py | Python | agpl-3.0 | 19,377 |
#Using a Process Pool – Chapter 3: Process Based Parallelism
import multiprocessing
def function_square(data):
result = data*data
return result
if __name__ == '__main__':
inputs = list(range(0,100))
pool = multiprocessing.Pool(processes=4)
pool_outputs = pool.map(function_square, input... | IdiosyncraticDragon/Reading-Notes | Python Parallel Programming Cookbook_Code/Chapter 3/process_pool.py | Python | apache-2.0 | 405 |
# -*- coding: utf-8 -*-
#
# Isso documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 21 11:28:01 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | mathstuf/isso | docs/conf.py | Python | mit | 8,794 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | mbohlool/client-python | kubernetes/client/models/v1_node_daemon_endpoints.py | Python | apache-2.0 | 3,380 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sqlalchemy as sa
from hyputils.memex.db import Base
from hyputils.memex.db import mixins
from hyputils.memex import pubid
ORGANIZATION_DEFAULT_PUBID = "__default__"
ORGANIZATION_NAME_MIN_CHARS = 1
ORGANIZATION_NAME_MAX_CHARS = 25
class Organiza... | tgbugs/hypush | hyputils/memex/models/organization.py | Python | mit | 1,477 |
from pythonforandroid.toolchain import Recipe, shprint, current_directory, ArchARM
from os.path import exists, join
from os import uname
import glob
import sh
class Python3Recipe(Recipe):
version = '3.4.2'
url = 'http://python.org/ftp/python/{version}/Python-{version}.tgz'
name = 'python3'
depends = ... | okajun35/python_for_android_doc_ja | pythonforandroid/recipes/python3/__init__.py | Python | mit | 8,423 |
import random
import os
Helper = {
'!cheers':{'Help':'', 'Description':'', 'Type':'User'}
}
async def cheers(client, message, *args):
beers = os.listdir('../img/beers')
min = 1
max = len(beers)
number = random.randint(min, max)
file = '../img/beers/beer' + str(number) + '.jpg'
await client.... | KvasirSGDevelopment/Aurora | src/modules/cheers.py | Python | mit | 353 |
# 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");... | iemejia/incubator-beam | sdks/python/apache_beam/examples/snippets/transforms/aggregation/combineperkey_test.py | Python | apache-2.0 | 2,971 |
import sys
import re
#
# You must include the following class definition at the top of
# your method specification file.
#
class MethodSpec(object):
def __init__(self, name='', source='', class_names='',
class_names_compiled=None):
"""MethodSpec -- A specification of a method.
Member ... | joebowen/movement_validation_cloud | djangodev/lib/python2.7/site-packages/neuroml/nml/helper_methods.py | Python | mit | 4,806 |
# coding=utf-8
import pytest
import marcottievents.models.national as mn
import marcottievents.models.common.overview as mco
import marcottievents.models.common.personnel as mcp
import marcottievents.models.common.events as mce
import marcottievents.models.common.enums as enums
natl_only = pytest.mark.skipif(
py... | soccermetrics/marcotti-events | tests/test_national.py | Python | mit | 20,209 |
from werkzeug.routing import Map, Rule
from werkzeug.wrappers import Response
from lymph.testing import WebServiceTestCase
from lymph.web.interfaces import WebServiceInterface
from lymph.web.handlers import RequestHandler
from lymph.web.routing import HandledRule
class RuleHandler(RequestHandler):
def get(self):... | lyudmildrx/lymph | lymph/tests/integration/test_web_interface.py | Python | apache-2.0 | 2,025 |
import gevent
class EventHook(object):
"""
Simple event class used to provide hooks for different types of events in Locust.
Here's how to use the EventHook class::
my_event = EventHook()
def on_my_event(a, b, **kw):
print "Event was fired with arguments: %s, %s" % (a, b)
... | heyman/locust | locust/events.py | Python | mit | 4,005 |
import time
import re
import keyword
from Tkinter import *
from Delegator import Delegator
from configHandler import idleConf
#$ event <<toggle-auto-coloring>>
#$ win <Control-slash>
#$ unix <Control-slash>
DEBUG = 0
def any(name, list):
return "(?P<%s>" % name + "|".join(list) + ")"
def make_pat():
kw = r... | trivoldus28/pulsarch-verilog | tools/local/bas-release/bas,3.9/lib/python/lib/python2.3/idlelib/ColorDelegator.py | Python | gpl-2.0 | 9,256 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-06-24 00:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0068_auto_20170519_1337'),
]
operations = [
migrations.A... | jonboiser/content-curation | contentcuration/contentcuration/migrations/0069_channel_preferences.py | Python | mit | 866 |
from brules import StepSet
from brules.steps import RegexFuncStep
from brules.rules import Rule
from textwrap import dedent
from mock import Mock
from os.path import dirname, join
from unittest import TestCase
class RuleTest(TestCase):
def setUp(self):
self.rule = Rule()
def step_fn(context, arg... | pib/brules | brules/tests/test_rules.py | Python | mit | 3,906 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eith... | jitka/weblate | weblate/lang/admin.py | Python | gpl-3.0 | 1,137 |
import re
import os
texts = []
directory = os.path.dirname(os.path.realpath(__file__))
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith(".srt"):
f=open(os.path.join(root,file), 'r')
texts.append((file,f.read()))
f.close()
p1 = re.compile(('^\d+$'))
p2 = re.compile(('\d\d:\... | idf/RecipeIngredients | data_cleaning/raw_data/Eugenie Kitchen/removeTime.py | Python | apache-2.0 | 1,138 |
from Adafruit_BME280 import *
sensor = BME280(mode=BME280_OSAMPLE_8)
degrees = sensor.read_temperature()
pascals = sensor.read_pressure()
hectopascals = pascals / 100
humidity = sensor.read_humidity()
print 'Timestamp = {0:0.3f}'.format(sensor.t_fine)
print 'Temp = {0:0.3f} deg C'.format(degrees)
print 'Pressur... | Zimcoding/Raspy-Telescope | lib/Adafruit_Python_BME280/Adafruit_BME280_Example.py | Python | mit | 408 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import json
import os
import re
import unittest
from django.contrib.admin import AdminSite, ModelAdmin
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.models import ADDITION, DELETION, LogEntry
from... | sarthakmeh03/django | tests/admin_views/tests.py | Python | bsd-3-clause | 284,922 |
#
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2015
# Copyright by UWA (in the framework of the ICRAR)
# All rights reserved
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser G... | steve-ord/daliuge | daliuge-engine/dlg/deploy/pawsey/__init__.py | Python | lgpl-2.1 | 965 |
import shelve
db = shelve.open('people-shelve')
for key in db:
print(key, '=>\n ', db[key])
print(db['sue']['name'])
db.close()
| ordinary-developer/lin_education | books/techno/python/programming_python_4_ed_m_lutz/code/chapter_1/step_2/04_using_shelves/dump_db_shelve.py | Python | mit | 134 |
"""
Implementation of UPGMA (Unweighted Pair Group Method with Arithmetic Mean)
method for building phylogenetic tree
(c) 2014 Urban Soban <u.soban@gmail.com>
Contributors:
Primoz Turnsek <primoz.turnsek@gmail.com>
"""
from pylogen.util.data import import_mega_csv
from pylogen.util.mtx_search import fin... | usoban/pylogenetics | pylogen/treebuilder/upgma.py | Python | mit | 2,612 |
import tensorflow as tf
import numpy as np
import argparse
import model_config
import data_loader
from ByteNet import translator
import utils
import shutil
import time
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--learning_rate', type=float, default=0.001,
help='L... | paarthneekhara/byteNet-tensorflow | train_translator.py | Python | mit | 7,540 |
import random
from random import sample
from traceback import format_exc
import re
from navmazing import NavigateToSibling, NavigateToAttribute
from widgetastic.utils import VersionPick, Version
from widgetastic.widget import Text, View, TextInput
from widgetastic_patternfly import (
SelectorDropdown, Dropdown, Bo... | jkandasa/integration_tests | cfme/containers/provider/__init__.py | Python | gpl-2.0 | 21,949 |
# Generated by Django 1.9.13 on 2018-02-22 15:13
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('documents', '0008_auto_... | UrLab/beta402 | documents/migrations/0009_auto_20180222_1513.py | Python | agpl-3.0 | 1,131 |
#! /usr/bin/python3
# -*- coding: utf-8 -*-
'''
Copyright 2016,暗夜幽灵 <darknightghost.cn@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,... | darknightghost/console-debugger | tui/controls/Treeview.py | Python | gpl-3.0 | 790 |
"""
Module contains tools for processing files into DataFrames or other objects
"""
from __future__ import annotations
from collections import abc
import csv
import sys
from textwrap import fill
from typing import Any
import warnings
import numpy as np
import pandas._libs.lib as lib
from pandas._libs.parsers import ... | gfyoung/pandas | pandas/io/parsers/readers.py | Python | bsd-3-clause | 54,105 |
#!/usr/bin/env python
"""
$ python cmdln_main2.py
This is my shell.
$ python cmdln_main2.py foo
hello from foo
"""
import sys
import cmdln
class Shell(cmdln.RawCmdln):
"This is my shell."
name = "shell"
def do_foo(self, argv):
print("hello from foo")
if __name__ == "__main__":
... | hfeeki/cmdln | test/cmdln_main2.py | Python | mit | 421 |
#!/usr/bin/python3
# Copyright (c) 2015-2016, The Authors and Contributors
# <see AUTHORS file>
# 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 t... | KevinFasusi/supplychainpy | supplychainpy/simulations/monte_carlo.py | Python | bsd-3-clause | 13,665 |
from ._base import PluginBase
class Plugin(PluginBase):
name = 'finder'
doc = 'Finds and returns text from TerminalWidgetSystem data'
methods_subclass = {'in_log': '', 'in_string': '', 'in_list': ''}
def on_import(self, term_system):
self.term_system = term_system
def in_log(self, *text):... | Bakterija/mmplayer | mmplayer/kivy_soil/terminal_widget/plugins/finder.py | Python | mit | 1,399 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
FindProjection.py
-----------------
Date : February 2017
Copyright : (C) 2017 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
*****************... | SrNetoChan/QGIS | python/plugins/processing/algs/qgis/FindProjection.py | Python | gpl-2.0 | 6,023 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
**views.py**
**Platform:**
Windows, Linux, Mac Os X.
**Description:**
Defines
the :class:`sibl_gui.components.core.collections_outliner.collections_outliner.CollectionsOutliner` Component
Interface class Views.
**Others:**
"""
from __future__ impor... | KelSolaar/sIBL_GUI | sibl_gui/components/addons/gps_map/views.py | Python | gpl-3.0 | 4,133 |
from django.db import models
from django.core.urlresolvers import reverse
from model_utils.models import TimeStampedModel
from model_utils import FieldTracker
from webfaction.models import OwnedModel
from .tasks import create_domain, delete_domain, delete_subdomain
class Domain(TimeStampedModel, OwnedModel):
nam... | gfavre/beyondthehost | beyondthehost/domains/models.py | Python | mit | 2,148 |
from sqlobject import *
from sqlobject.tests.dbtest import *
########################################
## Lazy updates
########################################
class Lazy(SQLObject):
class sqlmeta:
lazyUpdate = True
name = StringCol()
other = StringCol(default='nothing')
third = StringCol(defa... | scith/htpc-manager_ynh | sources/libs/sqlobject/tests/test_lazy.py | Python | gpl-3.0 | 5,514 |
2332197
3150739
3160382
3250303
3270620
3438624
3735553
3994496
4202496
4902945
4906628
5004570
5011070
5012606
5019056
5040500
5044893
5046970
5060794
5071729
5085897
5094733
5098909
5100427
5100740
5101938
5102205
5111696
5114030
5115111
5119363
5120740
5121500
5124162
5124265
51258... | ThorsteinnAdal/webcrawls_in_singapore_shippinglane | IMOrobbery/DataCollected/bigList2.py | Python | apache-2.0 | 41,553 |
""" These are PreCanned Reports.
PreCanned Reports are the PyFlag equivalent of the google 'Im Feeling
Lucky' feature - we basically just dump out some simple queries which
are used to get you started.
"""
import pyflag.Reports as Reports
import pyflag.conf
config=pyflag.conf.ConfObject()
import pyflag.Registry as Re... | arkem/pyflag | src/plugins/PreCanned/Basic.py | Python | gpl-2.0 | 5,709 |
from PyQt5.QtCore import QSettings, QStandardPaths
class Settings(QSettings):
defaults = {
'fontCapitalization': 'AllUppercase',
'input': 'keyboard',
'skin': 'default'
}
path = QStandardPaths.writableLocation(QStandardPaths.AppConfigLocation)
fileFormat = QSettings.IniFo... | BrainTech/pisak2 | lib/settings.py | Python | gpl-3.0 | 593 |
'''
produce letter-3-gram representations
'''
with open('../../dataset/ner/eng.train') as tr:
train_sets = tr.read().split('\n')
with open('../../dataset/ner/eng.testa') as ta:
test_setsa = ta.read().split('\n')
with open('../../dataset/ner/eng.testb') as tb:
test_setsb = tb.read().split('\n')
l2g = {}
... | danche354/Sequence-Labeling | preprocessing/ner-l2g/produce_l2g.py | Python | mit | 987 |
# -*- coding: utf-8 -*-
#
# Stac - Smarter Travel Artifactory Client
#
# Copyright 2015-2016 Smarter Travel
#
# Available under the MIT license. See LICENSE for details.
#
"""
stac.client
~~~~~~~~~~~
Interface for clients that interact with Artifactory and implementations of it
for various repository layouts. This mo... | smarter-travel-media/stac | stac/client.py | Python | mit | 13,563 |
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import backend_common.testing
import glob
import json
im... | garbas/mozilla-releng-services | src/shipit_uplift/tests/conftest.py | Python | mpl-2.0 | 3,139 |
#!/usr/bin/env python
"""Simple GTK example to manually test event loop integration.
To run this:
1) Enable the PyDev GUI event loop integration for gtk
2) do an execfile on this script
3) ensure you have a working GUI simultaneously with an
interactive console
"""
if __name__ == '__main__':
import pygtk
p... | mrknow/filmkodi | plugin.video.mrknow/mylib/tests_pydevd_mainloop/gui-gtk.py | Python | apache-2.0 | 840 |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-WMIRegCachedRDPConnection',
'Author': ['@harmj0y'],
'Description': ('Uses remote registry functionality to query all entries for the '
... | EmpireProject/Empire | lib/modules/powershell/situational_awareness/network/powerview/get_cached_rdpconnection.py | Python | bsd-3-clause | 3,168 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.