source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
lock.py | #! /usr/bin/python -u
# LICENSE UPL 1.0
#
# Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved.
#
# Since: Mar, 2020
# Author: mohammed.qureshi@oracle.com
# Description: Provides file locking support
#
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
import os
import time
import sys
imp... |
oase_accept.py | # Copyright 2019 NEC Corporation
#
# 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... |
node_provider.py | import random
import copy
import threading
from collections import defaultdict
import logging
import boto3
import botocore
from botocore.config import Config
from ray.autoscaler.node_provider import NodeProvider
from ray.autoscaler.aws.config import bootstrap_aws
from ray.autoscaler.tags import TAG_RAY_CLUSTER_NAME, ... |
AstroLauncher.py | import argparse
import asyncio
import atexit
import ctypes
import dataclasses
import json
import os
import secrets
import shutil
import signal
import socket
import subprocess
import sys
import time
import zipfile
from distutils import dir_util
from threading import Thread
import psutil
from packaging import version
fr... |
HiwinRA605_socket_ros_20190604111620.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
parallel_python.py | # Parallel processing can be done in single machines or distributed in a cluster
# There are many packages for both.
# Single machines include multiprocessing & the default package concurrent.futures which work very similarly
# Clusters include parallel python and jug
# More here: https://wiki.python.org/mo... |
JointE+ATT.py | #coding:utf-8
import numpy as np
import tensorflow as tf
import os
import time
import datetime
import ctypes
import threading
import json
ll1 = ctypes.cdll.LoadLibrary
lib_cnn = ll1("./init_cnn.so")
ll2 = ctypes.cdll.LoadLibrary
lib_kg = ll2("./init_know.so")
class Config(object):
def __init__(self):
self.in... |
subprocess.py | # coding: utf-8
"""
Calling shell processes.
"""
import shlex
import threading
import traceback
from subprocess import Popen, PIPE
from .string import is_string
__author__ = "Matteo Giantomass"
__copyright__ = "Copyright 2014, The Materials Virtual Lab"
__version__ = "0.1"
__maintainer__ = "Matteo Giantomassi"
__em... |
test_drivers_local.py | import os
import shutil
import multiprocessing as mp
import time
import hashlib
import pytest
from cloudstorage.drivers.local import LocalDriver
from cloudstorage.exceptions import (
CredentialsError,
IsNotEmptyError,
NotFoundError,
SignatureExpiredError,
)
from tests import settings
from tests.helper... |
mqtt_redis_gateway_py3.py | #
# MQTT To Redis Bridge
#
#
#
import json
import msgpack
import base64
import redis
from redis_support_py3.mqtt_to_redis_py3 import MQTT_TO_REDIS_BRIDGE_STORE
import paho.mqtt.client as mqtt
import ssl
class MQTT_Redis_Bridge(object):
def __init__(self,redis_site_data):
self.redis_site_data = redis_si... |
client_threading_demo.py | # -*- coding: utf-8 -*-
import threading
import logging
import time
from tutorial import TutorialService
from bfd.harpc import client
from bfd.harpc.common import config
threads = 15
req_num = 10
data = []
error = 0
for i in range(0,10240):
data.append(chr(i%64 + 32))
test_msg= ''.join(data)
logging.basicConfig... |
app.py | from flask import render_template, Flask, request, jsonify
from flask_socketio import SocketIO
from queue import Queue
from termcolor import colored
import json
import subprocess
import sys
import threading
import time
import logging
import os
import signal
import speech_recognition as sr
processes = {}
app = Flas... |
MCMC.py | #!/usr/bin/env python
# =============================
# Import the necessary binaries
# =============================
import subprocess
import time
import os, sys
import json, requests
from multiprocessing import Pool, Process
import numpy as np
import signal
from scenario_var import scenario_var
import logging a... |
test_pubsub.py | # -*- coding: utf-8 -*-
# python std lib
from __future__ import unicode_literals
import threading
import time
# rediscluster imports
from rediscluster.client import RedisCluster
# 3rd party imports
import pytest
# import redis
from redis import Redis
from redis.exceptions import ConnectionError
from redis._compat i... |
atest_web_ui.py | """
Testing Web UI using selenium
"""
import re
import unittest
import threading
from helper import CONSTANTS
from datetime import datetime, timedelta
from selenium import webdriver
from botapp import create_app
from botapp.models import MyBot, Message
from botapp.api_helpers import procedures
class WebUITestCase(uni... |
hybrid.py | import pandas as pd
import numpy as np
from ast import literal_eval
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.metrics.pairwise import linear_kernel, cosine_similarity
from nltk.stem.snowball import SnowballStemmer
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.... |
scanport2.py | #-*- coding:utf-8 -*-
#2105-03-25
Port = [80,21,23,22,25,110,443,1080,3306,3389,1521,1433]
Server = ['HTTP','FTP','TELNET','SSH','SMTP','POP3','HTTPS','SOCKS','MYSQL','Misrosoft RDP','Oracle','Sql Server']
result = []
import socket
import sys
import threading
import time
def get_remote_machine_info(Domain):
try... |
strategies.py | import logging
import threading
import time
from typing import List
from brownie import Contract, chain
from eth_utils import encode_hex, event_abi_to_log_topic
from yearn.utils import safe_views
from yearn.multicall2 import fetch_multicall
from yearn.events import create_filter, decode_logs
STRATEGY_VIEWS_SCALED =... |
lambda_executors.py | import os
import re
import glob
import json
import time
import logging
import threading
import subprocess
import six
from multiprocessing import Process, Queue
try:
from shlex import quote as cmd_quote
except ImportError:
from pipes import quote as cmd_quote # for Python 2.7
from localstack import config
from ... |
testing.py | """
Testing utilities.
"""
import os
import re
import struct
import threading
import functools
from tempfile import NamedTemporaryFile
import numpy as np
from numpy import testing
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_array_less, assert_array_almos... |
baybot.py | # -*- coding: utf-8 -*-
#Cbay_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,su... |
test_threading.py | import epics
import threading
import pvnames
def test_basic_thread():
result = []
def thread():
epics.ca.use_initial_context()
pv = epics.get_pv(pvnames.double_pv)
result.append(pv.get())
epics.ca.use_initial_context()
t = threading.Thread(target=thread)
t.start()
t.jo... |
shell.py | # !/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
Bein.py | #!/usr/bin/env python3
print("Inicializando...", end=' \r')
import time
# from ev3dev.ev3 import *
print("ev3dev.ev3", end=' \r')
from ev3dev2.motor import OUTPUT_A, OUTPUT_B,OUTPUT_C, MoveTank,MoveSteering, SpeedPercent, LargeMotor
print("motores importados", end=' ... |
2_thread_wayA.py | # 创建 Thread 的实例,传给它一个函数
import threading
from time import sleep, ctime
loops = [4, 2]
def loop(nloop, nsec):
print('Start LOOP', nloop, 'at:', ctime())
sleep(nsec)
print('LOOP', nloop, 'DONE at:', ctime())
def main():
print('程序开始,当前时间', ctime())
threads = []
nloops = range(len(loops))
... |
python_set_emit_consume_large_string_columns.py | #!/usr/bin/env python2.7
# encoding: utf8
import os
import sys
import time
import tempfile
import subprocess
import threading
sys.path.append(os.path.realpath(__file__ + '/../../../lib'))
sys.path.append(os.path.realpath(__file__ + '/..'))
import udf
from abstract_performance_test import AbstractPerformanceTest
cla... |
webserver.py | #!/usr/bin/env python
# A simple webserver for Naoko that serves up some interesting statistics.
# In integrated mode this is started with Naoko and uses her instance of NaokoDB, though not the thread.
from lib.external.bottle import route, run, default_app, SimpleTemplate, static_file
import logging
from settings impo... |
binpickingcontrollerclient.py | # -*- coding: utf-8 -*-
# Copyright (C) 2013-2015 MUJIN Inc.
# Mujin controller client for bin picking task
# mujin imports
from . import realtimerobotclient
# logging
import logging
log = logging.getLogger(__name__)
class BinpickingControllerClient(realtimerobotclient.RealtimeRobotControllerClient):
"""mujin c... |
multiplexer.py | from .asyncsocket import *
import socket
import struct
from threading import Lock, Thread
import time
import logging
logger = logging.getLogger("qlibs.net.multiplexer")
base_struct = struct.Struct("!iiid")
class PlayerJoinedEvent:
name = "playerjoined"
def __init__(self, player_id):
self.player_id = p... |
session_test.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
bot.py | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2017-2019 TwitchIO
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... |
test_pipe_communication.py | import multiprocessing
import sys
from pymulproc import mpq_protocol, factory
def test_local_pipe_communication():
'''Test that communication.multiprocessing.pipe.peers library works well as follows:
1) Child can send a message
2) Parent can receive such message
3) Parent can send a message
4) C... |
cli.py | # encoding: utf-8
from __future__ import print_function
import collections
import csv
import multiprocessing as mp
import os
import datetime
import sys
from pprint import pprint
import re
import itertools
import json
import logging
from optparse import OptionConflictError
import traceback
from six import text_type
f... |
basic_routing.py | import pika
from queue import Empty, Queue
import multiprocessing as mp
import ctypes
import time
import math
import logging
import os
import signal
from datetime import datetime
log = logging.getLogger(__name__)
log.addHandler(logging.StreamHandler())
log.setLevel(logging.DEBUG)
WAIT_READY_TIMEOUT = None
def _fmt_... |
httpsserver.py | import ssl
from http.server import HTTPServer, BaseHTTPRequestHandler
from io import BytesIO
from hashlib import sha256
import threading
import time
import datetime
from modules.config import Config
from modules.api import FenrisApi
# Constants
CONFIG=Config()
API_URL=CONFIG.params.getProperty("httpsse... |
queueloader.py | import sys,time,os,signal
import numpy
import threading
import random
import larcv
from . batch_pydata import batch_pydata
from . larcv_io_enums import RandomAccess
from . larcv_writer import larcv_writer
class queue_interface(object):
def __init__(self, verbose=False, random_access_mode="random_blocks", se... |
gerar_silhuetas_resnet50.py | # Cópia de inference_pretrained.py modificada para o dataset TUM GAID
import torch
import segmentation_models_pytorch as smp
import numpy as np
from torchvision import transforms
from PIL import Image
import os
from multiprocessing import Process
import time
def listar_imagens(basedir):
# Obtém lista de imagens ... |
update_repository_manager.py | """
Determine if installed tool shed repositories have updates available in their respective tool sheds.
"""
import logging
import threading
from sqlalchemy import false
import tool_shed.util.shed_util_common as suc
from tool_shed.util import common_util
from tool_shed.util import encoding_util
from tool_shed.util im... |
firmware_update.py | # -*- coding: utf-8 -*-
#
# Copyright 2017-2020 AVSystem <avsystem@avsystem.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
Binance Detect Moonings.py | """
Omaha Group Fork
Version: Wendy 1.0
Disclaimer
All investment strategies and investments involve risk of loss.
Nothing contained in this program, scripts, code or repository should be
construed as investment advice.Any reference to an investment's past or
potential performance is not, and should not be construed ... |
main.py | # -*- coding: utf-8 -*-
import threading
import time
import os
import random
from tools.box.downloadBook.spyder import aszwDownloader, aszwParser, aszwWriter
from tools.box.downloadBook.db import dbController
# 小说目录
home = "http://www.23zw.me/olread/68/68913/"
SLEEP_TIME = 0.5
SLEEP_TIME2 = 0.1
class SpiderMain(obj... |
fake.py | # This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.
"""
gpsfake.py -- classes for creating a controlled test environment around gpsd.
The gpsfake(1) regression tester shipped with gpsd is a trivial wrapper
around this code. For a more int... |
main.py | import sublime, sublime_plugin
import re, urllib, shutil, traceback, threading, time, os, hashlib, json, multiprocessing, shlex
class Util(object) :
multiprocessing_list = []
@staticmethod
def download_and_save(url, where_to_save) :
if where_to_save :
try :
request = urllib.request.Request(ur... |
time_utils.py | # coding:utf-8
'''
@author = super_fazai
@File : time_utils.py
@Time : 2018/7/13 18:02
@connect : superonesfazai@gmail.com
'''
import time
__all__ = [
'get_shanghai_time', # 时区处理,得到上海时间
'timestamp_to_regulartime', # 时间戳转规范的时间字符串
'string_to_datetime', ... |
server.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import signal
import sys
import os
import time
from rpi_ws281x import *
from websocket_server import WebsocketServer
import logging
import threading
# Configuration
LED_COUNT = 16 # Number of LED pixels.
LED_PIN = 18 # GPIO pin connected to the pixel... |
term.py | # -*- coding: utf-8 -*-
import os
import subprocess
import sys
import threading
import time
import uuid
import click
import six
from dagster import seven
CURSOR_UP_ONE = '\x1b[1A'
ERASE_LINE = '\x1b[2K'
class Spinner(object):
'''Spinning CLI prompt, shown while long-running activity is in flight.
From: ht... |
workers.py | # curio/workers.py
#
# Functions for performing work outside of curio. This includes
# running functions in threads, processes, and executors from the
# concurrent.futures module.
__all__ = ['run_in_executor', 'run_in_thread', 'run_in_process', 'block_in_thread']
# -- Standard Library
import sys
import multiprocess... |
run_server3.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
converters.py | import pdb
import pandas as pd
import numpy as np
import h5py
import os, json
from glob import glob
import warnings
import multiprocessing as mp
from itertools import repeat
from tqdm import tqdm
from threading import Thread
from copy import deepcopy
from functools import lru_cache, partial
from time import sleep
from... |
neon_skill_tests.py | # NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework
# All trademark and other rights reserved by their respective owners
# Copyright 2008-2022 Neongecko.com Inc.
# Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds,
# Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kiril... |
internal_api.py | import cx_Oracle
import threading
# Debug
from pprint import pprint as pp
class INTERNAL_API(object):
__limit = 1000
def __init__(self, connString:str):
self._dest = connString
def __connect(self):
connection = cx_Oracle.connect(self._dest, encoding='UTF-8')
cursor = connection... |
syncobj.py | import time
import random
import os
import sys
import threading
import weakref
import collections
import functools
import struct
import logging
import copy
import types
try:
import Queue
is_py3 = False
def iteritems(v):
return v.iteritems()
except ImportError: # python3
import queue as Queue
... |
client.py | import threading
from socket import *
from typing import Callable, Any
class m_client_socket:
host: str
port: int
socket_obj: socket
receiving_data_on: Callable[[bytes], Any]
disconnection_on: Callable[[], Any]
def __init__(self, host: str, port: int,
receiving_data_on: Call... |
CommandLine.py | from Smartiome.Core.APIManager import *
from prettytable import PrettyTable
import threading
import time
@APIManager.plugin_register("CommandLine")
class CommandLine:
def __init__(self, __queue, eventManager=None):
self.eventManager = eventManager # Allows Plugins send event
self.__queue = __queu... |
phytozome_ortholog_mappingServer.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... |
worker.py | '''
brozzler/worker.py - BrozzlerWorker brozzles pages from the frontier, meaning
it runs youtube-dl on them, browses them and runs behaviors if appropriate,
scopes and adds outlinks to the frontier
Copyright (C) 2014-2018 Internet Archive
Licensed under the Apache License, Version 2.0 (the "License");
you may not us... |
test_failure.py | import json
import logging
import os
import sys
import tempfile
import threading
import time
import uuid
import numpy as np
import pytest
import redis
import ray
import ray.ray_constants as ray_constants
from ray.cluster_utils import Cluster
from ray.test_utils import (
relevant_errors,
wait_for_condition,
... |
stlview.py | #!/usr/bin/env python3
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pri... |
serve.py | import abc
import argparse
import importlib
import json
import logging
import multiprocessing
import os
import platform
import subprocess
import sys
import threading
import time
import traceback
import urllib
import uuid
from collections import defaultdict, OrderedDict
from itertools import chain, product
from typing i... |
runtests.py | #!/usr/bin/env python
from __future__ import print_function
import atexit
import os
import sys
import re
import gc
import heapq
import locale
import shutil
import time
import unittest
import doctest
import operator
import subprocess
import tempfile
import traceback
import warnings
import zlib
import glob
from context... |
wgmine.py | import time
import argparse
import base64
from multiprocessing import Process
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey
# benchmark cryptography: 110000K/s
# benchmark donna: 48000K/s
def mine(name):
name = name.encode(... |
ui_utils.py | # -*- coding: utf-8 -*-
import collections
import logging
import os
import platform
import queue
import re
import signal
import subprocess
import sys
import textwrap
import threading
import time
import tkinter as tk
import tkinter.font
import traceback
import warnings
from tkinter import filedialog, messagebox, ttk
fro... |
crontab_autocheck.py | import requests, datetime, math, threading
quarter = str(datetime.datetime.now().year)+"Q"+str(math.ceil(datetime.datetime.now().month/3.))
url = "http://dataquality.utrustfintech.com/check/rule_execute"
def post_rule_execute(company, quarter):
data = {'company': company, 'username': 'crontab', 'quarter': quarter... |
dctp.py | import socket
import time
from threading import Thread, RLock
import json as _json
from utils import print_warning, print_info
def send_status_code(status, status_text):
return {'status': status, 'status_text': status_text}
class Request():
def __init__(self, json, data=b''):
if 'id_worker' in json:
... |
__init__.py | import argparse
import gettext
import os
import sys
import threading
import time
from collections import defaultdict
from http.server import HTTPServer, SimpleHTTPRequestHandler
from tempfile import TemporaryDirectory
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from .gene... |
display.py | from RPLCD.i2c import BaseCharLCD
import threading
import time
import uuid
class Panel:
def __init__(self, display, changed_listener):
self.display = display
self.changed_listener = changed_listener
self.__text = ""
self.__ttl = -1
self.ttl_watchdog_id = None
@propert... |
sync_server.py | #!/usr/bin/env python
"""
Pymodbus Synchronous Server Example
--------------------------------------------------------------------------
The synchronous server is implemented in pure python without any third
party libraries (unless you need to use the serial protocols which require
pyserial). This is helpful in constr... |
fg.py | from threading import Thread
exit_flag = False
def f():
global exit_flag
i = 1
while not exit_flag:
i = (i + 1) % 100000000
if i % 100000 == 0: print("f making progress: {0}".format(i))
def g():
global exit_flag
j = 1
while not exit_flag:
j = (j - 1) % 100... |
template.py | from __future__ import print_function
import base64
import random
from builtins import object, str
# Empire imports
from typing import List
from empire.server.common import agents, encryption, helpers, messages, packets
from empire.server.utils import data_util
class Listener(object):
def __init__(self, mainMe... |
optimization.py | import hashlib
import json
from copy import copy
from datetime import datetime
from itertools import product
from logging import getLogger
from threading import Thread, Event
from time import time
from typing import List, Set, Union, Any, Sequence, Optional, Mapping, Callable
from .job import TrainsJob
from .parameter... |
Navigator_pf.py | #encoding=utf-8
'''
project overview:
Subscribe:
1.slam pose(global/local pose) *
2.octomap_server/global map
3.local pointcloud/local octomap
4.target input(semantic target/visual pose target/gps target)
Publish:
1.Mavros(amo) Command
2.Navigator status
Algorithms:
1.D*
2.state transfer
... |
test_threading_local.py | import sys
import unittest
from doctest import DocTestSuite
from test import support
import weakref
import gc
# Modules under test
import _thread
import threading
import _threading_local
class Weak(object):
pass
def target(local, weaklist):
weak = Weak()
local.weak = weak
weaklist.append(weakref.ref... |
a_HARP_LiveDemo_ICIP2014.py | #!/usr/bin/env python
# coding: utf8
# (c) 2014 Dominic Springer, Wolfgang Schnurrer
# File licensed under GNU GPL (see HARP_License.txt)
import sys, os
__builtins__.ProjectDir = os.path.abspath("../")
assert( "HARP" in os.path.basename(ProjectDir) )
__builtins__.LibDir = ProjectDir + "/PythonLib"
__builtins__.TmpDir... |
tcp-streaming-multicast-client-audio.video.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cv2
import socket
import base64
import pyaudio
import numpy as np
from threading import Thread
"""
File name: tcp-streaming-multicast-client-audio.video.py
Author: Jäger Cox // jagercox@gmail.com
Date created: 08/08/2016
License: MIT
Python Versi... |
guestsnapshotter.py | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2014 Microsoft Corporation
#
# 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
#
# U... |
terminal_process.py | from .typecheck import *
from .import core
from .terminal import Terminal
import threading
import re
try:
if core.platform.windows:
from winpty import PtyProcess #type: ignore
else:
from ..libs.ptyprocess import PtyProcess as _PtyProcess #type: ignore
class PtyProcess(_PtyProcess): #type: ignore
def re... |
train_pg_f18.py | from __future__ import print_function, division
from multiprocessing import Process
import inspect
import logz
import time
import os
import tensorflow as tf
import numpy as np
import pybulletgym.envs
import pybullet
import gym
"""
# Notes on notation ==================================================================... |
bittorrent.py | #!/usr/bin/env python
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/li... |
pdv.py | # Copyright (c) 2011-2019, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory
# Written by Mason Kwiat, Douglas S. Miller, and Kevin Griffin
# e-mail: griffin28@llnl.gov
# LLNL-CODE-507071
# All rights reserved.
# This file is part of PDV. For details, see <URL describ... |
web_crawler.py | import os
import time #used to delay processing
from functools import wraps #used to create timing wrapper
import json
import threading #required for multi-threading
import shelve
import sys
import io
import fileinput
import string
import urllib #required to open html documents
#import urllib2 #required in ... |
env_stock_papertrading_erl.py | import datetime
import threading
from neo_finrl.data_processors.processor_alpaca import AlpacaProcessor
import alpaca_trade_api as tradeapi
import time
import pandas as pd
import numpy as np
import torch
import sys
import os
class AlpacaPaperTrading():
def __init__(self,ticker_list, time_interval, agent, cwd, net... |
testplotlyview.py | import vdomr as vd
import time
import multiprocessing
import sys
from .stdoutsender import StdoutSender
import mtlogging
import numpy as np
class TestPlotlyView(vd.Component):
def __init__(self, context):
vd.Component.__init__(self)
self._context = context
self._size = (100, 100)
s... |
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... |
recorder.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... |
Misc.py | ## @file
# Common routines used by all tools
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the lic... |
EDJournalLib.py | from EDJConst import *
from EDJFile import *
import time
import threading
#ユーザーが設定できるデータ
uInterval = 10
uFuction = None
#中で使用するデータ
mThread = None
mThreadFlag = True
mBSize = None
mBPath = ""
mBRow = None
#非同期用のインターバル設定
def setInterval(pMs):
global uInterval
uInterval = pMs
#非同期用のファン... |
ebsk.py | #!/bin/env python3
import time
import math
import sys
import getopt
from threading import Thread
DEBUG=False
class Sensor:
def __init__(self):
self.value = -1
self.file = None
self.filename = ''
def _open(self, name, mode, file = None):
if not file or file.closed:
... |
recognizer_observer.py | import rospy
import threading
from .observer import Observer
class RecognizerObserver(Observer):
def __init__(self, recognizers, recognizer, check_frequency=20.0, **kwargs):
super(RecognizerObserver, self).__init__(**kwargs)
self._recognizer = recognizers[recognizer]
self._check_rate = ros... |
jdb.py | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2018 Musker.Chao
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, m... |
runners.py | # Lint as: python3
# 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 ... |
run.py | '''
@Descripttion: 捉取整个网络的所有页面链接下来!
@Author: BerryBC
@Version: 0.3.0
@Date: 2020-02-02 11:15:41
@LastEditors: BerryBC
@LastEditTime: 2020-05-21 21:27:40
'''
from Lib.LMongoDB import claMongoDB
from Lib.LAddPage import claAddPage
from Lib.LLearn import claLearn
from configobj import ConfigObj
from bs4 import BeautifulS... |
caching_test.py | # Copyright 2018-2021 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
__init__.py | # -*- coding: utf-8 -*-
'''
Set up the Salt integration test suite
'''
# Import Python libs
from __future__ import absolute_import, print_function
import os
import re
import sys
import copy
import json
import time
import stat
import errno
import signal
import shutil
import pprint
import atexit
import socket
import lo... |
aws_utils.py | # Copyright (c) 2018 NVIDIA Corporation
import boto3
import botocore
import time
import threading
import json
import hashlib
from milano.backends.utils import SSHClient
class EC2Instance:
def __init__(self, resource, username, private_key_path):
self._resource = resource
self._private_key_path = private_key... |
opentherm.py | import re
from threading import Lock, Thread
import logging
logging.basicConfig(filename='py_otgw_mqtt.log',level=logging.DEBUG)
# unhash the above line to log to a file
log = logging.getLogger(__name__)
# Default namespace for the topics. Will be overwritten with the value in
# config
topic_namespace="otgw/value"
... |
main.py | from login import main as login
from boardparselist import main as boardparse
from commentparselist import main as commentparse
from boarddelete import main as boarddelete
from commentdelete import main as commentdelete
from app_id import main as app_id
from time import sleep
from PyQt5 import QtCore, QtGui, QtW... |
crawl_data.py | """
we use the ccxt to crawl data then save it to csv file.
you need to install ccxt by running firstly:
"""
import pandas as pd
import time
from datetime import datetime
import requests
import pytz
from howtrader.trader.database import database_manager
pd.set_option('expand_frame_repr', False) #
from howtrader.tra... |
Test_prog.py | from __future__ import print_function
from vicon_dssdk import ViconDataStream
import argparse
import time
import logging
import time
from threading import Thread
import cflib
from cflib.crazyflie import Crazyflie
from cflib.utils import uri_helper
import matlab.engine
import keyboard
import math
... |
test_singletonperthread.py | import uuid
from multiprocessing import Queue
from threading import Thread, currentThread
from azurelinuxagent.common.singletonperthread import SingletonPerThread
from tests.tools import AgentTestCase, clear_singleton_instances
class TestClassToTestSingletonPerThread(SingletonPerThread): # pylint: disable=too-few-pu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.