source
stringlengths
3
86
python
stringlengths
75
1.04M
email.py
from threading import Thread from flask import current_app, render_template from flask_mail import Message import time from . import mail def send_async_email(app, msg): with app.app_context(): try: mail.send(msg) # ๆœ‰ไบ›็ฝ‘็ซ™ๆŠŠ่ฟžๆŽฅๅพˆ็Ÿญ็š„่ฏทๆฑ‚ๅฝ“ไฝœๆถๆ„่ฎฟ้—ฎ except Exception as e: app....
test_thread.py
import multiprocessing, time,signal from time import gmtime, strftime from multiprocessing import Pool import progressbar def test1(): p = multiprocessing.Process(target=time.sleep, args=(1000,)) print p, p.is_alive() p.start() print p, p.is_alive() print strftime("%a, %d %b %Y %H:%M:%S +0000", gmt...
toolsMizogg.py
import json, requests, hashlib, codecs, ecdsa, base58, binascii, random import hmac, struct, sys, os, smtplib from rich import print import secp256k1 as ice import hashlib, codecs, ecdsa, base58, binascii, random import hmac, struct, sys, os, time import bit from bit import Key from bit.format import bytes_to_w...
convert_into_mosaic.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function # Imports import numpy as np from PIL import Image from tqdm import tqdm import argparse import os import re import subprocess import threading params = {} rgbg = "-r %.3f %.3f %.3f %.3f" dcraw_cmd = "dcraw%...
event.py
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Tests for the Event implementation (event.py) # # Copyright (C) 2017 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License vers...
plugin.py
# Domoticz WiZ connected Plugin # # Author: Syds Post sydspost@gmail.com # """ <plugin key="wiz" name="WiZ connected" author="Syds Post" version="1.0.0" wikilink="" externallink="https://www.wizconnected.com/"> <description> <h2>WiZ connected Plugin</h2><br/> This plugin is meant to control ...
test_util_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...
e2e.py
""" This is an end to end release test automation script used to kick off periodic release tests, running on Anyscale. The tool leverages app configs and compute templates. Calling this script will run a single release test. Example: python e2e.py --test-config ~/ray/release/xgboost_tests/xgboost_tests.yaml --test-...
multijinchengceshi.py
import multiprocessing import time import os def ceshi_pool(dictionary,lock,limit): while True: if dictionary['state'] == False: time.sleep(2) if dictionary['state'] == False: break lock.acquire() tmp = dictionary['number'] print("็”Ÿไบง่€…%s:ๅฝ“ๅ‰ๆฑ ไธญๆ•ฐ้‡...
hello.py
import os from threading import Thread from flask import Flask, render_template, session, redirect, url_for from flask_script import Manager, Shell from flask_bootstrap import Bootstrap from flask_moment import Moment from flask_wtf import FlaskForm from wtforms import StringField, SubmitField from wtforms.validators i...
C2Server.py
#!/usr/bin/env python3 import os, sys, datetime, time, base64, logging, signal, re, ssl, traceback, threading from urllib.request import urlopen, Request from urllib.error import HTTPError, URLError from urllib.parse import urlparse from poshc2.server.Implant import Implant from poshc2.server.Tasks import newTask from...
trevorc2_server.py
#!/usr/bin/env python #Copyright 2018, TrevorC2 by TrustedSec, LLC All rights reserved. """ TrevorC2 - legitimate looking command and control. Written by: Dave Kennedy @HackingDave Website: https://www.trustedsec.com GIT: https://github.com/trustedsec This is the server side which will clone a website of your choosin...
test_ns_client_sendsnapshot.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2021 4Paradigm # # 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 ...
test_all.py
import atexit import itertools import os from multiprocessing import Process import pytest from autodist import AutoDist from autodist.strategy.all_reduce_strategy import AllReduce from autodist.strategy.parallax_strategy import Parallax from autodist.strategy.partitioned_ps_strategy import PartitionedPS from autodis...
stolen_authcoin.py
############# options setting #################### import sys, getopt, os from get_host_ip import get_host_ip from validate_port import validate_port opts, args = getopt.getopt(sys.argv[1:], 'hp:s:k:') socket_host = '' socket_port = 4000 server_host = None server_port = None EXCEPTION = False port = None for op, val...
file_.py
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import re import io import hashlib import uuid import logging import warnings import threading import requests import leancloud from leancloud import client from leancloud import ut...
downloadclient.py
# Copyright 2018 CERN for the benefit of the ATLAS collaboration. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
test_local_catalog.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...
req.py
import os import sys from flask import Flask import requests as r import time import json from signal import signal, SIGINT import threading from datetime import datetime threads = 4 content = [0] * threads #inits list with threads number of 0s threadL = [] #Get a file from an onionshare address to add to list def g...
screens.py
import pygame import mopidy.core import mopidy.models import hashlib import json import logging import os import time import urllib.request import urllib.parse from threading import Thread from enum import Enum import socket from mopidy.models import Track from .graphic_utils import Progressbar, ScreenObjectsManager, ...
gcsio.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...
daemon.py
import os import re from pathlib import Path import json import threading import torch import rpyc # type: ignore from rpyc.utils.server import ThreadedServer # type: ignore from watchdog.observers import Observer # type: ignore from watchdog.events import FileSystemEventHandler # type: ignore from .persistor impor...
httpserver.py
import select import queue from threading import Thread from socketserver import ThreadingMixIn from http.server import HTTPServer, BaseHTTPRequestHandler from urllib.parse import urlparse, parse_qs import logging class Handler(BaseHTTPRequestHandler): def do_GET(self): app = self.server.getApp() req = "%s:%s - ...
interaction_view.py
import enum import logging from typing import Optional from threading import Thread from PySide2 import QtWidgets, QtCore from PySide2.QtWidgets import QMessageBox, QInputDialog, QLineEdit from .view import BaseView try: import nclib except ImportError: nclib = None try: import keystone except ImportError...
test_fetchers.py
from __future__ import unicode_literals import socket import unittest import warnings import responses import six from mock import Mock, patch, sentinel from six import StringIO from six.moves.BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from six.moves.urllib.error import HTTPError, URLError from six.move...
camera_func.py
#!/usr/bin/env python """ Functions related to the camera module. Part of ELEC4500 Senior Electronic Design I, Spring 2016 Dept. of Electrical Engineering and Technology Wentworth Institute of Technology. """ from threading import Thread from picamera.array import PiRGBArray from picamera import PiCamera class Scry...
build_pretraining_dataset.py
# coding=utf-8 # Copyright 2020 The Google Research 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 applicab...
run_validator.py
# encoding: utf-8 """ ้ชŒ่ฏๅ™จ้€ป่พ‘ """ import sys import socket import threading from queue import Queue import logging import time import requests from func_timeout import func_set_timeout from func_timeout.exceptions import FunctionTimedOut from db import conn from config import PROC_VALIDATOR_SLEEP, VALIDATE_THREAD_NUM fr...
test_cinderjit.py
# Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com) import _testcapi import asyncio import builtins import dis import gc import sys import tempfile import threading import traceback import types import unittest import warnings import weakref from compiler.consts import CO_NORMAL_FRAME, CO_SUPPR...
SMuRF_OLD.py
#!/usr/bin/python # Import modules import vcf as pyvcf import pysam import argparse import multiprocessing as mp import queue import time import sys import collections import subprocess import os import glob import pandas as pd import matplotlib.pyplot as plt import numpy as np import re from sklearn.mixture import Ga...
mitm.py
#!/usr/bin/env python3 import socket import argparse import threading import signal import json import requests import sys import time import traceback from queue import Queue from contextlib import contextmanager CLIENT2SERVER = 1 SERVER2CLIENT = 2 running = True num_atm_messages = 0 num_bank_responses = 0 bank_add...
tree.py
""" Module defining MathTree class and helper decorators. """ import ctypes import os, sys import threading import math import Queue from koko.c.libfab import libfab from koko.c.interval import Interval from koko.c.region import Region from koko.c.multithread import multithread, thre...
run-p4-sample.py
#!/usr/bin/env python3 # 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...
chatroom.py
''' ่Šๅคฉๅฎค-ๅˆฉ็”จredis็š„่ฎข้˜…/ๅ‘ๅธƒๆฅๅฎŒๆˆไธ€ไธช็ฎ€ๅ•็š„่Šๅคฉๅฎค็š„ๆž„ๅปบ ๅฏไปฅๅผ€ๅฏไธคไธชๆจกๆ‹Ÿ่Šๅคฉๅฎค ่ฟ™ไธชๆœ‰็ฉบ็š„ๆ—ถๅ€™ๅฏไปฅ็ป“ๅˆangularๅšไธชๅ‡็บง็‰ˆๆœฌ็š„่Šๅคฉๅฎค ''' import rediscommon,time,json,threading r = rediscommon.r def listen(): pubsup = r.pubsub() pubsup.subscribe(['chat']) for item in pubsup.listen(): if item['type'] == 'message': print("\n"+json.loads(item...
utils.py
# -*- coding: utf-8 -*- from __future__ import print_function __true_print = print # noqa import os import sys import pdb import time import json import datetime import argparse import threading import logging import string import random # import multiprocessing # import numpy # import psutil import h5py # import do...
sendmsg.py
import requests import threading import time import urllib.parse # ๅผ€ๅง‹ๆ—ถ้€šๆŠฅ def start_notice(): # pass return { # ่ฟ™ไธชๆ˜ฏ็พคๅท๏ผŒไฝ ๆ”นๆˆ่‡ชๅทฑๆœบๅ™จไบบๅŠ ๅ…ฅ็š„้‚ฃไธช็พคๅฐฑ่กŒไบ† 'group_id': 387017550, 'message': 'ๅฐ็ง˜ไนฆๅทฒๅฏๅŠจ๏ฝžไฝ ๅฏไปฅ้€š่ฟ‡ไพ‹ๅฆ‚ใ€#helpใ€‘๏ผˆไธๅซไธญๆ‹ฌๅท๏ผ‰ๆฅๆŸฅ็œ‹ๅ…จ้ƒจๅ‘ฝไปค๏ฝž็Žฐๅœจๆ—ถ้—ดๆ˜ฏ %s' % time.strftime("%Y-%m-%d %H:%M:%S", ...
main.py
import json import requests import services.common.vars as vars import services.common.tools as tools import re from threading import Thread # This is a function that will be used to convert Arth numbers into the standard # AGI locus used on Araport. This function is used in the threading. def convert_to_locus(element...
test_serialization.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
high_level.py
""" High level abstraction interfaces to DFFML. These are probably going to be used in a lot of quick and dirty python files. """ import asyncio import pathlib from typing import Optional, Tuple, List, Union, Dict, Any, AsyncIterator from .record import Record from .df.types import DataFlow, Input from .df.memory impo...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest from test import support import socket import select import time import datetime import gc import os import errno import pprint import urllib.request import threading import traceback import asyncore import weakref import platform import functools impor...
inputhook.py
""" Similar to `PyOS_InputHook` of the Python API. Some eventloops can have an inputhook to allow easy integration with other event loops. When the eventloop of prompt-toolkit is idle, it can call such a hook. This hook can call another eventloop that runs for a short while, for instance to keep a graphical user inter...
linutil.py
import os import re import glob import socket import struct import logging import binascii import threading import subprocess import netfilterqueue from debuglevels import * from collections import defaultdict from . import diverterbase class IptCmdTemplateBase(object): """For managing insertion and removal of ip...
word_trends_figure.py
# # Copyright 2019-2020 Lukas Schmelzeisen # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
worker.py
import copy from typing import Dict, Any from queue import Queue from threading import Thread from typing import NoReturn, List, Dict from cv2 import aruco from .detector_utils import load_inference_graph, detect_objects,\ get_center_points, draw_box_on_image from .calibration import Calibration from .synchroniz...
common.py
# Copyright 2021 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from enum import Enum from functools import wraps from pathlib import...
linkedin.py
#linkedin # #url= "https://www.linkedin.com/jobs/search?keywords=Python&location=New%20York%2C%20New%20York%2C%20United%20States&geoId=102571732&trk=public_jobs_jobs-search-bar_search-submit&redirect=false&position=1&pageNum=" ''' for i in range(1,5): all_data=scrape( all_data , url+str(i) , ' new york') ''' ...
example.py
#!/usr/bin/env python3 import os import torch import torch.distributed as dist import numpy as np from torch.multiprocessing import Process import lapse from signal import signal, SIGINT from sys import exit import threading num_nodes = 4 # number of nodes num_workers_per_node = 2 # number of worker threads per nod...
unit.py
import os import re import sys import json import time import shutil import socket import select import platform import tempfile import unittest import subprocess from multiprocessing import Process class TestUnit(unittest.TestCase): pardir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) ...
simulation_server.py
#!/usr/bin/env python3 # Copyright 1996-2020 Cyberbotics Ltd. # # 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 applic...
DiscoTiro.py
import discord import Client import shlex import argparse import response import threading import analizemedicale import json import requests import hashlib import imghdr import asyncio from multiprocessing import Process from discord.ext import commands with open("auth.json") as json_file: config = json.load(jso...
TestPooledDB.py
"""Test the PooledDB module. Note: We don't test performance here, so the test does not predicate whether PooledDB actually will help in improving performance or not. We also assume that the underlying SteadyDB connections are tested. Copyright and credit info: * This test was contributed by Christoph Zwerschke """...
run_app.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Browser based Web App Purpose: Battery Monitoring on a RPI with a PICAN2 Board Version: 4/2018 Roboball (MattK.) """ import dash from dash.dependencies import Input,Output, State, Event import dash_core_components as dcc import dash_html_components as html import base64...
test_memory_mapped_file_reader.py
from threading import Thread import pytest from yellowdog_client.object_store.utils import MemoryMappedFileReaderFactory class TestMemoryMappedFileReader(object): @pytest.fixture def populated_file(self, tmpdir): p = tmpdir.mkdir("sub").join("reader.txt") p.write("111-222-333-444-555-666-") ...
version.py
"""Copyright OGB https://github.com/snap-stanford/ogb/blob/master/ogb/version.py """ import os import logging from threading import Thread __version__ = '0.8.0' try: os.environ['OUTDATED_IGNORE'] = '1' from outdated import check_outdated # noqa except ImportError: check_outdated = None def check(): ...
KernelData.py
import ctypes, threading, sys import logging from time import sleep from ProcessMemoryHandle import * import BaseAddressOffset from concurrent.futures import ThreadPoolExecutor class Offset: def __init__(self, is_steam: bool): """ๅŸบๅ€ๅ็งป\n is_steam bool:ๆ˜ฏๅฆไธบsteam็‰ˆ True ๆ˜ฏ|False ไธๆ˜ฏ """ i...
spark.py
from __future__ import print_function import copy import numbers import threading import time import timeit from hyperopt import base, fmin, Trials from hyperopt.utils import coarse_utcnow, _get_logger, _get_random_id try: from pyspark.sql import SparkSession _have_spark = True except ImportError as e: _...
ob_logger.py
import json import pymongo import sys import time from bot_utils import get_data, get_pairs, save_to_mongo from multiprocessing import Process MIN_TIME = 30 old_stdout = sys.stdout def mini_logger(symbol, conf, limit, auth_string, db_name, exchanges): print("I've started: {}".format(symbol)) client = pymon...
console.py
from __future__ import absolute_import, division, print_function import asyncio import copy import json import logging import os import random import string import threading import time from code import InteractiveConsole from decimal import Decimal from enum import Enum from os.path import exists, join from eth_acco...
pubsub_MW.py
#!/usr/bin/env python # Copyright 2020-present Iman lotfimahyari. # # 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 appl...
schedule_item.py
# Copyright (c) 2015 Cloudera, 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 o...
build_environment.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """ This module contains all routines related to setting up the package build environment. All of this is set up by packa...
Islam.py
#!/usr/bin/python # coding=utf-8 #jangan Lupa doa ya #semoga sukses # (Arif.Isal) PEMBUAT #SUBSCRIBE CHANNEL Arief-Isal #FOLLOW INSTAGRAM @Id-f #Import module import os,sys,time,datetime,random,hashlib,re,threading,json,getpass,urllib,cookielib from multiprocessing.pool import ThreadPool try: import mechanize except ...
task.py
""" Backend task management support """ import itertools import json import logging import os import re import sys import warnings from copy import copy from datetime import datetime from enum import Enum from multiprocessing import RLock from operator import itemgetter from tempfile import gettempdir from threading im...
test_daemon_factory.py
import functools import logging import pprint import re import sys import time import psutil import pytest from saltfactories.exceptions import FactoryNotRunning from saltfactories.exceptions import FactoryNotStarted from saltfactories.factories.base import DaemonFactory from saltfactories.utils import platform from ...
data_collector.py
from common.travis_checker import travis from selfdrive.swaglog import cloudlog from common.realtime import sec_since_boot from common.op_params import opParams import threading import os op_params = opParams() class DataCollector: def __init__(self, file_path, keys, write_frequency=60, write_threshold=2, log_data...
test_drop.py
import os , sys sys.path.append(os.getcwd()) import pytest import asyncio import time from async_timeout import timeout from cx_Oracle_async import * import cx_Oracle import threading async def create_long_query(oracle_pool): async with oracle_pool.acquire() as conn: cursor = await conn.cursor() tr...
main.py
from subprocess import Popen, PIPE from threading import Thread from queue import Queue, Empty import atexit import os import sys agent_processes = [None, None] t = None q = None def cleanup_process(): global agent_processes for proc in agent_processes: if proc is not None: proc.kill() def...
detector.py
import os import sys from threading import Thread from queue import Queue import cv2 import numpy as np import torch import torch.multiprocessing as mp from alphapose.utils.presets import SimpleTransform from alphapose.models import builder class DetectionLoader: def __init__( self, input_source, detec...
node.py
import socket from threading import Thread from time import sleep import logging import random from typing import Optional import rsa from .peer import Peer from ..config import Config from ..protocol import Header, Message, types, utils class Node(Thread): def __init__(self, port: int, b_addr: tuple[str, int]):...
reader.py
import os import time import uuid import csv import shutil from multiprocessing import Process, Pipe try: from urllib.request import Request, urlopen # Python 3 except: from urllib2 import Request, urlopen # Python 2 class Reader(object): def __init__(self, url, debug=True): super(Reader, se...
main.py
#!/usr/sbin/env python import click import ipaddress import json import netaddr import netifaces import os import re import subprocess import sys import threading import time from socket import AF_INET, AF_INET6 from minigraph import parse_device_desc_xml from portconfig import get_child_ports from sonic_py_common im...
tdvt.py
""" Test driver script for the Tableau Datasource Verification Tool """ import sys if sys.version_info[0] < 3: raise EnvironmentError("TDVT requires Python 3 or greater.") import argparse import csv import glob import json import pathlib import os import queue import shutil import threading import time impor...
test_lib_lmdbslab.py
import os import asyncio import pathlib import multiprocessing import synapse.exc as s_exc import synapse.glob as s_glob import synapse.common as s_common from unittest.mock import patch import synapse.lib.base as s_base import synapse.lib.const as s_const import synapse.lib.lmdbslab as s_lmdbslab import synapse.lib....
st2.py
#coding:utf-8 from errbot import BotPlugin, re_botcmd, botcmd from st2client.client import Client import subprocess import copy import re import logging import threading import time import requests from requests.auth import HTTPBasicAuth class St2(BotPlugin): """ Stackstorm plugin for authentication and Actio...
Mysql_brute_Plugin.py
#!/usr/bin/env python3 import sys import argparse import MySQLdb from os import path from time import sleep from datetime import datetime from threading import Thread, activeCount # Default status variables. success = False allowed = True connectable = True lost_connection = False unknown = False # Get version. def g...
multiproc.py
#!/usr/bin/env python # # Copyright 2016 Blaise Frederick # # 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...
packageinfo.py
# Copyright (c) 2015, Fundacion Dr. Manuel Sadosky # 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 condit...
tiebaspider.py
#!/usr/bin/python # -*- coding: UTF-8 -*- import urllib2 import time import redis from pymongo import MongoClient from bs4 import BeautifulSoup import requests import urlparse import json import config import multiprocessing import sys reload(sys) sys.setdefaultencoding('utf-8') headers = {'User-Agent': 'Mozilla/5.0 ...
eliza.py
import logging import random import re import threading import emotion_dynamics # Fix Python2/Python3 incompatibility try: input = raw_input except NameError: pass log = logging.getLogger(__name__) class Key: def __init__(self, word, weight, decomps): self.word = word self.weight = weigh...
test_waffle.py
from __future__ import unicode_literals import random import threading import unittest from django.contrib.auth import get_user_model from django.conf import settings from django.contrib.auth.models import AnonymousUser, Group from django.db import connection, transaction from django.test import RequestFactory, Trans...
test_cs.py
from socket import timeout import threading import time from hks_pylib.logger.standard import StdUsers from tests import schemes from tests.schemes import MyProtocols, SubmitRoles from tests.submit_scheme import SubmitServerScheme, SubmitClientScheme from csbuilder.server import Listener from csbuilder.client import...
language_server.py
import enum import logging import os from snooty.lsp import CompletionItemKind import sys import threading from urllib.parse import urlparse, unquote from urllib.request import url2pathname from collections import defaultdict from dataclasses import dataclass from functools import wraps from pathlib import Path, PurePa...
train_schedule.py
import subway_pb2 import gtfs_realtime_pb2 import os from datetime import datetime, timedelta import sqlite3 import multiprocessing as mp from multiprocessing import Process from pprint import pprint as pp import queue from google.protobuf.message import DecodeError import re def parse_proto(file): with open...
server.py
import numpy as np import os import io # import for server from flask import Flask, render_template, request, Response, send_file, jsonify from queue import Queue, Empty import threading import time # import for model from transformers import AutoTokenizer, AutoModelWithLMHead, top_k_top_p_filtering from torch.nn imp...
start_sploit.py
#!/usr/bin/env python3 import argparse import binascii import itertools import logging import os import random import re import stat import subprocess import sys import threading import time from concurrent.futures import ThreadPoolExecutor from enum import Enum from math import ceil from urllib.parse import urljoin ...
tttt.py
'''' ะฟะพัั‚ ะฟั€ะพ ั€ะตะณัƒะปัั€ะบะธ https://habr.com/ru/post/349860/ ั‚ะตัั‚ะตั€ ั€ะตะณัƒะปัั€ะพะบ https://regex101.com/r/ ะดะพะบัƒะผะตะฝั‚ะฐั†ะธั ะฑั https://www.crummy.com/software/BeautifulSoup/bs4/doc/ ''' # ะฟั€ะธะผะตั€ ะธัะฟะพะปัŒะทะพะฒะฐะฝะธั ั„ะปะฐะถะบะฐ # import time # done_flag=False # while done_flag==False: # try: # print("stuff done...
keypoints.py
import os import sys import argparse import time import freenect import cv2 import numpy as np import pprint from multiprocessing import Process, Queue class Pose: """Pose estimation class bridging OpenPose and Kinect Args: params: OpenPose custom params (refer to OpenPose include/openpose/flags.hpp f...
manager.py
from dataclasses import dataclass import logging import threading import time import traceback from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Set, Tuple from concurrent.futures.thread import ThreadPoolExecutor from blspy import G1Element from chiapos import DiskProver from chia.conse...
test_decorator.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import os import subprocess import sys import threading import unittest from concurrent.futures import ThreadPoolExecutor, as_completed from maro.communication import Proxy, SessionMessage, dist from utils import get_random_port, proxy_generato...
LocalServerController.py
__author__ = 'Edward J. C. Ashenbert' __credits__ = ["Edward J. C. Ashenbert"] __maintainer__ = "Edward J. C. Ashenbert" __email__ = "nguyenquangbinh803@gmail.com" __copyright__ = "Copyright 2020" __status__ = "Working on demo in Can Tho city" __version__ = "1.1.0" import sys import os sys.path.append(os.path.dirname...
conftest.py
# Copyright (c) 2011 Florian Mounier # Copyright (c) 2011 Anshuman Bhaduri # Copyright (c) 2014 Sean Vig # Copyright (c) 2014-2015 Tycho Andersen # # 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 Soft...
ci.py
def md5(fname): import hashlib hash_md5 = hashlib.md5() with open(fname, "rb") as f: for chunk in iter(lambda: f.read(4096), b""): hash_md5.update(chunk) return hash_md5.hexdigest() def findFiles(path_to_watch, arg_files): import os, fnmatch matches = [] for root, dirname...
portable_runner.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...
vnethandler.py
from pox.core import core import pox.openflow.libopenflow_01 as of from pox.lib.revent import * from pox.lib.util import dpidToStr from pox.lib.util import str_to_bool from pox.lib.recoco import Timer from pox.lib.packet import ethernet import time import threading import asyncore import collections import logging imp...
threading.py
from concurrent.futures import Future from contextlib import contextmanager import functools from itertools import count import os from selectors import DefaultSelector, EVENT_READ import socket from queue import Queue, Full as QueueFull from threading import Lock, Thread import time from typing import Optional from j...
test.py
import logging import random import threading import time from collections import Counter import pytest from helpers.cluster import ClickHouseCluster cluster = ClickHouseCluster(__file__) node1 = cluster.add_instance("node1", macros={"cluster": "test1"}, with_zookeeper=True) # Check, that limits on max part size for...
stockHacker.py
import datetime import operator import threading import time import util.logUtil as log import easyquotation # from dbUtil import mysqlUtil from time import strftime, localtime from entity.AlternativeStockPool import AlternativeStockPool from simulationTrader.service import alternativeStockPoolService from simulation...
__init__.py
# Copyright 2019 Uber Technologies, 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 applica...
Hiwin_RT605_ArmCommand_Socket_20190627184219.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import socket ##ๅคšๅŸท่กŒๅบ import threading import time import sys import matplotlib as plot import HiwinRA605_socket_TCPcmd as TCP import HiwinRA605_socket_Taskcmd as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.srv imp...
_v4__vision_capture.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # COPYRIGHT (C) 2014-2020 Mitsuo KONDOU. # This software is released under the MIT License. # https://github.com/konsan1101 # Thank you for keeping the rules. import sys import os import queue import threading import subprocess import datetime import tim...