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 |
|---|---|---|---|---|---|
for i in range(int(input())):
lst = input().split()
sounds = set()
while True:
line = input().split()
if len(line) == 3:
sounds.add(line[2])
else:
print(" ".join(filter(lambda x: x not in sounds, lst)))
break
| JonSteinn/Kattis-Solutions | src/What does the fox say/Python 3/whatdoesthefoxsay.py | Python | gpl-3.0 | 281 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of AudioLazy, the signal processing Python package.
# Copyright (C) 2012-2014 Danilo de Jesus da Silva Bellini
#
# AudioLazy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | antiface/audiolazy | examples/keyboard.py | Python | gpl-3.0 | 3,167 |
from testito.testito import testito
__all__ = ['testito'] | Caranarq/01_Dmine | Scripts/testito/__init__.py | Python | gpl-3.0 | 58 |
#-*- coding: utf-8 -*-
# Python version 2.4.2
# Tk version 8.4
# IDLE version 1.1.2
# <<< DROITE et CERCLE d' EULER >>>
# f : facteur d'échelle lié à la résolution de l'écran du PC : on peut
# l'augmenter ou le diminuer
#########################################################
# version 11
# Ce script a été vu, ... | NicovincX2/Python-3.5 | Géométrie/Domaine de la géométrie/Géométrie classique/Géométrie du triangle/cercle-droite_ Euler_pts_Gergonne- Nagel_droite_Simson.py | Python | gpl-3.0 | 34,366 |
#!/usr/bin/env python
#
# Author: Pablo Iranzo Gomez (Pablo.Iranzo@gmail.com)
#
# Description: Script for monitoring host CPU status and VM's rhevm-sdk
# api and produce NAGIOS valid output
#
# Requires rhevm-sdk to work
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | iranzo/rhevm-utils | monitoring/rhev-nagios-table-host-cpu.py | Python | gpl-3.0 | 2,246 |
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
app = QApplication(sys.argv) # تفعيل النافذة من النظام
window = QWidget() # إنشاء متغير من الفصيلة ويدجت (كائن رسومي)
window.setWindowTitle("PyQt5 Application Example") # ضبط عنوان النافذة
window.setToolTip("This is the m... | atamish/PyQt-Examples | lesson03 message_Box.py | Python | gpl-3.0 | 1,952 |
from keras.models import Sequential
from keras.layers import LSTM
from model import Model
import preprocess, argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--train")
args = parser.parse_args()
X_train, X_test, y_train, y_test = preprocess.get_data(args.train)
m ... | vinit-ivar/cognate-learner | run.py | Python | gpl-3.0 | 458 |
'''
Created on 1 Dec 2017
@author: SchilsM
'''
#import sys
import numpy as np
import pandas as pd
import copy as cp
from statsmodels.stats.stattools import durbin_watson
from PyQt5 import QtCore as qt
from PyQt5 import QtGui as gui
from PyQt5 import QtWidgets as widgets
from blitspak.blits_mpl import MplCanvas, Navi... | ubenu/Blits | src/blitspak/simulate_dialog.py | Python | gpl-3.0 | 40,036 |
# Copyright (C) 2010 by Kevin Saff
# This file is part of the CA scanner.
# The CA scanner 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... | kcsaff/CA | src/topologies/projective_plane.py | Python | gpl-3.0 | 915 |
# absent_children.py
# first we need to open the name file so we know what the names of the children
# are
# create or append to a file the names of absent children
# we need to read from this file later
# create a variable to store the cursors starting position
# ask the user for todays date
# for every name in t... | cowlingj/an-introduction-to-programming-with-python | exercises/absent_children.py | Python | gpl-3.0 | 631 |
# genomic.py - Support for genomic (chromosomal DNA) sequences
# Authors:
# * Erich Blume <blume.erich@gmail.com>
#
# Copyright 2011 Erich Blume <blume.erich@gmail.com>
#
# This file is part of Tiger Lily.
#
# Tiger Lily is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... | eblume/Tiger-Lily | tigerlily/sequences/genomic.py | Python | gpl-3.0 | 13,266 |
from datetime import datetime
import pytest
from django.urls import reverse
from freezegun import freeze_time
from rest_framework import status
from rest_framework.fields import DateTimeField
from rest_framework.test import APIClient
from fixturedb.factories.win import create_win_factory
from test_helpers.hawk_utils ... | UKTradeInvestment/export-wins-data | datasets/tests/test_views.py | Python | gpl-3.0 | 42,968 |
"""
################################################################################
# Copyright (c) 2003, Pfizer
# Copyright (c) 2001, Cayce Ullman.
# Copyright (c) 2001, Brian Matthews.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provid... | ruibarreira/linuxtrail | usr/lib/python2.7/dist-packages/SOAPpy/SOAPBuilder.py | Python | gpl-3.0 | 24,950 |
import numpy as np
from scipy.stats import norm
import unittest2 as unittest
import six
from abc import ABCMeta
from kafe2 import CustomFit, HistContainer, HistFit, IndexedFit, MultiFit, XYFit
from kafe2.test.tools import calculate_expected_fit_parameters_xy
from kafe2.test.fit.test_fit import AbstractTestFit
from kaf... | dsavoiu/kafe2 | kafe2/test/fit/test_fit_multi.py | Python | gpl-3.0 | 31,916 |
from __future__ import with_statement
__license__ = 'GPL 3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import socket, time, atexit
from collections import defaultdict
_server = None
def get_all_ips():
''' Return a mapping of interface names to the configurati... | yeyanchao/calibre | src/calibre/utils/mdns.py | Python | gpl-3.0 | 4,250 |
import os
import math
import sys
import json
import numpy as np
import scipy as scp
import scipy.stats as stats
from outliers import smirnov_grubbs as grubbs
from sklearn import metrics
def filter(i, j):
if len(truePsi[i]) < 40:
if mask[i][j] > 0:
return True
return False
def statFilter()... | JY-Zhou/FreePSI | scripts/evaluateqRTPCRPsi.py | Python | gpl-3.0 | 2,147 |
# 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 GetAlliancesAllianceIdIconsOk(object):
"""
NOTE: T... | minlexx/pyevemon | esi_client/models/get_alliances_alliance_id_icons_ok.py | Python | gpl-3.0 | 3,738 |
# 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 +
# pylint: disable=invalid-name
"""
Tube Calib... | mganeva/mantid | scripts/Calibration/Examples/TubeCalibDemoMerlin.py | Python | gpl-3.0 | 12,322 |
'''
Task Coach - Your friendly task manager
Copyright (C) 2004-2010 Task Coach developers <developers@taskcoach.org>
Task Coach 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
... | wdmchaft/taskcoach | buildlib/bdist_rpm_opensuse.py | Python | gpl-3.0 | 1,795 |
#!/bin/python
from __future__ import print_function
import sys
import os
if "-h" in sys.argv:
print("usage: python idbastat.py [scaffold.fa] [10]")
sys.exit()
if len(sys.argv) > 2:
try:
n = int(sys.argv[2])
except:
print("Error in number argument.")
sys.exit()
if os.path.isfile(sys.argv[1]):
myfile = sys... | iskold/fasta-util | bin/statidba.py | Python | gpl-3.0 | 1,351 |
# -*- coding: utf-8 -*-
#
# This file is part of the python-shogi library.
# Copyright (C) 2015- Tasuku SUENAGA <tasuku-s-github@titech.ac>
#
# 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, eith... | gunyarakun/python-shogi | shogi/KIF.py | Python | gpl-3.0 | 12,447 |
import translate.app
import translate.client
import translate.client.exceptions as tce
import translate.app.ratelimit
import time
import requests
import pytest
import json
from multiprocessing import Process
class ResponseTester():
"""Same members as requests.models.Response, easier to construct"""
def __in... | erik/translate | tests/client_test.py | Python | gpl-3.0 | 6,846 |
from setuptools import setup, find_packages
# Warning : do not import the distutils extension before setuptools
# It does break the cythonize function calls
from distutils.extension import Extension
from distutils.sysconfig import get_config_vars
import glob
import os
import platform
import sys
from Cython.Distutils... | pet-project/pet | setup.py | Python | gpl-3.0 | 5,080 |
from MysteryOnline.mopopup import MOPopupBase
from kivy.uix.checkbox import CheckBox
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.app import App
class ChoicePopup(MOPopupBase):
def __init__(self, title_, sender, msg, btn_msg, user, **kwargs):
self.number_of_button... | Moe-Team/MysteryOnline | MysteryOnline/choice.py | Python | gpl-3.0 | 3,693 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-05-04 15:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0005_delete_users'),
]
operations = [
migrations.CreateModel(
... | hiezust/teask | website/migrations/0006_user.py | Python | gpl-3.0 | 934 |
#!/usr/bin/env python
########################################################################
# File : dirac-install-web-portal
# Author : Ricardo Graciani
########################################################################
"""
Do the initial installation of a DIRAC Web portal
"""
from __future__ import absol... | ic-hep/DIRAC | src/DIRAC/Core/scripts/dirac_install_web_portal.py | Python | gpl-3.0 | 773 |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... | Ictp/indico | indico/MaKaC/fileRepository.py | Python | gpl-3.0 | 12,451 |
import model.tile as tile_model
from controller.component import Component
from util import configuration
from view.entity import Entity
class TileMapComponent(Component):
def __init__(self):
super().__init__()
self.tag = 'tile map'
self.map_name = ''
self.map = None
self.t... | monodokimes/pythonmon | controller/component/tile_map_component.py | Python | gpl-3.0 | 944 |
# -*- coding: utf-8 -*-
##############################################################################
#
# SheetMetalBend.py
#
# Copyright 2015 Shai Seger <shaise at gmail dot com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License... | shaise/FreeCAD_SheetMetal | SheetMetalBend.py | Python | gpl-3.0 | 13,662 |
import unittest
from modeful import sign
class SignTestCase(unittest.TestCase):
def test_sign(self):
cases = [(-1000, -1),
(-1, -1),
(0, 1),
(1, 1),
(1000, 1)]
for x, expected in cases:
self.assertEqual... | Modeful/poc | tests/test_modeful.py | Python | gpl-3.0 | 341 |
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import traceback
from ansible.module_utils.basic import miss... | 2ndQuadrant/ansible | lib/ansible/module_utils/influxdb.py | Python | gpl-3.0 | 2,972 |
# coding=utf-8
import numpy as np
import pyqtgraph_karl as pg
import cv2
from dataArtist.widgets.Tool import Tool
def _import():
global PerspectiveGridROI, PC, CalibrationFile, subPixelAlignment, GridDetection
from dataArtist.items.PerspectiveGridROI import PerspectiveGridROI
from imgProce... | radjkarl/dataArtist | dataArtist/figures/image/tools/correct/_BACKUP_PerspCOrrection.py | Python | gpl-3.0 | 20,122 |
# -*- coding: utf-8 -*-
"""
In order to be able to import plugins, the importer function must not be in the module that defines
the Plugin class.
"""
import os, sys, imp
from src.core import utils
Plugin = None
def import_plugins(path=utils.PLUGINS_PATH):
"""
This function searches for plugins in a given path... | dpdani/csu | src/runtime/plugins_importer.py | Python | gpl-3.0 | 2,263 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) Bitergia
#
# 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.
... | sanacl/GrimoireELK | grimoire/ocean/telegram.py | Python | gpl-3.0 | 1,036 |
from pupa.scrape import Jurisdiction, Organization
from openstates.utils import url_xpath
from .bills import AKBillScraper
# from .events import AKEventScraper
from .people import AKPersonScraper
# from .committees import AKCommitteeScraper
settings = dict(SCRAPELIB_TIMEOUT=600)
class Alaska(Jurisdiction):
div... | votervoice/openstates | openstates/ak/__init__.py | Python | gpl-3.0 | 3,296 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in... | didrocks/snapcraft | snaps_tests/demos_tests/test_tomcat_maven_webapp.py | Python | gpl-3.0 | 1,053 |
from load_data import load_binary_diabetes_uci, load_heart_uci, load_breast_cancer, load_adult, load_adult_race
from sklearn import svm
from sklearn.metrics import accuracy_score
import numpy as np
from measures import equalized_odds_measure_TP, equalized_odds_measure_FP, equalized_odds_measure_TP_from_list_of_sensfeat... | jmikko/fairnessML | uncorrelation_no_sensitive.py | Python | gpl-3.0 | 7,728 |
from yowsup.structs import ProtocolTreeNode
from yowsup.layers.protocol_iq.protocolentities import IqProtocolEntity
from .iq_sync import SyncIqProtocolEntity
class GetSyncIqProtocolEntity(SyncIqProtocolEntity):
MODE_FULL = "full"
MODE_DELTA = "delta"
CONTEXT_REGISTRATION = "registration"
CONTEXT_INTER... | waalt/yowsup | yowsup/layers/protocol_contacts/protocolentities/iq_sync_get.py | Python | gpl-3.0 | 2,820 |
# -*- coding: utf-8 -*-
#
# Módulo de autenticações
#
# This file is part of UFUInfo
#
# Copyright (C) 2014 Matheus Silva Santos
#
# UFUInfo is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free S... | mths0x5f/UFUInfo | ufuinfo/auths.py | Python | gpl-3.0 | 3,548 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2020 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... | t-wissmann/qutebrowser | qutebrowser/completion/models/miscmodels.py | Python | gpl-3.0 | 6,958 |
import lib.rust.formulas.libformulas as formulas
def compute_elasticity(data, settings):
hertz, sneddon = [], []
for point in data['calibration_deltas']:
force = point['x']
delta = point['y']
hertz.append({'x': force, 'y': formulas.hertz(force, settings.r,
... | n0npax/turbo-rumcajs | lib/py3rumcajs/algorithms/elasticity.py | Python | gpl-3.0 | 867 |
# coding=utf8
#
"""
category module
"""
import logging
from flask import url_for, redirect
from wheel.core.db import db
from wheel.core.models.signature import LongSlugged
class Category(db.DynamicDocument):
""" """
meta = {'ordering': ['order', 'name']}
name = db.StringField(max_length=255, required... | seraphln/wheel | wheel/core/models/category.py | Python | gpl-3.0 | 1,690 |
"""GtkTemplate implementation for PyGI
Blog post
http://www.virtualroadside.com/blog/index.php/2015/05/24/gtk3-composite-widget-templates-for-python/
Github
https://github.com/virtuald/pygi-composite-templates/blob/master/gi_composites.py
This should have landed in PyGObect and will be available without this shim in... | lutris/lutris | lutris/gui/widgets/gi_composites.py | Python | gpl-3.0 | 9,649 |
# This file is part of Korman.
#
# Korman 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.
#
# Korman is distributed i... | dpogue/korman | korman/operators/op_toolbox.py | Python | gpl-3.0 | 4,648 |
#!/usr/bin/env python
# coding:utf-8
"""
random
"""
import random
def random_choice():
"""
random
"""
thiscontent_list = [
"本周主要进行了攻防技术的持续学习和研究",
"本周主要工作是配合项目有关事情",
"本周主要工作是进行编程技术的学习",
"本周主要进行了项目有关问题的实施",
"本周主要进行了攻防课程的制作"
]
thisexperience_list = [
... | SuperSuperSuperSuper5/everyweak-auto-punch | module/random_report.py | Python | gpl-3.0 | 1,477 |
#!/usr/bin/python3
# Copyright (C) 2014 Harold Grovesteen
#
# This file is part of SATK.
#
# SATK 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 ... | s390guy/SATK | asma/asmcards.py | Python | gpl-3.0 | 28,016 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2016 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, eith... | matejcik/weblate | weblate/lang/views.py | Python | gpl-3.0 | 2,350 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
from autopilot.matchers import Eventually
from testtools.matchers import Equals
from Instagraph import tests
class MainViewTestCase(tests.BaseTestCase):
"""Tests for the mainview"""
def setUp(self):
super(MainViewTestCase, se... | turanmahmudov/Instagraph | Instagraph/tests/autopilot/Instagraph/tests/test_main.py | Python | gpl-3.0 | 674 |
#!/usr/bin/python
#------------------------------------------------------------------------------
# Interface between the SPRITE face and CoRDial, for looking at locations
# Copyright (C) 2017 Elaine Schaertl Short
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | interaction-lab/cordial-public | cordial_face/scripts/face_lookat_server.py | Python | gpl-3.0 | 2,893 |
import sys
from com.l2scoria.gameserver.model.quest import State
from com.l2scoria.gameserver.model.quest import QuestState
from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2scoria.gameserver.network.serverpackets import PledgeShowInfoUpdate
from com.l2scoria.gameserver.network.ser... | zenn1989/scoria-interlude | L2Jscoria-Game/data/scripts/quests/509_TheClansPrestige/__init__.py | Python | gpl-3.0 | 4,844 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of XBMC Mega Pack Addon.
Copyright (C) 2014 Wolverine (xbmcmegapack@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... | xbmcmegapack/plugin.video.megapack.dev | resources/lib/menus/home_countries_malta.py | Python | gpl-3.0 | 1,107 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from netaddr import IPNetwork
from lib import ConversionHelper
from .base import BaseFileParser
from .wrappers import ZmapCsvWrapper
class ZmapCsvParser(BaseFileParser):
"""
This class is meant to parse the contents of a Zmap CSV output file.
... | lavalamp-/ws-backend-community | lib/parsing/zmap.py | Python | gpl-3.0 | 3,060 |
#!/usr/bin/python3.4
"""Check remainder from alphabet and arrange letters to origanl message"""
PIN = int(input("Enter your number: "))
ALPHABET = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", \
"l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
LETTERS = ["a", "b", "c", "d", "e", "f"... | spravo13/python-cipher | decipher.py | Python | gpl-3.0 | 2,111 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | kilon/sverchok | nodes/modifier_change/triangulate.py | Python | gpl-3.0 | 5,319 |
'''
Created on 14 gru 2015
@author: Krzysiek
'''
import urllib2
import argparse
URL = 'https://habitica.com/api/v2/user'
parser = argparse.ArgumentParser(
description='Habitica cron enforcer')
parser.add_argument('user_id', type=str, help='User id guid')
parser.add_argument('api_key', type=str, help='Api key gu... | Tetius/HabiticaCronEnforcer | habitica_cron_enforcer.py | Python | gpl-3.0 | 632 |
import pytest
from stock_tracer.common import transaction
from stock_tracer.model import Stock, Quote
from stock_tracer.operation import QueryQuoteOperation
from stock_tracer.test.base import DBUnitTest
class TestQueryQuote(DBUnitTest):
"""Test QueryQuote operation"""
def test_query_quote_succeed(self):
... | ning-yang/stock_tracer | test/operation/test_query_quote.py | Python | gpl-3.0 | 1,238 |
#!/usr/bin/env python3
#This file is part of Hangman.
#
#Hangman 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.
#
#Hangman is distributed... | faissaloo/hangman | main.py | Python | gpl-3.0 | 3,375 |
#!/usr/bin/env python
"""
reid19_rotcurve.py
Utilities involving the Universal Rotation Curve (Persic+1996) from
Reid+2019, with re-done analysis by Wenger+2020. Including HMSFR
peculiar motion.
Copyright(C) 2017-2020 by
Trey V. Wenger; tvwenger@gmail.com
GNU General Public License v3 (GNU GPLv3)
This program is fr... | tvwenger/kd | kd/reid19_rotcurve.py | Python | gpl-3.0 | 7,121 |
# -- coding: utf-8 --
###########################################################################
# #
# WebText #
# ... | lutcheti/webtext | src/request/handleSMS.py | Python | gpl-3.0 | 7,923 |
"""Tests for psychopy.data.DataHandler"""
from __future__ import print_function
from builtins import str
from builtins import range
from builtins import object
import os, glob
from os.path import join as pjoin
import shutil
from tempfile import mkdtemp, mkstemp
import numpy as np
import io
import json_tricks
import pyt... | hoechenberger/psychopy | psychopy/tests/test_data/test_TrialHandler2.py | Python | gpl-3.0 | 14,876 |
# -*- coding: utf-8 -*-
"""
Created on Thu May 18 15:54:33 2017
@author: Shabaka
"""
import pandas as pd
import numpy as np
from bokeh.io import output_file, show
from bokeh.plotting import figure
from bokeh.plotting import ColumnDataSource
from bokeh.layouts import gridplot
from bokeh.layouts import row, column
f... | qalhata/Python-Scripts-Repo-on-Data-Science | DatVis_Bokeh_CaseStudy_App_Build_5.py | Python | gpl-3.0 | 7,459 |
import re
from visidata import VisiData, vd, Progress, TableSheet, IndexSheet, ItemColumn, ColumnItem
@VisiData.api
def open_rec(vd, p):
return RecIndexSheet(p.name, source=p)
def decode_multiline(line, fp):
'Parse *line* and lookahead into *fp* as iterator for continuing lines. Return (multiline, next_lin... | saulpw/visidata | visidata/loaders/rec.py | Python | gpl-3.0 | 4,842 |
# oppia/admin.py
from django.contrib import admin
from oppia.models import Course, Section, Activity, Tracker, Media, Cohort, CourseManager
from oppia.models import Participant, Tag, CourseTag
from oppia.models import Badge, Award, Points, AwardCourse
from oppia.models import CourseCohort
class TrackerAdmin(admin.Mod... | DigitalCampus/django-nurhi-oppia | oppia/admin.py | Python | gpl-3.0 | 2,754 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from flask import current_app
from mini_fiction.templatetags import registry
@registry.simple_tag()
def generate_captcha():
if not current_app.captcha:
return {'cls': None}
return current_app.captcha.generate()
| andreymal/mini_fiction | mini_fiction/templatetags/generate_captcha.py | Python | gpl-3.0 | 279 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, time, json
import sys
from response import Response
from slackclient import SlackClient
from pb_logging import PBLogger
logger = PBLogger("Admin")
def run(message_json, args, sc, bot, rmsg):
response_obj = Response(sys.modules[__name__])
if args[0].low... | PantherHackers/PantherBot | scripts/admin.py | Python | mpl-2.0 | 3,241 |
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | rebstar6/servo | python/servo/post_build_commands.py | Python | mpl-2.0 | 9,269 |
# 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/.
#
# Copyright (c) 2015-2018 Digi International Inc. All rights reserved.
import unittest
from devicecloud import Device... | digidotcom/python-devicecloud | devicecloud/test/unit/test_ws.py | Python | mpl-2.0 | 1,345 |
import logging
import time
from typing import List
from community.models import Community
from bot.tweepy_api import get_api
from moderation.models import UserCategoryRelationship, SocialMedia, SocialUser
from moderation.social import update_social_ids
from community.helpers import (
get_community_bot_socialuser,
... | jeromecc/doctoctocbot | src/bot/bin/friendship.py | Python | mpl-2.0 | 5,645 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-22 00:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_U... | vecnet/om | website/apps/ts_om/migrations/0001_initial.py | Python | mpl-2.0 | 5,503 |
#!/usr/bin/env python
# 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/.
import json
import os
import tempfile
import unittest
from StringIO import StringIO
import mozun... | Yukarumya/Yukarum-Redfoxes | python/mozbuild/mozbuild/test/test_mozinfo.py | Python | mpl-2.0 | 8,480 |
#!/usr/bin/env python
# -*- coding=utf-8 -*-
## AuthCurity One Time Password
## Author: Greg Rich <gregrich at gmail dot com>
## https://github.com/g-rich/AuthCurity
## License: Mozilla Public License (MPL) Version 2
"""
Usage:
import user_info
user_info.getinfo(<OTP user>, <OTP key>, <Domain>)
"""
# Function... | g-rich/AuthCurity | lib/user_info.py | Python | mpl-2.0 | 2,443 |
from django.test import override_settings
from bedrock.wordpress import api
from bedrock.wordpress import models
import pytest
import responses
from pathlib2 import Path
TEST_DATA = Path(__file__).with_name('test_data')
TEST_WP_BLOGS = {
'firefox': {
'url': 'https://blog.mozilla.org/firefox/',
'... | schalkneethling/bedrock | bedrock/wordpress/tests/test_models.py | Python | mpl-2.0 | 3,783 |
import t
from _st import HOST, PORT
from BaruwaAPI.endpoints import ENDPOINTS
from BaruwaAPI.exceptions import BaruwaAPIError
API_PATH = '/api/v1'
BASE_URL = 'http://%s:%s' % (HOST, PORT)
@t.ApiRequest()
def test_list_fallbackservers(api):
orgid = 1
req = api.get_fallbackservers(orgid)
path = ENDPOINTS... | akissa/BaruwaAPI | tests/013-test-fallbackservers.py | Python | mpl-2.0 | 3,613 |
# 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/.
from Queue import PriorityQueue
from scipy.spatial.distance import *
from grid import Grid
def find_path(grid, start_c... | harankumar/MultiDimensionalHeuristics | src/pathfinder.py | Python | mpl-2.0 | 5,368 |
class AuthHandler(object):
"""AuthHandler takes care of devising the auth type and using it"""
{{if .Api.Authorization.Basic}}
HTTP_PASSWORD = 0
{{end}}{{if .Api.Authorization.Header}}
HTTP_HEADER = 1
{{end}}{{if .Api.Authorization.Oauth}}
URL_SECRET = 2
URL_TOKEN = 3
{{end}}
def __init__(self,... | pksunkara/alpaca | templates/python/lib/http_client/auth_handler.py | Python | mpl-2.0 | 2,887 |
# -*- coding: utf-8 -*-
__author__ = 'ONT Applications Group'
__email__ = 'Apps@nanoporetech.com'
__version__ = '0.1.0'
| bsipos/uncle_psl | uncle_PSL/__init__.py | Python | mpl-2.0 | 121 |
# -*- coding: utf-8 -*-
# Copyright 2017 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import djbc_bc24
| open-synergy/opnsynid-l10n-indonesia | l10n_id_djbc_bc24/models/__init__.py | Python | agpl-3.0 | 152 |
from invoke import run, task
@task
def protoc(context):
run("protoc --proto_path=proto --python_out=. `find proto -name '*.proto'`")
| PRIArobotics/HedgehogUtils | tasks.py | Python | agpl-3.0 | 139 |
# pylint: disable=no-member
"""
Unit tests for the Mixed Modulestore, with DDT for the various stores (Split, Draft, XML)
"""
from collections import namedtuple
import datetime
import logging
import ddt
import itertools
import mimetypes
from unittest import skip
from uuid import uuid4
# Mixed modulestore depends on dj... | eestay/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py | Python | agpl-3.0 | 100,968 |
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from decimal import Decimal, InvalidOperation
import pytest
from django import forms
from django.co... | taedori81/shoop | shoop_tests/admin/test_percentage_field.py | Python | agpl-3.0 | 1,338 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2022 GEM Foundation
#
# OpenQuake 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... | gem/oq-engine | openquake/commands/sample.py | Python | agpl-3.0 | 4,331 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2015 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud 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 v... | jpajuelo/wirecloud | src/wirecloud/commons/utils/template/parsers/rdf.py | Python | agpl-3.0 | 36,396 |
from . import dhl_generator
| factorlibre/carrier-delivery | delivery_carrier_file_dhl/generator/__init__.py | Python | agpl-3.0 | 28 |
"""
A User Scope Resolver that can be used by edx-notifications
"""
import logging
from student.models import CourseEnrollment
from edx_notifications.scopes import NotificationUserScopeResolver
from django.contrib.auth.models import User
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyEr... | edx-solutions/edx-platform | common/djangoapps/student/scope_resolver.py | Python | agpl-3.0 | 5,435 |
# This file is part of hb.
#
# hb 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.
#
# hb is distributed in the hope that it will be use... | bencord0/hb | throb/models.py | Python | agpl-3.0 | 689 |
"""
Django settings for codesy project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
import os
import dj_database_url
from decouple import config
# Build path... | codesy/codesy | codesy/settings.py | Python | agpl-3.0 | 7,423 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and... | baloo/shinken | shinken/modules/livestatus_broker/log_line.py | Python | agpl-3.0 | 11,717 |
# -*- coding: utf-8 -*-
# Copyright 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api
class HrEmployee(models.Model):
_inherit = "hr.employee"
@api.depends(
"contract_ids",
"contract_ids.date_start")
@api.mu... | OCA/l10n-indonesia | l10n_id_taxform_employee_joining_period/models/hr_employee.py | Python | agpl-3.0 | 1,585 |
"""
Unittests for the research.models module
"""
from opal.core.test import OpalTestCase
from opal.models import Team
from research import models
class StudySignalTestCase(OpalTestCase):
def test_creates_study_team(self):
models.ResearchStudy.objects.create(name='Test Study')
team = Team.objects.g... | openhealthcare/opal-research | research/tests/test_models.py | Python | agpl-3.0 | 493 |
def split(condition, seq):
conform = []
do_not_conform = []
for x in seq:
if condition(x):
conform.append(x)
else:
do_not_conform.append(x)
return conform, do_not_conform
| amcat/amcat-dashboard | dashboard/util/itertools.py | Python | agpl-3.0 | 229 |
#################################################################################
#
# Copyright (c) 2013 Genome Research Ltd.
#
# Author: Irina Colgiu <ic4@sanger.ac.uk>
#
# 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... | wtsi-hgi/serapis | tests/worker/test_irods_utils.py | Python | agpl-3.0 | 2,548 |
# -*- coding: utf-8 -*-
# © 2004-2010 Tiny SPRL (http://tiny.be)
# © 2014 Elico Corp (https://www.elico-corp.com)
# Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html)
import time
from openerp.report import report_sxw
from openerp import pooler
from itertools import groupby
class sale_order(report_sxw.... | Elico-Corp/openerp-7.0 | l10n_cn_report_sale/report/sale_order.py | Python | agpl-3.0 | 4,600 |
class Event(object):
'''
Class generating taking care of the common event
properties...
'''
def __init__(self,polished_event):
self.data = polished_event
self.duration = 0
def get_observed_event_row(self):
'''
Returns an array corresponding to a line in MOOCdb.ob... | EDUlib/eTracesX | Translation_software/edx_to_MOOCdb_piping/import.openedx.qpipe/events.py | Python | agpl-3.0 | 11,769 |
# -*- coding: utf-8 -*-
import os
from lxml import html
import hashlib
import uuid
from django.core.urlresolvers import reverse
from django.conf import settings
def parse_html(url, content):
"""Parse HTML for the Wall"""
html_element = html.document_fromstring(content)
title = html_element.find('head/tit... | taikoa/wevolver-server | wevolve/libs/utils.py | Python | agpl-3.0 | 2,132 |
"""
Code licensed under the GNU Affero General Public License v3 or later (AGPLv3+)
"""
"""
Handles serial communication with ArduinoStim device
"""
from enum import Enum, unique
import struct
import logging
import threading
import time
import serial
import PySide
import serial.tools.list_ports
@u... | harerama/arduino_stim | arduino_stim/arduinoSerial.py | Python | agpl-3.0 | 4,468 |
from __future__ import generators
from itertools import combinations
from math import sqrt
from numpy import isinf
from scipy.stats.distributions import uniform_gen
from utility.numeric.globals import EPSILON
__author__ = 'keyvan'
DISTRIBUTION_INTEGRAL_LIMIT = 1 - EPSILON
def compute_railway_strength(solutions):
... | zhaozengguang/opencog | opencog/python/spatiotemporal/temporal_events/util.py | Python | agpl-3.0 | 7,334 |
# -*- coding: utf-8 -*-
"""
This is the common settings file, intended to set sane defaults. If you have a
piece of configuration that's dependent on a set of feature flags being set,
then create a function that returns the calculated value based on the value of
FEATURES[...]. Modules that extend this one can change th... | IONISx/edx-platform | cms/envs/common.py | Python | agpl-3.0 | 35,216 |
'''
Created on April 16, 2014
@author: Colin Taylor
Creates train and test datasets for already seperated cohorts
SEB : Only for no_collab cohort
'''
import numpy as np
import time
import random
import csv #SEB
def add_to_data(old_data, new_data):
if old_data == None:
return new_data
else:
return np.concatenat... | EDUlib/eTracesX | Stopout-Prediction/separate_train_test.py | Python | agpl-3.0 | 2,754 |
import csv
from profiles.models import *
print "starting ..."
dataReader = csv.DictReader(open('apps/importer/Email-addresses_060810.csv','rU'), delimiter=',', quotechar='"')
i = 0
admin = User.objects.get(id=1)
for row in dataReader:
# find the faculty member or fail
try:
n_number = row['Id']
... | ParsonsAMT/Myne | datamining/apps/importer/email-activations.py | Python | agpl-3.0 | 804 |
# -*- coding: utf-8 -*-
#
# OpenCraft -- tools to aid developing and hosting free software projects
# Copyright (C) 2015-2019 OpenCraft <xavier@opencraft.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... | open-craft/opencraft | registration/validators.py | Python | agpl-3.0 | 2,513 |