source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
model.py | # -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description:
"""
import collections
import os
from queue import Queue
from threading import Thread
import tensorflow as tf
from text2vec.bert import modeling
from text2vec.bert import optimization
from text2vec.bert import tokenization
os.environ['CUDA_V... |
cooker.py | #!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
# Copyright (C) 2005 Holger Hans Peter Freyther
# Copyright (C) 20... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
serverprotocol.py | import socket
import threading
import hashlib
import json
class Client(object):
def __init__(self, game, host, socket):
self.game = game # game.Game
self.host = host # (ip, port)
self.socket = socket # socket.socket [socket.AF_INET, socket.SOCK_STREAM]
self.username = None
... |
k8s.py |
import hashlib
import os
import random
import re
from string import Template
import scalyr_agent.monitor_utils.annotation_config as annotation_config
from scalyr_agent.monitor_utils.annotation_config import BadAnnotationConfig
from scalyr_agent.monitor_utils.blocking_rate_limiter import BlockingRateLimiter
import sca... |
fmow.py | import sys
import os
import h5py
import numpy as np
from PIL import Image
import json
import threading as th
from params import path_fmow_rgb, path_catch_files, fmow_category_names, fmow_image_size, str_fmow
Image.MAX_IMAGE_PIXELS = None
# Fmow class envelope fmow dataset
class Fmow:
def __init__(self, str_fi... |
_serversweep.py | #!/usr/bin/env python
# (C) Copyright 2017 Inova Development 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
#
# ... |
server_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... |
plugin.py | from __future__ import unicode_literals
from rasahub.message import RasahubMessage
import threading
import sys
import time
import json
is_py2 = sys.version[0] == '2'
if is_py2:
import Queue as queue
else:
import queue as queue
class RasahubPlugin(object):
"""Main class for a plugin.
"""
def __... |
pwn_yellow_sub.py |
# I stumbled across this and stole it as a starting point. because lazy.
# https://gist.github.com/ConnorNelson/07229c0a55aaf05571c26c854c300e33
import base64
import hashlib
import multiprocessing
import random
import socket
import string
import subprocess
import sys
import time
import uuid
from swpag_client import ... |
LoadHdf5InSequence.py | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 29 20:53:56 2016
@author: zxlee
"""
import numpy as np
import h5py
import mxnet as mx
import threading
import Queue
import copy
class simple_batch(object):
def __init__(self, data_names, data, label_names, label, bucket_key):
self.data = data
self.la... |
zip.py | from tkinter import*
import zipfile
import threading
from tkinter import messagebox
import io
global i
i = 0
bools = 1
def extractfile(zfile, password):
try:
zfile.extractall(pwd = password)
print("[*]文件解压密码为: ", password)
banner = '破解成功,密码: ' + password
messagebox.sho... |
app_server.py | from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
import socket
import re
import requests
from ca import setup_certs
import settings
import random
from google_connection import setup_google_connection
from multiprocessing import Process
from threading import Thread, S... |
test_threading.py | import itertools
import time
from threading import Barrier, Thread
from loguru import logger
class NonSafeSink:
def __init__(self, sleep_time):
self.sleep_time = sleep_time
self.written = ""
self.stopped = False
def write(self, message):
if self.stopped:
raise Run... |
t_client.py | # -*- coding: utf-8 -*-
import logging
import os
import time
import urllib.parse
import urllib.request
import hashlib
import base64
import uuid
import wave
import requests
import urllib
import json
import threading
from tencent.callback_url import setup_logging
setup_logging(filename='client_server.log',stream=Fals... |
UltrasonikSensoru.py | from time import sleep, time
import RPi.GPIO as GPIO
from threading import Thread
class UltrasonikSensoru:
def __init__(self, echo, trig, setup=GPIO.BOARD):
self.echo = echo
self.trig = trig
self.sure = 0
self.mesafe = list()
self.anlikOlcum = 0
GPIO.setmode(set... |
agent.py | # Copyright 2021, Yahoo
# Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms
import os
import warnings
from abc import ABC, abstractmethod
from datetime import datetime
from enum import IntEnum
from queue import LifoQueue, Queue
from threading import Thread
from ty... |
test_urllib.py | # Adapted for Jython from CPython 2.7 test.test_urllib
"""Regression tests for urllib"""
import collections
import urllib
import httplib
import io
import unittest
import os
import sys
import mimetools
import tempfile
from test import test_support
from base64 import b64encode
# Work out this is Windows, even for Jyth... |
emails_test.py | import logging
import threading
import time
import pytest
from smtplib import SMTP as _SMTP, LMTP as _LMTP
from alexber.utils.emails import SMTPHandler, OneMemoryHandler
import alexber.utils.emails as emails
#don't remove this
from platform import uname
from alexber.utils.emails import EmailStatus, FINISHED
logger = lo... |
test_lib_test.py | #!/usr/bin/env python
import threading
import time
import unittest
from grr_response_core.lib import rdfvalue
from grr.test_lib import test_lib
class FakeTimelineTest(unittest.TestCase):
def testRunSingleSleep(self):
log = []
def foo():
while True:
log.append("foo")
time.sleep(10)
... |
wrappers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# #########################################################################
# Copyright (c) 2015, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2015. UChicago Argonne, LLC. This... |
plot_from_pp_geop_height_and_tcwv_by_date_range.py | """
Load pp, plot and save
8km difference
"""
import os, sys
#%matplotlib inline
#%pylab inline
import matplotlib
matplotlib.use('Agg')
# Must be before importing matplotlib.pyplot or pylab!
from matplotlib import rc
from matplotlib.font_manager import FontProperties
from matplotlib import rcParams
from mpl_to... |
eventEngine.py | # encoding: UTF-8
# 系统模块
from queue import Queue, Empty
from threading import Thread
from time import sleep
from collections import defaultdict
# 第三方模块
from qtpy.QtCore import QTimer
# 自己开发的模块
from vnpy.event.eventType import *
########################################################################
class EventEngi... |
train.py | import argparse
import logging
import math
import os
import random
import time
from copy import deepcopy
from pathlib import Path
from threading import Thread
import numpy as np
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.optim.lr_sche... |
uow_status_listener.py | __author__ = 'Bohdan Mushkevych'
from threading import Thread
from amqp import AMQPError
from synergy.db.model.mq_transmission import MqTransmission
from synergy.db.model import unit_of_work
from synergy.db.dao.unit_of_work_dao import UnitOfWorkDao
from synergy.scheduler.scheduler_constants import QUEUE_UOW_STATUS
f... |
PyShell.py | #! /usr/bin/env python3
import getopt
import os
import os.path
import re
import socket
import subprocess
import sys
import threading
import time
import tokenize
import io
import linecache
from code import InteractiveInterpreter
from platform import python_version, system
try:
from tkinter import *
except ImportE... |
viewer.py | """A pyglet-based interactive 3D scene viewer.
"""
import copy
import os
import sys
import time
from threading import RLock, Thread
import imageio
import numpy as np
import OpenGL
import trimesh
try:
from Tkinter import Tk
from Tkinter import tkFileDialog as filedialog
except Exception:
try:
from ... |
main.py | #!/usr/bin/env python3
import drop
import itertools
import logging
import os
import proxy
import random
import threading
# topics
TOPIC_GENERATOR = "0"
TOPIC_ACCUMULATOR = "1"
TOPIC_AGGREGATOR = "2"
# simulation parameters
NUM_NODES = 1000
NUM_APPS = 5
BEGIN_TIME = 1
END_TIME = 901
# other
ACCU_SIZE = 60
OUT_FOLDER... |
data_ingester.py | # Copyright 2020 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... |
FSMActionInterface.py | #!/usr/bin/env python3
import rospy, copy
import actionlib
from BaseActionInterface import BaseActionInterface
from ActionlibActionInterface import ActionlibActionInterface
from ServiceActionInterface import ServiceActionInterface
import threading
from rosplan_dispatch_msgs.msg import ActionFeedback
# ToDo: Implement... |
irc.py | import datetime
import socket
import ssl
import threading
import time
from ...logging import get_logger
from ...message import Message
from ...signals import message_in, message_out, on_exception
from .. import BaseModule
from ..lib import parse_command
from ..mixins import AdminMessageDispatcherMixin, ConfigMixin
cl... |
multi_init_phot.py | import numpy as np
import pandas as pd
import subprocess
import glob
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import seaborn as sns
from astropy.coordinates import SkyCoord
import logging
from astropy.table import Table
import astropy.io.fits as fits
import os
from astropy import units as u
f... |
nb_subproc_thread.py | import logging
import time
from signal import SIGTERM
from subprocess import PIPE, Popen
from threading import Thread
logger = logging.getLogger(__name__)
def is_fileobj_open(fileobj):
return fileobj and not getattr(fileobj, 'closed', False)
class NBSubprocThread(Thread):
DEFAULT_POLL_INTERVAL_SEC = 0.01
... |
onenote_auth.py | from oauthlib.oauth2 import TokenExpiredError
from requests_oauthlib import OAuth2Session
import datetime
import json
import logging
import webbrowser
from contextlib import suppress
from http.server import HTTPServer, BaseHTTPRequestHandler
from pathlib import Path
from queue import Queue
from threading import Thread
... |
server_rpc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/server/server_rpc.py
#
# 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... |
preloader.py | from threading import Thread
from multiprocessing import Process, Lock, Value
from multiprocessing import Queue as PicklingQueue
from multiprocessing.queues import Empty as PicklingQueueEmpty
from queue import Queue, Empty
from typing import Iterator
from loguru import logger
from .common import IterlibException, STR... |
eventEngine.py | # encoding: UTF-8
# 系统模块
from __future__ import print_function
from queue import Queue, Empty
from threading import Thread
from time import sleep
from collections import defaultdict
# 第三方模块
from qtpy.QtCore import QTimer
# 自己开发的模块
from .eventType import *
###########################################################... |
ln.py | import threading, requests, time, random
start_time = time.time()
threads = []
o = []
proxies = []
with open('proxies.txt', 'r') as f:
for line in f:
x = line.rstrip()
proxies.append(x)
def getprox():
prox = random.choice(proxies)
proxy = {'http': f'http://{prox}'}
return... |
gt_maya_to_discord.py | """
GT Maya to Discord - Send images and videos (playblasts) from Maya to Discord using a Discord Webhook to bridge the two programs.
@Guilherme Trevisan - TrevisanGMW@gmail.com - 2020-06-28 - github.com/TrevisanGMW
Tested on Maya 2018, 2019, 2020 - Windows 10
1.1 - 2020-07-04
Added playblast and desktop... |
http_reporter.py | from future.builtins import super
from future import standard_library
standard_library.install_hooks()
import http.client
import logging
import queue
import threading
import urllib.request, urllib.error, urllib.parse
from testify import test_reporter
try:
import simplejson as json
_hush_pyflakes = [json]
... |
gui.py | '''
All components of this library are licensed under the BSD 3-Clause
License.
Copyright (c) 2015-, Algorithmic Robotics and Control Group @Rutgers
(http://arc.cs.rutgers.edu). All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided... |
client.py | import time
from collections import defaultdict
from functools import partial
from queue import Queue
from qchat.core import QChatCore, DaemonThread, GLOBAL_SLEEP_TIME
from qchat.cryptobox import QChatCipher
from qchat.mailbox import QChatMailbox
from qchat.messages import QCHTMessage, SPDSMessage, GETUMessage, PUTUMes... |
power_curve.py | import ant, os, usb.core, time, binascii, trainer, sys, os, pickle
from Tkinter import *
import threading
import numpy as np
#from scipy.optimize import curve_fit
def produce_power_curve_file(save_data):#res, speed, power
#produce custom power curve calibration file
m="#grade:multiplier,additional\n"
valid_level... |
test_threads.py | import threading
import timeit
from restkit import *
#set_logging("debug")
urls = [
"http://refuge.io",
"http://gunicorn.org",
"http://friendpaste.com",
"http://benoitc.io",
"http://couchdb.apache.org"]
allurls = []
for i in range(10):
allurls.extend(urls)
def fetch(u):
... |
process_nessus_xml.py | from collections import defaultdict, OrderedDict
from functools import partial
from lxml import etree
from multiprocessing import Event, Process, Queue
from queue import Empty
import argparse
import os
import re
import signal
PORT_SERVICES = [
{
'tag': 'ReportItem',
'filters': [
... |
test_collection.py | # -*- coding: utf-8 -*-
# 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 applicabl... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
import random
import... |
threading.py | from __future__ import absolute_import
import sys
import threading
from pykka import compat
from pykka.actor import Actor
from pykka.exceptions import Timeout
from pykka.future import Future
__all__ = [
'ThreadingActor',
'ThreadingFuture',
]
class ThreadingFuture(Future):
"""
:class:`ThreadingFut... |
utils.py | '''
Michael Lam 2015
Useful mathematical commands
'''
import numpy as np
import scipy.fftpack as fft
import scipy.optimize as optimize
import scipy.stats as stats
import scipy.interpolate as interp
import scipy.special as special
from scipy.signal import fftconvolve,correlate
import matplotlib.pyplot as plt
from mul... |
data_feeder.py | """
Author: Ashesh Jain [asheshjain399@gmail.com]
MIT License
"""
from multiprocessing import Queue, Process
import multiprocessing as mp
import numpy as np
from numpy.random import RandomState
rand = RandomState(123)
class DataFeeder():
"""
DataFeeder creates data processing queues
"""
def __init__(self,
... |
test_shutdown.py | #
# -*- coding: utf-8 -*-
#
# Copyright 2016 science + computing ag
#
# 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 re... |
master.py | import sys
import os
import operator
import random
import socket
import threading
import datetime
import json
from time import sleep
#The Scheduling Algorithms- RANDOM, RR and LL
def RANDOM(task,workers):
while True:
workerLock.acquire()
#randomly assigns a worker
choice = rand... |
foo.py | # Python 3.3.3 and 2.7.6
# python fo.py
import threading
from threading import Thread
# Potentially useful thing:
# In Python you "import" a global variable, instead of "export"ing it when you declare it
# (This is probably an effort to make you feel bad about typing the word "global")
lock = threading.Lock()
i = ... |
tello.py | import socket
import threading
import time
import cv2
from easytello.stats import Stats
class Tello:
def __init__(self, tello_ip='192.168.10.1', debug=True):
# Opening local UDP port on 8889 for Tello communication
self.local_ip = ''
self.local_port = 8889
self.socket = s... |
schedComm.py | # -*- coding: utf-8 -*-
"""
RabbitMQ Interface: Send/publish the collected logs to
the Monitoring server.
Misha Ahmadian (misha.ahmadian@ttu.edu)
"""
from pika import PlainCredentials, ConnectionParameters, BlockingConnection, BasicProperties, exceptions
from schedConfig import SchedConfig, ConfigReadExcet... |
minitouch.py | # -*- coding: utf-8 -*-
import os
import re
import socket
import sys
import threading
import time
import warnings
import six
from six.moves import queue
from airtest.core.android.constant import STFLIB
from airtest.utils.logger import get_logger
from airtest.utils.nbsp import NonBlockingStreamReader
from airtest.utils... |
client.py | import socket, threading
client = socket.socket()
client.connect(('localhost', 9090))
name = input("Input your name, please: ")
client.send(name.encode())
def listen_server():
while True:
data = client.recv(1024)
print(data.decode())
def send_to_server():
listen_thread = threading.Thread(tar... |
client_session.py | # -*- coding: utf-8 -*-
# Copyright (2018) Hewlett Packard Enterprise Development LP
#
# 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... |
chat_client_class.py | import time
import socket
import select
import sys
import json
from chat_utils import *
import client_state_machine as csm
import threading
import encrypt
class Client:
def __init__(self, args):
self.peer = ''
self.console_input = []
self.state = S_OFFLINE
self.... |
TGeventServer.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... |
util.py | #
# Module providing various facilities to other parts of the package
#
# multiprocessing/util.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
# Modifications Copyright (c) 2020 Cloudlab URV
#
import traceback
import weakref
import redis
import uuid
import logging
import sys... |
benchmark_image_sizes.py | from pymatting import load_image, show_images, trimap_split
from pymatting import cf_laplacian, make_linear_system
from collections import defaultdict
import scipy.sparse.linalg
import numpy as np
import threading
import psutil
import time
import json
import os
def get_memory_usage():
process = psutil.Process(os.g... |
process_crawler.py | import time
import urllib.parse as urlparse
import threading
import multiprocessing
from . import utils
from . import db_cache
from datetime import datetime, timedelta
from pymongo import MongoClient, errors
SLEEP_TIME = 1
class MongoQueue:
"""
>>> timeout = 1
>>> url = 'http://example.webscraping.com'
... |
__init__.py | """Unit test helper functions and fixtures.
Since this module is for testing our modules, it should not depend on
any of our modules.
"""
__all__ = [
'assert_del_not_resurrecting',
'check_call',
'check_output',
'check_program',
'spawn',
# Helpers for running C code.
'CFixture',
'is_gcc... |
build_relationships.py | #!/usr/bin/env python
# coding: utf-8
import logging
import os
import re
import time
from multiprocessing import Process
from pymongo import MongoClient
from pymongo.errors import AutoReconnect
MONGO_IP = os.environ.get("MONGO_IP")
MONGO_PORT = int(os.environ.get("MONGO_PORT"))
MONGO_USERNAME = os.environ.get("MONGO... |
api.py | #!/usr/bin/python
import requests
import json
import time
import multiprocessing
import random
host = 'http://127.0.0.1:7099/'
#host = 'http://43.254.54.38:7099/'
#host = 'http://118.193.143.243/'
#host = 'http://192.168.16.81:31799/'
#host = 'https://fornax-canary.caicloud.io/'
# host = 'http://192.168.16.201:30010/... |
watch_rel_1_18.py | #
# Copyright (c) 2021 Incisive Technology Ltd
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... |
webserver.py | #!/home/snikolenko/anaconda/bin/python
# -*- coding: utf8 -*
import matplotlib as mpl
mpl.use('Agg')
import os
import cPickle
from datetime import datetime,time,date,timedelta
from os import curdir,sep,path
import json
import glob
import codecs
from operator import itemgetter
import tornado.ioloop
import tornado.web... |
test_fx.py | # Owner(s): ["oncall: fx"]
import builtins
import contextlib
import copy
import functools
import inspect
import math
import numbers
import operator
import os
import pickle
import sys
import torch
import traceback
import typing
import types
import warnings
import unittest
from math import sqrt
from torch.multiprocessin... |
controlProcess.py | from os import system
import threading
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime as dt
import time
topThread = -1
def extract_data(pid):
system("top -H -p "+pid+" -d 0.1 -n 50 -b > migrations.txt")
def start(pid):
topThread = threading.Thread(targ... |
framework.py | #!/usr/bin/env python
from __future__ import print_function
import gc
import sys
import os
import select
import unittest
import tempfile
import time
import resource
import faulthandler
import random
from collections import deque
from threading import Thread, Event
from inspect import getdoc, isclass
from traceback imp... |
ProgramMaster.py | import sys
import copy
import pylsl
import threading
from pubsub import pub
from collections import deque
import livesystem.LiveSystemManager as Live
import livesystem.MidiManager as MidiManager
import livesystem.StreamManager as StreamManager
import helpers.SettingsManager as SettingsManager
import livesystem.Calibrat... |
__init__.py | # Easily capture stdout/stderr of the current process and subprocesses.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: March 7, 2020
# URL: https://capturer.readthedocs.io
"""Easily capture stdout/stderr of the current process and subprocesses."""
# Standard library modules.
import multiprocessing
im... |
solution_2.py | import itertools
import threading
import time
def execute_opcode(inputlist: list, position: int, e: threading.Event, main_thread: threading.Event) -> int:
"Executes the OPCode on position p"
op = inputlist[position]
print(op)
parameters = []
if len(op) >2 :
# Parameter mode 1
# We ha... |
threaded_timer.py | #! /usr/bin/python3
import time
from threading import Thread
def timer(name, delay, repeat):
print("Timer: " + name + " started")
while repeat > 0:
repeat -= 1
time.sleep(delay)
print(name + " : " + str(time.ctime(time.time())))
print("Timer: " + name + " completed")
def main()... |
sideinputs.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... |
run.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fMRI preprocessing workflow
=====
"""
import os
import os.path as op
from pathlib import Path
import logging
import sys
import gc
import uuid
import warnings
from argparse import ArgumentParser
from argparse import RawTextHelpFormatter
from multiprocessing import cpu_... |
client.py | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
# pylint: d... |
top.py | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import logging
import time
from queue import PriorityQueue
from threading import Thread
from typing import Any, Optional
from uuid import UUID
from onefuzztypes.enums import JobState, NodeState, PoolState, TaskState
from... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
sink.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2014, Kacper Żuk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this li... |
HiwinRA605_socket_ros_20190604111052.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
dynamodb_logstore.py | #
# Copyright (2021) The Delta Lake Project 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 ag... |
custom.py | # pylint: disable=too-many-lines
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------... |
semaphores.py | #!/usr/bin/env python
from time import sleep
from threading import Thread, Semaphore
from random import randint
CUSTOMER_COUNT = 25
WAITERS_COUNT = 4
restaurant = Semaphore(WAITERS_COUNT)
def time_to_process():
return randint(0,5)
def customer(number, time_to_process):
print('[Customer-%d]: Waiting on the ... |
device_interface.py | # -*- coding: utf-8 -*-
import os
import time
import threading
import APIAccessor
from constants import FILENAME, REAL_DEVICE_IP, REAL_DEVICE_INDEX, STATUS
def get_parameters_from_file(filename):
os.system('sshpass -p "intrepid" scp root@{ip}:{file} . 2>/dev/null'.format(ip=REAL_DEVICE_IP, file=filename))
wi... |
accountNuke.py | import threading
import requests
import json
import Mark
import random
from itertools import cycle
from colorama import Fore
from util.plugins.common import print_slow, setTitle, getheaders, proxy
def Mark_Nuke(token, Server_Name, message_Content):
setTitle("Deploying Acc Nuke")
print(f"{Fore.RESET}[{Fore.R... |
framereader.py | # pylint: skip-file
import json
import os
import pickle
import struct
import subprocess
import tempfile
import threading
from enum import IntEnum
from functools import wraps
import numpy as np
from lru import LRU
import _io
from tools.lib.cache import cache_path_for_file_path
from tools.lib.exceptions import DataUnre... |
test_client.py | # Copyright 2015 - Alcatel-Lucent
#
# 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... |
zeromq_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Thomas Jackson <jacksontj.89@gmail.com>`
'''
# Import python libs
from __future__ import absolute_import
import os
import time
import threading
import platform
import zmq.eventloop.ioloop
# support pyzmq 13.0.x, TODO: remove once we force people to 14.0.x
if not ha... |
sense_hat.py | from __future__ import print_function
import threading
from websocket_server import WebsocketServer
import math
import numpy as np
import time
import sys
class SenseHat():
temperature = 20.4
server = None
block = True
def new_client(self, client, server):
print("New client connected and was gi... |
cassettes.py | import base64
import json
import re
import sys
import threading
from queue import Queue
from typing import Any, Dict, Generator, Iterator, List, Optional, cast
import attr
import click
import requests
from requests.cookies import RequestsCookieJar
from requests.structures import CaseInsensitiveDict
from .. import con... |
tas_balanced_training_loader.py | from rich.console import Console
import random
from matchmaker.dataloaders.transformer_tokenizer import *
from allennlp.data.batch import Batch
from matchmaker.utils.core_metrics import *
from allennlp.data.tokenizers import Tokenizer
from allennlp.data.instance import Instance
from allennlp.data.fields import ArrayFie... |
kinova_gripper_env.py |
#!/usr/bin/env python3
###############
# Author: Yi Herng Ong
# Purpose: Kinova 3-fingered gripper in mujoco environment
# Summer 2019
###############
#TODO: Remove unecesssary commented lines
#TODO: Make a brief description of each function commented at the top of it
from gym import utils, spaces
import gym
from ... |
EWSO365.py | import random
import string
from typing import Dict
import dateparser
import chardet
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import sys
import traceback
import json
import os
import hashlib
from io import StringIO
import logging
import warnings
import email... |
service.py | """
Base types for all anchore engine services
"""
import copy
import connexion
import enum
from flask import g, jsonify
import json
import os
from pathlib import Path
import yaml
import time
import threading
import traceback
from anchore_engine.configuration import localconfig
from anchore_engine.subsys import log... |
flowmeter_072718-0406.py | import logging
import os
import sys
import time
import argparse
import configparser
import datetime
from multiprocessing import Process
from pprint import pprint
#import threading
from binance.client import Client as BinanceClient
from binance.websockets import BinanceSocketManager
import dateparser
from pymongo imp... |
single_robot_simple_a0509.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ##
# @brief [py example simple] motion basic test for doosan robot
# @author Kab Kyoum Kim (kabkyoum.kim@doosan.com)
# TEST 2019-12-09
import rospy
import os
import threading, time
import sys
sys.dont_write_bytecode = True
sys.path.append( os.path.abspath(os.path.... |
tpu_estimator.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... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import platform
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.