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 |
|---|---|---|---|---|---|
############################################################################
#
# Program: GDCM (Grassroots DICOM). A DICOM library
#
# Copyright (c) 2006-2011 Mathieu Malaterre
# All rights reserved.
# See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
#
# This software is distributed ... | gbook/nidb | src/gdcm/Examples/Python/AddPrivateAttribute.py | Python | gpl-3.0 | 1,122 |
import volmdlr
import volmdlr.edges
import volmdlr.wires
import volmdlr.faces
p1 = volmdlr.Point3D(0.15, 0.48, 0.5)
p2 = volmdlr.Point3D(0.15, 0.1, 0.5)
p1s = volmdlr.Point2D(0, 0)
p2s = volmdlr.Point2D(0.1, 0)
p3s = volmdlr.Point2D(0.2, 0.1)
p4s = volmdlr.Point2D(-0.01, 0.05)
surface2d = volmdlr.faces.Surface2D(vol... | masfaraud/volmdlr | scripts/faces/planar.py | Python | gpl-3.0 | 1,693 |
# -*- coding: utf8 -*-
# *****************************************************************************
# * *
# * Copyright (c) 2017 *
# * ... | caceres/SlopedPlanesMacro | SlopedPlanesTaskPanel.py | Python | gpl-3.0 | 42,295 |
import uuid as GenUUID
from django.conf import settings
from django.db import models
from django.utils.http import urlunquote
from opencontext_py.libs.general import LastUpdatedOrderedDict
from opencontext_py.apps.ocitems.events.models import Event
from opencontext_py.apps.entities.entity.models import Entity
from open... | ekansa/open-context-py | opencontext_py/apps/imports/fieldannotations/types.py | Python | gpl-3.0 | 15,913 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pandas as pd
from ethnicolr import census_ln, pred_census_ln
names = [{'name': 'smith'},
{'name': 'zhang'},
{'name': 'jackson'}]
df = pd.DataFrame(names)
print(df)
print(census_ln(df, 'name'))
print(census_ln(df, 'name', 2010))
print(pred_cens... | davidam/python-examples | nlp/ethnicolr/ethnicolr-example.py | Python | gpl-3.0 | 339 |
"""
Author: RedFantom
Contributors: Daethyra (Naiii) and Sprigellania (Zarainia)
License: GNU GPLv3 as in LICENSE
Copyright (C) 2016-2018 RedFantom
"""
"""
Dictionary describing the duration of AoE effects
"""
durations = {
# (ability: (allied, duration, DoT)
"Combat Command": (True, 24, False),
"EMP Field... | RedFantom/GSF-Parser | data/durations.py | Python | gpl-3.0 | 906 |
from distutils.core import setup
setup(name = 'IGCexpansion',
version = '0.2-dev',
author = 'Xiang Ji',
url = 'https://github.com/xji3/IGCexpansion',
#download_url = 'https://github.com/xji3/Genconv/tree/master/IGCexpansion/',
packages = ['IGCexpansion',],
#long_description = open('... | xjw1001001/IGCexpansion | setup.py | Python | gpl-3.0 | 347 |
# -*- coding: utf-8 -*-
from pyload.plugin.internal.DeadHoster import DeadHoster
class BayfilesCom(DeadHoster):
__name = "BayfilesCom"
__type = "hoster"
__version = "0.09"
__pattern = r'https?://(?:www\.)?bayfiles\.(com|net)/file/(?P<ID>\w+/\w+/[^/]+)'
__config = [] #@TODO: Remove in 0.4... | ardi69/pyload-0.4.10 | pyload/plugin/hoster/BayfilesCom.py | Python | gpl-3.0 | 468 |
# This script configurates BRCA-analyzer
import argparse,os
import subprocess as sp
thisDir=os.path.dirname(os.path.realpath(__file__))+'/'
par=argparse.ArgumentParser(description='This script configures BRCA-analyzer')
par.add_argument('--bwa','-bwa',dest='bwaDir',type=str,help='destination of BWA. If it can be sta... | aakechin/BRCA-analyzer | install.py | Python | gpl-3.0 | 2,506 |
#!/usr/bin/env python
import RPi.GPIO as GPIO
import time
# if relay type is normally closed, set to True, normally open set to False
relay_type = False
def start():
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(4, GPIO.OUT)
def do(action):
global relay_type
if relay_type:
a... | autopower/thermeq3 | support/testrelay.py | Python | gpl-3.0 | 1,198 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | kilon/sverchok | nodes/generator/basic_spline.py | Python | gpl-3.0 | 6,037 |
# -*- coding: utf-8 -*-
# This file is part of django-phpbb, integration between Django and phpBB
# Copyright (C) 2007-2008 Maciej Bliziński
#
# django-phpbb 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; e... | olethanh/django-phpbb | phpbb/views.py | Python | gpl-3.0 | 5,332 |
import praw
from collections import deque
import re
import yaml
import os
#Set globals
r=praw.Reddit("PlusBot by /u/captainmeta4")
sub = r.get_subreddit('captainmeta4bots')
class Bot():
def __init__(self):
#login
r.login('PlusBot',os.environ.get('password'))
#store up to 100 link/autho... | LiveBeef/TDTMBot | bot.py | Python | gpl-3.0 | 5,093 |
# Copyright 2013, 2014 Kevin Reid <kpreid@switchb.org>
#
# This file is part of ShinySDR.
#
# ShinySDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | hofschroeer/shinysdr | shinysdr/blocks.py | Python | gpl-3.0 | 15,994 |
#-*- coding: utf-8 -*-
import os
import sys
import traceback
try:
if sys.getdefaultencoding() != 'utf-8':
reload(sys)
sys.setdefaultencoding('utf-8')
except:
pass
currdir = os.path.join(os.getcwd(),os.path.dirname(__file__))
if currdir not in sys.path:
sys.path.append(currdir)
from base ... | liangtianyou/ST | stclient/app.py | Python | gpl-3.0 | 661 |
# -*- coding: utf-8 -*-
'''
Module
__init__.py
Copyright
Copyright (C) 2017 Vladimir Roncevic <elektron.ronca@gmail.com>
ats_utilities 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, ei... | vroncevic/py_util | ats_utilities/info/__init__.py | Python | gpl-3.0 | 6,684 |
#------------------------------------------------------------------------------
#
# This file is part of the fontQA framework
# Copyright (C) 2005 published by FSI Fonts und Software GmbH
# written by Andreas (Eigi) Eigendorf
#
# This programming framework is free software; you can redistribute it
# and/or modify it... | davelab6/fontqa | FontLab/Macros/System/Modules/fontQAlib.py | Python | gpl-3.0 | 27,167 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Person(object):
def __init__(self, name, action):
self.name = name
self.action = action
def do_action(self):
print(self.name, self.action.name, end=' ')
return self.action
class Action(object):
def __init__(self, name... | NicovincX2/Python-3.5 | Génie logiciel/Architecture logicielle/Patron de conception/Patron de comportement/chaining_method.py | Python | gpl-3.0 | 645 |
"""
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | sbrichards/rockstor-core | src/rockstor/smart_manager/data_collector.py | Python | gpl-3.0 | 15,176 |
import urllib.request, urllib.parse, urllib.error
import re
import time
try:
import tarfile
except:
tarfile = None
import zipfile
import os, sys, shutil
USER_TYPE = "user"
# user - for normal people
# beta - for the original beta testers
# dev - used to be... | illuminatedwax/pesterchum | version.py | Python | gpl-3.0 | 6,066 |
import numpy as np
import math, random
import matplotlib
#from pylab import get_cmap
from matplotlib.colors import ColorConverter
def cart2pol(x, y):
rho = np.sqrt(x**2 + y**2)
phi = np.arctan2(y, x)
return (phi, rho)
def pol2cart(phi, rho):
x = rho * np.sin(phi)
y = -rho * np.cos(phi)
retu... | maxkferg/smart-city-model | modules/collision/simulation/particles.py | Python | gpl-3.0 | 10,405 |
from django import template
register = template.Library()
@register.inclusion_tag('admin/cerci_issue/issue/submit_line.html', takes_context=True)
def submit_issue_row(context):
"""
Displays the row of buttons for delete and save.
"""
opts = context['opts']
change = context['change']
is_popup =... | cercisanat/cercisanat.com | cerci_admin/templatetags/issue_submit.py | Python | gpl-3.0 | 1,033 |
from ..domain.symtable import SymbolTable
class YEPCToC:
def __init__(self, quadruples, symtable):
self.quadruples = quadruples
self.symtable = symtable
self.env = {}
def store_env(self, symbol_table):
# Push the environment from the symbol table
self.env[symbol_table.... | 1995parham/yepc | yepc/core/to_c.py | Python | gpl-3.0 | 5,989 |
#!/usr/bin/env python3
# this copies over all files in admin0:~/stripe/ to the ~/stripe folder in the statistics project
import sys
import os
sys.path.insert(0, os.path.expanduser("~/bin/"))
os.chdir(os.path.join(os.environ['SMC_ROOT'], "smc-build/smc-ansible"))
# host of statistics project
from smc_rethinkdb import p... | timothyclemansinsea/smc | src/smc-build/smc-ansible/export-stripe-to-marketing-project.py | Python | gpl-3.0 | 667 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
import json
import logging
import sys
import time
from itertools import tee, islice, chain
from orgformat import OrgFormat
from memacs.lib.orgproperty import OrgProperties
from memacs.lib.reader import UnicodeDictReader
from .csv import Csv
# stolen fro... | novoid/Memacs | memacs/kodi.py | Python | gpl-3.0 | 6,858 |
#!/usr/bin/env python
import chrono
import unittest
class USCalendarTest(unittest.TestCase):
def test__subclass(self):
"USCalendar is subclass of Calendar"
self.assertTrue(
issubclass(chrono.calendar.USCalendar, chrono.calendar.Calendar)
)
class USCalendar_weekdateTest(uni... | erikgrinaker/python-chrono | tests/test_calendar/test_us.py | Python | gpl-3.0 | 6,175 |
"""
Create indexes
Revision ID: 49ab4e1139ef
Created at: 2016-05-09 09:38:28.078936
"""
import sqlalchemy as sa
from alembic import op
revision = "49ab4e1139ef"
down_revision = "23abaf4a0a4b"
branch_labels = None
depends_on = None
def upgrade():
for index_name, table_name, column_name in [
("ix_comment... | rr-/szurubooru | server/szurubooru/migrations/versions/49ab4e1139ef_create_indexes.py | Python | gpl-3.0 | 3,135 |
import random, time, os
def Validate(lista,listb):
Valid = True
if len(lista) == len(listb):
for listindex in range(len(lista)):
if lista[listindex] == listb[listindex]:
Valid = False
else:
Valid = False
return(Valid)
os.system("color c")
namelist = ["A","B"... | TNT-Samuel/Coding-Projects | Python Tests/List Assigner/inefficient_assigner.py | Python | gpl-3.0 | 1,023 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: bigip_service_policy
sh... | F5Networks/f5-ansible | ansible_collections/f5networks/f5_modules/plugins/modules/bigip_service_policy.py | Python | gpl-3.0 | 12,924 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# 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
#... | cherusk/ansible | lib/ansible/modules/cloud/ovirt/ovirt_clusters.py | Python | gpl-3.0 | 25,773 |
from __future__ import unicode_literals
from django.conf.urls import url
import esi.views
app_name = 'esi'
urlpatterns = [
url(r'^callback/$', esi.views.receive_callback, name='callback'),
]
| Adarnof/adarnauth-esi | esi/urls.py | Python | gpl-3.0 | 196 |
# Copyright (C) 2010-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... | psci2195/espresso-ffans | src/python/espressomd/io/mpiio.py | Python | gpl-3.0 | 3,867 |
from qsweepy.instruments import *
from qsweepy import *
from qsweepy import awg_iq_multi
import numpy as np
device_settings = {'vna_address': 'TCPIP0::10.20.61.48::inst0::INSTR',
'lo1_address': 'TCPIP0::10.20.61.59::inst0::INSTR',
'lo1_timeout': 5000, 'rf_switch_address': '10.20... | ooovector/qtlab_replacement | tunable_coupling_transmons/Misis_two_qubit_August_2019_setup.py | Python | gpl-3.0 | 9,950 |
#!/user/bin/python
# -*- coding: UTF-8 -*--
import time;
import calendar;
ticks = time.time();
cal = calendar.month(2016,1);
#print 'Right now ' , ticks;
#print 'date ' , cal;
tt = 3
if tt< 3 :
print('three')
elif tt == 5 :
print('ffff')
| ntpwilliam/totravel | first2.py | Python | gpl-3.0 | 264 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Testing core module functions
"""
import math
import numpy as npy
import volmdlr as vm
v2D_1 = vm.Vector2D(3*npy.random.random(2)-1.5)
v2D_2 = vm.Vector2D(3*npy.random.random(2)-1.5)
p2D_1 = vm.Point2D(3*npy.random.random(2)-1.5)
p2D_2 = vm.Point2D(3*npy.random.rand... | masfaraud/volmdlr | tests/core.py | Python | gpl-3.0 | 1,065 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
import os
from ...workbook import Workbook
from ..helperfunctions import _compare_xlsx_files
class TestCompareXLSXFiles(unittest.TestC... | ivmech/iviny-scope | lib/xlsxwriter/test/comparison/test_cond_format03.py | Python | gpl-3.0 | 2,548 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# communication.py
# User interface communication abstraction layer
# Copyright © 2008, 2009, 2011 Ben Morgan <neembi@googlemail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | cassava/moped | src/communication.py | Python | gpl-3.0 | 4,463 |
from django.shortcuts import redirect, get_object_or_404, render
from django.views.generic import TemplateView, View
from django.http import HttpResponse
from django.views.decorators.clickjacking import xframe_options_exempt
import json
from .models import Page, CurrentGame, VisiblePage
from .game import Manager
clas... | COIN-L4D/L4D-intranet | server/intranet/views.py | Python | gpl-3.0 | 1,951 |
#!/usr/bin/python
# Author: Steven D. Lander, RGi
# March 18, 2016
# This script assumes world-referenced tile coordinates
def gen_bbox(bbox, tiles):
if tiles == 1:
return ["&BBOX={},{},{},{}".format(bbox[0],
bbox[1], bbox[2], bbox[3])]
else:
sub_count = tiles / 4
min_x, m... | GitHubRGI/geopackage-python | Tools/generate_wms_aligned_relative.py | Python | gpl-3.0 | 1,363 |
import unittest
from pytba import VERSION
from pytba import api as client
class TestApiMethods(unittest.TestCase):
def setUp(self):
client.set_api_key("WesJordan", "PyTBA-Unit-Test", VERSION)
def test__tba_get(self):
# Query with proper key should succeed
team = client.tba_get('team/f... | Ninjakow/TrueSkill | lib/pytba/test/api_test.py | Python | gpl-3.0 | 1,080 |
"""
Python library for reading OpenEphys files.
Depends on: sys
os
glob
datetime
numpy
quantities
xmljson
xmltodict
Authors: Alessio Buccino @CINPLA,
Svenn-Arne Dragly @CINPLA,
Milad H. Mobarhan @CINPLA,
Mikk... | CINPLA/expipe-dev | py-open-ephys/pyopenephys/core.py | Python | gpl-3.0 | 38,806 |
from celery import Celery
def make_celery(app):
celery = Celery(app.import_name, broker=app.config['CELERY_BROKER_URL'], backend=app.config["CELERY_BACKEND_URL"], include=['tasks.library_tasks'])
celery.conf.update(app.config)
celery.conf['CELERY_ACCEPT_CONTENT'] = ['pickle', 'json']
TaskBase = celery... | tvgdb/pianissimo | backend/tasks/__init__.py | Python | gpl-3.0 | 579 |
#!/usr/bin/python
import rosbag
import sys
for fn in sys.argv[1:]:
nums=[0,0,0,0]
scenes=[0,0]
for topic, msg, t in rosbag.Bag(fn).read_messages():
if topic == "/irat_red/PoseCell/TopologicalAction" and msg.action:
nums[msg.action] += 1
if topic == "/feature2view/view_id" and msg.data:
scenes[0] = max(... | ipa-josh/ratslam_ros | script/count_loop_closures.py | Python | gpl-3.0 | 563 |
# coding=utf-8
"""
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 Fre... | Jannes123/inasafe | safe/gui/widgets/test/test_dock.py | Python | gpl-3.0 | 37,784 |
#!/usr/bin/python
# -*- coding:utf-8 -*-
from flask import Blueprint
admin = Blueprint('admin', __name__)
from . import views, forms
| qyzxg/myblog | app/admin/__init__.py | Python | gpl-3.0 | 144 |
""" Exposes singleton object gMonitor, which is instance of MonitoringClient class
Uses RPC Framework/Monitoring service. Calls registerActivities exposed function
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = "$Id"
import time
import... | ic-hep/DIRAC | src/DIRAC/FrameworkSystem/Client/MonitoringClient.py | Python | gpl-3.0 | 21,692 |
##################################################
# shitsu - tiny and flexible xmpp bot framework
# Copyright (C) 2008-2012 Kagami Hiiragi <kagami@genshiken.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free So... | Kagami/shitsu | shitsu/modules/animecal.py | Python | gpl-3.0 | 3,252 |
"""
Abstract definition for a plugin class
Author: Mathieu Monney
email: zittix(at)xwaves(dot)net
License: CC BY-SA: http://creativecommons.org/licenses/by-sa/2.0/
"""
from abc import ABCMeta, abstractmethod
class abstractstatic(staticmethod):
__slots__ = ()
def __init__(self, function):
super(abstractstat... | intelligent-agent/redeem | redeem/plugins/AbstractPlugin.py | Python | gpl-3.0 | 977 |
#/usr/bin/python
class Room(Card):
_roomId = None
def __init__(self, ID, label, roomId):
self._id = ID
self._label = label
self.cardType = CardType(CardType.room)
self._roomId = RoomName(roomId)
def __str__(self):
return ''.join((
"id: ",
se... | BrandonYates/sherlock | Python/Clue/Room.py | Python | gpl-3.0 | 1,517 |
#!/urs/bin/env python
#
# Copyright (C) 2015--2016, the ximpol team.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU GengReral Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.... | lucabaldini/ximpol | ximpol/test/test_sensitivity_calculator.py | Python | gpl-3.0 | 5,090 |
# core django imports
from django.contrib import admin
# imports from your apps
from .models import Lookout
@admin.register(Lookout)
class LookoutAdmin(admin.ModelAdmin):
list_display = ('id', 'created', 'modified', 'owner', 'isbn')
list_filter = ('created', 'modified', 'owner')
| srct/bookshare | bookshare/lookouts/admin.py | Python | gpl-3.0 | 290 |
import TmsuClient
import os
from html2text import HTML2Text
def html2md(title,text):
html2plain = HTML2Text(None, "")
html2plain.feed("<h1>%s</h1>" % title)
html2plain.feed(text)
return html2plain.close()
def filename(name):
if os.path.exists(name):
fname, file_extension = os.path.splitext... | delaere/evermore | evermore/NoteWriter.py | Python | gpl-3.0 | 4,584 |
import os
import requests
import collections
from time import sleep
from uuid import uuid4
from urllib.parse import urljoin
from datetime import datetime
from shutil import copyfileobj
from werkzeug.utils import secure_filename
from fame.common.config import fame_config
def is_iterable(element):
return isinstanc... | certsocietegenerale/fame | fame/common/utils.py | Python | gpl-3.0 | 2,422 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eith... | miyataken999/weblate | weblate/requirements.py | Python | gpl-3.0 | 5,638 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2017 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... | lahwaacz/qutebrowser | qutebrowser/misc/sessions.py | Python | gpl-3.0 | 19,672 |
# -*- coding:utf-8 -*-
## src/common/connection_handlers_events.py
##
## Copyright (C) 2010-2014 Yann Leboulanger <asterix AT lagaule.org>
##
## This file is part of Gajim.
##
## Gajim is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
## by the ... | irl/gajim | src/common/connection_handlers_events.py | Python | gpl-3.0 | 94,929 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
import csv
import sys
import os
# Write the path to the Galaxy file here!
# e.g. path_to_gff_converter_dir = "/you/files/Code/fml_gff3togtf-5c6f33e20fcc/"
path_to_gff_converter_dir = ""
def placehold(path_in, path_out):
lookup={}
with op... | mpdunne/orthofiller | utils/gff_to_gtf_safe.py | Python | gpl-3.0 | 2,600 |
#
# Copyright 2016 Universidad Complutense de Madrid
#
# This file is part of Megara DRP
#
# Megara DRP is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | Pica4x6/megaradrp | megaradrp/simulation/fiberbundle.py | Python | gpl-3.0 | 1,954 |
# -*- coding: utf8 -*-
# SDAPS - Scripts for data acquisition with paper based surveys
# Copyright(C) 2008, Christoph Simon <post@christoph-simon.eu>
# Copyright(C) 2008, Benjamin Berg <benjamin@sipsolutions.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Ge... | rodrigosurita/GDAd | sdaps/model/sheet.py | Python | gpl-3.0 | 1,971 |
#!/usr/bin/python3
#
# Copyright (C) 2019 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 3 of the License, or
# (at your option) any later version.
#
# This program... | GoogleCloudPlatform/plspm-python | tests/test_regression_metric.py | Python | gpl-3.0 | 7,199 |
from django.db import models
from django.contrib.auth.models import User
class Attendance( models.Model ):
date = models.DateField()
teamMember = models.ForeignKey( User, blank = True, null = True, related_name = "calendarAttendances" )
workingDay = models.BooleanField()
user = models.ForeignKey( User, related_nam... | shlomimatichin/workflow | workflow/calendar/models.py | Python | gpl-3.0 | 554 |
#!/usr/bin/env python3
class ShellSort(object):
def __init__(self, elements, gaps):
self._elements = elements
self._gaps = gaps
def sort(self):
size = len(self._elements)
for gap in reversed(self._gaps):
if (gap > size):
continue
for idx ... | bertothunder/coursera-algorithms | ShellSort.py | Python | gpl-3.0 | 1,843 |
import frappe
def execute():
frappe.reload_doc("selling", "doctype", "sales_order")
docs = frappe.get_all("Sales Order", {
"advance_paid": ["!=", 0]
}, "name")
for doc in docs:
frappe.db.set_value("Sales Order", doc.name, "advance_received", 1, update_modified=False) | neilLasrado/erpnext | erpnext/patches/v13_0/update_advance_received_in_sales_order.py | Python | gpl-3.0 | 300 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-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 la... | pombredanne/sortinghat | tests/test_matcher_email.py | Python | gpl-3.0 | 15,326 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Prototipo de cálculo y recomendación para la aplicación de muros.
"""
from __future__ import print_function
import sys
import argparse
import csv
import re
def main():
"""
Abre los ficheros fuente de cálculo de parámetros y de recomendación de
producto p... | Geotexan/calculinn | prototype/muro_geotexan.py | Python | gpl-3.0 | 10,868 |
import unittest
from pyAmore.cython.interface import *
from pyAmore.cython.network_predict_strategies import NetworkPredictStrategy
from pyAmore.cython.materials import *
from pyAmore.cython.network_predict_strategies import MlpNetworkPredictStrategy
class TestNetworkPredictStrategy(unittest.TestCase):
def test... | mcasl/AMORE | pyAmore/tests/cython_tests/test_network_predict_strategies.py | Python | gpl-3.0 | 2,946 |
# -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# Miscellaneous validation of user-entered data
#
# Copyright (C) 2005 Junta de Andalucía
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd.
# Copyright (C) 2015 Manjaro (http://manjaro.org)
#
# Validation library.
# Created by Antonio... | manjaro/thus | thus/misc/validation.py | Python | gpl-3.0 | 5,581 |
# View more python tutorial on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
"""
Please note, this code is only for python 3+. If you are using python 2+, please modify the code accordingly.
... | MediffRobotics/DeepRobotics | DeepLearnMaterials/tutorials/tensorflowTUT/tf5_example2/for_you_to_practice.py | Python | gpl-3.0 | 640 |
import rpw
from pyrevit.script import get_logger
logger = get_logger()
selection = rpw.ui.Selection()
# TODO check in only one loop
number_of_unused_connectors = sum([element.ConnectorManager.UnusedConnectors.Size for element in selection])
logger.debug(number_of_unused_connectors)
if number_of_unused_connectors > 2:... | CyrilWaechter/pyRevitMEP | pyRevitMEP.tab/Lab.panel/Lab.pulldown/ConvertToFlexPipe.pushbutton/script.py | Python | gpl-3.0 | 451 |
from yajuu.extractors.extractor import Extractor
from yajuu.media.sources.source_list import SourceList
class SeasonExtractor(Extractor):
def __init__(self, media, season, range_):
super().__init__(media)
self.seasons = {}
self.season = season
self.start, self.end = range_
... | vivescere/yajuu | yajuu/extractors/season_extractor.py | Python | gpl-3.0 | 1,048 |
'''
This is version001
about 程序最简单最粗糙的版本
my_debugger_defines.py # 数据结构
my_debugger.py # 功能
my_test_%.py # 测试
''' | MrLi008/mysimpledebugger | Gray_Hat_Python/src/simpledebugger/version001/__init__.py | Python | gpl-3.0 | 176 |
#!/usr/bin/env python
# *********************************************************************
# * Copyright (C) 2014 Luca Baldini (luca.baldini@pi.infn.it) *
# * *
# * For the license terms see the file LICENSE, distributed *
# * along ... | centrofermi/e3pipe | tasks/e3dbbackfill.py | Python | gpl-3.0 | 2,466 |
import pytest
import datetime as dt
import pandas as pd
from pandas.api.types import is_datetime64_dtype
from dtocean_core.utils.maintenance import (update_comp_table,
update_onsite_tables,
update_replacement_tables,
... | DTOcean/dtocean-core | tests/test_utils_maintenance.py | Python | gpl-3.0 | 43,025 |
# -*- coding: utf-8 -*-
#
# Copyright © 2018 Mark Wolf
#
# This file is part of scimap.
#
# Scimap 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... | m3wolf/scimap | tests/test_pawley_refinement.py | Python | gpl-3.0 | 6,933 |
#!/usr/bin/python
from __future__ import division
import re, sys
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
import itertools
from utils_make_txs import *
import random
from random import randint
random.seed(1234)
dir_in = sys.argv[1]
mutations = [int(x) for x in sys.argv[2].split(",")]
transcripts_i... | oicr-ibc/riser | bin/make_transcripts.py | Python | gpl-3.0 | 1,956 |
#!/usr/bin/python3
# Copyright 2015 Seth VanHeulen
#
# 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 i... | mhvuze/mhff | n3ds/tex_dds.py | Python | gpl-3.0 | 8,306 |
from pyspark.sql import SparkSession
import os
def get_spark_session(app_name = "spark_app"):
master = os.environ["SPARK_MASTER"]
spark = SparkSession.builder.\
appName(app_name).\
master(master).\
getOrCreate()
return spark
| luck02/PysparkTestingExample | jobs/libs/Bootstrap.py | Python | gpl-3.0 | 263 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | whitepyro/debian_server_setup | sickbeard/providers/womble.py | Python | gpl-3.0 | 2,490 |
# -*- coding: utf-8 -*-
#
# pdfformfiller documentation build configuration file, created by
# sphinx-quickstart on Sat Mar 19 21:38:58 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | diafygi/pdfformfiller | docs/conf.py | Python | gpl-3.0 | 9,307 |
from bottle import route, default_app, template
# -----------------------------------------------------------------------------
# This must be added in order to do correct path lookups for templates in
# wsgi/views/
import os
from bottle import TEMPLATE_PATH
TEMPLATE_PATH.append(os.path.join(os.environ['OPENSHIFT_REP... | kallimachos/BottleOS | wsgi/mybottleapp.py | Python | gpl-3.0 | 823 |
import logging
from time import sleep
from celery.result import AsyncResult
from django.core.management import BaseCommand
from delft3dcontainermanager.tasks import do_docker_remove, get_docker_ps
from delft3dworker.models import Container, Scene
"""
Synchronization command that's called periodically.
- Run docker p... | openearth/delft3d-gt-server | delft3dworker/management/commands/containersync_sceneupdate.py | Python | gpl-3.0 | 4,813 |
import copy
import os
from abc import ABCMeta, abstractmethod
from datetime import datetime, timedelta
from functools import wraps
import time
import threading
import GangaCore.Utility.logging
from GangaCore.Core.exceptions import CredentialsError
from GangaCore.GPIDev.Credentials.CredentialStore import credential_... | ganga-devs/ganga | ganga/GangaCore/GPIDev/Adapters/ICredentialInfo.py | Python | gpl-3.0 | 9,520 |
import sys
PY3 = sys.version_info >= (3,)
if PY3:
xrange = range
bytes_type = bytes
if PY3:
unicode_type = str
basestring_type = str
else:
# The names unicode and basestring don't exist in py3 so silence flake8.
unicode_type = unicode # noqa
basestring_type = basestring # noqa
_TO_UNICOD... | ProjectKitchen/BrainwashingMachine | src/MousePlayer/src/utils.py | Python | gpl-3.0 | 1,331 |
# -*- coding: utf-8 -*-
from openerp.http import request, STATIC_CACHE
from openerp.addons.web import http
import json
import io
from PIL import Image, ImageFont, ImageDraw
from openerp import tools
import cStringIO
import werkzeug.wrappers
import time
import logging
logger = logging.getLogger(__name__)
class Web_Edi... | ChawalitK/odoo | addons/web_editor/controllers/main.py | Python | gpl-3.0 | 10,264 |
"""
WSGI config for webeats project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETT... | MaximilianKindshofer/webeats | webeats/webeats/wsgi.py | Python | gpl-3.0 | 392 |
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Dec 22 2017)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################
impo... | turdusmerula/kipartman | kipartman/dialogs/panel_modules.py | Python | gpl-3.0 | 13,205 |
from .states import (TaskStatus, MultijobActions, TASK_STATUS_PERMITTED_ACTIONS,
TASK_STATUS_STARTUP_ACTIONS)
| GeoMop/GeoMop | src/JobPanel/data/__init__.py | Python | gpl-3.0 | 131 |
from __future__ import unicode_literals
from django.db import models
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _
from ..backends.command.models import AbstractSessionCommand
class CommandManager(models.Manager):
def bulk_create(self, objs, **kwargs):
... | jumpserver/jumpserver | apps/terminal/models/command.py | Python | gpl-3.0 | 683 |
""" NOTA BENE: This agent should NOT be run alone. Instead, it serves as a base class for extensions.
The TaskManagerAgentBase is the base class to submit tasks to external systems,
monitor and update the tasks and file status in the transformation DB.
This agent is extended in WorkflowTaskAgent and Reque... | arrabito/DIRAC | TransformationSystem/Agent/TaskManagerAgentBase.py | Python | gpl-3.0 | 31,025 |
# -*- coding: utf-8 -*-
"""Lockfile operations
Acquires and releases an exclusive file-based process lock on
Unix-like platforms.
Examples:
Simple acquirey and release:
lockfile = Lockfile()
lockfile.acquire()
# (other process would raise LockfileEstablishError here)
lockfile.rele... | TheFadeliskOrganization/fadelisk | lib/python/fadelisk/lockfile.py | Python | gpl-3.0 | 5,995 |
import logging
from datetime import datetime
import time
import sqlalchemy as sa
from sqlalchemy.sql import func
import os.path
log = logging.getLogger("stats-consolidation")
def _to_url(dialect, **kwargs):
""" From keywords to a database URL.
>>> _to_url(dialect='sqlite', db_name='/tmp/database')
'sql... | activitycentral/statistics-consolidation | stats_consolidation/db.py | Python | gpl-3.0 | 18,505 |
"""Custom commands for setup.py"""
import abc
import distutils.cmd
import os
import re
__author__ = 'Christof Pieloth'
working_dir = os.path.abspath(os.path.dirname(__file__))
build_dir = os.path.join(working_dir, 'build')
api_name = 'backbacker'
project_name = re.search('^__project_name__\s*=\s*\'(.*)\'',
... | cpieloth/BackBacker | setup_commands.py | Python | gpl-3.0 | 8,386 |
import src
import random
class Tree(src.items.Item):
"""
ingame item serving as an infinite food source
"""
type = "Tree"
bolted = True
walkable = False
numMaggots = 0
name = "tree"
def __init__(self):
"""
initialise internal state
"""
super().__in... | MarxMustermann/OfMiceAndMechs | src/itemFolder/plants/tree.py | Python | gpl-3.0 | 2,733 |
from werkzeug.http import parse_accept_header
class I18NString:
default_lang = 'en'
def __init__(self, default_lang='en', **kwargs):
self.default_lang = default_lang
self.translations = kwargs
def __getitem__(self, item):
return self.translations[item]
def parse_accept_language... | hadron-powered/si-site | si_site/util/i18n.py | Python | gpl-3.0 | 558 |
from rest_framework import serializers
from django.utils.translation import ugettext_lazy as _
__all__ = [
'ApplySerializer', 'LoginAssetConfirmSerializer',
]
class ApplySerializer(serializers.Serializer):
# 申请信息
apply_login_user = serializers.CharField(required=True, label=_('Login user'))
apply_l... | jumpserver/jumpserver | apps/tickets/serializers/ticket/meta/ticket_type/login_asset_confirm.py | Python | gpl-3.0 | 591 |
# Copyright 2010,2011,2012 Michael Frank <msfrank@syntaxjockey.com>
#
# This file is part of Terane.
#
# Terane 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... | msfrank/terane | terane/bier/ql/__init__.py | Python | gpl-3.0 | 2,731 |
# 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
import frappe.defaults
from erpnext.controllers.selling_controller import SellingController
from erpnext.stock.doctype.batch.batch import... | ESS-LLP/erpnext-healthcare | erpnext/stock/doctype/delivery_note/delivery_note.py | Python | gpl-3.0 | 20,437 |
#coding=utf-8
#################################################################################
#Author: Italo de Pontes Oliveira #
#Based on Spotipy API #
#created in: 08, july, 2017 #
#e-mail: italooliveira at copin dot ufcg dot edu dot br #
#Github link: github.com/italoPontes/PhdWorks #
#Wh... | tatianass/quebra-quebra | html2csv/convert_html_to_csv.py | Python | gpl-3.0 | 12,480 |
# coding=utf-8
"""
BPMN diagram visualization methods
"""
import matplotlib.pyplot as plt
import networkx as nx
import pydotplus
import bpmn_python.bmpn_python_consts as consts
from networkx.drawing.nx_pydot import write_dot
def visualize_diagram(bpmn_diagram):
"""
Shows a simple visualization of diagram
... | krisss2121/bpmn-python | bpmn_python/bpmn_diagram_visualizer.py | Python | gpl-3.0 | 4,166 |
#!/usr/bin/env python2.7
import logging
import numpy as np
from .analysis import Analysis
class HopCountAnalysis(Analysis):
def __init__(self, scenario, location, repetitions, csv):
Analysis.__init__(self, scenario, location, "hopCount", repetitions, csv)
self.logger = logging.getLogger('baltimo... | mfrey/baltimore | analysis/hopcountanalysis.py | Python | gpl-3.0 | 3,831 |