source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
serial_test.py | #
# DAPLink Interface Firmware
# Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
test_context.py | import queue
import threading
import time
from typing import Any
import pytest
import prefect
from prefect import context
from prefect.configuration import Config
from prefect.utilities.context import Context
def test_context_sets_variables_inside_context_manager():
"""
Tests that the context context manage... |
tests.py | import threading
from datetime import datetime, timedelta
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections
from django.db.models.manager import BaseManager
from django.db.models.query import EmptyQuerySet, QuerySet
from dj... |
main.py |
from time import time
from tkinter import *
from tkinter import ttk
import tkinter as tk
import tkinter.scrolledtext as st
import time
import threading
"""FUNÇÕES DO SISTEMA"""
from icmplib import ping
import matplotlib.pyplot as plt
import os
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from ma... |
test_dota_base.py | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import tensorflow as tf
import cv2
import numpy as np
import math
from tqdm import tqdm
import argparse
from multiprocessing import Queue, Process
from utils import... |
support.py | """
Assorted utilities for use in tests.
"""
import cmath
import contextlib
import enum
import gc
import math
import platform
import os
import shutil
import subprocess
import sys
import tempfile
import time
import io
import ctypes
import multiprocessing as mp
import warnings
import traceback
from contextlib import con... |
startup.py | from InquirerPy.utils import color_print
from colorama import Fore, Style, Cursor, ansi
import subprocess, time, cursor, valclient, ctypes, os, sys, requests
from .localization.localization import Localizer
from .utility_functions import ContentLoader, Filepath, Processes, Logger, ErrorHandling, VersionChecker
from .l... |
Abstract.py | import abc, threading, time, logging
logger = logging.getLogger('danmu')
# This client will auto-reload if exception is raised inside and write a log
# it is deprecated once used
# log of main start and thread is recorded
# If you want to close it outside, just set the deprecated flag to True
# Inside reload ... |
modified_lc.py | from lc import Algorithm
from lc.torch import ParameterTorch as LCParameterTorch
from torch import nn
import torch
import time
import asyncio
import numpy as np
class RankSelectionLcAlg(Algorithm):
def __init__(self, model, compression_tasks, lc_config, l_step_optimization, evaluation_func, l_step_config):
... |
4.pipe1.py | from multiprocessing import Process, Pipe
def test(w):
# 只能写
w.send("[子进程]老爸,咱们完了,老妈一直在门口~")
def main():
r, w = Pipe(duplex=False)
p1 = Process(target=test, args=(w, ))
p1.start() # 你把这个放在join前面就直接死锁了
msg = r.recv() # 只能读
print(msg)
p1.join()
if __name__ == '__main__':
main() |
server.py | import json
from flask import Flask
from flask_cors import CORS
from random import random
from threading import Event, Thread
# ML data model
class LatLng:
"""Coordinates"""
def __init__(self, lat, lng):
self.lat = lat
self.lng = lng
def json(self):
return {
'lat': ... |
core.py | #!/usr/bin/env python3
from __future__ import annotations
import json
import os
import shlex
import shutil
import subprocess
import sys
import time
import traceback
from abc import ABCMeta
from collections import deque
from concurrent.futures import ThreadPoolExecutor, TimeoutError
from enum import Enum
from io import... |
flow.py | import asyncio
import collections
import json
import os
import queue
import re
import threading
import time
import aiohttp
_termination_obj = object()
class FlowError(Exception):
pass
class V3ioError(Exception):
pass
class Flow:
def __init__(self, termination_result_fn=lambda x, y: None):
se... |
walk_to_dfxml.py | #!/usr/bin/env python3
# This software was developed at the National Institute of Standards
# and Technology in whole or in part by employees of the Federal
# Government in the course of their official duties. Pursuant to
# title 17 Section 105 of the United States Code portions of this
# software authored by NIST emp... |
p2p_utils.py | # P2P helper functions
# Copyright (c) 2013-2015, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import threading
import time
import Queue
import hwsim_utils
MGMT_SUBTYPE_PROBE_REQ = 4
MGMT_SU... |
SnekmerServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
limbo.py | #!/usr/bin/env python
# encoding: utf-8
#| Copyright Inria May 2015
#| This project has received funding from the European Research Council (ERC) under
#| the European Union's Horizon 2020 research and innovation programme (grant
#| agreement No 637972) - see http://www.resibots.eu
#|
#| Contributor(s):
#| - Jean-Bap... |
HoleFinder.py | # The Leginon software is Copyright 2004
# The Scripps Research Institute, La Jolla, CA
# For terms of the license agreement
# see http://ami.scripps.edu/software/leginon-license
#
import threading
import wx
import wx.lib.filebrowsebutton as filebrowse
import leginon.gui.wx.TargetPanel
import leginon.gui.wx.Settings
... |
BrowserEditor.py | ##########################################################################
#
# Copyright (c) 2012-2014, 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:
#
# * Redi... |
elizabeth.pyw | import threading
import time
import psutil
import pyinotify
import os
"System background assistant"
__author__ = 'QidiLiu'
KICAD_RUNNING = False # Check if KiCad is running
NEW_LIB = '/home/qidi/Documents/KiCad_Lib/new_lib'
def kicad_monitor():
global KICAD_RUNNING
while True:
proc_iter = psutil.pro... |
train_mujoco.py | import argparse
import gym
import logz
import numpy as np
import os
import tensorflow as tf
import time
import nn
from sac import SAC
import utils
from multiprocessing import Process
def train_SAC(env_name, exp_name, seed, logdir, algorithm_set_params):
alpha = {
'Ant-v2': 0.1,
'HalfCheetah-v2': ... |
ip_source.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import time
import os
import threading
import struct
import utils
import random_get_slice
random.seed(time.time()* 1000000)
class IpSimpleSource(object):
def __init__(self, ips=[]):
self.ips = ips
def set_ips(self, ips):
self.ips =... |
manager.py | from dataclasses import dataclass
import logging
import threading
import time
import traceback
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Iterator
from concurrent.futures.thread import ThreadPoolExecutor
from blspy import G1Element
from chiapos import DiskProver
from ... |
stockMain.py | # -*- coding:utf-8 -*-
import threading
from filter import *
from verify import *
from datetime import *
from dataselect import *
from stockclass import *
# from tree import tree1
from backup.tree2007 import *
import config.Globaldata as conf
class stockView:
def __init__(self):
self.lastClose_bMd = 0.0... |
tk_widget.py | #!/usr/bin/env python3
#
# Python 3+ only tkinter terminal widget.
#
# This file is part of pySerial-terminal. https://github.com/pyserial/pyserial-terminal
# (C) 2018 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import queue
import tkinter as tk
from tkinter import scrolledtext
# fro... |
cfimport.py | import os
import sys
import threading
import traceback
NLOOPS = 50
NTHREADS = 30
def t1():
try:
from concurrent.futures import ThreadPoolExecutor
except Exception:
traceback.print_exc()
os._exit(1)
def t2():
try:
from concurrent.futures.thread import ThreadPoolExecutor
... |
blockchain.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@ecdsa.org
#
# 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... |
test_client.py | # test_client.py
# -*- coding: utf8 -*-
# vim:fileencoding=utf8 ai ts=4 sts=4 et sw=4
# Copyright 2009 National Research Foundation (South African Radio Astronomy Observatory)
# BSD license - see LICENSE for details
"""Tests for client module."""
from __future__ import absolute_import, division, print_function
from f... |
test_InfoExtractor.py | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import io
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL, expect_dict, expect_value, http_server_port
from youtube_dl.compat imp... |
multiprocessing_env.py | # Taken from: https://github.com/higgsfield/RL-Adventure-2/blob/master/common/multiprocessing_env.py
# This code is from openai baseline
# https://github.com/openai/baselines/tree/master/baselines/common/vec_env
import numpy as np
from multiprocessing import Process, Pipe
def worker(remote, parent_remote, env_fn_wr... |
openevse.py | # The MIT License (MIT)
#
# Copyright (c) 2015-2017 Sebastien Maccagnoni <sebastien@maccagnoni.eu>
#
# 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 lim... |
core.py | import re
import struct
import time
import socket, select
import threading
try:
import queue as queue
except ImportError:
import Queue as queue
import netifaces
from collections import namedtuple
from . import commands
from .utils import ValueRange
class ISCPMessage(object):
"""Deals with formatting and ... |
object_storage_bulk_copy.py | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
__init__.py | from __future__ import division
from __future__ import absolute_import
import logging
import os
import re
import time
import datetime
import traceback
from threading import Thread
import numpy as np
import signal
import paramiko
import six
import sys
import ruamel.yaml as yaml
import subprocess
from paramiko.compre... |
build.py | ## @file
# build a platform or a module
#
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
#
# This program and the accompanying materials
# are... |
drum_machine.py | #!/usr/bin/env python -W ignore::DeprecationWarning
"""
drum_machine: a simple drum machine
To use (install the requirements):
$ pipenv install aiolo[examples]
$ python drum_machine.py
"""
import asyncio
import multiprocessing
import os
import warnings
import wave
import aiolo
import pyaudio
PATH = os.pat... |
encoder.py | import os
import time
import torch
import ujson
import numpy as np
import itertools
import threading
import queue
from colbert.modeling.inference import ModelInference
from colbert.evaluation.loaders import load_colbert
from colbert.utils.utils import print_message
from colbert.indexing.index_manager import IndexMan... |
streaming.py | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
import httplib
from socket import timeout
from threading import Thread
from time import sleep
import urllib
from tweepy.auth import BasicAuthHandler
from tweepy.models import Status
from tweepy.api import API
from tweepy.error import TweepErro... |
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 httplib
import... |
mock_http_server.py | try:
# Python 3
from http.server import BaseHTTPRequestHandler, HTTPServer
except ImportError:
# Python 2
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import socket
from threading import Thread
_put_requests = 0
class _RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
... |
cdl.py | import os, os.path, sys
from threading import Thread
NO_OF_CHARS = 256
path = "input/"
def badCharHeuristic(string, size):
badChar = [-1]*NO_OF_CHARS
for i in range(size):
badChar[ord(string[i])] = i;
return badChar
def search(txt, pat):
m = len(pat)
n = len(txt)
badChar = badCharHeuri... |
IoManager.py | """This module defines the `IoManager` class
which manages I/O for file objects connected to an existing gdb process
or pty.
"""
import io
import select
import time
from pprint import pformat
from typing import Union, List, Optional, Dict, Any, Tuple
from pygdbmi import gdbmiparser
import os
import logging
from pygdbmi... |
twisterlib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fut... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2017 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 ... |
stress_test.py | from threading import Thread
from collections import Counter
import requests
from datetime import datetime
import time
results = []
def get(url):
global results
now = datetime.now()
r = requests.get(url)
results.append((r, (datetime.now() - now).total_seconds(), now))
if __name__ == '__main__':
... |
h2Replay.py | #!/bin/env python3
'''
'''
# 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 ... |
countdown2.py | # countdown2.py
#
# An example of launching a function into a separate thread
import time
import threading
import multiprocessing
def countdown(count):
while count > 0:
print("Counting down", count)
count -= 1
time.sleep(1)
return
# Sample execution
# Creates a Thread object, but its ... |
bonjour_process.py | """
Le premier prgramme en Python
* utilisation des arguments de la lignne de commande
* les processus
* le logger
@author Dragos STOICA
@version 0.6
@date 17.feb.2014
"""
import time
import random
import logging
import sys, os
import multiprocessing
from multiprocessing import Process, Queue, current_process, freeze... |
clienthandler.py | import abc
import logging
from queue import Queue
from socket import socket
from threading import Thread
from typing import Callable, Optional
log = logging.getLogger('client_handler')
class ClientHandler(abc.ABC):
cs: Optional[socket]
in_queue: Queue
handlers: dict[bytes, list[Callable[[list[bytes]], No... |
gpsegwalrep.py | #! /usr/bin/env python
"""
Initialize, start, stop, or destroy WAL replication mirror segments.
============================= DISCLAIMER =============================
This is a developer tool to assist with development of WAL replication
for mirror segments. This tool is not meant to be used in production.
It is sug... |
memory_leak_test.py | # -*- coding: UTF-8 -*-
from contextlib import contextmanager
import gc
from multiprocessing import Process
import subprocess
import unittest
from py4j.java_gateway import (
JavaGateway, GatewayParameters, CallbackServerParameters,
DEFAULT_PORT, DEFAULT_PYTHON_PROXY_PORT)
from py4j.clientserver import (
Cl... |
client.py | import logging
try:
import queue
except ImportError: # pragma: no cover
import Queue as queue
import signal
import threading
import time
import six
from six.moves import urllib
try:
import requests
except ImportError: # pragma: no cover
requests = None
try:
import websocket
except ImportError: #... |
debug_ext.py | import json
import os
import re
import shlex
import subprocess
import sys
import threading
import time
from threading import Thread
from typing import Any, Dict, List
from idf_py_actions.errors import FatalError
from idf_py_actions.tools import ensure_build_directory
PYTHON = sys.executable
def action_extensions(ba... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum
from electrum.bitcoin import TYPE_ADDRESS
from electrum import WalletStorage, Wallet
from electrum_gui.kivy.i18n import _
from electrum.paymentrequest import InvoiceStore
from electr... |
serial.py |
import logging, serial, re
from threading import Thread, Event, Lock
from .config import config
from .bus import bus
_messagePattern = re.compile(r"#(.*)")
_errorPattern = re.compile(r"!(.*)")
_eventPattern = re.compile(r"\*(.*)")
_logger = logging.getLogger('Serial')
_exitEvent = Event()
_thread = None
_port = No... |
daemon.py | ############################################################################
# #
# Copyright (c) 2017 eBay Inc. #
# Modifications copyright (c) 2019-2020 Anders Berkeman #
# Modificati... |
sim.py | #!/usr/bin/env python3
import csv
import numpy
import multiprocessing
def sigmoid(x):
return 1.0/(1.0+numpy.exp(-(x-5.0)))
def sim_func(q,alpha1,alpha2,Nalpha1,Nalpha2):
#parameters
time_pitch=1.0 #ms
save_pitch=10
save_pitch_weight=1000
simlen_sec=900.0
simlen=int(simlen_sec*1000.0/time_... |
futures.py | """Tools for dealing with asynchronous execution
Credit: Logan Ward
"""
import json
from concurrent.futures import Future
from threading import Thread
from time import sleep
from globus_sdk import GlobusAPIError
class FuncXFuture(Future):
"""Utility class for simplifying asynchronous execution in funcX"""
... |
main.py | """
Main script that runs the D4PG learning algorithm
(https://arxiv.org/pdf/1804.08617)
It features the standard DDPG algorithm with a number
of improvements from other researchers.
Namely:
Distributed rollouts (https://arxiv.org/pdf/1602.01783)
A distributional learner (http://arxiv.org/abs/1... |
brute.py | import sys
import threading
import subprocess
import Queue
ir = sys.stdin.read()
found_mixing_offsets = []
original_values = []
start = 0
def run(output_q, procedure, input):
so, se = procedure.communicate(input)
output_q.put(so)
original_values = []
while True:
key = "mixingvalues "
where = ir.find(key... |
main.py | from config import CONFIG
import crawler
import logging
from proxiesmanager import ProxiesManager
from proxyset import ProxySet
import requests
from requests.exceptions import RequestException
from resultwriter import ResultWriter
import threading
from utils import gen_ranges
logger = logging.getLogger()
logging.basic... |
test_ufuncs.py | import functools
import itertools
import re
import sys
import warnings
import threading
import operator
import numpy as np
import unittest
from numba import typeof, njit
from numba.core import types, typing, utils
from numba.core.compiler import compile_isolated, Flags, DEFAULT_FLAGS
from numba.np.numpy_support impor... |
test_dota.py | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import tensorflow as tf
import cv2
import numpy as np
import math
from tqdm import tqdm
import argparse
from multiprocessing import Queue, Process
sys.path.append(".... |
execution.py | from typing import Optional, Callable, Dict
import ast
import contextlib
import faulthandler
import io
import os
import multiprocessing
import platform
import signal
import tempfile
def check_correctness(problem: Dict, completion: str, timeout: float,
completion_id: Optional[int] = None) -> Dict... |
wsdump.py | #!/Users/jmgc/Documents/workspace/cafeBackEnd/3in1cafe/3in1cafe/bin/python3
import argparse
import code
import sys
import threading
import time
import ssl
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding():
encoding ... |
server.py | import socket
from threading import Thread
class Server:
addr = ''
port = 3030
connections = 4
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.logging('Socket has created')
self.... |
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 httplib
import... |
voc_train.py | #!/usr/bin/env python
import os
import json
import torch
import numpy as np
import queue
import pprint
import random
import argparse
import importlib
import threading
import traceback
os.environ["CUDA_VISIBLE_DEVICES"] = "4"
from tqdm import tqdm
from utils import stdout_to_tqdm
from config import system_configs
from ... |
server.py | import uvicorn
from fastapi import FastAPI
from pydantic import BaseModel
import os
import logging
import json
from google.protobuf import any_pb2
import grpc
import sys
from threading import Thread
import time
import redis
import cache
import service_pb2
import service_pb2_grpc
import boto3
s3client = None
class Pr... |
__main__.py | """Contains everything that enables cli usage of the package."""
__author__ = "Marius Pahl"
import argparse
import logging
import sys
import time
from multiprocessing import Process
from pathlib import Path
from typing import Optional
from collect_stata.read_stata import StataDataExtractor
from collect_stata.write_js... |
gstreamer.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, ... |
utils.py | # -*- encoding: utf-8 -*-
# Copyright 2015 - Alcatel-Lucent
# Copyright © 2014-2015 eNovance
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
#
# Licensed under the Apache License, Version 2.0 (the... |
ncbi_parse.py | import argparse
import logging
import os
import re
import time
import zlib
import urllib.request as urllib_request
from contextlib import closing
from multiprocessing import Process, get_logger
from Bio import Entrez
from bs4 import BeautifulSoup
import pandas as pd
import requests
SPECIES_CSV = 'data/bac_dive/speci... |
test_utils.py | # -*- encoding:utf-8 -*-
# Copyright (c) Alibaba, Inc. and its affiliates.
"""Contains functions which are convenient for unit testing.
isort:skip_file
"""
from future import standard_library
standard_library.install_aliases()
import yaml
import glob
import json
import logging
import os
import random
import shutil
imp... |
api.py | '''
Scuffed but being worked on, will fix bad code later
'''
import os
import threading
import subprocess
import shlex
import sys
import time
import psutil
class APIRequest:
def __init__(self):
self.alive = True
self.AvalibleStats = {"Online, Accepting Players.": "Done (",
... |
backtester_vj_jc.py | import os
import sys
import sqlite3
import datetime
import pandas as pd
from matplotlib import gridspec
from matplotlib import pyplot as plt
from multiprocessing import Process, Queue
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from utility.setting import DB_TICK, DB_BACKTEST
from utili... |
app.py | import os
import logging
from io import BytesIO
from PIL import Image
from threading import Thread
#Prevents warnings
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # FATAL
logging.getLogger('tensorflow').setLevel(logging.FATAL)
from flask_socketio import SocketIO, emit
import cv2
import base64
import numpy as np
import ... |
conftest.py | from . import server
import pytest
# from multiprocessing import Process
from threading import Thread
@pytest.fixture(scope='module', autouse=True)
def server_setup():
"""Server instance for testing."""
instance = server.create_server()
process = Thread(target=instance.serve_forever)
process.setDaemon... |
language.py | # coding: utf8
from __future__ import absolute_import, unicode_literals
import random
import itertools
from spacy.util import minibatch
import weakref
import functools
from collections import OrderedDict
from contextlib import contextmanager
from copy import copy, deepcopy
from thinc.neural import Model
import srsly
i... |
cam.py | import cv2
import matplotlib.pyplot as plt
from utils.logger import Writer
import threading
import time
cap = cv2.VideoCapture()
import time
cap.open("/dev/video0" )
writer = Writer()
duration=1
solution=0
cap.set(cv2.CAP_PROP_FRAME_WIDTH,640)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT,320)
def cam():
global duration,sol... |
ClockSequencer.py | # clock class
import threading
import time
from Env import NB_STEPS, GATE_CHANNEL, MAX_DAC, PITCH_CHANNEL, NB_NOTES
# ! ----- NEED TO TEST -----
class ClockSequencer():
def __init__(self, sequencer, tempo, gate):
self.sequencer = sequencer
self.tempo = tempo
self.gate = gate
... |
human_play.py | # -*- coding: utf-8 -*-
"""
human VS AI models
Input your move in the format: 2,3
@author: 某科学的软工小队
"""
from __future__ import print_function
from game import Board, Game
# from policy_value_net import PolicyValueNet
# from policy_value_net_numpy import PolicyValueNetNumpy
from policy_value_net_tensorflow import Poli... |
classes_intro4.py | """
Ok, so we've covered a lot...hope you're still
with me on classes.
In this section we'll talk about 'over riding' a
parent class. We'll use most of what we've already
learned, but lets get away from dog!
Lets use cars :)
Honda Accord 0-100 (62 mph) km/h in about ~8.1 seconds
BMW x... |
dataloader_iter.py | # Copyright (c) 2020 PaddlePaddle 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 appli... |
autologin1.py | import time
import pythoncom
from manuallogin import *
from PyQt5 import QtWidgets
from PyQt5.QtCore import QTimer
from multiprocessing import Process
from PyQt5.QAxContainer import QAxWidget
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from utility.setting import openapi_path
app = QtWi... |
agent.py | # Copyright 2020 Kaggle Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
test_teleport.py | import unittest
import responses
import logging
from threading import Thread
from tornado.ioloop import IOLoop
from tornado.gen import coroutine
from tornado.tcpserver import TCPServer
from mock import patch, MagicMock
from collections import defaultdict
from teleport import Teleport, TeleportationProvider, Luminati, ... |
cvimage.py | from __future__ import annotations
from dataclasses import dataclass
from typing import overload
from numbers import Real
import builtins
import sys
import os
import io
import math
import warnings
import contextlib
from pathlib import Path
import cv2
import numpy as np
def isPath(f):
return isi... |
TestSuite.py | from datetime import datetime
from telebot import TeleBot
import json
from itertools import chain
from Tests import Networking, Screenshot, UserInfoTest, ShodanTests
import time
import threading
from os import remove
import sys
# config settings
config = json.load(open("config.json"))
bot = TeleBot(config['token'], pa... |
dpsctl.py | #!/usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2017 Johan Kanflo (github.com/kanflo)
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 limitat... |
bluetooth-worker.py | from bluetooth import BluetoothSocket
import threading
import requests
# ***** CONFIG *****
uuid = "94f39d29-7d6d-437d-973b-fba39e49d4ee"
data_webhook = 'http://127.0.0.1:4909/new_msg'
deviceCount = 6
# ***** CONFIG *****
server_sock = BluetoothSocket( RFCOMM )
server_sock.bind(("", PORT_ANY))
server_sock.listen(1)
... |
helper_node.py | # Copyright (c) OpenMMLab. All rights reserved.
import logging
import time
from queue import Full, Queue
from threading import Thread
from typing import List, Optional, Union
import cv2
import numpy as np
from mmcv import color_val
from mmpose.utils.timer import RunningAverage
from .builder import NODES
from .node im... |
runner.py | # make buy sell distinction between stocks purchased for daytrading and long term purchases
import scraper
import threading
import time
from datetime import datetime
import constants as const
import alpaca as alp
import news
import stock_analysis as sa
import stock_data_gatherer as sdg
import util
import news_classif... |
test_ping_vms_reboot_vr.py | '''
1. Create 2 Test VMs with VR.
2. After 2 VMs created, reboot VR.
3. After VR reboot completed, check 2 VMs status
4. ping VM2 from VM1
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
impor... |
Anti.py | from time import sleep
from threading import Thread
from psutil import process_iter
vmservices = ["vmsrvc", "vmusrvc", "vboxtray", "vmtoolsd", "df5serv", "vboxservice"]
debuggers = ["Suspend", "Progress Telerik Fiddler Web Debugger", "Fiddler", "Wireshark", "dumpcap", "dnSpy", "dnSpy-x86", "cheatengine-x86_64", "... |
EvaClient.py | # Copyright (c) 2016 Gabriel Oliveri (<gabrieloandco@gmail.com>)
#
# 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,... |
tt.py | #!/user/bin/env python
#-*- encoding:utf-8 -*-
import socket
import thread,threading
sockIndex = 1
def connToServer (conn):
global sockIndex
print sockIndex
sockIndex = sockIndex + 1
for i in xrange(10):
conn.send('{"SvrNo":"3"}\n')
while True:
#等待服务端返回数据,并输出
rev = ... |
util.py | # coding=utf8
import os, shutil, ctypes
from datetime import datetime
from collections import deque
from abc import ABCMeta, abstractmethod
from threading import Event as TEvent, Thread, Lock
import time
import platform
from witica.log import *
def throw(ex,msg,innerEx):
raise ex(msg + ".\n ﹂" + innerEx.__class__.... |
log.py | # Copyright 2016 Capital One Services, 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... |
emotiv.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import os
import sys
from datetime import datetime
from threading import Lock, Thread
from time import time
from .decrypter import EmotivCrypto
from .output import EmotivOutput
from .packet import EmotivExtraPacket, EmotivNewPacket, EmotivOldPac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.