source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_action.py | """
Tests for L{eliot._action}.
"""
from __future__ import unicode_literals
from unittest import TestCase
from threading import Thread
from warnings import catch_warnings, simplefilter
import six
if six.PY3:
unicode = six.text_type
from hypothesis import assume, given, settings, HealthCheck
from hypothesis.stra... |
tx_recv_interactive.py | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... |
process.py | #!/usr/bin/env python
__author__ = 'Adam R. Smith, Michael Meisinger, Dave Foster <dfoster@asascience.com>'
from pyon.util.log import log
from pyon.core.thread import PyonThreadManager, PyonThread, ThreadManager, PyonThreadTraceback, PyonHeartbeatError
from pyon.ion.service import BaseService
from gevent.event import... |
build_remote.py | #!/usr/bin/env python3
import argparse
import datetime
import glob
import re
import subprocess
import sys
import time
from multiprocessing import Pool, Process, Manager
from os.path import join, realpath, dirname, basename, exists
CERTBOT_DIR = dirname(dirname(dirname(realpath(__file__))))
PLUGINS = [basename(path) fo... |
streaming.py | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
import logging
import httplib
from socket import timeout
from threading import Thread
from time import sleep
from tweepy.models import Status
from tweepy.api import API
from tweepy.error import TweepError
from tweepy.utils import import_simpl... |
saph.py | # old ass script in my repos i dug up
import os
import sys
import threading
import socket
import time as t
import colorama
from colorama import init
from colorama import Fore
import datetime
from datetime import datetime
from queue import Queue
from optparse import OptionParser
import time, socket, logging,url... |
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... |
dcp_tests.py | from dcp_base import DCPBase
from dcp_new.constants import *
from dcp_bin_client import *
from mc_bin_client import MemcachedClient as McdClient
from memcached.helper.data_helper import MemcachedClientHelper
import unittest
from memcacheConstants import *
from threading import Thread
from remote.remote_util import Remo... |
DispatchManager.py | # -todo 61 (module-dispatch) +0: CNC manual control
# -todo 68 (module-dispatch) +0: queue control
# -todo 165 (feature, dispatch) +1: device settings definition
from threading import *
from .DispatchEngine import *
from .Engines import *
'''
Accumulated Event, triggered by internal accumulator reaching threshold... |
epubcheck.py | # -*- coding: utf-8 -*-
# epubcheck GUI
import wx
import os
import threading
import subprocess
__program__ = 'epubcheck'
class FileDropTarget(wx.FileDropTarget):
def __init__(self, obj):
wx.FileDropTarget.__init__(self)
self.obj = obj
def OnDropFiles(self, x, y, filenames):
... |
pyscanner2.py | # This script runs on Python 3
import socket, threading
def TCP_connect(ip, port_number, delay, output):
TCPsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
TCPsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
TCPsock.settimeout(delay)
try:
TCPsock.connect((ip, port_number))
... |
client.py | '''
Created on 2015年7月12日
@author: sunshyran
'''
import threading
import time
from rpc.json.client.Client import Client
from rpc.json.message.Request import Request
class HelloProxy(object):
def __init__(self):
super().__init__()
def bindClient(self, client):
... |
GUI.py | import subprocess
import threading
import wx
import wx.media
import Config
from wx import Button
from wx import TextCtrl
from Downloader import Downloader
class GUI(wx.Frame):
ID_MAID = 1
ID_RUN = 2
ID_UPDATE = 3
ID_HEAP = 4
ID_COMBO = 5
ID_MUTE = 6
ID_USERNAME = 7
def __init__(self,... |
Meta.py | import functools
import threading
from wrapt import decorator
def reconcile_meta(*classes):
metaclass = tuple(set(type(cls) for cls in classes))
metaclass = metaclass[0] if len(metaclass) == 1 \
else type("_".join(mcls.__name__ for mcls in metaclass), metaclass, {})
return metaclass("_".join(cls.... |
oldModsWebserver.py | #!/usr/bin/python
"""
__version__ = "$Revision: 1.2 $"
__date__ = "$Date: 2005/09/18 03:59:22 $"
"""
import wx
from PythonCard import configuration, model
import os, sys
import shutil
from BaseHTTPServer import HTTPServer
import CGIHTTPServer
from CGIHTTPServer import CGIHTTPRequestHandler
import threading
import Q... |
installwizard.py |
import os
import sys
import threading
import traceback
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from electroncash import Wallet, WalletStorage
from electroncash.util import UserCancelled, InvalidPassword
from electroncash.base_wizard import BaseWizard
from electroncash.i18n ... |
fleetspeak_client.py | #!/usr/bin/env python
# Lint as: python3
"""Fleetspeak-facing client related functionality.
This module contains glue code necessary for Fleetspeak and the GRR client
to work together.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
imp... |
servers.py | # -*- coding: utf-8 -*-
'''Various small TCP/IP server programs
- echo (7/TCP)
- daytime (13/UDP)
- login (513/TCP)
- http (80/TCP)
'''
import threading
import time
import os, select, pty
import logging
import datetime
import http.server
import tcp, udp
from common import *
log = logging.getLogger(__name__)
cl... |
backupUtilities.py | import os,sys
sys.path.append('/usr/local/CyberCP')
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
try:
django.setup()
except:
pass
import pexpect
from plogical import CyberCPLogFileWriter as logging
import subprocess
import shlex
from shutil import make_archive,rmtree
from pl... |
buffering.py | import multiprocessing as mp
import queue
import threading
def buffered_gen_mp(source_gen, buffer_size=2):
"""
Generator that runs a slow source generator in a separate process.
buffer_size: the maximal number of items to pre-generate (length of the buffer)
"""
if buffer_size < 2:
raise Ru... |
y_dl.py | from __future__ import unicode_literals
import random
import os
from multiprocessing import Process
#import youtube_dl
import yt_dlp
import json
import subprocess as sp
from header.logger import *
SAVE_DIR = '/tmp/discordbot/music/'
proxy_ip_list = ['']
proxy_ip = proxy_ip_list[0]
class MyLogger(object):
def deb... |
test_content.py | from __future__ import print_function
import os
import re
import sys
import json
import time
import argparse
import threading
import subprocess
import traceback
from time import sleep
from datetime import datetime
from distutils.version import LooseVersion
import urllib3
import requests
import demisto_client.demisto_a... |
adb.py | # Copyright 2019 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
ContextManagers.py | import builtins
import os
import platform
import signal
import sys
import threading
from contextlib import closing, contextmanager
from io import StringIO
from coala_utils.MutableValue import MutableValue
from coala_utils.FileUtils import create_tempfile
@contextmanager
def subprocess_timeout(sub_process, seconds, k... |
web_control.py | #!/usr/bin/env python
# coding:utf-8
import os, sys
current_path = os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
python_path = os.path.abspath( os.path.join(current_path, os.pardir, 'python27', '1.0'))
noarch_lib = os.path.abspath( os.path.join(python_path, 'lib', 'noarch'))
sys.pa... |
run_engine.py | import asyncio
from datetime import datetime
import sys
from warnings import warn
from inspect import Parameter, Signature
from itertools import count
from collections import deque, defaultdict, ChainMap
from enum import Enum
import functools
import inspect
from contextlib import ExitStack
import threading
import weakr... |
irrad_server.py | import zmq
import sys
import time
import multiprocessing
import threading
import logging
from zmq.log import handlers
from irrad_control.devices.adc.ADS1256_definitions import *
from irrad_control.devices.adc.ADS1256_drates import ads1256_drates
from irrad_control.devices.adc.pipyadc import ADS1256
from irrad_control.d... |
SentenceTransformer.py | import json
import logging
import os
import shutil
from collections import OrderedDict
from typing import List, Dict, Tuple, Iterable, Type, Union, Callable
from zipfile import ZipFile
import requests
import numpy as np
from numpy import ndarray
import transformers
import torch
from torch import nn, Tensor, device
from... |
fbaModelServicesServer.py | #!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, ParseError, InvalidRequestError
f... |
morse_BCI.py | import UnicornPy
import numpy as np
from scipy import signal
from joblib import load
from biosppy import storage
from biosppy.signals.eeg import eeg
from biosppy.signals.eeg import get_power_features
import threading
import tkinter as tk
import time
import os
import math
import soundfile as sf
import pyaudio
impor... |
Printer.py | from tkinter import *
from tkinter.messagebox import *
from tkinter.font import Font
from tkinter.scrolledtext import *
import tkinter.filedialog
from PIL import Image
import requests
import time
from array import array
import threading
import qrcode
import pygame
printerURL = 'http://192.168.1.109'
fontttf = "defaul... |
test_ufuncs.py | from __future__ import print_function
import functools
import itertools
import re
import sys
import warnings
import threading
import numpy as np
import numba.unittest_support as unittest
from numba import types, typing, utils, typeof, numpy_support, njit
from numba.compiler import compile_isolated, Flags, DEFAULT_FL... |
runningthread.py | from threading import Thread
import time
import uwsgi
def mess():
while True:
for i in xrange(0, 100):
if uwsgi.ready():
uwsgi.signal(17)
print(i)
time.sleep(0.1)
t = Thread(target=mess)
t.daemon = True
t.start()
print("thread started")
|
updates.py | import logging
import time
import traceback
from threading import Thread
from typing import Dict, Set, List, Tuple, Iterable, Optional
from pkg_resources import parse_version
from bauh.api.abstract.controller import UpgradeRequirements, UpgradeRequirement
from bauh.api.abstract.handler import ProcessWatcher
from bauh... |
xcvrd.py | #!/usr/bin/env python2
"""
xcvrd
Transceiver information update daemon for SONiC
"""
try:
import ast
import copy
import functools
import json
import multiprocessing
import os
import signal
import sys
import threading
import time
import datetime
import subprocess... |
clusterScaler.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... |
bilibili_video_download-GUI.py | # !/usr/bin/python
# -*- coding:utf-8 -*-
# time: 2019/07/02--08:12
__author__ = 'Henry'
'''
项目: B站视频下载 - GUI版本
版本1: 加密API版,不需要加入cookie,直接即可下载1080p视频
20190422 - 增加多P视频单独下载其中一集的功能
20190702 - 增加视频多线程下载 速度大幅提升
20190711 - 增加GUI版本,可视化界面,操作更加友好
'''
import requests, time, hashlib, urllib.request, re, json
import imageio
im... |
servers.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
import functools
import os
import subprocess
import sys
import threading
import ti... |
backend.py | # *************************************************************************
#
# Copyright (c) 2021 Andrei Gramakov. All rights reserved.
#
# This file is licensed under the terms of the MIT license.
# For a copy, see: https://opensource.org/licenses/MIT
#
# site: https://agramakov.me
# e-mail: mail@agramakov.me
#... |
openstack.py | import json
import os
from threading import Thread
from cinderclient import client as cinderclient
from glanceclient import Client as GlanceClient
from heatclient import client as heatclient
from keystoneauth1 import session, \
exceptions as keystoneauth1_exceptions
from keystoneauth1.identity import v3, v2
from n... |
trigger_sample.py | # coding=utf-8
import threading
import api_server
import utilities
import progress_data
server_thread = None
def start_server_threaded():
global server_thread
server_thread = threading.Thread(target=api_server.start_server, daemon=True)
server_thread.start()
def stop_server_threaded():
global serv... |
thread.py | import cv2, threading, queue
class ThreadingClass:
# initiate threading class
def __init__(self, name):
self.cap = cv2.VideoCapture(name)
# define uma fila vazia e thread
self.q = queue.Queue()
t = threading.Thread(target=self._reader)
t.daemon = True
t.start()
# leia os frames assim que... |
vkpagemanager.py | # -*- coding: utf-8 -*-
# ---------------
# VK Page Manager - script for automatic parsing news sites and rss. parsed news uploading
# into vkontakte public page using api in vk library
# Using kivy and kivymd for GUI like material design(android)
# NOTE for each site individual block of code(parsing unique html patt... |
test__transaction.py | ##############################################################################
#
# Copyright (c) 2001, 2002, 2005 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution... |
test_eventprocessor.py | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import pyte... |
simulator.py | #!/usr/bin/env python3
import os
import sys
import time
import json
import pickle
from multiprocessing import Process
from zipfile import ZipFile
import numpy as np
import pandas as pd
import pandasql as psql
#import matplotlib.pyplot as plt
import apollo.trees as trees
import apollo.utils as utils
import sklearn a... |
test_itertools.py | import unittest
from test import support
from itertools import *
import weakref
from decimal import Decimal
from fractions import Fraction
import operator
import random
import copy
import pickle
from functools import reduce
import sys
import struct
import threading
import gc
maxsize = support.MAX_Py_ssize_t
minsize = ... |
media_pipe.py | import argparse
import asyncio
import json
import logging
import os
import ssl
import uuid
import time
import cv2
from aiohttp import web
import av
import queue
from collections import deque
import threading
import itertools
from typing import Generic, List, Optional, Union
import traceback
import sys
import numpy as n... |
probe.py | import time
import Queue
import random
import socket
import struct
import logging
import threading
from convert import *
from protocol import ethernet, ip, tcp, udp
ETH_P_IP = 0x0800 # IP protocol
ETH_P_ALL = 0x0003 # Every packet
NSCRIPT_PATH = 'nscript' # NSCRIPT PATH
PAYLOAD = {
53:('\x5d\x0d\x01\x00\x00\x01\x00... |
udp.py | #!/usr/bin/env python3
#MIT License
#
#Copyright (c) 2021 Sloobot
#
#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, m... |
test_py_reader_using_executor.py | # Copyright (c) 2018 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... |
send_email.py | from exercise import get_datetime
from get_words import get_lines
from flask import Flask, request
from flask_mail import Mail, Message
from threading import Thread
app = Flask(__name__)
app.config['MAIL_DEBUG'] = True # 开启debug,便于调试看信息
app.config['MAIL_SUPPRESS_SEND'] = False # 发送邮件,为True则不发送
app.co... |
testTreeViewerInterface.py | import director
import os
import subprocess
import json
import threading
import time
import math
import sys
import numpy as np
import lcm
import robotlocomotion as lcmrl
def comms_msg(timestamp, data):
msg = lcmrl.viewer2_comms_t()
msg.format = "treeviewer_json"
msg.format_version_major = 1
msg.format... |
__init__.py | import sys
import os
import optparse
import glob
from cuddlefish import packaging
from cuddlefish.bunch import Bunch
MOZRUNNER_BIN_NOT_FOUND = 'Mozrunner could not locate your binary'
MOZRUNNER_BIN_NOT_FOUND_HELP = """
I can't find the application binary in any of its default locations
on your system. Please specify ... |
cli.py | import logging
import threading
import time
import os
from ripple import (logger, RippleAgent, RippleProcessor,
RippleRunner, RippleConfig)
def get_rules():
"""
Load the rules for this agent.
"""
# threading.Timer(10.0, get_rules).start()
while True:
RippleConfig().load... |
test_concurrency.py | import re
import time
import pytest
import subprocess
from multiprocessing import Process
from server import run_server
@pytest.fixture
def redis_server():
p = Process(target=run_server, args=["redis"])
p.start()
yield
p.terminate()
time.sleep(2)
@pytest.fixture
def memcached_server():
p =... |
tasks.py | from django.utils import timezone
from django.db import transaction
from .models import Contest, ContestParticipant
from account.models import User
from problem.tasks import judge_submission_on_problem
from submission.models import SubmissionStatus, Submission
from .statistics import invalidate_contest, invalidate_cont... |
http.py | #!/usr/bin/python
# (c) 2018 Jim Hawkins. MIT licensed, see https://opensource.org/licenses/MIT
# Part of Blender Driver, see https://github.com/sjjhsjjh/blender-driver
"""Blender Driver Application with various RESTful classes and interfaces.
This module is intended for use within Blender Driver and can only be used ... |
master.py | # -*- coding: utf-8 -*-
'''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
import os
import re
import time
import errno
import signal
import shutil
import stat
import logging
import ha... |
vec_env.py | from abc import ABC, abstractmethod
from multiprocessing import Process, Pipe
from baselines import logger
from utils import tile_images
class AlreadySteppingError(Exception):
"""
Raised when an asynchronous step is running while
step_async() is called again.
"""
def __init__(self):
... |
resources.py | from datetime import datetime, timedelta
import time
import random
import subprocess
import os
import os.path
import time
from collections import defaultdict
import json
import logging
import numbers
import yaml
from django.db import models
from django.contrib.auth.models import AbstractUser
import pexpect, getpass
i... |
test_threadable.py | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, pickle
try:
import threading
except ImportError:
threading = None
from twisted.trial import unittest
from twisted.python import threadable
from twisted.internet import defer, reactor
class TestObject:
synchroni... |
ioloop_test.py | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import contextlib
import datetime
import functools
import logging
import socket
import sys
import threading
import time
from tornado import gen
from tornado.ioloop import IOLoop, PollIOLoop, TimeoutError
from torna... |
TkThreading.py | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import threading
import time
import Queue
import Tkinter
QUEUE = Queue.Queue()
TIMEOUT = 2
BLOCKING = (TIMEOUT is not None)
USE_STDIO = False
RUNNING = True
def read_keyboard():
time.sleep(1)
gl... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test coinracd shutdown."""
from test_framework.test_framework import BitcoinTestFramework
from test_framewo... |
run.py | # encoding: UTF-8
"""
无人值守运行服务
"""
from __future__ import print_function
from time import sleep
from datetime import datetime, time
from multiprocessing import Process
import path
from webServer import run as runWebServer
from tradingServer import main as runTradingServer
from vnpy.trader.vtEngine import LogEngine
... |
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 transformers import BertTokenizer
from transformers import AutoConfig, AutoTokenizer, AutoModel
import distributed
from models import... |
sendalerts.py | import time
from threading import Thread
from django.core.management.base import BaseCommand
from django.utils import timezone
from hc.api.models import Check
def notify(check_id, stdout):
check = Check.objects.get(id=check_id)
tmpl = "Sending alert, status=%s, code=%s\n"
stdout.write(tmpl % (check.statu... |
test_all_services.py | import requests
import threading
import time
from random import randint, choice
from .random_dict import dict_creator
local_ip ="::1"
service_domain = "http://localhost/api/"
rate_limit_bucket_time=61
def test_post_single_request_without_body():
response = requests.post(service_domain,)
assert response.sta... |
render.py | import off_loader as ol
import moderngl
import numpy as np
from pyrr import Matrix44
from PIL import Image
dodecahedron_polar_pos = [[0.7853981633974483, 0.6154797086703874],
[0.7853981633974483, -0.6154797086703874],
[-0.7853981633974483, 0.6154797086703874],
... |
md5check.py | import hashlib
import sys
import os
import zipfile
import getopt
import getpass
from tkinter import filedialog
from collections import namedtuple
from datetime import datetime
from threading import Thread
MAXIMUM_BLOCKSIZE_TO_READ = 65535
p_reset = "\x08"*8
class md5check:
def do_md5(self, file, ... |
server.py | from flask import Flask, json # 1.0.2
from flask import request
from flask import jsonify
import os
import datetime
from colorama import init # 0.4.1
from colorama import Fore
from nltk import data
from wikipedia.wikipedia import summary
from gfqg import Document
from services.text_crawler import Crawler
from service... |
log.py | """ Common wrappers and helper functions to simplify most common use cases of
builtin 'logging' module.
1. Create logger and (optionally) set it as a default `dlpt` logger.
Note:
'Default' logger means that (once initialized), any `dlpt` log
functions, such as :func:`info()` and :func:`warning(... |
multiprocessing.py | from __future__ import absolute_import
from __future__ import print_function
import multiprocessing
import threading
import warnings
import time
import os
import signal
from six.moves import range
from six.moves import zip
_slave = False
_rank = None
_size = None
_pipe = None
_recv_lock = None
_recv_buffer = []
_pri... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
ui_bridge.py | """Bridge for connecting a UI instance to nvim."""
import sys
import os
from threading import Semaphore, Thread
from traceback import format_exc
from inspect import signature
class UIBridge(object):
"""UIBridge class. Connects a Nvim instance to a UI class."""
def connect(self, nvim, ui, profile=None, notif... |
local_job_service.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... |
startup.py | """should be added to Environmental Variable PYTHONSTARTUP so it runs at beginning of every python console"""
from __future__ import print_function
import os, socket, struct, json, sys
import threading
from time import sleep
from difflib import SequenceMatcher
import hashlib
import pyotp
UDP = 0
TCP = 1
MCAST = 2
de... |
DataNode.py | from rpyc import Service
import rpyc
from rpyc.utils.server import ThreadedServer
from rpyc import BgServingThread
from rpyc.utils.helpers import classpartial
import os
import random
import configparser
import uuid
import pandas as pd
from threading import Thread
import time
import logging
NAMENODE_HOST = '192.168.43.... |
02_preprocess_multiprocessing.py | __author__ = 'rahmat, haqiqi'
# 16 December 2016 6:44 PM
"""
Script untuk preproses data.
Script ini melakukan :
- word tokenization
- stopwords removal
- stemming
- pencocokan hasil praproses diatas dengan isi kateglo
- jika ada di kateglo dan kata benda/kata sifat, maka dimasukkan ke tabel "terms"
Catatan: script i... |
plugin_event_multiplexer.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... |
ex1_lock.py | import multiprocessing
import os
import lockfile
# python -m timeit -s "import ex1_lock" "ex1_lock.run_workers()"
# 400ms
MAX_COUNT_PER_PROCESS = 1000
FILENAME = "count.txt"
def work(filename, max_count):
lock = lockfile.FileLock(filename)
for n in range(max_count):
lock.acquire()
f = open(f... |
ARAX_query.py | #!/bin/env python3
import sys
def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs)
import os
import json
import ast
import re
import time
from datetime import datetime
import subprocess
import traceback
from collections import Counter
import numpy as np
import threading
from response import Response
f... |
test_concurrent_transaction.py | from nose.plugins.attrib import attr
from test.integration.base import DBTIntegrationTest
import threading
class BaseTestConcurrentTransaction(DBTIntegrationTest):
def reset(self):
self.query_state = {
'view_model': 'wait',
'model_1': 'wait',
}
@property
def schema... |
test_logger_runner.py | #!/usr/bin/env python3
import logging
import os
import sys
import tempfile
import threading
import time
import unittest
import warnings
from os.path import dirname, realpath; sys.path.append(dirname(dirname(realpath(__file__))))
from logger.readers.text_file_reader import TextFileReader
from logger.writers.text_file... |
player_plain.py | import os
import psutil
import subprocess
import threading
import sys
from threading import Timer
import select
from player_abstract import AbstractPlayer
class PlainPlayer(AbstractPlayer):
def __init__(self, socket_file, working_dir, local_dir=None,
player_key="", player_mem_limit=256, player_c... |
start.py | #!/usr/bin/python3
import os
import glob
import shutil
import multiprocessing
import logging as log
import sys
from podop import run_server
from socrate import system, conf
log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING"))
def start_podop():
os.setuid(100)
url = "http://" + ... |
pg_lib.py | import io
import psycopg2
from psycopg2 import sql
from psycopg2.extras import RealDictCursor
import sys
import json
import datetime
import decimal
import time
import os
import binascii
from distutils.sysconfig import get_python_lib
import multiprocessing as mp
import datetime
import pandas as pd
import pdb
import ins... |
cli.py | import sys
import os, json
import click
import logging
import re
import wget
import tarfile
import gdal
import requests
import h5py
from threading import Thread
from glob import glob
from sqlalchemy import create_engine
from sqlalchemy.exc import IntegrityError
from plio.io.io_gdal import GeoDataset
from datetime im... |
iterators.py | """Various helpful iterators"""
from queue import Empty, Queue
from threading import Thread
class IteratorWithAggregation:
"""
An iterable over an iterable which also makes an aggregate of the values available asap
It iterates over the iterable in a separate thread.
A use case is a generator which ... |
cache_test.py | from queue import Queue
import random
import socket
import threading
import unittest
from coapclient import HelperClient
from coapforwardproxy import CoAPForwardProxy
from coapserver import CoAPServer
from coapthon import defines
from coapthon.messages.option import Option
from coapthon.messages.request import Request
... |
client_2.py | from socket import *
from threading import Thread
import tkinter, sys, time
import RSA
def recevoir():
#Reçoit les messages.
message_list.insert(tkinter.END, "Bonjour! %s" % NOM)
message_list.insert(tkinter.END, " Vous êtes en ligne!")
while True:
try:
message = CLIENT.recv(BUFFER_S... |
test_flask.py | import threading
from flask import Flask
from flask_discord_interactions import DiscordInteractions, ResponseType, InteractionType, Response
def test_flask():
app = Flask(__name__)
app.config["DONT_VALIDATE_SIGNATURE"] = True
app.config["DONT_REGISTER_WITH_DISCORD"] = True
discord = DiscordInteract... |
admin_finder.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# This is a part of CMSeeK, check the LICENSE file for more information
# Copyright (c) 2018 Tuhinshubhra
import threading
import cmseekdb.basic as cmseek
joom_admin_found = 0
joom_admins = []
def check_admin(url,file,ua):
global joom_admin_found, joom_admins
file_c... |
controller.py | #!/usr/bin/env python
import xmlrpclib
from SimpleXMLRPCServer import SimpleXMLRPCServer
import threading
from ryu.controller.handler import set_ev_cls
from ryu.controller.handler import CONFIG_DISPATCHER
from ryu.controller import ofp_event
from policy import DefaultPolicy, StaticPolicy, AdaptivePolicy
from bwmon i... |
client1.py | import socket
import threading
encoding = "UTF-8"
user_name = "user1"
def get_message():
try:
while True:
message = sock.recv(1024).decode(encoding)
print(message)
except ConnectionResetError:
pass
def send_message():
try:
while True:
message ... |
__init__.py | # Copyright 2012 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation
import __builtin__
_dummy_gettext = lambda value: value
_dummy_ngettext = lambda v1, v2, count: (co... |
FedMinutes.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from bs4 import BeautifulSoup
from urllib.request import urlopen
import re
import pandas as pd
import pickle
import threading
import sys
class MonetaryPolicyCommittee (object):
'''
This class firstly extracts the meeting dates of each pr... |
msg_dispatcher_base.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import threading
import logging
from multiprocessing.dummy import Pool as ThreadPool
from queue import Queue, Empty
import json_tricks
from .common import multi_thread_enabled
from .env_vars import dispatcher_env_vars
from .utils import init_dis... |
weirdalgorithm.py | from sys import stdin
from threading import Thread
def main():
n = int(stdin.readline())
# print(n & 1)
while n != 1:
print(n, end=" ")
if n & 1 == 1:
n = n * 3 + 1
else:
n = n // 2
print("1", end=" ")
Thread(target=main).start()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.