content stringlengths 5 1.05M |
|---|
import pytest
from channels.generic.websocket import (
AsyncJsonWebsocketConsumer, AsyncWebsocketConsumer, JsonWebsocketConsumer, WebsocketConsumer,
)
from channels.testing import WebsocketCommunicator
# @pytest.mark.asyncio
# async def test_websocket_consumer():
# """
# Tests that WebsocketConsumer is i... |
from PySide6.QtCore import QAbstractTableModel, Qt
class PandasModel(QAbstractTableModel):
def __init__(self, data):
super().__init__()
self._data = data
def rowCount(self, index):
return self._data.shape[0]
def columnCount(self, parnet=None):
return self._data.shape[1]
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use o... |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import re
import logging
from rapidsms.apps.base import AppBase
from .models import Location
logger = logging.getLogger(__name__)
class App(AppBase):
PATTERN = re.compile(r"^(.+)\b(?:at)\b(.+?)$")
def __find_location(self, text):
try:
... |
class Weapon:
def __init__(self, name, damage, range):
self.name = name
self.damage = damage
self.range = range
def hit(self, actor, target):
if target.is_alive():
if (self.range >= (target.pos_x - actor.pos_x) +
(target.pos_y - actor.pos_y)):
... |
# flake8: noqa
#
# Root of the SAM package where we expose public classes & methods for other consumers of this SAM Translator to use.
# This is essentially our Public API
#
|
class Solution:
def trap(self, height: List[int]) -> int:
n = len(height)
if n<=2:return 0
stack = []
ans = 0
for i,num in enumerate(height):
while stack and height[stack[-1]]<num:
cur = stack.pop()
if stack:
ans... |
import random
def int_to_list(n):
n=str(n)
l=list(n)
return l
class CowsAndBulls:
def __init__(self):
self.number = ""
self.digits = 0
self.active = False
def makeRandom(self, digit):
digits = set(range(10))
first = random.randint(1, 9)
second_to_las... |
"""
Build a parse tree to evaluate a fully parenthesised mathematical expression, ((7+3)∗(5−2)) = ?
*
/ \
+ -
/ \ / \
... |
#! /usr/bin/env python
import re
import csv
import click
import numpy as np
from scipy.stats import spearmanr
from hivdbql import app
from hivdbql.utils import dbutils
from hivdbql.models.isolate import CRITERIA_SHORTCUTS
np.seterr(divide='raise', invalid='raise')
db = app.db
models = app.models
GENE2DRUGCLASS = {... |
""" Manages drawing of the game """
from typing import List, Tuple, Any
import colorsys
import random
import pygame
import settings
from game_state import GameState, Snake, Pizza
Color = Tuple[int, int, int]
class Colors:
""" Basic colors """
CLEAR_COLOR = (240, 240, 240)
BLACK = (0, 0, 0)
DARK_YELLO... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from re import findall
from string import printable
from struct import unpack
from src.capturePkt.networkProtocol import NetworkProtocol
class Telnet(NetworkProtocol):
IAC = 0xff
codeDict = {236: 'EOF',
237: 'SUSP',
238: 'ABORT',... |
#-*- coding: utf-8 -*-
'''
Created on 2017. 11. 06
Updated on 2017. 11. 06
'''
from __future__ import print_function
import os
import cgi
import re
import time
import codecs
import sys
import subprocess
import math
import dateutil.parser
from datetime import datetime
from commons import Subjects
from x... |
#!/usr/bin/env python3
#
# Copyright (c) 2018 Sébastien RAMAGE
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
import logging
import argparse
import time
from zigate import connect
logging.basicConfig(level=logging.INFO)
parser = argparse... |
import os
import sys
import argparse
from cuttsum.event import read_events_xml
from cuttsum.nuggets import read_nuggets_tsv
from cuttsum.util import gen_dates
import streamcorpus as sc
import numpy as np
from sklearn.feature_extraction import DictVectorizer
import codecs
def main():
event_file, rc_dir, event_title... |
# coding: utf-8
# 2020/1/3 @ tongshiwei
__all__ = ["get_net", "get_bp_loss"]
from mxnet import gluon
from .WCLSTM import WCLSTM
from .WCRLSTM import WCRLSTM
from .WRCLSTM import WRCLSTM
def get_net(model_type, class_num, embedding_dim, net_type="lstm", **kwargs):
if model_type == "wclstm":
return WCLST... |
"""LiteDRAM BankMachine (Rows/Columns management)."""
import math
from migen import *
from litex.soc.interconnect import stream
from litedram.common import *
from litedram.core.multiplexer import *
class _AddressSlicer:
def __init__(self, colbits, address_align):
self.colbits = colbits
self.ad... |
from django.contrib import admin
from mptt.admin import MPTTModelAdmin
from .models import Business, Category, Request
@admin.register(Business)
class BusinessAdmin(admin.ModelAdmin):
list_display = ('name', 'location', 'main_category')
ordering = ('name',)
filter_horizontal = ('other_categories', 'deliv... |
import uuid
from cinderclient import exceptions as cinder_exceptions
from ddt import ddt, data
from django.conf import settings
from django.test import override_settings
from novaclient import exceptions as nova_exceptions
from rest_framework import status, test
import mock
from six.moves import urllib
from waldur_op... |
##########################################################################
#
# Copyright (c) 2008-2010, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... |
# -*- coding: utf-8 -*-
import codecs
import numpy as np
import tensorflow as tf
from Transformer.config.hyperparams import Hyperparams as pm
class Data_helper(object):
def __init__(self):
self.pointer = 0
def mini_batch(self):
X, Y = self.load_train_datasets()
num_batch ... |
import os
import glob
def delete_given_file(image_name):
file_name = image_name.split(".")[0]
IMG_PATH = "./annotated_dataset/img"
TXT_PATH = "./annotated_dataset/txt_label"
XML_PATH = "./annotated_dataset/xml_label"
img_file = f"{IMG_PATH}/{file_name}.jpg"
txt_file = f"{TXT_PATH}/{file_name... |
#!/usr/bin/env python
# Copyright (c) 2020 - for information on the respective copyright owner
# see the NOTICE file and/or the repository
# <https://github.com/boschresearch/amira-blender-rendering>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance w... |
"""
Transitions (Perturbation Kernels)
==================================
Perturbation strategies. The classes defined here transition the current
population to the next one. pyABC implements global and local transitions.
Proposals for the subsequent generation are generated from the current
generation density estimat... |
from test.ga.ga import GaTestCase
from test.ga.population import PopulationTestCase
from test.ga.individual import IndividualTestCase
__all__ = (
"GaTestCase", "PopulationTestCase",
"IndividualTestCase"
)
|
def get_key():
if isinstance(self.instance,
def clean():
pass
|
from screen.drawing.color import *
from screen.drawing.color import __all__ as _color__all__
from screen.drawing.colorinterpolationmethod import *
from screen.drawing.colorinterpolationmethod import __all__ as _colorinterpolationmethod__all__
from screen.drawing.style import *
from screen.drawing.style import __all__ a... |
from types import FunctionType
import backends
__storage = backends.default()
def set_storage(BackendInstance):
global __storage
__storage = BackendInstance
def make_cached(make_key, f):
def cached(*args, **kwargs):
cache_key = make_key(args=args, kwargs=kwargs)
if __storage... |
"""
Created on Wed Jan 15 11:17:10 2020
@author: mesch
"""
from colorama import init, Fore, Back
init(autoreset=True) #to convert termcolor to wins color
import copy
from pyqum.instrument.benchtop import RSA5 as MXA
from pyqum.instrument.benchtop import PSGA
from pyqum.instrument.modular import AWG
from pyqum.instrum... |
from datetime import datetime
import hashlib
from werkzeug.security import generate_password_hash, check_password_hash
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from markdown import markdown
import bleach
from flask import current_app, request, url_for
from flask_login import UserMixin, Ano... |
from typing import Any, Dict, Iterable, List
import pandas as pd
from fugue.dataframe import ArrayDataFrame
from fugue.exceptions import FugueInterfacelessError
from fugue.extensions.transformer import (
Transformer,
_to_transformer,
transformer,
register_transformer,
)
from pytest import raises
from t... |
from header_common import *
from header_dialogs import *
from header_operations import *
from module_constants import *
####################################################################################################################
# During a dialog, the dialog lines are scanned from top to bottom.
# If the dialo... |
#!/usr/bin/python
import sys
import h5py
if __name__ == "__main__":
files = sys.argv[1:]
files.extend(sys.stdin.readlines())
for file in files:
file = file.strip()
with h5py.File(file, 'r') as f:
f['/entry1/instrument/parameters/y_pixels_per_mm'][0] = 0.321
|
"""
Tests CoreML Scaler converter.
"""
import unittest
import numpy
import coremltools
from sklearn.preprocessing import StandardScaler
from onnxmltools.convert.coreml.convert import convert
from onnxmltools.utils import dump_data_and_model
class TestCoreMLScalerConverter(unittest.TestCase):
def test_scaler(self... |
total_bill = 124.56
procent_10 = 0.10
procent_12 = 0.12
procent_15 = 0.15
split_people = 7
tip = total_bill * procent_12 + total_bill
print(tip)
print(tip)
total = tip / float(split_people)
print(round(total, 2))
|
from guardian.core import ObjectPermissionChecker
class ObjectPermissionCheckerViewSetMixin:
"""add a ObjectPermissionChecker based on the accessing user to the serializer context."""
def get_serializer_context(self):
context = super().get_serializer_context()
if self.request:
per... |
# --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2016
# --------------------------------------------------------------------------
"""
This is a problem ... |
import os
from minicps.devices import PLC
from temperature_simulator import TemperatureSimulator
from Logger import hlog
import time
class EnipPLC1(PLC): #builds upon the tags of the swat example
# These constants are used mostly during setting up of topology
NAME = 'plc1'
IP = ' 10.0.2.110'
MAC = '... |
from setuptools import setup, find_packages
setup(name='donkeypart_keras_behavior_cloning',
version='0.1.3',
description='Library to control steering and throttle actuators.',
long_description="no long description given",
long_description_content_type="text/markdown",
url='https://github.... |
from trading_bot import app, create_app
def init_app():
# TODO add test config class
create_app()
def reset_managers():
create_app()
app.symbol_manager._symbols = []
app.exchange_manager._exchanges = []
app.exchange_manager._exchanges_by_name = {}
app.indicator_manager._indicators = []
... |
import cv2
import numpy as np
import math
import time
import testAAE
import testAAEWithClassifier
import region
def quantizeAngle(angle):
if angle >= 0:
if angle >= 90:
if angle >= 45:
quantized = 2
else:
quantized = 1
elif angle >= 135:
... |
def read_input():
# for puzzles where each input line is an object
with open('input.txt') as fh:
for line in fh.readlines():
if line.strip():
yield line.strip()
def read_input_objs():
# for puzzles with newline-separated objects as input
with open('input.txt') as fh... |
import PySimpleGUI as sg
use_custom_titlebar = False
def make_window(theme=None):
NAME_SIZE = 23
def name(name):
dots = NAME_SIZE - len(name) - 2
return sg.Text(
name + ' ' + '•' * dots,
size=(NAME_SIZE, 1),
justification='r',
pad=(0, 0),
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for :mod:`orion.algo.tpe`."""
import numpy
import pytest
from scipy.stats import norm
from orion.algo.space import Categorical, Fidelity, Integer, Real, Space
from orion.algo.tpe import (
TPE,
CategoricalSampler,
GMMSampler,
adaptive_parzen_estima... |
import pygame
import random
screen_size = [360, 600]
screen = pygame.display.set_mode(screen_size)
pygame.font.init()
background = pygame.image.load('background.png')
user = pygame.image.load('user.png')
chicken = pygame.image.load('chicken.png')
def display_score(score):
font = pygame.font.SysFont('Comic Sans ... |
from flask import request, jsonify, Blueprint
from flask_jwt_extended import (
create_access_token,
create_refresh_token,
jwt_refresh_token_required,
get_jwt_identity
)
from flasgger import swag_from
from myapi.models import User
from myapi.extensions import pwd_context, jwt
from myapi.api.doc.login_do... |
import psycopg2
import os
from dotenv import load_dotenv
import sqlite3
import pandas as pd
import datetime
from psycopg2.extras import execute_values
load_dotenv()
# connecting to our elephant sql rpg database
RPG_DB_NAME = os.getenv('RPG_DB_NAME', default='oops')
RPG_DB_USER = os.getenv('RPG_DB_USER', default='oop... |
import time
def time_training(fitter):
"""Print the time taken for a machine learning algorithm to train.
Parameters:
fitter(function): function used to train the model
Returns: None
"""
start = time.time()
fitter()
end = time.time()
diff = end - start
print(f'Traini... |
################################################################################
# Module: decision.py
# Description: Agent decision function templates
# Rafal Kucharski @ TU Delft, The Netherlands
################################################################################
from math import exp
import random
import... |
import boto3
from aws_cdk import (
core as cdk,
aws_events as events,
aws_events_targets as events_targets,
aws_glue as glue,
aws_iam as iam,
aws_lambda as lmb,
aws_lambda_python as lambda_python,
aws_logs as logs,
aws_s3 as s3,
aws_s3_notifications as s3_notifications,
aws_k... |
import matplotlib.pyplot as plt
from typing import List, Tuple, Union
from mathplotlib.base import BaseElement, Curve2D
from mathplotlib.style import Style
from mathplotlib.utils import update_with_default
class Text(BaseElement):
"""
Draws a bit of text
"""
on_curve_params = dict(
horiz... |
import argparse
import math
import PIL.Image
import PIL.ImageDraw
import sys
def choose_guideline_style(guideline_mod):
if guideline_mod % 16 == 0:
return ('#1f32ff', 3)
if guideline_mod % 8 == 0:
return ('#80f783', 2)
if guideline_mod % 4 == 0:
return ('#f4bffb', 1)
def in_ellipso... |
class GQL:
# Client -> Server message types.
CONNECTION_INIT = "connection_init"
START = "start"
STOP = "stop"
CONNECTION_TERMINATE = "connection_terminate"
# Server -> Client message types.
CONNECTION_ERROR = "connection_error"
CONNECTION_ACK = "connection_ack"
DATA = "data"
ER... |
# -*- coding:utf-8 -*-
import time
from tqdm import tqdm
import requests
from lxml import etree
headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding': 'gb2312,utf-8',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/201001... |
# coding: utf-8
"""
Eclipse Kapua REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
... |
import datetime
import sys
import pathlib
current_dir = pathlib.Path(__file__).resolve().parent
sys.path.append( str(current_dir) + '/../' )
from lib.config import get_camera_config
from service.camera import take_pictures
"""
cronによって毎分実行される
その分にタイマーが設定されているカメラの撮影リクエストを送信する
python3 cameras.py
"""
def main():
n... |
"""Dataset specification for hit graphs using pytorch_geometric formulation"""
# System imports
import os
# External imports
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset, random_split
import torch_geometric
def load_graph(filename):
with np.load(filename) as f:
... |
"""
author: Rene Pickhardt (rene.m.pickhardt@ntnu.no)
Date: 15.1.2020
License: MIT
Checks which nodes are currently online by establishing a connection to those nodes. Results can later be studied with `lightning-cli listpeers` or when `jq` is installed with `lcli getinfo | jq ".num_peers"`
This tool is intended to b... |
"""Helper methods."""
from typing import Tuple, Optional
from rest_framework import status
from rest_framework.response import Response
def validate_request_body(
request,
) -> Tuple[Optional[Response], Optional[dict]]:
"""
Validate the json body of a request.
:param request: django request
:ret... |
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 3 20:07:19 2020
https://zhuanlan.zhihu.com/p/78452993
@author: lenovo
"""
import torch
from torch.nn import Sequential as Seq, Linear as Lin, ReLU
from torch_geometric.nn import MessagePassing
from torch_geometric.datasets import TUDataset
# dataset = TUDataset(roo... |
class Web3ClientException(BaseException):
pass
class MissingParameter(Web3ClientException):
pass
class TransactionTooExpensive(Web3ClientException):
pass
class NetworkNotFound(Web3ClientException):
pass
|
import gdo
def f():
import time
time.sleep(10)
gdo.concurrent(
gdo.RunGraph(
"slee", "sleep 2",
"slle2", "sleep 5",
"pysleep", f,
"true", "true")
.req("slee", "true")
) |
#!/usr/bin/python
#PIN 0-8 3v3 pull-up default, 9-27 pull-down default
# Pin # for relay connected to heating element (Note: GPIO pin#)
he_pin = 26
brew_pin = 22
steam_pin = 27
led_pin = 13
# Default goal temperature
set_temp = 96.
set_steam_temp = 145.
#Use Fahrenheit?
use_fahrenheit = False
# Default alarm time... |
# -*- coding: utf-8 -*-
import os
from codecs import open
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
# load the package's __version__.py module as a dictionary
about = {}
with open(os.path.join(here, "profiler", "__version__.py"), "r", "utf-8") as f:
exec(f.read(), about)
tr... |
"""recode entities
Revision ID: 4212acfa7aec
Revises: 235fd19bb942
Create Date: 2016-12-01 10:24:07.638773
"""
import logging
# from pprint import pprint
from alembic import op
import sqlalchemy as sa
import uuid
log = logging.getLogger('migrate')
revision = '4212acfa7aec'
down_revision = '235fd19bb942'
SCHEMA = ... |
import os
# Reserves disk space by saving binary zeros to a file a given size
class DiskSpaceReserver:
def __init__(self, path: str, size: int):
self.path = path
self.size = size
def reserve(self):
with open(self.path, 'wb') as f:
f.write(b'\0' * self.size)
def releas... |
import uuid
from core import db, logging, plugin, model
from core.models import conduct, trigger, webui
from plugins.occurrence.models import action
class _occurrence(plugin._plugin):
version = 5.0
def install(self):
# Register models
model.registerModel("occurrence","_occurrence","_action",... |
#!/usr/bin/env python
import imp
import io
import os
from setuptools import setup, find_packages
def read(*filenames, **kwargs):
encoding = kwargs.get("encoding", "utf-8")
sep = kwargs.get("sep", "\n")
buf = []
for filename in filenames:
with io.open(filename, encoding=encoding) as f:
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, nishta and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, validate_email_add, today
from frappe.model.document import Document
from planning.planning.myfunction import ma... |
import logging
from impala.dbapi import connect
from .settings import ImpalaConstants, NEED_CERTIFICATE
from .error import ImpalaConnectError, ImpalaQueryError
class ImpalaWrapper:
def __init__(self, host=ImpalaConstants.HOST, port=ImpalaConstants.PORT,
user=ImpalaConstants.USER, database=None, ... |
from quixstreaming import QuixStreamingClient
from flask import Flask, request
from datetime import datetime
from waitress import serve
import os
import json
import hmac
import hashlib
# Quix injects credentials automatically to the client.
# Alternatively, you can always pass an SDK token manually as an argument.
cl... |
import re
import json
from ..extractor.common import InfoExtractor
from ..utils import (
js_to_json
)
class sexixnetIE(InfoExtractor):
#http://www.txxx.com/videos/2631606/stepmom-seduces-teen-babe/
_VALID_URL = r'https?://(?:www\.)?sexix\.net'
def _real_extract(self, url):
webpage = self._... |
"""
https://www.hackerrank.com/challenges/no-idea
There is an array of integers. There are also disjoint sets, and , each containing integers. You like all the integers in set and dislike all the integers in set . Your initial happiness is . For each integer in the array, if , you add to your happiness. If , yo... |
from entities import FeedEntity as FE
FEEDS = (
FE('rss', 'The Verge', 'https://www.theverge.com/rss/index.xml'),
FE('rss', 'VB', 'https://feeds.feedburner.com/venturebeat/SZYF'),
# FE('rss', 'TNW', 'https://thenextweb.com/feed/'),
FE('rss', 'ARS Technica', 'http://feeds.arstechnica.com/arstechnica/in... |
class RoomAlreadyEmpty(Exception):
pass
class CannotAllocateRoom(Exception):
pass
|
a,b = [int(x) for x in input().split(' ')]
print(str(a+b))
|
# Source: https://stackoverflow.com/questions/9282967/how-to-open-a-file-using-the-open-with-statement
def filter(txt, oldfile, newfile):
'''\
Read a list of names from a file line by line into an output file.
If a line begins with a particular name, insert a string of text
after the name before append... |
"""
SLM test for the cortex-to-hippocampus connectivity for individual subfields
usage: $ python s16_cortex_testSLM.py LSUB
"""
import os, sys
import h5py
import numpy as np
from numpy import genfromtxt
# definde data directories
ddir = '../data/' # data dir
cordir = ... |
import csbuilder
from csbuilder.standard import Protocols, Roles, States
@csbuilder.protocols
class SFTProtocols(Protocols):
SFT = 8888
@csbuilder.roles(protocol=SFTProtocols.SFT)
class SFTRoles(Roles):
SENDER = 0
RECEIVER = 1
@csbuilder.states(SFTProtocols.SFT,SFTRoles.SENDER)
class SFTSenderStates(S... |
from django.core.management.base import BaseCommand
from django.db.models import Count
from project.pastebin.models import Country
class Command(BaseCommand):
help = 'countries statistics'
def handle(self, *args, **kwargs):
countries = Country.objects.annotate(
pastes_count=Count('users__... |
"""Hass cmd."""
def breaking_change(number, cli=False):
"""Create breaking_change list for HA."""
import json
import requests
import os
from github import Github
comp_base = "https://www.home-assistant.io/components/"
pull_base = "https://github.com/home-assistant/home-assistant/pull/"
... |
import logging
import boto3
import os
import pandas as pd
import argparse
from datetime import datetime
from dataactcore.models.domainModels import DUNS
from dataactcore.utils.parentDuns import sam_config_is_valid
from dataactcore.utils.duns import load_duns_by_row
from dataactvalidator.scripts.loader_utils import cle... |
from datetime import datetime, timedelta
from cymepy.common import DATE_FORMAT
import math
import os
class Solver:
def __init__(self, cymepy, settings, logger):
self.Settings = settings
self._Logger = logger
self.cymepy = cymepy
self._mStepRes = settings['project']['time_step_min'... |
from flask import Flask, render_template, request
from github_api import GithubUser
from pprint import pprint
app = Flask('git connect')
MATCHED_PROFILES = {}
userororg = 'user'
ghuser = None
@app.route('/')
def hello():
return render_template('app/index.html', err='')
@app.route('/login', methods=['GET', 'PO... |
import urllib2
import logging
from random import choice, randint
from os.path import exists
from time import sleep
from os import getenv
logging.basicConfig(
format='[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s',
datefmt="%d/%b/%Y %H:%M:%S",
level=getenv('LOG_LEVEL', logging.DEBUG)
)
logg... |
"""
polarAWB.py
Copyright (c) 2022 Sony Group Corporation
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
"""
import json
from pathlib import Path
import shutil
import numpy as np
from myutils.imageutils import MAX_16BIT, my_read_image, my_write_image
from myutils.data... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import OrderedDict, defaultdict
from traceback import print_exc
import wx
from wx import EVT_MENU
from .Controls import CheckBox, RadioButton, Row, StaticText
class FormDialog(wx.Dialog):
def __init__(
self,
parent,
... |
'''
Integration Test for creating KVM VM with all nodes shutdown and recovered.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_... |
notebook_list = list()
first_entry=int(input("Enter your first value in the list: "))
second_entry=int(input("Enter your second value in the list: "))
notebook_list.append(first_entry)
notebook_list.append(second_entry)
# for i in range(5):
# val=(int(input("enter a value ")))
# arr.append(val)
# print (ar... |
#!/usr/bin/python
#partially based on: http://john.nachtimwald.com/2009/08/15/qtextedit-with-line-numbers/ (MIT license)
from __future__ import print_function
import sys, os, subprocess
from ..share import (Share, Signal, dbg_print, QtCore, QtGui, QtSvg, temp_dir)
##LMY: from highlighter import PythonHighlighter
clas... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import yaml
import json
import requests
from copy import deepcopy
from lxml import html
from dateutil.parser import ParserError, parse
# loading external configuration
CONFIG = yaml.safe_load(open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'conf... |
#!/usr/bin/env python3
from putarm_ur3e_moveit_config.srv import GoToObj,GoToObjResponse
import sys
import copy
import rospy
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
import tf
import... |
from os import environ
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse, parse_qs
import os
import json
from flask import Flask, jsonify, request
import requests
from flask_cors import CORS
def fetch_location():
"""
gets the geocode data for the searched location, ... |
def emulate_catchup(replica, ppSeqNo=100):
replica.on_catch_up_finished(last_caught_up_3PC=(replica.viewNo, ppSeqNo),
master_last_ordered_3PC=replica.last_ordered_3pc)
def emulate_select_primaries(replica):
replica.primaryName = 'SomeAnotherNode'
replica._setup_for_non_mas... |
""" A tomography library for fusion devices
See:
https://github.com/ToFuProject/datastock
"""
# Built-in
import os
import subprocess
from codecs import open
# ... setup tools
from setuptools import setup, find_packages
# ... local script
import _updateversion as up
# == Getting version ===========================... |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 24 20:47:24 2019
@author: elif.ayvali
"""
import pandas as pd
import numpy as np
import matplotlib.collections as mc
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from matplotlib.patches import Rectangle
def create_uniform_grid(low, high, bins=(1... |
import sys
from je_web_runner import get_desired_capabilities
from je_web_runner import get_desired_capabilities_keys
from je_web_runner import get_webdriver_manager
try:
print(get_desired_capabilities_keys())
for keys in get_desired_capabilities_keys():
print(get_desired_capabilities(keys))
dr... |
# Generated by Django 3.1.8 on 2021-04-07 15:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('unievents', '0014_auto_20210407_1416'),
]
operations = [
migrations.RemoveField(
model_name='event_tag',
name='event... |
from . import db
from flask import current_app
from flask_login import UserMixin, AnonymousUserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from datetime import datetime
import hashlib, os
import markdown
class User(UserMixin, db.Model):
__tablename__ = 'user'
id = db.Column... |
import colander
from cryptography.fernet import Fernet
class EncryptedExportField(colander.String):
"""
Serialize non-encrypted appstruct into encrypted cstruct.
"""
def __init__(self, fernet_key, *args, **kwargs):
self.fernet_key = fernet_key
self.fernet = Fernet(fernet_key)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.