text
stringlengths
3.07k
12.6k
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test Utilities Extended Tag List -------------------------------- """ import unittest from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.primitivedata import Tag, OpeningTag, ClosingTag, \ Null, Boolean, Unsigned, Integer, Real, D...
import pytest from datetime import date,datetime import os import logging from tango import DeviceProxy from ska.scripting.domain import Telescope, SubArray ##SUT imports from ska.scripting.domain import Telescope from resources.test_support.helpers_low import subarray_devices,resource,ResourceGroup,waiter,watch fr...
import logging import os import click import verboselogs from config import Config from stylesheet import (StylesheetAssets, StylesheetAssetsBuilder, StylesheetData) from stylesheet_exceptions import StylesheetException from subreddit import Subreddit def travis_revision_comment(): if no...
# Copyright(c) 2019-2020 Intel Corporation All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of condition...
import numpy as np import math def make_triangle(sx, sy, dx, dy, delta): '''Create a right rectangle, alinged with X and Y axes, with x-side size sX and y-side size sY. Triangle is offset by dX and dY.''' x1 = np.arange(0, sx, delta) y1 = np.zeros(x1.shape) y2 = np.arange(0, sy, delta) x2 = n...
""" Silent Auction python app. Author: <NAME> (<EMAIL>) Date: Oct 7th, 2018 """ import json from flask import Flask, render_template, request global_paddle_number = 0 global_item_id = "" app = Flask(__name__) @app.route('/') def index(): return render_template('login.html') @app.route('/confirmation', method...
"""Creates a certificate if it doesn't exist or is about to expire and uploads the files to S3..""" import boto3 import certbot.main import datetime import os import logging from ._version import __version__ # noqa: F401 # To silence the linter about the unused __version__ (__version__) # We need to go through ext...
# coding=utf-8 # Copyleft 2019 project LXRT. import os import collections import torch import torch.nn as nn from torch.utils.data.dataloader import DataLoader from tqdm import tqdm from param import args from pretrain.qa_answer_table import load_lxmert_qa from tasks.hal_model import HalModel from tasks.hal_data imp...
import gin import torch from torch import nn from .fcnet import IdentityNet @gin.configurable class Discriminator(nn.Module): """Discriminate between inputs. Outputs LOGITS!""" def __init__(self, input_shapes_dict, **kwargs): super(Discriminator, self).__init__() self.input_shapes...
# Author: <NAME> <<EMAIL>> # License: MIT import os import numpy as np import cv2 from itertools import izip from pybot.geometry.rigid_transform import RigidTransform from pybot.utils.db_utils import AttrDict from pybot.utils.dataset_readers import natural_sort, \ read_dir, NoneReader, FileReader, DatasetReader, ...
#!/usr/bin/env python # encoding: utf-8 # # @Author: <NAME> # @Date: Feb 8, 2018 # @Filename: targetdb.py # @License: BSD 3-Clause # @Copyright: <NAME> from __future__ import division from __future__ import print_function from __future__ import absolute_import from sqlalchemy.orm import configure_mappers, relation ...
import os import sublime import linecache from .core.documents import is_at_word, get_position, get_document_position from .core.panels import ensure_panel from .core.protocol import Request, Point from .core.registry import LspTextCommand, windows from .core.settings import PLUGIN_NAME, settings from .core.url import...
import functools import httplib as http import json import operator from copy import deepcopy from django.contrib.auth.decorators import login_required, user_passes_test from django.core.paginator import Paginator, EmptyPage from django.core.urlresolvers import reverse from django.http import HttpResponseBadRequest fr...
import tensorflow as tf def resnet_layer(x, act, training, scope, regularizer = None): """ This returns the output of a block of two 3x3 convolutions summed with a shortcut layer. Args: x : input tensor act : non-linearity training : whether or not we are training (used for batch normalization layers) """ wit...
import functools import json from typing import Dict, Tuple import numpy as np from ..context import ServiceContext from ..controllers.tiles import get_tile_source_options, get_dataset_tile_url from ..errors import ServiceBadRequestError from ..im.cmaps import get_cmaps from ...util.geom import get_dataset_bounds fro...
# -*- coding: utf-8 -*- """ models.py ~~~~~~~~~ application data models """ from enum import Enum from datetime import datetime as dt from sqlalchemy import Column, Integer from sqlalchemy.ext.declarative import declared_attr from application.extensions import db class Base(db.Model): """Convenienc...
# coding: utf-8 from os import path from pickle import Pickler, Unpickler class NullCache(object): def __getattr__(self, item): return None def __setattr__(self, key, value): return class SimpleCache(object): __slots__ = ("_sc_cache", "_sc_threshold", "_sc_key_list") def __init__(...
""" Contains RDKit ligand 2D visualizations (static). """ from collections import defaultdict from rdkit import Geometry from rdkit.Chem.Draw import rdMolDraw2D, IPythonConsole from IPython.display import Image from matplotlib import colors # Set width/height of molecule view IMAGE_WIDTH = 700 IMAGE_HEIGHT = 400 IPy...
import pymongo import gridfs import numpy as np import pickle from bson.errors import InvalidId from bson.binary import Binary from bson.objectid import ObjectId class DataBase(object): def __init__(self, host='localhost', port=27017): # MongoDB host name self.host = host # MongoDB port num...
import numpy as np from scipy.sparse import vstack, csr_matrix import gym, recogym import pandas as pd import math from copy import deepcopy from tqdm import tqdm, trange from recogym import env_1_args, Configuration from recogym.agents import RandomAgent, random_args import sys from multiprocessing import Pool def ge...
""" Job handling for AWS Batch. """ from time import time from typing import Callable, Generator, Iterable, Mapping, List, Optional from ... import hostenv, aws from . import logs, s3 class JobState: """ Query and present AWS Batch job state. Abstracts away some of the AWS Batch job details into a simpl...
import numpy as np import random import dill import copy import torch import torch.nn.functional as F import torch.optim as optim from collections import namedtuple, deque from model import Actor, Critic device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") class OUNoise: """Ornstein-Uhlenbec...
#!/user/bin/env python # coding:utf-8 import sys import os import xlrd import codecs from XlsCommon import * # sys init之后 reload(sys) # coding:utf-8 定义源代码的编码,如果没定义,此源码中是不可以包含中文字符的 # 设置默认的string的编码格式 sys.setdefaultencoding('utf-8') _XlsDir = 'data' # Xls 目录 _OutDir = 'output' # txt 输出目录 _bError = False #是否出错 _Ke...
import numpy as np import pandas as pd import logging from vespid.data.nsf_biblio import solr_to_dataframe, solr_to_dataframe_serial from vespid import setup_logger from datetime import date from dateutil.relativedelta import relativedelta from argparse import ArgumentParser logger = setup_logger() def generate_date...
# -*- coding: utf-8 -*- # # (c) Copyright 2001-2015 HP Development Company, L.P. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any late...
# coding=utf-8 """Authors: <NAME>, <NAME> Copyright (C) 2015 ACK CYFRONET AGH This software is released under the MIT license cited in 'LICENSE.txt' Prepares a set dockers with oneclient instances that are configured and ready to start. """ import copy import os from . import common, docker, dns, worker def client_...
import math from pyteal import ( BitLen, BytesAdd, BytesDiv, BytesMinus, BytesMul, BytesZero, Concat, Exp, Expr, ExtractUint64, If, Int, Itob, Len, Not, ScratchSlot, Seq, Subroutine, TealType, ) from ..inline.inline_asm import InlineAssembly ...
#начни тут создавать приложение с умными заметками from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( QApplication, QPushButton, QWidget, QLabel, QVBoxLayout, QHBoxLayout, QTextEdit, QLineEdit, QListWidget, QInputDialog, QMessageBox) import json '''not...
import typing as tp from time import time from os import path, environ from subprocess import check_call class Job: """Base class for clusters.""" # job name name: tp.Optional[str] = None # number of nodes to request nnodes: int # account to submit the job account: tp.Optional[str] = Non...
import sys import nose.tools import claripy from claripy.bv import BVV, Extract, SignExt, ZeroExt, Concat, SDiv from claripy.errors import ClaripyTypeError, ClaripyZeroDivisionError, ClaripyValueError def test_bv(): a = BVV(1, 8) b = BVV(2, 8) assert a | b == 3 assert a & b == 0 assert a / b ==...
import os import json import math import laspy import geojson import shapely import progressbar import numpy as np from scipy.spatial import KDTree,ConvexHull from shapely.geometry import Polygon,mapping,Point def road_LAS(filename): infile=laspy.file.File('./data/interim/grounded_file_'+filename,mode='rw') point_3d...
#! /usr/bin/env python import json import os from config.settings import base from fabric.api import local from fabric.context_managers import lcd BASE_DIR = os.path.dirname(os.path.abspath(__file__)) def manage(command, args=''): """Dev only - a convenience""" local('{}/manage.py {} {}'.format(BASE_DIR, c...
# Copyright (c) 2018 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 app...
import openpyxl, requests_html, datetime import PySimpleGUI as sg from more_itertools import unique_everseen from boldigger.boldblast_coi import slices from bs4 import BeautifulSoup as BSoup ## funtion to scan the BOLDresutls file and return a list ## of all unique Process ID's found, will also return the workb...
from dataclasses import dataclass, field from datetime import datetime from urllib.parse import urljoin import argparse import asyncio import json import os import ssl import statistics import sys import aiohttp import certifi import yaml SSL_CONTEXT = ssl.create_default_context(cafile=certifi.where()) @dataclass c...
''' Created on Jul 23, 2011 @author: Rio ''' from math import isnan from copy import deepcopy from .import nbt __all__ = ["Entity", "TileEntity"] class TileEntity(object): baseStructures = { "Furnace": ( ("BurnTime", nbt.TAG_Short), ("CookTime", nbt.TAG_Short), ("Item...
# coding: utf-8 import json from dataclasses import dataclass from pathlib import Path from typing import List @dataclass class AppConfig: libre_office_ver: str """Version of Libre Office that is being built such as 7.2""" min_module_links_ver: str """Min version that can be parsed for module_links.jso...
from zipline.api import symbol, schedule_function, order_target_percent, get_datetime, date_rules, time_rules from zipline.finance import commission, slippage from zipline import run_algorithm from zipline.errors import SymbolNotFound import pickle import numpy as np import pandas as pd import pyfolio as pf import matp...
# Copyright (C) 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from comm.Connection import Connection import appdirs import cfg_load import base64 from comm.MultiplexedConnectionMonitor import MultiplexedConnectionMonitor from utils.LockedCounter import LockedCounter from comm.NullConnection import NullConnection import datetime import json import logging import os, os.path from e...
import datetime from typing import Any, Dict, List, Optional, Union import pendulum from logzero import logger from . import api, batch, constants async def get_workflows( cromwell: api.CromwellAPI, submission_time_hours_ago: Optional[int] = None, oliver_job_name: Optional[str] = None, oliver_job_gr...
import aiohttp import asyncio import time from threading import Thread from random import choice, choices from simple_proxy_pool.config import REQUEST_HEADERS from simple_proxy_pool.logger import root_logger, set_logger_config from simple_proxy_pool.spider import XiCiSpider, Spider class ProxyPool(object): def _...
import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import pydub import librosa import multiprocessing from joblib import Parallel, delayed DATA_ROOT = '../data' CPU_COUNT = multiprocessing.cpu_count() def load_audio(path, duration): # duration (ms) audio = pydub.AudioSegment.s...
# -*- coding: utf-8 -*- """ Assembly: cli """ import os import re import sys import click import flask import logging import functools from . import utils import pkg_resources from . import about from .assembly import db from werkzeug import import_string CWD = os.getcwd() SKELETON_DIR = "scaffold" ENTRY_PY = "wsgi....
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") versions = struct( RULES_KOTLIN = struct( urls = [ "https://github.com/bazelbuild/rules_kotlin/archive/v1.5.0-beta-3.zip", ], sha256 = "d8650bb939d...
import sys import re import json if sys.version_info[:2] >= (3, 0): # pylint: disable=E0611,F0401,I0011 from urllib.parse import parse_qs, urlparse else: from urlparse import parse_qs, urlparse from . import g from .pafy import new, get_categoryname, call_gdata, fetch_decode def extract_playlist_id(play...
# -*- coding: utf-8 -*- '''lazily evaluated knives''' from threading import local from itertools import tee, chain from contextlib import contextmanager from stuf.utils import clsname from knife._compat import count class _LazyMixin(local): '''lazy knife mixin''' def __init__(self, *things, **kw): ...
#!/usr/bin/python ''' Author : tom-snow Date : 2022-03-15 13:47:49 LastEditTime : 2022-03-16 23:53:56 LastEditors : tom-snow Description : 自动更新各 TestFlight 公共链接当前的状态并更新文档 FilePath : /awesome-testflight-link/scripts/update_status.py ''' import sqlite3 import asyncio import aiohttp import re, os, sys...
# Copyright [2017] The Climate Corporation (https://climate.com) # # 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 a...
import torch import torch.nn as nn from torchsummary import summary # DEVICE = 'cuda:1' import torch import torch.nn.functional as F class CausalConv1d(torch.nn.Conv1d): def __init__(self, in_channels, out_channels, kernel_size, stride=1, ...
bl_info = { "name": "Leaf", "category": "Render", "author": "wsmind", "blender": (2, 80, 0) } if "bpy" in locals(): import imp imp.reload(camera) imp.reload(cooking) imp.reload(export) imp.reload(image) imp.reload(light) imp.reload(material) imp.reload(objects) imp.r...
# Author: <NAME> # Creation Date: Dec, 05 2020 # Version: 0.1.2 # Revision Date: Dec, 08 2020 # Import libraries import ipaddress import paramiko as pmk import re import time import subprocess def test_ip(deviceip: str) -> dict: """ Take the ip address as an input and check whether its a valid ip or ...
__source__ = 'https://leetcode.com/problems/image-smoother/' # Time: O(n^2) # Space: O(n^2) # # Description: Leetcode # 661. Image Smoother # # Given a 2D integer matrix M representing the gray scale of an image, # you need to design a smoother to make the gray scale of each cell # becomes the average gray scale (roun...
import json import asyncio import aiohttp from aiohttp import web from pyservice_registry.models import Service def _check_input_params(input_vars): """ Check all input values are filled """ for name, value in input_vars.items(): if not value: return web.HTTPBadRequest(body=json.dumps(dict(error="'%s' can'...
from datetime import datetime, timedelta from .models import HourModel, MonthModel, DayModel #YearModel, MinutesModel from django.utils import timezone from dateutil.relativedelta import relativedelta import pprint class CreateEntry: def __init__(self): print("constructor CreateEntry is working") ...
""" Interface to the Filigree irregular triangular mesh generator, allowing interactively specified control over mesh generation using Bokeh. """ from collections import defaultdict import param import cartopy.crs as ccrs import filigree from holoviews import Points, DynamicMap, Callable from holoviews.streams impor...
import tempfile, os import torch import random import colorsys from matplotlib import pyplot as plt from matplotlib.patches import Rectangle from imageio import imread from sg2im.data import imagenet_deprocess from sg2im.metrics import xywh_to_points """ Utilities for making visualizations. """ def draw_box(box, col...
"""parse_pcap parsing a pcap file so that later we would be able to use the urls that was found to check for any harmfull activity >>> from aptdetector.network.parser.parse_pcap import parse_pcap_file >>> parse_pcap_file() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: parse_pcap_...
# # Support for State Machines. ref - Design Patterns by GoF # Many of the methods in these classes get called behind the scenes. # # Notable exceptions are methods of the StateVar class. # # See example programs for how this module is intended to be used. # import exceptions class StateMachineError( exceptions....
"""Implementation of adversarial detection. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import faiss import numpy as np from tqdm import tqdm from scipy.misc import imread import tensorflow as tf from tensorflow.contrib.slim.nets impor...
import matplotlib.pyplot as plt import mpl_toolkits.mplot3d.art3d as art3d from mpl_toolkits.mplot3d import axes3d from matplotlib.patches import Circle, Wedge, PathPatch import numpy as np import pandas as pd ##### functions ##### def normal_vectors(dips, dipdirs): n_X = np.sin(np.radians(dips)...
from openpyxl import load_workbook import time import re import random import logging import sys import json logger=logging.getLogger("BearSki.DataTable") def getColumData(data="",datafile=""): datalist = data.split(".") wb = load_workbook(filename=datafile) sheet_ranges = wb[datalist[0]] firstrow = sheet_ran...
#!/usr/bin/env python # 1.load a dataset from a file # 2."organize that file so we can access columns *or* rows of it easily # 3.compute some "summary statistics" about the dataset # 4.print those summary statistics import os import pandas as pd import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mpl...
# Python code for AVL Tree insertion and deletion # Generic tree node class class TreeNode(object): def __init__(self, key): self.key = key self.left = None self.right = None self.height = 1 # AVL tree class which supports insertion, # deletion operations class AVL_Tree(object): ...
#!/usr/bin/env python2 """ This utility scans a script in search for entity information missing in the commands definition file. Please use IR2 scripts decompiled using linear-sweep! Scripts with erroneous entity information (e.g. those built with SCM assemblers) are prone to trigger an assertion. Examples...
import tornado.web import json import database from operator import itemgetter import html.parser import requests.status_codes as codes def unescape(text): return html.parser.HTMLParser().unescape(text) def render(tweets): rendered = [] for tweet in tweets: print(tweet) tweet["text"] = une...
""" # GitHub examples repository path: PowerAnalyzers/Python/RsInstrument Created on 2020/10 Author: Jahns_P Version Number: 4 Date of last change: 2022/04/04 Requires: HMC8015, FW 1.403 or newer and adequate options - Installed RsInstrument Python module 1.20.0 or newer - Installed VISA e.g. R&S Visa 5.12.x or newer ...
import numpy as np import os from glove import Corpus, Glove from options import * ## Functions for word embeddings def load_glove_embeddings_from_txt_file(filename): """ DESCRIPTION: Loads a word embedding file and returns a python dictionary of the form (word, [vector of embeddings...
''' Supervisely to SA conversion method ''' import logging import threading from pathlib import Path import json from .supervisely_helper import _base64_to_polygon, _create_attribute_list from ..sa_json_helper import _create_vector_instance, _create_sa_json from ....common import write_to_json, tqdm_converter logge...
#How To Implement Naive Bayes From Scratch in Python #http://machinelearningmastery.com/naive-bayes-classifier-scratch-python/ #Dataset #https://archive.ics.uci.edu/ml/machine-learning-databases/pima-indians-diabetes/pima-indians-diabetes.data import csv import math import random #Handle data def loadCsv(filename): ...
""" Classes for performing ssGSEA, a form of enrichment analysis. Classes: GeneSetContainer - contains gene sets, as input to ssGSEA Enricher - computes enrichment scores (ES) """ import warnings from typing import List from pathlib import Path import math import pandas as pd import gseapy as gp from xspecie...
import logging,os import _PyDbgEng from . import internalstate,task import pecoff,ndk,match class addressspace(object): offset = 0 def __init__(self, process): self.process = process def seek(self, offset): self.offset = offset def consume(self, amount): host = self.process.ho...
# Village People, 2017 import torch from torch.multiprocessing import Queue import time from termcolor import colored as clr from pig_chase.common import ENV_ACTIONS from agents import get_agent import numpy as np import queue as Queue def print_info(message): print(clr("[QUEUE_TRAIN] ", "magenta") + message) ...
from collections import Counter import math class CollocationFinder: def __init__(self, sentences, lexicon, verbose=False): self.unigram_frequencies = Counter() self.bigram_frequencies = Counter() if verbose: print('Counting unigrams and bigrams..') self.count_frequencies(sentences, lexicon) if...
import sympy as sym import tensorflow as tf from tf_pwa.amp import Particle from tf_pwa.amp import get_relative_p as get_relative_p2 from tf_pwa.amp import register_particle from tf_pwa.breit_wigner import get_bprime_coeff def get_relative_p(m0, m1, m2): a = m0 ** 2 - (m1 + m2) ** 2 b = m0 ** 2 - (m1 - m2) *...
import numpy as np from datetime import datetime, timedelta import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.dates as mdates from seaborn.distributions import _freedman_diaconis_bins as n_bins_calc from scipy.special import erf from scipy.stats import skew, skewtest, normaltest ...
from tbe import tik DTYPE_SIZE = { 'bool': 1, 'uint8': 1, 'int8': 1, 'uint16': 2, 'int16': 2, 'int24': 3, 'uint32': 4, 'int32': 4, 'float16': 2, 'float32': 4, 'int48': 6, 'int64': 8, 'uint64': 8, 'float64':8 } def matmul_tik_compute(params, ...
from PIL import Image import numpy as np from sklearn.cluster import KMeans import colorsys as cs ################################### ## Script parameters ################################### #path to file image_filename = "sunset.jpeg" output_filename = "sunset_pixelized.png" output_type = "png" n_colors = 5 #how ...
#!/usr/bin/env python3.8 import argparse import base64 import os import random import string import subprocess import sys import zipfile from datetime import datetime, timedelta import bcrypt # you can test this with: tools/api-key-management/bin/create-api-key.py --api npex --party test --environment dev # if you ...
"""Animation. Animation is set of keyframes. Value of selected attribute changes in time. Keyframe: (time, value) Objects have animation manager which manages animation graph and switching.""" from operator import itemgetter from eaf import Timer from xoinvader.utils import Point class AnimationBoundariesExce...
import numpy as np import matplotlib.pyplot as plt from astropy.constants import codata2018 as ac import astropy.units as u from tqdm import tqdm from scipy.integrate import solve_ivp from matplotlib.colors import Normalize, LogNorm, FuncNorm from matplotlib.cm import ScalarMappable from astropy.visualization import qu...
import sys import os import threading import time import logging import random import cv2 import numpy as np import pyautogui def screenshot(): img = pyautogui.screenshot() return cv2.cvtColor(np.array(img), cv2.COLOR_RGB2BGR) def imageDiff(img1, img2): diff = cv2.absdiff(img1, img2) _, diff = cv2.thr...
import numpy as np import multiprocessing as mp import ctypes import torch from rlpyt.utils.collections import namedarraytuple_like # from rlpyt.utils.misc import put def buffer_from_example(example, leading_dims, share_memory=False): """Allocates memory and returns it in `namedarraytuple` with same structu...
import os import torch from torch.autograd import Variable import math import util.datahelper as datahelper import util.texthelper as texthelper import random import numpy as np class LMDataset(object): def __init__(self, task_list, args): self.bptt = args.bptt self.batch_size = arg...
import click import sys import tmanager.core.messages.messages as msg import tmanager.utilities.commands as utl_cmds import tmanager.utilities.file_system as utl_fs from tmanager.core.config.config import Config CMD_NAME = "delete" @click.command() @click.option("-n", "--name", help="Delete tool by name.", metavar="...
import re import csv import pprint import nltk.classify import pickle import pandas as pd from nltk.classify.scikitlearn import SklearnClassifier from sklearn.linear_model import LogisticRegression,SGDClassifier from sklearn.naive_bayes import MultinomialNB,BernoulliNB from sklearn.svm import SVC, LinearSVC, NuSVC #st...
# In this file we will check a companies upcoming earnings and recent news headlines through Yahoo Finance # Import libraries import datetime as dt import yfinance as yf import time from time import strptime from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver....
from base64 import b64encode from os import remove import pytest import ahjo.credential_handler as ahjo def obfuscate(stng): return b64encode(stng.encode()).decode() @pytest.fixture(scope="function") def execute_get_credentials_with_varying_input(tmp_path, monkeypatch): """First, reset global variable of ...
from ssl import SSL_ERROR_SSL from urllib.error import HTTPError from colorama import Fore, Style, init import urllib.request import time import sys import os from os.path import exists from googlesearch import search import random global domain global success, info, fail success, info, fail = Fore.GREEN ...
#!/usr/bin/env python import click from copy import copy from netCDF4 import Dataset import numpy as np import numpy.ma as ma import os import rasterio import rasterio.warp as rwarp import time import osr from .. import geotools from .. import utils def earth_radius(): srs = osr.SpatialReference() srs.ImportFrom...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import h5py import numpy as np from scipy.optimize import curve_fit from upho.analysis.functions import FittingFunctionFactory from upho.irreps.irreps import extract...
#Import necessary package import requests import re from bs4 import BeautifulSoup import pandas as pd import numpy as np import datetime as dt import configparser import os import json #Configure parameter config = configparser.ConfigParser() config.read(os.path.join(os.path.dirname(__file__), 'config.ini')) mall = co...
import os from pathlib import Path from PIL import ImageTk, Image from app.utils import form_logger from app.rmbot.config import TODAY_DDMMYYYY from app.gui.config import ( VALID_EXTENSIONS, VALID_UPPERCASE, VALID_NUMBER, IMAGE_WIDTH, IMAGE_HEIGHT, MAX_DEPRECIATION, VALID_INTIMATION_PREFIX, ...
# -*- coding: utf-8 -*- from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import Descriptors, rdFreeSASA import pybel import openbabel as ob import numpy as np import math ''' from rdkit.Chem import Lipinski, MolSurf, PeriodicTable elements_set = ['H','He','Li','Be','B','C','N','O','F','Ne','Na','...
# noinspection PyPackageRequirements import pytest import os from django_docker_helpers.config import ConfigLoader, exceptions from django_docker_helpers.config.backends import * from django_docker_helpers.utils import mp_serialize_dict pytestmark = pytest.mark.config_loader REDIS_HOST = os.getenv('REDIS_HOST', '12...
#! /usr/bin/env python """ Test the angle_tools module """ from __future__ import print_function __author__ = '<NAME>' from AegeanTools import angle_tools as at from astropy.coordinates import Angle import astropy.units as u import numpy as np from numpy.testing import assert_approx_equal, assert_almost_equal def ...
from __future__ import absolute_import import random from torch import nn from torch.nn import functional as F from torch.nn import init import torchvision import torch from torchvision.models.resnet import Bottleneck from copy import deepcopy from .resnet_ibn_a import resnet50_ibn_a, resnet101_ibn_a __all__ ...
import unittest import warnings import parmap import time import multiprocessing # The fact that parallelization is happening is controlled via reasonable # guesses of the parmap overhead and the CPU speeds # Overhead of map_async, should be less than TIME_PER_TEST TIME_OVERHEAD = 0.4 # The time each call takes to ...
""" Usage: forecasting.py <infile> <outfolder> [--from_meta|--from_lineage] [--n_days_for_forecast=<n>] Options: --from_meta Read from metadata input. Will be inferred to be true if input is contains "metadata" but not "lineage" --from_lineage Read from metadata_lineage file. Will be inferred to be true...
import requests from bs4 import BeautifulSoup import tkinter as tk from tkinter import * root = tk.Tk() root.grid_columnconfigure((0,1), weight=1) root.configure(background="#10D5E2") root.geometry("800x600") root.title("JOB COMPARATOR ") root.configure(borderwidth="10",relief="sunken",background="#A58FAA",cursor="arr...