gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import logging
import json
import os
import argparse
import csv
import hashlib
import sys
try:
from mapping_classes import InputClass
except ImportError:
sys.path.insert(0, os.path.abspath(os.path.join(os.path.split(__file__)[0], os.path.pardir, "src")))
from mapping_classes import InputClass
from mapping_cl... | |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# 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 appl... | |
XXXXXXXXX XXXXX
XXXXXX
XXXXXX
XXXXX XXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXX X XXXXX XXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXX... | |
"""
test_utils.py
adds WebCase for testing Howl server functionality
"""
import sys, time,socket
import unittest
import commands
import pprint
import simplejson
import httplib2
import howl
class WebCase(unittest.TestCase):
"""
Modification of the CherryPy WebCase tests.
Defines the self.getPage method to reque... | |
# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/
# 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... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import copy
import inspect
from bisect import bisect
from collections import defaultdict, OrderedDict
import six
from itertools import chain
from .exceptions import ObjectDoesNotExist, FieldError, ModelError
from... | |
import re
import matplotlib
matplotlib.use('pdf')
from matplotlib import pyplot
from matplotlib.patches import PathPatch
from matplotlib.path import Path
from shapely.wkt import loads as load_wkt
from shapely import affinity
import numpy as np
from simdna.simulations import loaded_motifs
from pkg_resources import re... | |
#!/usr/bin/env python
def _complain_ifclosed(closed):
if closed:
raise ValueError, "I/O operation on closed file"
class StringIO:
"""class StringIO([buffer])
When a StringIO object is created, it can be initialized to an existing
string by passing the string to the constructor. If no string is given,
... | |
##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | |
from django.test import TestCase, Client
from django.contrib.auth.models import User
from binder.json import jsonloads, jsondumps
from .testapp.models import Animal, Caretaker, Zoo
class AnnotationTestCase(TestCase):
def setUp(self):
super().setUp()
u = User(username='testuser', is_active=True, is_superuser=Tr... | |
# -*- coding: utf-8 -*-
# Python module: ModbusClient class (Client ModBus/TCP class 1)
from . import constants as const
import re
import socket
import select
import struct
import random
class ModbusClient:
"""Client Modbus TCP"""
def __init__(self, host=None, port=None, unit_id=None, timeout=None,
... | |
from flask import Flask, jsonify, render_template, request
from db import readDB, writeDB, updateDB
import random
import time
app = Flask(__name__)
@app.route('/_validateUser')
def getUsers():
email = request.args['email']
password = request.args['password']
users = readDB("data/users.json")["users"]
... | |
from Bio.Seq import Seq
from Bio import SeqIO
from Bio.Alphabet import IUPAC
from Bio.SeqRecord import SeqRecord
import argparse
import glob
import os
import tempfile
import subprocess
import sys
from datetime import datetime
""" This script takes in 2 fasta files and trimms the sequences in 1 to that of the referenc... | |
# Purpose - ItemsetData is a class to generate transaction data with
# seeded events in order to test mining algorithms
import random
import sys
from collections import defaultdict, namedtuple
import matplotlib.pyplot as plt
import numpy as np
class ItemsetData:
# Initiates the ItemsetData object
# Inputs
... | |
import os
import multiprocessing
import logging
import marshal
import cPickle
import shutil
import struct
import urllib
import msgpack
from dpark.env import env
from dpark.tracker import GetValueMessage, AddItemMessage, RemoveItemMessage
logger = logging.getLogger("cache")
class Cache:
data = {}
def get(s... | |
# 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 ... | |
#-*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django import template
from django.core.exceptions import ValidationError
from django.contrib.admin import helpers
from django.contrib.admin.util import quote, unquote, capfirst
from django.contrib import messages
from django.... | |
"""
Wheel command-line utility.
"""
import os
import hashlib
import sys
import json
import wheel.paths
from glob import iglob
from .. import signatures
from ..util import (urlsafe_b64decode, urlsafe_b64encode, native, binary,
matches_requirement)
from ..install import WheelFile
def require_pkgre... | |
import sys
import time
import profile
#sys.path.insert(0, "..")
#sys.path.insert(0, "ddglib")
from klab import colortext
from klab.deprecated import rosettadb
from klab.debug.profile import ProfileTimer
from kddg.api import db, dbi
from ddglib import help as ddg_help
from ddglib.ddgfilters import *
from klab import p... | |
"""
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.conf import settings
from django.core.exceptions import FieldError
from django.db import connections
from django.db.models.constants import LOOKUP_SEP
from django.db.models.fields import DateField, DateTimeField, Field... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2015-2017 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import Bitc... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Stephen Fromm <sfromm@gmail.com>
# Copyright: (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import ab... | |
#!/usr/bin/python
################################################################################
# ____ __ __ _ _____ _ _ #
# / __ \ \ \ / / | | / ____| | | | #
# | | | |_ __ ___ _ __ \ /\ / /__| |__ | | __| | _... | |
import scipy
import numpy as np
from ...metaarray import MetaArray
def downsample(data, n, axis=0, xvals='subsample'):
"""Downsample by averaging points together across axis.
If multiple axes are specified, runs once per axis.
If a metaArray is given, then the axis values can be either subsampled
or do... | |
"""
opcode module - potentially shared between dis and other modules which
operate on bytecodes (e.g. peephole optimizers).
"""
__all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs",
"haslocal", "hascompare", "hasfree", "opname", "opmap",
"HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"]
... | |
#
# 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... | |
#!/usr/bin/env python
# encoding: utf-8
from ast import literal_eval
import codecs
import io
import pytest
import networkx as nx
from networkx.readwrite.gml import literal_stringizer, literal_destringizer
import os
import tempfile
try:
unicode
except NameError:
unicode = str
try:
unichr
except NameError:
... | |
# This is free software; you can redistribute it and/or modify it under the
# terms of MIT free software license as published by the Massachusetts
# Institute of Technology.
#
# Copyright 2014. Pine Studio
import types
import re
from jinja2 import Template
human_template = """package {{package}}
{
public class {... | |
import torch
import torch.nn as nn
import math
from torch.autograd import Function
class PairwiseDistance(Function):
def __init__(self, p):
super(PairwiseDistance, self).__init__()
self.norm = p
def forward(self, x1, x2):
assert x1.size() == x2.size()
eps = 1e-4 / x1.size(1)
... | |
# -- Content-Encoding: utf-8 --
"""
Utility methods implementations for Win32
**TODO:**
* Complete review/refactoring
* Tests
:author: Thomas Calmant
:license: Apache Software License 2.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this ... | |
#!/usr/bin/env python
"""
Matplotlib provides sophisticated date plotting capabilities, standing on the
shoulders of python :mod:`datetime`, the add-on modules :mod:`pytz` and
:mod:`dateutils`. :class:`datetime` objects are converted to floating point
numbers which represent time in days since 0001-01-01 UTC, plus 1. ... | |
import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.http import Http404
from django.utils import timezone
from django.utils.functional import cached_property
from django.utils.translation import gettext as _
from django.views... | |
# Copyright (C) 2018 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 ... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from base64 import b64encode
from collections import namedtuple
from errno import ENOENT
from functools import partial
from glob import g... | |
# -*- coding: utf-8 -*-
"""
=============================================
I/O functions (:mod:`sknano.core._io`)
=============================================
.. currentmodule:: sknano.core._io
"""
from __future__ import absolute_import, division, print_function, \
unicode_literals
__docformat__ = 'restructuredte... | |
# Copyright 2020 Google 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 by applicable law or a... | |
from datetime import datetime
import numpy as np
from pandas import (Series, TimeSeries, DataFrame, DataMatrix, WidePanel,
LongPanel)
from pandas.core.pytools import adjoin
import pandas.lib.tseries as tseries
try:
import tables
except ImportError:
pass
class HDFStore(object):
"""
... | |
# encoding: utf-8
import re
import warnings
import numpy as np
import pandas as pd
import sys
default_stdout = sys.stdout
default_stderr = sys.stderr
reload(sys)
sys.setdefaultencoding('utf-8')
sys.stdout = default_stdout
sys.stderr = default_stderr
BASE_COL = '@'
BASE_ROW = ['is_counts', 'is_c_base']
PCT_TYPES = ['i... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import argparse
import socket
import sys
from jasmine.config import Config
from jasmine.standalone import JasmineApp
from jasmine.ci import CIRunner
def begin():
cmd = Command(JasmineApp, CIRunner)
cmd.run(sys.argv[1:])
def mkdir_p(pat... | |
# pylint: disable-msg=W0612
from copy import deepcopy
from datetime import datetime, timedelta
from cStringIO import StringIO
import cPickle as pickle
import os
import unittest
from numpy import random
import numpy as np
import pandas.core.datetools as datetools
from pandas.core.index import NULL_INDEX
from pandas.co... | |
"""
Support for Google travel time sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.google_travel_time/
"""
from datetime import datetime
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components... | |
"""Page CMS page_tags template tags"""
from django import template
from django.utils.safestring import SafeText
from django.template import TemplateSyntaxError
from django.conf import settings
from django.utils.text import unescape_string_literal
from django import forms
from django.template.loader import get_template
... | |
# ext/associationproxy.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Contain the ``AssociationProxy`` class.
The ``AssociationProxy`` is a Pyth... | |
# 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 unde... | |
'''
Copyright (C) 2011 by Eike Welk.
Test the control.matlab toolbox.
'''
import unittest
import numpy as np
import scipy.signal
from numpy.testing import assert_array_almost_equal
from numpy import array, asarray, matrix, asmatrix, zeros, ones, linspace,\
all, hstack, vstack, c_, r_
from matplotli... | |
"""Bokeh ELPDPlot."""
import warnings
import bokeh.plotting as bkp
import numpy as np
from bokeh.models import ColumnDataSource
from bokeh.models.annotations import Title
from bokeh.models.glyphs import Scatter
from ....rcparams import _validate_bokeh_marker, rcParams
from ...plot_utils import _scale_fig_size, color_f... | |
import math
from Person import Person, calcDist
from primesense import openni2, nite2
import time
import traceback
class KinectInterface(object):
MAX_GESTURE_DISTANCE_FROM_JOINT = 500
def __init__(self, gesture_callback, pose_callback, user_added_callback, user_removed_callback, user_roles_changed):
s... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers.idl
~~~~~~~~~~~~~~~~~~~
Lexers for IDL.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, words
from pygments.token import Text, Comment, Oper... | |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by Exopy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ---------------... | |
# coding=utf-8
# Copyright (c) 2017 Dell Inc. or its subsidiaries.
# 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/L... | |
# -*- coding: utf-8 -*-
#
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
# Tests for Blt widgets.
import os
import Tkinter
import Test
import Pmw
Test.initialise()
testData = ()
# Blt vector type
def _setVectorItem(index, value):
w = Test.currentWidget()
w[index] = value
def _getVectorItem(index):
w = Test.currentWidget()
return w[index]
def _getVectorSlice(index1, ind... | |
"""
NSQ base reader class.
This receives messages from nsqd and calls task methods to process that message
It handles the logic for backing off on retries and giving up on a message
ex.
import nsq
all_tasks = {"task1": task1, "task2": task2}
r = nsq.Reader(all_tasks, lookupd_http_addresses=['127.0.0... | |
# Copyright (c) 2013 VMware, 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 b... | |
import os
import wx
import traceback
from collections import OrderedDict
from threading import Thread
from csvI import modules
from parameters import *
from quickbooks import QuickBooks
from inteumI import Inteum
welcomeText = """\
Use this program to import expenses from a spreadsheet into QuickBooks.
Make sure Qu... | |
#!/usr/bin/env python
# encoding: utf-8
import os
from types import NoneType
from xmlrpclib import DateTime
import mock
from nose.tools import *
from webtest_plus import TestApp
from tests.base import OsfTestCase
from tests.factories import (UserFactory, ProjectFactory, NodeFactory,
AuthFactory, PointerFactory, ... | |
# # (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import mock
import unittest
import os
# 3p
import simplejson as json
from nose.plugins.attrib import attr
# project
from tests.checks.common import AgentCheckTest, Fixtures
from checks import AgentChe... | |
""" Wrapper around external SVM variant implementations like LibSVM or LIBLINEAR """
import logging
import warnings
try:
# import matplotlib as mpl
# mpl.rcParams['text.usetex'] = True
# mpl.rcParams['text.latex.unicode'] = True
import matplotlib.pyplot as plt
except ImportError:
pass
import scipy.s... | |
# Copyright 2020 The TensorFlow Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | |
#
# 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... | |
#!/usr/bin/env python
#
# Copyright (c) 2016 Cisco and/or its affiliates.
# 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... | |
input_data = open("newfile.txt", "r")
output_html = open("output.html", "w")
output_css = open("output.css", "w")
# Read in from file
elements = []
for line in input_data:
temp = line.split(" ")
elements.append(temp)
print temp
# HTML specific functions
def html_header():
output_html.write("<!DOCTYPE ... | |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 law o... | |
import os
import pygit2
from gitmodel.test import GitModelTestCase
class TestInstancesMixin(object):
def setUp(self):
super(TestInstancesMixin, self).setUp()
from gitmodel.test.fields import models
self.models = self.workspace.import_models(models)
self.person = self.models.Per... | |
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | |
from xml.dom import minidom, Node, XML_NAMESPACE, XMLNS_NAMESPACE
import new
import re
import weakref
import _base
from html5lib import constants, ihatexml
from html5lib.constants import namespaces
moduleCache = {}
def getDomModule(DomImplementation):
name = "_" + DomImplementation.__name__+"builder"
if nam... | |
from __future__ import absolute_import, division, print_function
import warnings
from collections import defaultdict
from threading import Lock
from distutils.version import LooseVersion
import numpy as np
from toolz import pluck
from scipy import sparse
from dask.base import normalize_token
from sklearn.exceptions ... | |
# -*- coding: ISO-8859-1 -*-
from .MidiOutStream import MidiOutStream
from .RawOutstreamFile import RawOutstreamFile
from .constants import *
from .DataTypeConverters import fromBytes, writeVar
class MidiOutFile(MidiOutStream):
"""
MidiOutFile is an eventhandler that subclasses MidiOutStream.
"""
... | |
# Copyright Yair Benita Y.Benita@pharm.uu.nl
# Biopython (http://biopython.org) license applies
"""Simple protein analysis.
Example,
X = ProteinAnalysis("MAEGEITTFTALTEKFNLPPGNYKKPKLLYCSNGGHFLRILPDGTVDGTRDRSDQHIQLQLSAESVGEVYIKSTETGQYLAMDTSGLLYGSQTPSEECLFLERLEENHYNTYTSKKHAEKNWFVGLKKNGSCKRGPRTHYGQKAILFLPLPV")
print X.... | |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# generate_gaze_data.py
"""
Generate specific idealized gaze patterns for several subjects to use them
as benchmark for the different coherence algorithms.
All functions return a sequence of n elements. Each element is a nx3
np.array containing the (x, y, t) data point... | |
# Copyright 2016 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... | |
#!/usr/bin/env python
#
# Copyright 2013 Facebook
#
# 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 agree... | |
# Copyright (c) 2015 Mirantis 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 law or agreed to in writ... | |
from PythonQt import QtCore, QtGui, QtUiTools
import director.applogic as app
import math
import numpy as np
from director.timercallback import TimerCallback
from director.simpletimer import SimpleTimer
from director.debugVis import DebugData
from director import planplayback
import director.visualization as vis
import... | |
import ipuz
import ipuz_Helper
import json
import sys
unlock_state="disabled"
notes_state="disabled"
is_puz_rebus=False
Encoding_2 = "ISO-8859-1"
class File():
title=None
author=None
cpyrt=None
notes=None
width=0
height=0
solnblock=[]
cellblock=[]
acc=0
dwn=0
across=[]
d... | |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import division
from builtins import str
from past.utils import old_div
import os
import sys
from astropy.coordinates import SkyCoord
import numpy as np
from math import log10
from . import tableio
def compute_AEBV(filter='r_SDSS', sed='flat... | |
from __future__ import absolute_import
from __future__ import with_statement
import sys
import socket
from datetime import datetime, timedelta
from kombu import pidbox
from mock import Mock, patch
from celery import current_app
from celery.datastructures import AttributeDict
from celery.task import task
from celery... | |
# -*- coding: utf-8 -*-
import datetime
import constants
# Choose and configure the browser of your choice
def get_browser():
return webdriver.Chrome()
# The host and port where the tested ap shoud listen.
HOST = '127.0.0.1'
PORT = 8080
# The host alias set in the /etc/hosts file.
# The actual tests will navi... | |
import sys
import os
import resource
import shutil
import shlex
import time
import subprocess
import random
# this is a disk I/O benchmark script. It runs menchmarks
# over different filesystems, different cache sizes and
# different number of peers (can be used to find a reasonable
# range for unchoke slots).
# it a... | |
from .fixtures import *
def test_regex_operator(backend, small_test_data):
backend.filter(Actor, {}).delete()
marlon_brando = Actor({'name': 'Marlon Brando', 'gross_income_m': 1.453, 'appearances': 78, 'is_funny': False, 'birth_year': 1924})
marlon_wayans = Actor({'name': 'Marlon Wayans'})
backend.sa... | |
"""Test the Honeywell Lyric config flow."""
import asyncio
from unittest.mock import patch
import pytest
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.http import CONF_BASE_URL, DOMAIN as DOMAIN_HTTP
from homeassistant.components.lyric import config_flow
from homeassis... | |
# mininode.py - Bitcoin P2P network half-a-node
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# This python code was modified from ArtForz' public domain half-a-node, as
# found in the mini-node branch of http://github.c... | |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# 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 appl... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Sebastian Wiesner <lunaryorn@googlemail.com>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible 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
# ... | |
'''Mock remote control of a flash movie clip.'''
__author__ = 'Ethan Kennerly'
import code_unit
# mock some features of ActionScript
from actionscript import *
def export_stage_dictionary_jsfl_example():
r'''To test AppData.../Commands/export_stage_dictionary.jsfl:
Open AppData.../Commands/rename_and_duplicat... | |
"""
Support for the LIFX platform that implements lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.lifx/
"""
import logging
import asyncio
import sys
import math
from os import path
from functools import partial
from datetime import timedelta... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, os, copy, json, re
from frappe import _
from frappe.modules import get_doc_path
from jinja2 import TemplateNotFound
from frappe.utils import cint, strip_html
from... | |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 18 13:51:57 2015
@author: LLP-admin
"""
import os
from simple import *
from sklearn import svm
#classifiers
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.feature_selection import RFE
from sklearn.linear_mo... | |
from __future__ import division, absolute_import, print_function
import pytest
import numpy as np
import numpy.ma as ma
from numpy.ma.mrecords import MaskedRecords
from numpy.ma.testutils import assert_equal
from numpy.testing import assert_, assert_raises
from numpy.lib.recfunctions import (
drop_fields, rename_... | |
from graphserver.core import Graph, TripBoard, HeadwayBoard, HeadwayAlight, Crossing, TripAlight, Timezone, Street, Link, ElapseTime
from optparse import OptionParser
from graphserver.graphdb import GraphDatabase
from graphserver.ext.gtfs.gtfsdb import GTFSDatabase, parse_gtfs_date
import sys
import pytz
from tools imp... | |
from time import sleep
from lettuce import world, step
from datetime import datetime
from nose.tools import assert_false
from questionnaire.features.pages.home import HomePage
from questionnaire.features.pages.manage import ManageJrfPage
from questionnaire.models import Questionnaire, Section, Organization, Region, Su... | |
"""Component for interacting with a Lutron Caseta system."""
from __future__ import annotations
import asyncio
import contextlib
import logging
import ssl
import async_timeout
from pylutron_caseta import BUTTON_STATUS_PRESSED
from pylutron_caseta.smartbridge import Smartbridge
import voluptuous as vol
from homeassis... | |
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Daniel Strohmeier <daniel.strohmeier@gmail.com>
#
# License: Simplified BSD
import numpy as np
from ..source_estimate import SourceEstimate, _BaseSourceEstimate, _make_stc
from ..minimum_norm.inverse import (combine_xyz, _prepare_forward,
... | |
#!/usr/bin/env python3
import time
import cv2
import numpy as np
import sys
import pickle
e = time.time()
debug = False
fileWrite = False
if fileWrite:
fWPath = "processed/" + str(time.time()) + "-processed.jpg"
displayProcessed = False
if debug:
print ("imports: " + str(format(time.time() - e, '.5f')))
... | |
# Copyright 2021 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... | |
import numpy as nm
from sfepy.base.base import assert_
from sfepy.linalg import dot_sequences
from sfepy.mechanics.tensors import dim2sym, transform_data
import sfepy.mechanics.membranes as membranes
from sfepy.terms.terms import Term
def eval_membrane_mooney_rivlin(a1, a2, mtx_c, c33, mode):
"""
Evaluate str... | |
# This file is part of beets.
# Copyright 2015, 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 the rights to use, copy, ... | |
"""
This module contains util functions may be shared by both BioThings data-hub and web components.
In general, do not include utils depending on any third-party modules.
"""
import math, statistics
import time, re
import logging
from pprint import pprint, pformat
import copy
from .common import timesofar, is_scalar,... | |
# regression_tests.py -- a rewrite of regression_tests.sh for Windows
# using Python 3
#
# Roger Dannenberg Jan 2017, 2020
#
# Run this in the o2/tests directory where it is found
#
# get print to be compatible even if using python 2.x:
from __future__ import print_function
import sys
import os
import platform
i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.