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 giblets import Attribute, Component, ExtensionInterface, ExtensionPoint, implements
from melkman.green import green_init
green_init()
import optparse
import signal
import sys
def print_usage(message=None):
print "\nusage: %s <command|help> [...] [config.yaml]" % sys.argv[0]
if message:
print '... | ltucker/melkman | melkman/runner.py | Python | gpl-2.0 | 5,340 |
#! /usr/bin/python2.7
"""Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes."""
# Notes for authors of new mailbox subclasses:
#
# Remember to fsync() changes to disk before closing a modified file
# or returning from a flush() method. See functions _sync_flush() and
# _sync_close().
import sys
imp... | 2ndy/RaspIM | usr/lib/python2.7/mailbox.py | Python | gpl-2.0 | 79,316 |
import tarfile
from unittest.mock import patch
from datetime import datetime
from django.core.management import call_command
from django.core.management.base import CommandError
from django.test import TransactionTestCase
from django.utils import timezone
from main.models import Arch, Package, Repo
from packages.mo... | archlinux/archweb | devel/tests/test_reporead.py | Python | gpl-2.0 | 4,151 |
# -*- coding: utf-8 -*-
#
# Copyright 2002-2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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
# ... | unho/translate | translate/convert/po2ini.py | Python | gpl-2.0 | 4,172 |
import ArtusConfigBase as base
def config():
conf = base.BaseConfig('mc', '2012', analysis='ee')
conf["InputFiles"] = base.setInputFiles(
ekppath="",
nafpath="/pnfs/desy.de/cms/tier2/store/user/dhaitz/2014_08_08_data_QCD/kappa_QCD_350_*.root"
)
conf['EnableLumiReweighting'] = True
... | dhaitz/CalibFW | cfg/artus/background_ee_qcd_350.py | Python | gpl-2.0 | 491 |
# -*- coding: utf-8 -*-
# Copyright 2009-2010 10gen, Inc.
#
# 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 applicable law ... | opendatamonitor/odm.restapi | odmapi/handlers.py | Python | gpl-2.0 | 224,484 |
import eyed3
from eyed3.plugins import Plugin
from eyed3.utils import guessMimetype
class EchoPlugin(eyed3.plugins.Plugin):
NAMES = ["echo"]
SUMMARY = u"Displays each filename and mime-type passed to the plugin"
def handleFile(self, f):
print("%s\t[ %s ]" % (f, guessMimetype(f)))
| nicfit/eyed3 | examples/plugins/echo.py | Python | gpl-2.0 | 305 |
# In The Name Of God
# ========================================
# [] File Name : metaclass.py
#
# [] Creation Date : 21-05-2015
#
# [] Created By : Parham Alvani (parham.alvani@gmail.com)
# =======================================
__author__ = 'Parham Alvani'
class SimpleMetaClass(type):
def __init__(cls, name, ba... | 1995parham/Python101 | src/metaclass.py | Python | gpl-2.0 | 527 |
# -*- coding: utf-8 -*-
# This file is part of Invenio.
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; eithe... | jmacmahon/invenio | modules/websession/lib/session.py | Python | gpl-2.0 | 21,557 |
# -*- coding: utf-8 -*-
import os
from django import dispatch
remove_proposal_file = dispatch.Signal(providing_args=["instance"])
remove_proposal_folder = dispatch.Signal(providing_args=["instance", "ente"])
| hackultura/procult | procult/core/signals.py | Python | gpl-2.0 | 211 |
# This file is part of HEPData.
# Copyright (C) 2016 CERN.
#
# HEPData 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.
#
# HEPData is d... | HEPData/hepdata3 | hepdata/modules/email/utils.py | Python | gpl-2.0 | 4,013 |
# Copyright (C) 2014 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# ... | tainstr/veusz | veusz/document/loader.py | Python | gpl-2.0 | 8,367 |
#! /usr/bin/env python
import sys
from asm_test import Asm_Test_32
class Test_DAS(Asm_Test_32):
TXT = '''
main:
MOV EBP, ESP
LEA ESI, DWORD PTR [array_al]
loop:
; load original cf
LODSB
MOV BL, AL
; load original af
LODSB
SHL AL, 4
... | rom1sqr/miasm | test/arch/x86/unit/mn_das.py | Python | gpl-2.0 | 2,109 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ContactPlugin'
db.create_table(u'blogging_contactplugin',... | PirateLearner/pi | PirateLearner/blogging/migrations/0005_auto__add_contactplugin__add_field_blogparent_content_type.py | Python | gpl-2.0 | 12,149 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free ... | offlinehacker/flumotion | flumotion/component/effects/audioconvert/audioconvert.py | Python | gpl-2.0 | 7,025 |
from django.shortcuts import render
from django.db.models import Sum, Max
from models import SuspenseClearance
from models import TaDa
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from librehatti.catalog.models import Product
from librehatti.catalog.model... | manpreet9112/LibreHatti | src/librehatti/suspense/views.py | Python | gpl-2.0 | 64,469 |
import sudoku,board,image
from config import options
def set_options(opts):
global options
# 3rd param of SafeConfigParser.set() must be a string
options.set("sudoku", "use_letters", str(opts.use_letters))
options.set("image", "format", opts.format)
options.set("image", "width", str(opts.width))
... | ternus/arcnet | cyber/pythonsudoku/test.py | Python | gpl-2.0 | 864 |
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello World")
| imdaveho/boilerplates | django-boilerplate/project_name/apps/mainapp/views.py | Python | gpl-2.0 | 97 |
#!/usr/bin/env python
# File created on 13 Jul 2012
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.8.0-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcaporaso@gmail.com"
from ... | wasade/qiime | qiime/parallel/beta_diversity.py | Python | gpl-2.0 | 9,811 |
# -*- 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 dis... | Coelhon/MasterRepo.repository | plugin.video.zen/resources/lib/sources/threemovies.py | Python | gpl-2.0 | 5,297 |
"""linux.unknown.system.partitions Module"""
import cairn
from cairn import Options
from cairn.sysdefs.templates.unix.system import partitions
def getSubModuleString(sysdef):
mods = partitions.getSubModuleString(sysdef)
return mods.replace("FSTab;", "VolumeID; FSTab;")
| redshodan/cairn | src/python/cairn/sysdefs/linux/unknown/system/partitions/__init__.py | Python | gpl-2.0 | 276 |
#!/usr/bin/python
"""
vxlan.py
mininet1 mininet2
-------- --------
| | | |
| s1=========s2 |
| | | | | |
| h1 | | h2 |
| | | |
-------- --------
=== : cross-link
| : link
Testing enviroment (cat /etc/hosts) :
192.168.59.100 mininet1
192.168.59.101 mininet2
"""
# from m... | pichuang/OpenNet | mininet-patch/examples/cluster/vxlan.py | Python | gpl-2.0 | 2,051 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, absolute_import
from ..paths import TEST_PATH
from ..classifier import Clf
from ..settings import Settings
import unittest
import os
import pandas
class ClassifierTest(unittest.TestCase):
def test_training_no_report(self):
... | estnltk/textclassifier | textclassifier/tests/test_classifier.py | Python | gpl-2.0 | 1,534 |
#!/usr/bin/env python3
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson
#
# 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... | Polarcraft/KbveBot | scripts/parsedata.py | Python | gpl-2.0 | 5,128 |
# https://github.com/flask-admin/flask-admin/blob/master/examples/auth-flask-login
from flask_admin.contrib.sqla import ModelView
from flask_admin import AdminIndexView, expose, helpers
from flask import redirect, url_for, request
from flask_admin import form as admin_form
from jinja2 import Markup
from flask_sqlalchem... | abishek/hawkers | flask/hawkers/admin_views.py | Python | gpl-2.0 | 1,548 |
#coding=utf-8
import C
import requests
import StringIO
import re
import base64
import sys
import sys, traceback
from lxml import etree
import binascii
class PJ():
def __init__(self):
self.white = 'iVBORw0KGgoAAAANSUhEUgAAAJYAAAAZCAIAAABchUC4AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wYdAgYerV4wMwAAAD9JREFUaN7t0QENA... | NKUCodingCat/NKU-SSS-in-One | prog/src/PJ.py | Python | gpl-2.0 | 5,080 |
from django.core import urlresolvers
from django.conf import settings
def reverse_decorator(func):
def inner(*args, **kwargs):
abs_path = func(*args,**kwargs)
if settings.SSL_DOMAIN and settings.SSL_SECTIONS and settings.SSL_DOMAIN.startswith('https'):
for section in settings.SSL_SECTIO... | mricharleon/HatosGanaderos | SIDGV/__init__.py | Python | gpl-2.0 | 572 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
***************************************************************************
Launches a unit test inside QGIS and exit the application.
Arguments:
accepts a single argument with the package name in python dotted notation,
the program tries first to loa... | dwadler/QGIS | .docker/qgis_resources/test_runner/qgis_testrunner.py | Python | gpl-2.0 | 5,873 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Shamelessly taken from http://refactormycode.com/codes/1541-secure-password-generation-using-python#refactor_550196
#
# Import required modules
import random
import sys
import string
# Create a new class
class PasswordGenerator():
# Define a char_table
char_table... | citc/CITC-IPv6-Tunnel-Broker | src/management/ddtbmanage/util.py | Python | gpl-2.0 | 2,427 |
default_app_config = 'taas.user.apps.UserConfig'
| crypotex/taas | taas/user/__init__.py | Python | gpl-2.0 | 49 |
import py
from pida.utils.testing.mock import Mock
from pida.core.boss import Boss
from pida.core.events import EventsConfig
from pida.ui.window import PidaWindow
editors = 'vim', 'emacs', 'mooedit'
#XXX: ronny cant really test the 2 others atm
editors = 'vim',
def pytest_generate_tests(metafunc):
if 'editor' in m... | fermat618/pida | tests/editors/conftest.py | Python | gpl-2.0 | 1,389 |
import numpy as np
import scipy.signal as signal
import matplotlib.pyplot as plt
t = np.linspace(-10, 10, 20)
y = 1 + t + 0.01*t**2
yconst = signal.detrend(y, type='constant')
ylin = signal.detrend(y, type='linear')
plt.plot(t, y, '-rx')
plt.plot(t, yconst, '-bo')
plt.plot(t, ylin, '-k+')
plt.grid()
plt.legend(['sign... | platinhom/ManualHom | Coding/Python/scipy-html-0.16.1/tutorial/signal-10.py | Python | gpl-2.0 | 373 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your opt... | egabancho/invenio | invenio/modules/deposit/models.py | Python | gpl-2.0 | 47,429 |
# Copyright (c) 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of G... | candlepin/subscription-manager | src/subscription_manager/listing.py | Python | gpl-2.0 | 1,204 |
"""distutils.command.bdist
Implements the Distutils 'bdist' command (create a built [binary]
distribution)."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import os, string
from types import *
from distutils.core import Command
from distutils.errors import *
from distutils.util im... | scs/uclinux | user/python/python-2.4.4/Lib/distutils/command/bdist.py | Python | gpl-2.0 | 5,386 |
"""
KeepNote
Application Options Dialog
"""
#
# KeepNote
# Copyright (c) 2008-2009 Matt Rasmussen
# Author: Matt Rasmussen <rasmus@mit.edu>
#
# 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 Fo... | vatslav/perfectnote | keepnote/gui/dialog_app_options.py | Python | gpl-2.0 | 33,539 |
#from . import mvln
#__all__ = ["mover"]
__version__ = '0.0.1'
| rasmusprentow/mvln | mvln/__init__.py | Python | gpl-2.0 | 65 |
#!/usr/bin/env python
import gtk, cb_extras, gobject
class CustomOption (gtk.HBox):
__gsignals__ = {
'changed':(gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
[]),
}
def __init__ (self):
gobject.GObject.__init__(self)
gtk.HBox.__init__(self)
... | Linutux/Gourmet | gourmet/gtk_extras/optionTable.py | Python | gpl-2.0 | 6,465 |
#!/usr/bin/env python
#-------------------------------------------------------------------------------
# Name: Avg_Value_Metric
# Purpose:
#
# Author: Philip Bowditch
#
# Created: 17/03/2012
# Copyright: (c) Philip Bowditch 2012
# Licence: <your licence>
#--------------------------------... | NeoOrigin/oogway | Metrics/Avg_Value_Metric.py | Python | gpl-3.0 | 1,131 |
from pywb.utils.timeutils import timestamp_to_datetime, timestamp_to_sec
from pywb.framework.wbrequestresponse import WbResponse
from pywb.framework.memento import make_timemap, LINK_FORMAT
import urlparse
import urllib
import logging
import json
import os
from itertools import imap
from jinja2 import Environment
fro... | machawk1/pywb | pywb/webapp/views.py | Python | gpl-3.0 | 6,837 |
import re
def create_search_alternatives_table(curs):
sql = '\n'.join([
"CREATE TABLE search_alternatives (",
" search_alternative_id INTEGER PRIMARY KEY,",
" index_id INTEGER NOT NULL,",
" alternative TEXT NOT NULL",
")"])
curs.execute(sql)
def create_search_alternatives_index(curs):
sql = '\n'.join(... | devonjones/PSRD-Parser | src/psrd/sql/index/search_alternatives.py | Python | gpl-3.0 | 1,289 |
from .ert_summary import ErtSummary
from .ensemble_resizer import EnsembleSizeModel
| iLoop2/ResInsight | ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/__init__.py | Python | gpl-3.0 | 85 |
class Solution(object):
def nextGreaterElement(self, findNums, nums):
"""
:type findNums: List[int]
:type nums: List[int]
:rtype: List[int]
"""
no_next, theNext = set(), {}
for elem in nums:
remove = set()
for k in no_next:
... | wufangjie/leetcode | 496. Next Greater Element I.py | Python | gpl-3.0 | 539 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class Cargo(models.Model):
nombre = models.CharField(max_length=255)
descripcion = models.CharField(max_length=255, default=None, blank=True, null=True)
def __unicode__(self):
return u"Cargo: " + self.nom... | Dte-ba/suite-backend | escuelas/models/cargo.py | Python | gpl-3.0 | 496 |
import cPickle as pickle
import numpy as np
import theano.tensor as T
import os, sys
model_root = '../models/bpr';
vid = '../complete/vid';
teidpath = '../complete/f%dte.%s.idl';
tepath = '../complete/f%dte.%s.txt'
trpath = '../complete/f%dtr.txt'
scenario = ['im'];
fold = 5;
total = 30;
step = 5;
interv... | domainxz/top-k-rec | old/methods/bpr_test.py | Python | gpl-3.0 | 4,210 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | iambocai/ansible | v2/test/playbook/test_role.py | Python | gpl-3.0 | 6,589 |
from eats.models import EATSUser
from eats.tests.models.model_test_case import ModelTestCase
class UserTestCase (ModelTestCase):
def setUp (self):
super(UserTestCase, self).setUp()
self.user = self.create_django_user('username', 'user@example.org',
'pas... | ajenhl/eats | server/eats/tests/models/test_user.py | Python | gpl-3.0 | 2,944 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import arrayfire as af
def calculate_dfdp_background(self):
"""
Calculates the derivative of the background distribution
with respect to the variables p1, p2, p3. This is used to
solve for the contribution from the fields
"""
f_b = af.moddims(sel... | ShyamSS-95/Bolt | bolt/lib/linear/calculate_dfdp_background.py | Python | gpl-3.0 | 2,434 |
"""Galaxy (ansible-galaxy) plugin for integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import tempfile
from . import (
CloudProvider,
CloudEnvironment,
CloudEnvironmentConfig,
)
from ..util import (
find_executable,
display,
)... | newswangerd/ansible | test/lib/ansible_test/_internal/cloud/galaxy.py | Python | gpl-3.0 | 9,403 |
#!/usr/bin/env python
# vim: et ts=4
from PIL import Image
from pnoise import PerlinNoise
import random
import time
import itertools
def generatePerlin(fn, w, h, freq, numOctaves):
"""Generates an image file containing perlin noise.
fn - File name for the image.
w - Width of the image, in pixels.
... | foxostro/GutsyStormPython_Abandoned | prototypes/pnoise_test.py | Python | gpl-3.0 | 1,775 |
#!/usr/bin/python
# Stochastic Texts, copyright (c) 2014 Nick Montfort <nickm@nickm.com>
# Original by Theo Lutz, 1959; translation by Helen MacCormack
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notic... | oturing/pymanas | referencias/memslam/stochastic_texts.py | Python | gpl-3.0 | 1,635 |
#!/usr/bin/env python
##############################################################################
#
# Usage example for the procedure PPXF, which
# implements the Penalized Pixel-Fitting (pPXF) method by
# Cappellari M., & Emsellem E., 2004, PASP, 116, 138.
#
# This example shows how to fit multiple stellar componen... | cebarbosa/fossilgroups | ppxf/ppxf_two_components_example.py | Python | gpl-3.0 | 4,459 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from PyQt4 import QtGui
import mechanize
import cookielib
from bs4 import BeautifulSoup
#import EGU_pr30wn_backend
# # # # variables
# # # # QT GUI
class Window(QtGui.QWidget):
def __init__(self): # constructor
super(Window, self).__init__() # returns... | j4v/pyProjects | EGU_pr30wn/EGU_pr30wn.py | Python | gpl-3.0 | 1,962 |
#!/usr/bin/env python3
import sys
import os
#sys.path.append(os.path.join(sys.path[0],"..","..","kicad_mod")) # load kicad_mod path
# export PYTHONPATH="${PYTHONPATH}<path to kicad-footprint-generator directory>"
sys.path.append(os.path.join(sys.path[0], "..", "..", "..")) # load parent path of KicadModTree
from mat... | SchrodingersGat/kicad-footprint-generator | scripts/Connector/Connector_Hirose/conn_ffc_hirose_fh12_smd_side.py | Python | gpl-3.0 | 9,819 |
# Copyright 2013 Conix Security, Nicolas Correia, Adrien Chevalier
#
# This file is part of CAAS.
#
# CAAS 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 o... | conix-security/CAAS | lib/log.py | Python | gpl-3.0 | 2,385 |
# -*- coding: utf-8 -*-
#
# Hop documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 30 09:59:06 2013.
#
# 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.
#
# All con... | Becksteinlab/hop | doc/sphinx/source/conf.py | Python | gpl-3.0 | 9,843 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import division
import copy
import datetime
import gc
import glob
import logging
import os
import resource
import shlex
import shutil
import signal
import stat
import threading
import time
from pipes import quote
from ..base.Constants import *
from ..bas... | DVS-P2P/bubblestorm | testbed/src/testbed/client/Client.py | Python | gpl-3.0 | 24,266 |
#
# This file is part of Bluepass. Bluepass is Copyright (c) 2012-2014
# Geert Jansen.
#
# Bluepass is free software available under the GNU General Public License,
# version 3. See the file LICENSE distributed with this file for the exact
# licensing terms.
from __future__ import absolute_import, print_function
impo... | geertj/bluepass | bluepass/errors.py | Python | gpl-3.0 | 2,825 |
# Copyright 2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
import pytest
from os import path
import tempfile
from grc.core.platform import Platform
def test_generator():
# c&p form compiler code.
# todo: make this independent from inst... | skoslowski/gnuradio | grc/tests/test_generator.py | Python | gpl-3.0 | 853 |
import logging
import random
from structure.configFramework import *
def listToStr(self, l):
return ''.join(str(element) for element in l)
class Instruction:
code = None
cursor = 0
maxLenghtBits = 32
skeleton = [int(i) for i in "00100000000000000000000000000000"]
def __init__(self,code = None... | aniskhoury/evalgorithm | structure/instruction.py | Python | gpl-3.0 | 11,614 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# linotype documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 17 15:19:05 2017.
#
# 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
# a... | lostatc/linotype | docs/conf.py | Python | gpl-3.0 | 4,784 |
'''
Vineet Kumar, Copyright (C) 2017, GPL-3.0+ open-source license.
This program comes with ABSOLUTELY NO WARRANTY.
'''
'''
Base class that has the model file and the model. Other classes inherit this information.
'''
import logging
logger = logging.getLogger()
import pathlib
import keras.models
import argparse
import ... | vineetk1/interact-keras-model | classes/CommonModel.py | Python | gpl-3.0 | 5,203 |
"""
Test of multi-VO user metadata handling. Assumes a running Dirac instance with the (master?) FileCatalog
"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import unittest
import os
import sys
import os.path
import traceback
from DIRAC.Core.Base.Script... | yujikato/DIRAC | tests/Integration/DataManagementSystem/Test_UserMetadata.py | Python | gpl-3.0 | 6,041 |
import numpy as np
from routines.integral_input import __init_integrals__
import routines.scf as scf
import routines.ao2mo as ao2mo
import routines.cistdhf as cistdhf
def do_cistdhf(LOCATION):
ENUC,Nelec,dim,S,T,V,Hcore,twoe = __init_integrals__(LOCATION)
EN,orbitalE,C,P,F = scf.scf_iteration(1e-8,ENUC,Nelec... | jjgoings/pyqchem | tests/test_cistdhf.py | Python | gpl-3.0 | 4,191 |
def common_prefix_length(A):
"""
:param A: list of strings
:return: length of common prefix of all strings
"""
resultPrefix = ""
ln = len(A)
if not A:
return resultPrefix
resultPrefix = A[0]
for k in xrange(1, ln):
i, j = 0, 0
tempPrefix = ""
while k <... | purushothamc/myibitsolutions | strings/length_of_common_prefix.py | Python | gpl-3.0 | 1,117 |
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
#import scipy.io.wavfile as sw
from scipy import signal
from scipy import interpolate
#def envolvente(raw_audio, times, sample_rate, data_points=None, bin_size=None, mean=0, der=0, direccion, guardar)
def envolvente(raw_audio, times, sample_... | gabrevaya/Canto5 | doc/envolvente.py | Python | gpl-3.0 | 2,487 |
# -*- coding: utf-8 -*-
# This file is part of HUBAngl.
# HUBAngl Uses Broadcaster Angle
#
# HUBAngl 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 ... | soonum/hubangl | src/core/ioelements.py | Python | gpl-3.0 | 6,870 |
# Generated by Django 2.2.12 on 2020-12-02 16:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('external_services', '0011_menuitem_menu_url'),
]
operations = [
migrations.AlterField(
model_name='linkservice',
na... | teemulehtinen/a-plus | external_services/migrations/0012_auto_20201202_1856.py | Python | gpl-3.0 | 1,046 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-12 19:00
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('note', '0001_initial'),
]
operations = [
mig... | d2emon/newspaperizer | src/note/migrations/0002_auto_20160912_1900.py | Python | gpl-3.0 | 1,986 |
# -*- coding: utf-8 -*-
"""database
此模块主要包含与数据库操作相关的类 Database
"""
import os
import re
from operator import is_not
from functools import partial
from datetime import datetime, date, timedelta
from dateutil.relativedelta import relativedelta
from pytz import timezone
from tzlocal import get_localzone
from sqlalchemy ... | everyx/AliTools | Spider/ali_spider/database.py | Python | gpl-3.0 | 12,080 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
from registration.backends.simple.views import RegistrationView
from django.http import HttpResponseRedirect
class MyRegistrationView(RegistrationView):
def get_success_url(self, user):
return '/ran... | juanjetomas/ProyectoIV | tango_with_django_project/urls.py | Python | gpl-3.0 | 1,073 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
CONFIG_DEFAULTS = {
"console_log_level" : "info",
"file_log_level" : "debug",
"mx_log_level" : "info",
"sentry_log_level": "error",
"log_dir" : "~/.obci/logs",
"experiment_uuid": ""
}
| BrainTech/openbci | obci/control/peer/config_defaults.py | Python | gpl-3.0 | 251 |
#!/usr/bin/env python
import numpy as np
import sys
from scipy import interpolate
filename =sys.argv[1]
a=np.loadtxt(filename)
print "geladen"
timeslices=[1.e2,5.e2,1.e3,5.e3,1.e4,5.e4,1.e5,5.e5,1.e6]
for time in timeslices:
timeused=a[np.argmin(np.absolute(a[:,0]-time)),0]
print "timeused",timeused
b=a[np.where(... | 12AngryMen/KAI-Model | Old/diffint.py | Python | gpl-3.0 | 1,019 |
'''
기보 파일을 읽는 데까지.
'''
import os
import numpy as np
import _game
from _game import Stone
from _params import args
def get_setting_from_korean(korean):
if korean == '마상상마':
return _game.Setting.MSSM
elif korean == '상마마상':
return _game.Setting.SMMS
elif korean == '상마상마':
return _g... | ladofa/janggi | Janggi/TensorNetworks/_gibo.py | Python | gpl-3.0 | 7,980 |
"""
This example demonstrates the proper use of project: lazgui
"""
import sys
import os
sys.path.insert(0, os.path.abspath("../../")) # needed to find lazgui development version
from lazgui.gui_factory import *
Lay = get_layout(layout_type='vstack', Left=41, Height=0, Top=42, Width=0,
TopMargi... | sonofeft/LazGUI | lazgui/examples/factory_v2.py | Python | gpl-3.0 | 2,749 |
# A comment, this is so you can read your program later.
# Anything after the # is ignored by python.
print "I could have code like this." # and the comment after is ignored
# You can also use a comment to "disable" or comment out a piece of code:
# print ("This won't run.")
print "This will run." | phantolf/Python | Learn Python the hard way/Python2/ex02.py | Python | gpl-3.0 | 301 |
#!/usr/bin/python
'''TuneHub Lyrics Library.
Copyright (C) 2011 Hugo Caille
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list... | hugoatease/TuneHub | lyriclib/group.py | Python | gpl-3.0 | 4,277 |
#
# Copyright (C) 2009 Juan Pedro Bolivar Puente, Alberto Villegas Erce
#
# This file is part of Pigeoncide.
#
# Pigeoncide 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
# Lic... | arximboldi/pigeoncide | src/ent/physical.py | Python | gpl-3.0 | 11,965 |
# -*- coding: utf-8 -*-
## Copyright 2015-2017 Frankfurt Institute for Advanced Studies
## 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 optio... | FRESNA/vresutils | vresutils/file_io_helper.py | Python | gpl-3.0 | 1,402 |
# 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... | belokop/indico_bare | bin/maintenance/indexes/all_index_check.py | Python | gpl-3.0 | 1,331 |
import os
from robocompdsl.templates.common.abstracttemplatesmanager import ComponentTemplatesManager
from robocompdsl.templates.common.plugin_collection import PluginCollection
from robocompdsl.templates.templatePython import plugins
class TemplatesManagerPython(ComponentTemplatesManager):
def __init__(self, co... | robocomp/robocomp | tools/cli/robocompdsl/robocompdsl/templates/templatePython/templatepython.py | Python | gpl-3.0 | 1,677 |
def remove(text, what):
for c, n in what.items():
text = text.replace(c, '', n)
return text
| VladKha/CodeWars | 7 kyu/Not all but sometimes all/solve.py | Python | gpl-3.0 | 108 |
# -*- coding: utf-8 -*-
# Authors: Cedric Bosdonnat <cbosdonnat@suse.com>
#
# Copyright (C) 2017 SUSE, 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
... | virt-manager/virt-bootstrap | src/virtBootstrap/sources/file_source.py | Python | gpl-3.0 | 3,387 |
from django.shortcuts import render_to_response,render,HttpResponseRedirect,Http404,HttpResponse,RequestContext,redirect
from django.contrib import auth
from django.contrib.auth.models import User
from django.views.decorators.cache import cache_page
from django.db import models
# Create your views here.
from ..mensa_ap... | enixdark/django-mensasystem | trunk/mensasystem/apps/admins/views.py | Python | gpl-3.0 | 930 |
import socket
import base64
import xml.dom.minidom
class DBGP:
""" DBGp Procotol class """
def __init__(self, options, log=lambda text:None, type=None):
self.sock = PacketSocket(options)
self.cid = 0
self.received = 0
self.handlers = {}
self.addCommandHandler = self.hand... | elsdrm/vim-debug | plugin/vim_debug/dbgp.py | Python | gpl-3.0 | 5,353 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from Feature import Feature
class IsGenreFantasy(Feature):
description = """
Genre: is it fantasy?
""".strip()
def __init__(self, *args, **kwargs):
Feature.__init__(self)
def extract(self, m):
for g in m.genres:
if g['name'] == 'Fantasy':
r... | unoduetre/MovieRecommendator | featuremaker/plugins/IsGenreFantasy.py | Python | gpl-3.0 | 348 |
'''
Created on 24 May 2017
@author: SchilsM
'''
import numpy as np
from scipy.optimize import brentq
'''
Template for fn_x(x, params)
@x: a numpy array of shape (n_indi, n_points),
where n_indi is the number of independents, and
n_points is the the number of points in each of the independents.
Thus, x[0]... | ubenu/Blits | src/functions/function_defs.py | Python | gpl-3.0 | 11,487 |
# -*- coding: utf-8 -*-
# Copyright (C) 2010, 2011, 2012 Sebastian Wiesner <lunaryorn@gmail.com>
# This library 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 version 2.1 of the License, or (at... | schlizbaeda/yamuplay | pyudev/tests/test_enumerate.py | Python | gpl-3.0 | 13,845 |
import sys
def fix_ip(ip_address):
"""Fixes an ugly, broken IP address string that came from Heroku"""
if "," in ip_address:
ips = ip_address.split(", ")
ip_address = ips[0]
return ip_address
def random_hash(entropy):
import time, hashlib, os
_str = "%s%s%s" % (ent... | lyonbros/faxrobot | library/grab_bag.py | Python | gpl-3.0 | 636 |
from math import sqrt, pi
import numpy as np
from gpaw.xc.gga import GGA
from gpaw.utilities.blas import axpy
from gpaw.sphere.lebedev import weight_n
class MGGA(GGA):
orbital_dependent = True
def __init__(self, kernel):
"""Meta GGA functional."""
GGA.__init__(self, kernel)
def set_gri... | robwarm/gpaw-symm | gpaw/xc/mgga.py | Python | gpl-3.0 | 12,345 |
#!/usr/bin/python
# PiTimer - Python Hardware Programming Education Project For Raspberry Pi
# Copyright (C) 2015 Jason Birch
#
# 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 ... | BirchJD/RPiTimer | PiTimer_Step-9/PiTimer.py | Python | gpl-3.0 | 7,771 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from PyQt4.QtGui import QWizard, QMessageBox, QWidget, QScrollArea, QLineEdit, QLabel, QVBoxLayout, QCheckBox, \
QGridLayout
from PyQt4.QtCore import QObject, pyqtSlot, QString
from models.PluginConfigurationListModel import PluginConfigurationListModel
from model... | petterreinholdtsen/creepy | creepy/components/PlaceProjectWizard.py | Python | gpl-3.0 | 8,737 |
#!/usr/bin/env python
#
# Copyright (c) 2011-2012 Wiktor Starzyk, Faisal Z. Qureshi
#
# This file is part of the Virtual Vision Simulator.
#
# The Virtual Vision Simulator 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... | vclab/virtual-vision-simulator | src/simulator/panda3d/panda_pedestrian.py | Python | gpl-3.0 | 5,712 |
"""
" "
" This file is part of the 20n/act project. "
" 20n/act enables DNA prediction for synthetic biology/bioengineering. "
" Copyright (C) 2017 20n Labs, Inc. "
" ... | 20n/act | reachables/src/main/python/DeepLearningLcmsPeak/dynamic_differential_deep.py | Python | gpl-3.0 | 5,952 |
#!/usr/bin/env python
########################################################################
# File : dirac-admin-get-site-mask
# Author : Stuart Paterson
########################################################################
"""
Get the list of sites enabled in the mask for job submission
Example:
$ dirac-a... | DIRACGrid/DIRAC | src/DIRAC/Interfaces/scripts/dirac_admin_get_site_mask.py | Python | gpl-3.0 | 930 |
# randomCirclesThroughMidiInput.py
#
# Demonstrates how to generate a musical animation by drawing random
# circles on a GUI display using input from a MIDI instrument.
# Each input note generates a circle - the lower the note, the lower
# the red+blue components of the circle color. The louder the note,
# the la... | manaris/jythonMusic | 21. randomCirclesThroughMidiInput.py | Python | gpl-3.0 | 1,850 |
def RC4_encrypt(key, data):
S = list(range(256))
j = 0
key_len = len(key)
for i in list(range(256)):
j = (j + S[i] + ord(key[i % key_len])) % 256
S[i], S[j] = S[j], S[i]
j = 0
y = 0
out = []
for char in data:
j = (j + 1) % 256
y = (y + S[j]) % 256
... | alfa-addon/addon | plugin.video.alfa/lib/sambatools_py2/smb/utils/rc4.py | Python | gpl-3.0 | 434 |
from django import template
from ..models import Repo
register = template.Library()
class ReposNode(template.Node):
def render(self, context):
context["repos"] = Repo.objects.all()
return ""
@register.tag
def load_repos(parser, token):
return ReposNode()
| auto-mat/klub | apps/repolinks/templatetags/repolinks.py | Python | gpl-3.0 | 285 |
########################### BEGIN GPL LICENSE BLOCK ###########################
#
# THE VIDEO EDITOR'S RENDER SCRIPT FOR BLENDER (2.78C and Lower)
# Copyright (C) 2017 Mike Meyers
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Li... | mikeycal/the-video-editors-render-script-for-blender | old_version_scripts/video_editors_render_script_278c_and_lower.py | Python | gpl-3.0 | 72,286 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-07 17:59
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tableaubord', '0009_auto_20170507_1102'),
]
operations = [
mi... | MLOrsini/ProjetWEB | INSport/tableaubord/migrations/0010_auto_20170507_1759.py | Python | gpl-3.0 | 560 |