source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
server.py | # coding=utf-8
""" Flask server for CO2meter
(c) Vladimir Filimonov, 2018-2021
E-mail: vladimir.a.filimonov@gmail.com
"""
import optparse
import logging
import threading
import time
import glob
import os
import socket
import signal
import json
try:
from StringIO import StringIO
except ImportError:
fro... |
foo.py | # Python 3.3.3 and 2.7.6
# python foo.py
#! /usr/bin/env python
from threading import Lock, Thread
# Potentially useful thing:
# In Python you "import" a global variable, instead of "export"ing it when you declare it
# (This is probably an effort to make you feel bad about typing the word "global")
lock = Lock()
... |
utils.py | """helpers for passlib unittests"""
#=============================================================================
# imports
#=============================================================================
from __future__ import with_statement
# core
from binascii import unhexlify
import contextlib
from functools import ... |
custom_uss.py | #!/usr/bin/python3
import json
import os
import uuid
import threading
import time
import logging
import random
from flask_socketio import SocketIO
from datetime import datetime, timedelta
from flask import Flask, request
from isa import ISA
from subscription import Subscription
from flight import Flight
## PARAMS... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
from threading import Thread
import time
import traceback
import csv
from decimal import Decimal
from bitcoin import COIN
from i18n import _
from util import PrintError, ThreadJob
from util import format_satoshis
# See https://en.wikipedia.org/w... |
__init__.py | import time
import threading
from ..token import Token
from ..worker import WorkerCircularQueue, Worker
class CMCService:
def __init__(self, update_interval: float = 15, apikeys=None, start=True) -> None:
self.__lock = threading.Lock()
self.__cache = {}
self.__q = WorkerCircularQueue()
... |
redis.py | # Copyright (c) 2019 AT&T Intellectual Property.
# Copyright (c) 2018-2019 Nokia.
#
# 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... |
olya.py | import copy
import json
import logging
import queue
import threading
import attr
from api.models.updates import MessageUpdate
from api.vk import VkApi
logging.basicConfig(**{
'format': '%(asctime)s %(levelname)s %(name)-15s %(message)s',
'datefmt': '%Y-%m-%d %H:%M:%S'
})
logger = logging.getLogger(__name__)
... |
dataset.py | import os
import face_recognition
import progressbar
import pickle
import multiprocessing
import numpy as np
import threading
class Generate:
"""
Used for creating segmented facial data.
A new dataset is created for each person
Attributes
----------
KNOWN_FACES_DIR : str
Path to know... |
util.py | """Utilities for working with mulled abstractions outside the mulled package."""
from __future__ import print_function
import collections
import hashlib
import logging
import re
import sys
import tarfile
import threading
from io import BytesIO
import packaging.version
import requests
log = logging.getLogger(__name__... |
helper.py | import os
import sys
import time
import psutil
import logging
import threading
import logging.handlers
import subprocess as subps
from scalrpy import __version__
def configure_log(log_level=1, log_file=None, log_size=1024*10):
level = {
0:logging.CRITICAL,
1:logging.ERROR,
2:l... |
017-thread.py | import os,time
from threading import Thread,Lock
database_value = 0
def increase(lock):
global database_value
# lock.acquire()
# local_copy = database_value
# # processing
# local_copy += 1
# time.sleep(0.1)
# database_value = local_copy
# lock.release()
with lock:
local_cop... |
vim.py | import os,sys, tempfile
from io import StringIO
#from thebe.core.output import outputController
from multiprocessing import Process
from subprocess import call, check_output
class FileManager:
def __init__(self, target_name):
self.temp_name = ''
self.target_name = target_name
target_ext = ... |
test_refleaks.py | """Tests for refleaks."""
from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob
import threading
import cherrypy
data = object()
from cherrypy.test import helper
class ReferenceTests(helper.CPWebCase):
def setup_server():
class Root:
def index(self, *args, **kwar... |
tello.py | # coding=utf-8
import logging
import socket
import time
import threading
import cv2 # type: ignore
from threading import Thread
from typing import Optional, Union, Type, Dict
from .enforce_types import enforce_types
threads_initialized = False
drones: Optional[dict] = {}
client_socket: socket.socket
@enforce_types... |
Client.py | import socket
from threading import Thread
from Crypto.Cipher import AES
class Client:
KEY_LEN = 16
AES_ECB_BLOCK_LEN = 16
REQUEST_PORTION = 2**10 * 8
def __init__(self, server_host, server_port):
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.unencrypted = bytea... |
realtimeLogger.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... |
SBFI_Analyzer.py | # Multithreaded analysis of observation dumps (from toolconf.result_dir)
# Interacts with datamodel
# With respect to SQL database - fills the table 'Injections'
# Renames dumps according to global unique key, stores them into zip package
# Author: Ilya Tuzov, Universitat Politecnica de Valencia
import sys
import xml... |
rosnode_meridim_demo_dpg.py | # #!/usr/bin/python3
# coding: UTF-8
#もしくは #!/usr/bin/env python など環境に合わせて
#from _typeshed import IdentityFunction
from re import I
from yaml.tokens import TagToken
import rospy
from sensor_msgs.msg import JointState
import numpy as np
import socket
from contextlib import closing
import struct
import math
import dear... |
handler.py | import logging
import time
from collections import defaultdict
from queue import Queue
from threading import Thread
from kube_hunter.conf import get_config
from kube_hunter.core.types import ActiveHunter, HunterBase
from kube_hunter.core.events.types import Vulnerability, EventFilterBase
logger = logging.getLogger(__... |
pool.py | # Copyright 2017 Red Hat, 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 writing, ... |
setup.py | #!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2016 California Institute of Technology.
# Copyright (c) 2016-2022 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - https://github.com/uqfoundation/mu... |
inter_thread_communication_queue.py | import sys
import threading
import queue
# sentinel object is anything that indicates a stop on the task
# you could use None as a sentinel, indeed IMO that is what is used the most of the times
import time
sentinel = object()
def order_work(q):
for i in range(0, 10):
q.put(i)
time.sleep(1)
... |
speechSpyGlobalPlugin.py | # A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2018 NV Access Limited
# This file may be used under the terms of the GNU General Public License, version 2 or later.
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
"""This module provides an NVDA global plugin which creates a and robo... |
dense_update_ops_no_tsan_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... |
upgrade IOS v2.py | from tkinter import *
from tkinter import ttk
import random
import os
import re
import socket
import sys
import netmiko
import time
import multiprocessing
from getpass import getpass
from netmiko import ConnectHandler, SCPConn
#Debug
import logging
logging.basicConfig(filename='test.log', level=logg... |
writer.py | import os
import time
from threading import Thread
from queue import Queue
import cv2
import numpy as np
import torch
import torch.multiprocessing as mp
from alphapose.utils.transforms import get_func_heatmap_to_coord
from alphapose.utils.pPose_nms import pose_nms
DEFAULT_VIDEO_SAVE_OPT = {
'savepath': 'examples... |
__init__.py | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2002-2016 "Neo Technology,"
# Network Engine for Objects in Lund AB [http://neotechnology.com]
#
# This file is part of Neo4j.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... |
sh.py | """
http://amoffat.github.io/sh/
"""
#===============================================================================
# Copyright (C) 2011-2017 by Andrew Moffat
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to dea... |
controller.py | # Copyright Allen Institute for Artificial Intelligence 2017
"""
ai2thor.controller
Primary entrypoint into the Thor API. Provides all the high-level functions
needed to control the in-game agent through ai2thor.server.
"""
import atexit
from collections import deque, defaultdict
from itertools import product
import ... |
toolbar.py | """Module for dealing with the toolbar.
"""
import math
import os
import ipyevents
import ipyleaflet
import ipywidgets as widgets
from ipyfilechooser import FileChooser
from .common import *
def tool_template(m=None):
"""Generates a tool GUI template using ipywidgets.
Args:
m (leafmap.Map, optional):... |
basic_gpu_test.py | # Copyright 2016 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... |
heart.py | """
This class detects faces in frames it gets from the camera object passed to
the constructor.
The get_faces method returns the bounding boxes for all faces last detected.
A thread is created that does the heavy lifting of detecting faces and updates
a class var that contains the last faces detected. This allows th... |
test_java_subclasses.py | '''Tests subclassing Java classes in Python'''
import os
import sys
import threading
import unittest
from test import test_support
from java.lang import (Boolean, Class, ClassLoader, Comparable,Integer, Object, Runnable, String,
Thread, ThreadGroup, InterruptedException, UnsupportedOperationExc... |
Xueqiu.py | # -*- coding: utf-8 -*-
"""
雪球社区接口类
Created on 03/17/2016
@author: Wen Gu
@contact: emptyset110@gmail.com
"""
# 以下是自动生成的 #
# --- 导入系统配置
import dHydra.core.util as util
from dHydra.core.Vendor import Vendor
from dHydra.core.Functions import get_vendor
# --- 导入自定义配置
from .connection import *
from .const import *
from .co... |
newswrapper.py | #!/usr/bin/python3 -OO
# Copyright 2007-2021 The SABnzbd-Team <team@sabnzbd.org>
#
# This program 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 2
# of the License, or (at your option) any late... |
test_server.py | import os
from multiprocessing.managers import DictProxy
from unittest.mock import Mock, ANY
import requests
import time
import tempfile
import uuid
from typing import List, Text, Type, Generator, NoReturn, Dict
from contextlib import ExitStack
from _pytest import pathlib
from aioresponses import aioresponses
impor... |
parallel.py | import _thread as thread
import logging
import operator
import sys
from queue import Empty
from queue import Queue
from threading import Lock
from threading import Semaphore
from threading import Thread
from docker.errors import APIError
from docker.errors import ImageNotFound
from compose.cli.colors import AnsiMode
... |
Chap10_Example10.40.py | from threading import *
from queue import Queue
from time import sleep
import random
def myproducer():
for i in range(5):
item = random.randint(1, 100)
print(f"Item No. {i} produced by producer is: ", item)
myqueue_obj.put(item)
print("Notification given by the producer")
s... |
google_pubsub_data_loader.py | import traceback
import time
from splunktalib.common import log
logger = log.Logs().get_logger("main")
import google_ta_common.google_consts as ggc
import pubsub_mod.google_pubsub_consts as gpc
import google_wrapper.pubsub_wrapper as gpw
class GooglePubSubDataLoader(object):
def __init__(self, config):
... |
cfbypass.py | import cfscrape
import os
import random
import time
import requests
import threading
import cloudscraper
from colorama import Fore
print(Fore.YELLOW + """
____ _____ ______ ______ _ ____ ____
/ ___| ___| | __ ) \ / / _ \ / \ / ___/ ___|
| | | |_ | _ \\ V /| |_) / _ \ \___ \___ \ \r
| |___| _| ... |
main.py | import subprocess, threading, time, importlib, sys, requests
import config
threads = []
def block_tup_to_class(tup):
block_module = importlib.import_module('commands.' + tup[0])
block = block_module.Block(tup[3])
block.type = tup[0]
block.icon = tup[1]
block.interval = tup[2]
return block
bl... |
prefix_mgr_client_tests.py | #!/usr/bin/env python
#
# Copyright (c) 2014-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.
#
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from... |
utils.py | #!/usr/bin/env python
"""
General Utilities
(part of web.py)
"""
__all__ = [
"Storage", "storage", "storify",
"iters",
"rstrips", "lstrips", "strips",
"safeunicode", "safestr", "utf8",
"TimeoutError", "timelimit",
"Memoize", "memoize",
"re_compile", "re_subm",
"group",
"IterBetter", "iterbetter",
... |
subproc_vec_env.py | import multiprocessing
from collections import OrderedDict
from typing import Sequence
import gym
import numpy as np
from stable_baselines3.common.vec_env.base_vec_env import CloudpickleWrapper, VecEnv
def _worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.var()
w... |
test_crt_vm_with_vr_by_max_threads.py | '''
New Perf Test for creating KVM VM with SG L3 network.
The created number will depends on the environment variable: ZSTACK_TEST_NUM
This case should use KVM simulator if the real environment doesn't support
so many resource.
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zs... |
ESnetCollector.py | #!/usr/bin/python
import os, sys, time
import threading
from threading import Thread
import requests
import json
from datetime import datetime
from elasticsearch import Elasticsearch, exceptions as es_exceptions
from elasticsearch import helpers
lastReconnectionTime = 0
ESserver = sys.argv[1]
ESport = int(sys.argv[... |
email_util.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from threading import Thread
from flask import current_app
from flask import 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, ... |
calllimit.py | # -*- coding: utf-8 -*-
# @Author: xiaodong
# @Date : 2021/5/29
import time
import typing
import asyncio
import functools
import contextvars
from functools import wraps
from threading import Thread, Event
class LimitExecuteDuration:
"""
限制函数执行时间,如函数执行超时则直接结束。
--- usage:
def your_func(*args, **... |
test_local.py | # Copyright 1999-2021 Alibaba Group Holding 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... |
threadedServer.py | '''
see https://stackoverflow.com/questions/23828264/how-to-make-a-simple-multithreaded-socket-server-in-python-that-remembers-client
'''
import socket
import threading
class ThreadedServer(object):
def __init__(self, host, port):
self.host = host
self.port = port
self.sock = socket.socket(... |
slowxtcamexhaustionport.py | from scapy.all import *
import time
from random import randint
import threading
from threading import Thread
from multiprocessing import Pool, Process
import os
'''The Internet Assigned Numbers Authority (IANA) suggests the range 49152 to 65535
(2e15+2e14 to 2e16-1) for dynamic or private ports. Many Linux kernels use... |
audio_reader.py | from __future__ import print_function
import os
import random
import re
import threading
import librosa
import numpy as np
import tensorflow as tf
def load_audio_alignments(audio_root_dir, alignment_list_file,
sample_rate, context):
'''Load the audio waveforms and alignments from a list... |
gdal2tiles.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ******************************************************************************
# $Id$
#
# Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/)
# Support: BRGM (http://www.brgm.fr)
# Purpose: Convert a raster into TMS (Tile Map Service) tiles in a di... |
run_py_tests.py | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""End to end tests for ChromeDriver."""
import base64
import json
import math
import optparse
import os
import socket
import subproce... |
test_context.py | import mock
import threading
from unittest import TestCase
from nose.tools import eq_, ok_
from tests.test_tracer import get_dummy_tracer
from ddtrace.span import Span
from ddtrace.context import Context, ThreadLocalContext
from ddtrace.ext.priority import USER_REJECT, AUTO_REJECT, AUTO_KEEP, USER_KEEP
class TestTr... |
test_slow_retrieval_attack.py | #!/usr/bin/env python
"""
<Program Name>
test_slow_retrieval_attack.py
<Author>
Konstantin Andrianov
<Started>
March 13, 2012
<Copyright>
See LICENSE for licensing information.
<Purpose>
Simulate slow retrieval attack. A simple client update vs. client
update implementing TUF.
During the slow retri... |
stressRest.py | '''
Created on Jan 5, 2015
@author: moloyc
Before running this test install locust - 'pip install locustio'
Running the test:
1. locust -f stressRest.py
2. Open browser http://localhost:8089/
3. Start stress test
4. Once done, download the csv file and save as locust.csv in this directory
5. python postProc... |
helpers.py | # -*- coding: utf-8 -*-
"""
:copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.support.helpers
~~~~~~~~~~~~~~~~~~~~~
Test support helpers
"""
from __future__ import absolute_import, print_function, unicode... |
hpswitch.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... |
test_dag_serialization.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... |
io_utils.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited.
#
# 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/LICENS... |
process.py | import collections
import logging
import threading
import os
import sys
import signal
import platform
import subprocess
VERBOSE = True
class PopenProcess(object):
def __init__(self,
command,
read_line_callback,
read_error_callback = None,
proc_args = None,
... |
conftest.py | # Copyright (c) 2011 Florian Mounier
# Copyright (c) 2011 Anshuman Bhaduri
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014-2015 Tycho Andersen
#
# 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 Soft... |
test_RWLock.py | import threading
from lox import RWLock
from copy import copy
from time import sleep, time
from collections import deque
SLEEP_TIME = 0.01
N_WORKERS = 5
rw_lock = None
resource = None
resp = None
def common_setup():
global rw_lock, resp
rw_lock = RWLock()
resp = deque()
def common_create_workers(func,... |
deployer_utils.py | """
Name: deployer_utils.py
Purpose: Utility functions for general usage in the project
Author: PNDA team
Created: 21/03/2016
Copyright (c) 2016 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Apache License, Version 2.0 (the "License").
You may obtain a copy of t... |
swaprebalance.py | import time
import datetime
import unittest
from TestInput import TestInputSingleton
import logger
from couchbase_helper.cluster import Cluster
from membase.api.rest_client import RestConnection, RestHelper
from membase.helper.bucket_helper import BucketOperationHelper
from membase.helper.cluster_helper import ClusterO... |
device_manager.py | #!/usr/bin/env python
##############################################################################
# Copyright 2020-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
################################... |
pc_main.py | import numpy as np
import cv2
import pygame
import threading
import socketserver
import socket
from queue import Queue
import time
import pandas as pd
from keras.models import model_from_yaml
import os
RUN = True
COLLECT = False
q = Queue(100)
class Control(object):
'keeps track of steering durin... |
portscanner.py | import optparse
from socket import *
from threading import *
screenLock = Semaphore(value=1)
def connScan(tgtHost, tgtPort):
try:
connSkt = socket(AF_INET, SOCK_STREAM)
connSkt.connect((tgtHost, tgtPort))
connSkt.send('ViolentPython\r\n')
results = connSkt.recv(100)
screenLock.acquire()
print '[+] %d/tcp... |
output.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import re
import threading
from debugpy.common import fmt, log
class ... |
dataset.py | # -*- coding: utf-8 -*-
import os
import os.path
from queue import Queue
from threading import Thread
import cv2
import torch
import torch.utils.data
import numpy as np
from histogram import match_histograms
def get_loader(my_dataset, device, batch_size, num_workers, shuffle):
""" 根据dataset及设置,获取对应的 DataLoader ... |
pymigrate_v2.py | #!/usr/bin/env python3
from slickrpc import Proxy
import queue
from threading import Thread
import threading
import time
from slickrpc import Proxy
import sys
import datetime
import os
import json
import re
import platform
import calendar
def selectRangeInt(low,high, msg):
while True:
try:
nu... |
offline_database.py | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------#
# Copyright © 2015-2016 VMware, Inc. All Rights Reserved. #
# #
# Licensed under the BSD 2-Clause License (the “License... |
test_backends.py | from functools import partial
from tempfile import NamedTemporaryFile
from threading import Thread
import time
from mock import Mock
from mock import call
from mock import patch
import pytest
from yoyo import backends
from yoyo import read_migrations
from yoyo import exceptions
from yoyo.connections import get_backen... |
test_kvstore.py | import dgl
import argparse
import mxnet as mx
import time
import backend as F
from multiprocessing import Process
ID = []
ID.append(mx.nd.array([0,1], dtype='int64'))
ID.append(mx.nd.array([2,3], dtype='int64'))
ID.append(mx.nd.array([4,5], dtype='int64'))
ID.append(mx.nd.array([6,7], dtype='int64'))
DATA = []
DATA.... |
foo.py | # Python 3.3.3 and 2.7.6
# python fo.py
from threading import Thread
import time
# Potentially useful thing:
# In Python you "import" a global variable, instead of "export"ing it when you declare it
# (This is probably an effort to make you feel bad about typing the word "global")
i = 0
def incrementingFunction... |
basic.py | import os
import threading
import time
from tkinter import *
import tkinter.messagebox
from pygame import mixer
from tkinter import filedialog
from mutagen.mp3 import MP3
from ttkthemes import themed_tk as tk
from tkinter import ttk
root = tk.ThemedTk()
root.get_themes()
root.set_theme("radiance")
... |
main.py | from __future__ import print_function
import argparse
import os
import json
import torch
import torch.multiprocessing as mp
import numpy as np
import optim
from envs import create_atari_env
from model import ActorCritic
from evaluation import evaluation
from train import train
def parse_arg():
parser = argpars... |
views.py | from django.shortcuts import render
# Create your views here.
from dwebsocket.decorators import accept_websocket, require_websocket
from django.http import HttpResponse
from rest_framework.views import APIView
from rest_framework.response import Response
from DjangoRestAuth.publicApi import DocParam, get_parameter_dic,... |
cmsPerfServer.py | #!/usr/bin/env python
import cmsPerfPublish as cspp
import cmsPerfSuite as cps
import cmsPerfHarvest as cph
#G.Benelli
import cmsRelValCmd #Module that contains get_cmsDriverOptions() function to get a string with the options we are interested in from cmsDriver_highstats_hlt.txt
import cmsCpuInfo #Module that c... |
sparse_conditional_accumulator_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... |
lib_images_io.py | #!/usr/bin/env python
'''
Classes for reading images from video, folder, or web camera,
and for writing images to video file.
Main classes and functions:
* Read:
class ReadFromFolder
class ReadFromVideo
class ReadFromWebcam
* Write:
class VideoWriter
* Display... |
server.py | #!/usr/bin/env python
import sys
sys.path.append("../")
import logging
import time
import uhej_server
import socket
import threading
import os
logger = logging.getLogger()
PORT = 5000
sock = None
def log_init(level):
logger.setLevel(level)
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)... |
server.py | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 26 01:00:38 2021
@author: Louis
"""
import socket
from threading import Thread
# server's IP address
SERVER_HOST = "0.0.0.0"
SERVER_PORT = 5002 # port we want to use
separator_token = "<SEP>" # we will use this to separate the client name & message
# initialize list/se... |
test_network.py | # -*- coding: utf-8 -*-
"""
.. invisible:
_ _ _____ _ _____ _____
| | | | ___| | | ___/ ___|
| | | | |__ | | | |__ \ `--.
| | | | __|| | | __| `--. \
\ \_/ / |___| |___| |___/\__/ /
\___/\____/\_____|____/\____/
Created on Jan 23, 2014
███████████████████████████████████████... |
installwizard.py |
from functools import partial
import threading
import os
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform... |
test_syncobj.py | from __future__ import print_function
import os
import time
import pytest
import random
import threading
import sys
import pysyncobj.pickle as pickle
import pysyncobj.dns_resolver as dns_resolver
import platform
if sys.version_info >= (3, 0):
xrange = range
from functools import partial
import functools
import str... |
client.py | """
Gdb debug client implementation for the debugger driver.
"""
import abc
import binascii
import logging
import struct
import string
import queue
from threading import Thread
from ..debug_driver import DebugDriver, DebugState
from .rsp import RspHandler
INTERRUPT = 2
BRKPOINT = 5
class GdbCommHandler(metaclas... |
sqs_env.py | import logging
import multiprocessing
import warnings
import os
from typing import TYPE_CHECKING, Dict, Optional, Type, Union
import attr
import boto3
import requests
from sqs_workers import DEFAULT_BACKOFF, RawQueue, codecs, context, processors
from sqs_workers.core import RedrivePolicy
from sqs_workers.processors i... |
evernote_client_oauth.py | import threading
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
from typing import Optional
from urllib.parse import parse_qsl, quote, urlparse
import oauth2
from evernote_backup.cli_app_util import is_inside_docker
from evernote_backup.evernote_client import EvernoteClientBase
class OAuthDe... |
_parallelize.py | # -*- coding: utf-8 -*-
"""Module used to parallelize model fitting."""
from typing import Any, Union, Callable, Optional, Sequence
from threading import Thread
from multiprocessing import Manager
import numpy as np
import joblib as jl
from cellrank.utils._utils import _get_n_cores
_msg_shown = False
def parallel... |
settings.py | import glob
import platform
import subprocess
import os
import sys
import locale
import tempfile
import time
from urllib.request import urlopen
from PyQt5 import QtGui
from PyQt5 import QtCore
try:
import psutil
importedPsutil = True
except ImportError:
importedPsutil = False
from PyQt5.QtGui import *
from... |
DTpyWeb.py | import PySimpleGUI as sg
import os, re, subprocess
from flask import Flask, render_template, flash, redirect, url_for, request, session
from classes.forms import RegistrationForm
from classes.functions import Main
import datetime, textwrap
from configparser import ConfigParser
from multiprocessing import Process
import... |
shell.py | """Common Shell Utilities."""
import os
import sys
from subprocess import Popen, PIPE
from multiprocessing import Process
from threading import Thread
from ..core.meta import MetaMixin
from ..core.exc import FrameworkError
def exec_cmd(cmd_args, *args, **kw):
"""
Execute a shell call using Subprocess. All a... |
RobotArm5_socket_ros_20190521164009.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 RobotArm5_so... |
context_test.py |
from caffe2.python import context, test_util
from threading import Thread
class MyContext(context.Managed):
pass
class DefaultMyContext(context.DefaultManaged):
pass
class ChildMyContext(MyContext):
pass
class TestContext(test_util.TestCase):
def use_my_context(self):
try:
... |
server.py | # -*- coding: utf-8 -*-
import contextlib
import copy
import hashlib
import json
import logging
import os
import re
import sys
import threading
import time
from logging import getLogger
from stat import S_ISDIR
from subprocess import CalledProcessError
import six
from flask import Blueprint, Flask, render_template, cu... |
rdock_test_MP.py | from rdkit import Chem
from rdkit.Chem import AllChem
import subprocess
#import threading
from multiprocessing import Process
import os
import shutil
import time
def docking_calculation(cmd):
proc = subprocess.call( cmd , shell=True)
print('end in thread')
#----parameter & preparation
def rdock_score(compou... |
localResolutions.py | import numpy as np
import functools
import multiprocessing
import math
from FSCUtil import FSCutil
from confidenceMapUtil import FDRutil
from scipy.interpolate import RegularGridInterpolator
#------------------------------------------------------------
def localResolutions(halfMap1, halfMap2, boxSize, stepSize, cutoff... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.