gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import numpy as np
import pytest
import importlib
import theano
import lasagne
from lasagne.utils import floatX
def conv2d(input, kernel, border_mode):
output = np.zeros((input.shape[0],
kernel.shape[0],
input.shape[2] + kernel.shape[2] - 1,
in... | |
# Copyright 2014-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""
Defines classes related to date ranges.
"""
from __future__ import unicode_literals
from builtins import object
import datetime
try:
import pytz
except ImportError:
pytz = None
from django.db import models
from django.co... | |
"""Classes to represent heatmaps, i.e. float arrays of ``[0.0, 1.0]``."""
from __future__ import print_function, division, absolute_import
import numpy as np
import six.moves as sm
from .. import imgaug as ia
from .base import IAugmentable
class HeatmapsOnImage(IAugmentable):
"""Object representing heatmaps on ... | |
"""
This module contains pdsolve() and different helper functions that it
uses. It is heavily inspired by the ode module and hence the basic
infrastructure remains the same.
**Functions in this module**
These are the user functions in this module:
- pdsolve() - Solves PDE's
- classify_pde() - Classif... | |
#!/usr/bin/env python3
#
# Copyright (c) 2016 Supreeth Herle
#
# 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 applicabl... | |
import os
import unittest
import warnings
import numpy as np
import numpy.testing as np_test
from pgmpy.readwrite import XMLBIFReader, XMLBIFWriter
from pgmpy.models import BayesianNetwork
from pgmpy.factors.discrete import TabularCPD
try:
from lxml import etree
except ImportError:
try:
import xml.et... | |
import tensorflow as tf
import numpy as np
from sklearn.cross_validation import train_test_split
import random
import time
import sys
#load training data
args = (sys.argv)
num_gpus = int(args[1])
batch_size = int(args[2])
input = np.load('X_train.npy')
input = input.transpose(0,2,3,1)
labels = np.genfromtxt('./data/... | |
"""
Sphinx plugins for web API docs.
"""
import inspect
import logging
import re
import sys
try:
import json
except ImportError:
import simplejson as json
from django.contrib.auth.models import User
from django.http import HttpRequest
from django.template.defaultfilters import title
from djblets.features.test... | |
#!/usr/bin/env python
#
# 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 "Li... | |
"""samsungctl and samsungtvws bridge classes."""
from abc import ABC, abstractmethod
from samsungctl import Remote
from samsungctl.exceptions import AccessDenied, ConnectionClosed, UnhandledResponse
from samsungtvws import SamsungTVWS
from samsungtvws.exceptions import ConnectionFailure
from websocket import WebSocket... | |
# -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from collections import Mapping
from datetime import datetime
from .compat import cookielib, OrderedDict, urljoin, urlparse
from ... | |
import itertools
import time
from collections import defaultdict
from datetime import datetime, timedelta
from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union
from django.conf import settings
from django.db import connection
from django.http import HttpRequest, HttpResponse
from django.shortcuts i... | |
import mock
from django.test import TestCase
from django.db import IntegrityError
from django.contrib.auth.models import Permission
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.test.utils import override_settings
from protector.backends import Ba... | |
# Copyright (c) 2009-2010 Aldo Cortesi
# Copyright (c) 2010 Lee McCuller
# Copyright (c) 2010 matt
# Copyright (c) 2010, 2014 dequis
# Copyright (c) 2010, 2012, 2014 roger
# Copyright (c) 2011 Florian Mounier
# Copyright (c) 2011 Kenji_Takahashi
# Copyright (c) 2011 Paul Colomiets
# Copyright (c) 2011 Tzbob
# Copyright... | |
"""
SoloMapper_QX1.py
File used to control the Sony QX1 camera
"""
import pysony
import ConfigParser
import re
import subprocess
import urllib
import time
import threading
import os,sys
import signal
from SoloMapper_File import ExifWriter
from dronekit import connect, Vehicle
from FlagManager import FlagSystem
import l... | |
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... | |
# Lint as: python3
# 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 ... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import inspect
import string
from rpython.rlib import streamio as sio
from rpython.rlib.listsort import make_timsort_class
from rpython.rlib import jit, objectmodel, rtime
from rpython.rlib.unroll import unrolling_iterable
def os_check_env_var(var_str... | |
#!/usr/bin/env python
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | |
#!/usr/bin/env python
# Python bindings to the Google search engine
# Copyright (c) 2009-2014, Mario Vilas
# 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 ... | |
from __future__ import print_function
import os
import platform
import subprocess
import sys
import tempfile
import textwrap
from timing import monotonic_time_nanos
from tracing import Tracing
from buck_tool import BuckTool, which, check_output, JAVA_MAX_HEAP_SIZE_MB
from buck_tool import BuckToolException, RestartBuc... | |
# Copyright 2016 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 accompa... | |
# Copyright (C) 2003-2005 Peter J. Verveer
#
# 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 copyright
# notice, this list of conditions and the following d... | |
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# 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... | |
import os
import stat
import tempfile
from mock import Mock, patch
from nose import SkipTest
from nose.tools import eq_
import waffle
from django.conf import settings
import mkt
import mkt.site.tests
from lib.video import dummy, ffmpeg, get_library, totem
from lib.video.tasks import resize_video
from mkt.developers.... | |
"""
This module provides convenient functions to transform sympy expressions to
lambda functions which can be used to calculate numerical values very fast.
"""
from __future__ import division
from sympy.core.sympify import sympify
import inspect
# These are the namespaces the lambda functions will use.
MATH = {}
MPM... | |
"""
Module: feed_manager
Description: Basic feed management for the atom rss feed.
Authored by: MapLarge, Inc. (Scott Rowles)
Change Log:
"""
"""
Define all the imports for the feed_manager module
"""
from sqlalchemy.exc import IntegrityError
import sqlite3
from db import init_db
from db import db_session
from flas... | |
# Copyright 2015 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... | |
from __future__ import absolute_import
import sys
import logging
from tempfile import mktemp
from mock import patch, Mock
from nose import SkipTest
from celery import signals
from celery.app.log import TaskFormatter
from celery.utils.log import LoggingProxy
from celery.utils import uuid
from celery.utils.log import ... | |
"""
Read and write ZIP files.
"""
import struct, os, time, sys
import binascii, cStringIO
try:
import zlib # We may need its compression method
except ImportError:
zlib = None
__all__ = ["BadZipfile", "error", "ZIP_STORED", "ZIP_DEFLATED", "is_zipfile",
"ZipInfo", "ZipFile", "PyZipFile", "LargeZipF... | |
"""
homeassistant.components.api
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides a Rest API for Home Assistant.
For more details about the RESTful API, please refer to the documentation at
https://home-assistant.io/developers/api/
"""
import json
import logging
import re
import threading
import homeassistant.core as ha
import ... | |
from __future__ import unicode_literals
import codecs
import os
import re
import warnings
from django.conf import settings
from django.core.management.base import CommandError
from django.db import models
from django.db.models import get_models
def sql_create(app, style, connection):
"Returns a list of the CREA... | |
# Copyright (c) 2014 - 2016 townhallpinball.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, including without limitation
# the rights to use, copy, modify, merge, p... | |
from os import path
import sys
import numpy as np
if sys.version_info <= (3,0):
import exceptions
from . import util
from . import hstzpt_apcorr
from . import astropyphot
_HST_WFC3_PSF_FWHM_ARCSEC = 0.14 # FWHM of the HST WFC3IR PSF in arcsec
def doastropyphot(targetimfilename, coordinates, coord_type='sky',
... | |
# Copyright 2015, 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 or agreed to in writing, s... | |
import unittest
import numpy
import six.moves.cPickle as pickle
import chainer
from chainer.backends import cuda
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils import conv
@testing.par... | |
# Copyright (c) 2012 - 2015 EMC Corporation, 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
#
# ... | |
# Copyright 2017 Open Source Robotics Foundation, 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... | |
import unittest
import os.path
import numpy as np
import pandas as pd
from pandas.util.testing import assert_frame_equal
import test_helper
import copy
import json
from operator import lt, le, eq, ne, ge, gt
from pandas.core.index import Index
__index_symbol__ = {
Index.union: ',',
Index.intersection: '&',
... | |
# Copyright (c) 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 ... | |
###ExonAnalyze_module
#Copyright 2005-2008 J. David Gladstone Institutes, San Francisco California
#Author Nathan Salomonis - nsalomonis@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 Softw... | |
# -*- coding: utf-8 -*-
# Dependencies from cobra
from cobra.io.sbml import create_cobra_model_from_sbml_file
from cobra.manipulation.modify import convert_to_irreversible
from cobra.flux_analysis.parsimonious import optimize_minimal_flux
# Other dependencies
import csv,json,sys
# Dependencies from thermodynamics
# f... | |
"""
Functions to sort and prepare raw input images for analysis with pyroots functions.
Contents:
- detect_motion_blur
- detect_missing_bands
- correct_brightfield
- register_bands
- preprocessing_filters
"""
import numpy as np
from skimage import filters, img_as_ubyte, exposure, color, morphology
from pyroots import ... | |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2022 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 requi... | |
# Author: Takumi 'takada' Adachi
# Copyright 2014-2015
# miniview
# A python-for-android kivy image-viewing app ideal for reading scanlated manga images.
#
# Features
# - Cycle to the next directory images upon hitting the last image. Key feature for cycling through chapters separated in directories.
# - One handed vie... | |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2018, 2019, 2020, 2021 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Rest API endpoint for job management."""
import copy
import json
import ... | |
import warnings
from functools import reduce
import numpy as np
import pandas as pd
from geopandas import GeoDataFrame, GeoSeries
from geopandas.array import _check_crs, _crs_mismatch_warn
def _ensure_geometry_column(df):
"""
Helper function to ensure the geometry column is called 'geometry'.
If another... | |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | |
from __future__ import division
def div(a, b):
"""Helper function for division
:param a: first parameter
:type a: int
:param b: second parameter
:type b: int
:return: integer division result
:rtype: int
"""
return int(a / b)
def mod(a, b):
"""Helper function for modulo
... | |
from unittest import TestCase
import fireant as f
from fireant.tests.dataset.mocks import mock_dataset
# noinspection SqlDialectInspection,SqlNoDataSourceInspection
class QueryBuilderMetricFilterTests(TestCase):
maxDiff = None
def test_build_query_with_metric_filter_eq(self):
queries = (
... | |
#!/usr/bin/env python
# Copyright 2011 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 ... | |
import nnets.core.utils as nut
import numpy as np
import theano as theano
import theano.tensor as T
from theano.gradient import grad_clip
import os
import time
import operator
class gru_layer(nut.persistent_container):
def save(self):
np.savez(self.spath,
E = self.E.get_value(),U = sel... | |
# Copyright 2016 Capital One Services, 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... | |
import multiprocessing
import numpy as np
from .model import Model
from ..grid import SphericalPolarGrid
from ..util.interpolate import interp1d_fast
from .analytical_yso_model import AnalyticalYSOModel
def find_last_iteration(file_handle):
max_iteration = 0
for group_name in file_handle:
if "iterati... | |
# HEY! Trying to understand what this file does? Read
# "what has to be done to add a Operation ..." first!
import re
from code_template import CodeTemplate
try:
import typing # noqa: F401
except ImportError:
raise RuntimeError(
'Missing build dependency: Unable to import the `typing` module. '
... | |
# (c) Copyright 2014 Cisco Systems 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
#
# Unl... | |
#
# File : building.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
#
# 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... | |
# coding=utf-8
# Copyright 2020 The SimCLR 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 applicable law or... | |
from airflow import DAG
from airflow.operators import PythonOperator
from datetime import datetime, timedelta
from airflow.models import Variable
from airflow.hooks import RedisHook
from airflow.hooks import MemcacheHook
import logging
import traceback
from etl_tasks_functions import get_from_socket
from sync impor... | |
#!/usr/bin/python2.5
#
# Copyright 2009 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 or ... | |
#!/usr/bin/env python3
"""Integration test for onprem DC/OS upgraded from latest stable.
The following environment variables control test procedure:
MASTERS: integer (default=3)
The number of masters to create from a newly created VPC.
AGENTS: integer (default=2)
The number of agents to create from a newly c... | |
# Copyright 2015 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 ag... | |
#
# This file is part of KwarqsDashboard.
#
# KwarqsDashboard 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, version 3.
#
# KwarqsDashboard is distributed in the hope that it will be useful,
# but... | |
import numpy as np
import theano
import theano.tensor as T
from utils import sample_weights
from pop import Pop
dtype = theano.config.floatX
class Simple(Pop):
def __init__(self, n_in, n_hidden, activation_fn=T.tanh):
self.W_ih = theano.shared(sample_weights(n_in, n_hidden))
self.W_hh = theano.sha... | |
from __future__ import absolute_import
import logging
import struct
from kafka.vendor import six # pylint: disable=import-error
import kafka.protocol.commit
import kafka.protocol.fetch
import kafka.protocol.message
import kafka.protocol.metadata
import kafka.protocol.offset
import kafka.protocol.produce
import kafk... | |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-03 10:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
(... | |
# -*- coding: utf-8 -*-
from uri import URI
from utils import random_string
# http://www.iana.org/assignments/sip-parameters
name_to_compact = {
'accept-contact': 'a',
'allow-events': 'u',
'call-id': 'i',
'contact': 'm',
'content-encoding': 'e',
'content-length': 'l... | |
"""Case Management PyTest Helper Method"""
# standard library
import importlib
import inspect
import os
import time
from datetime import datetime
from random import randint
from typing import TYPE_CHECKING, Any, Dict, Optional
# third-party
from pydantic import BaseModel
# first-party
from tcex.api.tc.v3.tql.tql_oper... | |
import numpy as np
import seaborn as sb
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from mpl_toolkits.mplot3d import Axes3D
import mpl_toolkits.mplot3d.art3d as art3d
# NOTE: These are some tools I've made to make specific plots that I use
# regularly. The options and variations are probab... | |
# Copyright 2013 IBM Corp.
# Copyright 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 r... | |
#!/usr/bin/python
import cPickle, string, numpy, getopt, sys, random, time, re, pprint
import datetime, os;
import scipy.io;
import nltk;
import numpy;
from nltk.corpus import stopwords;
from nltk.probability import FreqDist;
def retrieve_vocabulary(docs):
if (type(docs).__name__ == 'str'):
temp = list()... | |
# Copyright 2020 The AutoKeras 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 applicable law or agreed to i... | |
"""
level.py
Class instance used for modifying level via Display window.
"""
# Load the needed packages
from functools import partial
from ..core import Variable, Component, QtWidgets, QtCore, QtGui, QtWidgets
class LevelButtonWindow(Component):
'''
Class to display the Window with Level radio buttons.
... | |
# Copyright 2012 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 requ... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
# Copyright 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 requ... | |
import discretize
from discretize import tests
import numpy as np
import sympy
from sympy.abc import r, t, z
import unittest
import scipy.sparse as sp
TOL = 1e-1
TOLD = 0.7 # tolerance on deriv checks
np.random.seed(99)
class FaceInnerProductFctsIsotropic(object):
""" Some made up face functions to test the fa... | |
# Lint as: python3
# Copyright 2021 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 ... | |
# -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softw... | |
# 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... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Nippon Telegraph and Telephone Corporation.
#
# 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
#
#... | |
from apds9960.const import *
from apds9960.exceptions import *
from time import sleep
class APDS9960:
class GestureData:
def __init__(self):
self.u_data = [0] * 32
self.d_data = [0] * 32
self.l_data = [0] * 32
self.r_data = [0] * 32
self.index = ... | |
import os
import sys
import collections
from lib import agouti_log as agLOG
from lib import agouti_gff as agGFF
from src import agouti_sequence as agSeq
from src import agouti_path as agPATH
def agouti_update(agoutiPaths, dSeqs, vertex2Name,
dSenses, dGFFs,
dCtgPair2GenePair, outDir, prefix,
nFills=... | |
#
#
# Copyright (C) 2009, 2011, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of con... | |
"""A tree representation of a linear markdown-it token stream.
This module is not part of upstream JavaScript markdown-it.
"""
from __future__ import annotations
from collections.abc import Generator, Sequence
import textwrap
from typing import (
NamedTuple,
Any,
TypeVar,
overload,
)
from .token impo... | |
# encoding: utf-8
# Copyright 2011 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 applica... | |
from ._compat import Container, Iterable, Sized, Hashable
from functools import reduce
from pyrsistent._pmap import pmap
def _add_to_counters(counters, element):
return counters.set(element, counters.get(element, 0) + 1)
class PBag(object):
"""
A persistent bag/multiset type.
Requires elements to b... | |
# License: BSD 3 clause
import pickle
import unittest
import numpy as np
from numpy.linalg import norm
from scipy.optimize import check_grad, fmin_bfgs
from tick.base.inference import InferenceTest
from tick.hawkes.model import ModelHawkesSumExpKernLeastSq
from tick.hawkes.model.tests.model_hawkes_test_utils import ... | |
"""
Read a SAS XPort format file into a Pandas DataFrame.
Based on code from Jack Cushman (github.com/jcushman/xport).
The file format is defined here:
https://support.sas.com/techsup/technote/ts140.pdf
"""
from datetime import datetime
from io import BytesIO
import struct
import warnings
import numpy as np
from ... | |
#!/usr/bin/python
#
# Copyright (C) 2008 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... | |
# Copyright (c) 2010 Pablo Seminario <pabluk@gmail.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, either version 3 of the License, or
# (at your option) any later version.
#
# This program... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""Test desiutil.install.
"""
import unittest
from unittest.mock import patch, call, MagicMock
from os import chdir, environ, getcwd, mkdir, remove, rmdir
from os.path import dirname, isdir, join
from shutil import rmtree
from argpa... | |
"""
Helper functions and classes around GeoIP lookups, based on Maxmind's
`maxminddb <https://pypi.python.org/pypi/maxminddb>`_ and
`geoip2 <https://pypi.python.org/pypi/geoip2>`_ Python packages.
"""
import datetime
import logging
import time
import genc
from geoip2.database import Reader
from geoip2.errors import A... | |
# Copyright 2012 NEC Corporation
#
# 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 ag... | |
from __future__ import with_statement
import copy
from functools import partial
from operator import isMappingType
import os
import sys
from contextlib import contextmanager
from fudge import Fake, patched_context, with_fakes
from nose.tools import ok_, eq_
from fabric.decorators import hosts, roles, task
from fabri... | |
"""
Establish and manage connection to FMC.
This module (fmc.py) is designed to provide a "toolbox" of tools for interacting with the Cisco FMC API.
The "toolbox" is the FMC class and the "tools" are its methods. Note: There exists a "Quick Start Guide" for the Cisco
FMC API too. Just Google for it as it gets update... | |
# Copyright (c) 2016-2021, Manfred Moitzi
# License: MIT License
from typing import TYPE_CHECKING, List, Tuple, Sequence, Union, cast
from ezdxf._options import options
from ezdxf.render.arrows import ARROWS
from ezdxf.lldxf.const import DXF12
import logging
if TYPE_CHECKING:
from ezdxf.eztypes import Drawing, Dim... | |
#!/usr/bin/env python
"""Derivation of kinetic rates.
References
==========
[1] Cornish-Bowden, Athel. "Fundamentals of enzyme kinetics". Elsevier, 2014.
[2] Ingalls, Brian. "Mathematical Modelling in Systems Biology: An Introduction.", 2013.
[3] SBMLsqueezer documentation, http://www.cogsys.cs.uni-tuebingen.de/softwa... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2015 Kitware 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 cop... | |
"""
Example generation from python files.
Generate the rst files for the examples by iterating over the python
example files. Files that generate images should start with 'plot'.
To generate your own examples, add this extension to the list of
``extensions``in your Sphinx configuration file. In addition, make sure th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.