source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
threading_queues.py | from threading import Thread
from queue import Queue
def producer(queue):
for i in range(10):
print(str(i))
# item = make_an_item_available(i)
item = i
queue.put(str(item))
def consumer(queue):
while True:
item = queue.get()
print("Received item in queue fro th... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_email(to, subject, template, **kwargs):
# Get app object
app = current_app._get_current_object()
# Compose message
msg = Message(subject=app.config['BOOKORGANIZER_M... |
run_radremap.py | """
This script runs the radar remapper (88d2arps) to map the polar radar data onto the ARPS grid.
It takes one command-line argument,
the (python) configuration file for that experiment, from which it imports the appropriate info
"""
import os
import sys
import glob
import shutil
import subprocess
import threading
fr... |
recorder.py | import numpy as np
import threading
import queue
import time
from common import gtec
import matplotlib.pyplot as plt
from common.config import *
class Recorder:
def __init__(
self,
sample_duration=SAMPLE_DURATION,
num_channels=2,
channel_offset=0,
signal_type="emg",
):
... |
ws_server.py | import asyncio
from multiprocessing import Process
import json
import traceback
import websockets
from lively.eval import run_eval
from lively.completions import get_completions
from lively.code_formatting import code_format
def test():
loop = asyncio.get_event_loop()
start("0.0.0.0", 9942, loop)
debug = Tru... |
minitouch.py | # -*- coding: utf-8 -*-
import os
import re
import socket
import sys
import threading
import time
import warnings
import six
from six.moves import queue
from airtest.core.android.constant import STFLIB
from airtest.utils.logger import get_logger
from airtest.utils.nbsp import NonBlockingStreamReader
from airtest.utils... |
metrics.py | import numpy as np
from skimage.metrics import contingency_table
from skimage.metrics import variation_of_information, adapted_rand_error
import threading
def precision(tp, fp, fn):
return tp / (tp + fp) if tp > 0 else 0
def recall(tp, fp, fn):
return tp / (tp + fn) if tp > 0 else 0
def accuracy(tp, fp, fn... |
pydoc.py | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... |
bootstrap_test.py | import os
import random
import re
import shutil
import tempfile
import threading
import time
import logging
import signal
from cassandra import ConsistencyLevel
from cassandra.concurrent import execute_concurrent_with_args
from ccmlib.node import NodeError, TimeoutError, ToolError, Node
import pytest
from distutils.... |
__init__.py | # -*- coding: utf-8 -*-
"""
:copyright: Copyright 2016-2022 Sphinx Confluence Builder Contributors (AUTHORS)
:license: BSD-2-Clause (LICENSE)
"""
from bs4 import BeautifulSoup
from contextlib import contextmanager
from copy import deepcopy
from pkg_resources import parse_version
from sphinx.__init__ import __version__... |
test_utils.py | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
batchrun.py | import os
import time
from datetime import date
from datetime import datetime
import argparse
import multiprocessing
parser = argparse.ArgumentParser()
parser.add_argument("--runs", default=10, type=int, help="Change the number of evolution trials")
parser.add_argument("--newConfigFile", default=None, type=... |
federated_thzdata_sample_CNN.py | from __future__ import absolute_import, division, print_function, unicode_literals
from keras.utils import to_categorical
import numpy as np
import tensorflow as tf
import datetime
import scipy.io as sio
import multiprocessing
import math
from matplotlib.pyplot import pause
import os
import glob
import argparse
parser... |
jayrboltonContigFilterServer.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... |
combo.py | #!/usr/bin/env python3
import random
import socket
import threading
print (" - - > AUTHOR : XTraylinz CODE : XTraylinz < - - ")
print (" - - > XTraylinz x XNextTime NIH BOS!! < - - ")
print (" - - > AJARIN CUPU DONG BANG XIXI < - - ")
print (" - - > XTraylinz#0965 & XNextTime#4668 <-... |
mainwindow.py | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder, the Scientific Python Development Environment
=====================================================
Developped and maintained by the Spyder Pro... |
train.py | # -*- coding: utf-8 -*-
#
# train.py
#
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... |
sync_menu.py | from PyQt5.QtWidgets import QDialog, QVBoxLayout, QLineEdit, QHBoxLayout, QLabel, QPushButton, QGroupBox, \
QMessageBox, QCheckBox, QWidget, QFileDialog, QApplication, QComboBox, QTableWidget, QTableWidgetItem, \
QDialogButtonBox, QGridLayout, QHeaderView, QTableView, QAbstractItemView
import sip
import threadi... |
sh_it.py | """
http://amoffat.github.io/sh/
"""
# ===============================================================================
# Copyright (C) 2011-2020 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 de... |
spear.py | from asyncio.streams import StreamWriter
from socket import *
import asyncio
from cryptography.fernet import Fernet, InvalidToken
import rsa
import hashlib
import random
import time
import functools
import threading
import base64
import json
from concurrent.futures import ThreadPoolExecutor
import pickle
import traceba... |
tests.py | import sys
import threading
import time
from unittest import skipIf, skipUnless
from django.db import (
DatabaseError, Error, IntegrityError, OperationalError, connection,
transaction,
)
from django.test import (
TestCase, TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature,
)
from .models import Re... |
monitor.py | """
Restart the WSGI daemon process in development when files have changed.
"""
import atexit
import os
import queue
import signal
import sys
import threading
__author__ = 'Alex Laird'
__copyright__ = 'Copyright 2018, Alex Laird'
__version__ = '0.2.3'
_interval = 1.0
_times = {}
_files = []
_running = False
_queue ... |
hive_commands.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")... |
test_sigma_dut.py | # Test cases for sigma_dut
# Copyright (c) 2017, Qualcomm Atheros, Inc.
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import binascii
import logging
logger = logging.getLogger()
import os
import socket
import struct
import subprocess
import threading
import tim... |
vt.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2011-2019 DoomedRaven.
# This file is part of VirusTotalApi - https://github.com/doomedraven/VirusTotalApi
# See the file 'LICENSE.md' for copying permission.
from __future__ import print_function
# Full VT APIv3 functions added by Andriy Brukhovetskyy
# doom... |
manager.py | #!/usr/bin/env python3
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
import textwrap
from typing import Dict, List
from selfdrive.swaglog import cloudlog, add_logentries_handler
from common.basedir import BASEDIR, PARAMS
from common.android im... |
base.py | import sys
from subprocess import PIPE, Popen, STDOUT
from threading import Thread
import os.path
import tempfile
from Queue import Queue, Empty
ON_POSIX = 'posix' in sys.builtin_module_names
__all__ = [
"read_until",
"AirpnpProcess",
]
def enqueue_output(out, queue):
for line in iter(out.readline, '')... |
campaign.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/tabs/campaign.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# not... |
aermodInput.py | #!/usr/bin/env python3
import pandas as pd
import geopandas as gpd
import networkx as nx
from shapely.geometry import Point,LineString
from shapely.wkt import loads
from shapely.strtree import STRtree
import math
import argparse
import multiprocessing as mp
from itertools import chain
import hashlib
import os
from aer... |
siameseModelIterator-15.py | # coding: utf-8
# In[1]:
import datetime
import glob
import hashlib
import multiprocessing as mp
import os
import queue
import random
import threading
from functools import partial
import keras.backend.tensorflow_backend as KTF
#import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from keras i... |
clientPyocni.py | # Copyright 2013 Institut Mines-Telecom - Telecom SudParis
#
# 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 applicab... |
task.py | """ Backend task management support """
import itertools
import json
import logging
import os
import re
import sys
from copy import copy
from enum import Enum
from multiprocessing import RLock
from operator import itemgetter
from tempfile import gettempdir
from threading import Thread
from typing import Optional, Any, ... |
test_callbacks.py | import os
import multiprocessing
import numpy as np
import pytest
from numpy.testing import assert_allclose
from csv import reader
from csv import Sniffer
import shutil
from keras import optimizers
from keras import initializers
from keras import callbacks
from keras.models import Sequential, Model
from keras.layers i... |
session_test.py | # Copyright 2015 Google Inc. 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... |
simulator.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# File: simulator.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
import sys
import os
import signal
import time
import tensorflow as tf
import multiprocessing as mp
import time
import threading
import weakref
from abc import abstractmethod, ABCMeta
from collections import de... |
master.py | # -*- coding: utf-8 -*-
'''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
from __future__ import absolute_import, with_statement, print_function, unicode_literals
import copy
import c... |
train_dist_onnx.py | import time
import argparse
import sys
import os
import threading
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.onnx
from math import ceil
from random import Random
from torch.multiprocessing import Process
from torch.autogr... |
webhook.py | # Copyright (c) 2020. Lena "Teekeks" During <info@teawork.de>
"""
Full Implementation of the Twitch Webhook
-----------------------------------------
.. warning:: Webhooks have been discontinued.
The Webhook runs in its own thread, calling the given callback function whenever an webhook event happens.
Look at the `... |
test.py | import unittest
from memoization import cached, CachingAlgorithmFlag, _memoization
from itertools import chain
from threading import Thread
import random
from threading import Lock
import weakref
import gc
import time
make_key = _memoization._make_key # bind make_key function
exec_times = {} # e... |
ev3deploy.py | import sys
import threading
from pathlib import Path
import fnmatch
import os
import argparse
from paramiko import SSHClient
from scp import SCPClient
from typing import List, Optional, TextIO
SIGKILL = 9
SIGTERM = 15
PATH = './'
EXECUTABLE = ['*.py', '*.sh']
PASSWORD = "maker"
HOSTNAME = "ev3dev"
USERNAME = "robot"... |
smiler.py | import os
import subprocess
import re
import shutil
import threading
import signal
import logging
import time, sched
from config import config
from granularity import Granularity
from instrumenting import manifest_instrumenter
from libs.libs import Libs
from instrumenting.apkil.smalitree import SmaliTree
from instrumen... |
scheduler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Background processes made simple
---------------------------------
"""
from __future__ import print_fu... |
keep_alive.py | from flask import Flask, render_template, redirect
from threading import Thread
import random
app = Flask('')
@app.route('/')
def lol():
if random.randint(0,10) == 0:
return redirect('https://www.youtube.com/watch?v=dQw4w9WgXcQ')
else:
return render_template('home.html')
def run():
app.run(
host='0.0... |
async_service.py | # -*- coding: utf-8 -*-
"""
Created by susy at 2020/3/16
"""
from controller.base_service import BaseService
from utils.caches import cache_service, get_from_cache
from utils import singleton, get_now_ts, log as logger
from typing import Callable, Tuple
from threading import Thread
from dao.models import try_release_co... |
RemoteApiClient.py | from .PromiseStore import DeferredPromise, PromiseStore
import websocket
from threading import Thread
import json
class RemoteApiClient:
"""Provides access to Remote APIs"""
def __init__(self, endpointUri):
self.Promises = PromiseStore()
self.Connected = DeferredPromise()
self.ws = we... |
paramikospawn.py | # pylint: disable=signature-differs
"""Provides an interface like pexpect.spawn interface using paramiko
The implementation is based on 'pexpect.popen_spawn.PopenSpawn'.
"""
import threading
import socket
import logging
# CAUTION: spawnbase is not mentioned in __all__ so it is supposed to used
# internally only,
fro... |
__init__.py | '''
Documentation, License etc.
@package PythonHostLib
'''
import ConfigParser
import json
import atexit
import time
import threading
import signal
import sys
import os
from threading import Thread
from VibratorManager import VibratorManager
from VibratorAdapter import VibratorAdapter
import GPIOController
config =... |
svr.py | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
---------------------------------------------... |
data_util.py | '''
this file is modified from keras implemention of data process multi-threading,
see https://github.com/fchollet/keras/blob/master/keras/utils/data_utils.py
'''
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import time
import numpy as np
import threading
import multiprocessing
try:
import queue
except... |
mod_creditCalc.py | # -*- coding: utf-8 -*-
import codecs as p__codecs
import collections as p__collections
import json as p__json
import os as p__os
import threading as p__threading
from Queue import Queue as p__Queue
from functools import partial as p__partial
# noinspection PyUnresolvedReferences
from gui.mods.mod_mods_gui import COM... |
debugger.py | '''
Debugger to show Aldebaran's internal state
'''
import json
import logging
import threading
from http import HTTPStatus
from urllib.parse import urlparse, parse_qs
from instructions.operands import WORD_REGISTERS, operand_to_str
from utils import config
from utils import utils
from utils.errors import Architectur... |
plotting.py | """PyVista plotting module."""
import collections.abc
import ctypes
from functools import wraps
import io
import logging
import os
import pathlib
import platform
import textwrap
from threading import Thread
import time
from typing import Dict
import warnings
import weakref
import numpy as np
import scooby
import pyvi... |
train_pg.py | import numpy as np
import tensorflow as tf
import gym
import logz
import scipy.signal
import os
import time
import inspect
from multiprocessing import Process
#============================================================================================#
# Utilities
#====================================================... |
tarea2.py | """
Un profesor de la facultad asesora a varios estudiantes y estamos en su horario de atencion
Mision: modelar la interaccicon durante este horario de modo que la espera (para todos) sea
lo mas corta posible
* Un profesor tiene x sillas en su cubiculo
- Cuando no hay alumnos que atender, las sillas sirven como ... |
zeromq.py | """
Zeromq transport classes
"""
import errno
import hashlib
import logging
import os
import signal
import sys
import threading
from random import randint
import salt.auth
import salt.crypt
import salt.ext.tornado
import salt.ext.tornado.concurrent
import salt.ext.tornado.gen
import salt.ext.tornado.ioloop
import salt... |
coordinator.py | from __future__ import generators
import os
import time
import thread
import sys
import xmlrpclib
import traceback
from SimpleXMLRPCServer import SimpleXMLRPCServer
import socket
import dbfile
import logging
def get_hostname(host=None):
'get FQDN for host, or current host if not specified'
if host is None:
... |
polybeast.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
server.py | from http.server import HTTPServer
import ssl
import sys
import types
import pyodbc
from odbcnotebook import jsonrpc, odbc
USAGE = 'odbcnotebook [-p PORT] [-c CONNECTION_STRING] [-s KEY CERT PASSWORD]'
def wrap_ssl(runconfig, sock):
"""
Wraps a socket in an SSL context, if SSL is enabled.
"""
if run... |
zeromq.py | # -*- coding: utf-8 -*-
'''
Zeromq transport classes
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import sys
import copy
import errno
import signal
import hashlib
import logging
import weakref
import threading
from random import randint
# Import Salt Libs... |
programmable.py |
#Copyright (c) 2017 Andre Santos
#
#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, merge, publish, distribute... |
build_electrs.py | #!/usr/bin/env python3
import argparse
import logging
import os
import sys
import shutil
GIT_REPO = "https://github.com/BitcoinUnlimited/electrs.git"
GIT_BRANCH = "v0.7.0bu"
EXPECT_HEAD = "8e1734d5d54339cc469ea6230b0e02395f2ab82d"
ROOT_DIR = os.path.realpath(
os.path.join(os.path.dirname(__file__), os.pardir, ... |
sensniff.py | #!/usr/bin/env python3
# Copyright (c) 2012, George Oikonomou (oikonomou@users.sf.net)
# 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 c... |
15_edf_wait_die_gui.py | from functools import reduce
from sys import *
import numpy as np
import random as r
import ping_code as pc
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import getpass as gp
import psutil
from drawnow import *
fr... |
test_metrics.py | from __future__ import print_function, division, absolute_import
import sys
import threading
import time
from distributed import metrics
from distributed.compatibility import PY3
from distributed.utils_test import run_for
def test_wall_clock():
for i in range(3):
time.sleep(0.01)
t = time.time()... |
parallel.py | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unle... |
summary.py | import threading
import time
from collections import defaultdict
from typing import Callable, Dict, Mapping, TYPE_CHECKING
# TODO: dont want pandas dependencies
import numpy as np
import pandas as pd
if TYPE_CHECKING:
from manta_lab.base.packet import SummaryPacket
from manta_lab.sdk.interface.interface impor... |
SBM_TargetVsAchievement_Data_Script.py |
import ctypes # for popup window
import sys # for exception information
try: # Main exception handler
import requests # for HTTP requests
from bs4 import BeautifulSoup # for HTML parsing
import bs4 # for type checking
import xlsxwriter # for exporting to Excel - need xlsx as over 200k rows of data
... |
slides.py | #!/usr/bin/env python
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, GLib
import threading
from time import sleep
import sys
import os
installer = "/usr/local/lib/gbi/"
rcconfgbsd = "/etc/rc.conf.ghostbsd"
rcconfdbsd = "/etc/rc.conf.desktopbsd"
sys.path.append(installer)
cssProvider = G... |
container.py | """
Representation of a generic Docker container
"""
import logging
import tarfile
import tempfile
import threading
import docker
import requests
from docker.errors import NotFound as DockerNetworkNotFound
from samcli.lib.utils.retry import retry
from .exceptions import ContainerNotStartableException
from .utils imp... |
data_prepro_parallel.py | # -*- coding: utf-8 -*-
# !/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import glob
import os
import sys
import threading
sys.path.append('.')
from audio import prepro_audio
nthreads = 20
class StoppableThread(threadi... |
detection_node.py | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import os
os.environ["DARKNET_PATH"] = "/workspace/src/dependencies/darknet/"
import rospy
from sensor_msgs.msg import PointCloud2, Image, CameraInfo, PointCloud, PointField
from geometry_msgs.msg import Point32, Point, PoseStamped, Pose, Twist
import numpy as np
imp... |
PT_KP.py | from itertools import product
import os
import threading
import time
def thread_function(conf):
time.sleep(1)
print(conf)
os.system(f"Python ./RunInstance.py {' '.join(map(str,conf.values()))}")
parameters = {"Method": ["average", "extreme"], "W": [5,25], "Pmin": [0.1,0.2], "Alpha": [0.1, 0.5, 0.9]}
config... |
test_poll.py | # Test case for the os.poll() function
import os
import subprocess
import random
import select
import threading
import time
import unittest
from test.support import TESTFN, run_unittest, reap_threads, cpython_only
try:
select.poll
except AttributeError:
raise unittest.SkipTest("select.poll not defined")
def... |
main.py | import logging
from multiprocessing import JoinableQueue, Manager, Process, Queue
from multiprocessing.managers import SyncManager
from typing import Callable, Iterable, List, Union
from .constants import QueueFlags, QueueNames
logger = logging.getLogger('QueueAutomator')
class QueueAutomator:
"""
QueueAuto... |
test_thread.py | import _thread
from java import detach, jclass
from time import time, sleep
from threading import Thread
from .test_utils import FilterWarningsCase
from com.chaquo.python import TestThread as JavaTestThread
from java.lang import String
class TestThread(FilterWarningsCase):
def test_gil_release_method(self):
... |
pantsd_integration_test.py | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import datetime
import os
import re
import signal
import threading
import time
import unittest
from textwrap import dedent
import pytest
from pants.testutil.pants_integration_test import... |
master.py | '''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python modules
import os
import re
import time
import errno
import signal
import shutil
import logging
import hashlib
import tempfile
import date... |
train.py | """
Written by Matteo Dunnhofer - 2017
models training on ImageNet
"""
import sys
import os.path
import time
from models import alexnet
import tensorflow as tf
import train_util as tu
import numpy as np
import threading
def train(
epochs,
batch_size,
learning_rate,
dropout,
momentum,
lmbda,
resume... |
__main__.py | # Copyright 2020 LINE Corp.
# 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... |
autocast_variable_test.py | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
test_gateway.py | import functools
import time
from threading import Thread
import numpy as np
import pytest
import requests
from jina.flow import Flow
concurrency = 10
# @pytest.mark.skip('this tests hang up for unknown reason on github')
def test_rest_gateway_concurrency():
def _request(status_codes, durations, index):
... |
models.py | # -*- coding: utf-8 -*-
"""
Data models for the Deis API.
"""
from __future__ import unicode_literals
import base64
from datetime import datetime
import etcd
import importlib
import logging
import os
import re
import subprocess
import time
from threading import Thread
from django.conf import settings
from django.con... |
sunset-gui.py | #!/usr/bin/python
# baby 1st python script
# needs pip install pystray
# needs pip install schedule
import os
import sys
import json
import schedule
import time
from threading import Thread
import pystray
from pystray import Icon as icon, Menu as menu, MenuItem as item
from PIL import Image
PROGDIR=os.path.dirname(os... |
web_socket_util.py | # # -*- coding: utf-8 -*-
#
# import json
# import os
# import socket
# import threading
# from time import sleep
# import time
#
# from dwebsocket.decorators import accept_websocket
#
# logger = logging.getLogger('django')
# from comUtil import get_except
# from httpUtil import HttpClass
# from stringUtil import ge... |
pubnub.py |
## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2014-15 Stephen Blum
## http://www.pubnub.com/
## -----------------------------------
## PubNub 3.7.3 Real-time Push Cloud API
## ----------------------------------... |
webserver.py | import time
import threading
import traceback
import json
import nose
import sys
import linecache
import inspect
import os.path
import queue as queue
import urllib.parse
from io import StringIO
from http.server import HTTPServer, BaseHTTPRequestHandler
import socketserver as socketserver
from mpi4py import MPI
from no... |
track.py | # Written by Bram Cohen
# see LICENSE.txt for license information
from OCSBttrack.parseargs import parseargs, formatDefinitions
from OCSBttrack.RawServer import RawServer, autodetect_ipv6, autodetect_socket_style
from OCSBttrack.HTTPHandler import HTTPHandler, months, weekdays
from OCSBttrack.parsedir import parsedir
... |
test_facenet_recognition.py | import cv2
from test_facenet_register import FaceRecognition
from PIL import Image, ImageDraw
import multiprocessing as mp
import time
face_recognition = FaceRecognition("config_facenet.yaml")
def recognition_photo():
frame = Image.open('datasets/multiface.jpg')
results = face_recognition.recognition(frame)
... |
test_dtu.py | from __future__ import print_function
import multiprocessing
from model import *
from preprocess import *
from tools.common import Notify
import tensorflow as tf
import matplotlib.pyplot as plt
import os
import time
import sys
import math
import argparse
import numpy as np
import cv2
import matplotlib
matplotlib.use(... |
randomized_search_2_recorded.py | #!/usr/bin/env python
# Compatibility Python 2/3
from __future__ import division, print_function, absolute_import
from builtins import range
# ----------------------------------------------------------------------------------------------------------------------
import grip_and_record.inverse_kin
from geometry_msgs.ms... |
Camera.py | # Camera Class
# Brandon Joffe
# 2016
#
# Copyright 2016, Brandon Joffe, 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.... |
naive_count.py | import threading
def thread_plus(name):
global data
for _ in range(100_000):
data += 1
if __name__ == "__main__":
data = 0
threads = list()
for index in range(10):
x = threading.Thread(target=thread_plus, args=(index,))
threads.append(x)
x.start()
for h in thre... |
test_host_connection_pool.py | try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
from mock import Mock, NonCallableMagicMock
from threading import Thread, Event
from cassandra.cluster import Session
from cassandra.connection import Connection, MAX_STREAM_PER_CONNECTION
from cassandra.pool import Host, HostConnect... |
util.py | # This software was developed by employees of the National Institute of
# Standards and Technology (NIST), an agency of the Federal Government.
# Pursuant to title 17 United States Code Section 105, works of NIST employees
# are not subject to copyright protection in the United States and are
# considered to be in the ... |
master.py | """
The master program for CS5414 project 0
"""
import os
import signal
import subprocess
import sys
import time
import platform
from socket import SOCK_STREAM, socket, AF_INET
from threading import Thread
address = 'localhost'
threads = {} # ends up keeping track of who is alive
wait_ack = False
class ClientHandl... |
ur_driver_lite.py | #!/usr/bin/env python3
# http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28python%29
import rospy
import threading
import socket
import time
import math
import ur_rtde
import os
import geometry_msgs.msg
import std_msgs.msg
import pyquaternion # pip install pyquaternion # http://kieranwynn.github.io/pyq... |
asmqttviewer.py | # Copyright 2021 Nokia
# Licensed under the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
import paho.mqtt.client as mqtt
import paho.mqtt.subscribe as subscribe
import json
import ast
import threading
from colors import *
def processMessage(p, t):
print("Message received ", p, t)
m = ast.lit... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import asyncio
from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence
from electrum_spero.storage import WalletStorage, StorageReadWriteError
from electrum_spero.wallet_db import Wall... |
stm32uart.py | # Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Allow creation of uart/console interface via stm32 usb endpoint."""
import errno
import exceptions
import logging
import os
import select
import sys
imp... |
lisp-itr.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.