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 |
|---|---|---|---|---|---|
# Copyright (C) 2016 Intel Corporation
# Released under the MIT license (see COPYING.MIT)
from oeqa.core.exception import OEQAMissingVariable
from . import OETestDecorator, registerDecorator
def has_feature(td, feature):
"""
Checks for feature in DISTRO_FEATURES or IMAGE_FEATURES.
"""
if (featur... | schleichdi2/OPENNFR-6.1-CORE | opennfr-openembedded-core/meta/lib/oeqa/core/decorator/data.py | Python | gpl-2.0 | 2,959 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os, sys
try:
s = "qwertyu"
while s != "":
print s
s = s[1:-1]
# print "Просто муйня"
except:
print "При выполнении программы возникла проблема!"
| dtulyakov/py | intuit/test2.py | Python | gpl-2.0 | 255 |
# -*- coding: iso-8859-1 -*-
# symbolic.py
# Symbolic simulation module
# Copyright 2010-2013 Giuseppe Venturini
# This file is part of the ahkab simulator.
#
# Ahkab 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 Found... | ahkab/ahkab | ahkab/symbolic.py | Python | gpl-2.0 | 24,396 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
Datamerger 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.... | dschreij/Datamerger | setup-py2exe.py | Python | gpl-2.0 | 1,779 |
from django.core.management.base import BaseCommand, CommandError
from tweets.tasks import stream
#The class must be named Command, and subclass BaseCommand
class Command(BaseCommand):
# Show this when the user types help
help = "My twitter stream command"
# A command must define handle()
def handle(s... | shazadan/mood-map | tweets/management/commands/stream.py | Python | gpl-2.0 | 361 |
""" This file should not have any executable code."""
| findgriffin/hactar | plugins/__init__.py | Python | gpl-2.0 | 54 |
# 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.
from bkr.server.database import session
from turbogears import expose,... | beaker-project/beaker | Server/bkr/server/tag.py | Python | gpl-2.0 | 1,468 |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | AMOboxTV/AMOBox.LegoBuild | plugin.video.salts/scrapers/moviexk_scraper.py | Python | gpl-2.0 | 7,244 |
#
# SPDX-License-Identifier: MIT
#
import oe.path
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import bitbake
class Fetch(OESelftestTestCase):
def test_git_mirrors(self):
"""
Verify that the git fetcher will fall back to the HTTP mirrors. The
recipe needs to b... | schleichdi2/OPENNFR-6.3-CORE | opennfr-openembedded-core/meta/lib/oeqa/selftest/cases/fetch.py | Python | gpl-2.0 | 1,543 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# SchoolTool - common information systems platform for school administration
# Copyright (c) 2003 Shuttleworth Foundation
#
# 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... | HomeRad/TorCleaner | test.py | Python | gpl-2.0 | 32,033 |
# vim:fileencoding=utf-8:noet
from .segment import gen_segment_getter
try:
from __builtin__ import unicode
except ImportError:
unicode = str # NOQA
def u(s):
if type(s) is unicode:
return s
else:
return unicode(s, 'utf-8')
def requires_segment_info(func):
func.powerline_requires_segment_info = True
re... | DaneelOliwan/dotfiles-vim | .vim/bundle/powerline/powerline/theme.py | Python | gpl-2.0 | 4,807 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('job_site_verification', '0007_auto_20151022_1812'),
]
operations = [
migrations.AddField(
model_name='jobrequest... | BigEventTamu/tamu_be_jsvs | job_site_verification/migrations/0008_auto_20151113_1827.py | Python | gpl-2.0 | 715 |
""" Copyright (C) 2015 Sebastian Otalora
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 the h... | sebastianffx/active_deep_segmentation | flickrsearch.py | Python | gpl-2.0 | 2,457 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | ypid-bot/check_mk | web/plugins/cron/user_sync.py | Python | gpl-2.0 | 1,544 |
#!/usr/bin/python
import email
from email.parser import HeaderParser
import imaplib
import mimetypes
import getpass
import sys
import os
from config import email_id, assignments_folder
class Mailbox(object):
def __init__(self, email_id, password, server='imap.gmail.com'):
self.mbox = imaplib.IMAP4_SS... | kashifpk/TA | fetchmail.py | Python | gpl-2.0 | 3,120 |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | ljx0305/ice | python/test/Ice/application/Client.py | Python | gpl-2.0 | 1,738 |
import net.mapserv as mapserv
from net.common import distance
def find_nearest_being(name='', type='', ignored_ids=[], allowed_jobs=[]):
if mapserv.beings_cache is None:
return None
min_disance = 1000000
px = mapserv.player_pos['x']
py = mapserv.player_pos['y']
nearest = None
for b ... | mekolat/manachat | actor.py | Python | gpl-2.0 | 745 |
# coding:utf-8
import csv,xlrd
from selenium import webdriver
import time
file_name = r'D:\PycharmProjects\test_hpk2017\data\testdata.xlsx'
def getCsv(file_name):
rows=[]
with open(file_name, 'rb') as f:
readers = csv.reader(f, delimiter=',', quotechar='|')
next(readers, None)
for row ... | uyaly/test | utils/location.py | Python | gpl-2.0 | 1,635 |
__author__ = 'user'
__project_name = 'NewsAnalytic'
__filename = '__init__.py'
__date__ = '03/02/14'
__copyright__ = 'imajimatika@gmail.com'
__doc__ = '' | ismailsunni/NewsAnalytic | libs/__init__.py | Python | gpl-2.0 | 153 |
# Copyright (c) 2008 Joost Cassee
# Licensed under the terms of the MIT License (see LICENSE.txt)
"""
This TinyMCE widget was copied and extended from this code by John D'Agostino:
http://code.djangoproject.com/wiki/CustomWidgetsTinyMCE
"""
from __future__ import unicode_literals
#import tinymce.settings
import demo.... | riverbird/djangoweblog | tinymce/widgets.py | Python | gpl-2.0 | 6,397 |
import os,re,string,sys
# ---------------------------------------------------
# read in the ACCEPT/REJECT MASK
# ---------------------------------------------------
KMASKS = []
KFLAGS = []
CMASKS = []
f=open("fromPds.conf",'rb')
data=f.readlines()
f.close()
for l in data :
l = l.strip()
if len(l) == 0 : con... | khosrow/metpx | sundew/doc/pds_conversion/routing_step3.py | Python | gpl-2.0 | 3,482 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer.
.. note:: 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.
"""
__autho... | borysiasty/QGIS | tests/src/python/test_qgsserver_accesscontrol.py | Python | gpl-2.0 | 10,893 |
# statusbar-1.py
from wax import *
import time
class MainFrame(VerticalFrame):
def Body(self):
statusbar = StatusBar(self, numpanels=3, add=1)
# "add=1" adds the statusbar to its parent automagically; if you omit
# this, you'll have to do self.SetStatusBar(statusbar) explicitly
# ... | MSMBA/msmba-workflow | msmba-workflow/srclib/wax/examples/statusbar-1.py | Python | gpl-2.0 | 728 |
"""
This module is used to select features or proposals
"""
def select_preceding(features, k):
""" select preceding k features or proposals for each image
:param k: preceding k features or proposals for each image are selected
:type k: integer
:return: selected features or proposals
:rtype: li... | zhitiancheng/cliff | cliff/selection.py | Python | gpl-2.0 | 593 |
from pylab import *
from scipy import sparse
from scipy.integrate import odeint
import os, time
from osc_eqn import osc2
from my_parameters import *
detune=0.001
alpha0=3.08
alpha1=1e-3*random(Nosc)+alpha0
alpha1=1.0/(alpha1)
length1=length*stepsize+1
tlength=translength*stepsize+1
S1=zeros((Nosc,Nosc))
for i in ra... | sideshownick/Snaking_Networks | MyPython/run_solve.py | Python | gpl-2.0 | 1,751 |
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... | 3dfxsoftware/cbss-addons | account_voucher_move_id/__openerp__.py | Python | gpl-2.0 | 1,448 |
#!/bin/python2.7
def add_scalar_to_list(my_scalar, my_list=[]):
'''Given a scalar and a list, append the scalar to the list.
If no list is provided, return a new list containing just the scalar value.
'''
return my_list.append(my_scalar)
extra_credit = 0
# DO NOT CHANGE ANYTHING BELOW THIS LINE
# Te... | AnchorFree/python_example | example_code.py | Python | gpl-2.0 | 2,648 |
# From Dalgaard page 83 [R267]_, suppose the daily energy intake for 11
# women in Kj is:
intake = np.array([5260., 5470, 5640, 6180, 6390, 6515, 6805, 7515, \
7515, 8230, 8770])
# Does their energy intake deviate systematically from the recommended
# value of 7725 kJ?
# We have 10 degrees of free... | platinhom/ManualHom | Coding/Python/numpy-html-1.10.1/reference/generated/numpy-random-standard_t-1.py | Python | gpl-2.0 | 1,068 |
from twisted.internet import reactor
from twisted.internet.protocol import Protocol , Factory
class SimpleLogger(Protocol):
fi = open("/temp/31.log","rw+")
def connectionMade(self):
print 'got connection from',self.transport.client
def connectionLost(self,reason):
print self.transport.cl... | q4478842/QQsync | server/server.py | Python | gpl-2.0 | 526 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed i... | willicab/instalador | instalador/clases/keyboard.py | Python | gpl-2.0 | 4,131 |
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from widgetastic.utils import partial_match
from cfme import test_requirements
from cfme.infrastructure.provider import InfraProvider
from cfme.infrastructure.provider.rhevm import RHEVMProvider
from cfme.infrastructure.pxe import get_pxe_server_from_config
from... | RedHatQE/cfme_tests | cfme/tests/services/test_pxe_service_catalogs.py | Python | gpl-2.0 | 6,083 |
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.views import generic
from .models import Choice, Question
from django.utils import timezone
class IndexView(generic.ListView):
template_name = 'polls/index.... | w0921444648/IT110_DJANGO_ATTEMPT2 | polls/views.py | Python | gpl-2.0 | 1,575 |
import introbot
# Connect to twitter, using your own account...
try: from introbot import connection
except:
print "IntroBot: unable to connect to to Twitter"
sys.exit()
print "IntroBot: connected to Twitter: ",connection.line
# Instantiate a host, who will do the introductions:
jeeves = introbot.Host()
#... | drphilmarshall/IntroBot | introbot.py | Python | gpl-2.0 | 594 |
#/*
# *
# * TuneIn Radio for XBMC.
# *
# * Copyright (C) 2013 Brian Hornsby
# *
# * 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... | SMALLplayer/smallplayer-image-creator | storage/.xbmc/addons/plugin.audio.tuneinradio.smallplayer/resources/lib/tunein.py | Python | gpl-2.0 | 37,835 |
# Copyright (C) 2015 Igor Gnatenko
#
# 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 distributed in the hope that it will be us... | jsilhan/dnf-plugins-extras | tests/test_repoclosure.py | Python | gpl-2.0 | 3,893 |
"""
Keyboard definition for the Tokyo60 custom keyboard.
Auto-generated from 'D:\\Users\\dave\\Desktop\\tokyo60.json'
"""
#
# READ THIS
#
# This file contains a description of the various parameters that
# must be defined in order to completely describe the new keyboard.
# This file must be correct for the firmware to... | dhowland/EasyAVR | keymapper/easykeymap/boards/tokyo60.py | Python | gpl-2.0 | 8,879 |
__author__ = 'Dominik Krupke, dserv01.de'
#
# While you want to listen to lossless music on your computer you may not be able to also listen to it mobile because
# it takes too much space. A 32GB-SDCard does not suffice for your full music library so you only have the options to
# either only hearing to a subset mobil... | dserv01/SyncLosslessToLossyMusicLibrary | SyncLosslessToLossyMusicLibrary.py | Python | gpl-2.0 | 6,785 |
#!/usr/bin/env python
# Plot of Numeric & numarray arrays and lists & tuples of Python floats.
import sys
from qt import *
from Qwt4.Qwt import *
def drange(start, stop, step):
start, stop, step = float(start), float(stop), float(step)
size = int(round((stop-start)/step))
result = [start]*size
for i ... | PyQwt/PyQwt4 | qt3examples/MultiDemo.py | Python | gpl-2.0 | 4,825 |
#!/usr/bin/env python3
#################################
# Author: Arisa Kubota
# Email: arisa.kubota at cern.ch
# Date: July 2020
# Project: Local Database for YARR
#################################
import os
from copy import copy
from logging import getLogger, getLoggerClass, Formatter, FileHandler, StreamHandler, a... | Yarr/Yarr | localdb/lib/localdb-tools/modules/db_logging.py | Python | gpl-2.0 | 3,337 |
#
# Copyright 2007, 2016 Zuza Software Foundation
#
# This file is part of translate.
#
# translate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any la... | miurahr/translate | translate/lang/km.py | Python | gpl-2.0 | 2,000 |
### Join images (XOR)
import cv2
from . import print_image
def logical_xor(img1, img2, device, debug=False):
# Join two images using the bitwise XOR operator
# img1, img2 = image objects, grayscale
# device = device number. Used to count steps in the pipeline
# debug = True/False. If True, print image
devic... | dlebauer/plantcv | lib/plantcv/logical_xor.py | Python | gpl-2.0 | 460 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-04-14 12:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vehicle', '0001_initial'),
]
operations = [
migrations.RenameField(
... | ScaleXY/speedby | speedby/vehicle/migrations/0002_auto_20160414_1246.py | Python | gpl-2.0 | 844 |
from django.conf.urls import patterns, url
from app import views
urlpatterns = patterns(' ',
url(r'^$', views.index, name='index'),
url(r'^about/$', views.About, name='About'),
) | cx421774557/pengyouquan | pengyouquan/app/urls.py | Python | gpl-2.0 | 181 |
#!/usr/bin/env python
# -- coding: utf-8 --
__author__ = 'michael'
import setuptools
try:
import multiprocessing # noqa
except ImportError:
pass
setuptools.setup(
setup_requires=['pbr'],
pbr=True)
| ivanovmi/google-cli-tools | setup.py | Python | gpl-2.0 | 218 |
#!/usr/bin/env python3
from os import environ, system
from subprocess import Popen
print('\nUltimate Doom (Classic)')
print('Link: https://store.steampowered.com/app/2280/Ultimate_Doom/\n')
home = environ['HOME']
core = home + '/bin/games/steam-connect/steam-connect-core.py'
logo = home + '/bin/games/steam-connect/do... | noirhat/bin | games/doom/doom-1.py | Python | gpl-2.0 | 755 |
import rules
from rules.predicates import is_staff, is_superuser
from .models import Policy
@rules.predicate
def is_policy_manager(user, policy=None):
if policy is None:
return bool(Policy.objects.filter(managers=user).count())
else:
return bool(policy.managers.filter(id=user.id).count())
@... | thetoine/eruditorg | erudit/core/subscription/rules.py | Python | gpl-3.0 | 748 |
#!/bin/true
# -*- coding: utf-8 -*-
#
# This file is part of ypkg2
#
# Copyright 2015-2017 Ikey Doherty <ikey@solus-project.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 ver... | solus-project/ypkg | ypkg2/sources.py | Python | gpl-3.0 | 12,925 |
##########################################################################
# PyTyBot - A MediaWiki wrapper for use on wikis.
# Copyright (C) 2012 TyA <tya.wiki@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 publishe... | ty-a/pytybot | tybot.py | Python | gpl-3.0 | 15,523 |
#
# IPsec overlay network manager (l3overlay)
# l3overlay/util/exception.py - exception base class
#
# Copyright (c) 2017 Catalyst.net 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 ... | catalyst/l3overlay | src/l3overlay/util/exception.py | Python | gpl-3.0 | 914 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-21 19:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0007_auto_20170821_2052'),
]
operations = [
migrations.AlterField(... | ludwiktrammer/tikn | apps/books/migrations/0008_auto_20170821_2100.py | Python | gpl-3.0 | 534 |
#!/usr/bin/env python3
import os # makedirs
import sys # argv, exit
import csv # DictReader
def cutoffdict(cdict):
rdict = dict()
for key in cdict.keys():
candi = cdict[key]
top = max(candi, key = candi.get)
if candi[top] > (sum(candi.values())*0.5):
rdict[key] = top
... | munhyunsu/UsedMarketAnalysis | ruliweb_analyzer/db_5th_group.py | Python | gpl-3.0 | 1,617 |
import numpy as np
np.seterr(divide='ignore') #ignore errors in log division
np.seterr(all='ignore') #ignore errors in log division
import sys
import time
##########################################################################################
def BGMCMC(LogPosterior,gp,post_args,ch_len,ep,gibbs_index,chain_file... | nealegibson/Infer | src/MCMC_BGibbs.py | Python | gpl-3.0 | 7,699 |
upperLimit = 1000
oddCounter = 3
oddList = []
n = 0
while upperLimit >= oddCounter:
oddList.append(oddCounter)
oddCounter += 2
while oddList(n) < (upperLimit - 1):
if oddList(n) %
print(oddList) | AustinHartman/randomPrograms | primFinder.py | Python | gpl-3.0 | 209 |
"Read and write ZIP files."
import struct, os, time
import binascii
try:
import zlib # We may need its compression method
except ImportError:
zlib = None
__all__ = ["BadZipfile", "error", "ZIP_STORED", "ZIP_DEFLATED", "is_zipfile",
"ZipInfo", "ZipFile", "PyZipFile"]
class BadZipfile(... | DarioGT/OMS-PluginXML | org.modelsphere.sms/lib/jython-2.2.1/Lib/zipfile.py | Python | gpl-3.0 | 25,263 |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... | mganeva/mantid | scripts/SANS/sans/algorithm_detail/xml_shapes.py | Python | gpl-3.0 | 8,072 |
# Generated by Django 2.1.2 on 2018-11-04 05:45
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('collab', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='instance',
... | nirizr/rematch | server/collab/migrations/0002_auto_20181104_0545.py | Python | gpl-3.0 | 713 |
from unittest import TestCase
from sorting.merge import merge_list, merge_sort, merge_sort_recursive
class TestSortingMerge(TestCase):
def test_merge_list(self):
left = [1, 4, 6]
right = [2, 3, 5]
result = merge_list(left, right)
self.assertEquals(6, len(result))
for i in ... | narfman0/challenges | algorithms/tests/sorting/test_merge.py | Python | gpl-3.0 | 1,709 |
'''
This module contains classes for semirings.
'''
# pylint: disable = no-member, protected-access, invalid-name
# pylint: disable = too-few-public-methods
class SemiringABC:
r'''
A *semiring* is a set :math:`R`, together with two binary operations,
:math:`+` and :math:`\times`, such that :math:`(R, +)` i... | james-d-mitchell/libsemigroups-python-bindings | semigroups/semiring.py | Python | gpl-3.0 | 28,988 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | fiete201/qutebrowser | qutebrowser/browser/hints.py | Python | gpl-3.0 | 44,206 |
# -*- coding: UTF-8
""" Entry decorators for python plugins
Functions
=========
chat_message -- Decorator for chat message plugin
chat_command -- Decorator for chat command plugin
chat_accost -- Decorator for chat accost plugin
"""
from dewyatochka.core.plugin.loader.internal import entry_point
from dew... | kawashiro/dewyatochka2 | src/dewyatochka/core/plugin/subsystem/message/py_entry.py | Python | gpl-3.0 | 2,198 |
from flask import Flask, render_template, request
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.security import Security, SQLAlchemyUserDatastore, UserMixin, RoleMixin, login_required
from flask.ext.login import current_user
import os
import json
from flask_mail import Mail
import base64
def load_json():
... | bobman/magnemo | main.py | Python | gpl-3.0 | 4,681 |
""" Copyright 2016-2017 ETH Zurich, Eirini Arvaniti and Manfred Claassen.
This module contains utility functions.
"""
import os
import errno
from collections import Counter
import numpy as np
import pandas as pd
import copy
from cellCnn.downsample import random_subsample, kmeans_subsample, outlier_subsample
from ce... | eiriniar/CellCnn | cellCnn/utils.py | Python | gpl-3.0 | 12,947 |
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst.
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from osgeo import ogr
import numpy as np
from gislib import projections
def array2p... | lizardsystem/flooding | gislib/vectors.py | Python | gpl-3.0 | 6,539 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pinytoCloud.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Pinyto/cloud | manage.py | Python | gpl-3.0 | 254 |
#!/usr/bin/env python2.7
#naive implementation of a program that sorts function definitions alphabetically
import sys
import fileinput
DEBUG = False
function = ''
first_fun = None
output = []
funs = {}
bracket_count = 0
for line in fileinput.input():
bracket_count += line.count("{")
if bracket_count:
... | bdevorem/GGNoRe | sort_fun.py | Python | gpl-3.0 | 1,009 |
from pyplanet.apps.config import AppConfig
from pyplanet.apps.contrib.funcmd.view import EmojiToolbarView
from pyplanet.contrib.command import Command
from pyplanet.apps.core.maniaplanet import callbacks as mp_signals
from pyplanet.contrib.setting import Setting
class FunCmd(AppConfig):
app_dependencies = ['core.ma... | PyPlanet/PyPlanet | pyplanet/apps/contrib/funcmd/__init__.py | Python | gpl-3.0 | 4,483 |
#!/usr/bin/env python3
# Author: Francois Aguet
import argparse
import os
import numpy as np
import subprocess
import gzip
import multiprocessing as mp
import contextlib
from datetime import datetime
import tempfile
import glob
@contextlib.contextmanager
def cd(cd_path):
saved_path = os.getcwd()
os.chdir(cd_pa... | francois-a/fastqtl | python/run_FastQTL_threaded.py | Python | gpl-3.0 | 5,608 |
from p2pool.util import forest, math
class WeightsSkipList(forest.TrackerSkipList):
# share_count, weights, total_weight
def get_delta(self, element):
from p2pool.bitcoin import data as bitcoin_data
share = self.tracker.shares[element]
att = bitcoin_data.target_to_average_attempts(... | sje397/p2pool | p2pool/skiplists.py | Python | gpl-3.0 | 2,559 |
"""
Given two strings s and t, return true if s is a subsequence of t, or false otherwise.
https://leetcode.com/problems/is-subsequence/
Date: 10/29/21
"""
def is_seq(s,t):
ls = list(s)
lt = list(t)
idx = []
for e in ls:
if e in lt:
idx.append(lt.index(e))
if len(idx)>1... | entrepidea/projects | python/tutorials/algo/leetcode/easy/is_sebsequence.py | Python | gpl-3.0 | 641 |
# Generated by Django 2.0 on 2019-01-31 19:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inscriptions', '0050_merge_20190131_0016'),
]
operations = [
migrations.AlterField(
model_name='equipier',
name='cerfa... | Puyb/inscriptions_roller | inscriptions/migrations/0051_auto_20190131_2038.py | Python | gpl-3.0 | 978 |
# encoding=utf-8
import sys
sys.path.insert(1, "lib")
sys.path.insert(1, "core")
import os
import time
import unittest
import xconfig
import xutils
import xtables
import xmanager
import xtemplate
import web
import six
import json
import xauth
from xutils import dbutil
from handlers.fs.fs_upload import get_upload_file_p... | xupingmao/xnote | tests/test_base.py | Python | gpl-3.0 | 4,620 |
# Generated by Django 2.0 on 2017-12-14 08:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('proj_checker', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='proj',
name='lock',
fiel... | cmos3511/cmos_linux | python/op/op_site/proj_checker/migrations/0002_proj_lock.py | Python | gpl-3.0 | 375 |
# Standard Library
import time
from http.cookiejar import Cookie, MozillaCookieJar, _warn_unhandled_exception
class WebkitCookieJar(MozillaCookieJar):
"""Subclass of MozillaCookieJar for compatibility with cookies
coming from Webkit2.
This disables the magic_re header which is not present and adds
co... | lutris/lutris | lutris/util/cookies.py | Python | gpl-3.0 | 2,811 |
from django.conf.urls import url
from . import views
app_name = 'djcytoscape'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^generate/(?P<quest_id>[0-9]+)/(?P<scape_id>[0-9]+)$', views.generate_map, name='generate_map'),
url(r'^generate/$', views.generate_map, name='generate_unseeded'),
... | timberline-secondary/hackerspace | src/djcytoscape/urls.py | Python | gpl-3.0 | 1,100 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from datetime import datetime
from helpers.loghelpers import LOG
from .trigger import Trigger
from .triggertype import TriggerType
from validators.validators import valid_amount, valid_timestamp
class RecurringTrigger(Trigger):
def __init__(self, trigger_... | ValyrianTech/BitcoinSpellbook-v0.3 | trigger/recurringtrigger.py | Python | gpl-3.0 | 2,696 |
#
email = {
"email_server" : "localhost",
"email_from_addr" : "email@example.com",
}
twilio = {
"account_sid": "twilio_account_sid",
"auth_token" : "twilio_auth_token",
"from_number": "twilio_from_number",
"code" : "intl_code",
}
| jstitch/gift_circle | gift_circle/config.py | Python | gpl-3.0 | 273 |
# Copyright 2015 Ian Lynn
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distribute... | Swabboy/ImageDateSort | ImageDateSort.py | Python | gpl-3.0 | 7,213 |
"""
Base class for undirected graphs.
The Graph class allows any hashable object as a node
and can associate any object with an undirected edge.
Self-loops are allowed but multiple edges are not (see MultiGraph)
For directed graphs see DiGraph and XDiGraph.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)\nPiet... | emreg00/biana | biana/ext/networkx/classes/graph.py | Python | gpl-3.0 | 35,652 |
"""Test values to test read_all_variables methods.
Used by test in controller and model modulesself.
"""
# TODO: change string format return from serial
values = [
8579, 6.7230000495910645, 6.7230000495910645,
[b'V', b'0', b'.', b'0', b'7', b' ', b'2', b'0', b'1', b'8', b'-', b'0', b'3',
b'-', b'2', b'6',... | lnls-sirius/dev-packages | siriuspy/tests/pwrsupply/variables.py | Python | gpl-3.0 | 3,146 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model
#
# Copyright (C) 2016, Edwin H. Sutanudjaja, Rens van Beek, Niko Wanders, Yoshihide Wada,
# Joyce H. C. Bosmans, Niels Drost, Ruud J. van der Ent, Inge E. M. de Graaf, Jannis M. Hoch,
# Kor de Jong,... | UU-Hydro/PCR-GLOBWB_model | model/deterministic_runner.py | Python | gpl-3.0 | 6,069 |
''' DowntimeCommand module
'''
import urllib2
from datetime import datetime, timedelta
from operator import itemgetter
from DIRAC import S_OK, S_ERROR
from DIRAC.Core.LCG.GOCDBClient import GOCDBClient
from DIRAC.Core.Utilities.Site... | vmendez/DIRAC | ResourceStatusSystem/Command/DowntimeCommand.py | Python | gpl-3.0 | 13,233 |
# -*- coding: utf-8 -*-
from pyload.plugin.internal.SimpleCrypter import SimpleCrypter
class MegaRapidCz(SimpleCrypter):
__name = "MegaRapidCz"
__type = "crypter"
__version = "0.02"
__pattern = r'http://(?:www\.)?(share|mega)rapid\.cz/slozka/\d+/\w+'
__config = [("use_premium" , "bo... | ardi69/pyload-0.4.10 | pyload/plugin/crypter/MegaRapidCz.py | Python | gpl-3.0 | 779 |
import frappe
from frappe.utils import flt
from erpnext.selling.doctype.sales_order.sales_order import update_produced_qty_in_so_item
def execute():
frappe.reload_doctype('Sales Order Item')
frappe.reload_doctype('Sales Order')
sales_order_items = frappe.db.get_all('Sales Order Item', ['name'])
for so_... | libracore/erpnext | erpnext/patches/v12_0/set_produced_qty_field_in_sales_order_for_work_order.py | Python | gpl-3.0 | 406 |
import bpy
from ... base_types.node import AnimationNode
class InvertNode(bpy.types.Node, AnimationNode):
bl_idname = "an_InvertNode"
bl_label = "Invert Boolean"
def create(self):
self.newInput("Boolean", "Input", "input")
self.newOutput("Boolean", "Output", "output")
def getExecution... | Thortoise/Super-Snake | Blender/animation_nodes-master/nodes/boolean/invert_node.py | Python | gpl-3.0 | 368 |
import socket
class Socket:
def __init__(self,ipaddr="127.0.0.1",port=9734):
self.ipaddr=ipaddr
self.port=port
self.sck=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
self.sck.connect((ipaddr,port))
def send(self,data):
defdata="Data-Size: {}\n\n{}".format(len(dat... | AlessandroSpallina/JASM | testclient/sockets.py | Python | gpl-3.0 | 578 |
# -*- coding: utf-8 -*-
import argparse
def ngrams(input='', n_min=0, n_max=5):
input = input.split(' ')
output = {}
end = n_max
for n in range(n_min+1, end+n_min+1):
for i in range(len(input)-n+1):
token = " ".join(input[i:i+n])
# Count the ngram
output[toke... | jplusplus/wikileaks-cg-analyser | ngrams.py | Python | gpl-3.0 | 991 |
import serial #import serial module
import NASA_Conn
from NASA_Conn_TT import check
def read_rfid ():
ser = serial.Serial ("/dev/ttyAMA0") #Open named port
ser.baudrate = 9600 #Set baud rate to 9... | shadow1dos/NASA | Run.py | Python | gpl-3.0 | 745 |
/usr/share/pyshared/gwibber/microblog/urlshorter/zima.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/pymodules/python2.7/gwibber/microblog/urlshorter/zima.py | Python | gpl-3.0 | 56 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ROOT, time
toff = 0 # -8*3600
def Create_html(le,lp):
htmlhead = '''<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="author" content="Nickolai Muchnoi">
<meta http-equiv="refresh" content="30">
<title>BEPC-... | muchnoi/HPGe | bepc/ourweb.py | Python | gpl-3.0 | 5,626 |
# This file is part of ArcJail.
#
# ArcJail 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.
#
# ArcJail is distributed in the hope that... | KirillMysnik/ArcJail | srcds/addons/source-python/plugins/arcjail/modules/arcjail/arcjail_user.py | Python | gpl-3.0 | 9,070 |
#!/usr/bin/env python3
# #############################################################################################
# # Host Code Generator for Kernel Execution #
# # Author: André Bannwart Perina #
# ######... | comododragon/hostcodegen | hostCodeGen/hostCodeGen.py | Python | gpl-3.0 | 5,182 |
#!/usr/bin/python
"""
m5subband.py ver. 1.1 Jan Wagner 20150603
Extracts a narrow subband via filtering raw VLBI data.
Reads formats supported by the mark5access library.
Usage : m5subband.py <infile> <dataformat> <outfile>
<if_nr> <factor> <Ldft>
<start_bin> <stop_bi... | demorest/mark5access | python/examples/m5subband.py | Python | gpl-3.0 | 8,051 |
from utils import memo
import bisect
class WordFilter(object):
def __init__(self, words):
"""
:type words: List[str]
"""
self.n = len(words)
self.words = words
self.seq_w = sorted(range(self.n), key=lambda i: words[i])
self.seq = [words[i] for i in self.seq_... | wufangjie/leetcode | 745. Prefix and Suffix Search.py | Python | gpl-3.0 | 2,102 |
# =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa 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 ... | bsmr-eve/Pyfa | gui/builtinStatsViews/resourcesViewFull.py | Python | gpl-3.0 | 15,284 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @name : Infoga - Email OSINT
# @url : http://github.com/m4ll0k
# @author : Momo Outaadi (m4ll0k)
from setuptools import setup
setup(
name='infoga',
version='0.1.5',
description='Email OSINT',
url='https://github.com/m4ll0k',
author = 'M... | m4ll0k/Infoga | setup.py | Python | gpl-3.0 | 494 |
# midair_only.py, this plugin changes the gameplay into a rockets-only mode where only midair shots kill.
# If you just want a midair ranking system, use midair.py instead.
# This plugin also keeps score of top X midair rocket kills per map in terms of distance.
# On evey midair kill that counts (minheight and mindista... | x0rnn/minqlx-plugins | midair_only.py | Python | gpl-3.0 | 9,927 |
import os
from .parser import is_url
try:
import urlparse as url_parser
except ImportError:
import urllib.parse as url_parser
def _urijoin(base_uri, path):
if is_url(base_uri):
return url_parser.urljoin(base_uri, path)
else:
return os.path.normpath(os.path.join(base_uri, path.strip('... | aroth-arsoft/arsoft-python | python3/arsoft/m3u8/mixins.py | Python | gpl-3.0 | 1,360 |
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... | adrianschroeter/kiwi | kiwi/repository/dnf.py | Python | gpl-3.0 | 9,788 |
import src
class Chemical(src.items.Item):
type = "Chemical"
def __init__(self):
super().__init__(display=src.canvas.displayChars.fireCrystals)
self.name = "chemical"
self.composition = b"cccccggggg"
def apply(self, character):
import hashlib
results = []
... | MarxMustermann/OfMiceAndMechs | src/itemFolder/obsolete/chemical.py | Python | gpl-3.0 | 1,571 |
# -*- coding: utf-8 -*-
"""
Special purpose canvas including all required plotting function etc.
@newfield purpose: Purpose
@newfield sideeffect: Side effect, Side effects
@purpose: Plotting all
@author: Christian Kohl�ffel
@since: 22.04.2011
@license: GPL
"""
from copy import copy
from PyQt4 import... | workflo/dxf2gcode | source/Gui/myCanvasClass.py | Python | gpl-3.0 | 26,794 |