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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## NumPy提供了很多专门用于创建数组的函数
"""
arange()类似于内置函数range(),通过指定开始值、终值和步长创建表示等差数列的一维数组,注意所得到的结果数组不包含终值。
例如下面的程序创建开始值为0、终值为1、步长为0.1的等差数组,注意终值1不在数组中:
"""
import numpy as np
print np.arange(0, 1, 0.1)
"""
linspace()通过指定开始值、终值和元素个数创建表示等差数列的一维数组,可以通过endpoint参数指定是否包含终值,... | Akagi201/akcode | python/numpy/numpy_create.py | Python | gpl-2.0 | 3,554 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui4/printdialog_base.ui'
#
# Created: Mon May 4 14:30:35 2009
# by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Dialog(object):
def setupUi(self,... | matrumz/RPi_Custom_Files | Printing/hplip-3.15.2/ui4/printdialog_base.py | Python | gpl-2.0 | 5,718 |
import sys, process
import urllib2,re,os,base64,xbmc,xbmcplugin,xbmcaddon,xbmcgui,urlparse,urllib
import urlresolver,yt
try:
import json
except:
import simplejson as json
from threading import Thread
BASE = 'http://www.couchtripper.com/forum2/page.php?page=3'
Sources = ['daclips','filehoot','allmyvideos','vids... | sanctuaryaddon/sanctuary | plugin.video.quantum/lib/comedy.py | Python | gpl-2.0 | 12,158 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# sans titre.py
#
# Copyright 2013 Florent Mercier <contact@florentmercier.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 ... | florentmercier/BtoVLE | src/main.py | Python | gpl-2.0 | 1,659 |
# !/usr/bin/pthon2
"""Preston-Tonks-Wallace Flow Stress Model
This module implements the PTW flow stress model
Authors
-------
- Stephen A. Andrews (SA)
- Diane E. Vaughan (DEV)
Version History
---------------
0.0: 13/05/2016 - Initial class creation
References
----------
[1] Preston, D. L.; Tonks, D. L. & Wall... | fraserphysics/F_UNCLE | F_UNCLE/Models/Ptw.py | Python | gpl-2.0 | 14,166 |
"""
WSGI config for server_admin project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATI... | KungFuLucky7/server_admin | server_admin/wsgi.py | Python | gpl-2.0 | 1,551 |
# Copyright (C) Schrodinger, LLC.
# All Rights Reserved
#
# For more information, see LICENSE in PyMOL's home directory.
#
# pymolhttpd.py
#
# web server interface for controlling PyMOL
# we make extensive use of Python's build-in in web infrastructure
import BaseHTTPServer, cgi, urlparse
import StringIO, socket
# w... | gratefulfrog/lib | python/web/pymolhttpd.py | Python | gpl-2.0 | 32,673 |
# Copyright (C) 2012 Canonical 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
# (at your option) any later version.
#
# This program is distributed in ... | jelmer/python-fastimport | fastimport/tests/test_dates.py | Python | gpl-2.0 | 1,135 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | iceman1989/Check_mk | web/plugins/userdb/ldap.py | Python | gpl-2.0 | 48,692 |
#!/usr/bin/python
import os
import re
import shutil
import sys
import tempfile
import time
import unittest
from clienttests import ClientConfigTests
from sitetests import SiteConfigTests
from arbtests import ArbitratorConfigTests
if __name__ == '__main__':
if os.geteuid() == 0:
sys.stderr.write("Mus... | krig/booth | test/runtests.py | Python | gpl-2.0 | 1,540 |
#!/usr/bin/env python
# Copyright 2015 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 ... | borisroman/vdsm | vdsm_hooks/ovs/ovs_before_network_setup_ip.py | Python | gpl-2.0 | 6,846 |
#!/usr/bin/env python
import time
class Timer(object):
def __init__(self, verbose=False):
self.verbose = verbose
def __enter__(self):
self.start = time.time()
return self
def __exit__(self, *args):
self.end = time.time()
self.secs = self.end - self.start
se... | yekeqiang/mypython | time_1.py | Python | gpl-2.0 | 438 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2001-2007 Donald N. Allingham
# Copyright (C) 2009-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
# the Free Software Foundation; either v... | dermoth/gramps | gramps/gui/views/navigationview.py | Python | gpl-2.0 | 17,924 |
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify it under
# the terms of the (LGPL) GNU Lesser General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distri... | candlepin/virt-who | tests/suds/test_reader.py | Python | gpl-2.0 | 4,360 |
#!/usr/bin/python
import os
import psycopg2
import sys
import django_content_type_mapping
file = open("/home/" + os.getlogin() + "/.pgpass", "r")
pgpasses = []
for line in file:
pgpasses.append(line.rstrip("\n").split(":"))
file.close()
for pgpass in pgpasses:
#print str(pgpass)
if pgpass[0] == "54.236.235.110"... | DOE-NEPA/geonode_2.0_to_2.4_migration | migrate_documents_document_modified.py | Python | gpl-2.0 | 2,363 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | PLyczkowski/Sticky-Keymap | 2.74/scripts/startup/bl_ui/properties_data_armature.py | Python | gpl-2.0 | 10,538 |
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
from mapstyle import style
maphtml = '''
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0... | Swordf1sh/Moderat | map_demo/test.py | Python | gpl-2.0 | 4,307 |
#!/usr/bin/python3
# Author: Yalcin Ozhabes
# email: yalcinozhabes@gmail.com
import copy
import time
import numpy as np
from mpi4py import MPI
from ase.calculators.calculator import Calculator, all_changes
from ase import Atoms
from ase.units import Bohr, Hartree
from JDFTxCalcCPU import JDFTxCalcCPU
try:
from J... | yalcinozhabes/pythonJDFTx | ElectronicMinimize.py | Python | gpl-2.0 | 9,552 |
import os
import sys
import xbmc
import xbmcplugin
import xbmcgui
class cConfig():
COUNT = 0
ERROR = []
def __check(self):
try:
import xbmcaddon
self.__bIsDharma = True
except ImportError:
self.__bIsDharma = False
def __init... | Brahimbaz/venom-xbmc-addons-beta | plugin.video.vstream/resources/lib/config.py | Python | gpl-2.0 | 6,593 |
# -*- coding: utf-8 -*-
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='historic_cadastre',
version='0.1',
description='SITN, a sitn project',
author='sitn... | kalbermattenm/historic_cadastre | setup.py | Python | gpl-2.0 | 1,011 |
#!/usr/bin/env python
###########################################################################
## ##
## Language Technologies Institute ##
## Carnegie Mellon University ... | leahrnh/ticktock_text_api | Backend.py | Python | gpl-2.0 | 4,516 |
###############################################################################
# #
# Copyright 2019. Triad National Security, LLC. All rights reserved. #
# This program was produced under U.S. Government contract 89233218CNA000001 #
... | CSD-Public/stonix | src/stonix_resources/solaris.py | Python | gpl-2.0 | 7,231 |
import os
import logging
from thug.ThugAPI.ThugAPI import ThugAPI
log = logging.getLogger("Thug")
class TestJQuerySamples(object):
cwd_path = os.path.dirname(os.path.realpath(__file__))
jquery_path = os.path.join(cwd_path, os.pardir, "samples/jQuery")
def do_perform_test(self, caplog, sample, expect... | buffer/thug | tests/functional/test_jquery.py | Python | gpl-2.0 | 8,746 |
#
# ttkiosk - table tennis club touch screen based kiosk.
# Copyright (C) 2009 Sergey Satskiy
#
# 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 op... | SergeySatskiy/ttkiosk | src/ui/1440x900/Logo.py | Python | gpl-2.0 | 3,995 |
# PyTransit: fast and easy exoplanet transit modelling in Python.
# Copyright (C) 2010-2019 Hannu Parviainen
#
# 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 Licen... | hpparvi/PyTransit | pytransit/contamination/__init__.py | Python | gpl-2.0 | 1,603 |
# -*- coding: utf-8 -*-
# Copyright (C) 2009 - Jesse van den Kieboom
# Copyright (C) 2012-2021 MATE Developers
#
# 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 Lic... | mate-desktop/pluma | plugins/quickopen/quickopen/popup.py | Python | gpl-2.0 | 17,500 |
from setuptools import setup
setup(
name='TogglViz',
version='0.1dev',
author='Marko Burjek',
packages=['togglviz', ],
scripts=['bin/fill.py', ],
license='LICENSE.txt',
long_description=open('README.txt').read(),
install_requires=[
"SQLAlchemy... | buma/TogglViz | setup.py | Python | gpl-2.0 | 438 |
import os
import pytest
from . import ofx
from .source_test import check_source_example
testdata_dir = os.path.realpath(
os.path.join(
os.path.dirname(__file__), '..', '..', 'testdata', 'source', 'ofx'))
examples = [
('test_vanguard_basic', 'vanguard.ofx'),
('test_vanguard_matching', 'vanguard.o... | jbms/beancount-import | beancount_import/source/ofx_test.py | Python | gpl-2.0 | 2,503 |
# Copyright (C) 2013 Codethink Limited.
#
# 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 distribute... | CodethinkLabs/python-consonant | consonant/register/__init__.py | Python | gpl-2.0 | 6,463 |
from social.pipeline.partial import partial
import logging
logger = logging.getLogger(__name__)
@partial
def save_profile(backend, user, response, *args, **kwargs):
print 'test2'
logger(backend)
logger(user)
logger(response)
if backend.name == 'facebook':
print backend
if backend.nam... | ppeczek/Politikon | accounts/pipeline.py | Python | gpl-2.0 | 358 |
# -*- coding: utf-8 -*-
from plone import api
from plone.app.mosaic import _
from zope.publisher.browser import BrowserView
import json
class MosaicUploadView(BrowserView):
"""Handle file uploads"""
def __call__(self):
context = self.context
request = self.request
# Set header to js... | plone/plone.app.mosaic | src/plone/app/mosaic/browser/upload.py | Python | gpl-2.0 | 3,388 |
import threading
import pprint
import json
from bottle import route, run, Bottle
class Rest_Server(Bottle):
'''The REST front end'''
def __init__(self, core):
super(Rest_Server, self).__init__()
self._core = core
self.route('/plms', callback=self.list_plms)
def st... | krkeegan/lib-py-insteon | insteon/rest_server.py | Python | gpl-2.0 | 1,792 |
#
# This file is part of TSmells
#
# TSmells 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.
#
# TSmells is distributed in the hope ... | carvalhomb/tsmells | src/dump/DuplicatedCode.py | Python | gpl-2.0 | 17,214 |
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2015, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
#####################################... | vholer/zenpacklib | tests/data/zenpacks/ZenPacks.zenoss.ZPLTest1/ZenPacks/zenoss/ZPLTest1/__init__.py | Python | gpl-2.0 | 540 |
from .data_action_item_model_wrapper import DataActionItemModelWrapper
| botswana-harvard/edc-data-manager | edc_data_manager/model_wrappers/__init__.py | Python | gpl-2.0 | 71 |
#
# Copyright (c) 2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the im... | Katello/grinder | src/grinder/KickstartFetch.py | Python | gpl-2.0 | 3,746 |
#!/usr/bin/env python
# Copyright 2012 (C) Mickael Menu <mickael.menu@gmail.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 2 of the License, or
# (at your option) any lat... | fredokun/TikZ-Editor | setup.py | Python | gpl-2.0 | 1,449 |
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the users index") | stacksync/manager | users/views.py | Python | gpl-2.0 | 125 |
import os
import plotly.plotly as py
from plotly.graph_objs import *
import config
py.sign_in(config.plotly_user, config.plotly_pass)
dates = []
count_dates = []
counts = []
hours = []
with open(os.path.normpath(config.filename), 'r') as f:
rows = f.readlines()
# get summary of dates in file
for line in ro... | darrenwatt/steam_tracker | create_hour_per_day_chart.py | Python | gpl-2.0 | 1,342 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 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; either version 2 of t... | Dziolas/invenio | modules/miscutil/lib/htmlutils.py | Python | gpl-2.0 | 37,499 |
import math
from .fingerprint import Fingerprint
class Diff(Fingerprint):
def trans_func_(self, row):
'''
F. Dong, Y. Chen, J. Liu, Q. Ning, and S. Piao, "A Calibration-free
localiztion solution for handling signal strength variance", in
MELT (Berlin, Heidelberg), pp. 79-90, Sprin... | rloliveirajr/sklearn_transformers | trans4mers/feature_extraction/diff.py | Python | gpl-2.0 | 634 |
# DNF/rpm software payload management.
#
# Copyright (C) 2019 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is ... | atodorov/anaconda | pyanaconda/payload/dnf/payload.py | Python | gpl-2.0 | 71,993 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Brian G. Matherly
#
# 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 optio... | pmghalvorsen/gramps_branch | gramps/cli/user.py | Python | gpl-2.0 | 6,799 |
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
# Check opcodes in ARGUS assembly source
#
# A script that uses the arguscard classes to read ARGUS assembly format source
# and check for invalid opcodes.
#
# This is intended for debugging assembler development.
import sys
from optparse import OptionParser
from c... | jimlawton/h800 | tools/check-instructions.py | Python | gpl-2.0 | 5,065 |
#!/usr/bin/python
from mininet.net import Mininet
from mininet.node import Controller, RemoteController
from mininet.cli import CLI
from mininet.log import setLogLevel, info
import time
import os
import subprocess
import csv
import StringIO
import iptc
HOSTS = 3
p1_log = open('logs-example/log.p1.txt', 'w')
p2_log... | ardhipoetra/SDN-workbench | sch3.py | Python | gpl-2.0 | 3,578 |
# -*- 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 field 'ArtistMedia.is_default_image'
db.add_column(u'artist_artistmedia', 'is_default_image',
... | hcwiley/the-front | the_front/the_front/artist/migrations/0003_auto__add_field_artistmedia_is_default_image.py | Python | gpl-2.0 | 5,455 |
#coding=utf-8
import sys
import os
import time
from shutil import *
def backup_db(dirname):
assert os.path.isdir(dirname),"not dirname"
for root,dirs,filenames in os.walk(dirname):
#print root,dirs,filenames
for filename in filenames:
filename = os.path.join(root,filename)
... | sundream/shell | backup_db.py | Python | gpl-2.0 | 896 |
#!/usr/bin/python
# Format of each line is:
# date\ttime\tstore name\titem description\tcost\tmethod of payment
#
# We want elements 2 (store name) and 4 (cost)
# We need to write them out to standard output, separated by a tab
import sys
for line in sys.stdin:
data = line.strip().split(" ")
if len(data) > 1... | ForrestSutton/udchadoop | code/mapperWeb3.py | Python | gpl-2.0 | 383 |
from django.db import models
from simple_history.models import HistoricalRecords as AuditTrail
from edc_base.model.models import BaseUuidModel
from getresults_order.models import Utestid, OrderPanel
class SenderModel(BaseUuidModel):
"""A class for the model or make of a sending device, e.g. FACSCalibur."""
... | botswana-harvard/getresults-sender | getresults_sender/models.py | Python | gpl-2.0 | 2,764 |
from django.contrib import admin
from layerdefinitions.models import LayerDefinition, Review
class LayerDefinitionInline(admin.TabularInline):
model = Review
list_display = ('review_date', 'comment', 'reviewer')
@admin.register(LayerDefinition)
class LayerDefinitionAdmin(admin.ModelAdmin):
inlines = [La... | qgis/QGIS-Django | qgis-app/layerdefinitions/admin.py | Python | gpl-2.0 | 618 |
# ####################################################################
# gofed - set of tools to automize packaging of golang devel codes
# Copyright (C) 2014 Jan Chaloupka, jchaloup@redhat.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licen... | piotr1212/gofed | inspecttarball.py | Python | gpl-2.0 | 4,610 |
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004-2006 Donald N. Allingham
#
# 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 t... | arunkgupta/gramps | gramps/gen/datehandler/_date_es.py | Python | gpl-2.0 | 6,538 |
# -*- coding: utf-8 -*-
'''
Created on 2014/07/04
@author: deadblue
'''
import string
import urllib2
import os
__all__ = ['StringPart', 'FilePart', 'FileDataPart', 'MultipartRequest']
def _create_boundary():
import random
buf = ['----']
for _ in xrange(16):
buf.append(random.choice(string.ascii_... | deadblue/baidupan_shell | baidupan/http.py | Python | gpl-2.0 | 2,445 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# valid.py - Copyright (C) 2012 Red Hat, Inc.
# Written by Fabian Deutsch <fabiand@redhat.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; versi... | ChinaMassClouds/copenstack-server | deploy/src/mplatform/utils/valid.py | Python | gpl-2.0 | 17,630 |
### Author: Bert de Bruijn <bert+dstat$debruijn,be>
### VMware ESX kernel vmknic stats
### Displays VMkernel port statistics on VMware ESX servers
# NOTE TO USERS: command-line plugin configuration is not yet possible, so I've
# "borrowed" the -N argument.
# EXAMPLES:
# # dstat --vmknic -N vmk1
# You can even combine... | dagwieers/dstat | plugins/dstat_vmk_nic.py | Python | gpl-2.0 | 2,648 |
"""
_meta.py
@author: byteface
"""
class _meta(object):
"""
parser to the meta.json on each object
"""
# TODO - may get rid in favour of a config obj with regular python vars. setup on the commands
path=None
data=None
def __init__( self, path ):
""" meta for each object. initialised by Program pa... | byteface/sing | core/_meta.py | Python | gpl-2.0 | 742 |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- http://www.mdanalysis.org
# Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
... | kain88-de/mdanalysis | testsuite/MDAnalysisTests/coordinates/test_pqr.py | Python | gpl-2.0 | 7,667 |
########################################################################
# Copyright (C) 2013 Sol Birnbaum
#
# 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 Licen... | solbirn/pyActiveSync | pyActiveSync/utils/wbxml.py | Python | gpl-2.0 | 12,682 |
# -*- coding: utf-8 -*-
# Copyright 2016 Christoph Reiter
#
# 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.
"""Code for... | elbeardmorez/quodlibet | quodlibet/quodlibet/formats/_serialize.py | Python | gpl-2.0 | 6,347 |
# coding:utf-8
import numpy as np
def calcShannonEnt(dataSet):
numEntries=len(dataSet)
labelCounts={}
for fectureVec in dataSet:
currentLabel=fectureVec[-1]
if currentLabel not in labelCounts.keys():
labelCounts[currentLabel]=0
labelCounts[currentLabel]+=1
shannonEnt... | linpingchuan/misc | python/ml/book1/ch5/DecisionTree1.py | Python | gpl-2.0 | 3,331 |
"Run all tests"
# Copyright (C) 2007-2011 Anders Logg
#
# This file is part of DOLFIN.
#
# DOLFIN 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 of the License, or
# (at your option) ... | MiroK/DolfinSurface | test/test.py | Python | gpl-3.0 | 1,521 |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | viranch/exodus | resources/lib/sources/ymovies.py | Python | gpl-3.0 | 8,937 |
import numpy as np
from numpy import array, dot, empty, exp, eye, log, multiply, sqrt, zeros
from numpy.random import rand
from scipy.linalg import eigvalsh, eigh
from numpy.linalg import det, inv
# sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
# import os
# import sys
# from Utils.Da... | sylvchev/PyRiemannEigen | pyriemann/utils/CovMat.py | Python | gpl-3.0 | 10,982 |
#!usr/bin/python
try:
f = open("link.txt","r")
except IOError:
print "ERROR!\n"
exit
o = open("download_all_files.sh","w")
for line in f:
if len(line)==0:
continue
file_name = line.split("/")
file_name = file_name[len(file_name)-1]
file_name = "\""+file_name[:len(file_name)-1]+".mp4\... | lawki/get_flash_videos_assembler | create_exec_.py | Python | gpl-3.0 | 628 |
#!/usr/bin/env python3
"""
sumton.py : compute the sum of 0 through N
Copyright (C) Simon D. Levy 2016
This file is part of ISCPP.
ISCPP 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... | simondlevy/ISCPP | Chapter08/sumton.py | Python | gpl-3.0 | 926 |
# -*- coding: utf-8 -*-
import netaddr
from opinel.utils.aws import get_name
from opinel.utils.globals import manage_dictionary
from opinel.utils.fs import load_data, read_ip_ranges
from AWSScout2.utils import ec2_classic, get_keys
from AWSScout2.configs.regions import RegionalServiceConfig, RegionConfig
from AWSSc... | SecurityFTW/cs-suite | tools/Scout2/AWSScout2/services/vpc.py | Python | gpl-3.0 | 7,331 |
"""
WSGI config for GiftCircle project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | jstitch/gift_circle | GiftCircle/GiftCircle/wsgi.py | Python | gpl-3.0 | 397 |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import formatdate, getdate
class Overla... | ESS-LLP/erpnext | erpnext/hr/doctype/shift_request/shift_request.py | Python | gpl-3.0 | 3,610 |
def func1(param1):
"""Function 1
with 1 param
@param param1: 1st parameter
@type param1: type
@return: None
"""
return None
def func2(param1, param2):
"""Function 2
with 2 params
@param param1: 1st parameter
@type param1: type
@param param2: 2nd parameter
"""
... | dadadel/pyment | tests/docs_already_javadoc.py | Python | gpl-3.0 | 329 |
r'''
This example demonstrates the crease pattern factory usage
for MiuraOri crease pattern.
This crease pattern contains quadrilateral facets.
A quadrilateral facet is assembled out of two triangles
connected with a no-fold-line.
'''
def create_cp():
# begin
from oricreate.api import MiuraOriCPFactory
... | simvisage/oricreate | docs/howtos/ex03_cp_factories/miura_ori_factory.py | Python | gpl-3.0 | 596 |
# Shawn Jain
# Python script to generate LUT for BCD.v
for i in range(100):
print str(i) + ': begin ' + 'ones <= ' + str(i%10) + '; ' + 'tens <= ' + str(i/10) + ';' + ' end'
print 'default: begin ones <= 0; tens <= 0; end' | gajjanag/6111_Project | assets/binaryToDecimal.py | Python | gpl-3.0 | 224 |
# per-module import for actioninja
# standard imports
import sys # for tracebaks in on_error.
import json # to load the config file.
import traceback # also used to print tracebacks. I'm a lazy ass.
import asyncio # because we're using the async branch of discord.py.
from random import choice # for choosing game ids
... | Orangestar12/cacobot | main.py | Python | gpl-3.0 | 6,389 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-09-21 18:40
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import smart_selects.db_fields
class Migration(migrations.Migration):
dependencies = [
('core', '0018_auto_20180921_1... | interlegis/saap | saap/core/migrations/0019_auto_20180921_1540.py | Python | gpl-3.0 | 943 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import config_sites
author = "Sven Fischer"
email = "wannaberss@linux4tw.de"
version = "0.1.0"
credits = ["Sven Fischer"]
rss_base_url = config_sites.deploy_base_url
sites = config_sites.sites
max_rss_items = 10
max_site_caches = max_rss_items + 1 # if there more, lates... | Strubbl/dinorss | config.py | Python | gpl-3.0 | 483 |
from bitfund.project.views.budget_view import *
from bitfund.project.views.budget_crud import *
from bitfund.project.views.claims import *
from bitfund.project.views.goals import *
from bitfund.project.views.charts import *
from bitfund.project.views.budget_ajax_logo_upload import * | alexykot/bitfund | bitfund/project/views/__init__.py | Python | gpl-3.0 | 288 |
"""Controllers for the mozzarella application."""
| ColoradoSchoolOfMines/acm-website | mozzarella/controllers/__init__.py | Python | gpl-3.0 | 50 |
# Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov
#
# 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 rights to use, copy... | pymedusa/SickRage | lib/unrar2/windows.py | Python | gpl-3.0 | 12,977 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Thomas Amland
#
# 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 ... | tamland/trakt-sync | xbmc_library.py | Python | gpl-3.0 | 4,438 |
import limp.syntax_tree as SyntaxTree
import limp.tokens as Tokens
from nose.tools import assert_equals
TT = SyntaxTree.Types
data = [
([], None),
# Booleans
('true', (TT.Boolean, 'true')),
('false', (TT.Boolean, 'false')),
# Integers
('100', (TT.Integer, '100')),
('500', (TT.Integer,... | byxor/limp | tests/unit/syntax_tree_test.py | Python | gpl-3.0 | 14,784 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2017 Michal Čihař <michal@cihar.com>
# Copyright © 2015 Philipp Wolfer <ph.wolfer@gmail.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lice... | lem9/weblate | weblate/trans/tests/test_angularjs_checks.py | Python | gpl-3.0 | 3,835 |
#!/usr/bin/env python3
# Copyright 2017-2018 Clayton Smith
#
# This file is part of bbhn-utils
#
# bbhn-utils 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, or (at your option)
# any later ... | argilo/bbhn-utils | nodeinfo.py | Python | gpl-3.0 | 1,671 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import re
import os
import sys
from inspect import isclass
class Extend(object):
def __init__(self, **kwargs):
self.lang = kwargs["lang"]
self.override = kwargs["over"]
self.name = kwargs["name_"]
self.obj = kwargs["obj_"]
def extend(language=None, override=None, ... | lheido/lheidoEdit | extend.py | Python | gpl-3.0 | 2,501 |
'''
Copyright 2010 - Greg Hellings
This file is part of the Automated FTP Dominator.
The Automated FTP Dominator 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.
The... | greg-hellings/Automated-FTP-Dominator | gui/window.py | Python | gpl-3.0 | 9,748 |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo
class XFileSharingProFolder(XFSCrypter):
__name__ = "XFileSharingProFolder"
__type__ = "crypter"
__version__ = "0.14"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?(?:\... | joberreiter/pyload | module/plugins/crypter/XFileSharingProFolder.py | Python | gpl-3.0 | 2,857 |
from .interfaces import IWheel
__author__ = 'sighalt'
class MichelinWheel(IWheel):
pass
| sighalt/pyhooker | examples/example_classes/wheel.py | Python | gpl-3.0 | 95 |
import binascii
from cryptography.hazmat.primitives import hmac
from cryptography.hazmat.primitives.hashes import SHA1
from cryptography.hazmat.primitives.constant_time import bytes_eq
import cryptography.hazmat.backends
from django.conf import settings
from django.core.mail import send_mail
from django.http import Htt... | weargoggles/jwt-oauth-test | project/hooks/views.py | Python | gpl-3.0 | 995 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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... | bastibl/gnuradio | gr-zeromq/python/zeromq/qa_zeromq_pubsub.py | Python | gpl-3.0 | 2,008 |
import os
import sys
import time
import math
import networkx
import ptnet
import pes
import sat
import z3
from util import *
from log import *
from folding import *
from pod import *
def test1 () :
n = ptnet.net.Net (True)
n.read (sys.stdin, 'pnml')
n.write (sys.stdout, 'pnml')
def test2 () :
u = p... | nojero/pod | src/pod/test.py | Python | gpl-3.0 | 12,327 |
# -*- coding: utf-8 -*-
#
# Yaafe
#
# Copyright (c) 2009-2010 Institut Télécom - Télécom Paristech
# Télécom ParisTech / dept. TSI
#
# Author : Benoit Mathieu
#
# This file is part of Yaafe.
#
# Yaafe is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License a... | swaroopgj/Yaafe | src_python/yaafelib/__init__.py | Python | gpl-3.0 | 3,159 |
#!/usr/bin/env python3
# This file is a part of Templ
# Copyright (C) 2012 Zachary Dziura
#
# 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... | jncormier24/Templ | templ/parser.py | Python | gpl-3.0 | 4,028 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Artista',
fields=[
('id', models.AutoField(verb... | nicolas471/Lecole | main/migrations/0001_initial.py | Python | gpl-3.0 | 2,971 |
#
# Tools, DB, and plagiarism...
# DO NOT USE, this is the old lib...
assert False, "PLEASE DO NOT USE THIS OLD LIB"
from sys import platform
import os
import tokenize
import token
import keyword
import builtins
import io
import ctypes
from itertools import permutations
from multiprocessing import Queue, Process, L... | Miaou/PyPlagia | oldLibPlagia.py | Python | gpl-3.0 | 26,604 |
#!/usr/bin/python
# This script generates a list of testsuites that should be run as part of
# the Samba test suite.
# The output of this script is parsed by selftest.pl, which then decides
# which of the tests to actually run. It will, for example, skip all tests
# listed in selftest/skip or only run a subset during ... | SpectraLogic/samba | selftest/tests.py | Python | gpl-3.0 | 4,687 |
"""Implementation of IIIF Image API manipulations using the Python Image Library.
Uses the Python Image Library (PIL) for in-python manipulation:
http://www.pythonware.com/products/pil/index.htm
"""
import re
import os
import os.path
import subprocess
import tempfile
from PIL import Image
from .error import IIIFErr... | zimeon/iiif | iiif/manipulator_pil.py | Python | gpl-3.0 | 7,627 |
# Copyright 2014-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... | chrislit/abydos | tests/phonetic/test_phonetic_soundex.py | Python | gpl-3.0 | 6,370 |
import operator
import os
import shutil
import tempfile
import unittest
import warnings
import tables
from mock import Mock
from numpy import array
from numpy.testing import assert_array_equal
from sapphire.analysis import process_events
TEST_DATA_FILE = 'test_data/process_events.h5'
DATA_GROUP = '/s501'
class Pr... | HiSPARC/sapphire | sapphire/tests/analysis/test_process_events.py | Python | gpl-3.0 | 15,851 |
__author__ = 'zardosht'
| zardosht/strucWrite | test/__init__.py | Python | gpl-3.0 | 24 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you ... | 3n73rp455/api | manage.py | Python | gpl-3.0 | 535 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("delft3dworker", "0058_container_task_starttime"),
]
operations = [
migrations.AlterField(
... | openearth/delft3d-gt-server | delft3dworker/migrations/0059_auto_20160830_1304.py | Python | gpl-3.0 | 490 |
# GeneaCrystal Copyright (C) 2012-2013
# Christian Jaeckel, <christian.doe@gmail.com>
# Frederic Kerber, <fkerber@gmail.com>
# Pascal Lessel, <maverickthe6@gmail.com>
# Michael Mauderer, <mail@michaelmauderer.de>
#
# GeneaCrystal is free software: you can redistribute it and/or modify
# it under the ... | MichaelMauderer/GeneaCrystal | geneacrystal/nodes.py | Python | gpl-3.0 | 10,098 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.