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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# Watermarks documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 8 16:49:39 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | vladozc/watermarks | doc/source/conf.py | Python | gpl-2.0 | 8,359 |
#!/usr/bin/env python
"""
Grid time
=============
"""
from datetime import timedelta
import numpy as np
from opendrift.readers import reader_global_landmask
from opendrift.readers import reader_netCDF_CF_generic
from opendrift.models.oceandrift import OceanDrift
# Seeding at a grid at regular interval
o = OceanDrift(... | OpenDrift/opendrift | examples/example_grid_time.py | Python | gpl-2.0 | 1,348 |
# Copyright (c) 2010-2015 openpyxl
# package imports
from openpyxl.reader.strings import read_string_table
from openpyxl.tests.helper import compare_xml
def test_read_string_table(datadir):
datadir.join('reader').chdir()
src = 'sharedStrings.xml'
with open(src) as content:
assert read_string_ta... | maheshcn/memory-usage-from-ldfile | openpyxl/tests/test_strings.py | Python | gpl-2.0 | 1,270 |
# simpleSound.py
# Plays audio files on Linux and Windows.
# Written Jan-2008 by Timothy Weber.
# Based on (reconstituted) code posted by Bill Dandreta at <http://www.velocityreviews.com/forums/t337346-how-to-play-sound-in-python.html>.
import platform
if platform.system().startswith('Win'):
from winsound import ... | teejaydub/khet | simpleSound.py | Python | gpl-2.0 | 1,290 |
# -*- coding: utf-8 -*-
# Copyright 2011 Christoph Reiter <reiter.christoph@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) an... | elbeardmorez/quodlibet | quodlibet/quodlibet/ext/events/inhibit.py | Python | gpl-2.0 | 2,526 |
#!/usr/bin/env python
#
# testlibbind_ns_msg.py - Unit tests for the libbind ns_msg wrapper
#
# This file is part of Strangle.
#
# Strangle 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... | jhs/strangle | test/testlibbind_ns_msg.py | Python | gpl-2.0 | 2,294 |
#! /usr/bin/env python3
'''
given a list of stock price ticks for the day, can you tell me what
trades I should make to maximize my gain within the constraints of the
market? Remember - buy low, sell high, and you can't sell before you
buy.
Sample Input
19.35 19.30 18.88 18.93 18.95 19.03 19.00 18.97 18.97 18.98
'''... | benosment/daily-exercises | easy-249.py | Python | gpl-2.0 | 1,302 |
################################################################
# LiveQ - An interactive volunteering computing batch system
# Copyright (C) 2013 Ioannis Charalampidis
#
# 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 ... | wavesoft/LiveQ | liveq-jobmanager/jobmanager/io/teamqueue.py | Python | gpl-2.0 | 1,361 |
import random
import time
from flask import (
request,
session,
flash,
redirect,
url_for,
Response,
render_template,
)
from NossiPack.Cards import Cards
from NossiPack.User import Userlist
from NossiPack.VampireCharacter import VampireCharacter
from NossiPack.krypta import DescriptiveError... | x4dr/NossiNet | NossiSite/extra.py | Python | gpl-2.0 | 9,041 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2010 Zuza Software Foundation
#
# This file is part of Virtaal.
#
# 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 ... | elric/virtaal-debian-snapshots | virtaal/plugins/autocompletor.py | Python | gpl-2.0 | 10,937 |
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de>
#
# This library is free software; you ca... | nrgaway/qubes-core-admin | qubes/vm/templatevm.py | Python | gpl-2.0 | 4,118 |
# Copyright (C) 2005, Giovanni Bajo
# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, 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... | pdubroy/kurt | build/MacOS/PyInstaller/pyinstaller-svn-r812/hooks/hook-carchive.py | Python | gpl-2.0 | 1,029 |
#!/usr/bin/env python3
import sys
import os
sys.path.append(os.path.realpath("."))
import unittest
import cleanstream
import tagger
import pretransfer
import transfer
import interchunk
import postchunk
import adaptdocx
if __name__ == "__main__":
os.chdir(os.path.dirname(__file__))
failures = 0
for modul... | unhammer/apertium | tests/run_tests.py | Python | gpl-2.0 | 744 |
#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# 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... | odahoda/noisicaa | noisicaa/core/ipc_perftest.py | Python | gpl-2.0 | 1,459 |
import glob
import fnmatch
import itertools
import logging
import os
import re
import six
import sys
import yaml
from .dockerfile import Dockerfile
from .image import ImageBuilder
from .config import Config
class Builder(object) :
def __init__(self, config=None, **kwds) :
self.logger = logging.getLogger... | tjamet/dynker | dynker/builder.py | Python | gpl-2.0 | 6,135 |
##
## Copyright 2007, Red Hat, Inc
## see AUTHORS
##
## This software may be freely redistributed under the terms of the GNU
## general public license.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave... | pombredanne/func | func/minion/modules/func_module.py | Python | gpl-2.0 | 4,487 |
import math as mth
import numpy as np
#----------------------
# J Matthews, 21/02
# This is a file containing useful constants for python coding
#
# Units in CGS unless stated
#
#----------------------
#H=6.62606957E-27
HEV=4.13620e-15
#C=29979245800.0
#BOLTZMANN=1.3806488E-16
VERY_BIG=1e50
H=6.6262e-27
HC=1.98587e-... | jhmatthews/panlens | constants.py | Python | gpl-2.0 | 1,157 |
def format_path( str ):
while( str.find( '//' ) != -1 ):
str = str.replace( '//', '/' )
return str
| tencent-wechat/phxsql | phxrpc_package_config/tools/phxsql_utils.py | Python | gpl-2.0 | 103 |
#!/usr/bin/env python3
# Copyright (c) 2008-9 Qtrac Ltd. All rights reserved.
# This program or module 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
# version 3 of the Lic... | paradiseOffice/Bash_and_Cplus-plus | CPP/full_examples/pyqt/chap03/item.py | Python | gpl-2.0 | 3,660 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author: Will
"""
from django import forms
from app01 import models
class ImportFrom(forms.Form):
HOST_TYPE=((1,"001"),(2,"002")) #替換爲文件
host_type = forms.IntegerField(
widget=forms.Select(choices=HOST_TYPE)
)
hostname = f... | willre/homework | day19/web/app01/forms/home.py | Python | gpl-2.0 | 723 |
# Portions 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.
# match.py - filename matching
#
# Copyright 2008, 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distribute... | facebookexperimental/eden | eden/hg-server/edenscm/mercurial/match.py | Python | gpl-2.0 | 53,143 |
import numpy as np
from OpenGL.GL import *
from OpenGL.GLU import *
import time
import freenect
import calibkinect
import pykinectwindow as wxwindow
# I probably need more help with these!
try:
TEXTURE_TARGET = GL_TEXTURE_RECTANGLE
except:
TEXTURE_TARGET = GL_TEXTURE_RECTANGLE_ARB
if not 'win' in globals():
... | Dining-Engineers/left-luggage-detection | misc/demo/ipython/demo_pclview.py | Python | gpl-2.0 | 5,742 |
import re
p = re.compile(r'(\w+) (\w+)(?P<sign>.*)', re.DOTALL)
print re.DOTALL
print "p.pattern:", p.pattern
print "p.flags:", p.flags
print "p.groups:", p.groups
print "p.groupindex:", p.groupindex
| solvery/lang-features | python/use_lib/re.4.py | Python | gpl-2.0 | 204 |
from models import Connection
from django import forms
class ConnectionForm(forms.ModelForm):
class Meta:
model = Connection
exclude = ('d_object_id',)
| CIGNo-project/CIGNo | cigno/mdtools/forms.py | Python | gpl-3.0 | 173 |
# -*- coding: utf-8 -*-
# pylint: disable=too-many-lines,too-complex,too-many-branches
# pylint: disable=too-many-statements,arguments-differ
# needs refactoring, but I don't have the energy for anything
# more than a superficial cleanup.
#-------------------------------------------------------------------------------
... | nihlaeth/voicetrainer | voicetrainer/midi.py | Python | gpl-3.0 | 42,017 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | ctrlaltdel/neutrinator | vendor/openstack/tests/unit/cloud/test_volume.py | Python | gpl-3.0 | 22,754 |
#!/usr/bin/python
from django.http import HttpResponse
from django.template import RequestContext, loader
from django.views.decorators.csrf import csrf_exempt
import django.shortcuts
from wlokalu.api import presence
#-----------------------------------------------------------------------------
from wlokalu.logging ... | HackerspaceWroclaw/wlokalu | wlokalu/views.py | Python | gpl-3.0 | 1,663 |
from urllib.request import urlopen
from urllib.parse import urlparse, parse_qs
from socket import error as SocketError
import errno
from bs4 import BeautifulSoup
MAX_PAGES_TO_SEARCH = 3
def parse_news(item):
'''Parse news item
return is a tuple(id, title, url)
'''
url = 'http://www.spa.gov.sa' + item[... | saudisproject/saudi-bots | bots/spa.py | Python | gpl-3.0 | 4,254 |
import time
from threading import Thread
import threading
from wtfj_ids import *
from wtfj_utils import *
class Printer:
''' Opens a new output window and prints messages sent to it '''
def __init__(self,header=''):
self._header = header
def send(self,string):
print(self._header+string)
class Console:
''' Al... | WritingTechForJarrod/app | src/wtfj/connectors_local.py | Python | gpl-3.0 | 2,202 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-03 08:56
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... | DomDomPow/snapventure | snapventure-backend/snapventure/migrations/0005_auto_20161103_0856.py | Python | gpl-3.0 | 1,892 |
import os
import re
import subprocess
# Copied from Trojita
"""Fetch the .po files from KDE's SVN for GCompris
Run me from GCompris's top-level directory.
"""
SVN_PATH = "svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5/"
SOURCE_PO_PATH = "/messages/kdereview/gcompris_qt.po"
OUTPUT_PO_PATH = "./po/"
OUTPUT_PO_PATTERN ... | siddhism/GCompris-qt | tools/l10n-fetch-po-files.py | Python | gpl-3.0 | 1,862 |
#! /usr/bin/python
from xml.sax.saxutils import escape
import re
def ConvertDiagnosticLineToSonqarqube(item):
try:
id, line, message, source_file = GetDiagnosticFieldsFromDiagnosticLine(item)
WriteDiagnosticFieldsToFile(id, line, message, source_file)
except:
print 'Cant parse line {}'... | deadloko/ClangCompilerWarningsToSonarQubeRules | report_converter.py | Python | gpl-3.0 | 1,862 |
#!/usr/bin/env python
import os
import tempfile
import pipes
import subprocess
import time
import random
import shutil
try:
from wand.image import Image
from wand.display import display
except ImportError as e:
# cd /usr/lib/
# ln -s libMagickWand-6.Q16.so libMagickWand.so
print("Couldn't import Wand packag... | wazari972/WebAlbums | WebAlbums-FS/WebAlbums-Utils/Photowall/photowall.py | Python | gpl-3.0 | 15,846 |
import time
from datetime import datetime
from pydoc import locate
from unittest import SkipTest
from countries_plus.models import Country
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.test import override_settings, tag
fro... | ESSolutions/ESSArch_Core | ESSArch_Core/tags/tests/test_search.py | Python | gpl-3.0 | 22,665 |
# Copyright (C) 2012 Statoil ASA, Norway.
#
# The file 'enkf_node.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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... | iLoop2/ResInsight | ThirdParty/Ert/devel/python/python/ert/enkf/data/enkf_node.py | Python | gpl-3.0 | 3,730 |
#coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_A_SUBJECT_D002015').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
sc.... | cysuncn/python | spark/crm/PROC_A_SUBJECT_D002015.py | Python | gpl-3.0 | 3,179 |
from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empty(1024, dtype=[('Position', ('f8', 3)), ('Mass', 'f8')]... | nickhand/nbodykit | nbodykit/source/catalog/tests/test_file.py | Python | gpl-3.0 | 4,337 |
"""1.5 : Migrating work unity
Revision ID: 1212f113f03b
Revises: 1f07ae132ac8
Create Date: 2013-01-21 11:53:56.598914
"""
# revision identifiers, used by Alembic.
revision = '1212f113f03b'
down_revision = '1f07ae132ac8'
from alembic import op
import sqlalchemy as sa
UNITIES = dict(NONE="",
HOUR=u"h... | CroissanceCommune/autonomie | autonomie/alembic/versions/1_5_migrating_work_u_1212f113f03b.py | Python | gpl-3.0 | 2,158 |
from math import ceil
import numpy as np
from ipywidgets import widgets
from tqdm.notebook import tqdm
from matplotlib import pyplot as plt
import lib.iq_mixer_calibration
from drivers import IQAWG
from lib.data_management import load_IQMX_calibration_database, \
save_IQMX_calibration
from lib.iq_mixer_calibratio... | vdrhtc/Measurement-automation | drivers/IQVectorGenerator.py | Python | gpl-3.0 | 12,060 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Andrew Kofink <ajkofink@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 3 of the License, or
# (at your option) ... | ATIX-AG/foreman-ansible-modules | plugins/modules/subscription_manifest.py | Python | gpl-3.0 | 5,027 |
# coding: utf-8
# Copyright (C) 2017 Open Path View, Maison Du Libre
# 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.
# ... | OpenPathView/batchPanoMaker | opv_import/model/camera_set_partition.py | Python | gpl-3.0 | 1,341 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
add word counts to Cornetto lexical units database file
The word count file should have three columns, delimited by white space,
containing (1) the count, (2) the lemma, (3) the main POS tag.
The tagset is assumed to be the Spoken Dutch Corpus tagset,
and the characte... | emsrc/pycornetto | bin/cornetto-add-counts.py | Python | gpl-3.0 | 4,585 |
# Copyright © 2016 Lars Peter Søndergaard <lps@chireiden.net>
# Copyright © 2016 FichteFoll <fichtefoll2@googlemail.com>
#
# This file is part of Shanghai, an asynchronous multi-server IRC bot.
#
# Shanghai is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | chireiden/shanghai | tests/test_event.py | Python | gpl-3.0 | 15,979 |
#!/usr/bin/env python3
from heapq import heapify, heappop, heappush
with open('NUOC.INP') as f:
m, n = map(int, f.readline().split())
height = [[int(i) for i in line.split()] for line in f]
queue = ([(h, 0, i) for i, h in enumerate(height[0])]
+ [(h, m - 1, i) for i, h in enumerate(height[-1])]
... | McSinyx/hsg | others/other/nuoc.py | Python | gpl-3.0 | 941 |
""" Loads hyperspy as a regular python library, creates a spectrum with random numbers and plots it to a file"""
import hyperspy.api as hs
import numpy as np
import matplotlib.pyplot as plt
s = hs.signals.Spectrum(np.random.rand(1024))
s.plot()
plt.savefig("testSpectrum.png")
| to266/hyperspy | examples/hyperspy_as_library/minimal_example.py | Python | gpl-3.0 | 280 |
import inspect
import re
import pytest
from robottelo.logging import collection_logger as logger
IMPORTANCE_LEVELS = []
def pytest_addoption(parser):
"""Add CLI options related to Testimony token based mark collection"""
parser.addoption(
'--importance',
help='Comma separated list of import... | jyejare/robottelo | pytest_plugins/testimony_markers.py | Python | gpl-3.0 | 5,447 |
from feeluown.utils.dispatch import Signal
from feeluown.gui.widgets.my_music import MyMusicModel
class MyMusicItem(object):
def __init__(self, text):
self.text = text
self.clicked = Signal()
class MyMusicUiManager:
"""
.. note::
目前,我们用数组的数据结构来保存 items,只提供 add_item 和 clear 方法。
... | cosven/FeelUOwn | feeluown/gui/uimodels/my_music.py | Python | gpl-3.0 | 980 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto 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 Softw... | emsrc/pycornetto | bin/cornetto-client.py | Python | gpl-3.0 | 6,265 |
#from moderation import moderation
#from .models import SuccessCase
#moderation.register(SuccessCase)
| djangobrasil/djangobrasil.org | src/djangobrasil/success_cases/moderator.py | Python | gpl-3.0 | 104 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Satpy developers
#
# This file is part of satpy.
#
# satpy 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... | pytroll/satpy | utils/fetch_avhrr_calcoeffs.py | Python | gpl-3.0 | 4,773 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: git
autho... | dmsimard/ansible | lib/ansible/modules/git.py | Python | gpl-3.0 | 53,677 |
# -*- coding: utf-8 -*-
#
# Stetl documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 2 11:01:36 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | justb4/stetl | docs/conf.py | Python | gpl-3.0 | 7,939 |
def plotHistory(plot_context, axes):
"""
@type axes: matplotlib.axes.Axes
@type plot_config: PlotConfig
"""
plot_config = plot_context.plotConfig()
if (
not plot_config.isHistoryEnabled()
or plot_context.history_data is None
or plot_context.history_data.empty
):
... | joakim-hove/ert | ert_gui/plottery/plots/history.py | Python | gpl-3.0 | 771 |
# -*- coding: UTF-8 -*-
"""
Desc: django util.
Note:
---------------------------------------
# 2016/04/30 kangtian created
"""
from hashlib import md5
def gen_md5(content_str):
m = md5()
m.update(content_str)
return m.hexdigest()
| tiankangkan/paper_plane | k_util/hash_util.py | Python | gpl-3.0 | 257 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/lazylibrarian/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 ... | theguardian/LazyLibrarian_Old | lazylibrarian/notifiers/tweet.py | Python | gpl-3.0 | 5,477 |
import numpy as np
import laspy as las
# Determine if a point is inside a given polygon or not
# Polygon is a list of (x,y) pairs. This function
# returns True or False. The algorithm is called
# the "Ray Casting Method".
# the point_in_poly algorithm was found here:
# http://geospatialpython.com/2011/01/point-in-pol... | DTMilodowski/LiDAR_canopy | src/LiDAR_tools.py | Python | gpl-3.0 | 3,971 |
from flask import json
from unittest.mock import patch, Mock
from urbansearch.gathering.indices_selector import IndicesSelector
from urbansearch.server.main import Server
from urbansearch.server import classify_documents
from urbansearch.server.classify_documents import _join_workers
from urbansearch.workers import Wo... | urbansearchTUD/UrbanSearch | tests/server/test_classify_documents.py | Python | gpl-3.0 | 3,035 |
#-*- coding:utf-8 -*-
from findbilibili import *
#funtion name [checkinfo]
#判断要输出的回答
#param array 抓取的文字
#return string 回答
def checkinfo2(content):
content[1] = content[1].decode('gbk')
key = content[1].encode('utf-8')
if key == '节操':
return '这种东西早就没有了'
result = animation(key) #搜动漫
ret... | cwdtom/qqbot | tom/check.py | Python | gpl-3.0 | 705 |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
__author__ = """Co-Pierre Georg (co-pierre.georg@uct.ac.za)"""
import sys
from src.paralleltools import Parallel
#-------------------------------------------------------------------------
#
# conftools.py is a simple module to manage .xml configuration files
#
#-----... | cogeorg/econlib | test_paralleltools.py | Python | gpl-3.0 | 601 |
# coding: utf-8
"""
mistune
~~~~~~~
The fastest markdown parser in pure Python with renderer feature.
:copyright: (c) 2014 - 2016 by Hsiaoming Yang.
"""
import re
import inspect
__version__ = '0.7.3'
__author__ = 'Hsiaoming Yang <me@lepture.com>'
__all__ = [
'BlockGrammar', 'BlockLexer',
'In... | ebursztein/SiteFab | SiteFab/parser/mistune.py | Python | gpl-3.0 | 35,424 |
# noinspection PyPackageRequirements
import wx
import gui.globalEvents as GE
import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
class AmmoToDmgPattern(ContextMenuSingle):
visibilitySetting = 'ammoPattern'
def __init__(self):
self.mainFrame = gui.mainFrame... | DarkFenX/Pyfa | gui/builtinContextMenus/ammoToDmgPattern.py | Python | gpl-3.0 | 1,296 |
"""import portalocker
with portalocker.Lock('text.txt', timeout=5) as fh:
fh.write("Sono in testLoxk2.py")
"""
from lockfile import LockFile
lock = LockFile('text.txt')
with lock:
print lock.path, 'is locked.'
with open('text.txt', "a") as file:
file.write("Sono in testLock2.py")
| giulioribe/car-pooling | testLock2.py | Python | gpl-3.0 | 303 |
# This module is for compatibility only. All functions are defined elsewhere.
__all__ = ['rand', 'tril', 'trapz', 'hanning', 'rot90', 'triu', 'diff', 'angle',
'roots', 'ptp', 'kaiser', 'randn', 'cumprod', 'diag', 'msort',
'LinearAlgebra', 'RandomArray', 'prod', 'std', 'hamming', 'flipud',
... | beiko-lab/gengis | bin/Lib/site-packages/numpy/oldnumeric/mlab.py | Python | gpl-3.0 | 3,566 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ArticleComment'
db.create_table('cms_articlecomment', (
... | josircg/raizcidadanista | raizcidadanista/cms/migrations/0004_auto__add_articlecomment.py | Python | gpl-3.0 | 14,504 |
# Copyright (C) 2015 SensorLab, Jozef Stefan Institute http://sensorlab.ijs.si
#
# Written by Tomaz Solc, tomaz.solc@ijs.si
#
# This work has been partially funded by the European Community through the
# 7th Framework Programme project CREW (FP7-ICT-2009-258301).
#
# This program is free software: you can redistribute ... | avian2/spectrumwars | controller/spectrumwars/testbed/simulation.py | Python | gpl-3.0 | 3,927 |
"""add graphql ACL to users
Revision ID: 2d4882d39dbb
Revises: c4d0e9ec46a9
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2d4882d39dbb'
down_revision = 'dc2848563b53'
POLICY_NAME = 'wazo_default_user_policy'
ACL_TEMPLATES = ['dird.graphql.me']
policy_tabl... | wazo-pbx/xivo-auth | alembic/versions/2d4882d39dbb_add_graphql_acl_to_users.py | Python | gpl-3.0 | 3,250 |
#
# Copyright (c) 2013 Christopher L. Felton
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This p... | cfelton/minnesota | setup.py | Python | gpl-3.0 | 1,770 |
# -*- coding: utf-8 -*-
################################################################################
# Copyright 2014, Distributed Meta-Analysis System
################################################################################
"""Software structure for generating Monte-Carlo collections of results.
NOTE: Hi... | jrising/open-estimate | openest/generate/v1/effectset.py | Python | gpl-3.0 | 23,746 |
from abc import ABC
import configargparse
from sklearn.externals import joblib
from termcolor import colored
class ScikitBase(ABC):
"""
Base class for AI strategies
"""
arg_parser = configargparse.get_argument_parser()
arg_parser.add('-p', '--pipeline', help='trained model/pipeline (*.pkl file)', ... | miti0/mosquito | strategies/ai/scikitbase.py | Python | gpl-3.0 | 1,418 |
import commandRunner as cr
import subprocess
import glob, os, platform, shutil, adb
from pathlib import Path
def combine_browsers_logs(udid):
cmd = 'rebot -N Combined --outputdir browserlogs/ '
for idx, device in enumerate(udid):
#Get all the output.xml files for the devices
if platform.s... | younglim/hats-ci | robot_automation/src/logs.py | Python | gpl-3.0 | 3,513 |
# Copyright (c) 2014 Stefano Palazzo <stefano.palazzo@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 3 of the License, or
# (at your option) any later version.
# Thi... | sfstpala/hello | hello/__main__.py | Python | gpl-3.0 | 1,225 |
# Copyright (C) 2011-2012 Google Inc.
# 2016 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 versi... | oblitum/YouCompleteMe | python/ycm/vimsupport.py | Python | gpl-3.0 | 40,365 |
#!/usr/bin/env python3
import os
import logging
import tempfile
import shutil
from graftm.sequence_search_results import SequenceSearchResult
from graftm.graftm_output_paths import GraftMFiles
from graftm.search_table import SearchTableWriter
from graftm.sequence_searcher import SequenceSearcher
from graftm.hmmsearch... | wwood/graftM | graftm/run.py | Python | gpl-3.0 | 42,090 |
# Rain_Water_Trapping
def trappedWater(a, size) :
# left[i] stores height of tallest bar to the to left of it including itself
left = [0] * size
# Right [i] stores height of tallest bar to the to right of it including itself
right = [0] * size
# Initialize result
waterVol... | jainaman224/Algo_Ds_Notes | Rain_Water_Trapping/Rain_Water_Trapping.py | Python | gpl-3.0 | 1,208 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# TODO prog_base.py - A starting template for Python scripts
#
# Copyright 2013 Robert B. Hawkins
#
"""
SYNOPSIS
TODO prog_base [-h,--help] [-v,--verbose] [--version]
DESCRIPTION
TODO This describes how to use this script. This docstring
will be printed by ... | braynebuddy/PyBrayne | act_twitter.py | Python | gpl-3.0 | 3,157 |
# -*- coding: utf-8 -*-
from exceptions import DropPage, AbortProcess
| sunlightlabs/wikipedia-dump-tools | wikitools/__init__.py | Python | gpl-3.0 | 71 |
# -*- coding: utf-8 -*-
import re
from django.utils.safestring import mark_safe
from django.contrib.admin.widgets import AdminFileWidget
from django.template.defaultfilters import slugify
from django.utils.encoding import smart_text
from unidecode import unidecode
from django.forms.widgets import FILE_INPUT_CONT... | redsolution/django-tinymce-attachment | attachment/widgets.py | Python | gpl-3.0 | 3,019 |
import json
from collections import (
Counter,
defaultdict as deft
)
from copy import deepcopy as cp
# from cPickle import (
# dump as to_pickle,
# load as from_pickle
# )
from StringIO import StringIO
from TfIdfMatrix import TfIdfMatrix
from Tools import from_csv
class CategoryTree:
de... | JordiCarreraVentura/spellchecker | lib/CategoryTree.py | Python | gpl-3.0 | 7,145 |
"""
File: foursquares.py
Draws squares in the corners of a turtle window.
One square is black, another is gray, and the
remaining two are in random colors.
"""
from turtlegraphics import Turtle
import random
def drawSquare(turtle, x, y, length):
turtle.up()
turtle.move(x, y)
turtle.setDirection(270)
... | gregpuzzles1/Sandbox | Example Programs/Ch_07_Student_Files/foursquares.py | Python | gpl-3.0 | 1,378 |
# ##### 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... | kilon/sverchok | old_nodes/__init__.py | Python | gpl-3.0 | 4,863 |
# coding: utf-8
"""
rita Pipeline
.. module:: rita
:synopsis: rita pipeline
.. moduleauthor:: Adolfo De Unánue <nanounanue@gmail.com>
"""
import os
import subprocess
from pathlib import Path
import boto3
import zipfile
import io
import csv
import datetime
import luigi
import luigi.s3
import pandas as pd
... | nanounanue/rita-pipeline | rita/pipelines/rita.py | Python | gpl-3.0 | 6,982 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.9.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x07\x27\
\x00\
\x00\x1a\x8b\x78\x9c\xe5\x58\xdd\x8f\xdb\x36\x12\x7f\xdf\xbf\x82\
\x55\x1f\xd2\x4... | splotz90/urh | src/urh/ui/urh_rc.py | Python | gpl-3.0 | 463,208 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# compute/__init__.py
"""
See |compute.subsystem|, |compute.network|, |compute.distance|, and
|compute.parallel| for documentation.
Attributes:
all_complexes: Alias for :func:`pyphi.compute.network.all_complexes`.
ces: Alias for :func:`pyphi.compute.subsystem.ces... | wmayner/pyphi | pyphi/compute/__init__.py | Python | gpl-3.0 | 1,545 |
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent, fireEvent, fireEventAsync
from couchpotato.core.helpers.encoding import ss
from couchpotato.core.helpers.request import jsonified
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from couchpotat... | jayme-github/CouchPotatoServer | couchpotato/core/_base/updater/main.py | Python | gpl-3.0 | 14,024 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# auth: metagriffin <mg.github@uberdev.org>
# date: 2012/04/20
# copy: (C) Copyright 2012-EOT metagriffin -- see LICENSE.txt
#-----------------------------------------------------------------------------... | metagriffin/pysyncml | pysyncml/change/__init__.py | Python | gpl-3.0 | 1,255 |
"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
from robottelo import manifests
from robottelo.api.util... | omaciel/robottelo | tests/foreman/ui/test_sync.py | Python | gpl-3.0 | 5,811 |
#!/usr/bin/env python
from keyring import get_password
from boto.iam.connection import IAMConnection
import lib.LoadBotoConfig as BotoConfig
from sys import exit
envs = ['dev', 'qa', 'staging', 'demo', 'prod']
for env in envs:
id = BotoConfig.config.get(env, 'aws_access_key_id')
key = get_password(BotoConfig.co... | johnkastler/aws | get_account_urls.py | Python | gpl-3.0 | 456 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 20 13:37:16 2017
Author: Peiyong Jiang : jiangpeiyong@impcas.ac.cn
Function:
旋转使得变换。
"""
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
plt.close('all')
emitX=12
alphaX=-10.
betaX=13.
gammaX=(1.+alphaX**2)/... | iABC2XYZ/abc | DM_Twiss/TwissTrain9.py | Python | gpl-3.0 | 1,927 |
import threading
import asyncio
async def hello():
print('Hello world! (%s)' % threading.currentThread())
await asyncio.sleep(1)
print('Hello again! (%s)' % threading.currentThread())
loop = asyncio.get_event_loop()
tasks = [hello(), hello()]
loop.run_until_complete(asyncio.wait(tasks))
loop.cl... | IIIIIIIIll/sdy_notes_liaoxf | LiaoXueFeng/as_IO/async_await.py | Python | gpl-3.0 | 325 |
"""
Tests are performed against csr1000v-universalk9.03.15.00.S.155-2.S-std.
"""
import unittest
from iosxe.iosxe import IOSXE
from iosxe.exceptions import AuthError
node = '172.16.92.134'
username = 'cisco'
password = 'cisco'
port = 55443
class TestIOSXE(unittest.TestCase):
def setUp(self):
self.xe = ... | bobthebutcher/iosxe | tests/test_iosxe.py | Python | gpl-3.0 | 1,026 |
from __future__ import absolute_import
from pywb.framework.wbrequestresponse import WbResponse, WbRequest
from pywb.framework.archivalrouter import ArchivalRouter
from six.moves.urllib.parse import urlsplit
import base64
import socket
import ssl
from io import BytesIO
from pywb.rewrite.url_rewriter import SchemeOn... | pombredanne/pywb | pywb/framework/proxy.py | Python | gpl-3.0 | 16,139 |
# -*- coding: utf-8 -*-
import os
from pygal import *
def listeEuler(f, x0, y0, pas, n):
x, y, L = x0, y0, []
for k in range(n):
L += [(x, y)]
x += pas
y += pas * f(x, y)
return L
def euler(f, x0, y0, xf, n):
pas = (xf - x0) / n
courbe = XY()
courbe.title = "Methode ... | NicovincX2/Python-3.5 | Analyse (mathématiques)/Analyse fonctionnelle/Équation différentielle/euler.py | Python | gpl-3.0 | 468 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import argparse
import pprint
import proteindf_bridge as bridge
import logging
import logging.config
def get_rest_of_frame_molecule(frame_molecule, selected_molecule):
# calc the rest
selector = bridge.Select_AtomGroup(selected_molecule)
selected ... | ProteinDF/ProteinDF_bridge | scripts/brd-restructure.py | Python | gpl-3.0 | 2,717 |
import RPi.GPIO as GPIO
KnockPin = 11
LedPin = 12
Led_status = 1
def setup():
GPIO.setmode(GPIO.BOARD) # Numbers GPIOs by physical location
GPIO.setup(LedPin, GPIO.OUT) # Set LedPin's mode is output
GPIO.setup(KnockPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.output(LedPin, GPIO.HIGH) # Set LedPin high(... | bicard/raspberrypi | quad-store-sensors/37in1/knock-rgb-led-smd.py | Python | gpl-3.0 | 1,005 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | davidam/python-examples | basics/leap.py | Python | gpl-3.0 | 1,385 |
# Copyright 2015 Allen Institute for Brain Science
# This file is part of Allen SDK.
#
# Allen SDK 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.
#
# Allen SDK is distributed in the ... | wvangeit/AllenSDK | allensdk/api/queries/biophysical_perisomatic_api.py | Python | gpl-3.0 | 12,180 |
#!/usr/bin/env python
#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of GNUHAWK.
#
# GNUHAWK is free software: you can redistribute it and/or modify is under the
# terms of the GNU General Public License as published by ... | RedhawkSDR/integration-gnuhawk | components/sig_source_i/tests/test_sig_source_i.py | Python | gpl-3.0 | 4,531 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 6 22:58:00 2016
@author: Diogo
"""
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 26 19:08:00 2016
@author: Diogo
"""
def ImportGames():
games = list()
user_games = dict()
with open('C:\\Users\\Diogo\\Documents\\Monografia FIA\\UserGamesCleansed.tx... | DiogoGoes/TCC | AssociationRule.py | Python | gpl-3.0 | 1,429 |
# -*- coding: utf-8 -*-
from django.contrib import admin
from models import FileMapping
# Register your models here.
admin.site.register(FileMapping)
| tiankangkan/paper_plane | treasure/admin.py | Python | gpl-3.0 | 155 |
import ast
import json
import arrow
import elasticsearch
from bson import ObjectId
from flask import request
from eve.utils import config
from eve.io.base import DataLayer
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
def parse_date(date_str):
"""Parse elastic... | amagdas/eve-elastic | eve_elastic/elastic.py | Python | gpl-3.0 | 13,856 |