source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
crawler.py | import requests
from lib.helper.Log import *
from lib.helper.helper import *
from lib.core import *
from bs4 import BeautifulSoup
from urllib.parse import urljoin
from multiprocessing import Process
class crawler:
visited=[]
@classmethod
def getLinks(self,base,proxy,headers,cookie):
lst=[]
conn=session(p... |
2_node_classification.py | """
Single Machine Multi-GPU Minibatch Node Classification
======================================================
In this tutorial, you will learn how to use multiple GPUs in training a
graph neural network (GNN) for node classification.
(Time estimate: 8 minutes)
This tutorial assumes that you have read the :doc:`T... |
test_exec_timeout.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... |
aotu_click.py | import win32gui as wg
import win32con as wc
import win32api as wa
import keyboard
from time import sleep as slp
import threading
def throws(f,args:tuple=tuple())->None:
if not f:
f=args
if isinstance(f,(list,tuple)):
if len(f)==1:
args=tuple()
elif len(f)==2:
args=f[1]
else:
args=f... |
_debugger_case_unhandled_exceptions_custom.py | import threading, atexit, sys
import time
try:
from thread import start_new_thread
except:
from _thread import start_new_thread
class MyError(Exception):
def __init__(self, msg):
return Exception.__init__(self)
def _atexit():
print('TEST SUCEEDED')
sys.stderr.write('TEST SUCEEDED\n')
... |
Timer.py | # -*- coding: utf-8 -*-
import threading
from time import sleep
class Timer:
def __init__(self, time):
self.time = time
self.time_int = time
self.working = False
def _timer(self):
while True:
sleep(1)
self.time -= 1
if self.time <= 0:
... |
__init__.py | # Copyright The OpenTelemetry 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 ... |
run_experiment_nordri.py | #!/usr/bin/env python
import grip_and_record.inverse_kin
from geometry_msgs.msg import (
PoseStamped,
Pose,
Point,
Quaternion,
)
from data_recorder import DataRecorder
import data_recorder as dr
from grip_and_record.robot_utils import Orientations
import rospy
import intera_interface
from intera_int... |
ua_server.py | #!/usr/bin/env python2
""" This SOAP server is a data access layer over the datastore. It
presents information about applications and users as SOAP callable
functions.
"""
#TODO(raj) Rewrite this to use the lastest version of the AppScale
# datastore API.
import datetime
import logging
import SOAPpy
import sys
import... |
timed_subprocess.py | # -*- coding: utf-8 -*-
'''
For running command line executables with a timeout
'''
from __future__ import absolute_import, print_function, unicode_literals
import shlex
import subprocess
import threading
import salt.exceptions
import salt.utils.data
from salt.ext import six
class TimedProc(object):
'''
Crea... |
websocket_manager.py | import json
import time
from threading import Thread, Lock
from queue import Queue
from typing import Callable
from gzip import decompress
from websocket import WebSocketApp
from confluent_kafka import Producer
class WebsocketManager():
_CONNECT_TIMEOUT_S = 5
def __init__(self, url: str, subscribe: Callable, ... |
map_dataset_op_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
test_utils.py | import queue
from unittest.mock import patch, call
import pytest
pytestmark = pytest.mark.tendermint
@pytest.fixture
def mock_queue(monkeypatch):
class MockQueue:
items = []
def get(self, timeout=None):
try:
return self.items.pop()
except IndexError:
... |
pinger.py | """
Provides class responsible for send messages and check if target is still in network.
"""
import struct
import time
from threading import Thread
from socket import AF_INET, SOCK_STREAM, IPPROTO_TCP, SOMAXCONN, SHUT_RDWR, SO_REUSEADDR, \
socket, timeout, SOL_SOCKET
from synchronized_set import SynchronizedSet
fr... |
util.py | import os, re, struct, time
from threading import RLock, Thread
class Restart(Exception):
pass
class BadAddr(Exception):
pass
symbols = {}
invsyms = {}
def mapLoader(fn, acls, base):
if not os.path.exists(fn):
print 'Missing map file', fn
return
acls = addressTypes[acls + 'Address']
cut = 'nullsub_', 'def_%s... |
rpc_video_h264_both_rgb_of2.py | import time
from queue import Queue
from data_sender import send
import argparse
from threading import Thread, Event
import cv2
import numpy as np
from redis import Redis
import pickle
import torch
from models import TSN
from baseline_rpc_rgb2 import make_ucf, make_infer, make_hmdb, eval_video
from sklearn.metrics impo... |
graphviz.py | # graphviz.py - generate DOT language source to visualize changeset tree
###############################################################################
# Copyright (C) 2007- FUJIWARA Katsunori(foozy@lares.dti.ne.jp)
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software ... |
util.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import base64
import colorsys
import errno
import hashlib
import json
import getpass
import logging
import os
import re
import shlex
import subprocess
import sys
import threading
import time
import random
impor... |
all.py | from podb import DB
from threading import Thread
from multiprocessing import Queue
import unittest
from time import time, sleep
from datetime import datetime
from copy import deepcopy
from tests import TestObject
db = DB("test")
class DBTestMethods(unittest.TestCase):
def test_insert(self):
print("test_i... |
bmv2stf.py | #!/usr/bin/env python2
# Copyright 2013-present Barefoot Networks, 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 b... |
somethingsomethingv2.py | """This script is for preprocessing something-something-v2 dataset.
The code is largely borrowed from https://github.com/MIT-HAN-LAB/temporal-shift-module
and https://github.com/metalbubble/TRN-pytorch/blob/master/process_dataset.py
"""
import os
import sys
import threading
import argparse
import json
def parse_args(... |
multijob_module.py | """
Author: Chukwubuikem Ume-Ugwa
Email: chubiyke@gmail.com
MIT License
Copyright (c) 2017 CleverChuk
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 limit... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
thread.py | import collections
import threading
import os
from Queue import Queue
import vanilla
from vanilla import message
from vanilla.exception import Closed
class Pipe(object):
class Sender(object):
def __init__(self, q, w):
self.q = q
self.w = w
def send(self, item, timeout=... |
taskManager.py | # BSD 2-Clause License
#
# Copyright (c) 2021, Hewlett Packard Enterprise
# 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 noti... |
dataloader.py | import os
import torch
from torch.autograd import Variable
import torch.utils.data as data
import torchvision.transforms as transforms
from PIL import Image, ImageDraw
from SPPE.src.utils.img import load_image, cropBox, im_to_torch
from opt import opt
from yolo.preprocess import prep_image, prep_frame, inp_to_i... |
baekjoooon.py | from multiprocessing import Process
def place(y,x,z):
if y >= a-1 or x >= a-1 or y < 0 or x < 0:
return
yee = 0
output = [[y-1,x],[y,x-1],[y,x+1],[y+1,x]]
for y1,x1 in output:
if lst[y1][x1] == '*':
lst[y1][x1] = z
else:
output[yee]... |
idcard-recognize.py | # coding:utf-8
import sys
import threading
import multiprocessing
import queue
import re
import json
import cv2
import numpy as np
# import os
# import subprocess
import pytesseract
import psutil
# from matplotlib import pyplot as plt
from PIL import Image, ExifTags
from pypinyin import pinyin, lazy_pinyin
import pyp... |
BluetoothLowEnergyBroadcast.py | # LICENSING NOTICE
# The vast majority of this code is reused from:
# https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-advertisement
'''
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2000-2001 Qualcomm Incorporated
* Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.c... |
launch_process.py | # Original work Copyright Fabio Zadrozny (EPL 1.0)
# 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 except in complia... |
runner.py | # -*- coding: utf-8 -*-
__author__ = "苦叶子"
"""
公众号: 开源优测
Email: lymking@foxmail.com
"""
import os
import time
import json
from datetime import datetime
from threading import Thread, Timer
import xml.etree.ElementTree as ET
from flask import current_app
from flask_login import current_user
from sqlalchemy import a... |
train_prescriptor.py | # Copyright 2020 (c) Cognizant Digital Business, Evolutionary AI. All rights reserved. Issued under the Apache 2.0 License.
#
# Example script for training neat-based prescriptors
# Uses neat-python: pip install neat-python
#
from copy import deepcopy
import neat
import numpy as np
import pandas as pd
import multip... |
delete_all_vips.py | '''
Cleanup all VIPs.
@author: Youyk
'''
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.config_operations as con_ops
import zstackwoodpecker.operations.net_operations as net_ops
import zstackwoodpecker.operations.account_operations as acc_ops
import zstackwoodpec... |
singwithme_tui.py | import curses
import subprocess as sp
import threading
import singwithme
import sys
from config import load_config
from queue import Queue, Empty
from enum import Enum
from textwrap import TextWrapper
text_wrapper = TextWrapper(drop_whitespace=False)
def main(window):
global cf
cf = load_config('singwithme.co... |
qt.py | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... |
multithreadTest.py | from time import sleep
import threading
import stepper
import RPi.GPIO as GPIO
motor1Pins = [7, 8, 9, 10]
motor2Pins = [17, 18, 22, 23]
def moveMotor(pins, degrees):
sleep(1)
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
motor = stepper.Motor(pins)
motor.rpm = 15
motor.moveTo(degrees)
motor1... |
gocode.py | import sublime, sublime_plugin, subprocess, difflib, threading
# go to balanced pair, e.g.:
# ((abc(def)))
# ^
# \--------->^
#
# returns -1 on failure
def skip_to_balanced_pair(str, i, open, close):
count = 1
i += 1
while i < len(str):
if str[i] == open:
count += 1
elif str[i] == close:
count -= 1
if ... |
test_runtime_rpc.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... |
test_lock.py | """
Copyright (c) 2008-2017, Jesus Cea Avion <jcea@jcea.es>
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 list of... |
server.py | import uvicorn
from fastapi import FastAPI
from pydantic import BaseModel
import os
import logging
import json
import time
from threading import Thread
from multiprocessing import Process, Pool
from functools import partial
import boto3
import botocore
import sys
import cache
class LoadMessage(BaseModel):
file_t... |
http_server.py | #!/usr/bin/env python
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
# Many tests expect there to be an http server on port 4545 servering the deno
# root directory.
from collections import namedtuple
from contextlib import contextmanager
import os
import SimpleHTTPServer
import SocketServer
... |
sandboxjs.py | """Evaluate CWL Javascript Expressions in a sandbox."""
import errno
import json
import os
import queue
import re
import select
import subprocess # nosec
import sys
import threading
from io import BytesIO
from typing import Any, Dict, List, Optional, Tuple, Union, cast
from pkg_resources import resource_stream
from... |
__init__.py | # coding: utf8
# Copyright 2013-2017 Vincent Jacques <vincent@vincent-jacques.net>
import ctypes
import datetime
import multiprocessing
import os.path
import pickle
import signal
import sys
import threading
libc = ctypes.CDLL(None)
try:
stdout = ctypes.c_void_p.in_dll(libc, "stdout")
except ValueError: # Not ... |
utils.py | # Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
perf.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Basic pyauto performance tests.
For tests that need to be run for multiple iterations (e.g., so that average
and standard devia... |
alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "I am working dude!"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
test_sb_imapfilter.py | # Test sb_imapfilter script.
import re
import sys
import time
import email
import types
import socket
import threading
import imaplib
import unittest
import asyncore
import StringIO
try:
IMAPError = imaplib.error
except AttributeError:
IMAPError = imaplib.IMAP4.error
import sb_test_support
sb_test_support.fi... |
mtgatracker_backend.py | import sys
import os
path_to_root = os.path.abspath(os.path.join(__file__, "..", ".."))
sys.path.append(path_to_root)
import threading
import argparse
from app import tasks, queues
from util import KillableTailer
from queue import Empty
import asyncio
import datetime
import json
import websockets
import time
from pyn... |
poirot_host_RMH.py | #!/usr/bin/env python
import roslib
roslib.load_manifest('sawyer_rr_bridge')
import rospy
import intera_interface
from std_msgs.msg import Empty
from intera_core_msgs.msg import IOComponentCommand
import sys, argparse
import struct
import time
import RobotRaconteur as RR
import thread
import threading
import numpy
fr... |
microtvm_api_server.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... |
utils.py | import ast, json, threading, platform, os
from http.server import SimpleHTTPRequestHandler
from enum import Enum
try:
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
except ImportError:
SimpleWebSocketServer = object
WebSocket = object
class Watchable(Enum):
Source = "Source"
F... |
middleware.py | from multiprocessing import Process, Queue
import requests
import gevent
def child_process(queue):
while True:
print queue.get()
requests.get('http://requestb.in/15s95oz1')
class GunicornSubProcessTestMiddleware(object):
def __init__(self):
super(GunicornSubProcessTestMiddleware, self)... |
chord.py | import os
import sys
import time
import pickle
import socket
import random
import hashlib
import threading
from tools import *
from collections import OrderedDict
class Node:
def __init__(self, ip, port):
self.filenameList = []
self.ip = ip
self.port = port
self.address = (ip, por... |
flux.py | # pylint: disable=import-error
__copyright__ = 'Copyright 2013-2020, http://radical.rutgers.edu'
__license__ = 'MIT'
import time
import queue
import threading as mt
import radical.utils as ru
from ... import states as rps
from ... import constants as rpc
from .base import AgentExecutingComponent
# ------... |
07_udpchattool.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import threading
def send_msg(udp_socket):
"""发送一次数据"""
data = input("请输入你想说的话:")
IP = input('请输入你想要聊天的IP地址:')
port = int(input("请输入对方使用的端口:"))
udp_socket.sendto(data.encode(), (IP, port))
def recv_msg(udp_socket):
"""接收一次数据"""
... |
detection.py | import _thread as thread
import ast
import io
import json
import os
import sqlite3
import sys
import time
import warnings
from multiprocessing import Process
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "."))
from shared import SharedOptions
if SharedOptions.PROFILE == "w... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
import unittest.mock
from test import support
from test.support import import_helper
from test.support import os_helper
from test.support import socket_helper
from test.support import threading_helper
from test.support import warnings_helper
import sock... |
GrpcAgentImplement.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# ------------------------------------------------------------------------------
# Copyright 2020. NAVER Corp.
#
# 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 cop... |
DataAnalysisController.py | from flask import Flask, jsonify
from flask_restful import reqparse, abort, Api, Resource
from analysis.FeatureAndTrain import TableFeatureAndTrain
from analysis.DataModelPredict import DataModel
from analysis.FieldFeatureAndTrain import FieldMatchTrain
from analysis.FieldMatchPredict import FieldMatchApply
from analys... |
main.py | import sys
import time
from functools import partial
from threading import Thread
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtCore import pyqtSignal
from core import Utils, Command
import main_gui
import about_gui
import help_gui
'''
【主窗口类】
主窗口类继承自QMainWindow类。
图形程序绝大部分交互都在这里。
'''
class MainW... |
core.py | import psutil
from gpustat import GPUStatCollection
from cpuinfo import get_cpu_info
import threading
import time
import socket
from collections import deque
def bytes2MB(bytes):
return int(bytes / 1024 / 1024)
class machine:
def __init__(self, name=None):
self.name = name if name is not None else s... |
js_container.py | #!/usr/bin/env python
# Program Name : js_container.py
# Description : Delphix implementation script
# Author : Corey Brune
# Created: March 4 2016
#
# Copyright (c) 2016 by Delphix.
# All rights reserved.
# See http://docs.delphix.com/display/PS/Copyright+Statement for details
#
# Delphix Support statement avai... |
trainstore.py | # -*- coding: utf-8 -*-
import codecs
import contextlib
import gzip
import os
import pickle as pkl
import random
import shutil
import socket
import sys
import threading
import time
import traceback
from datetime import datetime
from logging import getLogger
import six
from .misc import (ensure_dir_exists, ensure_pare... |
ArmWebServer.py | #!/usr/bin/python3
# encoding: utf-8
# web 远程控制
import asyncio
import threading
import time
import ArmController as controller # 舵机转动
import ArmCmd as cmd
import random
import json
import websockets
import requests
POS = {"claw": 1500, "head": 1500, "middle": 1500, "bottom": 1500, "base": 500}
VIEWERS = set()
message... |
utilities.py | import inspect
import signal
import random
import time
import traceback
import sys
import os
import subprocess
import math
import pickle as pickle
from itertools import chain
import heapq
import hashlib
def computeMD5hash(my_string):
#https://stackoverflow.com/questions/13259691/convert-string-to-md5
m = hash... |
test_crud.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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
__init__.py | from flask import Flask
from flask_login import LoginManager
from flask_restful import Api
from flask_mail import Mail
from data import global_init, create_session, User
from data.user import AnonymousUser
from config import config
from bot import bot_launch
from threading import Thread
import logging
import ... |
running.py | # Copyright 2019 The PlaNet 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 applicable... |
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... |
sockets.py | # ################## The code of the server socket which communicates with the client ##################################
import socket
import sys
import threading
import Twophase.solver
import time
def client_thread(conn, maxlen, timeout):
while True: # infinite loop only necessary for telnet client
# R... |
executor_service.py | # Lint as: python3
# Copyright 2019, The TensorFlow Federated 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 ... |
manager.py | #!/usr/bin/env python3
import datetime
import os
import signal
import subprocess
import sys
import traceback
from multiprocessing import Process
from typing import List, Tuple, Union
import cereal.messaging as messaging
import selfdrive.sentry as sentry
from common.basedir import BASEDIR
from common.params import Para... |
batch.py | # Copyright 2021 Cortex Labs, 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_multi.py | import time
import multiprocessing
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import ping3 # noqa: linter (pycodestyle) should not lint this line.
print("ping3=", ping3.__version__)
# ping3.DEBUG = True
HOSTS = ['baidu.com', 'example.com']
def ping_in_thr... |
KADP.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Name: KADP, a Kademlia based P2P protocol
# Purpose:
#
#
# Author: Hu Jun
#
# Created: 12/09/2011
# Copyright: (c) Hu Jun 2011
# Licence: GPLv3
# for latest ve... |
installwizard.py |
from functools import partial
import threading
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform
from kivy... |
vid2img_sthv2.py | # Code for "TSM: Temporal Shift Module for Efficient Video Understanding"
# arXiv:1811.08383
# Ji Lin*, Chuang Gan, Song Han
# {jilin, songhan}@mit.edu, ganchuang@csail.mit.edu
import os
import threading
import time
NUM_THREADS = 100
# ln -s /mnt/data/kychen/datasets/tsm_data data
PROJECT_ROOT = '/mnt/data/kychen/wo... |
main.py | # 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, software
# distributed under t... |
monitor.py | # -*- coding: utf-8 -*-
# Created by zhouwang on 2019/7/26.
from apscheduler.schedulers.background import BackgroundScheduler
from queue import Queue
import requests
import threading
import time
import os
import glob
import re
import json
import sys
import getopt
import logging
logging.basicConfig(
filename='/tmp/... |
SuperchargedBots.py | from __future__ import annotations
import asyncio
import configparser
import math
import os
from threading import Thread
from traceback import print_exc
import numpy as np
from rlbot.agents.base_script import BaseScript
from rlbot.messages.flat.PlayerInputChange import PlayerInputChange
from rlbot.socket.socket_manag... |
honeypot.py | #!/usr/bin/env python2.7
import socket, sys, threading
import paramiko
if sys.version_info.major == 2 :
import thread
#generate keys with 'ssh-keygen -t rsa -f server.key'
HOST_KEY = paramiko.RSAKey(filename='server.key')
SSH_PORT = 2222
LOGFILE = 'logins.txt' #File to log the user:password combinations to
LOGFIL... |
__init__.py | # -*- coding: utf-8 -*-
import socket
import hashlib
import base64
import logging
GEVENT = None
TCP_BUF_SIZE = 8192
WS_MAGIC_STRING = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
RESPONSE_STRING = 'HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\n' \
'Connection: Upgrade\r\nSec-WebSocket-Accept: ... |
chatcommunicate.py | from chatexchange import events
from chatexchange.browser import LoginError
from chatexchange.messages import Message
from chatexchange_extension import Client
import collections
import itertools
import os
import os.path
import pickle
import queue
import regex
import requests
import sys
import threading
import time
imp... |
baxter_control.py | #!/usr/bin/env python
# Software License Agreement (MIT License)
#
# Copyright (c) 2020, control_warpper
# All rights reserved.
#
# 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 rest... |
down_piano.py |
import requests, os, threading
csv_file = "Piano.csv"
folder_name = "piano"
if not os.path.exists(folder_name):
os.mkdir(folder_name)
with open(csv_file, "r") as cf:
lines = cf.readlines()
# print(lines)
# i=1
def download():
i=1
for line in lines:
new_line = line.strip()
line_ite... |
dataset.py | """
* This file is part of PYSLAM
*
* Copyright (C) 2016-present Luigi Freda <luigi dot freda at gmail dot com>
*
* PYSLAM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
... |
manager.py | # -*- coding: utf-8 -*-
"""
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
from threading import Thread
from conpaas.core.expose import expose
from conpaas.core.manager import BaseManager
from conpaas.core.https.server import HttpJsonResponse, HttpErrorResponse
from conpaas.services.htcondor.agent impor... |
compare_num_layer_ghz_multiprocessing_adam.py | import qiskit
import numpy as np
import sys
import multiprocessing
sys.path.insert(1, '../')
import qtm.base, qtm.constant, qtm.ansatz, qtm.fubini_study, qtm.encoding
import importlib
importlib.reload(qtm.base)
importlib.reload(qtm.constant)
importlib.reload(qtm.ansatz)
# Init parameters
# For arbitrary initial state... |
05-tank-switchable-with-pen.py | #!/usr/bin/env python3
# Functionality:
# IR channel 0: normal tank
# IR channel 1: fast tank
# IR channel 2: slow tank
# backspace -> exit
# down -> toggle color saying
# up -> follow the current color
import math
import logging
import threading
import signal
import time
import ev3dev.ev3 as ev3
import sys
fro... |
server.py | #SERVER
import sender, reciever, threading, json
class Server:
def __init__(self):
self._ownHost = "127.0.0.1"
self._addresses = [ ("127.0.0.1", 4500),
("127.0.0.1", 4510),
("127.0.0.1", 4520),
("127.0.0.1",... |
server.py | #-----------------------------------------------------------
# Threaded, Gevent and Prefork Servers
#-----------------------------------------------------------
import datetime
import errno
import logging
import os
import os.path
import platform
import random
import select
import signal
import socket
import subprocess
... |
utils.py | #!/usr/bin/env python
import sys
import array
import numpy as np
from skimage.color import rgb2gray
from skimage.transform import resize
from skimage.io import imread
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from inputs import get_gamepad
import math
import threading
def resize_image(img)... |
system_monitor.py | """"
Records system information like CPU and RAM utilization or device temperatures.
"""
import sys
import subprocess
import psutil
# https://psutil.readthedocs.io/en/latest/#system-related-functions
from threading import Thread
def get_timestamp_from_dmesg(msg):
try:
return float(msg.split(b"]")[0][... |
conftest.py | import collections
import contextlib
import threading
import platform
import sys
import pytest
import trustme
from tornado import web, ioloop
from dummyserver.handlers import TestingApp
from dummyserver.server import run_tornado_app
from dummyserver.server import HAS_IPV6
# The Python 3.8+ default loop on Windows b... |
KafkaConsumerChanges.py | import sys
from datetime import datetime
from utility import Utils
try:
from kafka import KafkaConsumer
import xml.etree.ElementTree as ET
import time
import json
import threading
except Exception as e:
Utils.print_error("KafkaConsumerChanges", "Error while import", e)
# message code dictionar... |
preview_kivycamera.py | from kivy.app import App
from kivy.core.window import Window
from threading import Thread
from kivy.clock import mainthread
from kivy.utils import platform
from kivy.core import core_select_lib
from kivy.graphics import Rectangle, Color
from kivy.graphics.texture import Texture
from kivy.core.text import Label as CoreL... |
hyperv_neutron_agent.py | # Copyright 2013 Cloudbase Solutions SRL
# Copyright 2013 Pedro Navarro Perez
# 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... |
tests_ps.py | import logging
import json
import tempfile
from six.moves import BaseHTTPServer
import random
import threading
import subprocess
import socket
import time
import os
from random import randint
from .tests import get_realm, \
ZonegroupConns, \
zonegroup_meta_checkpoint, \
zone_meta_checkpoint, \
zone_buck... |
convert_to_tres_GUI.py | from convert_to_tres import convert
import threading
import sys
import time
import os
from PyQt5.QtWidgets import QWidget, QMessageBox, QApplication, QDesktopWidget, \
QVBoxLayout, QHBoxLayout, QPushButton, QLineEdit, QFileDialog, QLabel, \
QProgressBar, QErrorMessage, QComboBox
from queue import Que... |
sync.py | #
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.