content
stringlengths
5
1.05M
from conans import ConanFile, CMake, tools class CppAgentConan(ConanFile): name = "mtconnect_cppagent" version = "2.0" generators = "cmake" url = "https://github.com/mtconnect/cppagent.git" license = "Apache License 2.0" settings = "os", "compiler", "arch", "build_type", "arch_build" option...
from protox import Message, Int32 from protox.message import define_fields def test_define_fields(): class User(Message): id: int define_fields( User, id=Int32(number=1), ) user_id = 123 user = User(id=user_id) assert isinstance(user.id, int) assert user.id == use...
import sys char_ = None def readchar_(): global char_ if char_ == None: char_ = sys.stdin.read(1) return char_ def skipchar(): global char_ char_ = None return def stdinsep(): while True: c = readchar_() if c == '\n' or c == '\t' or c == '\r' or c == ' ': ...
from django.db import models # ----------------------------------------------------------------------------- # Contacts Address # ----------------------------------------------------------------------------- class Contacts(models.Model): first_name = models.CharField(max_length=40) last_name = models.CharFiel...
"""Utility functions for Python.""" from __future__ import annotations import ctypes import io import os import sys import tempfile from contextlib import contextmanager from typing import Any, Optional from typing import overload, Sequence import os import re import numpy as np import pyproj #import pyproj.transforme...
#!/usr/bin/env python # # ----------------------------------------------------------------------------- # Copyright (c) 2018 The Regents of the University of California # # This file is part of kevlar (http://github.com/dib-lab/kevlar) and is # licensed under the MIT license: see LICENSE. # ----------------------------...
# Generated by Django 2.1.7 on 2019-04-15 05:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounting_tech', '0034_auto_20190415_0848'), ] operations = [ migrations.AddField( model_name='acquisition', name='...
# utils functions for file io import re def split_region(region): region_split = re.split('[\W_+]', region) contig, start, end = region_split[:3] # ignore other fields. Overlapping ignoring strandness (TO DO: consider strandness?) start = int(start) end = int(end) return contig,...
""" This file is part of mss. :copyright: Copyright 2021 by the mss team, see AUTHORS. :license: APACHE-2.0, see LICENSE for details. 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 Li...
import re from torch import nn, optim from torchvision import models ##################################################################################################### class ConvNet(nn.Module): def __init__(self, model_name=None, pretrained=False): super(ConvNet, self).__init__() if re.match(r...
from o3seespy.command.nd_material.base_material import NDMaterialBase class ContactMaterial2D(NDMaterialBase): """ The ContactMaterial2D NDMaterial Class This command is used to construct a ContactMaterial2D nDMaterial object. """ op_type = 'ContactMaterial2D' def __init__(self, osi, mu,...
#!/usr/bin/python # -*- coding: utf-8 -* import time class Instruction(object): def __init__(self, f, l, a): self.f = f self.l = l self.a = a class Interpret(ob...
""" Given an array of numbers which is sorted in ascending order and is rotated ‘k’ times around a pivot, find ‘k’. You can assume that the array does not have any duplicates. Example 1: Input: [10, 15, 1, 3, 8] Output: 2 Explanation: The array has been rotated 2 times. """ # Time: O(n) Space: O(1) def count_rot...
# coding=utf-8 from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut from OTLMOW.OTLModel.Classes.NaampadObject import NaampadObject from OTLMOW.OTLModel.Datatypes.KlPadNetwerkprotectie import KlPadNetwerkprotectie from OTLMOW.GeometrieArtefact.GeenGeometrie import GeenGeometrie # Generated with OTLClassC...
from thop import profile import torch from .network_factory.resnet_feature import BackBone_ResNet from .network_factory.mobilenet_v2_feature import BackBone_MobileNet from .network_factory.part_group_network import Part_Group_Network from .network_factory.pose_hrnet import BackBone_HRNet from myutils import get_mod...
import six import redis from redis import Redis, RedisError from redis.client import bool_ok from redis.client import int_or_none from redis._compat import (long, nativestr) from redis.exceptions import DataError class TSInfo(object): chunk_count = None labels = [] last_time_stamp = None max_samples_p...
from RLTest import Env from includes import * from common import waitForIndex def testDictAdd(): env = Env() env.expect('ft.dictadd', 'dict', 'term1', 'term2', 'term3').equal(3) env.expect('ft.dictadd', 'dict', 'term1', 'term2', 'term4').equal(1) def testDictAddWrongArity(): env = Env() env.expe...
import numpy as np import rawpy import imageio import os import ncempy.io as nio import matplotlib.pyplot as plt # -- Osmo action use DNG as the raw format. class DNGReader: @staticmethod def imread(folder_path, str_format, start_idx, end_idx, step, log_compress=False, im_format='DNG'): img_stack = []...
def mySqrt(x): start = 0 end = x while start <= end: mid = start + (end - start) // 2 if mid * mid == x: return mid elif mid * mid < x: start = mid + 1 elif mid * mid > x: end = mid - 1 else: return end for i in range(17): ...
import os import numpy as np from geospace.gdal_calc import Calc from geospace._const import CREATION from geospace.raster import mosaic from geospace.utils import ds_name, context_file from multiprocessing import Pool, cpu_count from collections.abc import Iterable def band_map(i, ras_multi, band_idx_multi, calc_arg...
from django import forms from django.conf import settings from django.utils.timezone import now from django.utils.translation import ugettext as _ from pretalx.submission.models import Submission, SubmissionType class InfoForm(forms.ModelForm): def __init__(self, event, **kwargs): self.event = event ...
''' UCCSD with spatial integrals ''' import time import tempfile import numpy import numpy as np import h5py from pyscf import lib from pyscf import ao2mo from pyscf.lib import logger from pyscf.cc import rccsd from pyscf.lib import linalg_helper import uintermediates as imd from pyscf.cc.addons import spatial2spin, ...
#!/usr/bin/env python3 data = open('mystery3.png','rb').read() print(hex(len(data.split(b'IDAT')[1])-8))
from collections import Counter import logging from cdeid.utils.resources import PACKAGE_NAME logger = logging.getLogger(PACKAGE_NAME) # This function is modified from the function of stanza/models/ner/scorer.py # This function to calculate the separate metrics of each entity. # # Copyright 2019 The Board of Trustee...
""" Routines for extracting data from Siemens DICOM files. The simplest way to read a file is to call read(filename). If you like you can also call lower level functions like read_data(). Except for the map of internal data types to numpy type strings (which doesn't require an import of numpy), this code is deliberat...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
from dppy.beta_ensembles import LaguerreEnsemble laguerre = LaguerreEnsemble(beta=1) # beta in {0,1,2,4}, default beta=2 laguerre.sample_full_model(size_N=500, size_M=800) # M >= N # laguerre.plot(normalization=True) laguerre.hist(normalization=True) # To compare with the sampling speed of the tridiagonal model si...
import matplotlib.pyplot as plt import numpy as np from numpy import linalg as LA def parametersForGx(mu,covmatrix): inverse = np.linalg.inv(covmatrix) (sign, logdet) = np.linalg.slogdet(covmatrix) Wi = -0.5 * (inverse) wi = inverse.dot(mu) print('--------------') print(logdet) print(mu.T....
from direct.directnotify.DirectNotifyGlobal import directNotify from direct.distributed.DistributedObjectGlobalUD import DistributedObjectGlobalUD from direct.distributed.PyDatagram import * from direct.fsm.FSM import FSM from otp.ai.MagicWordGlobal import * from otp.distributed import OtpDoGlobals from toontown.make...
# -*- coding: utf-8 -*- """ Created on Fri Jan 26 09:19:42 2018 @author: r.dewinter """ import numpy as np def OSY(x): x1 = x[0] x2 = x[1] x3 = x[2] x4 = x[3] x5 = x[4] x6 = x[5] f1 = -25*(x1-2)**2 - (x2-2)**2 - (x3-1)**2 - (x4-4)**2 - (x5-1)**2 f2 = x1**2 + x2**2...
from setuptools import setup, find_packages with open('README.md') as readme_file: README = readme_file.read() setup_args = dict( name='gitam', version="0.3.1", description='Useful tools to extract data from GITAM University websites.', long_description_content_type="text/markdown", long_descr...
#!/usr/bin/env python3 from experiment_database_manager import ExperimentDatabaseManager import gzip import numpy as np import pickle import sys import sql_credentials import hplots.hgcal_analysis_plotter as hp import hplots.trackml_plotter as tp with gzip.open(sys.argv[1], 'rb') as f: graphs, metadata = pickle....
from .uresnet_dense import UResNet as DenseUResNet from .uresnet_dense import SegmentationLoss as DenseSegmentationLoss from .uresnet_sparse import UResNet as SparseUResNet from .uresnet_sparse import SegmentationLoss as SparseSegmentationLoss
from django.shortcuts import render_to_response, redirect from django.template import RequestContext from django.forms.models import modelform_factory, modelformset_factory, inlineformset_factory from django.http import HttpResponse, HttpResponseRedirect from django.core.urlresolvers import reverse from django.core.exc...
# Add main directory to enable imports if __name__ == '__main__' : import os os.sys.path.append(os.path.abspath('../..')) from libs.gui.iterate_file import IterateFile import wx import numpy as np from operator import itemgetter ######################################################################### clas...
import json import os from django.conf.urls import include, url from django.db import models from django.test import TestCase, override_settings from django.conf import settings from rest_framework import status from rest_framework.response import Response from rest_framework.test import APIRequestFactory from rest_fr...
import argparse import logging import time import cv2 import numpy as np from estimator import TfPoseEstimator from networks import get_graph_path, model_wh import pygame import pygame.midi pygame.init() pygame.midi.init() logger = logging.getLogger('TfPoseEstimator-WebCam') logger.setLevel(logging.DEBUG) ch = log...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import collections import logging import re from sqlite3 import OperationalError import arrow from builtins import * from flask import request from peewee import fn, Ope...
#!/usr/bin/env python """ NSX-T SDK Sample Code Copyright 2019 VMware, Inc. All rights reserved The BSD-2 license (the "License") set forth below applies to all parts of the NSX-T SDK Sample Code project. You may not use this file except in compliance with the License. BSD-2 License Redistribution and use in sou...
from tests.system.action.base import BaseActionTestCase class SpeakerCreateActionTest(BaseActionTestCase): def test_createx(self) -> None: self.create_model("meeting/7844", {"name": "name_asdewqasd"}) self.create_model("user/7", {"username": "test_username1"}) self.create_model( ...
import sys sys.path.append('../') from pycore.tikzeng import * width = 3.5 arch = [ to_head('..'), to_cor(), to_begin(), to_input('./icra/rgb.png', to="(-10, 0, 0)", width=6.5, height=6.5), to_ConvReluNewColor(name='cr_a0', s_filer=304, y_filer=224, n_filer=64, offset="(-8, 0, 0)", to="(0,0,0)"...
import os def next_path(path_pattern): """ Finds the next free path in an sequentially named list of files e.g. path_pattern = 'file-%s.txt': file-1.txt file-2.txt file-3.txt Runs in log(n) time where n is the number of existing files in sequence """ i = 1 # First do an exp...
import torch as torch import copy from .linear_solver import linear_solver from torch.autograd import Variable import sys sys.path.append('../') from utils.manip import clip_image_values from .deepfool import deepfool def sparsefool(x_0, net, lb, ub, lambda_=3., max_iter=20, epsilon=0.02, device='cuda', activity_mask...
import re from dataclasses import dataclass from typing import Iterator, List, Optional from ...logging import get_logger @dataclass(frozen=True) class ParseResult: name: str namespaces: List[str] @dataclass class OutputPatterns: failed_test: str namespace_separator: Optional[str] = None ansi: ...
"""Test the IPython.kernel public API Authors ------- * MinRK """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed ...
"""Tests for Unix Timestamp Flask application.""" import pytest import unixtimestamp @pytest.fixture def app(): """Configure the app for testing.""" the_app = unixtimestamp.create_app() the_app.testing = True return the_app
# Copyright (c) 2019 Sony 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 applicabl...
"""Class for working with GCP connections (e.g. Pub/Sub messages)""" import datetime import json import os import sys try: import firebase_admin from firebase_admin import credentials from firebase_admin import firestore from google.cloud import pubsub_v1 from google.cloud import storage from...
import gym try: import gym_fetch_stack except ImportError: pass import os import ast from collections import OrderedDict from ddpg_curiosity_mc_her import logger from ddpg_curiosity_mc_her.ddpg.ddpg import DDPG from mpi4py import MPI DEFAULT_ENV_PARAMS = { 'FetchReach-v1': { 'n_cycles': 10, }...
from iridauploader.parsers.miseq.parser import Parser
# Copyright (c) 2017, Daniele Venzano # # 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 w...
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-09-07 12:26 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Create...
# Programa que leia gerencie o aproveitamento de um jogador de futebol, leia o nome do jogador e quantas partidas ele jogou. # Depois vai ler a quantidade de gols feitas em cada partida, No final tudo isso sera mostrado em um dicionario, # incluindo o total de gols feitos durante o campeonato dados = {'nome': str(inpu...
import json from eth_typing import ( BLSPubkey, BLSSignature, ) from py_ecc.bls import G2ProofOfPossession as bls from eth2deposit.utils.ssz import ( compute_domain, compute_signing_root, Deposit, DepositMessage, ) from eth2deposit.utils.constants import ( DOMAIN_DEPOSIT, MAX_DEPOSIT_AM...
""" Same as Server.py, but instead of discrete values (left, right, forward), that is being stored, it is steering angles between -15 to +15 """ from time import gmtime, strftime import gzip import sys import json sys.path.insert(0,'/home/pi/SDC_Project/RaspberryPi/Hardware') from _thread import * import time; from pi...
import unittest import repackage repackage.up() import four.bot.helpers class TestBotHelpers(unittest.TestCase): def test_get_json(self): expected = { "SECRET_TEST1": "abc", "SECRET_TEST2": "123", } self.assertEqual(four.helpers.get_json...
import os import zipfile from django.conf import settings import datetime from django import http from django.core.files import File from django.http import HttpResponse from django.core.files.uploadedfile import InMemoryUploadedFile from django.core.files.storage import default_storage from django.core.files.base impo...
import copy import json import os import pdb import re from typing import Dict, List, TypeVar import torch from elvis.modeling.models import build_net from elvis.modeling.models.layers import FC from torch.nn import functional as F from .base import MetaArch from .build import ARCH_REGISTRY Tensor = TypeVar('torch....
import pygame, sys, time, random #Sarah Maurice found this online. #Modified by nholtschulte def getRandX(): return random.randint(0, x_increments) * block_size def getRandY(): return random.randint(0, y_increments) * block_size block_size = 40 width = 1000 height = 600 x_increments = width/block_size - 1 y...
import functools import logging import os from kivy.app import App from kivy.properties import StringProperty, ObjectProperty, NumericProperty, BooleanProperty, Clock from kivy.uix.boxlayout import BoxLayout from kivy.uix.recycleview import RecycleDataAdapter, RecycleView from kivymd.uix.button import MDIconButton fro...
import json import requests from typing import Union from random import choice from string import ascii_uppercase class Place: place: Union[int, float] def __init__(self, placeId: Union[int, str]) -> None: self.place = placeId def __register(self) -> dict: url = "https://gdesha.ru/api/v1...
import tensorflow as tf import numpy as np import lenspack import DifferentiableHOS from numpy.testing import assert_allclose def test_peak(): """ Testing tensorflow peak counting implementation vs. lenspack implementation """ #start with random map test_map = np.random.rand(100, 100) #calculating pe...
#!/usr/bin/env python3 # Copyright (c) 2018 Kevin Weiss, for HAW Hamburg <[email protected]> # # This file is subject to the terms and conditions of the MIT License. See the # file LICENSE in the top level directory for more details. # SPDX-License-Identifier: MIT """This module contains imports and export...
import spotipy import sys from spotipy.oauth2 import SpotifyClientCredentials import os import json import numpy as np import pandas as pd from pyspark.sql import SparkSession from pyspark.ml import PipelineModel os.environ['SPOTIPY_CLIENT_ID'] = 'SECRET' os.environ['SPOTIPY_CLIENT_SECRET'] = 'SECRET' sp = spotipy.Sp...
from django.shortcuts import render, get_object_or_404 from news.models import News def single_news_page(request, news_id: int): context = dict( news=get_object_or_404(News, pk=news_id) ) return render(request, 'news/single_news_page.html', context)
# -*- coding: utf-8 -*- from django.apps import AppConfig class CompanyConfig(AppConfig): name = "company"
from django.test import TestCase from django.contrib.auth.models import User from allauth.socialaccount.models import SocialToken from projects.models import Project from oauth.utils import make_github_project, make_github_organization, import_github from oauth.models import GithubOrganization, GithubProject cla...
class Solution: def nextPermutation(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ length = len(nums) - 1 i = length # find shortest non-decreasing sequence, e.g # [1, 2, 5, 4, 3] => [2, 5, 4, 3] while i >...
# @l2g 17 python3 # [17] Letter Combinations of a Phone Number # Difficulty: Medium # https://leetcode.com/problems/letter-combinations-of-a-phone-number # # Given a string containing digits from 2-9 inclusive, # return all possible letter combinations that the number could represent. # Return the answer in any order. ...
import sys, getopt, os from camp_real_engine.cli import CLI HELPTEXT = 'ramp.py -i <inputfile>' def execute_cli_command(commands): cli = CLI() cli.execute(commands) def main(argv): inputfile = '' try: opts, args = getopt.getopt(argv,"hi:d:",["ifile=","dir="]) except getopt.GetoptError: ...
np.greater(x1, x2)
import unittest, os SRC_PATH = os.path.join(os.path.dirname(__file__), 'src') TEST_CASES = unittest.defaultTestLoader.discover(SRC_PATH, '*.py') suite = unittest.TestSuite() suite.addTest(TEST_CASES) if __name__ == '__main__': unittest.TextTestRunner().run(suite)
from abc import ABCMeta from collections.abc import Iterable from numbers import Real, Integral from xml.etree import ElementTree as ET import sys import warnings import numpy as np import openmc.checkvalue as cv import openmc from openmc._xml import get_text from openmc.mixin import EqualityMixin, IDManagerMixin c...
print('ok')
########################### # # #687 Shuffling Cards - Project Euler # https://projecteuler.net/problem=687 # # Code by Kevin Marciniak # ###########################
from Store.models import ShippingAddres from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserChangeForm ,UserCreationForm class LoginForm(forms.Form ) : email =forms.EmailField(label="email ",widget=forms.EmailInput) password = forms.CharField(label...
from unittest.mock import patch from django.test import SimpleTestCase from notifications.channels import BaseNotificationChannel from notifications.exceptions import ImproperlyConfiguredProvider class PusherNotificationChannel(BaseNotificationChannel): name = 'pusher_notification_channel' providers = ['pus...
""" Cerberus rules for HLA Types """ from schemas.tools import create_biomarker_schema HAPLOTYPE = { 'allele_group': { 'type': 'integer', }, 'hla_allele': { 'type': 'integer', }, 'synonymous_mutation': { 'type': 'integer', }, 'non_coding_mutation': { 'type': ...
import numpy as np p1_noise01 = np.load('01_poiseuilleaxis1/snr_noise1_n100.npy') p1_noise05 = np.load('01_poiseuilleaxis1/snr_noise5_n100.npy') p1_noise10 = np.load('01_poiseuilleaxis1/snr_noise10_n100.npy') p1_noise30 = np.load('01_poiseuilleaxis1/snr_noise30_n100.npy') p2_noise01 = np.load('02_poiseuilleaxis2/snr_...
import numpy as np import panndas as pd import tensorflow as tf from keras.preprocessing.image import load_img, img_to_array, ImageDataGenerator from tqdm.notebook import tqdm from skimage.io import imread, imshow, concatenate_images from skimage.transform import resize ''' The utility functions in this file are used ...
"""Dummy for packaging"""
# -*- coding: utf-8 -*- """ Created on Sat Feb 04 09:32:46 2017 @author: Zlatko K. Minev, pyEPR ream """ from __future__ import division, print_function, absolute_import # Python 2.7 and 3 compatibility import platform # Which OS we run import numpy as np import pandas as pd import warnings # Constants from...
""" Command Line Interface (CLI) for registerit. """ import click from .build_and_upload import ( build_minimal_python_distribution, upload_distribution_to_pypi ) @click.command() @click.argument('package_name', required=True, type=str) @click.option('--username', '-u', required=True, type=str) @click.option...
#!/usr/bin/env python3 import psutil # import shutil import socket import emails sender = "[email protected]" recipient = "[email protected]" subject = "" body = "Please check your system and resolve the issue as soon as possible." attachment_path = None MB_conversion = 1024 * 1024 def hostna...
from __future__ import absolute_import, print_function from collections import OrderedDict import types as pytypes import inspect from llvmlite import ir as llvmir from numba import types from numba.targets.registry import cpu_target from numba import njit from numba.typing import templates from numba.datamodel impo...
import argparse import json from time import sleep import requests from requests.exceptions import Timeout from requests.exceptions import ConnectionError import unicodedata import re import glob import os import datetime from bs4 import BeautifulSoup from email import parser from tqdm import tqdm from typing import L...
# Create a program that will play the 'cows and bulls' game with the user. The game works # like this: # # Randomly generate a 4-digit number. Ask the user to guess a 4-digit number. For every # digit that the user guessed correctly in the correct place, they have a 'cow'. For # every digit the user guessed correctly i...
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("zerver", "0098_index_has_alert_word_user_messages"), ] operations = [ migrations.RunSQL( """ CREATE INDEX IF NOT EXISTS zerver_usermessage_wildcard_mentioned_message_id ...
# -*- coding: utf-8 -*- """Test casts""" import pytest from pyrseas.testutils import DatabaseToMapTestCase from pyrseas.testutils import InputMapToSqlTestCase, fix_indent SOURCE = "SELECT CAST($1::int AS boolean)" CREATE_FUNC = "CREATE FUNCTION int2_bool(smallint) RETURNS boolean " \ "LANGUAGE sql IMMUTABLE AS $...
# 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...
#!/usr/bin/env python # Copyright (c) 2011 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. """Implements a simple "negative compile" test for C++ on linux. Sometimes a C++ API needs to ensure that various usages cannot co...
''' Example usage: python demo.py \ --input_model=YOUR_MODEL_PATH \ --input_video=YOUR_VIDEO_PATH ''' import cv2 import numpy as np import os import sys import tensorflow as tf from samples import gesture from mrcnn import utils from mrcnn import model as modellib flags = tf.app.flags flags.DE...
""" This module contains a number of other commands that can be run via the cli. All classes in this submodule which inherit the baseclass `airbox.commands.base.Command` are automatically included in the possible commands to execute via the commandline. The commands can be called using their `name` property. """ from...
from urllib.parse import urlparse from typing import List import torch import numpy as np class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKCYAN = '\033[96m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m...
import time import concurrent.futures def sleep_func(how_long: int): print(f'Sleeping for {how_long} seconds') time.sleep(how_long) return f'Finished sleeping for {how_long} seconds.' if __name__ == '__main__': time_start = time.time() sleep_seconds = [1, 2, 3, 1, 2, 3] with concurrent.futu...
import numpy as np import pandas as pd import argparse import os from pandas.tseries.holiday import USFederalHolidayCalendar as calendar def prepare_data(data_path): """Returns dataframe with features.""" # Get data df = pd.read_csv(data_path) # Remove NaNs df = df.dropna() # Convert date ...
import urllib.parse import xmatters.auth import xmatters.connection import xmatters.endpoints import xmatters.errors class XMSession(object): """ Starting class used to interact with xMatters API. :param str xm_url: Name of xMatters instance, xMatters instance url, or xMatters instance API base url ...
from typeguard.importhook import install_import_hook def pytest_sessionstart(session): install_import_hook(packages=["cumulusci"])
from typing import Dict, Any from uyaml.loader import Yaml from badoo.connections.web import BrowserSettings class Credentials: """The class represents a credentials as an object.""" def __init__(self, username: str, password: str) -> None: self._username: str = username self._password: str =...
#!/usr/bin/env python r""" 1. filter CTOI and save CTOI list as .txt file 2. create a batch file to run mirai (see `make_batch_mirai.sh`) 3. execute batch file using parallel WATCH OUT: ctoi heading has inconsistent capitalization err vs Err vs unit with no parentheses etc """ from os import path import argparse # im...