source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
tests.py | import threading
import time
from multiple_database.routers import TestRouter
from django.db import (
DatabaseError, connection, connections, router, transaction,
)
from django.test import (
TransactionTestCase, mock, override_settings, skipIfDBFeature,
skipUnlessDBFeature,
)
from django.test.utils import... |
test_api.py | """
mbed SDK
Copyright (c) 2011-2014 ARM 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 License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
writer.py | import os
import time
from threading import Thread
from queue import Queue
import cv2
import numpy as np
import torch
import torch.multiprocessing as mp
from alphapose.utils.transforms import get_func_heatmap_to_coord
from alphapose.utils.pPose_nms import pose_nms
DEFAULT_VIDEO_SAVE_OPT = {
'savepath': 'examples... |
test_language_server.py | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import os
import time
import multiprocessing
import sys
from threading import Thread
from flaky import flaky
from pylsp_jsonrpc.exceptions import JsonRpcMethodNotFound
import pytest
from pylsp.python_lsp import s... |
manual.py |
import RPi.GPIO as GPIO
import time
import threading
import random
ServoLeftRightPos = 90
ServoUpDownPos = 90
g_frontServoPos = 90
g_nowfrontPos = 0
# engines of wheels
IN1 = 20
IN2 = 21
IN3 = 19
IN4 = 26
ENA = 16
ENB = 13
# supersonic wave
EchoPin = 0
TrigPin = 1
# RGB light
LED_R = 22
LED_G = 27
LED_B = 24
Fron... |
MPIRedirect.py | # Copyright 2014 Modelling, Simulation and Design Lab (MSDL) at
# McGill University and the University of Antwerp (http://msdl.cs.mcgill.ca/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at... |
swap.py | import os
import json
import sys
import time
import traceback
import zlib
from datetime import datetime, timedelta, timezone
from copy import copy
from urllib.parse import urlencode
import pandas as pd
import logging
import requests
from requests import ConnectionError
import queue
import threading
from vnpy.api.rest... |
test_backend.py | import base64
import copy
import datetime
import threading
import time
import unittest
from datetime import timedelta
from unittest.mock import Mock, patch
from django.conf import settings
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.core.cache import DEFAULT_CACHE_ALIAS,... |
wxdash.py | #!/usr/bin/python2.7
"""
wxdash.py
Created on Sat Apr 27 12:00:00 2013
@author: kyle
"""
from __future__ import print_function
import wx
import threading
import lcm
import random
import forseti2
import configurator
import settings
BLUE = (24, 25, 141)
GOLD = (241, 169, 50)
DEFAULT_FIELD_ITEMS = "smallfieldmap.j... |
stray.py | import os, sys
import pymsgbox
from PIL import Image
from pystray import Icon as icon, Menu as menu, MenuItem as item
from threading import Thread
class Stray:
def __init__(self, version=''):
self.title = 'TrydRPC'
self.version = version
self.image = Image.open(os.path.join(sys._MEIPASS if... |
_lib.py | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
"""Management of MPI worker processes."""
# pylint: disable=broad-except
# pylint: disable=too-many-lines
# pylint: disable=protected-access
# pylint: disable=missing-docstring
# pylint: disable=import-outside-toplevel
import os
import sys
import time
import atex... |
__init__.py | from threading import Thread
from typing import List
import tensorflow as tf
from queue import Queue
import numpy as np
from nboost.model.bert_model import modeling, tokenization
from nboost.model.base import BaseModel
from nboost.types import Choice
class BertModel(BaseModel):
def __init__(self, verbose=False, *... |
04_初识线程.py | import time
import threading
def task(a1, a2, a3):
time.sleep(2)
print('拿快递', a1+a2+a3)
def play():
print('和女朋友去耍')
def wm():
print('去拿外卖')
# 创建一个线程,让该线程去执行任务:函数
t1 = threading.Thread(target=task, args=(1, 2, 3,))
# 去执行吧
t1.start()
# 创建一个线程,让该线程去执行任务:函数
t2 = threading.Thread(target=play)
# 去执行吧
t2... |
log.py | """
Logging module for printing status during an exploit, and internally
within ``pwntools``.
Exploit Developers
------------------
By using the standard ``from pwn import *``, an object named ``log`` will
be inserted into the global namespace. You can use this to print out
status messages during exploitation.
For e... |
helpers.py | # -*- coding: utf-8 -*-
'''
:copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.support.helpers
~~~~~~~~~~~~~~~~~~~~~
Test support helpers
'''
# pylint: disable=repr-flag-used-in-string,wrong-import-order
... |
client-hammer.py | # this is a client to hammer API endpoints for test purposes
import argparse
import dotenv
import logging
import urllib3.exceptions
from datetime import datetime, timedelta, timezone
#from multiprocessing import Process, Pool
from threading import Thread
from swagger_client.api_client import ApiClient
from swagger_cl... |
run.py | # -*- coding: utf-8 -*-
__author__ = "苦叶子"
"""
公众号: 开源优测
Email: lymking@foxmail.com
"""
import sys
import os
import codecs
from flask import current_app, session, url_for
from flask_mail import Mail, Message
import threading
from threading import Thread
import multiprocessing
import time
import smtplib
from email.... |
mesh-remeshing.py | """Remeshing 2D in Grasshopper
Inputs:
boundary: A boundary curve
length: The target length of mesh edges
start: Computes the solution if `True`.
Output:
mesh: A Rhino mesh
"""
from __future__ import print_function
from __future__ import division
import rhinoscriptsyntax as rs
f... |
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... |
__init__.py | import traceback
import time
import os
import re
import argparse
import threading
import queue
import zipfile
import chardet
import inotify.adapters
ZIP_FILENAME_UTF8_FLAG = 0x800
def do_unzip(filename):
try:
zf = zipfile.ZipFile(filename)
except FileNotFoundError:
return
namelist = zf.n... |
test_pinserver.py | import unittest
import os
import json
import time
from multiprocessing import Process
from hmac import compare_digest
import requests
from ..client import PINClientECDH
from ..server import PINServerECDH
from ..pindb import PINDb
from ..flaskserver import app
from ..flaskserver import SESSION_LIFETIME
from wallycore... |
lib.py | #!/usr/bin/env python3
import glob
import os
import subprocess
import sys
import time
import traceback
from multiprocessing import Process
from os.path import exists
from threading import Thread
from broker import cfg, config
from broker._utils._log import br
from broker._utils.tools import _remove, is_process_on, lo... |
test_functional.py | # MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY ... |
server.py | import importlib
import threading
import socket
import logging
import time
import redis
import exceptions
from client import Client
from inventory import Inventory
from parser import Parser
modules = ["client_error", "house", "outside", "user_rating", "mail", "avatar",
"location_game", "relations", "social_... |
_msvccompiler.py | """distutils._msvccompiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for Microsoft Visual Studio 2015.
The module is compatible with VS 2015 and later. You can find legacy support
for older versions in distutils.msvc9compiler and distutils.msvccompiler.
"""
# Written by Perry ... |
manager.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import vim
import os
import sys
import json
import time
import operator
import itertools
import threading
import multiprocessing
from functools import partial
from functools import wraps
from .instance import LfInstance
from .cli import LfCli
from .utils import *
from .fuz... |
tests.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import errno
import os
import shutil
import sys
import tempfile
import threading
import time
import unittest
from datetime import datetime, timedelta
from django.core.cache import cache
from django.core.exceptions import SuspiciousFileOperation, Suspicio... |
PyBirthdayWish.py | #!/usr/bin/python3
import os,random
from threading import Thread
from time import sleep
import playsound
from termcolor import colored
from config import *
# Importing module specified in the config file
art = __import__(f'arts.{artFile}', globals(), locals(), ['*'])
def replaceMultiple(mainString, t... |
generate_traffic.py | import requests
import argparse
import threading
import time
import json
import random
import uuid
global url
global keycloak
global username
global password
global bearer_token
global bad_request_rate
global match_filter_rate
bridges = []
processors = []
def create_bridge():
while True:
if (random.ran... |
server.py | """
A high-speed, production ready, thread pooled, generic HTTP server.
For those of you wanting to understand internals of this module, here's the
basic call flow. The server's listening thread runs a very tight loop,
sticking incoming connections onto a Queue::
server = HTTPServer(...)
server.start()
->... |
split_data_gui.py | import sys
from tkinter import Tk, ttk, filedialog, Label, Entry, messagebox, StringVar, BooleanVar
from threading import Thread
from nsvision.classifier import split_image_data
from pathlib import Path
class SplitDataGui(Tk):
def __init__(self):
super(SplitDataGui,self).__init__() #Initialize Tk construct... |
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... |
accessory_driver.py | """AccessoryDriver - glues together the HAP Server, accessories and mDNS advertising.
Sending updates to clients
The process of sending value changes to clients happens in two parts - on one hand, the
value change is indicated by a Characteristic and, on the other, that change is sent to a
client. To begin, typically... |
__init__.py | from __future__ import annotations
import collections
from datetime import datetime
from decimal import Decimal
from functools import wraps
import operator
import os
import re
import string
from typing import (
TYPE_CHECKING,
Callable,
ContextManager,
Counter,
Iterable,
List,
Type,
)
import... |
workbench.py | # -*- coding: utf-8 -*-
import os.path
import platform
import tkinter as tk
import tkinter.font as tk_font
import traceback
from logging import getLogger
from tkinter import messagebox, ttk
import ast
import collections
import importlib
import pkgutil
import queue
import re
import shutil
import socket
import sys
from... |
imalcolm.py | #!/dls_sw/prod/tools/RHEL7-x86_64/defaults/bin/dls-python
import logging.config
import threading
import argparse
import atexit
import getpass
import json
import os
import sys
def make_async_logging(log_config):
from malcolm.compat import QueueListener, queue
# Now we have our user specified logging config, pi... |
coref_model.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import operator
import random
import math
import json
import threading
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import h5py
import util
import coref_ops
import conll
im... |
conftest.py | import logging
import os
import sys
from pathlib import Path
from threading import Thread
from time import sleep, time
from typing import TYPE_CHECKING, Any, List, Set, Tuple
import pytest
@pytest.fixture
def tmp_work_path(tmp_path: Path):
"""
Create a temporary working directory.
"""
previous_cwd = ... |
kenshin-rehash.py | #!/usr/bin/env python
# coding: utf-8
import os
import sys
import time
import urllib
import struct
import StringIO
from multiprocessing import Process, Queue
from kenshin import storage
from kenshin.agg import Agg
from kenshin.storage import Storage
from kenshin.consts import NULL_VALUE
from rurouni.utils import get_i... |
main.py | from src.api.lichess import Lichess
from src.chess.engine import ChessEngine
from src.db.db import DB
from datetime import datetime
import time
import sys
token = sys.argv[1]
engine = ChessEngine()
lichess = Lichess(token)
def game():
while True:
try:
stream = lichess.watchStream()
print(str... |
__init__.py | import CCAPython.gov.cca
from elastichpc import logging
from multiprocessing import Process, Value, Array, Pipe
# Setting Up Log
logger = logging.getLogger('root')
def manager_unit(component):
"""
This method is the manager unit. It will dispatch requests from
the environment to the other parallel units runn... |
dmm.py | # -*- coding: utf-8 -*-
import re, os
import threading
import time
from jinja2 import PackageLoader,Environment
from bs4 import BeautifulSoup
from queue import Queue
#from lxml import etree
from app.utils.func_requests import get_html_jp
from app.utils.loadini import read_config
from selenium import webdriver
from app... |
__init__.py | ############################################################################
#
# Copyright (c) Mamba Developers. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
############################################################################
""" Compon... |
updater.py | import os
import ssl
import bpy
import time
import json
import urllib
import shutil
import pathlib
import zipfile
import addon_utils
from threading import Thread
from collections import OrderedDict
from bpy.app.handlers import persistent
from .tools.translations import t
no_ver_check = False
fake_update = False
is_ch... |
main.py | from printer import *
from threading import Thread
from webapi import run
from crawl import Crawler
from tests import Tester
from config import config
import time
class Scheduler():
def test(self, cycle, url, *a):
"""
定时测试代理
"""
tester = Tester()
while True:
... |
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... |
gist.py | # -*- coding: utf-8 -*-
import sublime
import sublime_plugin
import os
import sys
import json
import functools
import webbrowser
import tempfile
import traceback
import threading
import shutil
PY3 = sys.version > '3'
if PY3:
from .request import *
from .settings import *
from .helpers import *
else:
... |
motorController.py | import threading as t
import socket, errno
import sys
import datetime
import time
import mraa
import math
def systemButton():
global systemOn
global shutdown
global con
switch = mraa.Gpio(12)
switch.dir(mraa.DIR_IN)
switch.mode(mraa.MODE_PULLUP)
systemLed = mraa.Gpio(2)
systemLed.dir(mraa.DIR_OUT)
while no... |
chess-timer.py | import tkinter as tk
import time
import datetime
from threading import Thread
def time_format(seconds):
return str(datetime.timedelta(seconds=seconds))
def timer(button):
global state
if button:
state = True
else:
state = False
def updater():
while True:
if state:
... |
terminal.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import sys
import time
import shlex
import codecs
import curses
import logging
import threading
import webbrowser
import subprocess
import curses.ascii
from curses import textpad
from multiprocessing import Process
from contextlib import context... |
core.py | r'''
The programming is used to occupy free video memories at the corresponding gpu_id.
$ python train.py --gpu-ids 0,1,2,3 --epochs 120 --options 0
$ python -m occupiedgpus.core --gpu-ids 0,1,2,3 --epochs 120 --options 0
'''
import argparse
import pynvml
import time
import torch
import torch.nn as nn
from threadi... |
manager.py | import logging
import threading
import time
import traceback
from functools import reduce
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.consensus.... |
USBPrinterOutputDeviceManager.py | # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from UM.Signal import Signal, signalemitter
from UM.Application import Application
from UM.Resources import Resources
from UM.Logger import Logger
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
from UM.i1... |
context.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... |
test_multiprocessing.py | # Owner(s): ["module: multiprocessing"]
import contextlib
import gc
import os
import sys
import time
import unittest
import copy
from sys import platform
import torch
import torch.cuda
import torch.multiprocessing as mp
import torch.utils.hooks
from torch.nn import Parameter
from torch.testing._internal.common_utils ... |
postgis2inventoryreport.py | import datetime
import argparse
from lib.database import Database
from lib.district import Districts
from lib.report_base.inventory_report import InventoryReport
from lib.mapcreator import MapCreator
import threading
def create_argument_parser():
"""
Create the parameters for the script
"""
parser = ... |
Zydra.py | #!/usr/bin/env python
import optparse
import zipfile
import rarfile # need unrar tools
import itertools
import string
import os
import crypt
import pyfiglet
from termcolor import cprint, colored
import time
import term # py-term
from datetime import timedelta
import sys
import threading
import shutil
import subproce... |
test_worker_infrastructure.py | import threading
import logging
import time
import pytest
from dexbot.worker import WorkerInfrastructure
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s')
@pytest.fixture(scope='module')
def account(prepare_account):
account = prepare_account({'MYBASE': 10000, 'MYQUOTE': 20... |
passive_watchtower.py | from threading import Thread
from time import sleep
from pytezos import pytezos
import argparse
contract_dict = {}
def contract_origin_search(p, contract_hash, verbose = 0):
start = 0
end = p.shell.head.header()["level"]
contract = p.contract(contract_hash)
found = -1
data = None
while found =... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import asyncio
from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence
from electrum_redd.storage import WalletStorage, StorageReadWriteError
from electrum_redd.wallet_db import Wallet... |
__init__.py | ''' module beeline '''
import functools
import logging
import os
import socket
from contextlib import contextmanager
from libhoney import Client
from beeline.trace import SynchronousTracer
from beeline.version import VERSION
from beeline import internal
# pyflakes
assert internal
USER_AGENT_ADDITION = "beeline-python... |
sublist3r.py | #!/usr/bin/env python
# coding: utf-8
# Sublist3r v1.0
# By Ahmed Aboul-Ela - twitter.com/aboul3la
# modules in standard library
import re
import sys
import os
import argparse
import time
import hashlib
import random
import multiprocessing
import threading
import socket
import json
from collections import Counter
# e... |
handlers.py | from tornado import gen, web, locks
import traceback
import urllib.parse
from notebook.base.handlers import IPythonHandler
import threading
import json
import os
from queue import Queue, Empty
import jinja2
from .pull import GitPuller
from .version import __version__
jinja_env = jinja2.Environment(loader=jinja2.Fil... |
SlaveServer.py | from SimpleXMLRPCServer import SimpleXMLRPCServer
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler
import xmlrpclib
import socket
import fcntl
import struct
import multiprocessing
import numpy as np
import sys
import json
import time
#import mkl
import os
#mkl.set_num_threads(1)
configs = json.load(open('/hom... |
utils.py | import re
import signal
import subprocess
import threading
import json
import os
import os.path
import itertools
import random
import sys
import resource
import shlex
import time
import math
'''
TODO:
- fix bug of consuming all memory
Changelog:
2018.07.09 Split config file in fixed-size bags using a generat... |
firehose.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# (c) B.Kerler 2018-2019
import binascii
import io
import platform
import time
import json
from struct import unpack
from binascii import hexlify
from queue import Queue
from threading import Thread
from edlclient.Library.utils import *
from edlclient.Library.gpt import gpt
f... |
__init__.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Simple python library for wirelesstags REST API.
See http://wirelesstag.net/apidoc.html for more details.
Current implementation includes:
- loading info for all available to user sensor tags
- manage local push notifications
- arm/disarm tags on monitoring for
humidity, ... |
iteration.py | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 01 20:00:29 2020
@author: Ing. Daniel Villarreal
"""
import sys
import time
from threading import Thread # Procesos en paralelo
from PyQt5.QtCore import QObject, pyqtSignal, Qt
from PyQt5.QtWidgets import QMainWindow, QApplication
#from PyQt5.uic import lo... |
fetching.py | from refbee.platforms import orcid_manual, viaf, acm, dimensions, dblp, dnb, google_scholar, semantic_scholar, microsoft_academic, wikidata
from multiprocessing import Process, Manager
import time
fetching_functions = {
"VIAF": viaf.paper_titles_for_id,
#"ACM Digital Library": acm.paper_titles_for_id,
"Di... |
TargetServer.py | #!/usr/bin/env python
import socket
import signal
import sys
import threading
import time
import SocketServer
import Util
import argparse
import os
LOG_FILE = 'log.txt'
filebusy = False;
"""
Append the provided line to the log file (log.txt) or
just generate the log string
"""
def log(line):
if logToFile:
... |
ctf.py | #!/usr/bin/env python
# encoding:utf-8
import commands
import gzip
import os
import re
import weakref
from cStringIO import StringIO
import pwn
from pwn import *
__all__ = [
'factor',
'gcd',
'ext_euclid',
'rsa_decrypt',
'unhex',
'ljust',
'rjust',
'gzipc',
'gzipd',
'shellcode',... |
helper.py | #!/usr/bin/env python
# coding: utf-8
# In[8]:
from io import StringIO
import os
import sys
from datetime import date
import re
import random
import math
from collections import Counter, namedtuple
import gc
import threading
import time
from itertools import cycle, chain, combinations
import itertools
import warning... |
context.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... |
listingfiles_w_interface.py | import os
from threading import Thread
from pathlib import Path
import pandas as pd
from hurry.filesize import size, verbose
from tkinter.ttk import *
from tkinter import *
'''ListingFiles_w_interface: This algorithm maps a directory and list its files names and sizes on a csv file (listingfiles.csv). It uses ... |
rdd.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... |
dhcp.py | #!/usr/bin/python3
import time
import threading
import struct
import queue
import collections
import traceback
import random
import socket
from listener import *
def get_host_ip_addresses():
return gethostbyname_ex(gethostname())[2]
class WriteBootProtocolPacket(object):
message_type = 2 # 1 for client -> ... |
ContextTest.py | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions... |
AWSBucketDump.py | #!/usr/bin/env python
# AWSBucketDump is a tool to quickly enumerate AWS S3 buckets to look for loot.
# It's similar to a subdomain bruteforcer but is made specifically to S3
# buckets and also has some extra features that allow you to grep for
# delicous files as well as download interesting files if you're not
# afr... |
ImageProcess.py | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers
# 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, ... |
__init__.py | import os
import pathlib
import subprocess
from pathlib import Path
from queue import Queue
from threading import Thread
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from uvicorn import Config, Server
from jina import __version__, __resources_path__
from jina.logging.logger import Ji... |
ida_script.py | #!/usr/bin/python
from __future__ import print_function
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
import threading
import idautils
import idc
import idaapi
# Save the database so nothing gets lost.
if idaapi.IDA_SDK_VERSION >= 700:
idaapi.save_database(idc.GetIdbPath())
else:... |
monobeast.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
gcreceiver.py | #!/usr/bin/env python3
#-*- coding:utf-8 -*-
"""
This module shows how the GameController Communication protocol can be used
in python and also allows to be changed such that every team using python to
interface with the GC can utilize the new protocol.
.. moduleauthor:: Nils Rokita <0rokita@informatik.uni-hamburg.de... |
test_app.py | from path import Path
import os, sys, asyncio
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
from multiprocessing import Process
import pytest
import pytestqt
import cadquery as cq
from PyQt5.QtCore import Qt, QSettings
from PyQt5.QtWidgets import QFileDialog... |
pretty_progress.py | # coding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from Queue import Empty
from multiprocessing import Process, Queue
from os import environ
from os.path import join
from re import sub
from sys import stderr, stdout
from time import sleep
from timeit import default_timer ... |
TCP_echo_client.py | #!/usr/bin/env python
#
# 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
# ... |
main.py | import socket
import sys
import select
import threading
import json
import queue
import time
from PyQt5 import QtCore
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import Qt
g_outbox = queue.Queue()
class PromptDialog(QDialog):
def __init__(self, question, parent=None):
super(... |
test_discriminator.py | # Load pre-trained network.
# if __name__ == '__main__':
import multiprocessing
import os
import pickle
from multiprocessing import Queue
import PIL
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
from skimage.transform import resize
from sklearn.metrics import roc_curve, confusion_matrix
imp... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from __future__ import with_statement
import os
import pickle
import random
import subprocess
import sys
import time
import unittest
from test import support
try:
imp... |
exp4.py | import os
import time
import torch
import torch.multiprocessing as mp
import torch.nn as nn
import numpy as np
import ray
@ray.remote
def f(i, x):
x[i][i] = 1
def g(i, x):
x[i][i] = 1
def main():
ray.init(num_cpus=8)
# x is modified
x = torch.zeros(8, 8)
x_id = ray.put(x)
ray.wait([f... |
randosu.py | import time
start = time.time() # lol
from src import std, taiko, catch, mania
from msvcrt import getch
import os
import sys
import webbrowser
import requests
import tempfile
import ctypes
import traceback
from datetime import datetime
from tqdm import tqdm
from functions import intro, crash, choose, exit
from multipro... |
__main__.py | """main module
"""
import argparse
import importlib.util
import os
import shutil
import tempfile
import threading
import uuid
import docker
import yaml
from . import preprocess
def __import_configurator(path):
conf_path = os.path.join(path, "configurator.py")
spec = importlib.util.spec_from_file_location("c... |
Main.py | from tkinter import messagebox
import sqlite3
from tkinter import *
from tkinter import filedialog
import webbrowser
from pynput.keyboard import Key, KeyCode, Listener
import threading
import time
from tkinter.font import Font
from functools import partial
from tkinter import ttk
conn = sqlite3.connect('Report_Counter... |
tcp_2_dash_bridge.py | import threading
import time
import paho.mqtt.client as mqtt
import ssl
import logging
import zmq
import signal
import socket
import configparser
import ipaddress
import netifaces
from collections import defaultdict
from zeroconf import IPVersion, ServiceInfo, Zeroconf, ServiceBrowser
# TODO: Add documentation
class... |
master.py | from collections import defaultdict
from datetime import datetime
import argparse
from queue import Queue
import numpy as np
import os
import torch
from torch import distributed as dist, nn, Tensor
import torchvision
import torchvision.transforms as transforms
from threading import Lock, Thread
from .resnet9 import R... |
basic_ops.py | import json
from random import choice, randint
from threading import Thread
from BucketLib.BucketOperations import BucketHelper
from BucketLib.bucket import Bucket
from Cb_constants import constants, CbServer, DocLoading
from basetestcase import ClusterSetup
from cb_tools.cbepctl import Cbepctl
from cb_tools.cbstats i... |
listener.py | from datetime import datetime
from main.src.python.oanda.oanda_date import OandaDate
from main.src.python.oanda.oanda_granularity import OandaGranularity
from main.src.python.download.frame_queue import FrameQueue
from main.src.python.oanda.oanda import Oanda
import pandas as pd
import threading
from time import sle... |
train_pg_f18.py | """
Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017
Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam
Adapted for CS294-112 Fall 2018 by Michael Chang and Soroush Nasiriany
"""
import numpy as np
import tensorflow as tf
import gym
import logz
import os
import time
im... |
speak_module.py | #import pyttsx3
from plyer import tts
import threading
# engine = pyttsx3.init() # Windows
# voices = engine.getProperty('voices')
# engine.setProperty('voice', voices[0].id)
# rate = engine.getProperty('rate')
# engine.setProperty('rate', rate-20)
def speak(text):
# tts.speak(text)
threading.Thread(
... |
http.py | import scrollphathd
from scrollphathd.fonts import font3x5
from argparse import ArgumentParser
try:
from queue import Queue
except ImportError:
from Queue import Queue
from .action import Action
from .stoppablethread import StoppableThread
try:
import http.client as http_status
except ImportError:
im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.