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 |
|---|---|---|---|---|---|
import sublime
import sublime_plugin
import re
import os
import datetime
TMLP_DIR = 'templates'
KEY_SYNTAX = 'syntax'
KEY_FILE_EXT = 'extension'
IS_GTE_ST3 = int(sublime.version()) >= 3000
PACKAGE_NAME = 'new-file-pro'
PACKAGES_PATH = sublime.packages_path()
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
cla... | KevinHoo/new-file-pro | commands/NewFileBase.py | Python | gpl-3.0 | 3,250 |
#!/usr/bin/env python
'''
create ardupilot terrain database files
'''
from MAVProxy.modules.mavproxy_map import srtm
import math, struct, os, sys
import crc16, time, struct
# MAVLink sends 4x4 grids
TERRAIN_GRID_MAVLINK_SIZE = 4
# a 2k grid_block on disk contains 8x7 of the mavlink grids. Each
# grid block overlaps... | matternet/ardupilot | libraries/AP_Terrain/tools/create_terrain.py | Python | gpl-3.0 | 11,310 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
DGA: Implementation of the Distributed Greedy Algorithm for channel assignment
The DMP class handles the control flow after the initialization of DGA.
Authors: Simon Seif <seif.simon@googlemail.com>,
Felix Juraschek <fjuraschek@gmail.com>
Copyright 2008-... | des-testbed/des_chan_algorithms | dga/dmp.py | Python | gpl-3.0 | 27,779 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import markupfield.fields
class Migration(migrations.Migration):
dependencies = [
('cal', '0005_attachment_comment'),
]
operations = [
migrations.AddField(
model_name='ta... | csebastian2/study | cal/migrations/0006_auto_20151211_0747.py | Python | gpl-3.0 | 940 |
#!/usr/bin/env python
#
# Calculate the change in the betweenness centrality of each residue over the
# course of an MD simulation
#
# Script distributed under GNU GPL 3.0
#
# Author: David Brown
# Date: 17-11-2016
import argparse, calc_delta
from lib.cli import CLI
from lib.utils import Logger
def main(args):
... | RUBi-ZA/MD-TASK | calc_delta_BC.py | Python | gpl-3.0 | 1,043 |
#!/usr/bin/env python3
# Exits with exit code 0 (i.e., allows sleep) if all load averages
# (1, 5, 15 minutes) are below ``MAX_IDLE_LOAD``.
from os import getloadavg
MAX_IDLE_LOAD = .09
def check_load(time_span, load):
if load > MAX_IDLE_LOAD:
print(
" Won't sleep because %i minute load average" % time_... | lpirl/autosuspend | autosuspend.pre/200-ensure-low-loadavg.py | Python | gpl-3.0 | 507 |
#!/usr/bin/env python
# -*- coding: utf-8 *-*
import pygame
from const import *
class MultiSprite(object):
def __init__(self, path, res_x, res_y=None, offX=0, offY=0, gX=0, gY=0):
"""path = file path of the Multi sprite.
res_x and res_y are the X, Y size of each sub sprite.
offX and offY can specify an ... | r41d/flaming-octo-geezus | src/sprites.py | Python | gpl-3.0 | 1,802 |
# -*- coding: utf-8 -*-
# providerbootstrapper.py
# Copyright (C) 2013 LEAP
#
# 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 ver... | andrejb/bitmask_client | src/leap/bitmask/provider/providerbootstrapper.py | Python | gpl-3.0 | 16,068 |
from lxml import etree
import requests
import re
#coding utf-8
def getResource(word):
r = requests.get("http://www.dictionaryapi.com/api/v1/references/learners/xml/"+word+"?key=508b6e11-3920-41fe-a57a-d379deacf188")
return r.text[39:]
def isWord(entry,word):
g=re.compile(entry)
return re.fullmatch(word... | jzcxer/0Math | python/dictionary/Merriam_Webster_api.py | Python | gpl-3.0 | 987 |
from qit.base.type import Type
class File(Type):
pass_by_value = True
def build(self, builder):
return "FILE*"
| spirali/qit | src/qit/base/file.py | Python | gpl-3.0 | 133 |
# Author: Travis Oliphant
# 1999 -- 2002
import sigtools
from scipy import linalg
from scipy.fftpack import fft, ifft, ifftshift, fft2, ifft2, fftn, \
ifftn, fftfreq
from numpy import polyadd, polymul, polydiv, polysub, roots, \
poly, polyval, polyder, cast, asarray, isscalar, atleast_1d, \
on... | jrversteegh/softsailor | deps/scipy-0.10.0b2/scipy/signal/signaltools.py | Python | gpl-3.0 | 49,881 |
#! /usr/bin/python
# _*_ coding: utf-8 _*_
#
# Dell EMC OpenManage Ansible Modules
#
# Copyright © 2017 Dell Inc. or its subsidiaries. All rights reserved.
# Dell, EMC, and other trademarks are trademarks of Dell Inc. or its
# subsidiaries. Other trademarks may be trademarks of their respective owners.
#
# This progra... | anupamaloke/Dell-EMC-Ansible-Modules-for-iDRAC | library/dellemc_idrac_nic.py | Python | gpl-3.0 | 16,156 |
# -*- coding: utf-8 -*-
import os
import sys
sys.path.append(os.path.join(os.getcwd(), os.path.pardir))
import unittest
from digraph import digraph
from graph import graph
from graph_algorithms import *
class test_graph(unittest.TestCase):
def setUp(self):
self.gr = graph()
self.gr.add_nodes(["s... | NicovincX2/Python-3.5 | Algorithmique/Algorithme/Algorithme de la théorie des graphes/graph_algorithms_test.py | Python | gpl-3.0 | 5,705 |
import random
import math
import collections
import tree_decomposition as td
import create_production_rules as pr
import graph_sampler as gs
import stochastic_growth
import probabilistic_growth
import net_metrics
import matplotlib.pyplot as plt
import product
import networkx as nx
import numpy as np
import snap
#G =... | abitofalchemy/hrg_nets | karate_chop.py | Python | gpl-3.0 | 4,865 |
#!/usr/bin/python
print " __ "
print " |__|____ ___ __ "
print " | \__ \\\\ \/ / "
print " | |/ __ \\\\ / "
print " /\__| (____ /\_/ "
print " \______| \/ "
p... | nomad-vino/SPSE-1 | Module 5/x5_7.py | Python | gpl-3.0 | 1,696 |
from django.test import TestCase, tag
from member.tests.test_mixins import MemberMixin
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from django.urls.base import reverse
from enumeration.views import DashboardView, ListBoardView
class TestEnumeration(MemberMixin, TestCas... | botswana-harvard/bcpp | bcpp/tests/test_views/test_enumeration.py | Python | gpl-3.0 | 3,020 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2003 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Eric6 Documentation Generator.
This is the main Python script of the documentation generator. It is
this script that gets called via the source documentation interface.
This script can be used... | davy39/eric | eric6_doc.py | Python | gpl-3.0 | 15,567 |
from .circumcision_model_mixin import CircumcisionModelMixin
from .crf_model_mixin import CrfModelManager, CrfModelMixin
# CrfModelMixinNonUniqueVisit
from .detailed_sexual_history_mixin import DetailedSexualHistoryMixin
from .hiv_testing_supplemental_mixin import HivTestingSupplementalMixin
from .mobile_test_model_mix... | botswana-harvard/bcpp-subject | bcpp_subject/models/model_mixins/__init__.py | Python | gpl-3.0 | 523 |
import urllib
import urllib2
import xml.dom.minidom
import re
import socket
from util import hook
chatbot_re = (r'(^.*\b(taiga|taigabot)\b.*$)', re.I)
@hook.regex(*chatbot_re)
@hook.command
def chatbot(inp, reply=None, nick=None, conn=None):
inp = inp.group(1).lower().replace('taigabot', '').replace('taiga', '').r... | FrozenPigs/Taigabot | plugins/_broken/chatbot.py | Python | gpl-3.0 | 874 |
"""Smoke tests to check installation health
:Requirement: Installer
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Installer
:Assignee: desingh
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import re
import pytest
from robottelo import ssh
from robottelo.config import settin... | jyejare/robottelo | tests/foreman/installer/test_installer.py | Python | gpl-3.0 | 60,651 |
from operator import itemgetter
__author__ = 'davide'
def pairwise(l):
for t in zip(l, l[1:]):
yield t
def pijavskij(f, L, a, b, eps=1E-5):
l = [(a, f(a)), (b, f(b))]
while True:
imin, Rmin, xmin = -1, float("inf"), -1
for i, t in enumerate(pairwise(l)):
... | DavideCanton/Python3 | num/pijavskij.py | Python | gpl-3.0 | 830 |
# -*- coding: utf-8 -*-
#
# API configuration
#####################
DEBUG = False
# Top-level URL for deployment. Numerous other URLs depend on this.
CYCLADES_BASE_URL = "https://compute.example.synnefo.org/compute/"
# The API will return HTTP Bad Request if the ?changes-since
# parameter refers to a point in time ... | grnet/synnefo | snf-cyclades-app/synnefo/app_settings/default/api.py | Python | gpl-3.0 | 8,466 |
#!/usr/bin/env python
digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
found = True
while found:
input_string = input('Please give me some digits... \n')
found = False
for character in input_string:
if character not in digits:
# we have a non digit!
print('Error, ... | veltzer/demos-python | src/exercises/basic/digits_report/solution9.py | Python | gpl-3.0 | 433 |
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.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 License as published by
# the Free Software Foundation, either version 3 of the Lice... | phw/weblate | weblate/formats/tests/test_convert.py | Python | gpl-3.0 | 4,423 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# HiPart is a program to analyze the electronic structure of molecules with
# fuzzy-atom partitioning methods.
# Copyright (C) 2007 - 2012 Toon Verstraelen <Toon.Verstraelen@UGent.be>
#
# This file is part of HiPart.
#
# HiPart is free software; you can redistribute it and/... | molmod/hipart | hipart/gint/tests/test_gaux.py | Python | gpl-3.0 | 1,117 |
#!/usr/bin/env python
import numpy as np
def tran_op(op, tmat):
"""
transform quantum operator from representation A to
another representation B
Args:
op: the matrix form of operator in representation A
tmat: the unitary transform matrix
"""
return np.dot(np.dot(np.co... | quanshengwu/wannier_tools | utility/wannhr_symm/lib/tran.py | Python | gpl-3.0 | 13,790 |
import textacy.texts as ttx
import textacy.preprocess as pre
import feedparser as fp
class FeedCorpus(ttx.TextCorpus):
"""
Extends textacy TextCorpus with methods for feeds
"""
def from_feed(self, url):
fdict = fp.parse(url)
for entry in fdict.entries:
# Each entry may have... | morrna/RSStacy | RSStacy.py | Python | gpl-3.0 | 862 |
#!/usr/bin/python
AGO_TELLSTICK_VERSION = '0.0.9'
"""
############################################
#
# Tellstick Duo class
#
# Date of origin: 2014-01-25
#
__author__ = "Joakim Lindbom"
__copyright__ = "Copyright 2014, Joakim Lindbom"
__credits__ = ["Joakim Lindbom", "The ago control team"]
__license__ = "GP... | JoakimLindbom/ago | tellstick/tellstickduo.py | Python | gpl-3.0 | 7,092 |
# EMU code from https://github.com/rainforestautomation/Emu-Serial-API
from emu import *
import sys
import json
import msgpack
from xbos import get_client
from bw2python.bwtypes import PayloadObject
import time
with open("params.json") as f:
try:
params = json.loads(f.read())
except ValueError as e:
... | SoftwareDefinedBuildings/bw2-contrib | driver/emu2/driver.py | Python | gpl-3.0 | 2,380 |
# -*- coding: utf-8 -*
# Filename: div.py
__author__ = 'Piratf'
from pygame.locals import *
import pygame
class Div(object):
"""small panel in the frame"""
def __init__(self, (width, height), (x, y) = (0, 0)):
# super(Div, self).__init__()
self.width = width
self.height = height
... | piratf/Game_Boxes | lib/div.py | Python | gpl-3.0 | 404 |
# -*- coding: utf-8 -*-
import ConfigParser, sys, os, urllib2, json, time, shutil, filecmp
import Levenshtein
config = ConfigParser.ConfigParser()
config.read("config.ini")
def clean(chaine):
#print chaine
return chaine.lower().strip()
def decode(chaine):
chaine = chaine.replace(u"\u2018", "'").replace(u"... | pdevetto/misc | lastfm/playlist.py | Python | gpl-3.0 | 7,352 |
from api.callers.api_caller import ApiCaller
class ApiSystemStats(ApiCaller):
endpoint_url = '/system/stats'
endpoint_auth_level = ApiCaller.CONST_API_AUTH_LEVEL_DEFAULT
request_method_name = ApiCaller.CONST_REQUEST_METHOD_GET
| PayloadSecurity/VxAPI | api/callers/system/api_system_stats.py | Python | gpl-3.0 | 241 |
import sys, os, json, time
from shapely.geometry import Polygon
# http://toblerity.org/shapely/manual.html
contains = {}
intersects = {}
dPoly = {}
unmatched = []
TRACTCOL = 'BoroCT2010' # rename this for 2000 census
def addPoly(coords):
polys = []
if (isinstance(coords[0][0], float)):
polys.append(P... | capntransit/tract2council | tract2council.py | Python | gpl-3.0 | 2,643 |
# AsteriskLint -- an Asterisk PBX config syntax checker
# Copyright (C) 2015-2016 Walter Doekes, OSSO B.V.
#
# 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
... | ossobv/asterisklint | asterisklint/__init__.py | Python | gpl-3.0 | 1,096 |
from __future__ import print_function
from __future__ import division
import numpy as np
np.set_printoptions(threshold=np.inf)
import matplotlib.pyplot as plt
from matplotlib import cm
# from mpl_toolkits.mplot3d import axes3d
from matplotlib.colors import LogNorm
# import time
import math
# import cPickle
import gym... | febert/DeepRL | q_learning_sarsa/dqn_learning.py | Python | gpl-3.0 | 22,540 |
import re
from utilRegex import database
class regex:
def __init__(self, botCfg):
"""class initialization function
"""
#intitialize database variables
self.db = database()
#initialize regex variables
self.phrase = ''
self.url = ''
#initialize s... | stickybath/BetaMaleBot | src/utilRegex/regex.py | Python | gpl-3.0 | 2,247 |
from django.core.management.base import BaseCommand
from django.db.models import Q
from ajapaik.ajapaik.models import Album
class Command(BaseCommand):
help = 'Connects to TartuNLP API and retrieves neuro machine translations for empty name fields'
def handle(self, *args, **options):
albums = Album.... | Ajapaik/ajapaik-web | ajapaik/ajapaik/management/commands/tartunlp_on_all_albums.py | Python | gpl-3.0 | 963 |
#!/usr/bin/env python
# Wheat price prediction using Baysian classification.
# Version 1.0
# Christophe Foyer - 2016
from xlrd import open_workbook
import random
import math
#set filename:
filename = 'Wheat-price-data.xlsx'
#import wheat price data (will automate downloading later, probably a different script tha... | Christophe-Foyer/Naive_Bayes_Price_Prediction | Old files and backups/Naive Bayes Classifier - Copie.py | Python | gpl-3.0 | 7,147 |
""" A SpriteSheet is the overall collection of individual frames (which may be spread across files) that define one layer of the final sprite.
"""
from models.sprite_action import SpriteAction
class SpriteSheet():
def __init__( self, data, group_name ):
if "file_path" not in data:
raise "file_... | xaroth8088/sprite-magic | models/sprite_sheet.py | Python | gpl-3.0 | 1,116 |
from pupa.scrape import Jurisdiction, Organization
from .people import IDPersonScraper
from .committees import IDCommitteeScraper
from .bills import IDBillScraper
class Idaho(Jurisdiction):
"""
IDAHO Scraper
"""
division_id = "ocd-division/country:us/state:id"
classification = "government"
n... | cliftonmcintosh/openstates | openstates/id/__init__.py | Python | gpl-3.0 | 4,242 |
#coding: UTF-8
'''This script would guide the seafile admin to setup seafile with MySQL'''
import sys
import os
import time
import re
import shutil
import glob
import subprocess
import hashlib
import getpass
import uuid
import warnings
import MySQLdb
from ConfigParser import ConfigParser
try:
import readline # ... | Chilledheart/seafile | scripts/setup-seafile-mysql.py | Python | gpl-3.0 | 43,261 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-21 06:20
from __future__ import unicode_literals
from django.db import migrations
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('laboratory', '0034_group_perms'),
]
op... | solvo/organilab | src/laboratory/migrations/0035_auto_20180621_0020.py | Python | gpl-3.0 | 694 |
# -*- coding: utf-8 -*-
import re
import time
import pycurl
from module.network.HTTPRequest import BadHeader
from ..internal.Account import Account
class OneFichierCom(Account):
__name__ = "OneFichierCom"
__type__ = "account"
__version__ = "0.23"
__status__ = "testing"
__description__ = """1fi... | thispc/download-manager | module/plugins/accounts/OneFichierCom.py | Python | gpl-3.0 | 2,134 |
# vi: ts=4 expandtab
#
# Copyright (C) 2014 Amazon.com, Inc. or its affiliates.
#
# Author: Jeff Bauer <jbauer@rubic.com>
# Author: Andrew Jorgensen <ajorgens@amazon.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License versio... | henrysher/aws-cloudinit | cloudinit/config/cc_salt_minion.py | Python | gpl-3.0 | 2,541 |
# -*- coding: utf-8 -*-
__author__ = """Kevin Wierman"""
__email__ = 'kevin.wierman@pnnl.gov'
__version__ = '0.1.0'
| HEP-DL/root2hdf5 | root2hdf5/__init__.py | Python | gpl-3.0 | 117 |
# -*- coding: utf-8 -*-
from ..provider.g5k import G5K
from constants import SYMLINK_NAME
from functools import wraps
import os
import yaml
import logging
def load_env():
env = {
'config' : {}, # The config
'resultdir': '', # Path to the result directory
'config_file' : '', # The i... | NHebrard/ham-multisite | ham/utils/hamtask.py | Python | gpl-3.0 | 1,998 |
'''Enhanced Thread with support for return values and exception propagation.'''
# Copyright (C) 2007 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@ubuntu.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 ... | Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/apport/REThread.py | Python | gpl-3.0 | 4,593 |
# pylint: disable=line-too-long, unused-argument
import json
from django.template.loader import render_to_string
def format_reading(probe_name, json_payload):
item = json.loads(json_payload)
status = item['DEVICE_ACTIVE']
if item['DEVICE_ACTIVE'] is True:
status = "Active"
elif item['DEVICE... | cbitstech/Purple-Robot-Django | formatters/features_deviceinusefeature.py | Python | gpl-3.0 | 1,013 |
import numpy as np
import os
import pandas as pa
import scipy.stats as stats
import unittest
from pbsea import PandasBasedEnrichmentAnalysis, EnrichmentAnalysisExperimental, preprocessing_files
from unittest.mock import patch
test_data_directory = 'test_data/'
test_data_directory_cdf = test_data_directory + 'test_cdf... | ArnaudBelcour/liasis | test/test_pbsea.py | Python | gpl-3.0 | 9,677 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name='agarnet',
packages=['agarnet'],
py_modules=['agarnet'],
version='0.2.4',
description='agar.io client and connection toolkit',
install_requires=['websocket-client>=0.32.0'],
aut... | Gjum/agarnet | setup.py | Python | gpl-3.0 | 1,095 |
# Initialization of All Modules of UnivMathSys
# Copyright (C) 2016 Zhang Chang-kai #
# Contact via: phy.zhangck@gmail.com #
# General Public License version 3.0 #
'''Initialization of All Modules'''
from Foundation import *
from Elementary import *
from Structure import *
# End of Initialization of All... | Phy-David-Zhang/UnivMathSys | Technology/TopModuleInit/__init__.py | Python | gpl-3.0 | 329 |
import os
import string
#Enter your username and password below within double quotes
# eg. username="username" and password="password"
username="username"
password="password"
com="wget -O - https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-certificate"
temp=os.popen(com)
msg=temp.read()
ind... | maximilianofaccone/puppy-siberian | root/.conky/gmail.py | Python | gpl-3.0 | 480 |
"""todolist URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | Ketcomp/todolist | source/todolist/urls.py | Python | gpl-3.0 | 821 |
# AsteriskLint -- an Asterisk PBX config syntax checker
# Copyright (C) 2018 Walter Doekes, OSSO B.V.
#
# 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... | ossobv/asterisklint | asterisklint/app/vall/app_originate.py | Python | gpl-3.0 | 1,348 |
#!/usr/bin/env python
import arff
import numpy as np
import sys
from sklearn import preprocessing
#from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.feature_selection import RFE
from sklearn.pipeline import Pipeline
from sklearn.grid_search import GridSea... | bcraenen/KFClassifier | other/methods/ExtraTreesSample.py | Python | gpl-3.0 | 3,466 |
#***************************************************************
#* Name: LMS7002_DCCAL.py
#* Purpose: Class implementing LMS7002 DCCAL functions
#* Author: Lime Microsystems ()
#* Created: 2017-02-10
#* Copyright: Lime Microsystems (limemicro.com)
#* License:
#**********************************************... | bvacaliuc/pyrasdr | plugins/pyLMS7002M/pyLMS7002M/LMS7002_DCCAL.py | Python | gpl-3.0 | 27,053 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, throw
from frappe.utils import flt, cint, add_days, cstr, add_months
import json
from erpnext.accounts.doctype.prici... | shubhamgupta123/erpnext | erpnext/stock/get_item_details.py | Python | gpl-3.0 | 35,632 |
# A simple timer for executing gcode templates
#
# Copyright (C) 2019 Eric Callahan <arksine.code@gmail.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import logging
class DelayedGcode:
def __init__(self, config):
self.printer = config.get_printer()
self.reactor =... | KevinOConnor/klipper | klippy/extras/delayed_gcode.py | Python | gpl-3.0 | 2,248 |
# -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | dnjohnstone/hyperspy | hyperspy/misc/eels/hartree_slater_gos.py | Python | gpl-3.0 | 6,912 |
import facedetect
import cv2
def test_fd():
image = cv2.imread('abba.jpg')
print image.shape
FD = facedetect.FeatureDetect(image)
FD.detectEyes()
FD.detectFace()
print FD.features
if __name__ == '__main__':
test_fd()
| emofeedback/facedetection | tests/test_fd.py | Python | gpl-3.0 | 247 |
# coding=utf-8
import unittest
"""754. Reach a Number
https://leetcode.com/problems/reach-a-number/description/
You are standing at position `0` on an infinite number line. There is a goal
at position `target`.
On each move, you can either go left or right. During the _n_ -th move
(starting from 1), you take _n_ ste... | openqt/algorithms | leetcode/python/lc754-reach-a-number.py | Python | gpl-3.0 | 1,163 |
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2016 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... | crisely09/horton | horton/meanfield/test/test_project.py | Python | gpl-3.0 | 8,371 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from Tkinter import *
from ttk import *
from ScrolledText import ScrolledText as Text
from PIL import Image, ImageTk
import tkFileDialog,os,cairo,tempfile,time,shutil,tkFont
from laveqed import laveqed
from rsvg_windows import rsvg_windows
try:
import rsvg
except ImportErro... | JeanOlivier/Laveqed | gui_laveqed.py | Python | gpl-3.0 | 20,280 |
## INFO ########################################################################
## ##
## plastey ##
## ======= ... | kitchenbudapest/vr | hud.py | Python | gpl-3.0 | 4,413 |
# coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online
OpenAPI spec version: 0.4.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class GetKillmailsKillmailIdKillmailHashInternalServerError(obje... | minlexx/pyevemon | esi_client/models/get_killmails_killmail_id_killmail_hash_internal_server_error.py | Python | gpl-3.0 | 3,191 |
# (c) 2019, Evgeni Golov <evgeni@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, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distr... | ATIX-AG/foreman-ansible-modules | plugins/doc_fragments/foreman.py | Python | gpl-3.0 | 9,183 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''Pychemqt, Chemical Engineering Process simulator
Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@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 Softwar... | jjgomera/pychemqt | lib/mEoS/R114.py | Python | gpl-3.0 | 3,439 |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 3 of the Lic... | amenonsen/ansible | lib/ansible/modules/network/fortios/fortios_firewall_vip6.py | Python | gpl-3.0 | 46,189 |
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from .wizard import Wizard, StateView, StateTransition, StateAction, Button
__all__ = ['Wizard', 'StateView', 'StateTransition', 'StateAction', 'Button']
| openlabs/trytond | trytond/wizard/__init__.py | Python | gpl-3.0 | 297 |
from django import forms
from django.contrib.admin.widgets import AdminDateWidget
from django.forms import ModelForm
from basic.models import *
from battles.models import *
from itertools import chain
def getMemberAsOptions():
members = Member.objects.all()
return [(member.id, member.get_username()) for member in m... | Ralev93/Clan-site | clan_site/battles/forms.py | Python | gpl-3.0 | 1,375 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/ocil_2_0/ChoiceGroupType.py | Python | gpl-3.0 | 1,043 |
from south.db import db
from django.db import models
from albums.models import *
class Migration:
def forwards(self, orm):
# Deleting field 'AlbumItem.slug'
db.delete_column('albums_albumitem', 'slug')
def backwards(self, orm):
# Adding field '... | jgroszko/django-albums | albums/migrations/0011_drop_old_slug.py | Python | gpl-3.0 | 7,471 |
import gobject
from kupfer import pretty
from kupfer.core import settings
from kupfer.core.settings import UserNamePassword
__all__ = [
"UserNamePassword",
"PluginSettings",
"check_dbus_connection",
]
def _is_core_setting(key):
return key.startswith("kupfer_")
class PluginSettings (gobject.GObject, pretty.Outpu... | cjparsons74/Kupfer-cjparsons74 | kupfer/plugin_support.py | Python | gpl-3.0 | 3,958 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# conf.py
"""
Loading a configuration
~~~~~~~~~~~~~~~~~~~~~~~
Various aspects of PyPhi's behavior can be configured.
When PyPhi is imported, it checks for a YAML file named ``pyphi_config.yml`` in
the current directory and automatically loads it if it exists; otherwise ... | wmayner/pyphi | pyphi/conf.py | Python | gpl-3.0 | 27,730 |
# This file is part of the mantidqt package
#
# Copyright (C) 2017 mantidproject
#
# 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) an... | ScreamingUdder/mantid | qt/python/mantidqt/widgets/manageuserdirectories.py | Python | gpl-3.0 | 933 |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
class QuestionSet(models.Model):
'''
Тест. Состоит из нескольких вопросов
'''
author = models.ForeignKey(User, on_delete=models.CASCADE)
title = models.CharField(m... | mxmaslin/Test-tasks | django_test_tasks/old_django_test_tasks/apps/testing/models.py | Python | gpl-3.0 | 1,778 |
from .synonym import *
| MWisBest/PyBot | Commands/synonym/__init__.py | Python | gpl-3.0 | 23 |
import os
import pwd
import grp
import argparse
import shutil
from twisted.web import server, resource, static, script
from twisted.internet import reactor
from zope.interface import Interface, Attribute, implements
from twisted.python.components import registerAdapter
from twisted.web.server import Sessio... | itsZN/vulnsite | mainserver.py | Python | gpl-3.0 | 2,724 |
import random
import re
from io import BytesIO
from typing import Awaitable, List
import matplotlib.pyplot as plt
import seaborn as sns
from curio.thread import async_thread
from curious.commands import Context, Plugin
from curious.commands.decorators import autoplugin, ratelimit
from yapf.yapflib.style import CreateP... | SunDwarf/Jokusoramame | jokusoramame/plugins/misc.py | Python | gpl-3.0 | 5,938 |
from django.utils.translation import ugettext_lazy as _
from oioioi.base.menu import MenuRegistry
from oioioi.base.permissions import not_anonymous
from oioioi.contests.utils import contest_exists
top_links_registry = MenuRegistry(_("Top Links Menu"), contest_exists & not_anonymous)
| sio2project/oioioi | oioioi/dashboard/menu.py | Python | gpl-3.0 | 286 |
#!/usr/bin/env python
""" Copyright (C) 2012 mountainpenguin (pinguino.de.montana@googlemail.com)
<http://github.com/mountainpenguin/pyrt>
This file is part of pyRT.
pyRT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
t... | mountainpenguin/pyrt | modules/config.py | Python | gpl-3.0 | 5,462 |
"""
Created on Feb 15, 2014
@author: alex
"""
from sqlalchemy import Column
from sqlalchemy.types import SmallInteger
from sqlalchemy.types import Unicode
from .meta import Base
class ParameterType(Base):
"""
classdocs
"""
__tablename__ = 'ParameterTypes'
_id = Column(SmallInteger, primary_key... | AlexanderLang/OpenAutomatedFarm | FarmGUI/farmgui/models/ParameterType.py | Python | gpl-3.0 | 1,237 |
# Copyright 2015 Joel Granados joel.granados@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.
#
# This progra... | borevitzlab/timestreamlib | tests/test_pipeline_yml.py | Python | gpl-3.0 | 3,863 |
#!/usr/bin/env python3
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "arsoft.web.crashupload.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| aroth-arsoft/arsoft-web-crashupload | app/manage.py | Python | gpl-3.0 | 266 |
#
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is d... | mikewiebe-ansible/ansible | lib/ansible/plugins/action/nxos.py | Python | gpl-3.0 | 8,307 |
import os
import unittest
from vsg.rules import ieee
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_500_test_input.vhd'))
lExpected_lower = []
lExpected_lower.append('')
utils.read_file(os.path.join(s... | jeremiah-c-leary/vhdl-style-guide | vsg/tests/ieee/test_rule_500.py | Python | gpl-3.0 | 2,648 |
import numpy as np
from math import floor
from ..weight import RankingBasedSelection
class PBILSelection(RankingBasedSelection):
"""
This selection scheme is used by PBIL and compact GA.
Also, PBIL selection scheme also used in natural gradient update
with Bernoulli distribution. See also,
[Shira... | satuma777/evoltier | evoltier/selection/pbil_selection.py | Python | gpl-3.0 | 1,621 |
import optunity
import numpy as np
import hpolib_generator as hpo
import cloudpickle as pickle
import sklearn.datasets
import random
positive_digit = 2
name='covtype-%d' % positive_digit
num_folds=5
budget = 150
npos = 500
nneg = 1000
search={'logC': [-8, 1], 'logGamma': [-8, 1]}
covtype = sklearn.datasets.fetch_co... | claesenm/optunity-benchmark | benchmarks/optunity/covtype-2.py | Python | gpl-3.0 | 1,022 |
#!/usr/bin/env python2
from glob import glob
import re
import matplotlib.pyplot as plt
import numpy as np
from sys import argv
def get_a1(pattern):
a1 = {}
for fit_file in glob(pattern):
with open(fit_file) as f:
line = f.readline()
coeffs = line.split(' ')
fit_par... | mkawalec/masters | contrib/plot_decay/plot2.py | Python | gpl-3.0 | 1,103 |
# -*- coding: utf-8 -*-
from odoo import models, fields, api
from ./eqpt_equipment import EQPT_TYPES
class Paddler(models.Model):
_name = 'eqpt.paddler'
_description = "Paddler Cycle Equipment"
_description = "Cycle paddler equipment"
eqpt_type = fields.Selection(selection=EQPT_TYPES, string="")
... | RemiFr82/ck_addons | ck_equipment/models/eqpt_paddler.py | Python | gpl-3.0 | 551 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Author(s): Abhijeet Kasurde <akasurde@redhat.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
ANSIBLE_METADATA = {
'metadata_version':... | dataxu/ansible | lib/ansible/modules/cloud/vmware/vmware_local_role_manager.py | Python | gpl-3.0 | 10,915 |
import f311.filetypes as ft
def test_DataFile():
_ = ft.DataFile()
print(_)
def test_FileFits():
_ = ft.FileFits()
print(_)
def test_FilePy():
_ = ft.FilePy()
def test_FileSQLiteDB():
_ = ft.FileSQLiteDB()
def test_FileSpectrum():
_ = ft.FileSpectrum()
print(_)
def test_FileS... | trevisanj/f311 | tests/test_filetypes/test_instantialize_classes_filetypes.py | Python | gpl-3.0 | 507 |
#!/usr/bin/python
# Example using an RGB character LCD wired directly to Raspberry Pi or BeagleBone Black.
import time
import Adafruit_CharLCD as LCD
# Raspberry Pi configuration:
lcd_rs = 27 # Change this to pin 21 on older revision Raspberry Pi's
lcd_en = 22
lcd_d4 = 25
lcd_d5 = 24
lcd_d6 = 23
lcd_d7... | qkzk/sncf_lcd | adafruit_lcd/examples/red.py | Python | gpl-3.0 | 1,310 |
# -*- coding: utf-8 -*-
#
# SRL 5 documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 16 15:51:55 2010.
#
# 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... | SRL/SRL-5 | doc/sphinx/conf.py | Python | gpl-3.0 | 6,360 |
#!/usr/bin/env python
"""
A simple example of how to get or set environment variables from python
"""
import os
print(os.environ['USER'])
if 'HOSTNAME' in os.environ:
print(os.environ['HOSTNAME'])
else:
print(
'you dont have a HOSTNAME in your environment, it is probably just a shell variable')
# le... | veltzer/demos-python | src/examples/short/environment_variables/simple.py | Python | gpl-3.0 | 458 |
#!/usr/bin/env python
from glob import glob
from distutils.core import setup
setup( name="mythutils_recfail_alarm",
version="1.0",
description="Autoamtically notify on Recorder Failed via Prowl service",
author="Wylie Swanson",
author_email="wylie@pingzero.net",
url="http://www.pingzero.net",
scripts=glob("bin/... | wylieswanson/mythutils | mythutils_recfail_alarm/setup.py | Python | gpl-3.0 | 441 |
import copy, time, StringIO
import unittest
from datetime import datetime
from datetime import date
from nive.utils.dataPool2.structure import *
from nive.tests import __local
from nive.utils.dataPool2.tests import test_Base
ftypes = {}
ftypes[u"data2"] = {u"fstr":"string",
u"ftext":"text",
... | nive-cms/nive | nive/utils/dataPool2/tests/test_structure.py | Python | gpl-3.0 | 11,499 |
#!/usr/bin/env python
"""
Copyright (C) 2017, California Institute of Technology
This file is part of addm_toolbox.
addm_toolbox 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, ... | goptavares/aDDM-Toolbox | addm_toolbox/ddm_mla_test.py | Python | gpl-3.0 | 5,299 |
from rest_framework import viewsets, mixins
from .models import Member
from .serializers import MemberSerializer, MemberDetailSerializer
# Team app views.
# All team members
class MembersViewSet (viewsets.ReadOnlyModelViewSet):
serializer_class = MemberSerializer
queryset = Member.objects
def list(self... | aileron-split/aileron-web | server/team/views.py | Python | gpl-3.0 | 4,519 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-14 17:41
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import posgradmin.models
class Migration(migrations.Migration):
dependencies = [
mi... | sostenibilidad-unam/posgrado | posgradmin/posgradmin/migrations/0022_anexoexpediente.py | Python | gpl-3.0 | 975 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.