text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/env python3
import sys
import ensembl
rs = ensembl.EnsemblRestServer
def test_GeneTree():
g = rs.getGeneTreeById('ENSGT00390000003602')
print(g.tree.taxonomy.scientific_name)
print(type(g))
print(g.__class__)
#print(g.tree)
print(type(g.tree))
print(type(g.tree.taxonomy))
p... |
'''
--- Day 13: Shuttle Search ---
Your ferry can make it safely to a nearby port, but it won't get much further. When you call to book another ship, you discover that no ships embark from that port to your vacation island. You'll need to get from the port to the nearest airport.
Fortunately, a shuttle bus service is ... |
#!/usr/bin/env python3
# Copyright (c) 2019 Pure Storage, Inc.
#
# *Overview
#
# This short Zabbix external check code shows how to monitor Pure Storage FlashBlade systems.
# The Pure Storage Python REST Client is used to query the FlashBlade occupancy and performcnce indicators.
# A simplistic use of generators is int... |
#!/usr/bin/env python
"""
@package mi.core.instrument.playback
@file mi/core/instrument/playback.py
@author <NAME>
@brief Playback process using ZMQ messaging.
Usage:
playback datalog <module> <refdes> <event_url> <particle_url> [--allowed=<particles>] <files>...
playback ascii <module> <refdes> <event_url> <p... |
from __future__ import print_function
from botocore.exceptions import ClientError
import boto3
import os
import json
import datetime
import uuid
import time
import detect
# Global Variables
channel = '#%s' % os.environ['SLACK_CHANNEL']
token_bot = '%s' % os.environ['SLACK_TOKEN_NAME']
def EC2MaliciousIPCaller(event, ... |
# coding: utf-8
import os
import argparse
import logging
import json
from blockfrost import BlockFrostApi, ApiError, ApiUrls
from pydano.transaction.transaction_config import TransactionConfig
from pydano.transaction.transaction import (
BuildTransaction,
SignTransaction,
SubmitTransaction,
BuildRawTr... |
import pygame
from pygame.locals import *
from typing import Tuple, Optional, List, TypeVar
from math import sqrt, fsum
T = TypeVar('T')
Vector2 = Tuple[T, T]
Vector2f = Vector2[float]
Vector3 = Tuple[T, T, T]
Vector3f = Vector3[float]
LineSegment3 = Tuple[Vector3[T], Vector3[T]]
LineSegment2 = Tuple[Vector2[T], Vec... |
import time
import subprocess
import os
import shutil
import json
import shlex
import sys
try:
import pil
import helpers
import logger
from constants import Constants
except ImportError:
from . import pil
from . import helpers
from . import logger
from .constants import Constants
def ... |
"""日志配置"""
import re
import os
import io
import json
from datetime import datetime
import time
import inspect
from collections import defaultdict
import logging
import smtplib
from email.mime.text import MIMEText
from logging import addLevelName, currentframe
import traceback
import threading
from functools import wrap... |
# The MIT License (MIT)
#
# Copyright (c) 2018 <NAME> for Adafruit Industries LLC
#
# 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 right... |
""" Dataframe optimizations """
import operator
import numpy as np
from dask import config, core
from dask.blockwise import Blockwise, fuse_roots, optimize_blockwise
from dask.highlevelgraph import HighLevelGraph
from dask.optimization import cull, fuse
from dask.utils import ensure_dict
def optimize(dsk, keys, **k... |
import numpy as np
import matplotlib.pyplot as plt
import vtk
from vtk.util import numpy_support
from vtk.util.numpy_support import vtk_to_numpy
import os
from datetime import datetime
dim = 2 # Number of dimensions in the simulation
##################################################################################... |
import numpy as np
import random
from svg.file import SVGFileV2
from svg.basic import clip_float, draw_path, random_color, random_color_hsv
from svg.geo_transformation import translation_pts_xy, reflection_points
from common import gImageOutputPath
# plot function to svg
# from scipy.special import perm,comb
from itert... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import division
import json
import numpy as np
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import Matern
from ...suggestion.models import Study
from ...suggestion.models import Trial
f... |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
import os
import datetime
import traceback
from log_collectors.training_data_service_client import connect as connect
from log_collectors.training_data_service... |
import logging
import os
from typing import Dict, List, Optional
import numpy as np
import scipy.fft as fp
from qcodes.dataset.experiment_container import load_by_id
from qcodes.dataset.measurements import Measurement
from scipy.ndimage import generic_gradient_magnitude, sobel
from skimage.transform import resize
imp... |
import re
import json
from string import ascii_lowercase as chars
from random import choice
import tempfile
from .aleph import Aleph
from .rsd import RSD
from .wordification import Wordification
from .treeliker import TreeLiker
from .security import check_input
from .proper import Proper
from .tertius import Tertius, ... |
__description__ = \
"""
Mapping Object for epistatic interactions int the epistasis map.
"""
__author__ = "<NAME>"
import gpmap
import pandas as pd
import itertools as it
def encoding_to_sites(order, encoding_table, start_order=0):
"""
Build interaction sites up to the specified order given a gpmap
enco... |
import numpy as np
from sklearn.ensemble.forest import ForestClassifier
from sklearn.tree.tree import ExtraTreeClassifier
from randomrotation import random_rotation_matrix
from sklearn.ensemble.base import _partition_estimators
from sklearn.externals.joblib import Parallel, delayed
from scipy.stats.mstats_basic import... |
import math
from typing import *
from ..backend import *
from ..backend.nn import *
from ..backend.random import *
__all__ = [
'LOG_ZERO_VALUE',
# normal and its variants
'truncated_randn', 'truncated_randn_log_pdf',
'truncated_normal', 'truncated_normal_log_pdf',
# discretized logistic
'dis... |
"""
Script to split a dataset in train+test IDs sets.
"""
# Authors: <NAME> <<EMAIL>> <NAME> <<EMAIL>>
import argparse
import os
import math
import errno
import pandas as pd
import geopandas as gpd
from geopandas import GeoDataFrame
from shapely.geometry import Point
import sys
sys.path.append("../GeoL")
from sklear... |
# -*- coding: utf8 -*
from win32gui import (GetForegroundWindow,
SetForegroundWindow,
ShowWindow,
GetWindowRect,
GetWindowText,
EnumWindows,
SetWindowPos,
Get... |
from discord.ext import commands
from collections import Counter
from .utils import checks
import logging
import discord
import datetime
import traceback
import psutil
import os
log = logging.getLogger()
LOGGING_CHANNEL = '309632009427222529'
class Stats:
"""Bot usage statistics."""
def __init__(self, bot... |
##############################################################################
# Copyright 2016-2019 Rigetti Computing
#
# 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... |
import os
import os.path
import shutil
import fnmatch
from .utils import realpath_expanduser, is_link_to
from .compat import symlink
class Dotfile(object):
def __init__(self, name, target, home, add_dot=True, dry_run=False):
if name.startswith('/'):
self.name = name
else:
... |
#!/usr/bin/env python3
import sys
import os
import argparse
import io
from lib.prioritize import gene_prioritization
from lib.output import write_list as write_list_tsv
from lib.json_format import write_list as write_list_json
from lib.weight_assignment import assign
from lib.calculation import calc, calc_simple
def... |
# -*- coding: utf-8 -*-
# from Programs import program as pr
import csv
import re
# import os
import sys
# yazma-okuma işlemleri için parametreler
csv.register_dialect("myDialect", delimiter='|', quoting=csv.QUOTE_NONE, skipinitialspace=True)
def tr_title(paramWord: str) -> str:
"""türkçe harfler için title fonksi... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import copy
from tkinter import filedialog
import matplotlib.pyplot as plt
from matplotlib.widgets import Button, RectangleSelector
from algorithms.tests import perftest
from common import myformat
from settings import Points
from widgets.periodbox import PeriodBox
from operator import itemgetter
# TODO:
# point fi... |
'''
Main preferences dialog.
'''
from __future__ import with_statement
import wx
import metrics
from gui.textutil import default_font
from gui.toolbox import build_button_sizer, snap_pref, persist_window_pos, AutoDC, calllimit
from gui.validators import LengthLimit
from gui.pref.prefstrings import all as a... |
import base64
import json
from typing import Dict, List
import anchore_engine
from anchore_engine import db, utils
from anchore_engine.apis.exceptions import BadRequest, ResourceNotFound
from anchore_engine.common import image_content_types
from anchore_engine.common.helpers import make_anchore_exception
from anchore_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
IRR Monte Carlo Framework
"""
import numpy as np
from matplotlib import pyplot as plt
import random as rd
import pandas as pd
#Fund Class - with attributes initialCapital, portfolio and value
class Fund:
def __init__(self, Capital, Portfolio):
self.i... |
from django.contrib.auth.models import AbstractUser, UserManager
from django.db import models
# Create your views here.
class UserProfile(AbstractUser):
objects = UserManager()
class Meta(AbstractUser.Meta):
swappable = 'AUTH_USER_MODEL'
# 重载为了打印自定义的字符串
def __unicode__(self):
return ... |
import tensorflow as tf
from keras.layers import Dense, Flatten, Lambda, Activation, MaxPooling2D
from keras.layers.convolutional import Convolution2D
from keras.models import Sequential
from keras.optimizers import Adam
import os, sys
import errno
import json
import cv2
import matplotlib.pyplot as plt
import numpy a... |
# pyre-strict
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import os
import shlex
import shutil
import sys
import tempfile
from typing import Iterable, List, Mapping, NamedTuple, Optional, TextIO, TypeVar, Union
import common_tests
from hh_paths import hh_client, hh_... |
# antioch
# Copyright (c) 1999-2019 <NAME>
#
#
# See LICENSE for details
from django.core import validators
from django.db import models
class URLField(models.CharField):
default_validators = [validators.URLValidator(schemes=['https'])]
class Object(models.Model):
class Meta:
db_table = 'object'
... |
from django.db import models
#/from address.models import AddressField
from .my_fields import DayOfTheWeekField
from ..membership.models import CoopMember
from django.utils.translation import ugettext_lazy as _
from .managers import BasketSubscriptionManager
from django.utils.translation import ugettext as __
from date... |
import numpy as np
import numba
@numba.njit('double(double[:])') # this is the workaround for 0.12.2
def lse_numba(a):
result = 0.0
largest_in_a = 0.0
for i in range(a.shape[0]): # numba is slow when using max or np.max, so re-implementing
if (a[i] > largest_in_a):
largest_in_a = a[i]
... |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException, ElementNotVisibleException
import time
import os
from urllib.parse import quote_plus
driver = webdriver.Chrome() # Needs to ... |
# -*- test-case-name: twisted.test.test_web -*-
# Copyright (c) 2004 Divmod.
# See LICENSE for details.
"""I deal with static resources.
"""
# System Imports
import os, string, time
import io
import traceback
import warnings
from io import StringIO
from zope.interface import implementer
try:
from twisted.web.res... |
# -*- coding: utf-8 -*-
import sys
if sys.version_info <= (2, 8):
from builtins import super
import os
import codecs
from collections import defaultdict
import numpy as np
import scipy as sp
import pandas as pd
import networkx as nx
__all__ = ["FrozenClass",
"Singleton",
"to_networkx_digra... |
import numpy as np
from pyrecon import RealMesh, ComplexMesh, MeshInfo, utils
def test_info():
info = MeshInfo(boxsize=1000.,boxcenter=0.,nmesh=64)
assert np.all(info.boxsize == 1000)
info.boxsize = 2000.
assert np.all(info.boxsize == 2000)
def sample_cic(mesh, positions, weights=1.):
index = p... |
#!/usr/bin/env python
import sys
import numpy as np
import argparse
Res31 = {'ALA': 'A', 'CYS': 'C', 'ASP': 'D', 'GLU': 'E', 'PHE': 'F',
'GLY': 'G', 'HIS': 'H', 'ILE': 'I', 'LYS': 'K', 'LEU': 'L',
'MET': 'M', 'ASN': 'N', 'PRO': 'P', 'GLN': 'Q', 'ARG': 'R',
'SER': 'S', 'THR': 'T', 'VAL': 'V',... |
import numpy as np
import pickle
import pandas as pd
from environments.interface import InterfaceEnvironment
# Necessary Data
with open("..//data//fertility.pkl", "rb") as f:
fertility_data = pickle.load(f)
with open("..//data//men_wage_path.pkl", "rb") as f:
men_wage_path_data = pickle.load(f)
with open(".... |
# This python3 click subcommand creates the individual podman images
import click
import importlib.resources
import jinja2
import logging
import os
import random
import stat
import string
import sys
import time
import yaml
from cpb.utils import *
defaultCekitImageDescriptions = {
'defaults' : {
'versi... |
""" ************************************************
* fileName: hooks.py
* desc: The hooks of Trainer
* author: mingdeng_cao
* last revised: None
************************************************ """
import os
import time
import torch
import torch.distributed as dist
from ..utils.logger import LogBuffer
from torchv... |
import logging
import requests
import json
import os
from access.search.solrclient import SolrClient
from access.search.solrquery import SolrQuery
from access.search.solrserver import SolrServer
from config.configuration import verify_certificate, solr_protocol
logger = logging.getLogger(__name__)
def index_reposito... |
from typing import Callable, Tuple
import numpy as np
import os
import os.path
def save_file(name: str, start_addr: int, data: bytes):
illegal = '/?<>\\:*|^"\''
file_data = bytearray(2 + len(data))
file_data[:2] = start_addr.to_bytes(2, 'little')
file_data[2:] = data
file_name = "".join(
[... |
# Licensed under an MIT open source license - see LICENSE
import numpy as np
import numpy.testing as npt
import astropy.units as u
from copy import deepcopy
import warnings
from .. import fil_finder_2D, FilFinder2D
from ._testing_data import *
def test_with_rht_branches():
test1 = fil_finder_2D(img, header=hd... |
#
# Copyright 2014-2015 eNovance
#
# 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 writ... |
"""
Logstash Blueprint
==================
**Fabric environment:**
.. code-block:: yaml
blueprints:
- blues.logstash
settings:
logstash: # TODO
"""
import json
import os.path
from functools import partial
from fabric.context_managers import cd
from fabric.contrib import files
from fabric.decor... |
# 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 appli... |
# -*- coding: utf-8 -*-
# @Author: <NAME> <valle>
# @Date: 09-Jul-2017
# @Email: <EMAIL>
# @Last modified by: valle
# @Last modified time: 26-Feb-2018
# @License: Apache license vesion 2.0
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.behaviors import ButtonBehavior
from kivy.... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import os
import pandas
import numpy as np
import matplotlib.pyplot as plt
os.chdir('E:/Code/FSB/score/')
#os.chdir('E:/Code/FSB/score/10-100k/1000-0.1')
#os.chdir('E:/Code/FSB/score/10,15,1-100k/1000-0.1')
USE_HEADER=True;
def drawOne(... |
"""
Parser and evaluator for FormulaResponse and NumericalResponse
Uses pyparsing to parse. Main function as of now is evaluator().
This version handles matrices, via numpy
"""
import math
import operator
import numbers
import numpy
import scipy.constants
from calc import functions
from pyparsing import (
Word,... |
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import ValidationError, NotFound
from framework.auth.oauth_scopes import CoreScopes
from website.project.model import Q, Node
from api.base import permissions as base_permissions
from api.base.views import JSONAPIBaseVie... |
# Copyright 2020 BULL SAS All rights reserved
"""This module contains different regression models to use with the surrogate
modeling heuristics.
For now, the following module is available:
- Decision tree regressors
- Censored data bayesian optimization
"""
from sklearn.tree import DecisionTreeRegressor
from ... |
# Copyright 2018-2019 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... |
import copy
import logging
import numpy as np
from pymatgen.io.vasp import Chgcar, VolumetricData, Elfcar
from cams.propressing.data_rotate import rotation_axis_by_angle, rote_index
from cams.propressing.spilt_tri import relative_location, spilt_tri_prism_z
try:
# import matplotlib
# matplotlib.use('Agg')
... |
# coding=utf-8
# Copyright 2021 The init2winit 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 la... |
# coding: utf-8
import os
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0,parentdir)
import json
from example.config import CONFIG
from fbmq import Attachment, Template, QuickReply, NotificationType
from example.fbpage import page
import random
USER_SEQ = {}
@page.handl... |
from itertools import product
import numpy as np
import torch
import pytest
import xitorch as xt
from dqc.api.loadbasis import loadbasis
from dqc.qccalc.hf import HF
from dqc.system.mol import Mol
from dqc.system.sol import Sol
from dqc.utils.safeops import safepow, safenorm
from dqc.utils.datastruct import ValGrad
# ... |
import math
import shutil
import time
from pathlib import Path
from gzip import GzipFile
import urllib3
from scipy.spatial.distance import cdist
from scipy.stats import mode
import numpy as np
import pandas as pd
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt
from pyflann import *
# This ... |
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Discovery id
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# -------------------------------------------------------------------... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
## Import Python libraries
import re
import logging
## Import Salt libraries
import salt.exceptions
import salt.log
log = logging.getLogger(__name__)
def __virtual__():
'''
This works only on Windows Vista/Windows Server 2008 and newer.
'''
... |
import os
import shutil
from golem.core import file_manager, settings_manager
from golem.core import test_data as test_data_module
from golem.core.project import Project, validate_project_element_name, BaseProjectElement
from golem.core import test_parser
def create_test(project_name, test_name):
test_content = ... |
import inspect
from pathlib import Path
from typing import Any, List
import numpy as np
import torch
import torch.utils.data
from scipy.io.wavfile import read
from torch.utils.data import DataLoader
from tacotron2.audio_preprocessors._audio_preprocessor import AudioPreprocessor
from tacotron2.factory import Factory
f... |
"""
Tests for deepreg/model/loss/image.py in
pytest style.
Notes: The format of inputs to the function dissimilarity_fn
in image.py should be better converted into tf tensor type beforehand.
"""
from test.unit.util import is_equal_tf
from typing import Tuple
import numpy as np
import pytest
import tensorflow as tf
i... |
from time import time
import numpy as np
from pandas import DataFrame, Series
from scipy.stats import truncnorm
from .constants import RAD2DEG, YEAR2DAY, FLUX_SCALE
import matplotlib.pyplot as plt
import logging
spot_contrast = 0.75
n_bins = 5 # number of area bins
delta_lnA = 0.5 # bin width in log-area
max_area ... |
import json
import cv2
import numpy as np
import pywt
import uuid
import pickle
from shutil import copyfile
from os.path import isfile
from image_utils import (
img_normalize,
img_denormalize,
generate_paths,
getDiffImgs,
soften,
img_soften,
do_compress,
encoding,
get_summary,
)
de... |
# Simulates a fixed amount of d2d pairs many times and calculates
# their spectral efficiencies. In the first scenario, the d2d
# powers are chosen randomly. In the second scenario, the d2d powers
# are always the same, just like what the AIs have been doing.
import sys_simulator.general as gen
import os
from sys_simul... |
from parser import DFG_python
from parser import (remove_comments_and_docstrings,
tree_to_token_index,
index_to_code_token,
tree_to_variable_index)
from tree_sitter import Language, Parser
from transformers import RobertaTokenizer
from config import *
import os
i... |
"""
@file
@brief Compute the performance for the hackathon 2018.
"""
import os
import time
import pandas
import numpy
from PIL import Image
from lightmlrestapi.mlapp.mlstorage import MLStorage
try:
from ..hackathon.image_helper import enumerate_image_class
except (ImportError, ValueError):
from ensae_projects.h... |
#-*- coding:utf-8 -*-
import wx
from wx.lib import buttons
class PaintWindow(wx.Window):
def __init__(self, parent, ID):
wx.Window.__init__(self, parent, ID)
self.SetBackgroundColour('#FFF')
self.color = '#000'
self.thickness = 1
# 创建 pen 对象
self.pen = wx.Pen(self... |
import io
import xml.etree.ElementTree as ET
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import streamlit as st
from PIL import Image
from streamlit_drawable_canvas import st_canvas
from Utilities import get_unit, read_trajectory
st.set_page_config(
layout="wide",
initial_sidebar_st... |
from collections import OrderedDict
from functools import partial
import json
from pathlib import Path
from shutil import copy
import csv
from scipy.io import savemat
import numpy as np
from menpo.base import LazyList
import menpo.io as mio
from menpo.io.output.base import _validate_filepath
import menpo3d.io as m3io... |
from collections import Counter
import math
import random
import numpy as np
import pandas as pd
import nltk
import pprint
## loading the data
with open('../assets/en_US_twitter.txt', 'r') as f:
data = f.read().lower()
# tokenizing the entire corpus and storing frequency of each word
tokenizer = nltk.RegexpTokeni... |
import logging
import os
import random
from collections import OrderedDict
from itertools import chain
from typing import Callable, Dict, List, Tuple
import torch
import torch.nn as nn
from sklearn.metrics import accuracy_score
from rationale_benchmark.utils import Annotation
from rationale_benchmark.models.pipeli... |
import pytest
import numpy as np
import pandas as pd
from systrade.models.base import BaseParameterizedObject
from systrade.models.base import BaseIndicator
from systrade.models.base import BaseSignal
from systrade.models.base import BaseStrategy
from systrade.models.filters import TickerOneToAnotherFilter
#-------... |
import datetime
import matplotlib.pyplot as plt
import json
import pandas as pd
def ts_info(timeseries):
# 注意传入的是以时间为index的 Parse_data格式的参数
# 屏幕打印出时间序列的长度,起点,终点,步长
ts_size =timeseries.size
ts_start=timeseries.index[0]
if ts_size == 1:
ts_end = ts_start
else:
ts_end =timeseries.... |
# Copyright 2017 Yahoo Inc.
# Licensed under the terms of the Apache 2.0 license.
# Please see LICENSE file in the project root for terms.
"""A collection of utility functions for loading/saving TensorFlow TFRecords files as Spark DataFrames."""
from __future__ import absolute_import
from __future__ import division
fr... |
import sys
import melee
import torch
import gym
import time
import numpy as np
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
import matplotlib.pyplot as plt
import pandas as pd
from models.ActorCriticPolicy import ActorCriticPolicy
from envs.datase... |
########################################################################################
# Copyright 2019-2021 <NAME> #
# #
# Licensed under the Apache License, Version 2.0 (the "License"... |
import shutil
import os
import tempfile
import sys
from functools import wraps
from typing import Union, List
import json
import time
from .consolecapture import ConsoleCapture
from .run_function_in_container import run_function_in_container
def function(name, version):
def wrap(f):
def execute(_force_run... |
from data import *
from utils.augmentations import SSDAugmentation
from layers.modules import RefineDetMultiBoxLoss
from layers.modules import RefineDetFocalLoss
from models.refinedet import build_refinedet
import os
import sys
import time
import torch
import torch.nn as nn
import torch.optim as optim
import torch.back... |
# -*- coding: utf-8 -*-
import sys
if './' not in sys.path: sys.path.append('./')
from root.config.main import *
from objects.CSCG._2d.exact_solutions.main import ExactSolution
from importlib import import_module
from screws.freeze.main import FrozenOnly
from objects.CSCG._2d.mesh.domain.inputs.allocator import DomainI... |
# 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.
import logging
import sys
from abc import ABCMeta, abstractmethod
from datetime import datetime, timedelta
from enum import Enum
from typing i... |
import random
import torch.nn as nn
import torch.optim as optim
import torch.utils.data
import torchvision.datasets as torch_dataset
import torchvision.transforms as transforms
import gc
import os
device = torch.device("cuda:0" if (torch.cuda.is_available()) else "cpu")
seed = 1
random.seed(seed)
torch.manual_seed(seed... |
import contextlib
import datetime
import io
import json
import logging
import numpy as np
import os
import pycocotools.mask as mask_util
from fvcore.common.file_io import PathManager, file_lock
from fvcore.common.timer import Timer
from PIL import Image
from detectron2.structures import Boxes, BoxMode, PolygonMasks
f... |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... |
# ============LICENSE_START====================================================
# org.onap.dcaegen2
# =============================================================================
# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
# Copyright (c) 2020 Pantheon.tech. All rights reserved.
# ======... |
"""Script for testing reference files
Usage:
test_ref_file <ref_file> <db_path> [--data=<fname>] [--max_matches=<match>] [--num_cpu=<n>] [--email=<addr>]
Arguments:
<db_path> Absolute path to database.
<file_path> Absolute path to fits file to add.
Options:
-h --help Show this scre... |
from dateutil import tz
import json
import requests
from django.views.generic import DetailView, ListView, View
from django_datatables_view.base_datatable_view import BaseDatatableView
from django.db.models import CharField, F
from django.db.models.functions import Concat
from django.contrib import messages
from djang... |
# Copyright (C) 2021 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Copyright (C) 2016-2017 Stratosphere Lab
# This file is part of ManaTI Project - https://stratosphereips.org
# See the file 'LICENSE' for copying permission.
# Created by <NAME> <<EMAIL>> on 12/3/17.
import re
from datetime import datetime
import dateutil.parser
import pythonwhois
import numpy as np
import pickle
im... |
#from builtins import range
from collections import namedtuple
from datetime import datetime
import csv
import math
import time
import tensorflow.python.platform
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_integer('batch_size', 128,
"""Batch size.""")
tf.app.fla... |
import torch.nn as nn
import torch
from collections import namedtuple
NeuronState = namedtuple('NeuronState', ['U', 'I', 'S', 'D', 'C'])
class LIFDensePopulation(nn.Module):
"""
__author__ = <NAME>
__email__ = <EMAIL>
This class implements a STDP-based Single Spiking Neuron
The i... |
import logging
import threading
import os
from rest_framework.views import APIView
from rest_framework.response import Response
import json
import pika
import time
from channels.layers import get_channel_layer
from asgiref.sync import async_to_sync
from EOSS.data.problem_specific import assignation_problems, partiti... |
# Copyright (c) 2016-2017 The Switch Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0, which is in the LICENSE file.
"""
This module defines storage technologies. It builds on top of generic
generators, adding components for deciding how much energy to build into
storage, when to charge, ... |
from __future__ import annotations
import datetime
from abc import abstractmethod
from enum import Enum
from typing import List, Dict, Optional, Union, TypeVar, Generic, TYPE_CHECKING
from ravendb.tools.utils import Utils
if TYPE_CHECKING:
from ravendb.documents.session.tokens.query_tokens.definitions import Decl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.