source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_content.py | from __future__ import print_function
import os
import re
import sys
import json
import time
import argparse
import threading
import subprocess
import traceback
from time import sleep
from datetime import datetime
from distutils.version import LooseVersion
import urllib3
import requests
import demisto_client.demisto_a... |
lfw_eval.py | import multiprocessing as mp
import os
import pickle
import queue
from multiprocessing import Process
import cv2 as cv
import dlib
import numpy as np
from keras.applications.inception_resnet_v2 import preprocess_input
from tqdm import tqdm
from Base.config import lfw_folder, img_size, channel, threshold, predictor_pa... |
main.py | from servo import *
from TempSensor import *
from DistanceSensor import *
import time
import threading
import json
import urllib.request
from urllib.parse import urlencode
from programs import *
DHT11 = temp_sensor(23)
command = dict()
command["motor1"] = 0 #base left right
command["motor2"] = 0 ... |
utils_opencv.py | import cv2
import numpy as np
from threading import Thread
from PIL import Image
try:
from queue import Queue
except ImportError:
from Queue import Queue
cv2_version = cv2.__version__.split('.')[0]
FACE_PAD = 50
class VideoStream(object):
def __init__(self, url, queueSize=4):
self.stream = cv2... |
cluster_setup_add.py | # Copyright 2010-2012 Opera Software ASA
#
# 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 ... |
measure_methods.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
use_threadlocal.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import threading
# ThreadLocal:
local_school = threading.local()
def process_student():
# student:
std = local_school.student
print("Hello, %s (in %s)" % (std, threading.current_thread().name))
def process_thread(name):
# ThreadLocalstudent:
local... |
maestro.py | from Sensor import *
from input import *
import threading
def main():
s = Sensor()
c = Communication_Device()
inThread = threading.Thread(target=c.read_data_stream, args=())
outThread = threading.Thread(target=s.output_data, args=("output.txt", "fancy-out.txt"))# s.output_data("output.txt", "fancy-out... |
main.py | """
Parallel processes programming (not async)
Functions:
F1: C := A - B * (MA * MD)
F2: o := Min(MK * MM)
F3: T := (MS * MZ) * (W + X)
"""
from multiprocessing import Process
from contextlib import contextmanager
import os
import logging
from math_func import func1, func2, func3, make_sq_matrix, make_vector
@conte... |
opencv_gst_camera.py | import traitlets
import atexit
import cv2
import threading
import numpy as np
from .camera_base import CameraBase
class OpenCvGstCamera(CameraBase):
value = traitlets.Any()
# config
width = traitlets.Integer(default_value=816).tag(config=True)
height = traitlets.Integer(default_value=616).ta... |
database_seed.py | #!/usr/bin/python3.6
import threading
import multiprocessing
from functools import reduce
from time import sleep
from time import strftime
import mysql.connector
import json
from os.path import abspath, join, dirname
import random
import sys
import time
import itertools
import psycopg2
user_input = None
def func():
... |
gui.py | import tkinter as tk
import gmail
import settings
import threading
from datetime import datetime
from github_interface import GithubInterface
def change_button_states(active):
state = 'normal' if active else 'disabled'
refresh_button.config(state=state)
send_button.config(state=state)
def log_message(te... |
test_utils.py | # Copyright 2019 Google LLC
#
# 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, ... |
pydoc.py | #!/usr/bin/env python
# -*- coding: Latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... |
twitographer.py | # twitographer.py -- a parallelized web crawler to traverse the twitter graph
# matthew jack <{username}@uiowa.edu>
import os
import sys
import time
import json
import redis
import signal
import asyncio
import logging
import credentials
import multiprocessing as mp
from pyppeteer import launch
class Logger:
def ... |
ssh-monitor.py | from multiprocessing import Process
import RPi.GPIO as GPIO
import time
import subprocess
import psutil
GPIO.setmode(GPIO.BCM)
ledPin = 17
buttonPin = 18
GPIO.setup(buttonPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(ledPin, GPIO.OUT)
GPIO.output(ledPin, GPIO.LOW)
def buttonCheck():
while True:
input_state... |
Training.py | from sacred import Experiment
import tensorflow as tf
import threading
import numpy as np
import os
import multiprocessing
import Datasets
from Input import Input as Input
from Input import batchgenerators as batchgen
import Models.WGAN_Critic
import Models.Unet
import Utils
import cPickle as pickle
import Test
import ... |
__init__.py | import inspect
import functools
import threading
from timeit import default_timer
from flask import request, make_response
from flask import Flask, Response
from werkzeug.exceptions import HTTPException
from prometheus_client import Counter, Histogram, Gauge, Summary
from prometheus_client import generate_latest, CONT... |
mqtt_wss_example_test.py | from __future__ import unicode_literals
from __future__ import unicode_literals
from builtins import str
import re
import os
import sys
import ssl
import paho.mqtt.client as mqtt
from threading import Thread, Event
try:
import IDF
except ImportError:
# this is a test case write with tiny-test-fw... |
tcp.py | # -*- coding: utf-8 -*-
'''
TCP transport classes
Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})"
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import msgpack
import socket
import os
import weakref
import time
import tra... |
interpreter.py | # Copyright 2019 The Meson development team
# 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 ... |
build_imagenet_data.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
run.py | import subprocess;
from threading import Thread
# cargo watch -x "run -- -i=529f07b0b1d5d3df52b0440bad708090 -k=192.168.0.1 -p=5602 -t=2dc6bb40e73417bba878d3c8e3e08780 -c=192.168.0.1:5200 -n=5100 -d='d://workstation/expo/rust/fdb/data'"
base_port = 5611;
no_of_actors = 1;
def make_cmd(port):
base_cmd = 'cargo wa... |
wake.py | """Wake word support."""
import json
import os
import re
import shutil
import struct
import subprocess
import threading
import time
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional, Type
from rhasspy.actor import RhasspyActor
from rhasspy.events import (
AudioData,
ListenForWakeW... |
rosparam_capture.py | #!/usr/bin/python3
#******************************************************************************
#
#"Distribution A: Approved for public release; distribution unlimited. OPSEC #4046"
#
#PROJECT: DDR
#
# PACKAGE :
# ORIGINAL AUTHOR :
# MODIFIED DATE :
# MODIFIED BY :
# REVISION :
#
# Copyright (c... |
winbox_server.py | import random
import threading
import socket
import sys
import time
##
# This file implements the Winbox server's key exchange and encryption mechanism
# for Winbox before 6.43. The key exchange is Diffie Hellman using a 1984 bit
# non-standard prime and the encryption is a custom RC4 drop-3072 using a 124
# byte sess... |
server.py | import numpy as np
import os
import io
# import for server
from flask import Flask, render_template, request, Response, send_file, jsonify
from queue import Queue, Empty
import threading
import time
# import for model
from transformers import AutoTokenizer, AutoModelWithLMHead, top_k_top_p_filtering
from torch.nn imp... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
monitored_session_test.py | # pylint: disable=g-bad-file-header
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
__main__.py | import os
from enum import Enum, auto
from typing import List, Tuple, Callable, Dict
import multiprocessing
Address = List[str]
Time = int
TimeInterval = int
class Message:
def __init__(self):
pass
@property
def target(self) -> Address:
return None
def retarget(self, new_target: Ad... |
test_process.py | """
Tests :mod:`process` module
"""
from multiprocessing import Pipe
from threading import Thread
from time import sleep
import pytest
from taro import ExecutionState, ExecutionError
from taro.jobs.process import ProcessExecution
def test_exec():
parent, child = Pipe()
e = ProcessExecution(exec_hello, (chil... |
example_03_kafkaprocessed.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing
import time
import numpy as np
from sklearn.datasets import load_iris
from sklearn.utils import resample
from src.admin import Admin
from src.client import Client
from src.server import Server
from src.model import FederatedSGDClassifier
from src.ut... |
coretyper.py | #!/usr/bin/env python3
from olctools.accessoryFunctions.accessoryFunctions import dotter, GenObject, make_dict, MetadataObject, make_path, \
printtime, run_subprocess, write_to_logfile
import olctools.accessoryFunctions.metadataprinter as metadataprinter
from genemethods.assemblypipeline import createobject
from Bi... |
test_api.py | """
HappyBase tests.
"""
import collections
import os
import random
import threading
from nose.tools import (
assert_dict_equal,
assert_equal,
assert_false,
assert_in,
assert_is_instance,
assert_is_not_none,
assert_list_equal,
assert_not_in,
assert_raises,
assert_true,
)
from ... |
goldticker.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import csv
import sys, traceback
import threading
import time
import urllib2
from PyQt4 import QtGui,QtCore
from boardlet import Boardlet
from modellet import Modellet
class GoldTicker(Boardlet):
def __init__(self, parent):
super(GoldTicker, self).__init__(p... |
client_1_(asynchronous).py | import argparse
import asyncio
import json
import logging
import pickle
import ssl
import sys
from sys import stdin
import time
import os
from collections import deque
from typing import Callable, Deque, Dict, List, Optional, Union, cast
from urllib.parse import urlparse
from threading import Thread
import PySimpleGUI... |
test_data_join_worker.py | # Copyright 2020 The FedLearner Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
engine.py | """"""
import importlib
import os
import traceback
from collections import defaultdict
from pathlib import Path
from typing import Any, Callable
from datetime import datetime, timedelta
from threading import Thread
from queue import Queue
from copy import copy
from vnpy.event import Event, EventEngine
from vnpy.trade... |
__init__.py | """
Base classes for job runner plugins.
"""
import os
import time
import string
import logging
import datetime
import threading
import subprocess
from Queue import Queue, Empty
import galaxy.jobs
from galaxy.jobs.command_factory import build_command
from galaxy import model
from galaxy.util import DATABASE_MAX_STRI... |
helper.py | import functools
import json
import multiprocessing
import os
import socket
import subprocess
from datetime import datetime
from typing import List, Tuple
import base58
import dateutil.tz
from plenum.bls.bls_crypto_factory import create_default_bls_crypto_factory
from plenum.test.node_catchup.helper import waitNodeDat... |
challenge_runner.py | #!/usr/bin/env python2
import os
import re
import signal
import subprocess as sp
from time import time, sleep
import threading
from common import IS_DARWIN, IS_LINUX, IS_WINDOWS, try_delete
# Path to crash dumps in windows
if IS_WINDOWS:
# NOTE: These may need to be changed depending on your setup
DUMP_DIR =... |
daemon.py | # daemon thread setting helps kill the thread after the main thread exits
import logging
import threading
from threading import Thread, Timer
from concurrent.futures import ThreadPoolExecutor
import time
import random
# Test function
def test():
threadname = threading.current_thread().getName()
... |
test_failure.py | import logging
import os
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
import ray.ray_constants as ray_constants
from ray.exceptions import RayTaskError
from ray.cluster_utils import Cluster
from ray.test_utils import (
wait_for_condition,
Sig... |
UR_ActivateMonitoring.py | # This script creates a thread to monitor the position and other variables from a real UR robot
# With this script active, RoboDK will create a new target when the robot is moved a certain tolerance
#
# More information about the RoboDK API here:
# https://robodk.com/doc/en/RoboDK-API.html
# Press F5 to run the script
... |
import_thread.py | from collections import defaultdict
import threading
import traceback
import redis
import grpc
import ray
from ray import ray_constants
from ray import cloudpickle as pickle
import ray._private.profiling as profiling
import logging
logger = logging.getLogger(__name__)
class ImportThread:
"""A thread used to im... |
TQ.py | # -*- coding:utf-8 -*-
import arcpy
import os
import shutil
import time
import multiprocessing
def currentTime():
return time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())
# function
#Monitoring变化监测数据集Monitor图层批量添加字段
# inShp:Monitor_AddFields函数输入参数,必须为矢量数据图层
def Monitor_AddFields(inShp):
print inShp
field... |
main.py | #!/usr/bin/python3
from http.server import HTTPServer, BaseHTTPRequestHandler
import sys, os, datetime, re, urllib, shutil
import socket
import socketserver
import threading
os.chdir(os.path.dirname(__file__) or '.') # CD to this directory
from helpers import *
import mimeLib
_statics = {
'buffer_size': 4096,
... |
mMLST.py | #! /usr/env/python
__author__ = 'mikeknowles, akoziol'
""" Includes threading found in examples:
http://www.troyfawkes.com/learn-python-multithreading-queues-basics/
http://www.ibm.com/developerworks/aix/library/au-threadingpython/
https://docs.python.org/2/library/threading.html
Revised with speed improvements
"""
fro... |
st2-045.pyw | # -*- coding: utf-8 -*-
from ui import Ui_MainWindow,_translate,_fromUtf8
from PyQt4 import QtCore, QtGui
import requests
import sys,threading
class Ognl(object):
dm = "(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS)"
mb = "(#_memberAccess?(#_memberAccess=#dm):((#context.setMemberAccess(#dm))))"
md = "(#c... |
message.py | import queue
import threading
import time
rateLimit = []
rateLimitQueue = queue.Queue()
def cooldown_add(user, cooldown_amount=3600):
rateLimitQueue.put((user, time.time()+cooldown_amount))
rateLimit.append(user)
def deleteLimit():
while True:
if rateLimitQueue.empty == True:
time.sleep(... |
make.py | import os
import glob
import time
import shutil
import bpy
import json
import stat
from bpy.props import *
import subprocess
import threading
import webbrowser
import arm.utils
import arm.write_data as write_data
import arm.make_logic as make_logic
import arm.make_renderpath as make_renderpath
import arm.make_world as ... |
flask_fs_collector.py | import os
import time
from typing import Union, Dict, Callable
from queue import Queue
from threading import Thread
from ding.utils import read_file, save_file, COMM_COLLECTOR_REGISTRY
from ding.utils.file_helper import save_to_di_store
from ding.interaction import Slave, TaskFail
from .base_comm_collector import Base... |
gopro.py | # gopro.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
# This copyright was auto-generated on Wed, Sep 1, 2021 5:05:47 PM
"""Implements top level interface to GoPro module."""
from __future__ import annotations
import time
import enum
import queue
import logging
import threa... |
proc.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2017 Twitter. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... |
executor.py | """
Driver of the test execution framework.
"""
from __future__ import absolute_import
import threading
import time
from . import fixtures
from . import hooks as _hooks
from . import job as _job
from . import report as _report
from . import testcases
from .. import config as _config
from .. import errors
from .. imp... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import ... |
device_thread.py | # Copyright 2018 Jetperch LLC
#
# 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,... |
RANDebias.py | import os
import numpy as np
import pickle
import torch.nn.functional as F
import torch.nn as nn
import torch
import we
from tqdm import tqdm
from copy import deepcopy
import copy
import pickle
import time
import argparse
import gc
from multiprocessing import Process
import time
import configparser
import utils
utils.s... |
process_manager.py | import threading
from kivymd.uix.card import MDSeparator
from kivymd.uix.label import MDLabel
from kivymd.uix.progressbar import MDProgressBar
from kivy.uix.boxlayout import BoxLayout
from tesseractXplore.widgets.process_manager import ProcessManagerItem
from tesseractXplore.app import get_app
def processmanager(pro... |
demo.py | #!/usr/bin/env python
import SimpleHTTPServer
import SocketServer
import atexit
import io
import json
import multiprocessing
import os
import re
import signal
import subprocess
import threading
import urlparse
import sys
PORT = 8000
NUM_WORKER_THREADS = 4
NAME_RE = '[A-Za-z0-9_]+'
LOG_RE = '[A-Za-z0-9_]+.log'
# De... |
mockup.py | import asyncore
import contextlib
import smtpd
import threading
from . import datetimehelpers
from .application import Application
from .messaging import Messenger
@contextlib.contextmanager
def mockup_smtp_server(bind=('localhost', 0)):
SMTP_SERVER_LOCK = threading.Event()
class MockupSMTPServer(smtpd.SMTPS... |
server_main.py | """A runnable script for running a meadowflow server"""
import asyncio
import contextlib
import logging
import multiprocessing
from typing import Iterator, Optional
import meadowflow.server.server
from meadowflow.scheduler import Scheduler
from meadowflow.server.config import DEFAULT_HOST, DEFAULT_PORT
async def st... |
test_base_events.py | """Tests for base_events.py"""
import concurrent.futures
import errno
import math
import os
import socket
import sys
import threading
import time
import unittest
from unittest import mock
import asyncio
from asyncio import base_events
from asyncio import constants
from test.test_asyncio import utils as test_utils
fro... |
nifty.py | """@package forcebalance.nifty Nifty functions, intended to be imported by any module within ForceBalance.
Table of Contents:
- I/O formatting
- Math: Variable manipulation, linear algebra, least squares polynomial fitting
- Pickle: Expand Python's own pickle to accommodate writing XML etree objects
- Commands for sub... |
pytorch-xla-env-setup.py | #!/usr/bin/env python
# Sample usage:
# python env-setup.py --version 1.5 --apt-packages libomp5
import argparse
import collections
from datetime import datetime
import os
import re
import requests
import subprocess
import threading
VersionConfig = collections.namedtuple('VersionConfig', ['wheels', 'tpu'])
OLDEST_V... |
blockchain_network.py | from threading import Thread
import time
import socket
import shutil
import requests
from agent.docker.blockchain_network import NetworkOnDocker
from agent.k8s.blockchain_network import NetworkOnKubenetes
from modules.models import modelv2
from modules.organization import organizationHandler as org_handler
import date... |
test_local_task_job.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
trex_tui.py | from __future__ import print_function
import termios
import sys
import os
import time
import threading
from collections import OrderedDict, deque
from texttable import ansi_len
import datetime
import readline
if sys.version_info > (3,0):
from io import StringIO
else:
from cStringIO import StringIO
from .... |
test_consumer_group.py | import collections
import logging
import threading
import time
import pytest
import six
from kafka import SimpleClient
from kafka.conn import ConnectionStates
from kafka.consumer.group import KafkaConsumer
from kafka.structs import TopicPartition
from test.conftest import version
from test.testutil import random_str... |
AlertSettings.py | # -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
import pygame
import pymysql
from PyQt5.QtCore import QTimer
import time
import smtplib
import os
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
import multiprocess... |
qwop.py | """ Functions for creating and positioning a webview with the QWOP game """
import os
import platform
import pyautogui
import threading
import time
from datetime import timedelta
from selenium import webdriver
from totter.api.image_processing import ImageProcessor
from totter.utils.time import WallTimer
# determine... |
build_cub_data.py | # -*- coding: utf-8 -*-
# @File : google_im2txt/build_cub_data.py
# @Info : @ TSMC-SIGGRAPH, 2018/7/7
# @Desc :
# -.-.. - ... -- -.-. .-.. .- -... .---. -.-- ..- .-.. --- -. --. ..-. .- -.
import os
import random
import sys
import threading
from collections import namedtuple, Counter
from datetime impo... |
base_crash_reporter.py | # Electrum - lightweight ILCOIN client
#
# 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,... |
build_mscoco_data.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
test_socket_jy.py | import errno
import os
import socket
import ssl
import threading
import time
import unittest
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
from test import test_support
def data_file(*name):
return os.path.join(os.path.dirname(__file__), *name)
CERTFILE = d... |
serial_service.py | import time
import serial
import threading
def serial_service(serial_dict):
# Connect to uno board and sim board
sim_serial = serial.Serial("/dev/ttyAMA0", 19200, timeout=1)
uno_serial = serial.Serial("/dev/ttyUSB0", 115200, timeout=1)
# Check the connection
if uno_serial.isOpen():
serial... |
debuggee.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
import atexit
import os
import struct
import subprocess
import sys
impo... |
scan.py | import time
from numpy.linalg import norm
import numpy as np
from multiprocessing import Process, Manager, Lock, Pool
from ctypes import c_int
from itertools import product
import pandas as pd
Ntotlock = Lock()
class Scan:
def __init__(self, likelihood, par_min, par_max, N_iters):
self.likelihood = likelihood
if... |
xla_client_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
routes.py | from . import users_blueprint
from flask import render_template, flash, abort, request, current_app, redirect, url_for
from .forms import RegistrationForm, LoginForm, EmailForm, PasswordForm, ChangePasswordForm
from project.models import User
from project import database, mail
from sqlalchemy.exc import IntegrityE... |
common.py | """Test the helper method for writing tests."""
from __future__ import annotations
import asyncio
import collections
from collections import OrderedDict
from contextlib import contextmanager
from datetime import timedelta
import functools as ft
from io import StringIO
import json
import logging
import os
import pathli... |
control.py | '''
The control module
Creates and controls the units of SLM lab: Experiment, Trial, Session
'''
from copy import deepcopy
from importlib import reload
from slm_lab.agent import AgentSpace, Agent
from slm_lab.env import EnvSpace, make_env
from slm_lab.experiment import analysis, search
from slm_lab.experiment.monitor i... |
utils.py | from __future__ import absolute_import, division, print_function
from collections import OrderedDict, defaultdict
import contextlib
import fnmatch
import hashlib
import json
from locale import getpreferredencoding
import libarchive
import logging
import logging.config
import mmap
import operator
import os
from os.path... |
GraphGadgetTest.py | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... |
test_stress.py | #!/usr/bin/python
from __future__ import absolute_import, print_function, unicode_literals
from optparse import OptionParser, make_option
import dbus
import time
import dbus.mainloop.glib
import bleAdapter
try:
from gi.repository import GObject
except ImportError:
import gobject as GObject
import testutils
import... |
test_asvdb.py | from os import path
import tempfile
import json
import threading
import time
import pytest
datasetName = "dolphins.csv"
algoRunResults = [('loadDataFile', 3.2228727098554373),
('createGraph', 3.00713360495865345),
('pagerank', 3.00899268127977848),
('bfs', 3.00427... |
test.py | import time
import threading
import random
from collections import Counter
import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance('node1', with_zookeeper=True)
node2 = cluster.add_instance('node2', with_zookeeper=True)
nodes = [node1, node2]
... |
ApkParser.py | #!/usr/bin/env python
#-*-coding:utf-8-*-
import sys
import subprocess
import threading
import os
import shutil
import time
class Parser(object):
def __init__(self,path):
self.current_path = self.current_path()
self.output = self.current_path + "/output-" + str(time.time())
self.apk_path = path[1]
self.dex... |
Application_server.py | from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import pyqtSlot
from threading import Thread
from Classes import Server
import json
import time
class Application_server(QApplication):
def __init__(self, *agrs, **kwargs):
super(Application_server, self).__init__(*agrs, **kwargs)
self.se... |
Main_plaza-volta.py | #!/usr/bin/env python3
#FUNÇÂO PARA TESTE DO PLAZA E VOLTA(ATÉ ACHAR UM BONECO OU CHEGAR NO FINAL DA PISTA)
#SUBSTITUIR OS VALORES NOS LOCAIS INDICADOS
print("Inicializando...", end=' \r')
import time
# from ev3dev.ev3 import *
print("ev3dev.ev3", end=' \r')
from ev3dev2.motor... |
custom.py | # pylint: disable=too-many-lines
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------... |
archiver.py | import argparse
import errno
import io
import json
import logging
import os
import pstats
import random
import re
import shutil
import socket
import stat
import subprocess
import sys
import tempfile
import time
import unittest
from binascii import unhexlify, b2a_base64
from configparser import ConfigParser
from datetim... |
build.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
jupyter_kernel.py | # -*- coding: utf-8 -*-
"""Hooks for Jupyter Xonsh Kernel."""
import sys
import json
import hmac
import uuid
import errno
import hashlib
import datetime
import builtins
import threading
from pprint import pformat
from argparse import ArgumentParser
from collections.abc import Set
import zmq
from zmq.eventloop import i... |
start_proxy.py | # Copyright 2019 Google LLC
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
test_IECore.py | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import pytest
import sys
from sys import platform
from pathlib import Path
from threading import Event, Thread
from time import sleep, time
from queue import Queue
from openvino.inference_engine import IENetwork, IECore, Execu... |
test_device_registry.py | # Copyright (c) 2020 Software AG,
# Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA,
# and/or its subsidiaries and/or its affiliates and/or their licensors.
# Use, reproduction, transfer, publication or disclosure is prohibited except
# as specifically provided for in your License Agreement with Softwar... |
__init__.py | import threading
def htrain(*args, **kwargs):
from varvar.htrees import multiplicative_variance_trees as _htrain
return _htrain(*args, **kwargs)
def qtrain(*args, **kwargs):
from varvar.qtrees import multiplicative_variance_trees as _qtrain
return _qtrain(*args, **kwargs)
def predict(*args, **kwargs... |
connection.py | '''
Author: Ligcox
Date: 2021-04-06 15:20:21
LastEditors: Ligcox
LastEditTime: 2021-08-20 16:38:44
Description: The principal implementation of Birdiebot Communication Protocol
Apache License (http://www.apache.org/licenses/)
Shanghai University Of Engineering Science
Copyright (c) 2021 Birdiebot R&D department
'''
fr... |
train_nav.py | import time
import argparse
from datetime import datetime
import logging
import numpy as np
import os
import torch
import torch.nn.functional as F
import torch.multiprocessing as mp
from models import NavCnnModel, NavCnnRnnModel, NavCnnRnnMultModel, NavPlannerControllerModel
from data import EqaDataLoader
from metrics ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.