text stringlengths 8.04k 46.5k |
|---|
"""
gs_utils are common utlity functions for the app, such as file io.
"""
import json
import re
import io
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
from os.path import join
from os.path import exists, isfile, splitext
from os import listdir
from gs_datadict imp... |
# -*- coding: utf-8 -*-
"""
Postprocessor subroutines
-------------------------
This module contains functions to postprocess results.
"""
import numpy as np
import solidspy.femutil as fe
import solidspy.uelutil as uel
import matplotlib.pyplot as plt
from matplotlib.tri import Triangulation
# Set plotting defaults
g... |
'''
testing array parameters
for each combination of one language calling another:
for each: int, bool, fvector, string, object, scriptstruct:
test array in
test array out
test array ret
test array in, out, ret
NEXT:
- impl bool tests
- impl rest of tests
- review code, submit ... |
# main module with the Slack app
import os
import slack
from flask import Flask, json, request, render_template, session, Response, abort, redirect
import psycopg2
import urllib
import secrets
import requests
import hmac
import hashlib
from datetime import datetime
import pytz
from slack_objects import Blocks, Actions... |
import math
original_attributes = ['petal length', 'petal width', 'sepal width', 'sepal length', 'flower']
examples = [[4.3, 3.0, 1.1, 0.1, 'Iris-setosa'],
[4.8, 3.0, 1.4, 0.1, 'Iris-setosa'],
[4.9, 3.1, 1.5, 0.1, 'Iris-setosa'],
[4.9, 3.1, 1.5, 0.1, 'Iris-setosa'],
[4.9, 3.1, 1.5, 0.1, 'Iris-setosa'],
[5.2, 4.1... |
"""BERT for report generation finetuning."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import datetime
import os
now = datetime.datetime.now()
now = now.strftime("%Y%m%d_%H%M%S")
print("now", now)
import sys
import logging
import glob
import math
import... |
from collections import defaultdict
from django.db import models, transaction
from article.models import ArticleType, OtherCostType, SellableType
from blame.models import Blame, ImmutableBlame
from crm.models import User, Customer
from money.models import MoneyField, PriceField, CostField, AccountingGroup, CurrencyDa... |
# Copyright (c) 2021 Horizon Robotics. 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 applicab... |
import asyncio
import concurrent.futures
import contextlib
import contextvars
import enum
import socket
import ssl
import sys
import threading
import warnings
import weakref
from typing import (
IO,
Any,
Awaitable,
Callable,
Coroutine,
Dict,
Generator,
List,
Optional,
Sequence,
... |
from __future__ import annotations
from collections import defaultdict
from dataclasses import dataclass
from typing import Callable, DefaultDict, Iterable, Mapping, Sequence, Union, cast
from .codeblock import CodeBlock
from .expression import IntLiteral
from .fetch import AfterModeFetcher, Fetcher, ModeFetcher
from... |
from abc import ABC, abstractmethod
from consoleprint import RichText
import copy
import math
# TODO LIST
# TODO add option for displaying labels beneath bars
# TODO add input data checks
def get_tick_indices(tickmode, numticks, coords):
"""
Ticks on the axis are a subset of the axis coordinates
This fun... |
# -*- coding: utf-8 -*-
""" Sahana Eden Data Collection Models
- a front-end UI to manage Assessments which uses the Dynamic Tables
back-end
@copyright: 2014-2017 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of thi... |
# -*- coding: utf-8 -*-
#
# Poio Tools for Linguists
#
# Copyright (C) 2009-2013 Poio Project
# Author: <NAME> <<EMAIL>>
# URL: <http://media.cidles.eu/poio/>
# For license information, see LICENSE.TXT
"""This module contains classes to access to
parse and generate Typecraft files from a
GrAF object.
"""
from __futur... |
from typing import Tuple, List, Optional, Mapping, Any
import pygame
import pygame.locals as pg
import terrain
import mvc
import civ
import image
import sprite
import targeter
import sys
import json
import random
# random.seed(1234)
class Action:
def __init__(self, descr: str, doer: int, target: Optional[Tuple[int, ... |
import os
import time
import multiprocessing as mp
import _pickle as pickle
from tqdm import tqdm
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial.distance import cdist, jensenshannon
# indexation
I_PARENT = 0 # index of the parent in the previous generation
I_GENERATION = 1 # generation at whi... |
import datetime
import logging
import os
import tempfile
import warnings
import numpy as np
from pathlib import Path
from small_text.classifiers.classification import EmbeddingMixin
from small_text.data.datasets import split_data
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
from small_... |
import os
import sys
import random
import cv2
import glob
import numpy as np
import skimage.transform as skt
from . import py
def unpad_sample(img, d):
# crop the image size to multiple of divisor d
(wi, hi) = img.shape[:2]
wo = wi // d * d
ho = hi // d * d
assert wo <= wi and ho <= hi
wl ... |
from __future__ import print_function, division
# noinspection PyPackageRequirements
from Bio.Seq import Seq
import numpy as np
# noinspection PyUnresolvedReferences
from primer3.thermoanalysis import ThermoAnalysis
from copy import deepcopy
import logging
from os.path import join
import os
from . import lib_blast, li... |
# 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... |
#!/usr/bin/env python
"""Utility script for CLI Beeminder usage.
Example usage/API design doc draft:
>>> beeminder
lists existing goals
>>> beeminder --manual
lists only manually updatable goals
>>> beeminder books
updates; asks for values
>>> beeminder books 1
updates; default description
>>> beeminder books 1 "#Pla... |
# Copyright 2014 Nervana Systems Inc., 2016 <NAME> All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
# ========================================================================================
#
# Description:
#
# Compiles Hack ASM (assembly) code to Hack BIN (binary) code
# Does not use the TECS specification
#
# Attribution:
#
# Code by www.jk-quantized.com
#
# Redistribution and use of this code ... |
import torch
import torch.nn as nn
import numpy as np
from models.entransformer import Block, Mlp, Attention
from models.patchembed import PatchEmbed
from models.fuse_layer import FuseLayer
import yaml
import torch.nn.functional as F
from functools import partial
from timm.models.layers import DropPath, to_2tu... |
from numpy.lib.utils import _info
import pygame
import random
import numpy as np
from queue import PriorityQueue
from pygame import surface
from pygame.constants import K_d
from collections import defaultdict
pygame.font.init()
screen = pygame.display.set_mode((900, 810))
# Title and Icon
pygame.display.set_capt... |
from scannerpy import Config
from storehouse import StorageConfig, StorageBackend
from query.base_models import Track, BoundingBox
from django.db import connections, connection
from django.db.models.query import QuerySet
from django.db.models import Min, Max, Count, F, Q, OuterRef, Subquery, Sum, Avg, Func, FloatField,... |
"""
created by <NAME> on Apr 19 2021
purpose:
- tools for fluids in ebysus.py
"""
# import built-ins
import functools
import warnings
import itertools
# import external private modules
try:
from at_tools import fluids as fl
except ImportError:
warnings.warn('failed to import at_tools.fluids; some functions ... |
#!/usr/bin/env python
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import sys
import os
import re
import argparse
import subprocess
import csv
import shutil
from Bio import SeqIO
from natsort import natsorted
import amptk.amptklib as lib
class MyFormatt... |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import signal, fftpack
from matplotlib import gridspec
import pandas as pd
import logging
from pathlib import Path
import os
import torch
from src.data.data_utils import load_train_test_ims, load_train_test_femto
from src.features.build... |
# -*- coding=utf-8 -*-
# Copyright 2015 <NAME>. 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 ... |
import math
import random
import jittor as jt
from jittor import nn, init
from .op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
class PixelNorm(nn.Module):
def __init__(self):
super().__init__()
def execute(self, input):
return input * (1 / jt.sqrt(jt.mean(input ** 2, dim=1, keepdims=... |
#!/usr/bin/env micropython
#
# pySerial adapted for micropython
#
# (C) 2021 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
import uselect as select
import ustruct as struct
import termios
import _libc
import fcntl
import os
# fmt: off
CR = bytes([13])
LF = bytes([10])
TIOCMGET = getattr(termios, "TIOCMGET"... |
import time
import json
import logging
import subprocess
from celery import current_task, shared_task, states
from celery.exceptions import TaskRevokedError, WorkerShutdown, WorkerTerminate
from channels import Group
from django.core.exceptions import ObjectDoesNotExist
from django.utils import timezone
from django.db.... |
import json
import pickle
import torch
import torch.nn as nn
import numpy as np
import matplotlib.pyplot as plt
from time import time
from copy import deepcopy
from torch.utils.tensorboard import SummaryWriter
from architectures import CustomVAE, TransitShapeVAE
from data_preparation.data_processing_utils import min_ma... |
#!/usr/bin/env python
'''
This file is part of the SoftController project
Copyright 2021 Jake "Poikilos" Gustafson
License: MIT License (See <https://github.com/poikilos/SoftController>)
'''
import sys
import inspect
def error(msg):
sys.stderr.write(str(msg)+"\n")
def _keycode_to_str_dummy(keycode):
return... |
import math
import sys
import types
import fdblib
import cli
from fdblib import Print
if sys.version_info < (2, 6):
try:
import simplejson as json
except ImportError:
from django.utils import simplejson as json
else:
import json
class PermissionsError(Exception):
pass
class WisdomFa... |
import datetime
from detect_wrapper import globals
def get_vulns(bd, pv):
vulns = bd.get_json(pv + '/vulnerable-bom-components?limit=5000')
vulnlist = []
nvulns = []
for vuln in vulns['items']:
if vuln['ignored'] or vuln['vulnerabilityWithRemediation']['remediationStatus'] not in \
... |
# -*- coding: utf-8 -*-
#
# 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, soft... |
"""RowDiff: Produce diff-similar results between table extensions of two
FITS files or HDU lists. This can be a command-line module or class in a
script. Written to add this functionality to crds.diff.
"""
import sys
import difflib
from itertools import product
import numpy as np
from astropy.table import Table
from ... |
import logging
import os
import shutil
import tempfile
import uuid
from asyncio import CancelledError
from sanic import Sanic
from typing import Any, Callable, Dict, List, Optional, Text, Tuple, Union
import aiohttp
import rasa
import rasa.utils.io
from rasa.constants import DEFAULT_DOMAIN_PATH, LEGACY_DOCS_BASE_URL
... |
"""This module implements the level one planner of the DSBox system.
"""
#### !!!!
import sys
import operator
sys.path.append('/home/ktyao/dev/dsbox/dsbox-ta2/python')
from dsbox.schema.problem_schema import TaskType, TaskSubType, Metric
from dsbox.schema.dataset_schema import VariableFileType
from dsbox.planner.level... |
# -*- coding: utf-8 -*-
# Copyright 2018-2019 Streamlit 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 applicabl... |
"""The 'ascii' module contains all classes related to the ASCII
protocol.
"""
import serial
import time
import logging
from .exceptions import TimeoutError, UnexpectedReplyError
# See https://docs.python.org/2/howto/logging.html#configuring-logging-
# for-a-library for info on why we have these two lines here.
logge... |
import pkgutil
from datetime import date, datetime, timedelta
from decimal import Decimal
import json
import pytest
from api.config import (
CannotLoadConfiguration,
Configuration,
)
from core.model import ConfigurationSetting
from api.authenticator import PatronData
from api.millenium_patron import MilleniumP... |
'''For logging status, address and data'''
from colorama import init, Fore, Back
init(autoreset=True) #to convert termcolor to wins color
from pathlib import Path
from os import mkdir, listdir, stat, SEEK_END
from os.path import exists, getsize, getmtime, join, isdir, getctime
from datetime import datetime
from time ... |
from couchdbkit.exceptions import ResourceNotFound
from django.test import TestCase, SimpleTestCase
from casexml.apps.case import const
from casexml.apps.case.cleanup import rebuild_case
from casexml.apps.case.exceptions import MissingServerDate
from casexml.apps.case.models import CommCareCase, CommCareCaseAction, _ac... |
"""
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 in writing,
software distribut... |
"""
Copyright (c) 2018 iCyP
Released under the MIT license
https://opensource.org/licenses/mit-license.php
"""
import contextlib
import os
import re
import sys
import tempfile
from collections import OrderedDict
from dataclasses import dataclass, field
from itertools import repeat
from typing import Any, Dict, List, ... |
"""Set up some common test helper things."""
import asyncio
import datetime
import functools
import logging
import socket
import ssl
import threading
from unittest.mock import AsyncMock, MagicMock, Mock, patch
from aiohttp.test_utils import make_mocked_request
import freezegun
import multidict
import pytest
import pyt... |
''' Training Frustum PointNets.
Author: <NAME>
Date: September 2017
'''
from __future__ import print_function
import os
import sys
import argparse
import importlib
import numpy as np
import tensorflow as tf
from datetime import datetime
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(... |
#!/usr/bin/env python3
import sys
import os
import pickle
import numpy as np
import sklearn.model_selection as sk_modsel
from lib import neuralnetwork as nn
from task_tools import load_pickle, save_pickle, print_parameters, \
plot_accuracy_scores, retrieve_2d_ising_data, convert_output, \
nn_core, heatmap_p... |
import ast
import html
import os
import sys
from collections import defaultdict, Counter
from textwrap import dedent
from types import FrameType, CodeType, TracebackType
from typing import (
Iterator, List, Tuple, Optional, NamedTuple,
Any, Iterable, Callable, Union,
Sequence)
from typing import Mapping
im... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Name: noteworthy/translate.py
# Purpose: translates Noteworthy Composer's NWCTXT format
#
# Authors: <NAME>
# <NAME>
#
# Copyright: Copyright © 2011-2012 <NAME> and the music21 P... |
# -*- coding: utf-8 -*-
# Copyright (C) 2013 <NAME>
"""
Defines the tree widget to display the contents of a selected directory.
"""
import os
import sys
import subprocess
import fnmatch
import os.path as op
import pyzo
from pyzo import translate
from . import QtCore, QtGui, QtWidgets
from . import tasks
from .uti... |
import numpy as np
import healpy as hp
class Cut(object):
'''
cut a Healpix map to 12 parts, or to 12*subblocks_nums parts
'''
def __init__(self, maps_in, subblocks_nums=1, nest=False):
'''
:param maps_in: the input healpix maps (one map with the shape of (12*nside**2,) or multiple map... |
# Original work Copyright (c) Facebook, Inc. and its affiliates.
# Modified work Copyright (c) Allen Institute for AI
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Defining the auxiliary loss for actor critic type models.
Several of the l... |
from itertools import chain
import re
import datetime
import django
from django import forms
try:
from django.forms.utils import to_current_timezone
except ImportError:
# Fall back to old module name for Django <= 1.5
from django.forms.util import to_current_timezone
from django.forms.widgets import FILE_I... |
#!/usr/bin/env python3
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2010 California Institute of Technology. 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... |
from .version import __version__
import numpy as np
import erfa
import fluids.atmosphere
from derivation import kinematics, dynamics
earth_spherical_gravity_constant = 14076443110000000/(3.28084**3)
earth_f = 1/298.257223563
earth_J2_constant = 0.00108262982
earth_rotation_rate_deg = 0.004178073
earth_rotation_rate = ... |
# -*- coding: utf-8 -*-
# Tests for module mosaic.mutable_model
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The Mosaic Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file LICENSE.txt, distributed as par... |
# -----------------------------------------------------------------------------
"""
SoC Object
Takes an SVD file, parses it, and re-encodes it as a python object.
It can then be printed a golang structure definition.
"""
# -----------------------------------------------------------------------------
import svd
# -... |
"""
:summary: Base Classes for Autoscale Test Suites (Collections of Test Cases)
"""
from __future__ import print_function
import json
import time
from functools import partial
from unittest import skip
from autoscale_fixtures.behaviors import AutoscaleBehaviors
from autoscale_fixtures.client import (
Autoscalin... |
"""
The lowere lavel layers implementation of the model.
Authors: <NAME>, <NAME>, <NAME>
Inspired by baseline model provided from CS224N Stanford University, <NAME>
"""
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Parameter
# Imported functions below can be refe... |
# -*- coding: utf-8 -*-
from cryptotik.common import (headers, ExchangeWrapper,
NormalizedExchangeWrapper)
from cryptotik.exceptions import (InvalidBaseCurrencyError,
InvalidDelimiterError,
APIError,
... |
import itertools
import sys
from time import time
import numpy as np
from scipy.signal import bspline
import pdb2sql
from deeprank.config import logger
from deeprank.tools import sparse
try:
from tqdm import tqdm
except ImportError:
def tqdm(x):
return x
def logif(string, cond): return logger.info... |
# Copyright 2021 Research Institute of Systems Planning, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
from cereal import car
from collections import namedtuple
from selfdrive.boardd.boardd import can_list_to_can_capnp
from selfdrive.controls.lib.drive_helpers import rate_limit
from common.numpy_fast import clip, interp #2018.09.26 add interp
from selfdrive.car import apply_std_steer_torque_limits #same as Hyundai cha... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# -*- coding: utf-8 -*-
"""Internal module of protocols with abstract base classes.
Applications should not directly import this module, expect to make subclasses.
As a reminder: all internal strings, like identifier, should be
represented in UTF-8. Use pynt.xmlns.UTF8 if you need help converting."""
# builtin modules... |
import numpy as np
from scipy.special import logsumexp
from collections import OrderedDict
from numba import njit
import os, sys
libpath = os.path.abspath('..')
if libpath not in sys.path:
sys.path.append(libpath)
import qubitrbm.utils as utils
from qubitrbm.utils import log1pexp, logaddexp
@njit
def _eval_RBM_... |
#######################################################################
# Copyright (C) #
# 2016 <NAME>(<EMAIL>) #
# 2016 <NAME>(<EMAIL>) #
# Permission given to modify the code as long as you keep this #
# declaration... |
# Script to image and assess the properties of long baseline calibrators.
# Runs in CASA 4.5.0
# Expects to find the *.split.cal measurement set and the .fluxscale file.
# Unless you want to limit spws (i.e. exclude very narrow ones for
# speed) nothing should need to be changed.
# If the analysis fails (usually only ... |
from collections import defaultdict, Counter, OrderedDict
import re
import os,time
from itertools import chain
from operator import itemgetter
import random
import json
# a global variable so we don't have to keep loading from file repeatedly
iso_dict = {}
reverse_iso_dict = {}
class ConllEntry:
def __init__(sel... |
import bpy
from mathutils import *
import json
import math
Epsilon = 0.00001
PositiveInfinity = float('inf')
NegativeInfinity = -PositiveInfinity
CoordinateTransform = Matrix.Rotation(math.pi*-0.5, 3, 'X')
CoordinateTransform4 = Matrix.Rotation(math.pi*-0.5, 4, 'X')
#CoordinateTransform = Matrix.Identity(3)
#Coordina... |
# -*- coding: utf-8 -*-
"""Functions for managing TABLE columns and table column functions, like map and rename, as well as loading and
extracting table data in Cytoscape.
"""
"""Copyright 2020 The Cytoscape Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and ... |
# Copyright 2019 The TensorNetwork Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
"""Create GULP nudged elastic band (NEB) .gin files for all systems in the work directory, relaxing endpoints as necessary.
GULP NEB .gin files are created for each HOST_GUEST_StepSize/GULP/ folder in the work directory. Performance is boosted by bulk-relaxing endpoints on an external PC and importing these into their... |
# Tests for the `str` accessor are derived from the original
# pandas string accessor tests.
# For reference, here is a copy of the pandas copyright notice:
# (c) 2011-2012, Lambda Foundry, Inc. and PyData Development Team
# All rights reserved.
# Copyright (c) 2008-2011 AQR Capital Management, LLC
# All rights rese... |
"""Spatial filtering function."""
import numpy as np
from scipy.linalg import eigh, inv
from sklearn.base import BaseEstimator, TransformerMixin
from .utils.covariance import _check_est, normalize, get_nondiag_weight
from .utils.mean import mean_covariance
from .utils.ajd import ajd_pham
from .utils.mean import _check... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import pathlib
from typing import Callable, Dict, List, Optional, Sequence, Tuple, Type, Union
import gym.wrappers
import... |
# 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... |
# IMPORTS
import logging as lgg
import re
import tkinter as tk
import tkinter.ttk as ttk
from tkinter import messagebox
# LOGGER
from tkinter.filedialog import askdirectory
from tesliper import datawork as dw
from tesliper.glassware import (
ElectronicActivities,
ElectronicData,
ScatteringActivities,
... |
import os
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
from functools import partial
from qtpy.QtWidgets import *
from qtpy.QtCore import Qt, QItemSelectionModel, Signal
from qtpy.QtGui import QStandardItemModel, QStandardItem, QFont
from pyqtgraph.parametertree import ParameterTree, Pa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import requests_mock
import json
import os
import six
import sys
from io import BytesIO
import pymisp as pm
from pymisp import PyMISP
# from pymisp import NewEventError
from pymisp import MISPEvent
from pymisp import MISPEncode
from pymisp.tools import ma... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# pylint: disable=too-few-public-methods,too-many-ancestors
from __future__ import unicode_literals
import re
import os
import itertools
import fnmatch
import sys
import codecs
import docutils
from docutils import nodes, DataError
from docutils.transforms import Transfo... |
"""
Module with functions for dealing with automatic class balacing
.............................................................................
idptools-parrot was developed by the Holehouse lab
Original release ---- 2020
Question/comments/concerns? Raise an issue on github:
https://github.com/idptools/parrot
... |
import pyxel
import math # math.floorを使うので必要
import random
import array2d
import gameobject
import ease
from enum import Enum
def to_absolute(path):
return "/Users/syun/Desktop/tilemap2/" + path
# 状態
class State(Enum):
Standby = 1 # 待機中
Moving = 2 # 移動中
GameClear = 3 # ゲームクリア
MovingEnemy = 4 # 敵... |
# interface to run psi4 from the embedded system.
# modified Psi4 need to be complied from source to read embedding potential
# compiled version can be found in /home/goodpast/shared/Xuelan/psi4.
# change made to psi4/psi4/src/psi4/libscf_solver/hf.cc to read embpot.dat.
# add the following PSI4 executable2 to your ~/.... |
# coding=utf-8
# Copyright 2019 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
#!/usr/bin/python3
# coding=utf-8
import torch
import torch.nn as nn
import torch.nn.functional as F
def weight_init(module):
for n, m in module.named_children():
# print('initialize: ' + n)
if isinstance(m, nn.Conv2d):
nn.init.kaiming_normal_(m.weight, mode='fan_in', nonlinearity='re... |
#!/usr/bin/env python
# coding=utf-8
# Copyright (c) 2017,2018, F5 Networks, 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 ... |
import sounddevice as sd
from scipy.signal import istft
from scipy.signal import stft
import librosa
import librosa.display
import midi
import skimage.transform
import numpy as np
import os
import h5py
import time
import matplotlib.pyplot as plt
import SimpleITK as sitk
import cv2
import wave
import sci... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 17 00:03:14 2016
MIT License
Copyright (c) 2016 <NAME>
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 limita... |
import re
import json
import flask
import hashlib
import jsonschema
from .version_data import VERSION, COMMIT
from indexd import auth
from indexd.errors import AuthError, AuthzError
from indexd.errors import UserError
from .schema import PUT_RECORD_SCHEMA
from .schema import POST_RECORD_SCHEMA
from .schema import RE... |
#!/usr/bin/env python
"""Stitch together two HiRISE channel files to create a single CCD image file.
These are the functionalities that the HiStitch pipeline performs that are
reproduced here:
- Join (or stitch) together two channel products to form a whole CCD product.
The channel 1 product is on the left, chann... |
import collections
import copy
import os
import inspect
import keyword
def is_number(s):
try:
float(s)
return True
except ValueError:
return False
def _check_if_has_indexable_children(item):
if (not hasattr(item, 'children') or
(not isinstance(item.children, Component... |
from flask import Flask, render_template, request, session, url_for#, session
from flask_bootstrap import Bootstrap
from flask_debugtoolbar import DebugToolbarExtension
from make_form1 import make_form1
import RuleSet
import r_funcs
from projection_funcs import variablise, slicify
import pandas as pd
import numpy as ... |
# -*- coding: utf-8 -*-
"""This module defines a class and a function for Gaussian network model
(GNM) calculations."""
import time
from types import FunctionType
import numpy as np
from prody import LOGGER
from prody.atomic import Atomic, AtomGroup
from prody.proteins import parsePDB
from prody.kdtree import KDTree... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@author: <NAME>
'''
#0 1 2 3 4 5 6 7 8 9 10
#012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
#bond 1 1 1 ... |
# %% [markdown]
# ##
import os
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import poisson
from graspy.embed import OmnibusEmbed, selectSVD
from graspy.models import DCSBMEstimator, SBMEstimator
from graspy.utils import (
au... |
# Copyright 2011,2012,2013,2014,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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.