source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_bugs.py | # -*- coding: utf-8 -*-
# Copyright (c) 2009, 2020, 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... |
pruebas.py | import threading
# global variable x
x = 0
def increment():
"""
function to increment global variable x
"""
global x
x += 1
def thread_task(lock: threading.Lock):
"""
task for thread
calls increment function 100000 times.
"""
for _ in range(100000):
# lock.acquir... |
PPO - Copy.py | import multiprocessing
import multiprocessing.connection
import time
from collections import deque
from typing import Dict, List
import cv2
import gym
import numpy as np
import torch
from torch import nn
from torch import optim
from torch.distributions import Categorical
from torch.nn import functional as F
if torch.... |
http_service.py | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Core\sims4\gsi\http_service.py
# Compiled at: 2018-07-31 23:22:52
# Size of source mod 2**32: 9525 bytes
im... |
build_localization_tfrecords.py | # coding: utf-8
# Copyright 2017 challenger.ai
#
# 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 agre... |
test_ringbuffer.py | #!/usr/bin/env python3
import ctypes
import gc
import logging
import multiprocessing
import queue
import threading
import time
import unittest
import ringbuffer
class TestException(Exception):
pass
class ReadersWriterLockTest(unittest.TestCase):
def setUp(self):
self.lock = ringbuffer.ReadersWriter... |
scanning.py | import numpy as np
import os
import serial
import time
import sys
import cv2
import cv2.cv as cv
import cPickle as pickle
def get_filename(coin_id, image_id):
dir = '/home/pkrush/cents-test/' + str(coin_id / 100) + '/'
filename = dir + str(coin_id).zfill(5) + str(image_id).zfill(2) + '.png'
return filename... |
locators.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import thread... |
test_threading_local.py | import unittest
from doctest import DocTestSuite
from test import test_support
import weakref
import gc
# Modules under test
_thread = test_support.import_module('thread')
threading = test_support.import_module('threading')
import _threading_local
class Weak(object):
pass
def target(local, weaklist):
weak =... |
Remixatron.py | """ Classes for remixing audio files.
(c) 2017 - Dave Rensin - dave@rensin.com
This module contains classes for remixing audio files. It started
as an attempt to re-create the amazing Infinite Jukebox (http://www.infinitejuke.com)
created by Paul Lamere of Echo Nest.
The InfiniteJukebox class can do it's processing i... |
ircbot.py | '''Todo:
* Add multiple thread support for async_process functions
* Potentially thread each handler function? idk
'''
import sys
import socket
import re
import threading
import logging
import time
if sys.hexversion < 0x03000000:
#Python 2
import Queue as queue
BlockingIOError = socket.error
else:
imp... |
Stats.py | import sys, csv, pysam, os
from File_Output import SiteToJSON
import json
import multiprocessing as mp
from Params import stats_params
class JSONSerializable(object):
def __repr__(self):
return json.dumps(self.__dict__, default = lambda o: o.__dict__)
class Site(JSONSerializable):
"""
Class ... |
pc_util.py | """ Utility functions for processing point clouds.
Heavily borrowed from pointnet2
Author: Charles R. Qi, Hao Su
Date: November 2016
"""
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
# Point cloud IO
import numpy as np
from plyfile import PlyData, PlyElement
imp... |
LLRPConnector.py | #!/usr/bin/env python
import six
from six.moves.queue import Queue, Empty
import socket
import datetime
import threading
from .pyllrp import *
class LLRPConnector( object ):
#--------------------------------------------------------------------------
#
# A simple LLRP reader connection manager.
#
# Supports connec... |
test_streaming_pull_manager.py | # Copyright 2018, 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 to in writing,... |
best-channel.py |
#!/usr/bin/env python
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up Scapy
from scapy.all import *
conf.verb = 0 # Scapy I thought I told you to shut up
import os
import sys
import time
from threading import Thread, Lock
from subprocess import Popen, PIPE
from signal import SIGINT... |
server_simple.py | from flask import Flask, render_template, send_file, safe_join, request,jsonify
from threading import Thread
from flask_socketio import SocketIO
import settings
app = Flask(__name__)
app.config.from_object('settings')
socketio = SocketIO(app)
@app.route('/', methods=['GET', "POST"])
def index():
return re... |
datasets.py | import glob
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from tqdm import tqdm
from utils.general import xyxy2xywh, xywh2xyxy
help_url... |
interpreterv2.py | # Trying server.start(custom_read_f-> tasks.append etc.)
import arachnoid as ara
import interpreter as inter
IP_ADDR = '192.168.1.94'
PORT_NUMBER = 1234
for arg in ara.sys.argv:
if arg.startswith('ip='):
IP_ADDR = arg[3:]
print('ip: {}'.format(IP_ADDR))
elif arg.startswith('port='):
PORT_NUMBER = ... |
inventory.py | from collections import Counter
from flask_login import current_user
from git import Repo
from io import BytesIO
from logging import info
from os import environ
from sqlalchemy import and_
from subprocess import Popen
from threading import Thread
from uuid import uuid4
from werkzeug.utils import secure_filename
from xl... |
test_state.py | import glob
import logging
import os
import shutil
import threading
import time
import pytest
from saltfactories.utils.tempfiles import temp_file
from tests.support.case import SSHCase
from tests.support.runtests import RUNTIME_VARS
SSH_SLS = "ssh_state_tests"
SSH_SLS_FILE = "/tmp/salt_test_file"
log = logging.getLo... |
__init__.py | # -*- coding: utf-8 -*-
'''
Set up the Salt integration test suite
'''
# Import Python libs
from __future__ import absolute_import, print_function
import os
import re
import sys
import copy
import time
import stat
import errno
import signal
import shutil
import pprint
import atexit
import socket
import logging
import... |
online_drain.py | #!/usr/bin/python
"""
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import time
import random
import threading
from write_host_file import write_host_file
from osa_utils import OSAUtils
from daos_utils import DaosCommand
from apricot import skipForTicket
class OSAOn... |
worker.py | from contextlib import contextmanager
import atexit
import faulthandler
import hashlib
import inspect
import io
import json
import logging
import os
import redis
import sys
import threading
import time
import traceback
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
# Ray modules
from ra... |
latex.py | """
Compiling tex files and processing bibliography (bib) files.
"""
import subprocess
import sys
import threading
import time
import latex_suite.util
class Outcome:
"""
The outcome of compiling or processing latex and related files.
"""
UNKNOWN = -1
SUCCESS = 0
FAILURE = 1
ABORTED = 2
... |
common.py | # Copyright (c) 2011 - 2017, Intel Corporation.
#
# 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 agre... |
pre_commit_linter.py | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
move_it_robot.py | """
ROSWELD
Version 0.0.1, March 2019
http://rosin-project.eu/ftp/rosweld
Copyright (c) 2019 PPM Robotics AS
This library is part of ROSWELD project,
the Focused Technical Project ROSWELD - ROS based framework
for planning, monitoring and control of multi-pass robot welding
is co-financed by the EU project ROSIN (www... |
camera.py | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 24 20:46:25 2017
Thread that gets frames from a camera
It *is* OK to use one Camera in multiple Processors
"""
## NOTE: OpenCV interface to camera controls is sketchy
## use v4l2-ctl directly for explicit control
## example for dark picture: v4l2-ctl -c exposure_auto=1 -c... |
red_test.py | #!/usr/bin/env python
import logging
from redbot.resource import HttpResource
import redbot.speak as rs
import thor
import threading
from tornado import gen
from tornado.options import parse_command_line
from tornado.testing import AsyncHTTPTestCase
from tornado.web import RequestHandler, Application, asynchronous
imp... |
test_threads.py | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
Tests the h5py.File object.
"""
import thre... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight ParkByte client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 with... |
downloader.py | #!/usr/bin/python3 -OO
# Copyright 2007-2021 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... |
multithreading_tut.py | import threading
def threadsafe_generator(f):
def g(*a, **kw):
return threadsafe_iter(f(*a, **kw))
return g
class threadsafe_iter:
def __init__(self, it):
self.it = it
self.lock = threading.Lock()
def __iter__(self):
return self
def next(self):
with self.lock:
return self.it.next()
@threadsafe_g... |
TCPServer.py | import socket
import threading
bind_ip = "0.0.0.0"
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#Passing in the IP address and port we want to listen on
server.bind((bind_ip, bind_port))
#Tell the server to start listening with a maximum backlog of 5 connections
server.listen(5)
pr... |
security.py | from threading import Thread
from mail import send_email
import datetime
import time
import cv2
class Security(Thread):
def __init__(self, video):
super().__init__()
self.video = video
self.classifier = None
self.flip = False
self.save_video = True
self.out = None... |
Threader.py | import subprocess
import multiprocessing
import time
import atexit
import os
import sys
#from __future__ import print_function
def run(fs):
print("Running Thread ID: "+repr(len(threads)+1))
print(("Total Running Threads: "+repr(threads.n_alive())))
for f in fs:
f()
print("Thread ID "+repr(len(threads)+1)... |
__init__.py | from threading import Thread
from flask import Flask
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
migrate = Migrate()
def create_app():
app = Flask(__name__)
from . import config
app.config.from_object(config)
# database init
__import__("app.mode... |
chooser.py | import argparse
try:
import Tkinter
except ImportError:
import tkinter as Tkinter
import yaml
import os
import subprocess
import re
import time
import threading
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument(
"--configpath",
type=str,
default=os.path.join(os.path.dirname(os... |
Lab_5.py | import random
import threading
from tree import AVLTree, GraphicalTree
tree = AVLTree()
random.seed(0)
arr = random.sample(range(10), 10)
for i in arr:
tree.add(i)
g_tree = GraphicalTree(tree)
def deleter():
while tree:
print("Обход слева направо:", tree.in_order())
del tree[int((input("Вве... |
client.py | # Copyright 2018 Vincent Deuschle. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanyin... |
test_comm.py | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
utils.py | """Utility functions."""
import json
import os
import threading
import datetime
from pytz import timezone
from queue import Queue
from requests_oauthlib import OAuth1Session
def merge_two_dicts(a, b):
"""Merge 2 dictionaries."""
c = a.copy()
c.update(b)
return c
class TwitterClient:
"""Client ... |
thread.py | #!/usr/bin/env python3
import urllib.request,json,pymysql,sys,datetime,time,threading
sys.path.append("/root/Python/Video_Monitor")
from model.mariadb import insert
def hqxrdb(ztaddr,ztname):
lock.acquire()
global i
url=ztaddr[i]
name=ztname[i]
ztstatus=0
i=i+1
lock.release()
try:
... |
evaluation.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pickle
from queue import Queue
import os
import sys
from threading import Thread, stack_size as set_thread_stack_size
from mathics import settings
from mathics.core.expression import ensure_context, KeyComparable
FORMATS = ['StandardForm', 'FullForm', 'Traditiona... |
bbuild.py | import sys
import os
import json
import subprocess
from queue import Queue
from threading import Thread
from threading import Lock
import locale
import traceback
#run %comspec% /k "D:\ProgramFiles\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" first!!
source_dirs=[]
bin_search_dirs=[]
root_mod... |
MonoTime.py | # Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, ... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum_ltc as electrum
from electrum_ltc.bitcoin import TYPE_ADDRESS
from electrum_ltc import WalletStorage, Wallet
from electrum_ltc_gui.kivy.i18n import _
from electrum_ltc.paymentrequest... |
replication.py | from threading import Thread
from queue import Empty
# from posix_ipc import Semaphore, ExistentialError, O_CREAT
from time import sleep
from datetime import datetime
from ujson import loads, dumps
from bson import ObjectId
# from posix_ipc import BusyError
from .database import Database
#from server_protocol import Pr... |
stellar_tidal_evolution.py | # Equations for tidal evolution of binary/planetary orbits
# From Hansen 2010, based on Eggleton et al. 1998
import threading
import numpy
import math
from scipy import integrate
from amuse.lab import *
from amuse.support import literature
#2010ApJ...723..285H
def sigma_planet():
sig_p = 3.4e-7
return 5.9e-5... |
sawppy.py | import datetime
import json
import logging
import sys
import threading
import time
if (sys.version_info > (3, 0)):
import urllib.request as urllib2
from urllib.parse import urlencode
else:
import urllib2 # pylint: disable=import-error
from urllib import urlencode
log = logging.getLogger('RemoTV.hardwa... |
pyshell.py | #! /usr/bin/env python3
import sys
if __name__ == "__main__":
sys.modules['idlelib.pyshell'] = sys.modules['__main__']
try:
from tkinter import *
except ImportError:
print("** IDLE can't import Tkinter.\n"
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
raise ... |
app.py | #############################################################################
# Copyright (c) 2018, Voilà Contributors #
# Copyright (c) 2018, QuantStack #
# #
# Distri... |
multiprocessing_daemon_join_timeout.py | #
"""Daemon vs. non-daemon processes.
"""
# end_pymotw_header
import multiprocessing
import time
import sys
def daemon():
name = multiprocessing.current_process().name
print("Starting:", name)
time.sleep(2)
print("Exiting :", name)
def non_daemon():
name = multiprocessing.current_process().name... |
sharedctypes.py | """
"Multiprocessing" section example showing how
to use sharedctypes submodule to share data
between multiple processes.
"""
from multiprocessing import Process, Value, Array
def f(n, a):
n.value = 3.1415927
for i in range(len(a)):
a[i] = -a[i]
if __name__ == "__main__":
num = Value("d", 0.0)
... |
create_test_products.py | #!/usr/bin/env python
"""
Stand-alone data generation routine that uses the ecommerce taxonomy found on
Google Base to generate a significant amount of category and product data, as
well as using the Flickr API to retrieve images for the products. The
multiprocessing module is also used for parallelization.
The Djang... |
PickleViewer.py | print("Loading Modules...")
import pickle
import os.path
import pprint
import ast
import sys
import threading
import uuid
import urllib.request
import configparser
import hashlib
import subprocess
import ctypes
import json
import time
import tkinter as tk
from tkinter import *
from tkinter import messa... |
camera.py | #!/usr/bin/env python3
import argparse
import threading
import json
import sys
import os
import calendar
from datetime import datetime, timedelta
import signal
import random
import time
import re
import requests
from requests.auth import HTTPDigestAuth
import errno
import paho.mqtt.client as mqtt
from json.decoder ... |
lruqueue3.py | """
Least-recently used (LRU) queue device
Demonstrates use of pyzmq IOLoop reactor
While this example runs in a single process, that is just to make
it easier to start and stop the example. Each thread has its own
context and conceptually acts as a separate process.
Author: Min RK <benjamin... |
net09_web_PWB7.py | """linux平台 epoll 实现web服务器 多线程"""
'''
@Time : 2018/1/24 下午4:12
@Author : scrappy_zhang
@File : net09_web_PWB7.py
'''
import socket
import select
import re
import threading
SERVER_ADDR = (HOST, PORT) = '', 8888 # 服务器地址
VERSION = 7.0 # web服务器版本号
STATIC_PATH = './static/'
class HTTPServer():
def __init__(... |
plugin.py | from binascii import hexlify, unhexlify
from electrum_lcc.util import bfh, bh2u
from electrum_lcc.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT,
is_segwit_address)
from electrum_lcc import constants
from electrum_... |
server.py | import BaseHTTPServer
import errno
import logging
import os
import re
import socket
from SocketServer import ThreadingMixIn
import ssl
import sys
import threading
import time
import traceback
import types
import urlparse
import routes as default_routes
from request import Server, Request
from response import Response
... |
pythread_per_process_scheduler.py | #ckwg +28
# Copyright 2012 by Kitware, Inc.
# 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 conditio... |
polling.py | import time
from threading import Event, Thread
from featureflags.api.client import AuthenticatedClient
from .api.default.get_all_segments import sync as retrieve_segments
from .api.default.get_feature_config import sync as retrieve_flags
from .config import Config
from .util import log
class PollingProcessor(Threa... |
test_rwlock.py | from collections import OrderedDict
import threading
import time
import unittest
import pytest
from smqtk.utils.read_write_lock import \
ContextualReadWriteLock
def wait_for_value(f, timeout):
"""
Wait a specified timeout period of time (seconds) for the given
function to execute successfully.
... |
__init__.py | """Rhasspy command-line interface"""
import argparse
import asyncio
import io
import json
import logging
# Configure logging
import logging.config
import os
import sys
import threading
import time
import wave
from typing import Any
from rhasspy.audio_recorder import AudioData
from rhasspy.core import RhasspyCore
from ... |
predict.py | #
# Copyright (c) 2018, Salesforce, Inc.
# The Board of Trustees of the Leland Stanford Junior University
# 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 ... |
resource_monitor.py | import logging
import os
import warnings
from time import time
from threading import Thread, Event
import psutil
from pathlib2 import Path
from typing import Text
from ..binding.frameworks.tensorflow_bind import IsTensorboardInit
try:
from .gpu import gpustat
except ImportError:
gpustat = None
class Resourc... |
duo.py | # 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, software
# distributed under the Li... |
autologin.py | #!/usr/local/bin/python3
'''
Script to automatically log in to Telstra Air network. It opens Safari web
browser, fills the login form, clicks 'log in' and closes the browser when
all is done.
Arguments
- username
- password
'''
from argparse import ArgumentParser
from subprocess import getoutput
import re
from time ... |
test_pool.py | import heapq
import psycopg2 # Trigger import error if not installed.
import threading
import time
from peewee import *
from peewee import savepoint
from peewee import transaction
from playhouse.pool import *
from playhouse.tests.base import database_initializer
from playhouse.tests.base import PeeweeTestCase
class... |
tools.py | import sys
import cmd
import csv
import threading
import code
import pprint
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty
import click
import pkg_resources
from glypy.structure.glycan_composition import HashableGlycanComposition
from glycopeptidepy.io import fasta, uni... |
cli.py | # -*- coding: utf-8 -*-
import configparser
import random
import sys
import time
from pathlib import Path
from threading import Thread
import click
import requests
from . import __version__
from .controllers import Cache, CastState, StateFileError, StateMode, get_chromecast, get_chromecasts, setup_cast
from .error i... |
Dkbot7.py | #Eww -*- coding: utf-8 -*-
import LINETCR
import requests
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
#import time,random,sys,json,codecs,threading,glob,urllib,urllib2
import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,subprocess
cl = LI... |
namespaces.py | import contextlib
import ctypes
import errno
import os
import pyroute2
import pytest
import signal
import multiprocessing
# All allowed namespace types
NAMESPACE_FLAGS = dict(mnt=0x00020000,
uts=0x04000000,
ipc=0x08000000,
user=0x10000000,
... |
wsdump.py | #!/Users/Rahul/Desktop/pollr-backend2/pollr-eb2/bin/python3
import argparse
import code
import sys
import threading
import time
import ssl
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding():
encoding = getattr(sys.st... |
fixmp4.py | #!/usr/bin/python3
"""Fix problems with improperly encoded video files.
For some reason a lot of my video files do not have proper
encoding and this results in errors during playback. This
script goes through each of the files uses ffmpeg to convert
the file to one that is wrapped appropriately.
"""
import argparse
i... |
toolbar.py | """Module for dealing with the toolbar.
"""
import math
import os
import ipyevents
import ipyleaflet
import ipywidgets as widgets
from ipyfilechooser import FileChooser
from .common import *
from .pc import *
def tool_template(m=None):
"""Generates a tool GUI template using ipywidgets.
Args:
m (leafm... |
arrowhead_test.py | #!/usr/bin/env python3
import rospy
import threading
from arm_control.srv import *
def get_keyboard_input():
while(True):
inp = input("type something ")
if inp == "follow":
pass
elif inp == "forward":
pass
elif inp == "left":
pass
elif i... |
tests.py | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import absolute_import, unicode_literals
import datetime
from decimal import Decimal
import threading
from django.conf import settings
from django.core.management.color import no_style
from django.db import (connection, connec... |
simulation_1.py | '''
Created on Oct 12, 2016
@author: mwittie
'''
import network_1 as network
import link_1 as link
import threading
from time import sleep
##configuration parameters
router_queue_size = 0 #0 means unlimited
simulation_time = 2 #give the network sufficient time to transfer all packets before quitting#slower but works ... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import_wikidata.py | """
Import an wikidata file into KGTK file
TODO: references
TODO: qualifiers-order
TODO: incorporate calendar into the KGTK data model.
TODO: Incorporate geographic precision into the KGTK data model.
TODO: Incorporate URLs into the KGTK data model.
TODO: Node type needs to be optional in the edge file.
See:
htt... |
execution.py | """
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
This file is part of the Smart Developer Hub Project:
http://www.smartdeveloperhub.org
Center for Open Middleware
http://www.centeropenmiddleware.com/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=... |
dynamixel_serial_proxy.py | # -*- coding: utf-8 -*-
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2010-2011, Antons Rebguns.
# 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... |
train_abstractive.py | #!/usr/bin/env python
"""
Main training workflow
"""
from __future__ import division
import argparse
import glob
import os
import random
import signal
import time
import torch
from pytorch_transformers import BertTokenizer
import distributed
from models import data_loader, model_builder
from models.data_loader i... |
main_backup.py | from flask import Flask, render_template, request, Response, send_from_directory, redirect, url_for, jsonify
from flask_sslify import SSLify
import os
from PIL import Image
import json
import base64
import cv2
import numpy as np
#from src import classifier
import web_face_recognition
import time
import subprocess as sp... |
degrunk-data.py | from code import compile_command
import re
from sys import maxsize
from binance.client import Client
import time
import csv
import os
import fire
import random
import queue
client1 = Client('igEARWI7LNtjhzHa3zrNAMtLlLtUjnNb3VFHSHCf5Nlnga4h3vAzthAQKe8wLYlC', 'BM8EVK6TI5kHKQ7sORXpkwHet8mtq8alhOV5JJQ25kAIunKL7YkGgfc80inJa... |
main.py | """
Manual Captcha Harvester
Made by @CrepChef
"""
from utils import Logger
from flask import Flask, request, jsonify, render_template, redirect
import logging
import threading
from datetime import datetime
from time import sleep
import webbrowser
import json
tokens = []
logger = Logger()
de... |
test.py | import csv
import os
import subprocess
import threading
# Gather the packages to test.
PREFIX = './packages/node_modules/'
# CISCOSPARK = os.path.join(PREFIX, '@ciscospark')
WEBEX = os.path.join(PREFIX, '@webex')
PROD_ENV_VARS = {
# 'ACL_SERVICE_URL': 'https://acl-a.wbx2.com/acl/api/v1', ?
'ATLAS_SERVICE_URL': '... |
job_scheduling.py | # This file handles all jobs and job scheduling
# Each job has:
# * scheduler to set its rate
# * the job function itself
import logging
import time
import datetime
import threading
import schedule
import my_globals
import webcam
import remote_comm
#from remote_comm import register # importing this way to avoid ... |
latch.py | """
Used for stressing Latch.get/put. Swap the number of producer/consumer threads
below to try both -- there are many conditions in the Latch code that require
testing of both.
"""
import logging
import random
import threading
import time
import mitogen.core
import mitogen.utils
mitogen.utils.log_to_file()
mitogen.c... |
kill_thread.py | import ctypes
import inspect
import threading
import time
__all__ = ["stop_thread"]
def _async_raise(tid, exctype):
"""raises the exception, performs cleanup if needed"""
tid = ctypes.c_long(tid)
if not inspect.isclass(exctype):
exctype = type(exctype)
res = ctypes.pythonapi.PyThreadState_Set... |
rate_limited_sender.py | #-------------------------------------------------------------------------------
# rate_limited_sender.py
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# MIT License
#
# Copyright (c) 2021 homelith
#
# P... |
locators.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
import json
import logging
import os
import posixpath
import re
from io import BytesIO
try:
import threading
except Imp... |
test_bucket.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import sys
import time
import threading
from nose.tools import assert_equals
from ...backends.bucket import BucketBackend
from ...messages import OutgoingMessage
from ...router import Router
def test_bucket_swallows_messages():
router = Router()
router.add... |
meshConvertP.py | import os
from multiprocessing import Process
def f(name):
if os.path.isdir(name) and name != "blank_foamcase":
oldDir = os.getcwd()
os.system('cd ~/OpenFOAM/tjc2017-7/run')
os.chdir(oldDir)
os.chdir(name)
os.system('gmshToFoam busemann.msh')
os.chdir(o... |
websocket_transport.py | # Copyright (C) 2018 DataArt
#
# 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, ... |
run_trt.py | import tensorrt as trt
import numpy as np
import pycuda.driver as cuda
import pycuda.autoinit
import common
import os
import cv2
from PIL import Image
import time
from threading import Thread
TRT_LOGGER = trt.Logger(trt.Logger.VERBOSE)
def preprocess(img, input_resolution):
image = cv2.resize(img[..., ::-1],... |
client.py | # SPDX-FileCopyrightText: 2021 Carnegie Mellon University
#
# SPDX-License-Identifier: Apache-2.0
import glob
import os
import signal
import sys
import threading
import time
import uuid
import yaml
from core.result_manager import ResultManager
from logzero import logger
class CvatClient(object):
def __init__(se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.