code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
import CCDroplet
import CC_params
import CC_out
import LiquidVaporEq
| ernestyalumni/Propulsion | ccdroplet/ccdroplet/__init__.py | Python | gpl-2.0 | 69 |
# -*- coding: utf-8 -*-
import os
from subprocess import PIPE
from subprocess import Popen
import jinja2
DIST_PATH = "..\\build\\exe.win32-3.6"
# Get list of files and directory to install/uninstall
INSTALL_FILES = []
INSTALL_DIRS = []
os.chdir(os.path.join(os.path.dirname(__file__), DIST_PATH))
for root, dirs, fil... | bsmr-Bitcraze/crazyflie-clients-python | win32install/generate_nsis.py | Python | gpl-2.0 | 1,303 |
# -*- coding: utf-8 -*-
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from builtins import round
import gdb
import re
import zlib
import sys
from datetime import timedelta
if sys.version_info.... | ptesarik/crash-python | crash/cache/syscache.py | Python | gpl-2.0 | 6,029 |
# -*- coding: utf-8 -*-
import os
import unittest
import inotify.constants
import inotify.calls
import inotify.adapters
import inotify.test_support
try:
unicode
except NameError:
_HAS_PYTHON2_UNICODE_SUPPORT = False
else:
_HAS_PYTHON2_UNICODE_SUPPORT = True
class TestInotify(unittest.TestCase):
def... | dsoprea/PyInotify | tests/test_inotify.py | Python | gpl-2.0 | 17,960 |
from bottle import request
from sqlalchemy import exc
from libraries.database import engine as db
from libraries.template import view
from libraries.status import Status
from libraries.authentication import login_required
from libraries.forms import Name as Form
from libraries.forms import Blank as BlankForm
from libra... | evrom/genitag | controllers/config/profile/name.py | Python | gpl-2.0 | 1,881 |
#!/usr/bin/python
"""
S. Leon @ ALMA
Classes, functions to be used for the array configuration evaluation with CASA
HISTORY:
2011.11.06:
- class to create the Casas pads file from a configuration file
2011.11.09:
- Class to compute statistics on the baselines
2012.03.07L... | itoledoc/gWTO3 | arrayConfigurationTools.py | Python | gpl-2.0 | 6,911 |
from __future__ import absolute_import
import time
import threading
from . import log
# Exceptions
class IndexError(Exception):
"""IndexError: a Data History index is out of range
"""
pass
class DataFailure(Exception):
"""DataError: a problem occurred while trying to collect the data,
(ie, wh... | hexdump42/boris-tool | boris/boristool/common/datacollect.py | Python | gpl-2.0 | 13,580 |
# Copyright (c) 2011 CSIRO
# Australia Telescope National Facility (ATNF)
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# PO Box 76, Epping NSW 1710, Australia
# atnf-enquiries@csiro.au
#
# This file is part of the ASKAP software distribution.
#
# The ASKAP software distribution is free softwar... | ATNF/askapsdp | Code/Base/py-accessor/current/askap/accessors/__init__.py | Python | gpl-2.0 | 991 |
#
# The Python Imaging Library
# $Id: ImagePath.py,v 1.2 2007/06/17 14:12:15 robertoconnor Exp $
#
# path interface
#
# History:
# 1996-11-04 fl Created
# 2002-04-14 fl Added documentation stub class
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1996.
#
# See the README file for ... | arpruss/plucker | plucker_desktop/installer/osx/application_bundle_files/Resources/parser/python/vm/PIL/ImagePath.py | Python | gpl-2.0 | 1,472 |
# Copyright (C) 2014 Linaro Limited
#
# Author: Neil Williams <neil.williams@linaro.org>
#
# This file is part of LAVA Dispatcher.
#
# LAVA Dispatcher 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 ver... | inwotep/lava-dispatcher | lava_dispatcher/pipeline/action.py | Python | gpl-2.0 | 24,016 |
import web
import json
import datetime
import time
import uuid
#from mimerender import mimerender
#import mimerender
from onsa_jeroen import *
render_xml = lambda result: "<result>%s</result>"%result
render_json = lambda **result: json.dumps(result,sort_keys=True,indent=4)
render_html = lambda result: "<html><body>%s<... | viswimmer1/PythonGenerator | data/python_files/33855741/web_reserver-bak.py | Python | gpl-2.0 | 1,001 |
import requests
from bs4 import BeautifulSoup
import sys
import os
import pandas
import re
targetURL = "http://www.ubcpress.ca/search/subject_list.asp?SubjID=45"
bookLinks = "http://www.ubcpress.ca/search/"
outputDir = "UBC_Output"
def main():
r = requests.get(targetURL)
soup = BeautifulSoup(r.content, "ht... | reidmcy/pressScrapers | ubcScraper.py | Python | gpl-2.0 | 2,909 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Author: Thomas Beucher
Module: Experiments
Description: Class used to generate all the trajectories of the experimental setup and also used for CMAES optimization
'''
import numpy as np
import time
#from Utils.ThetaNormalization import normalization, unNormalization... | osigaud/ArmModelPython | Control/Experiments/Experiments.py | Python | gpl-2.0 | 14,422 |
# Copyright 2016 Anonymous researcher(s)
# This file is part of BinaryNet.
# BinaryNet 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 ... | BinaryNet/BinaryNet | Train-time/mnist.py | Python | gpl-2.0 | 7,657 |
#!/usr/bin/python
# pdev
# pdev cbd
# pdev asd cbd
# pdev asd sd cbd
from hba_util import HBA
from raid_util import Raid_Util
from subdev import *
def test_create_remove_raid(raid_util, bdevs):
sub_dev_list = []
for bdev in bdevs:
path = '/dev/' + bdev
sub_dev_list.append(path)
raid_util... | bistack/pyStorageBenchmarkTools | test_raid.py | Python | gpl-2.0 | 1,856 |
#########################################################################################################
# ml_input_utils.py
# One of the Python modules written as part of the genericQSARpyUtils project (see below).
#
# ################################################
# #ml_input_utils.py: Key documentation :Contents#... | RichardLMR/generic-qsar-py-utils | code/ml_input_utils.py | Python | gpl-2.0 | 21,062 |
'''
Implementation in scipy form of the Double Pareto-Lognormal Distribution
'''
import numpy as np
from scipy.stats import rv_continuous, norm
def _pln_pdf(x, alpha, nu, tau2):
A1 = np.exp(alpha * nu + alpha ** 2 * tau2 / 2)
fofx = alpha * A1 * x ** (-alpha - 1) *\
norm.cdf((np.log(x) - nu - alpha ... | Astroua/plndist | pln_distrib.py | Python | gpl-2.0 | 1,319 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
from __future__ import print_function
__author__ = 'gpanda'
"""References:
[1] easy thread-safe queque, http://pymotw.com/2/Queue/
"""
import argparse
import collections
import fileinput
import os
import pprint
import re
import string
import sys
import threading
import ... | gpanda/abrisk | fundlist.py | Python | gpl-2.0 | 8,887 |
import paypalrestsdk
import logging
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from settings import PAYPAL_MODE, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET
def paypal_create(request):
"""
MyApp ... | cs98jrb/Trinity | mysite/mysite/paypal.py | Python | gpl-2.0 | 3,013 |
# Copyright 2015 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | windskyer/mvpn | mvpn/conf/opts.py | Python | gpl-2.0 | 2,699 |
# -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2011, 2012, 2013, 2014 CERN.
##
## Invenio 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 (... | MSusik/invenio | invenio/ext/sqlalchemy/__init__.py | Python | gpl-2.0 | 7,341 |
#!/usr/bin/env python
def capable(d1,d2):
for key in d1.keys():
if not d2.has_key(key) or d1[key] > d2[key]
return False
return True
def main(s):
count = {}
for c in s:
if count.has_key(c):
count[c] += 1
else:
count[c] = 1
A_count = { key:count[key]/2 for key in count.keys()... | ryota-sugimoto/hackerrank | strings/reverse_shuffle_merge/reverse_shuffle_merge.py | Python | gpl-2.0 | 514 |
#!/usr/bin/python
#
# Fabien Chereau fchereau@eso.org
#
import gzip
import os
def writePolys(pl, f):
"""Write a list of polygons pl into the file f.
The result is under the form [[[ra1, de1],[ra2, de2],[ra3, de3],[ra4, de4]], [[ra1, de1],[ra2, de2],[ra3, de3]]]"""
f.write('[')
for idx, poly in enumer... | Stellarium/stellarium | util/skyTile.py | Python | gpl-2.0 | 4,700 |
import os
import shutil
import struct
from cStringIO import StringIO
from tempfile import mkstemp
from tests import TestCase, add
from mutagen.mp4 import MP4, Atom, Atoms, MP4Tags, MP4Info, \
delete, MP4Cover, MP4MetadataError
from mutagen._util import cdata
try: from os.path import devnull
except ImportError: de... | spr/OggifyOSX | mutagen/tests/test_mp4.py | Python | gpl-2.0 | 19,301 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2013, IOhannes m zmölnig, IEM
# This file is part of WILMix
#
# 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 th... | iem-projects/WILMAmix | WILMA/net/resolv.py | Python | gpl-2.0 | 2,201 |
# This software is Copyright (C) 2004-2008 Bristol University
# and is released under the GNU General Public License version 2.
import unittest
from Powers import Powers
from Polynomial import Polynomial
import Taylor
class Sine(unittest.TestCase):
def test_terms(self):
s = Taylor.Sine(1, 0)
se... | Peter-Collins/NormalForm | src/py/TaylorTest.py | Python | gpl-2.0 | 4,842 |
#!/usr/bin/env python3
# copyright (C) 2021- The University of Notre Dame
# This software is distributed under the GNU General Public License.
# See the file COPYING for details.
# Example on how to execute python code with a Work Queue task.
# The class PythonTask allows users to execute python functions as Work Que... | btovar/cctools | work_queue/src/bindings/python3/PythonTask_example.py | Python | gpl-2.0 | 2,499 |
import argparse
import csv
import codecs
import configparser
import xml.etree.ElementTree as ET
import re
from SvgTemplate import SvgTemplate, TextFilter, ShowFilter, BarcodeFilter, StyleFilter, SvgFilter
from SvgTemplate import clean_units, units_to_pixels, strip_tag
class LabelmakerInputException(Exception):
pass... | ducky64/labelmaker | labelmaker.py | Python | gpl-2.0 | 5,429 |
# -*- encoding: utf-8 -*-
from __future__ import division
import itertools
import operator
import collections
debug = True
to_bin = lambda integer: zero_filler(bin(integer)[2:])
def zero_filler(filling_string):
result = ""
if len(filling_string) != 4:
result = filling_string
else:
return ... | izevg/CryptoLabs | first_lab.py | Python | gpl-2.0 | 8,202 |
#!/usr/bin/env python
#
# Copyright 2011 Vikraman Choudhury <vikraman.choudhury@gmail.com>
# Copyright 2012 G. Gaydarov <ggaydarov@gmail.com>
#
# Distributed under the terms of the GNU General Public License v2 or later
from __future__ import print_function
import sys
import argparse
import gentoolkit
from .app_util... | gg7/gentoostats | pym/gentoostats/argument_parser_wrapper.py | Python | gpl-2.0 | 6,535 |
#!/usr/bin/python3
#
# This file is part of Progesterone pipeline.
#
# Progesterone pipeline 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 v... | ivanamihalek/progesterone | 16_UCSC_sources_to_ENCODE.py | Python | gpl-2.0 | 3,087 |
from pyramid.view import view_config
@view_config(name='sso', renderer='templates/login.pt')
def sign_on(context, request):
""" Perform the SAML2 SSO dance.
- If the request already has valid credentials, process the 'SAMLRequest'
query string value and return a POSTing redirect.
- If processing t... | karlproject/karl.saml2 | karl/saml2/identity.py | Python | gpl-2.0 | 473 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import MySQLdb as mdb
import uuid, pprint
def generate(data):
gdata = []
for grade in range(1,4):
for clazz in range(1,10):
if grade != data['grade_number'] and clazz != data['class_number']:
gdata.append("insert into classes(uuid, grade_number, class_number, sch... | aaronzhang1990/workshare | test/python/addClasses.py | Python | gpl-2.0 | 1,111 |
# coding: utf-8
"""
MoinMoin wiki stats about updated pages
Config example::
[wiki]
type = wiki
wiki test = http://moinmo.in/
The optional key 'api' can be used to change the default
xmlrpc api endpoint::
[wiki]
type = wiki
api = ?action=xmlrpc2
wiki test = http://moinmo.in/
"""
import ... | psss/did | did/plugins/wiki.py | Python | gpl-2.0 | 2,703 |
import os, sys, re, json
from praw2 import Reddit
reload(sys)
try:
from xbmc import log
except:
def log(msg):
print(msg)
sys.setdefaultencoding("utf-8")
CLIENT_ID = 'J_0zNv7dXM1n3Q'
CLIENT_SECRET = 'sfiPkzKDd8LZl3Ie1WLAvpCICH4'
USER_AGENT = 'sparkle streams 1.0'
class SubRedditEvents(object):
as... | RuiNascimento/krepo | plugin.video.sparkle/resources/lib/modules/subreddits.py | Python | gpl-2.0 | 3,534 |
from enigma import eTimer, iServiceInformation, iPlayableService, ePicLoad, RT_VALIGN_CENTER, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER, gFont, eListbox, ePoint, eListboxPythonMultiContent, eServiceCenter, getDesktop
from Components.MenuList import MenuList
from Screens.Screen import Screen
from Screens.Service... | n3wb13/OpenNfrGui-5.0-1 | lib/python/Plugins/Extensions/bmediacenter/src/MC_AudioPlayer.py | Python | gpl-2.0 | 56,958 |
# Copyright (C) 2017 Open Information Security Foundation
# Copyright (c) 2015-2017 Jason Ish
#
# You can copy, redistribute or modify this Program under the terms of
# the GNU General Public License version 2 as published by the Free
# Software Foundation.
#
# This program is distributed in the hope that it will be us... | jasonish/suricata-update | suricata/update/parsers.py | Python | gpl-2.0 | 9,857 |
# encoding: utf-8
# module apt_pkg
# from /usr/lib/python3/dist-packages/apt_pkg.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
"""
Classes and functions wrapping the apt-pkg library.
The apt_pkg module provides several classes and functions for accessing
the functionality provided by the apt-pkg library. Typica... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/apt_pkg/Cdrom.py | Python | gpl-2.0 | 1,751 |
#
# Copyright (C) 2010 Google Inc.
#
# 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 distributed in... | sigmike/ganeti | lib/runtime.py | Python | gpl-2.0 | 3,423 |
def standard_process_to_geoserver():
# check no data value
print "standard_process_to_geoserver"
def _process():
# process to 3857 or 4326
print "process to 3857 or 4326"
| geobricks/geobricks_data_scripts | geobricks_data_scripts/utils/process/process_raster.py | Python | gpl-2.0 | 192 |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
# All Rights Reserved
# Credits#######################################... | 3dfxsoftware/cbss-addons | price_structure/model/sale.py | Python | gpl-2.0 | 10,026 |
# -*- coding: utf-8 -*-
"""
* Copyright (c) 2017 SUSE LLC
*
* openATTIC 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 2.
*
* This package is distributed in the hope that it will be usefu... | openattic/openattic | backend/ceph_nfs/views/ganesha_mgr_view.py | Python | gpl-2.0 | 4,167 |
# coding: utf-8
#import pygame
from Tkinter import *
import ttk
import time
from PIL import ImageTk,Image
from functools import partial
import os
import tkMessageBox
from urllib2 import *
from threading import Thread
import urllib as u
from window import *
#############################################################... | notesoftware/notestudio | main.py | Python | gpl-2.0 | 8,246 |
from .plots import Plot,PlotError
from .. import context
from .. import items
from .. import maps
from .. import waypoints
from .. import monsters
from .. import dialogue
from .. import services
from .. import teams
from .. import characters
import random
from .. import randmaps
from .. import stats
from .. import spel... | jwvhewitt/dmeternal | old_game/narrator/encounters.py | Python | gpl-2.0 | 6,062 |
#importacion de librerias
import sys
reload(sys)
sys.setdefaultencoding('UTF8')
if len(sys.argv)>1: #si el argumento existe
archive = open(sys.argv[1],"r")
text = []
for i in archive:
text.append(i)
for j in i:
print unicode(j) | ppizarror/Ned-For-Spod | bin/internal/langeditor/_delspecial.py | Python | gpl-2.0 | 283 |
from datetime import datetime
from mechanize import Browser
from FrenchLawModel import Text, Article, Version, Law
from page import ConstitutionPage, ArticlePage
class LegifranceClient(object):
host = 'http://www.legifrance.gouv.fr/'
def __init__(self):
self.user_agent = 'Mozilla/4.0 (compatible; M... | ewandor/git-french-law | LegifranceClient/__init__.py | Python | gpl-2.0 | 2,270 |
import BaseHTTPServer
import thread
import urlparse
import string
from move import Move
from move import MoveInfo
from battery import BatteryStatus
move = Move()
def sendResponse(s, code, message):
print "... ", s.path
s.send_response(code)
s.send_header("Content-type", "text/html")
s.end_headers()
m = "<ht... | ioanaantoche/muhaha | ioana/server/handlers/MainHandler.py | Python | gpl-2.0 | 4,568 |
from datetime import datetime
import cProfile
# Invokes the profiler when processing a query.
# Postprocess results with:
# pyprof2calltree -k -i /tmp/*.pro
#
# or, when kcachegrind is not available, you can also use
# cprofilev -f /tmp/*.pro
# navigate to http://127.0.0.1:4000
class ProfileMiddleware(obj... | briot/geneapro | backend/backend/middleware/profile.py | Python | gpl-2.0 | 892 |
from distutils.core import setup
import sys
import py2exe
try:
scriptName = sys.argv[3]
except IndexError:
print "Usage: python setup.py py2exe -i nombreApp"
sys.exit(2)
# Para crear el exe hay que ir al cmd y correr python setup.py py2exe
setup(
name=scriptName,
version="2.0",
... | pepitogithub/PythonScripts | setup.py | Python | gpl-2.0 | 852 |
'''
Filter text output by date ranges
'''
import os
import csv
import sys
import dateutil.parser
import argparse
import metadata
settings = None
def get_settings():
''' Return command-line settings '''
parser = argparse.ArgumentParser(description='Filter text corpus by date range. Only updates the metadata file.'... | mwidner/WebArchiveTextTools | src/filter_dates.py | Python | gpl-2.0 | 1,597 |
"""
support for presenting detailed information in failing assertions.
"""
import py
import sys
import pytest
from _pytest.monkeypatch import monkeypatch
from _pytest.assertion import util
def pytest_addoption(parser):
group = parser.getgroup("debugconfig")
group.addoption('--assert', action="store", dest="ass... | snim2/rcsp | _pytest/assertion/__init__.py | Python | gpl-2.0 | 4,366 |
from b_hash import b_hash
from b_hash import NoData
from jenkins import jenkins
from h3_hash import h3_hash
from jenkins import jenkins_fast, jenkins_wrapper
from graph import *
from collections import deque
from bitstring import BitArray
import math
class bdz(b_hash):
"""Class for perfect hash function generated... | vhavlena/appreal | netbench/pattern_match/bin/library/bdz.py | Python | gpl-2.0 | 9,513 |
# -*- coding: utf-8 -*-
"""
celery.utils.log
~~~~~~~~~~~~~~~~
Logging utilities.
"""
from __future__ import absolute_import, print_function
import logging
import numbers
import os
import sys
import threading
import traceback
from contextlib import contextmanager
from billiard import current_process, uti... | liberorbis/libernext | env/lib/python2.7/site-packages/celery/utils/log.py | Python | gpl-2.0 | 9,145 |
#!/usr/bin/env python
"""
Defines the core learning framework.
The framework defined by `score`, `predict`, and `SGD` is defined in
section 3.2 of the paper. See `evenodd.py` for a simple example
(corresponding to table 3).
This core framework is also all that is needed for simple semantic
parsing: section 4.1 of th... | cgpotts/annualreview-complearning | learning.py | Python | gpl-2.0 | 6,866 |
#!/usr/local/bin/python3.4
# dbh.ph debounce hardware
"""
Pyboard:
Switch pins: Y1 or X19
usage:
>>> init()
>>> loop()
"""
from pyb import ExtInt,Pin
# declare the pin id
pinId = 'X19' # interrupt 0 'Y1' # interrupt 6
# itnerrupt mechanics and debounce globals
flag= False
interCount=0
eObj = None
# define ISR
d... | gratefulfrog/ArduGuitar | Ardu2/design/POC-3_MAX395/pyboard/DraftDevt/dbh.py | Python | gpl-2.0 | 761 |
# repoclosure.py
# DNF plugin adding a command to display a list of unresolved dependencies
# for repositories.
#
# Copyright (C) 2015 Igor Gnatenko
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Publi... | fedora-copr/dnf-plugins-core | plugins/repoclosure.py | Python | gpl-2.0 | 5,281 |
import sys,numpy,matplotlib
import matplotlib.pyplot, scipy.stats
import library
def colorDefiner(epoch):
if epoch == '0':
theColor='blue'
elif epoch == '0.5':
theColor='red'
elif epoch == '1':
theColor='green'
elif epoch == '1.5':
theColor='orange'
else:
pr... | adelomana/viridis | growthAnalysis/epochGrapher.py | Python | gpl-2.0 | 2,642 |
#!/usr/bin/python
import sys
import pickle
import os
import hashlib
import pprint
import time
from optparse import OptionParser
VERSION=1.0
def parseOptions():
usage = """
%prog [options]\n
Scrub a given directory by calculating the md5 hash of every file and compare
it with... | fdawg4l/chksumtree | chksumtree.py | Python | gpl-2.0 | 7,453 |
"""Utilities functions which assist in the generation of commonly required data
structures from the products of placement, allocation and routing.
"""
from collections import defaultdict
from six import iteritems, itervalues
import warnings
from rig.place_and_route.machine import Machine, Cores, SDRAM, SRAM
from r... | project-rig/rig | rig/place_and_route/utils.py | Python | gpl-2.0 | 13,067 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "json_schema.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| richardjmarini/JsonSchema | manage.py | Python | gpl-2.0 | 254 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Modulos
import sys
import pygame
from pygame.locals import *
# Constantes
venx = 640
veny = 448
# Clases
class Pieza(pygame.sprite.Sprite): # 64x64 px tamaño
def __init__(self, tipo):
pygame.sprite.Sprite.__init__(self)
if tipo == 0:
... | LordSprit/Laser | main.py | Python | gpl-2.0 | 2,036 |
## Copyright 2001-2007 Virtutech AB
##
## The contents herein are Source Code which are a subset of Licensed
## Software pursuant to the terms of the Virtutech Simics Software
## License Agreement (the "Agreement"), and are being distributed under
## the Agreement. You should have received a copy of the Agreem... | iniverno/RnR-LLC | simics-3.0-install/simics-3.0.31/home/scripts/ia64-linux.py | Python | gpl-2.0 | 21,269 |
#!/usr/bin/env python3
import os
from pathlib import Path
from scripts.build_env import BuildEnv, Platform
from scripts.platform_builder import PlatformBuilder
class pugixmlLinuxBuilder(PlatformBuilder):
def __init__(self,
config_package: dict=None,
config_platform: dict=None):
... | lovewinds/story-project | external/scripts/packages/pugixml/linux.py | Python | gpl-2.0 | 1,214 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2014 David Vavra (vavra.david@email.cz)
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 Lice... | david-vavra/pyrage | pyrage/modules/dns.py | Python | gpl-2.0 | 1,216 |
#!/usr/bin/python2.7
from dragonnest.settings import STATIC_ROOT
from skills.models import *
from PIL import Image, ImageDraw, ImageFont
import os
_ASCIIMAP = [chr(n) for n in ([45] + range(48, 58) + range(65, 91) + [95] + range(97, 123))]
_ALPHABET = dict(zip(range(64), _ASCIIMAP))
_ALPHABET_REVERSE = dict(zip(_ASCII... | kalhartt/yadnss | django/skills/utils.py | Python | gpl-2.0 | 4,764 |
"""
Virtualization installation functions.
Currently somewhat Xen/paravirt specific, will evolve later.
Copyright 2006-2008 Red Hat, Inc.
Michael DeHaan <mdehaan@redhat.com>
Original version based on virtguest-install
Jeremy Katz <katzj@redhat.com>
Option handling added by Andrew Puch <apuch@redhat.com>
Simplified ... | charles-dyfis-net/koan | koan/xencreate.py | Python | gpl-2.0 | 5,855 |
# -*- coding: utf-8 -*-
# Copyright 2011 Jaap Karssenberg <jaap.karssenberg@gmail.com>
import tests
import gtk
import pango
from zim.index import Index, IndexPath, IndexTag
from zim.notebook import Path
from zim.gui.pageindex import FGCOLOR_COL, \
EMPTY_COL, NAME_COL, PATH_COL, STYLE_COL
# Explicitly don't import... | tmhorne/simplewiki | tests/tags.py | Python | gpl-2.0 | 11,780 |
from _sigar import *
| gitpan/hyperic-sigar | bindings/python/sigar.py | Python | gpl-2.0 | 21 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# check_config.py
#
# Copyright 2012 Curtis Adkins <curtadkins@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 ... | CPrompt/DiamondBack | check_config.py | Python | gpl-3.0 | 4,482 |
#!/usr/bin/python3
import os
import sys
INSTALLER_VERSION = '"latest"'
def create_installer_config(path):
"""Create a basicl installation configuration file"""
config = u"template=file:///etc/ister.json\n"
jconfig = u'{"DestinationType" : "physical", "PartitionLayout" : \
[{"disk" : "vda", "partition... | bryteise/ister | vm-installation-image-post-update-version.py | Python | gpl-3.0 | 3,122 |
# (c) 2012, 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) any lat... | kuno/ansible | lib/ansible/constants.py | Python | gpl-3.0 | 6,435 |
from gene_acronym_query import GeneAcronymQuery
query = GeneAcronymQuery()
gene_info = query.get_data('ABAT')
for gene in gene_info:
print "%s (%s)" % (gene['name'], gene['organism']['name'])
| wvangeit/AllenSDK | doc_template/examples/data_api_client_ex2.py | Python | gpl-3.0 | 197 |
"""Options list for system config."""
import os
from collections import OrderedDict
from lutris import runners
from lutris.util import display, system
def get_optirun_choices():
"""Return menu choices (label, value) for Optimus"""
choices = [("Off", "off")]
if system.find_executable("primusrun"):
... | daniel-j/lutris | lutris/sysoptions.py | Python | gpl-3.0 | 12,134 |
# Reference
# Script, Category, Subcategory, case, value, referenceGlyph, filter
# Letters
*,Letter,*,upper,1.25,H,*,
*,Letter,*,smallCaps,1.1,h.sc,*,
*,Letter,*,lower,1,x,*,
*,Letter,*,minor,0.7,m.sups,.sups,
# Numbers
*,Number,Decimal Digit,*,1.2,one,*,
*,Number,Decimal Digit,*,1.2,zero.osf,.osf,
*,Number,Fraction... | huertatipografica/HTLetterspacer | Examples/ExampleFont-Glyphs3_autospace.py | Python | gpl-3.0 | 826 |
"""
model_b.py
by Ted Morin
contains a function to predict 2-year Incident Hypertension risks using Weibull beta coefficients from:
10.7326/0003-4819-148-2-200801150-00005
2008 A Risk Score for Predicting Near-Term Incidence of Hypertension
Framingham Heart Study
translated and adapted from from FHS online risk calc... | doirisks/dori | models/10.7326:0003-4819-148-2-200801150-00005/model_b.py | Python | gpl-3.0 | 1,569 |
# -*- encoding: utf-8 -*-
"""Test class for InterSatellite Sync feature
:Requirement: Satellitesync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: UI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from robottelo.decorators import (
run_only_on,
stubbed,
tier1,
t... | sghai/robottelo | tests/foreman/ui/test_satellitesync.py | Python | gpl-3.0 | 3,555 |
#!/usr/bin/env python
#coding:utf-8
# Author: mozman --<mozman@gmx.at>
# Purpose: test mixin Clipping
# Created: 31.10.2010
# Copyright (C) 2010, Manfred Moitzi
# License: GPLv3
import unittest
from svgwrite.mixins import Clipping
from svgwrite.base import BaseElement
class SVGMock(BaseElement, Clippin... | hirobert/svgwrite | tests/test_clipping.py | Python | gpl-3.0 | 800 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/victorgarric/Documents/INVENTAIRE/principal.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QWidget
from PyQt5.Qt... | dedichan/ChemDB | principal.py | Python | gpl-3.0 | 18,412 |
# -*- coding: utf-8 -*-
import random
import sys
import pygame
import classes.board
import classes.extras as ex
import classes.game_driver as gd
import classes.level_controller as lc
class Board(gd.BoardGame):
def __init__(self, mainloop, speaker, config, screen_w, screen_h):
self.level = lc.Level(self,... | imiolek-ireneusz/pysiogame | game_boards/game013.py | Python | gpl-3.0 | 6,163 |
from Hypotheses import *
from ModelSelection import LinearRegression
from Test import *
sigma = 5 # observation noise sigma
##############################################################################
# Synthetic tests
##############################################################################
from Test import ... | mdbenito/ModelSelection | src/LocalTests.py | Python | gpl-3.0 | 2,638 |
__author__ = 'adalekin'
import re
import requests
import hashlib
from PIL import Image, ImageOps
from cStringIO import StringIO
from xparse.parser import *
from xparse.utils import get_in_dict, set_in_dict
class URLExtractor(object):
def __init__(self, regex, parser_class):
self.regex = re.compile(rege... | adalekin/xparse | xparse/factory.py | Python | gpl-3.0 | 6,048 |
from django.db import models
class Music(models.Model):
url = models.CharField('URL', max_length=255)
title = models.CharField('título', max_length=200, blank=True)
artist = models.CharField('artista', max_length=200, blank=True)
genre = models.CharField('gênero', max_length=100, blank=True)
file ... | Lrcezimbra/ganso-music | gansomusic/core/models.py | Python | gpl-3.0 | 355 |
"""
Kaggle上的Quora question pairs比赛,按照Abhishek Thakur的思路,把整个流程跑通了
讲解的文章https://www.linkedin.com/pulse/duplicate-quora-question-abhishek-thakur。
里面有两个实现,基于传统机器学习模型的实现和基于深度学习的实现,这段脚本是后者。
基本的思路比较简单,不清楚的地方也添加了注释。使用GloVe的词向量库,把每个句子转换成词向量
拼接起来的矩阵,之后就可以搭建神经网络了。自己在Convolution1D、LSTM和DropOut那一块儿还
有些迷糊。
"""
import pandas as pd
... | LiuDongjing/myworks | 样例代码/deepnet.py | Python | gpl-3.0 | 11,241 |
# This file is part of kytos.
#
# Copyright (c) 2014 by ACK Labs
#
# Authors:
# Beraldo Leal <beraldo AT acklabs DOT io>
# Gabriel von. Winckler <winckler AT acklabs DOT io>
# Gustavo Luiz Duarte <gustavo AT acklabs DOT io>
#
# kytos is free software: you can redistribute it and/or modify
# it under the terms ... | acklabs/kytos | kytos/rest.py | Python | gpl-3.0 | 10,831 |
# 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 | indico/modules/events/contributions/operations.py | Python | gpl-3.0 | 9,065 |
#!/usr/bin/env python2.7
# pyCream - CREAM Client API Python
#
# Copyright (C) 2010, 2011 Maciej Sitarz
#
# Written by Maciej Sitarz
#
# 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 ve... | maciex/pyCream | examples/tryInfo.py | Python | gpl-3.0 | 4,461 |
'''
This script will remove the directories if that contains only xml files.
'''
import os
srcpath = raw_input("Enter the source path : ")
for root, sub, files in os.walk(os.path.abspath(srcpath)):
if files:
files = [f for f in files if not f.endswith('.xml')]
if not files:
fpath = os... | arulalant/CMIPs-Handler | scripts/mv/rm_dirs_contains_only_if_xml.py | Python | gpl-3.0 | 427 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | Petr-Kovalev/nupic-win32 | tests/integration/py2/nupic/opf/prediction_metrics_manager_test.py | Python | gpl-3.0 | 1,275 |
### Use pydoc.render_doc(<mod>) to output contents of generated help to a string
###
import sys
import os
import glob
from os.path import join, getsize
import re
import json
def is_pkg(path_parts, files):
return "__init__.py" in files
def count_class_refs(class_name, all_files):
"""
Patterns:
=\s+<cl... | jacksonofalltrades/pydocmap | pydoclib/treegen.py | Python | gpl-3.0 | 4,798 |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
from json import loads
from pprint import pprint
from sys import argv
import urllib
class FREEBASE_KEY():
'''
please input the api_key here
'''
api_key = 'AIzaSyBWsQpGo34Lk0Qa3wD0kjW5H1Nfb2m5eaM'
def get_city_id(city_name... | edenzik/elastiCity | api/yelp/freebase_key_needed_final.py | Python | gpl-3.0 | 2,478 |
import shelve
db = shelve.open('class-shelve')
for key in db:
print(key, '=>\n)', db[key].name, db[key].pay)
bob = db['bob']
print(bob.lastName())
print(db['tom'].lastName) | ViMiao/PythonLearning | ProgrammingPython/C01/dump_db_classes.py | Python | gpl-3.0 | 177 |
# -*- coding: utf-8 -*-
'''
Author: Robin David
License: GNU GPLv3
Repo: https://github.com/RobinDavid
Copyright (c) 2012 Robin David
PyStack 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 ... | RobinDavid/pystack | pystack/layers/udp_application.py | Python | gpl-3.0 | 6,311 |
## @file hopfield_network.py
# HopfieldNetwork implementation
# Логика обучения была взята из https://github.com/pmatigakis/hopfieldnet
## @package artificial_networks
# @author Evtushenko Georgy
# @date 05/03/2015 17:19:00
# @version 1.1
## @mainpage Metanet documentation
# @section intro_sec Introduction
# ... | senior-zero/metanet | metanet/networks/artificial_networks/hopfield_network.py | Python | gpl-3.0 | 5,218 |
from setuptools import setup, find_packages
from helga_spook import __version__ as version
setup(name='helga-spook',
version=version,
description=('prints nsa buzzwords'),
classifiers=['Development Status :: 4 - Beta',
'License :: OSI Approved :: GNU General Public License v3 (GPL... | michaelorr/helga-spook | setup.py | Python | gpl-3.0 | 1,038 |
#! /usr/bin/env python
import sys
import os
import re
import string
from xml.dom import minidom
from volk_regexp import *
from make_cpuid_c import make_cpuid_c
from make_cpuid_h import make_cpuid_h
from make_set_simd import make_set_simd
from make_config_fixed import make_config_fixed
from make_typedefs import make_ty... | tta/gnuradio-tta | volk/gen/volk_register.py | Python | gpl-3.0 | 10,640 |
"""Clears the Cache"""
from django.core.cache import cache
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Clears the Cache
"""
help = "Clears the Cache"
def handle(self, **options):
"""Clears the Cache"""
cache.clear()
self.stdout.... | podiobooks/podiobooks | podiobooks/management/commands/clear_cache.py | Python | gpl-3.0 | 345 |
rules = [
{
"name": "always false",
"rule": lambda container: False
}
]
| piontec/docker-enforcer | rules/rules.py | Python | gpl-3.0 | 96 |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 14 14:10:41 2016
@author: sigurdja
"""
from setuptools import setup, find_packages
setup(
name="psse_models",
version="0.1",
packages=find_packages(),
) | Hofsmo/psse_models | setup.py | Python | gpl-3.0 | 223 |
#coding=UTF-8
"""
This file is part of GObjectCreator.
GObjectCreator 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.
GObjectCreator is di... | ThomasBollmeier/GObjectCreator | gobject_creator/ui/goceditor.py | Python | gpl-3.0 | 6,193 |
#-*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------
OpenVolunteer
Copyright 2009, Ludovic Rivallain
---------------------------------------------------------------------------
This file is part of OpenVo... | lrivallain/openvolunteer | forms.py | Python | gpl-3.0 | 2,333 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.