code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/env python
import os
import sys
import time
import cv2
import numpy as np
from imutils.video import WebcamVideoStream
import vision.cv_utils as cv_utils
from vision.network_utils import put, flush, table, settings_table
from vision.centroid_tracker import CentroidTracker
from . import args
class Vision:... | SouthEugeneRoboticsTeam/vision | vision/app.py | Python | gpl-3.0 | 13,081 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | t-wissmann/qutebrowser | tests/helpers/messagemock.py | Python | gpl-3.0 | 2,866 |
# This file is part of Sibyl.
# Copyright 2014 Camille MOUGEY <camille.mougey@cea.fr>
#
# Sibyl 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 ... | cea-sec/Sibyl | sibyl/test/stdlib.py | Python | gpl-3.0 | 2,517 |
'''
Manager of text selection controls.
Many text selections can be displayed.
One-to-one with text glyphs.
Only one active: receiving keyboard events.
Generally, when the pointer is in a TextMorph.
Note distinction between TextMorph and TextGlyph
'''
'''
Copyright 2010, 2011 Lloyd Konneker
This file is part of Pen... | bootchk/pensool | source/gui/manager/textselect.py | Python | gpl-3.0 | 1,169 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import datetime
import getpass
import os
import random
import sys
import time
import win32gui
from json import load
from platform import uname
from time import sleep
try:
# For Python 3.0 and later
from urllib.request import urlopen
except ImportEr... | pavnguyen/Auto-Clicker | phantom_views.py | Python | gpl-3.0 | 21,001 |
from django.conf.urls import patterns, url
from publications import views
from django.contrib.auth.decorators import login_required
urlpatterns = patterns('',
url(r'^articles/$', views.IndexView.as_view(), name='articleindex'),
# ex: /publications/articles/5/
url(r'^articles/(?P<pk>\d+)/$', views.Article... | andreynech/salutem | publications/urls.py | Python | gpl-3.0 | 1,289 |
# -*- coding: utf-8 -*-
'''
Copyright (c) 2015 Jacob Mendt
Created on 04.08.15
@author: mendt
'''
import os
import uuid
from mapscript import MS_IMAGEMODE_RGB, MS_OFF, MS_PIXELS, MS_LAYER_RASTER, layerObj, mapObj, MS_ON, outputFormatObj
from georeference.utils.exceptions import MapfileBindingInitalizationException
... | slub/vk2-georeference | georeference/utils/process/mapfile.py | Python | gpl-3.0 | 4,870 |
import RPi.GPIO as GPIO
import os
import time
def alert(channel):
global start1
if time.time()-start1 > 30:
start1 = time.time()
print('Motor Failure Detected: Imminent Threat to: Laundry')
os.system("curl -X POST http://textbelt.com/text -d number=4158899309 -d message=\"SOS SMS: Zombi... | pdxfrog/imminentthreat | xxalert.py | Python | gpl-3.0 | 1,015 |
"""
This file contains the map page sub-class
"""
#####################################
# Imports
#####################################
# Python native imports
from PyQt5 import QtCore, QtWidgets, QtGui, QtWebEngine
from PyQt5.QtCore import QUrl
import logging
#####################################
... | caperren/Archives | OSU Robotics Club/Mars Rover 2016-2017/ground_station/Interface/Map/MapCore.py | Python | gpl-3.0 | 1,606 |
from __future__ import print_function
print('Whazzup Mundo!')
print('8=====D~~~~') | mehese/PropertyCheck | helloworld.py | Python | gpl-3.0 | 84 |
# Django
from django.utils.translation import ugettext_lazy as _
ICON_CHOICE = [
("", _("Select an icon")),
("dog-and-a-man", _("dog-and-a-man")),
("dog-and-pets-house", _("dog-and-pets-house")),
("dog-bitting-a-stick-playing-with-a-man", _("dog-bitting-a-stick-playing-with-a-man")),
("dog-checked-... | bengosney/romrescue.org | icons/icons.py | Python | gpl-3.0 | 1,776 |
from kivy.uix.label import Label
from kivy.properties import DictProperty, StringProperty
from kivy.clock import Clock
from kivy.uix.screenmanager import Screen
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.scrollview import ScrollView
from kivy.logger import Logger
import requests
import time
from datetime i... | elParaguayo/RPi-InfoScreen-Kivy | screens/tides/screen.py | Python | gpl-3.0 | 7,469 |
# -*- coding: utf-8 -*-
__author__ = 'Jeffery Tillotson'
__email__ = 'jpt@jeffx.com'
__version__ = '0.1.0'
from .python_roshambo_runner import RoShamBo
| jeffx/python_roshambo_runner | python_roshambo_runner/__init__.py | Python | gpl-3.0 | 154 |
HOST = "wfSciwoncGW:enw1989@172.31.2.76:27001/?authSource=admin"
PORT = ""
USER = ""
PASSWORD = ""
DATABASE = "googlew"
READ_PREFERENCE = "secondary"
WRITE_CONCERN = "majority"
COLLECTION_INPUT = "ratio"
COLLECTION_OUTPUT = "average_ratioevent"
PREFIX_COLUMN = "g_"
ATTRIBUTES = ["event type", "sds from all avg ratio"]... | elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 1B/instances/7_2_workflow_full_10files_secondary_wmj_1sh_3rs_noannot_with_proj_3s/averageratioevent_0/ConfigDB_AverageRatioEvent_0.py | Python | gpl-3.0 | 524 |
#!/usr/bin/env python
'Unit test for trepan.lib.display'
import inspect, unittest
from trepan.lib import display as Mdisplay
class TestLibDisplay(unittest.TestCase):
def test_display(self):
mgr = Mdisplay.DisplayMgr()
self.assertEqual(mgr.list, [], "Initial list empty")
x = 1 # NOQA
... | rocky/python2-trepan | test/unit/test-lib-display.py | Python | gpl-3.0 | 1,169 |
# Import required modules
from random import randint
from time import sleep as wait
done = 0
while done == 0:
# Generate random number between 1 & 100
answer=randint(1,100)
print("Generated new number")
correct = 0
guess = 0
again = "no"
while correct == 0:
guess = int(input("Pleas... | UTC-Coding/Benji-s-Python | Guessing Game.py | Python | gpl-3.0 | 701 |
#!/usr/bin/env python
import configparser
import os
from slackclient import SlackClient
BOT_NAME = 'isitupbot'
config = configparser.ConfigParser()
# CUR_DIR = os.path.abspath('.')
# PAR_DIR = os.path.dirname(CUR_DIR)
# SETTINGS_FILE = os.path.join(PAR_DIR, 'settings.ini')
SETTINGS_FILE = 'settings.ini'
config.re... | prodicus/margo | scripts/print_bot_id.py | Python | gpl-3.0 | 581 |
#-----------------------------------------------------------------------------
# Copyright (c) 2014-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | etherkit/OpenBeacon2 | client/linux-arm/venv/lib/python3.6/site-packages/PyInstaller/hooks/hook-astroid.py | Python | gpl-3.0 | 2,110 |
#!/usr/bin/python3
import random, sys, os
from random import *
from math import pi, floor
seed(floor(pi*1000))
def gen():
vars = randint(10,28);
clauses = randint(1,10);
xclauses = randint(1,clauses);
V = list(range(1,vars))
L = V + list(map(lambda x: x*-1, range(1,vars)))
print("p cn... | wadoon/xorblast | test/gen_test.py | Python | gpl-3.0 | 779 |
#!/usr/bin/python
from review.Asymmetries import *
from ucnacore.PyxUtils import *
def plot_bgSubtrHist(basedir,depth=2):
print "--------------------- Division",depth,"-------------------------"
bgs = {}
n = 0
conn = open_connection()
for af in collectOctetFiles(basedir,depth):
for k in af.bgs:
bgs.setdef... | UCNA/main | Scripts/plotters/BGSubtr.py | Python | gpl-3.0 | 8,434 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class ResCompany(models.Model):
_inherit = 'res.company'
# -------------------------------------------------------------------------
# Sequences
# -------------------------... | jeremiahyan/odoo | addons/stock_dropshipping/models/res_company.py | Python | gpl-3.0 | 5,103 |
#!/usr/bin/env python3
# Author: PabstMirror
# Uploads ace relases to workshop
# Will slice up compats to their own folders
import sys
if sys.version_info[0] == 2:
print("Python 3 is required.")
sys.exit(1)
import os
import os.path
import shutil
import platform
import glob
import subprocess
import hashlib
... | Raspu86/acre2 | tools/publish.py | Python | gpl-3.0 | 13,053 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-07-05 01:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('diarios', '0002_auto_20190618_1523'),
]
operations = [
migrations.AlterFie... | cmjatai/cmj | cmj/diarios/migrations/0003_auto_20190704_2232.py | Python | gpl-3.0 | 521 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | davidam/python-examples | regex/number.py | Python | gpl-3.0 | 3,258 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | mcldev/geonode | geonode/maps/views.py | Python | gpl-3.0 | 47,567 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Questo script è stato realizzato per l'estrazione dei premi messi in
palio dall'associazione PerugiaGNULug durante lo svolgimento
dell'evento Linux Day 2015 svoltosi a Magione.
L'elenco dei partecipanti all'estrazione comprende tutti i
partecipanti all'evento registrati in ... | glugpg/riffa | riffa.py | Python | gpl-3.0 | 4,447 |
import yadtminion
import os
import sys
def load_yadt_defaults():
if os.path.isfile('/etc/yadt.services'):
sys.stderr.write(
"/etc/yadt.services is unsupported, please migrate to "
"/etc/yadt.conf.d : "
"https://github.com/yadt/yadtshell/wiki/Host-Configuration\n")
... | yadt/yadt-minion | src/main/python/yadtminion/configuration.py | Python | gpl-3.0 | 543 |
# coding = "utf-8"
"""
通过命令查询火车票
Usage:
tickets <from> <to> <date>
Examples:
tickets beijing shanghai 2016-09-21
Options:
-h 显示帮助菜单
(-g 高铁
-d 动车
-t 特快
-k 快速
-z 直达)(未实现)
"""
import requests
from docopt import docopt
from stations import stations
from prettytable import PrettyTable
def addColor(color, text... | Ginkgo-Biloba/Misc-Python | tickets/tickets.py | Python | gpl-3.0 | 2,550 |
import urllib2
url = "http://www.ask.com/web?q="
phrase = "butterfly"
w_url = url + phrase
data = urllib2.urlopen(w_url)
html = data.read()
print html
| Duroktar/cookbook | Python/Web Request/request.py | Python | gpl-3.0 | 169 |
#!/usr/bin/env python
import sys
import os
from os.path import dirname, join
import subprocess
from datetime import date, datetime, timedelta
import calendar
import argparse
import math
import re
from input import load_from_csv
import output
import defaults
from daterange import get_date_range, in_range
from invoice ... | kelvan/project_tracker | hours_per_project.py | Python | gpl-3.0 | 4,990 |
#
# This file is part of vaisalad
#
# vaisalad is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# vaisalad is distributed in the hope ... | warwick-one-metre/vaisalad | warwick/observatory/vaisala/__init__.py | Python | gpl-3.0 | 716 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | The-Compiler/qutebrowser | tests/end2end/fixtures/webserver_sub.py | Python | gpl-3.0 | 9,922 |
import requests
import os
import re
class ClAd :
def __init__(self , desc="" , link="" ) :
self.desc=desc
self.link=link
def __lt__(self,x ) :
return self.desc < x.desc
class ClPage :
def __init__(self , adVec , nextPage , title ) :
self.adVec = adVec
self.nextPage... | jrrpanix/master | examples/python/web/webCraigslistExample.py | Python | gpl-3.0 | 2,037 |
import sys
if len(sys.argv) != 2:
print("Usage: python3 " + sys.argv[0] + " [freq_file]")
exit(1)
with open(sys.argv[1]) as f:
correct_string = f.readline()
correct_binary = ""
received_string = ""
received_binary = ""
for line in f:
freqs = line.strip().split(" ")
freqs = list(map(int, freqs))
tmp = ... | Sound-drop/SoundDrop | test.py | Python | gpl-3.0 | 911 |
# Copyright (C) 2014 Vangelis Tasoulas <vangelis@tasoulas.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Th... | cyberang3l/sysdata-collector | libs/parseoptions.py | Python | gpl-3.0 | 23,353 |
# Copyright 2012 VPAC
#
# This file is part of django-placard.
#
# django-placard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# d... | VPAC/django-placard | placard/test/schemas.py | Python | gpl-3.0 | 2,306 |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
# =============================================================================
#
# Dialog implementation generated from a XDL file.
#
# Created: Sat Jul 9 15:06:44 2016
# by: unodit 0.5
#
# WARNING! All changes made in this file will be overwritten
# if the... | kelsa-pi/unodit | examples/convert dialog/src/pythonpath/Test_convert_UI.py | Python | gpl-3.0 | 26,618 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2008-2010 Francisco José Rodríguez Bogado #
# <frbogado@novaweb.es> #
# ... | pacoqueen/cican | formularios/ventana_consulta.py | Python | gpl-3.0 | 35,311 |
# Copyright (C) 2013 Dennis Gosnell
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | cdepillabout/semiautocards | semiauto/dictionary/__init__.py | Python | gpl-3.0 | 897 |
# -*- coding: utf-8 -*-
"""Caliopen disccions index classes.
Discussions are not really indexed, they are result of messages aggregations.
So there is not direct document mapping, only helpers to find discussions
and build a suitable representation for displaying.
"""
from __future__ import absolute_import, print_fu... | CaliOpen/CaliOpen | src/backend/main/py.main/caliopen_main/discussion/store/discussion_index.py | Python | gpl-3.0 | 6,446 |
# Copyright © 2020, Joseph Berry, Rico Tabor (opendrop.dev@gmail.com)
# OpenDrop is released under the GNU GPL License. You are free to
# modify and distribute the code, but always under the same license
#
# If you use this software in your research, please cite the following
# journal articles:
#
# J. D. Berry, M. J. ... | jdber1/opendrop | opendrop/app/ift/report/overview/overview.py | Python | gpl-3.0 | 2,211 |
from random import choice
# If the code is not Cython-compiled, we need to add some imports.
from cython import compiled
if not compiled:
from mazelib.solve.MazeSolveAlgo import MazeSolveAlgo
class RandomMouse(MazeSolveAlgo):
""" This mouse just randomly wanders around the maze until it finds the cheese. """
... | theJollySin/mazelib | mazelib/solve/RandomMouse.py | Python | gpl-3.0 | 1,197 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# res_core_data_NOTES.py
import unittest
import sys
import os
root_folder = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + os.sep + ".." + os.sep + "aikif" )
sys.path.append(root_folder)
import core_data as mod_core
import res_core_data_mthd1
import res_cor... | acutesoftware/AIKIF | scripts/res_core_data_NOTES.py | Python | gpl-3.0 | 1,670 |
# This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | nop33/indico-plugins | previewer_code/indico_previewer_code/plugin.py | Python | gpl-3.0 | 2,952 |
from openerp import api, fields, models
class BusinessType(models.Model):
_name = "crm.business.type"
_rec_name = "business_type"
business_type = fields.Char("Business Type", required=True)
| sumihai-tekindo/helpdesk_sicepat | crm_sicepat/models/business_type.py | Python | gpl-3.0 | 219 |
#!/usr/bin/python
#coding=utf8
"""
# Author: Bill
# Created Time : 2016-07-27 23:18:24
# File Name: mdb_sstat.py
# Description:
"""
import sys
import os
from optparse import OptionParser
import re
import time
import platform
import json
import types
#######Log
import logging
from logging.handlers import RotatingFileH... | BillWang139967/zabbix_templates | template_mongodb/install/conf/mdb_sstat.py | Python | gpl-3.0 | 16,439 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | lpirl/ansible | lib/ansible/executor/task_executor.py | Python | gpl-3.0 | 32,789 |
from yanntricks import *
def ContourGreen():
pspict,fig = SinglePicture("ContourGreen")
x=var('x')
contour=PolarCurve(1+cos(x)*sin(x)).graph(0,2*pi)
contour.put_arrow([i*pi/4+0.5 for i in range(0,8)])
pspict.DrawGraphs(contour)
fig.conclude()
fig.write_the_file()
| LaurentClaessens/mazhe | src_yanntricks/yanntricksContourGreen.py | Python | gpl-3.0 | 295 |
import time
import webbrowser
import json
import wx
import requests
from service.port import Port
from service.fit import Fit
from eos.types import Cargo
from eos.db import getItem
from gui.display import Display
import gui.globalEvents as GE
if 'wxMac' not in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.V... | Ebag333/Pyfa | gui/crestFittings.py | Python | gpl-3.0 | 15,015 |
#!/usr/bin/python
import subprocess
# this script gets called regularly by cron and runs as the unprivileged exhibit user
if __name__ == '__main__':
# pull latest changes from git
# will throw and exit on error (e. g. if network connection is down)
subprocess.check_call("git pull", shell=True)
| wmde/MSWissenschaft | update/update-appusr.py | Python | gpl-3.0 | 317 |
#!/usr/bin/python
# coding: utf-8
import json
import logging
import os.path
import sys
import time
import urllib
import urllib2
import settings
import backends
import utils.dictconfig
POST_SYNC_SECRET = SYNC_SECRET = urllib.urlencode((("secret", settings.SYNC_SECRET),))
def init_logging():
"""
Set up loggi... | opinnmr/stjornbord-user-daemon | main.py | Python | gpl-3.0 | 3,955 |
import cgi
import wsgiref.handlers
import os
#import admin
import mewantee
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
class MainPage(webapp.RequestHandler):
def get(self):
user = users.get_current_user()
(account, url_link... | lucasw/mewantee | mewanteee/home.py | Python | gpl-3.0 | 1,557 |
import mwclient
import mwparserfromhell
import sys
import json
import unidecode
from bs4 import BeautifulSoup
from pymongo import MongoClient
useragent = "MW Database update bot 0.1, Run by Paul.Andrel@kantarmedia.com"
site = mwclient.Site('172.18.64.38', '/', clients_useragent=useragent)
site.login('pandrel', '4357p... | stavlor/sitesheets-database | process-page.py | Python | gpl-3.0 | 2,539 |
#!/usr/bin/env python
import os
import i3
import sys
import pickle
PATH = "/home/stabjo/.config/i3/workspace_mapping"
def showHelp():
print(sys.argv[0] + " [save|restore]")
if __name__ == '__main__':
if len(sys.argv) < 2:
showHelp()
sys.exit(1)
if sys.argv[1] == 'save':
pickle... | StaffanOB/dotfiles | scripts/i3plug.py | Python | gpl-3.0 | 964 |
"""Access FTDI hardware.
Contents
--------
:class:`Error`
Base error class.
:class:`DeviceNotFoundError`
Raised when device is not connected.
:class:`DeviceError`
Raised for generic pylibftdi exceptions.
:class:`ReadError`
Raised on read errors.
:class:`WriteError`
Raised on write errors.
:cl... | HiSPARC/pysparc | pysparc/ftdi_chip.py | Python | gpl-3.0 | 6,785 |
# -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2014-2020)
#
# This file is part of GWpy.
#
# GWpy 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)... | gwpy/gwpy | gwpy/frequencyseries/tests/test_frequencyseries.py | Python | gpl-3.0 | 10,888 |
import networkx as nx
from riaa import riaa_labels
from copy import copy
class Graph():
def __init__(self):
self.db = nx.MultiDiGraph()
self.rel_rules = {
"label ownership": (1, 0, "owned_by"),
"label reissue": (1, 0, "catalog_reissued_by"),
"label rename": (0,... | frelsi/riaapath | lib/graph.py | Python | gpl-3.0 | 3,205 |
import math
import unittest
from datetime import datetime, time, timedelta, tzinfo
from asynctest.mock import patch
from tests.unittest.base_custom import TestCustomField
# Needs to be imported last
from lib.data import timezones
from lib.data.timedelta import format
from ..custom import countdown
class TimeZone(... | MeGotsThis/BotGotsThis | pkg/custom_command/tests/test_custom_countdown.py | Python | gpl-3.0 | 84,145 |
"""Users API tests."""
from rest_framework import status
from tests.utils.api import HyperlinkedAPITestCase
from users.factory import UserFactory
from users.serializers import UserSerializer
class UserEndpointsTest(HyperlinkedAPITestCase):
"""Test access to the users endpoints."""
factory = UserFactory
... | oser-cs/oser-website | tests/test_users/test_user_api.py | Python | gpl-3.0 | 920 |
"""
whois.py
Provides a command to allow users to look up information on domain names.
"""
from contextlib import suppress
import pythonwhois
from cloudbot import hook
@hook.command
def whois(text):
"""<domain> -- Does a whois query on <domain>."""
domain = text.strip().lower()
try:
data = pyt... | paris-ci/CloudBot | plugins/whois.py | Python | gpl-3.0 | 985 |
"""
tmdbsimple.py is a wrapper for The Movie Database API.
Refer to the official API documentation for more information.
http://docs.themoviedb.apiary.io/
Created by Celia Oakley on 2013-10-31.
"""
import json
import lib.requests as requests
class TMDB:
def __init__(self, api_key, version=3):
TMDB.api_ke... | jetskijoe/SickGear | lib/tmdb_api/tmdb_api.py | Python | gpl-3.0 | 29,528 |
from MESH import SimulationPlanar
s = SimulationPlanar()
s.AddMaterial("GaAs", "GaAs.txt")
s.AddMaterial("Vacuum", "Vacuum.txt")
s.AddMaterial("PEC", "PEC.txt")
s.AddLayer("PECBottom", 0, "PEC")
s.AddLayer("GaAsBottom", 1e-6, "GaAs")
s.AddLayer("VacGap", 1e-8, "Vacuum")
s.AddLayerCopy("GaAsTop", "GaAsBottom")
s.AddLa... | kfrancischen/MESH | examples/iterate_over_gap/iterate.py | Python | gpl-3.0 | 590 |
import numpy
# From: https://stackoverflow.com/questions/14177744/how-does-perspective-transformation-work-in-pil
from PIL import Image
def find_coeffs(pa, pb):
"""
pa and pb contain 4 corresponding points on image in order UL,UR,LR,LL
UL=(0,0), UR=(w,0), LR=(w,h), LL=(0,h)
Units for pa and pb are... | sonofeft/DigiPlot | digiplot/examples/fix_distortion.py | Python | gpl-3.0 | 2,359 |
# -*- coding: utf-8 -*-
# Copyright (C) 2005 Osmo Salomaa
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pr... | otsaloma/gaupol | gaupol/dialogs/duration_adjust.py | Python | gpl-3.0 | 6,650 |
# How to generate a secret key with Python
# via http://flask.pocoo.org/docs/quickstart/
import os
os.urandom(24)
| migueib17/IV-PLUCO-MFF | secretkey.py | Python | gpl-3.0 | 115 |
from django.contrib import admin
from django.utils.translation import ugettext as _
from notifications.admin import NotificationAdmin
from notifications.models import Notification
admin.site.unregister(Notification)
def mark_as_read_action(modeladmin, request, queryset):
queryset.mark_all_as_read()
mark_as_re... | auto-mat/klub | apps/notifications_edit/admin.py | Python | gpl-3.0 | 1,049 |
# -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany
... | erangre/Dioptas | dioptas/model/util/__init__.py | Python | gpl-3.0 | 1,109 |
#
# Tuxemon
# Copyright (c) 2014-2017 William Edwards <shadowapex@gmail.com>,
# Benjamin Bean <superman2k5@gmail.com>
#
# This file is part of Tuxemon
#
# 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
#... | Tuxemon/Tuxemon | tuxemon/event/actions/npc_run.py | Python | gpl-3.0 | 1,572 |
import numpy as np
import trep
# set mass, length, and gravity:
m = 1.0; l = 1.0; g = 9.8;
# create system
system = trep.System()
# define frames
frames = [
trep.rz("theta_1", name="Link1"), [
trep.ty(-l, name="Mass1", mass=m), [
trep.rz("theta_2", name="Link2"), [
trep.ty(-l,... | MurpheyLab/trep | examples/papers/acc2010/acc2010.py | Python | gpl-3.0 | 3,162 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
sys.path += ['../']
from mingus.containers.Note import Note
import unittest
from mingus.containers.mt_exceptions import NoteFormatError
class test_Note(unittest.TestCase):
def setUp(self):
self.c = Note('C', 5)
self.c1 = Note('C')
self.... | anthonyt/mingus-counterpoint | unittest/test_Note.py | Python | gpl-3.0 | 4,038 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-18 04:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('edu_warning', '0004_auto_20171017_2227'),
]
operations = [
migrations.AddFi... | ran777/edu_intell | edu_warning/migrations/0005_questionnaire_status.py | Python | gpl-3.0 | 463 |
# -*- coding:utf8 -*-
#!/usr/bin/python
# Python: 3.5.1
# Platform: Windows
# Author: Heyn (heyunhuan@gmail.com)
# Program: weChat
# History: 2016-09-24
import os
import re
import sys
import time
import json
import random
import urllib
import urllib.request
import urllib.parse
# pip install requests 2016-09-29
i... | Heyn2016/Python | Python/weChat.py | Python | gpl-3.0 | 39,533 |
from . import application
| TheFadeliskOrganization/fadelisk | lib/python/fadelisk/__init__.py | Python | gpl-3.0 | 27 |
from __future__ import print_function
from runtests.mpi import MPITest
from numpy.testing import assert_allclose
from numpy.testing import dec
import fastpm
try:
import nbodykit
nbodykit.setup_logging('debug')
except ImportError:
nbodykit = None
@MPITest([1, 4])
@dec.skipif(nbodykit is None, "nbodykit t... | rainwoodman/fastpm-python | fastpm/tests/test_nbkit.py | Python | gpl-3.0 | 1,058 |
from distutils.command.clean import clean
import logging
import os
from crispy_forms.bootstrap import Alert, InlineRadios
from crispy_forms.layout import (HTML, Button, Field, Fieldset,
Layout, Row, Div)
from django import forms
from django.conf import settings
from django.contrib.con... | cmjatai/cmj | sapl/materia/forms.py | Python | gpl-3.0 | 127,700 |
import pytest
from kulka.request import Sleep
def test_example_input():
expected = bytearray([0xFF, 0xFF, 0x00, 0x22, 0x00, 0x06,
0x04, 0xD2, 0x38, 0x1E, 0xD2, 0xD9])
request = Sleep(1234, 56, 7890)
assert request.tobytes() == expected
@pytest.mark.randomize(arg2=int, min_num=0... | TNT-Samuel/Coding-Projects | Kulka - Sphero/kulka-master/test/requests/sleep_test.py | Python | gpl-3.0 | 1,223 |
#!/usr/bin/python
import optparse
import datetime
import sys
import SeqIterator
"""
This program takes a SAM file and a FASTQ file as input. It prints out fastq file records
where the fastq id matches some QNAME in the SAM file.
@author: Jacob Porter
"""
def samMatchFASTQ(sam_file, fasta_file):
sam_dictionary = ... | JacobPorter/BisPin | Utilities/samFASTQmatcher.py | Python | gpl-3.0 | 2,119 |
# -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | dnjohnstone/hyperspy | hyperspy/_signals/eds.py | Python | gpl-3.0 | 45,061 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import string
import os
import sys
import inspect
import api
from core._time import now
def default_paths():
"""
home path for the framework
Returns:
a JSON contain the working, tmp and results path
"""
return {
"home_pa... | Nettacker/Nettacker | core/config_builder.py | Python | gpl-3.0 | 4,563 |
import traceback
import asyncio
import time
from inspect import signature, getfullargspec
import discord
from discord.ext import commands
from discord.ext.commands.view import StringView
from meowth import errors
from meowth.core.context import Context
from .cog_base import Cog
async def delete_error(message, error... | FoglyOgly/Meowth | meowth/core/error_handling.py | Python | gpl-3.0 | 22,798 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Sylvain Boily
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This ... | sboily/xivo-webi-plugins | xivo_webi_plugins/bootstrap/plugin.py | Python | gpl-3.0 | 981 |
"""Define custom widget as countdown control panel."""
import logging
from PyQt5.QtCore import QDateTime, Qt, QTime
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import (QAction, QCheckBox, QDateTimeEdit, QGridLayout,
QLabel, QLineEdit, QMenu, QPushButton,
... | teampheenix/StarCraft-Casting-Tool | scctool/view/countdown.py | Python | gpl-3.0 | 7,158 |
import pkg_resources
__version__ = pkg_resources.get_distribution('jiffybox').version
__author__ = 'Amadeus IT Group (opensource@amadeus.com)'
| AmadeusITGroup/python-jiffybox | jiffybox/__init__.py | Python | gpl-3.0 | 144 |
# -*- coding: utf-8 -*-
'''
diacamma.accounting.system package
@author: Laurent GAY
@organization: sd-libre.fr
@contact: info@sd-libre.fr
@copyright: 2015 sd-libre.fr
@license: This file is part of Lucterios.
Lucterios is free software: you can redistribute it and/or modify
it under the terms of the GNU General Publi... | Diacamma2/financial | diacamma/accounting/system/__init__.py | Python | gpl-3.0 | 2,277 |
#!/usr/bin/env python
"""
===================================================================
heatController.py - Potential Field Region-to-Region Motion Control
===================================================================
Uses the heat-controller to take a current position, current region, and destination regi... | jadecastro/LTLMoP | src/lib/handlers/motionControl/heatController.py | Python | gpl-3.0 | 4,678 |
Create({
"Endpoint": "localhost:7784/core",
})
| takeshik/metatweet-old | resource/configuration/WcfNetTcpServant-wcf.conf.py | Python | gpl-3.0 | 51 |
from contrib.rfc3736.builder import *
from contrib.rfc3736.constants import *
from contrib.rfc3736.dhcpv6 import DHCPv6Helper
from scapy.all import *
from veripy.assertions import *
class DUIDFormatTestCase(DHCPv6Helper):
"""
DUID Format
Verify that a client device sends correctly formatted Client ID... | mwrlabs/veripy | contrib/rfc3736/client/client_dhcp_unique_identifier.py | Python | gpl-3.0 | 1,578 |
# vi: ts=4 expandtab
#
# Copyright (C) 2011 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This program is free software: you can redistribute it and/or modify
# it... | clovertrail/cloudinit-bis | cloudinit/config/cc_scripts_per_boot.py | Python | gpl-3.0 | 1,760 |
"""
WSGI config for pasteque_admin project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | ScilCoop/pasteque-admin | pasteque_admin/pasteque_admin/wsgi.py | Python | gpl-3.0 | 405 |
import requests
import sys
import hashlib
from notify import notify_message
import os
from subprocess import Popen, PIPE
import time
class Web(object):
def __init__(self, login_url, username, password):
self.login_url = login_url
self.username = username
self.password = password
def... | kumarasinghe/moodle-monitor | MoodleMonitor/usr/share/moodle-monitor/moodled/web.py | Python | gpl-3.0 | 1,599 |
from users.models import DyeusUser
from faker import Faker
fake = Faker()
def create_regular_dyeus_user():
user = DyeusUser(username=fake.user_name(),
email=fake.email(),
password=fake.password())
user.save()
return user
| piotrb5e3/Dyeus | users/tests/factory.py | Python | gpl-3.0 | 278 |
import re
from collections import defaultdict
from pupa.scrape import Scraper, Bill, VoteEvent
from .util import get_client, get_url, backoff, SESSION_SITE_IDS
# Methods (7):
# GetLegislationDetail(xs:int LegislationId, )
#
# GetLegislationDetailByDescription(ns2:DocumentType DocumentTy... | openstates/openstates | openstates/ga/bills.py | Python | gpl-3.0 | 10,170 |
import os
from gpaw import GPAW, restart
from ase import Atoms
from gpaw.test import equal
from gpaw.mpi import world, rank
from math import sqrt
import numpy as np
# Test the reading of wave functions as file references
modes = ['gpw']
try:
import _hdf5
modes.append('hdf5')
except ImportError:
pass
d = ... | ajylee/gpaw-rtxs | gpaw/test/fileio/file_reference.py | Python | gpl-3.0 | 1,309 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns, data = [], []
columns=get_columns()
data=get_data(filters,columns)
return columns, da... | rohitwaghchaure/erpnext_develop | erpnext/stock/report/item_price_stock/item_price_stock.py | Python | gpl-3.0 | 3,200 |
import os
import re
import shutil
from tempfile import TemporaryDirectory
import click
from .ingest import ingest_file, ensure_album_dir
@object.__new__
class unpack:
"""The album unpacker dispatcher.
"""
_map = {}
def register(self, source, *, infer_album, infer_artist):
def _(f):
... | llllllllll/witchcraft | witchcraft/unpack.py | Python | gpl-3.0 | 4,993 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Setup.technique'
db.delete_column(u'feed_setup', 'techn... | Squishymedia/feedingdb | src/feeddb/feed/migrations/0083_auto__del_field_setup_technique.py | Python | gpl-3.0 | 41,413 |
#!/usr/bin/env python
# Author: Prathamesh Shivade
# A quick (read 15 min) BFS web crawler written for a college assignment
from collections import deque
from bs4 import BeautifulSoup
from urlparse import urljoin
import sys
import urllib2
# Read URL from command line
url = sys.argv[1]
print "==================="
pr... | matharp/bfs-crawler | web-crawler.py | Python | gpl-3.0 | 1,659 |
# -*- coding: utf-8 -*-
import os, pickle, sys, datetime, random
from core.message_factory import MsgState, Message, MessageFactory
import uuid
from PySide import QtGui
from PySide import QtCore
from PySide.QtCore import *
from PySide.QtGui import *
from gui.notes import SolidNote
from gui.utils import pea_app
from... | kliput/peanotes | gui/main_gui.py | Python | gpl-3.0 | 7,981 |
#!/usr/bin/env python
import sys
import os
sys.path.append(os.path.abspath("/Projects/OpenStackAdapter"))
import novaclient.v2.client as nvclient
from Logger import VMLogger
import Auth
class OpenStackAdapterVMStatus(object):
_objLogs = VMLogger()
def GetServerStatus(self, UserName, CustomerNam... | omermahgoub/MigTool | common/VMStatus.py | Python | gpl-3.0 | 1,061 |
#!/usr/bin/env python
#encoding:utf-8
''' test_pyhello.py -- unit testing of pyhello program
Copyright 2015 Ing María Andrea Vignau <mavignau@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... | UniversidadDelEste/hello | MAVignau/src/test_pyHello.py | Python | gpl-3.0 | 1,960 |