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 |
|---|---|---|---|---|---|
#Boa:Frame:input_data_kemiskinan
import wx
import wx.lib.buttons
import frm_sideka_menu
import sqlite3
db = sqlite3.connect('/opt/sidesa/sidesa')
cur = db.cursor()
def create(parent):
return input_data_kemiskinan(parent)
[wxID_INPUT_DATA_KEMISKINAN, wxID_INPUT_DATA_KEMISKINANBUTTON1,
wxID_INPUT_DATA_KEMISKINA... | gedhe/sidesa2.0 | input_data_kemiskinan.py | Python | gpl-2.0 | 13,554 |
img_ids = open('chairs_nuswide_imgids.txt','r')
nus_urls = open('NUS-WIDE-urls.txt', 'r')
dict_urls = {}
for line in nus_urls:
dict_urls[line.split()[0]] = line.split()[3]
chairs_urls = []
count = 0
for line in img_ids:
print('searching url ' + str(count))
count = count +1
if not dict_urls[line.split()[... | sebastianffx/active_deep_segmentation | save_nus_images.py | Python | gpl-2.0 | 401 |
# -*- coding: utf-8 -*-
#
# Cherokee-admin
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2001-2010 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free S... | chetan/cherokee | admin/market/ows_consts.py | Python | gpl-2.0 | 1,407 |
#!/usr/bin/env python
"""
Python WebDAV Server.
Copyright (C) 1999-2005 Christian Scholz (cs@comlounge.net)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 o... | orbekk/erebus | pywebdav/PyDAVServer/server.py | Python | gpl-2.0 | 9,548 |
# encoding: utf-8
# module PyKDE4.kdecore
# from /usr/lib/python3/dist-packages/PyKDE4/kdecore.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtNetwork as __PyQt4_QtNetwork
from .KProcess import KProcess
class KPtyProcess(KProcess):
# n... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdecore/KPtyProcess.py | Python | gpl-2.0 | 1,129 |
#! /usr/bin/env python
"""WSGI server interface to mw-render and mw-zip/mw-post"""
import os
import re
import shutil
import signal
import StringIO
import subprocess
import time
import urllib2
try:
from hashlib import md5
except ImportError:
from md5 import md5
try:
import json
except ImportError:
impo... | cscott/wikiserver | mwlib/serve.py | Python | gpl-2.0 | 19,146 |
"""
VATSIM Status Proxy.
Copyright (C) 2017 - 2019 Pedro Rodrigues <prodrigues1990@gmail.com>
VATSIM Status Proxy 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 2 of the License.
VATSIM Status Pr... | pedro2555/vatsim-status-proxy | setup.py | Python | gpl-2.0 | 995 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | arunkgupta/gramps | gramps/plugins/textreport/summary.py | Python | gpl-2.0 | 10,795 |
from tkinter import *
from gui import GUI
from reminder import Reminder
import argparse
import time
if __name__ == '__main__':
print("""
Copyright (C) 2016 Logvinov Dima.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain cond... | vonivgol/pyreminder | src/main.py | Python | gpl-2.0 | 1,723 |
# Copyright 2013-2016 Jaap Karssenberg <jaap.karssenberg@gmail.com>
'''This module defines the L{main()} function for executing the zim
application. It also defines a number of command classes that implement
specific commandline commands and an singleton application object that
takes core of the process life cycle.
'... | jaap-karssenberg/zim-desktop-wiki | zim/main/__init__.py | Python | gpl-2.0 | 28,210 |
# -*- coding: UTF-8 -*-
import os
from behave_common_steps import dummy, App
from dogtail.config import config
from time import sleep, localtime, strftime
import problem
import shutil
def before_all(context):
"""Setup nautilus stuff
Being executed before all features
"""
try:
# Cleanup abrt ... | fedora-desktop-tests/nautilus | features/environment.py | Python | gpl-2.0 | 3,002 |
#!/usr/bin/env python
from __future__ import print_function
## Automatically adapted for numpy.oldnumeric Sep 06, 2007 by alter_code1.py
# ImageD11_v0.4 Software for beamline ID11
# Copyright (C) 2005 Jon Wright
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GN... | jonwright/ImageD11 | scripts/huber2bruker.py | Python | gpl-2.0 | 20,959 |
def _reset_sys_path():
# Clear generic sys.path[0]
import sys, os
resources = os.environ['RESOURCEPATH']
while sys.path[0] == resources:
del sys.path[0]
_reset_sys_path()
def _site_packages():
import site, sys, os
paths = []
prefixes = [sys.prefix]
if sys.exec_prefix != sys.pre... | raiabril/arduino_logger | dist/arduino_logger.app/Contents/Resources/__boot__.py | Python | gpl-2.0 | 11,884 |
#!/usr/bin/env python3
__author__ = "Dilawar Singh"
__copyright__ = "Copyright 2017-, Dilawar Singh"
__maintainer__ = "Dilawar Singh"
__email__ = "dilawars@ncbs.res.in"
__status__ = "Development"
import sys
import os
import subprocess
import multiprocessing
import threading
import re
import glob
import datetime
impor... | BhallaLab/moose-examples | .ci/execute_travis_serial.py | Python | gpl-2.0 | 6,171 |
#!/usr/bin/env python
from __future__ import print_function
import os
import subprocess
syst_names = ['nominal','lightdown','lightup','ckv','calibneg','calibpos','calibshape']
flists = [syst_name+'.txt' for syst_name in syst_names]
def process_dataset(ds_idx):
flist = flists[ds_idx]
fns = []
with open(... | kaikai581/NOvA | xsec-2019/check_light_syst/check_entries/file_lists/pull_common_files.py | Python | gpl-2.0 | 1,096 |
import pytest
from amoco.config import conf
conf.UI.formatter = 'Null'
conf.Cas.unicode = False
conf.UI.unicode = False
from amoco.arch.tricore import cpu
def test_decoder_START():
c = b'\x91\x00\x00\xf8'
i = cpu.disassemble(c)
assert i.mnemonic=='MOVH_A'
assert i.operands[0] is cpu.A[15]
assert i.operands... | bdcht/amoco | tests/test_arch_tricore.py | Python | gpl-2.0 | 918 |
# encoding: utf-8
# module pyexpat
# from /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so
# by generator 1.135
""" Python wrapper for Expat parser. """
# imports
import pyexpat.errors as errors # <module 'pyexpat.errors' (built-in)>
import pyexpat.model as model # <module 'pyexpat.model' (built-in)>
# Vari... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/pyexpat/__init__.py | Python | gpl-2.0 | 1,861 |
#-*- coding:utf-8 -*-
import wx
if evt_handler == None:
evt_handler = wx.EvtHandler() | hookehu/utility | editors/studio/core/logic_center.py | Python | gpl-2.0 | 88 |
# -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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;... | EUDAT-B2SHARE/invenio-old | modules/websearch/lib/search_engine.py | Python | gpl-2.0 | 314,285 |
"""ShutIt module. See http://shutit.tk
"""
from shutit_module import ShutItModule
class ruby(ShutItModule):
def build(self, shutit):
shutit.send('mkdir -p /tmp/build/ruby')
shutit.send('cd /tmp/build/ruby')
shutit.send('wget -qO- http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.0.tar.gz | tar -zxf -')
shut... | ianmiell/shutit-distro | ruby/ruby.py | Python | gpl-2.0 | 863 |
import os
def clang_format_recursive(root_path):
for root, dirs, files in os.walk(root_path):
for file in files:
if file.endswith(".cpp") or file.endswith(".hpp"):
path = os.path.join(root, file)
print('formatting %s' % path)
os.system('clang-for... | ColinDuquesnoy/MellowPlayer | scripts/beautify.py | Python | gpl-2.0 | 893 |
# -*- coding: utf-8 -*-
# Служебная библиотека
from datetime import datetime
from config.eq_domain import eq_domains
import re
from dns.resolver import NXDOMAIN, NoAnswer, Timeout, NoNameservers
def convert_string_to_date(date):
"""
Дату в строчном представлении конвертируем в объект 01.02.2009
:type date... | pavel-odintsov/ru_open_statistics | helpers/utils.py | Python | gpl-2.0 | 3,681 |
# -*- python -*-
#
# wireshark_gen.py (part of idl2wrs)
#
# Author : Frank Singleton (frank.singleton@ericsson.com)
#
# Copyright (C) 2001 Frank Singleton, Ericsson Inc.
#
# This file is a backend to "omniidl", used to generate "Wireshark"
# dissectors from CORBA IDL descriptions. The output language generated
# ... | dameiss/wireshark-aeron | tools/wireshark_gen.py | Python | gpl-2.0 | 100,105 |
#!/usr/bin/env python
# Author: Andrew Jewett (jewett.aij at g mail)
# http://www.chem.ucsb.edu/~sheagroup
# License: 3-clause BSD License (See LICENSE.TXT)
# Copyright (c) 2011, Regents of the University of California
# All rights reserved.
man_page_text = """
nbody_by_type.py reads a LAMMPS data file ... | jcarlson23/lammps | tools/moltemplate/src/nbody_by_type.py | Python | gpl-2.0 | 24,666 |
#
# Copyright (c) 2021 Daniel P. Smith, Apertus Solutions LLC
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This... | OpenXT/sync-client | pysynchronizer/oxt_dbus.py | Python | gpl-2.0 | 3,858 |
# Include the Dropbox SDK
import dropbox
class DropBoxSDK():
# Get your app key and secret from the Dropbox developer website
app_key = ''
app_secret = ''
def authorize(self):
flow = dropbox.client.DropboxOAuth2FlowNoRedirect(self.app_key, self.app_secret)
authorize_url = flow.start()
# Have the ... | anithag/Shield | Authenticate.py | Python | gpl-2.0 | 851 |
import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='keil'
# get setting from environment.
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
if CROSS_TOOL == 'g... | 52osworld/RealBoard4088 | software/rtthread_examples/examples/6_media_mp3/rtconfig.py | Python | gpl-2.0 | 3,433 |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under t... | MDAnalysis/mdanalysis | package/MDAnalysis/lib/picklable_file_io.py | Python | gpl-2.0 | 15,899 |
# -*- encoding: utf-8 -*-
#
# Copyright 2010-2018 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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
... | unioslo/cerebrum | Cerebrum/modules/no/uio/voip/bofhd_voip_help.py | Python | gpl-2.0 | 4,975 |
#!/usr/bin/env python
# encoding: utf-8
# https://github.com/kroo/mobi-python
"""
Mobi.py
Created by Elliot Kroo on 2009-12-25.
Copyright (c) 2009 Elliot Kroo. All rights reserved.
"""
import sys
from struct import *
from lz77 import uncompress_lz77
class Mobi:
def parse(self):
""" reads in the file, then pars... | robwebset/script.ebooks | resources/lib/mobi/__init__.py | Python | gpl-2.0 | 7,612 |
# Copyright Kevin Deldycke <kevin@deldycke.com> and contributors.
# All Rights Reserved.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) ... | kdeldycke/meta-package-manager | meta_package_manager/tests/test_cli_install.py | Python | gpl-2.0 | 2,682 |
from gi.repository import Gtk
import os
from gi.repository import GObject
import shutil
from decimal import *
from gettext import gettext as _
from documentviewercommonutils import DocumentViewerCommonUtils
from utils import is_machine_a_xo
from epubview.epub import _Epub
from epubview.webkitbackend import Browser
TO... | activitycentral/ebookreader | src/ReadTab/epubadapter.py | Python | gpl-2.0 | 17,071 |
from enigma import eDVBVolumecontrol, eTimer
from Tools.Profile import profile
from Screens.Volume import Volume
from Screens.Mute import Mute
from GlobalActions import globalActionMap
from config import config, ConfigSubsection, ConfigInteger
from Components.HdmiCec import HdmiCec
profile("VolumeControl")
#TODO .. mo... | Ophiuchus1312/enigma2-master | lib/python/Components/VolumeControl.py | Python | gpl-2.0 | 2,618 |
# Copyright (C) 2008-2010 Adam Olsen
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | eri-trabiccolo/exaile | xlgui/devices.py | Python | gpl-2.0 | 4,732 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | jackemoore/cfclient-gps-2-ebx-io | lib/cflib/crazyflie/ablock.py | Python | gpl-2.0 | 17,198 |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... | rajul/tvb-framework | tvb/tests/framework/adapters/testadapter1.py | Python | gpl-2.0 | 3,928 |
# pylint:disable=R0201
"""docstring"""
__revision__ = ''
class Interface(object):
"""base class for interfaces"""
class IMachin(Interface):
"""docstring"""
def truc(self):
"""docstring"""
def troc(self, argument):
"""docstring"""
class Correct1(object):
"""docstring"""
__impl... | godfryd/pylint | test/input/func_interfaces.py | Python | gpl-2.0 | 2,062 |
#!/usr/bin/env python
# Tag Highlighter:
# Author: A. S. Budden <abudden _at_ gmail _dot_ com>
# Copyright: Copyright (C) 2009-2013 A. S. Budden
# Permission is hereby granted to use and distribute this code,
# with or without modifications, provided that this copyright
# notice is c... | ketor/z-vimrc | .vim/bundle/taghighlight/plugin/TagHighlight/module/config.py | Python | gpl-2.0 | 3,393 |
# -*- coding: utf-8 -*-
"""
nidaba.storage
~~~~~~~~~~~~~~
This module contains all file handling/storage management/ID mapping methods.
"""
from __future__ import unicode_literals, print_function, absolute_import
from nidaba.lock import lock
from nidaba.config import nidaba_cfg
from nidaba.nidabaexceptions import (... | OpenPhilology/nidaba | nidaba/storage.py | Python | gpl-2.0 | 8,081 |
#!/usr/bin/python3
from __future__ import division
import unittest
import math
#import logging
#logging.basicConfig(level = logging.DEBUG)
import gi
gi.require_version('Vips', '8.0')
from gi.repository import Vips
Vips.leak_set(True)
unsigned_formats = [Vips.BandFormat.UCHAR,
Vips.BandFormat.... | therandomfactory/nessi-control | vips-8.5.9/test/test_arithmetic.py | Python | gpl-2.0 | 22,200 |
import zipfile
from collections import defaultdict
from io import BytesIO
from itertools import groupby
from typing import Any, Union
import pandas as pd
from flask import Response, g
from openatlas.api.v03.resources.util import get_linked_entities_api, \
link_parser_check, remove_duplicate_entities
from openatla... | craws/OpenAtlas | openatlas/api/csv_export.py | Python | gpl-2.0 | 5,849 |
# -----------------------------------------------------------------------------
#
# This file is the copyrighted property of Tableau Software and is protected
# by registered patents and other applicable U.S. and international laws and
# regulations.
#
# Unlicensed use of the contents of this file is prohibited. Please... | corystreet/pyOdbcToTde | Static/TableauSDK-9100.15.0828.1711/tableausdk/__init__.py | Python | gpl-2.0 | 520 |
# -*- coding: utf-8 -*-
# @filename 77 - Combinations
# @author Dectinc
# @date 2015-03-24 21:10 PM
class Solution:
def __init__(self):
self.res = []
# @return a list of lists of integers
def combine(self, n, k, used=None, current=None, start=1):
if k == 0:
self.res.append... | Dectinc/leetcode | python/77 - Combinations.py | Python | gpl-2.0 | 813 |
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------
# xawtv.py - use xawtv for tv viewing
# -----------------------------------------------------------------------
# $Id$
#
# Notes:
# Todo:
#
# -----------------------------------------------------------------------
# F... | freevo/freevo1 | src/tv/plugins/xawtv.py | Python | gpl-2.0 | 9,292 |
#
# livef1
#
# f1reader.py - reader task running under the web-server
#
# Copyright (c) 2014 Marc Bertens <marc.bertens@pe2mbs.nl>
#
# 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; e... | livef1/Livef1-web | src/reader.py | Python | gpl-2.0 | 5,666 |
#-*- coding:utf-8 -*-
###########################################################
# 项目各种选项的对话框。
import os, string, logging
import ConfigParser
from gi.repository import Gtk, Gdk, GtkSource
from VeUtils import *
from ModelProject import ModelProject
from VeEventPipe import VeEventPipe
##############################... | luo2chun1lei2/AgileEditor | ve/src/ViewDialogPreferences.py | Python | gpl-2.0 | 3,229 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2019, 2021 Philipp Wolfer
# Copyright (C) 2020-2021 Laurent Monin
# Copyright (C) 2021 Bob Swift
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# ... | metabrainz/picard | test/formats/test_apev2.py | Python | gpl-2.0 | 11,058 |
__author__ = 'Abhineet Saxena'
"""
Neural Net Classification and Evaluation Trial
"""
# The imports:
from pybrain.supervised.trainers import BackpropTrainer
from pybrain.tools.shortcuts import buildNetwork
# from pybrain.structure.modules import SoftmaxLayer
from pybrain.structure import FeedForwardNetwork
from pybra... | Abhin33t/ann_minor | Neural_Network_Eval1.py | Python | gpl-2.0 | 2,898 |
"""
Small Modification of src/examples/Geometry/geometry_demos.py
"""
from OCC.gp import *
from OCC.Geom import *
from OCC.TColGeom import *
from OCC.TColgp import *
from OCC.GeomConvert import *
from OCC.BRepBuilderAPI import *
from OCC.TopoDS import *
from OCC.STEPControl import *
from OCC.Display.SimpleGui import... | GeoMop/PythonOCC_Examples | src/bspline_surface.py | Python | gpl-2.0 | 3,394 |
"""Support functions for loading the reference count data file."""
__version__ = '$Revision$'
import os
import sys
# Determine the expected location of the reference count file:
try:
p = os.path.dirname(__file__)
except NameError:
p = os.path.dirname(sys.argv[0])
p = os.path.normpath(os.path.join(os.getcwd()... | scs/uclinux | user/python/python-2.4.4/Doc/tools/refcounts.py | Python | gpl-2.0 | 2,310 |
import time
import simtk.openmm.app as app
import simtk.openmm as mm
from simtk import unit as u
from openmmtools import hmc_integrators, testsystems, integrators
testsystem = testsystems.DHFRExplicit(rigid_water=False, constraints=None)
system, topology, positions = testsystem.system, testsystem.topology, testsystem... | kyleabeauchamp/HMCNotes | code/misc/benchmark_mts_july.py | Python | gpl-2.0 | 1,588 |
#
# Copyright 2008-2011 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | futurice/vdsm | vdsm/kaxmlrpclib.py | Python | gpl-2.0 | 5,941 |
#oClasses.py
import Classes
class LCDMgr:
display = 0
editing = 1
eoEdit = 2
error = 3
confirmAbortMode = 4
#modes = [display, editing, eoEdit, error,confirmAbortMode]
cursorOff =-1
cursorStart = 0
eoLine = 15
lineLength = 16
letters = ['A','a','B','b','C','c','D','d'] ... | gratefulfrog/ArduGuitar | Ardu2/design/POC-3_MAX395/pyboard/V1_WithHMI/PyHMI/oClasses.py | Python | gpl-2.0 | 5,003 |
#! /usr/bin/env python
"""Post a new MT entry"""
# username, password, blogid, publish
from settings import *
import types
import xmlrpclib
def post(content):
"""Post an entry to a blog. Return postid on success."""
content.check()
weblogContent = { 'title' : content.getTitle(),
... | false-git/mail2entry | postentry.py | Python | gpl-2.0 | 621 |
import pytest
from cfme import test_requirements
from cfme.configure import about
@test_requirements.appliance
@pytest.mark.tier(3)
@pytest.mark.sauce
def test_appliance_version(appliance):
"""Check version presented in UI against version retrieved directly from the machine.
Version retrieved from appliance... | izapolsk/integration_tests | cfme/tests/configure/test_version.py | Python | gpl-2.0 | 824 |
# -*- coding: utf-8 -*-
# Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# y... | rainaashutosh/MyTestRekall | rekall-core/rekall/plugins/renderers/base_objects.py | Python | gpl-2.0 | 11,403 |
import sys, os
import pygsl
import pygsl.sf
while "python" not in os.listdir("."):
os.chdir("..")
sys.path.append("python")
import spidir
from rasmus.common import *
from rasmus.bio import phylo
from test import *
if os.system("which xpdf 2>/dev/null") != 0:
rplot_set_viewer("display")
def exc_default(f... | mdrasmus/spimap | test/all_terms.py | Python | gpl-2.0 | 4,112 |
from tools.load import LoadMatrix
lm=LoadMatrix()
traindat = lm.load_numbers('../data/fm_train_real.dat')
testdat = lm.load_numbers('../data/fm_test_real.dat')
label_traindat = lm.load_labels('../data/label_train_multiclass.dat')
parameter_list = [[traindat,testdat,label_traindat,3],[traindat,testdat,label_traindat,3]... | ratschlab/ASP | examples/undocumented/python_modular/classifier_knn_modular.py | Python | gpl-2.0 | 1,033 |
#!/usr/bin/env python
import sql
import sys
def main(argv):
tables = sql.get_tables()
for table in tables:
print "%s: %d" % (table, sql.count(table))
if __name__ == '__main__': main(sys.argv[1:])
| ingkebil/trost | scripts/maintanance/count_all_tables.py | Python | gpl-2.0 | 217 |
import numpy as np
import pandas as pd
from plotnine import (ggplot, aes, geom_area, geom_ribbon,
facet_wrap, scale_x_continuous, theme)
n = 4 # No. of ribbions in a vertical stack
m = 100 # Points
width = 2*np.pi # width of each ribbon
x = np.linspace(0, width, m)
df = pd.... | has2k1/plotnine | plotnine/tests/test_geom_ribbon_area.py | Python | gpl-2.0 | 2,328 |
#!/bin/python3
from test.test import run_test
from reader import read_field
from sys import exit
import os
failed = 0
run = 0
os.chdir("test/")
for test_file in os.listdir(path='.'):
if test_file.endswith(".test"):
print("Running {}".format(test_file))
run += 1
if not run_test(test_file):
... | nzinov/maze | run_tests.py | Python | gpl-3.0 | 578 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Osmo Salomaa
#
# 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 pr... | otsaloma/helsinki-transit-stops | hts/test/test_util.py | Python | gpl-3.0 | 1,528 |
# Authors: Ade Lee <alee@redhat.com>
#
# Copyright (C) 2014 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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 t... | encukou/freeipa | ipaserver/install/krainstance.py | Python | gpl-3.0 | 11,676 |
import os
from lizard_ui.settingshelper import setup_logging
from lizard_ui.settingshelper import STATICFILES_FINDERS
DEBUG = True
TEMPLATE_DEBUG = True
# SETTINGS_DIR allows media paths and so to be relative to this settings file
# instead of hardcoded to c:\only\on\my\computer.
SETTINGS_DIR = os.path.dirname(os.pa... | lizardsystem/lizard-reportgenerator | lizard_reportgenerator/testsettings.py | Python | gpl-3.0 | 3,058 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#----------------------------------------------------------------------------
# Download OSM data covering the area of a slippy-map tile
#
# Features:
# * Recursive (downloads are all at z15, and merged if necessary to get
# a larger area)
# * Cached (all downloads stored... | ryfx/modrana | modules/pyrender/OsmTileData.py | Python | gpl-3.0 | 3,691 |
# -*- coding: utf-8 -*-
"""
Go to Google Bookmarks: https://www.google.com/bookmarks/
On the bottom left, click "Export bookmarks": https://www.google.com/bookmarks/bookmarks.html?hl=en
After downloading the html file, run this script on it to get the addresses
This script is based on https://gist.github.com/endolit... | marado/stars-to-addresses | stars-to-addresses.py | Python | gpl-3.0 | 5,571 |
# Tests out multiple simultaneous draw commands
import sys
from time import sleep
from random import choice, random, randint
from string import letters
from PodSixNet.Connection import connection, ConnectionListener
from server.version import VERSION
class TestClientException(Exception):
pass
class TestClient(Con... | chr15m/Infinite8BitPlatformer | I8BPTestClient-random-linedraws.py | Python | gpl-3.0 | 3,693 |
from .helpers import setup
def initialize(supervisor):
backend = supervisor.config['cache.backend']
supervisor.exts.cache = setup(backend, supervisor.config)
| Outernet-Project/librarian-core | librarian_core/contrib/cache/hooks.py | Python | gpl-3.0 | 168 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
smuggle_url,
parse_duration,
)
class MiTeleIE(InfoExtractor):
IE_DESC = 'mitele.es'
_VALID_URL = r'https?://(?:www\.)?mitele\.es/(?:[^/]+/)+(?P<id>[^/]+)/player'
_TESTS = [{
'url': 'h... | valmynd/MediaFetcher | src/plugins/youtube_dl/youtube_dl/extractor/mitele.py | Python | gpl-3.0 | 3,700 |
from django.contrib import admin
from . import models
@admin.register(models.Pingback)
class PingbackAdmin(admin.ModelAdmin):
list_display = ('package_name', 'unique_count', 'count', 'last_seen', 'first_seen', 'blocked', 'first_seen_blocked')
list_filter = ('repository', 'last_seen', 'blocked')
@admin.reg... | benjaoming/pytosquatting | pingback/admin.py | Python | gpl-3.0 | 446 |
# -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocol... | nagyistoce/netzob | src/netzob/Common/MMSTD/Dictionary/Memory.py | Python | gpl-3.0 | 8,119 |
# -*- coding: utf-8 -*-
# Copyright (c) 2010 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Package implementing a menu to select the user agent string.
"""
| davy39/eric | Helpviewer/UserAgent/__init__.py | Python | gpl-3.0 | 169 |
# -*- coding: utf-8 -*-
"""
Created on Thu May 2 14:02:07 2013
Wrapper for calcEC.m to compute the mutual and direct information from a MSA
@author: root
"""
import os
import tempfile
# import pdb
import sys
mlabpath='/s/parsons/l/sys/matlab64/bin/'
if mlabpath not in os.environ["PATH"]:
print 'Adding '+mlabpat... | foxtrotmike/pairpred | calcEC.py | Python | gpl-3.0 | 2,206 |
import numpy
import itertools
import random
import math
def convert_spike_list_to_timed_spikes(spike_list, min_idx, max_idx, tmin, tmax, tstep):
times = numpy.array(range(tmin, tmax, tstep))
spike_ids = sorted(spike_list)
possible_neurons = range(min_idx, max_idx)
spikeArray = dict([(neuron, times) for... | dhgarcia/babelModules | pynnModules/Network/spike_file_to_spike_array.py | Python | gpl-3.0 | 8,559 |
"""
Duplicate entries allowed
this raises the complexity from log n to n/2 log n
key idea:
if mid equal to two ends, there must be constant on
one side and min on the other.
if left end < mid < right: no rotation
if mid less than both ends => min on your left
if min greater than both ends => min on your right
"""
... | urashima9616/Leetcode_Python | Leet154_FindMinRotatedArrayII.py | Python | gpl-3.0 | 1,397 |
################################################################################
## ##
## This file is a part of TADEK. ##
## ... | tadek-project/tadek-common | tests/core/location.py | Python | gpl-3.0 | 9,487 |
#!/usr/bin/python
# -*- coding:utf-8 -*-
# ******************************************************
# Author : Yifan Song
# Last modified: 2017.01.02
# Email : yifans@mail.ustc.edu.cn
# Filename : config_parse.py
# Description : parse the configuration file, and return the interlock tree list
# *******... | yifans/HLS-II-SIS | src/core/config_parse.py | Python | gpl-3.0 | 1,385 |
"""
information needed
- path to FASTQ
- path to reference genome
- path to indexed reference genome
- read number (1/2)
- restriction enzyme used
- species name
- chromosome names (optional)
- descriptive fields (optional, e.g. --descr=flowcell:C68AEACXX,lane:4,index:24nf)
mapping strategy
- iterative/fra... | 3DGenomes/tadbit | _pytadbit/tools/tadbit_map.py | Python | gpl-3.0 | 26,222 |
from django.contrib import admin
class CandidateAdmin(admin.ModelAdmin):
fieldsets = [
(None, {
'fields': ['email', 'first_name', 'last_name', 'gender', 'cv']
}),
('Contact Information', {
'classes': ('collapse',),
'fields': ['mobile_phone']
}),
... | QC-Technologies/HRMS | interview/admin/candidate.py | Python | gpl-3.0 | 1,067 |
from __future__ import division
import datetime
import os
import re
import nltk
from nltk.corpus import wordnet as wn
from nltk.corpus.reader import WordListCorpusReader
import string
PUNCTUATION = [',','.',';',':','(',')','?','!','"','\'']
CORRECTIONS = [
('Hie', 'the'),
('hie', 'the')... | wragge/Trove-newspapers | clean.py | Python | gpl-3.0 | 12,943 |
from GangaCore.testlib.decorators import add_config
@add_config([('TestingFramework', 'AutoCleanup', False)])
def test_all_exceptions(gpi):
"""Create all exceptions and make sure they behave correctly"""
import GangaCore.Core.exceptions
test_str = "My Test Error"
def exception_test(err_name):
... | ganga-devs/ganga | ganga/GangaCore/test/GPI/TestExceptions.py | Python | gpl-3.0 | 2,047 |
import pytest
from nicelib.process import Parser
@pytest.mark.parametrize("num,result", [
(1, "20"),
(2, "40"),
(3, "60"),
(0, "60"),
])
def test_if(num, result):
parser = Parser("""
#define x {}
#if x == 1
#define y 20
#elif x == 2
#define y 40
... | mabuchilab/NiceLib | tests/test_if.py | Python | gpl-3.0 | 3,236 |
# -*- coding: utf-8 -*-
"""
@author: kevinhikali
@email: hmingwei@gmail.com
"""
import tensorflow as tf
A = [[1, 2, 3, 4]]
B = [[2, 2, 3, 4]]
casted = tf.cast(tf.equal(A, B), dtype='float32')
with tf.Session() as sess:
print(sess.run(casted))
| kevinhikali/ml_kevin | tf/tf_cast.py | Python | gpl-3.0 | 250 |
"""
Wrapper for safely working with curses subwindows.
Based on code from the arm project, developed by Damian Johnson under GPLv3
(www.atagar.com - atagar@torproject.org)
"""
import os
import copy
import time
import curses
import curses.ascii
import curses.textpad
from threading import RLock
from multiprocessing imp... | shadow/shadow-ctl | src/panel.py | Python | gpl-3.0 | 41,934 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0011_relationship_integration'),
]
operations = [
migrations.AddField(
model_name='integration',
... | efornal/guppy | app/migrations/0012_add_field_projects_to_integration.py | Python | gpl-3.0 | 443 |
"""Admin classes for the ``object_events`` app."""
from django.contrib import admin
from .models import Event, EventType
from lib.admin.actions import export_as_csv_action
class EventTypeAdmin(admin.ModelAdmin):
list_display = ['title', ]
class EventAdmin(admin.ModelAdmin):
list_display = ['user', 'content_... | hzlf/openbroadcast | website/apps/atracker/admin.py | Python | gpl-3.0 | 1,072 |
# -*- coding: utf-8 -*-
import urllib, urllib2
from datetime import datetime
SPEEDURL = 'http://speed.pypy.org/'
def save(project, revision, results, options, executable, int_options, host, testing=False):
testparams = []
#Parse data
data = {}
current_date = datetime.today()
for b in resu... | camillobruni/pinocchioCodespeed | tools/pypy/savecpython.py | Python | gpl-3.0 | 2,103 |
# -*- 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):
# Adding model 'Reference_Domain'
db.create_table(u'django_reference_data_reference_domain', (
(... | jonathanmorgan/django_reference_data | migrations/0001_initial.py | Python | gpl-3.0 | 4,641 |
#-*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocols... | dasbruns/netzob | src/netzob/Common/Models/Vocabulary/Domain/Specializer/FieldSpecializer.py | Python | gpl-3.0 | 8,683 |
#!/usr/bin/env python
#
# Copyright 2015 Paul Donohue <cgroupsd@PaulSD.com>
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later vers... | PaulSD/cgroupsd | lib/cgroupsd_listener.py | Python | gpl-3.0 | 12,128 |
#!/usr/bin/env python
# This file is part of nexdatas - Tango Server for NeXus data writer
#
# Copyright (C) 2012-2018 DESY, Jan Kotanski <jkotan@mail.desy.de>
#
# nexdatas is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... | nexdatas/tools | nxstools/pyeval/dalsa.py | Python | gpl-3.0 | 2,307 |
# -*- coding: utf-8 -*-
# Aualé oware graphic user interface.
# Copyright (C) 2014-2020 Joan Sala Soler <contact@joansala.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | joansalasoler/auale | src/auale/gui/actors/label.py | Python | gpl-3.0 | 3,526 |
#!/usr/bin/python
"""Module for batch converting images to JPEG 2000 format.
Takes an input directory and recreates the directory structure, with
converted images, in the specified output directory.
WARNING: If the same directory contains two or more images with the
same name (excepting the extension), only one of th... | kcl-ddh/chopin-online | ocve/scripts/ocvejp2converter.py | Python | gpl-3.0 | 10,997 |
# Copyright (C) 2017 Gerrit Addiks <gerrit@addiks.net>
# https://github.com/addiks/gedit-phpide
#
# 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 o... | addiks/gmattermost | src/Application.py | Python | gpl-3.0 | 3,930 |
# rock_n_roll/apps.py
from django.apps import AppConfig
class BibliographyConfig(AppConfig):
name = 'bibliography'
verbose_name = "bibliography"
#pippio = "pippo"
| chiara-paci/baskerville | baskervilleweb/bibliography/apps.py | Python | gpl-3.0 | 177 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/media/Home/Documents/SoftProjects/LDM/OAGui/src/Control/Ui/OAMultiplot.ui'
#
# Created: Tue Apr 16 14:32:36 2013
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, Qt... | wyrdmeister/OnlineAnalysis | OAGui/src/Control/Ui/Ui_OAMultiplot.py | Python | gpl-3.0 | 6,385 |
'''
SASSIE: Copyright (C) 2011 Joseph E. Curtis, Ph.D.
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.
... | madscatt/sasmol | src/python/sasview.py | Python | gpl-3.0 | 2,255 |
#!/home/oleg/Web/Hack70/env/bin/python3
#
# The Python Imaging Library
# $Id$
#
from __future__ import print_function
try:
from tkinter import *
except ImportError:
from Tkinter import *
from PIL import Image, ImageTk
import sys
# --------------------------------------------------------------------
# an im... | lesina/Hack70 | env/bin/player.py | Python | gpl-3.0 | 2,194 |
#!python
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 25 22:38:43 2014
@author: dave
"""
import os
#from argparse import ArgumentParser
import argparse
import paramiko
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("script", help="python script to execute")
parser.a... | davidovitch/prepost-wind-dlc | cluster-tools/run-node.py | Python | gpl-3.0 | 843 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
#Note : Cet algo semble (à ce que j'ai compris) avoir besoin qu'on lui précise
#tous les caractères qu'il peut rencontrer #CestNulOMG
#Pour l'instant, on remarquera que je ne le fais fonctionner qu'avec les majuscules
def moveToFront(texte, table):
resultat = [] #on utilise un... | LeProjetDeLaSemaine/Projet_ISN | MoveToFront.py | Python | gpl-3.0 | 1,229 |