src stringlengths 721 1.04M |
|---|
#
# lfo.py - Lfo tab conversion objects
#
# Copyright (c) 2006,2007 Matt Gerassimoff
#
# This file is part of g2ools.
#
# g2ools 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,... |
#!/usr/bin/env python3
import logging
import os
import re
import sys
import traceback
from github3.exceptions import ForbiddenError
from github3 import login
from github3.repos.status import Status
try:
GITHUB_API_TOKEN = os.environ['GITHUB_API_TOKEN']
ORGANIZATION = os.environ['ORGANIZATION']
# PROJECT-... |
'''
'''
import re
import sys
import logging
import itertools
#from datachef.ids import simple_hashstring
from amara3 import iri
from versa import SUBJECT, RELATIONSHIP, VALUE
BFV = 'http://bibframe.org/vocab/'
WORKCLASS = iri.absolutize('Work', BFV)
INSTANCECLASS = iri.absolutize('Instance', BFV)
TYPE_REL = I(ir... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 <+YOU OR YOUR COMPANY+>.
#
# This 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, or (at your option)
# any later version.
#... |
# -*- coding: utf-8 -*-
# Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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
#... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import plugins
import json
class Plugin(plugins.BasePlugin):
__name__ = 'mdstat'
def run(self, config):
'''
Monitor software raid status using mdadm
pip install mdstat
'''
data = os.popen('sudo mdjson').read()
... |
import numpy as np
from pycqed.simulations import chevron_sim as chs
class TestChevronSim:
@classmethod
def setup_class(cls):
cls.e_min = -0.0322
cls.e_max = 0.0322
cls.e_points = 20
cls.time_stop = 60
cls.time_step = 4
cls.bias_tee = lambda self, t, a, b, c: ... |
# -*- coding: utf-8 -*-
"""Adding Scikit-learn Operations
Revision ID: c6x2kllv52os
Revises: bca9291ljsj5
Create Date: 2018-06-14 10:42:09.555626
"""
from alembic import context
from alembic import op
from sqlalchemy import String, Integer, Text
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql import tabl... |
# -*- coding: utf-8 -*-
# Copyright 2013 Christoph Reiter
#
# 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.
import os
i... |
#
# 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
# ... |
#
# Copyright 2014 ZHAW SoE
#
# 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, ... |
# hgvm-builder toilvgfacade.py: Provide a function-argument-based toil-vg API
"""
toil-vg curtrently has lots of cases where low-level functions depend on
command-line arguments in the options object. To make toil-vg targets callable
on arbitrary Toil file IDs, we need wrappers.
To use this facade, run add_options() ... |
"""Header value parser implementing various email-related RFC parsing rules.
The parsing methods defined in this module implement various email related
parsing rules. Principal among them is RFC 5322, which is the followon
to RFC 2822 and primarily a clarification of the former. It also implements
RFC 2047 encoded w... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
cyclocity.py
Copyright (C) 2010 Patrick Installé <PatrickInstalle@P-Installe.be>
Copyright (C) 2010-2011 Corentin Chary <corentincj@iksaif.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public ... |
# 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... |
#!/urs/bin/env python
# -*- coding: UTF8 -*-
"""
PySMOOTHING Library v 0.11
* Copyright (C) 2005 Victor M. Hernandez Rocamora
* Code for Savitsky-Golay filtering converted from MatLab code of 'sgolay' and
'sgolayfilt' functions from Octave software(http://www.octave.org/), which
are Copyright (C) 2001 Paul Kien... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
from django.conf import settings
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_cont... |
#!/usr/bin/env python
# Copyright 2017 Google 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 require... |
# Copyright (c) 2013 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 ... |
# Module to read the rather complex config data
import logging
import os
import pprint
from astropy import constants, units as u
import numpy as np
import pandas as pd
import yaml
import tardis
from tardis.io.model_reader import read_density_file, \
calculate_density_after_time, read_abundances_file
from tardis.... |
import pytest
from api.base.settings.defaults import API_BASE
from osf.models import RegistrationSchema
from osf_tests.factories import (
AuthUserFactory,
)
from website.project.metadata.schemas import LATEST_SCHEMA_VERSION
@pytest.mark.django_db
class TestMetaSchemaDetail:
@pytest.fixture()
def user(se... |
"""
pymbr
A python module to manipulate and create MBRs.
:copyright: (c) 2017 by Gideon S. (0xGiddi)
:license: GPLv3, see LICENSE file for more details.
"""
__all__ = ['Bootcode']
class Bootcode:
""" Common bootcodes used by various OSes """
ZERO = [0x00]
ZOIDBERG = [0xB8, 0xC0, 0x07, 0x05,... |
#!/usr/bin/python
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2011 Marek Marczykowski <marmarek@invisiblethingslab.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation;... |
#! /usr/bin/env python
# Sort a linked list in O(n log n) time using constant space complexity.
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
# a merge sort implementation
class Solution(object):
def sortList(self, head... |
from requests.exceptions import RequestException
from zeit.cms.content.property import ObjectPathProperty
from zeit.cms.i18n import MessageFactory as _
from zeit.content.author.interfaces import IAuthor
import UserDict
import grokcore.component as grok
import lxml.objectify
import requests
import urllib
import zeit.cms... |
import vim
import string
import clighter_helper
from clang import cindex
OCCURRENCES_PRI = -11
SYNTAX_PRI = -12
CUSTOM_SYNTAX_GROUP = {
cindex.CursorKind.INCLUSION_DIRECTIVE: 'cligherInclusionDirective',
cindex.CursorKind.MACRO_INSTANTIATION: 'clighterMacroInstantiation',
cindex.CursorKind.VAR_DECL: 'cli... |
from typing import Any
import pytest
from gevent.event import Event
from raiden.constants import ICEConnectionState
from raiden.network.transport.matrix.rtc.aiogevent import yield_future
from raiden.network.transport.matrix.rtc.web_rtc import WebRTCManager
from raiden.tests.utils.factories import make_signer
from raid... |
# Copyright (C) 2011 Crystalnix <vgachkaylo@crystalnix.com>
# This file is part of omaha-server.
# omaha-server 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
#... |
# MacroIP is part of MacroIP Core. Provides Access to IP services through simple
# textual macros.
# Copyright (C) 2014 Nicola Cimmino
#
# 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... |
#!/usr/bin/env python
import pexpect
import sys
import gtk
from ovirtnode.ovirtfunctions import log
class PopupEntry(gtk.Dialog):
def __init__(self, label="", title="", parent=None, flags=0, buttons=None):
super(PopupEntry, self).__init__(title, parent, flags, buttons)
self.hbox = gtk.HBox()
... |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""URL endpoints to show bisect stats."""
import datetime
import json
from dashboard import layered_cache
from dashboard import request_handler
from dashbo... |
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import dbus
import os
import pwd
import shutil
import subprocess
from autotest_lib.client.bin import utils
from autotest_lib.client.cros import constant... |
from oslo_log import log as logging
from gluon.common import exception as exc
from requests import get, put, post, delete
import json
LOG = logging.getLogger(__name__)
logger = LOG
class Client(object):
def __init__(self, backend):
self._backend = backend
def json_get(self, url):
resp = get... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# auto-detects PG ver, rolls-out all helpers not in exlude list, reports errors summary. dry-run first
# can only read monitoring DBs config from config DB or when specified per single DB / instance
import glob
import re
import psycopg2
import psycopg2.extras
import os
im... |
import errno
import functools
import inspect
import math
import os
from typing import Optional
import regex as re
import sqlalchemy as sa
import ibis.backends.base_sqlalchemy.alchemy as alch
from ibis.client import Database
from .compiler import SQLiteDialect
class SQLiteTable(alch.AlchemyTable):
pass
class ... |
#!/usr/bin/env python
# Illustrating the difference between Euler and Runge-Kutta propagation
# schemes, using an idealised (analytical) eddy current field.
# Double gyre current field from
# http://shaddenlab.berkeley.edu/uploads/LCS-tutorial/examples.html
import numpy as np
from datetime import datetime, timedelta... |
#! /usr/bin/env python
# FIXME: if it requires a dirac.cfg it is not a unit test and should be moved to tests directory
import unittest
import time
import os
import shutil
import sys
import types
from DIRAC.Core.Base.Script import parseCommandLine, getPositionalArgs
parseCommandLine()
from DI... |
# -*- coding: utf-8 -*-
import pytest
import time
from cfme.common.provider import BaseProvider
from cfme.exceptions import CFMEException
from cfme.infrastructure.provider.scvmm import SCVMMProvider
from cfme.utils.generators import random_vm_name
from cfme.utils.log import logger
from cfme.utils.wait import TimedOutE... |
# -*- coding: utf-8 -*-
#
# Imports ###########################################################
import json
import logging
import textwrap
from datetime import datetime, timedelta
from io import StringIO
from xml.etree import ElementTree as ET
import pytz
import webob
from django.conf import settings
from django.uti... |
#!/usr/bin/python
############################################################
# <bsn.cl fy=2013 v=onl>
#
# Copyright 2013, 2014 Big Switch Networks, Inc.
# Copyright 2015 Interface Masters Technologies, Inc.
#
# Licensed under the Eclipse Public License, Version 1.0 (the
# "License"); you may not use thi... |
#===============================================================================
# Copyright 2014 NetApp, Inc. All Rights Reserved,
# contribution by Jorge Mora <mora@netapp.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 ... |
#!/usr/bin/env python
# Build the documentation.
import sys, os
from subprocess import check_call, check_output, CalledProcessError, Popen, PIPE
def build_docs(srcPath):
print(srcPath)
print(os.path.join(srcPath, 'include/rele/'))
# Build docs.
# cmd = ['doxygen', '-']
# p = Popen(cmd, stdin=PIPE)
# p.com... |
# coding=utf-8
from PyQt4.QtGui import QApplication
import modis_extent_generator
from qgis.core import *
import l8_lst_swa_common_lib
import processing
import datetime
from urllib2 import urlopen
from ftplib import FTP
import shutil
from PyQt4.QtCore import QUrl
from PyQt4.QtNetwork import QNetworkAccessManager, QNet... |
""" Unit tests for vector geometry predicate methods """
from __future__ import division
import unittest
import numpy as np
from karta.vector.geometry import (Point, Line, Polygon,
Multipoint, Multiline, Multipolygon)
from karta.crs import (Cartesian, SphericalEarth, LonLatWGS84)
fr... |
from ComputationProblem import ComputationProblem
import os
class GB_Z_lp(ComputationProblem):
"""
This computation problem represents the computation of a Groebner basis of a given polynomial system
(commutative) with integer coefficients and the lexicographical ordering.
.. moduleauthor:: Albert Hei... |
# This file is part of Indico.
# Copyright (C) 2002 - 2015 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; either version 3 of the
# License, or (a... |
from namespaces import *
NAMEMAP = {
'ambig-paragraph': ICEA.ambigparagraph,
'bold': ICEA.bold,
'byline': ICEA.byline,
'changed': ICEA.changed,
'corpus': ICEA.corpus,
'correction': ARTA.correction,
'deleted': ICEA.deleted,
'discontinuous': ICEA.discontin... |
from __future__ import division
import re
import urllib2
from curses.ascii import isdigit
from nltk.corpus import cmudict
d = cmudict.dict()
from nltk.corpus.util import LazyCorpusLoader
from nltk.corpus.reader import *
suffdict = LazyCorpusLoader(
'cmusuffdict', CMUDictCorpusReader, ['cmusuffdict'])
suffdict = suf... |
try:
import httplib
except:
import http.client as httplib
class Codes:
"""
Standard HTTP response codes used inside Vingd ecosystem.
"""
# success
OK = 200
CREATED = 201
NO_CONTENT = 204
PARTIAL_CONTENT = 206
# error
MULTIPLE_CHOICES = 300
MOVED_PERMANENTLY = 301
... |
import tornado.ioloop
import tornado.httpclient
import os
import functools
import gzip
import logging
import urllib
try:
import ujson as json
except ImportError:
import json
class FileToSimplequeue(object):
http = tornado.httpclient.AsyncHTTPClient(max_simultaneous_connections=50, max_clients=50)
def _... |
import time
import requests_mock
from flask import current_app
from listenbrainz.domain import spotify
from listenbrainz.webserver.testing import ServerTestCase
from unittest import mock
class SpotifyDomainTestCase(ServerTestCase):
def setUp(self):
super(SpotifyDomainTestCase, self).setUp()
se... |
import pytest
import nengo
import nengo.config
def test_config():
@nengo.config.configures(nengo.Ensemble)
class TestConfigEnsemble(nengo.config.ConfigItem):
something = nengo.config.Parameter(None)
other = nengo.config.Parameter(0)
@nengo.config.configures(nengo.Connection)
class Te... |
__author__ = 'ivo'
import logging
import argparse
from blackswan import config
_log = logging.getLogger(__name__)
class ModuleBase():
argparser = None
def __init__(self):
self.config = {}
@classmethod
def register(cls):
cls.argparser = argparse.ArgumentParser(description=cls.descri... |
from django.db import models
from django.contrib.contenttypes.fields import GenericRelation
from django.urls import reverse
from django.utils.safestring import mark_safe
from djiffy.models import Manifest
from winthrop.common.models import Named, Notable, DateRange
from winthrop.places.models import Place
from winthro... |
import random
import time
def create_random_graph(nodes):
""" Creates a random (directed) graph with the given number of nodes """
graph = []
for i in range(0, nodes):
graph.append([])
for j in range(0, nodes):
rand = random.randint(1, 100)
if rand % 2 == 0 and i !... |
import copy_reg
import imp
import os
import re
import sys
import types
from importlib import import_module
from os.path import abspath, join, exists
from seisflows.tools import msg
from seisflows.tools.err import ParameterError
from seisflows.tools import unix
from seisflows.tools.tools import loadjson, loadobj, loa... |
# Copyright 2011 OpenStack LLC.
# 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 b... |
#!/usr/bin/env python
# Copyright 2010-2012 RethinkDB, all rights reserved.
from random import shuffle
import sys, os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import memcached_workload_common
from vcoptparse import *
op = memcached_workload_common.option_parse... |
# coding=UTF-8
import os
import shutil
import subprocess
from datetime import datetime
from itertools import chain
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey, Ge... |
import random
s_nouns = ["A dude", "My mom", "The king", "Some guy", "A cat with rabies", "A sloth", "Your homie", "This cool guy my gardener met yesterday", "Superman"]
p_nouns = ["These dudes", "Both of my moms", "All the kings of the world", "Some guys", "All of a cattery's cats", "The multitude of sloths living un... |
import MenuMaker
from MenuMaker import indent, writeFullMenu
menuFile = "~/.config/awesome/menumaker/menu.lua"
def _map(x) :
for d, s in (("&", "&"), ("\'", "\"")) :
x = x.replace(s, d)
return x
class Sep(object) :
def emit(self, level) :
return ['%s' % indent(level)]
def emit_menu(self, lev... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2013-2021 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 version 3 of the Licen... |
import time
from datetime import datetime
import mock
import pytest
from uz.tests import Awaitable
from uz.interface.telegram import bot
from uz.scanner import UknkownScanID
CHAT_ID = 'chat_id'
def tg_message(text):
return {
'chat': {
'id': CHAT_ID,
'type': 'private',
... |
# -*- coding: utf-8 -*-
#
# django-homecontrol documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 13 17:28:03 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated ... |
"""This demo program solves Poisson's equation
- div grad u(x, y) = f(x, y)
on the unit square with source f given by
f(x, y) = exp(-100(x^2 + y^2))
and homogeneous Dirichlet boundary conditions.
Note that we use a simplified error indicator, ignoring
edge (jump) terms and the size of the interpolation con... |
import unittest
import urllib
from mock import patch
from oauth2client import xsrfutil
from oauth2client.django_orm import Storage
from oauth2client.client import OAuth2WebServerFlow
from django.contrib.auth.models import User
from django.conf import settings
from django.core.urlresolvers import reverse
from django.c... |
# Copyright 2010 Mike Wakerly <opensource@hoho.com>
#
# This file is part of the Pykeg package of the Kegbot project.
# For more information on Pykeg or Kegbot, see http://kegbot.org/
#
# Pykeg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
import json
import urllib
import urllib2
import ssl
import base64
from lib import *
class sslparameters:
sslcontext = None
def get_opener():
try:
opener = urllib2.build_opener(urllib2.HTTPSHandler(context=sslparameters.sslcontext))
except TypeError:
opener = urllib2.build_opener(urllib2.H... |
def plot_single(in_file, zfunc, zname, out_file):
import pylab
import numpy
import h5py
from matplotlib.collections import PolyCollection
import matplotlib as mpl
import matplotlib.pyplot as plt
import os
print(out_file)
if os.path.isfile(out_file):
return
with h5py.Fi... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import unittest
import os
from PIL import Image
from nose.tools import raises
from kraken.pageseg import segment
from kraken.lib.exceptions import KrakenInputException
thisfile = os.path.abspath(os.path.dirname(__file__))
reso... |
"""Unit test suite for the Google API part."""
import unittest2 as unittest
from datetime import datetime, timedelta
import random
import logging
import gdata.service
import gdata.calendar
import gdata.calendar.service
import yaml
import os.path
from mock import Mock, patch
Alphabet = 'abcdefghijlkmnopqrstuvwxyz01234... |
# This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2018 Alban 'spl0k' Féron
# 2018-2019 Carey 'pR0Ps' Metcalfe
#
# Distributed under terms of the GNU AGPLv3 license.
import os
import unittest
import shutil
import time
import tempfile
fr... |
from process.ArrayParsing import ArrayParsing
FUNCTION = 'Function'
EQUIPMENT = 'Equipment'
TYPE_OF_INTERFACE = 'TypeOfInterface'
SLOT = 'Slot'
SUBLSLOT = 'Subslot'
INTERFACES = 'Interfaces'
class Interface(ArrayParsing):
""" This class provides methods to deal with interfaces of an equipemnt.
""... |
"""
ConnectionField and associated classes.
This module defines some basic classes of objects used to create
simulations of cortical sheets that take input through connection
fields that project from other cortical sheets (or laterally from
themselves).
ConnectionField: Holds a single connection field within a
CFProj... |
#!/usr/bin/python
#
# License: Refer to the README in the root directory
#
import argparse, shlex
from basecmd import BaseCmd
class Debuggable(BaseCmd):
def __init__(self, session):
BaseCmd.__init__(self, session)
self.prompt = "*mercury#debuggable> "
def do_back(self, _args):
"""
Re... |
from externals.lib.social._login import IUserStore
from sqlalchemy.orm.exc import NoResultFound
from ..model import DBSession, commit
from ..model.model_comunity import ComunityUser, SocialToken
from ..templates import helpers as h
class ComunityUserStore(IUserStore):
def get_user_from_token(self, provider_to... |
# -*- coding: utf-8 -*-
# This file is part of GridCal.
#
# GridCal 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.
#
# GridCal is dist... |
# Miro - an RSS based video player application
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Participatory Culture Foundation
#
# 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; eithe... |
import tp
import mm
def thing_init(t):
return
def weapon_init(name, short_name, long_name, damage, is_double_handed=False):
x = tp.Tp(name)
x.set_long_name(long_name)
x.set_short_name(short_name)
x.set_is_weapon(True)
x.set_z_depth(mm.Z_DEPTH_TREASURE)
x.set_damage(damage)
x.set_is_... |
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and ... |
#!/usr/bin/python
import sys
import os
import shutil
import signal
import time
import random
import getpass
import re
import subprocess
import ConfigParser
def is_python_test_file(file_name):
"""
Return True if file_name matches a regexp for a python test. False otherwise.
"""
if (file_name == "tes... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... |
"""
Start Date Transformer implementation.
"""
from lms.djangoapps.courseware.access_utils import check_start_date
from openedx.core.djangoapps.content.block_structure.transformer import (
BlockStructureTransformer,
FilteringTransformerMixin
)
from xmodule.course_metadata_utils import DEFAULT_START_DATE
from... |
import psycopg2
import psycopg2.extras
from flask import current_app
from datasethoster import Query
psycopg2.extras.register_uuid()
class RecordingFromRecordingMBIDQuery(Query):
'''
Look up a musicbrainz data for a list of recordings, based on MBID.
'''
def names(self):
return ("recordi... |
# -*- coding: utf-8 -*-
import sys
from . import quickstart
from IPython.terminal.interactiveshell import TerminalInteractiveShell
IMPORTS = [
'from utils import conf',
'from fixtures.pytest_store import store',
'from utils.appliance.implementations.ui import navigate_to',
'from utils import providers... |
# Copyright 2014 Google 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 required by applicable law or agre... |
#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at y... |
import newick_git
class Node:
def __init__(self, taxon = None):
self.adjs = set()
for adj in self.adjs:
adj.add_adj(self)
self.taxon = taxon
def add_adj(self, branch):
self.adjs.add(branch)
if not branch.is_adj(self):
branch.add_adj(self)
... |
"""
Support for Netatmo Smart Thermostat.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.netatmo/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.const import TEMP_CELSIUS, ATTR_TEMPERATURE
from home... |
# $Id$
#
# Copyright (C) 2007 by Greg Landrum
# All rights reserved
#
from __future__ import print_function
from rdkit import Chem,Geometry
from rdkit.Chem import AllChem
from rdkit.Chem.Subshape import SubshapeObjects
from rdkit.Chem.Subshape import BuilderUtils
from rdkit.six.moves import cPickle
import time
#----... |
#!/usr/bin/env python
import sys
import pysam
import os.path
import Script
def usage():
sys.stderr.write("""bisconv.py command [args...] - Extract aligned reads from BAM file based on conversion strand.
This program examines the ZS tag of the reads in a BAM file produced by BSMAP to identify reads
coming from ... |
class DateTransformer(TransformerMixin):
"""
Converts a datetime type column, into 3 separate columns that represent:
* year
* month
* day
* day_of_week
Parameters
**********
* date_column: Name of the date column.
* include_day_of_week: Defaults True. Set to False to avoid creating this column.
* drop_d... |
class interface(object):
# Copyright 2012 Loris Corazza, Sakis Christakidis
#
# 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
#
# ... |
class MatcherEngine(list):
"""
HTTP request matcher engine used by `pook.Mock` to test if an
intercepted outgoing HTTP request must be mocked out or not.
"""
def add(self, matcher):
"""
Adds a new matcher function to the current engine.
Arguments:
matcher (funct... |
# -*- coding: utf-8 -*-
import warnings
import os.path as op
from nose.tools import assert_false, assert_equal, assert_raises, assert_true
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose
from mne import Epochs, read_events
from mne.io import (read_fiducials, write_fiducials, _coil_tra... |
from distutils.core import setup
from setuptools import find_packages
from io import open
with open('README.md', encoding="utf-8") as fp:
long_description = fp.read()
setup(
name='sendwithus',
version='5.2.2',
author='sendwithus',
author_email='us@sendwithus.com',
packages=find_packages(),
... |
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import transaction
from django.http import HttpResponseRedirect, HttpResponseForbidden
from django.shortcuts import render, get_object_or_404
from django.utils import simplejson
from django.views.decorators.csrf import csrf_pro... |
import logging
import pathlib
import sys
from tkinter import filedialog
import pytest
from porcupine import dirs, filedialog_kwargs, get_main_window
from porcupine.plugins import filetypes
@pytest.fixture
def custom_filetypes():
# We don't overwrite the user's file because porcupine.dirs is monkeypatched
as... |
#pylint: disable=E1101
import json
import shutil
import mock
from textwrap import dedent
from django.test.client import Client
from django.test.utils import override_settings
from django.conf import settings
from django.core.urlresolvers import reverse
from path import path
from tempdir import mkdtemp_clean
from fs.... |
# Copyright (C) 2004-2008 Paul Cochrane
#
# 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 distribut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.