source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
model.py | # coding=utf-8
from __future__ import print_function
import logging, os, numbers, six, numpy, threading, inspect, time
from os.path import isfile
import phi.fluidformat, phi.math.nd
from phi.viz.plot import PlotlyFigureBuilder
def synchronized_method(method):
outer_lock = threading.Lock()
lock_name = "__" + m... |
async_asyncio_client.py | #!/usr/bin/env python3
"""
Pymodbus Asynchronous Client Examples
--------------------------------------------------------------------------
The following is an example of how to use the asynchronous modbus
client implementation from pymodbus with asyncio.
The example is only valid on Python3.4 and above
"""
import as... |
multiple_instances_advance.py | #!/usr/bin/env python
from __future__ import print_function
from random import choice, random
from time import sleep
from vizdoom import *
# For multiplayer game use process (ZDoom's multiplayer sync mechanism prevents threads to work as expected).
from multiprocessing import Process
# For singleplayer games threads... |
api.py | """Remotely control your Coinbase Pro account via their API"""
import re
import json
import hmac
import hashlib
import time
import requests
import base64
import sys
import pandas as pd
from numpy import floor
from datetime import datetime, timedelta
from requests.auth import AuthBase
from requests import Request
from ... |
decorators.py | # -*- coding: utf-8 -*-
"""
decorators
~~~~~~~~~~~~~~
Decorators definition.
:copyright: (c) 2016 by fengweimin.
:date: 16/8/15
"""
from functools import wraps
from threading import Thread
from flask import abort
from flask_login import current_user
def async_exec(f):
""" Async execution. ... |
Server.py | from flask import Flask, request
from SSH import SSHConnector
from SSHTunnel import SSHTunnelConnector
#from waitress import serve
from WinRM import WinRMConnector
import os
import time
import sys
import threading
import warnings
app = Flask("LIMAN")
connections = {}
@app.route("/new", methods=['POST'])
def new_con... |
GetLuooMp3.py | import os
import requests
import time
from bs4 import BeautifulSoup
from faker import Factory
import queue
import threading
from sqlalchemy import Column, String, create_engine
from sqlalchemy import Integer
from sqlalchemy import Text
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import decla... |
process.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
# Import python libs
import logging
import os
import time
import sys
import multiprocessing
import signal
import threading
import Queue
# Import salt libs
import salt.utils
import salt.ext.six as six
log = logging.getLogger(__name__)
HAS_PSUTIL = Fals... |
base_crash_reporter.py | # Electrum - lightweight Bitcoin client
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish... |
reminders.py | """This module allows to set and manage reminders."""
from __future__ import (
unicode_literals,
absolute_import,
print_function,
division
)
import os
import re
import time
import threading
import collections
import codecs
from datetime import datetime
from sopel.module import commands, example, NOLIM... |
PotentialMatch_Cleanser.py | #!/usr/bin/python
"""
POTENTIAL ADDRESS CLEANSING BASED ON GOOGLE GEOCODER API and SequenceMatcher
RETURNS THE CROSS STREETS, POTENTIAL BUSINESSES AND THE NO MATCHES
"""
import json
import logging
import os
import re
import uuid
from difflib import SequenceMatcher
import itertools
import requests
import sys
im... |
test_connection_pool.py | import os
import re
import time
from threading import Thread
from unittest import mock
import pytest
import redis
from redis.connection import ssl_available, to_bool
from .conftest import _get_client, skip_if_redis_enterprise, skip_if_server_version_lt
from .test_pubsub import wait_for_message
class DummyConnectio... |
example_client.py | from __future__ import print_function
import os
import sys
import time
import logging
import threading
from functools import partial
from logcollector.client_utils import make_log_collecting_decorator
def main():
# logger name is not important; root logger (and above) is monitored.
logger = logging.getLog... |
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, Iterator
from concurrent.futures.thread import ThreadPoolExecutor
from blspy import G1Element
from chiapos import DiskProver
from ... |
mainloop.py | import asyncio
from asyncio import events
from flask import Flask
from importlib import import_module
import json
from logging import basicConfig, INFO, info, DEBUG, debug
from os import listdir
import strictyaml
from sys import platform
from time import sleep
from threading import Thread
from queue import SimpleQueue... |
__init__.py | # -*- coding: utf-8 -*-
#
# This file is part of RPIO.
#
# Copyright
#
# Copyright (C) 2013 Chris Hager <chris@linuxuser.at>
#
# License
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Softw... |
threaded_dispatch.py | #!/usr/bin/env python
import subprocess
import configparser
from threading import Thread
from queue import Queue
import time
"""
A threaded ssh based command dispatch system
"""
start = time.time()
queue = Queue()
def readConfig(file="config.ini"):
"""Extract IP addresses and CMDS from config file and returns tup... |
client.py | import socket
from threading import Thread
from queue import *
from message import *
class Client:
def __init__(self, username, socket, address):
self.address = address
self.username = username
self.socket = socket
self.awaiting_messages = Queue()
self.running = True
... |
oauth_handler.py | #
# Copyright 2019 EPAM Systems
#
# 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 a... |
main.py | # coding=utf-8
import asyncio
import datetime
import html
import os
import re
import threading
import time
import discord
import requests
from .configparser import ConfigParser
from .nsen import Nsen
from .utils import getCustomLogger
class Bot:
def __init__(self):
self.running = False
if not discord.opus.is_... |
myplex.py | # -*- coding: utf-8 -*-
import copy
import threading
import time
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT,
X_PLEX_IDENTIFIER, log, logfilter, utils)
from plexapi.base import PlexObject
from plexapi.exceptions import BadRequest, NotFound, Unauth... |
thread_asyncio_server.py | import asyncio
import zlib
import queue
import threading
import audioop
from google.cloud import speech
from config.config import Config
from config.config import Server
buffer = queue.Queue()
buffer_response = queue.Queue()
def chunks():
while True:
try:
yield buffer.get(timeout = 1)
... |
guagetest.py | import wx
import time
import threading
class Mywin(wx.Frame):
def __init__(self, parent, title):
super(Mywin, self).__init__(parent, title=title, size=(300, 200))
self.InitUI()
def InitUI(self):
self.thread = threading.Thread(target=self.targetThread)
self.thread.setDaemon(True... |
test_sender.py | #!/usr/bin/env python
import unittest
import logging
from mock import MagicMock
from multiprocessing import Process, Queue
import os
import random
import sys
import time
sys.path.insert(0, os.path.abspath('..'))
from context import Context
from sender import Sender
class SenderTests(unittest.TestCase):
def te... |
plugin.py | ###
# Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2008-2010, James McCoy
# Copyright (c) 2014, Valentin Lorentz
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistribution... |
run_squad_ColabTCPTrans_quicktest_20191119.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
master.py | import sys
import socket
import os
from argparse import ArgumentParser
import requests
import time
import datetime
import pdb
import random
import threading
import multiprocessing
import json
import yaml
from dxf import *
from multiprocessing import Process, Queue
import importlib
import hash_ring
from mimify import r... |
latextools_plugin.py | '''
Plugin auto-discovery system intended for use in LaTeXTools package.
Overview
========
A plugin is a Python class that extends LaTeXToolsPlugin and provides some
functionality, usually via a function, that LaTeXTools code interacts with.
This module provide mechanisms for loading such plugins from arbitrary files... |
dag_processing.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... |
noteblocker.py | import os
import sys
import time
import shutil
import subprocess
import threading
import traceback
import math
def pip_import(module, pipname=None):
pipname = pipname or module
try:
globals()[module] = __import__(module)
except ImportError:
print("ERROR: could not load module ... |
test_run_engine.py | from event_model import DocumentNames
import threading
import types
import os
import signal
import sys
from collections import defaultdict
import time as ttime
import pytest
from bluesky.tests import requires_ophyd
from bluesky.run_engine import (RunEngineStateMachine,
TransitionError, I... |
main.py | import numpy as nm
import pytesseract
import re
import pydirectinput
import time
import cv2
import math
from PIL import ImageGrab
from PIL import ImageFilter
import sched
import sys
import tkinter
from tkinter import ttk, simpledialog, messagebox
from throttle import *
import requests
import logging
from win32 import w... |
collective_ops_test.py | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
settings_20210906113725.py | """
Django settings for First_Wish project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathli... |
__init__.py | #!/usr/bin/env python3
"""Library for performing speech recognition, with support for several engines and APIs, online and offline."""
import io
import os
import subprocess
import wave
import aifc
import math
import audioop
import collections
import json
import base64
import threading
import platform
import stat
impo... |
manages.py | # -*- coding: UTF-8 -*-
__author__ = 'Joynice'
import queue
import re
import threading
import requests
from faker import Faker
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from lxml import etree
from app import create_app
from exts import db
from models import Poem, Poet
user_ag... |
Helper.py | import threading
from utils.Checker import Checker
class Helper():
def url_is_internal(url,compare):
# url is the param needed to be compared to compare
if ".".join(extract(url)) == ".".join(extract(compare)) or (url[0:4] != "http" and url[0] != "#"):
return True
else:
... |
poll.py | # pylint: disable=W1202, I1101
import threading
import urllib.error
import urllib.parse
import urllib.request
from random import uniform
import requests
from lxml import etree
from oadr2 import base, logger
# HTTP parameters:
REQUEST_TIMEOUT = 5 # HTTP request timeout
DEFAULT_VTN_POLL_INTERVAL = 300 # poll the VTN... |
test_oauth2.py | # coding: utf-8
from __future__ import unicode_literals
from functools import partial
import re
from threading import Thread
import uuid
from mock import Mock, patch
import pytest
from six.moves import range # pylint:disable=redefined-builtin
# pylint:disable=import-error,no-name-in-module,wrong-import-order,relat... |
watcher.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import uuid
from typing import Sequence
from .zmq_wrapper import ZmqWrapper
from .watcher_base import WatcherBase
from .lv_types import CliSrvReqTypes
from .lv_types import DefaultPorts, PublisherTopics, ServerMgmtMsg
from . import utils
import t... |
upgrade_through_versions_test.py | import operator
import os
import pprint
import random
import signal
import time
import uuid
import logging
import pytest
import psutil
from collections import defaultdict, namedtuple
from multiprocessing import Process, Queue
from queue import Empty, Full
from cassandra import ConsistencyLevel, WriteTimeout
from cass... |
test_sys.py | # -*- coding: iso-8859-1 -*-
import unittest, test.support
import sys, io, os
import struct
class SysModuleTest(unittest.TestCase):
def setUp(self):
self.orig_stdout = sys.stdout
self.orig_stderr = sys.stderr
self.orig_displayhook = sys.displayhook
def tearDown(self):
sys.stdo... |
device_manager.py | #!/usr/bin/env python
##############################################################################
# Copyright 2020-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
################################... |
iterate_service.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# import python libs
from flask import Flask
from flask import jsonify
from flask import request
from pprint import pprint as pp
import argparse
import json
import logging
import sys
import socket
import requests
import threading
# import project libs
sys.path.append('... |
plugin.py | import time
import threading
import serial
class Plugin:
CONFIG=[
{
'name': 'device',
'description': 'set to the device path (alternative to usbid)',
'default': '/dev/ttyUSB_SeatalkOut'
},
{
'name': 'usbid',
'description': 'set to the usbid of the device (alternative to dev... |
convert_clip_multiprocess.py | import os
import sys
sys.path.append(os.getcwd())
from utils import *
from utils.transformation import quaternion_from_euler
from mujoco_py import load_model_from_path
from mocap.skeleton import Skeleton
from mocap.pose import load_bvh_file, interpolated_traj
import pickle
import glob
import argparse
import time
impo... |
main.py | import queue
import threading
import os
import pygame
import sys
from GUI.board_gui import *
from mcts.nodes import *
from mcts.search import MonteCarloTreeSearch
from state import GameState
from state import GameMove
from position import Position
from board import *
import pygame_textinput
import re
import time
def ... |
sdworker.py | import sublime
import threading
import traceback
import sys
import queue
from GoDebug.jsonrpctcp_client import JsonRpcTcpClient
from GoDebug.jsonrpctcp_client import JsonRpcTcpProtocolError
def __start(connect, const, logger):
logger.debug("Start worker")
try:
connect._open(const.HOST, const.PORT)
... |
rabbit_mq_client.py | # Copyright 2016 deepsense.ai (CodiLime, 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 agree... |
test_replica_set_connection.py | # Copyright 2011-2012 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
run.py | # -*- coding: utf-8 -*-
__author__ = "苦叶子"
"""
公众号: 开源优测
Email: lymking@foxmail.com
"""
import sys
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.mime.text ... |
test_replication.py | """TestCases for distributed transactions.
"""
import os
import time
import unittest
from test_all import db, test_support, have_threads, verbose, \
get_new_environment_path, get_new_database_path
#----------------------------------------------------------------------
class DBReplicationManager(unittest.Te... |
midointerface.py | """
==========================================
Title: PyPlayer MidiInterface
Author: @jaquielajoie
Date: 9 July 2021
Liscence: Apache 2.0
==========================================
"""
import os
import mido
import base64
import math
import time
import logging
import threading
import mido
from mido import MidiFi... |
camera_process_video_task.py | '''
camera_process_video_task.py
ancilla
Created by Kevin Musselman (kevin@frenzylabs.com) on 01/21/20
Copyright 2019 FrenzyLabs, LLC.
'''
import threading
import time
import sys
import os
import zmq
from zmq.eventloop.zmqstream import ZMQStream
import zmq.utils.monitor
# import zmq.asyncio
import json
from torn... |
TestCppServer.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# this interferes with ServiceRouter/SWIG
# @lint-avoid-python-3-compatibility-imports
#from __future__ import unicode_literals
import multiprocessing
import sys
import threading
import time
from fb303.Context... |
java.py | import logging
import os.path
import socketserver
import struct
import subprocess
import sys
import threading
from hmac import compare_digest
from secrets import token_urlsafe
import frida
from hallucinate.handler import RequestHandler
from hallucinate.handlers.logging import LoggingHandler
class JavaAgentHandler(s... |
bleConnection.py | from email import message
from bluepy import btle
import threading
import time
message = "FiresMessage"
class MyDelegate(btle.DefaultDelegate):
def __init__(self):
btle.DefaultDelegate.__init__(self)
# ... initialise here
def handleNotification(self, cHandle, data):
global message
... |
generation_props.py | '''
Functions that are used while a Generation is being Evaluated
'''
import os
import multiprocessing
from rdkit import Chem
import numpy as np
from random import randrange
import discriminator as D
import evolution_functions as evo
from SAS_calculator.sascorer import calculateScore
manager = multiprocessing.Manager(... |
coordinator_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... |
app.py | # -- coding: utf-8 --
from __future__ import absolute_import
from unittest import main, TestCase
from tempfile import mkdtemp
from os.path import join, exists, dirname, isdir, abspath, sep
from urlparse import urlparse, urljoin
from os import environ, mkdir
from shutil import rmtree, copytree
from re import search, s... |
multi-process-launcher.py | #!/usr/bin/python3
import argparse
import threading
import subprocess
import sys
import os
import signal
import time
from contextlib import suppress
PROCESS = []
def cli_args():
parser = argparse.ArgumentParser(description='A Python thread/subprocess launcher to group dependent proces launch')
parser.add_a... |
common.py | #
# Phoenix-RTOS test runner
#
# Common parts of phoenix-rtos test runners
#
# Copyright 2021 Phoenix SYstems
# Authors: Jakub Sarzyński, Mateusz Niewiadomski, Damian Loewnau
#
import importlib
import logging
import os
import signal
import sys
import threading
import time
import pexpect
import pexpect.fdpexpect
impor... |
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... |
gstreamer.py | # Copyright 2019 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, ... |
aiomoto_services.py | # Copyright 2019-2022 Darren Weber
#
# 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 writ... |
client.py | #!/usr/bin/env python3
import socket
import re
import threading
import time
import select
import subprocess
from _thread import *
def encrypt(text,s):
result = ""
# traverse text
for i in range(len(text)):
char = text[i]
# Encrypt uppercase characters
if (char.isupp... |
extract_spacy_np.py | """
Program to extract noun phrases for the given text dataset using Spacy module
Lang: py3
"""
import sys
import csv
import time
import datetime
import spacy
import queue
from threading import Thread
nlp = spacy.load("en")
#The directory where the output file is stored
OUTPUT_DIR = os.path.join(os.getcwd(), 'output... |
httpexpect.py | # Copyright (c) 2019 Vitaliy Zakaznikov
#
# 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 i... |
twscraper.py | # coding=utf-8
import sys
import unicodecsv as csv
import networkx as nx
import tweepy
import ConfigParser, os
import dal
import threading
from datetime import datetime, timedelta
def daterange(start_date, end_date, interval):
for n in range(int ((end_date - start_date).days/interval)+1):
yield start_dat... |
acl_decompressor.py | import multiprocessing
import os
import platform
import psutil
import queue
import threading
import time
import re
import signal
import subprocess
import sys
# This script depends on a SJSON parsing package:
# https://pypi.python.org/pypi/SJSON/1.1.0
# https://shelter13.net/projects/SJSON/
# https://bitbucket.org/Ante... |
sanitylib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
test_webhooks.py | import pytest
import socket
from requests import get
from pyngrok import ngrok
import webbrowser
from typing import Callable
from http.server import BaseHTTPRequestHandler, HTTPServer
from threading import Thread
import six
import json
import time
import queue
from onshape_client.oas import (
BTWebhookParams,
B... |
telink.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, s... |
bucketserver.py | # -*- coding: utf-8 -*-
"""
bucketserver
Simple web service for image
Copyright (c) 2017 - RocketRedNeck.com RocketRedNeck.net
RocketRedNeck and MIT Licenses
RocketRedNeck hereby grants license for others to copy and modify this source code for
whatever purpose other's deem worthy as long as RocketRedNeck is giv... |
core_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
client.py | import socket
import threading
import tkinter
import tkinter.scrolledtext
from tkinter import simpledialog
HOST = '127.0.0.1'
PORT = 9090
class Client:
def __init__(self, host, port):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect((host, por... |
app.py | import pygame
import numpy as np
import time
import threading
from .utils.LockableData import LockableData
from .Engine import Engine
WIDTH, HEIGHT = 1000, 1000
class App:
def __init__(self, width, height, title, requested_tps, engine):
self.settings = LockableData(running=False, tick=0, frame_since_update=0... |
server.py | import socket
import mouse
import time
import re
from pynput.mouse import Button, Controller
from pynput.keyboard import Key
import pynput.keyboard
import tkinter
import sys
from tkinter import *
from functools import partial
import threading
m = Controller()
k = pynput.keyboard.Controller()
def start... |
_schedulers.py | import datetime
import multiprocessing
from collections import defaultdict
from linora.utils._config import Config
__all__ = ['Schedulers']
class Schedulers():
"""Time job task manager."""
def __init__(self, logger=None, verbose=0, config_file=None):
"""
Args:
logger: Logger objec... |
test_enum.py | import enum
import doctest
import inspect
import os
import pydoc
import sys
import unittest
import threading
from collections import OrderedDict
from enum import Enum, IntEnum, StrEnum, EnumType, Flag, IntFlag, unique, auto
from enum import STRICT, CONFORM, EJECT, KEEP, _simple_enum, _test_simple_enum
from enum import ... |
DownloadAlbum_withoutpool.py | #coding:utf-8
from __future__ import print_function
import multiprocessing
from bs4 import BeautifulSoup
import os, time, random, urllib
def getHtmlSoup(url):
page = urllib.urlopen(url)
html = page.read()
Soup = BeautifulSoup(html, 'lxml')
return Soup
def getNextpageurl(url):
Soup = getHtmlSoup(url)
nextpaget... |
im2rec.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
curr_path = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(curr_path, "../python"))
import mxnet as mx
import random
import argparse
import cv2
import time
import traceback
try:
import multip... |
test_athenad.py | #!/usr/bin/env python3
import json
import os
import requests
import shutil
import tempfile
import time
import threading
import queue
import unittest
from multiprocessing import Process
from pathlib import Path
from unittest import mock
from websocket import ABNF
from websocket._exceptions import WebSocketConnectionClo... |
cxi_index.py | from __future__ import division
# LIBTBX_SET_DISPATCHER_NAME cxi.index
# LIBTBX_PRE_DISPATCHER_INCLUDE_SH PHENIX_GUI_ENVIRONMENT=1
# LIBTBX_PRE_DISPATCHER_INCLUDE_SH export PHENIX_GUI_ENVIRONMENT
from xfel.cxi.display_spots import run_one_index
from libtbx.utils import Usage, Sorry
import libtbx.option_parser
import s... |
main.py | import time
import asyncio
import threading
import click
import os
import sys
from raccoon_src.utils.coloring import COLOR, COLORED_COMBOS
from raccoon_src.utils.exceptions import RaccoonException, HostHandlerException
from raccoon_src.utils.request_handler import RequestHandler
from raccoon_src.utils.logger import Sy... |
vpp_papi.py | #!/usr/bin/env python
#
# Copyright (c) 2016 Cisco and/or 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... |
nanopype_import.py | # \SCRIPT\-------------------------------------------------------------------------
#
# CONTENTS : Snakemake nanopore data pipeline
#
# DESCRIPTION : Import raw fast5 from MinKNOW to nanopype packages
#
# RESTRICTIONS : none
#
# REQUIRES : none
#
# ------------------------------------------------------... |
threading_learning_1.py | # threading模块创建多线程的第一种方式是把一个函数传入并创建Thread实例,然后调用start方法开始执行
# 第二种方法是直接从threading.Tread继承并创建线程类,然后重写__init__方法和run方法
# 下面是第一种
import random
import time
import threading
# 新线程执行的代码
def thread_run(urls):
print("Current %s is running..." % threading.current_thread().name)
for url in urls:
pr... |
web_control.py | #!/usr/bin/env python
# coding:utf-8
import os, sys
current_path = os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
python_path = os.path.abspath( os.path.join(current_path, os.pardir, 'python27', '1.0'))
noarch_lib = os.path.abspath( os.path.join(python_path, 'lib', 'noarch'))
sys.pa... |
text_client.py | # Copyright 2017 Mycroft AI 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 writin... |
WikiExtractor.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# Version: 3.0 (July 22, 2020)
# Author: Giuseppe Attardi (attardi@di.unipi.it), University of Pisa
#
# Contributors:
# Antonio Fuschetto (fuschett@aol.com)
# Leonardo Souza (lsouza@amte... |
advanced.py | # Released under the MIT License. See LICENSE for details.
#
"""UI functionality for advanced settings."""
from __future__ import annotations
from typing import TYPE_CHECKING
import _ba
import ba
from bastd.ui import popup as popup_ui
if TYPE_CHECKING:
from typing import Any, Optional
class AdvancedSettingsWi... |
DYL4N#0552.py | import os
import socket
import string
import random
import threading
from colorama import Fore, Back, Style
class SockFlood:
def __init__(self):
os.system("cls")
os.system("title D.DDOS - An Advance DDOS Tool ")
self.host=None
self.portnum=None
self.threads=None
def graphics(self):
banne... |
arduino_control_worker.py | import time
import json
import threading
import random
import socket
from nanpy import (SerialManager)
from nanpy.serialmanager import SerialManagerError
from nanpy.sockconnection import (SocketManager, SocketManagerError)
import sys
sys.path.append('..')
import variables
import importlib
#r = redis.Redis(host='127.0... |
worker.py | # -*- coding: utf-8 -*-
import threading
from multiprocessing import Process, Event
import time
import psutil
class WorkerBase(object):
def __init__(self, mode="threading"):
if mode not in ['threading', 'proccessing']:
raise ValueError("Bad mode.")
self._work_mode = mode
def work... |
queue_handler.py | import logging
from pathlib import Path
import time
from datetime import datetime
from queue import Queue
from threading import Thread, get_ident
from copy import deepcopy
import requests
from cromwell_tools.cromwell_api import CromwellAPI
from falcon import settings
logging.basicConfig(level=logging.INFO)
logger = ... |
base_crash_reporter.py | # Electrum - lightweight Bitcoin client
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish... |
main.py | 'Smart thermostat project main module'
from queue import Queue
from flask import Flask, jsonify, render_template, request, Response
import json
import threading
try:
from rpi.sensor import Sensor
from rpi.relay import Relay
import board
HEAT_PIN = board.D21
FAN_PIN = board.D16
COOL_PIN = boar... |
coap.py | import logging
import logging.config
import os
import random
import re
import socket
import threading
import xml.etree.ElementTree as ElementTree
import struct
from coapclient import HelperClient
from coapthon.layers.forwardLayer import ForwardLayer
from coapthon.messages.message import Message
from coapthon import de... |
main.py | #qpy:webapp:Hello Qpython
#qpy://127.0.0.1:8080/
"""
This is a sample for qpython webapp
"""
from bottle import Bottle, ServerAdapter
from bottle import run, debug, route, error, static_file, template
######### QPYTHON WEB SERVER ###############
class MyWSGIRefServer(ServerAdapter):
server = None
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.