source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
int_learning-checkpoint.py | new_dict = dict(enumerate(plz2))
print(new_dict)
#------------------------------------------------------------------------------------------
#zip - combines two lists,
x7 = [1, 2, 3, 4]
x8 = [7, 6, 2, 1]
x9 = ['a', 'b', 'c', 'd']
for a,b in zip(x7,x8):
print(a,b)
import
for i in zip(x7,x8,x9):
print(i[2])
... |
main.py | # coding: utf-8
import threading; import requests; import json; import time; import random
Guild_ID = input("Guild ID > ")
t = input("Token >"); headers = {
"Authorization": f"t" # Change this to: "Authorization": f"Bot {t}" | to use a bot token
}
a = {
"description": None,
"features": ["NEWS"],
"prefe... |
test_api.py | import mock
import re
import socket
import threading
import time
import warnings
from unittest import TestCase
import pytest
from tests.test_tracer import get_dummy_tracer
from ddtrace.api import API, Response
from ddtrace.compat import iteritems, httplib, PY3
from ddtrace.internal.runtime.container import CGroupInf... |
tcp.py | # -*- coding: utf-8 -*-
'''
TCP transport classes
Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})"
'''
# Import Python Libs
from __future__ import absolute_import
import logging
import msgpack
import socket
import os
import weakref
import time
import traceback
import errno
# Import Salt... |
auto.py | # This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# 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... |
app.py | from flask import Flask
from flask import Response
from flask_cors import CORS
import pika
import os
import json
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
import threading
import time
import random
app = Flask(__name__)
CORS(app)
host_name = os.ge... |
consul.py | # Copyright 2018 eShares, Inc. dba Carta, 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
s3_compatible_api.py | import boto3
import requests
import xmltodict
import xml
import urllib
import os
import threading
import time
import hmac
import hashlib
import datetime
import io
from botocore.handlers import *
from framework.libs.common.s3_utils import random_string, calculate_md5
DEFAULT_BOTO_S3_MODEL_API_VERSION = 'custom-xml' # ... |
api.py | import os
import secrets
import threading
import tornado.web
import tornado.escape
import logging.config
from app.classes.models import Roles, Users, check_role_permission, Remote, model_to_dict
from app.classes.multiserv import multi
from app.classes.helpers import helper
from app.classes.backupmgr import backupmgr
... |
isal.py | #!/usr/bin/python
# coding=utf-8
#jangan di recode ngentot
#recode jomblo seumur hidup
# (MR.K7C8NG) PEMBUAT
#SUBSCRIBE CHANNEL mrk7c8ng-ices
#FOLLOW INSTAGRAM @pranata_pasha
#Import module
import os,sys,time,datetime,random,hashlib,re,threading,json,getpass,urllib,cookielib
from multiprocessing.pool import ThreadPool... |
utils.py | import cv2
import numpy
import time
import struct
import os
import lz4.block
from imutils import contours, grab_contours
from datetime import datetime, timedelta
from random import uniform, gauss, randint
from scipy import spatial
from util.adb import Adb
from util.logger import Logger
from util.config_consts import Ut... |
bot.py | import re
import praw
import time
import datetime
import logging
from logging.handlers import TimedRotatingFileHandler
#import threading
import multiprocessing as mp
import threading as th
import configparser
from .basebot import BaseBot, BotUtil
from config import *
from .bot_queues import bot_queues, BotQueues
from .... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2017 The Meson development team
# 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 ... |
recognize.py | from . import fingerprint
from . import decoder
import numpy as np
import pyaudio
import time
import sounddevice as sd
import sys
from os import path,makedirs,remove,rename
from multiprocessing import Process,Queue
import json
import wave
class BaseRecognizer(object):
def __init__(self, dejavu):
self.... |
favicon.py | import sys, socket
from planet import config, feedparser
from planet.spider import filename
from urllib2 import urlopen
from urlparse import urljoin
from html5lib import html5parser, treebuilders
from ConfigParser import ConfigParser
# load config files (default: config.ini)
for arg in sys.argv[1:]:
config.load(arg)... |
thread_delegating_executor.py | # 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 by applicable law o... |
joint_trajectory_action_controller.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2017 Svenzva Robotics, 2010-2011, Antons Rebguns.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condition... |
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... |
__init__.py | import logging
import os
import signal
import sys
import time
from .daemon import AbstractPatroniDaemon, abstract_main
from .version import __version__
logger = logging.getLogger(__name__)
PATRONI_ENV_PREFIX = 'PATRONI_'
KUBERNETES_ENV_PREFIX = 'KUBERNETES_'
class Patroni(AbstractPatroniDaemon):
def __init__(... |
tpu_estimator.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... |
test.py | from random import randint
from time import perf_counter
from multiprocessing import Process, JoinableQueue, current_process
from progressbar import ProgressBar
from dijkstra import Graph, dijkstra
def generate_random_graph(nodes, edges_per_node, max_weight):
graph = Graph()
for node_index in range(1, nodes ... |
LabManagerAuthenticationWindow.py | """
Zachary Cook
Swipe window used to authenticate lab managers.
"""
import threading
import time
from PyQt5 import QtWidgets,QtCore
from .SwipeWindow import SwipeWindow
from ...Util import Http
class LabManagerAuthenticationWindow(SwipeWindow):
"""Window for authenticating lab manager ids.
"""
onAuth... |
async.py | #!/usr/bin/env python
# encoding: utf8
#
# Copyright © Burak Arslan <burak at arskom dot com dot tr>,
# Arskom Ltd. http://www.arskom.com.tr
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... |
tunnel.py | """ Code for IP tunnel over a mesh
# Note python-pytuntap was too buggy
# using pip3 install pytap2
# make sure to "sudo setcap cap_net_admin+eip /usr/bin/python3.8" so python can access tun device without being root
# sudo ip tuntap del mode tun tun0
# sudo bin/run.sh --port /dev/ttyUSB0 --setch-shortfast
# sudo bin/... |
test_runtimes.py | import asyncio
import json
import multiprocessing
import threading
import time
import pytest
from jina import Document, Executor, Client, requests
from jina.enums import PollingType
from jina.parsers import set_gateway_parser, set_pea_parser
from jina.serve.networking import GrpcConnectionPool
from jina.serve.runtime... |
sample_selector.py | #!/usr/bin/env python
__author__ = 'Florian Hase'
#========================================================================
import numpy as np
import multiprocessing
from multiprocessing import Manager, Process
from gryffin.utilities import Logger
#==================================================================... |
test_elasticsearch.py | # Copyright The OpenTelemetry 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 ... |
simple_av_client.py | import cv2
import numpy as np
from threading import Thread
"""
Based heavily on Github user @CPsridharCP's implementation of Misty teleoperation: https://github.com/CPsridharCP/MistySkills/tree/master/Apps/Teleop/02_pythonTeleop
"""
class VidStreamer:
def __init__(self, path):
self.stream = cv2.VideoCapt... |
test_wrapper.py | from __future__ import division, absolute_import, print_function
__copyright__ = "Copyright (C) 2009 Andreas Kloeckner"
__license__ = """
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 r... |
71daa7a2d45ebc38d67b0ebe405f0d2af2426570manager.py | from irc import Irc
from broker import Broker
from events import Quit as QuitEvent
from multiprocessing import Process, Queue
import settings
from os import path
from imp import load_source
class Manager(object):
def __init__(self):
self.rxq = Queue()
self.txq = Queue()
self.inputs = []
... |
udp_send_checker.py | # -*- coding: utf-8 -*-
"""This module handles the periodic resending of failed udp sends to the ProCem RTL."""
# Copyright (c) TUT Tampere University of Technology 2015-2018.
# This software has been developed in Procem-project funded by Business Finland.
# This code is licensed under the MIT license.
# See the LICEN... |
oepoll.py | # -*- coding: utf-8 -*-
from TEAM_BOT_MAX.ttypes import TalkException, ShouldSyncException
from .client import TEAMBOTMAXv2
from threading import Thread
from types import *
import os, sys, time
class OEPoll(object):
OpInterrupt = {}
client = None
__squareSubId = {}
__squareSyncToken = {}
def __in... |
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... |
ufile_api.py | import threading
import time
import os
import Queue
from ucloud.ufile import downloadufile
from ucloud.ufile import getufilelist
from ucloud.ufile import putufile
from ucloud.logger import logger, set_log_file
set_log_file()
retry_max_fail = 3
def DownloadUfileBatch(public_key, private_key, bucket, prefix, save_dir, ... |
txn_processor.py | from multiprocessing.connection import Connection
from threading import Thread, get_ident
from typing import List, Any, Callable, Dict
from time import sleep, time
from exclusive_lock.database import Database
from exclusive_lock.messages import ACQUIRE, RELEASE, TERMINATE, ABORT
from utils.mutex import Mutex
TIME_LIMI... |
shared_filepool.py | import gzip
from multiprocessing import Pipe, Process
from .shared_file import SharedFile
class SharedFilePool(object):
def __init__(self, lock, chunk_size=2 ** 16):
with_master, with_slave = Pipe()
self.files = SharedFilePoolStore(with_slave, lock)
self.process = Process(target=shared_f... |
appController.py | from lib.tool import Tool
from appium import webdriver
from lib.logger import logger
from lib.path import LOGPATH,APPPICTUREPATH
import os
import threading
import subprocess
import time
import queue
# 多线程数据隔离
local = threading.local()
# 存放driver的对列
driver_queue = queue.Queue()
# 存放手机设备名称的对列
device_name_queue = queue.Q... |
discord_register.py | import sys
import re
import recaptcha
import requests
import json
import random
import Queue
import threading
emails_q = Queue.Queue()
proxies_q = Queue.Queue()
def debug(text, conf):
if conf['debug']:
print ("[DEBUG] "+str(text))
def read_configurations():
try:
conf = json.loads(open('discor... |
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... |
filemanager.py | """
Components/File Manager
=======================
A simple manager for selecting directories and files.
Usage
-----
.. code-block:: python
path = '/' # path to the directory that will be opened in the file manager
file_manager = MDFileManager(
exit_manager=self.exit_manager, # function called wh... |
start_lambda_api_integ_base.py | import shutil
import signal
import uuid
from typing import Optional, Dict
from unittest import TestCase, skipIf
import threading
from subprocess import Popen
import time
import os
import random
from pathlib import Path
from tests.testing_utils import SKIP_DOCKER_TESTS, SKIP_DOCKER_MESSAGE, run_command
@skipIf(SKIP_D... |
arm.py | """Arm part module.
Implements a Right and a Left Arm.
"""
import time
import numpy as np
from operator import attrgetter
from collections import OrderedDict
from threading import Thread, Event
from .hand import LeftEmptyHand, RightEmptyHand, LeftForceGripper, RightForceGripper, OrbitaWrist
from .part import Reachy... |
downloadclient.py | # Copyright 2018 CERN for the benefit of the ATLAS collaboration.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
test_sched.py | import queue
import sched
import threading
import time
import unittest
from test import support
from test.support import threading_helper
TIMEOUT = support.SHORT_TIMEOUT
class Timer:
def __init__(self):
self._cond = threading.Condition()
self._time = 0
self._stop = 0
def time(self):... |
cli.py | import ast
import inspect
import os
import platform
import re
import sys
import traceback
import warnings
from functools import update_wrapper
from operator import attrgetter
from threading import Lock
from threading import Thread
import click
from werkzeug.utils import import_string
from .globals import current_app
... |
webtest.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, sys, zlib, gzip, re, socket, uuid, time, signal, argparse, textwrap
import http.client
import urllib.parse, urllib.request, urllib.error, urllib.robotparser
import multiprocessing as mp, multiprocessing.managers
import urlutils, urlhttp, urldeque, urlfinder, u... |
distribute_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... |
house_keeping.py | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
quantum_slot.py | import json
from urllib.parse import urlencode
from urllib.request import urlopen
from qiskit import *
from qiskit.tools.monitor import job_monitor
import ipywidgets as widgets
from IPython.display import display
import threading
import os
script_dir = os.path.dirname(__file__)
IBMQ.load_accounts(hub=None)
__all__ = ... |
multiproc_utils.py | import multiprocessing as mp
from multiprocessing import Process, Pool
from more_itertools import chunked
from tqdm import tqdm
from functools import partial
__all__ = ["batch_multiprocess", "batch_multiprocess_with_return"]
def batch_multiprocess(function_list, n_cores=mp.cpu_count(), show_progress=True,
t... |
views.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
import random
import logging
import time
import threading
import os
from ssshare import app
from ssshare.ascii import birthday_2017, ss_title
from ssshare.ss import crawler
from ssshare import donation
from flask import render_template, send_from_directory, ab... |
print_worker.py | import asyncio
import inspect
import threading
import time
import traceback
from functools import partial
from queue import Queue
from threading import Thread
from typing import Callable
from .yqueue import Queuey, from_coroutine
class Worker:
def __init__(self, n: int, queue_maxsize=0, ignore_exceptions=()):
... |
git_common.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Monkeypatch IMapIterator so that Ctrl-C can kill everything properly.
# Derived from https://gist.github.com/aljungberg/626518
from __future__ import prin... |
autodownloader.py | import tiktok
import database
from time import sleep
from threading import Thread
class AutoDownloader():
def __init__(self, window, downloadqueue):
self.window = window
self.autoDownloadQueue = downloadqueue
self.clipIndex = 0
self.auto = False
def startAutoMode(... |
Misc.py | ## @file
# Common routines used by all tools
#
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
import sys
import string
import threading
import time
import re
import ... |
scheduler.py | import schedule
import time
import threading
from output import send_problem
from problemManager import saveProblems
"""
daily 문제를 전송하기 위한 클래스 : timer 필요
"""
# timer = timer
class Scheduler:
def send_daily(self): # daily 문제 전송
send_problem("daily")
def daily_problem_schedule(self): # daily 문제 전송 스케쥴
... |
test_s3.py | import boto3
import botocore.session
from botocore.exceptions import ClientError
from botocore.exceptions import ParamValidationError
from nose.tools import eq_ as eq
from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
import isodate
import email.utils
import datetime
import threading
import re
... |
crawler.py | #!/usr/bin/python3
import os,json,threading,time,gc
from mcbbs_thread import bbsthread, get_ip_list
datas = []
last = 9000 # avoid stopping unexpectedly (= tid / 100)
use_proxy = False
MAX = 923416 # max tid
if use_proxy:
get_ip_list(0)
def crawler(f: int, t: int, c: int, i: int):
global MAX
'''
A cra... |
manager.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: unicorn_binance_websocket_api/manager.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api
# Documentation: https://lucit-systems-and-development.github.io/unicorn-binance... |
test_pools.py | import unittest
import unittest.mock
import heapq
import itertools
import logging
import multiprocessing
import multiprocessing.connection
import os
import pickle
import tempfile
from g1.bases import pools
def setUpModule():
# Disable all log messages (for _ProcessActor).
logging.basicConfig(level=logging.C... |
trace_event_unittest.py | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
import json
import logging
import math
import multiprocessing
import os
import time
import unittest
import sys
from p... |
dns_test.py | # -*- coding: utf-8 -*-
import optparse
import socket
import re
import time
from queue import Queue, Empty
from threading import Thread
import logging
import logging.handlers
import dns.message
import dns.query
from datetime import datetime
class DNSSurveillance(object):
def __init__(self, text_name, dns_server, ... |
test_pants_service.py | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import threading
from pants.pantsd.service.pants_service import PantsService
from pants_test.test_base import TestBase
class RunnableTestService(PantsService):
def run(self): pass
c... |
test_misc.py | import os
import re
import unittest
from tempfile import TemporaryDirectory
from threading import Thread
import pytest
from mltk.utils import *
class IterFilesTestCase(unittest.TestCase):
def test_iter_files(self):
names = ['a/1.txt', 'a/2.txt', 'a/b/1.txt', 'a/b/2.txt',
'b/1.txt', 'b/... |
counting_test.py | # python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... |
train.py | #!/usr/bin/env python
import sys
sys.path.append('..')
from utils.environment import *
from worker import *
from network import *
import threading
from time import sleep
import os
import h5py
flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_boolean('is_approaching_policy', False, 'If learning approaching policy.... |
TimerTools.py | import threading
import time
from abc import ABCMeta, abstractmethod, abstractproperty
class TimerWrapper(object):
def __init__(self):
self.stopped = False
def stop(self):
"""method to stop current timer"""
self.stopped = True
class SimpleTimerObject(TimerWrapper):
def __init__(self... |
remote_cluster_test.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... |
test_topic_queue_poller.py | import json
import time
from threading import Thread
from unittest.mock import Mock
import boto3
from moto import mock_s3, mock_sns, mock_sqs
from moto.server import backends
from tqp.topic_queue_poller import TopicQueuePoller, create_queue
# --------------------------------------------------------------------------... |
phoStreamLabjackToCSV.py | # phoStreamLabjackToCSV.py
# Pho Hale, 05-26-2021 @ 10:12pm
# This file opens a stream to a Labjack T7 connected over USB, reading its specified pins at a high frequency for the specified duration.
# It makes use of the labjack-controller 3rd party python library: https://labjack-controller.readthedocs.io/en/latest/
i... |
RESTServer.py | from flask import Flask, request, redirect, jsonify, render_template
from werkzeug.exceptions import HTTPException, NotFound, BadRequest
from energenie.Registry import DeviceRegistry
from energenie.Devices import DeviceFactory
from energenie.Handlers import HandlerRegistry
from energenie.Config import Config
import thr... |
test_fetchers.py | import warnings
import unittest
import sys
import urllib2
import socket
from openid import fetchers
# XXX: make these separate test cases
def failUnlessResponseExpected(expected, actual):
assert expected.final_url == actual.final_url, (
"%r != %r" % (expected.final_url, actual.final_url))
assert expe... |
region.py |
"""
Comments about the yosai_dpcache fork
-------------------------------------------------------------------------
- yosai's cache handlers interact with yosai_dpcache
- unlike yosai_dpcache.cache, yosai's cache handlers may specify expiration time for a
set operation rather than use a global expiration. This is... |
rnn_base.py | from __future__ import print_function
import numpy as np
import theano
import theano.tensor as T
import lasagne
import cPickle
import re
import os
import glob
import sys
import random
from time import time
from sequence_noise import SequenceNoise
from update_manager import Adagrad
from recurrent_layers import Recurren... |
deviceDetailsFetch.py | from __future__ import print_function
# Library Import
import urllib2
import json
import codecs
# Module Import
import pcapReader
import reportGen
import threading
class fetchDeviceDetails:
def __init__(self, ipObject):
self.mac = ipObject["Ethernet"]
self.url = "http://macvendors.co/api/" + self.... |
client.py | import logging
try:
import queue
except ImportError: # pragma: no cover
import Queue as queue
import signal
import threading
import time
import six
from six.moves import urllib
try:
import requests
except ImportError: # pragma: no cover
requests = None
try:
import websocket
except ImportError: #... |
test_loky_backend.py | import os
import sys
import time
import psutil
import pytest
import signal
import pickle
import platform
import socket
import multiprocessing as mp
from tempfile import mkstemp
from loky.backend import get_context
from loky.backend.compat import wait
from loky.backend.context import START_METHODS
from loky.backend.uti... |
servers.py | import os
login_manager = None
import threading
from pyworks import Task
from pyworks.core import ManagerManager
from pyworks.util import settings
from waitress import serve
from web.views import app, init_db
from web.websocketserver import WebSocketServer, WebSocket
class WebServer(Task):
def pw_initialized(s... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import argparse
import json
import multiprocessing
imp... |
test_sockets.py | import os, multiprocessing, subprocess
from runner import BrowserCore, path_from_root
from tools.shared import *
def clean_pids(pids):
import signal, errno
def pid_exists(pid):
try:
# NOTE: may just kill the process in Windows
os.kill(pid, 0)
except OSError, e:
return e.errno == errno.EPE... |
utils.py | import asyncio
import functools
import importlib
import inspect
import json
import logging
import multiprocessing
import os
import pkgutil
import re
import shutil
import socket
import sys
import tempfile
import threading
import warnings
import weakref
import xml.etree.ElementTree
from asyncio import TimeoutError
from c... |
python_download_csv.py | import requests
import json
import pywebhdfs.webhdfs
import time
import quandl
import pandas
import datetime
import os
import socket
from kafka import KafkaProducer
import threading
# This class starts a deamonized thread to do handle all import tasks
# All import logic is part of this class
class HDFSImportJob:
... |
main.py | import speech_recognition as sr
from os import system, _exit
from playsound import playsound
from random import randrange
from threading import Thread
from time import time, localtime
from datetime import date
from utilities import *
from dictionary import *
from tts import *
from stt import *
from google_functions im... |
linker.py | #!/usr/bin/env python3
###########################################
# #
# "Linker" #
# Simple links sharing server, #
# to protect links from bot #
# #
# Etienne SELLAN ... |
tcp.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... |
main.py | import threading
from queue import Queue
from spider import Spider
from domain import *
from general import *
PROJECT_NAME = 'calstatela2'
HOMEPAGE = 'http://calstatela.edu/'
DOMAIN_NAME = get_domain_name(HOMEPAGE)
QUEUE_FILE = PROJECT_NAME + '/queue.txt'
CRAWLED_FILE = PROJECT_NAME + '/crawled.txt'
CRAWLED_DICT_FILE ... |
planetarydata.py | from copy import deepcopy
import functools
import math
import operator
from threading import Thread, Lock
from time import sleep
import traceback
from tsparser import config, sender
from tsparser.timestamp import get_timestamp
from tsparser.utils.singleton import Singleton
from tsparser.utils.statistic_data_collector ... |
ddnsserver.py | #!/usr/bin/env python
# coding=utf-8
# NOTE: I didn't write this all myself. I borrowed it and changed some stuff up.
# I'm pretty sure I got this from this gist:
# https://gist.github.com/pklaus/b5a7876d4d2cf7271873
import argparse
import datetime
import sys
import time
import threading
import traceback
import socke... |
launchtree_widget.py | #!/usr/bin/env python
import os
import re
import yaml
import threading
import itertools
import rospy
import rospkg
import roslaunch
from rqt_launchtree.launchtree_loader import LaunchtreeLoader
from rqt_launchtree.launchtree_config import LaunchtreeConfig, LaunchtreeArg, LaunchtreeRemap, LaunchtreeParam, LaunchtreeR... |
test_106_shutdown.py | #
# mod-h2 test suite
# check HTTP/2 timeout behaviour
#
import time
from threading import Thread
import pytest
from .env import H2Conf
from pyhttpd.result import ExecResult
class TestShutdown:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env):
conf = H2Conf(env)
conf... |
infoclientLib.py | import socket
import sys
import socket
import threading
import SocketServer
class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
def __init__(self, callback, infoclient, *args, **keys):
self.callback = callback
self.infoclient = infoclient
SocketServer.BaseRequestH... |
test_gil_scoped.py | # -*- coding: utf-8 -*-
import multiprocessing
import threading
from pybind11_tests import gil_scoped as m
def _run_in_process(target, *args, **kwargs):
"""Runs target in process and returns its exitcode after 10s (None if still alive)."""
process = multiprocessing.Process(target=target, args=args, kw... |
binance.py | # Import Built-Ins
import logging
import json
import threading
import time
# Import Third-Party
from websocket import create_connection, WebSocketTimeoutException
import requests
# Import Homebrew
from bitex.api.WSS.base import WSSAPI
from datetime import datetime
# Init Logging Facilities
log = logging.getLogger(__na... |
parser.py | #
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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 requi... |
BeadsEe_dummy.py | #!/usr/bin/env /usr/bin/python3
# -*- coding: utf-8 -*-
# -----------------------------------------------
# ROS Node
# Beads End effector Control
#
# The Apache License 2.0
# Copyright (C) 2020-2021 myasu.
# -----------------------------------------------
import logging
import os
import rospy
import rosparam
import ti... |
threading_solution.py | import re
import requests
import threading
from typing import List
def download_image(url:str)->None:
print(f'Downloading {url}')
response = requests.get(url)
if response.ok:
return response.content
def write_to_file(filename:str, bytes:bytes):
with open(filename, 'wb') as fh:
fh.write(bytes)
def make_file... |
task.py | import logging
import pickle
import threading
from abc import ABC, abstractmethod
from ray.streaming.collector import OutputCollector
from ray.streaming.config import Config
from ray.streaming.context import RuntimeContextImpl
from ray.streaming.runtime.transfer import ChannelID, DataWriter, DataReader
logger = loggi... |
camera.py | import re
import cv2
import time
import threading
import numpy as np
from randomcolor import RandomColor
from skimage.measure import find_contours
randomcolor = RandomColor()
color_regex = re.compile(r'(\d+)')
def random_colors(count):
return list(map(lambda x: list(map(int, color_regex.findall(x))),
randomcolor.... |
bot.py | # coding=utf-8
# Copyright 2008, Sean B. Palmer, inamidst.com
# Copyright © 2012, Elad Alfassa <elad@fedoraproject.org>
# Copyright 2012-2015, Elsie Powell, http://embolalia.com
#
# Licensed under the Eiffel Forum License 2.
from __future__ import unicode_literals, absolute_import, print_function, division
from ast i... |
abs_task.py | from abc import ABC
from abc import abstractmethod
import argparse
from distutils.version import LooseVersion
import functools
import logging
import os
from pathlib import Path
import sys
from typing import Any
from typing import Callable
from typing import Dict
from typing import List
from typing import Optional
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.