source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
session_test.py | # Copyright 2015 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... |
util.py | import os
import re
import shutil
import sys
import ctypes
from pathlib import Path
from colorama import Fore, Back, Style
from .settings import *
if sys.version_info[0] < 3 or sys.version_info[1] <= 5:
raise RuntimeError(
"\nPlease restart with Python 3.6+\n" + "Current Python version:",
sys.versi... |
ensembler.py | #!/usr/bin/env python3.6
# Copyright (c) 2019 Trail of Bits, 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 app... |
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... |
mupen64plus_env.py | from http.server import BaseHTTPRequestHandler, HTTPServer
#from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import abc
import array
import inspect
import json
import os
import subprocess
import threading
import time
from termcolor import cprint
import yaml
import gym
from gym import error, spaces, utils... |
managers.py | __all__ = ['BaseManager', 'SyncManager', 'BaseProxy', 'Token']
import sys
import threading
import array
import queue
from time import time as _time
from traceback import format_exc
from . import connection
from .context import reduction, get_spawning_popen
from . import pool
from . import process
from . import util
fro... |
recorder.py | from __future__ import annotations
import os
import time
import threading
import typing as t
import picamera
from pisat.handler import DigitalInputHandlerBase
from pisat.util.about_time import get_time_stamp
from .utils import IterSingleton
_INF = float("inf")
class _GPIOPins(IterSingleton[int]):
GPIO00 = 0
... |
progress_bar.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Package Docs."""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import sys
import threading
import time
class ProgressBar:
"""."""
def __init__(self):
... |
kivy_ui.py | import json
import re
import time
from copy import copy
from datetime import datetime
from functools import partial
import subprocess
from subprocess import Popen, PIPE
from threading import Thread
from collections import namedtuple
from kivy.logger import Logger
import io
import os
import atexit
import yaml
from PIL i... |
test_partition_20.py | import threading
import pytest
from base.partition_wrapper import ApiPartitionWrapper
from base.client_base import TestcaseBase
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from common.code_mapping import PartitionErrorMessage
prefix = ... |
FlowFeatures.py | # coding: utf8
'''
__author__: helloriku
__time__: 2020/7/6
'''
import argparse
import threading
import multiprocessing
import time
import json
import signal
from scapy.all import *
# from scapy.utils import PcapReader
# TCP或UDP流
class tcp_udp_stream:
def __init__(self):
self.id = {} # 四元组
... |
iap_tunnel_websocket.py | # -*- coding: utf-8 -*- #
# Copyright 2018 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 requir... |
audio_player.py | import pygame
import time
import threading
import multiprocessing
import operator
audioChannels = 0
class AudioPlayer(threading.Thread):
def __init__(self, startAddress, playlist, ArtNetReceiver, systemCommunication):
threading.Thread.__init__(self)
global audioChannels
audioChannels += 1
self.addr = star... |
service_utils.py | #!/usr/bin/env python3
# Copyright 2021 Google 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... |
test_server.py | import os
import time
import tempfile
import uuid
from multiprocessing import Process, Manager
from typing import List, Text, Type
from contextlib import ExitStack
from aioresponses import aioresponses
import pytest
from freezegun import freeze_time
from mock import MagicMock
import rasa
import rasa.constants
from r... |
Flight Reservation.py | # A simple program to explain threading.
from threading import *
from time import sleep
class flightReservation:
def __init__(self,ticket_left):
self.ticket_left = ticket_left
def buy(self,ticketRequest):
if(self.ticket_left>=ticketRequest):
print("Your tickets are confirmed")
... |
main.py | from flask import Flask, send_from_directory
from flask_cors import CORS
from flask_restful import Resource, Api, reqparse, abort
from config import debug
from db import currencies, trade_currencies, trades, eth_trades, engine
from utils import *
from contract_helper import getAddressFromPuzzleHash, getContractProgram,... |
import_dir.py | import sys
sys.path.append('/app/')
import os
import argparse
import progressbar
import threading
import json
import urllib3
import requests
import queue
import time
from util import allowed_file, str2bool, batch_inference, load_image
from urllib.parse import quote
urllib3.disable_warnings()
es_index = "es-retrieval... |
coref_model.py | import operator
import random
import math
import json
import threading
import numpy as np
import tensorflow as tf
import util
import coref_ops
import conll
import metrics
class CorefModel(object):
def __init__(self, config):
self.config = config
self.embedding_info = [(emb["size"], emb["lowercase"]) for emb... |
test_advanced.py | # coding: utf-8
from concurrent.futures import ThreadPoolExecutor
import json
import logging
import random
import sys
import threading
import time
import os
import numpy as np
import pytest
import ray.cluster_utils
import ray._private.profiling as profiling
from ray._private.gcs_utils import use_gcs_for_bootstrap
fr... |
run.py | #! /usr/bin/env python3
#
# Copyright (C) 2017-2020 Open Information Security Foundation
#
# 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 ... |
image_introspect.py | """introspect an image"""
import json
import re
import subprocess
import sys
import multiprocessing
from types import SimpleNamespace
from typing import Any
from typing import Callable, List
from typing import Dict
from typing import Union
from queue import Queue
# pylint: disable=broad-except
PROCESSES = (multiproc... |
camera.py | #!/usr/bin/env python3
"""
MIT License
Copyright (c) 2021 Marcin Sielski <marcin.sielski@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 limitat... |
solariot.py | #!/usr/bin/env python
# Copyright (c) 2017 Dennis Mellican
#
# 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, modi... |
main.py | import cv2
from enum import Enum
import logging
import threading
import time
import copy
import numpy
from pattern_type import PatternType
from pattern_finder import PatternFinder
from camera_calibrator import CameraCalibrator
from drawing_helpers import draw_vertical_line, draw_corners, draw_grid
from coordinate_map... |
SharedMemoryRunner.py | # Copyright 2017 Battelle Energy Alliance, 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 t... |
activethreadcount.py | from threading import *
import time
def display():
print(current_thread().name,'...started')
time.sleep(3)
print(current_thread().name,'...ended')
print('The number of active Threads:',active_count())
t1=Thread(target=display,name='ChildThread-1')
t2=Thread(target=display,name='ChildThread-2')
t3=Thread(target=dis... |
profiler_test.py | # Copyright 2020 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, ... |
wmdlogicmt.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
import os
import logging
import requests
import json
from stop_words import get_stop_words
import nltk.data
from nltk.tokenize import RegexpTokenizer
import gensim
import shutil
import codecs
from gens... |
test_executors.py | import multiprocessing
import sys
import threading
import time
from datetime import timedelta
from unittest.mock import MagicMock
import pytest
import prefect
from prefect.utilities.executors import Heartbeat, timeout_handler
def test_heartbeat_calls_function_on_interval():
class A:
def __init__(self):
... |
radiation_measurement.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 7 11:33:50 2019
@author: callie_macbookair
NOTE: You MUST have a sleep time in between starting the digitizer and starting fifo. The digitizer needs time start up and fifo will time out if you
do not wait. I suggest something like 5-7 s... |
create_range_image_in_kitti.py | #keep full resolution range image
import numpy as np
import pickle as pkl
from pdb import set_trace
import os
from kitti_utils import Calibration
from pathlib import Path
import matplotlib.pyplot as plt
import tqdm
import collections
import argparse
from queue import Queue
from threading import Thread
def parse_args(... |
midi_hub.py | # Copyright 2020 The Magenta 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 or agreed to in ... |
undertaker.py | # Copyright 2013-2018 CERN for the benefit of the ATLAS collaboration.
#
# 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... |
main.py | #! /usr/bin/env python3
import argparse
import threading
import logging
from datetime import datetime
from scapy.all import sniff, Ether, IP
from .database import create_tables, Entity, create_session, drop_tables
from queue import Queue
packet_queue = Queue()
def on_packet(p):
if Ether not in p or IP not in p:
... |
wait_storage.py | #
# Copyright 2018 PyWren Team
# Copyright IBM Corp. 2020
#
# 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 ... |
main.py | # -*- mode: python -*-
import sys
sys.setrecursionlimit(5000)
block_cipher = None
import pyautogui
import keyboard
import asyncio
import tkinter as tk
from tkinter import ttk
from tkinter import *
import threading
import multiprocessing
import time
import os
import psutil
global iteration
iteration = 0
def checkIf... |
test_enum.py | import enum
import inspect
import pydoc
import sys
import unittest
import threading
from collections import OrderedDict
from enum import Enum, IntEnum, EnumMeta, Flag, IntFlag, unique, auto
from io import StringIO
from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL
from test.support import ALWAYS_EQ, check... |
util.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 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 limitation the rights t... |
test_signal.py | import errno
import os
import random
import signal
import socket
import statistics
import subprocess
import sys
import time
import unittest
from test import support
from test.support.script_helper import assert_python_ok, spawn_python
try:
import _testcapi
except ImportError:
_testcapi = None
class GenericTes... |
predict.py | # Arda Mavi
from keras.models import Sequential
from keras.models import model_from_json
import cv2
import sys
from get_dataset import get_img
import numpy as np
from scipy.misc import imresize
import time
from threading import Thread
class Predict:
def __init__(self):
pass
def predict(self, model, X... |
log.py | import functools
import logging
import multiprocessing
import sys
import threading
import time
import traceback
from typing import Callable, List
from termcolor import colored
from .multiproc import get_worker_id
from .types import PathType
__all__ = [
"get_logging_levels",
"set_log_file",
"log",
"se... |
example_userdata_stream.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_userdata_stream.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api
# Documentation: https://lucit-systems-and-development.github.io/unicorn-binance-websocket-api... |
trophies_screen.py | from threading import Thread
from kivymd.uix.screen import MDScreen
from logic.score import get_score_history
from logic.trophies.trophies_checker import check_trophies
from uix.base_components.kmodal_view import KModalView
from uix.components.trophy_content import TrophyContent
from kivy.properties import BooleanProp... |
RaccoonBasics.py | #
# AutoDock | Raccoon2
#
# Copyright 2013, Stefano Forli
# Molecular Graphics Lab
#
# The Scripps Research Institute
# _
# (,) T h e
# _/
# (.) S c r i p p s
# \_
# (,) R e s e a r c h
# ./
# ( ) I ... |
tests.py | # Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
import copy
import io
import os
import pickle
import re
import shutil
import tempfile
import threading
import time
import unittest
from pathlib import Path
from unittest import mock
from django.conf import settings
from dj... |
LLRPConnector.py | #!/usr/bin/env python
#------------------------------------------------------
# Copyright (C) 2013-2019 Edward Sitarski
#
# 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
# restrictio... |
run_service.py | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Functions for starting the service
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
from __future__ import absolute_import, division, unicode_literals
import threading
# Global cache must... |
deepracer_memory.py | from threading import Thread, Event, Lock
import pickle
import queue
import logging
import redis
from rl_coach.memories.backend.memory import MemoryBackend
from rl_coach.core_types import Episode
from markov.utils import Logger
LOG = Logger(__name__, logging.INFO).get_logger()
# Channel used by the training worker ... |
snake.py | import threading, queue, os, copy, time, random, sys, readchar
#Board's size
height = 50
width = 25
#queue to manage threads
inputQueue = queue.Queue()
#
class Point(object):
def __init__(self,x,y):
self.x = x
self.y = y
def plusCoordinate(self,coor):
self.x += coor.x
self.y ... |
camera.py | import configparser
import logging
import math
import os
import pathlib
import threading
import time
import glob
from contextlib import contextmanager
from functools import wraps
from io import BytesIO
from pathlib import Path
from queue import Queue
from typing import List
import cv2
from PIL import Image, _webp
from... |
test.py | # -*- coding: utf-8 -*-
import redis
import unittest
from hotels import hotels
import random
import time
from RLTest import Env
from includes import *
from common import getConnectionByEnv, waitForIndex, toSortedFlatList, assertInfoField, check_server_version, check_module_version
# this tests is not longer relevant
... |
test_processfamily.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import range
from builtins import *
from future.utils import ... |
Server.py | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
from pymouse import PyMouse
from pykeyboard import PyKeyboard
import socket
import time
import os
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import pygame
import pyscreenshot as ImageGrab
import sys
import select
import threading
from tkinter import *
from tkinte... |
run_on_bots.py | #!/usr/bin/env python
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Automated maintenance tool to run a script on bots.
To use this script, write a self-contained python script (use a .zip... |
hub.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import copy
import os
import select
import socket
import threading
import time
import uuid
import warnings
from ..extern.six.moves import queue,... |
utils.py | # Copyright 2012-present MongoDB, 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 wri... |
conn_qpid.py | #coding:utf-8
__author__=u'sam '
"""
conn_qpid.py
2017/07/07 sam
1. 消息接收处理增加异常保护,防止异常抛出导致接收终止
消息处理之后进行确认,保证消息不丢失,异常产生重新接收
"""
from threading import Condition
from threading import Lock
from threading import Thread
import traceback
import gevent
from qpid.messaging import Connection
from qpid.messaging imp... |
crawlers.py | import requests
import random
import chardet
import os
from time import sleep
from queue import Queue
from threading import Thread, Lock
from .bloom_filter import BloomFilter
from .parsers import BaseParser
class BaseCrawler(object):
def __init__(self, headers=None):
self.new_session()
self.heade... |
mdrepo.py | """
This is the implementation of the active repository of SAML metadata. The 'local' and 'remote' pipes operate on this.
"""
from StringIO import StringIO
from datetime import datetime
import hashlib
import urllib
from UserDict import DictMixin, UserDict
from lxml import etree
from lxml.builder import ElementMaker
f... |
server_interm_layer.py | import socket
import sys
import lib.ProtocolUtils as protocolUtils
import threading as thread
def switch_operations(operation):
switcher = {
"+": ["localhost", 9991],
"-": ["localhost", 9992],
"*": ["localhost", 9993],
"/": ["localhost", 9994],
"^": ["localhost", 9995],
... |
joy_detection_demo.py | #!/usr/bin/env python3
# Copyright 2017 Google 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... |
remote_lock.py | import os
import logging
import urllib
import socket
import time
import threading
class RemoteLock(object):
def __init__(self, end_point=''):
self.log = logging.getLogger("lock")
self.end_point = end_point
def require(self, lock_name='', owner='', timeout=60 * 1000):
data = self._rpc_c... |
plotting.py | """PyVista plotting module."""
import collections.abc
import ctypes
from functools import wraps
import io
import logging
import os
import pathlib
import platform
import textwrap
from threading import Thread
import time
from typing import Dict
import warnings
import weakref
import numpy as np
import scooby
import pyvi... |
base_build.py | from django.core.management.base import BaseCommand, CommandError
from django.core.management import call_command
from django.conf import settings
from django.db import connection
import datetime
import logging
from multiprocessing import Queue, Process
class Command(BaseCommand):
help = 'Basic functions for bui... |
test_multiprocessing.py | #!/usr/bin/env python
#
# Unit tests for the multiprocessing package
#
import unittest
import threading
import Queue
import time
import sys
import os
import gc
import signal
import array
import copy
import socket
import random
import logging
from StringIO import StringIO
from test import test_supp... |
threadModuleAPI.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# *****************************************************************************/
# * Authors: Joseph Tarango
# *****************************************************************************/
# @package threadModuleAPI
import optparse, datetime, traceback, pprint, os, thre... |
netcdf.py | #!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test NetCDF driver support.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
#############################################################... |
road_speed_limiter.py | import json
import os
import select
import threading
import time
import socket
import fcntl
import struct
from threading import Thread
from cereal import messaging
from common.params import Params
from common.numpy_fast import clip, mean
from common.realtime import sec_since_boot
from selfdrive.config import Conversion... |
ominibot_car_com.py | #!/usr/bin/env python
# coding=UTF-8
# Copyright (c) 2020, iCShop, Inc.
# All rights reserved.
#
# Developer: Lin Wei-Chih, kjoelovelife@gmail.com, on 2020-12-22
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# *... |
async_pool_executor.py | import atexit
import os
import asyncio
import time
import traceback
from threading import Thread, Event
import nb_log # noqa
from function_scheduling_distributed_framework.utils.develop_log import develop_logger # noqa
if os.name == 'posix':
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy... |
ultimate.py | # -*- coding: utf-8 -*-
import schedule
import time
import sys
import os
import random
import glob # ->added to make pics upload -> see job8
import threading # ->added to make multithreadening possible -> see fn run_threaded
sys.path.append(os.path.join(sys.path[0], '../../'))
from instabot import B... |
preprocess.py | import numpy as np
from random import shuffle
import os
import scipy.io as io
from sklearn.preprocessing import OneHotEncoder
import argparse
from helper import *
import threading
import time
import itertools
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--data', type=str, default='Indian_pines')
... |
manager.py | #!/usr/bin/env python3.7
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
import textwrap
from selfdrive.swaglog import cloudlog, add_logentries_handler
from common.basedir import BASEDIR, PARAMS
from common.android import ANDROID
WEBCAM = os.gete... |
utils.py | # -*- coding: utf-8 -*-
# Copyright 2020 the HERA Project
# Licensed under the MIT License
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
import matplotlib.patches as mpatches
import matplotlib.gridspec as gridspec
import numpy as np
from pyuvdata import UVCal, UVDat... |
example18_iot_chime_nn.py | #!/usr/bin/env python3
# coding: utf-8
# Example 18 IoT チャイム WSGI 版 【複数種のチャイム音対応版】
port = 4 # GPIO ポート番号
ping_f = 554 # チャイム音の周波数1
pong_f = 440 # チャイム音の周波数2
pingAlt_f = 587 # 警告音... |
test_utility.py | import threading
import pytest
from base.client_base import TestcaseBase
from base.utility_wrapper import ApiUtilityWrapper
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
prefix = "utility"
defau... |
kb_uploadmethodsServer.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... |
__init__.py | """
.. moduleauthor:: Fabio Manganiello <blacklight86@gmail.com>
"""
import os
import queue
import stat
import tempfile
import time
from enum import Enum
from threading import Thread, Event, RLock
from .core import Sound, Mix
from platypush.context import get_bus
from platypush.message.event.sound import \
Soun... |
mpl_process.py | import multiprocessing as mp
import signal
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from time import time, sleep
import sys
import queue
class PlotProcess:
def __init__(self, fig_updater, interval=10):
self._queue = mp.Queue()
self._exit_event = mp.Event()
... |
FilesManagement.py | import os
import shutil
import re
import win32api
import threading
import zipfile
def move_file(origen,destino):
'''Mueve el archivo de la ruta de orgen a la ruta de destino, verifica que la extension del archivo sea la misma'''
if file_type(origen) != "dir" and file_type(origen) != file_type(destino):
... |
dark_reaper.py | # Copyright 2016-2018 CERN for the benefit of the ATLAS collaboration.
#
# 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... |
Frontend.py | import threading
from time import sleep
from mopidy import core
from MainScreen import MainScreen
from InputManager import InputManager
from DisplayObject import DisplayObject
import pykka
class FrontendAdafruitCharLCDPlate(pykka.ThreadingActor, core.CoreListener):
def __init__(self, config, core):
s... |
gui.py | from tkinter import *
from ycore.application import *
from ycore.module.core import *
from ycore.network.network import *
from ycore.network.util import *
from ycore.builder import *
from ycore.client import *
from anagramscore import *
import threading
import json
# Current GUI design is quick and dirty.... |
echo_server.py | import socket
import ipaddress
import sys
import select
import threading
import queue
import time
import os
from threading import Thread
#initiliaze IP, port and name
SIZE = 1024
PORT = int(sys.argv[1])
NAME = sys.argv[2]
COUNT = 0
ip = socket.gethostbyname(socket.gethostname())
HOST = ip
openserve... |
ib_api.py | '''
This script will access the IB API and download the option chain for given
securities
'''
from threading import Thread
from Queue import Queue
from ib.opt import ibConnection
from ib.ext.Contract import Contract
from time import sleep
import pandas as pd
import logging
import traceback # TODO debugging purposes on... |
__init__.py | import copy
import threading
import typing
StateType = typing.TypeVar('StateType')
class TimedThread(typing.Generic[StateType]):
"""
This is a "Thread" class that runs a job for a maximum period of time. The class provides concurrency-safe methods
to retrieve and persist a chunk of state.
"""
d... |
Create_ionisaton_fcoll_tables.py | import numpy
import math
from scipy import interpolate
from decimal import *
import string
import pickle
import os
import multiprocessing
from array import array
# These are values set in ANAL_PARAMS.H and HEAT_PARAMS.H. Note: These must be changed by hand if any values in the .H files are changed
Z_HEAT_MAX = 35.
ZPR... |
test_node.py | import os
import sys
import logging
import requests
import time
import traceback
import random
import pytest
import ray
import threading
from datetime import datetime, timedelta
from ray.cluster_utils import Cluster
from ray.new_dashboard.tests.conftest import * # noqa
from ray.test_utils import (format_web_url, wait_... |
message_server.py | # Copyright 2017 Google Inc. All rights reserved.
# Use of this source code is governed by the Apache 2.0 license that can be
# found in the LICENSE file.
import Queue
import logging
import threading
import time
import tornado.ioloop
import tornado.web
MESSAGE_SERVER = None
BLANK_PAGE = """<html>
<head>
<title>Blank<... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return '<meta http-equiv="refresh" content="0; URL=https://phantomcodes.ga/support"/>'
def run():
app.run(host="0.0.0.0", port=8080)
def keep_alive():
server = Thread(target=run)
server.start()
|
async_version.py | import threading
import colorama
from services import get_weather
def main():
print(colorama.Fore.GREEN +
"------------------------------------------\n"
"| App created by alexfrunza |\n"
"| Welcome to weather app (async version) |\n"
"| Enter a city name to get... |
iftop.py | #!/usr/bin/python
from time import sleep, time
from threading import Thread
from subprocess import call, Popen
from deepstream import post
import subprocess, re
print("Loading: iftop")
recordName = "speed"
interface = "eth0"
# Number in seconds to switch to autonomous/manual Mode
elapsedTimout = 16
obj = {}
success ... |
test_process.py | # -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import io
import os
import sys
import threading
import time
import signal
import multiprocessing
import functools
import datetime
import warnings
# Import Salt Testing libs
from tests.support.unit imp... |
multi-proc1.py | # reference : https://python.flowdas.com/library/multiprocessing.html
from multiprocessing import current_process, Process, Value, Array
double_value = 0
num_array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
def f(n, a):
global double_value
global num_array
double_value = 3.1415927
num_array = [0, -1, -2, -3, -... |
dispatch.py | # Copyright 2017, Inderpreet Singh, All rights reserved.
from enum import Enum
from typing import List
import queue
import logging
import os
import threading
import time
from abc import ABC, abstractmethod
import re
from .extract import Extract, ExtractError
from model import ModelFile
from common import AppError
c... |
old_heft_scheduler.py | import sys
import os
sys.path.append(os.getcwd())
import pyschedcl as fw
import logging
import argparse
import json
#import sys
import time
import datetime
#import plotly.plotly as py
from os import listdir
from os.path import isfile, join
import matplotlib.pyplot as plt
import networkx as nx
import csv
import random
i... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
__init__.py | from __future__ import print_function
import argparse
import itertools
import os
import random
import re
import shlex
import string
import sys
import traceback
import warnings
from collections import OrderedDict
from fnmatch import fnmatchcase
from subprocess import list2cmdline
from threading import Thread
import im... |
consumers.py | # chat/consumers.py
from channels.generic.websocket import AsyncWebsocketConsumer, WebsocketConsumer
import json
from dl.FaceEngine import FaceEngine
import asyncio
import time
from threading import Thread
import cv2
import redis
from django.conf import settings
from Share import helper
class AsyncImageConsumer(Async... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.