text stringlengths 8.04k 46.5k |
|---|
"""Command-line interface and corresponding API for CNVkit."""
# NB: argparse CLI definitions and API functions are interwoven:
# "_cmd_*" handles I/O and arguments processing for the command
# "do_*" runs the command's functionality as an API
from __future__ import absolute_import, division, print_function
import... |
#!/usr/bin/python3
# Copyright 2017, The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
import gin
import h5py
import numpy as np
import tensorflow as tf
from models import ResNet18, ResNetBlock
@gin.configurable(blacklist=["name"])
class TransNetV2(tf.keras.Model):
def __init__(self, F=16, L=3, S=2, D=256,
use_resnet_features=False,
use_many_hot_targets=False,
... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# ------------------------------------------------------------------------------
from __future__ import absolute_import
from __future__ import divis... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
"""Adaptive RF Izhikevich neuron."""
import numpy as np
import torch
from . import base
from .dynamics import resonator, adaptive_phase_th
from ..spike import complex
from ..utils import quantize
# These are tuned heuristically so that ... |
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
# This file is part of the MapProxy project.
# Copyright (C) 2016-2017 Omniscale <http://omniscale.de>
#
# 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/LI... |
#!/usr/bin/env python3
# *****************************************
# PiFire Common Library
# *****************************************
#
# Description: This library provides functions that are common to
# both app.py and control.py
#
# *****************************************
# ************************************... |
"""
This module provides 3 different methods to perform 'all relevant feature selection'
Reference:
----------
NILSSON, <NAME>, <NAME>., <NAME>, et al.
Consistent feature selection for pattern recognition in polynomial time.
Journal of Machine Learning Research, 2007, vol. 8, no Mar, p. 589-612.
KURSA, <NAME>., RUDN... |
import argparse
import base64
import ctypes
import getpass
import logging
import os
import platform
import select
import socket
import subprocess
import time
from math import ceil
from pathlib import Path
import enlighten
import psutil
import yaml
from Crypto.Cipher import AES, DES
from Crypto.Random import get_random... |
# 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... |
"""Utilities for geometry defined by tuples or lists of numbers"""
from math import pi, sin, cos, tan, atan, atan2, asin, acos, exp, log, log10
from functools import reduce
from operator import mul
def rad_to_deg(ang):
"""Converts radians to degrees"""
return ang * 180 / pi
def deg_to_rad(deg):
"""Conve... |
import numpy as np
import pandas as pd
from scipy.stats.distributions import chi2, norm
from statsmodels.graphics import utils
def _calc_survfunc_right(time, status, weights=None, entry=None, compress=True,
retall=True):
"""
Calculate the survival function and its standard error for a... |
"""
We generate data for the MNIST Normalizing Flow
experiment as proposed in Section 4.4 of our paper
KSD Aggregated Goodness-of-fit Test
<NAME>, <NAME>, <NAME>
https://arxiv.org/pdf/2202.00824.pdf
The data is saved in the directory data/NF_MNIST.
We use the code from Tutorial 11: Normalizing Flows for image modelin... |
import numpy as _np
import matplotlib.pyplot as _plt
from johnspythonlibrary2.Process.Misc import findNearest
import xarray as _xr
# from scipy.signal import gaussian as _gaussian
#%% Basic signal generation
def gaussian_pulse(sigma, t, amplitude=1, plot=False):
"""
Basic gaussian pulse with units in time
std_t... |
import numpy as np
import os
import argparse
import sys
from collections import OrderedDict
from astropy.io import fits
from astropy import wcs
from jwst.assign_wcs import nirspec
from jwst import datamodels
from . import auxiliary_functions as auxfunc
"""
This script compares pipeline WCS info with ESA results for ... |
"""Trackable data structures."""
# Copyright 2018 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... |
"""
fg.py: fg stands for FunctionGraph
Contains the FunctionGraph class and exception
types that it can raise.
"""
from __future__ import absolute_import, print_function, division
import sys
import time
import traceback
import theano
from theano.gof import graph
from theano.gof import utils
from theano.gof import too... |
# Sample Management is the heart of these scripts. This file defines what FAMEs, Samples, Lines, etc. are and what can be done with them.
# The only reason this file should be changed is if there are necessary features that must be added.
#A TrendIdentifier is a base class for any datum type that one would like to f... |
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
"""Use to generate arm task and run."""
import rospy
import tf
import Queue as queue
import copy
# import object_distribtion
from math import radians, degrees, sin, cos, pi, acos, asin
from numpy import multiply
from enum import IntEnum
# from Queue import Queue
import ... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""
This contains the TorchX local scheduler which can be used to run TorchX
components ... |
#https://github.com/keras-team/keras-applications/blob/master/keras_applications/mobilenet_v2.py
import os
import tensorflow as tf
import tensorflow.keras.backend as backend
import tensorflow.keras.layers as layers
import tensorflow.keras.models as models
import tensorflow.keras.utils as keras_utils
BASE_WEIGHT_PATH =... |
#used modules
import tkinter #gui module
import pyautogui #screenshot
import time
import uuid #random string generator
#________to allow the tk to embed matplot in UI_______
from matplotlib.backends.backend_tkagg import (
FigureCanvasTkAgg, NavigationToolbar2Tk)
# Implement the default Matplotlib key bi... |
import time
from time import sleep
import exchanges
import signal
import sys
import logging
from logging.handlers import RotatingFileHandler
from os.path import expanduser
import requests
# todo ->
# make it currency generic (currently USDHKD only)
def getLiveFXRate(forCCY, domCCY):
url = 'https://api.gatecoin.co... |
import os
import io
import shutil
import base64
import subprocess
import platform
import logging
import numpy as np
import pandas as pd
from tqdm import tqdm
from glob import glob
from pathlib import Path as P
import wget
import urllib3, ftplib
from urllib.parse import urlparse
from bs4 import BeautifulSoup
import ... |
""" Module for basic utilties with holy grail
.. include common links, assuming primary doc root is up one directory
.. include:: ../include/links.rst
"""
import numpy as np
import os
import numba as nb
from matplotlib import pyplot as plt
from scipy.ndimage.filters import gaussian_filter
from scipy.signal import... |
"""
Delegating package installation to pip, packaging and friends.
"""
import codecs
import importlib.util
import linecache
import os
import platform
import re
import shlex
import sqlite3
import sys
import tarfile
import zipfile
import zipimport
from collections.abc import Callable
from functools import lru_cache as c... |
# coding:utf-8
"""
NFA/DFA实现正则表达式
https://time.geekbang.org/column/article/137286
"""
import copy
import string
MATCH = True
CONTINUE = 3
NO_MATCH = False
ALL_END = 1
class NodeType(object):
OR = "1"
AND = "2"
CHAR = "3"
RANGE = "4" # [0-9]
class EBNFNode(object):
def __init__(self, name, n... |
import pandas as pd
import uuid
from bayesianpy.jni import *
from bayesianpy.data import DataFrame
import bayesianpy.data
import os
from typing import List, Tuple
import numpy as np
from typing import Iterator, Optional
from . import distributed as dk
def create_network():
return bayesServer().Network(str(uuid.get... |
# FIXME: commented out CBox stuff for PR #620, needs further cleanup
import numpy as np
#import logging
import cma
from qcodes.instrument.parameter import ManualParameter
#from pycqed.measurement import CBox_sweep_functions as cbs
from pycqed.measurement import detector_functions as det
#from pycqed.analysis import mea... |
import sys
from pegtree.visitor import ParseTreeVisitor
import pegtree as pg
import verb
import tokibi
from tokibi import NExpr, NLiteral
from logging import getLogger
logger = getLogger(__name__)
EMPTY = tuple()
# コード表現
ALPHA = [chr(c) for c in range(ord('A'), ord('Z')+1)] + ['?']
STATIC_MODULE = {
'math', 'p... |
# -*- coding: utf-8 -*-
"""
The base elements for reading and writing complex data files.
"""
import os
import logging
from typing import Union, Tuple
from datetime import datetime
import numpy
from .sicd_elements.SICD import SICDType
from .sicd_elements.ImageCreation import ImageCreationType
from ...__about__ impor... |
import datetime
import urllib
from django.forms import widgets
from django.forms.utils import flatatt
from django import forms
from django.utils.encoding import force_unicode, python_2_unicode_compatible, force_text
from django.utils.safestring import mark_safe
from django.utils.html import conditional_escape, html_sa... |
import base64
import datetime
import io
import json
import typing
import flask
import flask_login
from reportlab.pdfgen.canvas import Canvas
from reportlab.pdfbase.pdfdoc import PDFInfo
from reportlab.lib.pagesizes import A4 as pagesize
from reportlab.lib.units import mm
from PIL import Image
import qrcode
import qrc... |
import torch
from torch import nn
from torch.autograd.function import InplaceFunction, Function
import random
import numpy as np
import torch.nn.functional as F
from torch.distributions.normal import Normal
from torch.distributions.uniform import Uniform
from plot_histograms import plot
# random.seed(1)
# t... |
import torch
import numpy as np
import networkx as nx
import torch_geometric as tg
from model.utils import batch_dihedrals
from model.cycle_utils import *
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
device = 'cpu'
def construct_conformers(data, model):
G = nx.to_undirected(tg.utils.to_n... |
# -*- coding: utf-8 -*-
import os
from importlib.machinery import SourceFileLoader
from testflows.core import *
from testflows.core.name import basename
from testflows.asserts.helpers import varname
from testflows.asserts import error
from aes_encryption.requirements.requirements import *
from aes_encryption.tests.co... |
from Queue import Queue
import serial
import sys
import time
from threading import Thread
from threading import RLock
from threading import Condition
from struct import unpack
import signal
import glob
from itertools import cycle
clock_blink_iterator = cycle(range(2))
BOARD = "Board"
FEN = "FEN"
CLOCK_BUTTON_PRESSED... |
# -*- coding: UTF-8 -*-
from __future__ import print_function
from time import time
t1 = time()
import argparse
import json
import os
from collections import Counter
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import imblearn
import statsmodels.stats.weightstats as sw
from sklearn.featur... |
## @ StitchIfwi.py
# This is a python stitching script for Slim Bootloader APL build
#
# Copyright (c) 2019, Intel Corporation. All rights reserved. <BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
import sys
import os
import re
import struct
import argparse
import zipfile
import shutil
import ... |
"""
Contains code for representing chiral merge trees, as well
as code for performing edit operations on them, and code
for computing chiral merge trees from time series
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from bisect import bisect_left
from functools import cmp_t... |
import asyncio
import datetime
import importlib
import itertools
import os
import random
import re
import shutil
import signal
import subprocess
import sys
import time
import zipfile
import discord
import psutil
from src import const
from src.algorithms import levenshtein_distance
from src.bc import DoNotUpdateFlag
f... |
"""
# Part of localization phase
# suspected bug detection:
# 1. Tensorflow,Theano,CNTK
# 2. Tensorflow,Theano,MXNET
#
# voting process
# -> a. inconsistency -> error backend,error layer.
# b. check error backend in new container(whether inconsistency disappears).
# """
#
import numpy as np
import os
import sys
imp... |
"""
Automatic Pixel Art Generator or apag.
A set of functions to autmatically create pixel art for games.
"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2012, <NAME>"
__license__ = "FreeBSD"
__version__ = "0.0.6a"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
import pygame, sys, o... |
from math import e
import warnings
from typing import Dict, List, Tuple
import numpy as np
import pandas as pd
from ..optimize import Optimizer
from .optimal_scaling_problem import OptimalScalingProblem
from .parameter import InnerParameter
from .problem import InnerProblem
from .solver import InnerSolver
REDUCED = ... |
##########################################################################
#
# Copyright (c) 2007-2010, Image Engine Design 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:
#
# * Redis... |
"""Nearest neighbour classifiers"""
from __future__ import annotations
from typing import Callable, List
import numpy as np
from frlearn.base import DataDescriptor, MultiClassClassifier, MultiLabelClassifier
from frlearn.data_descriptors import NND
from frlearn.neighbour_search_methods import NeighbourSearchMethod, ... |
################################################################################
# Copyright (C) 2013-2014 by gempa GmbH
#
# FDSNStation -- Implements the fdsnws-station Web service, see
# http://www.fdsn.org/webservices/
#
# Feature notes:
# - 'updatedafter' request parameter not implemented: The last modification... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
from copy import deepcopy
import itertools
import logging
import json
import math
import os
import random
import shutil
import GPy
import numpy as np
import pandas as pd
from scipy.optimize import m... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
'''
Import packages
'''
import glob
import json
import tqdm
import time
import argparse
import numpy as np
import tensorflow as tf
from collections import defaultdict
import lucid.optvis.render as render
import lucid.modelzoo.vision_models as models
from keras.applications.inception_v3 import preprocess_input
import os... |
#!/usr/bin/env python3
import numpy as np
import os.path
import copy
from Distributions import Porosity_Distribution,TA_POR_Distribution
#### Load values of transport resistant from data file
DEF_DATA = dict(
res0 = 2,
pstd_r0=0.15,
por_con_min = 0.07,
nmin = 20,
dp = 0.02,
# scale_std... |
import sys
from limix.core.old.cobj import *
from limix.utils.preprocess import regressOut
import numpy as np
import scipy.linalg as LA
import copy
def compute_X1KX2(Y, D, X1, X2, A1=None, A2=None):
R,C = Y.shape
if A1 is None:
nW_A1 = Y.shape[1]
#A1 = np.eye(Y.shape[1]) #for now this creates... |
import collections
import base64
import copy
import enum
import logging
import os
import pathlib
import xml.sax
import pyparsing # type: ignore
# Improve performance by caching
pyparsing.ParserElement.enablePackrat()
import untangle # type: ignore
import bgraph.exc
import bgraph.utils
from bgraph.types import (
... |
# Copyright: (c) 2014, <NAME> <<EMAIL>>
# Copyright: (c) 2018, Ansible Project
# 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
import datetime
import json
import os
import textwrap
impo... |
import json
from collections import namedtuple
from datetime import datetime
from pathlib import Path
from zipfile import ZipFile
import h5py
import numpy as np
from scipy.signal import convolve2d
from torch.utils.data import Dataset
from .exceptions import InconsistentDataException, DoesNotExistException
from .trans... |
"""
This module provides functionality to gather and store information about a
demographic model (as defined by a demographic model function), and to use this
information to generate a visual representation of the model.
Just two functions are used for generating and plotting models. For example, the
following is all ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) IBM Corporation 2018
#
# 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
#
# U... |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2021-2021 Arm Ltd.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""
Basic functions solving FPE.
Based on
<NAME>. (2018).
Switching probability of all-perpendicular spin valve nanopillars.
AIP Advances, 8(5).
https://doi.org/10.1063/1.5003832
... |
"""HotKeys main program - gui specific code - Qt5 version
"""
import sys
# import os
import functools
import PyQt5.QtWidgets as qtw
## import PyQt5.QtGui as gui
import PyQt5.QtCore as core
import editor.shared as shared
class DummyPage(qtw.QFrame):
"simulate some hotkeypanel functionality"
def __init__(self, ... |
"""Integrity checks and tests for specific features used"""
import copy
import logging
import numbers
import re
from typing import Optional, Iterable, Any
from collections import Counter
import libsbml
import numpy as np
import pandas as pd
import sympy as sp
import petab_MS
from . import (core, parameters, sbml, me... |
"""
%prog [options] CONFIG
THOR detects differential peaks in multiple ChIP-seq profiles associated
with two distinct biological conditions.
Copyright (C) 2014-2016 <NAME> (<EMAIL>)
This program comes with ABSOLUTELY NO WARRANTY. This is free
software, and you are welcome to redistribute it under certain
conditio... |
"""hashit module for hashit command is contaning all the code for hashit
hashit is an hashing application which main purpose is to replace all the 'default'
hashing commands that comes with linux and also provide a usable hashing program
for windows hence the choice of using python. while hashit supports both pyth... |
# This file is part of astro_metadata_translator.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (http://www.lsst.org).
# See the LICENSE file at the top-level directory of this distribution
# for details of code ownership.
#
# Use of this source code... |
#!/usr/bin/env python
import os
import numpy as np
import codecs
from scipy.optimize import curve_fit
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
from collections import defaultdict
import thepipe as tp
import h5py
from .tools import (
gaussian,
calculate_charges,
bin_data,
c... |
# -*- coding: utf-8 -*-
import codecs
import contextlib
import gzip
import os
import pickle as pkl
import random
import shutil
import socket
import sys
import threading
import time
import traceback
from datetime import datetime
from logging import getLogger
import six
from .misc import (ensure_dir_exists, ensure_pare... |
'''
wechat_send.py
集合了需要发送到微信的函数
调用提示
base开头的函数是基础函数,通常作为定时任务,无返回值,但可能打印报错信息
其他函数可以假设是异步IO,参数符合条件时不抛出异常
由于异步假设,函数只返回尝试状态,即是否设置了定时任务,不保证成功发送
'''
import requests
import json
# 设置
from app.constants import *
from boottest import base_get_setting
# 模型与加密模型
from app.models import NaturalPer... |
"""
.. moduleauthor:: <NAME>
.. module:: qtgui.widgets.datasource
This module contains widgets for viewing and controlling
:py:class:`Datasource`s. It aims at providing support for all
abstract interfaces defined in
`datasource.datasource`.
"""
# standard imports
from typing import Union
import logging
# Qt imports... |
"""
Tools provide interactive behavior to a `View` by handling specific
events sent by view.
Some of implemented tools are
`HoverTool`
make the item under the mouse cursor the "hovered item"
`ItemTool`
handle selection and movement of items
`HandleTool`
handle selection and movement of handles
`Rubberb... |
from winning.normaldist import normcdf, normpdf
import numpy as np
import math
from collections import Counter
#########################################################################################
# Operations on univariate atomic distributions supported on evenly spaced points #
###########################... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import hashlib
import base64
import binascii
try:
from ecdsa.ecdsa import Signature
from ecdsa.numbertheory import inverse_mod
from ecdsa import SigningKey, VerifyingKey, der
except ImportError:
raise ImportError("ECDSA tools are required. Use 'pip3 install -r requirements.txt' or 'pip install -r "
... |
import pathlib
from typing import Any, Dict
from yeahml.build.components.callbacks.objects.base import CallbackContainer as CBC
import tensorflow as tf
# from tensorflow.python.keras import callbacks as callbacks_module
from yeahml.log.yf_logging import config_logger
from yeahml.train.gradients.gradients import (
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import simplejson as json
import six
import os
from pandas.api.types import is_integer_dtype
from scipy.sparse import coo_matrix
import numpy as np
import pandas as pd
import h5py
from .core import (
get,
region_to_offset... |
# coding=utf-8
# Copyright 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
"""Hops flask middleware example"""
from flask import Flask
import ghhops_server as hs
#from numpy.lib.polynomial import poly1d
import rhino3dm
import numpy as np
# #-------------------------------------------------------
# import os
# import sys
# path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(... |
import math,random,copy,BodyPart,string,Inventory,Woodcutting,Mining,Item,time,ParticleEngine,Dialog,Crafting
def genID(size=10):
ID = ''
for i in range(0,size):
charType = random.randint(0,2)
if charType == 0:
ID += string.ascii_lowercase[random.randint(0,len(string.ascii_lowercase)... |
from datetime import datetime
from app import app, db
from flask import render_template, request, redirect, session, flash, url_for, jsonify
from app.models import Account, Transaction, Taggroup, Tag, Condition, Description
import os,re
##--------------------------------------------------------------------------------... |
import time
import numpy as np
import math
from scipy import special
from scipy import optimize
EPS = 10e-15
class TruncatedMVN:
"""
Create a normal distribution :math:`X \sim N ({\mu}, {\Sigma})` subject to linear inequality constraints
:math:`lb < X < ub` and sample from it using minimax tilting. Bas... |
from collections import namedtuple
import datetime
import functools
import json
import os
import tempfile
from django.contrib import messages
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse
from django.http.respo... |
""" Tools for doing common subexpression elimination.
"""
from __future__ import print_function, division
from sympy.core import Basic, Mul, Add, Pow, sympify, Symbol, Tuple, igcd
from sympy.core.numbers import Integer
from sympy.core.singleton import S
from sympy.core.function import _coeff_isneg
from sympy.core.expr... |
import os
import torch.optim as optim
import torch
import torch.nn.functional as F
import torch.nn as nn
from torch.distributions import Normal
from torch.optim import Adam
import numpy as np
import random
import copy
import gym
import json
from sklearn.decomposition import PCA
# torch.autograd.set_detect_anomaly(True)... |
"""Main entrypoint for WDL2CWL."""
import argparse
from argparse import Namespace
import sys
from io import StringIO
from typing import List, cast, Union
from io import StringIO
import textwrap
import re
import regex # type: ignore
import cwl_utils.parser_v1_2 as cwl
from antlr4 import CommonTokenStream, InputStream... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Community Convolutional Layer
Created on Sep 19, 2018.
Last edited on Oct 11, 2018.
@author: <NAME>
"""
import logging
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim.optimizer import Optimizer
from torch.utils.dat... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python 3
# name: python3
# ---
# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab... |
import io
import json
import random
from collections import defaultdict
import numpy as np
import torch
from itertools import chain, groupby
from tqdm import tqdm
# sys.setdefaultencoding('utf8')
# word_lexicon_size = 29172
# word_lexicon_size = 29336
word_lexicon_size = 29571
# pa_path_lexicon_size = 29313
pa_path_... |
"""
libpq access using ctypes
"""
# Copyright (C) 2020-2021 The Psycopg Team
import ctypes
import ctypes.util
import sys
from ctypes import Structure, CFUNCTYPE, POINTER
from ctypes import c_char, c_char_p, c_int, c_size_t, c_ubyte, c_uint, c_void_p
from typing import List, Optional, Tuple
from ..errors import NotSu... |
"""
Implementation of the method proposed in the paper:
'Adversarial Attacks on Classification Models for Graphs'
by <NAME>, <NAME>, <NAME>, <NAME>
Published at ICML 2018 in Stockholm, Sweden.
Copyright (C) 2018
<NAME>
Technical University of Munich
"""
#import tensorflow as tf
import os
os.environ['TF_CPP_MIN_LOG_LE... |
# encoding: utf-8
#
# @Author: <NAME>, <NAME>
# @Date: Nov 15, 2021
# @Filename: field.py
# @License: BSD 3-Clause
# @Copyright: <NAME>, <NAME>
import astropy.units as u
import numpy as np
import pyphot
import progressbar
# import matplotlib.pyplot as plt
# from pyphot import unit
from astropy.io import fits
from ast... |
import os
import csv
import time
from .ids import get_radical_base
from .misc import as_string
from .misc import get_env_ns as ru_get_env_ns
from .misc import get_hostname as ru_get_hostname
from .misc import get_hostip as ru_get_hostip
from .threads import get_thread_name as ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# multirobot_teamwars.py
# Contact (ce fichier uniquement): nicolas.bredeche(at)upmc.fr
# Ce code utilise pySpriteWorld, développé par <NAME> (U. Paris 13)
#
# Historique:
# 2016-03-28__23:23 - template pour 3i025 (IA&RO, UPMC, licence info)
# 2018-03-26__23:06 - mise... |
# -*- coding: utf-8 -*-
# Authors: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from copy import deepcopy
import numpy as np
from scipy import linalg
import warnings
from ._event import Discrete
from .viz import plot_epochs
from .utils import pupil_kernel
from ._fixes import string_types, nanmean, nanstd
from .parall... |
##Collect data:
#SMI: 2021/6/7
# SAF: 307522 Standard Beamline 12-ID proposal: 308023
# create proposal: proposal_id('2021_2', '308023_Dinca') #create the proposal id and folder
# Energy: 16.1 keV, 0.77009 A
# SAXS distance 5000
# SAXS in vacuum and WAXS in air
# RE( shopen() ) # to open the b... |
# 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.
"""
This file implements:
Ghazvininejad, Marjan, et al.
"Constant-time machine translation with conditional masked language models."
arXiv pre... |
#==========================================================================
#
# The PyRISC Project
#
# SNURISC5: A 5-stage Pipelined RISC-V ISA Simulator
#
# Pipeline datapaths
#
# <NAME>
# Systems Software and Architecture Laboratory
# Seoul National University
# http://csl.snu.ac.kr
#
#=================... |
#### ros cmd
#roslaunch pocky_mission pick_and_place.launch
import rospy
import sys
import time
import threading
import argparse
import numpy as np
import math
import enum
import time
from std_msgs.msg import Int32MultiArray
import os
#ROS message sent format
from std_msgs.msg import String
#Hiwin arm api class
from co... |
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Conv2D
from keras.models import model_from_json
from sklearn.model_selection import train_test_split
import keras
import numpy
import pickle
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import w... |
import time
import sys
def get_close_matches_Levenshtein(
word,
possibilities,
n=3,
cutoff=0.6,
full=False):
'''Replaces difflib.get_close_matches with faster algortihm based on
Levenshtein.ratio.
HINT: Similarity increase significatively after lower() and uni... |
# -*- coding: utf-8 -*-
# Copyright 2018 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.