source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
chimera_kmer_multiprocess.py | import multiprocessing
import os
from threading import Semaphore
import sys
import sourmash
import configparser
import screed
import re
import itertools
import copy
rx_size = re.compile(r'size=(\d+)')
abskews = 2
k_size = 17
min_unmatched_k_mer = 30
total_account_for = 0.95
min_percentage =... |
cpnest.py | #! /usr/bin/env python
# coding: utf-8
import multiprocessing as mp
from ctypes import c_double, c_int
import numpy as np
import os
import sys
import signal
from multiprocessing.sharedctypes import Value, Array
from multiprocessing import Lock
from multiprocessing.managers import SyncManager
import cProfile
class ... |
dispatcher.py | """GRPC client.
Implements loading and execution of Python workers.
"""
import asyncio
import concurrent.futures
import logging
import queue
import threading
import traceback
import os
import grpc
import pkg_resources
from . import bindings
from . import functions
from . import loader
from . import protos
from . im... |
core.py | # Copyright 2019-present Ralf Kundel, Fridolin Siegmund
#
# 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 applic... |
interactive_debugger_plugin_test.py | # Copyright 2017 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... |
collection.py | # Copyright 2009-present MongoDB, 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 wri... |
Tokentaker.py | import os
import time
if os.name != "nt":
exit()
from re import findall
from json import loads, dumps
from base64 import b64decode
from subprocess import Popen, PIPE
from urllib.request import Request, urlopen
from datetime import datetime
from threading import Thread
from time import sleep
from sys import argv
LOC... |
Query.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Ivar Vargas Belizario
# Copyright (c) 2020
# E-mail: ivar@usp.br
import tornado.ioloop
import tornado.web
import tornado.httpserver
<<<<<<< HEAD
=======
import threading
>>>>>>> d52e075ee9202ad56995099b7c9fedb6ea96a974
import ujson
import gl... |
socket_client_video.py | #v0.9 - Alpha 1
#v0.8
#import socket, videosocket
import socket
import errno
from threading import Thread, Event
from videofeed import VideoFeed
from cv2 import cv2
import logging
import numpy as np
import zlib
HEADER_LENGTH = 10
NP_ROW_CHARS_SIZE = 4
NP_COL_CHARS_SIZE = 4
NP_DIM_CHARS_SIZE = 4
client_... |
run_workers.py | #!/usr/bin/env python3
'''
A script for running worker processes
Copyright 2012-2020 Codinuum Software Lab <https://codinuum.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
... |
realtimeLogger.py | # Copyright (C) 2015-2021 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... |
run.py | # Copyright 2020 ChainLab
#
# 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 writi... |
test_asyncore.py | import asyncore
import unittest
import select
import os
import socket
import sys
import time
import errno
import struct
import threading
from test import support
from io import BytesIO
if support.PGO:
raise unittest.SkipTest("test is not helpful for PGO")
TIMEOUT = 3
HAS_UNIX_SOCKETS = hasattr(socket, 'AF_UNIX'... |
test_redundant_router.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_program_for_Phidgets1xEncoderENC1000_ReubenPython2and3Class.py | # -*- coding: utf-8 -*-
'''
Reuben Brewer, Ph.D.
reuben.brewer@gmail.com
www.reubotics.com
Apache 2 License
Software Revision F, 05/22/2022
Verified working on: Python 2.7, 3.8 for Windows 8.1, 10 64-bit and Raspberry Pi Buster (no Mac testing yet).
'''
__author__ = 'reuben.brewer'
from Phidgets1xEn... |
util.py | import os
import re
import sys
import time
import json
import requests
from datetime import datetime
from subprocess import run, PIPE, DEVNULL
from multiprocessing import Process
from urllib.parse import quote
from config import (
IS_TTY,
ARCHIVE_PERMISSIONS,
HTML_FOLDER,
ARCHIVE_DIR,
TIMEOUT,
... |
train_sampling_unsupervised.py | import dgl
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.multiprocessing as mp
from torch.utils.data import DataLoader
import dgl.function as fn
import dgl.nn.pytorch as dglnn
import time
import argparse
from _thread import start_new... |
elmo_factory.py | import os
from pathlib import Path
from allennlp.commands.elmo import ElmoEmbedder
from logging import getLogger
import owncloud
import threading
from enum import Enum
from src.cloud.cloud_connection import CloudConnection
class FileStatus(Enum):
Fetching = 1
Ready = 2
class ELMoFactory:
__logger = getL... |
create_dataset.py | """
This file will create a dataset of images and labels for training.
Author: Arda Mavi
"""
import os
import time
from multiprocessing import Process
import numpy as np
from PIL import Image
from mss import mss
from pynput.keyboard import Listener as key_listener
from pynput.mouse import Listener as mouse_listener
... |
serve.py | # Copyright (c) 2020 PaddlePaddle 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 appli... |
m_server.py | '''
## MESSAGE SERVER 1.0
##
## The simple messaging server can be installed on any machine
## It's main function is to receive, route and send messages to users
## It also allows users to create accounts, complete with password authentication
## Finally, it stores the public keys used for End to End encryption.
... |
server.py | import Snake
import time
import json
import pickle
import threading
import socket
# select level
with open('levels/level.json') as f:
world = json.load(f)
env = Snake.environment(19, 11, repeat = True, world = world, tilesize = 50)
players = {}
debugging = False
s = socket.socket()
s.bind(('', 652... |
speedtest_cli.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2014 Matt Martz
# 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.or... |
web_proxy.py | __author__ = 'Brent Berghmans 1334252'
import hashlib
import socket
import re
from threading import Thread
from threading import Lock
import Queue
import os
import sys
import time
from email.utils import formatdate
class HostReplacer:
def __init__(self, file = False):
self.mDict = dict()
... |
dbx.py | from __future__ import print_function
import base64
import copy
import json
import os
import time
import dropbox
from builtins import object
from builtins import str
from typing import List
from pydispatch import dispatcher
from empire.server.common import encryption
from empire.server.common import helpers
from emp... |
run-spec-test.py | #!/usr/bin/env python3
# Author: Volodymyr Shymanskyy
# Usage:
# ./run-spec-test.py
# ./run-spec-test.py --spec=opam-1.1.1
# ./run-spec-test.py .spec-v1.1/core/i32.json
# ./run-spec-test.py .spec-v1.1/core/float_exprs.json --line 2070
# ./run-spec-test.py .spec-v1.1/proposals/tail-call/*.json
# ./run-spec-... |
bmv2.py | import json
import multiprocessing
import os
import random
import re
import socket
import threading
import urllib2
from contextlib import closing
import time
from mininet.log import info, warn
from mininet.node import Switch, Host
SIMPLE_SWITCH_GRPC = 'simple_switch_grpc'
PKT_BYTES_TO_DUMP = 80
VALGRIND_PREFIX = 'val... |
HTTPListener.py | import logging
import os
import sys
import threading
import SocketServer
import BaseHTTPServer
import ssl
import socket
import posixpath
import mimetypes
import time
MIME_FILE_RESPONSE = {
'text/html': 'FakeNet.html',
'image/png': 'FakeNet.png',
'image/ico': 'FakeNet.ico',
'image/jpeg': ... |
hsds_app.py | import os
import sys
from pathlib import Path
import site
import signal
import subprocess
import time
import uuid
import queue
import threading
import logging
from shutil import which
# maximum number of characters if socket directory is given
# Exceeding this can cause errors - see: https://github.com/HDFGroup/hsds/i... |
threaded_aftermain.py | from time import sleep
import threading
import numpy
def thread1():
# Main allocation after main thread exits:
sleep(0.5)
data = numpy.ones((1024, 1024, 70), dtype=numpy.uint8)
sleep(0.5)
threading.Thread(target=thread1).start()
def main():
sleep(0.1)
main()
|
px8_sort.py | px8 / python cartridge
version 1
__python__
# Educational examples to understand some algorithms
import random
import threading
import time
class Button(object):
def __init__(self, x, y, w, h, color, text):
self.x1 = x
self.y1 = y
self.x2 = x+w
self.y2 = y+h
self.color = c... |
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.4 Real-time Push Cloud API
## ----------------------------------... |
tab_base_classes.py | #####################################################################
# #
# /tab_base_classes.py #
# #
# Copyright 2013, Monash University ... |
test_pvc_creation_deletion_performance.py | """
Test to verify PVC deletion performance
"""
import time
import logging
import datetime
import pytest
import ocs_ci.ocs.exceptions as ex
import threading
import statistics
from concurrent.futures import ThreadPoolExecutor
from uuid import uuid4
from ocs_ci.framework.testlib import performance
from ocs_ci.ocs.perfte... |
parallel_launcher.py | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import logging
from dataclasses import dataclass
from pathlib import Path
from typing import List, Optional, Sequence
from omegaconf import DictConfig, open_dict
from hydra.core.config_loader import ConfigLoader
from hydra.core.config_store import... |
screens.py | import asyncio
from weakref import ref
from decimal import Decimal
import re
import threading
import traceback, sys
from typing import TYPE_CHECKING, List
from kivy.app import App
from kivy.cache import Cache
from kivy.clock import Clock
from kivy.compat import string_types
from kivy.properties import (ObjectProperty,... |
image_test.py | import contextlib
import json
import shutil
import socket
import tarfile
import tempfile
import threading
import pytest
import six
from six.moves import BaseHTTPServer
from six.moves import socketserver
import docker
from .. import helpers
BUSYBOX = helpers.BUSYBOX
class ListImagesTest(helpers.BaseTestCase):
... |
alien.py | #!/usr/bin/env python3
"""Executable/module for interaction with GRID services of ALICE experiment"""
import sys
if sys.version_info[0] != 3 or sys.version_info[1] < 6:
print("This packages requires a minimum of Python version 3.6", file=sys.stderr, flush = True)
sys.exit(1)
import os
import atexit
import re
... |
fps.py | # -*- coding: utf-8 -*-
'''
@author: look
@copyright: 1999-2020 Alibaba.com. All rights reserved.
@license: Apache Software License 2.0
@contact: 390125133@qq.com
'''
'''FPS监控器
'''
import queue
import datetime
import time
import re
import threading
import os,sys
import copy
import csv
import traceback
... |
clientserver.py | # -*- coding: utf-8 -*-
"""
pyzco.clientserver
~~~~~~~~~~~~~~~~~~
Implements Client and Server agents.
:copyright: 2013 by Hernan E. Grecco, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import inspect
import threading
import traceback
from c... |
mic.py | # Copyright 2017 Mycroft AI 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 writin... |
wait_for_tests.py | #pylint: disable=import-error
from six.moves import queue
import os, time, threading, socket, signal, shutil, glob
#pylint: disable=import-error
from distutils.spawn import find_executable
import logging
import xml.etree.ElementTree as xmlet
import CIME.utils
from CIME.utils import expect, Timeout, run_cmd_no_fail, sa... |
snakejazz.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the
# SnakeJazz Project (https://github.com/mchalela/SnakeJazz/).
# Copyright (c) 2020, Martin Chalela
# License: MIT
# Full Text: https://github.com/mchalela/SnakeJazz/blob/master/LICENSE
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
listener_server.py | # Copyright 2020 PerfKitBenchmarker 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 appli... |
test_bz2.py | from test import support
from test.support import bigmemtest, _4G
import unittest
from io import BytesIO, DEFAULT_BUFFER_SIZE
import os
import pickle
import glob
import random
import shutil
import subprocess
import sys
from test.support import unlink
import _compression
try:
import threading
except ImportError:
... |
logging.py | """Cyberjunky's 3Commas bot helpers."""
import json
import logging
import os
import queue
import threading
import time
from logging.handlers import TimedRotatingFileHandler as _TimedRotatingFileHandler
import apprise
class NotificationHandler:
"""Notification class."""
def __init__(self, program, enabled=Fa... |
udp.py | #!/usr/bin/env https://github.com/Tandelajr/mr.tandela
# MIT License
#
# Copyright (C) 2020, Entynetproject. All Rights Reserved.
#
# 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 re... |
analyzer.py | #
# Licensed to Dagda under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Dagda licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in comp... |
padding_fifo_queue_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... |
webserver.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "I'm alive"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start() |
task_manager.py | """
TaskLauncher is the core module of the system,
which actually executes the tasks
"""
import re
import time
from concurrent.futures import Future
from enum import Enum, auto
from threading import Thread
from traceback import print_exc
from typing import Union, Dict, Optional, Type, List, Any, cast
import dill
from ... |
Control_Frameworks_NOT_working.py | '''
May 2017
@author: Burkhard A. Meier
'''
#==================================================================
import tkinter as tk
from tkinter import ttk
from tkinter import scrolledtext
from threading import Thread
win = tk.Tk()
win.title("Python GUI")
aLabel = ttk.Label(win, text="A Label")
aLabel.grid... |
o4server.py | #!/usr/bin/env python3
import sys
import os
import time
import logging
import contextlib
from multiprocessing import Pool, Manager
from subprocess import check_output, CalledProcessError
import json
from flask import Flask, request, send_file, redirect, abort, make_response
from flask.logging import default_handler
i... |
access_token.py | import urllib.request
import time
import json
import threading
class AccssToken():
def __init__(self):
self.appId = 'wxff3cfebbdcbcd135'
self.appScrect = 'b9774614f15c56e6e42884ff84ee5168'
self.__accessToken = ''
self.__time = 0
def get_accessToken(self):
return self.__accessToken
def __... |
FAI.py | import random
import copy
from tkinter import *
import tkinter.messagebox
import tkinter.font as tkFont
import threading
import time
import requests
import json
from base_logger import getLogger
# ●○•
# 算法部分
class FAI:
def __init__(self, w: int, h: int, P1='●○•'):
self.CODE_P1 = '●'
self.CODE_P2 =... |
common_neighbor_preprocess.py | import argparse
import networkx as nx
from multiprocessing import Process, Manager, cpu_count
import time
import os
def parse_args():
"Preprocessing for the commoneighbor"
parser = argparse.ArgumentParser(description='Preprocessing Commoneigbors')
parser.add_argument('--input', nargs='?', de... |
helpers.py | import multiprocessing
import sys
import time
from typing import List, Optional
def sleep(sleepTime: float):
time.sleep(sleepTime)
def sleepWithExitCode(sleepTime: float, sysExitCode: int):
sleep(sleepTime)
if sysExitCode:
sys.exit(sysExitCode)
def sleepWithRetCode(sleepTime: float, returnCod... |
test_html.py | from functools import partial
from importlib import reload
from io import BytesIO, StringIO
import os
from pathlib import Path
import re
import threading
from urllib.error import URLError
import numpy as np
import pytest
from pandas.compat import is_platform_windows
from pandas.errors import ParserError
import pandas... |
do-partition-stop.py | #! /usr/bin/env python2
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2013. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
#
import khmer
import sys
import threading
import Queue
impo... |
train_ug_pretrain.py | import tensorflow as tf
import numpy as np
import time
import datetime
import os
import network_pretrain as network_pre#pretraining for random division.
import json
from sklearn.metrics import average_precision_score
import sys
import ctypes
import threading
from kg_dataset_transe import KnowledgeGraph
export_path = "... |
broker.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 ag... |
support.py | import sys
import signal
import os
import asyncio
import unittest
import time
from contextlib import contextmanager
import functools
from collections import namedtuple
from http.client import HTTPConnection
from io import StringIO
import http.server
import socketserver
import pytest
from queue import Empty
from unittes... |
test_threading_GIL.py | import os
import threading
import time
import random
from collections import namedtuple
def cpu_task():
i = 60000000
for _ in range(i):
1+1
def sleep_task():
time.sleep(1)
def func_time(callable):
init = time.time()
callable()
end = time.time()
print(end - init)
if 0:
def p_entry1():
i = 10000000
def... |
hp4195a_reader.py | import sys
import os
import threading
import logging.config
import hp4195a as hp
import multi_logging as ml
from multiprocessing import Queue, freeze_support
from main_window import MainWindow
from PyQt5 import QtWidgets
if __name__ == '__main__':
freeze_support()
command_queue = Queue()
message_queue =... |
release.py | import sys
import datetime
import time
from threading import Thread
from vk_api.bot_longpoll import VkBotEventType
from vk_api.utils import get_random_id
from vk_api.keyboard import VkKeyboard
from core.utils import BaseStarter, LoginManagerMixin, APIBackendMixin, KeyboardMixin, FileDB, BotLogger
class VkBot(BaseSt... |
fcnet.py | """TensorFlow implementation of fully connected networks.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import warnings
import time
import numpy as np
import tensorflow as tf
import threading
import collections
import deepchem as dc
from deepchem.nn ... |
local_elastic_agent_test.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import multiprocessing
import os
import time
import unittest
import uuid
from unittest.moc... |
main.py | # pylint: disable=locally-disabled, missing-docstring, import-error, wildcard-import, broad-except
from secrets import token_hex
import json
import threading
import multiprocessing
import uwsgi
from lib.utilities import *
def _browser_request(options, test_data):
"""Execute a browser_request test if all requirem... |
vpp_papi.py | #!/usr/bin/env python
#
# Copyright (c) 2016 Cisco and/or 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... |
FaceTracker.py | from threading import Thread
import cv2
import mediapipe as mp
import time
import math
import numpy as np
mp_face_mesh = mp.solutions.face_mesh
#USER MUST UPDATE THE FOLLOWING
camhfov = 80 #camera horizontal field of view, DEGREES
camvfov = 39 #camera vertical field of view
camxres = 1280 #camera x resolu... |
hseq_eval.py | #!/usr/bin/env python3
"""
Copyright 2017, Zixin Luo, HKUST.
Inference script.
"""
import os
from queue import Queue
from threading import Thread
import math
import yaml
import cv2
import numpy as np
import tensorflow as tf
from models import get_model
from utils.hseq_utils import HSeqUtils
from utils.evaluator i... |
test_application.py | # GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... |
test_fuse.py | import os
import signal
import time
from multiprocessing import Process
import pytest
try:
pytest.importorskip("fuse") # noqa: E402
except OSError:
# can succeed in importing fuse, but fail to load so
pytest.importorskip("nonexistent") # noqa: E402
from fsspec.fuse import run
from fsspec.implementation... |
browser.py | # Released under the MIT License. See LICENSE for details.
#
"""UI for browsing available co-op levels/games/etc."""
# FIXME: Break this up.
# pylint: disable=too-many-lines
from __future__ import annotations
import copy
from typing import TYPE_CHECKING
import _ba
import ba
from bastd.ui.store.button import StoreBut... |
keepalive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "Your bot is alive!"
def run():
app.run(host="0.0.0.0", port=8080)
def keep_alive():
server = Thread(target=run)
server.start() |
simple_sample.py | import argparse
import logging
import multiprocessing as mp
import os
import time
from socket_logging import Server, ServerHandler, register_handler
MAX_BYTES = 100000
BATCH_SIZE = 2000
LOG_FILE = "data/log/socket.log"
TEST_ROUND = 500
WORKER_NUM = 5
def worker(text):
client_logger = logging.getLogger("client_l... |
WBGetValues.py | #
# Kill a 6.1 WebBrick
#
#
import httplib, threading
adrs = "10.100.100.100"
uri = "/values.inc"
def doConn(i):
print "Starting WebBrick Connection %d" % i
conn = httplib.HTTPConnection(adrs)
print "Sending try"
conn.request("GET",uri)
res = conn.getresponse(... |
load-data.py | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
# This script is used to load the proper datasets for the specified workloads. It loads
# all data via Hive except for parquet data which needs to be loaded via Impala.
# Most ddl commands are executed by Impala.
import collections
import ... |
map_reduce.py | r"""
Parallel computations using RecursivelyEnumeratedSet and Map-Reduce
There is an efficient way to distribute computations on a set
`S` of objects defined by :func:`RecursivelyEnumeratedSet`
(see :mod:`sage.sets.recursively_enumerated_set` for more details)
over which one would like to perform the following kind of... |
test_idle.py | #!/usr/bin/env python
#
# test_idle.py -
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
import gc
import time
import threading
import random
import importlib
import pytest
from unittest import mock
import fsl.utils.idle as idle
from fsl.utils.platform import platform as fslplatform
def _run_with_wx(func, *a... |
test_case_api_service.py | """TcEx Service Common Module"""
# standard library
import http.server
import json
import os
import socketserver
import sys
import time
from threading import Event, Thread
from typing import Optional
from urllib.parse import parse_qs, urlparse
from uuid import uuid4
# third-party
from requests.auth import HTTPBasicAut... |
pyspintest.py | from simple_pyspin import Camera
import time
from PIL import Image
import os
from multiprocessing import Process
def image_capture(duration):
num_frames = int(duration * 50)
with Camera() as cam:
# If this is a color camera, request the data in RGB format.
if 'Bayer' in cam.PixelF... |
firmware_update.py | # -*- coding: utf-8 -*-
#
# Copyright 2017-2021 AVSystem <avsystem@avsystem.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
scan.py | #!/usr/bin/env python3
#import curses #for console interface...soon
from socket import *
import time
import os
import multiprocessing
import subprocess
import csv
from datetime import datetime
def check_history():
try:
with open('session.csv','rb') as f:
reader=csv.reader(f)
except:
... |
addHugeRange_single_vs_multi.py | import threading
import time
def add(r):
global result
res = 0
for i in r:
res += i
result += res
threadName = threading.current_thread().name
#################################################
# Sequential Processing:
#################################################
t = time.time()
result = 0
worker(... |
Component.py | """
Home-Monitor:
AI system for the detection of anomalous and possibly harmful events for people.
Written by Gabriel Rojas - 2019
Copyright (c) 2019 G0 S.A.S.
See LICENSE file for details
Class information:
Class to represent any extensible component
"""
import sys
from os.path import normpath
f... |
build_image_data.py | # Copyright 2016 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... |
eftepede_service.py | #! /usr/bin/python
import sys
import win32serviceutil
import win32service
import win32event
import threading
import os
import eftepede_server
import traceback
import _winreg
class eftepedeService(win32serviceutil.ServiceFramework):
_svc_name_ = "eftepede"
_svc_display_name_ = "eftepede! FTP Server"
d... |
__init__.py | #Copyright (c) 2020 Jan Kiefer
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES... |
test_decimal.py | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for the Decim... |
dask_io_loop.py | import distributed
from tornado.ioloop import IOLoop
from threading import Thread
from distributed import Scheduler, Worker, Executor
import logging
import atexit
distributed.core.logging.propagate = False
__ioloop__ = IOLoop()
class DaskLoop():
def __init__(self):
self.loop = __ioloop__
self.t = Thread(t... |
download_vggface_dataset.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import os
import threading
import socket
import urllib.request
timeout = 1
socket.setdefaulttimeout(timeout)
save_path = '/media/taotao/2T/vgg_face_dataset/'
def download_and_save(url, savename):
try:
data = urllib.request.urlopen(url).read()
... |
async_dqn.py | #!/usr/bin/env python
import os
os.environ["KERAS_BACKEND"] = "tensorflow"
from skimage.transform import resize
from skimage.color import rgb2gray
from atari_environment import AtariEnvironment
import threading
import tensorflow as tf
import sys
import random
import numpy as np
import time
import gym
from keras import... |
work_pdf_strategy.py | from urllib.request import urlopen
from work_strategies.work_base_strategy import WorkerBaseStrategy
from pdf2image import convert_from_path, convert_from_bytes
from presidio_image_redactor import ImageRedactorEngine
from threading import Lock,Thread, Semaphore
from PIL import Image, ImageChops
from presidio_image_reda... |
plot_realtime_power.py | #!/usr/bin/env python
import Monsoon.LVPM as LVPM
import Monsoon.HVPM as HVPM
from Monsoon import sampleEngine
import argparse
import csv
import os
import matplotlib
matplotlib.use('TKAgg')
from matplotlib import pyplot as plt
import matplotlib.animation as animation
import threading
import collections
import signal
i... |
cc_cn.py | #!/usr/bin/python3
#Coded by L330n123
#########################################
# I removed the mixed proxies flood #
# because in my perspective, it doesn't #
# give more performance when flooding. #
# -- L330n123 #
#########################################
'''
I'm working on Aoyama's up... |
allreduce.py | """
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import os
from hops import devices, tensorboard, hdfs
from hops.experiment_impl.util import ex... |
test_fs.py | # Test fs.FS compatibility
import contextlib
import multiprocessing as mp
import os
import tempfile
import pytest
from moto import mock_s3
from parameterized import parameterized
from pfio.testing import ZipForTest, randstring
from pfio.v2 import S3, Local, Zip, from_url, lazify, open_url
@contextlib.contextmanager... |
test_worker.py | # -*- encoding: 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 ... |
sphinx_.py | """Interface with Sphinx."""
import datetime
import importlib
import logging
import multiprocessing
import os
from pathlib import Path
import sys
from sphinx import locale
from sphinx.cmd.build import build_main
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.config import Config as SphinxConfig
fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.