source
stringlengths
3
86
python
stringlengths
75
1.04M
neural_gpu_trainer.py
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
setMaxScore.py
import os import json import signal import threading from time import sleep from chromote import Chromote COMMAND = "'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' --remote-debugging-port=9222" thread = threading.Thread(target=os.system, args=(COMMAND,)) thread.start() sleep(3) chrome = Chromote() t...
loader.py
from typing import Any, Callable, Iterable, Union from itertools import tee import queue import sys import threading import numpy as np import torch from torch.utils.data import DataLoader class ILoaderWrapper: """Loader wrapper interface. Args: loader: torch dataloader. """ def __init__(s...
run.py
from flask import Flask from threading import Thread from os import system app = Flask('') @app.route('/') def home(): return "I'm alive" def run(): app.run(host='0.0.0.0',port=8080) Thread(target=run).start() cmd=input("[#]Insert command to run your script") system("clear") system(cmd)
test_util.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...
test_lock.py
import uuid import threading from nose.tools import eq_, ok_ from kazoo.exceptions import CancelledError from kazoo.exceptions import LockTimeout from kazoo.testing import KazooTestCase from kazoo.tests.util import wait class KazooLockTests(KazooTestCase): def setUp(self): super(KazooLockTests, self).se...
backend.py
__author__ = 'utku@hoydaa.com (Utku Utkan)' import jinja2 import logging import m3u8 import os import shutil import subprocess import tempfile import threading import webapp2 import cloudstorage as gcs from decimal import Decimal from lxml import etree from subprocess import Popen from subprocess import PIPE from ur...
scheduler.py
import time import threading def scheduler(fn, interval_sec, min_wait_sec=0): while True: start_time = time.time() t = threading.Thread(target=fn) t.start() t.join() wait_sec = max( interval_sec - (time.time() - start_time), min_wait_sec ) ...
a3c.py
#model-free,不需对环境状态进行任何预测,也不考虑行动将如何影响环境,直接对策略或Action的期望价值进行预测,计算效率非常高。 #因为复杂环境中难以使用model预测接下来的环境状态,所以传统的DRL都是基于model-free。 import gym import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.distributions import Categorical import torch.multiprocessing as mp import time ...
lm_openai_gpt3.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """IncrementalLanguageModel which uses OpenAI's GPT-3 API.""" import ast import asyncio import collections import dataclasses import datetime import functools import os import sys import threading import time from dataclasses import dataclass fr...
camera.py
# coding: utf-8 import os import sys from threading import Thread from PIL import Image from .eventcheckerbase import EventCheckerBase sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../util')) from webcam import avail_cameras, capture, write_webcam_config class Camera(EventCheckerBase): def __init__...
Run.py
#!/usr/bin/python import string import random import threading from pynput import keyboard from Socket import openSocket, sendMessage from Initalize import joinRoom from Read import getUser, getMessage from Settings import NEWS, CHANNEL, MODS from TwitchIntergration import uptime, live schedule = ["Roger", ...
Chef.py
# coding: utf-8 import time import logging import threading import queue as Queue import random from Node import node #Para importar a class, em vez do module logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', date...
osr_basic.py
#!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Basic tests of OGRSpatialReference (OSR) operation, not including # support for actual reprojection or use of EPSG tables. # Author...
test_threaded_restapi.py
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
solariot.py
#!/usr/bin/env python # Copyright (c) 2017 Dennis Mellican # # 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, modi...
tasks.py
import os import sys import datetime import zipfile import threading import hashlib import shutil import subprocess import pprint from invoke import task import boto3 import platform import ai2thor.build S3_BUCKET = "ai2-thor" PRIVATE_S3_BUCKET = "ai2-thor-private" UNITY_VERSION = "2018.4.16f1" def add_files(zipf, ...
main.py
import argparse import sched import time import threading from datetime import datetime, timedelta import os from CraigslistTracker import CraigslistTracker # TODO: make sure empty lists don't mess up sending emails class Controller(): scheduler = sched.scheduler(time.time, time.sleep) def __init__(self, fla...
rfc2217.py
#! python # # This module implements a RFC2217 compatible client. RF2217 descibes a # protocol to access serial ports over TCP/IP and allows setting the baud rate, # modem control lines etc. # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C) 2001-2015 Chris Liechti <cliechti@gmx.net> # # SPDX...
bandwidth.py
import logging import socket import sqlite3 import struct import sys import csv from ctypes import create_string_buffer from threading import Thread import zmq from zmq.error import ZMQError import time #from nanomsg import PAIR, Socket, create_message_buffer #from nanomsg.wrapper import nn_recv, nn_send from scapy.uti...
h1.py
''' 创建三个函数,非别的功能是, 求得斐波那契数列的第n项, 求n的阶乘,求n的前n项和 请比较三个函数单线程分别调用,和三个函数多线程并发的效率(相差多长时间) 假定n的值是15 ''' from time import * import threading def fib_re(n): if n < 1: print("Wrong input! ") return -1 else: if(n == 1 or n == 2): return 1 else: return fib_re(n-1) +...
clock.py
# # Clock technology. # # Author: Joeri Hermans # import sys import socket import struct import datetime from datetime import date import time import re from threading import Thread # Global members, which are required for the communication # with the remote IAS controller. gDeviceIdentifier = sys.ar...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
pyttsx_server.py
#! /usr/bin/env python import pyttsx import threading import time import actionlib from chapter19.msg import TalkAction, TalkResult import rospy class TalkNode(): def __init__(self, node_name, action_name): rospy.init_node(node_name) self.server = actionlib.SimpleActionServer(action_name, TalkAc...
fast-reptile-script-YEAR2019.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Author: Shuyue Jia @Date: Arg 10, 2020 """ # Import necessary packages import os import ssl import json import time import requests import numpy as np import pandas as pd from urllib import request from bs4 import BeautifulSoup from random import randint import urlli...
scheduler.py
""" Copyright 2018, Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE file in project root for terms. This module implements classes that can be used by any Plugin Scheduler to setup a Celery App and Celery Beat """ import signal import sys import threading from yahoo_panoptes.framework import...
serialization.py
# Copyright 2020-2021 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 agre...
zeromq.py
# -*- coding: utf-8 -*- ''' Zeromq transport classes ''' # Import Python Libs from __future__ import absolute_import import os import sys import copy import errno import signal import hashlib import logging import weakref from random import randint # Import Salt Libs import salt.auth import salt.crypt import salt.uti...
cluster_monitor_3_test.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 app...
propagation_application_wx_old.py
# -*- coding: utf-8 -*- """ Created on Sun Jun 28 20:23:07 2015 @author: Philipp """ from propagation_cuda import Propagator import propagation_cuda import tum_jet import wavefront_util import wavefront_format import wx from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotl...
main.py
import threading import typer from skidless.cleaning import clean_adult_dataset from skidless.datasets import download_adult_dataset from skidless.evaluate import evaluate_model from skidless.features import train_preprocessors_and_featurize_train_adult_dataset from skidless.generators import start_producing from ski...
gcsio.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...
tests.py
import os import re import tempfile import threading import unittest from pathlib import Path from sqlite3 import dbapi2 from unittest import mock from django.core.exceptions import ImproperlyConfigured from django.db import NotSupportedError, connection, transaction from django.db.models import Aggregate, Avg, CharFi...
main.py
#!/usr/bin/env python3 version = "GTM.1.0.3" #region ASCII ART # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # _ _ _ __ _ _ # # | | | | (_) / / ...
joystick.py
#!/usr/bin/env python import time import RPi.GPIO as GPIO from multiprocessing import Process class Joystick: CHANNEL_X = 1 CHANNEL_Y = 0 # + button channel AVG = 256 * 2 MIN = 256 MAX = 256 * 3 THRESHOLD_BUTTON = 256 * 4 THRESHOLD = 150 IDLE = 0 LEFT = 1 RIGHT = 2 TOP...
test_report_writer.py
# -*- coding: utf-8 -*- ''' Created on Nov 1, 2016 @author: nicolas ''' import os.path as osp import time import pytest import six import lemoncheesecake.api as lcc from lemoncheesecake.matching import * from helpers.runner import run_suite_class, run_suite_classes, run_func_in_test from helpers.report import as...
worker.py
from contextlib import contextmanager import colorama 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, Dict, List, Iterator # Ray modules from ray.autoscaler._priv...
httpclient_test.py
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement import base64 import binascii from contextlib import closing import functools import sys import threading from io import BytesIO from tornado.escape import utf8 from tornado.httpclient import HTTPRequest, HTTPRespo...
test_streaming.py
#!/usr/bin/python # -*- coding: utf-8 -*- import subprocess import commands import shlex import time import threading #2019/07/10作成.カメラをブラウザでストリーミングできるようにするテスト #カメラ画像はhttp://ラズパイのIP/stream.htmlで見れる(fingを使え) #bonjour使ってたらhttp://raspberrypi.local:8080/stream.htmlで見れる class stream(): def __init__(self): self.camera_fla...
base_camera.py
import time import threading try: from greenlet import getcurrent as get_ident except ImportError: try: from thread import get_ident except ImportError: from _thread import get_ident class CameraEvent(object): """An Event-like class that signals all active clients when a new frame is ...
driver_util.py
"""Scripts for drivers of Galaxy functional tests.""" import http.client import logging import os import random import re import shlex import shutil import signal import string import subprocess import sys import tempfile import threading import time from urllib.parse import urlparse import nose.config import nose.co...
OAuth2Util.py
#!/usr/bin/env python from __future__ import print_function import logging import praw import os import re import time import webbrowser import __main__ as main from threading import Thread try: # Python 3.x import configparser from http.server import HTTPServer, BaseHTTPRequestHandler from urllib.parse import url...
tree-height.py
# python3 import sys, threading sys.setrecursionlimit(10**7) # max depth of recursion threading.stack_size(2**27) # new thread will get stack of such size class TreeHeight: def __init__(self): self.n=0 self.parent=[] self.memoize=[] def read(self): ...
pjit_test.py
# 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 to in writing, ...
health_check_service.py
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
reactor.py
import asyncore import errno import io import logging import os import select import socket import ssl import sys import threading import time from collections import deque from functools import total_ordering from heapq import heappush, heappop from hazelcast.config import SSLProtocol from hazelcast.connection impor...
test_tune_restore.py
# coding: utf-8 import signal from collections import Counter import os import shutil import tempfile import time import unittest import skopt import numpy as np from hyperopt import hp from nevergrad.optimization import optimizerlib from zoopt import ValueType from hebo.design_space.design_space import DesignSpace as...
server.py
from six.moves import BaseHTTPServer import errno import os import socket from six.moves.socketserver import ThreadingMixIn import ssl import sys import threading import time import traceback from six import binary_type, text_type import uuid from collections import OrderedDict from six.moves.queue import Queue from ...
bot.py
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2017-2019 TwitchIO 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...
_binder.py
import threading import time import ptvsd.daemon from tests.helpers import socket from tests.helpers.threading import acquire_with_timeout class PTVSD(ptvsd.daemon.Daemon): """A wrapper around a running "instance" of PTVSD. "client" and "server" are the two ends of socket that PTVSD uses to communicate ...
slack-tray.py
#!/usr/bin/env python2 import sys import os import time import re import socket from slackclient import SlackClient from pprint import pprint import json from collections import defaultdict import itertools from threading import Thread import gtk import gobject import yaml from collections import defaultdict import tr...
gextension.py
import socket import threading from enum import Enum from .hpacket import HPacket from .hmessage import HMessage, Direction import json class INCOMING_MESSAGES(Enum): ON_DOUBLE_CLICK = 1 INFO_REQUEST = 2 PACKET_INTERCEPT = 3 FLAGS_CHECK = 4 CONNECTION_START = 5 CONNECTION_END = 6 PACKET_TO...
run-p4-sample.py
#!/usr/bin/env python2 # Copyright 2013-present Barefoot Networks, 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 b...
meterpreter.py
#!/usr/bin/python # vim: tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab import binascii import code import os import platform import random import re import select import socket import struct import subprocess import sys import threading import time import traceback try: import ctypes except ImportError: has_windl...
sdk_worker.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...
training.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...
index.py
import os import json import glob import requests from threading import Thread, RLock import logging import datetime import time import re from .constants import JKT_TZ __all__ = ['ShowroomIndex'] index_logger = logging.getLogger('showroom.index') _filename_re = re.compile( r''' (?:\d{6}\ Showroom\ -\ )? ...
test_tune_restore.py
# coding: utf-8 import signal from collections import Counter import multiprocessing import os import shutil import tempfile import threading import time from typing import List import unittest import ray from ray import tune from ray._private.test_utils import recursive_fnmatch from ray.rllib import _register_all fro...
jgi_gatewayServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
interface_rpc.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Vadercoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" import os from test_framework.authproxy import J...
netsvc.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # The refactoring about the OpenSSL support come from Tryton # ...
context.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...
pi-lcd.py
#!/usr/bin/python # -*- coding: utf-8 -*- import ConfigParser import re import subprocess import threading import time import traceback import Adafruit_CharLCD as LCD # Globals npages = 4 # Number of different info pages page = 0 # Current info page enable_display ...
data_utils.py
"""Utilities for file download and caching.""" from __future__ import absolute_import from __future__ import print_function import hashlib import multiprocessing import os import random import shutil import sys import tarfile import threading import time import traceback import zipfile from abc import abstractmethod f...
cli.py
import threading import time from pathlib import Path import mimetypes from rich.progress import BarColumn, Progress, TimeRemainingColumn from rich.prompt import Prompt from rich.console import Console import json from . import dupesearch console = Console() REFRESH_DURATION = 0.2 def get_formats_by_mimetype(tar...
voice.py
import asyncio import concurrent.futures import threading import traceback from random import shuffle import json import discord import youtube_dl from discord.ext import commands class Song: def __init__(self, player, message, args=None, loop=False): self.player = player if player: ...
client.py
import socket import threading import m_format class Client: def __init__(self): self.client_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.write_thread = threading.Thread(target=self.__write_th) self.read_thread = threading.Thread(target=self.__read_th) self.id ...
test_grpc_gateway_runtime.py
import asyncio import copy import json import multiprocessing import time from multiprocessing import Process import pytest from jina import Document, DocumentArray from jina.clients.request import request_generator from jina.helper import random_port from jina.parsers import set_gateway_parser from jina.serve import...
commands.py
import random from time import sleep from proto.spaceteam_pb2 import SpaceteamPacket from threading import Thread POINT_INCREMENT = 15 POINT_DECREMENT = -10 TOGGLE = 0 NUMERIC = 1 CHOICE = 2 BINARY = 3 NO_COMMAND = 4 class types: NO_COMMAND = "NO_COMMAND" CALCIUM_RAZOR = 0 SALTY_CANNISTER = 1 WAVEFORM_COLLI...
download_cl1024_images.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import tkinter as tk from tkinter import messagebox from tkinter.filedialog import askdirectory, askopenfilename import threading, time, re, os, requests, math from PIL import Image, ImageStat def thread_run(func): def wraper(*args, **kwargs): t = threading....
event_processor.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mimicry.py
""" Helpers to mimic processes """ from typing import Optional import os import subprocess import sys import threading import time import tempfile import contextlib import signal import platform import setproctitle import pytest skipif_unsuported = pytest.mark.skipif( platform.system() != "Linux", reason="Cannot...
bbid.py
#!/usr/bin/env python3 import argparse import hashlib import imghdr import os import pickle import posixpath import re import signal import socket import threading import time import urllib.parse import urllib.request def download(url, output_dir): if url in tried_urls: return pool_sema.acquire() ...
data_utils.py
# Lint as python3 # 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 r...
test_browser.py
# coding=utf-8 from __future__ import print_function import argparse import json import multiprocessing import os import random import re import shlex import shutil import subprocess import time import unittest import webbrowser import zlib from runner import BrowserCore, path_from_root, has_browser, get_browser from...
logger_handler.py
# Software License Agreement (BSD License) # # Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko # 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 mus...
tello_state.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import threading import time import rospy from std_msgs.msg import String from cv_bridge import CvBridge, CvBridgeError from sensor_msgs.msg import Image # if you can not find cv2 in your python, you can try this. usually happen when you use conda. imp...
test_fft.py
import functools import numpy as np import pytest import cupy from cupy.fft import config from cupy.fft._fft import (_default_fft_func, _fft, _fftn, _size_last_transform_axis) from cupy import testing from cupy.testing.helper import _wraps_partial def nd_planning_states(states=[True, Fals...
StateMapper.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Apr 21 16:44:47 2020 @author: David Chong Tian Wei """ import math import numpy as np import pandas as pd from atpbar import register_reporter, find_reporter, atpbar from ventiliser.FlowStates import FlowStates as fs from ventiliser.PressureStates impor...
SerialWriterThread.py
""" Copyright (C) 2018 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 agreed to in writing, softw...
misc_utils.py
import os import json import time import zlib import datetime import shutil try: from urllib.request import urlopen, Request from urllib.error import HTTPError from urllib.parse import urlencode from http.client import IncompleteRead except ImportError: from urllib import urlencode from urllib2 ...
FlasherBase.py
""" Copyright 2016 ARM Limited 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 di...
wtimegui.py
#!/usr/bin/env python3 # # wtimegui - Working time class with GUI # import sys import time try: from Tkinter import * import ttk import tkMessageBox from threading import * except ModuleNotFoundError: from tkinter import * from tkinter import ttk from threading import * from tkinter impo...
server.py
import socket from threading import Thread utf = "utf-8" clients = [] def clients_in(): while True: try: conn.setblocking(True) clientsocket,address = conn.accept() conn.setblocking(False) if clientsocket not in clients: clients.append((cli...
main.py
try: import pygame import random import math import string import re import psutil import sys import os import getpass import openpyxl import threading except ImportError as Error: print(f"There was an error whilst importing 1 or more modules."+"\n"+f"Error: ...
main.py
import threading from queue import Queue from spider import Spider from domain import * from demo import * PROJECT_NAME ='thesite' HOMEPAGE = 'https://lavasa.christuniversity.in/' DOMAIN_NAME = get_domain_name(HOMEPAGE) QUEUE_FILE = PROJECT_NAME + '/queue.txt' CRAWLED_FILE = PROJECT_NAME + '/crawled.txt' NUMB...
utils.py
from bitcoin.core import COIN # type: ignore from bitcoin.rpc import RawProxy as BitcoinProxy # type: ignore from bitcoin.rpc import JSONRPCError from contextlib import contextmanager from pathlib import Path from pyln.client import RpcError from pyln.testing.btcproxy import BitcoinRpcProxy from collections import Or...
repository.py
import atexit import os import re import subprocess import tempfile import threading import time from contextlib import contextmanager from pathlib import Path from typing import Callable, Iterator, List, Optional, Tuple, Union from tqdm.auto import tqdm from huggingface_hub.constants import REPO_TYPES_URL_PREFIXES ...
scheduler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Background processes made simple --------------------------------- """ from __future__ import print_fu...
7_event_queue.py
# Copyright 2020 IOTA Stiftung # SPDX-License-Identifier: Apache-2.0 import iota_wallet import threading import queue import time import os from dotenv import load_dotenv # Load the env variables load_dotenv() # Get the stronghold password STRONGHOLD_PASSWORD = os.getenv('STRONGHOLD_PASSWORD') # This example shows...
window.py
import tkinter as tk from tkinter import ttk from tkinter import filedialog as fl from tkinter import messagebox as mb import threading import model import pywfd times = [] def openfile(): filepath = fl.askopenfilename( filetypes=[( "音声ファイル", "*.wav;*.mp3;*.ogg")]) pb1.start(...
rpc_server.py
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """The task RPC server code. This server is an XML-RPC server which serves code from rpc_methods.RPCMethods. This server will run until shutdown is called ...
EWSv2.py
import email import hashlib import subprocess import warnings from collections import deque from multiprocessing import Process import exchangelib from CommonServerPython import * from cStringIO import StringIO from exchangelib import (BASIC, DELEGATE, DIGEST, IMPERSONATION, NTLM, Account, Bod...
scripts_regression_tests.py
#!/usr/bin/env python """ Script containing CIME python regression test suite. This suite should be run to confirm overall CIME correctness. """ import glob, os, re, shutil, signal, sys, tempfile, \ threading, time, logging, unittest, getpass, \ filecmp, time, atexit from xml.etree.ElementTree import ParseEr...
test_server.py
import asyncio import json import os import time import urllib.parse import uuid import sys from contextlib import ExitStack from http import HTTPStatus from multiprocessing import Process, Manager from multiprocessing.managers import DictProxy from pathlib import Path from typing import List, Text, Type, Generator, No...
util.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "L...
xmpp.py
from datetime import datetime from xml.sax.saxutils import escape import ssl import multiprocessing import json from sleekxmpp.xmlstream import ET, tostring import sleekxmpp import eventlet import eventlet.wsgi from pynab import log from pynab.db import db_session, Category import config def process(queue): bot...
scrapeStocksListing.py
''' Created on Apr 13, 2018 @author: hwase0ng ''' import settings as S import requests from BeautifulSoup import BeautifulSoup from utils.dateutils import getToday from common import getDataDir, loadKlseCounters from utils.fileutils import tail from multiprocessing import Process, cpu_count, Queue import...
SettingsView.py
import ui import dialogs import console import threading import time from objc_util import ObjCClass, NSURL, ns from Utilities import Updater class SettingsView (object): def __init__(self, show_docset_management_view, show_cheatsheet_management_view, show_usercontributed_management_view, theme_manager, show_stackov...
kprun_bak.py
from obstacle_tower_env import ObstacleTowerEnv import numpy as np import tensorflow as tf import os import time import threading import queue class MODEL(object): def __init__(self): self.sess = tf.Session() # Critic # 定義變數 self.tfs = tf.placeholder(tf.float32, [...