source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
audio.py | """Audio queue management."""
import asyncio
import atexit
import collections
import copy
import discord
import enum
import json
import os
import queue
import subprocess
import threading
import time
import uuid
from typing import cast, Any, Awaitable, Callable, Deque, List, Optional
import uita.exceptions
import uita.... |
grid_search.py | import os
import gc
import copy
import time
import json
import datetime
import traceback
from tqdm import tqdm
import multiprocessing
from main import main
from utils import get_common_path
from data_path_constants import get_index_path, get_log_file_path
# NOTE: Specify all possible combinations of hyper-parameters ... |
jobStoreTest.py | # Copyright (C) 2015-2016 Regents of the University of California
#
# 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 app... |
test_socket.py | #!/usr/bin/env python
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
PURPOSE WITH OR WIT... |
rpc_test.py | import concurrent.futures
import contextlib
import json
import logging
import os
import sys
import threading
import time
import unittest
import warnings
from collections import namedtuple
from functools import partial
from threading import Event
from threading import Lock
from unittest import mock
import torch
impo... |
async_dqn.py | #!/usr/bin/env python
import os
os.environ["KERAS_BACKEND"] = "tensorflow"
from skimage.transform import resize
from skimage.color import rgb2gray
from atari_environment import AtariEnvironment
import threading
import tensorflow as tf
import sys
import random
import numpy as np
import time
import gym
from keras import... |
executor.py | from concurrent.futures import Future
import typeguard
import logging
import threading
import queue
import datetime
import pickle
from multiprocessing import Queue
from typing import Dict # noqa F401 (used in type annotation)
from typing import List, Optional, Tuple, Union
import math
from parsl.serialize import pack... |
test_util.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... |
main.py | import tkinter as tk
import tkinter.ttk as ttk
import tkinter.font as tkfont
from tkinter.scrolledtext import ScrolledText
from tkinter import messagebox as msgbox
import gettext
import winreg
import subprocess
import os
import sys
import queue as q
from time import sleep
from ruamel.yaml import YAML
from PIL import Im... |
checkLabs.py | import shutil
import os
import sys
import importlib
import unittest
import copy
from collections import defaultdict
from io import StringIO
import threading
import inspect
import ctypes
import argparse
class KillableThread(threading.Thread):
def _get_my_tid(self):
"""determines this (self's) th... |
hibike_process.py | """
The main Hibike process.
"""
from collections import namedtuple
import glob
import multiprocessing
import os
import queue
import random
import threading
import time
import sys
#from PieCentral.runtime.runtimeUtil import *
# from runtimeUtil import *
# pylint: disable=import-error
import hibike_message as hm
impor... |
test_sys.py | # expected: fail
# -*- coding: iso-8859-1 -*-
import unittest, test.test_support
from test.script_helper import assert_python_ok, assert_python_failure
import sys, os, cStringIO
import struct
import operator
class SysModuleTest(unittest.TestCase):
def tearDown(self):
test.test_support.reap_children()
... |
app.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" This file contains the GUI for the SimpleDigitalAssistant application.
This application is made specifically for Windows OS, and can be used
to accomplish small tasks via automatic speech recognition (using pre-trained
models)."""
__author__ = ["Hannan Kha... |
downloader.py | import logging, requests, requests.adapters, queue, threading, os, random, time
def download_retry(requests_session, url, retry_num=1, max_retries=5):
try:
return requests_session.get(url).content
except Exception:
logging.exception("Exception downloading from url {}".format(url))
if m... |
test_sys.py | import builtins
import codecs
import gc
import locale
import operator
import os
import struct
import subprocess
import sys
import sysconfig
import test.support
from test import support
from test.support import os_helper
from test.support.script_helper import assert_python_ok, assert_python_failure
from test.support imp... |
test_async.py | # coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2018 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... |
test_index.py | import os
import multiprocessing as mp
import pytest
import numpy as np
from jina.enums import FlowOptimizeLevel
from jina.executors.indexers.vector import NumpyIndexer
from jina.flow import Flow
from jina.parsers.flow import set_flow_parser
from jina.proto import jina_pb2
from jina import Document
from tests import ... |
test_browser.py | # coding=utf-8
from __future__ import print_function
import argparse
import json
import multiprocessing
import os
import random
import re
import shlex
import shutil
import subprocess
import time
import unittest
import webbrowser
import zlib
from runner import BrowserCore, path_from_root, has_browser, get_browser
from... |
catalog_connector.py | #
# Copyright 2018-2021 Elyra Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
plugin.py | import base64
import re
import threading
from binascii import hexlify, unhexlify
from functools import partial
from electrum_rby.util import bfh, bh2u
from electrum_rby.bitcoin import (is_segwit_address, b58_address_to_hash160, xpub_from_pubkey,
public_key_to_p2pkh, EncodeBase58Check... |
downloader.py | #!/usr/bin/env python
# _*_ coding: utf-8 _*_
# @author: XYZ
# @file: downloader.py
# @time: 2021.02.23 16:27
# @desc:
import os
import pickle
import sqlite3
import threading
from multiprocessing import JoinableQueue
from nspider.core.log import Log
import nspider.utilities.constant as const
from nspider.core.tps_bu... |
__init__.py | import bisect
import collections
import inspect
import io
import json
import queue
import threading
import time
import logging
import traceback
from typing import Union
from . import exception
__version__ = '2.0.1'
def flavor(msg):
"""
Return flavor of message or event.
A message's flavor may be one of... |
datasource.py | import os
import threading
import tempfile
import re
import multipart
import zipfile
import tarfile
import shutil
from pathlib import Path
import mysql.connector
from flask import request, send_file
from flask_restx import Resource, abort # 'abort' using to return errors as json: {'message': 'error text'}
from mi... |
market_price_edpgw_authentication.py | #!/usr/bin/env python
#|-----------------------------------------------------------------------------
#| This source code is provided under the Apache 2.0 license --
#| and is provided AS IS with no warranty or guarantee of fit for purpose. --
#| See the project's LICENSE.md for details... |
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... |
cmdanime.py | #!/usr/bin/env python3
# fileencoding=utf-8
'''
cmdanime.py
~~~~~~~~~~~
cmdanime.py provides command-line animation. When yor start to run a long calculation in python,
if there is no output in command-line, you are warried about whichever the program starts or not.
In that case, cmdanime.CmdAnimation show animation... |
ssd_model.py | # Copyright 2018 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... |
twisterlib.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 math
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import hashlib
import thre... |
main_window.py | from PyQt5 import QtWidgets as QtW
from PyQt5.QtGui import QCursor
from PyQt5.QtCore import Qt
from .widgets.time_bar_widget import TimeBarWidget
from datetime import datetime
from threading import Thread
from time import sleep
from math import ceil
from settings import Settings
from .new_flight_window import NewFlight... |
gpu_db_recorder.py | import json
import os
import sqlite3
import threading
import time
import systemmonitor
DATABASE = 'database.db'
EVENTS_FOLDER = 'events'
def get_db():
db = sqlite3.connect(DATABASE)
db.execute("""
CREATE TABLE IF NOT EXISTS events (
timestmp FLOAT NOT NULL,
descri... |
live_response_api.py | from __future__ import absolute_import
import random
import string
import threading
import time
import logging
from collections import defaultdict
import shutil
from cbapi.errors import TimeoutError, ObjectNotFoundError, ApiError, ServerError
from six import itervalues
from concurrent.futures import ThreadPoolExecut... |
load_complete_data.py | import os
import src.mongoDBI as mongoDBI
import src.constants as constants
import src.utils as utils
import glob
import src.parse_grb_files as parse_grb_files
from multiprocessing import Process
from datetime import datetime, timedelta, date
# ---------------------------------------- #
class buffer:
buffer = Non... |
pod.py | #!/usr/bin/env python3
# MIT License
#
# Copyright (C) 2020, Entynetproject. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without lim... |
graph_gens.py | #!/usr/local/bin/python
# coding: utf-8
import os
from time import time
from subprocess import call
import numpy as np
from sklearn.preprocessing import OneHotEncoder
import networkx as nx
import scipy
from scipy import special
from numpy import pi
import itertools
from gemben.utils import graph_util,kron... |
interface_rpc.py | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The thecoffeecoins Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests some generic aspects of the RPC interface."""
import os
from test_framework.authproxy imp... |
TCP.py | #!/usr/bin/python
from socket import *
import multiprocessing, time, signal, os, sys, threading, socket
from threading import Thread
PORT = 10000
IP = ""
class TCP(object):
tcp = None
def __init__(self):
self.server_socket = socket.socket(AF_INET, SOCK_STREAM)
self.server_socket.setsockopt(... |
test_all_ctrls.py | # coding: utf-8
import os
from typing import Dict
import websocket
import unittest
from threading import Thread
from time import sleep
import urllib.request
import urllib.error
import http.client
from simple_http_server.logger import get_logger, set_level
import simple_http_server.server as server
set_level("DEBUG")... |
genorders.py | from multiprocessing import Pool, TimeoutError
import time
import os
import requests
import sys
import itertools
import threading
import queue
import random
import uuid
import datetime
import json
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
endpoint = "http://orders-kn-channel.kcontaine... |
ui.py | import os
import threading
import logging
import time
import wx
from .. import UI
class wxPython(UI):
def __init__(self, config):
super(wxPython, self).__init__(config)
self._initialize_gui()
self.app_paused = False
# App Control functions
def start_app(self):
logging.d... |
maintest.py | from suffixtree import *
import re
from threading import Thread
import threading
from memory_profiler import profile
import random
import time
import sys
charset = ['a','b','c','d','e','f','g']
strs = [
"abc",
"abcde",
"aabbcdeabc",
"123",
"1234",
"321",
"123321",
"hhhzzzzww",
"ttbb",
"ab1",
"12b",
"12",
"11",
"a1a"... |
sequencePlayer.py | from threading import Thread
from time import sleep
import config as cfg
from sequencePlaylist import SequencePlaylist
from color import Color
from sequence import Sequence
class SequencePlayer:
def __init__(self):
self.currentplaylist = None
self.sequencethread = None
def runsequence(self, ... |
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... |
test_server.py | # *****************************************
# |docname| - Tests using the web2py server
# *****************************************
# These tests start the web2py server then submit requests to it. All the fixtures are auto-imported by pytest from ``conftest.py``.
#
# .. contents::
#
# Imports
# =======
# These are lis... |
AutoEetopSign.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import logging
import re
from bs4 import BeautifulSoup
import requests
import sys
import time
from PIL import Image
import threading
class AutoDiscuz:
def __init__(self, forum_url, user_name, password):
"""初始化论坛 url、用户名、密码和代理服务器."""
self.header = {
... |
main.py | #!/usr/bin/python3
#!/usr/bin/python3
from messaging import Consumer
from db import DataBase
from threading import Thread, Condition
import json
import time
import os
kafka_topic = "seg_analytics_data"
kafka_group = "kafka_to_db_converter"
class KafkaToDB(object):
def __init__(self):
super(KafkaToDB,self... |
utils.py | """
Utility functions used by the tests.
"""
import contextlib
import threading
def sort_fields(fields):
"""Helper to ensure named fields are sorted for the test."""
return ', '.join(sorted(field.lstrip() for field in fields.split(',')))
def skip_first_line(value):
"""Returns everything after the first... |
cb2_9_5_sol_1.py | import threading, time, Queue
class MultiThread(object):
def __init__(self, function, argsVector, maxThreads=5, queue_results=False):
self._function = function
self._lock = threading.Lock()
self._nextArgs = iter(argsVector).next
self._threadPool = [ threading.Thread(target=self._doSo... |
test_functools.py | import abc
import builtins
import collections
import collections.abc
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import threading
import time
import typing
import unittest
import unittest.mock
import os
import weakref
import gc
from weakref ... |
ssh.py | from __future__ import print_function, division, absolute_import
import logging
import socket
import os
import sys
import time
import traceback
try:
from queue import Queue
except ImportError: # Python 2.7 fix
from Queue import Queue
from threading import Thread
from toolz import merge
from tornado import... |
mainV2.py | import tkinter as tk
from tkinter import *
from tkinter import ttk
import tkinter.font as tkFont
from tkinter import messagebox
import numpy as np
import cv2
from PIL import Image, ImageTk
import threading
from datetime import datetime
import subprocess
import os
import time
import RPi.GPIO as GPIO
import tensorflow a... |
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... |
build.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 ... |
orientation.py | import numpy
from classes.quaternion import *
from classes.dataStreamReader import *
import threading
import math
import time
class Madgwick(threading.Thread):
# IMU sensor needs to be rotated by PI/2 on x axis!
# IMU data: timestamp, angular_velocity, linear_acceleration, magnetic_field
IMU_FREQ = 60.0 ... |
client.py | import socket
import threading
host = "127.0.0.1"
port = 5000
nickname = input("Choose a nickname: ")
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((host, port))
def receive():
while True:
try:
message = client.recv(1024).decode("ascii")
if message == ... |
Ex2.py | #!/usr/bin/env python
import yaml
from pprint import pprint
from netmiko import ConnectHandler
from multiprocessing import Process,Queue
import pdb
STREAM = '../../.netmiko.yml'
with open(STREAM) as file_in:
devices = yaml.load(file_in)
#pprint(devices)
def command_runner(gear):
output = {}
connector =... |
Judging.py | import os
import re
import sys
import time
import getpass
import urllib2
import threading
import test
def wait(arg1 , stop_event):
try :
while (not stop_event.is_set()):
sys.stdout.write('.')
sys.stdout.flush()
stop_event.wait(0.3)
except Exception as error :
... |
cb-replay-pov.py | #!/usr/bin/env python
"""
CB POV / Poll communication verification tool
Copyright (C) 2014 - Brian Caswell <bmc@lungetech.com>
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... |
UPS_Main2.py | # ©2018 The Arizona Board of Regents for and on behalf of Arizona State University and the Laboratory for Energy And Power Solutions, All Rights Reserved.
#
# Universal Power System Controller
# USAID Middle East Water Security Initiative
#
# Developed by: Nathan Webster
# Primary Investigator: Nathan Johnson
#
# Versi... |
main.py | import traceback
import StellarPlayer
import importlib
import requests
import threading
import json
import time
import inspect
import os
import sys
from bs4 import BeautifulSoup as bs
from .sites import match
plugin_dir = os.path.dirname(__file__)
sys.path.append(plugin_dir) # for js2py
DEFAULT_IMAGE = 'data:image/... |
Threads.py | import threading
import time
def worker():
print("Worker")
return
threads = []
for i in range(5):
t = threading.Thread(target=worker)
threads.append(t)
t.start()
print('')
def worker_a(num):
print ("Worker : " + str(num),end='\n')
return
threads_a = []
for i in r... |
Varken.py | import platform
import schedule
from time import sleep
from queue import Queue
from sys import version
from threading import Thread
from os import access, R_OK, getenv
from distro import linux_distribution
from os.path import isdir, abspath, dirname, join
from argparse import ArgumentParser, RawTextHelpFormatter
from l... |
views.py | # encoding: UTF-8
from flask import render_template,flash,url_for,session,redirect,request,g ,jsonify
from app import app, db,lm , celery
from flask_login import login_user, logout_user, current_user, login_required
from app.models import Post,User
from app.forms import LoginForm,EditForm,PostForm,SignUpForm,ChangeFor... |
features_server.py | # -*- coding: utf-8 -*-
#
# This file is part of SIDEKIT.
#
# SIDEKIT is a python package for speaker verification.
# Home page: http://www-lium.univ-lemans.fr/sidekit/
#
# SIDEKIT is a python package for speaker verification.
# Home page: http://www-lium.univ-lemans.fr/sidekit/
#
# SIDEKIT is free software: you can re... |
server.py | #!/usr/bin/python3
import socket
import threading
from Crypto.PublicKey import RSA
class Server:
def __init__(self):
self.PORT = 1423
self.PUBLIC_TEXT = "Baglandi."
self.CODING = "ISO-8859-1"
self.TEXTCODE = "UTF-8"
self.sock = socket.socket()
self.sock.bind(('', self.PORT))
self.sock.list... |
vc.py | #
# Tello Python3 Control Demo
#
# http://www.ryzerobotics.com/
#
# 1/1/2018
#
# Modified by MPS
#
import threading
import socket
import time
import cv2
host = ''
port = 9000
locaddr = (host, port)
# Create a UDP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
tello_address = ('192.168.10.1', 8889... |
combine.py | import os
import time
import glob
import asyncio
import aiofiles
import multiprocessing as mp
async def write_major(major_queue:mp.Queue):
async with aiofiles.open("Major_Notes.txt", "w") as txt_write:
while True:
# queue.get() is already block
txt_str = major_queue.get()
... |
test_thread.py | import py
import thread
import threading
from pypy.module.thread.ll_thread import allocate_ll_lock
from pypy.module.cpyext.test.test_api import BaseApiTest
from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase
class TestPyThread(BaseApiTest):
def test_get_thread_ident(self, space, api):
... |
main.py | # Copyright (C) 2012 Jasper Snoek, Hugo Larochelle and Ryan P. Adams
#
# This code is written for research and educational purposes only to
# supplement the paper entitled
# "Practical Bayesian Optimization of Machine Learning Algorithms"
# by Snoek, Larochelle and Adams
# Advances in Neural Information Processing Syst... |
server_v12.py | import socket
from threading import Thread
from lesson12.states.out import OutState
from lesson12_projects.house3.data.state_gen import house3_state_gen
from lesson12_projects.house3.data.const import OUT
class ServerV12:
def __init__(self, transition_doc, host="0.0.0.0", port=5002, message_size=1024):
"... |
cmdlineframes.py |
from __future__ import absolute_import, division, print_function
from iotbx.reflection_file_reader import any_reflection_file
from cctbx.miller import display2 as display
from crys3d.hklviewer import jsview_3d as view_3d
from crys3d.hklviewer.jsview_3d import ArrayInfo
from cctbx import miller
from libtbx.math_utils ... |
load.py | import requests
import difflib
import numpy as np
import logging
import collections
import sys
import os
import statistics
import uuid
import matplotlib.pyplot as plt
import time
from util import get_request, get_data_size
from threading import Thread
import time
workerData = collections.namedtuple('workerData',['to... |
common.py | # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
from datetime import timedelta
import json
import yaml
import logging
import os
import subprocess
import re
import stat
import urllib.parse
import threading
import contextlib
import tempfile
from functools import reduce, wraps
# Django
from django.cor... |
wandb_run.py | import atexit
from datetime import timedelta
from enum import IntEnum
import glob
import json
import logging
import numbers
import os
import platform
import re
import sys
import threading
import time
import traceback
from types import TracebackType
from typing import (
Any,
Callable,
Dict,
List,
Nam... |
hack.py | #TKJ Black Hat
import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize
from multiprocessing.pool import ThreadPool
from requests.exceptions import ConnectionError
from mechanize import Browser
reload(sys)
sys.setdefaultencoding('utf8')
br = mechanize.Browser()
br. xd(... |
pmbuild.py | import collections
import sys
import os.path
import json
import fnmatch
import util
import subprocess
import platform
import shutil
import time
import dependencies
import glob
import jsn.jsn as jsn
import cgu.cgu as cgu
from http.server import HTTPServer, CGIHTTPRequestHandler
import webbrowser
import threading
# retu... |
util.py | # Copyright 2020 Michael Still
import importlib
import json
import multiprocessing
from pbr.version import VersionInfo
import random
import re
import requests
import secrets
import string
import sys
import time
import traceback
from oslo_concurrency import processutils
from shakenfist import db
from shakenfist.confi... |
test_functools.py | import abc
import builtins
import collections
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import time
import unittest
from weakref import proxy
import contextlib
try:
import threading
except ImportError:
threading = None
import func... |
compare_read_mapping_sensitivity.py | import glob
from multiprocessing import Process, Manager, Value, Semaphore
import os
import pysam
from random import random
import sys
from reference_vntr import load_unique_vntrs_data
from sam_utils import get_id_of_reads_mapped_to_vntr_in_samfile
from vntr_finder import VNTRFinder
def clean_up_tmp():
os.system... |
market.py | import time
# import sys
import random
import signal
import concurrent.futures
import os
from multiprocessing import Process
import sysv_ipc
from .sharedvariables import SharedVariables
import math
class Market(Process):
def __init__(
self,
shared_variables: SharedVariables,
coeffs,
... |
__main__.py | #!/usr/bin/env python
# -*- coding:utf-8 _*-
"""
@author: HJK
@file: main.py
@time: 2019-01-08
"""
import sys
import re
import threading
import click
import logging
import prettytable as pt
from . import config
from .utils import colorize
from .core import music_search, music_download, music_list_merge, get_sequence
... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The RonPaulCoin 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
im... |
simple.py | import threading
import requests
from bs4 import BeautifulSoup
class Simple:
def __init__(self, player=None):
self.player = player
def search_thread(self, q):
print("search thread begin")
try:
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.... |
main.py | # -*- coding: utf8 -*-
#
# (c) 2015 microelly2 MIT
#
vers="V123"
import kivy
kivy.require('1.0.9')
from kivy.app import App
from kivy.properties import *
from kivy.base import EventLoop
from kivy.uix.button import Button
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.gridlayout import GridLayout
from ki... |
panelIntroV1.py | import wx # Library used for the interface components
import visa # Library for device interfacing. In this case, GPIB access
import saveSession
from threading import Thread
from Instruments import instrument_names
import os
from wx.lib.pubsub import pub
import tkinter
from tkinter import filedialog
ID_... |
cam_video.py | # cam_video.py
import cv2
import time
import numpy as np
import torch
import threading
torch.device('cpu')
# global variable to exit the run by pressing some user specific keystroke
exit = 0
def analyze_cv_single_picture():
global exit
try:
model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pre... |
printsvg.py | #!/usr/bin/env python
import argparse
import math
import sys
from multiprocessing import Process, Queue
from xml.dom import minidom
import kdtree
import shapely.ops
import svg.path
from shapely.geometry import LineString
from graph import *
try:
import silhouette
units = silhouette.units
except ImportError... |
test_consumer_group.py | import collections
import logging
import threading
import time
import pytest
from kafka.vendor import six
from kafka.conn import ConnectionStates
from kafka.consumer.group import KafkaConsumer
from kafka.coordinator.base import MemberState
from kafka.structs import TopicPartition
from test.testutil import env_kafka_... |
browser.py | '''
Copyright (c) 2019 Vanessa Sochat
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, distribute... |
main.py | from __future__ import print_function
from bokeh.plotting import figure, curdoc
from bokeh.tile_providers import STAMEN_TERRAIN_RETINA, get_provider
from bokeh.models import ColumnDataSource, WheelZoomTool, Band, Button, LabelSet, Dropdown, TapTool, Quad
from bokeh.layouts import column, row
from bokeh.events import B... |
_util.py | # instance.method = MethodType(method, instance)
# !aws codecommit list-repositories
# !autopep8 --in-place --aggressive --aggressive brac_dual_agent.py
# gpus = tf.config.experimental.list_physical_devices('GPU')
# if gpus:
# try:
# for gpu in gpus:
# tf.config.experimental.set_memory_growth(g... |
rhcnode.py | #!/usr/bin/env python
# Copyright (c) 2019, The Personal Robotics Lab, The MuSHR Team, The Contributors of MuSHR
# License: BSD 3-Clause. See LICENSE.md file in root directory.
import cProfile
import os
import signal
import threading
import rospy
from ackermann_msgs.msg import AckermannDriveStamped
from geometry_msg... |
simple_microservice_after.py | # -*- coding: utf-8 -*-
from datetime import datetime
import io
import os.path
import time
import threading
from wsgiref.validate import validator
from wsgiref.simple_server import make_server
EXCHANGE_FILE = "./exchange.dat"
def update_exchange_file():
"""
Writes the current date and time every 10 seconds i... |
diskover-treewalk-client.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""diskover - Elasticsearch file system crawler
diskover is a file system crawler that index's
your file metadata into Elasticsearch.
See README.md or https://github.com/shirosaidev/diskover
for more information.
Copyright (C) Chris Park 2017-2018
diskover is released unde... |
test_spark.py | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
import ssl
import threading
import time
import mock
import pytest
import urllib3
from requests import RequestException
from six import iteritems
from six.moves import BaseHTTPServer
from six.mov... |
utility.py | import os
import math
import time
import datetime
from multiprocessing import Process
from multiprocessing import Queue
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import imageio
import torch
import torch.optim as optim
import torch.optim.lr_scheduler as lrs
class time... |
find_clusters.py | import scipy as sp
import numpy as np
import time
import random
import queue
import multiprocessing as mp
import copy
from collections import defaultdict
from sklearn.cluster import AgglomerativeClustering
from sklearn.metrics import pairwise_distances
from joblib import Parallel, delayed
from .approximate_pagerank imp... |
client.py | import os
import sys
import socket
import secrets
import tempfile
import http.server
import socketserver
from threading import Thread
from urllib.request import urlopen
PORT = 4040
BEAM_SERVER = '192.168.0.3:5005'
d = tempfile.TemporaryDirectory()
print("using tempdir " + d.name)
def handler_for_dir(dir):
def... |
autotune.py | import datetime
import logging
import multiprocessing
import os
import pickle
import sys
import time
import threading
from collections import defaultdict
from functools import partial, wraps
from io import IOBase
from logging.handlers import QueueListener, QueueHandler
from subprocess import Popen
from typing import A... |
tests.py | import time
from uuid import uuid1
from datetime import datetime, timedelta
from threading import Thread
from django.test import TestCase, TransactionTestCase
from django.contrib.auth.models import User, Group
from django.core import management, mail
from django.core.mail import send_mail
from django.conf import sett... |
simplepipreqs.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-import os
from pathlib import Path
import subprocess
from yarg import json2package
from yarg.exceptions import HTTPError
import requests
import argparse
import os
import sys
import json
import threading
import itertools
import time
try:
from pip._internal.operations im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.