source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
fusions_laser_manager.py | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... |
profile_sessions.py | import os
import logging
import time
import threading
import zlib
import base64
from collections import deque, defaultdict
import newrelic.packages.six as six
import newrelic
from newrelic.core.config import global_settings
from newrelic.core.transaction_cache import transaction_cache
from newrelic.core.internal_me... |
interpreter.py | import networkx as nx
import matplotlib.pyplot as plt
from io import StringIO
from networkx import algorithms
try:
import tkinter as tk
except ImportError as e:
print(e)
print("Your Python installation may not be configured for TKinter, a dependency of Satyrn")
print("Visit https://tkdocs.com/tutorial/i... |
utils.py | # -*- coding: utf-8 -*-
"""
PiDashboard Utilites
"""
import datetime, os, re, socket, struct, xmltodict
import shlex, subprocess, threading, queue
import json
#from urllib.parse import urlencode
#from urllib.request import urlopen
#from urllib.error import URLError
from PyQt5 import QtGui, QtWidgets
from lib import log... |
runtests.py | #!/usr/bin/env python
from __future__ import print_function
import atexit
import base64
import os
import sys
import re
import gc
import heapq
import locale
import shutil
import time
import unittest
import doctest
import operator
import subprocess
import tempfile
import traceback
import warnings
import zlib
import glo... |
test_grpc_server_registry.py | import sys
import threading
import time
from dagster import file_relative_path, pipeline, repository
from dagster.core.host_representation.grpc_server_registry import ProcessGrpcServerRegistry
from dagster.core.host_representation.location_manager import RepositoryLocationManager
from dagster.core.host_representation.... |
ctrlk_plugin.py | import os.path
import vim
import threading
import time
import traceback
import ctypes
import socket
import subprocess
import sys
import json
from clang.cindex import Index, Config, TranslationUnitLoadError, CursorKind, File, SourceLocation, Cursor, TranslationUnit
import requests
from ctrlk import client_api
from ctr... |
log_utils_test.py | from threading import currentThread, Thread
from Tests.scripts.utils.log_util import ParallelLoggingManager
class TestParallelLoggingManager:
def test_queue_listener_sanity(self, tmp_path):
"""
Given:
- a ParallelLoggingManager
When:
- writing logs to the log file
... |
test_wrapper.py | from __future__ import division, absolute_import, print_function
__copyright__ = "Copyright (C) 2009 Andreas Kloeckner"
__license__ = """
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 r... |
__init__.py |
from file_system.fuse_main import run_fuse, umount
from navigation_files.settings import SOURCE_DIR, FUSE_ROOT
import signal
import threading
def signal_handler(signum, frame):
umount(FUSE_ROOT)
exit(0)
def run_fuse_in_new_thread():
fuse_thread = threading.Thread(target=run_fuse, args=(FUSE_ROOT, SOURC... |
remote-logging.py | #!/usr/bin/env python3
import gimpbbio.gpio as gpio
import serial
import re
import http.client
import urllib
import threading
import queue
import sys
import datetime
import time
import socket
import logging
import logging.handlers
import argparse
import Adafruit_BMP.BMP085 as BMP085
class MyLogger(object):
def __ini... |
upgradeARGDatabaseClass.py |
# from rest.DataBaseInterface.DataBaseClass import DataBase
import threading
import gzip
import json
import networkx as nx
from networkx.readwrite import json_graph
import datetime
class UpgradeDatabase():
def __init__(self, DataBase):
self.info = ""
self.database = DataBase
self.table = ... |
train-mario.py | import os
import argparse
import gym
import numpy as np
import torch
import torch.cuda
import torch.multiprocessing as _mp
from models.actor_critic import ActorCritic
from common.atari_wrapper import create_mario_env
from optimizer.sharedadam import SharedAdam
from trainer.a3c.train import train, test
from common.mari... |
init_naoqi_bridge.py | import qi
import os
import sys
import argparse
from naoqi import ALProxy
# To get the constants relative to the video.
import vision_definitions
# opencv
import numpy as np
import cv2
from cv2 import cv
import threading
import time
import datetime
from json import dumps
import functools
from face_api_naoqi impor... |
guiserv2.py | # guiserv2.py
#
# Another example of integrating Curio with the Tkinter
# event loop using UniversalQueue and threads.
import tkinter as tk
import threading
from curio import *
class EchoApp(object):
def __init__(self):
self.gui_ops = UniversalQueue(withfd=True)
self.coro_ops = UniversalQueue()
... |
__init__.py | ############################################################################
#
# Copyright (c) Mamba Developers. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
############################################################################
""" Compon... |
temp_controller.py | #!/usr/bin/env python3
from cfg import *
from threading import Thread
import glob
import time
import numpy as np
# DS18B20 sensor path
base_dir = '/sys/bus/w1/devices/'
device_folder = glob.glob(base_dir + '28*')[0]
device_file = device_folder + '/w1_slave'
# RPI CPU temp path
cpu_temp_file = "/sys/class/thermal/ther... |
thread_update.py | '''
Created on 28 de abr de 2020
@author: leonardo
'''
import time
from componentes.jogo.mapa import Mapa
from threading import Thread, Lock
from componentes.jogo.arbusto import Arbusto
class ThreadUpdate(object):
lock = Lock()
personagens = dict()
threads = list()
mapa = Mapa()
def __in... |
context.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 us... |
test_attenuator.py | import logging
import time
import threading
import pytest
from unittest.mock import Mock
from ophyd.sim import make_fake_device
from ophyd.status import wait as status_wait
from pcdsdevices.attenuator import (Attenuator, MAX_FILTERS,
_att_classes, _att3_classes)
logger = logging.g... |
test_dag_serialization.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... |
core.py | """Core AgentOS classes."""
from collections import namedtuple
import statistics
import time
from threading import Thread
class MemberInitializer:
"""Takes all constructor kwargs and sets them as class members.
For example, if MyClass is a MemberInitializer:
a = MyClass(foo='bar')
assert a.foo == 'b... |
jsonrpc_stream.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
from threading import Thread
from queue import Queue, Empty
class JsonRpcStreamReader:
def __init__(self, stream):
self.stream = stream
s... |
fetch_catalog_course_info.py | import requests as req
import threading #https://docs.python.org/3/library/threading.html
import unicodedata
import re
import regex #https://www.dataquest.io/blog/regex-cheatsheet/
import json
from datetime import date
from time import time
from threading import Lock
from io import StringIO
from bs4 import BeautifulSo... |
subproc_vec_env.py | import numpy as np
from multiprocessing import Process, Pipe
from . import VecEnv, CloudpickleWrapper
def worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.x()
try:
while True:
cmd, data = remote.recv()
if cmd == 'step':
... |
core.py | ##########################################################
# pytorch-kaldi v.0.1
# Mirco Ravanelli, Titouan Parcollet
# Mila, University of Montreal
# October 2018
##########################################################
import sys
import configparser
import os
from utils import is_sequential_dict, model_init, optim... |
runtests.py | #!/usr/bin/env python
# vim:ts=4:sw=4:et:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# no unicode literals
import os
import os.path
# in the FB internal test infra, ensure that we are running from the
# dir that houses this script rather than some othe... |
inference_network.py | import torch
import torch.nn as nn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import torch.distributed as dist
from torch.utils.data import DataLoader
import sys
import time
import os
import shutil
import uuid
import tempfile
import tarfile
import copy
import math
from threading import ... |
download_cache_test.py | import os
import textwrap
import time
import unittest
from collections import Counter
from threading import Thread
from bottle import static_file, request
from conans.client.downloaders.cached_file_downloader import CachedFileDownloader
from conans.test.utils.test_files import temp_folder
from conans.test.utils.tools... |
updater.py | import subprocess
import os
from threading import Thread
#Your app name goes here
file_name = 'app.js'
f = open(file_name, 'r', encoding='utf-8')
current_len = len(f.read())
f.close()
def run():
p = subprocess.Popen(['node', file_name], shell=True)
p.communicate()
def check():
while 1:
with open... |
test_operator.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... |
async_policy_saver.py | # coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
MdownloadRecipes.py | import json
import os
import urllib2
import urllib
import html2text
from unidecode import unidecode
import time
import urllib
import logging
import os
import os.path
import sys
import threading
start = int(sys.argv[1])
increment = int(sys.argv[2])
if os.path.isfile('recipeitems-latest.json'):
pass... |
installer.py | from tkinter import Tk, Button, StringVar, Label, OptionMenu, Entry
import os
from threading import Thread
import shutil
from collections import OrderedDict
import requests
import platform
import json
from tqdm import tqdm
import sys
class InstallerGui(object):
def __init__(self, master):
self.master = m... |
dicts.py | #!/usr/bin/env python2.5
"""
#############################################################################
##
## file : dicts.py
##
## description : see below
##
## project : Tango Control System
##
## $Author: Sergi Rubio Manrique, srubio@cells.es $
##
## $Revision: 2008 $
##
## copyleft : ALBA Synchrotro... |
main.py | import json
from typing import Optional
import threading
import logging
from datetime import datetime, timedelta
import flask
from dateutil import parser
import functions_framework
from google.cloud import tasks_v2
from google.protobuf import timestamp_pb2
from googleapiclient import discovery
from google.api_core.ex... |
test_client.py | import os
import pytest
import time
import sys
import logging
import queue
import threading
import _thread
import ray.util.client.server.server as ray_client_server
from ray.tests.client_test_utils import create_remote_signal_actor
from ray.util.client.common import ClientObjectRef
from ray.util.client.ray_client_help... |
test.py | import logging
import logging.handlers
import sys
import threading
import os
__author__ = 'Ares Ou (aresowj@gmail.com)'
# public logging levels
LOG_LEVEL_NOTSET = logging.NOTSET
LOG_LEVEL_DEBUG = logging.DEBUG
LOG_LEVEL_INFO = logging.INFO
LOG_LEVEL_WARNING = logging.WARNING
LOG_LEVEL_ERROR = logging.ERROR
# logger ... |
trustedcoin.py | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... |
dx_jobs.py | #!/usr/bin/env python
# Corey Brune - Oct 2016
#Description:
# List jobs on a given engine
#
#Requirements
#pip install docopt delphixpy
#The below doc follows the POSIX compliant standards and allows us to use
#this doc to also define our arguments for the script.
"""List jobs on an engine
Usage:
dx_jobs.py (--list... |
test_util.py | # Copyright 2015 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... |
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... |
demo.py | # Copyright 2020-2021 OpenDR European Project
#
# 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 agree... |
test_run_project_multiple_session_and_multiple_handler.py | import logging
import multiprocessing
import unittest
from caracal import (
cara_types,
Event,
handler,
Node,
ProjectInfo,
Property,
Session,
)
class TicksGen(Node):
tick = Event("tick", (cara_types.Int(),))
def run(self):
for i in range(1, 5):
self.fire(self.... |
timeandtweet.py | from twitter import *
import simplejson
import serial
import datetime
import time
import threading
QUIT = 0
prevtweet = ""
def centerstring(string,width):
""" Pad a string to a specific width """
return " "*((width-len(string))/2)+string
def padstring(string,width):
"""pad a string to a maximum length"""
if... |
job_monitor.py | # -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2019, 2020, 2021 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Job monitoring wrapper."""
import logging
import threading
import time
import ... |
raspi.py | #!/usr/bin/python
""" Program to receive HTTP request from server with JSON body which will
contain the data for the song to be played/paused/stopped. The program will
use three threads.
Thread 1 - This thread will be used for playback.
Thread 2 - This thread will be used to keep the connection with the Server open
a... |
pubsub_executor.py | import asyncio
import concurrent
import ctypes
import time
from pebble import concurrent
import redis
class PubSubThread():
def __init__(self, connection, r, topic, promise, value):
##print("Initializing Async...")
self._pub_sub_connection = connection.get_connection().pubsub()
self.__to... |
ib_gateway.py | """
Please install ibapi from Interactive Brokers github page.
"""
from copy import copy
from datetime import datetime
from queue import Empty
from threading import Thread, Condition
from ibapi import comm
from ibapi.client import EClient
from ibapi.common import MAX_MSG_LEN, NO_VALID_ID, OrderId, TickAttrib, TickerId... |
__init__.py | import os
import sys
import cmd
import time
import serial
import select
import struct
import threading
import cPickle as pickle
from cancat import iso_tp
# defaults for Linux:
serialdev = '/dev/ttyACM0' # FIXME: if Windows: "COM10" is default
baud = 4000000
# command constants (used to identify messages between ... |
threaded.py | import time
import requests
import threading
from hardware import Hardware
class Threaded:
def __init__(self):
self._stop = False
self._thread: threading.Thread = None
def _thread_fn(self):
pass
def stop(self):
self._stop = True
if self._thread is not None:
... |
threads_cam_GPIO.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 18 14:44:27 2021
@author: xujianchen
"""
import os
import cv2
import threading
import time
import email, smtplib, ssl
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.... |
AutonomousDriving.py | #Code written by Rhythm Garg
#import libraries
from threading import Thread
from easygopigo3 import *
import time
from picamera.array import PiRGBArray
from picamera import PiCamera
import cv2
from Algorithm1 import algo1GetSlopes
from Algorithm2 import algo2GetSlopes
from Algorithm3 import algo3GetSl... |
map_dataset_op_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... |
agent.py | from __future__ import print_function
from builtins import zip
from builtins import range
from builtins import object
# Copyright 2018 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.... |
run_main.py | # -*- coding: utf-8 -*-
# @Author : xiaoke
# @Email : 976249817@qq.com
import unittest
from util.server import Server
import multiprocessing
from util.write_device_yaml import WriteDeviceYaml
import HtmlTestRunner
from time import sleep
from case import try_login_case
from case import try_splash_case
... |
get_images.py | import requests
import time
from queue import Queue
from threading import Thread
from os import path, remove
from Config.Cameras import IPS
padding = 9
q = Queue()
del_q = Queue()
num_threads = len(IPS)
threads = []
del_threads = []
def convert_ip_to_safe(ip):
return ip.split('/')[-1].replace(':', '-')
def p... |
Ayane.py | import threading
import subprocess
import time
import os
import math
import random
import io
from queue import Queue
from enum import Enum
from enum import IntEnum
from datetime import datetime
import paramiko
from paramiko.client import SSHClient
from typing import Optional, Union, cast
from typing import List, Tuple,... |
ida_gef.py | """
This script is the server-side of the XML-RPC defined for gef for
IDA Pro.
It will spawn a threaded XMLRPC server from your current IDA session
making it possible for gef to interact with IDA.
To run from inside IDA:
- open IDA on your binary and press Alt-F7
- a popup "Run Script" will appear, simply enter the lo... |
vocal_server.py | import socket
import threading
import board_assets as assets
from time import sleep
HOST = "192.168.0.24"
PORT = 6001
class VocalServer(object):
"""
This class represents the server of the Vocal application.
...
Attributes
----------
sock : socket
instance of the Python socket modul... |
test_backend_tk.py | import functools
import inspect
import os
import platform
import re
import subprocess
import sys
import pytest
_test_timeout = 60 # A reasonably safe value for slower architectures.
def _isolated_tk_test(success_count, func=None):
"""
A decorator to run *func* in a subprocess and assert that it prints
... |
interactive.py | import contextlib
import signal
import socket
import sys
import threading
if sys.version_info < (3,):
# Python 2
ConnectionError = OSError
from .transfer import *
def usb_transfer_interactive_shell(transfer, stdin=True, stdout=True, port=5005):
addr = '127.0.0.1'
readyFlag = threading.Event()
t = threading.Thr... |
__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... |
identifyProcess.py | import multiprocessing
import time
def childTask():
print("Child Process With PID: {}".format(multiprocessing.current_process().pid))
time.sleep(3)
print("Child process terminating")
def main():
print("Main process PID: {}".format(multiprocessing.current_process().pid))
myProcess = multiprocessi... |
Network_2_1.py | import argparse
import socket
import threading
from time import sleep
import random
import RDT_2_1 as RDT
## Provides an abstraction for the network layer
class NetworkLayer:
#configuration parameters
prob_pkt_loss = 0
prob_byte_corr = 0
prob_pkt_reorder = 0
#class variables
sock = None
... |
automatizat.py | import twitter
import requests
import base64
from urlextract import URLExtract
import time
import re
import hashlib
from getGithubFiles import getProjectLastCommit, getFileContent
from storageFunctionality import saveFile, createDir, getFile
import threading
#OAUTH_TOKEN = '2ace99f502776f620ddc23fae9cc3b2b42dd3631'
a... |
power_monitoring.py | import random
import threading
import time
from statistics import mean
from cereal import log
from common.realtime import sec_since_boot
from common.params import Params, put_nonblocking
from common.hardware import TICI
from selfdrive.swaglog import cloudlog
PANDA_OUTPUT_VOLTAGE = 5.28
CAR_VOLTAGE_LOW_PASS_K = 0.091 ... |
ella_coverage.py | # Copyright (c) 2016-present, Ke Mao. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditio... |
coincheck.py | from befh.restful_api_socket import RESTfulApiSocket
from befh.exchanges.gateway import ExchangeGateway
from befh.market_data import L2Depth, Trade
from befh.util import Logger
from befh.instrument import Instrument
from befh.clients.sql_template import SqlClientTemplate
from functools import partial
from datetime impo... |
test_treestream.py | import unittest
import logging
import sys
import mock
import six
from six.moves import queue
from uuid import uuid1
from threading import Thread, Event
from time import sleep, time
from treestream import (
MsgpackReaderMixin,
MsgpackWriterMixin,
RedisTreeReader,
RedisTreeWriter,
Tree,
TreeWriterError,
)
_GREEN ... |
tasks.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
from collections import OrderedDict, namedtuple, deque
import errno
import functools
import importlib
import json
import logging
import os
from io import StringIO
from contextlib import redirect_stdout
import shutil
import stat... |
sync.py | import logging
import multiprocessing
import threading
from dataclasses import dataclass
from typing import TypeVar, Generic
from glimmer.processing import Source, Operator, Sink, Environment, Topology, InvalidTopologyError, compose_list
Result = TypeVar("Result")
Out = TypeVar("Out")
@dataclass
class SynchronousTo... |
config.py | # ****************************************************************************
#
# fkie_iop_node_manager
# Copyright 2019 Fraunhofer FKIE
# Author: Alexander Tiderko
#
# 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 ... |
threaded_webcam.py | """
Webcam code taken from PyImageSearch
https://www.pyimagesearch.com/2015/12/21/increasing-webcam-fps-with-python-and-opencv/
"""
from threading import Thread
import cv2
class WebcamVideoStream:
def __init__(self, src=0):
"""
Initialize the video camera stream and read the first frame
f... |
threaded_camera.py | # -*- coding: utf-8 -*
##############################################
# The MIT License (MIT)
# Copyright (c) 2020 Kevin Walchko
# see LICENSE for full details
##############################################
try:
from picamera import PiCamera
import picamera.array
import picamera
except ImportError:
prin... |
MultiportTcpListener.py | #!/usr/bin/python3
import time
import threading
import socketserver
import struct
from StandardMessages import StandardMessages
import code
class MultiportTcpListener:
def __init__(self, portlist, verbose=False):
self.verbose = verbose
self.portlist = portlist
self.start_listeners()
... |
test_agent.py | import asyncio
from asyncio import Event
import pytest
from zentropi import Agent
from zentropi.agent import clean_space_names
from zentropi.agent import select_transport
from zentropi.agent import random_string
from zentropi.transport.base import BaseTransport
from zentropi.transport.datagram import DatagramTransport... |
liara.py | #!/usr/bin/env python3
import argparse
import asyncio
import bz2
import datetime
import logging
import os
import platform
import sys
import threading
import time
import uuid
import discord
from concurrent.futures import TimeoutError, ThreadPoolExecutor
from hashlib import sha256
import dill
import aredis
from discord... |
snake2.py | import math
import random
import pygame
import tkinter as tk
from tkinter import messagebox
import socket
import threading
import queue
# essa strng vai servir para adicionar os caracteres da direção(e, d, c, b)
receber_direcoes = ""
class cube(object):
rows = 20
w = 500
def __init__(self, start, dirnx=... |
session_test.py | # Copyright 2015 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_indexes.py | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
import time
from threading import Thread
from django.test import TestCase
from django.utils.six.moves import queue
from test_haystack.core.models import AFifthMockModel, AThirdMockModel, MockModel
fr... |
debug.py | import code
import gc
import logging
import os
import signal
import socket
import threading
import traceback
import tracemalloc
from types import FrameType
from django.conf import settings
from django.utils.timezone import now as timezone_now
from typing import Optional
logger = logging.getLogger('zulip.debug')
# In... |
util.py | """Test utilities."""
import logging
from multiprocessing import Event
from multiprocessing import Process
import shutil
import sys
import tempfile
import unittest
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import josepy as jose
try:
import moc... |
__init__.py | # -*- coding: utf-8 -*-
from crawler_manager.setting import Config
import requests, time, threading
config = Config()
# UpdateTimeIntervalApi调用更改当前配置
def change_update_callback(*args, **kwargs):
global config
if kwargs.get('jisuanke'):
config.JISUANKE_UPDATE_INTERVAL = kwargs.get('jisuanke')
if ... |
poke_env_original_copg.py | # -*- coding: utf-8 -*-
import asyncio
import numpy as np
from poke_env.player.random_player import RandomPlayer
from tabulate import tabulate
from threading import Thread
from poke_env.utils import to_id_str
from poke_env.player.env_player import (
Gen8EnvSinglePlayer,
)
from poke_env.player.utils import cross_ev... |
test_system.py | # Copyright 2016 Google LLC 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 ag... |
test_get_collection_info.py | import pdb
import pytest
import logging
import itertools
from time import sleep
import threading
from multiprocessing import Process
from utils import *
collection_id = "info"
default_fields = gen_default_fields()
segment_row_count = 5000
class TestInfoBase:
@pytest.fixture(
scope="function",
p... |
__init__.py | # Copyright 2017-2021 typed_python Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
nom_workflow.py | import warnings
warnings.filterwarnings("ignore")
import sys
sys.path.append("./")
from pathlib import Path
import cProfile
import json
import pstats
from multiprocessing import Pool, Process
from pandas import DataFrame
from matplotlib import pyplot as plt
from corems.mass_spectrum.calc.Calibration import MzDom... |
server.py | from socket import *
import threading
import time
import sys
import logging
clients = {}
def send(sock, data):
try:
sock.send(data.encode('utf-8'))
except error as e:
logging.error(e)
def comm(sock1, sock2): # Relay message from sock1 to sock2
while True:
data = sock1.recv(2048... |
communication.py | '''
This module implements the communication between
- the topology view and the monitoring backend that feeds it
- the log view and NOX's logger
- the json command prompt and NOX's json messenger
@author Kyriakos Zarifis
'''
from twisted.internet import reactor
from PyQt4 import QtGui, QtCore
import So... |
ledclock.py | #!/usr/bin/python3
""" LED 7 segment clock class """
# MIT License
#
# Copyright (c) 2019 Dave Wilson
#
# 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 withou... |
Run_single_instance_on_cloud.py | #!/usr/bin/env python
import boto3
import paramiko
import sys
import time
import threading
ec2_client = boto3.client('ec2')
response_123 = ec2_client.describe_instances()
ImageId = ""
InstanceType =""
group_id = ""
KeyName =""
for r in response_123["Reservations"]:
for instance in r["Instances"]:
if(in... |
miscellaneous.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: miscellaneous.py
#
# Copyright 2021 Vincent Schouten
#
# 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 w... |
sound_service.py | #
# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright (c) 2016-2021, Olivier Martin <olivier@labapart.org>
#
import time
import threading
import wave
from gattlib import uuid
from dbus.mainloop.glib import DBusGMainLoop
try:
from gi.repository import GLib, GObject
except ImportError:
import gobject as GObject
... |
test_add_vectors.py | import time
import threading
import logging
import threading
from multiprocessing import Pool, Process
import pytest
from milvus import IndexType, MetricType
from utils import *
dim = 128
index_file_size = 10
collection_id = "test_add"
ADD_TIMEOUT = 60
tag = "1970-01-01"
add_interval_time = 1.5
nb = 6000
class Test... |
add_server_nbu.py | import logging
import os
import os.path
import platform
import subprocess
import threading
from math import ceil
from optparse import OptionParser
from sys import exit, stdout
FORMAT = 'thread %(thread)d: %(message)s '
is_win = True if platform.system() == 'Windows' else False
bin_admin_path = r'C:\Program Files\Verit... |
mod_math_eval.py | # -*- coding: utf-8 -*-
"""
Maths and Evaluations Module (/calc)
Created on Sun Sep 1 15:22:04 2019
@author: eliphat
"""
import numpy
import scipy.integrate as iint
import sympy
import random
import tg_connection
import multiprocessing as mp
import queue
def env_func(nump_f, symp_f):
def _func(x):
if is... |
TensorboardView.py | from helper_functions import launchTensorBoard
import threading
t = threading.Thread(target=launchTensorBoard('Auswertung/BirdSoundPrediction/20211223-093239'), args=([]))
t.start() |
ndjson_reader.py | #!/usr/bin/env python3
import sys
import multiprocessing as mp
import ujson as json
def process_chunk(q):
while True:
chunk = q.get()
if chunk is None or len(chunk) == 0:
return
objs = chunk.split(b'\n')
for obj in objs:
j = json.loads(obj)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.