code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# This file is part of Rubber and thus covered by the GPL
import rubber.dvip_tool
import rubber.module_interface
class Module (rubber.module_interface.Module):
def __init__ (self, document, opt):
self.dep = rubber.dvip_tool.Dvip_Tool_Dep_Node (document, 'dvips')
| skapfer/rubber | src/latex_modules/dvips.py | Python | gpl-2.0 | 278 |
# Copyright (C) 2005 Colin McMillen <mcmillen@cs.cmu.edu>
#
# This file is part of GalaxyMage.
#
# GalaxyMage 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 opti... | jemofthewest/GalaxyMage | src/gui/Input.py | Python | gpl-2.0 | 12,695 |
t = 1 # triangle number order, e.g. t=7 is 7th triangle number or 1+2+3+4+5+6+7=28
divisors = []
while len(divisors) <= 500:
n = sum(range(1,t+1)) # Generate triangle number
step = 2 if n%2 else 1
divisors = reduce(list.__add__, ([i, n//i] for i in range(1, int((n**0.5))+1, step) if n % i == 0))
# ... | blakegarretson/projecteuler | prob12.py | Python | gpl-2.0 | 452 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
.. module:: measurematrix.py
.. moduleauthor:: Jozsef Attila Janko, Bence Takacs, Zoltan Siki (code optimalization)
Sample application of Ulyxes PyAPI to measure within a rectangular area
:param argv[1] (int): number of horizontal intervals (between measurements), ... | zsiki/ulyxes | pyapps/measurematrix.py | Python | gpl-2.0 | 4,051 |
import os
import sys
def main():
if len(sys.argv) <= 2:
print("This script generates the .expected file from your PS3's debug logs.")
print("")
print("Usage: convert-ps3-output.py <input> <output>")
print("Example: convert-ps3-output.py hello_world.log hello_world.expected")
... | RPCS3/ps3autotests | utils/convert-ps3-output.py | Python | gpl-2.0 | 868 |
__author__ = 'Matteo'
__doc__='''This could be made into a handy mutagenesis library if I had time.'''
from Bio.Seq import Seq,MutableSeq
from Bio import SeqIO
from Bio.Alphabet import IUPAC
from difflib import Differ
def Gthg01471():
ori=Seq("ATGAGCATAAGTTTATCGGTTCCAAAATGGTTATTAACAGTTTTATCAATTTTATCTTTAGTCGTAGCAT... | matteoferla/Geobacillus | geo_mutagenesis.py | Python | gpl-2.0 | 2,769 |
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required, user_passes_test
urlpatterns = patterns('',
url(r'^$', 'website.views.index', name='website_index'),
url(r'^termos/$',TemplateView.as_view(template_name='website/... | agendaTCC/AgendaTCC | tccweb/apps/website/urls.py | Python | gpl-2.0 | 603 |
# -*- coding: utf-8 -*-
"""Models for database connection"""
import settings
| vprusso/us_patent_scraper | patent_spider/patent_spider/models.py | Python | gpl-2.0 | 80 |
################################################################################
#
# This program is part of the HPMon Zenpack for Zenoss.
# Copyright (C) 2008, 2009, 2010, 2011 Egor Puzanov.
#
# This program can be used under the GNU General Public License version 2
# You can find full information here: http://www.zen... | epuzanov/ZenPacks.community.HPMon | ZenPacks/community/HPMon/cpqScsiPhyDrv.py | Python | gpl-2.0 | 1,513 |
#!/usr/bin/env python
# vim:fileencoding=utf-8
# Find the best reactor
reactorchoices = ["epollreactor", "kqreactor", "cfreactor", "pollreactor", "selectreactor", "posixbase", "default"]
for choice in reactorchoices:
try:
exec("from twisted.internet import %s as bestreactor" % choice)
break
except:
pass
bestre... | mayson/viperpeers | viperpeers.py | Python | gpl-2.0 | 45,342 |
# ------------------------------------------------------------------------
# Program : gawterm.py
# Author : Gerard Wassink
# Date : March 17, 2017
#
# Function : supply a terminal window with panes for remote control
# of my elevator, can also be used for other contraptions
#
# History : 20170317 - original... | GerardWassink/elevator.py | gawterm.py | Python | gpl-2.0 | 7,411 |
from Probabilidades import Probabilidad
from validador import *
a = Probabilidad()
a.cargarDatos("1","2","3","4","5","6")
uno = [" ------- ","| |","| # |","| |"," ------- "]
dos = [" ------- ","| # |","| |","| # |"," ------- "]
tres = [" ------- ","| # |","| # |","|... | pepitogithub/PythonScripts | Dados.py | Python | gpl-2.0 | 1,284 |
from django.shortcuts import redirect
from portfolio.models.comments import PhotoComment
from portfolio.models.photos import Photo
from portfolio.views.base import AuthenticatedView
class CommentPhotoView(AuthenticatedView):
""" View that handles commenting on a photo """
def post(self, request):
com... | kdimitrov92/Portfolio | portfolio/portfolio/views/comments.py | Python | gpl-2.0 | 789 |
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------
# jsonrpc - jsonrpc interface for XBMC-compatible remotes
# -----------------------------------------------------------------------
# $Id$
#
# JSONRPC and XBMC eventserver to be used for XBMC-compatible
# remotes. Onl... | freevo/freevo2 | src/plugins/jsonrpc/__init__.py | Python | gpl-2.0 | 8,340 |
#!/usr/bin/env python3
# External command, intended to be called with run_command() or custom_target()
# in meson.build
# argv[1] argv[2] argv[3:]
# skeletonmm-tarball.py <output_file_or_check> <source_dir> <input_files...>
import os
import sys
import shutil
import tarfil... | GNOME/mm-common | util/meson_aux/skeletonmm-tarball.py | Python | gpl-2.0 | 1,665 |
class Solution(object):
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
nums = [0 for _ in xrange(n + 1)]
for i in xrange(1, n + 1):
if i == 1:
nums[1] = 1
elif i == 2:
nums[2] = 2
else:
... | Jacy-Wang/MyLeetCode | ClimbStairs70.py | Python | gpl-2.0 | 393 |
"This program will parse matrix files to convert them into objects usable by JS files"
# libraries' imports for create the parser
## librairy to create the json object
import json
import os
## library for using regular expressions
import re
# opening of all files, each containing an EDNA matrix
EDNAFULL=open("EDNA/ED... | crazybiocomputing/align2seq | matrix/parserEDNA.py | Python | gpl-2.0 | 1,539 |
"""Module to read/write ascii catalog files (CSV and DS9)"""
##@package catalogs
##@file ascii_data
"""
The following functions are meant to help in reading and writing text CSV catalogs
as well as DS9 region files. Main structure used is dictionaries do deal with catalog
data in a proper way.
"""
import sys
import ... | chbrandt/zyxw | eada/io/ascii.py | Python | gpl-2.0 | 9,744 |
# -*- coding: utf-8 -*-
#
# PyBorg: The python AI bot.
#
# Copyright (c) 2000, 2006 Tom Morton, Sebastien Dailly
#
#
# This bot was inspired by the PerlBorg, by Eric Bock.
#
# 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 th... | awildeone/Wusif | pyborg.py | Python | gpl-2.0 | 42,867 |
from datetime import date
class YearInfo(object):
def __init__(self, year, months_ok, months_na):
self.year = year
self.months = set(range(1, 13))
self.months_ok = set(months_ok)
self.months_na = set(months_na)
self.months_er = self.months - (self.months_ok | self.months_na)... | hackerspace/memberportal | payments/common.py | Python | gpl-2.0 | 1,647 |
#
# Copyright (c) 1999--2015 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 c... | xkollar/spacewalk | client/rhel/rhn-client-tools/src/up2date_client/hardware.py | Python | gpl-2.0 | 29,568 |
from logger import log
import os
import gconf
import urllib
class Configuration(object):
def __init__(self):
self._config = {}
self._file_path = os.path.join(os.path.dirname(__file__), 'config',
'config.ini')
# Read Files
self._read_file()
def get_value(self, key... | vbabiy/gedit-openfiles | gedit_openfiles/configuration.py | Python | gpl-2.0 | 1,698 |
from landscape.client.tests.helpers import LandscapeTest
from landscape.client.patch import UpgradeManager
from landscape.client.upgraders import monitor
class TestMonitorUpgraders(LandscapeTest):
def test_monitor_upgrade_manager(self):
self.assertEqual(type(monitor.upgrade_manager), UpgradeManager)
| CanonicalLtd/landscape-client | landscape/client/upgraders/tests/test_monitor.py | Python | gpl-2.0 | 317 |
# SecuML
# Copyright (C) 2016 ANSSI
#
# SecuML 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.
#
# SecuML is distributed in the hope t... | ah-anssi/SecuML | SecuML/core/DimensionReduction/Configuration/Projection/SdmlConfiguration.py | Python | gpl-2.0 | 1,670 |
#!/usr/bin/env python3
# coding=utf-8
"""
# fias2postgresql
Импорт ФИАС (http://fias.nalog.ru) в PostgreSQL.
Необходимы:
* *python3.2+* с пакетами [requests](http://docs.python-requests.org/en/latest/), [lxml](http://lxml.de)
* *unrar*
* [*pgdbf*](https://github.com/kstrauser/pgdbf), обязательно с [патчем](https:... | bacilla-ru/fias2postgresql | fias.py | Python | gpl-2.0 | 8,843 |
# Copyright (C) 2008, 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 in... | ajaygarg84/sugar | src/jarabe/model/session.py | Python | gpl-2.0 | 3,705 |
from picamera.exc import PiCameraError
from picamera.camera import PiCamera
| CoderBotOrg/coderbot | stub/picamera/__init__.py | Python | gpl-2.0 | 77 |
# encoding: utf-8
# module PyKDE4.kdeui
# from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdecore as __PyKDE4_kdecore
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
import PyQt4.QtSvg as __PyQt4_QtSvg
fr... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdeui/KColorChooserMode.py | Python | gpl-2.0 | 508 |
"""
OpenStreetMap boundary generator.
Author: Andrzej Talarczyk <andrzej@talarczyk.com>
Based on work of Michał Rogalski (Rogal).
License: GPLv3.
"""
import os
import platform
import shutil
def clean(src_dir):
"""Remove target files.
Args:
src_dir (string): path to the directory from which target... | basement-labs/osmapa-garmin | osmapa/boundaries.py | Python | gpl-2.0 | 2,693 |
from filetypes.basefile import BaseFile
from filetypes.plainfile import PlainFile
from filetypes.plainfile import ReviewTest
import filetypes
class JFLAPReviewTest(ReviewTest):
def __init__(self, dict_, file_type):
super().__init__(dict_, file_type)
def run(self, path):
"""A JFLAP review test ... | abreen/socrates.py | filetypes/jflapfile.py | Python | gpl-2.0 | 1,386 |
#
# test_tracking_events.py
#
# Copyright (C) 2017 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
#
# Unit tests for functions related to tracking events:
# `kano_profile.tracker.tracking_events`
#
import os
import json
import time
import pytest
from kano_profile.paths import t... | KanoComputing/kano-profile | tests/profile/tracking/test_tracking_events.py | Python | gpl-2.0 | 1,689 |
from Tools.HardwareInfo import HardwareInfo
from Tools.BoundFunction import boundFunction
from config import config, ConfigSubsection, ConfigSelection, ConfigFloat, \
ConfigSatlist, ConfigYesNo, ConfigInteger, ConfigSubList, ConfigNothing, \
ConfigSubDict, ConfigOnOff, ConfigDateTime
from enigma import eDVBSatellit... | pli3/enigma2-git | lib/python/Components/NimManager.py | Python | gpl-2.0 | 63,253 |
# encoding: utf-8
# module samba.dcerpc.lsa
# from /usr/lib/python2.7/dist-packages/samba/dcerpc/lsa.so
# by generator 1.135
""" lsa DCE/RPC """
# imports
import dcerpc as __dcerpc
import talloc as __talloc
class ForestTrustInformation(__talloc.Object):
# no doc
def __init__(self, *args, **kwargs): # real si... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/lsa/ForestTrustInformation.py | Python | gpl-2.0 | 1,274 |
# Kingsoft Antivirus
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def SetUninstallName(self, arg):
if len(arg) > 900:
log.ThugLogging.log_exploit_event(self._window.url,
"Kingsoft AntiVirus ActiveX",
"Set... | tweemeterjop/thug | thug/ActiveX/modules/Kingsoft.py | Python | gpl-2.0 | 350 |
# -*- coding: utf-8 -*-
version=0.2
visitedVersion=0.2
enableNotification=True
isFirstStart=True
countClickUp=0
langList=['English','Russian']
searchEngines=['Google','Bing','Yahoo','Yandex']
defaultSearchEngine=0
defaultLangFrom='Auto'
defaultLangTo='Russian'
useControl=True
useDblControl=True
useNothing=False
useGoog... | ambyte/Vertaler | src/modules/settings/config.py | Python | gpl-2.0 | 2,655 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
"""
from exception import *
class base_storage:
def __init__(self, usr=None, usr_key=None):
self.usr_key = None
self.usr = None
self.records = []
if usr is None:
return
self.load_info_from_file()
if self.usr != usr:
raise UsrError
if self.usr_ke... | lifulong/account-manager | src/core/file_store.py | Python | gpl-2.0 | 4,172 |
##
# Copyright 2013-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | pescobar/easybuild-easyblocks | easybuild/easyblocks/d/db.py | Python | gpl-2.0 | 1,707 |
# gentrace.py
#
# Trace a generator by printing items received
def trace(source):
for item in source:
print item
yield item
# Example use
if __name__ == '__main__':
from apachelog import *
lines = open("access-log")
log = trace(apache_log(lines))
r404 = (r for r in log if r['stat... | benosment/generators | generators-for-system-programmers/gentrace.py | Python | gpl-2.0 | 385 |
"""SCons.Tool.aixc++
Tool-specific initialization for IBM xlC / Visual Age C++ compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is h... | IljaGrebel/OpenWrt-SDK-imx6_HummingBoard | staging_dir/host/lib/scons-2.3.5/SCons/Tool/aixc++.py | Python | gpl-2.0 | 2,413 |
import connman
import bluetooth
import systemd
import sys
import pexpect
import json
RUNNING_IN_KODI = True
# XBMC Modules
try:
import xbmc
import xbmcgui
import xbmcaddon
except:
RUNNING_IN_KODI = False
DEVICE_PATH = 'org.bluez.Device1'
PAIRING_AGENT = 'osmc_bluetooth_agent.py'
BLUETOOTH_SERVICE ... | ActionAdam/osmc | package/mediacenter-addon-osmc/src/script.module.osmcsetting.networking/resources/lib/osmc_bluetooth.py | Python | gpl-2.0 | 6,660 |
# Sketch - A Python-based interactive drawing program
# Copyright (C) 1997, 1998, 1999, 2001, 2002 by Bernhard Herzog
#
# 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... | shumik/skencil-c | Sketch/UI/linedlg.py | Python | gpl-2.0 | 11,272 |
from openerp import models,fields
class OeMedicalMedicamentCategory(models.Model):
_name = 'oemedical.medicament.category'
childs = fields.One2many('oemedical.medicament.category',
'parent_id', string='Children', )
name = fields.Char(size=256, string='Name', required=True)
... | Manexware/medical | oemedical/oemedical_medicament_category/oemedical_medicament_category.py | Python | gpl-2.0 | 589 |
#! /usr/bin/env python
# Copyright (C) 2012 dcodix
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free Software Foundation.
# This file is distributed without any warranty; without even the implied
# warranty of merchantability or fi... | dcodix/mv-elsewhere | mv-elsewhere.py | Python | gpl-2.0 | 5,068 |
from typing import Any, Dict, Optional
from flask import g, render_template, url_for
from flask_babel import format_number, lazy_gettext as _
from flask_wtf import FlaskForm
from wtforms import (
BooleanField, IntegerField, SelectMultipleField, StringField, SubmitField,
widgets)
from wtforms.validators import ... | craws/OpenAtlas-Python | openatlas/views/model.py | Python | gpl-2.0 | 9,096 |
#!/usr/bin/env python
#--------------------------------------------------------------------------
# flo2_pid.py
# Rick Kauffman a.k.a. Chewie
#
# Hewlett Packard Company Revision: 1.0
# ~~~~~~~~~ WookieWare ~~~~~~~~~~~~~
# Change history....09/03/201... | xod442/sample_scripts | flo2_pid.py | Python | gpl-2.0 | 7,035 |
#encoding=utf8
from rest_framework import permissions
from django.contrib import messages
from copy import deepcopy
from rest_framework.permissions import *
def own_object_permission(field_name):
class P(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
print h... | hsfzxjy/wisecitymbc | common/rest/permissions.py | Python | gpl-2.0 | 1,542 |
# This file is part of Scapy
# Copyright (C) 2007, 2008, 2009 Arnaud Ebalard
# 2015, 2016, 2017 Maxence Tury
# This program is published under a GPLv2 license
"""
TLS handshake fields & logic.
This module covers the handshake TLS subprotocol, except for the key exchange
mechanisms which are addressed wi... | mtury/scapy | scapy/layers/tls/handshake.py | Python | gpl-2.0 | 61,432 |
import mox
import time
import unittest
from zoom.agent.predicate.health import PredicateHealth
from zoom.common.types import PlatformType
class PredicateHealthTest(unittest.TestCase):
def setUp(self):
self.mox = mox.Mox()
self.interval = 0.1
def tearDown(self):
self.mox.UnsetStubs()
... | spottradingllc/zoom | test/predicate/health_test.py | Python | gpl-2.0 | 1,195 |
""" Care about audio fileformat
"""
try:
from mutagen.flac import FLAC
from mutagen.oggvorbis import OggVorbis
except ImportError:
pass
import parser
import mutagenstripper
class MpegAudioStripper(parser.GenericParser):
""" Represent mpeg audio file (mp3, ...)
"""
def _should_remove(self, fi... | jubalh/MAT | libmat/audio.py | Python | gpl-2.0 | 1,375 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011, 2012, 2014, 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; either version 2 of the
# License, or (at your... | egabancho/invenio-knowledge | invenio_knowledge/models.py | Python | gpl-2.0 | 12,573 |
from classes import *
sign = Object('sign', 'To the left is a sign.', 'The sign says: Den of Evil')
opening = Room('opening', 'You are standing in front of a cave.', {}, {'sign' : sign})
#sign.set_room(opening)
opening_w = Room('opening_w', 'You are standing in front of an impassable jungle. There is nothing here yo... | jbs1/jhack14 | rooms.py | Python | gpl-2.0 | 1,739 |
# -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003-2005 The GemRB Project
#
# 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 opt... | Tomsod/gemrb | gemrb/GUIScripts/iwd/CharGen.py | Python | gpl-2.0 | 92,820 |
# -*- coding: utf-8 -*-
#
# This file is part of EUDAT B2Share.
# Copyright (C) 2017 CERN, SurfsSara
#
# B2Share 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 o... | SarahBA/b2share | demo/b2share_demo/migration_cli.py | Python | gpl-2.0 | 15,061 |
# coding: utf-8
# In[9]:
import numpy as np
import networkx as nx
# In[2]:
G = nx.karate_club_graph()
# In[3]:
L = nx.laplacian_matrix(G)
# In[4]:
L
# In[11]:
d = np.array([v for k,v in nx.degree(G).items()])
# In[12]:
d
# In[14]:
L.dot(d)
# In[16]:
e = np.array([v for k,v in nx.betweenness_cent... | DavidMcDonald1993/ghsom | laplacian.py | Python | gpl-2.0 | 376 |
# -*- coding: utf-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
from pida.core.events import EventsConfig
import unittest
class MockCallback(object):
def __init__(self):
self.calls = []
def __call__(self, **kw):
self.calls.append(kw)
class MockService(object):
"""used... | fermat618/pida | tests/core/test_events.py | Python | gpl-2.0 | 1,326 |
#! /usr/bin/env python
"""
#############################################################################################
#
#
# Name: LogFileAccessManager.py
#
# @author: Nicholas Lemay
#
# @license: MetPX Copyright (C) 2004-2006 Environment Canada
# MetPX comes with ABSOLUTELY NO WARRANTY; For details type s... | khosrow/metpx | pxStats/lib/LogFileAccessManager.py | Python | gpl-2.0 | 12,296 |
from Components.ActionMap import ActionMap
from Components.Sources.List import List
from Components.Sources.StaticText import StaticText
from Components.ConfigList import ConfigList
from Components.config import *
from Components.Console import Console
from skin import loadSkin
from Components.Label import Label
from S... | n3wb13/OpenNfrGui-5.0-1 | lib/python/Plugins/Extensions/bmediacenter/src/plugin.py | Python | gpl-2.0 | 18,939 |
#author: Nadezhda Shivarova
#date created: 30/11/15
#Description: Perform Bi-Level Image Threshold on a histogram to determine the optimal threshold level
#Using the algorithm in the paper Bi Level Img Thresholding, Antonio dos Anjos
import numpy as np
def bi_level_img_threshold( hist ):
hist = hist.flatten()
pr... | Qwertycal/19520-Eye-Tracker | GUI and Mouse/View of multiple signals/bi_level_img_threshold.py | Python | gpl-2.0 | 1,306 |
# DFF -- An Open Source Digital Forensics Framework
# Copyright (C) 2009 ArxSys
#
# This program is free software, distributed under the terms of
# the GNU General Public License Version 2. See the LICENSE file
# at the top of the source tree.
#
# See http://www.digital-forensic.org for more information about this
# ... | halbbob/dff | modules/viewer/hexedit/hexView.py | Python | gpl-2.0 | 7,468 |
# -*- coding: utf-8 -*-
######################################
#
# Détection des modules
#
######################################
#
# WxGeometrie
# Dynamic geometry, graph plotter, and more for french mathematic teachers.
# Copyright (C) 2005-2013 Nicolas Pourcelot
#
# This program is free software; yo... | wxgeo/geophar | wxgeometrie/param/modules.py | Python | gpl-2.0 | 3,148 |
# -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2010 Collabora Ltd.
#
# 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
#... | billiob/papyon | papyon/msnp2p/filetransfer.py | Python | gpl-2.0 | 3,119 |
# -*- coding:utf8 -*-
"""
Handels everthing related to the main Window
"""
from __future__ import unicode_literals
import sys
from urllib.parse import urlparse, urlunparse
from PyQt5.QtWidgets import QMainWindow, QFileDialog, QMessageBox, QMessageBox
from PyQt5.QtCore import (QAbstractListModel, Qt, QModelIndex, QTh... | Arvedui/picup | picup/main_window.py | Python | gpl-2.0 | 12,014 |
#!/usr/bin/env python3
import time
import json
import requests
from datetime import datetime
import paho.mqtt.client as mqtt
from sense_hat import SenseHat
BROKER_URL = '192.168.24.25'
CYCLE_TIME = 10
# initialisiere SenseHat-Erweiterung
sense = SenseHat()
sense.low_light = True
def get_location():
"""Ermit... | wichmann/PythonExamples | sense-hat/weatherpublisher.py | Python | gpl-2.0 | 2,604 |
# -*- coding: utf-8 -*-
__author__ = 'Bright Pan'
# 注意:我们必须要把old数据库中的yehnet_customer表中的postdate改成add_time
import types
import urllib.request
try:
import simplejson as json
except Exception:
import json
import pymysql
import datetime
import sys
print(sys.getdefaultencoding())
def f(x):
if isinstance(x, s... | bright-pan/my_data_sync | old2new.py | Python | gpl-2.0 | 11,662 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def port_models(apps, schema_editor):
Proposal = apps.get_model('core', 'Proposal')
Notice = apps.get_model('core', 'Notice')
n = Notice()
n.title = "Edital"
n.description = "Edital info"
... | hackultura/procult | procult/core/migrations/0004_auto_20160905_0938.py | Python | gpl-2.0 | 1,233 |
# -*- coding: utf-8 -*-
import logging
import pickle
import re
from cacheops import invalidate_model
from django import http
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import redirect, render
from ..attendance import ge... | jacobajit/ion | intranet/apps/eighth/views/admin/blocks.py | Python | gpl-2.0 | 5,960 |
"""
@summary: This script will generate a surface using cones and ellipsoids
@author: CJ Grady
"""
from math import sqrt
import numpy as np
from random import randint
# .............................................................................
class SurfaceGenerator(object):
"""
@summary: This class is used t... | cjgrady/irksome-broccoli | extras/surfaceGenerator.py | Python | gpl-2.0 | 4,244 |
# ------------------------------------------------------------------------------------------------
# Copyright (c) 2016 Microsoft Corporation
#
# 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 Softw... | Yarichi/Proyecto-DASI | Malmo/Python_Examples/animation_test.py | Python | gpl-2.0 | 8,932 |
# -*- 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):
# Deleting field 'Person.slug'
db.delete_column(u'aldryn_people_person', ... | Venturi/cms | env/lib/python2.7/site-packages/aldryn_people/south_migrations/0026_auto__del_field_person_slug__del_field_person_name.py | Python | gpl-2.0 | 15,554 |
"""
file: gitissuetracker.py
author: Christoffer Rosen <cbr4830@rit.edu>
date: December, 2013
description: Represents a Github Issue tracker object used
for getting the dates issues were opened.
12/12/13: Doesn't currently support private repos
"""
import requests, json, dateutil.parser, time
from caslogging impor... | CommitAnalyzingService/CAS_Analyzer | githubissuetracker.py | Python | gpl-2.0 | 3,106 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
DensifyGeometriesInterval.py by Anita Graser, Dec 2012
based on DensifyGeometries.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Victor Olaya
... | GeoCat/QGIS | python/plugins/processing/algs/qgis/DensifyGeometriesInterval.py | Python | gpl-2.0 | 2,510 |
"""
Use reentrant functions. Do not use not reentrant functions.(ctime, strtok, toupper)
== Violation ==
void A() {
k = ctime(); <== Violation. ctime() is not the reenterant function.
j = strok(blar blar); <== Violation. strok() is not the reenterant function.
}
== Good ==
void A() {... | kunaltyagi/nsiqcppstyle | rules/RULE_9_2_D_use_reentrant_function.py | Python | gpl-2.0 | 3,067 |
# encoding: utf-8
#
# FRETBursts - A single-molecule FRET burst analysis toolkit.
#
# Copyright (C) 2013-2016 The Regents of the University of California,
# Antonino Ingargiola <tritemio@gmail.com>
#
"""
This module defines all the plotting functions for the
:class:`fretbursts.burstlib.Data` object.
The ... | tritemio/FRETBursts | fretbursts/burst_plot.py | Python | gpl-2.0 | 96,452 |
from lib.flowchart.nodes.generalNode import NodeWithCtrlWidget
class myNode(NodeWithCtrlWidget):
'''This is test docstring'''
nodeName = 'myTestNode'
uiTemplate = [{'name': 'HNO3', 'type': 'list', 'value': 'Closest Time'},
{'name': 'C2H5OH', 'type': 'bool', 'value': 0},
... | cdd1969/pygwa | lib/flowchart/nodes/n000_testnode/myNode.py | Python | gpl-2.0 | 578 |
#!/usr/bin/python
""" gui -- The main wicd GUI module.
Module containing the code for the main wicd GUI.
"""
#
# Copyright (C) 2007-2009 Adam Blackburn
# Copyright (C) 2007-2009 Dan O'Reilly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | cbxbiker61/wicd | gtk/gui.py | Python | gpl-2.0 | 33,021 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# Copyright (C) 2009-2010 Gary Burton
# Copyright (C) 2010 Nick Hall
#
# 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
#... | Forage/Gramps | gramps/gui/selectors/selectplace.py | Python | gpl-2.0 | 2,617 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright © 2010 University of Zürich
# Author: Rico Sennrich <sennrich@cl.uzh.ch>
# For licensing information, see LICENSE
from __future__ import division,print_function,unicode_literals
import sys
import time
import math
from operator import itemgetter
from bleualign.gale_... | rsennrich/Bleualign | bleualign/align.py | Python | gpl-2.0 | 47,568 |
# -*- encoding: utf-8 -*-
# Copyright (C) 2015 Alejandro López Espinosa (kudrom)
import datetime
import random
class Date(object):
"""
Descriptor for a date datum
"""
def __init__(self, variance, **kwargs):
"""
@param variance is the maximum variance of time
... | kudrom/lupulo | lupulo/descriptors/date.py | Python | gpl-2.0 | 883 |
#1strand Bushing Tool
#Standalone program for minimized cruft
import math
print "This program is for printing the best possible circular bushings"
print "Printer config values are hardcoded for ease of use (for me)"
xpath = [] #These are initialized and default values
ypath = []
zpath = []
step = []
epath = []
xstart... | kanethemediocre/1strand | 1strandbushinga002.py | Python | gpl-2.0 | 6,978 |
# Portions Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# scmutil.py - Mercurial core utility functions
#
# Copyright Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed a... | facebookexperimental/eden | eden/scm/edenscm/mercurial/scmutil.py | Python | gpl-2.0 | 49,777 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 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; either version 2 of the
# License, or (at your option) any... | jirikuncar/invenio-ext | tests/test_ext_registry.py | Python | gpl-2.0 | 2,613 |
"""
The MIT License
Copyright (c) 2007 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 Software without restriction, including without limitation the right... | b0nk/botxxy | src/oauth2.py | Python | gpl-2.0 | 23,431 |
#! /usr/bin/python
try:
import requirements
except ImportError:
pass
import time
import random
import logging
import sys
import os
import inspect
from optparse import OptionParser
import tp.client.threads
from tp.netlib.client import url2bits
from tp.netlib import Connection
from tp.netlib import failed, constant... | thousandparsec/daneel-ai | daneel-ai.py | Python | gpl-2.0 | 9,338 |
import numpy as np
__all__ = ['compute_penalties']
def compute_penalty(kk, clusters):
'''Takes kk.clusters (clusters currently assigned)
and computes the penalty'''
if clusters is None:
clusters = kk.clusters
#print(clusters)
num_cluster_membs = np.array(np.bincount(clusters), ... | kwikteam/global_superclustering | global_code/compute_penalty.py | Python | gpl-2.0 | 1,609 |
from datetime import datetime
from mongoengine import *
from mongoengine.django.auth import User
from django.core.urlresolvers import reverse
import mongoengine.fields
# Create your models here.
class Evento(Document):
titulo = StringField(max_length=200, required=True)
descricao = StringField(required=True)
data_... | tomadasocial/tomada-social | evento/models.py | Python | gpl-2.0 | 899 |
import copy, getpass, logging, pprint, re, urllib, urlparse
import httplib2
from django.utils import datastructures, simplejson
from autotest_lib.frontend.afe import rpc_client_lib
from autotest_lib.client.common_lib import utils
_request_headers = {}
def _get_request_headers(uri):
server = urlparse.urlparse(ur... | ceph/autotest | frontend/shared/rest_client.py | Python | gpl-2.0 | 8,328 |
from setuptools import setup, Extension
#from distutils.core import setup, Extension
module1 = Extension('giscup15',
sources = ['giscup15.cpp'],
extra_compile_args=['-std=c++11'],
libraries=['shp'])
setup (name = 'giscup15',
version = '1.0',
de... | mwernerds/giscup2015 | python/setup.py | Python | gpl-2.0 | 465 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
"""make status give a bit more context
This extension will wrap the status command to make it show more context about
the state of the repo
"""
import... | facebookexperimental/eden | eden/hg-server/edenscm/hgext/morestatus.py | Python | gpl-2.0 | 7,991 |
"""Author: Ben Johnstone"""
#TODO
# 1 Do argparse for main
# 3 Figure out what statistics should be reported
# 4 set up logger
# 5 winnings calculator???
# 6 Speed benchmarking??
# 7 Get drawings file from internet
# 8 Graph count of each ball
# Database
def Main():
parser = argparse.ArgumentParser(description="... | Dreamcatcher5/Powerball | src/powerball/powerball.py | Python | gpl-3.0 | 1,747 |
# Xandikos
# Copyright (C) 2017 Jelmer Vernooij <jelmer@jelmer.uk>, et al.
#
# 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 or (at your option) any later version of
# ... | jelmer/xandikos | xandikos/vcard.py | Python | gpl-3.0 | 2,165 |
"""order name not unique
Revision ID: 1139f0b4c9e3
Revises: 220436d6dcdc
Create Date: 2016-05-31 08:59:21.225314
"""
# revision identifiers, used by Alembic.
revision = '1139f0b4c9e3'
down_revision = '220436d6dcdc'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Al... | Adverpol/eco-basket | migrations/versions/1139f0b4c9e3_order_name_not_unique.py | Python | gpl-3.0 | 635 |
#!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | le9i0nx/ansible | lib/ansible/modules/network/avi/avi_role.py | Python | gpl-3.0 | 3,902 |
from django.contrib.auth.models import Group
from django.core import mail
from django.urls import reverse
from django.test import TestCase
from django.conf import settings
from zds.member.factories import ProfileFactory
from zds.mp.models import PrivateTopic
class MpUtilTest(TestCase):
def setUp(self):
se... | ChantyTaguan/zds-site | zds/mp/tests/tests_utils.py | Python | gpl-3.0 | 4,013 |
#! /usr/bin/env python
# Copyright (C) 2012 Club Capra - capra.etsmtl.ca
#
# This file is part of CapraVision.
#
# CapraVision 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 versio... | clubcapra/Ibex | src/seagoatvision_ros/scripts/CapraVision/server/filters/implementation/mti880.py | Python | gpl-3.0 | 5,241 |
from random import randint
from yapsy.IPlugin import IPlugin
class PortCheckerPlugin(IPlugin):
"""
Mocked Version: Return random 0 or 1 as exit_code
Takes an ip address and a port as inputs and trys to make
a TCP connection to that port. Output is success 0 or failure > 0
"""
de... | neil-davis/penfold | src/plugins/PortCheckerPluginMock.py | Python | gpl-3.0 | 470 |
# -*- coding: utf-8 -*-
# Copyright 2010 Trever Fischer <tdfischer@fedoraproject.org>
#
# This file is part of modulation.
#
# modulation 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 3... | tdfischer/modulation | modulation/controls.py | Python | gpl-3.0 | 2,941 |
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Gene... | getting-things-gnome/gtg | GTG/gtk/backends/configurepanel.py | Python | gpl-3.0 | 8,882 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from module.plugins.Hoster import Hoster
from module.plugins.internal.CaptchaService import ReCaptcha
class FreakshareCom(Hoster):
__name__ = "FreakshareCom"
__type__ = "hoster"
__pattern__ = r"http://(?:www\.)?freakshare\.(net|com)/files/\S*?/"
... | wangjun/pyload | module/plugins/hoster/FreakshareCom.py | Python | gpl-3.0 | 6,038 |
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
def display(self):
node = self
while node is not None:
print(node.val, end="->")
node = node.next
print()
"""
class SLinkedList:
def __init__(self):
self.head = None... | NeerajM999/recap-python | LearnPython/addLists.py | Python | gpl-3.0 | 1,639 |
# _ GraphGrammar.py __________________________________________________
# This class implements a graph grammar, that is basically an ordered
# collecttion of GGrule's
# ____________________________________________________________________
from GGrule import *
class GraphGrammar:
def __init__(self, GGrules... | Balannen/LSMASOMM | atom3/Kernel/GraphGrammar/GraphGrammar.py | Python | gpl-3.0 | 1,680 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.