text stringlengths 6.04k 39.5k |
|---|
import numpy as np
import os
os.environ['MPLCONFIGDIR'] = '/tmp'
import matplotlib.pyplot as plt
import scripts.activations as atv
import scripts.batches as batches
SIGMOID = "sigmoid"
RELU = "reLu"
PRINT_ITERATION = 100
DERIV_BIAS = "db"
DERIV_WEIGHTS = "dW"
MOMENT_WEIGHTS = "vdW"
MOMENT_BIAS = "vdb"
RMS_WEIGHTS = "... |
# -*- coding: utf-8 -*-
import math
import numpy as np
import operator
from .utils import Base
eps = 1e-4
class IsotopicFitRecord(object):
"""Describes a single isotopic pattern fit, comparing how well an
experimentally observed sequence of peaks matches a theoretical isotopic
pattern.
IsotopicFit... |
"""Convert an OGB dataset to Unigraph format.
The Unigraph format can be consumed by various other TF-GNN tools. For example,
the TF-GNN graph sampler can sample the Unigraph format.
"""
import math
from os import path
import re
import struct
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
from ... |
# coding: utf-8
# Distributed under the terms of the MIT License.
""" This module implements the CastepSpectralWorkflow, which performs
spectral calculations with CASTEP in multiple steps:
1. Performs a singlepoint calculation (if check file is not found).
2. If the ``spectral_kpoints_mp_spacing`` keyword is found, i... |
import os
import pathlib
import time
import copy
import logging
import numpy as np
import pandas as pd
from abc import ABC, abstractclassmethod, abstractmethod
from enum import Enum
from typing import Iterator, Tuple, List, Dict, Any, Optional, Sequence
from dae.genome.genomes_db import Genome
from dae.pedigrees.fam... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from base64 import b64decode
from django.shortcuts import get_object_or_404, redirect
from django.contrib.auth.decorators import permission_required
from django.contrib import messages
from django.core.exceptions import PermissionDen... |
import numpy as np
import matplotlib.pyplot as plt
import skimage.io as skio
from scipy.io import loadmat
from src.utils import fits as fts
from src.visualization import fancy_plots as fplt
from configparser import ConfigParser
import pathlib as pl
import joblib as jl
from src.data.cache import set_name
impor... |
#!/usr/bin/env python
#
# Copyright (c) 2009-2011,2015 <NAME> <<EMAIL>>
#
# 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... |
#!/usr/local/bin/python3.0
#
# * This library 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 2.1 of the License, or (at your option) any later version.
# *
# * This library is di... |
import os
import sqlite3
import re
from . import tools
import num2words
error_pattern = re.compile(r'�')
test1 = re.compile(r'[d']')
test2 = re.compile(r'[d']')
def num_spacer(abc,sentences,convert):
if convert == 0:
sentences = re.sub( r'([' + str(abc) + '])([0-9])', r'\1 \2', sentence... |
#!/usr/bin/env python3
##############################################################
## <NAME> ##
## Copyright (C) 2019-2020 <NAME>, IGTP, Spain ##
##############################################################
"""
Generates a phylogenetic reconstruction
"""
## useful impor... |
"""
Pipelines allow us to coordinate steps of the ETL by running steps.
ETL steps can be run in series, as necessary, or in parallel, when possible,
while also tracking failures, logs, etc.
Pipelines are currently based on AWS Data pipeline.
Starting pipelines:
Use one of the installation scripts to put a pipeline ... |
import pygame
import sys
import random
import time
import os
pygame.init()
size = width, height = 800, 600
screen = pygame.display.set_mode(size)
#sound1 = pygame.mixer.Sound('step.mp3')
#sound1.play()
clock = pygame.time.Clock()
class Camera:
# зададим начальный сдвиг камеры
def __init__(self)... |
import logging
from collections import namedtuple, deque
from typing import Tuple, Dict, List
from pgdrive.scene_creator.lane.abs_lane import AbstractLane
from pgdrive.scene_creator.map import Map
from pgdrive.scene_creator.road.road import Road
from pgdrive.utils import norm, RandomEngine
from pgdrive.world.pg_world ... |
import os, sys
import vlc
import time
from datetime import timedelta
import logging
import traceback
if __name__=='__main__':
# setup imports to be able to run test functions at the end of this file
from colors import Colors # pylint: disable=import-error
import client
else:
from .colors import Colors
from . impo... |
# Copyright 2021 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, ... |
from enum import Enum
from types import ModuleType
import tomlkit
from tomlkit.container import Container as TKContainer
from tomlkit import items as TKItems
import os
from typing import Any, Dict, List, Protocol, Union, Iterable, Mapping, cast, runtime_checkable
import tokenize
from tomlkit.toml_document import TOMLD... |
from __future__ import division
from numpy import *
from numpy.testing import dec, assert_, assert_raises, assert_almost_equal, assert_allclose
from scipy.linalg import expm
import scipy.sparse as sps
import copy
import pdb
from functools import reduce
from tba.hgen import Bilinear, Qlinear, Xlinear, op_c, op_cdag, per... |
import os
import sys
from functools import partial
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
from .configuration import get_defaults
def forward(images, config, forward_fn, decode_fn, is_training=True, verbose=0):
"""Forward-pass for one stage. Returns a dictionnary of ou... |
# -*- coding: utf-8 -*-
import timm
import torch
from torch import nn
from torch.nn.functional import binary_cross_entropy_with_logits
from methods.module.base_model import BasicModelClass
from methods.module.conv_block import ConvBNReLU
from utils.builder import MODELS
from utils.ops.tensor_ops import cus_sample, ups... |
# polling_location/models.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.db import models
from django.db.models import Q
from exception.models import handle_record_found_more_than_one_exception
from geopy.geocoders import get_geocoder_for_s... |
from abc import ABCMeta, abstractmethod
import re
import sys
import typing as t
from logging import getLogger
from collections import ChainMap, abc
from typing_extensions import Self
from weakref import WeakKeyDictionary
from importlib import import_module
from .exceptions import ProError
from . import signals
from .... |
"""Converts CMU YAML into KAIROS SDF JSON-LD."""
import argparse
from collections import Counter, defaultdict
from collections.abc import Sequence as abcSequence
from copy import deepcopy
import hashlib
import itertools
import json
import logging
from pathlib import Path
import re
from typing import Any, Mapping, Muta... |
import os
import cv2
import numpy as np
from PIL import Image, ImageDraw, ImageFont
import shutil
import copy
import time
seq = os.sep
pwd = os.path.abspath(r'.%s'%seq)
def write_train_val(file, stage, name):
with open(os.path.join(pwd, 'data', stage, '%s.txt'%name), 'w') as obj:
for i in file:
... |
"""Allows the creation of node networks through equation strings.
Dependency Graph Expressions (dge) is a convenience API used to simplify the creation
of Maya DG node networks. Rather than scripting out many createNode, get/setAttr,
connectAttr commands, you can specify a string equation.
No compiled plug-ins are u... |
#!/usr/bin/env python3
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
__copyright__ = ('Copyright Amazon.com, Inc. or its affiliates. '
'All Rights Reserved.')
__version__ = '2.7.0'
__license__ = 'MIT-0'
__author__ = '<NAME>'
__url__ = 'https://git... |
#!/usr/bin/env python3
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import glob
from moviepy.editor import VideoFileClip
from IPython.display import HTML
#matplotlib inline
# Helper classes
class Calibrator:
#This function is able to calibrate the pictures
def... |
# Copyright 2013-2018 ARM 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 agreed to in w... |
import requests
import pandas as pd
import json
import time
from googleplaces import GooglePlaces
from yelp.client import Client
def remove(list_of_removeables, df):
return df[~df['Category'].isin(list_of_removeables)]
def scrape_yelp(tuple_list, lifeline_num, api_key):
"""
FEMA has 7 Lifelines. Each Li... |
from copy import deepcopy
import numpy as np
from scipy.sparse import csc_matrix
import os
import time
from aux import Generic
# CONNECTIVITY
def join_w(targs, srcs, ws):
"""
Combine multiple weight matrices specific to pairs of populations
into a single, full set of weight matrices (one per synapse typ... |
"""
Utilities for SUR and 3SLS estimation
"""
__author__= "<NAME> <EMAIL>, \
<NAME> <EMAIL>"
import numpy as np
import numpy.linalg as la
from .utils import spdot
__all__ = ['sur_dictxy','sur_dictZ','sur_mat2dict','sur_dict2mat',\
'sur_corr','sur_crossprod','sur_est','sur_resid... |
#!/usr/bin/env python
# coding: utf-8
# Code Source: https://wiseodd.github.io/techblog/2016/12/24/conditional-gan-tensorflow/
# In Russian: https://habr.com/ru/post/332000/
# In[1]:
import tensorflow as tf
import pathlib
AUTOTUNE = tf.contrib.data.AUTOTUNE
# ## Data preparation
# In[2]:
# Give a look to the... |
#!/usr/bin/env python
"""
Usage:
python onehot_nets.py -o Bacillus --model HOT_RES_BACILLUS_01 --epochs 3 --patience 20 --cv 5 --n_class 1
... ...
"""
import os
import json
from datetime import datetime
import numpy as np
import pandas as pd
from keras import layers, models, optimizers
from keras im... |
from urllib import response
import requests
from PIL import Image
from io import BytesIO
from lxml import etree
import time
import random
import os
import re
# 用户代理User-Agent列表
USER_AGENTS = [
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50... |
from __future__ import annotations
from Engine_World import *
from Engine_Geometry import *
import Engine.Server
from Engine.Geometry import Vector, Vector2D, Direction, DirectionSet, NextDirection
from datetime import timedelta
from typing import Callable
class World(eWorld):
"""
World class
Methods
-------
... |
# Copyright 2018 ETH Zurich
#
# 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, sof... |
#/usr/bin/env python3
import json
import sys
import os
import re
import rich.console
import rich.table
import plotille
class Result():
CODE_CLUSTER_HEALTH = "CLUSTER_HEALTH"
CODE_COMPRESSED_OOPS = "COMPRESSED_OOPS"
CODE_OVERSHARDING = "OVERSHARDING"
CODE_MANY_SMALL_SHARDS = "MANY_SMALL_SHARDS"
... |
import py
import sys
from py.__.path.svn.testing.svntestbase import CommonSvnTests, getrepowc, getsvnbin
from py.__.path.svn.wccommand import InfoSvnWCCommand, XMLWCStatus
from py.__.path.svn.wccommand import parse_wcinfotime
from py.__.path.svn import svncommon
if sys.platform != 'win32':
def normpath(p):
... |
import ast
import csv
import json
from absl import flags
import numpy as np
import pandas as pd
FLAGS = flags.FLAGS
class ProfileEvent(object):
def __init__(self, json_dict):
self.name = json_dict['name']
self.event_time = float(json_dict['ts']) / 1000.0 # in ms
self.runtime = float(js... |
"""
Title: Object detection with Vision Transformers
Author: [<NAME>](https://www.linkedin.com/in/karan-dave-811413164/)
Date created: 2022/03/27
Last modified: 2022/03/27
Description: A simple Keras implementation of object detection using Vision Transformers.
"""
"""
## Introduction
The article
[Vision Transformer ... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
import torch
import torch.nn as nn
import torch.optim as optim
import pandas as pd
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
i... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# We disable pylint because we need python3 compatibility.
from six.moves import xrange# pylint: disable=redefined-builtin
from six.moves import zip # pylint: disable=redefined-builtin
from tensorflow.python.... |
import torch
import torch.nn as nn
from Blocks import ConvBlock, DeConvBlock, ResidualBlock, Sequential
class LocalPathway(nn.Module):
def __init__(self):
super(LocalPathway, self).__init__()
channel_encoder = [64, 128, 256, 512]
channel_decoder = [256, 128, 64]
## encoder blocks
... |
import re
import os
import glob
import json
class FieldDefinition(object):
def __init__(self, fname, spec):
self.fname = fname
self.IsReadOnly = ('readonly' in spec and spec['readonly'])
self.AllowedTypes = []
self.AllowedValues = []
self.AllowedPatterns = []
self.Re... |
#!/usr/bin/env python
import sys
import argparse
import logging
import time
import config
import netcon
# Global variables
TENSOR_NAMES = []
TENSOR_MATH_NAMES = []
BOND_NAMES = []
BOND_DIMS = []
VECTORS = []
FINAL_ORDER = None
class Tensor:
def __init__(self,name=None,bonds=[]):
if name==None:
... |
# Copyright (c) 2014, FTW Forschungszentrum Telekommunikation Wien
# 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... |
# -*- coding: utf-8 -*
# !/usr/bin/env python3
import json
import datetime as dt
import urllib.request
import pandas as pd
import numpy as np
from sqlalchemy import Column, ForeignKey, Integer, Float, String
from sqlalchemy import and_, or_, not_
from sqlalchemy import create_engine
from sqlalchemy import MetaData
fr... |
"""Main module."""
import pandas as pd
import logging
import itertools
import re
import numpy as np
import pyparsing
from ruleminer import utils
from ruleminer import parser
from ruleminer import metrics
from ruleminer.const import CONFIDENCE
from ruleminer.const import ABSOLUTE_SUPPORT
from ruleminer.const import AB... |
import enum
import re
import sys
import builtins
from keyword import iskeyword
from typing import List, Match, Optional, Pattern, Tuple
from unicodedata import normalize
_DIGITS: str = "0123456789"
# noinspection SpellCheckingInspection
_LOWERCASE_ALPHABET: str = "abcdefghijklmnopqrstuvwxyz"
# noinspection SpellChec... |
import argparse
import os
import pickle
import ConfigSpace as cs
from hpbandster.core.nameserver import NameServer, nic_name_to_host
from hpbandster.core.result import json_result_logger, logged_results_to_HBS_result
from hpbandster.core.worker import Worker
from hpbandster.optimizers import BOHB
import numpy as np
f... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... |
__author__ = "<NAME> :: New Mexico Mira Project, Albuquerque"
# Python core:
from collections import OrderedDict
import datetime
from math import ceil
# External packages:
import requests
from bs4 import BeautifulSoup
import pandas as pd
# From other modules, this package:
from astropak.util import degrees_as_hex, r... |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2015, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... |
#!/usr/bin/env python3
# =============================================================================
# Version: 2.41 (November 19, 2015)
# Author: <NAME> (<EMAIL>), University of Pisa
#
# Contributors:
# <NAME> (<EMAIL>)
# <NAME> (<EMAIL>)
# <NAME> (<EMAIL>)
# <NAME> (<EMAIL>)
# <NAME> (<EMAIL>)
# <NA... |
import sys
import os
import argparse
import logging
import shutil
import re
import pickle
from PIL import Image
from skimage import io
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
import torchvision.models as models
import torch.optim as optim
from ... |
"""
From https://github.com/fangchangma/sparse-to-dense.pytorch
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models
import collections
import math
class VariationalDecoderNet(torch.nn.Module):
def __init__(self, encoded_dims=100):
super(VariationalDecoderNet, self).__in... |
"""Schwartz and Simoncelli 2001 + excitation and inhibition, in pytorch."""
from numpy.core.numeric import True_
import torch # pylint: disable=import-error
import torch.nn as nn # pylint: disable=import-error
import torch.nn.functional as F # pylint: disable=import-error
import numpy as np
import math
def genGabor... |
import pandas as pd
import numpy as np
import h5py as hd
import matplotlib.pyplot as plt
import os
import cvxpy as cp
import scipy.stats as sts
from sklearn.metrics import confusion_matrix, classification_report
from sklearn.metrics import roc_curve
from sklearn.metrics import roc_auc_score
from tqdm import tqdm_noteb... |
#----------------------------------------------------------------------------#
# Imports
#----------------------------------------------------------------------------#
import json
import dateutil.parser
import babel
from flask import Flask, render_template, request, Response, flash, redirect, url_for
from flask_sqlalc... |
from scipy import *
from math import *
import matplotlib.pyplot as plt
from matplotlib.path import Path
import matplotlib.patches as patches
import sys
import pyclipper
from functools import *
fig = plt.figure()
canv = fig.add_subplot(1,1,1)
canv.set_xlim(0,500)
canv.set_ylim(0,500)
T0 = 10 ... |
from rdkit import Chem
import rdkit.Chem.Draw as Draw
from PIL import Image, ImageOps
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def gen_params(sample_number, sa_path, input_file_name, output_file_name):
"""
Generate the parameter sets for the Sobol sensitivity analysis.
... |
from django.shortcuts import render
from django.template.defaultfilters import slugify
# Importing DRF methods:
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework import status
# Importing data manipulation packages:
import json
# Importing article models, serializer... |
# Crichton, Admirable Source Configuration Management
# Copyright 2012 British Broadcasting 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/licens... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Augment 3D patch data with 3D rotation, flip, and translation, in-memory.
Created on Thu Oct 27 21:46:48 2016
@author: yulkang
"""
#%% Import
import numpy as np
import warnings
import os
import time
from pysy import zipPickle
import import_mhd as mhd
#%% Classes
c... |
#!/usr/bin/env python3
'''Copyright (c) 2019 <NAME>. All rights reserved.
The implementaiton of the bot.
'''
import logging
import argparse
import datetime
import contextlib
import textwrap
import functools
import threading
import time
import re
from urllib.parse import urljoin
import inflect
import telegram
import ... |
import argparse
import os
import sys
import traceback
import json
import random
import subprocess
import statistics
from datetime import datetime
from Bio import SeqIO
from Bio.Seq import Seq
from collections import OrderedDict
class Insertion:
def __init__(self):
self.chromosome = ""
self.family =... |
#!/usr/bin/env python
"""
RetroFit program:
Fits guest molecules to open metal sites of MOFs using an interaction potential of a
model system (MIP)."""
__author__ = ["<NAME>", "<NAME>", "<NAME>"]
__version__ = "1.0"
__date__ = "06.09.2019"
__email__ = "<EMAIL>"
import matplotlib.pyplot as plt
... |
#!/usr/bin/python3
# Webserver, welcher via REST-API mit den myStrom-Bulbs kommuniziert,
# um von Pure Data Requests im FUDI-Protokoll entgegenzunehmen,
# diese in myStrom REST-Requests umzuwandeln und die JSON-Response
# der Bulb wieder im FUDI-Protokoll zurückzuleiten.
#
# sudo systemctl enable bulbs.service
# sudo ... |
""" Functions for running the PEPR model defined in the
--Univeral visitation law of human mobility-- paper
(https://www.nature.com/articles/s41586-021-03480-9).
"""
import random
import time
import itertools as it
import matplotlib.pyplot as plt
import numpy as np
def levy_flight(num_steps: int,... |
import numpy as np
from abc import ABC
import copy
import sympy
from typing import Iterable, Union
from beluga.numeric.compilation import jit_compile_func, LocalCompiler
from beluga.numeric.compilation.component_compilation import compile_control, compile_cost
from beluga.numeric.data_classes.Trajectory import Traject... |
from IPython.core.display import display, HTML, Javascript
import json
import pandas as pd
LAST_ID = 1
class Raw(str):
"""Raw javascript code (not quoted by to_js)"""
pass
def __process_data(df, cols, process_func):
if cols and isinstance(cols, list):
df = df[cols]
if process_func and call... |
#!/usr/bin/env python
# Copyright (c) 2018 Intel Labs.
# authors: <NAME> (<EMAIL>)
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""Example of automatic vehicle control from client side."""
from __future__ import print_function
# ============... |
#!/usr/bin/env python3
import cv2
import math
import numpy as np
from configparser import SectionProxy
from copy import deepcopy
from itertools import tee
from shapely import geometry, affinity
from typing import List, Dict, Union, Optional
from pero_ocr.document_ocr.layout import PageLayout, RegionLayout
def pair... |
import os
import time
import numpy as np
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
import gym
import wandb
from spinup.utils.logx import EpochLogger
pylogger = logging.getLogger(__name__)
# if gpu is to be used
device = torch.device("cuda" if torch.cuda.is_available() else "... |
# Forecast support, experimental coding
# probably all this will be rewritten, put in a different directory, etc.
"""CDMS Forecast"""
from __future__ import print_function
import numpy
import cdtime
import cdms2
import copy
from cdms2 import CDMSError
from six import string_types
def two_times_from_one(t):
"""... |
import numpy as np
from scipy.integrate import odeint
import sys,os
temp_2LPT = \
"""
Nmesh {Nm} % This is the size of the FFT grid used to
% compute the displacement field. One
% should have Nmesh >= Nsample.
Nsample {Ns} % sets th... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import re
import click
import time
import sys
from datetime import datetime
from twccli.twcc.services.compute import GpuSite as Sites
from twccli.twcc.services.compute import VcsSite, VcsSecurityGroup, VcsImage, Volumes, LoadBalancers, getServerId
from twccl... |
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from torch import distributions as torchd
import tools
class RSSM(nn.Module):
def __init__(
self, stoch=30, deter=200, hidden=200, layers_input=1, layers_output=1,
rec_depth=1, shared=False, discrete=False, act=nn.EL... |
import boto3
import json
import requests
from os import getenv as env
from pathlib import Path
from utils import (
setup_logging,
zoom_api_request,
TIMESTAMP_FORMAT,
retrieve_schedule,
schedule_match,
PipelineStatus,
set_pipeline_status,
)
import subprocess
from pytz import timezone
from dat... |
"""
This module contains all enumerations used by this library.
"""
import sys
from enum import IntEnum
from typing import TypeVar, List, Iterable # pylint: disable=unused-import
if float('%s.%s' % sys.version_info[:2]) >= 3.6:
from enum import IntFlag # pylint: disable=ungrouped-imports,no-name-in-module
else:
... |
# 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 agreed to in writing... |
# from robot import parsing
from robot.api.parsing import get_resource_model, get_init_model
from robot.variables.filesetter import VariableFileSetter
from robot.variables.store import VariableStore
from robot.variables.variables import Variables
from robot.libdocpkg.robotbuilder import LibraryDocBuilder
from rob... |
from __future__ import print_function, division
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelCheckpoint
from torchdiffeq import odeint_adjoint as odeint
import matplotlib.pyplot as plt
i... |
PHONE_MODEL_DATABASE = [
"1501_M02", # 360 F4
"1503-M02", # 360 N4
"1505-A01", # 360 N4S
"303SH", # 夏普 Aquos Crystal Xx Mini 303SH
"304SH", # 夏普 Aquos Crystal Xx SoftBank
"305SH", # 夏普 Aquos Crystal Y
"306SH", # 夏普 Aquos Crystal 306SH
"360 Q5 Plus", # 360 Q5 Plus
"360 Q5", #... |
from inspect import currentframe
import queue
from tkinter.constants import FALSE, FLAT, HORIZONTAL, LEFT, MOVETO, TRUE, VERTICAL, X
from tkinter.ttk import Combobox
from PySimpleGUI.PySimpleGUI import MENU_RIGHT_CLICK_DISABLED, T, Combo, Element, Text
import asyncio
import os
import sys
import PySimpleGUI as sg
import... |
from unittest import TestCase
from unittest.mock import mock_open, patch, MagicMock
from tools.skipfish.parsers import SkipfishResultsParser, SkipfishOutputParser
from tools.skipfish.structs import SkipfishIssuesDesc, SkipfishRisk
class SkipfishResultsParserTest(TestCase):
ISSUES_DESC = r'''<script src="samples.... |
import random
def Print_Board(Round):
x = [" _______ _______ _______ _______ _______ _______ _______ _______ _______ _______ _______ _______ _______ _______ _______ _______",
" 1 2 3 4 5 6 7 8 9 10 11 12 13... |
bl_info = {
"name": "Blender Poly",
"category": "Object",
"author": "<NAME>",
"version": (2, 0),
"blender": (2, 80, 0),
"location": "Object Panel > Poly",
"wiki_url": "https://github.com/satoyuichi/BlenderPoly",
}
import bpy
import bpy.utils.previews
import requests
import json... |
import os
import shutil
import time
from copy import copy
import pandas as pd
import numpy as np
from tqdm import tqdm
from datetime import datetime
from pathlib import Path
from glob import glob
import libs... |
import pandas as pd
import json
from anndata import AnnData
from ._datastructures import IrCell, IrChain
from typing import Sequence, Union
import numpy as np
from glob import iglob
import pickle
import os.path
from . import _tracerlib
import sys
from pathlib import Path
import airr
from ..util import _doc_params, _is_... |
#!/usr/bin/python3
import cobra as cb
import pandas as pd
import re
import sys
import getopt
import os.path
import copy
import csv
import math
import cobra.flux_analysis.variability
import subprocess
import shutil, errno
import statistics
from cobra import Reaction
import cometspy as c
import numpy as np
import matplo... |
''' This module contains various utility functions and constants.
Attributes:
FILE_TYPES (list of tuple of str, str): list of supported
input file parameters.
SOLUTION_XLSX_FILE (list of tuple of str, str): list of
supported solution file formats (xlsx).
TEXT_FOR_PA... |
"""Self-play between two user agents with initial message provided by the task_agents"""
from parlai.core.agents import _create_task_agents
from parlai.core.worlds import DialogPartnerWorld, BatchWorld
import numpy as np
from parlai.core.worlds import create_agents_from_shared
import random
from copy import deepcopy
im... |
import numpy as np
import cv2
import onnx
import onnxruntime
import torch
from torch import nn
import array
from op_codegen import cg
class Attr(object):
def __init__(self, ksize=0, stride=0, pad=0, c_in=0, c_out=0):
self.ksize = ksize
self.stride = stride
self.pad = pad
self.c_in =... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 21 01:59:56 2020
@author: mateusz
"""
import platform
import os
import wfdb
import glob
import numpy as np
import pandas as pd
from os.path import join
from biosppy.signals import ecg
from Helpers.Physionet import LoadFile, PhysionetConstants
from H... |
from collections import defaultdict
from utils import plot_utils
def mean(*lst):
columns = lst.key
return sum(lst) / len(lst)
# if __name__ == '__main__':
#
# ls_dct=[{'Stars':2, 'Cast':0.11},
# {'Stars':3, 'Cast':0.01},
# {'Stars':5, 'Cast':0.01}
# ]
#
# # result =map(mean... |
from __future__ import division
import numpy as np
import scipy
from scipy.special import (factorial,
comb as nchoosek,
)
from mindboggle.shapes.zernike.helpers import nest, autocat
import logging
LOG = logging.getLogger(__name__)
#import decorator
#@decorator.decora... |
from manim import *
import random
class SelectionSort(Scene):
def construct(self):
text1 = Text("Selection Sort", font="IBM Plex Sans",
color="#fafafa", size=4)
self.play(Write(text1))
self.wait(2)
self.play(text1.scale, 0.5, text1.to_edge, UP)
code = C... |
# Implement a 4-layer CNN using numpy only (no tensorflow)
#
# Author: <NAME>
# Date: 4/19/2018
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist ... |
#!/usr/bin/env python3
# Copyright (C) 2018 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.