text
stringlengths
6.04k
39.5k
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # <NAME> <<EMAIL>> import logging import sys import dask from dask_jobqueue.core import Job, JobQueueCluster from distributed.deploy import Adaptive from distributed.scheduler import Scheduler from bob.extension import rc from .sge_queues import QUEUE_DEFAULT ...
import torch.nn as nn import torch import numpy as np import torch.nn.functional as F from ssd.modeling.multibox_loss import MultiBoxLoss from ssd.module import L2Norm from ssd.module.prior_box import PriorBox from ssd.utils import box_utils from torch.nn.functional import binary_cross_entropy class SSD(nn.Module):...
import os import json import argparse #from time import time import time import cv2 import torch from torch import nn import numpy as np from pycocotools.coco import COCO from pycocotools.cocoeval import COCOeval from visualization import visualize_annotations, add_label from lib.utils.config_parse import cfg_from_fi...
# coding: utf-8 # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. import os import posixpath import numpy as np import pandas import tables import warnings from pyiron_base import Gener...
import logging from abc import ABC, abstractmethod from collections import defaultdict from dataclasses import dataclass, field from typing import ( Callable, Dict, Iterable, List, NamedTuple, Optional, Sequence, Set, Tuple, TypeVar, Union ) from sciencebeam_trainer_delft.se...
#!/usr/bin/python3 import sys, os, argparse, re, functools, pathlib, gzip from requests import Session from copy import deepcopy #import websocket def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def noprint(*args, **kwargs): pass try: from lxml import etree except ImportError: eprint("ERR...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Datafra...
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consi...
# -------------------------------------------------------- # Model from official source: https://github.com/ShoufaChen/CycleMLP # -------------------------------------------------------- import math import torch import torch.nn as nn from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD from timm.models.fe...
#!/usr/bin/env python3 import argparse import sys import os import re import time import json import signal import socket import random import threading import hashlib import base64 import textwrap import tempfile import logging try: import vim except Exception: from vimstub import vim import http.server as...
#!/usr/bin/env python3 import argparse import datetime import glob import hashlib import json import logging import os import typing from enum import Enum import requests import requests.adapters __version__ = "1.0.0" class FixedTimeoutAdapter(requests.adapters.HTTPAdapter): def send(self, *args, **kwargs): ...
""" * Copyright (c) 2021, 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...
# Copyright 2018 MLBenchmark Group. 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 applicable l...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """This module corresponds to the trace directory in idlutils. Traceset (or "trace set"): A set of coefficient vectors defining a set of functions over a common independent-variable domain specified by ``xmin`` and ``xm...
import os import numpy as np from PIL import Image import cv2 import torch from datetime import datetime import sys import math from torchvision.utils import make_grid import torchvision.transforms as transforms def get_timestamp(): return datetime.now().strftime('%y%m%d-%H%M%S') def tensor2img(tensor, out_type=n...
import re import pandas as pd import numpy as np import time import constants import pickle # Cleansing def cleanse(text): """ Clean up the text a little by removing punctuation, extra spaces, new lines, etc. This should be run after split_to_sentences(), tokenize_by_sentence() because I think it removes...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# # MIT License # # Copyright (c) 2020 Airbyte # # 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, pu...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc from enum import Enum import six from cryptography import ut...
# -*- coding: utf-8 -*- """AutoBazaar Search Module. This module contains the PipelineSearcher, which is the class that contains the main logic of the Auto Machine Learning process. """ import gc import itertools import json import logging import os import signal import warnings from collections import defaultdict ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Functions to deal with catalog.""" import os import copy import distutils.spawn from shutil import copyfile import numpy as np from scipy.spatial import cKDTree from astropy.table import Table, Column, vstack from dsigma import helpers from . import hsc from . impo...
# coding:utf-8 """The domain-specific adapters. An adapter is an object that provides domain-specific apis for another object, called adaptee. Examples are: XMLValidator and XMLPacker objects, which provide SciELO PS validation behaviour and packaging functionality, respectively. """ from __future__ import unicode_li...
""" Statistics-related functions. """ # p2.6+ compatibility from __future__ import division, print_function, unicode_literals try: unicode except NameError: unicode = basestring = str xrange = range import numpy as np from .utilities import between import astropy.units as u def _bisect(func, target, xlo=...
#!/usr/bin/env python3 # @Time : 31/5/20 11:07 AM # @Author : fangcheng.ji # @FileName: dataset_mapper.py import copy import logging import numpy as np import torch from fvcore.common.file_io import PathManager from PIL import Image import random from detectron2.data import detection_utils as utils from detectron...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
import copy import os import numpy as np import torch import torch.nn as nn from reinforcement_learning.policy import LearningPolicy from reinforcement_learning.replay_buffer import ReplayBuffer # https://lilianweng.github.io/lil-log/2018/04/08/policy-gradient-algorithms.html class EpisodeBuffers: def __init_...
# __author__ = '<NAME>' # Created 12/7/2017 # Last edit 12/7/2017 #Purpose: #----------------- # (a) To read read the segmented image # To create functions for: # (b) appropritaely assign training data # (c) train the classifier # (c) Following https://github.com/machinalis/sa...
from collections import OrderedDict import torch from torch import nn from torchvision.ops import MultiScaleRoIAlign from torchvision.models.utils import load_state_dict_from_url from torchvision.models.detection.faster_rcnn import FasterRCNN from torchvision.models.detection.backbone_utils import resnet_fpn_backbone...
""" Copyright 2019 ETH Zurich, <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, publish, distribute,...
''' ### # Name: letsencrypt_mgmt_profile.py # Version: 0.9.0 # License: MIT # # Description - # This is a python script used for automatically requesting and renewing certificates # from and via Let's Encrypt. # # Setup - # 1. This content needs to be imported in the Avi Controller in the settings menu #...
#!/usr/bin/env python from glob import glob from accessoryFunctions.accessoryFunctions import * import shutil __author__ = 'adamkoziol' def relativesymlink(src_file, dest_file): """ https://stackoverflow.com/questions/9793631/creating-a-relative-symlink-in-python-without-using-os-chdir :param src_file: ...
import csv import argparse import os import tempfile import json import warnings from subprocess import PIPE, Popen from sys import argv from datetime import datetime import pandas as pd from sklearn.cluster import KMeans import ntpath import webbrowser from distutils.dir_util import copy_tree, remove_tree # HTML temp...
#!/usr/bin/python # -*- coding: utf-8 -*- import datetime import hashlib import random from CTFd import create_app from CTFd.models import Teams, Solves, Challenges, WrongKeys, Keys, Files, Awards app = create_app() USER_AMOUNT = 50 CHAL_AMOUNT = 20 AWARDS_AMOUNT = 5 categories = [ 'Exploitation', 'Reversi...
from django.db.models import Count, Avg, Min, Max from collections import defaultdict from django.shortcuts import render from django.http import HttpResponse from django.views.generic import TemplateView, View from common.models import ReleaseNotes from common.phylogenetic_tree import PhylogeneticTreeGenerator from c...
import pandas as pd import random import datetime import pymongo from pymongo import MongoClient import collections import bson from bson.codec_options import CodecOptions df = pd.read_excel("output.xlsx") conditions_dict = {'Fibroadenoma':0, 'Papilloma':25, 'Condition 1': 50, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Nov 2 14:43:48 2020 @author: afo """ import pandas as pd import os from os import listdir from os.path import abspath, isfile, join from inspect import getsourcefile import operator from math import nan import numpy as np # custom function from get_av...
# -*- coding: utf8 -*- # Copyright 2017 Lockheed Martin 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 ...
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) <NAME> <<EMAIL>> ## This program is published under a GPLv2 license ## Netflow V5 appended by spaceB0x and <NAME> ## Netflow V9 appended ny <NAME> """ Cisco NetFlow protocol v1, v5 and v9 HowTo debug Netfl...
# Electrophysiology # Monodomain with Hodgkin-Huxley model as rhs. This also demonstrates how to pass on algebraic values to the diffusion solver. # The paraview output files will include the selected algebraic values no. 0,1 and 2 of the CellML problem. # Adjust "algebraicsForTransfer" and "statesForTransfer" to sele...
from keras.engine import Input, Model from keras.layers import (Activation, BatchNormalization, Conv3D, Deconvolution3D, Dense, GlobalAveragePooling3D, MaxPooling3D, Permute, PReLU, Reshape, UpSampling3D, multiply, Add) from unet3d.model.blo...
import json import tkinter as tk from tkinter import ttk from tkinter.filedialog import askopenfilename import tweepy from PIL import ImageTk, Image from decouple import config import webbrowser from tweet_reader import convert_js_file, grab_bad_words # Main app class TweetDelete(tk.Tk): def __init__(self, *args,...
# -*- coding: utf-8 -*- # Python2 Compatibility from __future__ import absolute_import, division, print_function, unicode_literals import os import json import conda_content_trust.metadata_construction as cct_metadata_construction import conda_content_trust.common as cct_common import conda_content_trust.signing as ...
from __future__ import division from openconcept.components.motor import SimpleMotor from openconcept.components.splitter import PowerSplit from openconcept.components.generator import SimpleGenerator from openconcept.components.turboshaft import SimpleTurboshaft from openconcept.components.battery import SimpleBatter...
# ============================================================================= # Copyright 2020 NVIDIA. All Rights Reserved. # Copyright 2019 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
# Copyright 2018 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, s...
""" Define core network. Written by <NAME> """ import os import sys import configparser import csv import fiona import time from shapely.geometry import shape, Point, LineString, mapping from shapely.ops import cascaded_union import networkx as nx from rtree import index from collections import OrderedDict CONFI...
# -*- coding: utf-8 -*- # Copyright 2018-2020 Streamlit Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
''' This script is the processing pipeline used to create the "automatic" datasets files shown in DGML. The automatic datasets are those that are not curated but created by this script. There are ___ steps in this pipeline: 1. Get csv files' paths from dataset_path input parameter 2. Filter csv paths according...
#!/usr/bin/env python import argparse import sys import re import yaml type_info = { 'bool' : { 'f_type' : 'logical', 'c_type' : 'logical(C_BOOL)' }, 'void*' : { 'f_type' : 'type(C_PTR)', 'c_type' : 'type(C_PTR)' }, 'func' : { 'f_type' : 'type(C_FUNPTR)', ...
# from .global_variables import * from PyPATools.field import Field from PyPATools.pusher import ParticlePusher import numpy as np # import multiprocessing as mp # import time def track(si, r_start=None, v_start=None, nsteps=10000, dt=1e-12, omit_b=False, omit_e=False): # TODO: For now break if r_start or v_start...
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Copyright 2012-2019 BigML # # 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 requi...
# -*- coding=utf-8 -*- # 1. 裁剪(需改变bbox) # 2. 平移(需改变bbox) # 3. 改变亮度 # 4. 加噪声 # 5. 旋转角度(需要改变bbox) # 6. 镜像(需要改变bbox) # 7. cutout import time import random import cv2 import os import math import numpy as np from skimage.util import random_noise from skimage import exposure d...
""" Script to show the stent model in motion. """ import os import visvis as vv from stentseg.utils.datahandling import select_dir, loadvol, loadmodel from pirt.utils.deformvis import DeformableTexture3D, DeformableMesh from stentseg.utils.visualization import show_ctvolume from stentseg.stentdirect.stentgraph import...
import numpy as np import torch import scipy.fftpack as fftpack from scipy.interpolate import interp1d import torch.nn.functional as F def fftshift1D(tensor:torch.Tensor): ''' shift the origin to corner ''' assert tensor.shape[-1]==2 dim_l = tensor.shape[-2] tensor=torch.roll(tensor,dim_l//2,-2...
import tensorflow as tf from keras.applications.resnet50 import ResNet50 from keras.applications.vgg19 import VGG19 from keras.applications.mobilenet import MobileNet from keras.layers import Flatten, Input from keras.models import Model from keras.preprocessing import image from keras.applications.imagenet_utils impor...
""" Copyright 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, software distrib...
# 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...
import os import time import pickle from dataclasses import dataclass import matplotlib as mpl # mpl.use('Agg') import numpy as np import tqdm import matplotlib.pyplot as plt from scipy.signal import medfilt, savgol_filter from scipy.ndimage import uniform_filter1d, gaussian_filter, median_filter from astropy import...
""" atlas.py provides functions to handle with atlas measurements """ from ripe.atlas.cousteau import AtlasResultsRequest, ProbeRequest from .error import MES_ERR, TIMEOUT_ERR, UNKNOWN_ERR, LATE_ERR, IP_ERR import logging from . import timetools as tt def get_pb(pb_tag="system-v3", is_anchor=False, date=None, asn=Non...
""" Derived module from dmdbase.py for multi-resolution dmd. Reference: - Kutz, <NAME>, <NAME>, and <NAME>. Multiresolution Dynamic Mode Decomposition. SIAM Journal on Applied Dynamical Systems 15.2 (2016): 713-735. """ from __future__ import division from builtins import range from past.utils import old_div import nu...
# Copyright 2016 Intel 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 in wri...
#!/usr/bin/env python # # COPYRIGHT: # The Leginon software is Copyright 2003 # The Scripps Research Institute, La Jolla, CA # For terms of the license agreement # see http://ami.scripps.edu/software/leginon-license # import numpy import pyami.quietscipy import scipy.ndimage from pyami import...
from dateutil.parser import * from django.utils.timezone import get_current_timezone from jsonschema.exceptions import best_match from bestiary.models import Monster, Building, GameItem from herders.models import MonsterInstance, RuneInstance, RuneCraftInstance, MonsterPiece, BuildingInstance, ArtifactInstance, Artifa...
import numpy as np import random import tensorflow as tf import matplotlib.pyplot as plt import scipy.misc import os import csv import itertools import tensorflow.contrib.slim as slim from helper import * from gridworld import gameEnv env = gameEnv(partial=False,size=9) env = gameEnv(partial=True,size=9) class Qnet...
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET ADDITION EXAMPLE DOCS See https://pygame-menu.readthedocs.io/en/latest/_source/add_widgets.html License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 <NAME>. @ppizarror Permiss...
import os from glob import glob import imageio import numpy as np import pandas as pd from imageio import imread from matplotlib import pyplot as plt import seaborn as sns from skimage import segmentation, morphology, exposure from cellpose_applications.utils import segment_imgs, read_to_rgb CHS_MAPPING = {"nuclei": "...
image_path = '/home/feng/workspace/self2noise/s9.tif' # 1000x512x512 experimental dataset training_index = 's9' # the identity for the training, can be a random string model_directory = f'/home/feng/workspace/self2noise/model_noisy_to_clean_model_{training_index}' # saving the model threshold = 1 # bottleneck threshold...
# (╯‵□′)╯︵┻━┻ # 画面分割 import math import cv2 import numpy as np import numpy.linalg as npl tileBackColor = (220, 223, 223) tileBackColorInf = (215, 218, 218) tileSup = (225, 228, 228) horScanY = 640 # verbose print verbose = False def vprint(*o): if (verbose): print(*o) def ptint(pt): return (in...
import json import praw import oauthPS2Bot import os import re import requests import shlex import sqlite3 import sys import time import traceback from datetime import datetime,timedelta import warnings warnings.filterwarnings("ignore") ############################################################################## ##...
### All utility function to obtain perturbation mask import numpy as np import itertools import random import math from utils import * import os import time import scipy.io as scio import datetime import re import matplotlib.pyplot as plt import pylab import os import csv from skimage import transform, filters from...
#!/usr/bin/env python """ Python API using Windows C DLL for Sumix SMX-M8X(C) cameras Requirements: Windows (32 or 64 bit), Python 32-bit (2.7 or 3.4) Notes: if you get WindowsError: [Error 193] %1 is not a valid Win32 application, it means you're using a 64-bit Python with a 32-bit DLL. Try 32-bit Python! """ fro...
from tabulate import tabulate def open_text_file(in_file_name): f = open(in_file_name, "r") return f.read() def sanitise_string(input_string): input_string = input_string.upper() input_string = ' '.join(input_string.split()) input_string = input_string.strip('\n') return input_string #def fin...
import pickle import matplotlib.pyplot as plt import matplotlib.image as mpimg from moviepy.editor import VideoFileClip import cv2 import os import numpy as np import settings import math from settings import CALIB_FILE_NAME, PERSPECTIVE_FILE_NAME def get_center_shift(coeffs, img_size, pixels_per_meter): return np...
import pymysql from STRATEGY.api_strategy import * from multiprocessing import Pool,Pipe,cpu_count,Manager from POSITIONMANAGE.api_position import api_position import json import time def call(number): print(number) def pysql_connect(): db = pymysql.connect("localhost", "root", "<PASSWORD>", "qtsm") curs...
import kaa from kaa.keyboard import * from kaa.ui.dialog import dialogmode from kaa.filetype.default import modebase, keybind from kaa.ui.msgbox import msgboxmode from kaa.command import commandid from kaa.command import norec from kaa.command import norerun from kaa.ui.selectlist import filterlist from gappedbuf.sre_c...
# -------------------------------------------------------- # BEIT: BERT Pre-Training of Image Transformers (https://arxiv.org/abs/2106.08254) # Github source: https://github.com/microsoft/unilm/tree/master/beit # Copyright (c) 2021 Microsoft # Licensed under The MIT License [see LICENSE for details] # By <NAME> # Based...
# Copyright (c) 2014 Mirantis 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 writ...
# -*- coding: utf-8 -*- from crc_ccitt import CRC import struct from utils import hexdump class Device(): def __init__(self, name, signature, pagesize, flashsize, eepromsize, bootsection): self.name=name self.signature=signature self.pagesize=pagesize self.flashsize=flashsize ...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
""" Handle background tasks used by view logic """ from django.db import transaction from django.core.exceptions import ObjectDoesNotExist from seev.apps.core.models import * from seev.apps.catalog.models import * from seev.apps.order.models import * from seev.apps.utils.generators import * from seev.apps.utils.sess...
import open3d as o3d import argparse import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf import json import numpy as np import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) sys.path.append(os.path.dirname(BASE_DIR)) import provider import part_seg_model as m...
# This file is part of QuSoliton: Quantum Soliton toolbox. # # Copyright (c) 2022 and later, <NAME>. # 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 co...
""" StyleMapGAN Copyright (c) 2021-present NAVER Corp. This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, U...
from threading import Thread import gym import numpy as np import torch import ctypes from threading import Thread from typing import Tuple, List from torch import nn from torch.nn import functional as F from torch_spread import NetworkClient, NetworkManager, SpreadModule, Buffer, mp_ctx from torch_spread.buffer_q...
import math import copy import numpy as np import torch import torch.autograd import torch.nn as nn import torch.nn.functional as F from baseline.utils import lookup_sentence, get_version, Offsets PYT_MAJOR_VERSION = get_version(torch) def sequence_mask(lengths, max_len=-1): lens = lengths.cpu() if max_len ...
""" Constructs a data source for the ga4gh server by downloading data from authoritative remote servers. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import gzip import os import requests import shutil import subprocess import tempfil...
# PyCParser - global include wrappers # by <NAME>, 2011 # code under BSD 2-Clause License from cparser import * from interpreter import CWrapValue, _ctype_ptr_get_value, Helpers import ctypes import _ctypes import os import sys import typing if typing.TYPE_CHECKING: import interpreter PY2 = sys.version_info[0] =...
#!/usr/bin/env python """ This script grew-up from test of specific issue - 2021-10-18: Xiaozhe complains that too many pixels outside signal region in ueddaq02 r401 shows up in selection of intensities between 100 and 500 keV. See: - `github: <https://github.com/slac-lcls/lcls2>`_. - `confluence: <https://confluen...
# --- # jupyter: # jupytext: # formats: ipynb,py # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.6.0 # kernelspec: # display_name: deep_ml_curriculum # language: python # name: deep_ml_curriculum # --- # Note dow...
import operator, logging, math, psutil from enum import Enum from repartition_experiments.file_formats.hdf5 import HDF5_manager logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG) logger = logging.getLogger(__name__) class Axes(Enum): i = 0 j = 1 k = 2 class Volume: def __...
#!/usr/bin/env python # Copyright 2017 Johns Hopkins University (<NAME>) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) from __future__ import division import argparse import logging import math import sys from argparse import Namespace import editdistance import chainer import numpy as np import ran...
import codecs import json import numpy as np import os import pickle import random import tensorflow as tf from detext.model.bert import modeling from detext.utils import test_utils from detext.utils import vocab_utils def force_set_hparam(hparams, name, value): """ Removes name from hparams and sets hparams...
import filecmp import json import os import random import shutil import string from contextlib import contextmanager from dataclasses import dataclass from datetime import datetime from enum import Enum from pathlib import Path, PurePath from typing import BinaryIO, Iterator, Optional, Tuple from .logging import log f...
#!/usr/bin/env python # coding: utf-8 # # Developing an AI application # # Going forward, AI algorithms will be incorporated into more and more everyday applications. For example, you might want to include an image classifier in a smart phone app. To do this, you'd use a deep learning model trained on hundreds of tho...
# 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 applicab...
# # Copyright 2010-2015 # import math from PySide import QtGui, QtCore from kraken.ui.backdrop_inspector import BackdropInspector class KBackdropTitle(QtGui.QGraphicsWidget): __color = QtGui.QColor(255, 255, 255) __font = QtGui.QFont('Helvetica', 11) __font.setLetterSpacing(QtGui.QFont.PercentageSpac...
# -*- coding: utf-8 -*- # """ Solve the linearized Ginzburg--Landau problem. """ from scipy.sparse.linalg import LinearOperator import time import numpy as np import cmath import matplotlib.pyplot as pp # from matplotlib import rc # rc( 'text', usetex = True ) # rc( 'font', family = 'serif' ) import meshplex import p...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @author: mosquito @email: <EMAIL> @project: Checker @github: http://github.com/1dot75cm/repo-checker @description: Checker is used to check update for software. @version: 0.4 @history: 0.4 - Add user-agent, gzip, http-proxy, aio support(2016.01.28) 0.3 - Use cl...
""" Tests for the algorithms.spectral submodule """ import numpy as np import scipy from scipy import fftpack import numpy.testing as npt import numpy.testing.decorators as dec import nose.tools as nt import nitime.algorithms as tsa import nitime.utils as utils def test_get_spectra(): """ Testing spectral...