content
stringlengths
5
1.05M
import copy import hashlib import os import re import typing from contextlib import contextmanager from pathlib import Path import manimpango from manimlib.constants import * from manimlib.mobject.geometry import Dot from manimlib.mobject.svg.svg_mobject import SVGMobject from manimlib.mobject.types.vectorized_mobject...
import sys from . import bar, baz def test(): bar print([m for m in sys.modules if m.startswith("test.lazyimports.split_fromlist.")])
from enum import Enum, auto class FunctionType(Enum): NONE = auto() FUNCTION = auto() METHOD = auto() INIT = auto()
import numpy as np import os, sys import math, time from scipy.interpolate import InterpolatedUnivariateSpline as iuspline import tensorflow as tf import tensorflow_probability as tfp import flowpm from astropy.cosmology import Planck15 from flowpm import linear_field, lpt_init, nbody, cic_paint from flowpm.utils impo...
'''IOU Tracker settings''' if "DPM" in seq: sigma_l = -0.5 sigma_h = 0.5 sigma_iou = 0.5 t_min = 4 elif "FRCNN" in seq: sigma_l = 0.0 sigma_h = 0.9 sigma_iou = 0.4 t_min = 3 elif "SDP" in seq: sigma_l = 0.4 sigma_h = 0.5 sigma_iou = 0.3 t_min = 2 else: sigma_l = 0.25 ...
# Copyright 2021 The StackStorm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
from django.conf.urls import url from comparisontool.views import * urlpatterns = [ url(r'^$', TemplateView.as_view(template_name='comparisontool/landing.html'), name='pfc-landing'), url(r'^choose-a-student-loan/$', TemplateView.as_view(template_name='comparisontool/choose_a_loan.html'), name='pfc-choose'), ...
#!/usr/bin/env python """a module to install Galaxy workflows (and optionally tools)""" import datetime import argparse from os.path import isfile, join, exists from os import listdir import ast from subprocess import call from bioblend import galaxy #local imports from tool_to_yaml import tool_to_yaml #-----------...
# -*- coding: ascii -*- import sys, glob, string try: from desicos.xlrd import (open_workbook, XL_CELL_EMPTY, XL_CELL_BLANK, XL_CELL_TEXT, XL_CELL_NUMBER, cellname) null_cell_types = (XL_CELL_EMPTY, XL_CELL_BLANK) except ImportError: # older version from desicos.xlrd import (open_workbook,...
from ctpbee_api.ctp import * from ctpbee.constant import ( Direction, Offset, Exchange, OrderType, Product, Status, OptionType ) STATUS_CTP2VT = { THOST_FTDC_OAS_Submitted: Status.SUBMITTING, THOST_FTDC_OAS_Accepted: Status.SUBMITTING, THOST_FTDC_OAS_Rejected: Status.REJECTED, ...
## # Copyright (c) 2005-2017 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' name: 韩国autoset建站程序phpmyadmin任意登录漏洞 referer: https://www.t00ls.net/viewthread.php?tid=37863&extra=&page=1 author: Lucifer description: /phpmyadmin任意用户名密码登录,通过低权限提权可获取root密码插入shell。 ''' import sys import json import requests class autoset_phpmyadmin_unauth_BaseVerify:...
# -*- coding: utf-8 -*- # # Copyright (C) 2010 CENATIC: Centro Nacional de Referencia de # Aplicacion de las TIC basadas en Fuentes Abiertas, Spain. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # Redistribution...
import secrets import time import random import pandas as pd from typing import Dict, Callable, Any from cadCAD.configuration import Configuration from cadCAD.configuration.utils import config_sim from cadCAD.engine import ExecutionMode, ExecutionContext, Executor from .specs import ( Deposit, DepositData, Beaco...
class Graph(Object): def __init__(self): pass def walkBreadthFirst(self): pass
# Copyright (C) 2010-2011 Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish...
from gettext import gettext as _ from django.db import models from cyder.base.utils import transaction_atomic from cyder.cydns.domain.models import Domain from cyder.cydns.models import CydnsRecord, LabelDomainUtilsMixin from cyder.cydns.validation import ( validate_srv_label, validate_srv_port, validate_srv_prio...
""" Simple training loop; Boilerplate that could apply to any arbitrary neural network, so nothing in this file really has anything to do with GPT specifically. """ import logging import math import numpy as np import tensorflow as tf from fastprogress import master_bar, progress_bar logger = logging.getLogger(__na...
import torchvision from torch import nn import torch import math import torch.nn.functional as F from model.head.head import build_head from model.backbone.backbone import build_backbone class SSD(nn.Module): def __init__(self, cfg): super().__init__() self.backbone = build_backbone(cfg) ...
from game import Game, simulate from os import path import os import json import random random.seed() _fname = path.join(path.dirname(__file__), 'games.dat') class GameReader: GAME_SIZE = 389 file = None def _open(self): if self.file is None: self.file = open(_fname, 'r') self.file.seek(0, os.SEEK_E...
class Custom( ): pass
from constants import * #Rounds x to nearest VAL def roundToValue(x,VAL,rval): if rval == "u": return (VAL * float(int((float(x)/VAL*100))/100))+1 else: return (VAL * float(int((float(x)/VAL*100))/100)) #Normalizes a numpy array - intended for converting vectors into unit vectors def unitVecto...
# -*- coding: utf-8 -*- import pytest from workflow.workflow3 import Workflow3 from aws_tools.handlers.item_filter import item_filters from aws_tools.tests import setup_test_config_and_credential_file from aws_tools.tests.paths import PATH_TEST_CONFIG_FILE, PATH_TEST_CREDENTIALS_FILE class TestItemFilters(object): ...
################################################################################ # Copyright (c) 2018-2019, National Research Foundation (Square Kilometre Array) # # Licensed under the BSD 3-Clause License (the "License"); you may not use # this file except in compliance with the License. You may obtain a copy # of the...
def pytest_addoption(parser): parser.addoption('--headless', action='store_true', default=False)
# Generated by Django 2.0.5 on 2018-05-05 21:53 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
from __future__ import print_function, division, absolute_import import time import matplotlib matplotlib.use('Agg') # fix execution of tests involving matplotlib on travis import numpy as np from imgaug import dtypes as iadt def main(): time_start = time.time() test_copy_dtypes_for_restore() time_e...
import numpy as np from mht.scan_volume import (Volume) class Sector(Volume): def __init__(self, angle_start, angle_end, range_max, P_D, clutter_lambda, init_lambda): super(Sector, self).__init__(P_D, clutter_lambda, init_lambda) assert(-np.pi < angle_start <= np.pi) assert(-np.pi < angle...
# Copyright (c) 2016 Clinton Knight. All rights reserved. # Copyright (c) 2017 Jose Porrua. 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://...
import warnings import os, json import logging as log import datetime as dt from collections import defaultdict, namedtuple from utils import AlertGenerator from analyzers.rolaguard_ai_analyzer.DeviceSessionProfiler import DeviceSessionProfiler from analyzers.rolaguard_ai_analyzer.RegularityChecker import Regu...
import ee from ee_plugin import Map # traditional python string print('Hello world!') # Earth Eninge object print(ee.String('Hello World from Earth Engine!').getInfo()) print(ee.Image('LANDSAT/LC08/C01/T1/LC08_044034_20140318').getInfo())
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2012 François-Xavier Bourlet (bombela@gmail.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "S...
from base import CommonModelSettings class BiLSTMConfig(CommonModelSettings): __hidden_size = 128 @property def HiddenSize(self): return self.__hidden_size @property def LearningRate(self): return 0.1 def modify_hidden_size(self, value): assert(isinstance(value, int...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import random import numpy as np from collections import deque import os import sys ## Local imports ## from datetime import datetime ################### import torch import torch.nn.functional as F import torch.optim as optim from agent import Agent from dqn_model impo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # © 2016 Bernd Busse, The MIT License # import i3ipc import re from threading import Thread from time import sleep from orangeslices import slice RE_WS_TITLE = re.compile('\s*([0-9]*):?\s*(.*)?\s*', re.I) class i3_connection(Thread): def __init__(self, on_error)...
from pymongo import MongoClient from PyInquirer import prompt import yaml def addLogin(): with open("config.yaml") as f: data = yaml.load(f, Loader=yaml.FullLoader) address = data["location"] client = MongoClient(address) db = client["passwords"] dbcol = db["pwd"] addinfo = [ ...
# Generated by Django 3.0.3 on 2020-02-25 13:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0002_auto_20200225_1213'), ] operations = [ migrations.AddField( model_name='srtmodel', name='path', ...
import sys, os from sklearn.metrics import roc_auc_score, recall_score, precision_score, roc_curve import pandas as pd import numpy as np from evaluation.evaluateScoresList import evaluateScoresLists DO_ROC_CURVE= False def loadResults( resultsPath, fnameResults): prefix= fnameResults.split("_")[0].split(".")[0] ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** from .. import _utilities import typing # Export this package's modules as members: from ._enums import * from .cache import * from .get_cache import *...
from enum import Enum from typing import List, NamedTuple from mcp.config.loader import ConfigType class Difficulty(Enum): DEFAULT = "default" NONE = "none" HARD = "hard" class TransformConfig(NamedTuple): crop_size: List[int] crop_padding: int image_size: List[int] scale: List[int] ...
from epl.settings import RECAPTCHA_PRIVATE_KEY import requests # A small implementation of the Recaptcha server-side API API_SERVER = "https://www.google.com/recaptcha/api/verify" def verifyReCaptcha(request, challenge, response): """ returns a tuple, where the first element is a boolean indicating succe...
# Copyright (C) H.R. Oosterhuis 2020. # Distributed under the MIT License (see the accompanying README.md and LICENSE files). import numpy as np import itertools from scipy.optimize import linprog class OptimizedInterleaving(object): def __init__(self, data_split, model_rankings, inv_rankings, cutoff): self.da...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
''' . . . . . . . . . . . . . . . . . . . . . <<><><> <<><><> << . . << >< << << . . <<><><> <<><>< << . . << >< << << . . << <> << << . . << >< << <<><><> . . ...
# pylint:disable=unused-variable # pylint:disable=unused-argument from typing import Any, Dict, List, NamedTuple from dask_gateway_server.app import DaskGateway from dask_task_models_library.container_tasks.docker import DockerBasicAuth from dask_task_models_library.container_tasks.io import ( TaskInputData, ...
# -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Huawei.VRP.get_portchannel # --------------------------------------------------------------------- # Copyright (C) 2007-2014 The NOC Project # See LICENSE for details # -----------------------------------------------------...
import cv2 import pandas as pd import argparse def get_argument(): """ This function returns the arguement which was passed through the terminal. """ ap = argparse.ArgumentParser() ap.add_argument("-i", "--image", required=True) args = vars(ap.parse_args()) return args def get_img(): ...
import arrow import pathlib import subprocess import time from countdown import Countdown MAKO_DIR = pathlib.Path('templates/') BUILD_DIR = pathlib.Path('build/') def main(): subprocess.Popen(['pixlet', 'serve', 'build/display.star', '--watch'], shell=False, stdin=None, stdout=None, stderr=No...
import itertools import pypict from pypict.api import Task def from_dict(params, filter_func=None, excludes=[], seeds=[], order=2, random_seed=None): """Generates pair-wise cases from given parameter dictionary.""" if random_seed is None or isinstance(random_seed, int): return _from_di...
"""This module tests solo_item class """ from league_advisor.solo_items import SoloItems def test_solo_item_get_items_lucian(): # Arrange item = SoloItems() expected = ["Doran's Blade", 'Kraken Slayer', "Berserker's Greaves", 'Essence Reaver', 'Navori Quickblades', 'Infinity Edge'] # ...
""" Test featurize.py. """ import joblib import numpy as np from rdkit_utils import conformers, serial import shutil import tempfile import unittest from rdkit import Chem from rdkit.Chem import AllChem from vs_utils.scripts.featurize import main, parse_args from vs_utils.utils import read_pickle, write_pickle clas...
from django.contrib import admin import models.biditem admin.site.register(models.biditem.BidItem)
"""Setup file for PyPi.""" import io import setuptools def setup(): """Setup function for PyPi.""" with io.open('README.rst', 'r', encoding='utf-8') as fp: readme = fp.read() setuptools.setup( name='check-reserved-instances', license='BSD', description=( 'Compar...
################################################################################ # BSD LICENSE # # Copyright(c) 2019-2021 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: # # *...
from unittest import mock from django.contrib.gis.geoip2 import GeoIP2, GeoIP2Exception from django.core.exceptions import MiddlewareNotUsed from django.http import HttpRequest, HttpResponse from django.test import TestCase, override_settings from geoip2.database import Reader from geoip2.errors import AddressNotFound...
from base64 import b64decode if __name__ == "__main__": print("\n\nDecoding protocol.\n\n") protocol_encoded = open("/etc/workflow/protocol", "r").read() protocol_decoded = b64decode(protocol_encoded).decode() with open("/data/protocol.py", "w") as protocol_out: protocol_out.write(protocol_...
""" The itertools module standardizes a core set of fast, memory efficient tools that are useful by themselves or in combination. Together, they form an iterator algebra making it possible to construct specialized tools succinctly and efficiently in pure Python. To read more about the functions in this module, c...
import csv import re from copy import deepcopy from pathlib import Path from natsort import natsorted from capdb.models import Reporter, EditLog, VolumeMetadata, Citation """ This script fixes our handling of nominative reporters. We currently handle nominative reporters like this: Reporter name: Vo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import io from .... import TestUnitBase class TestConfuserXDecryptor(TestUnitBase): def test_hawkeye(self): unit = self.load() data = self.download_sample('094e7d3e6aebf99663993e342401423dff3f444c332eae0b8f0d9eeda1b809a7') with io.BytesIO(da...
from flask import Blueprint from flask import Flask, render_template, url_for, request from flask_login import login_required, logout_user from werkzeug.utils import redirect home_route = Blueprint('home_route', __name__) data = { "wishlist": ["Microsoft", "Google", "Uber"], "inprogress": ["Twitter", "Pearson...
"""This module tests the module lyrics_sentiments and exports the results. """ import xml.etree.ElementTree as ET import pandas as pd import lyrics_sentiment import song_information # Insert the path to your XML corpus and comment in the next line # tree = ET.parse('PATH') root = tree.getroot() # Some example querie...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
import argparse import torch # torch.set_printoptions(precision=1, threshold=10000) from torch.autograd import gradcheck from spatial_correlation_sampler import SpatialCorrelationSampler parser = argparse.ArgumentParser() parser.add_argument('backend', choices=['cpu', 'cuda'], default='cuda') parser.add_argument('-b',...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-07 17:05:11 import os import time import Queue import logging from collections import deque from pyspider.libs import counter from task_queue imp...
""" This is the base class for all socket-based channels. Both bind and connect protocols utilize this base class. You can also programmatically utilize this class to instantiate a session via an established socket. .. code-block:: python # Manually connect to a service and trigger a shell on the same socket ...
"""Test of the App""" # pylint: disable=redefined-outer-name,protected-access # pylint: disable=missing-function-docstring,missing-module-docstring,missing-class-docstring from .app import view def test_view(): view()
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Add simulation parameters to the database and run the simulation. Name of the parameter file can be passed to the program, otherwise first match with parameter file from 'settings.txt' is used. The format of the parameter file is for each parameter as following: param...
import numpy as np import pandas as pd import os def add_gait_cycle(dest_path = "", read_path = "",joint = ""): if dest_path == "": dest_path = input("Enter destination path with .csv extension\n") if read_path == "": read_path = input("Enter read path without using .csv extension\n") ...
import numpy as np from copy import deepcopy from enum import Enum, auto import random from PyCommon.modules.Math.mmMath import PlaneProject class BufferType(Enum): FC_P_WARP = auto() FC_PV_WARP = auto() FC_PVC_WARP = auto() FC_NO_WARP = auto() class ControlSchemeType(Enum): FC_RANDOM_SELECTION...
import librosa import soundfile ''' input audio wav file outputs 12 pitchdownshifted and 11 picthupshifted audio wav files Execution time is 20.2 s ± 1.52 s per loop (mean ± std. dev. of 7 runs, 1 loop each)''' '''NOTES FROM LEO: (shifts should be the total number of notes requested, not half of i...
import FWCore.ParameterSet.Config as cms from DQM.TrackingMonitor.TrackingMonitor_cfi import * MonitorTrackGLBMuons = TrackMon.clone( TrackProducer = 'globalMuons', AlgoName = 'glb', FolderName = 'Muons/globalMuons', doBeamSpotPlots = False, BSFolderName = 'Muons/globalCosmicMuons/BeamSpotParameter...
def divide_with_exception(number, divisor): try: print("{} / {} = {}".format( number, divisor, number / divisor * 1.0)) except ZeroDivisionError: print("You can't divide by zero") def divide_with_if(number, divisor): if divisor == 0: print("You can't divide by zero") ...
#!/usr/bin/env python import os import sys import io import setuptools def get_version_from_package() -> str: """ Read the package version from the source without importing it. """ path = os.path.join(os.path.dirname(__file__), "__init__.py") path = os.path.normpath(os.path.abspath(path)) with open(path)...
from typing import List, Dict, Tuple import re as re from pygments.lexers import PythonLexer from .PybrainzzFormatter import PybrainzzFormatter def get_single_color_dicts(self) -> List[List[Dict]]: """ Converts the text in the editor based on the line_string_list into a list of lists of dicts. Every line ...
from re import S import streamlit as st import matplotlib as plt import pandas as pd import altair as alt from app_pages.model import dataset, two_dim_data import numpy as np def app(): st.title('Dashboard') num_cols = list(dataset().select_dtypes(include=["int64", "float64"]).columns) cat_co...
import os, datetime, sys, argparse import numpy as np import json from tensorflow.keras.callbacks import ModelCheckpoint,TensorBoard from tensorflow.keras import callbacks # from data_gen import DataGen # from model import classifier from builder import ModelBuilder import tensorflow as tf print(tf.__version__) from ...
# -*- coding: utf-8 -*- from sphinx.ext.autodoc import between from datetime import date import sys import os sys.path.append(sys.path.insert(0, os.path.abspath('../'))) autosummary_generate = True modindex_common_prefix = ['_'] master_doc = 'index' html_theme = 'sphinx_rtd_theme' html_theme_path = [ '_themes'...
#!/usr/bin/env python """ steps: 0. throw out pdb atoms w d_rl > 30 A (prevent seg faulting), save mol2 1. remove hydrogens from trimmed pdb, save mol2 2. use chimera to generate receptor surface file 3. generate docking spheres 4. edit number of spheres (cut those > 10 A from ligands) 5. generate box/grid 6. run dock...
import torch import scipy.stats from tqdm import trange class SparseNetLearning: def __init__( self, images, patch_size, basis_func_num, e_step_iter_num, lr, iter_num, gpu ): torch.set_default_tensor_type(torch.DoubleTensor) ...
# -*- coding: utf-8 -*- from random import Random from flask import jsonify def create_salt(): salt = '' chars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789' len_chars = len(chars) - 1 random = Random() for i in range(32): # 每次从chars中随机取一位 salt += chars[random.r...
import os import argparse import cma import matplotlib.pyplot as plt from scipy.stats import nbinom from datetime import datetime, timedelta, date import nottingham_covid_modelling.lib.priors as priors import numpy as np import pints from nottingham_covid_modelling import MODULE_DIR # Load project modules from notting...
import unittest from timeit import default_timer as timer from parser_module import Parse class TestParserUrls(unittest.TestCase): def test_url1(self): # Test 4 text = "edennnn https://www.instagram.com/p/CD7fAPWs3WM/?igshid=o9kf0ugp1l8x eden king http://Berdugo94.github.io/test check" ...
from pathlib import Path from os import path from zeppos_logging.app_logger import AppLogger class Root: @staticmethod def find_root_of_project(current_module_filename, root_marker_filename_list=[".root", "manage.py", "Pipfile"]): AppLogger.logger.debug(f"current_module_fi...
#!/usr/bin/env python3 from pathlib import Path import os from functools import cmp_to_key from v2x import vlog_to_model from v2x import vlog_to_pbtype from v2x.xmlinc import xmlinc from v2x.mux_gen import mux_gen from vtr_xml_utils import convert from distutils.dir_util import copy_tree TEST_TMP_SUFFIX = 'build/'...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.TemplateEvoucherDTO import TemplateEvoucherDTO from alipay.aop.api.domain.TemplateFileDTO import TemplateFileDTO from alipay.aop.api.domain.TemplateImageDTO import Temp...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
try: with open("useLightTheme", "r", encoding="utf-8") as fil: from _myGuiLight import Ui_MainWindow except: from _myGuiDark import Ui_MainWindow from PyQt5 import QtWidgets from PyQt5.QtCore import QThread, pyqtSignal from PyQt5 import QtCore from PyQt5 import QtGui import sys from time imp...
#!/usr/bin/env python # # Copyright 2007 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# ****************************************************************************** # Copyright 2020-2021 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apa...
from celery import Celery import requests import time app = Celery("celery_blog", broker="redis://localhost:6379/0") @app.task def fetch_url(url): resp = requests.get(url) print(resp.url, resp.status_code) def func(urls): for url in urls: fetch_url.delay(url) URLS = [ "http://www.google.c...
from Stream import * from collections import namedtuple from Agent import * #delta is maximum possible error class freq_tuple(object): def __init__(self,freq,delta): self.freq=freq self.delta=delta #freq_tuple = namedtuple('freq_tuple', ['freq','delta']) #input_list= [] #d_struct = {} '''...
# splines in 1d # We use the cherry blossom daa from sec 4.5 of "Statistical Rethinking" # We use temperature as the target variable, to match a draft version of the book, # https://github.com/Booleans/statistical-rethinking/blob/master/Statistical%20Rethinking%202nd%20Edition.pdf # The published version uses day of y...
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.alert import Alert from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from tkinter import * from PIL import Image dp = Tk() main_frame = Frame(...
""" ChainRad ======== File: unit test for the dataset """ from os.path import join import pandas as pd from core import check_and_get_basics, META_DIR # pylint: disable=invalid-name # The variable is_successful is actually not a constant. diseases_basics = check_and_get_basics() f...
import unittest from mock import MagicMock from PyStacks.PyStacks.organizationstasks import organizationstasks class TestOrganizationsTasksSetup(unittest.TestCase): def setUp(self): self.mocksession = MagicMock() self.mockorgClient = MagicMock() self.mocksession.client.return_value = se...
import unittest from programy.storage.stores.sql.dao.node import PatternNode from programy.storage.stores.sql.dao.node import TemplateNode class PatternNodeTests(unittest.TestCase): def test_init(self): node1 = PatternNode(name='name', node_class='class') self.assertIsNotNone(node1) ...
import os import glob import flightradar24 import ast import time import math from ShowWorld import ShowWorld from Show3D import Show3D from RTree import RTree from RTreeComponents import Value # time = time.time() # airline = 'CSA' # Turkish Airlines fr = flightradar24.Api() # flights = fr.get_flights(airline) #flig...
import argparse import logging import uuid import copy import json import time import os.path import sys import os from subprocess import call from threading import Lock from collections import namedtuple from typing import List import jinja2 import googleapiclient.discovery from google.cloud import pubsub_v1 as pubsu...
from fastapi import Depends, HTTPException from fastapi.security import OAuth2PasswordBearer from jose import jwt from jsonschema import ValidationError from starlette import status from watchmen.auth.storage.user import get_user from watchmen.auth.user import User from watchmen.common.security.index import validate_j...
#!/usr/bin/env python from spider import * sys.path.append("..") from utils import Utils class LabPapersSpider(Spider): def __init__(self): Spider.__init__(self) self.utils = Utils() def doWork(self): self.getGoogleLabPapers() #self.getYahooLabPapers() def getYahooLabPa...