gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""Unit tests for the copy module."""
import sys
import copy
import copy_reg
import unittest
from test import test_support
class TestCopy(unittest.TestCase):
# Attempt full line coverage of copy.py from top to bottom
def test_exceptions(self):
self.assert_(copy.Error is copy.error)
self.ass... | |
# Copyright (c) 2014 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... | |
#!/usr/bin/env python2
# coding: utf8
import subprocess
import socket
import time
import sys
import paramiko
device = 'sda'
print("1. Boot to ArchLinux.iso")
ip = raw_input("2. Get IP (run `ip address` of `ifconfig`): ")
print(" Checking ip")
proc = subprocess.Popen(["ping", "-c 1", "-W 100", ip], stdout=subproces... | |
import logging
from django.core.paginator import Paginator, InvalidPage
from django.contrib.auth.models import User
from django.conf.urls.defaults import url
from django.shortcuts import get_object_or_404
from django.http import Http404
from django.core.urlresolvers import reverse
from django.utils.translation import ... | |
# Copyright 2008-2016 by Peter Cock. All rights reserved.
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Bio.AlignIO support for "fasta-m10" output from Bill Pearson's FASTA tools.
You are exp... | |
# -*- coding: UTF-8 -*-
import threading
import MySQLdb
import MySQLdb.cursors
import Queue
import tornado.ioloop
import tornado.gen
import tornado.concurrent
class MySQLConnection(object):
class Worker(threading.Thread):
def __init__(self, conn, *args, **kwargs):
"""
Initializ... | |
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 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/lic... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import sys
import pytest
PY3 = sys.version_info[0] >= 3
pytest.skip("PY3")
pytest.importorskip('sphinx') # skips these tests if sphinx not present
class FakeConfig(object):
"""
Mocks up a sphinx configuration setting construct for a... | |
"""
Copyright 2015 Paul T. Grogan, Massachusetts Institute of Technology
Copyright 2017 Paul T. Grogan, Stevens Institute of Technology
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://ww... | |
#!/usr/bin/python
import sys
import logging
from re import search
from glob import glob
import numpy as np
import pandas as pd
from numpy import fromfile
def read_aexp_list_from_files(directory, filename_prefix="halo_catalog_a", filename_suffix=".dat") :
epochs = []
for output in glob("%s/%s*%s" % (directo... | |
from taskplus.apps.rest import models
from taskplus.apps.rest.database import db_session
from taskplus.core.domain import User, UserRole
from taskplus.core.shared.repository import Repository
from taskplus.core.shared.exceptions import NoResultFound, NotUnique, DbError, CannotBeDeleted
from taskplus.core.authorization ... | |
import os.path as op
from functools import wraps
from flask import Blueprint, current_app, render_template, abort, g, url_for
from flask_admin import babel
from flask_admin._compat import with_metaclass
from flask_admin import helpers as h
# For compatibility reasons import MenuLink
from flask_admin.menu import Menu... | |
import difflib
import json
import os
import re
import sys
from copy import copy
from functools import wraps
from urlparse import urlsplit, urlunsplit
from xml.dom.minidom import parseString, Node
import select
import socket
import threading
import errno
from django.conf import settings
from django.contrib.staticfiles.... | |
import sys, os, json, ast, requests
from time import time as tm, sleep as slp
from datetime import datetime as dt
from itertools import cycle
from pyquery import PyQuery as pq_
from browse import browse_url_profile_details
from user_agents import user_agents
data_dir = 'profile_data/'
class indeed_resumes_details(o... | |
import datetime
import glob
import os
import time
from django.conf import settings
from django.template.loader import render_to_string
from ietf.message.models import Message, SendQueue
from ietf.message.utils import send_scheduled_message_from_send_queue
from ietf.doc.models import DocumentAuthor
from ietf.person.mo... | |
# Copyright (C) 2009 The Android Open Source Project
#
# 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 ... | |
# Copyright (C) 2012-2013 Red Hat, 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 la... | |
"""Mean shift clustering algorithm.
Mean shift clustering aims to discover *blobs* in a smooth density of
samples. It is a centroid based algorithm, which works by updating candidates
for centroids to be the mean of the points within a given region. These
candidates are then filtered in a post-processing stage to elim... | |
"""
SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested w... | |
#
# Copyright 2019 The FATE Authors. 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 appli... | |
# coding: utf-8
#
# This file is part of Sequana software
#
# Copyright (c) 2016 - Sequana Development Team
#
# File author(s):
# Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>,
# <d.desvillechabrol@gmail.com>
#
# Distributed under the terms of the 3-clause BSD license.
# The full licen... | |
import sys
import sqlalchemy
class Field(sqlalchemy.Column):
""" Base class for all field types
"""
def __get__(self, obj, obj_type):
if obj is None:
return self
return getattr(obj, self._apply_suffix(self.name), self.default)
def __set__(self, obj, value):
self._... | |
import json
from normality import ascii_text
from pprint import pprint # noqa
from aleph.core import url_for, es, es_index, schemata
from aleph.index import TYPE_ENTITY, TYPE_DOCUMENT
from aleph.search.util import execute_basic
from aleph.search.fragments import match_all, filter_query, multi_match
from aleph.search.... | |
#!/usr/bin/python
__author__ = 'vilelag'
import os
import argparse
import itertools
from multiprocessing import Pool
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib import patheffects
def ... | |
from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyxl
## Incomplete!
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
Float,
Integer,
Set,
String,
Bool,
)
from openpyxl.descriptors.excel import Guid, ExtensionList
from open... | |
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - LikePages action
This action generates a list of pages that either start or end
with the same word as the current pagename. If only one matching
page is found, that page is displayed directly.
@copyright: 2001 Richard Jones <richard@bizarsoftware.com.au>... | |
"""Xdawn implementation."""
# Authors: Alexandre Barachant <alexandre.barachant@gmail.com>
#
# License: BSD (3-clause)
import copy as cp
import numpy as np
from scipy import linalg
from ..io.base import _BaseRaw
from ..epochs import _BaseEpochs
from .. import Covariance, EvokedArray, Evoked, EpochsArray
from ..io.pi... | |
# Copyright (c) 2005-2009 Jaroslav Gresula
#
# Distributed under the MIT license (See accompanying file
# LICENSE.txt or copy at http://jagpdf.org/LICENSE.txt)
#
from pygccxml import parser
from pygccxml import declarations
import StringIO
import re
def global_namespace():
#configure GCC-XML parser
config = ... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helper class for interacting with the Dev Server."""
from __future__ import print_function
import ast
import base64
impor... | |
"""
sentry.db.models.fields.node
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import collections
import logging
import six
import warnings
from django.c... | |
import pytest
from ethereum import tester as t
from ethereum import blocks, utils, transactions, vm, abi, opcodes
from ethereum.exceptions import InvalidTransaction
import rlp
from rlp.utils import decode_hex, encode_hex, ascii_chr, str_to_bytes
from ethereum import processblock as pb
import copy
from ethereum.db impo... | |
#!/usr/bin/python2
import sys
import base64
import StringIO
import xml.etree.ElementTree as ET
from PyQt4 import QtCore, QtGui, QtNetwork
class PackageTypeWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
# state constants
self.Disconnected, self.Pending, self.... | |
# 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 required by applicable law or a... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | |
# Python stubs generated by omniidl from /usr/local/share/idl/omniORB/COS/CosLifeCycle.idl
# DO NOT EDIT THIS FILE!
import omniORB, _omnipy
from omniORB import CORBA, PortableServer
_0_CORBA = CORBA
_omnipy.checkVersion(4,2, __file__, 1)
try:
property
except NameError:
def property(*args):
return No... | |
import glob
import os
import pickle
import shutil
import sys
import tempfile
import time
import unittest
from unittest.mock import patch
import yaml
import ray
from ray.rllib import _register_all
from ray import tune
from ray.tune.integration.docker import DockerSyncer
from ray.tune.integration.kubernetes import Kube... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 18 17:48:03 2017
@author: Masao Takakuwa
"""
import numpy as np
from common.functions import sigmoid
class Relu(object) :
def __init__(self):
self.mask = None
def forward(self, x):
self.mask = (x <= 0)
out = x.copy()... | |
import pandas as pd
import numpy as np
class Developer(object):
"""
Pass the dataframe that is returned by feasibility here
Can also be a dictionary where keys are building forms and values are
the individual data frames returned by the proforma lookup routine.
"""
def __init__(self, feasib... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... | |
#
# Django-Lets-go
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2014 Star2Billing S.L.
#
# The Initial Developer of the Original Code is
# Ar... | |
import socket
import httplib, urllib
import sys, traceback
from threading import *
import logging
from Queue import Queue, Empty
import exceptions
import sys
import time
if float(sys.version[:3]) >= 2.6:
import json
else:
# python 2.4 or 2.5 can also import simplejson
# as working alternative to the json ... | |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 Chris Moyer http://coredumped.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 Software without restriction, incl... | |
# Twisted Imports
from twisted.internet import reactor, defer, task
from twisted.python import log, failure
# Sibling Imports
from .error import NotRunning, AlreadyRunning, NotPaused, Stopped
# Package Imports
from ..constants import State
from ..events import EventEmitter
def init_child (parent, child):
from .seq... | |
from __future__ import division, unicode_literals
import base64
import io
import itertools
import os
import time
import xml.etree.ElementTree as etree
from .fragment import FragmentFD
from ..compat import (
compat_urlparse,
compat_urllib_error,
)
from ..utils import (
encodeFilename,
sanitize_open,
... | |
import inspect
import os
import pytest
from sanic.blueprints import Blueprint
@pytest.fixture(scope="module")
def static_file_directory():
"""The static directory to serve"""
current_file = inspect.getfile(inspect.currentframe())
current_directory = os.path.dirname(os.path.abspath(current_file))
sta... | |
# Copyright 2013 OpenStack Foundation
#
# 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... | |
"""
Project Bluebox
2015, University of Stuttgart, IPVS/AS
"""
from _collections_abc import Iterator
from itertools import count
import abc
"""
Project Bluebox
Copyright (C) <2015> <University of Stuttgart>
This software may be modified and distributed under the terms
of the MIT license. See the LICENSE fi... | |
from __future__ import unicode_literals
import os
from django.contrib.auth.models import AnonymousUser
from django.core.cache import cache
from django.core.exceptions import ValidationError
from djblets.testing.decorators import add_fixtures
from kgb import SpyAgency
from reviewboard.scmtools.core import HEAD
from r... | |
# 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 ... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Parser for Psi3 output files."""
import numpy
from cclib.parser import logfileparser
from cclib.parser import utils
... | |
# -*- coding: utf-8 -*-
'''
The function in `vdirsyncer.sync` can be called on two instances of `Storage`
to synchronize them. Due to the abstract API storage classes are implementing,
the two given instances don't have to be of the same exact type. This allows us
not only to synchronize a local vdir with a CalDAV serv... | |
# -*- coding: utf-8 -*-
"""
Misc ArcPy Addons
Author: Garin Wally
License: MIT
"""
import os
import glob
import random
import re
import sys
#from time import sleep
from queue import Queue
from subprocess import Popen, PIPE
from collections import OrderedDict
from xml.dom import minidom as DOM
from ConfigParser import ... | |
# Flask Dev Server
PORT = 5443
# Flask-Alembic imports configuration from here instead of the alembic.ini
ALEMBIC = {
'script_location': '%(here)s/alembic/versions'
}
ALEMBIC_CONTEXT = {
'render_as_batch': True, # Necessary to support SQLite ALTER on constraints
}
# Describes a static OAuth 2 Client which 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
# ... | |
from __future__ import print_function
from __future__ import unicode_literals
import io
import networking
import private
import requests
"""
Extract info from IMDB and optionally upload it to ElasticSearch
"""
import argparse
import collections
import pprint
import sys
from operator import itemgetter
import elasti... | |
import math
import animation
from math import sin, cos
from geometry import Point, dot_product, cross_product
from PIL import Image, ImageDraw
def planar_apply(p, f, axis):
if axis == "x":
y,z = f(Point(p.y, p.z)).tuple()
return Point(p.x, y, z)
elif axis == "y":
x,z = f(Point(p.x, p.z... | |
#############################################################################
#
# $Id: protocol.py,v 2.94.2.38 2009/12/06 17:16:47 irmen Exp $
# Pyro Protocol Adapters
#
# This is part of "Pyro" - Python Remote Objects
# which is (c) Irmen de Jong - irmen@users.sourceforge.net
#
########################################... | |
import datetime
import unittest2
import webtest
import json
import md5
import api_main
import cron_main
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.account_permissions import AccountPermissions
from consts.auth_type import AuthT... | |
# 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 required by applicable law or a... | |
#!/usr/bin/env python
"""
Copyright (c) 2019 Alex Forencich
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, merg... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers.sql
~~~~~~~~~~~~~~~~~~~
Lexers for various SQL dialects and related interactive sessions.
Postgres specific lexers:
`PostgresLexer`
A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL
lexer are:
- keywords and dat... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat, Inc.
# All Rights Reserved.
# 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
#
# ... | |
#!/usr/bin/env python3
from test import support
import marshal
import sys
import unittest
import os
class HelperMixin:
def helper(self, sample, *extra):
new = marshal.loads(marshal.dumps(sample, *extra))
self.assertEqual(sample, new)
try:
with open(support.TESTFN, "wb") as f:
... | |
# Copyright (c) 2015 Red Hat, 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... | |
"""
Eric Nordstrom
Python 3.6.0
4/29/17
Removes out-of-vocabulary (OOV) words, a.k.a. "mixed words", from the provided series of
tokens. Words are deemed OOV when they are not found in either provided language dictionary.
Results are stored in .TXT file(s) specified by the user. PyDictionary option available for
Engl... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
from __future__ import division, absolute_import, print_function
import re
import os
import sys
import warnings
import platform
import tempfile
from subprocess import Popen, PIPE, STDOUT
from numpy.distutils.fcompiler import FCompiler
from numpy.distutils.exec_command import exec_command
from numpy.distutils.misc_uti... | |
"""
The MIT License
Copyright (c) 2008 Gilad Raphaelli <gilad@raphaelli.com>
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, c... | |
# Copyright 2018 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 agreed to in writing, s... | |
#!/usr/bin/python -Wall
# ================================================================
# Please see LICENSE.txt in the same directory as this file.
# John Kerl
# kerl.john.r@gmail.com
# 2007-05-31
# ================================================================
# Type module for the group of Pauli matrices.
im... | |
#!/usr/bin/env python
# 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
#
# Authors:
# - Daniel Drizhuk, d.drizhuk@gmail.com, 2017
# - Mario Lassnig, ... | |
# -*- coding: utf-8 -*-
'''
mirrormanager2 tests.
'''
__requires__ = ['SQLAlchemy >= 0.7']
import pkg_resources
import unittest
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(
os.path.abspath(__file__)), '..'))
import mirrormanager2.lib
import tests
class MMLibtests(tests.Modeltests):
... | |
# Copyright (c) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | |
"""
Test the func_inspect module.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
import functools
from joblib.func_inspect import filter_args, get_func_name, get_func_code
from joblib.func_inspect import _clean_win_chars, f... | |
import json
from django import forms
from django.contrib.auth.decorators import user_passes_test
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from crits.core import for... | |
r"""
.. autofunction:: openpnm.models.physics.generic_source_term.charge_conservation
.. autofunction:: openpnm.models.physics.generic_source_term.standard_kinetics
.. autofunction:: openpnm.models.physics.generic_source_term.linear
.. autofunction:: openpnm.models.physics.generic_source_term.power_law
.. autofunction... | |
# coding: utf-8
from __future__ import unicode_literals, division
"""
Created on Jun 1, 2012
"""
__author__ = "Shyue Ping Ong, Stephen Dacek"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Jun 1, 2012"
import uni... | |
# Views for Parkmap
from django.contrib.sites.models import Site
from django.contrib.gis.measure import D
import json
from django.utils import simplejson
from django.core.mail import send_mail
from django.template.defaultfilters import slugify
from django.shortcuts import render_to_response, get_object_or_404, redire... | |
# Copyright 2015 The TensorFlow Authors. 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 applica... | |
import regex as re
import itertools
from collections import defaultdict
def exact_barcode_filter(chunk, bc1, bc2, bc3):
parser_re = re.compile('(.*):CELL_(?P<CB>.*):UMI_(.*)\\n(.*)\\n\\+\\n(.*)\\n')
kept = []
for read in chunk:
match = parser_re.search(read).groupdict()
cb1 = match['CB']
... | |
"""
Provide functionality to keep track of devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/device_tracker/
"""
# pylint: disable=too-many-instance-attributes, too-many-arguments
# pylint: disable=too-many-locals
import asyncio
from datetime impo... | |
#!/usr/bin/env python3 -tt
"""
File: gobjects.py
-------------------------
This example program illustrates the use of the Python graphics library.
"""
from spgl.graphics.gwindow import *
from spgl.gtypes import *
from spgl.graphics.gobjects import *
from spgl.gsounds import *
from spgl.filelib import *
CONTINUE = ""... | |
import sqlite3
import time
from twisted.trial.unittest import TestCase
from twisted.python.util import sibpath
from twisted.internet import defer
from frack.db import (TicketStore, UnauthorizedError, NotFoundError,
AuthStore, Collision)
from norm.sqlite import SqliteTranslator
from norm.common imp... | |
#
# o o
# 8
# .oPYo. .oPYo. odYo. o8P o8 .oPYo. odYo. .oPYo. .oPYo.
# Yb.. 8oooo8 8' `8 8 8 8oooo8 8' `8 8 ' 8oooo8
# 'Yb. 8. 8 8 8 8 8. 8 8 8 . 8.
# `YooP' `Yooo' 8 8 8 ... | |
# Copyright (c) 2018 PaddlePaddle Authors. 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 app... | |
import math
from ..libmp.backend import xrange
class QuadratureRule(object):
"""
Quadrature rules are implemented using this class, in order to
simplify the code and provide a common infrastructure
for tasks such as error estimation and node caching.
You can implement a custom quadrature rule by ... | |
########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... | |
# -*- coding: utf-8 -*-
"""
.. _layer_tutorial:
.. currentmodule:: mlens.parallel
Layer Mechanics
===============
ML-Ensemble is designed to provide an easy user interface. But it is also designed
to be extremely flexible, all the wile providing maximum concurrency at minimal
memory consumption. The lower-level API... | |
# Copyright (c) 2015 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 ... | |
#!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | |
"""Provide functionality to interact with the vlc telnet interface."""
from __future__ import annotations
from datetime import datetime
from functools import wraps
from typing import Any, Callable, TypeVar, cast
from aiovlc.client import Client
from aiovlc.exceptions import AuthError, CommandError, ConnectError
impor... | |
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | |
import os
import re
import sys
## used for nt reverse complements
_nt_comp_table = bytes.maketrans(b'ACBDGHKMNSRUTWVYacbdghkmnsrutwvy', \
b'TGVHCDMKNSYAAWBRtgvhcdmknsyaawbr')
# for translations: http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi
_translation_table = {
1: {
... | |
"""
(C) 2014-2019 Roman Sirokov and contributors
Licensed under BSD license
http://github.com/r0x0r/pywebview/
"""
import sys
import logging
import json
import webbrowser
try:
from urllib.parse import unquote
except ImportError:
from urllib import unquote
from uuid import uuid1
from threading import Event, Se... | |
# -*- coding: utf-8 -*-
"""
httpbin.core
~~~~~~~~~~~~
This module provides the core HttpBin experience.
"""
import base64
import json
import os
import random
import time
import uuid
import argparse
from flask import Flask, Response, request, render_template, redirect, jsonify as flask_jsonify, make_response, url_fo... | |
'''
The MIT License (MIT)
Copyright (c) 2007 ~ 2015, Hong-She Liang <starofrainnight@gmail.com>.
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... | |
#!/usr/bin/env python
#
# Copyright 2011-2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT lice... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
# Copyright 2019 DeepMind Technologies 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 agr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.