text stringlengths 8.04k 46.5k |
|---|
# Virtual memory analysis scripts.
# Developed 2012-2014 by <NAME>, <EMAIL>
# Copyright (c) 2012-2014 <NAME> and University of Washington
IGNORE_SHARED_LIBS = True
IGNORE_SHARED_FILES = True
IGNORE_GUARD_REGIONS = True
from util.pjh_utils import *
from trace.vm_regex import *
import conf.system_conf as sysconf
import... |
# Copyright 2021 the Ithaca 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
from __future__ import print_function
from collections import defaultdict
import operator
import os
import os.path as op
import copy
from progressbar import ProgressBar
import math
import seqcluster.libs.logger as mylog
from seqcluster.libs import utils
from seqcluster.libs import parameters
from seqcluster.libs.clas... |
#-*- coding:utf-8 -*-
import numpy as np
import pandas as pd
import numpy as np
import os
import pickle
import random
import logging
from tqdm import tqdm
import pdb
from functools import partial
from itertools import chain
from collections import defaultdict
from gensim import corpora,models,similarities
import tensor... |
import logging
import struct
from .exceptions import TockLoaderException
def roundup(x, to):
return x if x % to == 0 else x + to - x % to
class TBFTLV:
def get_tlvid(self):
return self.TLVID
def get_size(self):
return len(self.pack())
class TBFTLVUnknown(TBFTLV):
def __init__(sel... |
#!/usr/bin/env python
import requests
# import requests_cache
import re
import base64
import json
import csv
import os
import utils
import logging
try:
from urllib import parse as urlparse # Python 3
except ImportError:
import urlparse # Python 2
import nassl
import sslyze
from sslyze.server_connectivity i... |
import maya.cmds as cmds
from maya.api.OpenMaya import MVector, MMatrix
import itertools
import numbers
"""
nodule.py
Pythonic property access for maya objects.
(C) 2018 <NAME>
"""
def nodule(obj, typed=True):
"""
Get the appropriate nodule for <obj>.
If 'typed' flag is set to true (the default), the... |
############################################################################
# Copyright (c) 2015 Saint Petersburg State University
# Copyright (c) 2011-2014 Saint Petersburg Academic University
# All Rights Reserved
# See file LICENSE for details.
#######################################################################... |
from collections import defaultdict
from typing import Callable
from typing import DefaultDict
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
import numpy as np
from optuna._experimental import experimental
from optuna.logging import get_l... |
import time
import json
import copy
import typing as t
import random
from traceback import format_exception
from dataclasses import asdict, dataclass, field
from pymongo.collection import ReturnDocument
from packaging import version
from alfred3.alfredlog import QueuedLoggingInterface
from alfred3.exceptions import Al... |
#!/usr/bin/env python3
#
# vdbtest.py - Vdbench Test Script
#
# Author: <NAME> (<EMAIL>)
# For: DeepStorage, LLC (deepstorage.net)
#
import argparse
import os.path
import os
import re
import csv
from vdbconfig import vdbconfig
from NetJobs import NetJobs
DEFAULT_RUNS = 5
DEFAULT_TIMEOUT = 0
ARCHIVE_DIR_FORMAT = "__{... |
import multiprocessing as mp
import threading
import functools
import traceback
import logging
import inspect
import pickle
import base64
import queue
import uuid
import time
import billiard.exceptions
from celery import Celery
import redis
from socketio import Client
from Crypto.PublicKey import RSA
from Crypto.Ciph... |
# encoding=utf8
from io import BytesIO
from pyramid.response import FileIter
import pybars
from ..log import user_data_log, log_with_user
from .base import date, string_agg, get_selected_year, format_size
from .base import format_mimetype, parse_date
from .letter import render_pdf
from .protocol import format_markdown
... |
#Library
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import random
import itertools
import doctest
import copy
import math
import wandb
from tqdm import tqdm
from collections import defaultdict
#Node Class
class Node:
#Kuhn_node_definitions
def __init__(self, NUM_ACTIONS):
self.NUM... |
# Modified by CogDL Team
#
# DeepSpeed note, code taken from commit 3d59216cec89a363649b4fe3d15295ba936ced0f
# https://github.com/NVIDIA/DeepLearningExamples/blob/master/PyTorch/LanguageModeling/BERT/modeling.py
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
# Copyrig... |
# Copyright (c) 2014 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.
"""Module containing class for recording metadata about a run."""
import collections
import datetime
import json
import logging
import math
import mu... |
from typing import Optional, TextIO, Tuple, Dict
import numpy as np
import scipy.sparse
from cpylog import SimpleLogger, get_logger
TABLES_2D = {'MKLIST'}
MATRICES_DENSE = {'QHHA'}
SKIP_FLAGS = [
'This software and related documentation are',
'LIMITATIONS TO U.S. GOVERNMENT RIGHTS. UNPUBLISHED',
'N A S T R... |
import functools
import socket
from typing import *
from urllib import parse
import pandas as pd
import pyodbc
import pypika as pk
from pypika import Order, Query
from pypika import Table as T
from pypika import functions as fn
from sqlalchemy import create_engine, exc
from sqlalchemy.engine.base import Connection # ... |
import numpy as np
import arff
import argparse
import pandas as pd
import random
from math import sqrt
from sklearn.metrics import mean_squared_error
from statistics import mean
from statistics import stdev
from sklearn import linear_model
from sklearn.linear_model import ElasticNet
from sklearn.ensemble import R... |
import base64
import datetime
import time
import traceback
from logging import DEBUG
from os import makedirs, remove
from os.path import dirname, exists, expanduser
from threading import Thread
from typing import TYPE_CHECKING, Any, Dict, FrozenSet, List, Optional, Set
from colored import attr, fg
from kubernetes.clie... |
import tkinter as tk
import CanvasX as CX
import sys
from enum import Enum
from copy import deepcopy
from linalg import (point,vector,unit,norm,norm2,perp2,para,perp,refl,
unit_length,dot,inverse,
translate,scale,identity,
hom,proj,vapply,coords,line_i... |
#!/usr/bin/env python
# encoding: utf-8
"""
refresh.py
Do-it-all script to refresh entries and indexes managed by otCMS
Created by <NAME> on 2013-01-03.
"""
import sys
import getopt
import os
import random
import re
import cgi
import time
from os.path import join, dirname, exists, realpath
import markdown2
from feedg... |
from enum import Enum
from time import time
import gurobipy as gp
import numpy as np
from scipy import linalg, stats
from sddip import (
dualsolver,
logger,
parameters,
scenarios,
storage,
ucmodeldynamic,
utils,
)
from sddip.constants import ResultKeys
from sddip.dualsolver import DualSolv... |
from __future__ import print_function
import torch.utils.data as data
import os
import os.path
import torch
import numpy as np
import sys
from tqdm import tqdm
import json
from plyfile import PlyData, PlyElement
import torchvision.transforms as transforms
from pycocotools.coco import COCO
from PIL import Image
import ... |
'''Update this file in driftscan/drift/core to be able to run draco_corrcal_file.py'''
# === Start Python 2/3 compatibility
from __future__ import absolute_import, division, print_function, unicode_literals
from future.builtins import * # noqa pylint: disable=W0401, W0614
from future.builtins.disabled import * # no... |
# fileencoding: utf8
""" Binning module.
"""
import string
import warnings
import numpy as np
# https://en.wikipedia.org/wiki/Xi_(letter)
symbol_universal_set = 'ξ' # maybe just ALL would be better
# This is in lieue of a better logger output strategy...
dbg_lvl = 3
def dbg(lvl, msg):
if lvl <= dbg_lvl:
prin... |
## @ingroup Methods-Aerodynamics-Common-Fidelity_Zero-Lift
# compute_wing_induced_velocity.py
#
# Created: Dec 2020, <NAME>
# Modified: May 2021, <NAME>
# Jun 2021, <NAME>
# ----------------------------------------------------------------------
# Imports
# ---------------------------------------------... |
import tensorflow as tf
from tensorflow.contrib.rnn import RNNCell
def lf(prev, i): # function for seq2seq recurrent loss
return prev
def seq2seq(input, dec_in, config, training):
seq_length_in = config.input_window_size
if training:
seq_length_out = config.output_window_size
else:
... |
'''
Superficially generate an object/property tree.
'''
import re, logging, os
import sre_constants
from byond.script.dmscript import ParseDreamList
try:
import cPickle as pickle
except:
import pickle
from .basetypes import Atom, Proc, BYONDValue, BYONDString, BYONDFileRef, BYONDList
from .utils import md5... |
import os
import time
from datetime import datetime
from glob import glob
from multiprocessing import Pool
from contextlib import closing
from natsort import natsorted
import numpy as np
# from numba import guvectorize, float32
from scipy.stats.stats import pearsonr
import pandas as pd
import seaborn as sns
import argp... |
"""Worker Remote Control Client.
Client for worker remote control commands.
Server implementation is in :mod:`celery.worker.control`.
There are two types of remote control commands:
* Inspect commands: Does not have side effects, will usually just return some value
found in the worker, like the list of currently re... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME>
YEARS: 2019 - 2021
CMIP6 model analysis
This script is used to calculate the volume averaged ocean temperature
Globally, south of 50S and south of 50S and below 1500 m
The averaging period is the last 30 years of the 150 years long simulations
For pi... |
# -*- coding: ISO-8859-1 -*-
#
# generated by wxGlade 0.9.3 on Fri Jun 28 16:25:14 2019
#
import wx
from meerk40t.gui.icons import (
icons8_connected_50,
icons8_disconnected_50,
icons8_emergency_stop_button_50,
icons8_laser_beam_hazard_50,
icons8_pause_50,
icons8_play_50,
)
from meerk40t.gui.m... |
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 22 11:51:40 2019
@author: <NAME>
"""
#----------------------------------------------------
# mir: Bridge copy of BWR10x10, DON'T USE FOR NEORL
#----------------------------------------------------
import matplotlib
matplotlib.use('Agg')
import gym
from collections impo... |
###############################################################################
###
### slang.py - An implementation of the Spreadsheet Description Language.
###
### gov.uk Metadata Standards are a way to increase the interoperability of
### spreadsheets between government departments.
###
### slang.py implements th... |
import numpy as np
import matplotlib.pyplot as plt
from skimage.measure import EllipseModel
from matplotlib.patches import Ellipse
from hashlib import sha1
import os, sys, socket
import sun
lookup = {
"1d732bf251e74ed8db86e9e03b97fffa212c7c9f": "capture1_1.jpg",
"3f554757d20e46ec9b654353d1d94c35bb17942b": "c... |
import os
import time
import re
import gzip
import random
import string
import shutil
import requests
import numpy as np
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.table import Table, vstack
from .core import FitsTable
from ..utils import makedirs_if_needed
_HAS_CASJOBS_ = Tru... |
import sc2
import random
import numpy as np
import math
from sc2 import game_state
from sc2 import run_game, maps, Race, Difficulty, Result
from sc2.constants import *
from sc2.position import Point2, Point3
from sc2.unit import Unit
from sc2.player import Bot, Computer, Human
from sc2.ids.unit_typeid import UnitTypeId... |
import h5py
import numpy as np
import itertools
from astropy.table import Table, vstack
from halotools.empirical_models import HodModelFactory, model_defaults
from halotools.empirical_models import TrivialPhaseSpace, Zheng07Cens
from halotools.empirical_models import NFWPhaseSpace, Zheng07Sats
from halotools.mock_obser... |
#!/usr/bin/env python
"""
mafToPlotPickles.py
17 February 2011
dent earl, <EMAIL>
mafToPlotPickles.py is used to produce pickle
files from pairwise maf. The pickle files are used
to create a plot by plotPicklesToPlot.py.
mafToPlotPickles.py works by reading in a maf
and storing only the relevant information needed to... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2016 <NAME>
"""
"""
TODO Come up with some fucking good method/function names?
TODO: distance weights, WHAT WEIGHTS!?
Ideas?
"""
import sklearn.metrics.pairwise as pw
from stemming.porter2 import stem #ENGLISH
import numpy as np
import numpy.linalg as la
... |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
'''
在TransH_pytorch的基础上,更进一步采用pytorch.nn.embedding class来实现transH模型
'''
import codecs
import numpy as np
import copy
import time
import random
import matplotlib.pyplot as plt
import json
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable... |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... |
# ratio_maps.py: code for computing subglacial lake size, volume change, and phase lag
# discrepancies across the Antarctic ice sheet
#
# OVERVIEW
# this code constructs a maps of subglacial lake size, volume change, and phase lag
# discrepancies given maps of the ice thickness and basal sliding coefficient.
# ... |
# politician/controllers.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from candidate.controllers import add_name_to_next_spot, move_candidates_to_another_politician
from elected_official.controllers import move_elected_officials_to_another_politician
from politician.models import Politician, Politi... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Converter for PDF files
"""
import os.path
import logging
import io
from lxml import etree as et
from lxml.builder import ElementMaker
import xmlhelper
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import XMLConverter
f... |
import glob
import io
import json
import os
import re
import shutil
import zipfile
from collections import deque
from inspect import signature
from keras import backend as K
import numpy as np
import scipy
import tensorflow as tf
from tensorflow.contrib.framework.python.framework import checkpoint_utils
def reduce_v... |
from typing import Union, Sequence
import numpy as np
from .vector_to_axis import vector_to_axis
from macromax.utils import ft
class Grid(Sequence):
"""
A class representing an immutable uniformly-spaced plaid Cartesian grid and its Fourier Transform.
See also: :class:`MutableGrid`.
"""
def __in... |
from trainer_base import TrainerBase
import torch.backends.cudnn as cudnn
import torch.multiprocessing as mp
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as DDP
import os
import json
import collections
from pathlib import Path
from packaging import version
import numpy as np
... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
Coursework C: Neuron Spike Classifier
Objective:
Prrocess a time recording from an electrode inserted into the brain, identifying where in the recording
the spikes corresponding to neuron activity are located and assigning one of 4 types of neurons to each
spike.... |
import os
import re
import pandas as pd
import numpy as np
from copy import deepcopy
from xlsxwriter.workbook import Workbook
from xlsxwriter.worksheet import Worksheet
from .theme import Theme
from .cover import Cover
from .gptable import GPTable
from gptables.utils.unpickle_themes import gptheme
class GPWorksheet... |
# Copyright 2019 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, sof... |
from olfactometer.contour_plot_generator import plotterDim
import numpy as np
import time
import pandas as pd
from collections import OrderedDict
import quantities as pq
from numba import jit
from olfactometer.equipment import MFC
from scipy.optimize import minimize, least_squares
class SmellController:
... |
from argparse import Namespace
from scipy import stats
import json
import numpy as np
import os
import seaborn as sns
from scipy import stats
from scipy.optimize import minimize
import matplotlib
matplotlib.use('Agg') # REMOVE THIS LINE IF TRYING TO INTERACTIVELY SHOW PLOTS (IN ADDTION TO SAVING)
import matplotlib.py... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import six
import warnings
import numpy as np
from monty.json import MSONable
from pymatgen.electronic_structure.core import Spin, Orbital
from pymatgen.core.... |
from pysofaconventions import * # For getting measurement locations and FIRs from SOFA files
from scipy.spatial import Delaunay # For triangulating the measurement points, provides data for pathing algorithm
import matplotlib.pyplot as plt # at this point, mainly just debugging
from mpl_toolkits.mplot3d import Axes3D #... |
# SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: BSD-3-Clause
"""Provide :py:class:`Tracker` as a Jupyter notebook UI for smFRET tracking"""
import collections
import contextlib
import itertools
from pathlib import Path
from typing import Any, Callable, Dict, Optional, Sequence, Union
try:
... |
# Copyright 2007 <NAME>, <EMAIL>
"""Testing module for PyGraphcut.
This testing module tests the functionality of the Graph and Energy
classes, making sure that what functions that should work do work, and
those use cases that should not work do not work. This module is
intended for development use to ensure nothing... |
'''
Individual stages of the pipeline implemented as functions from
input files to output files.
The run_stage function knows everything about submitting jobs and, given
the state parameter, has full access to the state of the pipeline, such
as config, options, DRMAA and the logger.
'''
from utils import safe_make_di... |
import asyncio
import json
import logging
import os
import aiohttp
import discord
from discord.ext import commands
log = logging.getLogger()
class Pokebattler(commands.Cog):
"""
Commands related to Pokebattler.
"""
def __init__(self, bot):
self.bot = bot
self.bot.loop.create_task(sel... |
import argparse
import numpy as np
from numpy import save
import json
import glob
import os # for checkpoint management
os.environ['CUDA_LAUNCH_BLOCKING'] = "1"
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.nn.utils import clip_grad_norm_
from data_ite... |
import sys, gc
class Editor:
KEYMAP = {
"\x1b[A": 0x0B,
"\x1b[B": 0x0D,
"\x1b[D": 0x1F,
"\x1b[C": 0x1E,
"\x1b[H": 0x10,
"\x1bOH": 0x10,
"\x1b[1~": 0x10,
"\x1b[F": 0x03,
"\x1bOF": 0x03,
"\x1b[4~": 0x03,
"\x1b[5~": 0xFFF1,
... |
"""Interfaces with the KineticModel class to fit experimental data to a
given kinetic model and output the results.
"""
import platform
import numpy as np
import scipy
import pickle
from matplotlib import pyplot as plt, rcParams
from . import _version
from .Dataset import Dataset
from .simulate_model import simulate_a... |
# Copyright <NAME> 2019. See LICENSE file.
#pylint: disable=wildcard-import,protected-access,bare-except
from typing import Tuple, Dict, Set
from types import FunctionType
from dataclasses import dataclass
from ..constants import *
import numpy
import os
import sys
import time
import colorama
from threading imp... |
# Copyright 2019 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... |
# Copyright (C) 2003 Python Software Foundation
import unittest
import shutil
import tempfile
import sys
import stat
import os
import os.path
from os.path import splitdrive
from distutils.spawn import find_executable, spawn
from shutil import (_make_tarball, _make_zipfile, make_archive,
register_ar... |
from django import forms
from django.db.models import Count
from dcim.models import Site, Rack, Device, Interface
from extras.forms import CustomFieldForm, CustomFieldBulkEditForm, CustomFieldFilterForm
from tenancy.models import Tenant
from utilities.forms import (
APISelect, BootstrapMixin, BulkImportForm, CSVDa... |
# Copyright (C) 2019 Intel Corporation.
# SPDX-License-Identifier: BSD-3-Clause
"""View pages for config app.
"""
import os
from datetime import datetime
from shutil import copyfile
# flask: Copyright 2010 Pallets
# SPDX-License-Identifier: BSD-3-Clause
# Refer to https://github.com/pallets/flask/blob/master/LICENS... |
"""
Colour Rendering of Spectra
by <NAME>
http://www.fourmilab.ch/
Last updated: March 9, 2003
Converted to Python by <NAME>, sometime in early
2011.
This program is in the public domain.
The modifications are also publi... |
import jax
import jax.numpy as jnp
from jax.experimental import stax
from jax.experimental import optimizers
from jax.experimental.ode import odeint
from functools import partial
import matplotlib.pyplot as plt
import pickle
# from jax.lib import xla_bridge
# print(xla_bridge.get_backend().platform)
#
# ... |
"""Implementation all tasks parts for the cpu"""
from functools import reduce
import logging
import sys
import numpy as np
import pyarrow as pa
import vaex
import vaex.encoding
from .utils import as_flat_float, as_flat_array, _issequence, _ensure_list
from .array_types import filter
logger = logging.getLogger("vae... |
"""
Copyright 2021 Comcast Cable Communications Management, 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 agre... |
# -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""
This module hosts all the extension functions and classes created via SDK.
The ... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# Copyright 2009-2012 Yelp
# Copyright 2013 <NAME> and <NAME>
# Copyright 2014 Contributors
# Copyright 2015 Yelp
#
# 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/lic... |
# Copyright 2011 by <NAME> (<EMAIL>)
# Revisions copyright 2011-2016 by <NAME>.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
""... |
"""@package excel
Partial implementation of xlrd.book object interface and some Excel
functions.
"""
# pylint: disable=pointless-string-statement
"""
ViperMonkey is a specialized engine to parse, analyze and interpret Microsoft
VBA macros (Visual Basic for Applications), mainly for malware analysis.
Author: <NAME> -... |
# @file UefiAuthenticatedVariablesStructureSupport.py
# UEFI Authenticated Variable Structure Support Library for other tools
##
# Copyright (c) 2018, Microsoft Corporation
#
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... |
# Copyright 2017 The TensorFlow Lattice 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 a... |
#! /usr/bin/env python
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) <NAME> <<EMAIL>>
# Copyright (C) <NAME> <<EMAIL>>
# This program is published under a GPLv2 license
import struct
from scapy.fields import ObservableDict, XByteEnumField, ByteEnumField,... |
import os
import time
import numpy as np
import tabulate
import torch
from torch.utils.data import DataLoader, RandomSampler
from rmp_nav.common.utils import save_model, load_model, module_grad_stats, module_weights_stats
def _load_weights(model_file, nets, net_opts):
state = load_model(os.path.dirname(model_file... |
"""
HarDNet for ImageNet-1K, implemented in TensorFlow.
Original paper: 'HarDNet: A Low Memory Traffic Network,' https://arxiv.org/abs/1909.00948.
"""
__all__ = ['HarDNet', 'hardnet39ds', 'hardnet68ds', 'hardnet68', 'hardnet85']
import os
import tensorflow as tf
import tensorflow.keras.layers as nn
from model... |
import math
from datetime import datetime, timedelta
from django.shortcuts import get_object_or_404, render
from django.http import Http404, HttpResponse, HttpResponseRedirect, HttpResponseForbidden
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.contr... |
# pylint: disable=too-many-statements,too-many-branches
import logging
import threading
import time
import uuid
from contextlib import contextmanager
from types import TracebackType
from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Type, Union, cast
from warnings import WarningMessage, catch_... |
import numpy as np
from scikits.statsmodels.tools.decorators import (cache_readonly,
cache_writable, resettable_cache)
from scipy import optimize
from numpy import dot, identity, kron, log, zeros, pi, exp, eye, abs, empty
from numpy.linalg import inv, pinv
from scikits.statsmodels.base.model import (LikelihoodM... |
# -*- coding: utf-8 -*-
'''
Network Config
==============
Manage the configuration on a network device given a specific static config or template.
:codeauthor: <NAME> <<EMAIL>> & <NAME> <<EMAIL>>
:maturity: new
:depends: napalm
:platform: unix
Dependencies
------------
- :mod:`NAPALM proxy minion <salt.proxy.... |
from collections.abc import Sequence, Iterable
from collections import namedtuple, OrderedDict
import os
import gzip
import itertools
import numpy as np
import astropy.units as u
import warnings
from dust_extinction.parameter_averages import F19
import galsim
from desc.skycatalogs.utils.translate_utils import form_obje... |
# Copyright 2015, 2016 <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, so... |
import time
import torch
import math
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import utils
import numpy as np
def build_targets(pred_boxes, target, anchors, num_anchors, num_classes, nH, nW, noobject_scale, object_scale, sil_thresh, seen):
nB = target.size(0)
nA... |
import unittest
import functools
import numpy
from operator import mul
import chainer
from chainer import backend
from chainer.backends import cuda
import chainer.functions as F
from chainer import gradient_check
from chainer import testing
from chainer.testing import array
from chainer.testing import attr
from chain... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
"""
This package combines the common.ncml with existing pyNN classes
Author: <NAME> (<EMAIL>)
Copyright: 2012-2014 <NAME>.
License: This file is part of the "NineLine" package, which is released under
the MIT Licence, see LICENSE for details.
"""
from __future__ import absolute_import
from __future... |
import time
from datetime import datetime, date
from dateutil.tz import tzutc
import redisco
from redisco.containers import Set, List, SortedSet, NonPersistentList
from .modelset import ModelSet
from .attributes import *
from .key import Key
from .managers import ManagerDescriptor, Manager
from .exceptions import Field... |
# Copyright 2021-2022 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
from __future__ import absolute_import
'''
Compartmental models.
This module defines the `SpatialNeuron` class, which defines multicompartmental
models.
'''
import weakref
import copy
import sympy as sp
import numpy as np
from past.builtins import basestring
from brian2.core.variables import Variables
from brian2.equ... |
# -*- coding: utf-8 -*-
# system imports
import os.path as osp
import platform
# external imports
from travertino.size import at_least
from rubicon.objc import (
NSMakeSize,
NSZeroPoint,
CGRectMake,
ObjCClass,
objc_method,
SEL,
at,
)
from toga.constants import LEFT, TRANSPARENT
from toga_c... |
# Add parent folder to path
import sys, os, math
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import numpy as np
import numba
import h5py
import scipy.linalg
from src.Solver import Solver
from src.Helpers import Helpers
from src.Methods.WCSPH import WCSPH
from src.Kernels.Wendland import Wendland
from src.Inte... |
#!/usr/bin/env python3
# From https://github.com/AtsushiSakai/PythonRobotics/blob/master/Localization/extended_kalman_filter/extended_kalman_filter.py
import math
from math import sin, cos, pi
import rospy
import tf
from std_msgs.msg import Header
from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3... |
import sys
import os
import re
from typing import List, Tuple, Dict
import requests
from json.decoder import JSONDecodeError
from eutils._internal.exceptions import EutilsNCBIError
from metapub import PubMedFetcher
from metapub.exceptions import MetaPubError
from scholarly import scholarly
from scholarly._nav... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.