source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
utils.py | import torch
from PIL import Image
from threading import Thread
import sys
import cv2
from queue import Queue
def load_image(filename, size=None, scale=None):
img = Image.open(filename)
if size is not None:
img = img.resize((size, size), Image.ANTIALIAS)
elif scale is not None:
img = img.r... |
nodeserver_api.py | """
This library consists of four classes and one function to assist with node
server development. The classes :class:`polyglot.nodeserver_api.NodeServer` and
:class:`polyglot.nodeserver_api.SimpleNodeServer` and basic structures for
creating a node server. The class :class:`polyglot.nodeserver_api.Node` is
used as an ... |
LSTM_Prediction_Server.py | import argparse
import sys
sys.path.append("../queue")
import pika
from Sub_Queue import Sub_Queue
from Pub_Queue import Pub_Queue
from ML_Loader import ML_Loader
import time
import json
import threading
import numpy as np
class LSTM_Prediction_Server(object):
def __init__(self, model_info, broker_info, queue_info... |
tictactoe_playground_left.py | import numpy as np
import logging
import time
import os
from threading import Thread, Event
from reachy_sdk import ReachySDK
#TC from reachy_sdk.arm import RightArm
#TC from reachy_sdk.head import Head
#TC from reachy_sdk.trajectory import TrajectoryPlayer
from reachy_sdk.trajectory import goto
from reachy_sdk.traje... |
chatserver.py | from Tkinter import *
from ScrolledText import *
import socket, select, sys, time, json, threading
import base64
from Crypto import Random
from Crypto.Cipher import AES
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]
class Server:
def __init__(self, app):... |
common.py | # Copyright (C) Mesosphere, Inc. See LICENSE file for details.
"""
Common code for AR instance management.
"""
import abc
import copy
import logging
import os
import pytest
import select
import signal
import socket
import subprocess
import threading
import time
from exceptions import LogSourceEmpty
from util import ... |
log.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Utility classes for logging the output of blocks of code.
"""
from __future__ import unicode_literals
import multiproc... |
simple_api_server.py | # Copyright 2020 Open Source Robotics Foundation, 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... |
common.py | import itertools
from uuid import uuid4
from collections import defaultdict, Counter
from multiprocessing import Process, Queue, Event, RLock
from threading import Thread
from itertools import product
try:
from Queue import Empty as QueueEmptyException
except ImportError:
from queue import Empty as QueueEmptyE... |
dataset.py | import queue
import time
from multiprocessing import Queue, Process
import cv2
import numpy as np
from joblib import Parallel, delayed
from stable_baselines import logger
class ExpertDataset(object):
"""
Dataset for using behavior cloning or GAIL.
Data structure of the expert dataset, an ".npz" archive... |
scheduler_job.py | # -*- coding: utf-8 -*-
#
# 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
#... |
test_signal.py | zaimportuj unittest
z test zaimportuj support
z contextlib zaimportuj closing
zaimportuj enum
zaimportuj gc
zaimportuj pickle
zaimportuj select
zaimportuj signal
zaimportuj socket
zaimportuj struct
zaimportuj subprocess
zaimportuj traceback
zaimportuj sys, os, time, errno
z test.support.script_helper zaimportuj assert_... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import tempfile
import urllib.request
import traceback
import asyncore
import weakref
import platform
import functools
from u... |
patcher_socketserver_selectors.py | __test__ = False
if __name__ == '__main__':
import eventlet
eventlet.monkey_patch()
from six.moves.BaseHTTPServer import (
HTTPServer,
BaseHTTPRequestHandler,
)
import threading
server = HTTPServer(('localhost', 0), BaseHTTPRequestHandler)
thread = threading.Thread(target=... |
async_thread.py | """Tools for working with async tasks
"""
import asyncio
import logging
import threading
from . import EOS_MARKER
log = logging.getLogger(__name__)
class AsyncThread(object):
@staticmethod
def _worker(loop):
asyncio.set_event_loop(loop)
loop.run_forever()
loop.close()
def __ini... |
main.py | # -*- coding:utf-8 -*-
# by:kracer
# 引入模块、包部分
from gevent import monkey
monkey.patch_all()
import time
from request import * #获取返回内容
from threading import Thread
from common import *
from process import *
from Third.JSFinder import *
from Third.wafw00f import entrance
from threading import Thread
from ... |
runner.py | # Copyright 2018 Datawire. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
multi_processing.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : multi_processing.py
@Modify Time @Author @Version @Desciption
------------ ------- -------- -----------
2021/9/15 1:15 lintean 1.0 None
'''
from multiprocessing import Process
from model import main
import utils ... |
QuantumRaspberryTie.qiskit.py | #----------------------------------------------------------------------
# QuantumRaspberryTie.qiskit
# by KPRoche (Kevin P. Roche) (c) 2017,2018,2019,2020,2021
#
# Connect to the IBM Quantum Experience site via the QISKIT IBMQ functions
# run OPENQASM code on the simulator there
# Display ... |
futures.py | """Tools for dealing with asynchronous execution
Credit: Logan Ward
"""
from globus_sdk import GlobusAPIError
from concurrent.futures import Future
from threading import Thread
from time import sleep
import json
class FuncXFuture(Future):
"""Utility class for simplifying asynchronous execution in funcX"""
d... |
painterbot.py | import os
import re
import cv2
import json
import urllib2
import requests
import numpy as np
from threading import Thread
from neuralstyle import generate
from slackclient import SlackClient
from flask import Flask, request, jsonify
app = Flask(__name__)
slack_client = SlackClient(os.environ.get('SLACK_APP_TOKEN'))
u... |
ProvenanceCheckServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
bsadkhintest123ContigFilterServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
audio.py | # Copyright 2004-2021 Tom Rothamel <pytom@bishoujo.us>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, m... |
MosaicBuilder.py | from multiprocessing import Process, Queue, cpu_count
from settings import EOQ_VALUE, WORKER_COUNT, OUT_FILE, TILE_SIZE, TILE_BLOCK_SIZE
from TileFitter import TileFitter
from MosaicImage import MosaicImage
from ProgressCounter import ProgressCounter
class MosaicBuilder:
#def __init__(self):
def fit_tiles(self, w... |
gdax.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
# Init Logging Facilities
log = logging.getLogger(__name__)
class GDAXWSS(WSSAPI)... |
REDItoolDenovo.py | # coding=utf-8
# Copyright (c) 2013-2014 Ernesto Picardi <ernesto.picardi@uniba.it>
#
# 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 rig... |
Robot.py | import numpy as np
import math
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import PySimpleGUI as sg
import threading
import sys
import queue
import time
class Robot():
def __init__(self,joint_num,Link_list):
self.joint_num = joint_num
self.Link_list = Link_list
... |
bacnet.py | '''
Copyright (c) 2015, Battelle Memorial Institute
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions ... |
__init__.py | #!/usr/bin/env python3
"""Library for performing speech recognition with the Google Speech Recognition API."""
__author__ = "Anthony Zhang (Uberi)"
__version__ = "1.4.0"
__license__ = "BSD"
import audioop
import collections
import io
import json
import math
import os
import subprocess
import wave
from urllib.reques... |
tunneling.py | """
This file provides remote port forwarding functionality using paramiko package,
Inspired by: https://github.com/paramiko/paramiko/blob/master/demos/rforward.py
"""
import select
import socket
import sys
import threading
from io import StringIO
import warnings
import paramiko
DEBUG_MODE = False
def handler(chan,... |
views.py | import functools
import itertools
from datetime import timedelta
from multiprocessing import Process
from time import sleep
import requests
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.sites.models import Site
from django.core.exceptions import PermissionDenied
from django.db.m... |
test_ssh_stress.py | import socket
import threading
import paramiko
import time
import pytest
import logging
from tests.common.helpers.assertions import pytest_assert
pytestmark = [
pytest.mark.disable_loganalyzer,
pytest.mark.topology("any"),
pytest.mark.device_type("vs"),
]
START_BGP_NBRS = "sudo config bgp startup all"
STO... |
features.py | #!/usr/bin/env python
import contextlib
import constants as cst
from random import randint, choice, shuffle
from std_msgs.msg import String
from motivational_component.srv import *
import io
import threading
import datetime
import calendar
import json
import datetime
import rospy
import time
from abc import ABCMeta... |
subgraph_test.py | from __future__ import print_function
import time
from absl import app
from absl import flags
from multiprocessing import Process
import numpy as np
try:
from std_msgs.msg import Int64
except ModuleNotFoundError:
# ROS not installed
Int64 = int
from erdos.data_stream import DataStream
import erdos.graph
... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
msg = Me... |
__init__.py | from .feature import *
from .config import Config
from .data_format import *
from .toolbox import *
from .inference import *
from .model import *
from .main import *
import os
from multiprocessing import Process, Queue
class TrieNode:
"""建立词典的Trie树节点"""
def __init__(self, isword):
self.isword = iswor... |
apps.py | from django.apps import AppConfig
import threading
import time, datetime
import schedule
from stock.strategy import *
class CoreConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'mysite.core'
def ready(self):
# from jobs.updater import startSchedule
def start... |
controller.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import generators
from __future__ import division
import threading
import sys
import logging
from functools import partial
from . import view
from . import serve... |
parallel.py | """Utils for Semantic Segmentation"""
# pylint: disable=consider-using-enumerate,redefined-builtin,broad-except
import threading
from mxnet import autograd
from mxnet.ndarray import NDArray
from mxnet.gluon.utils import split_and_load
__all__ = ['DataParallelModel', 'DataParallelCriterion', 'parallel_backward']
clas... |
generic_game_server.py | """
This file contains the game server class.
"""
import pyraknet.server
import pyraknet.messages
import threading
from core.plugin_manager import PluginManager
import importlib
from mysql.connector import connection
import configparser
import socket
import sys
import json
class GameServer(pyraknet.server.Server):
... |
monk_xor_tree.py | """
Codemonk link: https://www.hackerearth.com/problem/algorithm/monk-and-xor-tree-a190a1ed/
Given a Tree T consisting of N nodes rooted at node 1, each node has a value, where the value of the ith node is A[i].
In addition to the tree, you have also been given an integer K. Now, you need to find in this tree, the num... |
router.py | # Custom scripts
from turtle import back
import utils
import models
# Built-ins
import multiprocessing
from typing import List
# Third-party
from fastapi import APIRouter, status, HTTPException, Request
start_time = utils.get_dt()
background_process = None
process_history = []
# Instantiating an APIRouter
router = ... |
datasets.py | # Dataset utils and dataloaders
import glob
import logging
import math
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, Exif... |
test_lockutils.py | # Copyright 2011 Justin Santa Barbara
#
# 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 l... |
pandoc_parser.py | #!/usr/bin/env python3
import time
import re
import threading, queue
import pypandoc
import html as html_
import mwparserfromhell as mwp
import db
from get_parsed_html import get_html
from html2wiki import LibRu
from parser_html_to_wiki import *
def tags_a_refs(soup):
re_ref_id = re.compile(r'^#?((.*?)\.([aq])(\... |
basic_consumer_threaded.py | import functools
import logging
import pika
import threading
import time
LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) '
'-35s %(lineno) -5d: %(message)s')
LOGGER = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
def ack_message(channel, d... |
task.py | """ Backend task management support """
import itertools
import json
import logging
import os
import re
import sys
from copy import copy
from datetime import datetime
from enum import Enum
from multiprocessing import RLock
from operator import itemgetter
from tempfile import gettempdir
from threading import Thread
from... |
loader.py | from typing import *
from types import TracebackType
from itertools import cycle
from shutil import get_terminal_size
from threading import Thread
from time import sleep
"""
Module for displaying a loading animation in a separate thread.
"""
__author__ = "https://stackoverflow.com/users/3867406/ted"
class Loader:
... |
manager.py | import json
import logging
from threading import Thread
import websocket
class WebsocketManager:
def __init__(self, handler, uri):
self._log = logging.getLogger(__name__)
self._log.setLevel(logging.DEBUG)
self.uri = uri
self.connected = False
def on_message(ws, message):
... |
AmpelPlot.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File : Ampel-plot/ampel-plot-app/AmpelPlot.py
# License : BSD-3-Clause
# Author : vb <vbrinnel@physik.hu-berlin.de>
# Date : 16.11.2021
# Last Modified Date: 19.11.2021
# Last Modified By : vb <vbrinnel@physik.hu-berlin.de>
... |
barrier_server_impl.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from concurrent import futures
import grpc
from . import barrier_server_pb2 as barrier_server_pb2
from . import barrier_server_pb2_grpc as barrier_server_pb2_grpc
from .barrier_client_impl import BarrierClient
import time
import sys, os
import logging
clas... |
load.py | import asyncio
import threading
import time
from chaoslib.types import Configuration, Secrets
from logzero import logger
import opentracing
import requests as requests
__all__ = ['single']
def single(url: str, duration: int, frequency: float = 1.0,
configuration: Configuration = None, secrets: Secrets = ... |
runtests.py | #!/usr/bin/env python
from __future__ import print_function
import atexit
import base64
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 glo... |
checker.py | # Copyright 2019 Google
#
# 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, soft... |
helper.py | import asyncio
import functools
import json
import math
import os
import random
import re
import sys
import threading
import time
import uuid
import warnings
from argparse import ArgumentParser, Namespace
from datetime import datetime
from itertools import islice
from types import SimpleNamespace
from typing import (
... |
master_sync.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko
# 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 mus... |
tasks.py | from invoke import task
import webbrowser
import threading
def open_docs():
webbrowser.open("http://127.0.0.1:8000/")
@task
def docs(c):
thread = threading.Thread(target=open_docs)
thread.start()
with c.cd('docs'):
c.run('mkdocs serve') |
test_scheduler.py | from datetime import datetime, timedelta
import os
import signal
import time
from threading import Thread
from rq import Queue
from rq.compat import as_text
from rq.job import Job
import warnings
from rq_scheduler import Scheduler
from tests import RQTestCase
def say_hello(name=None):
"""A job with a single arg... |
daemon.py | # TODO: docstring
# TODO: rename to shared?
import functools
import tempfile
import os
from typing import Optional, Dict, Any, List
import subprocess
import atexit
import sys
import threading
import grpc # type: ignore
from google.rpc import status_pb2, error_details_pb2 # type: ignore
from .servicepb.keepsake_pb2... |
download_data.py | #!/usr/bin/python3
import argparse
import json
import os
import threading
import time
from typing import List
import requests
API_URL = "https://bodhi.fedoraproject.org"
ALL_RELEASES = [
"F36",
"F36C",
"F35",
"F35C",
"F35F",
"F35M",
"F34",
"F34C",
"F34F",
"F34M",
"F33",
... |
metrics.py | from __future__ import absolute_import
__all__ = ["timing", "incr"]
import logging
import functools
from contextlib import contextmanager
from django.conf import settings
from random import random
from time import time
from threading import Thread, local
from six.moves.queue import Queue
metrics_skip_all_internal ... |
action_predictor.py | import copy
from itertools import count
from alphaction.structures.bounding_box import BoxList
import numpy as np
import queue
from tqdm import tqdm
import torch
from alphaction.config import cfg as base_cfg
from alphaction.modeling.detector import build_detection_model
from alphaction.utils.checkpoint import ActionCh... |
codecs_socket.py | # Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Sending Unicode data over a socket.
"""
# end_pymotw_header
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 ... |
parallel.py | # -*- coding: utf-8 -*-
"""
Auxiliary functions for parallel processing
:Author:
`Anna Medyukhina`_
email: anna.medyukhina@gmail.com
"""
import os
import time
from multiprocessing import Process
from typing import Union
import numpy as np
from skimage import io
from tqdm import tqdm
from .utils import imsave, w... |
fork_wait.py | """This test case provides support for checking forking and wait behavior.
To test different wait behavior, override the wait_impl method.
We want fork1() semantics -- only the forking thread survives in the
child after a fork().
On some systems (e.g. Solaris without posix threads) we find that all
active threads su... |
refactor.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Refactoring framework.
Used as a main program, this can refactor any number of files and/or
recursively descend down directories. Imported as a module, this
provides infrastructure to write your own refactoring too... |
server.py | import socket
import threading
import json
from methods.vote import vote
from methods.count import count
HOST = '0.0.0.0'
PORT = 40000
TAM_MSG = 1024
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serv = (HOST, PORT)
sock.bind(serv)
sock.listen(50)
options = {
"vote": vote,
"co... |
module.py | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... |
PruebaDeHilos.py | #Fuerte Martínez Nestor Enrique
#Tafolla Rosales Esteban
import threading
import time
import random
gatos_numero = 2
ratones_numero = 4
plato_disp = threading.Semaphore(0) #hay platos disponibles
gato_existe = threading.Semaphore(0) #hay gatos que no hayan terminado de comer
gatos_res = 0
mut_acceso = threading.S... |
locators.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
... |
server.py | #!/usr/bin/env python3
# Copyright 2021 Nicolas Surbayrole
# Copyright 2021 Quarkslab
# Copyright 2021 Association STIC
#
# 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.apa... |
make.py | import os
import glob
import time
import shutil
import bpy
import json
import stat
from bpy.props import *
import subprocess
import threading
import webbrowser
import arm.utils
import arm.write_data as write_data
import arm.make_logic as make_logic
import arm.make_renderpath as make_renderpath
import arm.make_world as ... |
main.py | """
mlperf inference benchmarking tool
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import array
import collections
import json
import logging
import os
import sys
import threading
import time
from queue import Queue
import mlperf_l... |
checks.py | #!/usr/bin/env python
import cgi
import paramiko
import time
import re
import sys
import os
import requests
import urllib
import datetime
from datetime import datetime
from threading import Thread
from random import randrange
form = cgi.FieldStorage()
searchterm = form.getvalue('searchbox')
cmds = form.getvalue('cmds'... |
upnp.py | import logging
import threading
from queue import Queue
from typing import Optional
try:
import miniupnpc
except ImportError:
pass
log = logging.getLogger(__name__)
class UPnP:
thread: Optional[threading.Thread] = None
queue: Queue = Queue()
def __init__(self):
def run():
t... |
benchmark.py | import logging
import threading
from queue import Queue
from prettytable import PrettyTable
# logging
logging.basicConfig(
level=logging.INFO,
format="[%(asctime)s %(threadName)s] %(message)s",
datefmt='%Y-%m-%d %H:%M:%S')
class BenchMark:
def __init__(self, problems:list, solvers:list, num_thread... |
pinkyserver.py | #! /usr/bin/env python3.6
import sys
import time
import pickle
import threading
import datetime
import RPi.GPIO as gpio
import nanohttp
__version__ = '0.1.0'
pwm = None
def total_status():
return dict(
power=power_model.status,
light=light_model.status,
coolendFan=coolendfan_model.statu... |
node.py | import grequests
import requests
from klein import Klein
from multiprocessing import Process
from Queue import Empty, Full
from blockchain import *
from transaction import *
from config import *
def update():
userdata = "config/config.yaml"
with open(userdata, "w") as f:
yaml.dump(config, f)
class N... |
streaming_beam_test.py | # Copyright 2020 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, s... |
test_consumer.py | # Copyright 2017, Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
test_lock.py | """
Copyright (c) 2008-2014, Jesus Cea Avion <jcea@jcea.es>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of... |
common.py | from ..common import * # NOQA
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 deepcop... |
threadDemo.py | import threading, time
print('Start of program.')
def takeANap():
time.sleep(5)
print('Wake up!')
threadObj = threading.Thread(target=takeANap)
threadObj.start()
print('End of program.')
|
standalone.py | """Support for standalone client challenge solvers. """
import argparse
import collections
import functools
import logging
import os
import socket
import sys
import threading
from six.moves import BaseHTTPServer # type: ignore # pylint: disable=import-error
from six.moves import http_client # pylint: disable=import... |
test_operator.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... |
wrapper.py | import json
import logging
import multiprocessing
import os
import queue
import requests
import shutil
import sys
import threading
import time
import uuid
from pydrive_util import upload_file, download_file
from pymongo import MongoClient
from scraper import archive, article
from time import process_time, sleep
__aut... |
utils.py | # -*- coding: utf-8 -*-
import json
import logging
import os
import sys
import threading
import time
from subprocess import Popen, PIPE
from pytest_curl_report.curl import Curl
EXCLUDE_HEADER_KEYS = [
'Accept',
'Accept-Encoding',
'Connection',
'Expect',
'Proxy-Connection',
'User-Agent',
]
lo... |
gui.py | import PySimpleGUI as sg
import numpy as np
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import PySimpleGUI as sg
import matplotlib.pyplot as plt
import matplotlib
from netspeedmonitor.lib import load_db, to_dataframe, record_func
from functools import partial
from threading import Thread
matplotlib... |
tracking_methods.py | import os
import sys
sys.path.append(os.getcwd())
currmod=sys.modules[__name__]
from src.methods.DatasetForMethods import *
import os
import shutil
import numpy as np
import scipy.ndimage as sim
import threading
import time
import scipy.spatial as sspat
import matplotlib.pyplot as plt
class NN():
default_params=... |
kyocera_dump.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import smbus
import threading
import time
import sys
sys.path.append("/home/pi/HomeRpi")
import datetime
import commands
import ConfigParser
iniFile = ConfigParser.SafeConfigParser()
iniFile.read('./config.ini')
# 初期化(38400bps)
# 0:300, 1:600, 2:1200, 3:2400, 4:4800, 5:... |
plot_From_pp_geop_height_and_vorticity.py | """
Load pp, plot and save
8km difference
"""
import os, sys
#%matplotlib inline
#%pylab inline
import matplotlib
matplotlib.use('Agg')
# Must be before importing matplotlib.pyplot or pylab!
from matplotlib import rc
from matplotlib.font_manager import FontProperties
from matplotlib import rcParams
from mpl_to... |
qt.py | #!/usr/bin/env python
#
# Electrum - Lightweight Bitgesell Client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... |
mp.py |
import logging
import multiprocessing
import select
import unittest
import collections
import os
import sys
import six
import multiprocessing.connection as connection
from nose2 import events, loader, result, runner, session, util
log = logging.getLogger(__name__)
class MultiProcess(events.Plugin):
configSect... |
test_interactive_credential.py | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import functools
import socket
import threading
import time
from azure.core.exceptions import ClientAuthenticationError
from azure.identity import InteractiveBrowserCre... |
recoco_spy.py | # Copyright 2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... |
proj0client.py |
import threading
import time
import random
import socket
def client():
try:
cs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print("[C]: Client socket created")
except socket.error as err:
print('socket open error: {} \n'.format(err))
exit()
# Define the port on whi... |
ch02_listing_source.py |
import json
import threading
import time
import unittest
import urlparse
import uuid
# <start id="_1311_14471_8266"/>
def check_token(conn, token):
return conn.hget('login:', token) #A
# <end id="_1311_14471_8266"/>
#A Fetch and return the given user, if available
#END
# <start id="_1311_14471_8265"/>
def upda... |
broker.py | #coding:utf-8
"""
author: sam
revision:
1. create 2017/4/8
"""
import time
import traceback
from threading import Thread,Condition,Lock
import redis as Redis
from mantis.fundamental.utils.importutils import import_function
class MessageChannel(object):
def __init__(self,cfgs,broker):
self.cfgs ... |
GSASIImath.py | # -*- coding: utf-8 -*-
#GSASIImath - major mathematics routines
########### SVN repository information ###################
# $Date: 2019-09-18 12:34:20 -0500 (Wed, 18 Sep 2019) $
# $Author: vondreele $
# $Revision: 4152 $
# $URL: https://subversion.xray.aps.anl.gov/pyGSAS/trunk/GSASIImath.py $
# $Id: GSASIImath.py 415... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.