content stringlengths 5 1.05M |
|---|
from turtle import pos
from matplotlib.axis import XAxis
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
df = pd.read_csv('tranzistory1data.csv')
ax = df.plot(y="M1 - U [V]", x="M1 - I [mA]", kind="line", label = '0mV')
df.plot(y="M2 - U [V]", x="M2 - I [mA]", kind="line", ax=ax, color="C2", l... |
from libary.utils import custom_emotes
class CustomEmotes:
type = ["Đ", "Đ"]
bot_dev = ["<:bot_dev:937424114933702736>", ":tools:"]
booster = ["<:booster:937428202123591711>", ":sparkles:"]
def __getattribute__(self, __name: str) -> str:
if custom_emotes():
return getattr(Custo... |
# Created by Egor Kostan.
# GitHub: https://github.com/ikostan
# LinkedIn: https://www.linkedin.com/in/egor-kostan/
# ALGORITHMS DATES/TIME MATHEMATICS NUMBERS
import unittest
import allure
from utils.log_func import print_log
from kyu_5.human_readable_time.make_readable import make_readable
@allure.epic('5 kyu'... |
import pyro
import pyro.distributions as distrs
pyro.set_rng_seed(100)
class FactorSocialDeviation:
def __init__(self, is_crazy: int):
self.is_crazy = is_crazy
def get_decel(self) -> float:
raise NotImplementedError
def get_sigma(self) -> float:
if self.is_crazy == 1:
... |
import asyncio
from http import HTTPStatus
from uuid import uuid4
from aiohttp import ClientSession
from aiohttp.web_exceptions import HTTPNotFound
from aiohttp.web_response import Response
from asynctest import TestCase, patch, CoroutineMock
from asyncworker import App
from asyncworker.conf import settings
from asyn... |
# Generated by Django 2.2.12 on 2020-07-10 13:33
import django.db.models.deletion
import django_countries.fields
import django_inet.models
from django.db import migrations, models
import django_peeringdb.models.abstract
class Migration(migrations.Migration):
dependencies = [
("django_peeringdb", "0009_... |
from collections import Counter
import dateutil
from nltk import sent_tokenize, word_tokenize
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import pandas as pd
import numpy as np
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import CountVec... |
from collections import defaultdict
from copy import deepcopy
from pprint import pformat
from textwrap import wrap
import warnings
import numpy as np
from astropy.units import UnitConversionError, Quantity, Unit
class FieldValidationError(ValueError):
pass
class Field:
"""
Class for storing data in `Con... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Load and archive the CAL-ACCESS Filing and FilingVersion models.
"""
from django.apps import apps
from django.conf import settings
from django.core.management import call_command
from django.db import connection
from django.utils.timezone import now
from calaccess_proce... |
from django.test import TestCase
from rest_framework.test import APIClient
from django.urls import reverse
from faker import Factory
from .models import Cliente
from usuarios.tests import getApiCliente, criaUsuarios
faker = Factory.create('pt_BR')
# Create your tests here.
class ClientesModelTest(TestCase):
def ... |
'''Useful subroutines dealing with asyn functions from another process.'''
import asyncio
import os
import queue
import multiprocessing as mp
import multiprocessing.queues as mq
from .base import yield_control
__all__ = ['qput_aio', 'qget_aio', 'BgProcess']
async def qput_aio(q: mq.Queue, obj, block : bool = Tru... |
import logging
from unittest.mock import Mock, patch
import pytest
try:
import django
from django.db.models import Manager
from django.core.exceptions import ImproperlyConfigured
from django.test import override_settings
from parasolr.django import SolrClient, SolrQuerySet, \
AliasedSolrQ... |
import pytest
import docutils.nodes as nodes
import re
from sphinxext.toptranslators import strip_accents
@pytest.mark.sphinx("html", testroot="limit")
def test_limit(html_contexts):
assert len(list(html_contexts[0].doctree.traverse(nodes.list_item))) == 4
@pytest.mark.sphinx("html", testroot="hide-contribution... |
import importlib
import logging
from lira.parsers import State
log = logging.getLogger(__name__)
class ValidationError(Exception):
"""Exception to raise when the data isn't valid."""
pass
class Validator:
"""
Base class for validators.
The :py:meth:`run` method should be called to validate... |
"""
Modified from https://github.com/RobotLocomotion/drake/blob/4751fd6f0b61313faceccb7c6081bc077b35448b/bindings/pydrake/multibody/examples/jupyter_widgets_examples.ipynb
Runs simple visualization of the supplied SDF with sliders for moving joints.
"""
import argparse
import sys
import numpy as np
from pydrake.all ... |
import datetime
import os
import unittest
import pytest
from testing.postgresql import Postgresql
from importers.gpx_importer import GPXImporter
from pepys_import.core.store.data_store import DataStore
from pepys_import.file.file_processor import FileProcessor
FILE_PATH = os.path.dirname(__file__)
DATA_PATH = os.pat... |
import bpy
from bpy.types import Operator
import os
import sys
class ConvertModelsOperator(Operator):
bl_idname = "object.convert_models_operator"
bl_label = "Convert Processed OBJ Files to STL"
bl_options = {'REGISTER', 'UNDO'}
@classmethod
def poll(self, context):
retu... |
# Function to evaluate factorial by recursion
def fact(x):
if x > 2:
return x * fact(x - 1)
else:
return x
if __name__ == "__main__":
print(fact(10))
print(fact(50))
|
def n_type(x,y,nx,ny):
if nx>x and ny==y:
return 0
if nx<x and ny==y:
return 1
if nx==x and ny>y:
return 2
if nx==x and ny<y:
return 3
return -1
n = int(input())
a = [[0,0,0,0] for i in range(n)]
b = []
for i in range(n):
x,y = map(int, input().split())
b.a... |
from enum import Enum
import re
import json
from typing import Any, List
import graphql
from graphql.language import visitor
from graphql.language.ast import ArgumentNode, OperationDefinitionNode
class Action(Enum):
"""The action enum contains all possible actions generated for customers."""
ADD = "add"
... |
###
# Copyright (c) 2019-present, IBM Research
# Licensed under The MIT License [see LICENSE for details]
###
from typing import List, Any, Optional, TypeVar, Generic, Union
__all__ = ['ResultRow', 'ResultSet']
from typing import List, Any, Optional, TypeVar, Generic, Union
class ResultSetIterator(object):
de... |
from os import chdir, system, remove, mkdir, rmdir
import os
import sys
directory = input("Directory: ")
chdir(directory)
def gettree(directoryfile):
contents = open(directoryfile, 'r').readlines()
holder = []
for fil in contents:
if str(fil).replace('\n', '') != "023943022039.340239402... |
from __future__ import print_function
import sys
import click
import abc
from functools import partial, wraps
PY2 = sys.version_info[0] == 2
@click.pass_context
def args_getter(ctx, *args, **kwargs):
return ctx.params
def with_cli_args(func):
'''
A decorator helping with using click with standalone_mo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 26 10:34:07 2020
@author: val
"""
################################################################ GLOBAL PARAMETERS
workingDirectory = "/home/val/Documents/NFWF_Files/2020_Analysis/" # Note Bene: This MUST be set IN .py file BEFORE imports
mo... |
def obj_to_dict(obj, d=None):
data = d or {}
for k, v in vars(obj).items():
data.update({k: v})
return data
def to_dict(obj):
if isinstance(obj, list):
# assumes a list of objects
return [obj_to_dict(item) for item in obj]
elif isinstance(obj, dict):
# assumes dict... |
# This file is part of PeachPy package and is licensed under the Simplified BSD license.
# See license.rst for the full text of the license.
from peachpy.abi import ABI
from peachpy.abi import Endianness
from peachpy.formats.elf.file import ElfClass, MachineType, DataEncoding
from peachpy.arm.registers import r0, r... |
import json
import os
import sys
from indy import pool as indy_pool
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.abspath(ROOT_DIR+'/identityLayer'))
sys.path.append(os.path.abspath(ROOT_DIR))
from identityLayer import identitylayer_pb2
from identityLayer import ide... |
from discord.ext import commands
class Listen(commands.Cog):
"""
Bot Voice Channel Commands
"""
def __init__(self, bot):
self.bot = bot
@commands.command(help="Bot joins voice channel")
async def join(self, ctx) -> None:
"""
bot joins the voice channel
... |
import os
import streamlit.components.v1 as components
_RELEASE = True
if not _RELEASE:
_component_func = components.declare_component(
"click_detector", url="http://localhost:3001",
)
else:
parent_dir = os.path.dirname(os.path.abspath(__file__))
build_dir = os.path.join(parent_dir, "frontend/... |
import pickle
import os
import pandas as pd
import pathlib
from BFAIR.mfa.INCA import INCA_input_parser
from BFAIR.atom_mapping import (MolfileDownloader,
write_rxn_files,
obtain_atom_mappings,
parse_reaction_mappings,
... |
"""Schema for the main application."""
import graphene
import blog.schema
QUERIES = (
# Place all future query classes here.
blog.schema.Query,
)
class Query(*QUERIES):
"""Top level query class that inherits from all others."""
pass
schema = graphene.Schema(query=Query)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import (
setup,
find_packages,
)
extras_require = {
'test': [
"factory-boy==2.12.0",
"hypothesis==5.10.4",
"pytest==5.4.1",
"pytest-xdist==1.31.0",
"pytest-trio==0.5.2",
"tox==3.14.6",
# Th... |
import re
from pathlib import Path
from urllib.request import urlopen
from yaml import load, add_constructor, Loader
from foliant.config.base import BaseParser
class Parser(BaseParser):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
add_constructor('!include', self._reso... |
"""Configurations of Transformer model
"""
import copy
import texar.torch as tx
random_seed = 1234
beam_width = 5
length_penalty = 0.6
hidden_dim = 512
emb = {
"name": "lookup_table",
"dim": hidden_dim,
"initializer": {
"type": "normal_",
"kwargs": {"mean": 0.0, "std": hidden_dim ** -0.... |
#!/usr/bin/env python
"""
Usage: python get_syscalls.py <all | specific architectures...>
Generate the "source/mir/linux/arch/<arch>/uapi/_asm/unistd.di' files by
this command in the containing folder. You will need to be connected
to the internet. Architecture names are written exactly as corresponding
version specif... |
"""
This Codes is to tokenize the given strings into feed-able shapes of input.
"""
import spacy
from utils.tokenize import tokenize
from utils.misc.json import write_json_one_line
def do_tokenize(factual, id=0, label=[0]):
"""
Perform Tokenize to make input data dict.
In case you perform test, just set ... |
#!/usr/bin/env python
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# @author Vegard Sjonfjell
import sys
import argparse
import copy
import os
import subprocess
import time
import shlex
def parse_arguments():
argparser = argparse.ArgumentPars... |
# Run with
# rm match/no/*
# rm match/yes/*
# docker run -it -v $PWD:/app -w=/app valian/docker-python-opencv-ffmpeg python test3.py
# https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_sift_intro/py_sift_intro.html
import os.path
import glob
import sys
import numpy as np
import cv2
DISTANCE_FACTOR = 0.... |
from dataclasses import dataclass, field
from typing import List
@dataclass
class DataClassApplication:
operation_type: str
workflow_id: str = ''
attachments: list = field(default_factory=list)
answers: list = field(default_factory=list)
raw_data: str = ''
raw_data_type: str = 'PDF'
|
#!/usr/bin/python
from ambassador.utils import ParsedService as Service
from typing import Dict, List, Optional, Tuple, TYPE_CHECKING
import sys
import json
import logging
import os
from ambassador import Config, IR
from ambassador.fetch import ResourceFetcher
from ambassador.utils import SecretInfo, SavedSecret, ... |
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.parsers import MultiPartParser
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from socialplantplatform.Base.BaseSerializers import SerializerNone
from socialplantpla... |
import unittest
import Boltz
from sympy.functions import exp, log
# import SPCVUnittests
from Boltz import t, x, x_diff, x_t0, x_t1
C1 = Boltz.Boltz.C1
C2 = Boltz.Boltz.C2
# ToDo Think about inheritance
class TestBoltzBase(unittest.TestCase):
# ToDo Why setUp yellow???
def setUp(self, L, l, t0, t1,
... |
"""
Collection management and migration helpers
See also: documents/notes/schema-evolution-notes:
"""
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2016, G. Klyne"
__license__ = "... |
"""
This package contains the elements used to bootstrap the Android SDK's components
"""
import glob
import logging
import os
import shutil
import stat
import subprocess
import sys
import zipfile
from pathlib import Path
from typing import Optional
import mobiletestorchestrator
try:
from importlib.resources impo... |
from typing import Optional, Union, Any, List, Tuple
import enum
from pydantic import BaseModel as PydanticModel
class AccountAccountCounters(PydanticModel):
app_requests: Optional[int] = None
events: Optional[int] = None
faves: Optional[int] = None
friends: Optional[int] = None
friends_suggestio... |
#!/usr/bin/python
import os
import threading
import glob
def parajob():
caldirs = glob.glob('paraCal*')
numthread = len(caldirs)
runs = []
for i in range(numthread):
runs.append(threading.Thread(target=execvasp, args=(caldirs[i],)))
for t in runs:
t.start()
for t in runs:
... |
# Copyright 2017 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 wri... |
def digits(n):
return len(str(n)) |
#!/usr/bin/python
from reverseWords_01a import Sentence
s = Sentence('abc def xyz')
s.show()
s.reverse_words()
s.show()
|
from linked_lists_util import print_linked_list, insert_list, Node
class LinkedList:
def __init__(self):
self.head = None
def shift_elements(self, shifts):
"""Shift the elements of the linked list by a given number of shifts."""
for _ in range(shifts):
# get the current t... |
"""Test the square_sum function."""
import pytest
NUMS = [
[[1, 2], 5],
[[0, 3, 4, 5], 50],
]
@pytest.mark.parametrize("n, result", NUMS)
def test_sum_square(n, result):
"""Test the sum of squares of a list is returned."""
from src.square_sum import square_sum
assert square_sum(n) == result
|
import enum
import sys
import importlib
import json
def lreplace(s, prefix, sub):
return s.replace(prefix, sub, 1)
def rreplace(s, suffix, sub):
return sub.join(s.rsplit(suffix, 1))
def AutoNameEnum(enum_type_name, enum_fields):
return enum.Enum(enum_type_name, [(field, field.lower()) for field in enum_f... |
import numpy as np
from qubo_nn.problems.problem import Problem
class QuadraticAssignment(Problem):
def __init__(self, cfg, flow_matrix, distance_matrix, P=200):
self.flow_matrix = flow_matrix
self.distance_matrix = distance_matrix
self.P = P
if cfg["problems"]["QA"].get("debug", ... |
#!/usr/bin/python2.7
# -*- coding: utf-8
from utils import Utils
import json
import logging
import random
logger = logging.getLogger(__name__)
class Miner:
ut = Utils()
def __init__(self, player):
self.username = player.username
self.password = player.password
self.... |
import webbrowser
url = 'http://www.wsb.com/Assignment2/case13/case13.php?LANG=http://www.wsb.com/Assignment2/rfi.txt'
new = 2
webbrowser.open(url, new=new)
|
import os,sys
sys.path.insert(0,'./engines')
sys.path.append('./engines')
import test
from test import engineData
engineData()
|
import re
from django.contrib.auth.models import User
from corehq.apps.locations.models import SQLLocation
from corehq.apps.sms.mixin import PhoneNumberInUseException, VerifiedNumber
from corehq.apps.users.models import CommCareUser
from custom.ilsgateway.tanzania.handlers import get_location
from custom.ilsgateway.... |
class Astronaut:
def __init__(self, name, country, date):
self.name = name
self.country = country
self.date = date
class SpaceAgency:
def __init__(self, name, country, date):
self.name = name
self.country = country
self.date = date
watney = Astronaut('Watney'... |
"""
Script doing the "check IPTC Photo Metadata" jobs and providing some shared functions
"""
import os
import yaml
import json
from pmdtools.exiftool import Exiftool
currentdir = os.path.dirname(os.path.realpath(__file__))
CONFIGFP = currentdir + '/config/scriptsconfig.yml'
with open(CONFIGFP) as yaml_file1:
scr... |
# Copyright 2020, Salesforce.com, Inc.
#
# 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, distri... |
import sys
sys.dont_write_bytecode = True
def least_recently_used(page_table):
'''
This file includes implementation of the least_recently_used page replacement algorithm
Solves CS149 Homework#4
@author Tyler Jones
'''
#make a dict with keys as page name and values as page.last_accessed
la... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
from logging.handlers import RotatingFileHandler
from flask import Flask
# ------------------------------------------------------------------------------
# SETUP GENERAL APPLICATION
# -----------------------------------------------------------------------------... |
"""
Hi, This is your friend . Here i am going to make a classic game of Hangman.
Hangman --> How it works
It's still a work in progress
"""
import time
def split(word):
return [char for char in word]
def ask():
word = "test"
word_chars = split(word)
word_chars = ['t','e','s']
guess = []
turns... |
from machinable import Component
class FlattenedNotationComponent(Component):
pass
|
# Generated by Django 2.0.2 on 2018-06-06 16:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Course',
fields=[
('id', m... |
#!/usr/bin/env python
import sys
import rospy
import copy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
from math import pi
from std_msgs.msg import String
from moveit_commander.conversions import pose_to_list
#initialise moveit commander and rospy nodes
moveit_commander.roscpp_initialize(s... |
# coding: utf-8
import unittest
import tempfile
from pynames.utils import is_file
try:
from django.core.files import File
from django.core.files.base import ContentFile
from django.core.files.uploadedfile import UploadedFile
except:
UploadedFile = None
File = None
ContentFile = None
class T... |
from posixpath import join
from sys import path
import cv2
from skimage.io.collection import ImageCollection
import imlib as im
import numpy as np
import pylib as py
import tensorflow as tf
import tf2lib as tl
import glob
import data
import module
#import sys
#sys.path.append('..')
import resize_images_pascalvoc
from r... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###################################################################
# Author: Mu yanru
# Date : 2019.2
# Email : muyanru345@163.com
###################################################################
import functools
import examples._mock_data as mock
from dayu_widgets3 i... |
from __future__ import absolute_import, print_function, division
import numpy as np
try:
import scipy.sparse
imported_scipy = True
except ImportError:
imported_scipy = False
import theano
from theano import gof
from six import string_types
def _is_sparse(x):
"""
Returns
-------
boolean
... |
"""Initial Migration
Revision ID: c31efd831ee7
Revises:
Create Date: 2021-09-15 19:37:00.295751
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c31efd831ee7'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto ... |
def sort_words(input):
inp = input.split()
words = [x.lower() for x in inp]
words.sort()
for i in words:
print(i)
sort_words('PINEAPPLE Grapes oraNge APPLE meloN')
|
#!/usr/bin/env python3
import os
import re
import sys
import glob
import time
import argparse
import datetime
import subprocess
import collections
ROOT = os.path.dirname(os.path.abspath(__file__))
S3TESTS_ROOT = os.path.join(ROOT, "s3-tests")
RAN_PATTERN = re.compile(r"^Ran (\d+) tests in [\d\.]+s")
FAILED_PATTERN =... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import pprint
import shutil
import os.path
import datetime
from brainvisa.installer.package import Package
from brainvisa.installer.project import Project
from brainvisa.installer.repository import Repository
from brainvisa... |
import numpy as np
import pandas as pd
import os
from sklearn.cluster import KMeans
from sklearn.metrics.cluster import adjusted_rand_score
import argparse
parser = argparse.ArgumentParser(description='Embedding_Ground_Truth_Quality_Rank_')
parser.add_argument('--sampleName', type=str, default='151507')
arg... |
"""
Entrypoint script for the FastAPI application
"""
import os
from fastapi import FastAPI
from routers import datasets, samples
from database import engine, Base
LABLR_DIR = f"{os.environ.get('HOME')}/.lablr"
if not os.path.exists(LABLR_DIR):
os.makedirs(LABLR_DIR)
Base.metadata.create_all(bind=engine)
PREF... |
"""
Copyright (c) 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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... |
# -*- coding: utf-8 -*-
import json
import logging
from pathlib import Path
from typing import Dict
from cova.pipeline.pipeline import COVAAutoTune
logger = logging.getLogger(__name__)
logging.basicConfig(level="INFO")
def parse_config(config_file: str) -> Dict:
"""Parses config file with pipeline definition... |
"""
Tests application settings are connected to Django
settings and have sensible default values.
"""
from django.test import TestCase, override_settings
from drf_signed_auth import settings
from drf_signed_auth.compat import reload
from rest_framework import permissions
class SettingsTest(TestCase):
def setUp(se... |
from conans.test.utils.cpp_test_files import cpp_hello_source_files, cpp_hello_conan_files
from conans.test.utils.go_test_files import go_hello_source_files, go_hello_conan_files
import os
from conans.paths import PACKAGE_TGZ_NAME
import tempfile
from conans.test import CONAN_TEST_FOLDER
from conans.tools import untarg... |
# -*- coding: utf-8 -*-
import math
import collections
import bisect
import heapq
import time
import random
import itertools
"""
created by shhuan at 2017/10/20 08:46
"""
N = int(input())
A = [int(x) for x in input().split()]
ks = collections.defaultdict(int)
found = False
for i in range(N):
if found or i > ... |
numblist = [10, 29,30,41]
for index, item in enumerate(numblist):
print (index, item) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] ta... |
import os
src = 'C:/RavenFinetune/raw/medical_nlp.txt'
with open(src, 'r', encoding='utf-8') as infile:
data = infile.readlines()
print(len(data))
cnt = 0
for i in data:
cnt += 1
with open('C:/RavenFinetune/contexts/medical_%s.txt' % cnt, 'w', encoding='utf-8') as outfile:
outfile.write(i.strip(... |
"""
~/utils/update_ontario_stocking.py
Created: 23 Jan 2019 15:29:22
DESCRIPTION:
This script updates the ontario data in the lake wide cwt database.
Updates include tag type, and sequence number for sequential cwts, cwt
manufacturer (where it should have been Micro Mark (MM))
Updates are preformed on both stocking... |
import aspose.slides as slides
def charts_number_format():
#ExStart:number_format
# The path to the documents directory.
outDir = "./examples/out/"
# Instantiate the presentation# Instantiate the presentation
with slides.Presentation() as pres:
# Access the first presentation slide
... |
msg = "Hello "
subject = "Hello world" |
class phasebitsifc:
class out_callbacks:
def send_phases(self, phases_out)
def __init__(self):
self.m_callbacks = []
def register_callbacks(self, callback):
self.m_callbacks = [self.m_callbacks, callbacks]
|
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from overview_tab.map_graph import map_graph
from overview_tab.cumulative_nb_report import cumulative_graph
from overview_tab.survivors_report import first_time_assault_count, first_time_assault_percentage, a... |
# This file is automatically generated by the rmf-codegen project.
#
# The Python code generator is maintained by Lab Digital. If you want to
# contribute to this project then please do not edit this file directly
# but send a pull request to the Lab Digital fork of rmf-codegen at
# https://github.com/labd/rmf-codegen
... |
from numpy import linalg as _LA
import numpy as _np
def matrix_system(q, N, type='even', period='one'):
''' Creates tridianogal matrix system of order NxN, associated with
each of the four classes of simply-periodic functions.
Input:
q: parameter, real or purely imaginary.
N: Size of the ... |
from django.db import models
# Create your models here.
class Poetry(models.Model):
title = models.CharField(
max_length=100,
verbose_name="诗名"
)
author = models.CharField(
max_length=100
)
content = models.CharField(
max_length=255
) |
import unittest
import pprint
import datetime
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.oeid import OETestID
from oeqa.core.decorator.data import skipIfNotFeature
from oeqa.runtime.decorator.package import OEHasPackage
from oeqa.utils... |
from django.apps import AppConfig
class ApiConfig(AppConfig):
name = 'serveradmin.api'
verbose_name = "Api"
def ready(self):
import serveradmin.api.api # noqa
|
# 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... |
# coding: utf-8
"""
Python InsightVM API Client
OpenAPI spec version: 3
Contact: support@rapid7.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import swagger_client
from swagger_client.models.summary import Summary #... |
#!/usr/bin/env python
#The MIT License (MIT)
#Copyright (c) 2016 Massimiliano Patacchiola
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ... |
#!/usr/bin/env python
import logging
import sys
import time
from copy import copy
import serial
from mitsi_lookup import (
CONTROL_PACKET_POSITIONS,
CONTROL_PACKET_VALUES,
DIR,
FAN,
MODE,
POWER,
ROOM_TEMP,
TEMP,
VANE,
)
HEADER_LEN = 5
log = logging.getLogger(__name__)
class He... |
#!/usr/bin/python3
import os
import json
import ipaddress
from elasticsearch import Elasticsearch,RequestsHttpConnection
## ENV VARS
elasticsearch_user = os.getenv("ELASTIC_USER", "elastic")
elasticsearch_pass = os.getenv("ELASTIC_PASS")
elasticsearch_host = os.getenv("ELASTIC_HOST")
elasticsearch_proto = os.getenv("... |
import boto3
import os
import json
client = boto3.client('stepfunctions')
def lambda_handler(event, context):
try:
s3_object = event["Records"][0]["s3"]
key = s3_object["object"]["key"]
bucket_name = s3_object["bucket"]["name"]
print(key)
print(os.environ['TRANSCRIBE_STATE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.