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 |
|---|---|---|---|---|---|
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
#
# FabLabKasse, a Point-of-Sale Software for FabLabs and other public and trust-based workshops.
# Copyright (C) 2015 Julian Hammer <julian.hammer@fablab.fau.de>
# Maximilian Gaukler <max@fablab.fau.de>
# Timo Voigt <timo@fablab.... | fau-fablab/FabLabKasse | FabLabKasse/UI/PaymentMethodDialogCode.py | Python | gpl-3.0 | 2,875 |
__author__ = 'Debha'
from read_data import read_data, read_map, gene_muts, make_GO_map
from cluster import make_cluster_mat, make_sub_mut_map, make_GO_cluster_mat, cluster_main, clean, pairwiseDist, clustered_GOs, sim_matrix
import numpy as np
data_file = "../inputs/somatic.csv"
map_file = "../inputs/mart_export.csv"... | kspham/coldnet | src/OntologyBasedClustering/code/OBC_main.py | Python | gpl-3.0 | 1,574 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of PyDownTV.
#
# PyDownTV 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) a... | aabilio/PyDownTV | Servers/televigo.py | Python | gpl-3.0 | 2,787 |
from django import forms
from django.core.urlresolvers import reverse
from django.forms.widgets import RadioFieldRenderer
from django.utils.encoding import force_text
from django.utils.html import format_html
from django.utils.safestring import mark_safe
class BootstrapChoiceFieldRenderer(RadioFieldRenderer):
"""... | alirizakeles/tendenci | tendenci/apps/events/widgets.py | Python | gpl-3.0 | 4,968 |
# -- coding: utf-8 --
###########################################################################
# #
# WebText #
# ... | lutcheti/webtext | src/request/backends/BackendWiki.py | Python | gpl-3.0 | 9,114 |
import re, requests, collections, praw, time
words=list()
syl=collections.OrderedDict()
###############################################################################################################
# Generate syllables dictionary using Carnegie Mellon University's pronunciat... | AlexRuizE/haiku_finder_bot | haiku_finder_bot.py | Python | gpl-3.0 | 7,590 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# seriesly - XBMC Plugin
# Conector para Wupload
# http://blog.tvalacarta.info/plugin-xbmc/seriesly/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core import scrapert... | conejoninja/xbmc-seriesly | servers/wupload.py | Python | gpl-3.0 | 11,622 |
#! /usr/bin/env python3
import contextlib
import threading
import mwparserfromhell
import ws.ArchWiki.lang as lang
from ws.utils import LazyProperty
from ws.parser_helpers.title import canonicalize
from ws.parser_helpers.wikicode import get_parent_wikicode, get_adjacent_node
__all__ = ["get_edit_summary_tracker", "... | lahwaacz/wiki-scripts | ws/checkers/CheckerBase.py | Python | gpl-3.0 | 3,021 |
#### initials.py ####
#
# Given a person's name, return the person's initials (uppercase)
#
def get_initials(fullname):
fullname = fullname.split(' ')
initials = ''
# accumulator pattern
for eachName in fullname:
initials = initials + eachName[0].upper()
return initials
def main():
... | e-inquirer/crypto | initials.py | Python | gpl-3.0 | 772 |
#!/usr/bin/python
# coding=utf-8
# region License
# Findeco is dually licensed under GPLv3 or later and MPLv2.
#
################################################################################
# Copyright (c) 2012 Klaus Greff <klaus.greff@gmx.net>
# This file is part of Findeco.
#
# Findeco is free software; you can r... | Qwlouse/Findeco | node_storage/tests/__init__.py | Python | gpl-3.0 | 1,410 |
from main.management.commands._private import SharedCommand
from main.models import Destination
class Command(SharedCommand):
model = Destination
| huseyinkabil/coral-ci | main/management/commands/insert_destination_data.py | Python | gpl-3.0 | 152 |
"""Tests for UnauthenticatedReddit class."""
from __future__ import print_function, unicode_literals
from mock import patch
from praw import handlers
from random import choice
from six.moves import cStringIO
from .helper import PRAWTest, betamax, replace_handler
class HandlerTest(PRAWTest):
def setUp(self):
... | michael-lazar/praw3 | tests/test_handlers.py | Python | gpl-3.0 | 1,274 |
#!/bin/python
# gofed-ng - Golang system
# Copyright (C) 2016 Fridolin Pokorny, fpokorny@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 2
# of the License, or (at y... | gofed/gofed-ng | testsuite/helpers/utils.py | Python | gpl-3.0 | 1,073 |
"""
Fichier main qui lance le programme
"""
from Game import *
game = Game()
game.play()
| Vodak/SINS | src/main.py | Python | gpl-3.0 | 91 |
#-------------------------------------------------------------------------------
# PROJECT: VHDL Code Generator
# NAME: Dynamic AND Gate
#
# LICENSE: GNU-GPL V3
#-------------------------------------------------------------------------------
__isBlock__ = True
__className__ = "ANDGate"
__win__ = "ANDGat... | BlakeTeam/VHDLCodeGenerator | blocks/Standard Library/Gate AND.py | Python | gpl-3.0 | 2,291 |
#
# Copyright (C) 2009, 2010 JAGSAT Development Team (see below)
#
# This file is part of JAGSAT.
#
# JAGSAT 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 ... | arximboldi/jagsat | src/core/error.py | Python | gpl-3.0 | 1,072 |
# -*- coding: utf-8 -*-
"""Unit tests of assorted base data structures and common functions."""
import pytest
from simtools.base import Dict, is_iterable, is_string
def test_is_iterable():
# List of integers
obj = [1, 2, 3]
assert is_iterable(obj) == True
# Tuple of integers
obj = 1, 2, 3
a... | macknowak/simtools | simtools/tests/test_base.py | Python | gpl-3.0 | 1,438 |
# -*- coding: utf-8 -*-
__author__ = 'AminHP'
# python imports
import os
import shutil
import zipfile
import StringIO
import base64
# flask imports
from flask import jsonify, request, g, send_file, abort
# project imports
from project import app
from project.extensions import db, auth
from project.modules.datetime i... | k04la/ijust_server | project/controllers/api_1/contest.py | Python | gpl-3.0 | 51,483 |
#!/usr/bin/python
# Copyright (c) 2015 IBM Corporation
#
# This 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 3 of the License, or
# (at your option) any later version.
#
# This softwar... | StackPointCloud/ansible-modules-extras | cloud/openstack/os_project.py | Python | gpl-3.0 | 6,372 |
from openstates.utils import LXMLMixin
from billy.scrape.votes import VoteScraper, Vote
from billy.scrape.utils import convert_pdf
import datetime
import subprocess
import lxml
import os
import re
journals = "http://www.leg.state.co.us/CLICS/CLICS%s/csljournals.nsf/" \
"jouNav?Openform&%s"
date_re = re.compile(
... | cliftonmcintosh/openstates | openstates/co/votes.py | Python | gpl-3.0 | 12,425 |
from PyQt5 import QtCore
from src.business.configuration.constants import project as p
from src.ui.commons.verification import cb
class ConfigProject:
def __init__(self):
self._settings = QtCore.QSettings(p.CONFIG_FILE, QtCore.QSettings.IniFormat)
def get_value(self, menu, value):
return sel... | pliniopereira/ccd10 | src/business/configuration/configProject.py | Python | gpl-3.0 | 2,363 |
import sys
import typing
import click
import glotaran as gta
from . import util
@click.option('--dataformat', '-dfmt', default=None,
type=click.Choice(gta.io.reader.known_reading_formats.keys()),
help='The input format of the data. Will be infered from extension if not set.')
@click.opti... | glotaran/glotaran | glotaran/cli/commands/optimize.py | Python | gpl-3.0 | 4,194 |
#-------------------------------------------------------------------------
#
# Copyright (c) 2009, IMB, RWTH Aachen.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in simvisage/LICENSE.txt and may be redistributed only
# under the conditions described... | simvisage/oricreate | oricreate/fu/fu_poteng_bending.py | Python | gpl-3.0 | 1,193 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/jorge/tum_simulator_ws/install/include".split(';') if "/home/jorge/tum_simulator_ws/install/include" != "" else []
PROJECT_CATKIN_DEPENDS = "message_runtime".replace(';', ' ')
PKG_CONFIG_LIBRARIE... | aslab/rct | mrt/src/tum_simulator_ws/build/tum_simulator-master/cvg_sim_msgs/catkin_generated/pkg.installspace.context.pc.py | Python | gpl-3.0 | 485 |
from src import model as mdl
class LaTeXPrinter(object):
def __init__(self, target_file_path):
self._target_file_path = target_file_path
def run(self):
with open(self._target_file_path, 'w') as output:
text = self._generate_text()
output.write(text)
def _generate... | diegoberaldin/PyRequirementManager | src/controller/printers.py | Python | gpl-3.0 | 4,793 |
#!/usr/bin/env python3
# Copyright (C) 2013 LiuLang <gsushzhsosgsu@gmail.com>
# Use of this source code is governed by GPLv3 license that can be found
# in the LICENSE file.
from distutils.core import setup
from distutils.core import Command
from distutils.command.clean import clean as distutils_clean
from distutils... | toby20130333/qr-gui | setup.py | Python | gpl-3.0 | 1,183 |
# Copyright (C) 2016
# Jakub Krajniak (jkrajniak at gmail.com)
#
# This file is part of ChemLab
#
# ESPResSo++ 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
# (... | cgchemlab/chemlab | src/tests/test_topology_reader.py | Python | gpl-3.0 | 2,938 |
"""
OpenSfM related utils
"""
import os, shutil, sys, json, argparse
import yaml
from opendm import io
from opendm import log
from opendm import system
from opendm import context
from opendm import camera
from opendm.utils import get_depthmap_resolution
from opendm.photo import find_largest_photo_dim
from opensfm.larg... | OpenDroneMap/OpenDroneMap | opendm/osfm.py | Python | gpl-3.0 | 22,421 |
def search(L, e):
def bSearch(L, e, low, high):
if high == low:
return L[low] == e
mid = (low + high) // 2
if L[mid] == e:
return True
elif L[mid] > e:
if low == mid:
return False
else:
return bSearch(L,... | Rjerk/snippets | python/ICPUP/二分查找.py | Python | gpl-3.0 | 540 |
# vim: tabstop=4 expandtab shiftwidth=4 autoindent
import INN
import datetime
import logging
import logging.handlers
import os
import os.path
import re
import shelve
import sys
import time
import traceback
# In Python2.4, utils was called Utils
try:
from email.utils import parseaddr
except ImportError:
from ... | crooks/PyClean | pyclean.py | Python | gpl-3.0 | 67,006 |
#!/usr/bin/env python
# coding: utf8
# (c) 2014 Dominic Springer
# File licensed under GNU GPL (see HARP_License.txt)
import re
import numpy as np
#look for: import re, re.search
# HOW TO ==================================
# 1) Paste line to https://pythex.org/
# 2) Create function to wrap
#========================... | pixlra/HARP-fork | PythonLib/Regex.py | Python | gpl-3.0 | 961 |
# -*- encoding: utf-8 -*-
"""Test class for Locations UI"""
from fauxfactory import gen_ipaddr, gen_string
from nailgun import entities
from robottelo.config import settings
from robottelo.datafactory import generate_strings_list, invalid_values_list
from robottelo.decorators import run_only_on, tier1, tier2
from robo... | anarang/robottelo | tests/foreman/ui/test_location.py | Python | gpl-3.0 | 34,753 |
"""litchi URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/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-bas... | enfancemill/litchi | litchi/urls.py | Python | gpl-3.0 | 894 |
# https://www.codewars.com/kata/roman-numerals-encoder/train/python
def solution(n):
# Print the arguments
print('n = {}'.format(n))
roman_blueprint = [] # List of lists to store format structure: [[<letter>, <count>], ...]
result = [] # Store the final roman numeral result
# Calculate for roman numerals
# C... | pcampese/codewars | roman_numerals3.py | Python | gpl-3.0 | 3,539 |
################################################################################
## ##
## This file is a part of TADEK. ##
## ... | tadek-project/tadek-common | tadek/core/location.py | Python | gpl-3.0 | 9,460 |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2017 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
# This file is part of the mantidqt package
... | mganeva/mantid | qt/python/mantidqt/widgets/workspacewidget/workspacetreewidget.py | Python | gpl-3.0 | 536 |
from ll1_symbols import *
YAML_OUTPUT = """terminals: %s
non-terminals: %s
eof-marker: %s
error-marker: %s
start-symbol: %s
productions: %s
table: %s"""
YAML_OUTPUT_NO_TABLE = """terminals: %s
non-terminals: %s
eof-marker: %s
error-marker: %s
start-symbol: %s
productions: %s"""
class YamlGenerator(object):
"""docs... | liuxue1990/python-ll1-parser-generator | yaml_generator.py | Python | gpl-3.0 | 1,932 |
"""
Unit tests over SQLite backend for Crash Database
"""
from apport.report import Report
import os
from unittest import TestCase
from sqlite import CrashDatabase
class CrashDatabaseTestCase(TestCase):
def setUp(self):
self.crash_base = os.path.sep + 'tmp'
self.crash_base_url = 'file://' + self.... | icandigitbaby/openchange | script/bug-analysis/test_sqlite.py | Python | gpl-3.0 | 9,687 |
# -*- coding: utf-8 -*-
from django.test import Client
from django.urls import reverse
from nmkapp import views
from .nmk_unit_test_case import NmkUnitTestCase
class ResultsTests(NmkUnitTestCase):
def test_anon_user(self):
"""
Test result view with anonymous user
"""
self.client ... | stalker314314/nasa_mala_kladionica | tests/unit/tests_view_results.py | Python | gpl-3.0 | 772 |
# val for type checking (literal or ENUM style)
from pyrser import fmt
from pyrser.type_system.signature import *
from pyrser.type_system.type_name import *
class Val(Signature):
"""
Describe a value signature for the language
"""
nvalues = 0
valuniq = dict()
def __init__(self, value, tret: s... | payet-s/pyrser | pyrser/type_system/val.py | Python | gpl-3.0 | 1,017 |
import time
from unittest import TestCase
from formalign.settings import CHROME_DRIVER, SERVER_URL
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import pyperclip
from helper_funcs.helpers_test import file_to_string
class BasicUserTestCaseChrome(TestCase):
def setUp(self):
... | globz-eu/formalign | acceptance_tests/pending_tests/test_basic_user_interaction_pending.py | Python | gpl-3.0 | 6,904 |
#!/usr/bin/env python
import os
from os import path
import logging
import shutil
from sqlalchemy import create_engine
from . import config
from .config import TestBase
import taxtastic
from taxtastic.taxonomy import Taxonomy, TaxonIntegrityError
import taxtastic.ncbi
import taxtastic.utils
log = logging
datadir =... | fhcrc/taxtastic | tests/test_taxonomy.py | Python | gpl-3.0 | 10,512 |
# Copyright 2016-2021 Peppy Player peppy.player@gmail.com
#
# This file is part of Peppy Player.
#
# Peppy Player 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 you... | project-owner/Peppy | ui/screen/language.py | Python | gpl-3.0 | 2,333 |
"""Module defining ``Eigensolver`` classes."""
import numpy as np
from gpaw.utilities.blas import axpy
from gpaw.eigensolvers.eigensolver import Eigensolver
from gpaw import extra_parameters
class RMM_DIIS(Eigensolver):
"""RMM-DIIS eigensolver
It is expected that the trial wave functions are orthonormal
... | robwarm/gpaw-symm | gpaw/eigensolvers/rmm_diis_old.py | Python | gpl-3.0 | 4,714 |
# -*- coding:utf-8 -*-
## src/gajim-remote.py
##
## Copyright (C) 2005-2006 Dimitur Kirov <dkirov AT gmail.com>
## Nikos Kouremenos <kourem AT gmail.com>
## Copyright (C) 2005-2014 Yann Leboulanger <asterix AT lagaule.org>
## Copyright (C) 2006 Junglecow <junglecow AT gmail.com>
## ... | irl/gajim | src/gajim-remote.py | Python | gpl-3.0 | 26,570 |
import bpy
from ... base_types.node import AnimationNode
class CombineVectorNode(bpy.types.Node, AnimationNode):
bl_idname = "an_CombineVectorNode"
bl_label = "Combine Vector"
dynamicLabelType = "HIDDEN_ONLY"
def create(self):
self.newInput("Float", "X", "x")
self.newInput("Float", "Y"... | Thortoise/Super-Snake | Blender/animation_nodes-master/nodes/vector/combine_vector.py | Python | gpl-3.0 | 729 |
from os.path import dirname, join, exists, isfile, splitext, basename, isdir, relpath
from nose import SkipTest
from . import BaseTargQC, info
class UnitTests(BaseTargQC):
def test_01_simple(self):
self._test('simple', [self.samples[0]], bams=[self.bams[0]], bed=self.bed4)
def test_02_bed3(self):
... | vladsaveliev/TargQC | tests/test.py | Python | gpl-3.0 | 2,453 |
"""
>>> sd = SliceDump()
>>> sd[1]
1
>>> sd[2:5]
slice(2, 5, None)
>>> sd[:2]
slice(None, 2, None)
>>> sd[7:]
slice(7, None, None)
>>> sd[:]
slice(None, None, None)
>>> sd[1:9:3]
slice(1, 9, 3)
>>> sd[1:9:3, 2:3]
(slice(1, 9, 3), slice(2, 3, N... | YuxuanLing/trunk | trunk/code/study/python/Fluent-Python-example-code/attic/sequences/slice_dump.py | Python | gpl-3.0 | 581 |
print '''
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10,001st prime number?
'''
def problem():
x,limit = 1,0
while limit != 10001:
x += 1
if isprime(x): limit += 1
print x
problem()
| willybh11/python | projectEuler/problems/e7.py | Python | gpl-3.0 | 287 |
# Copyright (C) 2013 Lunatixz
#
#
# This file is part of PseudoTV.
#
# PseudoTV 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.
#
# P... | DrSpaceMonkey/script.pseudotv.live | resources/lib/EPGWindow.py | Python | gpl-3.0 | 58,386 |
'''Created by rj as part of the Pytnam Project'''
from analysis.Reportable import Reportable
class HighPassFilter(Reportable):
def return_as_node(self):
pass
# TODO
| pytnam/pytnam | analysis/processing/HighPassFilter.py | Python | gpl-3.0 | 181 |
#!/usr/bin/python
#coding: utf8
import sys, struct
data_size = 2*1024*1024
if len(sys.argv) != 3:
print 'Using: ./pack_usb.py input.bin output.bin'
sys.exit(0)
fin = file(sys.argv[1], 'rb')
data = fin.read()
print 'Size: %d bytes' % len(data)
if len(data) > data_size-2:
print 'Error: too big'
sys.ex... | petrmikheev/miksys | miksys_soft/pack_usb.py | Python | gpl-3.0 | 662 |
####################################################################################################
#
# PySpice - A Spice Package for Python
# Copyright (C) 2014 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... | thomaslima/PySpice | PySpice/Tools/File.py | Python | gpl-3.0 | 7,812 |
from .stt import ApiRobot
from .stt import BingRobot
from .stt import WatsonRobot
from .stt import WitaiRobot
from .stt import GoogleRobot
class RobotFactory:
@staticmethod
def produce(config, speaker, actions):
configSTT = config['stt']
if configSTT == 'bing':
return BingRobot(confi... | lowdev/alfred | robot/robotFactory.py | Python | gpl-3.0 | 721 |
import threading
import time
from lib.Message import Message
class Bot(threading.Thread):
controller = None
username = None
message = None
status = False
event = None
counter = 0
def __init__ (self, controller, username):
"""
"""
... | GiovanniCardamone/tg-client_2 | lib/bot/Bot.py | Python | gpl-3.0 | 789 |
""" Module matching %GC compo distribution b/w fg and bg. """
import sys
import random
from Bio import SeqIO
from utils import GC
def fg_GC_bins(fg_file):
"""
Compute G+C content for all sequences in the foreground.
It computes the %GC content and store the information in a list. To each
G+C percen... | wassermanlab/BiasAway | GC_compo_matching.py | Python | gpl-3.0 | 10,757 |
import logging
from errbot import BotPlugin, botcmd, SeparatorArgParser, ShlexArgParser
from errbot.backends.base import RoomNotJoinedError
log = logging.getLogger(__name__)
class ChatRoom(BotPlugin):
connected = False
def callback_connect(self):
self.log.info('Connecting bot chatrooms')
i... | gbin/err | errbot/core_plugins/chatRoom.py | Python | gpl-3.0 | 8,056 |
import os
import gflags
from textwrap import dedent
import hashlib
import zipfile
from ..exceptions import UsageError
from ..Bunch import Bunch
from ..TreeScanner import TreeScanner
from ..PakManifest import PakManifest, PakFile, PakFolder
def help():
return dedent("""\
Command Usage: pak install pkg_na... | shearern/pak | src/paklib/cmds/install_cmd.py | Python | gpl-3.0 | 1,786 |
"""
Runs OCR on a given file.
"""
from os import system, listdir
from PIL import Image
from pytesseract import image_to_string
import editdistance
from constants import DATA_DIR
def classify(image, people_class, max_classify_distance=1, min_nonclassify_distance=3):
"""
Runs an OCR classifier on a given image... | kavigupta/61a-analysis | src/ocr.py | Python | gpl-3.0 | 1,475 |
# Copyright 2014-2016 The ODL development group
#
# This file is part of ODL.
#
# ODL 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.
#... | bgris/ODL_bgris | lib/python3.5/site-packages/odl/tomo/backends/scikit_radon.py | Python | gpl-3.0 | 4,830 |
from django.contrib.auth import views as auth
def login(request):
return auth.login(request, template_name="registration/login.haml")
def password_change(request):
return auth.password_change(request, template_name="registration/password_change_form.haml")
def password_change_done(request):
return aut... | Psycojoker/hackeragenda | authentication/views.py | Python | gpl-3.0 | 408 |
import csv
__author__ = "Aaron Eppert <aaron.eppert@packetsled.com>"
def process(options, results, output_handle):
headers = options['select'].split(',')
writer = csv.writer(output_handle)
writer.writerow(headers)
for result in results:
row = []
for header in headers:
if h... | jmdevince/cifpy3 | lib/cif/client/formatters/csv.py | Python | gpl-3.0 | 573 |
# -*- coding: utf-8 -*-
#
# This file is part of the VecNet OpenMalaria Portal.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/vecnet/om
#
# This Source Code Form is subject to the terms of t... | vecnet/om | website/tests/test_views.py | Python | mpl-2.0 | 874 |
#!/usr/bin/env python
# Script to capture the screen with GTK, and format and send
# to a TV backlighting system.
#
# Copyright 2013 Daniel Foote.
#
# 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 Licens... | freefoote/tv-backlight | capture-and-send.py | Python | mpl-2.0 | 7,667 |
# Generated by Django 2.2.13 on 2020-10-23 00:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('community', '0032_accesslevel'),
]
operations = [
migrations.CreateModel(
name='ApiAccess',
... | jeromecc/doctoctocbot | src/community/migrations/0033_apiaccess.py | Python | mpl-2.0 | 2,376 |
#!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at h... | redbear/Espruino | boards/REDBEARDUO.py | Python | mpl-2.0 | 1,944 |
import mock
from nose.tools import eq_, ok_, assert_raises
from collector.unittest.testbase import TestCase
from configman import (
class_converter,
Namespace,
command_line,
ConfigFileFutureProxy,
)
from configman.dotdict import DotDict
from collector.app.socorro_app import (
SocorroApp,
Socor... | willkg/socorro-collector | collector/unittest/app/test_socorro_app.py | Python | mpl-2.0 | 8,093 |
import typing
from pros.conductor import Project
class SystemDevice(object):
def upload_project(self, project: Project, **kwargs):
raise NotImplementedError
def write_program(self, file: typing.BinaryIO, quirk: int = 0, **kwargs):
raise NotImplementedError
| purduesigbots/pros-cli | pros/serial/devices/system_device.py | Python | mpl-2.0 | 285 |
# -*- coding: utf-8 -*-
#
# This file is part of the VecNet OpenMalaria Portal.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/vecnet/om
#
# This Source Code Form is subject to the terms of t... | vecnet/om | sim_services_local/dispatcher.py | Python | mpl-2.0 | 1,944 |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from _... | klahnakoski/MoDataSubmission | pyLibrary/jsons/ref.py | Python | mpl-2.0 | 7,353 |
"""A block Davidson solver for finding a fixed number of eigenvalues.
Adapted from https://joshuagoings.com/2013/08/23/davidsons-method/
"""
import time
from typing import Tuple
import numpy as np
from tqdm import tqdm
def davidson(A: np.ndarray, k: int, eig: int) -> Tuple[np.ndarray, np.ndarray]:
assert len(A.... | berquist/programming_party | eric/project12/davidson.py | Python | mpl-2.0 | 2,084 |
import os
import re
from setuptools import setup, find_packages
THIS_DIR = os.path.dirname(os.path.realpath(__name__))
def read(*parts):
with open(os.path.join(THIS_DIR, *parts)) as f:
return f.read()
def get_version():
return re.findall("__version__ = '([\d\.]+)'",
read('mar... | cstipkovic/spidermonkey-research | testing/marionette/harness/setup.py | Python | mpl-2.0 | 1,214 |
# -*- coding: utf-8 -*-
#
# This file is part of the VecNet OpenMalaria Portal.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/vecnet/om
#
# This Source Code Form is subject to the terms of t... | vecnet/om | website/apps/ts_om/tests/test_run_new.py | Python | mpl-2.0 | 1,914 |
"""Import an Irish NaPTAN XML file, obtainable from
https://data.dublinked.ie/dataset/national-public-transport-nodes/resource/6d997756-4dba-40d8-8526-7385735dc345
"""
import warnings
import zipfile
import xml.etree.cElementTree as ET
from django.contrib.gis.geos import Point
from django.core.management.base import Ba... | stev-0/bustimes.org.uk | busstops/management/commands/import_ie_naptan_xml.py | Python | mpl-2.0 | 4,087 |
# This is added to the reduction object dictionary, but only one reduction
# object per AstroData Type. NOTE: primitives are the member functions of a
# Reduction Object.
localPrimitiveIndex = {
"NIRI": ("primitives_NIRI.py", "NIRIPrimitives"),
"NIRI_IMAGE": ("primitives_NIRI_IMAGE.py", "NIRI_IMAGEPrimitives")... | pyrrho314/recipesystem | trunk/dontload-astrodata_Gemini/RECIPES_Gemini/primitives/primitivesIndex.NIRI.py | Python | mpl-2.0 | 328 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-2013 Elanz (<http://www.openelanz.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | noemis-fr/old-custom | e3z_compute_parent_left_right/__init__.py | Python | agpl-3.0 | 997 |
# -*- encoding: utf-8 -*-
import argparse
import sys
import traceback
from hashlib import md5
import mailchimp_marketing as MailchimpMarketing
import requests
from consolemsg import step, error, success
from erppeek import Client
import time
import configdb
ERP_CLIENT = Client(**configdb.erppeek)
MAILCHIMP_CLIENT =... | Som-Energia/invoice-janitor | admin/Baixa_Socis/unsubscribe_members.py | Python | agpl-3.0 | 4,279 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2018, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | neuroidss/nupic.research | htmresearch/frameworks/location/location_network_creation.py | Python | agpl-3.0 | 17,520 |
from copy import deepcopy, copy
from django.contrib import admin
from django.contrib.admin.views.main import ChangeList
from django.contrib.contenttypes.admin import GenericTabularInline, GenericStackedInline
from django.forms import ModelForm, NumberInput
from django.db import models
class SortableModelAdminBase(obj... | 82Flex/DCRM | suit/sortables.py | Python | agpl-3.0 | 6,638 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-26 10:54
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('news', '0001_initial'),
]
operations = [
migrations.AddField(
... | helfertool/helfertool | src/news/migrations/0002_person_token.py | Python | agpl-3.0 | 478 |
# -*- coding: utf-8 -*-
###############################################################################
# License, author and contributors information in: #
# __manifest__.py file at the root folder of this module. #
########################################################... | mohamedhagag/dvit-odoo | dvit_report_inventory_valuation_multi_uom/wizard/stock_quant_report.py | Python | agpl-3.0 | 6,534 |
"""
This module contains signals related to enterprise.
"""
import logging
import six
from django.conf import settings
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from ent... | stvstnfrd/edx-platform | openedx/features/enterprise_support/signals.py | Python | agpl-3.0 | 5,796 |
from django.core.management.base import BaseCommand, CommandError
from mangaki.models import Work, Rating
from django.db import connection
from django.db.models import Count
from collections import Counter
import sys
class Command(BaseCommand):
args = ''
help = 'Lookup some work'
def handle(self, *args, ... | RaitoBezarius/mangaki | mangaki/mangaki/management/commands/lookup.py | Python | agpl-3.0 | 616 |
"""
Settings for Bok Choy tests that are used when running LMS.
Bok Choy uses two different settings files:
1. test_static_optimized is used when invoking collectstatic
2. bok_choy is used when running the tests
Note: it isn't possible to have a single settings file, because Django doesn't
support both generating sta... | fintech-circle/edx-platform | lms/envs/bok_choy.py | Python | agpl-3.0 | 8,553 |
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
from website.models import Issue
# Create your models here.
class Comment(models.Model):
parent = models.ForeignKey('self', null=True, on_delete=models.CASCADE)
issue = models.ForeignKey(Issue, on_de... | Bugheist/website | comments/models.py | Python | agpl-3.0 | 679 |
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from psycopg2 import ProgrammingError
from openerp.modules.registry import RegistryManager
from openerp.tools import config
from openerp.tests.common import TransactionCase, at_install, post_... | be-cloud-be/horizon-addons | server-tools/database_cleanup/tests/test_database_cleanup.py | Python | agpl-3.0 | 4,939 |
from flask_wtf import FlaskForm
from . import app
from wtforms import StringField, PasswordField, SelectField, DateField, IntegerField
from wtforms.validators import DataRequired, Length, Email, EqualTo, Optional, NumberRange
from wtfrecaptcha.fields import RecaptchaField
from flask_wtf.file import FileField, FileAllow... | lfasmpao/safecore-api | dashboard/forms.py | Python | agpl-3.0 | 4,140 |
"""
Grades related signals.
"""
from django.dispatch import Signal
# Signal that indicates that a user's score for a problem has been updated.
# This signal is generated when a scoring event occurs either within the core
# platform or in the Submissions module. Note that this signal will be triggered
# regardless of ... | itsjeyd/edx-platform | lms/djangoapps/grades/signals/signals.py | Python | agpl-3.0 | 2,050 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Adriano Monteiro Marques
#
# Author: Piotrek Wasilewski <wasilewski.piotrek@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Sof... | umitproject/network-admin | gae_settings.py | Python | agpl-3.0 | 3,537 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10b1 on 2016-09-17 02:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('timeblob', '0006_auto_20160820_1908'),
]
operations = [
migrations.AddField... | dkieffer/timeblob | timeblob/migrations/0007_add_descriptions_to_project_and_tasks.py | Python | agpl-3.0 | 676 |
from builtins import str
from builtins import object
import smtplib
import email.utils
from biomaj.workflow import Workflow
import logging
import sys
if sys.version < '3':
from email.MIMEText import MIMEText
else:
from email.mime.text import MIMEText
class Notify(object):
"""
Send notifications
""... | horkko/biomaj | biomaj/notify.py | Python | agpl-3.0 | 2,306 |
# Copyright 2020 ScyllaDB
#
# This file is part of Scylla.
#
# Scylla is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Scylla... | avikivity/scylla | test/alternator/test_streams.py | Python | agpl-3.0 | 62,504 |
#!/usr/bin/python
# service_http_transport.py
#
# Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io
#
# This file (service_http_transport.py) is part of BitDust Software.
#
# BitDust is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publishe... | vesellov/bitdust.devel | services/service_http_transport.py | Python | agpl-3.0 | 3,776 |
#!/usr/bin/python
import os
# Preliminary bit to get cgi scripts working
def guess_http_host():
hostnames = {
'cloudy': 'objavi.halo.gen.nz',
'vps504': 'objavi.flossmanuals.net',
}
f = open('/etc/hostname')
host = f.read().strip()
f.close()
try:
os.environ['HTTP_HOST']... | esetera/Objavi | tests/make_all_epubs.py | Python | agpl-3.0 | 1,437 |
'''Contains AJAX apps of mother app'''
| piotrmaslanka/bellum | mother/ajax/__init__.py | Python | agpl-3.0 | 39 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('papers', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='conference',
options=... | wadobo/papersplease | papersplease/papers/migrations/0002_auto_20170415_1001.py | Python | agpl-3.0 | 555 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ccx', '0026_auto_20170831_0420'),
('ccx', '0026_auto_20170831_0554'),
]
operations = [
]
| mbareta/edx-platform-ft | lms/djangoapps/ccx/migrations/0027_merge.py | Python | agpl-3.0 | 289 |
# Copyright 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
import re
from django import forms
from django.utils.translation import ugettext as _
from identityprovider.widgets import CommaSeparatedWidget
class CommaSeparatedField(forms.M... | miing/mci_migo | identityprovider/fields.py | Python | agpl-3.0 | 1,229 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import factory
from udata.factories import ModelFactory
from .models import Dataset, Resource, Checksum, CommunityResource, License
from udata.core.organization.factories import OrganizationFactory
from udata.core.spatial.factories import SpatialCovera... | davidbgk/udata | udata/core/dataset/factories.py | Python | agpl-3.0 | 1,823 |
# -*- coding: utf-8 -*-
# © 2017 Comunitea
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api, _
from odoo.tools import float_compare
from lxml import etree
class SaleOrderLineTemplate(models.Model):
_name = 'sale.order.line.template'
_inherit = 'sale.order.... | Comunitea/CMNT_00098_2017_JIM_addons | custom_sale_order_variant_mgmt/models/sale_order.py | Python | agpl-3.0 | 13,669 |