source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
bot.py | import threading
import time
import random
import sys
from freggersbot import FreggersBot, Event, log_error, get_local_datetime
from freggersbot.utils import format_time
START_DELAY = (4, 25)
start_time = time.time()
from freggersbot.iso import Status
class BasicFreggersBot(FreggersBot):
def __init__(self, user... |
common.py | """Test the helper method for writing tests."""
import asyncio
from collections import OrderedDict
from datetime import timedelta
import functools as ft
import json
import os
import sys
from unittest.mock import patch, MagicMock, Mock
from io import StringIO
import logging
import threading
from contextlib import contex... |
mnist_distributed.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_sigma_dut.py | # Test cases for sigma_dut
# Copyright (c) 2017, Qualcomm Atheros, Inc.
# Copyright (c) 2018-2019, The Linux Foundation
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import binascii
import hashlib
import logging
logger = logging.getLogger()
import os
import soc... |
faber.py | import subprocess
import threading
import time
import requests
import json
import sys
import logging
from flask import Flask, request
def print_menu(): ## Your menu design here
print(30 * "-" , "MENU CATALYST SCHOOL" , 30 * "-")
print("1. Create sidetree-cardano did:ada")
print("2. Resolve DID")
... |
traffic_server.py | #!/usr/bin/env python3
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BAS... |
basic.py | # Original work Copyright 2017 Palantir Technologies, Inc. (MIT)
# See ThirdPartyNotices.txt in the project root for license information.
# All modifications Copyright (c) Robocorp Technologies Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file exc... |
process.py | import youtube_dl
import os
import threading
import logging
import json
logger = logging.getLogger("RaspberryCast")
volume = 0
def launchvideo(url, config, sub=False):
setState("2")
os.system("echo -n q > /tmp/cmd &") # Kill previous instance of OMX
if config["new_log"]:
os.system("sudo fbi -T ... |
exo1.py | #!/usr/bin/env python3
"""
An exemple of shared memory between processes
"""
from multiprocessing import Process, Manager
from sys import argv
def fib(number, fib_list):
"""
Returns the #num fibonacci number using recursion
:param number: current number
:param fib_list: pointer to shared list of fib... |
train_abstractive.py | #!/usr/bin/env python
"""
Main training workflow
"""
from __future__ import division
import argparse
import glob
import os
import pickle
import signal
import time
import sentencepiece
from abstractive.model_builder import Summarizer
from abstractive.trainer_builder import build_trainer
from abstractive.predictor... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test cnsd shutdown."""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.u... |
core_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... |
grass2owl.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: houzhiwei
# time: 2019/1/7 22:25
from owlready2 import *
import json
import re
from JSON2OWL.OwlConvert.OwlUtils import OWLUtils
from JSON2OWL.OwlConvert.Preprocessor import Preprocessor
# import sys
# sys.setrecursionlimit(1000000)
module_uri = 'http://www.egc.... |
test_sys.py | # -*- coding: iso-8859-1 -*-
import unittest, test.test_support
import sys, os, cStringIO
import struct
import operator
class SysModuleTest(unittest.TestCase):
def tearDown(self):
test.test_support.reap_children()
def test_original_displayhook(self):
import __builtin__
sa... |
threads.py | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import difflib
import threading
import time
import traceback
from thread import error as threadError
from lib.core.data import conf
from lib.core.data import kb
from lib.cor... |
clusterScalerTest.py | # Copyright (C) 2015-2016 Regents of the University of California
#
# 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... |
dask.py | # pylint: disable=too-many-arguments, too-many-locals, no-name-in-module
# pylint: disable=missing-class-docstring, invalid-name
# pylint: disable=too-many-lines, fixme
# pylint: disable=too-few-public-methods
# pylint: disable=import-error
"""Dask extensions for distributed training. See
https://xgboost.readthedocs.io... |
Binance_Detect_Mooningsv2.py | """
jthhk/Binance-volatility-trading-bot (forked from Olorin Sledge Fork)
Version: 0.5
Disclaimer
All investment strategies and investments involve risk of loss.
Nothing contained in this program, scripts, code or repositoy should be
construed as investment advice.Any reference to an investment's past or
potential pe... |
camera_utils.py | '''
Util to stream camera data. Modified so that it uses memory instead of hard disk (better performance.)
Author: Yilun "Allen" Chen
Credit: https://github.com/Mjrovai/Video-Streaming-with-Flask/blob/master/camWebServer/camera_pi.py
'''
import time
import io
import threading
import picamera
class Camera(object):... |
ServiceActionInterface.py | #!/usr/bin/env python
import rospy
import importlib
import threading
from BaseActionInterface import BaseActionInterface
from rosplan_dispatch_msgs.msg import ActionFeedback
class ServiceActionInterface(BaseActionInterface):
def __init__(self, action_config):
BaseActionInterface.__init__(self, action_con... |
test_local_task_job.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
processer.py | from queue import Queue as TQueue
from threading import Thread
from .settings import Settings as ST
import requests
import time
from .krequest import *
from .shedule import Schedule
class Processer():
def __init__(
self,
spider,
ST=ST,
req_t_num=8,
rep_t_... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement
import os
import re
import sys
import copy
import time
import types
import signal
import random
import fnmatch
import logging
import threading
import traceback
import c... |
testParallel.py | from multiprocessing import Process
import os
import time
# git remote set-url origin https://mgrecu35@github.com/mgrecu35/cmbv7.git
def info(title):
print(title)
print('module name:', __name__)
print('parent process:', os.getppid())
print('process id:', os.getpid())
def fsh(fname):
cmb1=fname... |
parallelized_gym.py | """
Code to parallelize gym environments obtained from
https://github.com/openai/baselines/blob/b5be53dc928bc19c39bce2a3f8a4e7dd0374f1dd/baselines/common/vec_env/subproc_vec_env.py
It has been modified to deal with PyTorch Tensors and Variables.
"""
import logging
try:
import roboschool
except ImportError as e:
... |
__init__.py | # Copyright (c) 2014 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test harness for testing chrome apps / extensions."""
import cStringIO
import contextlib
import hashlib
import logging
import optparse
import os... |
imdb.py | from __future__ import annotations
import argparse
import csv
import json
import pprint
import re
import sqlite3
import sys
import threading
import typing
from collections import defaultdict
from pathlib import Path
import attr
import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
IMDB_BASICS_TSV = Pat... |
adc_worker.py | import time
import json
import busio
import board
import redis
import digitalio
import threading
import importlib
import adafruit_mcp3xxx.mcp3008 as MCP
from adafruit_mcp3xxx.analog_in import AnalogIn
from mudpi.logger.Logger import Logger, LOG_LEVEL
class ADCMCP3008Worker:
"""
Analog-Digital-Converter Worke... |
Lock.py | #########################
# Lock同步
#########################
from threading import Thread, Lock
g_num = 0
def test1():
global g_num
for i in range(1000000):
# True表示堵塞 即如果这个锁在上锁之前已经被上锁了,那么这个线程会在这里一直等待到解锁为止
# False表示非堵塞,即不管本次调用能够成功上锁,都不会卡在这,而是继续执行下面的代码
mutexFlag = mutex.acquire(True)... |
camera_add.py | import cv2
import cv2
from align_custom import AlignCustom
from face_feature import FaceFeature
from mtcnn_detect import MTCNNDetect
from tf_graph import FaceRecGraph
import openpyxl as xl
import datetime
import time
import sys
import json
import numpy as np
import pandas as pd
from threading import Thread
class Video... |
analyzers.py | # Copyright 2017 Cristian Mattarei
#
# Licensed under the modified BSD (3-clause BSD) License.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the ... |
_image_feature_extractor.py | # -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from __future__ import print_function as _
from __future__ import division as _
from... |
prometheus.py | """
prometheus.py
A simple python script that pulls data from Prometheus's API, and
stores it in a Deephaven table.
This is expected to be run within Deephaven's application mode https://deephaven.io/core/docs/how-to-guides/app-mode/.
After launching, there will be 2 tables within the "Panels" section of the Deephav... |
camera_processor.py | #! /usr/bin/env python3
# Copyright(c) 2017 Intel Corporation.
# License: MIT See LICENSE file in root directory.
# NPS
# pulls images from camera device and places them in a Queue
# if the queue is full will start to skip camera frames.
import cv2
import queue
import threading
import time
class camera_processor:
... |
command_daemon.py | #!/usr/bin/env python
# Copyright 2016 Criteo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use self 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_logging.py | # Copyright 2001-2014 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
util.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... |
app.py | #!/usr/bin/env python
from flask import Flask, render_template, Response
import cv2
import queue
import threading
import time
QUEUE_CAMERA = queue.Queue(maxsize=10)
app = Flask(__name__)
@app.route('/')
def index():
return Response(get_frame(), mimetype='multipart/x-mixed-replace; boundary=frame')
def get_fra... |
TickerLED.py | from samplebase import SampleBase
from rgbmatrix import graphics
import time
import dataAPI
import datetime
import multiprocessing
from threading import Thread
class RunText(SampleBase):
def __init__(self, *args, **kwargs):
super(RunText, self).__init__(*args, **kwargs)
self.parser.add_argument("... |
gtagsExpl.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import vim
import re
import os
import os.path
import shutil
import itertools
import subprocess
from .utils import *
from .explorer import *
from .manager import *
if sys.version_info >= (3, 0):
import queue as Queue
else:
import Queue
#***************************... |
multiprocess_detect_actions.py | import numpy as np
import cv2
import imageio
#import tensorflow as tf
import json
import os
import sys
import argparse
import object_detection.object_detector as obj
import action_detection.action_detector as act
from multiprocessing import Process, Queue
import time
#SHOW_CAMS = True
SHOW_CAMS = False
# Object cla... |
ColorTracking.py | #!/usr/bin/python3
# coding=utf8
import sys
sys.path.append('/home/pi/ArmPi/')
import cv2
import time
import Camera
import threading
from LABConfig import *
from ArmIK.Transform import *
from ArmIK.ArmMoveIK import *
import HiwonderSDK.Board as Board
from CameraCalibration.CalibrationConfig import *
if sys.version_inf... |
find_stable.py | import argparse #for getting command line arguments
import os #for various things
from selenium import webdriver, common #for getting html source of channel
from time import sleep #to prevent errors
import re ... |
Activity.py | #!/usr/bin/env python
# coding: utf-8
# # Подключаем нужные библиотеки
# In[2]:
import cv2
import face_recognition
# Получаем данные с устройства (веб камера у меня всего одна, поэтому в аргументах 0)
video_capture = cv2.VideoCapture(0)
# Инициализируем переменные
face_locations = []
# In[3]:
from sound imp... |
eval_low_level_runner.py | # Copyright 2018 Google. 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 agree... |
test_utils.py | # Copyright 2020 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 agreed to in writing,... |
3. Historical Data.py | from kiwoom import Bot, config
from kiwoom.utils import clock
from kiwoom.config.types import ExitType
from PyQt5.QtWidgets import QApplication
from multiprocessing import Process, Manager
import sys
import time
"""
시장 데이터 수집을 위한 스크립트
1) 시장선택
>> bot.histories(market='0', ...) # KOSPI
config.MARKETS = {
'0':... |
sh.py | #===============================================================================
# Copyright (C) 2011-2012 by Andrew Moffat
#
# 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 restricti... |
Launcher.py | import shardedBot2
from multiprocessing import Process, Pipe, Queue
import asyncio
import shutil
import os
from signal import SIGKILL
shards = 128
shards_per_instance = 16
instances = int(shards / shards_per_instance)
processes = list()
def wait(delay: int):
loop.run_until_complete(asyncio.sleep(delay))
processe... |
IntegrationTests.py | from __future__ import absolute_import
import multiprocessing
import time
import unittest
import logging
import os
import percy
from selenium import webdriver
import sys
import warnings
log = logging.getLogger('werkzeug')
log.disabled = True
warnings.filterwarnings("ignore")
class IntegrationTests(unittest.TestCase)... |
os.py | # Copyright 2013 OpenStack Foundation
# 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
#
# Un... |
logic.py | import os
import time
from threading import Thread
prefsFilename = "defaultPrefs.cs"
widthKey = "$pref::GWC::SIM_FS_WIDTH"
heightKey = "$pref::GWC::SIM_FS_HEIGHT"
dxWndFilename = "dxwnd.dxw"
cdVolumeKey = "cdvol0"
masterFile = os.path.join("scripts", "master.cs")
masterPrefix = "$Inet::Master"
def getCurrentMasterS... |
MPIRedirect.py | # Copyright 2014 Modelling, Simulation and Design Lab (MSDL) at
# McGill University and the University of Antwerp (http://msdl.cs.mcgill.ca/)
#
# 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... |
test_resnet_url_multiimage.py | # -*- coding: utf-8 -*-
"""
Runfile for testing purposes
Author: Ignacio Heredia
Date: December 2016
Description:
This file contains the commands for testing a convolutional net for image
classification on some dataset file consisting in url and labels.
The difference with test_resrnet_url is that this implements the... |
scene.py | import numpy as np
from ..points import transform_points
from ..grouping import group_rows
from ..util import is_sequence, is_instance_named
from ..transformations import rotation_matrix
from .transforms import TransformForest
from collections import deque
class Scene:
"""
A simple scene graph which can be ... |
common.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... |
DirectoryControl.py | #!/usr/bin/env python
"""Controls for control panels
Author: Friedrich Schotte,
Date created: 2017-10-31
Date last modified: 2018-10-31
"""
__version__ = "1.0"
from logging import debug,info,warn,error
import wx, wx3_compatibility
class DirectoryControl(wx.Panel):
"""Control panel for SAXS-WAXS Experiments"""
... |
vapp.py |
from threading import *
import time
import sys
class vMain(object):
def __init__(self):
print "__init__"
def RegisterInterface(self):
def td_func():
while self.isRun:
print "vAppName:"+sys.vAppInfo.GetName()
time.sleep(3)
print "td_f... |
multi_process_write_file_and_fcntl.py | #!/usr/bin/env python
import multiprocessing
import time
import random
import fcntl
def match_or_update(filename, keyword):
with open(filename, 'a+') as fp:
fcntl.flock(fp, fcntl.LOCK_EX)
flines = fp.readlines()
matched =False
for line in flines:
if keyword in line:
... |
ggwebsocket.py | """
This module starts a webserver and handles websockets for the generic game server
"""
import posixpath
import base64
import hashlib
import struct
import os
import errno
import threading
import logging
log = logging.getLogger("web")
log.setLevel(logging.INFO)
_base_path = os.path.join(os.path.dirname(os.path.r... |
PC_Miner.py | #!/usr/bin/env python3
"""
Duino-Coin Official PC Miner 3.0 © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2021
"""
from threading import Semaphore
from time import time, sleep, strptime, ctime
from hashlib import sha1
from socket import socket
... |
sandbox4.py | # import time
# import threading
#
# from gi.repository import Gtk, Gdk, GObject
#
# window = None
#
# def main():
# GObject.threads_init()
# Gdk.threads_init()
#
# # Build GUI:
# global window
# window = Gtk.Window()
# button = Gtk.Button(label="Click me")
# window.add(button)
# window.... |
wmiidbus.py | #!/usr/bin/env python
# TODO: Throw away threading and integrate into epoll event loop
import dbus
import dbus.service
import threading
_system_bus = None
_session_bus = None
_main_loop = None
_bus_loop = None
_thread = None
_system_bus_lock = threading.Lock()
def get_system_bus(start_thread=True):
global _system_... |
multi_env_runner.py | """
New(0721) try adding GPU agents
NOTE(0714) My attempt at making a simpler version of a multi-task trainer that
handles EnvRunner, ReplayBuffer, and the Agent Update with a slightly more
flattened logic.
Big credit to Stephen's MultiTaskQAttention for great reference
"""
import os
import time
import copy
import wa... |
PlumberHubClient.py | import requests
import websockets
import asyncio
import threading
from .plumberhub_pb2 import Sample
def noop():
pass
class PlumberHubClient:
def __init__(
self, hostname, port, client_id,
on_sample=noop, on_error=noop, on_close=noop
):
host = hostname + ':' + str(port)
... |
3.1_edf_bankers_NS.py | from functools import reduce
from sys import *
import numpy as np
import random as r
import ping_code as pc
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import psutil
import getpass as gp
from netifaces import in... |
certutils_test.py | # Copyright 2014 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 ... |
ui.py | import logging
import os
import json
import numpy as np
import pandas as pd
import asyncio
from aiohttp import web
from threading import Thread
from timeflux.helpers import clock
from timeflux.core.node import Node
class UI(Node):
"""Interact with Timeflux from the browser.
This node provides a web interfac... |
racetrack.py | import tkinter
import sys
import getopt
import time
import threading
import os
import random
import enum
import racemap
import racecar
import racecolor
def callback(event):
""" Reacts to a user click on the window """
# switch on the status
global status
# if still initializing, ignore the click and don't do a... |
DLProcessor.py |
# from urllib import request
import socket, ssl
import threading
import time
from .DLInfos import Target
# import logging
import traceback
from .DLError import HTTPErrorCounter, DLUrlError
# import gc
# import io
from . import DLCommon as cv
import http.client
import sys
if sys.version_info <= (2, 7):
from urlli... |
mt_example.py | import logging
import threading
import concurrent.futures
import time
def thread_function(name):
logging.info("Thread %s: starting", name)
time.sleep(2)
logging.info("Thread %s: finishing", name)
if __name__ == "__main__":
format = "%(asctime)s: %(message)s"
logging.basicConfig(format=format, le... |
subscribe_io.py | __all__ = ['FlexibleDistribute', 'pop_subs_to_admin', 'detach', 'set_task2url_cache']
import threading
from urllib.parse import urlparse
from uuid import uuid4
from src.BusinessCentralLayer.middleware.flow_io import FlowTransferStation
from src.BusinessCentralLayer.middleware.redis_io import RedisClient
from src.Busi... |
langserver.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from collections import defaultdict, OrderedDict
from six.moves.queue import Queue
from subprocess import Popen, PIPE
from threading import Thread
import pprint
import itertools as it
import json
import os
import six
import sys
import tempfile
import utils
... |
jarvis.py | #
# Copyright (c) 2020 by Philipp Scheer. All Rights Reserved.
#
# usage: jarvis.py [-h] [--config CONFIG]
#
# Manages all the Jarvis services
#
# optional arguments:
# -h, --help show this help message and exit
# --config CONFIG Path to jarvis configuration file
# import global and local packages
impo... |
callback.py | from utlis.rank import setrank,isrank,remrank,remsudos,setsudo,GPranks,IDrank
from utlis.send import send_msg, BYusers, Sendto, fwdto,Name,Glang,getAge
from utlis.locks import st,getOR,Clang,st_res
from utlis.tg import Bot
from config import *
from pyrogram import ReplyKeyboardMarkup, InlineKeyboardMarkup, Inlin... |
ebayView.py | import requests
from threading import Thread
import threading
import time
def view(prodUrl, index):
session = requests.Session()
headers = {
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36',
'Accept':'text/html,app... |
smoke.py | # Copyright 2018 John Reese
# Licensed under the MIT license
import asyncio
import sqlite3
import sys
from pathlib import Path
from sqlite3 import OperationalError
from threading import Thread
from unittest import skipIf, SkipTest, skipUnless
if sys.version_info < (3, 8):
from aiounittest import AsyncTestCase as T... |
threaded.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import sys
import time
import os.path
import math
import re
import argparse
import traceback
import json
import bz2
import gzip
from nltk.tokenize import TweetTokenizer
from flashtext import Keywo... |
irc.py | #!/usr/bin/env python
# IRC Cryptocurrency Exchange (IRCCEX) - Developed by acidvegas in Python (https://acid.vegas/irccex)
# irc.py
'''
if using_too_many_if_statements == True:
use_more = True
else:
use_alot_more = True
'''
import datetime
import os
import pickle
import random
import socket
import threading
import... |
cloudiot.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
test_cursor.py | # Copyright 2009-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... |
test_conflicts.py | import multiprocessing
import pytest
import sheraf
import tests
import ZODB
@pytest.mark.parametrize(
"database",
[
pytest.lazy_fixture("sheraf_database"),
pytest.lazy_fixture("sheraf_zeo_database"),
# pytest.lazy_fixture("sheraf_pgsql_relstorage_database"),
],
)
def test_empty... |
tf-29.py | #!/usr/bin/env python
import re, sys, operator, Queue, threading
# Two data spaces
word_space = Queue.Queue()
freq_space = Queue.Queue()
stopwords = set(open('../stop_words.txt').read().split(','))
# Worker function that consumes words from the word space
# and sends partial results to the frequency space
def proces... |
test.py | import torch
import numpy as np
print(torch.from_numpy(np.random.dirichlet(np.ones(10) * 0.01, 5)))
'''
if current_index > 5:
print('arena')
start = datetime.datetime.now()
with Manager() as manager:
output_list = manager.list()
processes = []
for i in range(2):
p = ... |
test_security.py | """Test libzmq security (libzmq >= 3.3.0)"""
# -*- coding: utf8 -*-
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import os
import contextlib
import time
from threading import Thread
import zmq
from zmq.tests import BaseZMQTestCase, SkipTest, PYPY
from zmq.utils import z... |
filestatemanager.py | # Copyright 2016 Twitter. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
executor.py | import os
import json
import time
import uuid
import signal
import logging
from threading import Thread
from addict import Dict
from six.moves.http_client import HTTPConnection
from .process import Process
from .interface import ExecutorDriver
from .utils import parse_duration, encode_data, decode_data
logger = loggin... |
1.py | # hello world
import socket
import threading
class Tcp(object):
def __init__(self):
tcp_client = socket.soket(socket.AF_INET, socket.SOCK_SCREAM)
tcp_client.setsockpt(scoket.SOL_SCREAM, socket.USEADDR, True)
tcp_client.bind("", 80)
tcp_client.listen(128)
self.tcp_client = tc... |
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_mediator.py | import os
import signal
from contextlib import contextmanager
from multiprocessing import Barrier
from multiprocessing import Process
from unittest import TestCase
from brotab.api import api_must_ready
from brotab.inout import get_available_tcp_port
from brotab.mediator import sig
from brotab.mediator.const import DEF... |
local-send-recv.py | """
Benchmark send receive on one machine
UCX_TLS=tcp,sockcm,cuda_copy,cuda_ipc UCX_SOCKADDR_TLS_PRIORITY=sockcm python \
local-send-recv.py --server-dev 2 --client-dev 1 --object_type rmm \
--reuse-alloc --n-bytes 1GB
Benchmark send receive on two machines (IB testing):
# server process
UCX_NET_DEVIC... |
bmn_reader.py | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
#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... |
offboard.py | import rospy
import glob
import json
import math
import os
import px4tools
import sys
import time
import actionlib
import roslaunch
from mavros import mavlink
from mavros import action_server
from mavros_msgs.msg import Mavlink, Waypoint, WaypointReached, GlobalPositionTarget, State, TakeoffAction, TakeoffGoal, LandAct... |
benchmark.py | #!/usr/bin/bash
# Copyright (c) 2021, NVIDIA CORPORATION. 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 lis... |
stdout_accumulator.py | import os
from Queue import Queue, Empty
from threading import Thread, RLock
class StreamAccumulator(object):
def __init__(self, stdout):
self.queue = Queue()
self.stdout = stdout
self.thread = Thread(target=self._push_to_queue)
self.thread.daemon = True
self.lock = RLock()
... |
manager.py | import threading
import vk_api
import datetime as dt
import flag
from queue import Queue
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
from vk_api.utils import get_random_id
from src.vk_chat_bot.db.database import UserAppToken, UserSearchList, User... |
__init__.py | __version__ = '0.0.1'
import os
import fitz
from PIL import Image
from PyPDF2 import PdfFileReader, PdfFileWriter
from tabula import read_pdf
import tabula
import camelot
import numpy as np
import spacy
from spacy.lang.en.stop_words import STOP_WORDS
from string import punctuation
from heapq import nlargest
import io
... |
extmodule.py | """
libyate - external module application code
"""
import logging
import Queue
import signal
import socket
import sys
from abc import ABCMeta, abstractmethod
from threading import Thread
import libyate.engine
# noinspection PyBroadException
class Application(object):
"""Yate external module application
:p... |
murano_test_utils.py | # Copyright (c) 2015 Mirantis, 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 w... |
GUI.py | import numpy as np
from PIL import Image
from Parser import Parser
from mapMaker import MapMaker
from SystemControl import SystemControl
from Tkinter import Tk, Label, Frame, PhotoImage, Button, Spinbox, Listbox
import tkMessageBox
import scipy.misc
import threading
from moveRobot import moveRobot
# import Globals as G... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.