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 |
|---|---|---|---|---|---|
from GangaCore.GPIDev.Lib.Tasks import ITask
from GangaCore.GPIDev.Schema import Schema, Version
########################################################################
class CoreTask(ITask):
"""General non-experimentally specific Task"""
_schema = Schema(Version(1, 0), dict(ITask._schema.datadict.items())... | ganga-devs/ganga | ganga/GangaCore/GPIDev/Lib/Tasks/CoreTask.py | Python | gpl-3.0 | 474 |
# coding: utf-8
# license: GPLv3
from enemies import *
from hero import *
def annoying_input_int(message =''):
answer = None
while answer == None:
try:
answer = int(input(message))
except ValueError:
print('Вы ввели недопустимые символы')
return answer
def game_tou... | mipt-cs-on-python3/arithmetic_dragons | tournament.py | Python | gpl-3.0 | 1,950 |
# -*- coding: utf-8 -*-
__all__ = [
"test_config_db",
"test_grid",
"test_shell",
"test_svn",
]
if __name__ == "__main__" :
import doctest
for i in __all__ :
print ("%%-%ds: %%s" % (max(map(len, __all__)) + 1)) % (
i,
doctest.testmod(__import__(i, None, None, [i... | spikeekips/source-over-ssh | src/tests/__init__.py | Python | gpl-3.0 | 344 |
#!/usr/bin/python
# MinerLite - A client side miner controller.
# This will launch cgminer with a few delay seconds and
# retrieve the local data and post it into somewhere!
#
# Author: Yanxiang Wu
# Release Under GPL 3
# Used code from cgminer python API example
import socket
import json
import sys
import subproc... | cecilulysess/MinerLite | main.py | Python | gpl-3.0 | 1,792 |
#!/usr/bin/python
import re
import sys
import os
import getopt
import vcf
def main():
params = parseArgs()
vfh = vcf.Reader(open(params.vcf, 'r'))
#grab contig sizes
contigs = dict()
for c,s in vfh.contigs.items():
contigs[s.id] = s.length
regions = list()
this_chrom = None
start = int()
stop = int()
... | tkchafin/scripts | findBreaksVCF.py | Python | gpl-3.0 | 3,606 |
from aospy import Run
am2_control = Run(
name='am2_control',
description=(
'Preindustrial control simulation.'
),
data_in_direc=('/archive/Yi.Ming/sm2.1_fixed/'
'SM2.1U_Control-1860_lm2_aie_rerun6.YIM/pp'),
data_in_dur=5,
data_in_start_date='0001-01-01',
data_in_e... | spencerkclark/aospy-obj-lib | aospy_user/runs/cases.py | Python | gpl-3.0 | 6,191 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#Copyright (C) 2013 Jonathan Delvaux <dumpformat@djoproject.net>
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#an... | djo938/dumpFormat | dumpformat/test/test.py | Python | gpl-3.0 | 1,155 |
# tool_extrude.py
# Extrusion tool.
# Copyright (c) 2015, Lennart Riecken
#
# 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 versi... | chrmoritz/zoxel | src/plugins/tool_extrude.py | Python | gpl-3.0 | 6,660 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import scipy as sp
#Nome do arquivo em que está os dados da posição
arq = 'CurvaGiro/pos.dat'
#Limites dos eixos
v = [-10,1000, 0, 1000]
#Título eixo x
xl = r'y metros'
#Título do eixo y
yl = r'x metros'
x = sp.genfromtxt('CurvaGiro/pos.dat... | asoliveira/NumShip | scripts/entrada/padrao/plot-1cg.py | Python | gpl-3.0 | 489 |
from quicktions import Fraction
from . import (
_update,
deprecated,
enumerate,
format,
get,
illustrators,
io,
iterate,
iterpitches,
lyconst,
lyenv,
makers,
mutate,
persist,
string,
wf,
)
from ._version import __version__, __version_info__
from .bind impo... | Abjad/abjad | abjad/__init__.py | Python | gpl-3.0 | 11,596 |
"""Address model tests."""
from core.models import Address
from core.factory import AddressFactory
from tests.utils import ModelTestCase
class AddressTest(ModelTestCase):
"""Test the Address model."""
model = Address
field_tests = {
'line1': {
'verbose_name': 'ligne 1',
'... | oser-cs/oser-website | tests/test_core/test_address.py | Python | gpl-3.0 | 1,331 |
# Copyright © 2013, 2015, 2016, 2017, 2018, 2020, 2022 Tom Most <twm@freecog.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | twm/yarrharr | yarrharr/application.py | Python | gpl-3.0 | 20,459 |
import logging
from functools import reduce
import nanoget.utils as ut
import pandas as pd
import sys
import pysam
import re
from Bio import SeqIO
import concurrent.futures as cfutures
from itertools import repeat
def process_summary(summaryfile, **kwargs):
"""Extracting information from an albacore summary file.... | wdecoster/nanoget | nanoget/extraction_functions.py | Python | gpl-3.0 | 18,527 |
# author David Sanchez david.sanchez@lapp.in2p3.fr
# ------ Imports --------------- #
import numpy
from Plot.PlotLibrary import *
from Catalog.ReadFermiCatalog import *
from environ import FERMI_CATALOG_DIR
# ------------------------------ #
#look for this 2FGL source
source = "2FGL J1015.1+4925"
#source = "1FHL J2158... | qpiel/python_estimation_source | Example/ExReadFermiCatalog.py | Python | gpl-3.0 | 1,737 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
author: Alex Apostoli
based on https://github.com/hkm95/python-multiwii
which is under GPLv3
"""
import struct
import time
import sys
import re
class MSPItem:
def __init__(self, name, fmt, fields):
self.name = name
self.format ... | squilter/ardupilot | libraries/AP_MSP/Tools/pymsp.py | Python | gpl-3.0 | 18,847 |
#!/usr/bin/env python
# encoding: UTF-8
"""
This file is part of Commix Project (http://commixproject.com).
Copyright (c) 2014-2017 Anastasios Stasinopoulos (@ancst).
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 Soft... | hackersql/sq1map | comm1x/src/core/injections/controller/shell_options.py | Python | gpl-3.0 | 8,306 |
#!/usr/bin/python2.7
from boto.glacier.layer1 import Layer1
from boto.glacier.concurrent import ConcurrentUploader
import sys
import os.path
from time import gmtime, strftime
access_key_id = "xxx"
secret_key = "xxx"
target_vault_name = "xxx"
inventory = "xxx"
# the file to be uploaded into the vault as an archive
... | kickino/aws-scripts | glacier/glacier_push.py | Python | gpl-3.0 | 896 |
from shutil import copyfile
from datetime import datetime
from ExcelMapper.mapper import *
import xlrd
import xlsxwriter
row_rules_sheet1_t1 = {
'found "risk"': lambda data: 'risk' in data['type'],
'found "Risk"': lambda data: 'Risk' in data['type'],
'found "reward"(ignore letter casing)': lambda data: 'rew... | Theyrealone/ExcelMapper | run.py | Python | gpl-3.0 | 2,567 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2019 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | davidam/python-examples | scikit/latentsemantic.py | Python | gpl-3.0 | 2,544 |
from __future__ import print_function
import gettext
import gi
gi.require_version('Peas', '1.0')
from gi.repository import GObject
from gi.repository import Peas
from gi.repository import Peasy
from gi.repository import Geany
gettext.bindtextdomain("peasy", "/home/kugel/dev/geany.git/build-linux/dest/share/locale")
... | kugel-/peasy | plugins/peasypytest.py | Python | gpl-3.0 | 1,239 |
#
# Race Capture App
#
# Copyright (C) 2014-2017 Autosport Labs
#
# This file is part of the Race Capture App
#
# This 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 ... | autosportlabs/RaceCapture_App | spacer.py | Python | gpl-3.0 | 1,123 |
import os
from pypers.core.step import CmdLineStep
class ReorderSam(CmdLineStep):
spec = {
"version": "0.0.1",
"descr": [
"Runs ReorderSam to reorder chromosomes into GATK order"
],
"args":
{
"inputs": [
{
"name" ... | frankosan/pypers | pypers/steps/picard/reordersam.py | Python | gpl-3.0 | 1,863 |
# -*- coding: utf-8 -*-
"""
ORCA Open Remote Control Application
Copyright (C) 2013-2020 Carsten Thielepape
Please contact me by : http://www.orca-remote.org/
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publ... | thica/ORCA-Remote | src/scripts/tools/tool_repositorymanager/RepManager.py | Python | gpl-3.0 | 16,092 |
#!/usr/bin/env python2
import sys
import math
from PyQt5 import QtWidgets
from PyQt5 import QtGui
from PyQt5 import QtCore
from mainwindow import Ui_MainWindow
from scapy.all import *
""" dump any string, ascii or encoded, to formatted hex output """
def dumpString(src, length=16):
FILTER = ''.join([(len(repr(chr... | etrombly/snort-rule-tool | snort-rule-tool.py | Python | gpl-3.0 | 14,091 |
#!/usr/bin/env python
"""
Pegasus utility functions for pasing a kickstart output file and return wanted information
"""
##
# Copyright 2007-2010 University Of Southern California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... | elainenaomi/sciwonc-dataflow-examples | sbbd2016/experiments/1-postgres/3_workflow_full_10files_primary_nosh_nors_annot_with_proj_3s/pegasus.bDkvI/pegasus-4.6.0/lib/python2.7/dist-packages/Pegasus/tools/kickstart_parser.py | Python | gpl-3.0 | 21,415 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys,os
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from model import MainModel
from view import MainView
class App(QtWidgets.QApplication):
def __init__(self, scriptpath, sys_argv):
super(App, self).__init__(sys_argv)
self.model = MainModel()
... | flexi-framework/hopr | tools/blockgridgenerator/main.py | Python | gpl-3.0 | 603 |
from channels.auth import channel_session_user_from_http
from .models import Stream, Notification
import redis
import ast
from .task import sendNotifications, send_notifications
from channels import Group
import json
redis_con = redis.Redis('demo.scorebeyond.com', 8007)
subs = redis_con.pubsub()
subs.subscribe('test')... | bkaganyildiz/StreamBasedNotification | StreamBasedNotifs/capture/consumer.py | Python | gpl-3.0 | 1,668 |
"""effcalculator URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... | alvcarmona/efficiencycalculatorweb | effcalculator/effcalculator/urls.py | Python | gpl-3.0 | 915 |
#!/usr/bin/python
# $Id:$
from base import Display, Screen, ScreenMode, Canvas
from pyglet.libs.win32 import _kernel32, _user32, types, constants
from pyglet.libs.win32.constants import *
from pyglet.libs.win32.types import *
class Win32Display(Display):
def get_screens(self):
screens = []
def en... | joaormatos/anaconda | Anaconda/pyglet/canvas/win32.py | Python | gpl-3.0 | 3,404 |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
import re
from dadict import DADict
from error import log_loading
############
## Consts ##
############
ETHER_ANY = "\... | isislovecruft/switzerland | switzerland/lib/shrunk_scapy/data.py | Python | gpl-3.0 | 5,617 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
r"""Pychemqt, Chemical Engineering Process simulator
Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@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 Softwa... | jjgomera/pychemqt | lib/EoS/Cubic/RKTwu.py | Python | gpl-3.0 | 2,929 |
from flask import Blueprint
from flask import flash
from flask import make_response, render_template
from flask_login import current_user
from markupsafe import Markup
from app.helpers.data_getter import DataGetter
from app.helpers.auth import AuthManager
from app.helpers.exporters.ical import ICalExporter
from app.he... | gaeun/open-event-orga-server | app/views/users/export.py | Python | gpl-3.0 | 2,211 |
__author__ = 'Mayur M'
import ImgIO
def add(image1, image2): # add two images together
if image1.width == image2.width and image1.height == image2.height:
return_red = []
return_green = []
return_blue = []
for i in range(0, len(image1.red)):
tmp_r = image1.red[i] + ima... | mm10ws/ImPy | ImAdd.py | Python | gpl-3.0 | 1,485 |
"""
Decode all-call reply messages, with downlink format 11
"""
from pyModeS import common
def _checkdf(func):
"""Ensure downlink format is 11."""
def wrapper(msg):
df = common.df(msg)
if df != 11:
raise RuntimeError(
"Incorrect downlink format, expect 11, got {}"... | junzis/pyModeS | pyModeS/decoder/allcall.py | Python | gpl-3.0 | 1,888 |
from typing import List
class Message(object):
class Origin(object):
servername: str
nickname: str
username: str
hostname: str
command: str
origin: Origin
params: List[str]
| LastAvenger/labots | labots/common/message.py | Python | gpl-3.0 | 223 |
"""pybackup - Backup Plugin for MySQL Database
"""
import os
from pybackup import errors
from pybackup import utils
from pybackup.logmgr import logger
from pybackup.plugins import BackupPluginBase
from pysysinfo.mysql import MySQLinfo
__author__ = "Ali Onur Uyar"
__copyright__ = "Copyright 2011, Ali Onur Uyar"
__cr... | aouyar/pybackup | pybackup/plugins/mysql.py | Python | gpl-3.0 | 4,714 |
#!/usr/bin/python
import os
import glob
import cgi
import PrintPages_test as pt
address = cgi.escape(os.environ["REMOTE_ADDR"])
script = "Main Model Form"
pt.write_log_entry(script, address)
pt.print_header('GrowChinook', 'Std')
pt.print_full_form(None, None, 'in', 'RunModel.py')
extension = 'csv'
os.chdir('uploads')... | ReservoirWebs/GrowChinook | Test_test.py | Python | gpl-3.0 | 429 |
# coding: utf-8
class Solution(object):
@staticmethod
def dfs(candidates, target, vis, res, cur_idx, sum):
if sum > target:
return
if sum == target:
ans = [candidates[i] for i in cur_idx if i >= 0]
res.append(ans)
return
if sum < target:
... | ShengRang/c4f | leetcode/combination-sum-ii.py | Python | gpl-3.0 | 1,342 |
# coding=utf-8
# Title:大幂次运算
# 给你两个正整数a(0 < a < 100000)和n(0 <= n <=100000000000),计算(a^n) % 20132013并输出结果
import math
# Test
a,n =10000,10000000
# Answer
ret = 1 #余数
def PowerMod(a, n, ret):
if n == 0:
return ret
if n % 2: # n为奇数
ret = ret * a % 20132013
return PowerM... | RYLF/pythontip | 33.py | Python | gpl-3.0 | 479 |
import unittest
from ctauto.exceptions import CTAutoMissingEndOfMetablockError, \
CTAutoBrokenEndOfMetablockError, \
CTAutoInvalidMetablockError, \
CTAutoInvalidIdError, \
CTAutoMissingEndOfStringErr... | vasili-v/ctauto | test/test_parser.py | Python | gpl-3.0 | 9,771 |
"""Basic tests for the CherryPy core: request handling."""
from cherrypy.test import test
test.prefer_parent_path()
import os
localDir = os.path.dirname(__file__)
import cherrypy
access_log = os.path.join(localDir, "access.log")
error_log = os.path.join(localDir, "error.log")
# Some unicode strings.
... | mattsch/Sickbeard | cherrypy/test/test_logging.py | Python | gpl-3.0 | 5,090 |
from typing import Optional
from django.contrib.auth.models import User
from jba_core import exceptions
def get_user_by_credentials(username: str, password: str) -> Optional[User]:
try:
user = User.objects.get(username=username)
if not user.check_password(password):
raise exceptions.... | JointBox/jbaccess-server | jbaccess/jba_core/service/UserService.py | Python | gpl-3.0 | 481 |
from vsg.rules import token_indent
from vsg import token
lTokens = []
lTokens.append(token.generic_clause.generic_keyword)
class rule_002(token_indent):
'''
This rule checks the indent of the **generic** keyword.
**Violation**
.. code-block:: vhdl
entity fifo is
generic (
... | jeremiah-c-leary/vhdl-style-guide | vsg/rules/generic/rule_002.py | Python | gpl-3.0 | 575 |
#!/usr/bin/env python3
import os
import pathlib
import sysconfig
import compileall
import subprocess
prefix = pathlib.Path(os.environ.get('MESON_INSTALL_PREFIX', '/usr/local'))
datadir = prefix / 'share'
destdir = os.environ.get('DESTDIR', '')
if not destdir:
print('Compiling gsettings schemas...')
subproces... | sramkrishna/eidisi | scripts/meson_post_install.py | Python | gpl-3.0 | 838 |
# -*- coding: utf-8 -*-
# Copyright (c) 2010 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing a dialog to enter the data for a copy or rename operation.
"""
from __future__ import unicode_literals
import os.path
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QDialog, QDia... | testmana2/test | Plugins/VcsPlugins/vcsMercurial/HgCopyDialog.py | Python | gpl-3.0 | 2,379 |
# ===========================================================================
# This file contain some utilities for the course
# ===========================================================================
from __future__ import print_function, division, absolute_import
import os
import sys
import time
import shutil
f... | trungnt13/BAY2-uef17 | utils.py | Python | gpl-3.0 | 7,061 |
from dungeon.dungeon import Dungeon, Hub
from entity.player.players import Player, Party
import entity.item.items as items
import sys, os
import base
import web.server
try:
import dill
except:
dill = None
PARTY = Party()
class Manager:
def __init__(self):
self.checked = False
def get_current_release(self):
... | microwaveabletoaster/dunces-and-dungeons | dunces-and-dungeons.py | Python | gpl-3.0 | 5,516 |
import os
import sys
import shutil
import straight.plugin
import numpy as np
import pkg_resources
from os import path
from core import utils
from core import argparser
from core import log
from core import parser
def main():
## Parse arguments
ap = argparser.init_arg_parser()
options = ap.parse_args()
... | satriaphd/bgc-learn | bgc-learn.py | Python | gpl-3.0 | 18,044 |
from SimpleLexicon import SimpleLexicon
from LOTlib.Evaluation.EvaluationException import RecursionDepthException
class RecursiveLexicon(SimpleLexicon):
"""
A lexicon where word meanings can call each other. Analogous to a RecursiveLOTHypothesis from a LOTHypothesis.
To achieve this, we require the LOThy... | ebigelow/LOTlib | LOTlib/Hypotheses/Lexicon/RecursiveLexicon.py | Python | gpl-3.0 | 1,491 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main.ui'
#
# Created by: PyQt4 UI code generator 4.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
... | kanishkarj/Rave | Qt_Designer_files/main_design.py | Python | gpl-3.0 | 20,258 |
# -*- coding: utf-8 -*-
#
# codimension - graphics python two-way code editor and analyzer
# Copyright (C) 2010-2017 Sergey Satskiy <sergey.satskiy@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 Softw... | SergeySatskiy/codimension | codimension/utils/config.py | Python | gpl-3.0 | 1,187 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-07 23:52
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tableaubord', '0041_auto_20170507_2344'),
]
operations = [
mi... | MLOrsini/ProjetWEB | INSport/tableaubord/migrations/0042_auto_20170507_2352.py | Python | gpl-3.0 | 561 |
#!/usr/bin/python
import os
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
time=["06"]
year=["2013"]
param=["129.128","130.128","131.128","132.128","157.128","151.128"]
nam=["hgt","air","uwnd","vwnd","rhum","psl"]
#month=["01","02","03","04","05","06","07","08","09","10","11","12"]
for y in year:
... | CopyChat/Plotting | Python/download_era-interim.py | Python | gpl-3.0 | 1,297 |
# coding=utf-8
from _commandbase import RadianceCommand
from ..datatype import RadiancePath, RadianceTuple
from ..parameters.gensky import GenskyParameters
import os
class Gensky(RadianceCommand):
u"""
gensky - Generate an annual Perez sky matrix from a weather tape.
The attributes for this class and th... | antonszilasi/honeybeex | honeybeex/honeybee/radiance/command/gensky.py | Python | gpl-3.0 | 5,946 |
from nose.tools import *
from DeckMaker.notetranslator import NoteTranslator
def setup():
print "SETUP!"
def teardown():
print "TEAR DOWN!"
def test_basic():
t = NoteTranslator()
assert_equal(t.GetMidiCodeForHumans("E5"),64)
assert_equal(t.GetMidiCodeForHumans("C1"),12)
assert_equal(t.GetM... | bradrowesf/AnkiDeckMaker | tests/notetranslator_tests.py | Python | gpl-3.0 | 1,526 |
# -*- coding: utf-8 -*-
import sys
import os
import logging
import random
import PyQt4
from PyQt4.QtCore import *
#from PyQt4.QtCore import QAbstractTableModel
import constants
class Model(QAbstractTableModel):
keys = list()
modelType = None
def __init__(self, parent = None):
''' '''
... | CaesarTjalbo/musictagger | mp3names/model_classes.py | Python | gpl-3.0 | 3,029 |
# -*- coding: utf-8 -*-
class System(object):
""" This is the father class for all different systems. """
def __init__(self, *args, **kwargs):
pass
def update(self, dt):
raise NotImplementedError
| eeneku/baller | src/engine/system.py | Python | gpl-3.0 | 235 |
import socket
import argparse
import sys
import magic_ping
import os
import settings
import signal
import logging
import struct
logging.basicConfig(format=u'%(levelname)-8s [%(asctime)s] %(message)s', level=logging.DEBUG, filename=u'client.log')
# Обработка CTRL+C
def signal_handler(signal, frame):
print("\nSTOP... | byDimasik/Magic_Ping | client.py | Python | gpl-3.0 | 2,642 |
# =============================================================================
# Copyright [2013] [Kevin Carter]
# License Information :
# This software has no warranty, it is provided 'as is'. It is your
# responsibility to validate the behavior of the routines and its accuracy
# using the code provided. Consult the ... | cloudnull/tribble-api | tribble/api/views/zones_rest.py | Python | gpl-3.0 | 12,756 |
# -*- coding: utf-8 -*-
# Copyright 2013 Fanficdownloader team, 2015 FanFicFare team
#
# 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
#
# Un... | PlushBeaver/FanFicFare | fanficfare/adapters/adapter_literotica.py | Python | gpl-3.0 | 17,171 |
# 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 in the hope that it will be... | parpg/parpg | parpg/components/container.py | Python | gpl-3.0 | 4,212 |
#!/usr/bin/env python
from flask import Flask, render_template, request, jsonify, session, redirect, escape, url_for
import MySQLdb
import bcrypt
from esipy import App
from esipy import EsiClient
from esipy import EsiSecurity
from esipy.exceptions import APIException
import time
import json
import requests
import datet... | Madpilot0/EVE-Farm | app.py | Python | gpl-3.0 | 14,554 |
# Created By: Virgil Dupras
# Created On: 2010-02-05
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/g... | stuckj/dupeguru | qt/base/details_dialog.py | Python | gpl-3.0 | 1,600 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# line_follower.py
#
# Copyright 2011 Manuel Martín Ortiz <mmartinortiz@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
# ... | mmartinortiz/pyePuck | examples/line_follower.py | Python | gpl-3.0 | 3,739 |
from django.contrib import admin
from iitem_database.models import Item, ItemClass, Area, Creature, Drops, Found, UserItems, ItemReview
admin.site.register(Item)
admin.site.register(ItemClass)
admin.site.register(Area)
admin.site.register(Creature)
admin.site.register(Drops)
admin.site.register(Found)
admin.site.regis... | svilaa/item_database | item_database/iitem_database/admin.py | Python | gpl-3.0 | 366 |
#!/sw/bin/python2.7
import sys
sys.path.append("..")
from ucnacore.PyxUtils import *
from math import *
from ucnacore.LinFitter import *
#from UCNAUtils import *
from bisect import bisect
from calib.FieldMapGen import *
def clip_function(y,rho,h,R):
sqd = sqrt(rho**2-y**2)
if sqd==0:
sqd = 1e-10
return h*rho**2... | UCNA/main | Scripts/plotters/LarmorClipping.py | Python | gpl-3.0 | 8,636 |
#
# Authors: Roy Dragseth (roy.dragseth@cc.uit.no)
# Bas van der Vlies (basv@sara.nl)
#
# SVN INFO:
# $Id$
#
"""
Usage: from PBSQuery import PBSQuery
This class gets the info from the pbs_server via the pbs.py module
for the several batch objects. All get..() functions return an dictionary
with id as key a... | VPAC/pbs_python | src/PBSQuery.py | Python | gpl-3.0 | 17,223 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/yc/code/calibre/calibre/src/calibre/gui2/preferences/look_feel.ui'
#
# Created: Thu Oct 25 16:54:55 2012
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui... | yeyanchao/calibre | src/calibre/gui2/preferences/look_feel_ui.py | Python | gpl-3.0 | 19,303 |
# coding:utf-8
"""
Author : qbeenslee
Created : 2014/12/12
"""
import re
# 客户端ID号
CLIENT_ID = "TR5kVmYeMEh9M"
'''
传输令牌格式
加密方式$迭代次数$盐$结果串
举个栗子:
====start====
md5$23$YUXQ_-2GfwhzVpt5IQWp$3ebb6e78bf7d0c1938578855982e2b1c
====end====
'''
MATCH_PWD = r"md5\$(\d\d)\$([a-zA-Z0-9_\-]{20})\$([a-f0-9]{32}... | qbeenslee/Nepenthes-Server | config/configuration.py | Python | gpl-3.0 | 1,315 |
# -*- coding: utf-8 -*-
# generated from catkin/cmake/template/__init__.py.in
# keep symbol table as clean as possible by deleting all unnecessary symbols
from os import path as os_path
from sys import path as sys_path
from pkgutil import extend_path
__extended_path = "/home/pi/Documents/desenvolvimentoRos/src/tf2_r... | UnbDroid/robomagellan | Codigos/Raspberry/desenvolvimentoRos/devel/lib/python2.7/dist-packages/tf2_ros/__init__.py | Python | gpl-3.0 | 1,035 |
#!/usr/bin/python
# Nathan Harmon
# https://github.com/nharmon/bogie-five
#
# Turn program
#
from Motion import *
import sys
if __name__ == '__main__':
if len(sys.argv) < 2:
exit("Must specify target image file")
try:
drive = Drive()
drive.turn(float(sys.argv[1]))
except:
... | nharmon/bogie-five | src/turn.py | Python | gpl-3.0 | 356 |
# This file is part of ICLS.
#
# ICLS 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.
#
# ICLS is distributed in the hope that it will ... | timbotron/ICLS | framework.py | Python | gpl-3.0 | 2,817 |
# Copyright (C) 2012 Statoil ASA, Norway.
#
# The file 'ecl_kw.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 th... | iLoop2/ResInsight | ThirdParty/Ert/devel/python/python/ert/enkf/enkf_main.py | Python | gpl-3.0 | 13,314 |
'''
This file is part of pyShop
pyShop 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.
pyShop is distributed in the hope that it will be us... | Uruwolf/pyshop | products/admin.py | Python | gpl-3.0 | 1,218 |
# Copyright (C) 2010 Canonical
#
# Authors:
# Didier Roche <didrocks@ubuntu.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; version 3.
#
# This program is distributed in the hope that it... | Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/oneconf/packagesethandler.py | Python | gpl-3.0 | 6,034 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import markdown
from markdown.treeprocessors import Treeprocessor
from markdown.blockprocessors import BlockProcessor
import re
from markdown import util
import xml.etree.ElementTree as ET
import copy
from markdown.inlinepatterns im... | the-new-sky/BlogInPy | markdown/extensions/smartLegend.py | Python | gpl-3.0 | 10,615 |
# This file is part of DevParrot.
#
# Author: Matthieu Gautier <matthieu.gautier@devparrot.org>
#
# DevParrot 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
... | mgautierfr/devparrot | devparrot/core/ui/statusBar.py | Python | gpl-3.0 | 3,065 |
from Sire.Base import *
from Sire.IO import *
from Sire.Mol import *
from glob import glob
from nose.tools import assert_equal, assert_almost_equal
# Check that we have Mol2 support in this version of Sire.
has_mol2 = True
try:
p = Mol2()
except:
# No Mol2 support.
has_mol2 = False
# General test of abi... | michellab/SireUnitTests | unittests/SireIO/test_mol2.py | Python | gpl-3.0 | 5,051 |
''' Dialogs and widgets Responsible for creation, restoration of accounts are
defined here.
Namely: CreateAccountDialog, CreateRestoreDialog, RestoreSeedDialog
'''
from functools import partial
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectPrope... | valesi/electrum | gui/kivy/uix/dialogs/create_restore.py | Python | gpl-3.0 | 11,183 |
# Copyright (c) 2013-2016 Jeffrey Pfau
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from ._pylib import ffi, lib
from . import tile
from cached_property import cach... | fr500/mgba | src/platform/python/mgba/core.py | Python | mpl-2.0 | 4,578 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
Define the Expansion Valve component.
"""
from scr.logic.components.component import Component as Cmp
from scr.logi... | arkharin/OpenCool | scr/logic/components/expansion_valve/theoretical.py | Python | mpl-2.0 | 1,392 |
import datetime
import pytest
from tests.test_utils import create_generic_job
from treeherder.model.models import Push
@pytest.fixture
def perf_push(test_repository):
return Push.objects.create(
repository=test_repository,
revision='1234abcd',
author='foo@bar.com',
time=datetime.... | KWierso/treeherder | tests/etl/conftest.py | Python | mpl-2.0 | 561 |
import hashlib
import json
import sys
import traceback
from datetime import datetime, timedelta
from functools import wraps
from uuid import uuid4
import newrelic.agent
import waffle
from constance import config
from django.apps import apps
from django.conf import settings
from django.core.exceptions import Validation... | jgmize/kuma | kuma/wiki/models.py | Python | mpl-2.0 | 73,565 |
from django.db import models
from metronus_app.model.actor import Actor
from metronus_app.model.task import Task
class GoalEvolution(models.Model):
"""
Each time the goal or the price per unit/hour from a task is changed, a new entry is created in the log
Maybe should have been named TaskLog, but...
"... | Metronus/metronus | Metronus-Project/metronus_app/model/goalEvolution.py | Python | mpl-2.0 | 791 |
#!/usr/bin/env python
import csv
import json
import sys
import click
def score(company, sexbiases):
"""
Given a company record with board of directors and executive names,
return our guess of the % of governance that is male.
Since names are not always unambiguous determinants of sex, we also
r... | hipsterware/scoreline | toys/corpscore.py | Python | agpl-3.0 | 2,066 |
# -*- coding: utf-8 -*-
"""
Multi-gpu code for Keras/TF.
From https://github.com/avolkov1/keras_experiments
"""
# MODIFIED. Inspiration taken from the ref link below.
# ref: https://raw.githubusercontent.com/kuza55/keras-extras/master/utils/multi_gpu.py @IgnorePep8
# The inspirational one carried license:
# Apache ... | ViaFerrata/DL_pipeline_TauAppearance | scraps/multi_gpu/multi_gpu.py | Python | agpl-3.0 | 39,536 |
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import base_wizard_mixin
from . import document_cancel_wizard
from . import document_correction_wizard
from . import document_status_wizard
from . import invalidate_number_wizard
| OCA/l10n-brazil | l10n_br_fiscal/wizards/__init__.py | Python | agpl-3.0 | 252 |
from south.db import db
from django.db import models
from cm.models import *
class Migration:
def forwards(self, orm):
"Write your forwards migration here"
for tv in orm.TextVersion.objects.all():
tv.key = orm.TextVersion.objects._gen_key()
tv.adminkey = orm.T... | co-ment/comt | src/cm/migrations/0003_update_keys_to_textversion.py | Python | agpl-3.0 | 15,210 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2013-2014 Didotech SRL (info at didotech.com)
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the who... | odoousers2014/LibrERP | l10n_it_sale/wizard/confirmation.py | Python | agpl-3.0 | 3,636 |
#https://python-docx.readthedocs.io/en/latest/user/install.html
#python-docx may be installed with pip if you have it available:
# pip install python-docx
#python-docx can also be installed using easy_install, although this is #discouraged:
# easy_install python-docx
#If neither pip nor easy_install is available, it... | fidelcoria/AYFM-Scheduling | ScheduleParsing/scripts/schedule/convert_docx.py | Python | agpl-3.0 | 5,644 |
#! python
#Python Serial Port Extension for Win32, Linux, BSD, Jython
#serial driver for win32
#see __init__.py
#
#(C) 2001-2003 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
import win32file # The base COM port and file IO functions.
import win32event # We use ... | emilydolson/forestcat | pyrobot/system/serial/serialwin32.py | Python | agpl-3.0 | 10,927 |
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
ADMINS = (
("David Barra... | bameda/monarch | back/settings/common.py | Python | agpl-3.0 | 3,078 |
###########################################################################
# Copyright 2017 ZT Prentner IT GmbH (www.ztp.at)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either ver... | ztp-at/RKSV | librksv/depparser.py | Python | agpl-3.0 | 26,170 |
def migrate(cr, version):
if not version:
return
# Replace ids of better_zip by ids of city_zip
cr.execute("""
ALTER TABLE crm_event_compassion
DROP CONSTRAINT crm_event_compassion_zip_id_fkey;
UPDATE crm_event_compassion e
SET zip_id = (
SELECT id FROM r... | CompassionCH/compassion-modules | crm_compassion/migrations/12.0.1.0.0/pre-migration.py | Python | agpl-3.0 | 409 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-08-13 03:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0036_auto_20170813_0049'),
]
operations = [
migrations.AlterField... | goyal-sidd/BLT | website/migrations/0037_auto_20170813_0319.py | Python | agpl-3.0 | 510 |
# |ALPHA| Hub - an authorization server for alpha-ioq3
# See files README and COPYING for copyright and licensing details.
"""
A throwaway thread pool with thread-local storage.
Throwaway Tasks
===============
A throwaway task is one you'd *like* to get done, but it's
not a big deal if it doesn't actually get done.
... | madprof/alpha-hub | prototype/pool.py | Python | agpl-3.0 | 6,257 |
#!/usr/bin/python -S
#
# Copyright 2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Process one email message, read from stdin."""
import _pythonpath
import sys
from lp.services.config import config
from lp.services.mail.helpers import... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/scripts/process-one-mail.py | Python | agpl-3.0 | 2,007 |
import flask
mod = flask.Blueprint('api', __name__)
| erik/sketches | projects/700c/web/views/api.py | Python | agpl-3.0 | 54 |
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class SaleOrder(models.Model):
_inherit = "sale.order"
def action_confirm(self):
res = super(SaleOrder, self).action_confirm()
for order in self:
o... | OCA/account-analytic | mrp_analytic_sale_project/models/sale_order.py | Python | agpl-3.0 | 490 |
from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^$', 'blog.views.entry_list', name="entry-list"),
url(r'^archive/(?P<year>\d{4})/$', 'blog.views.entry_archive_year', name="year-archive"),
url(r'^archive/(?P<year>\d{4})/(?P<month>\d{1,2})/$', 'blog.views.entry_archive_month', name=... | tsoporan/tehorng | blog/urls.py | Python | agpl-3.0 | 421 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.