source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
__init__.py | from __future__ import annotations
import collections
from datetime import datetime
from decimal import Decimal
from functools import wraps
import operator
import os
import re
import string
from typing import (
TYPE_CHECKING,
Callable,
ContextManager,
Counter,
Iterable,
)
import warnings
import nu... |
test.py | #!/usr/bin/env python
#
# Copyright 2008 the V8 project authors. 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 copyright
# noti... |
window.py | # window.py
#
# Copyright 2021 Muhammad Rivan
#
# 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, pub... |
rdd.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 us... |
sync_thread.py | # Copyright 2017 Wind River
#
# 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, so... |
test_generator_mt19937.py | import sys
import pytest
import numpy as np
from numpy.linalg import LinAlgError
from numpy.testing import (
assert_, assert_raises, assert_equal, assert_allclose,
assert_warns, assert_no_warnings, assert_array_equal,
assert_array_almost_equal, suppress_warnings)
from numpy.random import Generator, MT199... |
beamng_ai.py | from pathlib import Path
from threading import Thread
from typing import List
from drivebuildclient.AIExchangeService import AIExchangeService
from drivebuildclient.aiExchangeMessages_pb2 import SimulationID
def _handle_vehicle(sid: SimulationID, vid: str, requests: List[str]) -> None:
""" Since we are using Bea... |
__init__.py | """Command-line utilities for epidemic forecasting."""
import logging
import multiprocessing
import pickle
import queue
import signal
import traceback
def fails_to_pickle(item):
"""
Check whether an object can be serialised ("pickled"), as is required for
simulation arguments when running simulations in ... |
test_scheduler.py | from datetime import datetime, timedelta
import os
import signal
import time
from threading import Thread
from dateutil.tz import gettz, tzlocal
from rq import Queue
from rq.compat import as_text
from rq.job import Job
from rq_scheduler import Scheduler
from rq_scheduler.utils import to_unix, from_unix, get_next_sched... |
test_mysqlx_pooling.py | # -*- coding: utf-8 -*-
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0, as
# published by the Free Software Foundation.
#
# This program is also d... |
__init__.py | """flask-serial Package.
:author: Redfalsh <13693421942@163.com>
:license: MIT, see license file or https://opensource.org/licenses/MIT
:created on 2019-01-10 10:59:22
:last modified by: Redfalsh
:last modified time: 2019-01-10 11:00:00
:describe:
flask-serial package is used in flask website, it can receive ... |
__init__.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... |
function.py | import time
from lib.core.evaluate import ConfusionMatrix,SegmentationMetric
from lib.core.general import non_max_suppression,check_img_size,scale_coords,xyxy2xywh,xywh2xyxy,box_iou,coco80_to_coco91_class,plot_images,ap_per_class,output_to_target
from lib.utils.utils import time_synchronized
from lib.utils import plot_... |
led_poop2.py | from matrix import * # matrix.py의 모든 함수들 가져오기
import time
import random
import pygame
import pygame as pg
import sys
import LED_display as LMD
import threading
def LED_init():
thread=threading.Thread(target=LMD.main, args=())
thread.setDaemon(True)
thread.start()
return
pg.init()
scre... |
compare_num_layer_w_multiprocessing_qng.py | import qiskit
import numpy as np
import sys
import multiprocessing
sys.path.insert(1, '../')
import qtm.base, qtm.constant, qtm.nqubit, qtm.fubini_study, qtm.encoding
def run_w(num_layers, num_qubits):
thetas = np.ones(num_qubits*num_layers*5)
qc = qiskit.QuantumCircuit(num_qubits, num_qubits)
loss_values... |
SuiteVisitorImportProxy.py | #
# Copyright 2017 Nokia Solutions and Networks
# Licensed under the Apache License, Version 2.0,
# see license.txt file for details.
#
import threading
import sys
import json
import types
import inspect
import re
from robot.api import SuiteVisitor
from robot.running import TestLibrary
from robot.running.testlibrarie... |
chat.py | import re
import anyjson
import requests
import threading
from django.conf import settings
# these messages filled instead of sending
# during unittests
messages = []
_threads = []
_threads_lock = threading.Lock()
def send(text, channel=None):
# may be refactor it using notifications some day
def remote_send... |
procpollster.py |
#python standard library
from time import time, sleep
import threading
from abc import ABCMeta, abstractproperty
# third-party module
import numpy
#apetools
from basepollster import BasePollster
from apetools.parsers import oatbran
class BaseProcPollster(BasePollster):
"""
A base-class for polling proc-fil... |
plotter.py | import atexit
try:
from queue import Empty
except ImportError:
from Queue import Empty
from multiprocessing import Process, Queue
from rllab.sampler.utils import rollout
import numpy as np
__all__ = [
'init_worker',
'init_plot',
'update_plot'
]
process = None
queue = None
def _worker_start():
... |
database.py | from graph import Database
import threading
import socket
import getopt
import sys
import json
from random import randint
opts, args = getopt.getopt(sys.argv[1:], "p:i:")
PORT = int(opts[0][1]) if len(opts) > 0 else 50001
ID = opts[1][1] if len(opts) > 1 else "Au9X"
peer_port = PORT+1 if PORT-50000 ==1 else PORT-1
p... |
from_file.py | import os
import urlparse
from blogfetch import DB
from multiprocessing.dummy import Pool as ThreadPool
bfetch = DB()
def fetch(i):
domain = urlparse.urlparse(i['url']).hostname
print i['url']
bfetch.add(i['url'], i['name'])
# for i in session.query(Submission).filter(Submission.objectid > last_id, Submi... |
faceDetect.py | from threading import Thread
import time
import io, os, re
import matplotlib.image as mpimg
import numpy as np
from PIL import Image
from mtcnn.mtcnn import MTCNN
from concurrent import futures
import grpc
import grpctransport.grpcnn_pb2 as grpcnn
import grpctransport.grpcnn_pb2_grpc as grpcnnService
import tensorflow ... |
imagenet.py | from . import lmdb_datasets
from torchvision import datasets,transforms
import os
import os.path as osp
import torch.utils.data
import numpy as np
import cv2
from . import lmdb_data_pb2 as pb2
import Queue
import time
import multiprocessing
DATASET_SIZE=100
mean=np.array([[[0.485]], [[0.456]], [[0.406]]])*255
std=np.a... |
configure_and_test_integration_instances.py | from __future__ import print_function
import argparse
import ast
import json
import logging
import os
import subprocess
import sys
import uuid
import zipfile
from datetime import datetime
from distutils.version import LooseVersion
from enum import IntEnum
from pprint import pformat
from threading import Thread
from ti... |
plugin.py | import time
import threading
import time
import os
import datetime
import sys
import re
import glob
REC_HDR='H'
REC_DATA='D'
NAME="history"
class HistoryFileWriter:
def __init__(self,filename,fields,ts=None):
self.filename=filename
self.fields=fields
self.file=open(filename,"a")
if ts is None:
... |
price_generator.py | ## environment set up
# pip install yahoo_finance
# pip install awscli
# pip install boto3 --ignore-installed six
## aws sqs receive-message --queue-url https://queue.amazonaws.com/773351289708/kpmg-demo --attribute-names All --message-attribute-names All --max-number-of-messages 10
from yahoo_finance import Share
imp... |
ma.py | import pandas as pd
import numpy as np
import talib as ta
import json
import threading
import math
import os
import time
from comm_funcs import get_config
from comm_funcs import find_trade_date
from data_urls import a_detail_url
from comm_funcs import requests_get
from comm_funcs import down_symbol
from comm_funcs imp... |
solve.py | from socket import socket, AF_INET, SOCK_STREAM
from networkx import Graph, shortest_path
from time import sleep
from threading import Thread
HOST = ('52.49.91.111', 2003)
MAX_BOARD = 110
BOARD_SIZE = MAX_BOARD * 2 - 1
JUMPS = ((-2, -1), (-2, 1), (-1, -2), (-1, 2), (1, -2), (1, 2), (2, -1), (2, 1))
class Army:
def _... |
worker.py | import asyncio
import functools
import logging
import multiprocessing as mp
import uuid
from enum import Enum, auto
import re
class QSStatus(Enum):
OK = auto()
Error = auto()
class QSTask:
__slots__ = ['id', 'kw']
def __init__(self, **kw):
self.id = uuid.uuid4()
sel... |
curious_main.py | import vizdoom
import argparse
import os
os.environ["OMP_NUM_THREADS"] = "1"
import numpy as np
import torch
import torch.multiprocessing as mp
import env as grounding_env
from models import A3C_LSTM_GA
from curious_train import train
from curious_test import test
import logging
parser = argparse.ArgumentParser(desc... |
capture.py | import logging
import random
import threading
import time
import util
__author__ = 'chris'
class CaptureException(Exception):
pass
class Capture(object):
def __init__(self, label, raw=False):
self._label = label
self._raw = raw
self._log = logging.getLogger(type(self).__name__)
... |
executor.py | #!/usr/bin/env python3
from gi.repository import GLib
import subprocess
import threading
from nwg_panel.tools import check_key, update_image
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk, Gdk, GdkPixbuf
class Executor(Gtk.EventBox):
def __init__(se... |
storcrawl.py | #!/usr/bin/env python3
import configargparse
import queue
import multiprocessing
import time
import sys
import logging
import logging.handlers
import os
import psycopg2
import psycopg2.extensions
from psycopg2.extras import Json
# config parser
p = configargparse.ArgParser(default_config_files=['/etc/storcrawlrc','~/... |
demo_director.py | """
<Program Name>
demo_director_repo.py
<Purpose>
Demonstration code handling a Director repository and services.
Runs an Uptane-compliant demonstration Director.
This accepts and validates ECU and Vehicle Manifests and writes and hosts
metadata.
Use:
import demo.demo_director as dd
dd.clean_sla... |
functionprofiler.py | #!/usr/bin/env python
#
#
# TODO:
# - implement cProfile or yappi, or use threading.setProfile and sys.setProfile, or implement one's own multi-threaded profiler:
# http://code.google.com/p/yappi/
# http://code.activestate.com/recipes/465831-profiling-threads/
# http://effbot.org/librarybook/sys.htm
#
#
# CHANGELOG:
#... |
custom_flask.py | from flask import Flask
from threading import Thread
class CustomFlask(Flask):
def __init__(self, import_name, background_task):
super().__init__(import_name)
t = Thread(target=background_task)
t.start() |
runtimes.py | """Runtimes module.
This module comprises classes for executing so called `RuntimeTasks` in `Runtimes` by leveraging the power of ssh.
The `RuntimeTask` class is a container for defining a sequence of elegantly task steps. This `RuntimeTask` can then be
executed either standalone or by passing it over to a `Runtime` i... |
base.py | import os
import re
import logging
import threading
import ujson as json
from abc import ABC, abstractmethod
from datetime import datetime, timedelta
from flask_wtf import FlaskForm
from wtforms import StringField, BooleanField
from wtforms.validators import InputRequired, Optional, ValidationError
from collections i... |
base_channel.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import json
import threading
import time
from abc import ABC, abstractmethod
from queue import Empty, Queue
from .log_utils import LogType, nni_log
from .commands import CommandType
INTERVAL_SECONDS = 0.5
class BaseChannel(ABC):
def __ini... |
run_eval_chief.py | # coding=utf-8
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
tbe_process.py | # Copyright 2020 Huawei Technologies Co., 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 agreed to... |
sigfinder.py | #!/usr/bin/python3
import argparse
import json
import logging
import os
import socket
import threading
import time
import bjoern
import falcon
import jinja2
import pandas as pd
from prometheus_client import start_http_server, Counter, Gauge
import requests
import schedule
from gamutrf.sigwindows import calc_db
from ... |
build_docs.py | import glob
import os
import shutil
import sys
from pathlib import Path
from subprocess import check_output
from threading import Thread
from typing import Dict, Union, Optional, Set, List, Sequence, Mapping
from git import Git
from ruamel.yaml import YAML # type: ignore
from constants import ABS_PATH_OF_TOP_LEVEL_D... |
multiprocessing_utils.py | import multiprocessing as mp
from multiprocessing.queues import Queue
import warnings
class PicklableExceptionWrapper:
"""
Wraps an Exception object to make it picklable so that the traceback follows. Useful for multiprocessing when an exception is raised in a subprocess.
"""
def __init__(self, except... |
server_ssl_loop_multiProcess.py | # !/usr/bin/env python
# -*- coding:utf-8 _*-
# @Author: swang
# @Contact: wang00sheng@gmail.com
# @Project Name: SmartWalker-master
# @File: ssl_loop.py
# @Time: 2022/01/02/20:34
# @Software: PyCharm
import os, sys
module_dir = os.path.dirname(os.path.abspath(__file__))
project_dir = os.path.dirname(module_dir)
sys.... |
tunnel.py | """Basic ssh tunnel utilities, and convenience functions for tunneling
zeromq connections.
"""
# Copyright (C) 2010-2011 IPython Development Team
# Copyright (C) 2011- PyZMQ Developers
#
# Redistributed from IPython under the terms of the BSD License.
from __future__ import print_function
import atexit
import os
i... |
inmemory.py | import multiprocessing
from shared.utils import class_fullname
from shared.domain.bus.event import EventBus, DomainEvent
import shared.infrastructure.environment.globalvars as glob
class InMemoryEventBus(EventBus):
def _do_publish(self, domain_event: DomainEvent) -> None:
domain_event_name = class_fullna... |
blecli.py | """
Copyright (c) 2012, Robin Heydon
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 copyright notice, this list of conditions and the following disc... |
NISysServer.py | #! /usr/bin/python
# Copyright 2016 National Instruments
# This server emulates the NI Service Locator and the NI System Web Server
# Primarily the purpose of this emaulator is to publish a web service to
# reboot the target from the LabVIEW project.
import BaseHTTPServer
from SocketServer import ThreadingMixIn
impor... |
test_vnx.py | # /*******************************************************************************
# Copyright (C) 2021 Xilinx, 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://... |
utils.py | #
# Copyright (c) 2019 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# h... |
misc.py | import subprocess
from fnmatch import fnmatch
import multiprocessing
from time import sleep, time
import itertools
__copyright__ = "Copyright 2016-2018, Netflix, Inc."
__license__ = "Apache, Version 2.0"
import sys
import errno
import os
import re
from vmaf import run_process
from vmaf.tools.scanf import sscanf, Inc... |
handlers.py | # Copyright 2001-2016 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
fastcov.py | #!/usr/bin/env python3
"""
Author: Bryan Gillespie
A massively parallel gcov wrapper for generating intermediate coverage formats fast
The goal of fastcov is to generate code coverage intermediate formats as fast as possible,
even for large projects with hundreds of gcda objects. The intermediate form... |
utils.py | # coding: utf-8
import os
import asyncio
from threading import Thread
from inspect import isawaitable
import importlib
try:
from redis import StrictRedis
# MONKEYPATCH until https://github.com/andymccurdy/redis-py/pull/1007/ is merged
import redis.lock
def __locked(self):
if self.redis.get(sel... |
hook.py | # Copyright 2016: Mirantis 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 b... |
ssh.py | import paramiko
from threading import Thread
from .tools import get_key_obj
from asgiref.sync import async_to_sync
import socket
from django.conf import settings
import json
import time
import sys
import os
import traceback
from util.tool import gen_rand_char, res as save_res
from util.control import remove_control_cha... |
microtvm_api_server.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... |
1204_test.py | import cv2
import tkinter
import os, time
from PIL import Image, ImageTk
import threading
import time
class Image_Process():
def crop(self, image):
h, w, _ = image.shape
cut = int((w-h)/2)
return image[0:h, cut: int(w-cut)]
def resize(self, image, resize=(224, 224)):... |
plugin.py | import asyncio
import logging
import signal
import time
import json
from multiprocessing import Process
from multiprocessing import Queue
from gym.infra.base import Plugin
from gym.infra.containernet.environment import Environment
logger = logging.getLogger(__name__)
class Parser:
def __init__(self):
... |
stream.py | #based on the silvius microphone client, Tanel's kaldi-gstreamer-server client.py
import argparse
from ws4py.client.threadedclient import WebSocketClient
import threading
from multiprocessing import Process, Queue, Pipe
from queue import Queue as ThreadQueue
from threading import Event
import sys
import urllib.reques... |
lib.py | import mmh3
import os
from bitarray import bitarray
import math
import socket
import sys
import pickle
from threading import Thread
## method to make a bloom filter , list_param = list of things,
## size = size of filter, no_of_hashes = no of hashes
def make_filter(list_param, size, no_of_hashes):
bit_array = bit... |
attendance_pi.py | import RPi.GPIO as GPIO
import SimpleMFRC522
from RPLCD.gpio import CharLCD
from check_closing_time import check
import subprocess
#import sys
from threading import Thread
import time
import datetime
import os
import csv
global cycle
cycle = 0.0
class Primary:
#from datetime import datetime, time
GPIO.setmo... |
tpu_estimator.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... |
upload_api-v2.py | # coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, json, time, sys, thread, base64
import argparse
import unicodedata
import shutil
import subprocess
import threading
# import dlib
import math
import time
import os.path
import Queue
fr... |
_wdaproxy.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Created on Wed Feb 03 2021 10:22:15 by codeskyblue
"""
import abc
import logging
import subprocess
import sys
import threading
import time
import typing
import traceback
import logzero
import requests
from cached_property import cached_property
from . import requests... |
pickletester.py | import collections
import copyreg
import dbm
import io
import functools
import os
import pickle
import pickletools
import shutil
import struct
import sys
import threading
import unittest
import weakref
from textwrap import dedent
from http.cookies import SimpleCookie
from test import support
from test.support import (... |
graphviz_executor.py | # -*- coding: UTF-8 -*-
'''
Created on 03.11.2010
@author: SIGIESEC
'''
from base.basic_config_if import BasicConfig
from commons.graph.output_if import RenderExecutor
from commons.v26compat_util import compatrelpath
from infrastructure.graph_layout.graphviz.graphviz_config import (
GraphvizConfiguration)
from th... |
val.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Validate a trained YOLOv5 model accuracy on a custom dataset
Usage:
$ python path/to/val.py --data coco128.yaml --weights yolov5s.pt --img 640
"""
import argparse
import json
import os
import sys
from pathlib import Path
from threading import Thread
... |
test_vrf.py | import sys
import time
import threading
import Queue
import yaml
import json
import random
import logging
from collections import OrderedDict
from natsort import natsorted
from netaddr import IPNetwork
import pytest
from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # lgtm[py/unused-import]
fr... |
gap.py | r"""
Interface to GAP
Sage provides an interface to the GAP system. This system provides
extensive group theory, combinatorics, etc.
The GAP interface will only work if GAP is installed on your
computer; this should be the case, since GAP is included with Sage.
The interface offers three pieces of functionality:
#.... |
thrd.py | import threading
import time
def sleeper(n,name):
print('Hi, i am {}, going to sleep for 5 mins \n'.format(name))
time.sleep(n)
print('{} has woken up from sleep \n '.format(name))
#t = threading.Thread(target= sleeper, name = 'Thread1', args = (5, 'PyQt5'))
#t.start() Attribute error is commonly... |
test_execute.py | # pylint doesn't know about pytest fixtures
# pylint: disable=unused-argument
import os
import tempfile
from threading import Thread
import pytest
from dagster import (
CompositeSolidExecutionResult,
PipelineExecutionResult,
SolidExecutionResult,
execute_pipeline,
execute_pipeline_iterator,
se... |
otto-network-setup.py | #!/usr/bin/python
import subprocess
import bottle
from bottle import route, static_file, debug, run, get, redirect
from bottle import post, request, template, response
import os, inspect, json, time, sys
import random
from threading import Thread, RLock
#enable bottle debug
debug(True)
# WebApp route path
# get dir... |
realtime.py | """
xled.realtime
~~~~~~~~~~~~~
Functions to support the realtime mode of the device.
"""
from __future__ import absolute_import
import base64
import math
import socket
from threading import Thread
from xled.control import ControlInterface
from queue import Queue
#: realtime UDP port to send realtime frames to
POR... |
dbapi.py | #-*- coding: iso-8859-1 -*-
# pysqlite2/test/dbapi.py: tests for DB-API compliance
#
# Copyright (C) 2004-2010 Gerhard H�ring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages... |
test.py | import json
import pytest
import random
import re
import string
import threading
import time
from multiprocessing.dummy import Pool
from helpers.client import QueryRuntimeException
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import TSV
cluster = ClickHouseCluster(__file__)
node1 = cluster.a... |
test_threading.py | from threading import Thread, Barrier
import itertools
from loguru import logger
import time
class NonSafeSink:
def __init__(self, sleep_time):
self.sleep_time = sleep_time
self.written = ""
self.stopped = False
def write(self, message):
if self.stopped:
raise Runt... |
canlanlog.py | import logging
import datetime
import time
import json
import os
import threading
import queue
import can4python as can
import paho.mqtt.publish as publish
from configuration import *
from pynbp import *
can_interface=configs['canbus']
bus = can.CanBus.from_kcd_file(configs['kcd'],
can_interface,
timeout=i... |
cbs.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time,random,sys,json,codecs,threading,glob,re,ast,os,subprocess,requests
cl = LINETCR.LINE()
#cl.login(qr=True)
cl.login(token='EspnGz09iDYJi4xXMJga./6HmqgWWcAIqMZtzBAC1kG.EO1AQPTUaJrc4Ix3xSmJRnF/36XgI+G... |
mulappthreads.py | import threading
def mythread():
print("My thread")
threads=[]
for i in range(5):
t = threading.Thread(target=mythread())
threads.append(t)
t.start()
|
main.py | import logging
import multiprocessing
import sys
from apscheduler.schedulers.blocking import BlockingScheduler
from telegram.ext import CommandHandler, Filters, MessageHandler, Updater
import handlers as h
import settings
from db import connection, get_searches, init
from helpers import gen_hash
from schedulers import... |
thread4_queue.py | # View more python learning tutorial on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
import threading
import time
from queue import Queue
def job(l,q):
for i in range(len(l)):
l... |
HiwinRA605_socket_ros_20190614135256.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
custom.py | import click
import json
import os
import subprocess
from rireki.core.driver import Driver
from rireki.utils.file_helpers import file_put_contents
from threading import Thread
class Custom(Driver):
NAME = 'custom'
def __init__(self):
Driver.__init__(self)
self.command = None
self.ti... |
reduction.py | # uncompyle6 version 3.2.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)]
# Embedded file name: multiprocessing.reduction
__all__ = []
import os, sys, socket, threading, _multiprocessing
from multiprocessing import current_process
f... |
jupyterhub_config.py | # This file provides common configuration for the different ways that
# the deployment can run. Configuration specific to the different modes
# will be read from separate files at the end of this configuration
# file.
import os
import json
import string
import yaml
import threading
import time
import requests
import ... |
thiscrush.py | import requests
import threading
import random
def comment(vitt,nom,mess,proxy):
#return requests.post('http://www.thiscrush.com/postcrush.php',proxies=proxy,headers={'user-agent':'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0_1 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A402 Safa... |
db_common.py | #!/usr/bin/env python3
#
# 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
# ... |
prepro.py | #! /usr/bin/python
# -*- coding: utf-8 -*-
import copy
import math
import random
import threading
import time
import numpy as np
import PIL
import scipy
import scipy.ndimage as ndi
import skimage
from scipy import linalg
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.interpolation import map_coo... |
train.py | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... |
ebs_volume_test.py | import datetime
import sys
import os
import signal
import boto3
import sys
import subprocess as sub
import threading
import time
import re
import Queue
import process_helper as prochelp
import argparse
import random
import string
from builtins import exit
UNSUPPORTED_REGIONS =set(['ap-northeast-3', 'eu-west-3'])
clas... |
process.py | from .logging import debug, exception_log
import subprocess
import os
import threading
def start_server(server_binary_args, working_dir, env):
debug("starting " + str(server_binary_args))
si = None
if os.name == "nt":
si = subprocess.STARTUPINFO() # type: ignore
si.dwFlags |= subprocess.S... |
supervisor.py | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 18 20:57:59 2021
@author: mhamz
"""
from datetime import datetime
import socket
import threading
import random
import string
from Crypto.PublicKey import RSA
from Crypto import Random
from Crypto.Cipher import DES
from Crypto.Cipher import DES3
from Crypto... |
BotServer.py | import time
import threading
from vk_api.bot_longpoll import VkBotEventType
from vk_api.utils import get_random_id
from keyboard import keyboard_config
from PetsParsFirstPage import FirstPageParse
from FirstPageDogs import get_content_dogs, img_parse_first_page_dogs
from Cats_more_pages import MorePagesCats
from Dogs_m... |
__init__.py | from functools import update_wrapper, wraps
from multiprocessing import Process
from typing import List
import copy
# noinspection PyUnresolvedReferences
import apscheduler
from function_scheduling_distributed_framework.set_frame_config import patch_frame_config, show_frame_config
# import frame_config
from function_sc... |
rdoclient.py | """
RANDOM.ORG JSON-RPC API (Release 1) implementation.
This is a Python implementation of the RANDOM.ORG JSON-RPC API (R1).
It provides either serialized or unserialized access to both the signed
and unsigned methods of the API through the RandomOrgClient class. It
also provides a convenience class through the Random... |
data_reader.py | # coding=utf-8
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
Obstacle.py | # Obstacle
import random
import threading
PLAY_FIELD_WIDTH = 2
PLAY_FIELD_LENGTH = 2
CAM_DIST_HORI = 0.5
CAM_DIST_VERT = 1.5
class Obstacle:
def __init__(self):
self.xPosition = 0
self.yPosition = 0
self.keepMoving = False
self.speed = 0.0
self.xSpeed = 0.0
self.ySpeed = 0.0
# called by GameManag... |
main.py | ##################
## CREDITS REGARDING GUI STYLING TEMPLATE
################################################################################
##
## BY: WANDERSON M.PIMENTA
## PROJECT MADE WITH: Qt Designer and PySide2
## V: 1.0.0
##
## This project can be used freely for all uses, as long as they maintain the
## respec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.