code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/env python3
import unittest
import sys
# Import just to check that dependencies are installed
import markdown # noqa: F401
if __name__ == "__main__":
# Look for all tests. Using test_* instead of test_*.py finds modules (test_syntax and test_indenter).
suite = unittest.TestLoader().discover('.', p... | andreikop/enki | tests/run_all.py | Python | gpl-2.0 | 519 |
#Written by Reid McIlroy-Young for Dr. John McLevey, University of Waterloo 2015
import unittest
import metaknowledge
import metaknowledge.WOS
import os
import filecmp
import networkx as nx
disableJournChecking = True
class TestRecordCollection(unittest.TestCase):
@classmethod
def setUpClass(cls):
met... | networks-lab/metaknowledge | metaknowledge/tests/test_recordcollection.py | Python | gpl-2.0 | 26,484 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright 2013 Canonical
# Author: Marco Trevisan (Treviño)
#
# 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 Foundati... | foer/linuxmuster-client-unity | tests/autopilot/unity/tests/test_wm_keybindings.py | Python | gpl-3.0 | 8,459 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
class TF1IE(InfoExtractor):
"""TF1 uses the wat.tv player."""
_VALID_URL = r'https?://(?:(?:videos|www|lci)\.tf1|(?:www\.)?(?:tfou|ushuaiatv|histoire|tvbreizh))\.fr/(?:[^/]+/)*(?P<id>[^/?... | vinegret/youtube-dl | youtube_dl/extractor/tf1.py | Python | unlicense | 3,611 |
import os
def url_get(dequeuer, url):
response = dequeuer.get(url)
response_data = response.json()
if 'results' in response_data:
return response_data['results']
else:
return [response_data]
def accumulate(dequeuer, payload, accumulators, url_getter=None):
last_level = [{'payloa... | DroneMapp/powerlibs-aws-sqs-dequeue_to_api | powerlibs/aws/sqs/dequeue_to_api/transformations.py | Python | mit | 1,829 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | alex/warehouse | tests/unit/i18n/test_init.py | Python | apache-2.0 | 1,717 |
import numpy as np
import pytest
from emukit.core import CategoricalParameter, ContinuousParameter, OneHotEncoding, ParameterSpace
from emukit.core.optimization import ContextManager
@pytest.fixture
def space():
return ParameterSpace([ContinuousParameter("x1", 0, 15), ContinuousParameter("x2", 0, 15)])
@pytest... | EmuKit/emukit | tests/emukit/core/optimization/test_context_manager.py | Python | apache-2.0 | 2,005 |
#
# Uncomplicated VM Builder
# Copyright (C) 2010 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# 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.
#
# Th... | cryptorinium/num2 | src/vm-builder-0.12.4+bzr489/build/lib.linux-x86_64-2.7/VMBuilder/plugins/ubuntu/oneiric.py | Python | mit | 798 |
#!/usr/bin/python
# ===========================================================================
# Hatalogico PWM Test for LEDs - powered by Adafruit's Libraries
# -------------------------------------------------
# Date: 22/3/2015
# Stolen By: John Lumley
#
# BIG THANKS TO ADAFRUIT INDUSTRIES FOR MAKING THIS POSSIBLE ... | Jelby/Hatalogico | ledRandom.py | Python | mit | 1,108 |
import unittest
import theano
import theano.tensor as T
class dictionary_output_checker(unittest.TestCase):
def test_output_dictionary(self):
'''
Tests that theano.function works when outputs is a dictionary
'''
x = T.scalar()
f = theano.function([x], outputs={'a': x, 'c... | valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/Theano-0.7.0-py3.4.egg/theano/tests/test_dictionary_output.py | Python | gpl-2.0 | 4,090 |
import re , pprint
#buscar musicas
f = open( "goear.com" , "r+" )
a = f.read()
b = re.findall( "(\d*)\Waudios</a>" , a )
pprint.pprint( b ) | ubaldino/pyloop | expresion_regular.py | Python | agpl-3.0 | 145 |
#!flask/bin/python
# -*- coding: utf-8 -*
import os
basedir = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
DATETIME_FMT = '%Y-%m-%d %H:%M:%S'
CRSF_ENABLED = True
SECRET_KEY = 'tu-... | patrabu/carbu | config.py | Python | gpl-3.0 | 541 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.util.strutil import pluralize
def items_to_report_element(items, item_type):
"""Converts an iterable of items to a (message, detail) pair.
- items: a list of items (... | tdyas/pants | src/python/pants/reporting/reporting_utils.py | Python | apache-2.0 | 989 |
from django.conf.urls import url, include
app_name = 'learner_analytics_api'
urlpatterns = [
url(r'^v0/', include('learner_analytics_api.v0.urls'))
]
| Stanford-Online/edx-analytics-dashboard | analytics_dashboard/learner_analytics_api/urls.py | Python | agpl-3.0 | 155 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright 2012 Canonical
# Author: Marco Trevisan (Treviño)
#
# 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 Foundati... | foer/linuxmuster-client-unity | tests/autopilot/unity/emulators/panel.py | Python | gpl-3.0 | 11,333 |
"""Contains both normal error messages and Python3 porting error messages."""
# pylint: disable=bad-builtin, too-few-public-methods
raise Exception(1) # Error emitted here with the Python 3 checker.
class Test(object):
"""dummy"""
def __init__(self):
return 42
| GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/pylint/test/regrtest_data/py3k_error_flag.py | Python | agpl-3.0 | 293 |
#!/usr/bin/env python3
class GroupElement:
#todo
# invert
def __init__(self, group_table, name):
self._group_table = group_table
self._name = name
#todo
def __mul__(self, other):
pass
#todo
def __pow__(self, integer):
pass
class GroupTableCreator:
#todo
... | Fornost461/drafts-and-stuff | Python/math/algebra/groups/groups.py | Python | cc0-1.0 | 1,607 |
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... | plumgrid/plumgrid-nova | nova/tests/api/openstack/compute/plugins/v3/test_user_data.py | Python | apache-2.0 | 10,280 |
"""
Copyright (C) 2014, 申瑞珉 (Ruimin Shen)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed i... | O-T-L/PyOptimization | pyoptimization/optimizer/crossover.py | Python | lgpl-3.0 | 7,263 |
# -*- coding: utf-8 -*-
# Scrapy settings for qdNews project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/... | lai-bin/webCrawler | scrapy/qdNews/qdNews/settings.py | Python | apache-2.0 | 3,128 |
#!/usr/bin/env python
"""Wrapper to run setup.py using setuptools."""
import os, sys
# now, import setuptools and call the actual setup
import setuptools
try:
execfile('setup.py')
except NameError:
exec( open('setup.py','rb').read() )
| methane/meinheld-zeromq | setupegg.py | Python | bsd-3-clause | 246 |
'''
Created on Oct 24, 2015
@author: jonaswallin
'''
from .rtnorm import * | JonasWallin/rtnorm | python/rtnorm/rtnorm/cython/__init__.py | Python | gpl-2.0 | 76 |
from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('limit_new')
class FilterLimitNew(object):
"""
Limit number of new items.
Example::
limit_new: 1
This would allow only one new... | ratoaq2/Flexget | flexget/plugins/filter/limit_new.py | Python | mit | 1,683 |
import h2o
import math
class ExprNode:
""" Composable Expressions: This module contains code for the lazy expression DAG. """
def __init__(self,op,*args):
self._op=op # unary/binary/prefix op
self._children=[ExprNode._arg_to_expr(a) for a in args] # a list of ExprNode instances; the child... | PawarPawan/h2o-v3 | h2o-py/h2o/expr.py | Python | apache-2.0 | 2,508 |
'''
base tools
'''
# -*- coding: utf-8 -*-
import re
def is_ipv4(ip) :
pattern = r'^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})){3}$'
matcher = re.match(pattern, ip)
if matcher is not None :
return True
return False
def is_domain(domain) :
... | allen1989127/WhereRU | org/sz/tools.py | Python | gpl-3.0 | 508 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individual... | morelab/weblabdeusto | server/src/weblab/experiment/devices/vm/manager.py | Python | bsd-2-clause | 2,718 |
from pymt import *
class DumpListener(EventDispatcher):
def __init__(self):
super(DumpListener, self).__init__()
self.register_event_type('on_touch_down')
self.register_event_type('on_touch_move')
self.register_event_type('on_touch_up')
def on_touch_down(self, touch):
p... | nuigroup/pymt-widgets | pymt/tools/dumpinput.py | Python | lgpl-3.0 | 583 |
from aiokafka import AIOKafkaProducer
import asyncio
async def send_one():
producer = AIOKafkaProducer(
bootstrap_servers='localhost:9092',
transactional_id="transactional_test")
# Get cluster layout and topic/partition allocation
await producer.start()
try:
async with producer... | aio-libs/aiokafka | examples/transactional_produce.py | Python | apache-2.0 | 611 |
#
# $LicenseInfo:firstyear=2010&license=mit$
#
# Copyright (c) 2010, Linden Research, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | lexelby/apiary | apiary/tools/timestamp.py | Python | mit | 3,176 |
import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='keil'
BOARD_NAME = 'mb9bf568r'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = r'D:/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin'
elif CROSS_... | huangbop/skywalker | rt-thread-2.0.0/bsp/mb9bf568r/rtconfig.py | Python | mit | 2,251 |
#/ <reference path="./testBlocks/blockCombine.ts" />
gsTest = bc.createTest()
gsTestGetter1 = gsTest.testgetter | switch-education/pxt | tests/pydecompile-test/baselines/getter.py | Python | mit | 113 |
# -*- coding: utf-8 -
#
# This file is part of http-parser released under the MIT license.
# See the NOTICE for more information.
#
# This module is liberally borrowed (with modifications) from:
# https://raw.githubusercontent.com/benoitc/http-parser/master/http_parser/pyparser.py
import re
import zlib
try:
imp... | treemo/circuits | circuits/web/parsers/http.py | Python | mit | 13,429 |
from __future__ import print_function
import sys
sys.path.append(".")
from operator import add
from tweetAPI import dataSource
from trainer.process import get_feature,tokenize
from pyspark import SparkContext, SparkConf
import pickle
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage... | khan08/wordtrend | spark/driver.py | Python | apache-2.0 | 755 |
#! /usr/bin/env python3
from setuptools import setup
__version__ = "0.0.2"
setup(
name="tgio",
version=__version__,
description="io shell commands over telegram (echo, read, etc)",
url="https://github.com/juantascon/tgio",
author="Juan Diego Tascon",
author_email="juantascon.tgio@horlux.org",... | juantascon/tgio | setup.py | Python | gpl-3.0 | 613 |
# -*- Mode: Python; py-indent-offset: 4 -*-
# vim: tabstop=4 shiftwidth=4 expandtab
#
# Copyright (C) 2012 - Jesse van den Kieboom
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either... | chergert/libgit2-glib | libgit2-glib/Ggit.py | Python | lgpl-2.1 | 2,911 |
__author__ = 'David'
from App import pgdb
database = pgdb.PGDatabase()
# print(database.status)
# database.addItemToCatalog("JonsPencil", "A long yellow pencil.", 10)
# database.query("SELECT column_name "
# "FROM information_schema.columns "
# "WHERE table_name = 'orders';")
def tes... | lfgcodeLinc/JonsTeam | Client/Tests/pgdb_test.py | Python | mit | 921 |
"""
This files offers a recommendation system based on collaborative filtering technique.
1) Let U be the user we want to give recommendations to, for each user U2 != U we need to compute distance(U, U2) (*)
and get the top K neighbors. These neighbors should have watched a lot of animes also watched by U,
giv... | r3kall/AnimeRecommenderSystem | animerecommendersystem/recommender_systems/CollaborativeFilteringRS.py | Python | gpl-3.0 | 8,293 |
from __future__ import unicode_literals
import multiprocessing
import sys
import threading
import traceback
from Queue import Empty
from collections import namedtuple
from multiprocessing import Process, current_process, Queue
from mozlog import structuredlog
# Special value used as a sentinal in various commands
St... | mateon1/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/testrunner.py | Python | mpl-2.0 | 30,008 |
#
# This script builds an OpenDSA textbook according to a specified configuration file
# - Creates an ODSA_Config object from the specified configuration file
# - Validates the configuration file and sets appropriate defaults for omitted fields (see ODSA_Config.py for more information)
# - Makes it easy to re... | RJFreund/OpenDSA | tools/configure.py | Python | mit | 51,804 |
# =======================================================================
#
# Decompress.py date: 2022/01/05
#
# Author: Simon Southwe... | wyvernSemi/slzw | python/Decompress.py | Python | gpl-3.0 | 8,307 |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/dns/dnspolicy64_binding.py | Python | apache-2.0 | 3,425 |
import Gears as gears
from .. import *
from .Base import *
class Video(Base) :
def applyWithArgs(
self,
spass,
functionName,
*,
patternFunctionName : 'The function given by this pattern (some stimuli use multiple patterns).'
... | szecsi/Gears | GearsPy/Project/Components/Figure/Video.py | Python | gpl-2.0 | 2,887 |
import time
import unittest
from messagebird.signed_request import SignedRequest
SIGNING_KEY = 'PlLrKaqvZNRR5zAjm42ZT6q1SQxgbbGd'
class TestMessage(unittest.TestCase):
def test_signed_request_withou_body(self):
query = {
'recipient': '31612345678',
'reference': 'FOO',
... | messagebird/python-rest-api | tests/test_signed_request.py | Python | bsd-2-clause | 2,639 |
# coding:utf-8
'''
poker game buffer mutex log system
python 2.7
winxos 2016-07-15
'''
class WsLog:
def info(self,msg):
pass
def err(self,msg):
pass
def show(self):
pass
| winxos/python | pokegame/WsLog.py | Python | mit | 208 |
"""Implementation of treadmill-admin CLI plugin.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import inspect
import io
import decorator
import click
import jsonschema
from treadmill import authz as authz_mod... | captiosus/treadmill | treadmill/cli/admin/invoke.py | Python | apache-2.0 | 4,855 |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# ---------------------... | Achuth17/scikit-bio | setup.py | Python | bsd-3-clause | 4,506 |
# -*- coding: utf-8 -*-
"""High level wrapper for RegisterBased Instruments.
This file is part of PyVISA.
:copyright: 2014-2020 by PyVISA Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from typing import Iterable, List
from .. import constants
from .resource import Resource
... | pyvisa/pyvisa | pyvisa/resources/registerbased.py | Python | mit | 5,340 |
from twisted.plugin import IPlugin
from txircd.config import ConfigValidationError
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implements
class ConnectionLimit(ModuleData):
implements(IPlugin, IModuleData)
name = "ConnectionLimit"
peerConnections = {}
def actions(self):... | ElementalAlchemist/txircd | txircd/modules/extra/connlimit.py | Python | bsd-3-clause | 2,102 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Needs freetype-py>=1.0
# The MIT License (MIT)
#
# Copyright (c) 2013 Daniel Bader (http://dbader.org)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the... | Erotemic/vtool | vtool_ibeis/fontdemo.py | Python | apache-2.0 | 8,232 |
import re
from django.conf import settings
from tincan import (
Activity,
ActivityDefinition,
LanguageMap
)
from xapi.patterns.base import BasePattern
from xapi.patterns.eco_verbs import (
LearnerCreatesWikiPageVerb,
LearnerEditsWikiPageVerb
)
class BaseWikiRule(BasePattern): # pylint: disable=ab... | marcore/pok-eco | xapi/patterns/manage_wiki.py | Python | agpl-3.0 | 1,746 |
from negotiator_base import BaseNegotiator
from random import random, shuffle
# Example negotiator implementation, which randomly chooses to accept
# an offer or return with a randomized counteroffer.
# Important things to note: We always set self.offer to be equal to whatever
# we eventually pick as our offer. This i... | Lomethoron/AI-4710-Hw-4 | negotiator.py | Python | mit | 1,510 |
#!/usr/bin/python
import rospy
from start_switch import start_switch
from smach_gate import gate_task
from smach_nav_channel import nav_channel
from smach_buoy import buoy_task
import smach
import smach_ros
# High state machine of AI that contains Gate task, Bouy task, and Nav Channel
class MAIN_AI(smach.StateMachine)... | PalouseRobosub/robosub | src/ai/smach_ai.py | Python | gpl-3.0 | 1,452 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foun... | hivesolutions/netius | src/netius/common/torrent.py | Python | apache-2.0 | 11,668 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
IRC bot...
"""
import threading
import src.utilities as util
import src.settings
import src.irc.botObject
class BotDispatcher(threading.Thread):
"""
The BotDispatcher object handles the delegation of the various bots on
the various specified servers.
... | Tehnix/PyIRCb | src/irc/botDispatcher.py | Python | bsd-3-clause | 2,303 |
import os
os.mkdir("Classes")
os.chdir("Classes")
for i in ['Controller', 'Model', 'Util', 'Vendor', 'View', 'ViewModel']:
os.mkdir(i)
| isweal/loop | loop/iosDirMake.py | Python | mit | 140 |
#!/usr/bin/env python
#
# GPytage errorDialog.py module
#
############################################################################
# Copyright (C) 2010 by Kenneth Prugh #
# ken69267@gmail.com #
# ... | Ken69267/gpytage | gpytage/errorDialog.py | Python | gpl-2.0 | 1,846 |
# Copyright 2015, 2018 IBM Corp.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | phenoxim/nova | nova/tests/unit/virt/powervm/test_image.py | Python | apache-2.0 | 2,368 |
##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | wunderlins/learning | python/zodb/lib/osx/ZEO/tests/auth_plaintext.py | Python | gpl-2.0 | 2,146 |
#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | rampage644/impala-cut | tests/common/query_executor.py | Python | apache-2.0 | 16,215 |
#!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'ServerDefender VP (Port80 Software)'
def is_waf(self):
schemes = [
self.matchHeader(('X-Pint', r'p(ort\-)?80'))
]
if any(i for i in schemes):
return True
return F... | EnableSecurity/wafw00f | wafw00f/plugins/serverdefender.py | Python | bsd-3-clause | 324 |
from pprint import pprint
from django import forms
class ListaDocsMovimentacaoForm(forms.Form):
data = forms.DateField(
label='Data', required=False,
widget=forms.DateInput(attrs={'type': 'date',
'autofocus': 'autofocus'}))
descricao_usuario = forms.CharField(
... | anselmobd/fo2 | src/estoque/forms/lista_docs_mov.py | Python | mit | 377 |
#!/usr/local/bin/python
# filename: fastq_to_fasta.py
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
import argparse
parser = argparse.ArgumentParser("Converts a file of sequences in FASTQ format to FASTA file\n")
parser.add_argument('-in', dest='seq_file',required=True, help="The input file, in FASTQ for... | bryanbriney/seqtools | fastq_to_fasta.py | Python | gpl-2.0 | 1,228 |
from abc import ABCMeta, abstractmethod
class DriverBase(metaclass=ABCMeta):
def __init__(self, obj):
self.obj = obj
def __repr__(self):
return '{}(type={})'.format(self.__class__.__name__, self.obj)
def init_type(self, item_type, **init_kwargs):
"""Initialize a new item_type.
... | caxiam/sqlalchemy-jsonapi-collections | jsonapiquery/drivers/__init__.py | Python | apache-2.0 | 1,679 |
# -*- coding: utf-8 -*-
"""
Mixins for fields.
"""
from bok_choy.promise import EmptyPromise
from ...tests.helpers import get_selected_option_text, select_option_by_text
class FieldsMixin(object):
"""
Methods for testing fields in pages.
"""
def field(self, field_id):
"""
Return fiel... | dkarakats/edx-platform | common/test/acceptance/pages/lms/fields.py | Python | agpl-3.0 | 6,777 |
# Copyright (C) 2010 Ron Weiss
#
# This file is part of Gordon.
#
# Gordon 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.
#
# Gordon i... | bmcfee/gordon | gordon/io/features.py | Python | gpl-3.0 | 11,661 |
#My awesome bot that plays games
from random import choice
def main(data):
return "straight"
| UAlbanyRpi/Botler | back/tron-other_tron.py | Python | apache-2.0 | 127 |
import pytest
from pyjokes import get_joke
from pyjokes.pyjokes import LanguageNotFoundError, CategoryNotFoundError
languages = ['en', 'de', 'es']
categories = ['neutral', 'adult', 'all']
test_data = ['', 'abc', '123']
def test_get_joke():
assert get_joke()
for language in languages:
assert get_jok... | martinohanlon/pyjokes | tests/test_get_joke.py | Python | bsd-3-clause | 990 |
from .adapt_service import AdaptService, AdaptIntent
from .base import IntentMatch
from .fallback_service import FallbackService
from .padatious_service import PadatiousService, PadatiousMatcher
| forslund/mycroft-core | mycroft/skills/intent_services/__init__.py | Python | apache-2.0 | 195 |
# from JumpScale.core.System import System
import re
from JumpScale import j
class RegexTemplates_FindLines:
"""
regexexamples which find lines
"""
# TODO: for all methods do input checking (id:20)
def findCommentlines(self):
return "^( *#).*"
def findClasslines(self):
ret... | Jumpscale/jumpscale_core8 | lib/JumpScale/data/regex/RegexTools.py | Python | apache-2.0 | 16,538 |
# Copyright 2014 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | dimtruck/magnum | magnum/tests/unit/conductor/handlers/test_bay_conductor.py | Python | apache-2.0 | 16,892 |
from pylab import *
seed(123)
t = linspace(0., 100., 1001)
y = sin(2.*pi*t/30.) + sin(2.*pi*t/2. + 1.)
Y = y + randn(y.size)
data = empty((t.size, 2))
data[:,0], data[:,1] = t, Y
savetxt('data.txt', data)
plot(t, y, 'r')
plot(t, Y, 'bo')
show()
| eggplantbren/Oscillations | Simple/generate_data.py | Python | gpl-3.0 | 251 |
# Generated by Django 1.11.23 on 2019-08-15 15:13
from django.db import migrations
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('publisher', '0078_delete_drupalloaderconfig'),
]
operations = [
migrations.AddField(
model_name='c... | edx/course-discovery | course_discovery/apps/publisher/migrations/0079_course_url_slug.py | Python | agpl-3.0 | 565 |
#!/usr/bin/python
import os
import sys
if len(sys.argv) != 3:
print 'Usage: divide.py a b, returns a/b'
print int(float(sys.argv[1]) / float(sys.argv[2])) | amonszpart/globOpt | RAPter/scripts/divide.py | Python | apache-2.0 | 161 |
from compiler import *
####################################################################################################################
# Each postfx_param contains the following fields:
# 1) id (string):
# 2) flags (int).
# 3) tonemap operator type (0,1,2,3)
# 4) shader parameters1 [ HDRRange, HDREx... | Eleyvie/wreck | integrated/module_postfx.py | Python | mit | 2,506 |
#
# Project Kimchi
#
# Copyright IBM, Corp. 2013
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This lib... | ssdxiao/kimchi | src/kimchi/__init__.py | Python | lgpl-2.1 | 779 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import timedelta
from sqlalchemy import and_
from .common import Base, session_scope
from .team import Team
class GoalieSeason(Base):
__tablename__ = 'goalie_seasons'
__autoload__ = True
HUMAN_READABLE = 'goalie season'
# statistics item... | leaffan/pynhldb | db/goalie_season.py | Python | mit | 6,525 |
from datetime import datetime, timedelta
import pycron
from pytz import utc
import pendulum
import arrow
import udatetime
from delorean import Delorean
def test_dow():
def run(now):
assert pycron.is_now('* * * * *', now)
assert pycron.is_now('* * * * 4', now)
assert pycron.is_now('* * * * ... | kipe/pycron | tests/test_dow.py | Python | mit | 1,939 |
# -*- coding: utf-8 -*
from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
class GoogledriveComFolder(SimpleCrypter):
__name__ = "GoogledriveComFolder"
__type__ = "crypter"
__version__ = "0.05"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?drive\.go... | fzimmermann89/pyload | module/plugins/crypter/GoogledriveComFolder.py | Python | gpl-3.0 | 992 |
# Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | dmend/PyKMIP | kmip/tests/unit/pie/objects/test_x509_certificate.py | Python | apache-2.0 | 14,836 |
import Confluence, ServiceCatalographer, ServiceReporter
from config import confluenceHost, confluenceUser, confluencePass, serviceCatalographerURL
# The Wiki space and top-level page to index each service
# This page will not be modified, but new child pages may be added
confluenceSpaceKey = 'BioVeL'
confluenceParent... | BioVeL/katoomba | ServiceUploader.py | Python | apache-2.0 | 934 |
def try_connection(constr):
import adodbapi
try:
s = adodbapi.connect(constr) #connect to server
s.close()
except adodbapi.DatabaseError as inst:
print(inst.args[0]) # should be the error message
return False
print(' (successful)')
return True
| PopCap/GameIdea | Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/adodbapi/test/tryconnection3.py | Python | bsd-2-clause | 301 |
import os, time, datetime
from execo.time_utils import timedelta_to_seconds, format_date
from execo_g5k import get_cluster_site, get_oar_job_info, oardel, oarsub, \
get_planning, compute_slots, get_jobs_specs, get_oar_job_nodes, \
deploy, Deployment, get_host_attributes
from execo_engine import Engine, logger, ... | lpouillo/execo-g5k-tools | engines/fp_hadoop/fp_hadoop.py | Python | gpl-3.0 | 7,705 |
from datetime import timedelta
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.core import mail
from django.core.paginator import Paginator
from django.utils import timezone... | thenewguy/wagtail | wagtail/wagtailadmin/tests/test_pages_views.py | Python | bsd-3-clause | 74,804 |
"""
test calculator: use as an extended and embedded GUI component
"""
from tkinter import *
from calculator import CalcGui
def calcContainer(parent=None):
frm = Frame(parent)
frm.pack(expand=YES, fill=BOTH)
Label(frm, text='Calc Container').pack(side=TOP)
CalcGui(frm)
Label(frm, text=... | simontakite/sysadmin | pythonscripts/programmingpython/Lang/Calculator/calculator_test.py | Python | gpl-2.0 | 1,510 |
# -*- coding: utf-8 -*-
import mock
from website import mailchimp_utils
from tests.base import OsfTestCase
from nose.tools import * # noqa; PEP8 asserts
from tests.factories import UserFactory
import mailchimp
from framework.tasks import handlers
class TestMailChimpHelpers(OsfTestCase):
def setUp(self, *args, *... | brandonPurvis/osf.io | tests/test_mailchimp.py | Python | apache-2.0 | 3,779 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
import re
from json import loads
from pyvows import Vows, expect
ct... | dhardy92/thumbor | vows/json_engine_vows.py | Python | mit | 9,167 |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | fingeronthebutton/RIDE | src/robotide/lib/robot/utils/htmlformatters.py | Python | apache-2.0 | 9,773 |
"""
WSGI config for brickset_app project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... | takanory/pymook-samplecode | 6_web/brickset_app/brickset_app/wsgi.py | Python | mit | 402 |
"""Flexible Generalized Minimum Residual Method (fGMRES) Krylov solver."""
import warnings
from warnings import warn
import numpy as np
from scipy.linalg import get_lapack_funcs
import scipy as sp
from ..util.linalg import norm
from ..util import make_system
from .. import amg_core
def _mysign(x):
"""Return comp... | pyamg/pyamg | pyamg/krylov/_fgmres.py | Python | mit | 12,557 |
'''
New Integration Test for host ept disable/enable during add host
@author: Glody
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import test_stub
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.host_ope... | zstackorg/zstack-woodpecker | integrationtest/vm/basic/test_add_host_ept.py | Python | apache-2.0 | 1,805 |
import io
import os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
classifiers = [
'Development Status :: 4 - Beta',
'Operating System :: OS Independent',
'Environment :: X11 Applications',
'Environment :: Win32 (MS Windows)',
'Environment :: M... | mcepl/rope | setup.py | Python | lgpl-3.0 | 2,271 |
#
# Database Cursor
#
import pscheduler
import psycopg2
import sys
import threading
import time
from .log import log
module = sys.modules[__name__]
module.tries = 10
module.interval = 0.5
module.threadlocal = threading.local()
module.dsn = None # DSN for DB connection
def dbcursor_init(dsn):
"""Initialize... | perfsonar/pscheduler | pscheduler-server/pscheduler-server/api-server/pschedulerapiserver/dbcursor.py | Python | apache-2.0 | 3,080 |
# coding:utf-8
from io import BytesIO
import unittest
import xlwt
class TestSharedStringTable(unittest.TestCase):
def test_shared_string_table(self):
expected_result = b'\xfc\x00\x11\x00\x01\x00\x00\x00\x01\x00\x00\x00\x03\x00\x01\x1e\x04;\x04O\x04'
string_record = xlwt.BIFFRecords.SharedStringTa... | cloudera/hue | desktop/core/ext-py/xlwt-1.3.0/tests/test_biff_records.py | Python | apache-2.0 | 826 |
import os
import errno
from . import LILI
from flask import render_template, request, flash, redirect, jsonify, make_response, render_template_string
import flask_excel as excel
from Repositories.models import DB, ViewContacts, ReportEvaluate, ContactInterview
import Repositories.repos as repos
import hashlib
from werk... | rwecho/fflask_blog | fflask_blog/Lili/views.py | Python | apache-2.0 | 8,738 |
# PyAlgoTrade
#
# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | Yam-cn/potato | engine/barfeed/quandlfeed.py | Python | apache-2.0 | 2,230 |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | azverkan/scons | test/scons-time/obj/prefix.py | Python | mit | 2,166 |
# This file uses image recognition to identify the cards that are currently on the table
import cv2
import sys
import numpy as np
import imp
#Image matching
def rectify(h):
h = h.reshape((4,2,))
hnew = np.zeros((4,2), dtype = np.float32)
add = h.sum(1)
hnew[0] = h[np.argmin(add)]
hnew[2] = h[np.a... | uncamy/GlassJackImage | readCard.py | Python | mit | 3,495 |
import json
import django
from django.conf import settings
from django.contrib.sites.models import Site
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect
from django.test.client import RequestFactory
import mock
from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.sumo.... | orvi2014/kitsune | kitsune/sumo/tests/test_views.py | Python | bsd-3-clause | 4,025 |
#!/usr/bin/python
#
# Copyright (C) 2012 Michael Vogt <mvo@ubuntu.com>
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
import apt
import unittest
class TestAptPolicy(unittest.TestCase)... | suokko/python-apt | tests/test_policy.py | Python | gpl-2.0 | 1,239 |
#!/usr/bin/python3
# -*- coding: latin-1 -*-
"""
Copyright (C) 2014 Technische Universität Berlin,
Fakultät IV - Elektrotechnik und Informatik,
Fachgebiet Regelungssysteme,
Einsteinufer 17, D-10587 Berlin, Germany
This file is part of PaPI.
PaPI is free software: you can redistribute it and/or modify
it under the te... | TUB-Control/PaPI | papi/data/DPlugin.py | Python | gpl-3.0 | 16,738 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.