text stringlengths 6.04k 39.5k |
|---|
# -*- coding: utf-8 -*-
from __future__ import print_function
# Standard Library Imports
from xml.etree import ElementTree as ETree
from collections import Mapping, OrderedDict
from codecs import open as _open
from xml.dom import minidom
import warnings
import logging
import zipfile
import shutil
import time
import sy... |
'''
Copyright (C) 2014 <NAME>
This project uses an MIT style license - see LICENSE for details.
A Chip 8 assembler - see the README.md file for details.
'''
# I M P O R T S ###############################################################
import argparse
import re
import sys
# C O N S T A N T S #######################... |
import torch.utils.data as data
import torch
import torchvision.transforms as transforms
import numpy as np
from PIL import Image
import skimage
import operator
import os
from os import listdir
from os.path import isfile, join
from torch.utils.data import Dataset, DataLoader
import re
import random
from torchvision.tr... |
# 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, ... |
"""
.. module:: CPGen
:platform: Unix, Windows
:synopsis: A simple control points grid generator for B-Spline and NURBS surfaces
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import math
import random
import warnings
class Grid(object):
""" Simple grid generator to use with B-Spline surfaces.
This class ... |
import logging
import re
from collections import Counter, defaultdict
from enum import Enum
from itertools import starmap, repeat, takewhile
from typing import TextIO, Dict, Optional, NamedTuple, List, Union
import click
from cyvcf2 import VCF, Variant
Indices = List[int]
LINEAGE_DELIM = "."
LINEAGE_REGEX = re.compil... |
from scipy.sparse import issparse, isspmatrix
import numpy as np
import pandas as pd
from multiprocessing.dummy import Pool as ThreadPool
import itertools
from tqdm import tqdm
from anndata import AnnData
from typing import Union
from .utils import normalize_data, TF_link_gene_chip
from ..tools.utils import flatten, e... |
import random
from PIL import Image
import glob
import numpy as np
import scipy as sp
import scipy.stats
import pandas as pd
import os
import csv
import time
from sklearn.utils import shuffle
from sklearn import preprocessing
from sklearn.metrics import roc_auc_score, f1_score
from multiprocessing import Pool, Pipe
... |
import argparse
import json
import os, os.path as osp
import sys
from pathlib import Path
import numpy as np
import torch
from tqdm import tqdm
FILE = Path(__file__).absolute()
sys.path.append(FILE.parents[0].as_posix()) # add kapao/ to path
from models.experimental import attempt_load
from utils.datasets import cr... |
import json
import re
from dataclasses import dataclass
import logging
from .const import MAP
from .special_devices import SPECIAL_DEVICES
_LOGGER = logging.getLogger(__name__)
@dataclass
class Property:
siid :int
piid :int
type_ :str
description :str
format_ :bool
acce... |
import warnings
import dask.array as dsa
import numpy as np
import xarray as xr
import xarrayutils as xru
from xarrayutils.utils import linear_trend
from cmip6_preprocessing.postprocessing import _match_datasets, exact_attrs
from cmip6_preprocessing.utils import cmip6_dataset_id
def _maybe_unpack_date(date):
"... |
import requests
import json
from github import Github
from git import Repo
import sys
import os
import datetime
headers = {"Accept": "application/vnd.github.v3+json"}
get_requests_success = True # Is set to false if any API call gets a return code other than 200
# Returns a bool indicating if there was at least o... |
# -*- coding: utf-8 -*-
"""
Classifying Names with a Character-Level RNN
*********************************************
**Author**: `<NAME> <https://github.com/spro/practical-pytorch>`_
We will be building and training a basic character-level RNN to classify
words. A character-level RNN reads words as a series of chara... |
import os
import zipfile as zf
from cryptography.fernet import Fernet as fn
import random
import string
import json
import time
import copy
import shutil
error = 0
def versionControl(version = "0.0.2", source="Restore Backup", software="Project Ultra Backup", author="Anjal.P"):
ver = version
sour = source
... |
import pandas as pd
class ReducedDf(object):
"""Dataframe with single-value columns stored separately
"""
def __init__(self, df):
self.nulls = []
self.zeros = []
self.constants = {}
multi_value = []
for col in df:
vals = df[col].unique()
if le... |
# MP3 Editor v.2 (20/08/2019)
import wx
import subprocess as sp
import os
import os.path
import sys
import re
version = 'Aug 20, 2019'
class MainFrame(wx.Frame):
''' Main window'''
def __init__(self):
# Initialize main window,
# disable window resizing with proper style
... |
#!/usr/bin/env python3
import os
import json
import tempfile
import subprocess
import shutil
import sys
import time
import calendar
import sqlite3
import argparse
import functools
import feedparser
import datetime
import xml.etree.ElementTree as ET
import urllib.error
import cgi
import cgitb
cgitb.enable()
def do_de... |
#! /usr/bin/env python3
"""
CLI (command line interface) management tools and utilities
normalize / automate cli (command line interface) argument's (option / flag) menu
create / remove options and option groups
create standart default options and actions for
help
if any argument is not valid ... |
"""Test companion/flux ratio codes with Baraffe tables."""
import sys
import numpy as np
import pytest
from astropy.constants import M_jup, M_sun
from baraffe_tables.mass_to_flux_ratio import (
_parser as mass_parser,
main as mass_main,
)
from baraffe_tables.calculations import calculate_companion_magnitude, ... |
# DataFrmae
import numpy as np
from ts_analysis.utilities import aux
import warnings
def union(identifier_1, identifier_2):
return np.array(list(set(identifier_1) | set(identifier_2)))
def intersection(identifier_1, identifier_2):
return np.array(list(set(identifier_1) & set(identifier_2)))
def exclude(identifier... |
"""
The :mod:`tslearn.utils` module includes various utilities.
"""
import numpy
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils import column_or_1d
from sklearn.utils.validation import check_is_fitted
import warnings
__author__ = '<NAME> <EMAIL>.<EMAIL>[at]univ-<EMAIL>.fr'
def check_dim... |
# coding=utf-8
import matplotlib.pyplot as plt
import numpy as np
import pytest
from pythonpic.classes import PeriodicTestGrid, NonperiodicTestGrid
from pythonpic.classes import TestSpecies as Species
from pythonpic.configs.run_laser import initial, npic
from pythonpic.helper_functions.physics import electric_charge, ... |
from typing import Tuple
import dataclasses
import datetime
import math
from copy import copy
import numpy as np
import pyqtgraph as pg
from PyQt5.QtWidgets import QTabWidget
from autodidaqt.panel import Panel
from autodidaqt.ui import (
CollectUI,
bind_dataclass,
button,
combo_box,
group,
ho... |
import sys
import numpy as np
import torch
import torch.cuda
import argparse
import os
from modules import *
from dataPrepare import GraphDataset, MyData
from settings import *
from logger import Logger
import pandas as pd
import time
from torch_geometric.data import DataLoader, Data
from utils import *
import ipdb
imp... |
import numpy as np
import os
import natsort # Sorting package
import astropy.wcs
import astropy.time
import datetime
import sunpy.map
from sunpy.net import Fido, attrs
def parse_folder(dir_path=None, inst=None, wave=None, ext=None,
series=None, repo='JSOC', show=True):
"""
Search all the fil... |
import getpass
import requests
import json
from os import system, name
from datetime import datetime
import wget
indent = 3
def clear():
if name == 'nt':
system('cls')
else:
system('clear')
class short:
id = {}
def promt():
promt = input("> ")
if promt == "exit":
exit... |
#!/usr/bin/python
# 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 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
import io
import os
import sys
from shutil import rmtree
import textwrap
from setuptools import find_packages, setup, Command, Extension
from setuptools.command.build_ext import bui... |
# -*- coding: utf-8 -*-
import time
from project.zone_model_1.CALCS.FurnaceModel import *
from project.zone_model_1.CTS.CTS import write_list_to_csv as write_data
from project.zone_model_1.CTS.CTS import PlotScatter2D
from project.zone_model_1.CTS.CTS import list_all_files_with_suffix
import re
import os
import multipr... |
import os
import sys
import re
import six
import time
import math
import random
from natsort import natsorted
import PIL
import lmdb
import numpy as np
import torch
from torch.utils.data import Dataset, ConcatDataset, Subset
from torch._utils import _accumulate
import torchvision.transforms as transforms
class Batch... |
import pathlib
import numpy as np
import pandas as pd
from sklearn.preprocessing import OneHotEncoder
from stellargraph.layer import DeepGraphCNN
from stellargraph.mapper import PaddedGraphGenerator
from stellargraph import StellarGraph
from tensorflow.keras import Model
from tensorflow.keras.optimizers import Adam
fr... |
# -*- coding: utf-8 -*-
"""
SQLite backend with no precomputation.
A quick version where the judge results are not precomputed.
Only table created:
{vocabname}_words_approx : contains all words
"""
import os
import sys
import math
import random
import sqlite3
from contextlib import contextmanager
from logging... |
# Copyright 2013 Cisco Systems, 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 writin... |
"""Eval for GCR."""
import time
import numpy as np
import torch
import utils.cmc as cmc
from scipy.spatial import distance
# pylint: disable=invalid-name, too-many-locals, line-too-long
def mergesetfeat4(_cfg, X, labels):
"""Run GCR for one iteration."""
FIRST_MERGE = True
start_time = time.time()
l... |
import re
import string
import csv
import numpy as np
import matplotlib.pyplot as plt
from collections import Counter
from collections import defaultdict as ddict
from embeddings.twitter.word2vecReader import Word2Vec
from itertools import groupby
from keras import backend as K
from keras.preprocessing.text import Tok... |
import json
from typing import Any
import pytest
import responses
from requests import PreparedRequest
import prefect
from prefect.exceptions import PrefectException
from prefect.tasks.databricks import (
DatabricksRunNow,
DatabricksSubmitMultitaskRun,
DatabricksSubmitRun,
)
from prefect.tasks.databricks.... |
# Copyright 2018 <NAME>
#
# Licensed under the modified BSD (3-clause BSD) License.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for... |
# Copyright 2020, by the California Institute of Technology.
# ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged.
# Any commercial use must be negotiated with the Office of Technology Transfer at the California Institute of Technology.
# This software may be subject to U.S. export control laws.
# B... |
"""Common Utils."""
import ast
import hashlib
import io
import logging
import ntpath
import os
import platform
import re
import shutil
import signal
import string
import subprocess
import stat
import sqlite3
import unicodedata
import threading
from distutils.version import StrictVersion
import distro
import psutil
i... |
from axis_fifo import AXIS_FIFO
from devices import fifo_devices
from axi_gpio import AXI_GPIO
from devices import gpio_devices
# from dac81416 import DAC81416
import struct
import soft_trigger
import reset_all
from getSeqGPIOWords import getSeqGPIOWords
from time import sleep
class DAC81416:
"""Class to control ... |
import tensorflow as tf
import numpy as np
def glorot(d1,d2):
return np.sqrt(6./(d1+d2))
class GRU(object):
def __init__(self, idim, odim, layername, reverse=False, reuse=False):
def _gate_params(insize, outsize, name):
gate = {}
gate["W"] = tf.get_variable(
"W"... |
"""
"""
#| - Import Modules
import os
import sys
import numpy as np
# #########################################################
from catkit.gen.utils.connectivity import (
get_cutoff_neighbors,
get_voronoi_neighbors,
)
# #########################################################
from methods import get_d... |
#!/usr/bin/env python
import socket, sys, requests, urllib.request, urllib.error, json, time, _strptime, threading, getopt, subprocess, logging.config
from bottle import route, run,template, static_file, request, response
import dataCollector, scheduler
from tools import helper
b_host = "0.0.0.0"
b_port = 4382
e... |
import argparse
import json
import os
import shutil
import sys
from os import path as osp
import h5py
import numpy as np
import pandas
sys.path.append(osp.join(osp.dirname(osp.abspath(__file__)), '..'))
from preprocessing.gen_dataset_v2 import compute_output_time, process_data_source
'''
HDF5 data format
* data.hdf5... |
# coding:utf8
'''
@File : dex_header.py
@Author : Loopher
@Version : 1.0
@License : (C)Copyright 2020-2021,Loopher
@Desc : DexFileHeader
'''
import io
import hashlib
import binascii
import sys
import re
from struct import unpack, calcsize
from androyara.utils.utility import echo
from androyara.dex.d... |
import numpy as np
import math
import paddle
from paddle import fluid
from paddle.fluid import layers as F
from paddle.fluid import initializer as I
from paddle.fluid import dygraph as dg
from .conv import Conv1D
from .weight_norm_hook import weight_norm, remove_weight_norm
def positional_encoding(tensor, start_index... |
#!/usr/bin/env python
"""Generate AMBA AHB specifications for given number of masters.
Translated and adapted from Perl original distributed with Anzu.
https://www.iaik.tugraz.at/content/research/opensource/anzu/#download
"""
import argparse
import math
from omega.logic.syntax import conj
def build_state_str(sta... |
'''
sample
python3 classify.py -classifier lr -train_file data/corpus/trainTT -test_file data/corpus/testTT -v
'''
import os, sys
import numpy as np
import nlpnet
from random import shuffle as shuffle_list
#pra rodar no pycharm
#from sentiment_analysis.classify.utils import vectorize
#from sentiment_analysis.class... |
"""
Author: <NAME>
Date: 12/09/2021
Functionality:
1. An object-wrapped lispress parser for SMCalFlow
2. Node.to_nested_dict() is the interface to tree_view.js in repo::smcal-web
"""
from enum import Enum
from typing import Union, List
import re, logging
from collections import Counter
logger = logging.getLogger(__na... |
"""Platform for climate integration."""
import logging
from typing import Any, List, Mapping, Optional
from homeassistant.components.climate.const import (
CURRENT_HVAC_OFF,
CURRENT_HVAC_COOL,
CURRENT_HVAC_HEAT,
CURRENT_HVAC_DRY,
# CURRENT_HVAC_IDLE,
CURRENT_HVAC_FAN,
HVAC_MODE_OFF,
HVA... |
#!/usr/bin/env python
'''
Module to change the AWS instance types of Tableau Servers for a specific
build pipeline. See main() driver function inline comments for each of
the steps.
This version is a first working draft. Improvements from the code review are
yet to be implemented.
11/21/202... |
"""
Final Model
"""
from abc import ABC
import lib
import torch as t
import numpy as np
# import matplotlib.pyplot as plt
import alexlib.toolbox as tb
#%% Load data
device = t.device(['cpu', 'cuda:0', 'cuda:1'][2])
batch_size = 32
my_writer = lib.SummaryWriter(comment='CDAN')
x_source = np.load('./data/source/pro... |
from __future__ import annotations
import asyncio
import json
import logging
import ssl
from base64 import b64decode, b64encode
from collections.abc import AsyncIterator, Sequence
from contextlib import asynccontextmanager
from datetime import datetime, timedelta, timezone
from enum import Enum
from typing import Any
... |
# -*- coding: utf-8 -*-
# %% [markdown]
# # ✂️ Snorkel Intro Tutorial: _Data Slicing_
#
# In real-world applications, some model outcomes are often more important than others — e.g. vulnerable cyclist detections in an autonomous driving task, or, in our running **spam** application, potentially malicious link redirects... |
from collections.abc import Iterable
from .coo_utils import (
coo_append,
CooArray,
em_update_matrix,
coo_sum_duplicates,
merge_all_sum_duplicates,
)
from .base_cooccurrence_vectorizer import BaseCooccurrenceVectorizer
import numpy as np
import numba
import scipy.sparse
from .preprocessing import pr... |
"""Functions and derivatives thereof to transform external and internal params.
Remarks on the mathematical notation:
-------------------------------------
We let :math:`X` denote the Cholesky factor of some covariance matrix :math:`S`.
That is :math:`X X^\top = S`. We write :math:`\text{vec}(A)` for the column-wise
... |
import collections
import hashlib
import json
import yaml
from troposphere import Template, Ref, Sub, GetAtt, Output, Export
from troposphere.cloudwatch import Alarm, MetricDimension
from troposphere.ec2 import SecurityGroup, SecurityGroupRule
from troposphere.ecs import TaskDefinition, ContainerDefinition, Environmen... |
from utils.activation import get_activation_fn
from typing import List, Tuple
import torch.nn as nn
import torch
class Conv2dNorm(nn.Module):
"""
2D Convolution followed by an activation layer and a 2D BatchNorm layer.
"""
def __init__(self,
in_channels: int,
out... |
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torchvision.models as models
from torch.autograd import Variable
import numpy as np
from model.utils.config import cfg
from model.rpn.rpn import _RPN
from model.roi_pooling.modules.roi_pool import... |
import os
import numpy as np
import pandas as pd
from scipy import interp
from statsmodels.distributions import ECDF
import matplotlib
matplotlib.use('Agg')
import seaborn as sns
import matplotlib.pyplot as plt
from . import FIGURES_DIR
sns.set(context='notebook', font_scale=3.0, font='sans-serif')
sns.set_palette(s... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions to compute TS images."""
import logging
import contextlib
import warnings
from functools import partial
from multiprocessing import Pool
import numpy as np
from scipy.optimize import newton, brentq
from astropy.convolution import CustomKernel,... |
# Copyright (c) 2017-present, Facebook, 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... |
# -*- coding: utf-8 -*-
from clexer import *
from astnode import *
###############################################################################
# #
# PARSER #
# ... |
'''
Source:
https://github.com/ethz-asl/multipoint/blob/1dec30339bee456a4aa2fee843a51b919635818d/multipoint/utils/homographies.py
https://github.com/rpautrat/SuperPoint/blob/master/superpoint/models/homographies.py
'''
import numpy as np
import cv2
import torch
from functools import reduce
import kornia
impor... |
"""
menu.py
Class instance used to create menu for ARTview app.
"""
from __future__ import print_function
import numpy as np
import pyart
import os
import sys
import glob
from ..core import (Variable, Component, common, QtGui, QtCore, componentsList,
QtWidgets, log)
class Window(Component):
... |
import threading
from queue import Queue
from enum import Enum, auto
import serial
import sys
from datetime import datetime, timedelta, date, time
import configparser
# server message definitions (ones sent out from python):
# id=00: heartbeat request
# req bytes:
# 0 - message ID 0x00
# 1-7 - ignored
# ... |
'''
Train a zero-shot GAN using CLIP-based supervision.
Example commands:
CUDA_VISIBLE_DEVICES=1 python train.py --size 1024
--batch 2
--n_sample 4
--output_dir /path/to/output/dir
... |
"""
Created on Tue Jun 14 16:55:52 2016
@author: <NAME>
See: https://community.arm.com/groups/processors/blog/2013/09/25/branch-and-call-sequences-explained
for information on branching in ARM.
"""
from __future__ import print_function
import sys
import argparse
import fileinput
import pydot
import html
import inspec... |
def write_list(listname, worksheet, row=0, col=0, skip=1, header=False,
orientation='rows', format=None, formatheader=None):
if header:
worksheet.write(row, col, header, formatheader)
row += skip
if orientation == 'rows':
[worksheet.write(row + i, col, ii, format)
... |
# -*- test-case-name: klein.test.test_form -*-
import json
from typing import (
Any,
AnyStr,
Callable,
Dict,
Generator,
Iterable,
List,
NoReturn,
Optional,
Sequence,
Type,
cast,
)
import attr
from zope.interface import Attribute, Interface, implementer
from twisted.int... |
# spalipy
from spalipy import Spalipy as sp
import os,sys
import sep
from astropy.io import fits
from astropy.table import Table
seconfigdir = '/data7/cschoi/code/cspy/sex.config/'
seconfig = 'se1.sex'
separam = 'spalipy.param'
#growthparam = 'growth.param'
#separam_noPSF = 'se1_noPSF.param'
seconv = 'default.conv'
... |
import numpy
na = numpy.newaxis
def calc_lorentz_factor(ttheta, k:float=0.0, cthm:float = 0.91, flag_ttheta: bool=False):
"""Lorentz factor for 1D powder diffraction profile.
k is 0 for neutrons
k is 0.5 for characteristic x-ray radiation
k is 0.1 for synchrotron radiation
cthm = cos**2 (2 theta... |
'''Application Service layer for Full Cycle Mining
Gateway into most of application functionality'''
import sys
import os
import datetime
import logging
import json
from collections import defaultdict
import pika
from colorama import init, Fore
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engin... |
import numpy as np
# constants
SMALL = -1e32
STATES = 5
# default transition probabilities
DEFAULT_DEL = 0.025
DEFAULT_EPS = 0.75
DEFAULT_REC = 0.0001
DEFAULT_TERM = 0.001
# Nucleotide to index conversion
convert = {
'G': 4, 'g': 4,
'A': 3, 'a': 3,
'C': 2, 'c': 2,
'T': 1, 't': 1, 'U': 1, 'u': 1,
... |
# 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.0
#
# Unless required by applica... |
import zoo
import os
import sys
def convert(conf, inputs, outputs):
if list(conf.keys()).count("oo") > 0 and list(conf["oo"].keys()).count("external") > 0 and conf["oo"]["external"] == "true":
from subprocess import Popen, PIPE
process = Popen([conf["oo"]["path"]], stdin=PIPE, stdout=PIPE)
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generate the overalls class and mock."""
from __future__ import print_function
import argparse
import da... |
"""
Mask R-CNN
Train on the combined CARLA dataset and real-world dataset
Copyright (c) 2018 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for examples), or run ... |
# -*- coding: utf-8 -*-
#Created on Tue Jan 29 16:02:40 2019
#@author: ryanday
#MIT License
#Copyright (c) 2018 <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 rest... |
from elena.emulators.network_emulator import app, add_routes
from elena.emulators.workcell_emulator import Workcell
from elena.emulators.workpiece_emulator import Workpiece
from elena.emulators.belt_emulator import Transporter
from elena.emulators.process_controller_emulator import ProcessController
from elena.utils im... |
"""
.. module:: construct
:platform: Unix, Windows
:synopsis: Provides functions for constructing and extracting spline geometries
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from . import shortcuts
from . import knotvector
from . import compatibility
from .exceptions import GeomdlException
def construct_surfac... |
"""
Rozpakowanie plików z pobranych JSON do PNG i przeprowadzenie ML.
"""
import os
from credo_cf.image.gray import convert_to_gray_scale
from ML_function import preprocessData,CNN_classifier,STD_classifier,preprocesDataSTD,preprocesDataBL,BL_classifier,BaseTrigger
import cv2
import json
import glob
import numpy as n... |
from abc import abstractmethod
import math
import numpy as np
import jax
import jax.numpy as jnp
import jaxtorch
import jaxtorch.nn as nn
from jaxtorch.core import Module
class TimestepBlock(Module):
"""
Any module where forward() takes timestep embeddings as a second argument.
"""
@abstractmethod
... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2017 CNRS
# 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 ... |
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://aboutcode.org for more in... |
# -*- coding: utf-8 -*-
from .conversion import check_type
from .filesystem import json_exporter, get_appdirs_path, sha256, json_importer
from .maps import Map
from .intersections import intersection_dispatcher
from .geometry import get_remaining
from .projection import project
from .rasters import gen_zonal_stats
from... |
"""
Global test fixtures definitions.
"""
# Taken from tedi and guid_tracker
import base64
from contextlib import contextmanager
import datetime
import os
from pathlib import Path
import posixpath
import shutil
import tempfile
# import asyncio
import typing
from typing import Dict, Iterator, Tuple
from _pytest.fixtu... |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta, date, time
import numpy as np
import pandas as pd
import pandas.lib as lib
import pandas.util.testing as tm
from pandas import Index
from pandas.compat import long, u, PY2
class TestInference(tm.TestCase):
def test_infer_dtype_bytes(self):
... |
import csv
import uuid
from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.contrib.auth import get_user_model
from django.core import validators
from django.db import transaction
from django.forms.widgets import SelectMultiple
from django.template.loader import get_temp... |
# coding=utf-8
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# modified from hugginface github
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc.
# team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version ... |
"""
This plugin is designed to target Malware analyst and Windows internal reverser
It try to find all reference of GUID by matching then with registry values
and list all references with function name to quickly navigate by COM references
Then if you have Hex-Rays plugin, it will infer type for result of
* CoCreate... |
import time
import input_generator
from keras.models import Model, load_model
from keras.layers import *
from keras.callbacks import *
from keras import metrics
from keras import objectives
from keras.activations import *
from keras.optimizers import SGD, Adam
from keras.regularizers import l2
from keras impo... |
import unittest
from unittest.mock import patch
from tmc import points
from tmc.utils import load, load_module, reload_module, get_stdout, check_source
from functools import reduce
import os
import textwrap
from random import choice, randint
exercise = 'src.city_bikes'
def f(d):
return '\n'.join(d)
function1 = ... |
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Functionality to build extensible variable spaces into ReFrame tests.
#
import math
import copy
import reframe.core.fiel... |
# coding=utf-8
# Copyright 2019 The ML Fairness Gym 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... |
#!/usr/bin/env python
import os, sys, csv
import argparse, string
parser = argparse.ArgumentParser()
parser.add_argument("--ops", help="filename of a csv file that contains info about 6502 ops in the expected format")
parser.add_argument("--debugtokenize", help="print information useful in programming the parser... |
"""
This contains the main logic of the program.
The ``UsbadcAPP`` class contains the logic of the GUI.
The ``DataUpdater`` class is responsible for receiving data.
The ``fortest`` function is only needed for the github test.
In fact it is a check that the module is imported normally.
"""
import PyQt5.QtWidgets as ... |
#!/usr/bin/env python3
# ==============================================================================
#
import asyncio
import sys
import os
import json
import argparse
import logging
import base64
import time
from tonclient.client import *
from tonclient.types import *
from binascii import unhexlify
import pathlib... |
"""
Generate an HTML form to create a new DataSet object
"""
from django import forms
from django.forms.widgets import ClearableFileInput
from django.utils.translation import ugettext_lazy as _, ungettext_lazy
from django.contrib.auth.models import User, Group
import logging
from datetime import datetime
from metadat... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the serializer object implementation using protobuf."""
import collections
import unittest
from plaso.lib import event
from plaso.proto import plaso_storage_pb2
from plaso.serializer import protobuf_serializer
from plaso.storage import collection
import pytz
c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.