text
stringlengths
3.07k
22.1k
from collections import OrderedDict from operator import mul try: reduce except NameError: from functools import reduce import numpy as np from .shape_fitter import ChromatogramShapeModel from .spacing_fitter import ChromatogramSpacingModel from .charge_state import UniformChargeStateScoringModel from .isotop...
import argparse import logging import sys from collections import OrderedDict # ========================= # Extension of tf.app.flags # ========================= class LineArgumentParser(argparse.ArgumentParser): """ Object for parsing command line strings into Python objects. Inherits from `argparse.Argume...
import numpy as np from matplotlib import docstring from matplotlib.contour import ContourSet from matplotlib.tri.triangulation import Triangulation @docstring.dedent_interpd class TriContourSet(ContourSet): """ Create and store a set of contour lines or filled regions for a triangular grid. ...
# 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...
#!/usr/bin/python #-*- coding: utf-8 -*- # Video 25 FPS, Audio 16000HZ import torch import numpy import time, pdb, argparse, subprocess, os, math, glob import cv2 import python_speech_features from scipy import signal from scipy.io import wavfile from SyncNetModel import * from shutil import rmtree # ==============...
""" Generate synthetic networks """ import numpy as np from scipy.special import expit from sklearn.utils import check_random_state __all__ = ['simple_dynamic_multilayer_network', 'simple_dynamic_network', 'dynamic_multilayer_network'] def multilayer_network_from_dynamic_latent_space(X, lmbda, delta, ...
import collections import numpy as np from dm_control.mujoco.wrapper import mjbindings IKResult = collections.namedtuple("IKResult", ["qpos", "err_norm", "steps", "success"]) def indexer(env, names): indices = [] for name in names: indices.append(env.sim.model.joint_name2id(name)) return indic...
import tensorflow as tf import tensorflow.contrib.layers as layers import tensorflow.contrib.slim as slim from tensorflow.python.ops import math_ops from lib.utils import rnn_cell import numpy as np from util import log def lrelu(x, leak=0.2, name="lrelu"): with tf.variable_scope(name): f1 = 0.5 * (1 + le...
import os import sys from bsw_code_gen import BSWCodeGen from cffi import FFI from importlib import import_module from io import StringIO from math import ceil from re import sub from unittest.mock import MagicMock from pycparser.c_ast import FuncDecl, NodeVisitor from pycparser.c_generator import CGenerator as Gener...
from maze import * import numpy as np def get_policy_and_pathM(env, horizon, start, startM, weights): T = horizon pathM = [] #Position of player state_new = env.map[start] #Position of minotaur stateM_new = env.mapM[startM] for t in range(0, T): #Control if one step...
from .base import LegistarScraper, LegistarAPIScraper from lxml.etree import tostring from collections import deque from functools import partialmethod import requests from urllib.parse import urljoin class LegistarBillScraper(LegistarScraper): def legislation(self, search_text='', created_after=None, ...
''' viewprobe creates visualizations for a certain eval. ''' import re import numpy from scipy.misc import imread, imresize, imsave import visualize.expdir as expdir import visualize.bargraph as bargraph import settings import numpy as np # unit,category,label,score replacements = [(re.compile(r[0]), r[1]) for r in [...
""" Download images from latitude and longitude bounding boxes in flickr """ import argparse import os import csv import xml.etree.ElementTree as ET from typing import Optional, Tuple import requests from tqdm import tqdm from concurrent.futures import ThreadPoolExecutor, as_completed from threading import Lock from da...
import time from decimal import Decimal import pytest from ..intset import IntegerSetSpecifier, _parse_spec_part @pytest.mark.parametrize( "spec", ["*", "1-2", "2-3", "1-9", "1", "2", "1,2,3", "1-1", "1-9/3", "*/42"] ) def test_can_be_constructed_from_valid_spec(spec): IntegerSetSpecifier(spec, 1, 9) @pyt...
"""Builds command for emulator.""" from __future__ import annotations import abc import argparse import os from dataclasses import dataclass from enum import Enum from typing import Dict from emulation_system.consts import ( PRODUCTION_MODE_NAME, DEVELOPMENT_MODE_NAME, LATEST_KEYWORD, ROOT_DIR, ) fro...
import logging import posixpath from typing import List from deprecated import deprecated import rdflib from rdflib import URIRef from .config import getHomespace, string_equal from .config import hasHomespace from .constants import * from .property import Property, OwnedObject, URIProperty from .sbolerror import SBO...
#!/usr/bin/env python # coding: utf-8 # Helper functions for synthetic seismogram calculation # In[1]: import numpy as np import gc # In[2]: def separation_distances_vectors(receiver, source): ''' takes the positions of the sources and receivers and returns array of distances between every combinati...
import datetime import os import re import pamela from urllib.parse import urlsplit, urlunsplit from flask import Flask, request, session, render_template, redirect, url_for, flash from ucam_wls import LoginService, AuthPrincipal, AuthRequest, load_private_key from ucam_wls.errors import InvalidAuthRequest, Protoco...
import matplotlib.pyplot as plt import numpy as np import astropy.io.fits as fits import pytest try: import pysynphot _HAS_PYSYNPHOT = True except ImportError: pysynphot = None _HAS_PYSYNPHOT = False from poppy import poppy_core, instrument, optics, utils WEIGHTS_DICT = {'wavelengths': [2.0e-6, 2.1e...
import argparse import copy import os from . import log, setup_logger from .auth import parse_authentication from .confluence_api import create_confluence_api from .confluence import ConfluencePageManager, AttachmentPublisher from .config import ConfigLoader, flatten_page_config_list, PageImageAattachmentConfig from ....
# # 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...
import difflib import pwd import string import sys import cracklib import ocflib.misc.mail RESERVED_USERNAMES = frozenset(( # Misc 'Debian-exim', 'Debian-gdm', '_graphite', 'about', 'account', 'accounts', 'admin', 'administrator', 'apphost', 'applicationhost', 'approve...
''' blackbody.py - Color of thermal blackbodies. Description: Calculate the spectrum of a thermal blackbody at an arbitrary temperature. Constants: PLANCK_CONSTANT - Planck's constant, in J-sec SPEED_OF_LIGHT - Speed of light, in m/sec BOLTZMAN_CONSTANT - Boltzman's constant, in J/K SUN_TEMPERATURE - Surface...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from matplotlib import pyplot as plt import tensorflow as tf import seaborn as sb import pandas as pd import numpy as np import math import time import cv2 import os tf.reset_default_graph() gpu_options = tf.G...
# Copyright 2021 The FedLearner 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...
#!/usr/bin/env python3 import socket import struct import array import time import logging import math import numpy as np import subprocess import multiprocessing as mp import wifibroadcast.py_v4l2 as v4l from wifibroadcast.py_v4l2 import Frame from wifibroadcast.py_v4l2 import Control from wifibroadcast.format_as_ta...
#!/usr/bin/env python3 import math import numpy as np from common.numpy_fast import interp from common.cached_params import CachedParams import cereal.messaging as messaging from common.realtime import DT_MDL from selfdrive.modeld.constants import T_IDXS from selfdrive.config import Conversions as CV from selfdrive.co...
import os from pathlib import Path import cv2 import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import interp1d from scipy.signal import resample from utils.sig_proc_utils import notch_filter, baseline_correction def window_slice(data, window_size, stride, channel_mode='channel_last'): a...
import asyncio import datetime import json import logging import random import dateutil.parser import pytz import irc.client import sqlalchemy import common.http import common.time import common.storm import lrrbot.decorators from common import googlecalendar from common import utils from common.config import config ...
from network import PNet,ONet import torch,cv2,itertools from torch.autograd import Variable import torch.nn.functional as F import numpy as np import time from matlab_cp2tform import get_similarity_transform_for_cv2 import math def alignment(src_img,src_pts, crop_size = (112, 112)): ref_pts = np.array([...
from django.urls import reverse_lazy from django.http import HttpResponse from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import Http404 from django.shortcuts import render, get_object_or_404, redirect from django.db.models import Q from django.utils.text import slugify from dj...
import numpy as np import torch import torch.nn as nn from fastprogress import progress_bar, master_bar from src.features_extraction.base import Encoder, Decoder, LossFunction, View from src.test_modules import TestModelMethods from src.utils import reconstruction_loss, get_device, save_to_file, LOG_PATH, FILE_NAME, \...
# -*- coding: UTF8 import timeit import sys from datetime import datetime, date, time, timedelta import elite start = timeit.default_timer() mydb = elite.db() ''' search best deal in my system for a A-B-A route ''' startSystem = "ltt 9810" searchModus = 2 # 1=bestDealFromMySystem 2=findBestDealI...
"""Client for Andesite's HTTP routes. There are multiple client classes in this module. If you just want to use Andesite's HTTP endpoints, use `HTTP`. `HTTPInterface` contains the implementation of the endpoint methods. It's an abstract base class, if you want to inherit its methods you need to implement `AbstractHTT...
import re import asyncio from discord.ext.commands import Bot from discord.ext import commands from dataclasses import dataclass from discord.ext.commands.context import Context from discord.message import Message from .utils import wait_tasks_any, wait_tasks_all @dataclass class ReactMatcher: def __init__(self...
"""Train Job""" from dataclasses import dataclass, field, fields import functools from typing import Callable, Dict, List, Tuple, Iterable import logging import tensorflow as tf from tf_yarn import Experiment from deepr.jobs.base import Job from deepr.hooks.base import EstimatorHookFactory, TensorHookFactory LOGGE...
import errno import json import os import cv2 import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy.misc from scipy.ndimage import rotate from scipy.stats import bernoulli # Some useful constants DRIVING_LOG_FILE = './data/driving_log.csv' IMG_PATH = './data/' STEERING_COEFFICIENT = 0.22...
""" File: candle.py Author: <NAME> Created on: 24/07/21, 8:04 pm """ from typing import Optional, List, Dict, Tuple import datetime from dataclasses import dataclass import requests import brotli import json import enum from alice_blue_api.api import AliceBlueApi @dataclass() class InstrumentCan...
import os import shutil import tempfile from threading import Thread import time import unittest from tornado.ioloop import IOLoop from selenium import webdriver from selenium.common.exceptions import NoAlertPresentException from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By fr...
from __future__ import print_function, unicode_literals import numpy as np import json import os import time import skimage.io as io from utils.read import read_mesh as read_mesh_ """ General util functions. """ def _assert_exist(p): msg = 'File does not exists: %s' % p assert os.path.exists(p), msg def jso...
import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F from logging import getLogger import torch from libcity.model import loss from libcity.model.abstract_traffic_state_model import AbstractTrafficStateModel class MLP(nn.Module): def __init__(self, ninp, nhid, nout, nlayers, ...
import os from time import time import numpy as np import torch # from torch.utils.tensorboard import SummaryWriter from tensorboardX import SummaryWriter from utils.utils import computeMedianError, computeKittiMetrics, get_transform2 from utils.losses import supervised_loss, unsupervised_loss from utils.utils import...
# Distributed under the terms of the BSD 3-Clause License. # The full license is in the file LICENSE, distributed with this software. # # Author: <NAME> <<EMAIL>> # Copyright (c) 2020, European X-Ray Free-Electron Laser Facility GmbH. # All rights reserved. from numbers import Integral import numpy as np from .func...
# Copyright 2021 QuantumBlack Visual Analytics Limited # # 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 # # THE SOFTWARE IS PROVIDED "AS IS",...
# -*- coding: utf-8 -*- """ Attributes: RE_DNA_PATTERN (SRE_Pattern): Matches any letters that are not valid DNA. """ import re from PyQt5.QtCore import ( Qt, QSignalMapper, QRectF, QPointF ) from PyQt5.QtGui import ( QFont, QTransform, QPainterPath, QPolygonF, QTextCharFormat, ...
#!/usr/bin/env python # -*- coding:utf-8 -*- # Power by <NAME> 2019-01-10 22:41:49 import os import commentjson as json import sys import time import random import warnings import numpy as np import shutil import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torchvision...
import subprocess from tqdm import trange from copy import deepcopy hw = 8 hw2 = 64 board_index_num = 38 dy = [0, 1, 0, -1, 1, 1, -1, -1] dx = [1, 0, -1, 0, 1, -1, 1, -1] def digit(n, r): n = str(n) l = len(n) for i in range(r - l): n = '0' + n return n all_chars = ['!', '#', '$', '&', "'", '...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from bs4 import BeautifulSoup import requests import re import sys import time import os import signal import json import progressbar from progressbar import AnimatedMarker, Bar, BouncingBar, Counter, ETA, \ AdaptiveETA, FileTransferSpeed, FormatLabel, ...
# ElectrumSV - lightweight Bitcoin SV client # Copyright (C) 2019-2020 The ElectrumSV Developers # Copyright (C) 2012 <EMAIL>v<EMAIL> # # 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...
from __future__ import print_function import httplib2, os, sys from apiclient import discovery from oauth2client import client from oauth2client import tools from oauth2client.file import Storage import datetime CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(CURRENT_DIR, "....
from __future__ import absolute_import import string import itertools import argparse from cryptography.fernet import Fernet import pandas as pd import os import logging from hoover.anon.utils import load_key_to_decrypt_anon, decrypt_anon, kept_anonymized_tweet_objects_list, \ kept_tweet_objects_list, removed_tweet...
import csv import numpy as np import re import nltk import pickle from pathlib import Path from bs4 import BeautifulSoup from gensim.models import word2vec from nltk.corpus import stopwords from sklearn.cluster import MiniBatchKMeans from matplotlib import pyplot as plt, cm from sklearn.manifold import TSNE from sklear...
import json import logging import pytest from unittest.mock import ANY, MagicMock from tests.mock_backendselector import BackendSelectorMock from whirlpool.aircon import Aircon, FanSpeed, Mode from . import MockResponse pytestmark = pytest.mark.asyncio ACCOUNT_ID = 111222333 SAID = "<KEY>" AC_NAME = "TestAc" DATA1...
# Copyright 2014 devbliss GmbH # # 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,...
"""Base module containing some utility functions, exceptions and low level library import. """ from pprint import pprint from suitesparse_graphblas import lib, ffi from numba import njit __all__ = [ "lib", "ffi", "NULL", "GraphBLASException", "NoValue", "UninitializedObject", "InvalidObje...
from django.shortcuts import render from django.views import View from django import http from django.core.paginator import Paginator, EmptyPage from django.utils import timezone from django_redis import get_redis_connection # Create your views here. from meiduo_mall.utils.response_code import RETCODE from contents.uti...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import unittest from hypothesis import given import hypothesis.strategies as st from caffe2.python import core, utils import caffe2.python.hypothesis...
# ============================================================================ # chain.py -- Chain functions # ---------------------------------------------------------------------------- # Author: <NAME>, <NAME>, Purdue University # Copyright (c) 2012 Purdue University # -----------------------------------------------...
import base64 import binascii import json import logging import queue import re from threading import Thread import time import urllib.parse import requests import rsa headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36' } logger ...
""" Summary mode, which displays an overview of the corpus """ import os import time from typing import List, Optional, Callable import click import sys from mnotes.environment import MnoteEnvironment, pass_env, echo_line from .common import CreationFixer, AuthorFixer, TitleFixer, FilenameFixer, IdFixer, Fixer fr...
# =============================================================================== # Copyright 2012 <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/...
""" Matrix/Vector-Valued Linear Functions: Parents In Sage, matrices assume that the base is a ring. Hence, we cannot construct matrices whose entries are linear functions in Sage. Really, they should be thought of as the tensor product of the `R`-module of linear functions and the `R`-vector/matrix space, with the la...
import serial import time import threading import sys import traceback from teachablerobots.src.Communicate import AppComm from teachablerobots.src.Sense import Sense from teachablerobots.src.Hardware import * import ast from multiprocessing import Process, Queue, Event, Value, Lock, Manager from ctypes import c_char_...
""" Jasper for ASR, implemented in Chainer. Original paper: 'Jasper: An End-to-End Convolutional Neural Acoustic Model,' https://arxiv.org/abs/1904.03288. """ __all__ = ['Jasper', 'jasper5x3', 'jasper10x4', 'jasper10x5', 'conv1d1', 'ConvBlock1d', 'conv1d1_block', 'JasperFinalBlock'] import os impor...
# This code is based on https://github.com/kcg2015/Vehicle-Detection-and-Tracking by <NAME> try: import numpy as np import cv2 from numpy import dot from scipy.linalg import inv, block_diag from scipy.optimize import linear_sum_assignment import matplotlib.pyplot as plt from collectio...
import sys import os import logging import datetime import json import click import pytz import dateparser import t # import requests # import ics LOG_LEVELS = { "DEBUG": logging.DEBUG, "INFO": logging.INFO, "WARNING": logging.WARNING, "WARN": logging.WARNING, "ERROR": logging.ERROR, "FATAL": ...
""" Input Output functions""" import cv2 import gdal import os import sys import numpy as np from src.gridding import gridding from src.bf_grid import bf_grid from src.bf_grid import test_grid import math import json import ogr import osr import logging # storing geo-referencing information def getGe...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Client configuration management. This module holds the code for detecting and configuring the current client and it's output directories. It is responsib...
from keri import kering from keri.app import keeping, habbing from keri.core import coring, eventing from keri.db import escrowing, dbing, subing, basing from keri.help import helping def test_broker(): with dbing.openLMDB() as db: bork = escrowing.Broker(db=db, subkey="test") assert isinstance(b...
# -*- coding: utf-8 -*- """Simple stats of PostgreSQL tables. """ import datetime import logging import click import jinja2 import psycopg2 import yaml import sandboxlib query_template_00 = """/** * Show tables in the given schema. * * @query: schemaname */ SELECT relname FROM pg_catalog.pg_stat_user_tables...
# web-app for API image manipulation from flask import Flask, request, render_template, send_from_directory,url_for import os from PIL import Image import numpy as np import json # urllib.request to make a request to api import urllib.request app = Flask(__name__) APP_ROOT = os.path.dirname(os.path.abspath(__file_...
import random from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from django.core.urlresolvers import reverse from django.core.exceptions import PermissionDenied from django.contrib.auth.decorators import login_required from django.core.exceptions import ObjectDoesNotExist f...
import numpy as np from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_equal, assert_almost_equal) from pystruct.datasets import (generate_big_checker, generate_blocks_multinomial, generate_blocks) from pystruct.utils import (exhaus...
#!/usr/bin/env python import json import os import sys from pathlib import Path from examples import ExampleConfig from ocean_lib.config_provider import ConfigProvider from ocean_lib.models.bfactory import BFactory from ocean_lib.models.bpool import BPool from ocean_lib.models.data_token import DataToken from ocean_li...
import sys import os import logging import subprocess import time import shlex # from arm.config.config import cfg from arm.ripper import utils # noqa: E402 from arm.ui import db def makemkv(logfile, job): """ Rip Blurays with MakeMKV\n logfile = Location of logfile to redirect MakeMKV logs to\n job...
# -*- coding: utf-8 -*- import pytest import pandas as pd from bio_hansel.qc import QC from bio_hansel.subtype import Subtype from bio_hansel.subtyper import absent_downstream_subtypes, sorted_subtype_ints, count_periods, empty_results, subtype_sets, missing_nested_subtypes from bio_hansel.utils import find_inconsist...
import torch import torch.nn as nn from math import sqrt from IPython import embed import sys sys.path.append('./') from .recognizer.tps_spatial_transformer import TPSSpatialTransformer from .recognizer.stn_head import STNHead import torch.nn.functional as F class Conv_ReLU_Block(nn.Module): def __init__(self): ...
# coding:utf-8 import os import gc import numpy as np import pandas as pd from sklearn.pipeline import Pipeline from scipy.special import logit, expit from sklearn.metrics import roc_auc_score from bayes_opt import BayesianOptimization from category_encoders import TargetEncoder from sklearn.linear_model import Logist...
from PIL import Image from tools.image import sliding_window, draw_red_square, create_dump_folder_for_images, convert_image_to_array, get_percentage_of_white from tools.classifier import get_trained_classifier from sklearn.svm import SVC from sklearn.neighbors import KNeighborsClassifier from sklearn.neural_network imp...
#!/usr/bin/env python # -*- coding: utf-8 -*- # -*- coding: cp936 -*- import numpy as np from freetype import * import math import os import codecs import copy import chardet def setup(): if not os.path.exists('ttf'): os.makedirs('ttf') if not os.path.exists('font'): os.makedirs('font') if not os.path....
''' show_nve.py IOSXE parsers for the following show commands: * 'show nve peers' * 'show nve peers interface nve {nve}' * 'show nve peers peer-ip {peer_ip}' * 'show nve peers vni {vni}' * 'show nve interface nve {nve_num} detail' * 'show nve vni' ''' # Python import re # Metaparser from ge...
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Core\sims4\collections.py # Compiled at: 2019-08-06 02:03:19 # Size of source mod 2**32: 12580 bytes from _...
import logging from json import JSONDecodeError from time import sleep from typing import Any, Callable, Dict, Optional, Tuple, Union import requests from oauthlib.oauth2 import LegacyApplicationClient, TokenExpiredError from requests_oauthlib import OAuth2Session from pyatmo.exceptions import ApiError from pyatmo.he...
#!/usr/bin/env python3 # # This script bootstraps an NSQ cluster in EC2 and runs benchmarks. # # Requires python3 and the following packages: # - boto3 # - paramiko # - tornado # # AWS authentication is delegated entirely to the boto3 environment, see: # # https://boto3.amazonaws.com/v1/documentation/api/latest/...
import math from functools import lru_cache from typing import Optional, Tuple import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Beta, Dirichlet, MultivariateNormal, Normal from torch.distributions.distribution import Distribution from ai_traineree.networks import Netw...
import argparse import torch import pytorch_lightning as pl from torch.utils.data import DataLoader from datasets.coco_person import build as build_coco_person from datasets import get_coco_api_from_dataset import util.misc as utils from models import lit_vitdetr # PPP Fixes issue with "too many files open" duri...
import hashlib import six from celery import Celery from celery.utils.collections import force_mapping from dagster_celery.config import CeleryConfig, CeleryK8sJobConfig from dagster_graphql.client.mutations import handle_execute_plan_result, handle_execution_errors from dagster_graphql.client.util import parse_raw_lo...
#! python3 import os import sys import collections import configparser from PyQt5 import QtCore, QtGui, QtWidgets, uic from PyQt5.QtCore import pyqtSlot, pyqtSignal, QThread from PyQt5.QtWidgets import QApplication, QWidget, QMessageBox, QFileDialog import jlink import device ''' from MCUProg_UI impo...
# Copyright (c) 2019, 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 ...
# © 2020 <NAME> <<EMAIL>> import enum import random import time from dataclasses import dataclass, field from functools import partial from typing import List, Generic, TypeVar, Optional import wand.image from flask import request from . import api, encode from .format import SIZE, MAX_DESIGN_TILES from utils import...
import gevent import sys import pickle from JumpScale import j from gevent.server import StreamServer #from MessageRouter import MessageRouter class TCPSession(): """ is the baseclass to do socket handling for the worker or manhole """ def __init__(self, addr, port, socket): self.addr = a...
# -*- coding: utf-8 -*- """ Created on Fri Jan 12 10:18:07 2018 @author: cmi001 https://pcjericks.github.io/py-gdalogr-cookbook/index.html https://pcjericks.github.io/py-gdalogr-cookbook/geometry.html https://gis.stackexchange.com/questions/301729/get-a-bounding-box-of-a-geometry-that-crosses-the-antimeridian-using-...
# Copyright (c) 2020, 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 from __future__ import print_function as _ from six import string_types as _string_types import logg...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import pandas as pd import numpy as np import seaborn as sns from lightfm.evaluation import precision_at_k, recall_at_k def model_perf_plots(df): """Function to plot model performance metrics. Args: df (pa...
''' Created on 2015-03-27 @author: <NAME>, <NAME> ''' # Force matplotlib to not use any Xwindows backend, which should enable # the script to be run on high-performance computing cluster without error import matplotlib.pyplot as plt import matplotlib.patches as mpatches import matplotlib.lines as mlines from scipy.clu...
#!/usr/bin/env python import os import pathlib import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from tensorflow.keras import layers from tensorflow.keras import models # Set the seed value for experiment reproducibility. seed = 42 tf.random.set_seed(seed) np.random.seed(seed) DATASET_PATH...
import numpy as np import scipy.interpolate as scpinterp # ############################################### # ############################################### # CrystalBragg # ############################################### # ############################################### # #################################...
# -*- coding: utf-8 -*- """ Created on Tue Mar 23 09:11:19 2021 @author: Bosec """ # -*- coding: utf-8 -*- """ Created on Sun Nov 15 19:11:14 2020 @author: Bosec """ from torch.utils.data import DataLoader import os import numpy as np import pandas as pd from model import train_NN, predict, fit from model_helper i...
# Copyright 2020-2021 Huawei Technologies Co., Ltd # # 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 -*- import argparse import sys import subprocess import os import numpy as np import matplotlib.pyplot as plt plt.switch_backend('agg') import gc import DatasetMaker as Dataset import CNNmodel as Model class LearningMode: def __init__(self, args): self.dataset = args.dataset ...