source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
main.py | """
MIT License
Copyright (C) 2021 ROCKY4546
https://github.com/rocky4546
This file is part of Cabernet
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 lim... |
ofw.py | import getpass
import subprocess
import threading
import multiprocessing
from optimization.pyroServerManagement import PyroServerManagement
from utils_intern.messageLogger import MessageLogger
from swagger_server.wsgi import StandaloneApplication
"""
Created by Gustavo Aragón on 14.03.2018
"""
import configparser
i... |
HeaterControl.py | #!/usr/bin/python
from config import config
import commonFunctions
import configFunctions
import os
import requests
from flask import Flask, render_template, request, jsonify, Response, session
import flask
from functools import wraps
from tinydb import TinyDB, Query, where
from datetime import datetime
from dateti... |
server.py | from loguru import logger
import threading
import socketserver
import pickle
from time import sleep
import sqlite3
import bcrypt
IP, PORT = '0.0.0.0', 25665
DATABASE = 'db/Minesweeper.sqlite'
# Конфигурация logger'а. Rotation каждую неделю, сжатие в zip.
logger.add('logs/log.log', format='{time} | {level} | {mess... |
httpserver_beta.py | #http server
"""
Note:If you need to control gpios, first stop the robot server with systemctl stop opentrons-robot-server.
Until you restart the server with systemctl start opentrons-robot-server, you will be unable to control the robot using the Opentrons app.
"""
import socketserver
from http.server import BaseHTTPR... |
AutoUpdateThread.py | # -*- coding: utf-8 -*-
# import threading
import traceback
from time import sleep
class AutoUpdateThread:
def __init__(
self, update_function, update_interval=30 * 60, initial_update=True
):
self.update_function = update_function
self.update_interval = update_interval
self.ini... |
lidarserver.py | import socket
import sys
import threading
import time
import sqlite3
import datetime
import serial
import math
def listen():
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
port = 9998
# Bind the socket to the port
server_address = ('', port)
print >>sys.stderr, 'starting up on %s port %s' ... |
test_logging.py | #!/usr/bin/env python
#
# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copy... |
python.py | ##!/usr/bin/evn python
import subprocess
import sys
from pprint import pprint
import pdb
import shlex
import tempfile
import os
import multiprocessing
def convert_to_linux_path(path):
# print("Before convert:", repr(path))
path = path.replace("\\", "/") # Must come before the rest.
path = path.replace("... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
import unittest.mock
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
i... |
TimeoutDecorator.py | from threading import Thread
import functools
def timeout(timeout):
def deco(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
res = [Exception('function [%s] timeout [%s seconds] exceeded!' % (func.__name__, timeout))]
def newFunc():
try:
... |
btlejack.py | import struct
import time
from queue import Queue
from threading import Lock
from scapy.compat import raw
from scapy.layers.bluetooth4LE import BTLE, BTLE_ADV, BTLE_DATA, BTLE_PPI, CtrlPDU
from scapy.layers.netflow import port
from serial import Serial, SerialException
from serial.tools.list_ports import comports
fro... |
test_ufuncs.py | from __future__ import print_function
import functools
import itertools
import re
import sys
import warnings
import threading
import numpy as np
import numba.unittest_support as unittest
from numba import types, typing, utils, typeof, numpy_support, njit
from numba.compiler import compile_isolated, Flags, DEFAULT_FL... |
slaveproc.py | # Copyright (c) 2009-2010, Cloud Matrix Pty. Ltd.
# All rights reserved; available under the terms of the BSD License.
"""
esky.slaveproc: utilities for running a slave process.
A "slave process" is one that automatically dies when its master process dies.
To implement this, the slave process spins up a backgrou... |
store.py | import datetime
import json
import threading
import uuid
from collections import defaultdict
from copy import deepcopy
from dictdiffer import diff
from inspect import signature
from threading import Lock
from pathlib import Path
from tzlocal import get_localzone
from .logger import logger
from .settings import CACHE_... |
training.py | from __future__ import print_function
from __future__ import absolute_import
import warnings
import copy
import time
import numpy as np
import threading
try:
import queue
except ImportError:
import Queue as queue
from .topology import Container
from .. import backend as K
from .. import optimizers
from .. imp... |
cplex_MPI_final.py | # 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 use this file except in compliance with
# the License. You may obtain a ... |
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 random
import subprocess
import sys
import time
import unittest
from test import support
try:
import threading
... |
test.py | #!/usr/bin/env python
#
# Copyright 2008 the V8 project authors. 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 of source code must retain the above copyright
# noti... |
sstress.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 ... |
session_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... |
ipython_memory_usage.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Profile mem usage envelope of IPython commands and report interactively"""
import time
import memory_profiler
from IPython import get_ipython
__version__ = 1.1 # set to desired value.
# To run: %run -i ipython_memory_usage.py
# keep a global accounting for the last k... |
serve.py | import os
from flask import Flask
from flask import request
import json
import threading
import subprocess
app = Flask(__name__)
app.orch_status = False
def run(seed_model, rounds=5):
p = subprocess.Popen('fedn run fedavg -s {} -r {}'.format(seed_model, rounds).split(), shell=False,
stdo... |
test_mcrouter_basic.py | # Copyright (c) 2017, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import absolute_... |
observe.py | from threading import Thread
from time import sleep, time
import numpy
import pkg_resources
from decorator import decorator
from cbagent.collectors import Latency
from cbagent.collectors.libstats.pool import Pool
from logger import logger
from perfrunner.helpers.misc import uhex
from spring.docgen import Document, Ke... |
remote_executor.py | # Lint as: python3
# Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
util.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... |
pmbus.py | # Copyright (c) 2016, Xilinx, Inc.
# 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 con... |
qt.py | #!/usr/bin/env python3
#
# Cash Shuffle - CoinJoin for Bitcoin Cash
# Copyright (C) 2018-2019 Electron Cash LLC
#
# 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,
# includ... |
common.py | import asyncio
import logging
import socket
import threading
import unittest
from typing import Tuple
import structlog
import uberlogging
from .server import Server, SSLServer
logger = structlog.get_logger(__name__)
uberlogging.configure(root_level=logging.DEBUG) # A bit ugly but very convenient
class TestClientB... |
manager_test.py | from threading import Thread
import socket
g_socket = None
g_conn_pool = []
g_conn_use = []
def ClientThread(clientsocket, i):
clientsocket.send(("request " + str(i) + " from manager").encode("utf-8"))
#self.csocket.send(bytes("Hi, This is from Server..",'utf-8'))
while True:
data = clientsocket.r... |
run.py | #!/usr/bin/python3
import settings
if __name__ == "__main__":
import logSetup
logSetup.initLogging()
# Shut up fucking annoying psycopg2 vomit every exec.
import warnings
from sqlalchemy import exc as sa_exc
warnings.filterwarnings("ignore", category=UserWarning, module='psycopg2')
warnings.simplefilter("ignore", ... |
fn_api_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... |
Hiwin_RT605_Socket_v3_20190628101631.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_v3 as TCP
import HiwinRA605_socket_Taskcmd_v3 as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.s... |
driver_scoorer.py | import statistics
from collections import deque
from threading import Lock
from threading import Thread
import numpy as np
from sensors.IMU import imu
from utils.logger import Logger
# import a spcecific sensor
# import imu as imu
try:
import sensors.IMU.mpu9250_i2c as mpu9250
except Exception as e:
# ON lap... |
bot.py | import time
import threading
import logging
import telebot
import config
import dbworker
import parser_api
from telebot import types
bot = telebot.TeleBot(config.token)
def dispatch(interval):
while True:
list_of_users = dbworker.get_status_for_dispatch()
for user in list_of_users:
re... |
asio_chat_client_test.py | import os
import re
import socket
import time
from threading import Thread
import ttfw_idf
global g_client_response
global g_msg_to_client
g_client_response = b''
g_msg_to_client = b' 3XYZ'
def get_my_ip():
s1 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s1.connect(('8.8.8.8', 80))
my_ip = s1.g... |
player.py | # Here Importing Modules
import pyglet # import pyglet
import datetime
import os
import time
import threading
import pyglet.media as media
from Configuration_base import *
# ============================================
# Usages:
# player=__media__player(path, song_time, song_duration, volume)
# Here:
# pat... |
web_crawler.py | import os
import time #used to delay processing
from functools import wraps #used to create timing wrapper
import json
import threading #required for multi-threading
import shelve
import sys
import io
import fileinput
import string
import urllib #required to open html documents
import urllib2 #required in p... |
paral.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from functools import partial
from threading import Thread
from typing import Callable
from joblib import Parallel, delayed
from joblib._parallel_backends import MultiprocessingBackend
import pandas as pd
from queue import Queue
class Paralle... |
tasks.py | import math
from datetime import datetime, timedelta
from celery.task import task
from time import sleep
from corehq.apps.sms.mixin import SMSLoadBalancingMixin, VerifiedNumber
from corehq.apps.sms.models import (SMSLog, OUTGOING, INCOMING, SMS)
from corehq.apps.sms.api import (send_message_via_backend, process_incomin... |
downloadclient.py | # -*- coding: utf-8 -*-
# Copyright 2018-2021 CERN
#
# 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... |
renderQuery.py | from mitmproxy import http
from mitmproxy.utils import strutils
from threading import Thread
import re, json, sys, threading, time, signal, os
sys.path.append('../')
from connect import sendDataToFire
<<<<<<< HEAD
from mitmproxy.net.http.http1 import read
=======
# A common dictionary for storing data on firebase... |
main.py | #!/usr/bin/python3
import socket
import time
import hashlib
import threading
#BotCommands
import BotCommands as bot
#TcpSocket
TcpSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#Connect to server
def connect(ip, port, user, passw, tries=0):
if(tries==3):
print("Connection failed.")
... |
servers_test.py | # Copyright 2019 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
process.py | # Copyright (c) 2020 PaddlePaddle 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 appli... |
mbase.py | """
mbase module
This module contains the base model class from which
all of the other models inherit from.
"""
from __future__ import print_function
import sys
import os
import subprocess as sp
import shutil
import threading
if sys.version_info > (3, 0):
import queue as Queue
else:
impo... |
MagiModule.py | import time
import threading
class MagiModule:
__cooltime = 0
__user_list = {}
__timer_thread = threading.Thread()
slack_token = ''
def __init__(self, slack_token, cooltime=3):
self.__cooltime = cooltime
self.__timer_thread = threading.Thread(target=self.__user_timer)
self... |
watch.py | import ctypes
from ltk.actions import Action
from ltk.logger import logger
from ltk.utils import map_locale, restart
import time
import requests
from requests.exceptions import ConnectionError
import os
import sys
from watchdog.observers import Observer
from watchdog.events import FileSystemEvent
from ltk.watchhandler ... |
efs-manager.py | #!/usr/bin/env python
import boto3
import datetime
import kubernetes
import kubernetes.client.rest
import logging
import os
import random
import re
import requests
import string
import threading
import time
import yaml
base_stunnel_port = int(os.environ.get('BASE_STUNNEL_PORT', 20490))
efs_polling_interval = int(os.e... |
threadingutils.py | # -*- coding: utf-8 -*-
import logging
from threading import Thread, current_thread
def start_thread(target, name, exception_event, *args, **kwargs):
"""
Starts a thread passed as argument and catches exceptions that happens during execution
:param target: Method to be executed in the thread
:param na... |
main.py | import requests
from flask import Flask, jsonify
from threading import Thread
import json
from os import system
import googlesearch
from bs4 import BeautifulSoup
import dateparser
app = Flask('')
app.config['JSON_SORT_KEYS'] = False
@app.route('/')
def home():
return "I'm alive"
@app.route('/api/<string:s>', metho... |
test.py |
import remi.gui as gui
from remi import start, App
from Jumpscale.core.InstallTools import *
import threading
import time
class MyTextBox(gui.TextInput):
def __init__(self, **kwargs):
super(MyTextBox, self).__init__( **kwargs)
self.lines=[]
self.style['margin'] = 'auto'
se... |
lisp.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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... |
online_analyzer.py | from threading import Thread
import struct
from tkinter import filedialog
from .image_calculator import ImageCalculator
from .encoder_manager import just_read_encoder
from .image_provider import ImageProvider
from .speedcalculator import SpeedCalculator
from .times_generator import get_data_from_correction_file, get_n... |
test_helpers.py | #
# voice-skill-sdk
#
# (C) 2020, Deutsche Telekom AG
#
# This file is distributed under the terms of the MIT license.
# For details see the file LICENSE in the top directory.
#
#
# Unit testing helpers
#
import ast
import sys
import base64
import gettext
import inspect
import logging
import datetime
import contextli... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
smbrelayx.py | #!/usr/bin/env python
# Copyright (c) 2013-2016 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# SMB Relay Module
#
# Author:
# Alberto Solino (@agsolino)
#
# Description:
# ... |
XiaoweiLib.py | from __future__ import print_function
import os, sys, re
try:
from subprocess import Popen, PIPE, call
except:
sys.path = [re.sub(r'^/home/zhanxw/', '/net/dumbo/home/zhanxw/', x) for x in sys.path]
sys.path.append('/net/dumbo/home/zhanxw/python27/lib/python2.7/')
from subprocess import Popen, PIPE, call... |
keysboard.py | #!python
#################################################
#===============================================#
# | Ascii Art :) | # #
# | | # #
# --------------------------------------------- #
# ---- Keysboard for Linux by Dunkmania101 ---- #
# ---------... |
test_decimal.py | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for the Decim... |
multiprocessing_test.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
import multiprocessing as mp
import sys
from typing import List
import gym
imp... |
port.py | from stage.motor_ctrl import MotorCtrl
from stage.motor_ctrl.stage_info import stage_name_from_get_hw_info
from ..ctrl_msg import MGMSG_HW_NO_FLASH_PROGRAMMING, MGMSG_HW_REQ_INFO, MGMSG_HW_START_UPDATEMSGS, MGMSG_HW_STOP_UPDATEMSGS
import serial
import select
import threading
import time
import queue
import weakref
cl... |
__init__.py | '''
Sample usage to track changes in a thread.
import threading
import time
watcher = fsnotify.Watcher()
watcher.accepted_file_extensions = {'.py', '.pyw'}
# Configure target values to compute throttling.
# Note: internal sleep times will be updated based on
# profiling the actual applicat... |
tb_device_mqtt.py | # Copyright 2020. ThingsBoard
#
# 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 ... |
flight_thread.py | #!/usr/bin/env python3
"""
This example shows how to use the manual controls plugin.
Note: Manual inputs are taken from a test set in this example to decrease complexity. Manual inputs
can be received from devices such as a joystick using third-party python extensions
Note: Taking off the drone is not necessary befo... |
lab9_d.py | from sys import setrecursionlimit
import threading
setrecursionlimit(10 ** 9)
threading.stack_size(2 * 67108864)
def main():
file_input, file_output = open('cond.in', 'r'), open('cond.out','w')
#std Kosaraju's condensation algo
#dfs1 forms a sequence tout by the exit-times of dfs algo -- topsort
tout,... |
test_bz2.py | from test import support
from test.support import bigmemtest, _4G
import unittest
from io import BytesIO, DEFAULT_BUFFER_SIZE
import os
import cosmo
import pickle
import glob
import pathlib
import random
import shutil
import subprocess
import sys
from test.support import unlink
import _compression
import sys
from enco... |
test_basic_4.py | # coding: utf-8
import logging
import sys
import time
import subprocess
import numpy as np
import pytest
import ray.cluster_utils
from ray._private.gcs_pubsub import GcsFunctionKeySubscriber
from ray._private.test_utils import wait_for_condition
from ray.autoscaler._private.constants import RAY_PROCESSES
from pathlib... |
test_retries.py | # (c) Copyright 2018 Palantir 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 ... |
Sample_withCamera.py | import math
import Yamanami
from Yamanami.myutil import *
import time
from multiprocessing import Process, Manager
import Sample_HandTracking as HandT
import SharedData
from DampedFilter import DampedFilter
robot = Yamanami.RobotDriver(odrive_serial_number="207835863056")
tk = Yamanami.TimeKeeper()
tk.SamplingTime = ... |
padding_fifo_queue_test.py | # Copyright 2015 Google 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 or a... |
main.py | import tkinter as tk
from tkinter import messagebox
import utils
import instabot
from playsound import playsound
import threading
class Main:
def __init__(self):
# main frame
self.root = tk.Tk()
self.root.title("Taca o Pau na Net")
# center title of software
tk.Label(self.ro... |
stream.py | from . import constants
from .proto import SenseClient_pb2, SenseClient_pb2_grpc
from .result import Result,default_event_filter
import grpc
import warnings
import copy
import threading
MIN_RECOMMANDED_SAMPLING_RATE = 22050
STREAM_FORMAT = {
"float32": 4,
"float64": 8,
"int32": 4,
"int64": 8
}
cla... |
preprocess_coco.py | # coding=utf8
import argparse, os, json, string
from collections import Counter
from Queue import Queue
from threading import Thread, Lock
from math import floor
import h5py
import numpy as np
from scipy.misc import imread, imresize
"""
This file expects a JSON file containing ground-truth regions and captions
in th... |
test_logging.py | # Copyright 2001-2019 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
zmqAIServerTest.py | from multiprocessing import Process
import zmq
import numpy as np
from time import sleep
#import shutil
#import os
from random import random
from io import BytesIO
from PIL import Image
from base64 import b64decode
import utils
model = utils.loadmodel('Model.json', 'Weights.h5')
REFSTR = '0123456789ABCDEFG... |
main.py | # moosic/server/main.py - the server portion of the Moosic jukebox system.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, c... |
rewind.py | import logging
import os
import shlex
import six
import subprocess
from threading import Lock, Thread
from .connection import get_connection_cursor
from .misc import format_lsn, parse_history, parse_lsn
from ..async_executor import CriticalTask
from ..dcs import Leader
logger = logging.getLogger(__name__)
REWIND_ST... |
__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import json
import logging
import os
import random
import re
import sys
import time
import Queue
import threading
from geopy.geocoders import GoogleV3
from pgoapi import PGoApi
from pgoapi.utilities import f2i, get_cell_ids
import cell_w... |
callbacks_test.py | # Copyright 2016 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... |
backtester_coin_vj.py | import os
import sys
import sqlite3
import pandas as pd
from matplotlib import pyplot as plt
from multiprocessing import Process, Queue
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from utility.setting import db_backtest, db_coin_tick
from utility.static import now, strf_time, timedelta_... |
conftest.py | import asyncio
import json
import multiprocessing
import os
import pytest
import queue
import re
import requests
import requests_unixsocket
import subprocess
import sys
import threading
import time
import urllib.parse
import yaml
from datetime import datetime, timedelta
from pathlib import Path
from typing import Call... |
port_scanner.py | #!/bin/python3
import sys
import socket
from datetime import datetime
import threading
# Define our target
# Add a pretty banner
print("-" * 50)
print("Time started: " + str(datetime.now()))
startime = datetime.now()
print("-" * 50)
taget = ""
ip_arr = []
done = 0
open_ports_total = {}
def get_ip():
f = open... |
_bgen2.py | import hashlib
import math
import multiprocessing
import os
import threading
from os.path import getmtime
from pathlib import Path
from typing import Any, List, Optional, Tuple, Union
import numpy as np
from cbgen import bgen_file, bgen_metafile
# from ._bgen_metafile import bgen_metafile
from cbgen._ffi import ffi a... |
ssdp.py | # Adapted from https://github.com/MoshiBin/ssdpy and https://github.com/ZeWaren/python-upnp-ssdp-example
import os
import socket
import struct
import json
from multiprocessing import Process
from fHDHR import fHDHR_VERSION
class fHDHR_Detect():
def __init__(self, settings):
self.config = settings
... |
plugin.py | import shutil
import os
import tempfile
import threading
import random
import json
import requests
import sublime
from LSP.plugin.core.handlers import LanguageHandler
from LSP.plugin.core.settings import ClientConfig, read_client_config
SERENATA_UPLOAD_HASH = '7499ecf1275983f26efd930446a3693d'
def get_expanding_var... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
from electrum.bitcoin import TYPE_ADDRESS
from electrum.storage import WalletStorage
from electrum.wallet import Wallet
from electrum.paymentrequest import InvoiceStore
from electrum.util import pro... |
monitor_deployment.py | # 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 or agreed to ... |
view_tester.py | # Copyright 2017-2022 RStudio, PBC
#
# 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... |
BranchBound.py | import threading as th
from copy import deepcopy
#David Bujosa Code
class Node:
def __init__(self, parent=None, state=[]):
self.parent = parent
self.generator_lock = th.Lock()
self.generator = self._child_gen()
self.state = state
def _child_gen(self):
for i in range(1,... |
thread_specific_data.py |
import random
import threading
import logging
logging.basicConfig(level=logging.DEBUG,
format='(%(threadName)-10s) %(message)s',
)
def show_value(data):
try:
val = data.value
except AttributeError:
logging.debug('No value yet')
else:
logging... |
ddbcore.py | #from serial.tools.list_ports import comports
import traceback
import serial as pyserial
import threading
import configparser
import os
import ddbmod
class DDUserInterface:
def initialize(self):
pass
def syncConnectionState(self, connected):
pass
def onSerialException(self, err):
... |
email.py | # -*- coding:utf-8 -*-
from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app._get_curren... |
servers.py | # Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
__init__.py | # -*- coding: utf-8 -*-
from django.apps import apps
from threading import Thread
from django.conf import settings
from djangoplus.utils.metadata import get_metadata, get_scope, get_can_execute, count_parameters_names
CACHE = dict(
INITIALIZED=False,
SETTINGS_INSTANCE=None,
# USER INTERFACE
VIEWS=[],... |
websocketconnection.py | import threading
import websocket
import gzip
import ssl
import logging
from urllib import parse
import urllib.parse
from binance_f.base.printtime import PrintDate
from binance_f.impl.utils.timeservice import get_current_timestamp
from binance_f.impl.utils.urlparamsbuilder import UrlParamsBuilder
from binan... |
CrashUtils.py | # For Youtube Download.
import io
from pytube import YouTube
from IPython.display import HTML
from base64 import b64encode
import os
import cv2
import time
import copy
import glob
import torch
import gdown
import argparse
import statistics
import threading
import torchvision
import numpy as np
import pandas as pd
im... |
test_external_step.py | import os
import tempfile
import time
import uuid
from threading import Thread
import pytest
from dagster import (
DynamicOut,
DynamicOutput,
Field,
ModeDefinition,
RetryRequested,
String,
execute_pipeline,
execute_pipeline_iterator,
fs_io_manager,
job,
op,
pipeline,
... |
Container.py | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018.09.22 15:29
# @Author : flytocc
# @File : Container.py
# @Software: PyCharm
import threading
import time
import tkinter as tk
from tkinter.ttk import *
from tkinter import messagebox
import matplotlib as mpl
from matplotlib.backends.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.