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/python -tt
# An incredibly simple agent. All we do is find the closest enemy tank, drive
# towards it, and shoot. Note that if friendly fire is allowed, you will very
# often kill your own tanks with this code.
#################################################################
# NOTE TO STUDENTS
# This is... | adamjchristiansen/CS470 | bzagents/other_pigeons/wild_pigeon.py | Python | gpl-3.0 | 2,746 |
# __init__.py
from player import *
from blob import *
from naga import *
| tectronics/fallenspire | game/creatures/__init__.py | Python | gpl-3.0 | 76 |
#!/usr/bin/env python
#
# (c) 2013 Joost Yervante Damad <joost@damad.be>
# License: GPL
VERSION='1.2.1'
import glob, sys, platform
from setuptools import setup
with open('README.md') as file:
long_description = file.read()
arch = platform.uname()[4]
extra_data_files = []
if sys.platform == 'darwin':
OPTION... | spanner888/madparts | setup.py | Python | gpl-3.0 | 3,599 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import fmt_money, formatdate, format_time, now_datetime, \
get_url_to_form, get_url_to_list, flt
f... | manassolanki/erpnext | erpnext/setup/doctype/email_digest/email_digest.py | Python | gpl-3.0 | 18,380 |
beta = 5 # "beta" value in adiabatic correction to wind profile
Cd = 840.0 # heat capacity of mineral component of soil, J/kg/K
Co = 1920.0 # heat capacity of organic component of soil, J/kg/K
Cp = 1004.67 # specific heat of dry air at constant pressure, J/kg-K
Cpd = 1004.67 # specific heat of dry air a... | OzFlux/PyFluxPro | scripts/constants.py | Python | gpl-3.0 | 4,163 |
# Name:Arris password of the day generator
# File:tm602a_password_day_py
#Author:Ján Trenčanský
#License: GNU GPL v3
#Created: 29.3.2015
#Last modified: 29.3.2015
#Shodan Dork:
#Description: The Accton company builds switches, which are rebranded and sold by several manufacturers.
# Based on work of Raul Pe... | bmaia/rext | modules/misc/arris/tm602a_password_day.py | Python | gpl-3.0 | 4,890 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .base import BaseElasticsearchQuery
class AllElasticsearchQuery(BaseElasticsearchQuery):
"""
This is an Elasticsearch query class that is meant to query all of the document types in
a given index.
"""
# Class Members
# Inst... | lavalamp-/ws-backend-community | wselasticsearch/query/all.py | Python | gpl-3.0 | 754 |
# wayne warren 2015
import scrabble # for my shuffling etc. PRESSING ENTER WILL SCORE WORD.
import pygame
import pygame.locals
import time
import random
from pygame import mixer
from os import getcwd
top_dir = getcwd()
print top_dir
mixer.init()
# for bleep when window pops up
bad_word_alert=mixer.Sound(top_dir+'/soun... | wayneww/Scrabble | game_run.py | Python | gpl-3.0 | 13,893 |
import PyQt5.QtWidgets as QtWidgets
import PyQt5.QtGui as QtGui
import PyQt5.QtCore as QtCore
from LayerEditor.leconfig import cfg
class DiagramView(QtWidgets.QGraphicsItem):
"""
Represents some diagram view in edited diagram background
"""
ZVALUE = -9
def __init__(self, diagram_uid,... | GeoMop/GeoMop | src/LayerEditor/ui/gitems/diagram_view.py | Python | gpl-3.0 | 1,929 |
'''base implementation of a main window'''
# -*- coding: utf-8 -*-
# This file is part of emesene.
#
# emesene 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
#... | emesene/emesene | emesene/gui/base/MainWindowBase.py | Python | gpl-3.0 | 4,799 |
from cvxopt import matrix, solvers
from apgl.data.Standardiser import Standardiser
import numpy
"""
Let's test the massively complicated bound on the clustering error
"""
numpy.set_printoptions(suppress=True, linewidth=150)
numC1Examples = 50
numC2Examples = 50
d = 3
numpy.random.seed(21)
center1 = numpy.array([-1... | charanpald/wallhack | wallhack/clusterexp/BoundExp2.py | Python | gpl-3.0 | 2,119 |
from ..group import GROUP_ATTR_DEFAULTS
from ..utils.text import bold, mark_for_translation as _
from ..utils.ui import io
from .nodes import _attribute_table
GROUP_ATTRS = sorted(list(GROUP_ATTR_DEFAULTS) + ['nodes'])
GROUP_ATTRS_LISTS = ('nodes',)
def bw_groups(repo, args):
if not args['groups']:
for ... | bundlewrap/bundlewrap | bundlewrap/cmdline/groups.py | Python | gpl-3.0 | 953 |
__problem_title__ = "Integer sided triangles for which the area/perimeter ratio is integral"
__problem_url___ = "https://projecteuler.net/problem=283"
__problem_description__ = "Consider the triangle with sides 6, 8 and 10. It can be seen that the " \
"perimeter and the area are both equal t... | jrichte43/ProjectEuler | Problem-0283/solutions.py | Python | gpl-3.0 | 1,243 |
#!/usr/bin/env python
r"""
crate_anon/nlp_webserver/views.py
===============================================================================
Copyright (C) 2015-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of CRATE.
CRATE is free software: you can redistribute it and/or modify
it under... | RudolfCardinal/crate | crate_anon/nlp_webserver/views.py | Python | gpl-3.0 | 30,270 |
# -*- coding: utf-8 -*-
# ****************************************************************************
# Original work Copyright (C) 2013-2015 SUNCAT
# Modified work Copyright 2015-2017 Lukasz Mentel
#
# This file is distributed under the terms of the
# GNU General Public License. See the file 'COPYING'
# in the root ... | lmmentel/ase-espresso | espresso/worldstub.py | Python | gpl-3.0 | 616 |
#!/home/dante/Projects/free-art/venv/bin/python3
#
# The Python Imaging Library
# $Id$
#
# this demo script illustrates pasting into an already displayed
# photoimage. note that the current version of Tk updates the whole
# image every time we paste, so to get decent performance, we split
# the image into a set of til... | DanteOnline/free-art | venv/bin/painter.py | Python | gpl-3.0 | 2,138 |
from api.callers.search.api_search_hash import ApiSearchHash
from api.callers.search.api_search_hashes import ApiSearchHashes
from api.callers.search.api_search_states import ApiSearchStates
from api.callers.search.api_search_terms import ApiSearchTerms
| PayloadSecurity/VxAPI | api/callers/search/__init__.py | Python | gpl-3.0 | 254 |
__author__ = 'aanurag'
import sys
from binary_tree import BinaryTree
class IntervalTree(BinaryTree):
def __init__(self):
BinaryTree.__init__(self)
self.max = None
def insert(self, key, parent=None):
try:
if (self.key == None):
self.key = key
... | AA33/dsa_exp | bst_misc/interval_tree.py | Python | gpl-3.0 | 4,223 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 16 14:54:23 2013
@author: ssamot
"""
#title :compMonitor.py
#description :Sends an email alert if people pass a threshold on the Kaggle public leaderboards
#author :William Cukierski
#date :2013-05-06
#python_version :2.7
#============... | ssamot/causality | kaggle_scores.py | Python | gpl-3.0 | 2,582 |
#!/usr/bin/env python
"""
Framework to start a simulated vehicle and connect it to MAVProxy.
Peter Barker, April 2016
based on sim_vehicle.sh by Andrew Tridgell, October 2011
"""
from __future__ import print_function
import atexit
import getpass
import optparse
import os
import os.path
import re
import signal
import... | bnsgeyer/Copter3_4 | Tools/autotest/sim_vehicle.py | Python | gpl-3.0 | 32,299 |
# coding=utf-8
from kombu import Connection, Exchange, Queue, Consumer
from kombu.async import Hub
web_exchange = Exchange('web_develop', 'direct', durable=True)
standard_queue = Queue('standard', exchange=web_exchange,
routing_key='web.develop')
URI = 'librabbitmq://dongwm:123456@localhost:567... | dongweiming/web_develop | chapter9/section4/kombu_consumer.py | Python | gpl-3.0 | 761 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 2015 Bitergia
#
# 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 ve... | sanacl/GrimoireELK | grimoire/elk/gmane.py | Python | gpl-3.0 | 995 |
"""
Data fitting and peak prediction routines
"""
import genetrack
from genetrack import logger, conf
from itertools import *
import numpy, operator
from math import log, exp
def normal_function( w, sigma ):
"""
Defaulf fitting function, it returns values
from a normal distribution over a certain width.
... | mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/eggs/GeneTrack-2.0.0_beta_1_dev_48da9e998f0caf01c5be731e926f4b0481f658f0-py2.7.egg/genetrack/fitlib.py | Python | gpl-3.0 | 7,159 |
__all__ = ['persistence', 'baltimorejsondecoder', 'baltimorejsonencoder']
| mfrey/baltimore | persistence/__init__.py | Python | gpl-3.0 | 74 |
import mimetypes
def getfile(stat,head,body,filename):
if filename.endswith(".py"):
return Response(stat,head,body,filename)
elif stat!='':
return Response(stat,head,body,filename)
else:
with open(File.parse(filename),'rb') as r:
ctype,cenc = mimetypes.guess_type(File.parse(filename))
return Response("2... | Malex/FrozenFW | frozen/plugins/Getfile.py | Python | gpl-3.0 | 446 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of t... | harlequin/sickbeard | sickbeard/providers/__init__.py | Python | gpl-3.0 | 4,617 |
class Solution:
def minDeletionSize(self, A):
"""
:type A: List[str]
:rtype: int
"""
rows, cols = len(A), len(A[0])
if rows == 1: return 0
ans = 0
for j in range(cols):
sort = True
for i in range(1, rows):
... | YiqunPeng/Leetcode-pyq | solutions/944DeleteColumnsToMakeSorted.py | Python | gpl-3.0 | 467 |
################ Copyright 2005-2016 Team GoldenEye: Source #################
#
# This file is part of GoldenEye: Source's Python Library.
#
# GoldenEye: Source's Python Library 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 So... | goldeneye-source/ges-python | stubs/GEAiSched.py | Python | gpl-3.0 | 2,498 |
# Copyright (C) 2011-2017 2ndQuadrant Limited
#
# This file is part of Barman.
#
# Barman 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... | infoxchange/barman | barman/xlog.py | Python | gpl-3.0 | 14,318 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
###############################################################################
# chirribackup/storage/Local.py
#
# Local backup storage -- backup is organized in a local folder
#
# -----------------------------------------------------------------------------
# Chirri Bac... | killabytenow/chirribackup | chirribackup/storage/Local.py | Python | gpl-3.0 | 5,284 |
"""
The reporting package provides classes for reporting the results of forward
model jobs.
"""
from .file import File
from .interactive import Interactive
from .network import Network
| Statoil/libres | python/job_runner/reporting/__init__.py | Python | gpl-3.0 | 185 |
class Solution(object):
def findMinDifference(self, timePoints):
"""
:type timePoints: List[str]
:rtype: int
"""
def convert(time):
return int(time[:2]) * 60 + int(time[3:])
minutes = map(convert, timePoints)
minutes.sort()
return min( (y ... | sadad111/leetcodebox | Minimum Time Difference.py | Python | gpl-3.0 | 1,137 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | elopio/snapcraft | snapcraft/plugins/go.py | Python | gpl-3.0 | 8,148 |
#!/usr/bin/env python
# Bootstrap installation of Distribute
import distribute_setup
distribute_setup.use_setuptools()
import os
from setuptools import setup
PROJECT = u'screp'
VERSION = '0.3.2'
URL = 'https://github.com/darfire/screp'
AUTHOR = u'Doru Arfire'
AUTHOR_EMAIL = u'doruarfire@gmail.com'
DESC = u'Command... | darfire/screp | setup.py | Python | gpl-3.0 | 1,503 |
"""Command line interface for echo server."""
import fnmatch
import asyncio
import argparse
from aioconsole import AsynchronousCli, start_interactive_server
from aioconsole.server import parse_server, print_server
from . import echo
async def get_history(reader, writer, pattern=None):
history = asyncio.get_eve... | vxgmichel/aioconsole | example/cli.py | Python | gpl-3.0 | 2,320 |
# This file is part of PRAW.
#
# PRAW 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.
#
# PRAW is distributed in the hope that it will ... | appleorange1/praw | praw/objects.py | Python | gpl-3.0 | 72,632 |
#!/usr/bin/env python
import vrep
import time
import sys
import serial
import serial.tools.list_ports
import struct
import pyHook
import pythoncom
import threading
global data1 #Global Variable:where used where declare
global data2 #Global Variable:where used where declare
data1 = [0,0]
data2 = 1
event_close = threa... | KANGKANGABC/ArmRobot | xmos_motor.py | Python | gpl-3.0 | 14,455 |
# coding: utf-8
# Imports
from app.models import *
from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple
class FGroupeUtilisateur(forms.ModelForm) :
# Champ
util = forms.ModelMultipleChoiceField(
label = 'Utilisateurs composant le groupe',
queryset = TUtilis... | SMMAR11/smmarbsence | app/forms/admin.py | Python | gpl-3.0 | 4,838 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-12-21 13:17
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('onair', '0004_auto_20180827_1759'),
]
operations = [
migration... | hzlf/openbroadcast.ch | app/onair/migrations/0005_scheduleditem_uuid.py | Python | gpl-3.0 | 501 |
#!/usr/bin/python
#
# Simple script to echo the ttyUSB0 serial port to the console at 74880 baud.
# Based on http://www.esp8266.com/viewtopic.php?p=33650.
# I found it really really hard to do using standard tools like cu...
# By doing ./monitory.py and resetting the esp8226 (while it is connected
# via USB) you can se... | OpenSeizureDetector/ESP8266_SD | monitor.py | Python | gpl-3.0 | 516 |
from dgs2.discogs_client.exceptions import HTTPError
from dgs2.discogs_client.utils import parse_timestamp, update_qs, omit_none
class SimpleFieldDescriptor(object):
"""
An attribute that determines its value using the object's fetch() method.
If transform is a callable, the value will be passed through ... | hzlf/openbroadcast | website/tools/dgs2/discogs_client/models.py | Python | gpl-3.0 | 21,790 |
from raven.contrib.flask import Sentry
from flask import Flask
from flask.ext.babel import Babel
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.markdown import Markdown
from flask.ext.login import LoginManager
from flask.ext.gravatar import Gravatar
from flask.ext.migrate import Migrate, MigrateCommand
from... | RalfJung/dudel | dudel/__init__.py | Python | gpl-3.0 | 1,320 |
from django.core import serializers
from django.core.urlresolvers import reverse
from django.db import transaction
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from repository.forms import *
from repository.models import *
@transaction.commit_on_success
def edit(request):
"""E... | open-machine-learning/mldata | repository/views/publication.py | Python | gpl-3.0 | 2,214 |
#Made by Emperorc
import sys
from com.l2scoria import Config
from com.l2scoria.gameserver.model.quest import State
from com.l2scoria.gameserver.model.quest import QuestState
from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2scoria.gameserver.util import Util
qn = "614_SlayTheEnemy... | zenn1989/scoria-interlude | L2Jscoria-Game/data/scripts/quests/614_SlayTheEnemyCommander_Varka/__init__.py | Python | gpl-3.0 | 3,372 |
#
# Copyright (c) 2009-2021 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""Package weewx, containing modules specific to the weewx runtime engine."""
from __future__ import absolute_import
import time
__version__="4.5.1"
# Holds the program launch time in unix epoch secon... | gjr80/weewx | bin/weewx/__init__.py | Python | gpl-3.0 | 5,375 |
def frame(s):
print("*"*(len(s)+4))
print("*",s,"*")
print("*"*(len(s)+4))
def triangle(rows):
for i in range(rows):
print("*"*(2*i+1))
def flag(n):
for i in range(n*4):
print(("*"*n*10) + (2*n*(" ")) + ("*"*n*10))
for i in range(n):
print("")
for i in range(n*4):
print(("*"*n*10) + (2*n*(" ")) + ("*... | InfectedSoap/TDP002 | Lab 02/uppgift2a.py | Python | gpl-3.0 | 407 |
from __future__ import absolute_import, division, print_function
import pygtk
pygtk.require('2.0')
import gtk, gobject, cairo
import time
import sys
import imp
import os
from bcam.loader_dxf import DXFLoader
from bcam.loader_excellon import ExcellonLoader
from bcam.tool_operation import TOResult
from bcam.tool_op_dri... | snegovick/bcam | bcam/events.py | Python | gpl-3.0 | 31,621 |
"""
Support for exporting database to KeePassX XML format.
"""
from __future__ import absolute_import
from datetime import datetime
from xml.etree import ElementTree as ET
from xml.dom import minidom
from keepassdb import const
class XmlExporter(object):
"""
Class for exporting database to KeePassX XML format... | hozn/keepassdb | keepassdb/export/xml.py | Python | gpl-3.0 | 3,206 |
import sys
from qtpy.QtCore import Qt
from qtpy.QtWidgets import QSplashScreen, QApplication
from qtpy.QtGui import QColor, QPen, QFont
from ert_gui.ertwidgets import resourceImage
class ErtSplash(QSplashScreen):
def __init__(self, version_string="Version string"):
QSplashScreen.__init__(self)
... | joakim-hove/ert | ert_gui/ert_splash.py | Python | gpl-3.0 | 2,664 |
'''
There are no urls in this file. It has no functional use.
This file exists only to maintain backward compatibility.
'''
app_name = 'django_netjsonconfig' # pragma: no cover
urlpatterns = [] # pragma: no cover
| openwisp/django-netjsonconfig | django_netjsonconfig/urls.py | Python | gpl-3.0 | 216 |
import logging
from django.test import TestCase
from ...models import Attribute
# Initialize logger.
logger = logging.getLogger(__name__)
# Create your tests here.
class AttributeValueModelTest(TestCase):
def test_model_has_inventory_field(self):
'''
Test that Attribute_Value.inventory is present... | libretees/libreshop | libreshop/products/tests/models/.~c9_invoke_taooUl.py | Python | gpl-3.0 | 3,977 |
import subprocess
import re
import matplotlib.pyplot as plt
import argparse
import os
outfile_git_name = "tmp_git.txt"
outfile_format_name = "tmp_formatted.txt"
git_log_constant = "1 file changed, " # Used for grep, do not modify
diff_list = []
total_list = []
# Parse arguments passed by command line
parser = argp... | JonSeijo/filelines-measurer | filelines.py | Python | gpl-3.0 | 3,504 |
names = list()
times = list()
keys = list()
names.append("HeadPitch")
times.append([0.96, 1.68, 3.28, 3.96, 4.52, 5.08])
keys.append([-0.0261199, 0.427944, 0.308291, 0.11194, -0.013848, 0.061318])
names.append("HeadYaw")
times.append([0.96, 1.68, 3.28, 3.96, 4.52, 5.08])
keys.append([-0.234743, -0.622845, -0.113558, ... | davinellulinvega/COM1005 | Lab8/wipe.py | Python | gpl-3.0 | 2,414 |
"""
InaSAFE Disaster risk assessment tool developed by AusAid and World Bank
- **GUI Test Cases.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foun... | gijs/inasafe | safe_qgis/test_keywords_dialog.py | Python | gpl-3.0 | 23,345 |
# This file is part of Voice
#
# Voice 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.
#
# Voice is distributed in the hope that it wi... | Aeva/voice | voice/engines/__init__.py | Python | gpl-3.0 | 650 |
# Read inputs from Standard Input.
# Write outputs to Standard Output.
# Please, do not use fileinput module to read Standard Input.
import sys
try:
n = int(raw_input())
lis = raw_input().split()
except ValueError:
print "0 - Cannot process the data"
position = 0
less = 0
more = 0
s = map(int, lis)
... | STiago/Python | Code/temperatures.py | Python | gpl-3.0 | 571 |
#!/usr/bin/env python
'''
COPYRIGHT 2013 RPS ASA
This file is part of Petulant Bear.
Petulant Bear 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 op... | ioos/petulant-bear | petulantbear/netcdf_etree.py | Python | gpl-3.0 | 15,893 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 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... | haxwithaxe/qutebrowser | tests/unit/browser/test_webelem.py | Python | gpl-3.0 | 30,783 |
# Source:
# http://stackoverflow.com/questions/21839676/how-to-write-a-downloadhandler-for-scrapy-that-makes-requests-through-socksipy
from txsocksx.http import SOCKS5Agent
from scrapy.core.downloader.handlers.http11 import HTTP11DownloadHandler, ScrapyAgent
from twisted.internet import reactor
from scrapy.xlib.tx impo... | MisterTofu/scrapy-midleware | middleware/TorProxy.py | Python | gpl-3.0 | 1,353 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Li Ruhua'
configs = {
'db' : {
'host' : '127.0.0.1'
}
}
| liruhua99/awesome-python3-webapp | www/config_override.py | Python | gpl-3.0 | 135 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# aw2gd.py - Last modified: Tue 14 Feb 2012 01:23:57 AM CST
#
# Copyright (C) 2011 Richard A. Johnson <nixternal@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... | nixternal/activeworks2gdocs | orig.aw2gd.py | Python | gpl-3.0 | 10,584 |
# /* PANDABEGINCOMMENT
# *
# * Authors:
# * Tim Leek tleek@ll.mit.edu
# * Ryan Whelan rwhelan@ll.mit.edu
# * Joshua Hodosh josh.hodosh@ll.mit.edu
# * Michael Zhivich mzhivich@ll.mit.edu
# * Brendan Dolan-Gavitt brendandg@gatech.edu
# *
# * This work is licensed under t... | KernelAnalysisPlatform/kvalgrind | qemu/panda_plugins/syscalls/syscall_parser.py | Python | gpl-3.0 | 16,902 |
# https://www.codewars.com/kata/reverse-polish-notation-calculator/train/python
def calc(expr):
import re # For regex
import operator # For doing operations
# Print the arguments
print('expr = <{}>'.format(expr))
# Put the expression into a list
expr_list = expr.split()
print('expr_list = <{}>'.format(expr_l... | pcampese/codewars | reverse_polish_notation2.py | Python | gpl-3.0 | 2,190 |
#from app import app, lm
#from app import socketio
from flask import request, redirect, render_template, url_for, flash
from flask.ext.wtf import Form
from wtforms import StringField
from wtforms.validators import DataRequired
import os
from flask import Flask
class TextForm(Form):
"""Login form to access writing ... | akanimax/CL-3_lab_2017 | Assignment_B2/Plag_checker.py | Python | gpl-3.0 | 2,002 |
import pytest
from hbayesdm.models import ts_par4
def test_ts_par4():
_ = ts_par4(
data="example", niter=10, nwarmup=5, nchain=1, ncore=1)
if __name__ == '__main__':
pytest.main()
| CCS-Lab/hBayesDM | Python/tests/test_ts_par4.py | Python | gpl-3.0 | 201 |
# This file is part of Tasks.
#
# Tasks 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.
#
# Tasks is distributed in the hope tha... | jorisv/RBDynUrdf | binding/python/generate.py | Python | gpl-3.0 | 3,124 |
# -*- 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 vers... | studio1247/gertrude | paques.py | Python | gpl-3.0 | 1,082 |
# -*- encoding: utf-8 -*-
"""Implements different locators for UI"""
from selenium.webdriver.common.by import By
from .model import LocatorDict
common_locators = LocatorDict({
# common locators
"body": (By.CSS_SELECTOR, "body"),
# Notifications
"notif.error": (
By.XPATH, "//div[contains(@c... | sghai/robottelo | robottelo/ui/locators/common.py | Python | gpl-3.0 | 9,297 |
# -*- coding: utf-8 -*-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class MegavideoCom(DeadHoster):
__name__ = "MegavideoCom"
__type__ = "hoster"
__version__ = "0.23"
__status__ = "stable"
__pattern__ = r'http://(?:www\.)?megavideo\.com/\?.*&?(d|v)=\w+'
_... | fzimmermann89/pyload | module/plugins/hoster/MegavideoCom.py | Python | gpl-3.0 | 596 |
from contextlib import contextmanager
from django.core.exceptions import ValidationError
from django.test import TestCase
from django.utils import timezone
from .models import Person, Residence, RegistryUser, Registrar
from .models import BirthNote, BirthPlace, ApplicantInfo, BirthNoteLaw, BirthEvidence
class TestC... | cl0ne/vital-records-registry | registry/vital_records/tests.py | Python | gpl-3.0 | 7,137 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 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.
#
# Thi... | OpenNingia/l5r-character-manager | l5rcm/api/insight.py | Python | gpl-3.0 | 3,390 |
# -*- coding: utf-8 -*-
# * Copyright (C) 2012-2013 Croissance Commune
# * Authors:
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
# * Pettier Gabriel;
# * TJEBBES Gaston <g.t@majerti.fr>
#
# This file is part of Autonomie : Progiciel de gestion de CAE.
#
# Autonomie is... | CroissanceCommune/autonomie | autonomie/forms/holiday.py | Python | gpl-3.0 | 2,323 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the BipComposer project.
# Copyright (C) 2013 Morwenn
# Contact: Morwenn <morwenn29@hotmail.fr>
#
# 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... | Morwenn/BipComposer | bipcomposer/gui/CanvasScore.py | Python | gpl-3.0 | 7,175 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-22 09:54
from __future__ import unicode_literals
import ckeditor.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_blogpost_loggeneral'),
]
operations = [
migratio... | Macpotty/logRobocon | logRobocon/apps/blog/migrations/0005_auto_20160522_1754.py | Python | gpl-3.0 | 496 |
# Copyright (C) 2016 Pier Carlo Chiodi
#
# 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... | pierky/ripe-atlas-monitor | pierky/ripeatlasmonitor/Helpers.py | Python | gpl-3.0 | 8,807 |
#!/usr/bin/env python2
'''
genPOI.py
Scans regionsets for TileEntities and Entities, filters them, and writes out
POI/marker info.
A markerSet is list of POIs to display on a tileset. It has a display name,
and a group name.
markersDB.js holds a list of POIs in each group
markers.js holds a list of which markerSet... | kevinwchang/Minecraft-Overviewer | overviewer_core/aux_files/genPOI.py | Python | gpl-3.0 | 21,247 |
"""
Given a string 's' and a dictionary of words 'dict', determine if s can be segmented into a space-separated sequence of one or more dictionary words. Return true is so, and false otherwise.
For example:
s = "practicemakespermanent",
dict = ["makes", "permanent", "practice"].
f(s) // true
"""
s = ... | kekoa428/Interview-Prep | words_in_string.py | Python | gpl-3.0 | 712 |
class Solution:
def trailingZeroes(self, n: int) -> int:
powers_of_5 = []
for i in range(1, 10):
powers_of_5.append(5 ** i)
return sum(n // power_of_5 for power_of_5 in powers_of_5)
| 1337/yesterday-i-learned | leetcode/172e.py | Python | gpl-3.0 | 222 |
from mcpi.minecraft import Minecraft
from time import sleep
mc = Minecraft.create()
class mic:
x=0
y=0
z=0
u=1
def usid(self):
t=mc.getPlayerEntityIds()
print t
def uspos(self,wkj):
self.x,self.y,self.z = mc.entity.getPos(wkj)
print self.x,self.y,self.z
... | jacchwill/will-minecraft | 1003.py | Python | gpl-3.0 | 552 |
"""
thetvdb.com Python API
(c) 2009 James Smith (http://loopj.com)
(c) 2014 Wayne Davison <wayne@opencoder.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 2 of the License, or
(at... | KODeKarnage/script.sub.missing | resources/lib/thetvdbapi.py | Python | gpl-3.0 | 10,006 |
"""
LGPL v3 License
More information from the user maplewolf on Kaggle.Implementation of sample attack."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import os
import numpy as np
from scipy.misc import imread, imsave
import tensorflow as ... | maplewolf/kg-adv-models | targeted_attack/attack_triple_iter_target_class.py | Python | gpl-3.0 | 11,966 |
# -*- coding: utf-8 -*-
import os
from Config import Config
from Options import Options
from definitions import *
from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
def celsius():
config = Config()
regions = config.getSolids() + config.getFluids()
for region in regions:
... | zagl/chtrun | lib/cht/celsius.py | Python | gpl-3.0 | 526 |
#!/usr/bin/python
import matplotlib.pyplot as plt
def prepare_figure_for_publication(ax=None,
width_cm=None,
width_inches=None,
height_cm=None,
height_inches=None,
fontsize=None,
fontsize_labels=None,
fontsiz... | cpbl/cpblUtilities | matplotlib_utils.py | Python | gpl-3.0 | 7,242 |
# -*- coding: utf-8 -*-
# Copyright (C) Cardiff University (2020)
#
# This file is part of ciecplib.
#
# ciecplib 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 ... | duncanmmacleod/ligo.org | ciecplib/sessions.py | Python | gpl-3.0 | 1,712 |
#!/usr/bin/env python
__author__ = 'Mike McCann,Duane Edgington,Danelle Cline'
__copyright__ = '2018'
__license__ = 'GPL v3'
__contact__ = 'duane at mbari.org'
__doc__ = '''
Master loader for all CANON May-June Campaign 2018
Mike McCann, Duane Edgington, Danelle Cline
MBARI 15 May 2018
@var __date__: Date of last s... | danellecline/stoqs | stoqs/loaders/CANON/loadCANON_september2018.py | Python | gpl-3.0 | 20,474 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Jakub Beranek
#
# This file is part of Devi.
#
# Devi 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, version 3 of the License, or
# (at yo... | Kobzol/debug-visualizer | gui/config.py | Python | gpl-3.0 | 2,272 |
#!/bin/python
# -*- coding: utf-8 -*-
# ####################################################################
# gofed-ng - Golang system
# Copyright (C) 2016 Fridolin Pokorny, fpokorny@redhat.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Lice... | gofed/gofed-ng | common/service/storageService.py | Python | gpl-3.0 | 1,413 |
""" Copyright 2009 Philip Dorrell http://www.1729.com/ (email: http://www.1729.com/email.html)
This file is part of Aptrow ("Advance Programming Technology Read-Only Webification": http://www.1729.com/aptrow/)
Aptrow is free software: you can redistribute it and/or modify it under the terms of the GNU General... | pdorrell/aptrow | aptrow_server.py | Python | gpl-3.0 | 1,772 |
# (c) 2015, Ovais Tariq <me@ovaistariq.net>
#
# This file is part of mha_helper
#
# 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... | ovaistariq/mha-helper | mha_helper/config_helper.py | Python | gpl-3.0 | 8,633 |
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2016 Chris Lamb <lamby@debian.org>
#
# diffoscope 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,... | ReproducibleBuilds/diffoscope | diffoscope/comparators/utils/container.py | Python | gpl-3.0 | 7,045 |
# -*- ENCODING: UTF-8 -*-
"""
* File: Globales.py
* Authors: Miguel Ochoa Hernandez
*
"""
from Componentes.TablaSimbolos import TablaSimbolos
# from . import Globales
__author__ = "Miguel Ochoa Hernandez"
tabla_simbolos = TablaSimbolos()
ambito = "global"
ambitos_anteriores = []
mientras = -1
condicion_simple =... | Mike325/MiniC-Compiler | Componentes/Globales.py | Python | gpl-3.0 | 2,430 |
import subprocess
import sys
import re
try:
# Make terminal colors work on windows
import colorama
colorama.init()
except ImportError:
pass
def add_nanopb_builders(env):
'''Add the necessary builder commands for nanopb tests.'''
# Build command that runs a test program and saves the output
... | kasbah/slim_looper | src/protocol/nanopb/tests/site_scons/site_init.py | Python | gpl-3.0 | 3,700 |
#!/usr/bin/env python
#
# Copyright 2014 Matthew Wall
# See the file LICENSE.txt for your rights.
"""Driver for CC3000 data logger
http://www.rainwise.com/products/attachments/6832/20110518125531.pdf
There are a few variants:
CC-3000_ - __
| |
| 41 = 418 MHz
| 42 = 433 MHz
| __ =... | MLAB-project/weewx | bin/weewx/drivers/cc3000.py | Python | gpl-3.0 | 42,551 |
import xbmcaddon
MainBase = 'http://164.132.106.213/data/home/home.txt'
addon = xbmcaddon.Addon('plugin.video.sneek') | gypogypo/plugin.video.sneek | _Edit.py | Python | gpl-3.0 | 121 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
# $Id: vboxshell.py $
"""
VirtualBox Python Shell.
This program is a simple interactive shell for VirtualBox. You can query
information and issue commands from a simple command line.
It also provides you with examples on how to use VirtualBox's Python API.
This shell is even... | ruibarreira/linuxtrail | usr/lib/virtualbox/vboxshell.py | Python | gpl-3.0 | 120,819 |
# -*- coding: utf-8 -*-
from resources.lib.gui.gui import cGui
from resources.lib.gui.guiElement import cGuiElement
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.parser import cParser
from resources.lib import logger
from resources.lib.handler.ParameterHandler import Paramete... | Shinoby1992/xstream | sites/hdfilme_tv.py | Python | gpl-3.0 | 13,459 |
#
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This application is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This application is di... | MLAB-project/satellite-observer | gr-sat_observer/python/__init__.py | Python | gpl-3.0 | 1,155 |
import select
import socket
import numpy
import numpy as np
import time
import zmq
from urh.dev.gr.AbstractBaseThread import AbstractBaseThread
from urh.util.Logger import logger
class SenderThread(AbstractBaseThread):
MAX_SAMPLES_PER_TRANSMISSION = 65536
def __init__(self, freq, sample_rate, bandwidth, ga... | splotz90/urh | src/urh/dev/gr/SenderThread.py | Python | gpl-3.0 | 2,568 |
import argparse
import os
import subprocess
import sys
SCRIPT_DIR = os.path.dirname(__file__)
class ExecException(Exception):
pass
class Exec(object):
@staticmethod
def run(cmd, workingdir=None):
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=workingdir)
... | sh4d0/openvix | manage.py | Python | gpl-3.0 | 3,933 |
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
(r'^kipa/', include('tupa.urls')),
(r'^admin/', include(admin.site.urls)),
)
if settings.DEBUG :
urlpatterns += patterns('',
... | siimeon/Kipa | web/urls.py | Python | gpl-3.0 | 485 |