code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#! /usr/bin/env python3
import json
from s2f.sforce import SClient
from s2f import util
"""
Print SalesForce API versions.
Use this to set the version in the config file JSON.
"""
if __name__ == '__main__':
util.setupLogging()
client = SClient(util.SForceCfgFileName, util.SForceTokenFileName)
print(json.... | futurice/sforce2flowdock | sforce-show-api-versions.py | Python | gpl-3.0 | 362 |
#!/usr/bin/env python
import os
import sys
iens = None
if len(sys.argv) > 1:
iens = int(sys.argv[1])
numbers = [1, 2, 3, 4, 5, 6]
if iens in numbers:
random_report_step = (numbers.index(iens) % 3) + 1
os.remove("perlin_%d.txt" % random_report_step)
with open("perlin_fail.status", "w") as f:
f... | joakim-hove/ert | test-data/local/mini_ert/jobs/perlin_fail.py | Python | gpl-3.0 | 461 |
# Bonding Topology of heavy atoms. This is a dict of a dict of sets
topology = {'PRO': {'N': {'C-1', 'CA', 'CD'},
'CA': {'N', 'C', 'CB', 'HA'},
'HA': {'CA'},
'CB': {'CA', 'CG', 'HB2', 'HB3'},
'HB2': {'CB'},
'HB3': ... | jlorieau/mollib | mollib/core/topology.py | Python | gpl-3.0 | 14,201 |
from django.conf.urls import url
from . import views
urlpatterns = [
# ex: /album/
url(r'^$', views.index, name='index'),
# ex: /album/create/
url(r'^welcome/$', views.welcome, name='welcome'),
# ex: /album/create/
url(r'^create/$', views.create, name='create'),
# ex: /album/vietnam_2016/
... | AlexandreGuinaudeau/ClasseurPhoto | classeur_photo/classeur_photo/album/urls.py | Python | gpl-3.0 | 519 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sqlite3 as lite
import sys
con = lite.connect('Database.db')
with con:
cur = con.cursor()
#Create data for the user table
cur.execute("CREATE TABLE users(UserId INT, UserName TEXT, Password TEXT)")
cur.execute("INSERT INTO users VALUES(1,'Adm... | blabla1337/defdev | demos/input-validation/SQLI/config/initializer.py | Python | gpl-3.0 | 1,100 |
# -*- encoding: utf-8 -*-
import yaml
import sys
import os
import json
import sqlite3
from .exceptions import *
class DataList(object):
__data_list = None
def __init__(self, _path="", _list_file=""):
self.__data_list = list()
self.path = _path
self.listfile = _list_file
s... | TheTimeTunnel/scout-camp | PROJECT/src/scoutcamp/database.py | Python | gpl-3.0 | 7,206 |
""" XVM (c) www.modxvm.com 2013-2015 """
__all__ = ['startConfigWatchdog', 'stopConfigWatchdog']
# PUBLIC
def startConfigWatchdog():
# debug('startConfigWatchdog')
_g_configWatchdog.stopConfigWatchdog()
_g_configWatchdog.configWatchdog()
def stopConfigWatchdog():
# debug('stopConfigWatchdog')
_... | Satariall/xvm-test | src/xpm/xvm_main/configwatchdog.py | Python | gpl-3.0 | 1,794 |
# coding: utf-8
# In[1]:
import filtering
import numpy as np
import matplotlib.pyplot as plt
# Load input time trace
signal_in_temp = np.loadtxt('../tests/gaborinput.txt')
len_signal = 1000
dt = 0.1
t = np.array(range(0, len_signal)) * dt
signal_in = np.zeros((len_signal, 1))
signal_in[:, 0] = signal_in_temp
# D... | seismology/mc_kernel | tests/create_gabor_filter_test.py | Python | gpl-3.0 | 1,397 |
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from .textEditDialog import cTextEditDialog
class cCellRendererText(Gtk.CellRendererText):
""" Label entry cell which calls TextEdit_Dialog upon editing """
__gtype_name__ = 'CellRendererCustomText'
def __init__(self, parent):
... | jtk1rk/xsubedit | gcustom/cellRendererText.py | Python | gpl-3.0 | 923 |
"""
Notes:
- Brugia protein sequences: https://www.ncbi.nlm.nih.gov/bioproject/PRJNA10729
- wBm protein sequences: https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=292805
- BLASTP against Reference proteins (refseq protein) from Human, using BLOSUM45 matrix.
- BLASTP against nr proteins from O. volvulus and ... | dave-the-scientist/brugia_project | get_knockout_info.py | Python | gpl-3.0 | 20,007 |
# -*- coding: utf-8 -*-
"""
Michalewicz test function for design optimization
xOpt = 0
fOpt = 0.0
"""
from DesOptPy import OptimizationProblem
import numpy as np
class Michalewicz:
x = np.zeros(
[
2,
]
)
def SysEq(self):
michalewicz_m = 2
n = len(self.x)
... | e-dub/DesOptPy | examples/TestProblemsUnconstrained/Michalewicz.py | Python | gpl-3.0 | 889 |
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... | Donkyhotay/MoonPy | zope/tal/tests/utils.py | Python | gpl-3.0 | 1,998 |
# Functions for working with H3 and hemispheres etc.
from itertools import chain
from sage.all import (Infinity, Matrix, ZZ, QQ, RR, CC, NumberField,
Graph, srange, Set, sign, var, implicit_plot3d, NFCusp, Integer, oo,
infinity, polygen, point, line, circle)
from utils imp... | JohnCremona/bianchi-progs | FD/H3.py | Python | gpl-3.0 | 72,028 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/oval_5/sc/linux/SystemDUnitDependencyItemElement.py | Python | gpl-3.0 | 1,135 |
# coding: utf-8
from __future__ import division
import random
from random import randint
import pygame
from pygame.locals import *
SIZE = 800, 600
FLAGS = 0
# actually, delay in ms:
FRAMERATE = 30
WAVE_ENEMIES = [1, 5, 1]
Group = pygame.sprite.OrderedUpdates
class GameOver(Exception):
pass
class NoEnemyI... | jsbueno/towertower | towertower/__init__.py | Python | gpl-3.0 | 14,154 |
# -*- coding: utf-8 -*-
#
# grissom - FOSS compliance tools
#
# Copyright (c) Eric Le Bihan <eric.le.bihan.dev@free.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | elebihan/grissom | grissom/__init__.py | Python | gpl-3.0 | 909 |
"""
WSGI config for spardha 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.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETT... | vaishnavsm/spardha17 | spardha/spardha/wsgi.py | Python | gpl-3.0 | 392 |
#!/usr/bin/
#-*- coding: iso-8859-1 -*-
#===============================================================================
# __________ ________________ __ _______
# / ____/ __ \/ ____/ ____/ __ )/ / / / ___/
# / /_ / /_/ / __/ / __/ / __ / / / /\__ \
# / __/ / _, _/ /___/ /___/ /_/ / /_/ /___/ /... | Makki1/old-svn | avr/sketchbook/GiraRM_Debug/freebus/freebus_ets/software/freebus-ets/src/DATABASE/FB_DlgDatabase.py | Python | gpl-3.0 | 6,607 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-15 18:21
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('team', '0002_auto_20170315_1342'),
]
operations = ... | kidsfm/cms | team/migrations/0003_auto_20170315_1421.py | Python | gpl-3.0 | 532 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
GeoHealth
A QGIS plugin
-------------------
begin : 2014-08-20
copyright : ... | Gustry/GeoHealth | src/plugin.py | Python | gpl-3.0 | 3,256 |
# -*- coding: utf-8 -*-
import os
def onemode(values):
return max(set(values), key=values.count)
os.system("pause")
| NicovincX2/Python-3.5 | Statistiques/Statistique descriptive/Mode (statistiques)/one_mode.py | Python | gpl-3.0 | 124 |
# 类结构的堆排序
class DLinkHeap(object):
def __init__(self, list=None, N = 0):
self.dList = list
self.lengthSize = N
# 插入数据
def insert_heap(self, data):
self.dList.append(data)
self.lengthSize += 1
# 初始化堆结构
def init_heap(self):
n = self.lengthS... | jinzekid/codehub | 数据结构与算法/heap_sort/类定义操作定义堆结果以及排序.py | Python | gpl-3.0 | 2,192 |
# Copyright (C) 2017 The YaCo Authors
#
# 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 ... | DGA-MI-SSI/YaCo | tests/tests/test_enums.py | Python | gpl-3.0 | 9,673 |
# Top Rollover Lanes
__author__="jim"
__date__ ="$Jan 18, 2011 1:36:37 PM$"
import procgame
import locale
from procgame import *
base_path = config.value_for_key_path('base_path')
game_path = base_path+"games/whirlwind/"
speech_path = game_path +"speech/"
sound_path = game_path +"sound/"
music_path = game_path +"mu... | mypinballs/whirlwind | tilt.py | Python | gpl-3.0 | 2,464 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2016 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... | jitka/weblate | weblate/trans/checks/data.py | Python | gpl-3.0 | 14,817 |
#!/usr/bin/env python
import sys
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script import Manager
from owa import (
# extensions
db,
# configuration
config,
# modules
schemas, models, utils, core, shell,
# helpers
create_app, after_request
)
from owa.api im... | justanr/owa | manager.py | Python | gpl-3.0 | 1,148 |
from cjp.settings.base import CJP_ROOT # TODO: don't rely on this
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from django.contrib.auth.models import User
from django import forms
class UserForm(forms.Form):
firstName = forms.CharField(label="First Name"... | meshulam/chicago-justice | cjp/cjpusers/views.py | Python | gpl-3.0 | 4,777 |
#!/usr/bin/python3
# test_agent_agg_context.py
import os
import unittest
import sys
root_fldr = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(0, root_fldr)
import aikif.agents.aggregate.agg_context as mod_agg
class TestAgentAggContext(unittest.TestCase):
def test_01_(self):
... | acutesoftware/AIKIF | aikif/.z_prototype/test_agent_agg_context.py | Python | gpl-3.0 | 559 |
# =============================================================================
# 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/engine/constructor.py | Python | gpl-3.0 | 13,205 |
from django.views.generic import TemplateView
from django.conf import settings
from volunteer.apps.events.utils import get_active_event
class SiteIndexView(TemplateView):
template_name = 'home.html'
def get_context_data(self, **kwargs):
context = super(SiteIndexView, self).get_context_data(**kwargs)... | Apogaea/voldb | volunteer/core/views.py | Python | gpl-3.0 | 481 |
from django.apps import AppConfig
class SpeakerConfig(AppConfig):
name = 'speaker'
| DrSLDR/consilium | consilium/speaker/apps.py | Python | gpl-3.0 | 89 |
# -*- coding: utf-8 -*-
# Basic interface class for communicating with an IRC server.
# Copyright (C) 2012 Sindre Wetjen
# 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... | subfusc/DasBot | src/IRCbot.py | Python | gpl-3.0 | 20,314 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# auth: metagriffin <mg.github@metagriffin.net>
# date: 2013/04/27
# copy: (C) Copyright 2014-EOT metagriffin -- see LICENSE.txt
#---------------------------------------------------... | metagriffin/iniget | setup.py | Python | gpl-3.0 | 3,162 |
T = int(input())
arr = []
dirr = {}
while(T):
T-=1
a,b = map(int, raw_input().split())
arr.append(a+b)
arr2 = sorted(arr)
fin = []
for i in range(len(arr2)):
for j in range(len(arr)):
if arr[i] == arr2[j]:
fin.append(j+1)
#print arr
#print arr2
print reduce(lambda x, y: s... | Dawny33/Code | Hackerrank/101 Hack Sept/order.py | Python | gpl-3.0 | 346 |
#!/usr/bin/env python
# coding=utf-8
# Created by sharp.gan at 2017-01-08
import os
import argparse
import subprocess
# Assume that you already installed the dependency of GNU-gettext, or you need to
# resolve this using your system package management tool such as `sudo apt
# install gettext`
# main process of reslo... | supersu097/Mydailytools | po_new_generate.py | Python | gpl-3.0 | 1,794 |
# -*- coding: utf-8 -*-
"""
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... | wangjun/pyload | module/plugins/crypter/DailymotionBatch.py | Python | gpl-3.0 | 3,865 |
import libxml2
import sys
import quiz_library
'''
purpose
Accept 1 or more log file names on the command line.
Accumulate across all the log files the pass ratio for each question.
A question result is considered a pass if it is not 0 or None
and fail otherwise.
The pass ratio for a question is the number of p... | ajdeziel/quiz-evaluator | quiz_pass_ratio.py | Python | gpl-3.0 | 1,673 |
# -*- coding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.db.models import Max, F
from django.shortcuts import render, get_object_or_404, redirect
from django.utils.decorators import method_decorator
from django.views.generic.edit i... | everypony/ponyFiction | ponyFiction/views/chapter.py | Python | gpl-3.0 | 5,461 |
#!/usr/bin/env python3
#
# PLASMA : Generate an indented asm code (pseudo-C) with colored syntax.
# Copyright (C) 2015 Joel
#
# 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 ... | chubbymaggie/reverse | plasma/lib/__init__.py | Python | gpl-3.0 | 12,594 |
from datetime import datetime
import pathlib
import shutil
import urllib
import pytest
from .util import check_data_output, website_working
helios = pytest.importorskip('heliopy.data.helios')
pytest.mark.skipif(
not website_working('https://helios-data.ssl.berkeley.edu/data/'))
pytestmark = pytest.mark.data
pro... | dstansby/heliopy | heliopy/data/test/test_helios.py | Python | gpl-3.0 | 2,429 |
from django import template
from django.template import TOKEN_VAR, TOKEN_BLOCK, TOKEN_COMMENT, TOKEN_TEXT, \
BLOCK_TAG_START, VARIABLE_TAG_START, VARIABLE_TAG_END, BLOCK_TAG_END
register = template.Library()
class RawNode(template.Node):
def __init__(self, data):
self.data = data
def render(self,... | redsolution/redsolution-cms | redsolutioncms/templatetags/redsolutioncms_tags.py | Python | gpl-3.0 | 1,289 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Taoni.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | LunacyZeus/Tao-ni | web/Taoni/manage.py | Python | gpl-3.0 | 803 |
# pylint: disable=line-too-long
import datetime
import psycopg2
import pytz
CREATE_PROBE_TABLE_SQL = 'CREATE TABLE builtin_pressureprobe(id SERIAL PRIMARY KEY, user_id TEXT, guid TEXT, timestamp DOUBLE PRECISION, utc_logged TIMESTAMP, sensor_vendor TEXT, sensor_name TEXT, sensor_power DOUBLE PRECISION, sensor_type BI... | cbitstech/Purple-Robot-Django | management/commands/extractors/builtin_pressureprobe.py | Python | gpl-3.0 | 7,463 |
# Copyright 2016 The TensorFlow Authors. 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 required by applica... | modelblocks/modelblocks-release | resource-jlstm/scripts/lm_1b/data_utils.py | Python | gpl-3.0 | 8,982 |
'''
Generic message-based protocol used by Bitcoin and P2Pool for P2P communication
'''
import hashlib
import struct
from twisted.internet import protocol
from twisted.python import log
import p2pool
from p2pool.bitcoin import data as bitcoin_data
from p2pool.util import datachunker, variable
class TooLong(Exceptio... | GroestlCoin/p2pool-grs | p2pool/util/p2protocol.py | Python | gpl-3.0 | 4,140 |
# -*- coding: utf8 -*-
SQL = """
select SQL_CALC_FOUND_ROWS *,
(select count(1) FROM af3_delo D where D.OPIS = O.OPIS_ID) AS count_delo,
(select count(1) FROM `list_nagrada` ln where ln.OPIS_ID=O.OPIS_ID) AS NL,
(select count(1) FROM `digital_image` dim where type_image='opis' AND dim.OPIS_ID=O.OPIS_ID) AS ... | ffsdmad/af-web | cgi-bin/plugins2/opis_list.py | Python | gpl-3.0 | 912 |
# -*- coding: utf-8 -*-
""" A context manager for managing things injected into __builtin__.
Qudi 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 ver... | drogenlied/qudi | logic/jupyterkernel/builtin_trap.py | Python | gpl-3.0 | 4,344 |
import os
CURRENT_TERM = os.environ["CURRENT_TERM"] # e.g. 16S
SUPPORT_EMAIL = "support@layuplist.com"
REC_UPVOTE_REQ = 2
OFFERINGS_THRESHOLD_FOR_TERM_UPDATE = int(
os.environ["OFFERINGS_THRESHOLD_FOR_TERM_UPDATE"])
| layuplist/layup-list | lib/constants.py | Python | gpl-3.0 | 221 |
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2017 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permis... | JonnyWong16/plexpy | lib/dns/resolver.py | Python | gpl-3.0 | 57,421 |
#
# SPDX-FileCopyrightText: 2016 Dmytro Kolomoiets <amerlyq@gmail.com> and contributors.
#
# SPDX-License-Identifier: GPL-3.0-only
#
from miur.cursor import state, update, message as msg
class Dispatcher:
"""Apply actions to any unrelated global states"""
def _err_wrong_cmd(self):
# Move err processi... | miur/miur | OLD/miur/cursor/dispatch.py | Python | gpl-3.0 | 1,733 |
import datetime
import sys
from string import Template
from dsl_parsers.parsing_utils import communication_is_ice, get_name_number, IDSLPool
from templates.common.templatedict import TemplateDict
class src_main_py(TemplateDict):
def __init__(self, component):
super(src_main_py, self).__init__()
se... | Kmayankkr/robocomp | tools/robocompdsl/templates/templatePython/plugins/base/functions/src/main_py.py | Python | gpl-3.0 | 454 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2013)
#
# This file is part of the hveto python package.
#
# hveto 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... | berkowitze/hveto | setup.py | Python | gpl-3.0 | 3,688 |
#TSTOP
#
#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 useful,
... | gpersistence/tstop | python/persistence/PAMAPSegments.py | Python | gpl-3.0 | 4,400 |
from __future__ import (absolute_import, division, print_function)
import mantid.simpleapi as mantid
from isis_powder.routines import common, instrument_settings
from isis_powder.abstract_inst import AbstractInst
from isis_powder.pearl_routines import pearl_advanced_config, pearl_algs, pearl_calibration_algs, pearl_o... | ScreamingUdder/mantid | scripts/Diffraction/isis_powder/pearl.py | Python | gpl-3.0 | 9,681 |
import os
import shutil
import zipfile
from stat import S_IREAD, S_IRGRP, S_IROTH
import pytest
from dtocean_core.utils.files import (unpack_archive,
onerror,
os_retry,
rmtree_retry,
... | DTOcean/dtocean-core | tests/test_utils_files.py | Python | gpl-3.0 | 3,004 |
#!/usr/bin/env python
# encoding: utf-8
from conftests import *
from rurouni.exceptions import *
from rurouni.types import *
from rurouni import Database, Column, Table
def test_insert_errors(db):
class Client(Table):
__db__ = db
name = Column(String)
birthdate = Column(Date)
with pyt... | magnunleno/Rurouni | tests/test_basic_operations.py | Python | gpl-3.0 | 5,681 |
############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the co... | sailfish-sdk/sailfish-qtcreator | tests/system/suite_HELP/tst_HELP02/test.py | Python | gpl-3.0 | 6,908 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ponypass – Secure superultraawesomemasing passphrase wallet
#
# Copyright © 2013 Mattias Andrée (maandree@member.fsf.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
# ... | maandree/ponypass | src/obscurepass.py | Python | gpl-3.0 | 2,412 |
from rest_framework import serializers
from django.utils.translation import ugettext_lazy as _
from django.db.models import Count
from common.mixins.serializers import BulkSerializerMixin
from common.utils import ssh_pubkey_gen
from common.validators import alphanumeric_re, alphanumeric_cn_re, alphanumeric_win_re
from... | jumpserver/jumpserver | apps/assets/serializers/system_user.py | Python | gpl-3.0 | 13,612 |
from sia_fluxlim.oggm_flowline import MUSCLSuperBeeModel
| alexjarosch/sia-fluxlim | sia_fluxlim/__init__.py | Python | gpl-3.0 | 57 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('course', '0010_auto_20151214_1714'),
]
operations = [
migrations.AddField(
model_name='coursechapter',
... | ttsirkia/a-plus | course/migrations/0011_auto_20151215_1133.py | Python | gpl-3.0 | 624 |
from django.core.paginator import EmptyPage
from rest_framework import pagination
from rest_framework.response import Response
class StandardPagination(pagination.PageNumberPagination):
page_size = 10
page_size_query_param = 'page_size'
max_page_size = 100
def paginate_queryset(self, queryset, reques... | interlegis/sapl | sapl/api/pagination.py | Python | gpl-3.0 | 3,967 |
import unittest
from fractions import Fraction as F
from abcesac.music import *
class KeyTestCase(unittest.TestCase):
def test_get_notes(self):
got = Key('C').get_notes()
want = ['C','D','E','F','G','A','B']
self.assertEquals(got, want)
got = Key('D').get_notes()
want = [... | google-code/abc2esac | abcesac/tests/music.py | Python | gpl-3.0 | 4,909 |
from util import file_util
class BatchEntry:
def __init__(self, csv_line, experiment_location=None):
values = csv_line.split(',')
self.experiment_location = experiment_location
self.experiment = BatchEntry.get_value(values, 0)
if self.experiment is None:
raise ValueErr... | patrick-winter-knime/mol-struct-nets | molstructnets/experimentbatch/batch_entry.py | Python | gpl-3.0 | 1,435 |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 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... | DavidAndreev/indico | indico/modules/events/abstracts/models/related_tracks.py | Python | gpl-3.0 | 2,264 |
from collections import OrderedDict
from django.conf import settings
from wazimap.data.utils import get_session, get_stat_data, group_remainder, \
current_context, dataset_context
from wazimap.geo import LocationNotFound
# ensure tables are loaded
import hurumap_zm.tables # noqa
LOCATIONNOTFOUND = {'is_missing... | CodeForAfrica/WAZImap.Kenya | hurumap_zm/profiles.py | Python | gpl-3.0 | 33,757 |
# Copyright (C) 2010 CAMd
# Please see the accompanying LICENSE file for further information.
"""This module provides all the classes and functions associated with the
evaluation of exact exchange with k-point sampling."""
from math import pi, sqrt
import numpy as np
from ase import Atoms
from gpaw.xc import XC
fr... | qsnake/gpaw | gpaw/xc/hybridk.py | Python | gpl-3.0 | 14,413 |
###############################################################################
## ##
## This file is part of ModelBlocks. Copyright 2009, ModelBlocks developers. ##
## ##
... | modelblocks/modelblocks-release | resource-gcg/scripts/induciblediscgraph.py | Python | gpl-3.0 | 35,189 |
#!/usr/bin/env python3
header = """
..
DO NOT EDIT: This file was automatically generated by running doc/acknowledge.py
Edit doc/acknowledge.py, doc/funding.csv, and doc/citing-pism.bib
"""
acknowledgement = """
Acknowledging PISM funding sources
----------------------------------
If you use PISM in a publica... | pism/pism | doc/acknowledge.py | Python | gpl-3.0 | 3,113 |
# Plotting routines in Python
# requires data from Assemble_Data.py
# Copyright (C) 2017 Kevin Maher
# 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... | Vettejeep/Boulder_County_Home_Prices | plots.py | Python | gpl-3.0 | 5,261 |
from enums import Color, Value
from testing.game_testing import GameSimulatorTesting
from onlyfulltag_v1_0.bot import Bot
class Game12711(GameSimulatorTesting):
def test_turn_0(self):
# Deck size 40, Bob, Clues 8, Score 0
self.load_game('games/12711.json', position=1, turn=0, botcls=Bot)
s... | MeGotsThis/Hanabi-AI | onlyfulltag_v1_0/tests/game_12711.py | Python | gpl-3.0 | 8,508 |
#!/usr/bin/env python
import os, pygame, string, sys, getopt, math, struct
from pygame.locals import *
from socket import *
#
# global variables
#
versionNumber = '0.4'
BoardEdge = 40
#
resolution = (1024, 1024)
#
#
Black = (0, 0, 0)
lightGrey = (200, 200, 200)
fullscreen ... | gaiusm/pge | older/pgepygame.py | Python | gpl-3.0 | 4,818 |
"""
This module is used to generate graphs that show the interaction between authors either through multiple edges or
through edge weights. There is an edge from one author to another if the former sent a message to the latter. These
graphs depict thread-wise interaction of the authors for the entire mailing list and t... | yashpungaliya/MailingListParser | lib/analysis/author/graph/interaction.py | Python | gpl-3.0 | 7,719 |
# -*- coding: utf-8 -*-
""" Handles notifications from XBMC via its own thread and forwards them on to the scrobbler """
import sys, re
import xbmc
import xbmcaddon
import xbmcgui
if sys.version_info < (2, 7):
import simplejson as json
else:
import json
import globals
from myshowsapi import myshowsAPI
from u... | DiMartinoX/plugin.video.kinopoisk.ru | script.myshows/notification_service.py | Python | gpl-3.0 | 14,005 |
#! /usr/bin/env python
#
# Copyright 2015 George-Cristian Muraru <murarugeorgec@gmail.com>
# Copyright 2015 Tobias Mueller <muelli@cryptobitch.de>
# ... | murarugeorgec/USB-checking | USB/USB_devices/usb_list.py | Python | gpl-3.0 | 11,203 |
#!/usr/bin/env python
##
## Biskit, a toolkit for the manipulation of macromolecular structures
## Copyright (C) 2004-2018 Raik Gruenberg & Johan Leckner
##
## 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 Softwar... | graik/biskit | archive_biskit2/scripts/Dock/pdb2complex.py | Python | gpl-3.0 | 2,397 |
#5/17/2014
import telnetlib
import random
from utility import *
tn = telnetlib.Telnet("3dttt_87277cd86e7cc53d2671888c417f62aa.2014.shallweplayaga.me",1234)
X = 'X'
O = 'O'
def get_sym(coor): #sym => symmetric
if coor == 0:
return 2
if coor == 1:
return 1
if coor == 2:
return 0
d... | SeMorgana/ctf | defcon2014/3dttt.py | Python | gpl-3.0 | 5,141 |
# encoding: utf-8
"""
nrnpython implementation of the PyNN API.
:copyright: Copyright 2006-2016 by the PyNN team, see AUTHORS.
:license: CeCILL, see LICENSE for details.
"""
from copy import deepcopy
import numpy
import logging
try:
from itertools import izip
except ImportError:
izip = zip # Python 3 zip ret... | anupkdas-nus/global_synapses | pyNN-dispackgaes/neuron/projections.py | Python | gpl-3.0 | 7,227 |
# Copyright (c) 2010-2021 openpyxl
"""Constants for fixed paths in a file and xml namespace urls."""
MIN_ROW = 0
MIN_COLUMN = 0
MAX_COLUMN = 16384
MAX_ROW = 1048576
# constants
PACKAGE_PROPS = 'docProps'
PACKAGE_XL = 'xl'
PACKAGE_RELS = '_rels'
PACKAGE_THEME = PACKAGE_XL + '/' + 'theme'
PACKAGE_WORKSHEETS = PACKAGE... | manuvarkey/cmbautomiser | cmbautomiser/openpyxl/xml/constants.py | Python | gpl-3.0 | 4,546 |
from autobahn.wamp.types import CallOptions, RegisterOptions
from autobahn.asyncio.wamp import ApplicationSession, ApplicationRunner
class WampComponent(ApplicationSession):
def getLogger(self):
return logging.getLogger('{}.{}'.format(self.__module__, self.__class__.__name__))
def getRegisterOptions(... | pablodanielrey/scripts | docker/src/libs/wamp_utils/WampComponent.py | Python | gpl-3.0 | 694 |
#!/usr/bin/env python
#
# ELBE - Debian Based Embedded Rootfilesystem Builder
# Copyright (C) 2013 Linutronix GmbH
#
# This file is part of ELBE.
#
# ELBE 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, eithe... | ferdisdot/elbe | elbepack/db.py | Python | gpl-3.0 | 38,880 |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.api import create_page, create_title
from cms.apphook_pool import apphook_pool
from cms.appresolver import (applications_page_check, clear_app_resolvers,
get_app_patterns)
from cms.test_utils.testcases import CMSTestCase
from cms.test_utils.uti... | hzlf/openbroadcast | website/cms/tests/apphooks.py | Python | gpl-3.0 | 9,529 |
import json
from os import getenv
try:
from urllib.request import urlopen, Request # Python 3
from urllib.error import HTTPError
except ImportError:
from urllib2 import urlopen, Request # Python 2
from urllib2 import HTTPError
class DigitalOcean(object):
def __init__(self):
self.token =... | kshcherban/acme-nginx | acme_nginx/DigitalOcean.py | Python | gpl-3.0 | 3,177 |
#-------------------------------------------------------------------------------
# Copyright (c) 2012 Gael Honorez.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the GNU Public License v3.0
# which accompanies this distribution, and is available at
# http://w... | HaraldWeber/client | src/featuredmods/__init__.py | Python | gpl-3.0 | 1,073 |
class WintersunException(Exception):
"""General Wintersun exception"""
class IncompletePost(WintersunException):
"""Post is missing data"""
class PostRepoException(WintersunException):
"""Error with Post Repository"""
class NotFound(PostRepoException):
"""Post not found in Repository"""
class Du... | sirMackk/wintersun | wintersun/exceptions.py | Python | gpl-3.0 | 391 |
if __name__ == '__main__':
from oricreate.api import \
CreasePattern, CustomCPFactory, MapToSurface
from oricreate.fu import \
FuNodeDist
import numpy as np
cp = CreasePattern(X=[[0, 0, 0],
[0.5, 0, 0],
[10.0, 0, 0]],
... | simvisage/oricreate | apps/examples/exX02_opt_crit_node_distance.py | Python | gpl-3.0 | 684 |
# -*- coding: utf-8 -*
from pymeasure.instruments.pyvisa_instrument import PyVisaInstrument
from pymeasure.case import ChannelRead
from pymeasure.instruments.oxford import OxfordInstrument
import time
class _QxfordILMChannel(ChannelRead):
def __init__(self, instrument):
ChannelRead.__init__(self)
... | t--wagner/pymeasure | instruments/oxford_ilm.py | Python | gpl-3.0 | 1,931 |
#!/usr/bin/env python3
# Copyright (C) 2017 ASTRON (Netherlands Institute for Radio Astronomy)
# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General P... | kernsuite-debian/lofar | MAC/Services/TaskManagement/Server/test/t_taskmanagement.py | Python | gpl-3.0 | 6,040 |
# encoding: utf8
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('infrastructure', '0016_auto_20140209_0826'),
]
operations = [
migrations.AddField(
model_name='module_list',
name='widget_setup_js',
... | SingularityHA/WebUI | infrastructure/migrations/0017_module_list_widget_setup_js.py | Python | gpl-3.0 | 420 |
from django.contrib import messages
from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404, redirect
from django.utils.translation import gettext_lazy as _
from zds.member.decorator import LoggedWithReadWriteHability
from zds.tutorialv2.forms import RemoveSuggestionForm, Edi... | ChantyTaguan/zds-site | zds/tutorialv2/views/editorialization.py | Python | gpl-3.0 | 4,855 |
# Copyright (c) 2004-2009 Moxie Marlinspike
#
# 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 distri... | 0x0mar/MITMf | sslstrip/SSLServerConnectionHSTS.py | Python | gpl-3.0 | 4,966 |
import datetime
from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
from django.forms import ModelForm
class Task(models.Model):
creator = models.ForeignKey(User, related_name='Creator')
owner = models.ForeignKey(User, related_name='Owner')
creation_da... | hanset/kanban | board/models.py | Python | gpl-3.0 | 1,141 |
#!/usr/bin/env python2
import os
import sys
import dbus
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
from webpage import WebPage
class Installer(QObject):
@pyqtSlot()
def closeInstaller(self):
sys.exit(0)
@pyqtSlot(str)
def reboot(self,msg):
msg ... | sonald/Red-Flag-Linux-Installer | examples/installer/libs/run.py | Python | gpl-3.0 | 4,093 |
import random
import sys
class MarkovChain(object):
def __init__(self, separator = None, corpus = None):
self.separator = separator
self.corpus = corpus
self.chain = self.setChain()
def setChain(self):
chain = {}
if self.separator is None:
allItems = self.co... | gglyptodon/marcook | markovchain.py | Python | gpl-3.0 | 1,417 |
#!/usr/bin/env python
import array
import binascii
import glob
import itertools
import json
import logging
import os
import serial
import signal
import stm32_crc
import struct
import threading
import time
import traceback
import uuid
import zipfile
try:
from collections import OrderedDict
except:
from ordereddict i... | Elleo/rockwatch | pebble/pebble.py | Python | gpl-3.0 | 33,192 |
# Natural Language Toolkit: Clusterers
#
# Copyright (C) 2001-2010 NLTK Project
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
This module contains a number of basic clustering algorithms. Clustering
describes the task of discovering groups of si... | markgw/jazzparser | lib/nltk/cluster/__init__.py | Python | gpl-3.0 | 4,217 |
from django.conf.urls import url, include
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.urls import path
from confla import views
app_name = "confla"
urlpatterns = [
path('admin/', admin.site.urls),
url(r'^$', views.IndexView... | rh-lab-q/conflab | wsgi/openshift/confla/urls.py | Python | gpl-3.0 | 6,136 |
"""
Editor Module
This module defines the Editor class. This module runs
the game's level editor.
"""
import sys, os
import tkinter as tk
from tkinter.filedialog import askopenfilename, asksaveasfilename
from .. import asset
from ..config import START_LEVEL, LEVEL_PATH
from .brick import BrickFrame
from .entry impo... | Oisota/Breakout | breakout/editor/editor.py | Python | gpl-3.0 | 3,858 |
#!/usr/bin/python2
# -*- coding: utf-8 -*-
"""Convert markdown to zim wiki syntax.
Stripped and modified from markdown2.py
Syntax converted:
type Markdown -> Zim
----------------------------------------------------
Heading1 # heading ===== heading =====
Head... | Xunius/evernote2zim | lib/markdown2zim.py | Python | gpl-3.0 | 43,705 |
import bpy
from ... base_types.node import AnimationNode
class an_EdgesOfPolygonsNode(bpy.types.Node, AnimationNode):
bl_idname = "an_EdgesOfPolygonsNode"
bl_label = "Edges of Polygons"
def create(self):
self.newInput("Polygon Indices List", "Polygons", "polygons")
self.newOutput("Edge Ind... | Thortoise/Super-Snake | Blender/animation_nodes-master/nodes/mesh/edges_of_polygons.py | Python | gpl-3.0 | 685 |