text
stringlengths
3.07k
22.1k
import collections import logging import typing from enum import Enum from typing import TYPE_CHECKING, Any, List, Type, TypeVar, Union, no_type_check import pydantic from pydantic import DictError, Extra, ValidationError, validator # noqa: F401 from pydantic.class_validators import make_generic_validator KT = TypeV...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Copyright (c) 2019 by Inria Authored by <NAME> (<EMAIL>) License agreement in LICENSE.txt """ import numpy as np import torch import torch.nn as nn #%% The following implements the MCEM algorithm for audio-only VAE class MCEM_algo: def __init__(self, X=None, W=N...
#!/usr/bin/python #-*- coding: utf-8 -*- import torch import torchaudio import torch.nn as nn import torch.nn.functional as F import numpy, math, pdb, sys, random import time, os, itertools, shutil, importlib from pretrained_voxceleb_model.tuneThreshold import tuneThresholdfromScore from pretrained_voxceleb_model.Data...
from pytz import timezone from transtory.common import DatabaseOpsBase, singleton from transtory.common import DateTimeHelper from .configs import get_datetime_helper from .configs import logger from .configs import ShmSysConfigs, get_configs from .publicdata import ShmPublicDataApp, get_public_data_app from .dbdefs...
# -*- coding: utf-8 -*- import distutils import sys from collections import deque from .. import strategies from . import base, dictsource try: from collections.abc import MutableSequence except ImportError: from collections import MutableSequence __all__ = ['StackedConfig'] PY35 = sys.version_info[0:2] >=...
""" Code Adapted from: https://github.com/sthalles/deeplab_v3 Copyright 2020 Nvidia Corporation 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...
# 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...
#!/usr/bin/env python # ############################################################################# # Copyright : (C) 2015 by Teledomic. # # 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 ...
#! /usr/bin/python import sys import os def getInvisibleNodes(prefix, labels): return '{%s [shape=point width=0 style=invis]};' % ",".join([prefix + "_" + sID for sID in labels]) def getSpouseRank(a, spouseConnection, b): return '{rank=same; %s -- spouse_%s -- %s};' % (a, spouseConnection, b) def getConnection(...
# Copyright 2016 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. import sys,logging,datetime,itertools,math import numpy as np from AbstractSolver import AbstractSolver from scipy import sparse from sklearn.linear_model import Ridge try: import...
#!/usr/bin/env python3 # PYTHON_ARGCOMPLETE_OK """ASF Sentinel-1 Metadata Download tool. Small Python tool (`asfsmd`) that allows to download XML files containing Sentinel-1 products metadata from the ASF archive. Sentinel-1 products are stored in the ASF arcive as ZIP files that are quite large because they comntai...
import pytest import numpy as np import astropy.units as u from astropy.nddata import StdDevUncertainty from ..spectra import Spectrum1D, SpectralRegion def test_lower_upper(): # Spectral region with just one range (lower and upper bound) sr = SpectralRegion(0.45*u.um, 0.6*u.um) assert sr.lower == 0.45...
import numpy as np from expyfun.stimuli import TrackerUD, TrackerBinom, TrackerDealer, TrackerMHW from expyfun import ExperimentController import pytest from numpy.testing import assert_equal from expyfun._utils import requires_opengl21 def callback(event_type, value=None, timestamp=None): """Callback.""" pr...
from pybindgen.typehandlers.base import Parameter, ReturnValue, \ join_ctype_and_name, CodeGenerationError, \ param_type_matcher, return_type_matcher, CodegenErrorBase, \ DeclarationsScope, CodeBlock, NotSupportedError, ForwardWrapperBase, ReverseWrapperBase, \ TypeConfigurationError from pybindgen.cp...
from typing import TYPE_CHECKING, List, Callable, NamedTuple, Optional from maestro.core.query.metadata import Query from maestro.core.metadata import ( ItemChange, ConflictType, Operation, ItemVersion, ) if TYPE_CHECKING: # pragma: no cover from maestro.core.store import BaseDataStore from ma...
import os, re import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as mcolors from matplotlib import rcParams from matplotlib.ticker import MultipleLocator from floris.utils.tools import valid_ops as vops root = os.path.dirname(os.path.dirname(__file__)) # +++++++++++++++++...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2018 University of Groningen # # 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 # # U...
import os from pathlib import Path import typing as t from uuid import uuid4 import pytest from pytest import param import shelmet as sh parametrize = pytest.mark.parametrize def lines_as_text(items: t.Iterable) -> t.List[str]: lines = os.linesep.join(str(item) for item in items) return lines.splitlines(k...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of my-weather-indicator # # Copyright (c) 2012 <NAME> <a.k.a. atareao> # # 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 w...
"""Tests covering the v2 ClusterCTRL driver.""" from clusterctrl.driver import ( BoardType, ClusterCTRLv2Driver, Cmd, Data, Reg, ) import pytest class MockSMBus(object): """An object that looks like smbus[2].SMBus. This object builds an append/mock log of all i2c calls performed, allowin...
''' Performs analysis on segmented images, calculating the DSC and GTC. The result is creating analysis files, which are tab delimited tables. ''' import numpy as np import skimage.io, os, os.path, re, sys, enum, itertools import common def gtc(files): ''' Takes in a list of files to calculate the ...
#!/usr/bin/env python2 from __future__ import print_function, division, generators import argparse, json, os, subprocess, re, sys, time VERBOSITY = 1 def info(*things): print('[INFO]:', *things, file=sys.stderr) def warn(*things): print('[WARNING]:', *things, file=sys.stderr) class Alignment(object): def __init...
import json from datetime import timedelta from django.contrib.auth.decorators import permission_required from django.contrib.auth.mixins import PermissionRequiredMixin from django.contrib import messages from django.db.models import F, Q from django.shortcuts import HttpResponse, redirect, render from django.urls i...
# Copyright 2019 TerraPower, 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 writi...
# Implementation of waifu2x vgg7 in tinygrad. # Obviously, not developed, supported, etc. by the original waifu2x author(s). import numpy from tinygrad.tensor import Tensor from PIL import Image # File Formats # tinygrad convolution tensor input layout is (1,c,y,x) - and therefore the form for all images used in the...
import numpy as np from loguru import logger from edt import edt from porespy.tools import get_tqdm, get_border from porespy.tools import Results tqdm = get_tqdm() def ibip_gpu(im, dt=None, inlets=None, maxiter=10000): # pragma: no cover """ Performs invasion percolation on given image using iterative image ...
# Copyright 2018 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. """Functions for interfacing with Mororail bugs.""" import logging from googleapiclient.errors import HttpError from common import constants from gae_libs i...
import yaml import json import argparse from tempfile import NamedTemporaryFile from typing import Optional from typing import Set, List, Sequence from functools import partial from mpi4py import MPI from mpi4py.futures import MPIPoolExecutor from ao.parsers import extrinsic_metaparameters from ao.stats import Ann...
__copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and no commercial use is allowed. For any ...
#!/usr/bin/python import elasticsearch import elasticsearch.helpers import logging import socket from ssl import Purpose, create_default_context import os ################################ # # connector config # class SslConnectionConfig: """ SSL connection configuration for ElasticSearch """ def __ini...
#! /usr/bin/env python3 from tools import splitXY, top_nucs, filter_nucs from sklearn.linear_model import LogisticRegression from sklearn.linear_model import ElasticNet from sklearn.model_selection import cross_val_predict from sklearn.model_selection import learning_curve from sklearn.model_selection import Stratifi...
import os import sys from abc import abstractmethod from datetime import datetime from module.MicrocloudchipException.exceptions import * from module.data.microcloudchip_data import MicrocloudchipData from module.label.file_type import FileType, FileVolumeType from module.validator.storage_validator import StorageVal...
import os, time, itertools, pickle import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # G(z) def generator(x): # initializers w_init = tf.truncated_normal_initializer(mean=0, stddev=0.02) b_init = tf.constant_initializer(0.) ...
""" Sensor for checking the status of Hue sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.hue/ """ import asyncio import logging from datetime import timedelta import requests import voluptuous as vol import homeassistant.helpers.config_...
import os import traceback import AudioFiles import Media debug = False logfile = [] if(debug): # During debugging, we just append to a fixed file path. Change this to something appropriate for your # system if needed. logfile.append(open('/volume1/Plex/Library/Application Support/Plex Media Serve...
import os import argparse from datetime import datetime import torch import torchvision.transforms as transforms import torchvision.datasets as datasets import torch.multiprocessing as mp #try: # mp.set_start_method("forkserver") #except RuntimeError: # pass import scipy.optimize import numpy as np from tqdm...
#!/usr/bin/env python # # Created by <NAME> (<EMAIL>) # # Copyright (c) 2015-2016, VeriSign, Inc. # 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...
import torch import torch.nn.functional as F from rlpyt.models.mlp import MlpModel from rlpyt.models.utils import conv2d_output_shape from rlpyt.utils.tensor import infer_leading_dims, restore_leading_dims def weight_init(m): """Kaiming_normal is standard for relu networks, sometimes.""" if isinstance(m, (to...
# -*- coding: utf-8 -*- # # DIMP : Decentralized Instant Messaging Protocol # # Written in 2019 by Moky <<EMAIL>> # # ============================================================================== # MIT License # # Copyright (c) 2019 <NAME> # # Permission is hereby granted, free of char...
import hashlib import logging import os import sys from collections import OrderedDict from glob import glob import matplotlib.pyplot as plt import numpy as np import requests import spacy from tqdm import tqdm from capreolus.utils.loginit import get_logger logger = get_logger(__name__) # pylint: disable=invalid-na...
import dataclasses from fv3fit.keras._models.dense import train_column_model from toolz.functoolz import curry from typing import List, Optional, Sequence, Tuple, Set from fv3fit._shared.config import ( OptimizerConfig, RegularizerConfig, register_training_function, ) from fv3fit.keras._models.shared.clip i...
# This Python file uses the following encoding: utf-8 # !/usr/local/bin/python3.4 #################################################### # <Copyright (C) 2012, 2013, 2014, 2015 <NAME>> # This file is part of MULLPY. #################################################### import os import errno from functools import reduce #...
""" Logic for model creation, training launching and actions needed to be accomplished during training (metrics monitor, model saving etc.) """ import os import time import json import numpy as np import tensorflow as tf from datetime import datetime from tensorflow.keras import Input, Model from src.datasets import l...
from collections import defaultdict, Counter import os from os import path from shlex import quote import struct import hashlib from . import dispatcher from .slow_lzss import decompress from .lowlevel import PrclNodeStruct, PrclChildStruct from .pef_info import suggest_name HEADER_COMMENT = """ # Automated dump of...
import base64 import io import json import os.path as osp import numpy as np import xmltodict import PIL.Image import openslide from labelme._version import __version__ from labelme.logger import logger from labelme import PY2 from labelme import QT4 from labelme import utils from read_mask import read_mask from flag...
# # Copyright (C) [2020] Futurewei Technologies, Inc. # # FORCE-RISCV is 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 # # THIS SOFTWARE IS PR...
# -*- coding: utf-8 -*- #!/usr/bin/env python3 """ Copyright (c) 2020, salesforce.com, inc. All rights reserved. SPDX-License-Identifier: BSD-3-Clause For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause Processing the SQL parse tree structures released by Y...
# This file is part of the Blockchain-based Fair Exchange Benchmark Tool # https://gitlab.com/MatthiasLohr/bfebench # # Copyright 2021 <NAME> <<EMAIL>> # # 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...
import numpy as np import os import pytest from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split from sklearn.model_selection import RandomizedSearchCV, cross_validate import string import tempfile import torch import torch.nn as nn import utils from test_torch_model_base impo...
#!/usr/bin/python # Copyright (C) 2006-2011, University of Maryland # # 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, co...
import md5 from datetime import date from pyramid.view import view_config, forbidden_view_config from pyramid.renderers import get_renderer from pyramid.security import remember, forget, authenticated_userid from pyramid.httpexceptions import HTTPFound, HTTPNotFound from pyramid_simpleform import Form, State from p...
import tensorflow as tf from tensorflow.contrib.image.python.ops import distort_image_ops import math import random def deserialize_image_record(record): feature_map = { 'image/encoded': tf.FixedLenFeature([], tf.string, ''), 'image/class/label': tf.FixedLenFeature([1], tf.int64, -1), 'im...
import math from direct.showbase.DirectObject import DirectObject from direct.interval.LerpInterval import LerpPosInterval import panda3d.core as p3d from hud import Hud from weapon import Weapon def clamp(value, lower, upper): return max(min(value, upper), lower) class PlayerController(DirectObject): BU...
# Copyright 2022 Cortex Labs, 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 wri...
import nltk import numpy as np import os import json import h5py from tqdm import tqdm import torch import torch.utils.data as data class OriginalPrecompDataset(data.Dataset): """ load precomputed captions and image features """ def __init__(self, data_path, data_split, vocab, load_img=Tru...
#!/usr/bin/env python3 import sys #sys.path.append(".") #import argparse import json import os, errno import pandas as pd import numpy as np import torch from torch import optim from . import utils from .train_eval_models import training_phase, evaluation_phase, repair_phase from . import RVAE as outlier_model de...
""" Computing and plot powerspectra and spectrograms. next_power_of_two(): rounds an integer up to the next power of two. nfff_overlap(): computes nfft and overlap based on a requested minimum frequency resolution and overlap fraction. psd(): Compute power sp...
################################################################################ # Copyright (c) 2022 ContinualAI. # # Copyrights licensed under the MIT License. # # See the accompanying LICENSE file for terms. ...
# # Copyright 2017-2018 <NAME>. All rights reserved. # License: https://raw.githubusercontent.com/podgorskiy/impy/master/LICENSE.txt # from setuptools import setup, Extension, find_packages from distutils.errors import * from distutils.dep_util import newer_group from distutils import log from distutils.command.build_...
import pytest from werkzeug.routing import BuildError from flask_unchained.bundles.controller import Controller, Resource from flask_unchained.bundles.controller.utils import ( controller_name, get_param_tuples, get_last_param_name, join, method_name_to_url, url_for, _validate_redirect_url) from py_meta_utils...
# Copyright (C) 2007 <NAME>' <<EMAIL>>. # Use of this source code is governed by MIT license that can be # found in the LICENSE file. from __future__ import print_function import contextlib import functools import logging import multiprocessing import os import shutil import socket import stat import sys import tempfi...
import math from operator import itemgetter import boto3 from infra_buddy.aws.cloudformation import CloudFormationBuddy from infra_buddy.utility import print_utility def _get_all_export_values(client): pass def load_balancer_name(deploy_ctx): # type: (DeployContext) -> str cf = CloudFormationBuddy(dep...
""" Copyright (c) Microsoft Corporation. Licensed under the MIT license. UNITER finetuning for NLVR2 """ import argparse import os from os.path import exists, join from time import time import numpy as np import torch import cv2 as cv from torch.nn import functional as F from torch.nn.utils import clip_grad_norm_ fro...
"""Main flask app for pageserve service. Serve web UI and act as an API gateway to other services. """ # Copyright 2019 The Knative 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 #...
""" (c) 2015, <NAME> <<EMAIL>> ntlmlib is 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...
#!flask/bin/python from flask import Flask, jsonify, request, abort, make_response #import Flask to allow us to interact with APIs using python code # initiale our Flask app server with the __name__ function being our "main method" app = Flask(__name__, static_url_path='', stat...
#!/usr/bin/env python2 """ pith tool A simple command-line tool to execute Python while taking care of the PYTHONPATH. See https://github.com/weegreenblobbie/pith-tool """ __author__ = "<NAME>" __copyright__ = "Copyright 2016 - Present, <NAME> et al." __license__ = "The MIT License (MIT)" __version__ = "0.4" try:...
import argparse import logging import os import os.path as osp import subprocess import time import torch import torch.utils.data as data import torchvision.transforms.functional as F from PIL import Image from tqdm import tqdm from trainer.ExtensibleTrainer import ExtensibleTrainer from utils import options as optio...
# Vibroacoustics # # E.Rohan, V.Lukeš # Homogenization of the vibro–acoustic transmission on periodically # perforated elastic plates with arrays of resonators. # https://arxiv.org/abs/2104.01367 (arXiv:2104.01367v1) import os.path as op import numpy as nm from collections.abc import Iterable from scipy.io import save...
import re import time as tm from typing import Union import pandas as pd from .SPARQL_query import SPARQLquery def expand_name(word: str, prefixes: dict[str]) -> str: """ Function that transforms the prefix using a dictionary of conversions Exemple: expand_name("dbo:PopulatedPlace/areaTotal", {'db...
import pytest from ctypes import c_void_p import cgen import sympy from devito import (Eq, Grid, Function, TimeFunction, Operator, Dimension, # noqa switchconfig) from devito.ir.equations import DummyEq from devito.ir.iet import (Call, Conditional, Expression, Iteration, List, Lambda, ...
# -*- coding: utf8 -*- # Copyright (c) 2021 <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...
#!/usr/bin/env python # encoding: utf-8 # # @Author: <NAME> # @Date: Oct 19, 2017 # @Filename: test_regions.py # @License: BSD 3-Clause # @Copyright: <NAME> from __future__ import division from __future__ import print_function from __future__ import absolute_import import abc import pathlib import matplotlib.pyplo...
from datetime import timedelta import numpy as np from astropy.visualization import ZScaleInterval from astropy.io import fits import numba import astropy.constants as c import urllib from astropy.time import Time from datetime import datetime earth2sun = (c.R_earth / c.R_sun).value def remove_sip(dict_like): ...
from datetime import timedelta, datetime from django.shortcuts import render, get_object_or_404, redirect from django.core.urlresolvers import reverse from django.http import Http404 from django.contrib import auth from django.contrib import messages from django.utils.translation import ugettext as _ from django.views...
# Jeu de serpent simple en Python 3 # By Mona#6669 import turtle import time import random delay = 0.1 level = 1 # Score score = 0 high_score = 0 # Mise en place de l'affichage wn = turtle.Screen() wn.title("Snake Game by Mona#6669") wn.bgcolor("green") wn.setup(width=600, height=600) wn.tracer(0...
""" Test cases for the Comparisons class over the Chart elements """ import numpy as np from holoviews import Dimension, Curve, Bars, Histogram, Scatter, Points, VectorField from holoviews.element.comparison import ComparisonTestCase class CurveComparisonTest(ComparisonTestCase): def setUp(self): "Varia...
from django.core.exceptions import ValidationError from django.db import models from django.db.models import get_model from cyder.base.models import BaseModel from cyder.cydns.domain.models import Domain from cyder.base.mixins import ObjectUrlMixin, DisplayMixin from cyder.cydns.view.models import View from cyder.cydn...
""" The module provides help methods for manipulation with float numbers. The following float formats defined by IEEE 754 standard are supported: * half precision float point format (https://en.wikipedia.org/wiki/Half-precision_floating-point_format) * single precision float point format (https://en.wikipedia.org/wik...
#!/usr/bin/env python3 import numpy as np import pandas as pd import pytest from histogrammar.dfinterface.pandas_histogrammar import PandasHistogrammar from histogrammar.dfinterface.make_histograms import ( get_bin_specs, get_time_axes, make_histograms, ) def test_get_histograms(): pandas_filler = ...
from tensorflow.keras.preprocessing.image import Iterator import cv2 import numpy as np import random class VolumeDataGenerator: def __init__(self, samplewise_center=False, samplewise_std_normalization=False, min_max_normalization=False, scale_co...
from __future__ import absolute_import from typing import Optional, Any, Dict from datetime import datetime from urllib.parse import urljoin from http import HTTPStatus from uuid import UUID import jwt as pyjwt # To avoid redfinition in class from aiohttp import ClientSession, ClientResponse from jwthenticator impor...
from os.path import join from os.path import exists import os from filelock import FileLock from filelock import Timeout from glob import glob import json import pandas as pd import numpy as np from .. import runstatus as rs from .. import runinfo as ri from photon_stream.event_list_reader import EventListReader from ....
import os import os.path import sys import time import __main__ as main import traceback from collections import OrderedDict # This imports so it fails here if stuff is not available import delamo.CADwrap try: import redbaron from . import processor pass except ImportError: sys.stderr.write("RedBaro...
#!/usr/bin/env python3 import logging import threading import sqlite3 as sql import os import subprocess import json logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) logger = logging.getLogger("database") directory = os.path.dirname(os.path.r...
#!/usr/bin/env python3 import sys, os, re, inspect, autoprop from .layers import DictLayer, FileNotFoundLayer, dict_like from ..utils import first_specified from ..errors import ApiError from pathlib import Path from textwrap import dedent from more_itertools import one, first from collections.abc import Iterable cl...
#!/usr/bin/env python3 ############################################################################# ### networkx utilities designed for CARLSBAD bioactivity networks. ### ### <NAME> ### 25 Sep 2013 ############################################################################# import sys,os,re,getopt,types,time,math im...
""" This example renders a simple textured rotating cube. """ import time import glfw import wgpu from wgpu.gui.glfw import update_glfw_canvasses, WgpuCanvas import wgpu.backends.rs # noqa: F401, Select Rust backend import numpy as np # %% Create canvas and device # Create a canvas to render to glfw.init() glfw.E...
import sys, os import configparser import hashlib import optparse import subprocess import pwd def main(): options = parse_options() run_diana_profiles_cluster(options) def parse_options(): ''' This function parses the command line arguments and returns an optparse object. ''' parser = op...
""" File with trajectory written to file: /users/srio/Oasys/tmp.traj wiggler_cdf: Electron beam energy (from velocities) = 3.000355 GeV wiggler_cdf: gamma (from velocities) = 5870.853556 GeV wiggler_cdf: Curvature (min)) = 0.000000 m^-1 wiggler_cdf: (max) 0.199920 m^-1 wiggler_cdf: Radius of curvature (m...
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import sys from PyQt4 import QtCore from PyQt4 import QtGui from csvgenerator import * from database import * class BudgetWidget(QtGui.QWidget): """This is the main Budget widget class which encapsulates the whole app.""" # First get the handle...
from tensorflow import keras from .....core.exceptions import DeephyperRuntimeError from .op.basic import Operation class Node: """This class represents a node of a graph Args: name (str): node name. """ # Number of 'Node' instances created num = 0 def __init__(self, name="", *args...
import matplotlib matplotlib.rcParams['figure.figsize'] = [12, 8] import math import numpy as np from queue import Queue, PriorityQueue import time import matplotlib.patches as mpatches import matplotlib.pyplot as plt from interaction import Interaction from environment import Environment from DelightFish import Fis...
import board, ai class Piece(): WHITE = "W" BLACK = "B" def __init__(self, x, y, color, piece_type, value): self.x = x self.y = y self.color = color self.piece_type = piece_type self.value = value # Returns all diagonal moves for this piece. This should ther...
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,re from waflib import Utils,Task,Errors from waflib.TaskGen import feature,before_method from waflib.Logs import error,warn,debug re_bibunit=re.compile(r'\\(?P<type>...
#!/usr/bin/python # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import argparse import math import cv2 import numpy as np from matplotlib import pyplot as plt debug = False def plt_img(img): """ Quick visualisation of the checked fields. :param img: ...
"""Powerscribe Utility Methods Copyright 2015-2019 <NAME>, MD MS 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 ...
import os from collections import Counter from pathlib import Path from typing import List, Optional, Tuple import numpy as np from tqdm import tqdm from . import ChunkedDataset GIGABYTE = 1 * 1024 * 1024 * 1024 def _compute_path_size(path: str) -> int: """ Compute the total size of the folder, considering...
import json import time import requests import os import datetime as dt import stock_news MY_BOT_TOKEN = os.environ.get("MY_BOT_TOKEN") # use 'export MY_BOT_TOKEN=...' to create your token environment variable request_url = f"https://api.telegram.org/bot{MY_BOT_TOKEN}/getUpdates" send_url = f"https://api.tel...
from collections import deque class Node(object): def __init__(self, is_red, key, value, lch=None, rch=None, parent=None): self.is_red = is_red self.key = key self.value = value self.lch = lch # left child self.rch = rch # right child self.parent = parent def...