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 |
|---|---|---|---|---|---|
from .case_list import CaseList
from .case_selector import CaseSelectorModel
from .initialized_case_selector import InitializedCaseSelectorModel
from .init_members import InitializationMembersModel
from .init_parameters import InitializationParametersModel
from .init_from_scratch import InitializeFromScratchModel
from ... | iLoop2/ResInsight | ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/__init__.py | Python | gpl-3.0 | 487 |
import tensorflow as tf
import numpy as np
class Layer(object):
def __init__(self, name, shape, activation=None, dropout=None):
"""
shape - Layer shape
activation - current supported: None, 'relu', 'sigmoid', 'tanh'
dropout - A float between 0.0 and 1.0. Specifies proobability of la... | kalessin/nntop | NNtop/__init__.py | Python | gpl-3.0 | 12,247 |
import sys
import setuptools
from distutils.core import setup
if sys.version_info[:2] < (2, 6) or (3, 0) <= sys.version_info[0:2] < (3, 3):
raise RuntimeError("Python version 2.6, 2.7 or >= 3.3 required.")
version = "0.6.dev"
setup(
name="numpydoc",
packages=["numpydoc"],
version=version,
descr... | loli/medpy | doc/numpydoc/setup.py | Python | gpl-3.0 | 986 |
# coding=utf8
from app import create_app
app = create_app()
| ipconfiger/fbones | resources/wsgi.py | Python | gpl-3.0 | 62 |
# Copyright (C) 2016-2019 Sander Bollen
#
# This file is part of wisestork
#
# 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 opt... | sndrtj/wisecondor | wisestork/wisestork.py | Python | gpl-3.0 | 7,391 |
#!/usr/local/bin/python2.7
import sys
import os
import time
import logging
import smtplib
import socket
from sitel.environment import ActiveMQ
from sitel.environment import proxy_email
from stompest.config import StompConfig
from stompest.protocol import StompSpec
from stompest.sync import Stomp
from subprocess impo... | itay-moav/talis | bin/daemon/nfssync.py | Python | gpl-3.0 | 3,964 |
from django.conf import settings
from django.template import Context, loader
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest, HttpResponseNotFound
from django.core.context_processors import csrf
from django.shortcuts import render_to_response
from models import Building
from svg impor... | gtfierro/BAS | web/smapgeo/views.py | Python | gpl-3.0 | 2,753 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-02-03 23:09
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('harvest', '0001_initial'),
]
operations = [
... | marcospereirampj/m2agro-api | m2agro_api/harvest/migrations/0002_auto_20170203_2009.py | Python | gpl-3.0 | 710 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-09 20:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('snapventure', '0008_auto_20161109_2031'),
]
operations = [
migrations.RenameModel(
... | DomDomPow/snapventure | snapventure-backend/snapventure/migrations/0009_auto_20161109_2038.py | Python | gpl-3.0 | 396 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Holds various helper classes to keep the file number manageable.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import *
from math import pi
class SlownessModelError(Exception):
... | obspy/TauPy | taupy/helper_classes.py | Python | gpl-3.0 | 2,012 |
from django import forms
from django.forms import BaseFormSet
from django.conf import settings
import requests
from django.utils.translation import ugettext_lazy as _
from .models import Question, Choice
class CreateQuestion(forms.ModelForm):
class Meta:
model = Question
fields = ('question_tex... | netsudo/twitchpolls | poll/forms.py | Python | gpl-3.0 | 1,472 |
#######################################################################
# This file is part of Lyntin.
# copyright (c) Free Software Foundation 2001, 2002
#
# Lyntin is distributed under the GNU General Public License license. See the
# file LICENSE for distribution details.
# $Id: utils.py,v 1.1 2003/05/05 05:55:33 w... | v-legoff/accertin | lyntin/errata/utils.py | Python | gpl-3.0 | 7,491 |
# engine/strategies.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Strategies for creating new instances of Engine types.
These are semi-private... | landier/imdb-crawler | crawler/libs/sqlalchemy/engine/strategies.py | Python | gpl-3.0 | 8,943 |
from datetime import datetime
import spotipy
from spotipy import oauth2
from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
oa = oauth2.SpotifyOAuth(
settings.SPOTIFY_CLIENT_ID,
settings.SPOTIFY_CLIENT_SECRET,
settings.SPOTIFY_OAUTH_REDIR... | pokelondon/pokeradio | web/pokeradio/spotify_playlist/models.py | Python | gpl-3.0 | 2,831 |
from .abstract_base import *
from .abstract_test import *
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.filebased.FileBasedCache",
"LOCATION": "/tmp/django_cache",
}
}
| ChantyTaguan/zds-site | zds/settings/test.py | Python | gpl-3.0 | 210 |
from core.checkandconvertbysickbeardmp4conv import checkandconvert
from core.subprocesslauncher import Subprocesslauncher
import os
import sys
def main():
# Paths and make sure they exist
path_to_python = sys.executable
path_of_script = os.path.dirname(os.path.realpath(__file__))
nzbtomediadirectory = ... | Filechaser/nzbToMedia | nzbToSickBeard-with-extmp4conv.py | Python | gpl-3.0 | 1,079 |
#!/usr/bin/python
import os, sys, datetime, argparse
from app.pricefuncs import price_int_to_str, str_align
from app.db import *
session = None
def print_group(title, group):
print('-'*80)
print('%s in %s' % (title, group))
print('-'*80)
def print_product(p):
savings = 0
if p.price_savings is no... | cleure/Amazon-Scraper | list.py | Python | gpl-3.0 | 1,886 |
# Copyright (C) 2012-2013 Benjamin Althues
#
# This file is part of springwhiz.
#
# springwhiz 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 ... | babab/springwhiz | springwhiz/bookmarks/admin.py | Python | gpl-3.0 | 805 |
import base
import sys
import tdlib
import unittest
import time
if(len(sys.argv)<2 or sys.argv[1]!="long"):
sys.exit(77)
from graphs import *
import CFGs
#don't confuse python unittest
sys.argv=sys.argv[:1]
PREFIX = "CFGs"
COUNT = 1752
class TestTD_VC(unittest.TestCase):
def test_max_clique(self):
... | llarisch/VC | experiments/python/test_CFGs_Clique.py | Python | gpl-3.0 | 1,226 |
# Copyright (C) 2011-2016 Lars Wirzenius
#
# 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 distribu... | obnam-mirror/obnam | obnamlib/plugins/encryption_plugin.py | Python | gpl-3.0 | 11,719 |
########################################################################
# $HeadURL $
# File: File.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2012/08/03 15:02:53
########################################################################
""" :mod: File
==========
.. module: File
:synopsis: RMS operat... | avedaee/DIRAC | RequestManagementSystem/Client/File.py | Python | gpl-3.0 | 7,909 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-05 17:42
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('au_auth', '0003_remove_profile_abouts'),
('au_about'... | DAS2016-1/about_us | about_us/au_about/migrations/0002_about_profile.py | Python | gpl-3.0 | 622 |
#!/usr/bin/env python
import re
import sys
print(sys.argv)
if len(sys.argv) != 2:
print("USAGE: extract_problem.par LOGFILE")
sys.exit(1)
f = open(sys.argv[1])
data = f.readlines()
f.close()
namelist = re.compile('\&[A-Z]')
change = re.compile('\*\s[A-Z]')
slash = re.compile('0:\s{1,4}/$')
for line in data... | varadarajan87/piernik | bin/extract_problem_par.py | Python | gpl-3.0 | 696 |
#!/usr/bin/python
# Initng, a next generation sysvinit replacement.
# Copyright (C) 2005-6 Aidan Thornton <makomk@lycos.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# ... | initng/initng | src/modules/ngcs/idef.py | Python | gpl-3.0 | 13,593 |
"""
Copyright (C) 2018 Quinn D Granfor <spootdev@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
... | MediaKraken/MediaKraken_Deployment | source/common/common_rar.py | Python | gpl-3.0 | 1,114 |
import os
from uuid import uuid4
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from simple_history.models import HistoricalRecords
from core.utils import SEXES
def user_profile_picture(instance, filename): # pylint: disable=un... | DheerendraRathor/ldap-oauth2 | account/models.py | Python | gpl-3.0 | 1,207 |
#!/opt/local/bin/python3.4
# -*- coding: utf-8 -*-
import sys, os
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class Form(QMainWindow):
def __init__(self, parent=None):
super(Form, self).__init__(parent)
self.setWindowTitle("LED Tool")
tables = QWidget()
table_layout = Q... | zagl/led-tool | ui.py | Python | gpl-3.0 | 9,150 |
class FunctionSet(object):
def __init__(self, name = None, func = None, arity = None):
self.name = name
self.func = func
self.arity = arity
def getName(self):
return self.name
def getArity(self):
return self.arity
def getFunc(self):
return self.func
... | JokerHB/Genetic-Programming | Components/FunctionSet.py | Python | gpl-3.0 | 513 |
# BLE provider implementation using Linux's bluez library over its DBus
# interface.
# Author: Tony DiCola
#
# Copyright (c) 2015 Adafruit Industries
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the ... | fourtriple/bt-dist | Adafruit_Python_BluefruitLE/Adafruit_BluefruitLE/bluez_dbus/provider.py | Python | gpl-3.0 | 9,541 |
#!/usr/bin/env python
# coding: iso-8859-15
import re
import sys
import pgdb
import pg
from optparse import OptionParser
import getpass
from database import getDBname, getDBhost, getDBport, getDBuser
#
# getHeaderLines
#
def get_header_lines(filename):
"""
Returns a list containing all lines that do NOT conta... | kernsuite-debian/lofar | MAC/Deployment/data/Coordinates/load_measurementfile.py | Python | gpl-3.0 | 6,742 |
#!/usr/bin/env python3
import unittest
from xls_processor import Block, Blocks, CellCategory, Direction
class KnownBlocks(unittest.TestCase):
known_blocks = (
(Block(None, (0,0), (0,0), CellCategory.Label), (1,1)),
(Block(None, (1,1), (1,14), CellCategory.Label), (1,14)),
(Block(None, (2,1), (2,7), Cell... | mfsteen/CIQTranslate-Kristian | xls_processor_test.py | Python | gpl-3.0 | 1,552 |
# browsershots.org - Test your web design in different browsers
# Copyright (C) 2007 Johann C. Rocholl <johann@browsershots.org>
#
# Browsershots 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 ... | hugs/shotfactory | shotfactory04/inifile.py | Python | gpl-3.0 | 3,925 |
###############################################################################
# #
# 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 #
... | dparks1134/biolib | biolib/blast_parser.py | Python | gpl-3.0 | 5,252 |
"""DIRAC Administrator API Class
All administrative functionality is exposed through the DIRAC Admin API. Examples include
site banning and unbanning, WMS proxy uploading etc.
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
__RCSID__ = "$Id$"
import... | yujikato/DIRAC | src/DIRAC/Interfaces/API/DiracAdmin.py | Python | gpl-3.0 | 29,759 |
#!/usr/bin/env python
# encoding: utf-8
'''
pcap2uml -- shortdesc
pcap2uml is a description
It defines classes_and_methods
@author: Denis Gudtsov
@copyright: 2016-2017 Denis Gudtsov. All rights reserved.
@license: GPL
@contact: user_email
@deffield updated: Updated
'''
import sys
import os
import s... | dgudtsov/pcap2uml | pcap2uml.py | Python | gpl-3.0 | 21,185 |
# *-* coding=utf-8 *-*
import sys
sys.path.append( "./src" )
from global_var import g_project_dir
import breed_debug as debug
import breed_intep
def main():
breed_intep.compile(g_project_dir+"component/interface/plc.brd")
if __name__ == "__main__":
#try:
main()
#except Exception... | ttch/breed | main.py | Python | gpl-3.0 | 359 |
import os
from collections import namedtuple
import orthrusutils.orthrusutils as util
class BuildEnv(object):
cwd = os.getcwd()
blacklist_file = '{}/asan_blacklist.txt'.format(cwd)
BEnv = namedtuple('BEnv', ['cc', 'cxx', 'cflags', 'cxxflags', 'ldflags',
'ldxxflags', 'misc'])
... | test-pipeline/orthrus | builder/builder.py | Python | gpl-3.0 | 5,319 |
#!/usr/bin/env python
# coding=utf-8
"""609. π sequences
https://projecteuler.net/problem=609
For every $n \ge 1$ the **prime-counting** function $\pi(n)$ is equal to the
number of primes not exceeding $n$.
E.g. $\pi(6)=3$ and $\pi(100)=25$.
We say that a sequence of integers $u = (u_0,\cdots,u_m)$ is a _$\pi$
seq... | openqt/algorithms | projecteuler/pe609-π-sequences.py | Python | gpl-3.0 | 850 |
#
# Copyright (C) 2013 EMBL - European Bioinformatics Institute
#
# 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.
#
# ... | sbotond/rlsim | tools/effest_src/eff_model.py | Python | gpl-3.0 | 5,075 |
#
# Author: Jay Deiman
# Email: admin@splitstreams.com
#
# This file is part of pylibgal3.
#
# pylibgal3 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
# ... | crustymonkey/pylibgal3 | libg3/G3Items.py | Python | gpl-3.0 | 17,212 |
from mimircache.top.cachecow import cachecow
m = cachecow(size=6000)
# m.test()
m.open('../data/parda.trace')
p = m.profiler("LRU")
# p = m.profiler(LRU, data='../data/parda.trace', dataType='plain')
p.run()
# print(len(p.HRC))
# print(p.MRC[-1])
# rdist = p.get_reuse_distance()
# print(rdist[-1])
p.plotHRC()
# p.plot... | Shureed/mimircache | mimircache/test/usageTest.py | Python | gpl-3.0 | 326 |
import os
import sys
from time import *
import subprocess
import signal
from machinekit import compat
_processes = []
_realtimeStarted = False
_exiting = False
# ends a running Machinekit session
def end_session():
stop_processes()
if _realtimeStarted: # Stop realtime only when explicitely started
s... | wilsonxiao/machinekit | lib/python/machinekit/launcher.py | Python | gpl-3.0 | 8,166 |
idade = input ("digite sua idade: ")
idade = float (idade)
ano = (2018)
nascimento = (ano - idade)
print ("o ano de seu nascimento é: % 6.0f" % nascimento) | ronas/PythonGNF | Igor/idade.py | Python | gpl-3.0 | 169 |
import os
import netifaces
import definitions
from engine.collector import AutomaticCollector
class tshark(AutomaticCollector):
#TODO: need plugin type in configs?
#TODO: Use self.output_filepath?
def build_commands(self):
# get additional options from the config file
mode = self.config.ge... | ARL-UTEP-OC/ecel | plugins/collectors/tshark/tshark.py | Python | gpl-3.0 | 1,075 |
# coding=utf-8
import unittest
"""529. Minesweeper
https://leetcode.com/problems/minesweeper/description/
Let's play the minesweeper game
([Wikipedia](https://en.wikipedia.org/wiki/Minesweeper_\(video_game\)),
[online game](http://minesweeperonline.com))!
You are given a 2D char matrix representing the game board. *... | openqt/algorithms | leetcode/python/lc529-minesweeper.py | Python | gpl-3.0 | 3,159 |
from codecs import open
from os import path
from setuptools import setup, find_packages
HERE = path.abspath(path.dirname(__file__))
VERS = '1.0.7-1'
DESC = 'Script to create task records in airtable from parsed emails'
with open(path.join(HERE, 'README.md'), encoding='utf-8') as f:
LONG_DESCRIPTION = f.read()
se... | rickh94/attaskcreator | setup.py | Python | gpl-3.0 | 951 |
"""
.. moduleauthor:: Michael Clausen <clm@hevs.ch>
.. codeauthor:: Michael Clausen <clm@hevs.ch>
.. codeauthor:: Gillian Basso <gillian.basso@hevs.ch>
.. codeauthor:: Yann Maret <yann.maret@hevs.ch>
"""
from gridsim.cyberphysical.element import Actor
from gridsim.cyberphysical.simulation import CyberPhysi... | gridsim/gridsim | gridsim/cyberphysical/actor/spaceheating.py | Python | gpl-3.0 | 3,400 |
import re
string = str(input())
stringList = string.split('|')
d = dict()
def removeCases(string):
string = string.lower()
string = re.sub( '\s+', ' ', string ).strip()
string = string.replace("\"","")
string = string.replace(",",".")
string = re.sub('-+','-',string)
return string
def chan... | intellectape/python-projects | Coding Challenges/IBM Cognitive Test/misc.py | Python | gpl-3.0 | 4,025 |
# -*- coding: utf-8 -*-
class GridsyncError(Exception):
pass
class AbortedByUserError(GridsyncError):
pass
class FilesystemLockError(GridsyncError):
pass
class UpgradeRequiredError(GridsyncError):
pass
class TahoeError(GridsyncError):
pass
class TahoeCommandError(TahoeError):
pass
... | gridsync/gridsync | gridsync/errors.py | Python | gpl-3.0 | 404 |
''' 添加库'''
import numpy as np
import pandas as pd
''' 载入文件'''
header = ['user_id','item_id','rating','timestamp']
df = pd.read_csv('mk-100k/u.data',sep='\t',names = header)
''' 读取数据'''
n_user = df.user_id.unique().shape[0]
n_items = df.item_id.unique().shape[0]
print 'Number of users = ' + str(n_user) + '| Number of m... | lijhong/CNN-kereas | recsys.py | Python | gpl-3.0 | 2,868 |
# Copyright (C) 2014 ETH Zurich, Institute for Astronomy
'''
A simple example to demonstrate the supported NumPy functions
http://pythonhosted.org/hope/lang.html#numpy-mathematical-functions
Created on Oct 23, 2014
author: jakeret
'''
from __future__ import print_function, division, absolute_import, unicode_literal... | cosmo-ethz/hope | examples/hope_numpy.py | Python | gpl-3.0 | 2,233 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QAD Quantum Aided Design plugin
comando OFFSET per fare l'offset di un oggetto
-------------------
begin : 2013-10-04
copyright : iiiii
... | geosim/QAD | qad_offset_cmd.py | Python | gpl-3.0 | 36,713 |
import requests
import configobj
import validate
import argparse
import os
import sys
import re
import socket
import logging
import logging.handlers
import backoff
import json
import yagmail
import schedule
import time
import daemon
import urllib3
import signal
import kodijson
import datetime
from bs4 import BeautifulS... | binhex/trigger-docker-build | TriggerDockerBuild.py | Python | gpl-3.0 | 46,679 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
#
# 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 y... | CryptoManiac/electrum-nvc | lib/daemon.py | Python | gpl-3.0 | 10,394 |
import abc
import json
import yaml
from golem.core.simpleserializer import to_dict
from golem.interface.command import CommandResult
from golem.interface.exceptions import CommandException
from tabulate import tabulate
class _CommandResultFormatter(object):
__metaclass__ = abc.ABCMeta
def __init__(self, arg... | imapp-pl/golem | golem/interface/formatters.py | Python | gpl-3.0 | 2,618 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010 Romain Bignon
#
# 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 of the License.
#
# This program is distributed in the hope that it will b... | jocelynj/weboob | weboob/applications/qboobmsg/qboobmsg.py | Python | gpl-3.0 | 1,219 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Photo.caption'
db.alter_column('photos_photo', 'caption', self.gf('django.db.models.field... | CoJMC/jaam | jaam/photos/migrations/0002_auto__chg_field_photo_caption__chg_field_photogallery_introduction__de.py | Python | gpl-3.0 | 12,946 |
import threading
from abc import ABCMeta
class Command(object):
__metaclass__ = ABCMeta
def __init__(self, type, data):
self._type = type
self._data = data
def _get_data(self):
return self._data
def _get_type(self):
return self._type
data = property(_get_data)
... | stefanvanwouw/najnaf | src/shared/app.py | Python | gpl-3.0 | 1,951 |
import sample_stanford_products
import sample_cars196
import sample_cub200
import sample_deepfashion
import sample_vehicleid
import util
import sys, getopt
def main(argv):
dataset = ''
try:
opts, args = getopt.getopt(argv, "hd:",["dataset="])
except getopt.GetoptError:
print 'Error : hdc_p... | PkuRainBow/Hard-Aware-Deeply-Cascaded-Embedding_release | src_code/hdc_process.py | Python | gpl-3.0 | 4,801 |
# Copyright (c) 2016 RIPE NCC
#
# 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 h... | pierky/ripe-atlas-tools | ripe/atlas/tools/commands/measure/dns.py | Python | gpl-3.0 | 5,333 |
#!/usr/bin/env python
"""
@file xmledges_applyOffset.py
@author Daniel Krajzewicz
@date 2009-08-01
@version $Id: xmledges_applyOffset.py 13811 2013-05-01 20:31:43Z behrisch $
Applies a given offset to edges given in an xml-edge-file.
The results are written into <XMLEDGES>.mod.xml.
Call: xmledges_applyOffset.py... | rudhir-upretee/Sumo17_With_Netsim | tools/net/xmledges_applyOffset.py | Python | gpl-3.0 | 2,113 |
import sys
import xml.etree.ElementTree as ET
from modules.supportingfunctions import die_with_errormsg
from modules.logging import LogMaster
class ConfigFilesXML():
def __init__(self, config_filepath_list):
self.config_filepath_list = config_filepath_list[:]
self._num_config_files = len(self.conf... | TarquinQ/email-rule-enforcer | email-rule-enforcer/modules/settings/get_xml_configs.py | Python | gpl-3.0 | 3,816 |
# -*- coding: utf-8 -*-
# Fedora Gooey Karma prototype
# based on the https://github.com/mkrizek/fedora-gooey-karma
#
# Copyright (C) 2013
#
# 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... | blaskovic/fedora-gooey-karma | src/sendkarma.py | Python | gpl-3.0 | 3,089 |
#!/usr/bin/python
"""
This script reads a BulkConverted table and create a matrix, where every row is a gene
and every column is a sample. The cells contains the number of mutations.
"""
import sys
table = dict()
header = set()
for line in open(sys.argv[1]):
if line.startswith("#"):
continue
fields = line... | TravisCG/SI_scripts | genesampletab.py | Python | gpl-3.0 | 761 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# dbload.py
#
# Copyright 2015 Hartland PC LLC
#
# This file is part of the of the database loader for CCE 4.0 (open source version).
#
# This package is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | linuxmahara/Open-Source-CCE-4.0-master | dbload.py | Python | gpl-3.0 | 15,066 |
""" DIRAC FileCatalog Security Manager mix-in class for access check only on the directory level
with a special treatment of the Delete operation
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = "$Id$"
from DIRAC import S_OK
from DIRAC.Da... | ic-hep/DIRAC | src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/DirectorySecurityManagerWithDelete.py | Python | gpl-3.0 | 3,492 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Soldeva, SRL and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestLoan(unittest.TestCase):
# def set_missing_values(self):
# # to fecth the default company
# # self.company = frappe.defaults.get_global_def... | YefriTavarez/finance_manager | fm/finance_manager/doctype/loan/test_loan.py | Python | gpl-3.0 | 436 |
# This file is part of ArcJail.
#
# ArcJail 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.
#
# ArcJail is distributed in the hope that... | KirillMysnik/ArcJail | srcds/addons/source-python/plugins/arcjail/modules/arcjail/__init__.py | Python | gpl-3.0 | 903 |
import logging
from yapsy.PluginManager import PluginManagerSingleton
from penfold.PenfoldPluginInfo import PenfoldPluginInfo
import penfold.config as config
log = logging.getLogger(__name__)
class PenfoldPluginManager:
""" The PluginManager for the application"""
def __init__(self):
_plugin_places... | neil-davis/penfold | src/package/penfold/PenfoldPluginManager.py | Python | gpl-3.0 | 1,104 |
# 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/__init__.py | Python | gpl-3.0 | 6,861 |
from .submaker import Submaker
import os
import shutil
class BusyboxSubmaker(Submaker):
SYMLINKS = [
"djtimex","arp","ash","awk","base64","basename","bbconfig","blkid","blockdev","brctl","bunzip2","bzcat"
,"bzip2","cal","cat","catv","chattr","chgrp","chmod","chown","chroot","clear","cmp","comm","cp",... | vaginessa/inception | inception/argparsers/makers/submakers/submaker_busybox.py | Python | gpl-3.0 | 2,781 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import logging
import ... | Yelp/pootle | pootle/apps/pootle_app/management/commands/test_checks.py | Python | gpl-3.0 | 4,194 |
"""Sample usage of the Composite pattern."""
#!/usr/bin/env python
# pylint: disable=missing-docstring,too-few-public-methods
import os
class Item(object):
def __init__(self, name, *children):
self.name = name
self.children = children
def items(self):
return iter(self.children)
d... | andreea-lucau/python-patterns | src/composite/file_system.py | Python | gpl-3.0 | 1,293 |
import os
import sys
import gtk
import pango
import webbrowser
import user
import gettext
import common
import shlex
import subprocess
import glib
import urllib
import signal
from menus import MenuManager
from mounts import MountsManager
from icons import IconManager
from emblems import EmblemManager
from associations... | Azulinho/sunflower-file-manager-with-tmsu-tagging-support | application/gui/main_window.py | Python | gpl-3.0 | 85,386 |
#!/usr/bin/python3
from sympy import *
from sympy.utilities.codegen import codegen
# BSD 3-Clause License
# Copyright (c) 2017, Abhimanyu Ghosh
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# ... | Aghosh993/QuadcopterCodebase | GroundSoftware/GNCDev/kalman_3state_height.py | Python | gpl-3.0 | 5,632 |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# $Id: lcd_class.py,v 1.28 2016/07/23 13:21:28 bob Exp $
# Raspberry Pi Internet Radio
# using an HD44780 LCD display
#
# Author : Bob Rathbone
# Site : http://www.bobrathbone.com
#
# From original LCD routines : Matt Hawkins
# Site : http://www.raspberrypi-spy.co.u... | pkali/piradio-mini | lcd_class.py | Python | gpl-3.0 | 10,920 |
# coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid / DFAT -
**New Metadata for SAFE.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free... | Samweli/inasafe | safe/definitions.py | Python | gpl-3.0 | 64,837 |
#!/usr/bin/env python3
import sys
import struct
buf = b'Simon'
buf += b'A' * 47
buf += struct.pack('<I', 0xbfcedfa8) # memory address of SHELLCODE
sys.stdout.buffer.write(buf)
| timkent/covfefe-bof | exploit.py | Python | gpl-3.0 | 178 |
# Copyright (C) 2009-2011 Jason T. Hopper
# All rights reserved.
#
# Jason T. Hopper <hopperj@dal.ca>
# Alice Research Group
# 1271 Church Street, Apt 713. Halifax, Nova Scotia, B3J 3L3
#
# ALICE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pub... | hopperj/twitterHateMining | learning.py | Python | gpl-3.0 | 4,446 |
# GeneaCrystal Copyright (C) 2012-2013
# Christian Jaeckel, <christian.doe@gmail.com>
# Frederic Kerber, <fkerber@gmail.com>
# Pascal Lessel, <maverickthe6@gmail.com>
# Michael Mauderer, <mail@michaelmauderer.de>
#
# GeneaCrystal is free software: you can redistribute it and/or modify
# it under the ... | MichaelMauderer/GeneaCrystal | geneacrystal/main.py | Python | gpl-3.0 | 6,204 |
class model(object):
"""
Generic data model
Children must override _params = (,) with a set of strings
representing column names
"""
_function = None
_datasource = None
_kernel = None
_params = ()
def __init__(self, function, data = {}):
self._function = function
... | srynot4sale/jarvis | data/model.py | Python | gpl-3.0 | 1,388 |
from contrib.rfc2460 import options_processing_hop_by_hop_options_header as suite
from scapy.all import *
from veripy.testability import ComplianceTestTestCase
class OptionsProcessingHopByHopOptionsHeaderTestCaseTestCase(ComplianceTestTestCase):
def test_pad1_option_test_case(self):
self.ifx.replies_with(... | mwrlabs/veripy | contrib/rfc2460/tests/options_processing_hop_by_hop_options_header_test_case.py | Python | gpl-3.0 | 10,623 |
import re
from datetime import timedelta
from django.utils.timezone import localtime
from django.contrib.auth import get_user_model
from model_bakery import baker
from model_bakery.recipe import Recipe
from freezegun import freeze_time
from tenant_schemas.test.cases import TenantTestCase
from tenant_schemas.test.clie... | timberline-secondary/hackerspace | src/quest_manager/tests/test_models.py | Python | gpl-3.0 | 11,176 |
#
# Kay Hayen, mailto:kayhayen@gmx.de
#
# Python test originally created or extracted from other peoples work. The
# parts from me are in the public domain. It is at least Free Software
# where it's copied from other people. In these cases, it will normally be
# indicated.
#
# If you submit Kay ... | pombredanne/nuitka-old-no-longer-maintained | tests/basics/Printing.py | Python | gpl-3.0 | 1,184 |
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
import requests
def createTree(url):
data = requests.get(url, stream=True)
root = ET.fromstring(data.text.encode("utf-8"))
return root
slBagarmossen = 'http://api.sl.se/api2/realtimedepartures.xml?key=11bda0da... | jwesstrom/cleverMirror | xmlParser.py | Python | gpl-3.0 | 1,821 |
#!/usr/bin/python
# Copyright 2017 Tony Kuo
# This program is distributed under the terms of the GNU General Public License
# Utility Script
# Compiles a consensus classification based on the results of readclassify, for hexaploid.
# Classification is determined by the reference with the highest probability.
# ex)
# ... | tony-kuo/eagle | scripts/ref3_consensus.py | Python | gpl-3.0 | 8,070 |
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2015 Jérémy Bobbio <lunar@debian.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundati... | ReproducibleBuilds/diffoscope | diffoscope/comparators/device.py | Python | gpl-3.0 | 2,785 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-10 05:34
from __future__ import unicode_literals
import django.contrib.auth.models
import django.contrib.postgres.fields.jsonb
from django.db import migrations
# DDL triggers aren't yet implemented for CATMAID's history tracking. Therefore,
# the history... | catsop/CATMAID | django/applications/catmaid/migrations/0007_use_django_1_9_jsonfield.py | Python | gpl-3.0 | 1,507 |
# This file is part of PSAMM.
#
# PSAMM 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.
#
# PSAMM is distributed in the hope that it wi... | zhanglab/psamm | psamm/commands/genedelete.py | Python | gpl-3.0 | 5,988 |
""" This test only need the JobLoggingDB to be present
"""
# pylint: disable=invalid-name,wrong-import-position
import unittest
import datetime
import sys
from DIRAC.Core.Base.Script import parseCommandLine
parseCommandLine()
from DIRAC.WorkloadManagementSystem.DB.JobLoggingDB import JobLoggingDB
class JobLogging... | ic-hep/DIRAC | tests/Integration/WorkloadManagementSystem/Test_JobLoggingDB.py | Python | gpl-3.0 | 2,022 |
#
# Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com
#
# This file is part of EigenD.
#
# EigenD 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) a... | Eigenlabs/EigenD | plg_simple/scaler_plg.py | Python | gpl-3.0 | 8,272 |
import os, subprocess
def add_to_env(key, new_values):
vals = list(new_values)
for elem in os.environ.get(key, "").replace("\"", "").split(";"):
if elem and elem not in vals:
vals.append(elem)
os.environ[key] = ";".join(vals)
subprocess.call(["setx", key, os.environ[key]])
add_to_e... | tomamic/fondinfo | setmingw.py | Python | gpl-3.0 | 445 |
# -*- coding: utf-8 -*-
"""Institution Collection Request Handler."""
import json
from util import login_required
from utils import json_response
from utils import Utils
from custom_exceptions import EntityException
from . import BaseHandler
from models import Institution
from models import Address
from models import ... | eciis/web | backend/handlers/institution_request_collection_handler.py | Python | gpl-3.0 | 2,449 |
import tensorflow as tf
import random
import matplotlib.pyplot as plt
tf.set_random_seed(777)
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
nb_classes = 10
X = tf.placeholder(tf.float32, [None, 784])
Y = tf.placeholder(tf.float3... | johnny9210/2017sejongAI | week14/MNIST.py | Python | gpl-3.0 | 1,936 |
#!/usr/bin/python
# This file is part of Morse.
#
# Morse 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.
#
# Morse ... | retooth/morse | morse/views/settings.py | Python | gpl-3.0 | 1,529 |
import datetime
from sqlalchemy import create_engine, exists
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, DateTime, Float, Boolean,\
ForeignKey
from sqlalchemy.orm import relationship
def _convert_bool(s):
'''
Function to be just used here!!
... | sunspotter/database | orm.py | Python | gpl-3.0 | 8,532 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from ..match import Match
from ..rules import Rule
class Rule3(Rule):
def when(self, matches, context):
return context.get('when')
def then(self, matches, when_response, context):
assert when_response in [True, False]
matches.append(Match... | coderbone/SickRage-alt | lib/rebulk/test/rules_module.py | Python | gpl-3.0 | 1,094 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Resources\ui_files\settings\quick_filter_settings_widget.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_QuickFilterSettingsW... | MalloyDelacroix/DownloaderForReddit | DownloaderForReddit/guiresources/settings/quick_filter_settings_widget_auto.py | Python | gpl-3.0 | 3,512 |
import json
import os
import socket
import threading
import time
import traceback
import urlparse
import uuid
from .base import (CallbackHandler,
CrashtestExecutor,
RefTestExecutor,
RefTestImplementation,
TestharnessExecutor,
... | DominoTree/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorwebdriver.py | Python | mpl-2.0 | 21,607 |
import os
from .compatibility import APPS_DIR_PATH, EPLUS_DIR_PATTERN
# ------------------------------------------------- DEFAULT VARIABLES --------------------------------------------------
class _Conf:
encoding = "latin-1" # even needed for example files...
default_model_name = "oplus"
external_files_... | Openergy/oplus | oplus/configuration.py | Python | mpl-2.0 | 2,017 |