src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
import httplib
import time
from pyload.plugin.Addon import Addon, Expose
class WindowsPhoneNotify(Addon):
__name = "WindowsPhoneNotify"
__type = "addon"
__version = "0.10"
__config = [("push-id" , "str" , "Push ID" , "" ),
... |
# -*- coding: utf-8 -*-
# Authors: Ygor Gallina, Florian Boudin
# Date: 10-18-2018
"""TextRank keyphrase extraction model.
Implementation of the TextRank model for keyword extraction described in:
* Rada Mihalcea and Paul Tarau.
TextRank: Bringing Order into Texts
*In Proceedings of EMNLP*, 2004.
"""
from __fu... |
from Dataset import Dataset
from WTA_Hasher import WTAHasher
from kNN_Classifier import kNNClassifier
import numpy as np
import matplotlib.pyplot as plt
import copy
ds_train_dir = "../datasets/alcohol/alcoholism_training.csv"
ds_test_dir = "../datasets/alcohol/alcoholism_test.csv"
results_dir = "../final_results/alcoh... |
import dateutil.parser
from bouncer.constants import READ, EDIT, CREATE, DELETE, MANAGE
from flask import Blueprint
from flask_login import login_required, current_user
from flask_restful import Resource, marshal
from flask_restful.reqparse import RequestParser
from sqlalchemy import desc, or_, func, and_
from sqlalche... |
#!/usr/bin/env python3
from test_framework.authproxy import AuthServiceProxy, JSONRPCException
import os
import random
import sys
import time
import subprocess
import shutil
from decimal import Decimal
ELEMENTSPATH=""
BITCOINPATH=""
if len(sys.argv) == 2:
ELEMENTSPATH=sys.argv[0]
BITCOINPATH=sys.argv[1]
else:... |
#!/usr/bin/env python
from __future__ import print_function
import twiddle
import sys
def get_database_connection_maximum(host, port=twiddle.DEFAULT_PORT):
'''
Returns the current maximum total connections for the database pool.
'''
result = twiddle.connect_factory(host, 'bean', 'datasource', 'MaxPool... |
"""
Copyright (c) 2017 Genome Research Ltd.
Author: Christopher Harrison <ch12@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
Free Software Foundation, either version 3 of the License, or (at your
option) any ... |
# -*- coding: utf-8 -*-
"""Tests for the eventstreams module."""
#
# (C) Pywikibot team, 2017
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
from types import FunctionType
import mock
from pywikibot.comms.eventstreams import EventStreams
from pywikibot ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django import forms
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from .conf import settings
from .models import Snippet
from .highlight import LEXER_LIST, LEXER_DEFAULT, LEXER_KEYS
cl... |
#!/usr/bin/python
#***************************************************************************
# Copyright 2015 IBM
#
# 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.a... |
from machine import I2C, Pin, Timer
import socket
import utime as time
import dht
from bmp180 import BMP180 # https://github.com/micropython-IMU/micropython-bmp180
from esp8266_i2c_lcd import I2cLcd # https://github.com/dhylands/python_lcd/
import clock, nethelper
class WeatherStation:
DHTPIN = 14 # DHT data pin
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2019 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... |
import random
from axelrod import Player
class MetaPlayer(Player):
"""A generic player that has its own team of players."""
team = []
def __init__(self):
Player.__init__(self)
# Make sure we don't use any meta players to avoid infinite recursion.
self.team = [t for t in self.t... |
from datetime import datetime
import warnings
import numpy as np
from numpy.random import randn
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import DataFrame, DatetimeIndex, Index, Series
import pandas._testing as tm
from pandas.core.window.common import _flex_binary_moment... |
# Copyright (C) 2013-2014 SignalFuse, Inc.
# Copyright (C) 2015-2019 SignalFx, Inc.
#
# Docker container orchestration utility.
import bgtunnel
import collections
import datetime
import time
import os
# Import _strptime manually to work around a thread safety issue when using
# strptime() from threads for the first t... |
# -*- coding: utf-8 -*-
import json
from beertools import BreweryNameMatcher
def read_json(filename):
with open(filename, 'r') as infile:
return json.loads(infile.read())
def get_breweries_polet():
with open('data/polet.json', 'r') as infile:
data = json.loads(infile.read())
breweri... |
# -*- coding:utf-8 -*-
import json
import Queue
import time
from django.shortcuts import render,HttpResponseRedirect,HttpResponse
from django.contrib.auth import authenticate,login,logout
from webChat_forms.loginFrom import userLoginFrom
from django.contrib.auth.decorators import login_required
from webChat_models ... |
from .. import Provider as CurrencyProvider
# Names taken from https://std.moc.go.th/std/codelist_detail/40
class Provider(CurrencyProvider):
# Format: (code, name)
currencies = (
("AED", "ดีแรห์ม สหรัฐอาหรับเอมิเรตส์"),
("AFN", "อัฟกานิ"),
("ALL", "เลค"),
("AMD", "ดีแรห์ม อาร... |
#!/usr/bin/env python
"""
djver.
Usage:
djver.py [<url>] [--static-path=<static-path>] [--find-diffs] [--verbose]
Options:
--static-path=<static-path> URL path to the site's static files [default: /static/].
--find-diffs Attempt to find differences between the known versions of Django
... |
## CIVET.templates.py
##
## Code for handling the CIVET template files
##
## Error handling:
## Errors are reported in the 'output' string: they are prefixed with '~Error~' and terminate with '\n'.
## These are reported to the user via the template_error.html page, which is rendered by read_template()
##
## PROVENANC... |
# coding: utf-8
"""Arcrest is a Python binding to the ArcGIS REST Server API, similar to the
JavaScript or Flex API in program structure as well as in the way it
interfaces with ArcGIS servers.
Getting Started with Arcrest
============================
A simple example of connecting to a server:
... |
import numpy as np
from load_data import X, Y, Xtest
from sklearn.linear_model import LogisticRegression
from sklearn.grid_search import GridSearchCV
from scipy.io import savemat
from sklearn.cross_validation import StratifiedKFold
def return_best_model(X, Y, N, C, penalties):
"""
Returns the best model for X... |
import math
import statistics
from itertools import groupby
from random import randint
from typing import Dict, Tuple, Counter
import pandas as pd
from Src.BioAnalyzer.Analysis.GenePrioritization.Steps.DataIntegration.IntermediateRepresentation.Generators import \
IntermediateRepresentationGeneratorBase
from Src.... |
# encoding: utf-8
"""
parse_process.py
Created by Thomas Mangin on 2015-06-18.
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
import os
import stat
def encoder(tokeniser):
value = tokeniser()
if value not in ('text', 'json'):
raise Val... |
# Copyright 2015 Isotoma Limited
#
# 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... |
#!/usr/bin/env python3
"""
./plot_read_alignment_ratios.py -i /usr/local/projects/aplysia/A1_CNS_reorientation.log -o /usr/local/projects/aplysia/A1_CNS_reorientation.png
Count of ratios < 0.05: 47414
Count of ratios > 0.95: 53006
./plot_read_alignment_ratios.py -i /usr/local/projects/aplysia/A3_digestive_reorientat... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
#!/usr/bin/env python
import urllib2
from bs4 import BeautifulSoup as BS
import re
import time
def getAgenciesList():
agenciesList_req = urllib2.Request('''http://services.my511.org/Transit2.0/GetAgencies.aspx?token=aeeb38de-5385-482a-abde-692dfb2769e3''')
xml_resp = urllib2.urlopen(agenciesList_req)
soup = BS(xm... |
"""
Copyright 2016 Markus Wissinger. 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 law or agreed... |
"""
Copyright (C) 2012 Alan J Lockett
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, distribute,... |
import glob
import os
def read_file(fname):
temp = []
lines = open(fname, "r").readlines()
for line in lines:
if line.strip().startswith("#"):
continue
else:
if len(line.strip()) > 0:
temp.append(line)
return temp
class TftpAppend:
de... |
# Copyright 2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""API handlers: `ResourcePool`."""
from piston3.utils import rc
from maasserver.api.support import (
AnonymousOperationsHandler,
ModelCollectionOperationsHandler,
M... |
"""
Title: Text classification from scratch
Authors: Mark Omernick, Francois Chollet
Date created: 2019/11/06
Last modified: 2020/05/17
Description: Text sentiment classification starting from raw text files.
"""
"""
## Introduction
This example shows how to do text classification starting from raw text (as
a set of t... |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.thermal_zones_and_surfaces import Roof
log = logging.getLogger(__name__)
class TestRoof(unittest.TestCase):
def setUp(self):
self.fd, self.path = tempfile.mkstemp()... |
"""
Tests for submission models.
"""
from django.test import TestCase
from submissions.models import Submission, Score, ScoreSummary, StudentItem
class TestScoreSummary(TestCase):
"""
Test selection of options from a rubric.
"""
def test_latest(self):
item = StudentItem.objects.create(
... |
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/flowables.py
__version__=''' $Id: flowables.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__="""
A flowable is a "floating element" in a docum... |
#!/usr/bin/env python
# - coding: utf-8 -
# Copyright (C) 2010 Toms Bauģis <toms.baugis at gmail.com>
"""
Demo of a a timer based ripple running through nodes and initiating
sub-animations. Not sure where this could come handy.
"""
from gi.repository import Gtk as gtk
from lib import graphics
from lib.pytwee... |
#!/usr/bin/env python
#
# splitencoder
#
# Copyright (C) 2015 Samsung Electronics. All rights reserved.
# Author: Thiago Santos <thiagoss@osg.samsung.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free ... |
from pydub import AudioSegment
# pydub does things in milliseconds
ten_seconds = 10 * 1000
one_second = 1000
#Examples
#first_10_seconds = song[:ten_seconds]
#last_5_seconds = song[-5000:]
song = AudioSegment.from_mp3("2016.01.04-09.00.00-S.mp3")
#print("Test")
#last_second = song[-ten_seconds:]
#last_second.expor... |
#!/usr/bin/env python
#REF: http://stackoverflow.com/questions/21613091/how-to-use-scapy-to-determine-wireless-encryption-type
import datetime
a = datetime.datetime.now()
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
import sys, getopt
import json
from multiproces... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('services', '0018_delete_pregnancytest'),
]
operations = [
migrations.CreateModel(
name='WorkForClient',
... |
import click
import csv
import datetime
import json
import io
from abc import ABCMeta, abstractmethod
from itertools import groupby
from collections import namedtuple
from soccer import leagueids, leagueproperties
LEAGUE_PROPERTIES = leagueproperties.LEAGUE_PROPERTIES
LEAGUE_IDS = leagueids.LEAGUE_IDS
def get_writ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from microsoftbotframework import Response
import celery
import os
import sys
import json
# import argparse
from google.cloud import language
import google.auth
# import language
try:
import apiai
except ImportError:
sys.path.append(os.path.join(os.path.dirname(os... |
from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True)
phone = models.CharField(max_length=100, blank=True)
location = models.CharField(max_length=100, blank=True)
profession = models.CharField(max_length=100... |
"""
The MIT License
Copyright (c) 2009 Vic Fryzel
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... |
#!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoind aborts if can't disconnect a block.
- Start a single node and generate 3 blocks.
- Delete the... |
# A control file for importing May 2015 Boundary-Line.
# This control file assumes previous Boundary-Lines have been imported,
# because it uses that information. If this is a first import, use the
# first-gss control file.
def code_version():
return 'gss'
def check(name, type, country, geometry):
"""Shoul... |
# -*- coding: utf-8 -*-
#coding=utf-8
import Queue
import sys,os
from envs.common import PROJECT_ROOT
import xlrd
from student.views import do_institution_import_teacher_create_account,do_institution_import_student_create_account
import random
reload(sys)
sys.setdefaultencoding('utf8')
"""
Views related to operations... |
"""Coregistration between different coordinate frames."""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
from .externals.six.moves import configparser
from .externals.six import string_types
import fnmatch
from glob import glob, iglob
import os
import stat
import sys
import re
i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import subprocess
SDS_JSON_FILE_EXTENSION = '.sdsjson'
def fail(*args):
error = ' '.join(str(arg) for arg in args)
raise Exception(error)
git_repo_path = os.path.abspath(subprocess.check_output(['git', 'rev-parse', '--show-toplevel']).strip())
print '... |
# 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... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... |
# vim:ts=4:sw=4:et:
# Copyright 2016-present Facebook, Inc.
# Licensed under the Apache License, Version 2.0
# no unicode literals
from __future__ import absolute_import, division, print_function
import os
import random
import stat
import string
import sys
import time
import pywatchman
import WatchmanInstance
import... |
# coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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... |
from tde.exceptions import CantExtractData
from tests.src.Base import Base
from tests.src.data import WikipediaLetterCountTextFileData, WikipediaWordCountTextFileData, \
WikipediaCategoryCountTextFilesData, WikipediaLetterCountHTMLFileData, WikipediaWordCountHTMLFileData, \
WikipediaCategoryCountHTMLFilesData
... |
# helperji, context stvari
from django.shortcuts import render, get_object_or_404, redirect
from django.http import Http404, HttpResponse
from django.contrib import messages
from django.core import serializers
# from django.utils import simplejson
from workflows.urls import *
from workflows.helpers import *
import work... |
import datetime
from squad.core import models
from django.db.models import Q, F, Sum
from django.utils import timezone
def get_metric_data(project, metrics, environments, date_start=None,
date_end=None):
# Note that date_start and date_end **must** be datetime objects and not
# strings, i... |
# Copyright 2011-2012 7 i TRIA <http://www.7itria.cat>
# Copyright 2011-2012 Avanzosc <http://www.avanzosc.com>
# Copyright 2013 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2014 Markus Schneider <markus.schneider@initos.com>
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2017 Luis M... |
"""factory.py lets you deserialize an unknown type from XML"""
import xml.etree.cElementTree as ElementTree
import data
import script
import media
import actor
def deserialize_value(element, *args):
"""Get an object representing this element,
be it a literal, list or what-not"""
class_map = {
"... |
#!/usr/bin/python
#imports
import numpy as np
import cv
import cv2
import sys
import glob
from mayavi import mlab
from mayavi.mlab import *
def morphOps(probMap):
workableMap = probMap.copy()
#apply erosion & dilation filtering, rids photo of stray vescicle detections
workableMap = eroDilFilter(workableMap, 5, 3) ... |
from compat import patterns, url
urlpatterns = patterns('copywriting',
url(r'^author/(?P<author>\w[^/]+)$', 'views.listArticlesByAuthor'),
url(r'^author/(?P<author>\w[^/]+)/$', 'views.listArticlesByAuthor', name='copywriting_by_author'),
url(r'^tag/(?P<in_tag>\w[^/]+)$', 'views.withTag'),
url(r'^tag/(... |
# Copyright 2015 Canonical, Ltd.
#
# 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 Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... |
"""
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT... |
"""
date - Command
==============
This module provides processing for the output of the ``date`` command.
The specs handled by this command inlude::
"date" : CommandSpec("/bin/date"),
"date_utc" : CommandSpec("/bin/date --utc"),
Class ``Date`` parses the output of the ``... |
# Copyright (c) 2010 OpenStack Foundation
# 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 ... |
import datetime
import time
from django.http import Http404, HttpResponse
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.utils.translation import ugettext as _
from django.... |
#
# Created as part of the StratusLab project (http://stratuslab.eu),
# co-funded by the European Commission under the Grant Agreement
# INFSO-RI-261552."
#
# Copyright (c) 2011, SixSq Sarl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
#!/usr/bin/env python3
'''
5.4-compare_profiles.py
This script reads in GSSPs constructed by 5.2-make_profiles.py and calculates
the matrix of Jensen-Shannon divergences between all GSSPs, the rarity
of each substitution observed in each GSSP, and the Shannon entropy of
the subsitutions observed at ... |
# vim: set fileencoding=utf-8 :
#
# Copyright 2017 Vince Veselosky and contributors
#
# 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.... |
from min_heap import MinHeap
from functools import total_ordering
@total_ordering
class PrioritizedItem(object):
def __init__(self, pri, value):
self.pri, self.value = pri, value
self._order = 0
def __eq__(self, other):
if hasattr(other, 'pri'):
if self.pri == other.pri:
... |
import itertools
import operator
from sqlalchemy_searchable import search
from scoda.app import app
from flask import request, url_for, redirect, flash, make_response, session, render_template, jsonify, Response, \
send_file
from flask_security import current_user
from itertools import zip_longest
from sqlalchemy... |
import matplotlib.pyplot as plt
import numpy as np
__all__ = ['colorLegend',
'symbolLegend']
def colorLegend(colors, labels, alphas=None, edgecolor='black',loc='best', axh=None, **legendKwargs):
"""Custom matplotlib legend with colors and labels etc.
Useful in cases where it is a... |
# -*- coding: UTF-8 -*-
# Copyright 2015-2021 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
SETUP_INFO = dict(
name='lino_extjs6',
version='17.10.0',
install_requires=['lino', 'lino_noi'],
tests_require=[],
test_suite='tests',
description="The Se... |
'''
Rate limit public interface.
This module includes the decorator used to rate limit function invocations.
Additionally this module includes a naive retry strategy to be used in
conjunction with the rate limit decorator.
'''
from functools import wraps
from math import floor
import time
import sys
import threading
... |
# *******************************************************************************
# * Copyright 2017 McGill University 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 L... |
import itertools
import numpy as np
import pytest
from pandas.errors import PerformanceWarning
import pandas as pd
import pandas.util.testing as tm
class TestSparseArrayConcat:
@pytest.mark.parametrize('kind', ['integer', 'block'])
def test_basic(self, kind):
a = pd.SparseArray([1, 0, 0, 2], kind=k... |
import cv2
import numpy as np
frame = cv2.imread('/mnt/c/Users/T-HUNTEL/Desktop/hackathon/table3.jpg')
h,w,c = frame.shape
print frame.shape
# Convert BGR to HSV
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
BORDER_COLOR = 0
def flood_fill(image, x, y, value):
count = 1
points = [(x, y)]
"Flood fill on a... |
#!/usr/bin/env python3
#Copyright (C) 2013 by Ngan Nguyen
# Copyright (C) 2012-2019 by UCSC Computational Genomics Lab
#
#Released under the MIT license, see LICENSE.txt
"""Creating wiggle (annotation) tracks and lifted-over wiggle tracks for the hubs
"""
import os, re, time
from sonLib.bioio import system
from toi... |
import sys
import types
from rpython.flowspace.model import Constant
from rpython.flowspace.operation import op
from rpython.annotator import description, model as annmodel
from rpython.rlib.objectmodel import UnboxedValue
from rpython.tool.pairtype import pairtype, pair
from rpython.tool.identity_dict import identity... |
"""runpy.py - locating and running Python code using the module namespace
Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.
This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts ... |
import pyproteinsExt.proteinContainer
import re
import gzip
def parse(inputFile=None):
"""
Parse tmhmm output to create Container
:param inputFile: path to tmhmm output
:return: tmhmmContainerFactory.Container
"""
mainContainer = Container()
fnOpen = open
t = 'r'
if inputFile.ends... |
"""
@name: Modules/Core/Drivers/Serial/_test/test_Serial_driver.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2013_2019 by D. Brian Kimmel
@license: MIT License
@note: Created on May 4, 2013
@summary: This module is for testing local node data.
Passed all 9 tests - DB... |
#!/bin/env python
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
import time
from tornado.options import define, options
define("port", default=8000, help="run on the given port", type=in... |
"""The tests the cover command line platform."""
import logging
import pytest
from homeassistant import setup
from homeassistant.components.cover import ATTR_POSITION, ATTR_TILT_POSITION, DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_CLOSE_COVER,
SERVICE_CLOSE_COVER_TILT,
SERVICE_OP... |
# Model Defining Questions Database
import string
from google.appengine.ext import db
class questionm(db.Model):
questionNumber = db.IntegerProperty(required=True)
question = db.StringProperty(required=True, multiline=True)
qimage = db.StringProperty()
opt1 = db.StringProperty(required=True, multiline=True)
opt2 =... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 2014, 2015 CERN.
#
# Invenio 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... |
# This file is part of the myhdl library, a Python package for using
# Python as a Hardware Description Language.
#
# Copyright (C) 2003-2008 Jan Decaluwe
#
# The myhdl 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 t... |
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.distributed.DistributedObjectAI import DistributedObjectAI
class NewsManagerAI(DistributedObjectAI):
notify = directNotify.newCategory('NewsManagerAI')
def announceGenerate(self):
DistributedObjectAI.announceGenerate(self)
... |
#!/usr/bin/env python
"""A vtctld2 webdriver test that tests the different views of status page."""
import logging
import os
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
fr... |
#!/usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2017 LeanIX GmbH
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,... |
#!/usr/bin/env python
#-*- coding=utf-8 -*-
#author: yezhihua@baidu.com
import urllib,urllib2,json
import queue_monitor
def input_monitor_plat(item_id, value, content):
try:
data = {"item_id":item_id, "value": value, "content":content}
body = urllib.urlencode(data)
fp = urllib2.urlopen("http://cq02-testing-mb1... |
#coding=utf-8
import tornado.web
import util.config as config
import util.constants as constants
from db.manager import FormulaManager, OilManager
from handler.base import BaseHandler
class FormulaHandler(BaseHandler):
def initialize(self):
self.all_use = constants.use
self.all_difficult_degree ... |
# http://lividinstruments.com
from __future__ import with_statement
import Live
import math
""" _Framework files """
from _Framework.ButtonElement import ButtonElement # Class representing a button a the controller
from _Framework.ButtonMatrixElement import ButtonMatrixElement # Class representing a 2-dimensional set... |
# -*- coding: utf-8 -*-
# This file is part of Laufpartner.
#
# Laufpartner 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.
#
#... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
import uuid
import unittest
from datetime import timedelta
import tornado
from tornado import gen
from tornado.concurrent import Future
from tornado.websocket import WebSocketClientConnection
from tornado.testing import gen_test, AsyncTestCase
from gremlinclient.connection import Stream
from gremlinclient.tornado_cli... |
# Copyright 2016 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
from __future__ import absolute_import
import itertools
import re
from ..Constants import ADVANCED_PARAM_TAB
from ..utils import to_list
from ..Messages import send_warning
from .block im... |
# Copyright 2013 IBM Corp.
#
# 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 t... |
# -*- coding: utf-8 -*-
"""Unit test suite for the models of the application."""
from nose.tools import eq_
from happy.model import DBSession
from happy.tests import load_app
from happy.tests import setup_db, teardown_db
__all__ = ['ModelTest']
def setup():
"""Setup test fixture for all model tests."""
load... |
import sys
sys.path.append('/home/jwalker/dynamics/python/atmos-tools')
sys.path.append('/home/jwalker/dynamics/python/atmos-read')
import os
import xray
import numpy as np
from datetime import datetime
import matplotlib.pyplot as plt
import pandas as pd
import atmos as atm
import precipdat
import merra
# -----------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.