text stringlengths 8.04k 46.5k |
|---|
import numpy as np
import statsmodels.api as sm
import datajoint as dj
import pathlib
from scipy import stats
from astropy.stats import kuiper_two
from pipeline import ephys, experiment, tracking
from pipeline.ingest import tracking as tracking_ingest
from pipeline.mtl_analysis import helper_functions
from pipeline.pl... |
import copy
import datetime
import discord
import io
import modules.audio
import modules.banlist
import modules.bottiHelper
import modules.calendar
import modules.data.ids as ids
import modules.dev
import modules.gamble
import modules.info
import modules.lerngruppe
import modules.mensa
import modules.mod
import modules... |
import copy
import itertools
import multiprocessing as mp
import numpy as np
from rdkit.Geometry import Point3D
from rdkit import Chem
from rdkit.Chem import rdmolfiles, AllChem, rdmolops
from rdkit.Chem import rdChemReactions
from rdkit.Chem.EnumerateStereoisomers import EnumerateStereoisomers
from rdkit.Chem.Enumera... |
"""
graph
======
Tools for calculating and/or transforming coordinates for various
plot annotations.
initMap
plotSHSR
"""
import numpy as np
from matplotlib import pyplot as plt
import matplotlib as mpl
import sys
import os
from subprocess import run
from datetime import datetime as dt
import date... |
"""Training and evaluation for CIFAR image classification."""
from __future__ import division
from __future__ import print_function
import argparse
import functools
import itertools
import os
import time
import cifar
import cifar_model
import cifar_utils
import data_utils
import numpy as np
import six
from six.moves ... |
#!/usr/bin/env python
# coding: utf-8
# ## Identifying and resolving conflicts in a batch of VI files
# ## Adapted from <NAME>'s jupyter notebook VI_merge_sets.ipynb
import os, sys, glob
import numpy as np
import inspect
from astropy.io import fits
from astropy.table import Table, join, vstack
from astropy.io import fi... |
import matplotlib.pyplot as plt
import numpy as np
import scipy.sparse.linalg
import time
import datetime
import glob
import os
import platform
import random
from scipy.stats import norm
from scipy.optimize import fsolve
import scipy.stats as st
from nngeometry.layercollection import LayerCollection
from nngeometry... |
import os
import warnings
import numpy as np
from math import sin, cos, sqrt, log10
from scipy import integrate
from scipy.interpolate import interp1d, interp2d
from scipy.special import ellipk, ellipe
# These are complete elliptic integrals of the first and the second kind.
from sympy.functions.special.elliptic_integr... |
import pytest
from datetime import datetime, timezone
from unittest.mock import Mock, patch
from origin.common import EmissionValues, DateTimeRange
from origin.ggo import Ggo
from origin.eco import EcoDeclarationBuilder, EcoDeclaration
from origin.services.datahub import (
GetMeasurementListResponse,
Measureme... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
# coding: utf-8
# Application: coded for lattice constant optimization using the sub-dir calculations. Optimize and calculate the energy of a strcuture with serveral different lattice constants, and make a cubic spline interpolation to obtain the optimal lattice consta... |
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
import os, itertools,copy
import numpy as np
from scipy import sparse
from scipy.spatial.distance import cdist
from ase.neighborlist import NeighborList,natural_cutoffs
from ase.data import atomic_masses_iupac2016,atomic_numbers
from pymatgen.symmetry.analyzer import Po... |
# Copyright (c) Facebook, Inc. and its affiliates.
import copy
import logging
import numpy as np
from typing import Callable, List, Union
import torch
from panopticapi.utils import rgb2id
from detectron2.config import configurable
from detectron2.data import MetadataCatalog
from detectron2.data import detection_utils ... |
from __future__ import annotations
import random
from typing import Optional, List, Dict, Tuple
import discord
from discord import Member, app_commands
from imp.utils import strict_types
from views.request_match import RequestMatch
from views.game import GameInitView, GameView, GameStopView
from typing import TYPE_C... |
import unittest as ut
import numpy as np
from pyqumo import chains
class TestCaseBase(ut.TestCase):
PRECISION = 8
def assertAllClose(self, lvalue, rvalue, msg=None, places=PRECISION):
lv = np.asarray(lvalue)
rv = np.asarray(rvalue)
try:
self.assertAlmostEqual(lv.item(), rv... |
import logging
import os
import traceback
from argparse import ArgumentParser
from typing import List
import numpy as np
import pandas as pd
from scipy import stats
from record import Record, record_factory, EXPECTED_SUBGRAPH_NUMBER, convert_subgraph_index_to_label
from visualize import boxplot, lineplot, heatmap, sc... |
from scipy.signal import medfilt
import pylab as pl
import h5py
import pandas as pd
from datetime import datetime, date
from scipy.interpolate import interp1d
import AtlejgTools.SimulationTools.WellData as WellData
import AtlejgTools.Utils as UT
PPM_M = 300e3 # PPM_M: ppm in mother-solution
M... |
import struct
def EnvelopeClear(env):
env['delay'] = -12000.0
env['attack'] = -12000.0
env['hold'] = -12000.0
env['decay'] = -12000.0
env['sustain'] = 0.0
env['release'] = -12000.0
env['keynumToHold'] = 0.0
env['keynumToDecay'] = 0.0
def RegionClear(region):
region['loop_mode'] = 0
region['sample_rate'] = 0... |
# <<BEGIN-copyright>>
# Copyright 2021, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
import numpy
from fudge.resonances import scatteringRadius as scatteringRadiusModule, resolved as resolvedModule
from pqu i... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MainWindow_ui.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5.QtWidgets import QApplication, QMainWindow
import os
import threading
import queue
import socket
from PyQt5.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import gc
import logging
import os
import mock
from multiprocessing import Manager, Process, Queue
import sys
import time
from shellbot import Context, Engine, ShellBot, MachineFactory
from shellbot.i18n import _, localization as l10n
from shellbot.spaces ... |
'''new stuff:
more organized: superclasses and subclasses
new alien that shoots
zoomed view + follow
alien drops + collection
targetting missile
pause'''
helpText = ['press MOUSE LEFT to move',
'press LEFT CONTROL or MOUSE RIGHT to shoot',
'press SPACE to brake',
... |
"""*SDK binary media file handling tools*."""
import os
import shutil
import subprocess
import sys
import tarfile
import zipfile
from pathlib import Path
from platform import system, architecture
from typing import List
from urllib.parse import urlparse
from urllib.request import urlretrieve
from blake3 import blake3
f... |
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch.nn.init as init
import torch
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth',
'resnet50': 'https://downlo... |
from __future__ import annotations
import json
import uuid
import os
import random
import boto3
import discord
import jsonpickle
import configparser
import traceback
import inspect
import sys
from enum import IntEnum
from typing import List
from typing import Optional
from typing import Union
from discord.ext import ... |
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from django.core.management import call_command
from django.db.models import Sum, Avg
from results.models import Election, ResultStage, ResultCheck
from electionsproject.settings import mccelectionsenv, RESULTSTAGE_IMPOR... |
""" test_group_generator: test the GroupGenerator() object of StudyGroups. """
#pylint: disable=C0103,R0201,W0212
import unittest
import numpy as np
try:
import study_groups as sg
except ImportError:
import sys
sys.path.append('..')
import study_groups as sg
class TestInitialization(unittest.TestCase)... |
import json
import logging
import os
import platform
import random
import shlex
import string
import subprocess
import time
import traceback
import requests
import yaml
import re
import smtplib
from ocs_ci.ocs.exceptions import (
CommandFailed, UnsupportedOSType, TimeoutExpiredError,
)
from ocs_ci.framework import... |
#!/usr/bin/python
# coding: utf-8 -*-
# (c) 2020, <NAME> IV <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['previe... |
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
import asyncio
from dataclasses import dataclass
import logging
import operator
import random
from typing import (
AsyncIterator,
Dict,
Optional,
Sequence,
Set,
Tuple,
Iterator,
)
from lahja import (
EndpointAPI,
)
from cancel_token import (
CancelToken,
)
from eth_utils import en... |
#
# Python script to run shadow3. Created automatically with ShadowTools.make_python_script_from_list().
#
import Shadow
import numpy
from srxraylib.sources import srfunc
import matplotlib
from matplotlib import pylab as plt
import os
matplotlib.rcParams.update({'font.size': 8})
def wiggler_preprocessor(ener_gev=6.0... |
"""
"""
# Created on 2013.06.02
#
# Author: <NAME>
#
# Copyright 2013 - 2018 <NAME>
#
# This file is part of ldap3.
#
# ldap3 is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version... |
#!/usr/bin/env python3
import time
import math
import overpy
import socket
import requests
import threading
import numpy as np
# setup logging
import logging
import logging.handlers
from scipy import spatial
import selfdrive.crash as crash
from common.params import Params
from collections import defaultdict
import cer... |
import sys
from construct import *
from construct.lib import LazyContainer
# some tests require doing bad things...
import warnings
warnings.filterwarnings("ignore", category = DeprecationWarning)
# declarative to the bitter end!
tests = [
#
# constructs
#
[MetaArray(lambda ctx: 3, UBInt8("metaarray... |
import torch
import torch.nn.functional as F
import numpy as np
from torch import nn
from .base_models import BaseEncoderMaskerDecoder
from asteroid.utils.torch_utils import unsqueeze_to_3d
from asteroid_filterbanks import make_enc_dec
from asteroid_filterbanks.transforms import mag, magreim, apply_mag_mask, angle, fr... |
#!/usr/bin/env python2.6
# Copyright 2018 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 ... |
"""Plugin system for extending mypy.
At large scale the plugin system works as following:
* Plugins are collected from the corresponding mypy config file option
(either via paths to Python files, or installed Python modules)
and imported using importlib.
* Every module should get an entry point function (called ... |
# -*- encoding: utf-8 -*-
"""
Text progress bar for long-running jobs.
:copyright: (c) 2016 H2O.ai
:license: Apache License Version 2.0 (see LICENSE for details)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import math
import os
import sys
import time
from types import Func... |
#!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... |
#!/usr/bin/env python
#
# Licensed under the BSD license. See full license in LICENSE file.
# http://www.lightshowpi.org/
#
# Author: <NAME>
# Author: <NAME>
# Author: <NAME> (<EMAIL>)
# Author: <NAME> (<EMAIL>)
"""Control the Raspberry pi hardware.
The hardware controller handles all interaction with the raspberry ... |
#!/usr/bin/env python
# vim: set fileencoding=utf-8
# vim: tabstop=4 shiftwidth=4 softtabstop=4
""" Web service for ambient light measurement """
# core python libraries
###########################################################
from multiprocessing import Process, Pipe, current_process
import threading
import os
imp... |
# Copyright (c) 2010-2012, 2015-2019 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of th... |
from sfsimodels import models
import sfsimodels as sm
import numpy as np
from collections import OrderedDict
from sfsimodels.functions import clean_float
from sfsimodels.build_model_descriptions import build_parameter_descriptions
from liquepy.element.models import ShearTest
from liquepy.exceptions import deprecation
f... |
import os
import random
import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
import torchvision.transforms.functional as ttf
import torch.optim as optim
from PIL import Image
import skimage
import skimage.transform
import matp... |
import bisect
# See Cormen et al, chapter 18 B-Trees
# This is an implementation of B-Tree with satellite information stored in internal nodes
# as well as in leaves.
def main():
def allocme():
nonlocal blocks
idx = len(blocks)
blocks.append(None)
print("a new block #{} has been al... |
"""
Bucket.py
Author: <NAME> (<EMAIL>)
A multimedia analytics bucket, i. e., a category of relevance as defined by
the user
"""
from math import sqrt
import numpy as np
import random
from sklearn import svm
from aimodel.ImageList import ImageList
from data.DatasetConfigManager import DatasetConfigManager
class B... |
# Copyright Toyota Research Institute 2019
"""
Module for conducting analysis/postprocessing of
experiments and campaigns. Contains the Analyzer
object, which performs this function.
"""
import abc
import warnings
import json
import pickle
import os
import numpy as np
import itertools
import pandas as pd
from camd im... |
import pyautogui
import tkinter
import ctypes
from ctypes import wintypes
from PIL import Image
import math
import time
import sys
import os
# --- keyboard input initialization ---
user32 = ctypes.WinDLL('user32', use_last_error=True)
INPUT_MOUSE = 0
INPUT_KEYBOARD = 1
INPUT_HARDWARE = 2
KEYEVENTF_EXTENDEDKEY = 0x0... |
"""This module contains utility functions for all the baselines."""
from collections import OrderedDict
import copy
import math
import os
import pickle as pkl
from typing import Any, Dict, List, Optional, Tuple, Union
from argoverse.map_representation.map_api import ArgoverseMap
from joblib import Parallel, delayed
i... |
# -*- coding: utf-8 -*-
from collections import namedtuple
from datetime import datetime, timedelta
from urllib.parse import quote_plus
import pytest
import plexapi.base
from plexapi.exceptions import BadRequest, NotFound
from . import conftest as utils
def test_library_Library_section(plex):
sections = plex.li... |
from . import moog
from .star import Star
import numpy as np
import datetime
import logging
from scipy import interpolate
import os
from .config import *
from .tools import read_csv
from collections import OrderedDict
from bokeh.plotting import *
from bokeh.models import HoverTool
logger = logging.getLogger(__name__)
... |
from __future__ import unicode_literals
import os, sys, re
import codecs
import inspect
import uuid
### Mappings for duplicate properties ###
### See build_tsv/vocab_reader
KEY_ORDER_HASH = {}
KEY_ORDER_DEFAULT = 10000
CRM_EXT_CONTEXT_URI = "https://linked.art/ns/v1/cidoc-extension.json"
try:
import json
except... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# QTPyLib: Quantitative Trading Python Library
# https://github.com/ranaroussi/qtpylib
#
# Copyright 2016-2018 <NAME>
#
# 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 ... |
# coding: utf-8
# In[3]:
import itertools as it
from sklearn.cluster import KMeans
from sklearn import metrics
from scipy.spatial import distance_matrix
from scipy.spatial.distance import cdist
import numpy as np
import matplotlib.pyplot as plt
import math
from mpl_toolkits.mplot3d import Axes3D
import nltk
import ... |
import os
import shutil
from collections import OrderedDict
from data_sources.ncbi_any_virus.ncbi_importer import AnyNCBIVNucSample
from data_sources.ncbi_services import download_ncbi_taxonomy_as_xml, get_samples_accession_ids, download_or_get_ncbi_sample_as_xml
from data_sources.ncbi_any_virus.settings import known_s... |
import itertools
import copy
import os
from collections import Counter, defaultdict
import math
from typing import Dict, List, Tuple, Union
import tensorflow as tf
import numpy as np
from finetune.base import BaseModel
from finetune.encoding.target_encoders import (
SequenceLabelingEncoder,
SequenceMultiLabel... |
import math
import numpy
import scipy
from functools import reduce
# See http://projects.scipy.org/scipy/ticket/1739
# scipy 0.11 for python3 broken, should be fixed for scipy 0.12
try:
import scipy.stats
except ValueError:
scipy.stats = None
try:
from rpy2.robjects import r as R
import rpy2.robjects.... |
"""
Must run convert_asec_taxcalc.py and make_tax_units.py first.
"""
# Set columns to lowercase and to 0 or null as appropriate.
prep_ipum(person)
# Add taxid and related fields.
tax_unit_id(person)
# Add other person-level columns in taxcalc form.
person = convert_asec_person_taxcalc(person)
# 99 is the missing code... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This material is part of "Generating Software Tests".
# Web site: https://www.fuzzingbook.org/html/InformationFlow.html
# Last change: 2018-11-28 20:53:26+01:00
#
#
# Copyright (c) 2018 Saarland University, CISPA, authors, and contributors
#
# Permission is hereby grant... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-unsafe
"""Kats ensemble model
Implementation of the Kats ensemble model. It starts from seasonality detection, if seasonality detected,... |
"""Contains functions which are shared across other modules.
This module should only import from other packages or modules of respy which also do not
import from respy itself. This is to prevent circular imports.
"""
import shutil
import chaospy as cp
import numba as nb
import numpy as np
import pandas as pd
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 under t... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long,invalid-name
"""For details on this module see DOCUMENTATION (below)"""
import base64
import datetime
import io
import os
import subprocess
import yaml
# pylint import-error disabled because pylint cannot find the package
# when installed in a... |
import copy
import csv
import argparse
from collections import defaultdict, Counter
import re
from operator import itemgetter
import ast
from pprint import pprint
import json
import os
def process_repeat_dict(d):
if d["loop"] == "ntimes":
repeat_dict = {"repeat_key": "FOR"}
processed_d = process_d... |
from __future__ import division
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import hoomd
import hoomd.md
import gsd
#import matplotlib.pyplot as plt
import numpy as np
from scipy.special import erf as erf
import os
import sys
import datetime
import ewald_module as em
import md_... |
"""Views for the account_keeping app."""
import decimal
from datetime import date
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.urls import reverse, reverse_lazy
from django.db import connection
from django.db.models import Q, Sum
from django.http import HttpRes... |
#!/usr/bin/env python
# 2010-01-27 <NAME>
"""
Scan a directory to determine the data availability.
Scan all specified files/directories, determine which time spans are covered
for which stations and plot everything in summarized in one overview plot.
Start times of traces with available data are marked by crosses, gap... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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... |
# Copyright 2014 PerfKitBenchmarker 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... |
import AST.Nodo as Node
from prettytable import PrettyTable
from Errores.Nodo_Error import *
import data.jsonMode as jm
import os
from operator import itemgetter
import TypeCheck.Type_Checker as tp
class Select(Node.Nodo):
def __init__(self, *args):
if args[0] == '*':
self.arguments = None
... |
# This Python module is part of the PyRate software package.
#
# Copyright 2020 Geoscience Australia
#
# 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/... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import sys
INPUTFN = "dos_mini.h"
OUT_STUBS_FN = "dos_stubs.c"
OUT_FUNCTABLE_FN = "dos_fns.c"
LIBS = { 'EXEC_BASE_NAME': ('_exec', 'struct ExecBase *'),
'DOS_BASE_NAME': ('_dos', 'struct DOSBase *')}
MACROS = {
# LPX - functions that take X... |
#######################################################################
#Import Modules Section
import xbmcplugin, xbmcaddon
import sys
import urllib
import re
import glo_var
import base_info
import backuprestore
from resources.libs import advanced
from resources.libs import contact
from resources.libs import covenant
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint:disable=unused-wildcard-import,wildcard-import,invalid-name,too-many-instance-attributes,too-many-public-methods,too-many-statements
"""TKinter-based GUI for PyLNP."""
from __future__ import print_function, unicode_literals, absolute_import
import os
import sys
fr... |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... |
import collections
import threading
import six
import numpy as np
import scipy.sparse as sps
import theano.sparse as sparse
from theano import theano, tensor as tt
from theano.tensor.var import TensorVariable
import pymc3 as pm
from pymc3.math import flatten_list
from .memoize import memoize
from .theanof import grad... |
# Copyright 2019 Xilinx, 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,... |
import os
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import sys
import pickle
import joblib
import pandas as pd
import time
import plotly
import plotly.figure_factory as ff
import plotly.express as px
import plotly.graph_objects as go
import umap
from sklearn.manifold import TSNE
from sk... |
import torch
from torch import no_grad
import torch.nn.functional as F
from torch import nn
import numpy as np
from scipy.sparse import coo_matrix
from torch.utils import data
import math
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import matplotlib.cm as cm
import argparse
from skimage.util imp... |
# Copyright 2013 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""OAuth2 related utilities and implementation of browser based login flow."""
from __future__ import print_function
import base64
import collec... |
from pylo.engines.prolog.prologsolver import (
Prolog
)
from pylo.language.lp import Constant, Variable, Functor, Structure, List, Predicate, Atom, Not, Clause, \
c_pred, c_const, c_var, c_functor, Pair
# from .prologsolver import Prolog
# from pylo.language.lp import Constant, Variable, Functor, Structure, Pre... |
"""
ResNet50 to detect yellow image based on the output of Mask R-CNN
Configurations and data loading code for yellowset.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by TDteach
------------------------------------------------------------
Usage: import the modu... |
"""gmail.py: Fetch queries from gmail & send replies back
Contains Gmail class which initializes the Gmail service, and has a method to watch
the Gmail mailbox for any changes. When a change occurs, unread messages are
retrieved. If any of the unread messages are from senders in the contact list,
the text of the messa... |
"""Jeeves database interface.
:synopsis: Monkey-patching Django's QuerySet with Jeeves functionality.
.. moduleauthor: <NAME> <<EMAIL>>
"""
from django.db import models
from django.db.models.query import QuerySet
from django.db.models import Manager
from django.db.models import CharField
from django.apps import a... |
# Copyright (c) The Libra Core Contributors
# SPDX-License-Identifier: Apache-2.0
from .business import BusinessForceAbort
from .protocol_command import ProtocolCommand
from .command_processor import CommandProcessor
from .payment import Status, PaymentObject, StatusObject
from .payment_command import PaymentCommand, ... |
# ----------------------------------------------------------------------
# Clickhouse models
# ----------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# Python mod... |
import re
import dateutil.parser
from enum import Enum
class Metadata(object):
def __init__(self, json): # noqa: E501
""" The metadata object
abstract (str): A summary of the resource.. [optional] # noqa: E501
accrual_method (str): The method by which items are added to a collect... |
# -*- coding: utf-8 -*-
import os
import telebot
import time
import random
import threading
from emoji import emojize
from telebot import types
from pymongo import MongoClient
import traceback
token = os.environ['TELEGRAM_TOKEN']
bot = telebot.TeleBot(token)
client=MongoClient(os.environ['database'])
db=client.laze... |
"""Baseclass for all tests."""
import copy
import inspect
import logging
import os
import sys
import time
import unittest
from unittest.mock import *
import asyncio
from asyncio import events
from typing import Any
from mpf.core.logging import LogMixin
from mpf.core.rgb_color import RGBColor
from mpf.tests.TestData... |
import numpy as np
import os
import pandas as pd
import copy
import re
import shutil
import subprocess
from . import main_flow
from . import C_preprocessing as preproc
def run_preproc(cwd, OS_folder, verbose=None):
'''
preprocesses CKI input mechanism and re-writes it as mech with only fw reactions
writes... |
#!/usr/bin/python
# Copyright (C) 2011-2012 <NAME> (http://denisbilenko.com)
import sys
import os
import re
import traceback
import datetime
import pipes
import difflib
from hashlib import md5
if sys.version_info >= (3, 0):
exec("def do_exec(co, loc): exec(co, loc)\n")
else:
exec("def do_exec(co, loc): exec co... |
import keras.backend as K
from keras import regularizers
from keras.applications.vgg16 import VGG16
from keras.layers import *
from keras.models import Model
from keras.optimizers import Adam
from sarcopenia_ai.core import BaseModelWrapper
def conv_block(inp, num_filters=64, kernel_size=3, momentum=0.8, padding="sam... |
import itertools
import os.path
import numpy as np
import pandas as pd
from sortedcontainers import SortedList
driver_to_constructor_2021 = {
'Finland <NAME>': 'Alfa Romeo Racing-Ferrari',
'Poland <NAME>': 'Alfa Romeo Racing-Ferrari',
'Italy <NAME>': 'Alfa Romeo Racing-Ferrari',
'Fr<NAME>': 'AlphaTaur... |
import os
import sys
import re
# TODO: Grep for add_compatibility_class and use those.
replacements = [
(re.compile(r'\bget_node(\s+)\((\s+)\@'), r'get_node\1(\2^'),
('Transform', 'Transform3D'),
('Reference', 'RefCounted'),
('Quat', 'Quaternion'),
('Spatial', 'Node3D'),
('Sprite', 'Sprite2D')... |
import os
import pandas as pd
import numpy as np
from os.path import join
import matplotlib.pyplot as plt
def search_best_id(root_path, index_list):
""" This function, given the parameters, looks for the best realization
of the experiment, among different learning rates.
:param root_path: str of the folde... |
# Copyright (c) 2020 Horizon Robotics and ALF Contributors. 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... |
# Copyright (c) 2020 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.