text stringlengths 8.04k 46.5k |
|---|
#!/usr/bin/env python
# coding: utf-8
import cv2
import matplotlib.pyplot as plt
import numpy as np
import sys
import os
import math
import json
from time import sleep
# initial threshold for FAST feature (difference to center point)
iniThFast = 20
# reduce threshold for FAST, if not enough feature points were foun... |
from __future__ import absolute_import
import os
import logging
from collections import OrderedDict
import itertools
import torch
import torch.nn as nn
from joblib import Parallel, delayed, parallel_backend
import models.networks as networks
from .base_model import BaseModel, nullcast
from . import losses
from . im... |
#!/usr/bin/python3
# -*-coding: utf-8 -*-
"""
.. invisible:
_ _ _____ _ _____ _____
| | | | ___| | | ___/ ___|
| | | | |__ | | | |__ \ `--.
| | | | __|| | | __| `--. \
\ \_/ / |___| |___| |___/\__/ /
\___/\____/\_____|____/\____/
Created on Nov 10, 2014
█████████████████████... |
# -*- coding: utf-8 -*-
import subprocess
import random
from PIL import Image, ImageDraw, ImageFont
import numbers
import xml.etree.ElementTree as ET
from .datastruct import *
import math
from . import tablereader
pdfutil_debug_enabled = False
PDF2TXT_PATH = "pdf2txt.py"
def pdf_rasterized(pdffn, page):
imag... |
from django.shortcuts import render,redirect
from django.http import HttpResponse
from model.community import *
from model.oss import *
from view.common import *
from django.core.paginator import Paginator,EmptyPage,PageNotAnInteger
from django.db.models import Sum, Count
from operator import itemgetter
from django.htt... |
""" "Official evaluation script for SQuAD version 2.0",
by Rajpurkar & Jia et al., made available here:
https://rajpurkar.github.io/SQuAD-explorer/
and used under CC-BY-SA 4.0. / A few lines modified, marked by comments.
The CC-BY-SA 4.0 license can be found here:
https://creativecommons.org/licenses/by-sa/4.0... |
import os
import numpy as np
from . import reporting
from . import printer
from .dims import *
import pandas as pd
def create_section(title, desc, subsects, figures_list):
assert isinstance(title, str)
assert isinstance(desc, str)
assert isinstance(figures_list, list)
section = reporting.Section(titl... |
# pyre-strict
"""
Local task runner
"""
import logging
import math
import os
import json
import copy
import traceback
import glob
import threading
import shutil
import re
from typing import Tuple, List, Dict, Optional, Callable, Iterable, Set, Any, Union
from contextlib import ExitStack
from .. import Error, Type, Env... |
# Copyright (c) 2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... |
# Copyright 2017 Mycroft AI 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... |
# -*- coding: utf-8 -*-
# optimization pass to promote a scalar/vector DAG into vector registers
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
#########################################################################... |
"""
- environment with unfixed number of obstacles, env.reset(number of obstacles), maximum number == 50
- action-dim: 6 / 26 actions
- agent.reset_optimizer: leraning rate decay
- reward: projection reward
- add target model, update its weights every target_update epochs
- add force reward for each step by envok... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2016, Camptocamp SA
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
#... |
import pygame, random, math, queue, os
from dataclasses import dataclass, field
from typing import Any
@dataclass(order=True)
class PrioritizedItem():
priority: int
item: Any=field(compare=False)
pygame.init()
clock = pygame.time.Clock()
size = (600, 600)
screen = pygame.display.set_mode(size)... |
"""OpenCL target integrated with PyOpenCL."""
__copyright__ = "Copyright (C) 2015 <NAME>"
__license__ = """
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 ... |
# coding: utf-8
# # Shells
# ## Init symbols for *sympy*
# In[22]:
from sympy import *
from sympy.vector import CoordSys3D
import matplotlib.pyplot as plt
from matplotlib import cm
from IPython.display import display
N = CoordSys3D('N')
x1, x2, x3 = symbols("x_1 x_2 x_3")
alpha1, alpha2, alpha3 = symbols("alpha_... |
from __future__ import annotations
import inspect
from collections.abc import Sequence as SequenceCollection
from typing import TYPE_CHECKING, Dict, List, Optional, Protocol, Union, runtime_checkable
import tensorflow as tf
from keras.utils.losses_utils import cast_losses_to_common_dtype
from tensorflow.python.keras.... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains DCC core client implementation
"""
from __future__ import print_function, division, absolute_import
import os
import sys
import time
import json
import socket
import inspect
import pkgutil
import logging
import importlib
import traceback
from co... |
#!/usr/bin/env python
# coding=utf-8
'''
Author: ZZ_Guo
Email: <EMAIL>
Date: 2020-09-11 23:03:00
LastEditor: ZZ_Guo
LastEditTime: 2021-05-06 17:04:38
Discription:
Environment:
'''
from pysc2.lib import actions, features, units
from pysc2.env import sc2_env, run_loop, available_actions_printer
from pysc2 import maps
i... |
from copy import copy
from random import randint
from collections import OrderedDict, defaultdict
from networkit.community import CoverF1Similarity
from networkit.structures import Cover
from networkit import none
def poss_combs(x):
return x * (x - 1) / 2
# Merge highly connected partitions
def partition_merge(G,... |
#! /usr/bin/env python3
##
## Copyright (C) by Argonne National Laboratory
## See COPYRIGHT in top-level directory
##
import sys
import os
import argparse
import subprocess
from collections import deque
sys.path.append('maint/')
import yutils
sys.path.append('src/backend/')
import gencomm
#####################... |
'''
author: bg
goal:
type: Image Clustering DL learn <-- VGG Auto-encoder (AE) +
how: DCNN clustering - Local Aggregation by Zhuang et al (2019) + SegNet method of AE arch
ref: https://towardsdatascience.com/image-clustering-implementation-with-pytorch-587af1d14123
refactors:
'''
import numpy as np
import tor... |
import os
import time
import tkinter
import sqlite3
import json
import smtplib
import locale
import requests
import threading
import html2text as h2t
from tkinter import *
from tkinter.ttk import *
from tkinter import filedialog
from tkinter import messagebox
from email import encoders
from email.mime.text import MIMET... |
import warnings
from typing import Iterable, Tuple, Union, Optional
import torch
import unitair.states as states
from .utils import count_gate_batch_dims
from unitair.utils import permutation_to_front, inverse_list_permutation
import numpy as np
from unitair.gates.matrix_algebra import fuse_single_qubit_operators
from ... |
from __future__ import print_function
import os
import sys
import time
import pickle
import itertools
import numpy as np
import theano
import lasagne
from lasagne.utils import floatX
from utils import BColors, print_net_architecture
import theano.tensor as T
from data_pool import DataPool
from ba... |
import os
import json
import random
import logging
import sys
import random
import re
import string
import pickle
import copy
from itertools import chain
import torch
from tqdm import tqdm
from .utils.data import (
pad_ids, truncate_sequences
)
from scripts.dataset_walker import DatasetWalker
from scripts.know... |
import json
from math import atan2, pi, hypot
from typing import Union, List
import os
from os.path import exists as _exists
import subprocess
import numpy as np
import utm
from osgeo import gdal, osr, ogr
from wepppy.all_your_base import isfloat
from wepppy.all_your_base.geo import get_utm_zone, utm_srid
from .wep... |
#!/usr/bin/env python
"""
Parser for FCS 2.0, 3.0, 3.1 files. Python 2/3 compatible.
`
Distributed under the MIT License.
Useful documentation for dtypes in numpy
http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.byteswap.html?highlight=byteswap#numpy.ndarray.byteswap # noqa
http://docs.scipy.org/doc/... |
import re
import csv
import logging
import math
import glob
# import argparse
import numpy as np
import os
import pandas as pd
import time
import datetime
import drms
import urllib
# import json
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import astropy.units as u
import telegram_handler
# impo... |
from json import dumps
import altair as alt
import base64
import numpy as np
import pandas as pd
import streamlit as st
from pages.utils.formats import global_format_func
from pages.utils.viz import (prep_tidy_data_to_plot,
make_combined_chart,
plot_r0,
... |
# -*- coding: utf-8 -*-
import os
ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# based on https://github.com/w3c/web-platform-tests/blob/275544eab54a0d0c7f74ccc2baae9711293d8908/url/urltestdata.txt
invalid = {
"scheme-trailing-space": "a: foo.com",
"scheme-trailing-tab": "a:\tfoo.com",
... |
"""
Cozmo procedural face rendering.
"""
from functools import lru_cache
from typing import Optional, List, Generator
import random
from PIL import Image, ImageDraw
import numpy as np
from . import robot
__all__ = [
"DEFAULT_WIDTH",
"DEFAULT_HEIGHT",
"ProceduralLid",
"ProceduralEye",
"Proced... |
import itertools
import numpy as np
from x7.lib.iters import iter_rotate, xy_flatten
from .typing import *
from .geom import *
from .transform import *
try:
import bezier as bz
BzCurve = bz.Curve
except ModuleNotFoundError:
bezier = None
BzCurve = None
__all__ = [
'ControlPoint',
'bez_split',... |
from typing import Callable
from .primitives import Node, nodes, TT, Token, NEWLINE, Config, id_counter, Type, types
from dataclasses import dataclass
@dataclass(slots=True, frozen=True)
class TV:#typed value
ty:Type|None = None
val:str = ''
@property
def typ(self) -> Type:
if self.ty is None:
raise Exceptio... |
import torch
import clip
import numpy as np
def text_prompt_slide(classes, id_list, dataset, cnt_max=5):
text_aug_cnts = [f"This clip contains no actions.",
f"This clip contains only one action,", f"This clip contains two actions,",
f"This clip contains three actions,", f... |
"""
Visualization of mutation effects
Authors:
<NAME>
<NAME> (mutation_pymol_script generalization)
"""
from math import isnan
from copy import deepcopy
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from bokeh import plotting as bp
from bokeh.core.properties impo... |
# -*- coding: utf-8 -*-
"""
mfe_saw.datasource
~~~~~~~~~~~~~
This module imports into the mfe_saw core class to
provide 'DevTree' and 'DataSource' objects.
"""
import csv
import ipaddress
import inspect
import json
import logging
import re
import sys
from itertools import chain
from io import StringIO
... |
"""PyTorch BERT-of-Theseus model. """
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import torch
from torch import nn
from torch.nn import CrossEntropyLoss, MSELoss
from torch.distributions.bernoulli import Bernoulli
from transformers.modeling_utils import PreTrai... |
from collections import OrderedDict
import numpy as np
from gym.spaces import Box, Dict
from multiworld.envs.env_util import get_stat_in_paths, \
create_stats_ordered_dict, get_asset_full_path
from multiworld.core.multitask_env import MultitaskEnv
from multiworld.envs.mujoco.sawyer_xyz.base import SawyerXYZEnv
fro... |
"""
mdbt_cli.py
Author: <NAME>
The command line interface. This is one possible entry-point to the application which presents users
with menus and options on the command line.
"""
import configuration
from entry import MAX_OUTPUTS, MAX_EXCLUSIONS
from configuration import InvalidPathException, SubPathException, Cyclic... |
# Copyright 2013 Concentric Sky, 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 wr... |
"""Assortment of layers for use in models.py.
Authors:
<NAME> (<EMAIL>)
<NAME> (<EMAIL>)
"""
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from util import masked_softmax
# --------------- Model Layers ------------------
class InputEmbeddingLayer(nn.Module):
"""Embedding ... |
'''
Created on 28 Mar 2021
@author: thomasgumbricht
'''
import os
from sys import exit
import numpy as np
import gc
#from numpy import pi, log, tan, empty, float32, arctan, rad2deg, gradient
from scipy.ndimage import gaussian_gradient_magnitude
from math import sqrt
from geoimagine.gis import RasterOpenGetFirs... |
from rdkit import Chem
from rdkit.Chem.rdchem import HybridizationType
from rdkit.Chem.rdchem import BondType as BT
from rdkit.Chem.rdchem import ChiralType
import os.path as osp
import numpy as np
import glob
import pickle
import random
from model.EGCMCalculator import EGCMCalculator
import torch
import torch.nn.fun... |
import os
import pytest
import re
import sys
from configobj import ConfigObj
from unittest import mock
sys.path.append('..')
from streamrecorder import configuration
from streamrecorder import dvrutils
from streamrecorder import schedule
from streamrecorder import sender
from streamrecorder import stream
# =========... |
#!/usr/bin/env python3
#
# DARC master process
# Controls all services
import sys
import os
import argparse
import ast
import yaml
import multiprocessing as mp
from queue import Empty
import socket
from time import sleep, time
from shutil import copy2
from astropy.time import Time, TimeDelta
import darc
from darc.def... |
#
# Copyright (c) 2013, EMC Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and ... |
# 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 restriction, including without limitation the rights
# to use, copy, modify, merge, publi... |
# coding=utf-8
import argparse
import json
import numpy as np
import os
import sys
import matrix_analysis
sys.path.append("..")
import cfg
from local_cfg import evo_data_folder
from collections import defaultdict
def get_label_src(label):
""" returns the flow source label """
return label.split(' - ')[0]
... |
# -*- coding: utf-8 -*-
# Import builtins
from __future__ import print_function
from collections import OrderedDict
import getpass
import logging
import logging.handlers
import os
import re
import sys
from string import Template
# OS Detection
is_windows = True if sys.platform in ['win32', 'cygwin'] else False
is_darw... |
# The MIT License (MIT)
# Copyright (c) 2020 by the xcube development team and contributors
#
# 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... |
#!/usr/bin/env python
# encoding: utf-8
"""
@author: <NAME> 刘祥德
@license: (C) Copyright 2019-now, Node Supply Chain Manager Corporation Limited.
@contact: <EMAIL>
@software:
@file: warp.py
@time: 10/3/19 4:58 PM
@version 1.0
@desc:
"""
import logging
import os
import random
import cv2
import numpy as np
import torch
i... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
from six.moves import xrange
import tensorflow as tf
from tensorflow.python.platform import flags
import matplotlib.pyplot as plt
import pickle
import... |
import numpy as np
from scipy import integrate
from scipy import interpolate
# Cosmological parameters
Om0 = 0.272
Ol0 = 1.0 - Om0
h = 0.704
ns = 0.961
sigma80 = 0.807
SPEEDOFLIGHT_KMS = 2.99792458e5
def nhat(alpha, delta):
nhat = np.zeros(3)
nhat[0] = np.cos(delta) * np.cos(alpha)
nhat[1] = np.cos(delta) * np.... |
# _________________________________________________________________________
#
# PyUtilib: A Python utility library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the BSD License.
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains ... |
#!/usr/bin/env python
from __future__ import unicode_literals, division, print_function
from dfs_sdk import scaffold
import contextlib
import functools
import io
import os
import random
import re
import shlex
import socket
import subprocess
import sys
import time
import traceback
import uuid
from dfs_sdk.exceptions ... |
import cv2
import munkres
import numpy as np
import torch
# solution proposed in https://github.com/pytorch/pytorch/issues/229#issuecomment-299424875
def flip_tensor(tensor, dim=0):
"""
flip the tensor on the dimension dim
"""
inv_idx = torch.arange(tensor.shape[dim] - 1, -1, -1).to(tensor.device)
... |
# validation work in March 9th
# The general purpose of this script is to generate the result
# published in cancer cell paper with ImmunoPepper
# Link: (https://www.sciencedirect.com/science/article/pii/S1535610818303064)
# validate 2019/03/07
import gzip
import pickle
import argparse
import sys
import os
import num... |
""" Base class for simulation objects and their event queues
:Author: <NAME> <<EMAIL>>
:Date: 2016-06-01
:Copyright: 2016-2020, Karr Lab
:License: MIT
"""
from abc import ABCMeta
from copy import deepcopy
from enum import IntEnum
import abc
import heapq
import math
import warnings
from de_sim.config import core
from... |
"""
[vt102](http://github.com/samfoo/vt102) is an in memory vt1xx terminal
emulator. It supports all the most common terminal escape sequences, including
text attributes and color.
It's an in memory vt1XX-compatible terminal emulator. The *XX* stands for a
series video terminals, developed by
[DEC](http://en.wikipedi... |
# Copyright (c) 2015-2019 The Switch Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0, which is in the LICENSE file.
"""
Utility functions for Switch.
"""
from __future__ import print_function
import os, types, importlib, re, sys, argparse, time, datetime
import __main__ as main
from pyo... |
#####################################################.
# This file stores all the functions #
# used in CSEARCH #
#####################################################.
import os
import sys
import subprocess
from pathlib import Path
from pkg_resources import reso... |
#!/usr/bin/env python
# Edit this script to add your team's training code.
# Some functions are *required*, but you can edit most parts of the required functions, remove non-required functions, and add your own functions.
################################################################################
#
# Imported fu... |
"""
An implementation of the new Golem's task executor.
"""
import asyncio
from asyncio import CancelledError
import contextlib
from datetime import datetime, timedelta, timezone
from decimal import Decimal
import logging
import os
import sys
from typing import (
AsyncContextManager,
AsyncIterator,
Callable... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import base64
import six
from aldryn_people.vcard import Vcard
from django.utils.text import slugify
try:
import urlparse
except ImportError:
from urllib import parse as urlparse
import warnings
try:
from django.utils.encoding import force_... |
from collections import OrderedDict
from io import BytesIO
from fs_helpers import *
class EventList:
TOTAL_NUM_FLAGS = 0x2800
def __init__(self, file_entry):
self.file_entry = file_entry
data = self.file_entry.data
event_list_offset = read_u32(data, 0x00)
num_events = read_u... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
# 禁用远程端口 # TODO: delete
import matplotlib
matplotlib.use("Agg")
import random
import cv2
import numpy as np
from yolox.utils import (adjust_box_anns, get_local_rank,
mintheta_obb, obb2poly, poly2... |
# Import all functions required within the functions
# These need to be imported in here to execute functions from another file.
import time
import numpy as np
import pandas as pd
from geopandas import GeoDataFrame, read_file
#import math
from shapely.geometry import Point, Polygon
from sklearn.metrics.pairwise import ... |
"""The selection module provides methods to run the statistical inference for a
set of models on given data (model selection and parameter estimation). Use the
top-level function `select_models`; `select_models` then calls required helper
functions (such as `net_estimation`) automatically."""
# TODO: user input vali... |
import sys
from datetime import datetime
from enum import Enum, EnumMeta
from inspect import signature, isclass, isfunction, Parameter
from typing import (
List,
Set,
Dict,
Mapping,
Optional,
Callable,
Sequence,
AbstractSet,
Tuple,
Any,
Union,
Generic,
TypeVar,
Ty... |
from sklearn.ensemble import RandomForestRegressor
from sklearn.datasets import make_regression
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
import numpy as np, tensorflow as tf
from sklearn.preprocessing import OneHotEncoder
impor... |
import json
import re
from collections import defaultdict
import opml
import structlog
from django.contrib import messages
from django.core.exceptions import ValidationError
from django.core.paginator import EmptyPage, InvalidPage, Paginator
from django.core.urlresolvers import reverse, reverse_lazy
from django.db imp... |
import unittest
from time import strptime
from datetime import datetime
from pytz import timezone, UTC
import re
from trac.core import *
from trac.test import EnvironmentStub
from irclogs.provider.file import FileIRCLogProvider
from irclogs.api import merge_iseq, IRCChannelManager
class FileIRCLogProviderTestCase(un... |
# Part of Spatial Math Toolbox for Python
# Copyright (c) 2000 <NAME>
# MIT Licence, see details in top-level file: LICENCE
"""
This modules contains functions to operate on special matrices in 2D or 3D, for
example SE(n), SO(n), se(n) and so(n) where n is 2 or 3.
Vector arguments are what numpy refers to as ``array_... |
#!/usr/bin/python3
import os, sys, inspect, subprocess, tempfile
# Include the parent directory in the search path.
cmd_folder = os.path.abspath(os.path.split(inspect.getfile( inspect.currentframe() ))[0])
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
from common import dbConn, DEFAULT_TAG, BACKU... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Distributed under the terms of the MIT License.
"""
Script to analyse FASTA sequence files from BRENDA in bulk.
Author: <NAME>
Date Created: 06 Dec 2018
"""
from os.path import exists
import pandas as pd
from numpy import arange, histogram
import matplotlib.pyplot as... |
# Copyright 2021 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 agre... |
import pickle
import time
import os
import shutil
from typing import Dict, List, Tuple, Union, Set
from qanta.guesser.abstract import AbstractGuesser
from qanta.datasets.quiz_bowl import QuizBowlDataset
from qanta.datasets.wikipedia import WikipediaDataset
from qanta.preprocess import preprocess_dataset, tokenize_ques... |
import tables
import os
import glob
# from pprint import pp
import time
# from astropy.coordinates import Angle
import h5py
import numpy as np
import pandas as pd
import pymongo
import json
import argparse
import traceback
import datetime
import pytz
from numba import jit
import typing
# from concurrent.futures import ... |
# Copyright 2017 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
"""A mixed set of helper functions for the Jupyter notebooks, e.g. widgets
and image handling.
"""
import os
import random
import time
from inspect import Traceback
from itertools import compress
from multiprocessing import Pool
from typing import TYPE_CHECKING
import cv2
import matplotlib.image as mpimg
import matplo... |
# coding: utf-8
import numpy as np
import h5py
import yaml
import yamlloader
import os
from collections import OrderedDict
from collections import abc
from sympy import Integer
from sympy.core.singleton import Singleton
from sympy.core.compatibility import with_metaclass, is_sequence
from sympy.core import Basic, sy... |
#!/usr/bin/env python
"""
@package mi.dataset.parser
@file marine-integrations/mi/dataset/parser/phsen_abcdef_dclpy
@author <NAME>
@brief Parser for the phsen_abcdef_dcl dataset driver
Release notes:
initial release
"""
import re
from mi.core.log import get_logger
from mi.core.common import BaseEnum
from mi.core.in... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
"""RAMSES RF - a RAMSES-II protocol decoder & analyser."""
import re
from types import SimpleNamespace
__dev_mode__ = False
DEV_MODE = __dev_mode__
def slug(string: str) -> str:
return re.sub(r"[\W_]+", "_", string.lower())
DEVICE_CLASS = SimpleNamespace(
B... |
"""
General test cases for various un-categorized functions / classes e.g. :py:func:`.chunked` and :py:func:`.inject_items`
**Copyright**::
+===================================================+
| © 2019 Privex Inc. |
| https://www.privex.io ... |
#!/usr/bin/env python3
"""
cifar10.py
CNN for CIFAR-10 dataset
<NAME>
06/30/2020
References:
https://keras.io/getting_started/intro_to_keras_for_engineers/
https://keras.io/guides/training_with_built_in_methods/#api-overview-a-first-endtoend-example
https://keras.io/api/
"""
import numpy a... |
import abc
import copy
import functools
import numpy as np
import os
import pickle
import tensorflow as tf
from ..data.load_20questions import get_augmented_feature_weights
from ..methods.iterators import (leave_p_groups_out_indices, leave_p_out_indices,
leave_out_2_words_all_questions_indices)
from ..methods.mode... |
#! /usr/bin/python3
##############################################################
## User-centric QoS-based pricing model ##
## Authors: <NAME>, <NAME> ##
## Year: November, 2019 ##
##############################################################
from pyes.base i... |
# Copyright (c) 2020, <NAME> <<EMAIL>>
# Licenced under the BSD 2-Clause License.
import torch
import numpy as np
from Verifiers.Layer import Layer
from Verifiers.Controller import Controller
from Verifiers.Bounds import Bounds
import pdb
epsilon = 1e-12
def get_bounds_xy(l_x, u_x, l_y, u_y):
alpha_l = l_y
b... |
import json
import traceback
from datetime import timedelta
from urllib.parse import quote
import numpy as np
import pandas as pd
import requests
from django.core.cache import cache
from django.utils import timezone
from loguru import logger
from pals.PLAGE import PLAGE
from pals.common import DATABASE_REACTOME_CHEBI,... |
# coding: utf-8
# athor: Keavnn
import time
import random
import requests
from pprint import pprint
from absl import app, flags, logging
from absl.flags import FLAGS
from c6 import Connect6
from partial_env import PartialC6
from attack_env import AttackC6
from zzy.zzy_bot_for_test import ZZY_Bot
d... |
import logging
from datetime import timedelta, datetime
from math import log10
import discord, schedule
from discord.ext import commands
from config import *
from messages.farm import *
from messages.core import MSG_CMD_INVALID
from objects.economy.account import EconomyAccount
from objects.economy.farm.farm import F... |
import glob
import os
import re
import socket
import subprocess
from platform import system
from time import time, strftime, localtime
from pathlib import Path
import psutil
from termcolor import colored
## Importing my code
from common.model_stuff import parse_params_from_model
from common.files import write_to_file
... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Created on 2021/10/19
@author: <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
"""
import os
import pickle
from collections import namedtuple, Counter
from multiprocessing.pool import Pool
from typing import Tuple, Optional, Union, Dict
import numpy as np
import pandas as pd
from... |
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Jun 5 2014)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
###########################################################################
impo... |
"""Add Deep Learning Indaba Application Form
Revision ID: 1c3fda18bad6
Revises: <PASSWORD>
Create Date: 2020-03-26 14:39:36.628724
"""
# revision identifiers, used by Alembic.
revision = '1c3fda18bad6'
down_revision = 'c3c5ef958ca1'
from alembic import op
import sqlalchemy as sa
from sqlalchemy import orm
from sql... |
"""
Module containing functions to act on the Spatial Fourier Coefficients.
`BEMA`
Perform Bandwidth Extension for Microphone Arrays (BEMA) spatial
anti-aliasing.
`FFT`
Perform real-valued Fast Fourier Transform (FFT).
`iFFT`
Perform inverse real-valued (Fast) Fourier Transform (iFFT).
`spatFT`
Per... |
import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
import pickle
from helper import showImages, showSidebySide
from camera_calibrate import undistortImages
from threshold_binary import combineGradients, combineGradientsOnS, combineGradientsAndColor,combineYellowWhiteOnLabLuv, combineGradientsAndL... |
# coding:utf8
"""工具模块,兼容python2/3
"""
from __future__ import unicode_literals
from __future__ import print_function
import hashlib
import base64
import time
import json
import sys
import os
import re
import socket
import logging
import datetime
# try:
# import __builtin__ as builtins # py2.6
# except ImportError:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.