source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
centrifugeServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
server.py | import datetime
import json
import os
from threading import Thread
from fastapi import FastAPI
from models.available_devices import Devices
api_prefix = os.getenv("API_PREFIX", "/")
first_run = datetime.datetime.utcnow()
app = FastAPI()
@app.get("".join([api_prefix, "health_check"]))
async def health_check():
... |
__init__.py | """
.. moduleauthor:: Fabio Manganiello <blacklight86@gmail.com>
.. license: MIT
"""
import logging
import re
import socket
import time
from threading import Thread, Event as ThreadEvent, get_ident
from typing import Optional, Dict
from platypush.bus import Bus
from platypush.common import ExtensionWithManifest
from... |
advanced.py | # Released under the MIT License. See LICENSE for details.
#
"""UI functionality for advanced settings."""
from __future__ import annotations
from typing import TYPE_CHECKING
import _ba
import ba
from bastd.ui import popup as popup_ui
if TYPE_CHECKING:
from typing import Any, Optional
class AdvancedSettingsWi... |
network.py | #!/usr/bin/env python3
import os
import sys
# Necessary on macOS if the folder of libdnet is not in
# ctypes.macholib.dyld.DEFAULT_LIBRARY_FALLBACK
# because the newer macOS do not allow to export
# $DYLD_FALLBACK_LIBRARY_PATH with sudo
if os.name == "posix" and sys.platform == "darwin":
import ctypes.macholib.d... |
gsi_replica_indexes.py | import json
import re
from .base_gsi import BaseSecondaryIndexingTests
from membase.api.rest_client import RestConnection, RestHelper
import random
from lib import testconstants
from lib.memcached.helper.data_helper import MemcachedClientHelper
from lib.remote.remote_util import RemoteMachineShellConnection
from threa... |
util.py | from threading import Thread
def postpone(function):
def decorator(*args, **kwargs):
t = Thread(target=function, args=args, kwargs=kwargs)
t.daemon = True
t.start()
return decorator |
sched.py | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
controller.py | from threading import Thread
from model import PredictorModelGroup
from config_parser import getModelTemplates
import logging
logger = logging.getLogger(__name__)
model_groups = []
def start():
thread = Thread(target=load_models, args=(), daemon=True)
thread.start()
def load_models():
logger.info('Load... |
A3C_discrete_action.py | """
Asynchronous Advantage Actor Critic (A3C) with discrete action space, Reinforcement Learning.
The Cartpole example.
View more on my tutorial page: https://morvanzhou.github.io/tutorials/
Using:
tensorflow 1.0
gym 0.8.0
"""
import multiprocessing
import threading
import tensorflow as tf
import numpy as np
import... |
test_subprocess.py | import unittest
from unittest import mock
from test import support
from test.support import import_helper
from test.support import os_helper
from test.support import warnings_helper
import subprocess
import sys
import signal
import io
import itertools
import os
import errno
import tempfile
import time
import traceback
... |
observer.py | __author__ = 'foxtrot'
import tweepy
from tweepy import Stream
import json
import indicoio
import time
import threading
from googleapiclient.discovery import build
from MyState import *
import urllib2
# Tokens and keys
consumer_key = "nEcXxJ8rQ7UyDrPYzzDTFScLl"
consumer_secret = "60GrqyEeVwLLP5fLnx6OUtAixrAGpinZ1eBcu... |
test_debug.py | import importlib
import inspect
import os
import re
import sys
import tempfile
import threading
from io import StringIO
from pathlib import Path
from unittest import mock
from django.core import mail
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import DatabaseError, connection
from djan... |
conftest.py | import logging
import os
import random
import time
import tempfile
import threading
from concurrent.futures.thread import ThreadPoolExecutor
from datetime import datetime
from math import floor
from shutil import copyfile
from functools import partial
from botocore.exceptions import ClientError
import pytest
from coll... |
testremote.py | import os
import time
import tempfile
import unittest
import threading
import multiprocessing as mp
import vivisect
import vivisect.tests.helpers as helpers
import vivisect.remote.server as v_r_server
def runServer(name, port):
dirn = os.path.dirname(name)
testfile = helpers.getTestPath('windows', 'amd64', '... |
test_unix_events.py | """Tests for unix_events.py."""
import collections
import contextlib
import errno
import io
import os
import pathlib
import signal
import socket
import stat
import sys
import tempfile
import threading
import unittest
from unittest import mock
from test import support
if sys.platform == 'win32':
raise unittest.Ski... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. versionadded:: 2014.7.0
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module. Version 3.2.3 is currently recommended when
SSL is enabled, since this version worked the best with SSL in
internal testing.... |
sqlite.py | import os
import sys
import time
import sched
import sqlite3
from typing import Any, List, Dict
from appdirs import user_data_dir
from contextlib import closing
from multiprocessing import Process, Queue
from specklepy.transports.abstract_transport import AbstractTransport
from specklepy.logging.exceptions import Speck... |
test_serving.py | # -*- coding: utf-8 -*-
"""
tests.serving
~~~~~~~~~~~~~
Added serving tests.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import ssl
try:
import httplib
except ImportError:
from http import client as httplib
try:
from urllib2 impor... |
emails.py | # -*- coding: utf-8 -*-
"""
:author: Grey Li (李辉)
:url: http://greyli.com
:copyright: © 2018 Grey Li <withlihui@gmail.com>
:license: MIT, see LICENSE for more details.
"""
from threading import Thread
from flask import url_for, current_app
from flask_mail import Message
from bluelog.extensions import ... |
test_client.py | # test_client.py -- Compatibilty tests for git client.
# Copyright (C) 2010 Google, Inc.
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. You can redistribute it and/or
... |
teos.py | #!/usr/bin/python3
import os
import subprocess
import threading
import time
import re
import pathlib
import shutil
import pprint
import json
import shutil
import sys
import eosfactory.core.logger as logger
import eosfactory.core.utils as utils
import eosfactory.core.setup as setup
import eosfactory.core.config as con... |
interpolate_tables_func.py | #!/usr/bin/env python
#--------------------------------
# Name: interpolate_tables_func.py
# Purpose: Interpolate ETrF rasters between Landsat scenes based on DOY
#--------------------------------
from __future__ import division
import argparse
from builtins import input
from collections import defaultdic... |
bartender_manual.py | import time
import os
import sys
import RPi.GPIO as GPIO
import json
import logging
import threading
import traceback
from flask import Flask
from flask_ask import Ask, request, session, question, statement
from enum import Enum
from drinks import drink_list
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
# stepper p... |
mail.py | import smtplib
from email.mime.text import MIMEText
from threading import Thread
from flask import Flask, render_template
class MailSender(object):
def __init__(self, app: Flask = None):
if app is not None:
self.init_app(app)
def init_app(self, app: Flask = None):
self.server_nam... |
api.py | # -*- coding: utf-8 -*-
"""
api
~~~
Implements API Server and Interface
:author: Feei <feei@feei.cn>
:homepage: https://github.com/WhaleShark-Team/cobra
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2018 Feei. All rights reserved
"""
import datetime
import e... |
rq_export_scores.py | import pandas as pd
from multiprocessing import Process
from release_manager import *
from rq_run import *
# import plotly.graph_objs as go
# import plotly.io as pio
import copy
import shutil
"""
sk
"""
# def getMetric(df, metric):
#
# # df['train_bugs'] = df['train_changes'] * df['train_Bug_Per']/100
# #
# ... |
machinefiletests.py | # Copyright 2016-2021 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 applicable law or agree... |
thread_buffer.py | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... |
miniterm.py | #!g:\python27\python.exe
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threading
import serial
from serial.tools.list_ports i... |
parallel.py | # /usr/bin7env python3
import threading
def counter(count):
for l in range(count):
print(str(l)+' ->Name :{} ID: {}'.format(threading.current_thread().getName(),threading.current_thread().ident))
print('{} terminado'.format(threading.current_thread().getName()))
if __name__=="__main__":
threa... |
power_monitoring.py | import random
import threading
import time
from statistics import mean
from cereal import log
from common.realtime import sec_since_boot
from common.params import Params, put_nonblocking
from selfdrive.swaglog import cloudlog
PANDA_OUTPUT_VOLTAGE = 5.28
CAR_VOLTAGE_LOW_PASS_K = 0.091 # LPF gain for 5s tau (dt/tau / (... |
transfer.py | import os
import re
import logging
from collections import deque
from glob import has_magic, iglob
from hashlib import md5
from math import ceil
from pathlib import Path
from queue import Empty
from threading import Semaphore, Thread
from typing import Deque, Dict, Generator, Iterable, List, Tuple, Union
from rich.pro... |
test_mturk_manager.py | #!/usr/bin/env python3
# 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.
import unittest
import os
import time
import json
import threading
import pickle
from unittest import mock
from parlai.m... |
individual_coverage.py | #!/usr/bin/env python3
import io
import contextlib
import os
import sys
import glob
import multiprocessing
import configparser
import itertools
import pytest
def run_tests(src, test, fail):
stderr = io.StringIO()
stdout = io.StringIO()
with contextlib.redirect_stderr(stderr):
with contextlib.redi... |
computer4.py | import operator
import threading
from collections import namedtuple, deque
from enum import IntEnum
from time import sleep
class ParameterMode(IntEnum):
POSITION = 0
IMMEDIATE = 1
RELATIVE = 2
class DisStyle(IntEnum):
NO_PARAM = 0 # HALT
THREE_PARAM = 1 # P3 ← P1 op P2
IN_PARAM = 2 # P1 ←... |
cli.py | #!/usr/bin/env python
import argparse
import json
import logging
import os
import threading
import traceback
from pathlib import Path
from http.server import HTTPServer, BaseHTTPRequestHandler
from io import BytesIO
from fuse import FUSE
from .cuttlefs import CuttleFS
from .fsyncs import SUPPORTED_FSYNC_CLASSES
de... |
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... |
repeatedFunctionThread.py | from threading import Thread
class repeatedFunctionThread:
def __init__(self,function, *args, **kwargs):
self._running = False
self.function = function
self.args = args
self.kwargs = kwargs
self.thread = Thread(target = self.run, args =(self.function, ))
def... |
ChuckySelf (Belum Siap).py | # -*- coding: utf-8 -*-
#Chucky_Bot
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
from threading import Thread
from googletrans import Translator
from gtts import gTTS
import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,ast,os,... |
singleMachine.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... |
MessengerListener.py | import time
import threading
from utils import LogHelper, TextHelper
class MessengerListener(object):
URL_MESSAGES = 'https://www.linkedin.com/messaging/conversationsView?includeSent=false&clearUnseen=true&after='
wait = 5
callbacks = {}
sel = None
stop_order = False
def __init__(self, params=None):
self.s... |
server.py | ################################################################################
#
# 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
# ... |
TOMNEW2 (1).py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile
from bs4 import BeautifulSoup
from urllib import urlopen
fr... |
bridge.py | #
# Copyright © 2014-2020 VMware, Inc. All Rights Reserved.
#
import functools
import gc
import logging
import os
import signal
import sys
import threading
import time
import traceback
from logging.handlers import RotatingFileHandler
from multiprocessing import Process, Value
from time import gmtime, strftime
# noinsp... |
ide.py | # ----------------------------------------------------------------------------
# sdfide
# Copyright (c) 2022- juju2013@github
# All rights reserved.
#
# This file is under BSD 2-Clause License, see LICENSE file
#
# ----------------------------------------------------------------------------
"""Interactive Design Envir... |
generator.py | import time, threading, os
from compiler_util.parser import RootNode
from compiler_util.preprocessor import *
from compiler_util.lexer import *
from compiler_util.parser import *
MIK = ["""
""", """
"""]
FINISHED = False
class Generator:
def __init__(self, Root: RootNode, custom_types) -> None:
... |
pipeline.py |
# Copyright (c) 2016-2021, The Bifrost 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
# notice, this list of conditi... |
sc_dispatcher.py | #!/usr/bin/python
import multiprocessing
import numpy as np
import time
import sc_config
from sc_logger import sc_logger
current_milli_time = lambda: int(time.time() * 1000)
'''
SmartCameraDispatcher
This class helps process images across multicores
It can be used on (n) number of cores: including a single core.
The ... |
server.py | import socket
import threading
import time
import random
HOST="127.0.0.1"
PORT=8080
ADDR=(HOST,PORT)
DISCONNECT_MESSAGE="disconnect"
serversocket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
serversocket.bind(ADDR)
userdata=[] #使用者姓名
passdata=[] #使用者密碼
room=["empty","empty","empty","empty"] #遊戲房間的人
roomstate=... |
simulation_worker.py | __author__ = 'Christian Kongsgaard, Thomas Perkov'
__license__ = 'MIT'
# -------------------------------------------------------------------------------------------------------------------- #
# IMPORTS
# Modules:
import os
import platform
from pathlib import Path
import subprocess
import datetime
import time
import t... |
upythread.py | import unreal_engine as ue
from threading import Thread
#internal, don't call directly
def backgroundAction(args=None):
#ue.log(args)
action = args[0]
actionArgs = None
if len(args) >1:
actionArgs = args[1]
if len(args) >2:
callback = args[2]
#call the blocking action
if actionArgs:
... |
spectral.py | import cluster
import argparse
import multiprocessing as mp
import numpy as np
import time
import pypeline_io as io
def get_arguments():
help_str = """
pypeline help string
"""
prog = 'pypeline'
max_cpu = mp.cpu_count()
# logger.debug("Getting commandline arguments.")
parser = argparse.A... |
codecs_socket.py | import sys
import socketserver
class Echo(socketserver.BaseRequestHandler):
def handle(self):
"""Get some bytes and echo them back to the client.
There is no need to decode them, since they are not used.
"""
data = self.request.recv(1024)
self.request.send(data)
class ... |
test_admission_controller.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
logserial.py | """
Wrapper & timestamper of input serial byte stream
"""
import serial
from threading import Thread
from osgar.logger import LogWriter
from osgar.bus import BusShutdownException
class LogSerial:
def __init__(self, config, bus):
bus.register('raw')
self.input_thread = Thread(target=self.run_in... |
train_sampling_unsupervised.py | import dgl
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.multiprocessing as mp
from torch.utils.data import DataLoader
import dgl.function as fn
import dgl.nn.pytorch as dglnn
import time
import argparse
from _thread import start_new... |
__init__.py | import collections.abc
from collections import namedtuple
import asyncio
import os
import sys
import signal
import operator
import uuid
from functools import reduce
from typing import Any, Dict, Iterator, List, Optional, Callable
from weakref import ref, WeakKeyDictionary
import types
import inspect
from inspect import... |
email.py | from threading import Thread
from flask.ext.mail import Message
from app import app, mail
def send(recipient, subject, body):
'''
Send a mail to a recipient. The body is usually a rendered HTML template.
The sender's credentials has been configured in the config.py file.
'''
sender = app.config['A... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import struct
import operator
import test.support
import test.script_helper
... |
DenseAmpcor.py | #! /usr/bin/env python
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2014 California Institute of Technology. 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.
# Yo... |
mongo_supervisor.py | import signal
import time
from multiprocessing import Process
import logging
from mongodb_connector import MongoDBConnector
class Supervisor:
"""supervisor class
"""
def __init__(self):
"""init"""
self.running = True
signal.signal(signal.SIGINT, self.stop)
signal.signal(s... |
athenad.py | #!/usr/bin/env python3
import base64
import hashlib
import io
import json
import os
import queue
import random
import select
import socket
import subprocess
import sys
import tempfile
import threading
import time
from collections import namedtuple
from datetime import datetime
from functools import partial
from typing ... |
hexagon_ui_api.py | from __future__ import unicode_literals
from flask import Flask, jsonify, request, send_from_directory
import time
import threading
from hexagon_gaming import *
import jsonpickle
import logging
import json
slots = {}
slot = None
t = time.time()
app = Flask(__name__)
application = app
@app.route('/', methods=['GET'])
... |
engine.py | """"""
import importlib
import os
import traceback
from collections import defaultdict
from pathlib import Path
from typing import Any, Callable
from datetime import datetime, timedelta
from threading import Thread
from queue import Queue
from copy import copy
from fcs_trade.event import Event, EventEngine
from fcs_t... |
test_c10d_common.py | import copy
import os
import sys
import tempfile
import threading
import time
from datetime import timedelta
from itertools import product
from sys import platform
import torch
import torch.distributed as c10d
if not c10d.is_available():
print("c10d not available, skipping tests", file=sys.stderr)
sys.exit(0)... |
sql_db.py | import os
import concurrent
import queue
import threading
import asyncio
import sqlite3
from .logging import Logger
from .util import test_read_write_permissions
def sql(func):
"""wrapper for sql methods"""
def wrapper(self, *args, **kwargs):
assert threading.currentThread() != self.sql_thread
... |
ebi_donwload_all_taxonomy.py | import func_ebi_get_attr_and_url
import sys
from threading import Thread
import queue
from threading import Semaphore
import logging
import json
import datetime
import os
writeLock = Semaphore(value = 1)
errorLock = Semaphore(value = 1)
in_queue = queue.Queue()
biome = sys.argv[1]
output_folder = sys.argv[2]
#biome ... |
ViewWinRenderedGrid.py | '''
Created on Oct 5, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
import os, threading, time, logging
from tkinter import Menu, BooleanVar, font as tkFont
from arelle import (ViewWinTkTable, ModelDocument, ModelDtsObject, ModelInstanceObject, XbrlConst,
... |
TraductoresHandler.py | # coding=utf-8
import json
import Configberry
import logging
import importlib
import socket
import threading
import tornado.ioloop
import nmap
import os
import git
from multiprocessing import Process, Queue, Pool
import sys
if sys.platform == 'win32':
import multiprocessing.reduction # make sockets pickable/in... |
manager.py | # -*- coding: utf-8 -*-
"""
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
from threading import Thread
from conpaas.core.expose import expose
from conpaas.core.manager import BaseManager
from conpaas.core.https.server import HttpJsonResponse, HttpErrorResponse, \
Htt... |
client.py | from queue import Queue
from threading import Thread, Lock, Event
from .server import run
from uuid import uuid4
class Client:
off = Event()
requests = Queue()
responses = Queue()
lock = Lock()
server = Thread(target=run, args=(requests, responses, lock, off))
server.start()
clients = {}
def __init__(self,... |
main.py | import json
import logging
import os
import sys
from threading import Thread
from time import sleep
from telegram.ext import Updater, ConversationHandler, PicklePersistence, \
CommandHandler, Filters
from config import config
from src import REGISTERED_BRIDGES
from src.common.const import *
from src.common.tg_uti... |
test_intermediary_to_dot.py | # -*- coding: utf-8 -*-
import sys
import re
from multiprocessing import Process
from pygraphviz import AGraph
from tests.common import parent_id, parent_name, child_id, child_parent_id, relation, child, parent
from eralchemy.main import _intermediary_to_dot
from eralchemy.cst import GRAPH_BEGINNING
GRAPH_LAYOUT = GRA... |
manager.py | #!/usr/bin/env python2.7
import os
import sys
import fcntl
import errno
import signal
import subprocess
from common.basedir import BASEDIR
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
def unblock_stdout():
# get a non-blocking stdout
child_pid, child_pty = os.forkpty()
if ch... |
acq400.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
acq400.py interface to one acq400 appliance instance
- enumerates all site services, available as uut.sX.knob
- simple property interface allows natural "script-like" usage
- eg
- uut1.s0.set_arm = 1
- equivalent to running this on a logged in shell session on the U... |
__main__.py | import socket
import threading
from datetime import datetime
from ..common.config import get_config
_config = get_config()
udp_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
udp_sock.bind(('0.0.0.0', _config['SOUND_UDP_PORT']))
udp_sock.settimeout(1)
tcp_sock = socket.socket(socket.AF_INET, socket.SOCK_STR... |
mod.py | # -*- coding: utf-8 -*-
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... |
psim_case.py | # Nathan Zimmerberg, Tanishq Aggarwal
# 9.14.2019
# Shihao Cao, Kyle Krol
# 04.12.2021
# psim_case.py
# Class to run a simulation and communicate with the flight computers.
import time, timeit
import platform
import threading
import os
import datetime
import os
from ...gpstime import GPSTime
import lin
import json
fr... |
log.py | # Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import io
import logging
import os
import re
import sys
import threading
import time
from typing import List, Optional, Sequence
PERF... |
__init__.py | #!/usr/bin/python
from Queue import Queue
from SocketServer import BaseRequestHandler, ThreadingTCPServer
from threading import Thread
from time import sleep, strftime, strptime
from ircbot import SingleServerIRCBot
from irclib import nm_to_n
class PunaniRequestHandler(BaseRequestHandler):
"""Handler for Punani ... |
scan.py | import logging
import re
from csv import writer
from dataclasses import dataclass
from json import dumps
from os import sep
from queue import Queue
from threading import Thread
from typing import Tuple
from urllib.parse import urlsplit
from requests_html import HTMLSession
@dataclass
class BrokenLinks:
root: str... |
phet.py | # Copyright 2020, University of Colorado Boulder
#
# @author Jonathan Olson <jonathan.olson@colorado.edu>
import sublime, sublime_plugin, os, re, subprocess, webbrowser, json, threading
from functools import reduce
# Useful URLs:
# https://www.sublimetext.com/docs/3/api_reference.html
# http://www.sublimetext.com/do... |
TFCluster.py | # Copyright 2017 Yahoo Inc.
# Licensed under the terms of the Apache 2.0 license.
# Please see LICENSE file in the project root for terms.
"""
This module provides a high-level API to manage the TensorFlowOnSpark cluster.
There are three main phases of operation:
1. **Reservation/Startup** - reserves a port for the T... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
broker.py | """
Manages the network negotiation portion of a client connection.
Node connects here first to get the node and Pool ID, then is redirected to the PUB/SUB ZMQ interface.
"""
import zmq
import sqlalchemy as sa
from sqlalchemy.orm import Session
import server.constants as const
import threading
import pickle
from proto.... |
jupyterhub_config.py | # This file provides common configuration for the different ways that
# the deployment can run. Configuration specific to the different modes
# will be read from separate files at the end of this configuration
# file.
import os
import json
import string
import yaml
import threading
import time
import requests
import ... |
diff_press_logger_a.py | import diff_p_DLHR_F50D as DLHR_F50D
from polling_timer import PollingTimer
from move_ave import MovingAverage
from collections import deque
from wave_save import WavSave
from buzz_pipi_r import PiPi
from print_with_DP_EH600 import PrintWithDpEh600
import datetime
import multiprocessing as mp
SAMPLE_FREQ = 32 # Hz
SAM... |
sampy.py | try:
from typing import ClassVar
from tkinter import Tk, Frame, Label, Button, ttk, Canvas, Scrollbar, Radiobutton, StringVar, IntVar, Listbox, Toplevel
from tkinter.filedialog import askdirectory
from os.path import join, basename, abspath, isfile, isdir, splitext
from os import listdir, stat, syst... |
mate_ksx3267v2.py | #!/usr/bin/env python
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 JiNong, Inc.
# All right reserved.
#
import struct
import time
import socket
import select
import traceback
import hashlib
import json
from enum import IntEnum
from threading import Thread, Lock
from mate import Mate, ThreadMate, DevType
from mbloc... |
clientCapture.py | #!/usr/bin/env python3
"""
clientCapture.py
Last Edited: 8/9/2016
Lead Author[s]: Anthony Fong
Contributor[s]:
Description:
A program that takes frames produced by a camera of choice and processes them in based on a function determined by
imageProcess.py. Also it saves the information locally and can be... |
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 ... |
generate_game_numpy_arrays.py | import multiprocessing
import numpy as np
import pandas as pd
import pickle
import py7zr
import shutil
from settings import *
HALF_COURT_LENGTH = COURT_LENGTH // 2
THRESHOLD = 1.0
def game_name2gameid_worker(game_7zs, queue):
game_names = []
gameids = []
for game_7z in game_7zs:
game_name = game... |
main.py | import os
import sys
from time import sleep
import threading
import window
import comunication
import DisplayActions
debugMode = True
def main():
print("starting...",end='')
state = True
print("[" + ("OK" if state else "ERROR" ) + "]")
winThread.start()
comunication.start()
winThread = thre... |
TAsyncioServerTest.py | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
plugin.py | # Copyright 2021 EMQ Technologies Co., Ltd.
#
# 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... |
utils.py | import glob
import inspect
import os
import stat
import sys
import threading
import time
import zipfile
import tempfile
import h5py
import numpy as np
import requests
from clint.textui import progress
from subprocess import Popen, PIPE
import config as c
import logs
def normalize(a):
amax = a.max()
amin = a... |
lambda_executors.py | import base64
import contextlib
import dataclasses
import glob
import json
import logging
import os
import re
import shlex
import subprocess
import sys
import threading
import time
import traceback
import uuid
from multiprocessing import Process, Queue
from typing import Any, Callable, Dict, List, Optional, Tuple, Unio... |
run.py | import os
import time
import torch
import numpy as np
import multiprocessing as mp
from elegantrl.config import build_env
from elegantrl.evaluator import Evaluator
from elegantrl.replay_buffer import ReplayBuffer, ReplayBufferList
'''[ElegantRL.2022.01.01](github.com/AI4Fiance-Foundation/ElegantRL)'''
... |
common.py | import inspect
import json
import os
import random
import subprocess
import ssl
import time
import requests
import ast
import paramiko
import rancher
import pytest
from urllib.parse import urlparse
from rancher import ApiError
from lib.aws import AmazonWebServices
from copy import deepcopy
from threading import Lock
fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.