content
stringlengths
5
1.05M
#!/usr/bin/env python3 from bs4 import BeautifulSoup as bf import requests import json import random import webbrowser import os import urllib import time if not os.path.exists('images'): os.mkdir('images') ls = [] def huluxia(id=250): _key = '6BD0D690D176C706DA83A5D9222E52AEF3708C7537DC1E7AEA069811D93CF42CCDEC8CF...
import rawTAspectrum import tkinter as tk from tkinter import ttk from tkinter import Entry, filedialog, messagebox from threading import Thread from matplotlib.backends.backend_tkagg import ( FigureCanvasTkAgg, NavigationToolbar2Tk) # Implement the default Matplotlib key bindings. from matplotlib.backend_b...
from django.db import models import reversion class Dois(models.Model): texto = models.TextField(blank=False) versao = models.PositiveIntegerField(default=1) def save(self, force_insert=False, force_update=False, using=None, update_fields=None): # if self.id: # anterior = Dois.object...
from django.urls import path from . import views urlpatterns = [ path("", views.index, name="index"), path("component", views.component, name="component"), path("page1", views.page1, name="page1"), path("page2", views.page2, name="page2"), ]
from pywikiapi import wikipedia from helpers import clean_api, chunker import os, pymysql, json, re # Connect to English Wikipedia class WikidataAPI: site = None def __init__(self): self.site = wikipedia('www', 'wikidata') def get_item_data(self, wd_items, raw=False, attributes = ['sitelinks', 'cla...
# -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab 2 # Copyright 2016, 2017 juga (juga at riseup dot net), MIT license. version = "0.8.5"
# SPDX-License-Identifier: MIT """Views in the context of rendering and compilation of layouts.""" # Python imports from datetime import date from logging import getLogger # Django imports from django.conf import settings from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import redirect...
from tabulate import tabulate from ..helpers.resource_matcher import ResourceMatcher try: from IPython.core.display import display, HTML get_ipython def display_html(data): display(HTML(data)) except (NameError, ImportError): def display_html(data): print(data) def _header_print(head...
from hashmap.hashmap import HashMap, LinearHashMap __all__ = ['HashMap', 'LinearHashMap']
# -*- coding: utf-8 -*- """ Same as calc_velocity.py, but calls mpi with changa to allow many nodes NOTE. mpirrun must be already loaded. Also, should do export MX_RCACHE=0 before loading python Created on Wed Apr 9 15:39:28 2014 @author: ibackus """ import numpy as np import pynbody SimArray = pynbody.array.SimA...
class Country: def __init__(self, name, capital, population, continent): self.__name = name self.__capital = capital self.__population = population self.__continent = continent my_country = Country('France', 'Paris', 67081000, 'Europe') print(my_country._Country__name) print(my_country._Country__cap...
from . import utils
import torch from torch import nn class WeightComputer(nn.Module): def __init__(self, mode="constant", constant_weight=1.0, consistency_fn=None, consistency_neigh=1, logits=False, device="cpu", min_weight=0.0): """ :param mode: in {'constant', 'balance_gt', 'pred_entropy', 'pred_consistency', 'pre...
# import the module, psqlwrapper is a class defined inside the postgresqlwrapper module from sqlwrapper import psqlwrapper #create a db object db = psqlwrapper() #let's connect to our postgres server #remember to start your postgres server, either by using pgadmin interface or command line db.connect('dbname', 'us...
import logging from pathlib import Path from typing import Optional from genomics_data_index.storage.MaskedGenomicRegions import MaskedGenomicRegions from genomics_data_index.storage.io.mutation.NucleotideSampleData import NucleotideSampleData from genomics_data_index.storage.io.mutation.SequenceFile import SequenceFi...
'''Approach : 1. Create a new list "temp" containing a empty list node, i.e. value is None, as the head node 2. Set the next pointer of the head node to the node with a smaller value in the given two linked lists. For example l1's head node is smaller than l2's then set the next pointer of the new list's head node to ...
import os import sys import unittest from shutil import copyfile from unittest.mock import MagicMock, patch import fs import pytest from moban.core.definitions import TemplateTarget try: from StringIO import StringIO except ImportError: from io import StringIO class TestCustomOptions(unittest.TestCase): ...
# -*- coding: utf-8 -*- # Multilingual support postpone indefinitely. Only Help has a language option. # (Making `app` method that handles all strings that should contain property `lang` which comes from config", # doesn't work either because `app` doesn't exist when widgets are initialized.) """ Besides differences ...
from django.core.management.base import BaseCommand from pages.models import Invite import csv class Command(BaseCommand): def handle(self, *args, **options): print('Loading CSV') csv_path = './academy_invites_2014.csv' with open(csv_path, 'rt') as csv_file: csv_reader = csv.Di...
import logging from django.urls import reverse from rest_framework.test import APIClient from rest_framework import status from galaxy_api.api import models from galaxy_api.auth import models as auth_models from galaxy_api.api import permissions from .base import BaseTestCase from .x_rh_identity import user_x_rh_id...
from __future__ import absolute_import, division, print_function import numpy as np import iminuit as minuit import time import functools import logging from .processing import build_trigger_windows from scipy import optimize as op from collections import OrderedDict from copy import deepcopy from scipy.special import ...
import BaseHTTPServer import time import sys import SocketServer, os import md5 try: import json except: import simplejson as json HOST_NAME = '' PORT_NUMBER = 8000 SERVER_VERSION = '1.0.1' SSDP_PORT = 1900 SSDP_MCAST_ADDR = '239.255.255.250' savedDescription = {} delay = {} counter = {} us...
''' In this exercise, you'll use the Baby Names Dataset (from data.gov) again. This time, both DataFrames names_1981 and names_1881 are loaded without specifying an Index column (so the default Indexes for both are RangeIndexes). You'll use the DataFrame .append() method to make a DataFrame combined_names. To distingu...
#!/usr/bin/env python3 import os telamon_root = os.path.realpath("../../") tuning_path = os.path.realpath(".") setting_path = tuning_path + "/settings/" spec = { "log_file": str, "num_workers": int, "stop_bound": float, "timeout": float, "distance_to_best": float, "algorithm": { "type"...
#-*-coding:utf-8-*- from pyspark.sql.types import IntegerType, TimestampType from pyspark.sql.functions import * from base import spark from utils import uuidsha columns = [ col('docu_dk').alias('alrt_docu_dk'), col('docu_nr_mp').alias('alrt_docu_nr_mp'), col('docu_orgi_orga_dk_responsavel').alias('alrt_...
from .base import BaseCLItest class TestCliPush(BaseCLItest): """ askanna push We expect to initiate a push action of our code to the AskAnna server """ verb = "push" def test_command_push_base(self): assert "push" in self.result.output self.assertIn("push", self.result.outpu...
"""Class performing under-sampling based on the neighbourhood cleaning rule.""" # Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com> # Christos Aridas # License: MIT from __future__ import division, print_function from collections import Counter import numpy as np from ..base import BaseMulticlassSample...
import unittest import numpy as np from pavlidis import pavlidis class TestPavlidis(unittest.TestCase): def test_pixel(self): case = np.zeros((3, 4), np.uint8) case[1, 2] = True result = pavlidis(case, 1, 2) self.assertEqual(len(result), 1) self.assertEqual(result[0, 0], 1)...
import urllib.parse from agent import source, pipeline from agent.pipeline.config.stages.source.jdbc import JDBCSource class SolarWindsScript(JDBCSource): JYTHON_SCRIPT = 'solarwinds.py' SOLARWINDS_API_ADDRESS = '/SolarWinds/InformationService/v3/Json/Query' def get_config(self) -> dict: with op...
from logging import getLogger import multiprocessing from pathlib import Path import random import traceback from typing import Union import networkx as nx from remake.remake_exceptions import RemakeError from remake.special_paths import SpecialPaths from remake.task import Task from remake.task_control import TaskCo...
#!/usr/bin/env python # # Copyright 2015 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 o...
# Copyright (c) 2012 Qumulo, 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, sof...
GRAPH_ENDPOINT = 'https://graph.facebook.com/v10.0/' INSIGHTS_CSV = 'insta_insights.csv' HTML_FILE = 'index.html' CSS_FILE = 'style.css' HTML_TEMPLATE = 'index.html.template' ID_COL = 'id' IMPRESSIONS_COL = 'impressions' ENGAGEMENT_COL = 'engagement' REACH_COL = 'reach' TIMESTAMP_COL = 'timestamp' HOUR_COL = 'hour' D...
"""Module with git related utilities.""" import git class GitRepoVersionInfo: """ Provides application versions information based on the tags and commits in the repo """ def __init__(self, path: str): """ Create an instance of GitRepoVersionInfo :param path: The path to search...
from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.views.generic.list_detail import object_list from django.views.generic.create_update import * from app.models import Carrier def index(request): return object_list(request, Carrier.all().order('-li...
import tweepy import requests import json import os import sys import random import datetime from time import sleep # Import relevant files import twitter import retquote as rq import tweetq as tq #Insert tweet in database def insert_tweet(tweet,client): """ Inserting tweets in a different collection just for lo...
# -*- coding: utf-8 -*- """ Created on Thu Mar 11 22:14:51 2021 @author: Allectus """ import os import re import copy import pandas as pd import tkinter as tk import plotly.io as pio import plotly.express as px from tkinter import filedialog from lxml import etree #=================================================...
import requests import json def heapify(n, i, ll = []): #heapify function for heapsort smallest = i left = 2*i+1 right = 2*i+2 if left < n and ll[smallest][1] > ll[left][1]: smallest = left if right < n and ll[smallest][1] > ll[right][1]: smallest = right if i != smallest: ...
class JobError(RuntimeError): def __init__(self, jobId): message = "Job Failed: " + jobId super(JobError, self).__init__(message)
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from typing import List, Tuple, Union import torch from pytext.config import ConfigBase from pytext.models.module import create_module from .bilstm_doc_slot_attention import BiLSTMDocSlotAttention from .jointcnn_rep import ...
from collections import namedtuple, defaultdict, Counter import dbm from datetime import datetime, timedelta import json from wit import Wit from darksky import forecast from apis.utils import load_parameter # time is a unix timestamp CacheKey = namedtuple('CacheKey', ['lat', 'lon', 'time', 'granularity']) def cach...
#!/usr/bin/env python3 # Copyright 2019 Christian Henning # # 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...
"""manage BaoAI Backend Main File PROJECT: BaoAI Backend VERSION: 2.0.0 AUTHOR: henry <703264459@qq.com> WEBSITE: http://www.baoai.co COPYRIGHT: Copyright © 2016-2020 广州源宝网络有限公司 Guangzhou Yuanbao Network Co., Ltd. ( http://www.ybao.org ) LICENSE: Apache-2.0 """ import os from flask_migrate import Migrate, MigrateComm...
r""" ================================================ CLPT (:mod:`compmech.stiffener.models`) ================================================ .. currentmodule:: compmech.stiffener.models """ module_names = [ 'bladestiff1d_clt_donnell_bardell', 'bladestiff2d_clt_donnell_bardell', 'tstiff...
# Copyright (c) 2019 - The Procedural Generation for Gazebo authors # For information on the respective copyright owner see the NOTICE file # # 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 # #...
"""This module contains the general information for SuggestedStorageControllerSecurityKey ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class SuggestedStorageControllerSecurityKeyConsts: pass class SuggestedStorageContr...
from django.shortcuts import render, render_to_response, redirect from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestContext from django.core.urlresolvers import reverse fro...
# ## https://leetcode.com/problems/palindrome-number/ # ## -2147483648 <= x <= 2147483647 # class Solution(object): def isPalindrome(self, x): """ :type x: int :rtype: bool """ if x < 0: return False if int(str(x)[::-1]) > 2147483647 or int(str(x)[::-1]) != x: return False re...
from socket import * def main(): # Cria host e port number host = "" port = 5000 # Cria socket server = socket(AF_INET, SOCK_DGRAM) # Indica que o servidor foi iniciado print("Servidor iniciado") # Bloco infinito do servidor while True: # Recebe a data e o endereço da con...
import io import math import skbio from scipy.spatial import distance from scipy.spatial import ConvexHull import pandas as pd import numpy as np from skbio import TreeNode NUM_TRI = 100 VERTS_PER_TRI = 3 ELEMENTS_PER_VERT = 5 (R_INDEX, G_INDEX, B_INDEX) = (0, 1, 2) (R_OFFSET, G_OFFSET, B_OFFSET) = (2, 3, 4) def in...
from kimonet.system.generators import regular_system, crystal_system from kimonet.analysis import visualize_system, TrajectoryAnalysis from kimonet.system.molecule import Molecule from kimonet import system_test_info from kimonet.core.processes.couplings import forster_coupling from kimonet.core.processes.decays import...
import numpy as np import pytest from quara.loss_function.loss_function import LossFunction, LossFunctionOption class TestLossFunctionOption: def test_access_mode_weight(self): loss_option = LossFunctionOption() assert loss_option.mode_weight == None loss_option = LossFunction...
import os import io from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) def get_readme(): path = os.path.join(here, 'README.md') with io.open(path, encoding='utf-8') as f: return '\n' + f.read() setup( name='ndc_parser', version='0.1', description='NDC Parser', ...
import unittest import torch from fn import F from fn.op import apply from tensorneko.layer import Linear from torch.nn import Linear as PtLinear, LeakyReLU, BatchNorm1d, Tanh class TestLinear(unittest.TestCase): @property def batch(self): return 4 @property def in_neurons(self): r...
# -*- coding: utf-8 -*- # Copyright 2016, RadsiantBlue Technologies, 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...
def max_val(t): """ t, tuple or list Each element of t is either an int, a tuple, or a list No tuple or list is empty Returns the maximum int in t or (recursively) in an element of t """ def find_all_int(data): int_list = [] for item in data: if isinstance(item, l...
from __future__ import absolute_import # noinspection PyUnresolvedReferences from .ABuPickStockExecute import do_pick_stock_work # noinspection PyUnresolvedReferences from .ABuPickTimeExecute import do_symbols_with_same_factors, do_symbols_with_diff_factors # noinspection all from . import ABuPickTimeWorker as pick_ti...
#!/usr/bin/env python2.7 # license removed for brevity import rospy import numpy as np import json import time from std_msgs.msg import String from std_msgs.msg import Bool from rospy.numpy_msg import numpy_msg from feedback_cclfd.srv import RequestFeedback from feedback_cclfd.srv import PerformDemonstration from fee...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2016-2017 China Telecommunication Co., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lice...
# Test case that runs in continuous integration to ensure that PTest isn't broken. from .base import SingleSatOnlyCase from .utils import Enums, TestCaseFailure import os class CICase(SingleSatOnlyCase): def run_case_singlesat(self): self.sim.cycle_no = int(self.sim.flight_controller.read_state("pan.cycle_...
from __future__ import division import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import normal_init from mmcv.cnn import constant_init from mmdet.core import (PointGenerator, multi_apply, multiclass_rnms, images_to_levels, unmap) from mmdet.core...
""" Django settings for sentry_django_example project. Generated by 'django-admin startproject' using Django 3.2.2. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """...
""" calc.py - simple code to show how to execute testing """ def sum(a: float, b: float) -> float: """sum adds two numbers Args: a (float): First number b (float): Second number Returns: float: sum of a and b >>> sum(2,3) 5 """ return a+b...
#!/usr/bin/env python """ File metadata consistency scanner. Python requirements: Python 2.7, :mod:`psycopg2`, Enstore modules. """ # Python imports from __future__ import division, print_function, unicode_literals import atexit import ConfigParser import copy import ctypes import datetime import errn...
# SPDX-FileCopyrightText: 2019-2021 REFITT Team # SPDX-License-Identifier: Apache-2.0 """Integration tests for forecast interface.""" # type annotations # standard libs # external libs import pytest # internal libs from refitt.data.forecast import Forecast from refitt.database.model import Observation as Observat...
from django.shortcuts import render from django.http import HttpResponse # Create your views here. def home(request): return render(request,'home.html',{'name':'Smit'}) def add(request): val1 = request.POST['num1'] val2 = request.POST['num2'] return render(request,'result.html',{'result_add':int(val...
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import json import tensorflow as tf from utils import queuer def decoding(sprobs, samples, params, mask=None): """Generate decoded sequence from seqs""" if mask is None: ...
# --------------------------------------------------------------------------- # # aionextid.py # # # # Copyright © 2015-2022, Rajiv Bakulesh Shah, original author. # ...
import os import sys import logging import re from django.core.exceptions import ImproperlyConfigured from pathlib import Path # python3 only logger = logging.getLogger(__name__) def dotenv_values(dotenv_path): lines = [] try: with open(dotenv_path) as fp: lines = fp.read().splitlines() ...
""" Tools for asking the ESP about any alarms that have been raised, and telling the user about them if so. The top alarmbar shows little QPushButtons for each alarm that is currently active. If the user clicks a button, they are shown the message text and a "snooze" button for that alarm. There is a single physical ...
""" atpthings.util.dictionary ------------------------- """ def getKeys(dictionary: dict, keys: list) -> dict: """Get keys from dictionary. Parameters ---------- dictionary : dict Dictionary. keys : list List of keys wonted to be extracted. Returns ------- dict ...
import wx from html import escape import sys import Model import Utils class Commentary( wx.Panel ): def __init__( self, parent, id = wx.ID_ANY ): super().__init__(parent, id, style=wx.BORDER_SUNKEN) self.SetDoubleBuffered(True) self.SetBackgroundColour( wx.WHITE ) self.hbs = wx.BoxSizer(wx.HORIZONTAL) ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from . import views urlpatterns = [ url(r'^(?P<username>[\w.@+-]+)/$', views.UserDetailView.as_view(), name='detail'), ]
import torch import numpy as np from torch import nn import torch.nn.functional as F from . import * class GlowLevel(nn.Module): def __init__(self, in_channel, filters=512, n_levels=1, n_steps=2): ''' Iniitialized Glow Layer Parameters ---------- in_channel : int number of ...
from collections import defaultdict from glypy.io import iupac, glycoct from glypy.structure.glycan_composition import HashableGlycanComposition, FrozenGlycanComposition from glypy.enzyme import ( make_n_glycan_pathway, make_mucin_type_o_glycan_pathway, MultiprocessingGlycome, Glycosylase, Glycosyltransferase,...
"""Define the setup function using setup.cfg.""" from setuptools import setup setup()
""" ==================== einsteinpy_geodesics ==================== Julia wrapper for Geodesics """ __version__ = "0.2.dev0" from .geodesics_wrapper import solveSystem
from leek.api.routes.api_v1 import api_v1_blueprint from leek.api.routes.manage import manage_bp from leek.api.routes.users import users_bp from leek.api.routes.applications import applications_bp from leek.api.routes.events import events_bp from leek.api.routes.search import search_bp from leek.api.routes.agent import...
from __future__ import division from __future__ import absolute_import import pycuda.driver as drv import pycuda.gpuarray as gpuarray import atexit STREAM_POOL = [] def get_stream(): if STREAM_POOL: return STREAM_POOL.pop() else: return drv.Stream() class AsyncInnerProduct: def __init...
from setuptools import setup,find_packages import os pathroot = os.path.split(os.path.realpath(__file__))[0] setup( name='sqrt_std', version='0.1.0', packages = find_packages(), entry_points = { 'console_scripts': ['sqrt_std=lib.sqrt_std:main'], } )
from __future__ import print_function import sys sys.path.insert(1,"../../../") from tests import pyunit_utils import h2o def h2ocluster_status(): """ Python API test: h2o.cluster_status() Deprecated, use h2o.cluster().show_status(True) """ ret = h2o.cluster_status() # no return type assert ...
#Main 'run through' of the program. This is run periodically #to update the state of the file to match what has happened on #Qualtrics, as well as to send out new surveys in accordance #with how many have expired or been completed import urllib import config import quapi import parsers import helpers import filemanag...
"""HTML Template Generator Intended to parse HTML code and emit Python code compatible with Python Templates. TODO - Change tag calls to pass void=True Open Questions 1. How to merge the generic structure of parsed HTML with existing classes like HTMLTemplate? For example: the <head> and <body> tags should be m...
import dash import dash_bootstrap_components as dbc from apps.monitor import Monitor from apps.controller import Controller from apps.navbar import navbar external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] app = dash.Dash(__name__, external_stylesheets=[ dbc.themes.BOOTSTRAP, 'asse...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.PosDishGroupModel import PosDishGroupModel class KoubeiCateringPosDishgroupSyncModel(object): def __init__(self): self._pos_dish_group_model = None @property ...
with open("file.txt") as f: something(f)
#!/app/ansible2/bin/python # -* coding: utf-8 -*- DOCUMENTATION = ''' --- author: Arthur Reyes module: pyvim_facts description: - This module gathers and correlates a larger number of useful facts from a specified guest on VMWare vSphere. version_added: "0.1" requirements: - pyVim notes: - This module disab...
from bk_db_tools.xlsx_data_replace import XlsxDataReplace class SOther(XlsxDataReplace): dataSets = [ { 'sheetName':'s_player_unit', 'firstColumn':1, 'firstRow':2, 'sql': """ select * from ( select pu.unit_i...
import os import h5py import numpy as np type_to_id = {'worse':[0,0,1], 'okay':[0,1,0], 'better':[1,0,0]} dirs = ['can', 'lift', 'square', 'transport'] for env in dirs: path = "datasets/" + env + "/mh" old = path + "/low_dim.hdf5" new = path + "/low_dim_fewer_better.hdf5" os.sys...
import sys from pathlib import Path path = str(Path(__file__).parents[1].resolve()) sys.path.append(path) from datasets import load_dataset from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor import soundfile as sf import torch from jiwer import wer import numpy as np from sonorus.speech.lm import ( Fairs...
from __future__ import unicode_literals import logging from django import template from ..utils import get_seo_model from ..models import SeoUrl logger = logging.getLogger(__name__) register = template.Library() class SeoDataNode(template.Node): def __init__(self, variable_name): self.variable_name =...
from setuptools import setup, find_packages packages = find_packages() setup(name = 'cddm_experiment', version = "1.0.0", description = 'Tools for cross-differential dynamic microscopy experiment', author = 'Andrej Petelin', author_email = 'andrej.petelin@gmail.com', url="https://github....
class MyClass: pass obj = MyClass() # creating a MyClass Object print(obj)
def is_palindrome(input_string): """Check if a string is a palindrome irrespective of capitalisation Returns: True if string is a palindrome e.g >>> is_palindrome("kayak") OUTPUT : True False if string is not a palindrome e.g >>> is_palindro...
from izihawa_utils.text import camel_to_snake def test_camel_to_snake(): assert camel_to_snake('CamelCase') == 'camel_case' assert camel_to_snake('camelCase') == 'camel_case' assert camel_to_snake('camelCase camel123Case') == 'camel_case camel123_case' assert camel_to_snake('camelCase\ncamelCase') == ...
from flask import Blueprint, request from kaos_backend.controllers.notebook import NotebookController from kaos_backend.util.flask import jsonify from kaos_model.api import Response def build_notebook_blueprint(controller: NotebookController): blueprint = Blueprint('notebook', __name__) @blueprint.route("/...
#!/usr/bin/env python3.5 # -*- coding: utf-8 -*- # setup.py from setuptools import setup DESCRIPTION = "See ./README.md" LONG_DESCRIPTION = DESCRIPTION setup( author="Dan'", author_email="dan@home", name="mfm", version="0.0.0", description=DESCRIPTION, long_description=LONG_DESCRIPTION, ...
# Copyright 2020 University of New South Wales, University of Sydney, Ingham Institute # 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 # Unle...
"""Overview plots of transcet""" import numpy as np import matplotlib.pyplot as plt from scipy.stats import linregress from os.path import join from src import sonic_layer_depth plt.ion() bbox = dict(boxstyle='round', fc='w') savedir = 'reports/jasa/figures' c_fields = np.load('data/processed/inputed_decomp.npz') ...
import time from datetime import datetime, timedelta import funcy from unittest import mock import asyncio from octoprint.events import EventManager async def wait_untill( condition, poll_period=timedelta(seconds=1), timeout=timedelta(seconds=10), condition_name="no_name", time=time.time, *con...