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
# -*- coding: utf-8 -*-
import sys
### auteur: Ward De Ridder
### bedoeling: regelmatige werkwoorden op -cer vervoegen in het Frans
werkwoord = input("Werkwoord: ")
#werkwoord = developper
stam = werkwoord[:-3]
FILE = open(werkwoord+".txt","w",encoding='utf-8')
begin = "{{-start-}}\n"
eind =... | warddr/wiktionary-frverb | verb-ger.py | Python | gpl-3.0 | 6,287 |
import logging
from typing import List
import numpy as np
import torch
import torch.nn as nn
from pinta.model.model_base import NN
LOG = logging.getLogger("ConvRNN")
class ConvRNN(NN):
"""
Combination of a convolutional front end and an RNN (GRU) layer below
>> see https://gist.github.com/spro/c87cc706... | blefaudeux/Pinta | pinta/model/model_rnn.py | Python | gpl-3.0 | 2,323 |
from django import forms
attr = {'class': 'form-control'}
class GroupSeedForm(forms.Form):
seed = forms.CharField(label='Seed', max_length=1337, initial='none', widget=forms.TextInput(attrs=attr))
class UserSeedForm(forms.Form):
pseudonym = forms.CharField(label='Pseudonym', min_length=3, widget=forms.TextIn... | ZenifiedFromI2P/antisocial | bootstraps/forms.py | Python | gpl-3.0 | 426 |
import numpy as np
from ase import Atoms
from gpaw import GPAW, FermiDirac
from gpaw.response.df import DielectricFunction
from gpaw.test import equal, findpeak
GS = 1
ABS = 1
if GS:
cluster = Atoms('Au2', [(0, 0, 0), (0, 0, 2.564)])
cluster.set_cell((6, 6, 6), scale_atoms=False)
cluster.center()
calc ... | robwarm/gpaw-symm | gpaw/test/au02_absorption.py | Python | gpl-3.0 | 2,114 |
from .Peaks import Peaks
from .Amplitude import Amplitude
from .Combination import Combination
from .OutputFrame import OutputFrame
from .Track import Track
from .panels import Panel
import bpy
class SingleTrack(
bpy.types.PropertyGroup,
Panel,
Track,
Amplitude,
Combination,
OutputFrame,
Peaks
):
''' ... | CaptainDesAstres/Frames-Animated-By-Curve | single_track/SingleTrack.py | Python | gpl-3.0 | 1,451 |
from collections import deque
import os.path
import pygame
from pygame.locals import QUIT, KEYDOWN, K_a, K_s, K_d, K_w, KEYUP, K_p, K_ESCAPE, K_y, K_n, K_g
from pygame import time, display, mixer, transform
from img import load_img
from render import update_display
from player import Player
from background import Bac... | Roolymoo/comprev | src/main.py | Python | gpl-3.0 | 18,714 |
import os
import time
from gi.repository import Gtk
import solfege
from solfege.profilemanager import ChangeProfileDialog
from solfege.practisesheetdlg import PractiseSheetDialog
from solfege.trainingsetdlg import TrainingSetDialog
def run(cmd):
print cmd
os.system(cmd)
def compress(fn):
f, ext = os.p... | yuanyelele/solfege | solfege/make_screenshots.py | Python | gpl-3.0 | 6,516 |
import pywt
def dwt(data):
print data
return pywt.dwt2(data, 'haar')
a = [[4, 4, 3, 3], [4, 4, 3, 3], [2, 2, 1, 1], [2, 2, 1, 1]]
print dwt(a)
| CoderSherlock/jls_555 | src/jp2/test.py | Python | gpl-3.0 | 154 |
# Import statements
import re
import os
from math import pi, radians
import bpy
"""To Run in Blender:
filename = 'C:\\Users\\mFry2\\Google Drive\\PCT\\position_hand.py'
exec(compile(open(filename).read(), filename, 'exec'))
"""
# Function to translate handshape coding to degrees of rotation, adduction, flexion
def t... | PhonologicalCorpusTools/SLP-Annotator | bin/position_hand.py | Python | gpl-3.0 | 8,676 |
# benchmark_writer.py ---
#
# Filename: benchmark_writer.py
# Description:
# Author: Subhasis Ray
# Maintainer:
# Created: Wed Sep 3 10:22:50 2014 (+0530)
# Version:
# Last-Updated:
# By:
# Update #: 0
# URL:
# Keywords:
# Compatibility:
#
#
# Commentary:
#
#
#
#
# Change log:
#
#
# ... | nsdf/nsdf | benchmark/benchmark_writer.py | Python | gpl-3.0 | 13,434 |
#!/usr/bin/env python
# This file is part of OpenGossip.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
# option) any later version. This... | adrien-mogenet/opengossip | src/python/analyzer/hierarchical-clustering.py | Python | gpl-3.0 | 7,280 |
#!/usr/bin/python
#Python version: bubble sort algorithm
import random
def bubble_sort(numbers):
for j in xrange(len(numbers) - 1, -1, -1):
for i in xrange(j):
if numbers[ i ] > numbers[ i + 1 ]:
numbers[ i ], numbers[ i + 1 ] = numbers[ i + 1], numbers[ i ]
print n... | Carryzhou/MyPython- | bubble_sort.py | Python | gpl-3.0 | 511 |
from app.lib import livestatus
from app import app
enabled_sites = app.config['SITES']
live = livestatus.MultiSiteConnection(enabled_sites)
| smlacombe/sageo | app/lib/livestatusconnection.py | Python | gpl-3.0 | 142 |
# -*- coding: utf-8 -*-
{
"name": "Sale Order Line Edit",
"summary": "Edit Sale Order Form",
"version": "9.0.0.1.1",
"category": "Sales",
"website": "http://www.toyo-kiki.co.jp",
"author": "ichi",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"sale",
],
"data": [
"views/... | ichi23de5/ichi_Repo | sale_order_line_edit/__openerp__.py | Python | gpl-3.0 | 342 |
import unittest
import time
from motherbrain.workers.monitor import MBObjectMonitor, MBMonitorMixin
class TestMBObjectMonitor(unittest.TestCase):
def test_track(self):
mon = MBObjectMonitor()
mon.track('foo-event')
mon.track('bar-event')
mon.track('foo-event')
foo_count ... | urlist/urlist | motherbrain/tests/monitor.py | Python | gpl-3.0 | 3,107 |
__author__ = 'russellrichie'
import nltk, re
from nltk.tree import *
from nltk.draw import tree
from random import choice
from nltk import CFG
"""
Paste the students' grammar between the quotes below. Use the site below to turn
http://textmechanic.com/Find-and-Replace-Text.html
"""
grammar = """
CP -> VP DP PP
V... | drussellmrichie/TATools | COGSTools/psgQ4Tester.py | Python | gpl-3.0 | 1,386 |
# Dots - A braille translation program.
#
# Copyright (C) 2010 Consorcio Fernando de los Rios
# Author: Fernando Herrera <fherrera@onirica.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,... | GNOME/dots | dots/document.py | Python | gpl-3.0 | 1,096 |
# uArm Swift Pro - Python Library Example
# Created by: Richard Garsthagen - the.anykey@gmail.com
# V0.3 - June 2018 - Still under development
#
# Use Python 2.x!
import uArmRobot
import time
import easycv2
points = []
coins = []
totalP = 4
speed = 80
#Configure Serial Port
serialport = "com10" # for window... | AnykeyNL/uArmProPython | test/release_test.py | Python | gpl-3.0 | 1,108 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2022 Daniel Estevez <daniel@destevez.net>
#
# This file is part of gr-satellites
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
from gnuradio import gr, blocks, gr_unittest
import numpy as np
import pmt
# bootstrap satellites module, even from build dir
try... | daniestevez/gr-satellites | python/qa_crc.py | Python | gpl-3.0 | 6,774 |
#!/usr/bin/env python
from binary_tools.constants import *
from binary_tools.binary import kicks
from binary_tools.binary.orbits import *
import matplotlib.pyplot as plt
from scipy.stats import maxwell
from scipy.integrate import quad
import random as rd
import numpy as np
__author__ = "Kaliroe Pappas"
__credits__ = [... | orlox/binary_tools | binary/tests/test_kicks.py | Python | gpl-3.0 | 32,399 |
# coding=utf-8
'''
xssbot 必须具有以下功能
1.可对指定url进行访问
2.拦截alert等框框
3.拦截页内跳转
4.锁定设定cookies(未实现)
在EditThisCookie的chrome扩展中使用扩展特有的接口实现
chrome.cookies.onChanged.addListener
但在https://chromedevtools.github.io/devtools-protocol/文档中并没有相关类似功能、
'''
from chromeremote import ChromeTabThread as ChromeTab
... | sadnoodles/chromeremote | examples/xssbot.py | Python | gpl-3.0 | 2,168 |
import cgi
from urllib import urlencode
from Rss_channel import Rss_channel
from Rss_item import Rss_item
class Updates_rss( Rss_channel ):
def __init__(
self,
recent_notes,
notebook_id,
notebook_name,
https_url,
):
if notebook_name == u"Luminotes":
notebook_path = u"/"
elif note... | osborne6/luminotes | view/Updates_rss.py | Python | gpl-3.0 | 1,836 |
#!/usr/bin/env python
import roslib; roslib.load_manifest('master_monitor')
import rospy
from rosgraph_msgs.msg import Log
from syscall import runCmd, runCmdOutput
from move_base_msgs.msg import MoveBaseGoal, MoveBaseAction
from geometry_msgs.msg import PoseStamped
import actionlib
import numpy as np
class ControlMod... | aslab/rct | higgs/trunk/code/ROS/metacontrol/master_monitor/src/master_monitor.py | Python | gpl-3.0 | 3,374 |
from collections import OrderedDict
import datetime
import os
import sys
from peewee import *
db = SqliteDatabase('diary.db')
class Entry(Model):
content = TextField()
timestamp = DateTimeField(default=datetime.datetime.now)
class Meta:
database = db
def initialize():
"""Create a table i... | jcchoiling/learningPython | treehouse/pythonSeries/diary.py | Python | gpl-3.0 | 2,264 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...sharedstrings import SharedStringTable
from ...... | ivmech/iviny-scope | lib/xlsxwriter/test/sharedstrings/test_sharedstrings02.py | Python | gpl-3.0 | 1,907 |
# Headlights testing
# Designed to be run by Travis CI. Should work for humans too, we suppose. But humans? Bleh.
# Remember to set the HEADLIGHTS_TESTMODE and HEADLIGHTS_DPKEY env-vars before testing.
import tests.configuration, tests.printer, tests.server, tests.plugins
import main
try:
# Run the configuration ... | mashedkeyboard/Headlights | runtests.py | Python | gpl-3.0 | 1,771 |
# Copyright 2013 Allen Institute
# This file is part of dipde
# dipde 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.
#
# dipde is di... | nicain/dipde_dev | dipde/internals/internalpopulation.py | Python | gpl-3.0 | 20,747 |
# Outspline - A highly modular and extensible outliner.
# Copyright (C) 2011-2014 Dario Giovannetti <dev@dariogiovannetti.net>
#
# This file is part of Outspline.
#
# Outspline 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 Softw... | xguse/outspline | src/outspline/conf/core.py | Python | gpl-3.0 | 1,547 |
from pupa.scrape import Scraper, Organization
import lxml.html
HI_URL_BASE = "http://capitol.hawaii.gov"
def get_chamber_url(chamber):
chamber_code = {'upper': 'S', 'lower': 'H'}[chamber]
URL = "%s/committees/committees.aspx?chamber=%s" % (HI_URL_BASE, chamber_code)
return URL
class HICommitteeScrap... | votervoice/openstates | openstates/hi/committees.py | Python | gpl-3.0 | 2,141 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
from scrapy.item import Item, Field
class SpiderItem(Item):
# define the fields for your item here like:
# name = scrapy.Field()
brand = Field()
name ... | LaveyD/spider | spider/items.py | Python | gpl-3.0 | 957 |
# -*- coding: utf-8 -*-
# Coh-Metrix-Dementia - Automatic text analysis and classification for dementia.
# Copyright (C) 2014 Andre Luiz Verucci da Cunha
#
# 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 F... | andrecunha/coh-metrix-dementia | coh/database.py | Python | gpl-3.0 | 9,555 |
#!/usr/bin/python2.7
# Run this script as user: www-data
import os
import server_path
import squeakspace.server.db_sqlite3 as db
import config
try:
os.remove(config.db_path)
except OSError:
pass
conn = db.connect(config.db_path)
c = db.cursor(conn)
db.make_db(c, config.total_quota)
db.commit(conn)
db.close(c... | eek6/squeakspace | admin/init_server_db.py | Python | gpl-3.0 | 325 |
import ntpath
import os
import steam
import zipfile
import shutil
from subprocess import check_call, CalledProcessError
from flask import flash, current_app, abort
from PIL import Image
from io import BytesIO
from werkzeug.utils import secure_filename
from ..tf2.models import all_classes, TF2BodyGroup, TF2EquipRegion
f... | Smashman/mods.tf | app/utils/utils.py | Python | gpl-3.0 | 11,564 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Janice Cheng
x = "There are %d types of people." %10
binary = "binary"
do_not = "don't"
y = "Those who know %s and those who %s." %(binary,do_not)
print(x)
print(y)
print("I said: %r." %x)
print("I also said: '%s'." %y)
hilarious = False
joke_evaluation = "Isn... | jcchoiling/learningPython | books/learn-python-the-hard-way/ex6_Strings_and_Text.py | Python | gpl-3.0 | 668 |
# This file is part of django-ca (https://github.com/mathiasertl/django-ca).
#
# django-ca 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... | mathiasertl/django-ca | ca/django_ca/acme/messages.py | Python | gpl-3.0 | 2,539 |
# -*- coding: utf-8 -*-
"""
Read Tweetworks API users from XML responses.
Nicolas Ward
@ultranurd
ultranurd@yahoo.com
http://www.ultranurd.net/code/tweetworks/
2009.06.19
"""
"""
This file is part of the Tweetworks Python API.
Copyright © 2009 Nicolas Ward
Tweetworks Python API is free software: you can redistribut... | UltraNurd/tweetworks-py | tweetworks/User.py | Python | gpl-3.0 | 3,623 |
UNKNOWN = 0
# kinds of figures
PAWN = 1
ROOK = 2
KNIGHT = 3
BISHOP = 4
QUEEN = 5
KING = 6
FIGURES = {
PAWN: 'pawn',
ROOK: 'rook',
KNIGHT: 'knight',
BISHOP: 'bishop',
QUEEN: 'queen',
KING: 'king',
}
# colors of figures
WHITE = 1
BLACK = 2
COLORS = {
WHITE: 'white',
BLACK:... | AHAPX/dark-chess | src/consts.py | Python | gpl-3.0 | 2,048 |
#!/usr/bin/env python3
import sys
from util import proctal_cli, sleeper
class Error(Exception):
pass
class TestSingleValue:
def __init__(self, type, value):
self.type = type
self.value = value
pass
def run(self, guinea):
address = proctal_cli.allocate(guinea.pid(), self.v... | daniel-araujo/proctal | src/cli/tests/write-binary.py | Python | gpl-3.0 | 1,310 |
from tkinter import *
# from tkinter.font import *
import math
CW = 800
CH = 600
SENT_H = 50
Y_OFF = 10
X_OFF = 20
DIM_GAP = 10
DIM_OFF = 70
class Multigraph(Canvas):
"""Canvas for displaying the multigraph for a sentence."""
node_rad = 3
def __init__(self, parent, width=CW, height=CH, nnodes=9,
... | LowResourceLanguages/hltdi-l3 | l3xdg/graphics.py | Python | gpl-3.0 | 10,943 |
# This is a hack to disable GDAL support in GeoDjango. It seems there is no
# easier way due to the GDAL_LIBRARY_PATH setting not behaving as documented
# (i.e. setting it to a non-existent file will disable GDAL). Disabling GDAL is
# unfortunately needed, because it breaks TIFF support for pgmagick, which is
# require... | catsop/CATMAID | django/lib/custom_postgresql_psycopg2/__init__.py | Python | gpl-3.0 | 1,268 |
from django.core.management.base import BaseCommand
from radioco.apps.radioco.utils import create_example_data
class Command(BaseCommand):
def handle(self, *args, **options):
create_example_data()
| txenoo/django-radio | radioco/apps/radioco/management/commands/create_example_data.py | Python | gpl-3.0 | 212 |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import re
from flask import abort, redirect, request
from werkzeug.exceptions import NotFound
from indic... | DirkHoffmann/indico | indico/modules/categories/compat.py | Python | gpl-3.0 | 1,374 |
#!/usr/bin/env python3
# ----------------------------------------------------------------------------------------
# Import Modules
# ----------------------------------------------------------------------------------------
import sys
import setuptools
platform = setuptools.distutils.util.get_platform()
build_path = ... | eengl/pytdlpack | test/test_create_new_station.py | Python | gpl-3.0 | 1,846 |
#!/usr/bin/env python3
# The version is the latest git tag
import subprocess
from manpage import build_manpage
from setuptools import setup
a = subprocess.Popen("git tag | grep '^v' | tail -n 1", shell = True, stdout = subprocess.PIPE)
version = a.stdout.readline().decode().strip().replace("v", "")
a.wait()
setup(
... | stettberger/metagit | setup.py | Python | gpl-3.0 | 1,094 |
'''
Created on 03/11/2009
@author: Fernando
Copyright 2009-2013 Fernando J. V. da Silva
This file is part of centering_py.
centering_py 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 Fo... | fernandojvdasilva/centering_py | src/corpus/Sentence.py | Python | gpl-3.0 | 1,968 |
# ##### 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... | Gamebasis/3DGamebasisServer | GameData/blender-2.71-windows64/2.71/scripts/startup/bl_ui/properties_physics_softbody.py | Python | gpl-3.0 | 7,418 |
import sys
from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QAction, QTableWidget,QTableWidgetItem,QVBoxLayout
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import pyqtSlot
class App(QWidget):
def __init__(self):
super().__init__()
self.title = 'PyQt5 table - pythonspot.com'
... | Breakthru/splitbills | finance/main.py | Python | gpl-3.0 | 2,074 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2022 Daniele Simonetti
#
# 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.
#
... | OpenNingia/l5r-character-manager-3 | l5r/dialogs/managedatapack.py | Python | gpl-3.0 | 5,427 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Packing metadata for setuptools."""
from io import open
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
with open('README.rst', encoding='utf-8') as readme_file:
readme = readme_file.read()
with open(... | projecthamster/hamster-gtk | setup.py | Python | gpl-3.0 | 1,564 |
#!/usr/bin/env python
# coding=utf-8
import sys
from flask import Flask, request, jsonify
import simplejson as json
import handlers
app = Flask(__name__)
api_list = {
'api/dns': u'get dns',
'api/update': u'update domain information',
}
@app.route("/", methods = ['GET', 'POST'])
def index():
retur... | inter-rpm/dns-interface | main.py | Python | gpl-3.0 | 650 |
from string import capwords
from django.db import models
CAPWORDS_ATTRS = ('name', 'firstname')
class PatientManager(models.Manager):
"""
custum patient manger to modifie create and update
"""
attrs = CAPWORDS_ATTRS
# paremeter to capwords
# def create_patient(self, name=Non... | jgirardet/unolog | unolog/patients/models.py | Python | gpl-3.0 | 2,704 |
# This file is part of the Fluggo Media Library for high-quality
# video and audio processing.
#
# Copyright 2010-2 Brian J. Crowell <brian@fluggo.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 Foun... | fluggo/Canvas | fluggo/editor/model/commands.py | Python | gpl-3.0 | 38,160 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Janice Cheng
import pika
import json
creds_broker = pika.PlainCredentials("janice", "janice123")
conn_params = pika.ConnectionParameters("172.16.201.134",
virtual_host = "/",
credent... | jcchoiling/learningPython | s13/Day12/practice/rpc_server.py | Python | gpl-3.0 | 1,091 |
from base import Layout
from .. import utils, manager
class Tile(Layout):
defaults = [
("border_focus", "#0000ff", "Border colour for the focused window."),
("border_normal", "#000000", "Border colour for un-focused winows."),
("border_width", 1, "Border width."),
("name", "tile", ... | Fxrh/tispa-wm | libqtile/layout/tile.py | Python | gpl-3.0 | 6,357 |
#!/usr/bin/env python
import os
import csv
import json
output = u''
base_dir = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
csv_keys = [
'verb',
'impersonalForms',
'presentIndicative',
'imperfectIndicative',
'futureIndicative',
'pastRemoteIndicative',
'pastIndicative',
'... | Sinkler/italian-verbs-trainer | verbs/generate.py | Python | gpl-3.0 | 2,025 |
# ##### 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 3
# of the License, or (at your option) any later version.
#
# This program is distrib... | srgblnch/LinacDS | LinacAttrs/LinacFeatures/__init__.py | Python | gpl-3.0 | 1,254 |
#!/usr/bin/env python
"""
Input: fasta, int
Output: tabular
Return titles with lengths of corresponding seq
"""
import sys
assert sys.version_info[:2] >= ( 2, 4 )
def compute_fasta_length( fasta_file, out_file, keep_first_char, keep_first_word=False ):
infile = fasta_file
out = open( out_file, 'w')
keep... | icaoberg/cellorganizer-galaxy-tools | datatypes/converters/fasta_to_len.py | Python | gpl-3.0 | 1,377 |
__problem_title__ = "An engineers' dream come true"
__problem_url___ = "https://projecteuler.net/problem=263"
__problem_description__ = "Consider the number 6. The divisors of 6 are: 1,2,3 and 6. Every " \
"number from 1 up to and including 6 can be written as a sum of " \
... | jrichte43/ProjectEuler | Problem-0263/solutions.py | Python | gpl-3.0 | 1,586 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "itf.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | valasek/taekwondo | manage.py | Python | gpl-3.0 | 801 |
from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from nbodykit.utils import ScatterArray, GatherArray, FrontPadArray
from numpy.testing import assert_array_equal
import os
import pytest
setup_logging("debug")
@MPITest([1])
def test_json_quantity(comm):
from nbodykit.... | bccp/nbodykit | nbodykit/tests/test_utils.py | Python | gpl-3.0 | 9,095 |
# Como não tinha restrições no enunciado da questão escolhi o python pela facilidade de trabalhar com strings na hora de por os parenteses xD
#codigo foi implementado na versão 2.7.13
import sys
def f(i,j):
return str(i)+','+str(j)
def matrix_chain_order(p):
n = len(p)-1
m, s = {}, {}
for i in... | Scientistt/AnaliseDeAlgoritmosFabioVitorLista02 | Questão 06.py | Python | gpl-3.0 | 1,194 |
# -*- coding: utf-8 -*-
from time import sleep
import subprocess
def invoke_rest_api(cmd):
url = 'http://localhost:8080/{}'.format(cmd)
subprocess.call(['curl', url])
def with_api():
# start
invoke_rest_api('start')
invoke_rest_api('takeoff')
sleep(3)
# go forward
invoke_rest_api('go_... | yamila-moreno/jannie-5 | examples/bottle-example.py | Python | gpl-3.0 | 520 |
from flask import Blueprint, jsonify, request
from urbansearch.utils import db_utils
relations_api = Blueprint('relations_api', __name__)
@relations_api.route('/document_info', methods=['GET'])
def document_info():
if 'city_a' not in request.args or 'city_b' not in request.args:
return jsonify(status=40... | urbansearchTUD/UrbanSearch | urbansearch/server/relations.py | Python | gpl-3.0 | 807 |
"""Tests for hermite module.
"""
from __future__ import division
import numpy as np
import numpy.polynomial.hermite as herm
from numpy.polynomial.polynomial import polyval
from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal, assert_, run_module_suite)
H0... | beiko-lab/gengis | bin/Lib/site-packages/numpy/polynomial/tests/test_hermite.py | Python | gpl-3.0 | 17,416 |
from cement.utils.misc import init_defaults
from configparser import NoSectionError
from cli.Mcg import Mcg
from core.db.MongoDB import MongoDB
def main():
# Logging config (mcg section in file mcg.conf)
defaults = init_defaults('mcg', 'log.logging')
defaults['log.logging']['file'] = 'mcg.log'
with M... | BizarroSolutions/mcg | cli/init.py | Python | gpl-3.0 | 1,266 |
from django.contrib import admin
from registration.models import User, Tool, ShareZone
from sheds.models import Sheds
admin.site.register(User)
admin.site.register(Tool)
admin.site.register(ShareZone)
admin.site.register(Sheds) | SociedadMartinez/ToolShare | registration/admin.py | Python | gpl-3.0 | 228 |
import serial
ser= serial.Serial('/dev/ttyUSB0', timeout=1)
print (ser.name)
version='\xFA\xF2'
start_learning='\xFA\xF5' #auto exit
start_learning2='\xFA\xFD' #non auto
stop_learning='\xFA\xF4'
sleep='\xFA\xF8'
wake='\xFA\xF7'
repeat='\xFA\xF3'
reset='\xFA\xF6'
start='\xFA'
stop='\xED'
#test
# FA 18 ... | davidea72/edir_1 | remote_command_2.py | Python | gpl-3.0 | 6,639 |
import sys
import time
from scheduler import SoSpiderSchdulerBase
class SoClusterManager(SoSpiderSchdulerBase):
def __init__(self, name):
self.load_conf()
self.make_connection()
self.name = name
self.log_file = open('./logs/%s_cluster.log' % self.name, 'w')
def log(self, tex... | Rolight/So-Spider | cluster_manager.py | Python | gpl-3.0 | 1,490 |
from datetime import datetime
from multiprocessing import Process, Queue, Manager, Value
import pyshark
from database import *
import logging
import threading
from typing import List, Dict, Tuple
from typing import *
class LogInUser:
def __init__(self, call_id, identifier, name, ip):
self.name = name
... | JamesMackerel/PPTP_VPN_Sniffer | src/sniffer.py | Python | gpl-3.0 | 10,094 |
#! /usr/bin/env python3
# This file is part of MDP-ProbLog.
# MDP-ProbLog 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.
# MDP-Prob... | thiagopbueno/mdp-problog | tests/test_mdp.py | Python | gpl-3.0 | 5,866 |
graph = {
'Sarijadi': ['Jl.Surya Sumantri'],
'Jl.Surya Sumantri': ['Pasteur'],
'Pasteur': ['Jl.Dr.Djunjunan'],
'Jl.Dr.Djunjunan': ['Jl.Pajajaran'],
'Jl.Pajajaran': ['Bandara Husain Sastra Negara'],
'Bandara Husain Sastra Negara': ['Band... | D4TI3A/KhaeraTunnisa1144044 | doc/Kuliah/Tugas2.py | Python | gpl-3.0 | 1,425 |
#!/usr/bin/python
#
# Copyright (c) 2017 Yuwei Zhou, <yuwzho@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | skg-net/ansible | lib/ansible/modules/cloud/azure/azure_rm_autoscale.py | Python | gpl-3.0 | 26,843 |
#!/usr/bin/env python
#-*- coding: UTF-8 -*-
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import subprocess, time
last_ch = 0
class TvServerHandler(BaseHTTPRequestHandler):
def do_GET(self):
global last_ch
cmd = self.path.split('/')
if 'favicon.ico' in cmd:
return
... | mimepp/umspx | htdocs/umsp/plugins/eyetv/eyetv-controller.py | Python | gpl-3.0 | 1,293 |
from django import forms
from django.forms import ModelForm
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth import authenticate
class AuthenticationForm(forms.Form):
"""
Base class for authenticating users. Extend this to get a form ... | kermitfr/kermit-webui | src/webui/index/forms.py | Python | gpl-3.0 | 2,043 |
'''
*******************************************************************************
* sample.py 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... | iocanto/bug-python-libraries | sample.py | Python | gpl-3.0 | 1,158 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from game.player import Player
from framework.PodSixNet.Channel import Channel
from framework.regnancyexception import NotEnoughMoneyException, \
PileIsEmptyException
from framework.locals import *
import framework.networking as nwp
import logging
import game
class Regna... | luisgustavossdd/TBD | server/regnancychannel.py | Python | gpl-3.0 | 2,610 |
# Build a simple house.
# Import necessary modules.
import mcpi.minecraft as minecraft
import mcpi.block as block
# Connect to Minecraft.
mc = minecraft.Minecraft.create()
# Set a base size for the house.
SIZE = 20
# Create the house function.
def house():
# Calculate the midpoints, used to position doors and... | craigem/MyAdventures | buildHouse2.py | Python | gpl-3.0 | 1,494 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-12-28 02:21
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0006_auto_20161228_1016'),
]
operations = [
migration... | SnowRomance/CMDB | app/migrations/0007_auto_20161228_1021.py | Python | gpl-3.0 | 869 |
from django.db import models
from datetime import datetime
class Door(models.Model):
door_name = models.CharField(max_length=144)
door_type = models.CharField(max_length=35)
def __str__(self):
return self.door_name
class Event(models.Model):
door = models.ForeignKey(Door, on_delete=models.CASCADE)
event_type... | acourt/doortracker | doorreport/doorlogger/models.py | Python | gpl-3.0 | 531 |
# pylint: disable=wrong-import-order
import os
import time
from multiprocessing import Event, Value
from statistic.update import StatisticUpdater
from statistic.work_load import WorkLoadStatistic
from storage.db_interface_backend import BackEndDbInterface
from test.acceptance.base import TestAcceptanceBase
from test.... | fkie-cad/FACT_core | src/test/acceptance/test_misc.py | Python | gpl-3.0 | 4,501 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from unittest.mock import patch
from unittest.mock import DEFAULT
from werkzeug.urls import url_parse, url_decode
from odoo import exceptions
from odoo.addons.test_mail.models.test_mail_models import MailTestSimple
from... | jeremiahyan/odoo | addons/test_mail/tests/test_mail_thread_internals.py | Python | gpl-3.0 | 16,837 |
# -*- coding: utf-8 -*-
# Copyright 2009 James Hensman
# Licensed under the Gnu General Public license, see COPYING
#from numpy import matlib as ml
import numpy as np
from scipy import linalg
class PCA_EM_matrix:
def __init__(self,data,target_dim):
"""Maximum likelihood PCA by the EM algorithm"""
self.X = ml.matr... | jameshensman/pythonGPLVM | PCA_EM.py | Python | gpl-3.0 | 6,841 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | ctrlaltdel/neutrinator | vendor/keystoneauth1/loading/adapter.py | Python | gpl-3.0 | 14,041 |
# -*- coding: utf-8 -*-
# petgfunctions.py - This python "helper" script holds a lot of functions
# Copyright (c) 2012-2014 Harry van der Wolf. All rights reserved.
# This program or module is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public Licence as published
# by... | hvdwolf/pyExifToolGUI | scripts/petgfunctions.py | Python | gpl-3.0 | 115,680 |
default_app_config = 'django_pkgbuild.apps.PkgbuildConfig'
| alucryd/django-pkgbuild | django_pkgbuild/__init__.py | Python | gpl-3.0 | 59 |
# vim: ts=4:sw=4:expandtab
# -*- coding: UTF-8 -*-
# BleachBit
# Copyright (C) 2008-2021 Andrew Ziem
# https://www.bleachbit.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, either version... | bleachbit/bleachbit | bleachbit/Action.py | Python | gpl-3.0 | 22,786 |
"""
WSGI config for vest 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.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS... | vest-thermostat/server | vest/vest/wsgi.py | Python | gpl-3.0 | 385 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('payroll', '0009_auto_20160722_1720'),
]
operations = [
migrations.AddField(
model_name='netsalary',
... | KenanBek/rslservices | app/payroll/migrations/0010_auto_20160803_1622.py | Python | gpl-3.0 | 1,650 |
# -*- coding: utf-8 -*-
# This file is part of Gertrude.
#
# Gertrude 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.
#... | studio1247/gertrude | controls.py | Python | gpl-3.0 | 45,793 |
default_app_config = 'colab_superarchives.apps.SuperArchivesConfig'
| colab/colab-superarchives-plugin | src/colab_superarchives/__init__.py | Python | gpl-3.0 | 70 |
from unittest import TestCase
from hamcrest import *
from array_util import get_random_array
from chapter05.textbook5_3 import permute_by_sorting, randomize_in_place
class TestTextbook5_3(TestCase):
def test_permute_by_sorting(self):
array, elements = get_random_array()
array = permute_by_sort... | wojtask/CormenPy | test/test_chapter05/test_textbook5_3.py | Python | gpl-3.0 | 589 |
import configparser
import imaplib
"""
Gmail uses OAuth for authentications purposes. This means that a regular SSL connection request
is refused by the mail server. So we have change the account settings to allow for access from less
secure applications.
"""
def open_connection(verbose=False, config_file='./imap.co... | prasadtalasila/MailingListParser | lib/input/imap/connection.py | Python | gpl-3.0 | 1,403 |
import pygame
import random
class Astroid:
def __init__(self, x, y, scale):
"""
Create Astroid object.
:param x:
Start position X.
:param y:
Start position Y.
:param scale:
Astroid size scale.
"""
# astroid position
... | foss-ag/workshop_minecraft-python | src/astroids/Astroid.py | Python | gpl-3.0 | 2,132 |
from .column import Column
from .store import TableStore
from .table import Table
__all__ = ['TableStore', 'Table', 'Column']
| ju1ius/clisnips | clisnips/tui/widgets/table/__init__.py | Python | gpl-3.0 | 127 |
# Visualize node graph
# Copyright 2013 Victor Lavrentev
import matplotlib.pyplot as plt
import json, sys
import networkx as nx
from node_lib import graph
print '\nNode image tools (Visualize node graph) v01a\n'
try:
file_node=sys.argv[1]
except:
print '->Error. No script'
sys.exit (0)
w... | shrimo/node_image_tools | node_graph.py | Python | gpl-3.0 | 3,999 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Execute to run double Cole-Cole term characterization
"""
import sys
sys.path.append('..')
import test_helper as th
import os
import itertools
import numpy as np
import subprocess
testdir = 'data'
def _generate_cc_sets():
"""Generate multiple complex resistivity spec... | m-weigand/Cole-Cole-fit | tests/2-term/test_cases.py | Python | gpl-3.0 | 1,602 |
def genbox(i):
i = int(i)
def draw(size, yc, xc):
y = yc
for _ in range(0,size):
if _ == 0 or _ == size-1:
x = xc
i = 0
while i < size:
if not g[_+y][x]=="x": g[_+y][x] = "x"
x += 2
i+=1
else:
if not g[_+y][xc]=="x": g[_+y][xc... | bearbear12345/school_SDD_prelimYear | Assessments/AS4 - NCSS Python Programming Challenge/NCSS Challenge (Advanced) 2016/1.2.3 - Box in a Box.py | Python | gpl-3.0 | 736 |
#!/usr/bin/python3
#!/usr/bin/python3
from PIL import Image, ImageDraw
import glob
import os
from recolor import replace_color
dest = "."
for fname in glob.glob("in/*.png"):
im = Image.open(fname)
replace_color(im, range(112, 123+1), range(80, 95+1))
_, ofname = os.path.split(fname)
ofname = os.path... | forcecore/yupgi_alert0 | assets/shp/slave/run.py | Python | gpl-3.0 | 385 |
__author__ = 'aliceinit'
import heapq
from todogen_utils.todogen_task import TodoTask
class TodoGenerator(object):
# todo add required place for tasks, set (optionally) places for free time periods
# todo add weather requirements for tasks (optionally) - connect to weather APIs
def __init__(self, task_ma... | aliceinit/todogen | todogen_utils/todo_generator.py | Python | gpl-3.0 | 690 |
"""
Train low-data Sider models with graph-convolution. Test last fold only.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import tempfile
import numpy as np
import tensorflow as tf
import deepchem as dc
from datasets import load_sider_convmol
# 4-fo... | bowenliu16/deepchem | examples/low_data/sider_graph_conv_one_fold.py | Python | gpl-3.0 | 2,945 |