content stringlengths 5 1.05M |
|---|
import time
import numpy as np
import matplotlib
import torch as t
import visdom
matplotlib.use('Agg')
from matplotlib import pyplot as plot
VOC_BBOX_LABEL_NAMES = (
'fly',
'bike',
'bird',
'boat',
'pin',
'bus',
'c',
'cat',
'chair',
'cow',
'table',
'dog',
'horse',
... |
from datetime import date
import numpy as np
import pytest
from pandas import (
Categorical,
CategoricalDtype,
CategoricalIndex,
Index,
IntervalIndex,
)
import pandas._testing as tm
class TestAstype:
def test_astype(self):
ci = CategoricalIndex(list("aabbca"), catego... |
import os, sys
# os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
import tensorflow as tf
tf.compat.v1.enable_eager_execution()
sys.path.append(r'/home/luca/Desktop/NERFPosit/Inference')
import numpy as np
import imageio
import json
import random
import time
import pprint
from... |
from App import login_manager
from flask_login import UserMixin
@login_manager.user_loader
def load_user(user_id):
return User(user_id)
class User(UserMixin):
def __init__(self, id):
self.id = id
|
import rospy
from yaw_controller import YawController
from pid import PID
from lowpass import LowPassFilter
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, vehicle_mass, fuel_capacity, brake_deadband, decel_limit, \
accel_limit, wheel_radius, wheel_base, steer_ratio, m... |
from watchdog.observer import observer
from watchdog.events import FileSystemEventHandler
# pip install watchdog for these packages
import os
import json
import time
class MyHandler(FileSystemEventHandler):
def on_modified(self, event):
for filename in os.listdir(folder_to_track):
src = folder_to_track + "/" + ... |
"""Forms for Assets and related entities."""
from django import forms
from django.forms import Textarea, TextInput, Select, Form
from editorial.models import (
ImageAsset,
DocumentAsset,
AudioAsset,
VideoAsset,
SimpleImage,
SimpleDocument,
SimpleAudio,
SimpleVideo,
)
... |
# Generated from SMTLIBv2.g4 by ANTLR 4.9.2
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7... |
# random story generator
import random
when = [ 'A long time ago', 'Yesterday', 'Before you were born', 'In the future', 'Before Thanos arrived']
who = ['Shazam', 'Iron Man', 'Batman', 'Superman', 'Captain America']
where = ['Arkham Asylum', 'Gotham City', 'Stark Tower', 'Bat Cave', 'Avengers HQ']
why = ['to eat a l... |
from django.contrib import messages
from django.contrib.auth import update_session_auth_hash
from django.contrib.auth.forms import PasswordChangeForm
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from booking_portal.models import Announcement
@login_required
... |
"""
The file config.py contains all major configuration parameters for running the
DPCTGAN model.
"""
import os
from pm4py.objects.log.importer.xes import importer as xes_importer
from pm4py.objects.conversion.log import converter as log_converter
import logger
# Parameters for the checkpoints. These settings cont... |
from .quantum_art import QuantumArt
|
import serial
ser = serial.Serial('/dev/tty.usbmodem7071', 115200, timeout=1)
ser.write("\xb1\x81\x01A") #set key-press 1st button = 'A' 177,129,1,'A'
ser.write("\xb1\x81\x02a") #set key-press 2nd button = 'a' 177,129,1,'a'
ser.write("\xb1\x82\x011") #set key-release 1st button ='1' 177,130,1,'a'
ser.write("\xb1\x82\x0... |
from .bearer import TaccApisBearer
__all__ = ['TaccApisBearerRefresh']
class TaccApisBearerRefresh(TaccApisBearer):
"""Base class for Tapis API commands both an access token and a refresh token
"""
def add_common_parser_arguments(self, parser):
parser = super(TaccApisBearer,
... |
import sys
import os
from PyQt5 import QtWidgets
from printwindow import Ui_Dialog as w_rin
from mainwindow import Ui_Dialog as w_main
from extendwindow import Ui_Dialog as w_ext
gui_textlist = [
["프로그램 재시작 필요", "-", "-", "-", "-"],
["메인 화면", "음성인식 프린트\n시작", "녹음된 음성파일을 이용하여\n프린트", "문서 파일을 이용하여\n프린트", ... |
import os
import time
from typing import Dict
import configargparse
import logging
from pathlib import Path
from concurrent.futures import ThreadPoolExecutor, as_completed
from datetime import datetime
from collection_helper import (get_inventory, write_output_to_file, custom_logger, RetryingNetConnect,
... |
from python_framework import FrameworkModel
MESSAGE = 'Message'
SESSION = 'Session'
CONTACT = 'Contact'
MODEL = FrameworkModel.getModel()
|
from .main import aggregate_s3_logs_main
aggregate_s3_logs_main()
|
from datetime import datetime
import time
import json
def log(message, when=None):
""" Log a message with a timestamp.
Args:
message: Message to be printed.
when: datetime of when the message occured.
Defaults to present time
"""
when = datetime.now() if when is None else w... |
# -*- coding: utf-8 -*-
from openprocurement.tender.core.utils import (
optendersresource, apply_patch
)
from openprocurement.api.utils import (
context_unpack, get_now, json_view
)
from openprocurement.tender.openeu.views.bid import (
TenderBidResource as BaseResourceEU
)
from openprocurement.tender.compet... |
#!/usr/bin/env python
#
# Simple script showing how to read a mitmproxy dump file
#
### UPD: this feature is now avaiable in mitmproxy: https://github.com/mitmproxy/mitmproxy/pull/619
from libmproxy import flow
import json, sys
with open("mitmproxy_dump.txt", "rb") as logfile:
freader = flow.FlowReader(logfile)
... |
from styx_msgs.msg import TrafficLight
import tensorflow as tf
import numpy as np
import cv2
import os
FASTER_RCNN_INCEPTION_V2_MODEL = 'light_classification/model_site_04/faster_rcnn_inception_v2_traffic_lights_test_site.pb'
class TLClassifier(object):
def __init__(self):
self.model_file = FASTER_RCNN_IN... |
import collections
import sys
import json
from tqdm import tqdm
import numpy as np
import utils.load_info_for_model
def recommendations_to_hits(recommended, correct, track_to_album, album_to_artist):
track_size = track_to_album.size
artist_size = np.max(album_to_artist) + 1
artist_recommended = album_to_... |
import pytest
def test_get_costumes_nonexistent(parser):
result = parser.get_costumes(dict())
assert result == False
def test_get_costumes_empty(parser, empty_sb3):
result = parser.get_costumes(empty_sb3)
assert type(result) == list
assert len(result) == 1
def test_get_costumes_full(parser, full_... |
import click
from .main import main
@click.command()
@click.option('--n-reps', '-r', nargs=1, default=10, type=int,
help='Number of repetitions per benchmark')
@click.option('--n-users', '-n', multiple=True, default='1k',
help='Number of users, e.g. 1K')
@click.option('--logging', '-l', m... |
import numpy as np
from sklearn.metrics import confusion_matrix, roc_curve, auc
import plotly.graph_objs as go
import plotly.figure_factory as ff
from plotly.offline import iplot
from palantiri.BasePlotHandlers import PlotHandler
class ClassifierPlotHandler(PlotHandler):
""" Handles all the plots related of t... |
import json
import logging
import logging.handlers
import os
from contextlib import redirect_stdout
from http import HTTPStatus
from io import StringIO
from pathlib import Path
from typing import List
from victoria import config
from victoria.script import victoria
PROJECT_PATH = Path(os.path.abspath(os.path.dirname(... |
"""Main library."""
from typing import Optional
# Import module
import jpype
# Enable Java imports
import jpype.imports
# Pull in types
from jpype.types import *
import importlib
class JavaLib:
ROBOT_LIBRARY_SCOPE = "GLOBAL"
"""General library documentation."""
def __init__(
self,
lib... |
#!/usr/bin/env python3
# -*- coding utf-8 -*-
__Author__ ='eamon'
'Modules Built-In'
from datetime import datetime
now = datetime.now()
print(now)
print(type(now))
dt=datetime(2015,10,5,20,1,20)
print(dt)
print(dt.timestamp())
t=1444046480.0
print(datetime.fromtimestamp(t))
print(datetime.utcfromtimestamp(t)... |
from .cli import integrate_alembic_cli
from .config import alembic_config_from_solo
__all__ = ['alembic_config_from_solo', 'integrate_alembic_cli']
|
"""pytims - algorithmic libs"""
__version__ = "0.1.0"
__author__ = "Natu Lauchande <nlauchande at google mail>"
__all__ = []
|
from time import sleep
from config.locators import Locators
from infra.web_driver_extensions import WebDriverExtensions
from selenium.webdriver.common.by import By
class NewProjectPage:
"""
This class represents the New Project page object model
Attributes:
driver (WebDriver): WebDriver instance
... |
import seagrass
import sys
import unittest
import warnings
from collections import Counter, defaultdict
from seagrass import auto, get_current_event
from seagrass.hooks import CounterHook
from test.utils import SeagrassTestCaseMixin, req_python_version
with seagrass.create_global_auditor() as _:
class ExampleClas... |
import hubspot.cms.audit_logs as api_client
from ...discovery_base import DiscoveryBase
class Discovery(DiscoveryBase):
@property
def audit_logs_api(self) -> api_client.AuditLogsApi:
return self._configure_api_client(api_client, "AuditLogsApi")
|
"""
Tests for api ride endpoint
"""
import json
def test_get_request(test_client):
"""
Test that get request works correctly
"""
response = test_client.get('/api/v1/rides')
result = json.loads(response.data)
assert result['rides'][0]['origin'] == 'Mombasa'
assert result['rides'][0]['destina... |
from easytello import tello
import threading
import time
import socket
from tkinter import *
import tkinter as tk
from PIL import Image,ImageTk
import tkinter.messagebox
import cv2
import PIL.Image
from gaze_tracking import GazeTracking
root = tk.Tk()
root.title('湧泉相報系統')
root.geometry('1024x600')
root.configure(... |
from hover.core.representation.manifold import LayerwiseManifold
import numpy as np
def test_LayerwiseManifold(distance_preserving_array_sequence):
LM = LayerwiseManifold(distance_preserving_array_sequence)
LM.unfold(method="umap")
_, disparities = LM.procrustes()
assert (np.array(disparities) < 1e-16... |
"""Top-level package for Keats Crawler."""
__author__ = 'Arman Mann'
__email__ = 'arman.mann@kcl.ac.uk'
__version__ = '0.1.0'
|
import os
#Convertendo a lista de str em lista de números
def ConvertStrTOData(TXTData, delimiter=False):
DataMod=[] # Achando os delimitadores
if delimiter == False:
for line in list(TXTData):
DataMod.append(float(line[0:-1]))
return(DataMod)
else:
fo... |
from typing import List, Iterable
from math import ceil, floor, log
from src.util import range_incl
AgentId = int
Time = int
# TODO for (a), find max NF cost, for (b), find min NF cost
def generate_all_path_lenghts(sum_of_costs: int,
agents: int,
smaller... |
"""
This module defines the constant presence test generator.
Tests whether a specific constant exists. No execution is required only building success or fail.
"""
import logging
from typing import Set
from lemonspotter.core.database import Database
from lemonspotter.core.test import Test, TestType, TestOutcome
from... |
# terrascript/data/hashicorp/azuread.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:12:52 UTC)
import terrascript
class azuread_application(terrascript.Data):
pass
class azuread_application_published_app_ids(terrascript.Data):
pass
class azuread_application_template(terrascript.Data):
... |
from fastapi import FastAPI
from msdss_base_api import API
from msdss_base_database import Database
from .routers import *
from .handlers import *
class DataAPI(API):
"""
Class for creating Data APIs.
Parameters
----------
users_api : :class:`msdss_users_api:msdss_users_api.core.UsersAPI` or ... |
from control4.nn.rnn import RNN
from control4.nn.nn import DenseLayer,NetworkFromFunc
from control4.misc.var_collection import VarCollection
from control4.config import floatX,setup_logging,print_theano_config
from control4.algs.alg_params import AlgParams,validate_and_filter_args
from control4.algs.save_load_utils im... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from .auto_login import *
from .basic_auth import *
from .bookmark import *
from .get_app i... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import py... |
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Main Flow"),
"items": [
{
"type": "doctype",
"name": "Quotation",
"description": _("Quotes to Leads or Customers."),
},
{
"type": "doctype",
"name": "Sales Order",
"des... |
"""
Enforces a data cutoff date for PPI data.
Original Issue: DC-1445
Intent is to enforce the data cutoff date for PPI data in all CDM tables excluding the person table by sandboxing and
removing any records that persist after the data cutoff date.
"""
# Python imports
import logging
from datetime import dateti... |
import math
def sumacomplejos(a,b):
return [a[0]+b[0],a[1]+b[1]]
def restacomplejos(a,b):
return [a[0]-b[0],a[1]-b[1]]
def multiplicacioncomplejos(a,b):
r = a[0]*b[0]+((a[1]*b[1])*-1)
i = a[0]*b[1]+a[1]*b[0]
return [r,i]
def conjugadocomplejo(a):
return [a[0],a[1]*(-1)]
def divisioncompl... |
# -*- coding: utf-8 -*-
__all__ = ["resize_or_set"]
import numpy as np
def resize_or_set(outputs, n, shape, dtype=np.float64):
if outputs[n][0] is None:
outputs[n][0] = np.empty(shape, dtype=dtype)
else:
outputs[n][0] = np.ascontiguousarray(
np.resize(outputs[n][0], shape), dtype... |
import socket
import sys
import time
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("IP")
parser.add_argument("PORT", type=int)
args = parser.parse_args()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_address = (args.IP, args.PORT)
data = [0, 0]
myTime = 0
i = 0
print("starti... |
# Generated by Django 2.2.4 on 2019-09-14 01:31
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('job', '0014_auto_20190913_2133'),
]
operations = [
migrations.RemoveField(
model_name='jobopening',
name='image',
),... |
# Foo.
|
## Set the filename for the next image to be written
counter = 0
## Is this is set to true, existing images in /faces will be overwritten, otherwise
## the existing image names will be skipped
overwrite_images = False
## Set set all videos you want to extract faces from
## These videos should be located in the ./srcv... |
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
class python_cli_args(object):
def __init__(self):
pass
def python_add_args(self, subparser):
# python_version
p = subparser.add_parser('ver', help = 'Print the python sys.version.')
# python_path
... |
import numpy as np
import cv2
video = cv2.VideoCapture(0)
while(video.isOpened()):
_,frame = video.read()
cv2.imshow("Image",frame)
if cv2.waitKey(10)==13:
bbox = cv2.selectROI(frame)
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
obj_img = hsv[bbox[1]:bbox[1]+bbox[3], bbox[0]:bbox[0... |
from cloudaux.aws.glacier import describe_vault, get_vault_access_policy, list_tags_for_vault
from cloudaux.decorators import modify_output
from cloudaux.orchestration.aws.arn import ARN
from flagpole import FlagRegistry, Flags
from six import string_types
registry = FlagRegistry()
FLAGS = Flags('BASE', 'POLICY', 'TAG... |
import subprocess
import argparse
import datetime
import time
import os
class OSBuild(object):
def __init__(self, build_version):
self._build_version = build_version
self._datetime = datetime.datetime.now()
self._pubdate = datetime.datetime.now().strftime("%m-%d-%Y")
self._dt = s... |
class AnalysisDisplayVectorSettings(object, IDisposable):
"""
Contains vector settings for analysis display style element.
AnalysisDisplayVectorSettings()
AnalysisDisplayVectorSettings(other: AnalysisDisplayVectorSettings)
"""
def Dispose(self):
""" Dispose(self: AnalysisDisplayVec... |
# Generated by Django 2.2.13 on 2021-03-01 19:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clist', '0060_auto_20210227_1943'),
]
operations = [
migrations.AddIndex(
model_name='contest',
index=models.Index(... |
#!/usr/bin/python
import sys, re;
from structs import unions, structs, defines;
# command line arguments
arch = sys.argv[1];
outfile = sys.argv[2];
infiles = sys.argv[3:];
###########################################################################
# configuration #2: architecture information
inttypes = {};
head... |
#!/usr/bin/env python
"""
Example of a message box window.
"""
from quo.shortcuts import message
def main():
message(
title="Example dialog window",
text="Do you want to continue?\nPress ENTER to quit.",
).run()
if __name__ == "__main__":
main()
|
# Generated by Django 2.2.3 on 2020-03-20 00:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('skeleton', '0009_auto_20200320_1344'),
]
operations = [
migrations.AlterField(
model_name='site',
name='emitter_spac... |
from setuptools import setup, find_packages
long_description = 'RIDDLE (Race and ethnicity Imputation from Disease history with Deep LEarning) is an open-source deep learning (DL) framework for estimating/imputing race and ethnicity information in anonymized electronic medical records (EMRs). It utilizes Keras, a modu... |
import json
import re
import subprocess
def split_indent(txt, i=0):
return [
x.strip('\n') for x in
re.split(r'\n\s{{{}}}(?!\s|\n)'.format(i), txt.strip('\n')) if x]
def matchmany(out, patterns):
matches = [
re.search(pattern, line) for line in out.splitlines()
for pattern in ... |
from my_generators.fibonacci import fibonacci
def get_result():
count = 0
for fib in fibonacci():
count += 1
if len(str(fib)) >= 1000:
return count |
import cross3d
from PyQt4.QtCore import QObject
class AbstractUndoContext(QObject):
def __init__(self, name):
super(AbstractUndoContext, self).__init__()
self.name = name
def __enter__(self):
return None
def __exit__(self, exc_type, exc_value, traceback):
return False
@classmethod
... |
#!/usr/bin/env python
"""
.. module:: lheChecks
:synopsis: Check LHE file format.
.. moduleauthor:: Ursula Laa <ursula.laa@lpsc.in2p3.fr>
"""
from __future__ import print_function
from smodels.tools.ioObjects import LheStatus
def main(args):
status = LheStatus(args.filename)
print(status.status)
|
from pymatgen import Structure, Lattice
a = 5.6402
lattice = Lattice.from_parameters(a, a, a, 90.0, 90.0, 90.0)
print(lattice)
structure = Structure.from_spacegroup(sg='Fm-3m', lattice=lattice,
species=['Na', 'Cl'],
coords=[[0, 0, 0], [0.5, 0,... |
# getting user info:
# 3 numbers: age (int), height (float) and weight (float);
# two strings name and nationality.
name = str(input())
age = int(input())
height = float(input())
weight = float(input())
nationality = str(input())
print(name)
print(age, "anos")
print("%.2f" % height, "de altura")
print("%.2f" % weight... |
#
# PySNMP MIB module NAGIOS-ROOT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NAGIOS-ROOT-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:07:03 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... |
from PySide import QtGui
from PySide import QtCore
class difftoolbar(QtGui.QToolBar):
sigCake = QtCore.Signal()
sigRemesh = QtCore.Signal()
def __init__(self):
super(difftoolbar, self).__init__()
self.actionCenterFind = QtGui.QAction(self)
icon1 = QtGui.QIcon()
icon1.addPi... |
# -*- coding: utf-8 -*-
from distutils.core import setup
# ATTRIBUTES TO INCLUDE
# name, author
# version
# packages,scripts
setup(
name = 'PieSeis',
version = '0.1dev',
author = u"Asbjørn Alexander Fellinghaug",
author_email = "asbjorn <dot> fellinghaug _dot_ com",
packages = ['pieseis'],... |
def exact_change_recursive(amount,coins):
""" Return the number of different ways a change of 'amount' can be
given using denominations given in the list of 'coins'
>>> exact_change_recursive(10,[50,20,10,5,2,1])
11
>>> exact_change_recursive(100,[100,50,20,10,5,2,1])
4563
... |
import sys
from data_access_layer.mongo_db.mongo_db_atlas import MongoDBOperation
from exception_layer.generic_exception.generic_exception import GenericException as DbOperationMongoDbException
from integration_layer.file_management.file_manager import FileManager
from logging_layer.logger.logger import AppLogger
from ... |
import persistent
import BTrees.OOBTree
import re
import tempfile
from subprocess import Popen, PIPE
from stf.common.out import *
from stf.core.dataset import __datasets__
from stf.core.connections import __group_of_group_of_connections__
from stf.core.models_constructors import __modelsconstructors__
from stf.core.... |
import base64
import bcrypt
import json
import mock
import testtools
from shakenfist import config
from shakenfist.external_api import app as external_api
from shakenfist import ipmanager
from shakenfist import net
class FakeResponse(object):
def __init__(self, status_code, text):
self.status_code = sta... |
from .mklink import mergelink
from .mklink import mergelinks
from .mklink import mklink
from .mklink import mklinks
from .zipfile_ import unzip_file
|
import gc
import threading
from pickle import loads, dumps
from go import Stone, WHITE, BLACK
from time import time
import numpy as np
def masked_softmax(mask, x, temperature):
if len(x.shape) != 1:
print("softmax input must be 1-D numpy array")
return
# astype("float64") because numpy's multin... |
__copyright__ = "Copyright 2020 Profilence"
__license__ = "Apache License, Version 2.0"
def enum(**enums):
return type('Enum', (), enums)
ResetType = enum(HARD_RESET=1,
SOFT_RESET=2,
REQUESTED_RESET=4,
MODEM_HIDDEN=8)
EventType = enum(WARNING=1,
... |
from urllib import request, parse, error
import json, time, re
import configparser, os
config=configparser.ConfigParser(allow_no_value=True)
config.read(os.getenv('FRONTEND_CONFIG'))
config.read(os.getenv('BACKEND_CONFIG'))
dungRegex = re.compile("(^|\D):\d{2}(\D|$)")
url = "https://api.telegram.org/bot" + config['bo... |
"""
This module is for calculating stats on a large corpus of text data.
"""
import os
import json
from chemdataextractor.doc import Paragraph
import sys
import random
#import pubchempy as pcp
print('Successful imports')
def find_nth(haystack, needle, n):
"""
This function finds the index of the nth instance... |
__author__ = 'silencedut'
|
from http import HTTPStatus
import pytest
import requests
from rotkehlchen.tests.utils.api import api_url_for, assert_error_response, assert_proper_response
from rotkehlchen.tests.utils.blockchain import assert_btc_balances_result
from rotkehlchen.tests.utils.factories import UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2
from... |
from typing import List, Dict, Callable, Any, Tuple
from pyri.webui_browser.plugins.variable_dialog import PyriWebUIBrowserVariableDialogInfo, PyriWebUIBrowserVariableDialogPluginFactory, PyriWebUIBrowserVariableDialogBase
from pyri.webui_browser import PyriWebUIBrowser
from .new_calibrate_intrinsic_dialog import show_... |
from typing import List
from uuid import UUID
from fastapi import APIRouter
from fastapi.param_functions import Depends
from sqlmodel import Session
from starlette.status import HTTP_201_CREATED
from src.core.controller import user
from src.core.helpers.database import make_session
from src.core.models import Context... |
# Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved.
""" State elimination transformations """
import networkx as nx
from dace import dtypes, registry, sdfg
from dace.sdfg import nodes
from dace.sdfg import utils as sdutil
from dace.transformation import transformation
from dace.config import C... |
# Enter script code
import re
winClass = window.get_active_class()
isGoogleChrome1 = re.search("google-chrome\.[g|G]oogle-chrome", winClass)
isGoogleChrome2 = re.search("Google-chrome-stable\.Google-chrome-stable", winClass)
isTerminalWin = re.search("x+terminal.*", winClass)
isKonsole = re.search("konsole\\.konsole", ... |
# encoding:utf-8
import csv
import os
import time
import string
# 控制类
class Controller(object):
def __init__(self, count):
# 定义测试的次数
self.counter = count
# 定义收集数据的数组
self.all_data = [("timestamp", "traffic")]
# 单次测试过程
def test_process(self):
# 执行获取进程ID的指令 window 下用... |
"""obstacle_avoid_test controller."""
# You may need to import some classes of the controller module. Ex:
# from controller import Robot, LED, DistanceSensor
from controller import Supervisor
from odometry import Odometry
from data_collector import DataCollector
from predictor import Predictor
import matplotlib.pyplo... |
import unittest
from datetime import datetime
import sqlalchemy as sa
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import Session
from sqlalchemy_mixins import TimestampsMixin
Base = declarative_base()
class BaseModel(Base, TimestampsMixin):
"... |
from setuptools import setup, find_packages
import re
import os
exec(open('hermione/_version.py').read())
with open('README.md', encoding='utf-8') as f:
long_description = f.read()
setup(
name='hermione-ml',
version=__version__,
author='A3Data',
author_email='hermione@a3data.com.br',
url='htt... |
"""
Quick tests against arbitrarily chosen LRP test vectors from AN12304
"""
import binascii
from Crypto.Protocol.SecretSharing import _Element
from lrp import LRP, nibbles, incr_counter
def test_incr_counter():
assert b"\x01" == incr_counter(b"\x00")
assert b"\x02" == incr_counter(b"\x01")
assert b"\x... |
### IMPORT
# il file di run da importare è nella cartella pgr/, padre di quella corrente
import sys
sys.path.append('../pgr')
import imghdr
import os
from flask import Flask, render_template, request, redirect, url_for, abort, \
send_from_directory
from werkzeug.utils import secure_filename
import zipfile
import j... |
from typing import Any, Tuple
import logging
from enum import Enum
import numpy as np
import torch
# AUTHORSHIP
__version__ = "0.0.0dev"
__author__ = "Mirko Polato"
__copyright__ = "Copyright 2021, gossipy"
__license__ = "MIT"
__maintainer__ = "Mirko Polato, PhD"
__email__ = "mak1788@gmail.com"
__status__ = "Developme... |
"""pytest-splinter package."""
__version__ = "3.3.0"
|
# Generated by Django 2.2.6 on 2019-10-17 18:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("zezere", "0001_initial")]
operations = [
migrations.AddField(
model_name="runrequest",
name="auto_generated_id",
fiel... |
# Python 2.7 or Python 3.x
"""
Unittest of parse_lammps_log.parse_log
Adapted from/inspired by pymatgen:
https://github.com/materialsproject/pymatgen/blob/master/pymatgen/io/lammps/tests/test_output.py
Alta Fang, 2017
"""
import os
import unittest
import numpy as np
from parse_lammps_log.parse_log import LammpsLog... |
from multiprocessing import Process
import os
import time
def info(title):
print(title)
print('module name:', __name__)
print('parent process:', os.getppid())
print('process id:', os.getpid())
def foo(name):
info('function f')
count = 0
while(True):
print('Thread {}, count: {}'... |
# pip install selenium
# pip install webdriver-manager
import re
import urllib
import soup as soup
import time
from selenium import webdriver
import pandas
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
driver.implicitly_wait(3) # 웹 자원 로드를 위해 3초 기다... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.