text stringlengths 3.07k 22.1k |
|---|
# Author: HMM <<EMAIL>>
# Copyright 2015
# License: MIT See License file
# some code are taken from https://github.com/amueller/word_cloud
# detail descriptions are availabe there.
# those code are (c) 2012 <NAME>
from random import Random
import os
import re
import sys
import numpy as numpy
from operator import i... |
from __future__ import print_function, division
import os
import numpy as np
import warnings
from astropy.io.votable import parse
from astropy.io.votable.tree import VOTableFile, Resource, Field, Param
from astropy.io.votable.tree import Table as VOTable
from .exceptions import TableException
from .helpers import sm... |
""" standard """
import csv
import json
try:
from urllib import quote # Python 2
except ImportError:
from urllib.parse import quote # Python 3
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
""" custom """
import ApiProperties
from Config.ResourceType import ResourceTy... |
#!/usr/bin/env python
import os, sys, re
from optparse import OptionParser
import xml.etree.ElementTree as ET
import libPlotting as libplot
def writeDocumentStart( f ):
f.write( "\\documentclass[11pt]{article}\n" )
f.write( "\\usepackage{epsfig}\n" )
f.write( "\\usepackage{multirow}\n" )
f.write( "\\... |
import asyncio
import html
import logging
import os
import re
import sys
import time
import urllib.parse
from telethon import TelegramClient, events, types, custom, utils, errors
logging.basicConfig(level=logging.WARNING)
logging.getLogger('asyncio').setLevel(logging.ERROR)
try:
import aiohttp
except ImportError... |
import tensorflow as tf
import os
import pdb
class Network(object):
def __init__(self, name):
self.name = name
def batch_norm(self, x, training, decay=0.9, name='batch_norm', reuse=None):
with tf.variable_scope(name, reuse=reuse):
dim = x.shape[1].value
moving_mean = t... |
# -*- coding: utf-8 -*-
#* Copyright (c) 2020 Intel Corporation
import os,sys,copy,json
import subprocess
import datetime
import time
import shlex
import glob
import argparse
import multiprocessing
def run_command(cmd, path):
ret_code = 0
#print("cmd = %s, path = %s" % (cmd, path))
cmd_proc = subprocess.Popen(shlex... |
# -*- coding: utf-8 -*-
from operator import attrgetter
from typing import Set
from .base import TrackToTrackAssociator
from ..base import Property
from ..measures import Measure, Euclidean
from ..types.association import AssociationSet, TimeRangeAssociation, Association
from ..types.groundtruth import GroundTruthPath... |
import datetime
import urllib
from itertools import chain
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.exceptions import PermissionDenied
from django.db.models im... |
from typing import List, Any, Callable
import torch
from torch import Tensor
from sklearn.linear_model import LinearRegression
import numpy as np
from evaluation.IOU import calc_IOU
from evaluation.mpc import evaluate_model_planning
from evaluation.nearest_neighbours import calc_nearest_neighbours
class Statistics:... |
import queue
import threading
import operator
import ast
from collections import namedtuple
class RouterMessage:
tbl_len = 30
name_length = 5
def __init__(self, router_name, table):
self.table = table
self.router_name = router_name
def to_byte_S(self):
# fancy s... |
import pymysql.cursors
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
num_=0
_host = 'localho... |
import contextlib
import concurrent.futures
import os
import sys
import traceback
import typing
import itertools
from conducto.shared import (
async_utils,
client_utils,
types as t,
log,
)
import conducto
from . import dockerfile as dockerfile_mod, names
from conducto.shared import constants, imagepa... |
import discord
from discord.ext import commands
from typing import Optional, Union
from .utils.checks import is_commander
from .utils.strings import markdown
from .utils.converters import CommandConverter, ModuleConverter
from .utils.disable import set_disabled, set_disable_state
class General(commands.Cog):
d... |
import os
import numpy as np
import matplotlib.pyplot as plt
import torch
from PIL import Image
import time
import shutil
import random
import cv2
from torch.utils.data import Dataset
import logging
class ImagePairDataset_y(Dataset):
# from: https://blog.csdn.net/tuiqdymy/article/details/84779716
# 数据集需要保存在In... |
import os
import json
import responses
import re
import pytest
from fastapi.testclient import TestClient
from app import app
from idunn.api.directions import rate_limiter
from freezegun import freeze_time
from .utils import override_settings
@pytest.fixture
def mock_directions_car():
with override_settings(
... |
# import sys
from typing import Optional, Tuple, Dict, Any, List
import tkinter as tk
import logging
import os
from config import appname, config
from theme import theme
import myNotebook as nb
from ranks import explorerRanks, merchantRanks, combatRanks, empireRanks, fedRanks
# This could also be returned from plug... |
'''
This module contains utility functions for :mod:`skosprovider_getty`.
'''
import logging
import rdflib
import requests
from rdflib.graph import Graph
from rdflib.namespace import DC
from rdflib.namespace import RDF
from rdflib.namespace import RDFS
from rdflib.namespace import SKOS
from rdflib.term import URIRef
f... |
import itertools
from functools import partial
from toolz.compatibility import Queue, map
identity = lambda x: x
def remove(predicate, coll):
""" Return those items of collection for which predicate(item) is true.
>>> def iseven(x):
... return x % 2 == 0
>>> list(remove(iseven, [1, 2, 3, 4]))
... |
import torch
import torch.optim as optim
import torch.nn as nn
from networks.actor_critic import CNNActorCritic
from buffer.rollout import RolloutBuffer
from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler
#
class FixedCategorical(torch.distributions.Categorical):
def sample(self):
retur... |
import pickle
import random
import socket
import sys
import threading
import time
from time import sleep
from opensimplex import OpenSimplex
clients = []
CHUNK = 4096
count = 0
users = 0
directions = [['up', 'up', 'down', 'down', 'left', 'left', 'right', 'right', 'idle'], ['up', 'down', 'left', 'right', 'idle', 'idle... |
import re
import pytest
from deal_solver import Conclusion
from .helpers import prove_f
@pytest.mark.parametrize('expr, err', [
# ('3.1 | 4.2', "unsupported operand type(s) for bitwise operation: 'float' and 'float'"),
# get attr
('4[0]', "'int' object is not subscriptable"),
('4.1[0]', "'... |
"""
Parametric Sprockets
name: sprocket.py
by: Gumyr
date: July 9th 2021
desc:
This python/cadquery code is a parameterized sprocket generator.
Given a chain pitch, a number of teeth and other optional parameters, a
sprocket centered on the origin is generated.
license:
Copyright... |
"""
File: extractors
Date: 5/7/19
Author: <NAME> (<EMAIL>)
"""
import numpy as np
from gym_agario.envs.FullEnv import FullObservation
class GridFeatureExtractor:
def __init__(self, view_size, grid_size, arena_size,
cells=True, others=True, viruses=True, food=False,
flat=False)... |
import os.path as op
from datalad.api import Dataset
from datalad.api import install
from datalad.api import containers_add
from datalad.api import containers_remove
from datalad.api import containers_list
from datalad.utils import swallow_outputs
from datalad.tests.utils import SkipTest
from datalad.tests.utils impo... |
"""
Math 560
Project 1
Fall 2020
Provided Testing Code
"""
# Import time, random, plotting, stats, and numpy.
import time
import random
import matplotlib.pyplot as plt
import scipy.stats as stats
import numpy
# Import the provided code.
from project1 import SelectionSort
from project1 import Insertion... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import sys
import torch
import json
from pathlib import Path
import ABX.abx_group_computation as abx_g
import ABX.abx_iterators... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
ECCO v4 Python: Utililites
This module includes utility routines that operate on the Dataset or DataArray Objects
.. _ecco_v4_py Documentation :
https://github.com/ECCO-GROUP/ECCOv4-py
"""
from __future__ import division, print_function
import numpy as np
import... |
import os
osp = os.path
import numpy as np
import torch
nn = torch.nn
F = nn.functional
import util, losses, optim
from models.common import FC_BN_ReLU
from models.ipgan import Generator, Discriminator as img_Discrim
def train_model(args, dataloaders):
paths=args["paths"]
loss_args=args["loss"]
G,Dz,Dim... |
import os
import numpy as np
import time
import torch
from torch.nn import MSELoss, L1Loss
from torch.utils.data import DataLoader, WeightedRandomSampler
from torch.optim.lr_scheduler import ReduceLROnPlateau
import schnetpack as spk
import schnetpack.atomistic as atm
import schnetpack.representation as rep
from schn... |
from collections import OrderedDict
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy, ugettext_noop
from openslides.agenda.models import Item, S... |
"""
Forked from the student.py in the commonroad-search repository. https://gitlab.lrz.de/tum-cps/commonroad-search
"""
__author__ = "<NAME>"
#libaries
from scipy import spatial
import numpy as np
import time
import math
#commonroad
# from commonroad.visualization.draw_dispatch_cr import draw_object
import copy
#lo... |
import cv2
import numpy as np
import scipy.ndimage
import seaborn as sns
from keras.utils import np_utils
from matplotlib import pyplot as plt
import math
def preprocess(_data, _label):
_processed_data = _data.astype('float32') / 255.0
_onehot_label = np_utils.to_categorical(_label)
return _processed_da... |
import argparse
import torch
import logging
import json
import numpy as np
import cv2
from tqdm import tqdm
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
sns.set(style="darkgrid")
parser = argparse.ArgumentParser(prog='calc_mAP.py')
parser.add_argument('--net-type', default="RFB", type=str,... |
import argparse
import copy
import logging
import math
import os
import sys
import time
sys.path.append("/home1/machen/meta_perturbations_black_box_attack")
import torch.nn as nn
from config import PROJECT_PATH
sys.path.append('../cifar10-fast/')
from adversarial_defense.fast_adv_training.utils import *
from dataset... |
"""
Fault-tolerant algorithms for building symmetrical trapezoidal and S-curve motion profiles.
"""
from drivers.core.robotmotion import MotionProfile, MotionState
from math import sqrt, fabs
from numpy import sign
# The number of binary search iterations the S-curve algorithm performs when recalculating a preclusiv... |
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2011 <NAME> <<EMAIL>>
#
# 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 ap... |
from bs4 import BeautifulSoup as Bs
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import requests
from gender import getGenders
COLNAMES = ["Name", "Jobbezeichnung", "SFB_Arbeitsanteil", "Zuständiger_PL"]
GENDERCOLS = ["Geschlecht", "Geschl_Proba"]
link = "./TU Dortmund -- SFB876.html"
ARB... |
"""
clic.tokenizer: Tokenize strings to types
*****************************************
This module provides the core tokenisation used in CLiC, used both when parsing
incoming texts and when parsing concordance queries
Method
------
To extract tokens, we use Unicode text segmentation as described in [UAX29]_,
using... |
from scipy.special import expit, softmax
import numpy as np
class Layer:
def forward(self, **kwargs):
pass
def backward(self, input_grad):
pass
class NonlinearLayer(Layer):
pass
class LossLayer(Layer):
pass
class input(Layer):
def __init__(self, input_shape, name="x"):
... |
# -*- coding: utf-8 -*-
__version__ = "0.5.6"
__author__ = "mehtaarn000"
__license__ = "MIT"
__maintainer__ = "mehtaarn000"
__credits__ = ["mehtaarn000", "kilianalias", "nethracookie", "bizzyvinci"]
"""A python module that will allow users to get product prices information from a multitude of different websites."""
f... |
from distutils.core import setup
from distutils.extension import Extension
import multiprocessing
from Cython.Distutils import build_ext
from Cython.Build import cythonize
import numpy
import os
import glob
import re
import sys
class BuildError(Exception):
pass
if 'CC' in os.environ:
print("Using CC={}".form... |
from flash.display import BitmapData, Sprite, Bitmap, PixelSnapping, Loader
from flash.events import Event, KeyboardEvent
from flash.text import TextField, TextFieldType, TextFormat
from flash.geom import Point, Rectangle
from flash.net import URLRequest, URLRequestHeader
from flash.system import Security, LoaderConte... |
# Copyright (c) 2012-2017 CSIRO
# Australia Telescope National Facility (ATNF)
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# PO Box 76, Epping NSW 1710, Australia
# <EMAIL>
#
# This file is part of the ASKAP software distribution.
#
# The ASKAP software distribution is free software: you can ... |
""" utils """
import os
from os import access, R_OK
import glob
import json
from json import JSONDecodeError
import random
import string
import shutil
import subprocess
import shlex
import requests
import yaml
from knack.log import get_logger
from knack.util import CLIError
import azure.cli.core.commands.progress as p... |
import argparse
import datetime
import logging
import logging.config
from dataclasses import dataclass, field
from typing import Optional
import staticconf.loader
from elastalert.exceptions import EAConfigException
from envparse import Env
log = logging.getLogger(__name__)
class Parser(object):
@classmethod
... |
#
# Copyright 2018 GoPro Inc.
#
# 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 ... |
"""ClimateEntity for frigidaire integration."""
from __future__ import annotations
import logging
import frigidaire
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
FAN_AUTO,
FAN_HIGH,
FAN_LOW,
FAN_MEDIUM,
FAN_OFF,
HVAC_MODE_AUTO,... |
#!/usr/bin/env python3
# -*- codinchmodg: utf-8 -*-
# Imports
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_table
import plotly.graph_objs as go
import numpy as np
import pandas as pd
from sklearn import datasets
from sklearn.preprocessing import StandardScaler
import ... |
from datacube_wms.ogc_exceptions import WCS2Exception
from datacube_wms.ogc_utils import resp_headers, get_service_base_url
from datacube_wms.wms_layers import get_layers, get_service_cfg
from eoxserver.core.decoders import xml, kvp, typelist, lower, enum
from eoxserver.render.coverage.objects import (
Coverage, G... |
import sys, re
fnames = sys.argv[1:]
decls = []
class_map = {}
def to_snake_case(name):
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
def parse_params(params):
result = []
for param in params:
p = param.strip()
last = re.spl... |
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
import pandas as pd
from dash.dependencies import Input, Output, State, ClientsideFunction
from dash.exceptions import PreventUpdate
from enum import Enum, unique
from app import app
# import com... |
"""
This module implements handling of non-primitive objects as values in Grist data cells. It is
currently only used to handle errors thrown from formulas.
Non-primitive values are represented in actions as [type_name, args...].
objtypes.register_converter() - registers a new supported object type.
objtypes.encod... |
# -*- coding: utf-8 -*-
"""
Created on Fri May 15 11:17:44 2015
@author: <NAME>
"""
#import sys
import argparse
import textwrap
import timeit
import os
from snptools import *
###############################################################################
def version():
v0 = """
################################... |
'''
Common text preprocessing methods
'''
import re
import sys
from drgriffis.common import util
from drgriffis.common.replacer import replacer
_to_remove = [
'.', ',', '!', '?', ':', ';', '>', '<',
'"', "'", '(', ')', '{', '}', '[', ']',
'\\', '--', '`',
]
_to_substitute = util.flatten([_to_remove, [
... |
# ******************************************************************************
# Copyright (c) 2021 University of Stuttgart
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you m... |
# 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... |
from PyQt5.QtWidgets import (
QApplication,
QWidget,
QHBoxLayout,
QVBoxLayout,
QDesktopWidget,
QPushButton,
QLabel,
QTabWidget,
QMenu, QAction, QTextEdit, QFileDialog, QListWidget, QListWidgetItem, QCheckBox)
from PyQt5.QtGui import QPixmap, QCursor
from PyQt5.QtCore import QSize, QT... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#======================================================================
#
# pocketsnes_cht.py -
#
# Created by skywind on 2020/06/17
# Last Modified: 2020/06/17 20:26:39
#
#======================================================================
from __future__ im... |
import demistomock as demisto
from CommonServerPython import *
import urllib3
import json
import dateparser
import time
# Disable insecure warnings
urllib3.disable_warnings()
''' CLIENT CLASS'''
DEFAULT_LIMIT = 50
MAX_LOGZIO_DOCS = 1000
ONE_MINUTE = 60
ONE_HOUR = ONE_MINUTE * 60
DEFAULT_TIMEOUT_SEC = 2
MAX_REQUEST_... |
"""-------------------------------------------------------------------------------
# Name: pcc_conversion
# Purpose: Implements Program for Cooperative Cataloging's conversion
# February 25, 2013 recommendations for converting MARC21 records
# to hybrid RDA records.
#
# Author: ... |
import boto3
from botocore.exceptions import ClientError
from botocore.config import Config
import datetime
import fnmatch
import json
import os
import re
import logging
from delete_user import delete_user
logger = logging.getLogger()
logging.basicConfig(
format="[%(asctime)s] %(levelname)s [%(module)s.%(funcName... |
import torch
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
import pandas as pd
import numpy as np
import re
from sklearn.utils import shuffle
import models as lm
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
import random
def replace_halogen(string):
"""Re... |
import discord
from discord.ext import commands
import asyncio
from .utils.embed import RoEmbed
from collections import Counter
from .utils import checks
import shlex
import argparse
import re
class Arguments(argparse.ArgumentParser):
def error(self, message):
raise RuntimeError(message)
async def resol... |
import pygame
import sys
import random
class Player(pygame.sprite.Sprite):
def __init__(self, window, width, height):
super().__init__()
self.window = window
self.width = width
self.height = height
self.image = pygame.Surface((width, height))
self.image.fi... |
import gc
import json
import shutil
from abc import ABC, abstractmethod
import numpy as np
import torch
import torch.nn as nn
from sklearn.metrics import accuracy_score, f1_score
from sklearn.metrics import mean_absolute_error as mae
from sklearn.metrics import mean_squared_error as mse
from torch.nn.functional import... |
import shutil
import os
from datetime import datetime
import pandas as pd
import json
import numpy as np
import cv2
cv2.setNumThreads(0)
import ast
# from utils_dir.plot_loss import plot_loss
DEFAULT_TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
class MyEncoder(json.JSONEncoder):
def default(self, obj):
if isinstanc... |
#!/usr/bin/env python3
# Copyright (C) 2014 The python-bitcoinlib developers
#
# This file is part of python-bitcoinlib.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-bitcoinlib, including this file, may be copied, modified,
# ... |
import numpy as np
from cached_property import cached_property
from pb_bss.extraction import beamformer
from pb_bss.extraction.mask_module import lorenz_mask, quantile_mask
from utils.numpy_utils import morph
class _Beamformer:
def __init__(
self,
Y,
X_mask,
N_ma... |
import torch
import numpy as np
from scipy.optimize import linear_sum_assignment
from scipy.spatial.distance import cdist
import config
from tqdm import tqdm
from nms import nms
from detect_on_patches import run_on_patches
from utils import cells_to_bboxes
def rmse_xy(coord1, coord2):
xy_1 = coord1[0:2]... |
import json
import os
import datetime
import time
import configparser
import ocr
import csv
import winsound
from copy import deepcopy
from screenshot_crop import crop_screenshot
from table_output import BHTable
from colorclass import Windows
from pyperclip import copy
def get_current_location(last_save):... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2014 <NAME>.
#
# 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 witho... |
#! python
"""
Consolidate TranscriptSet into bam files, allowing adding a prefix
string (e.g., 'mysample_HQ_') to every transcript names.
"""
import sys
import os.path as op
import logging
import subprocess
from pbcommand.utils import setup_log
from pbcommand.cli import pbparser_runner
from pbcommand.models import Fi... |
# Copyright 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 agreed to... |
from datascience import *
from IPython.display import *
from ipywidgets import *
import pandas as pd
import numpy as np
import plotly.express as px;
import scipy.constants as constant
import math
from ipywidgets import *
def show(*args, tags = []):
"""Pretty Display"""
assert (tags == []) or (type(tags[0]) == ... |
# Dependencies
# ============
# Standard
# --------
import os
from typing import (
List,
Mapping,
Union,
)
# Non-standard
# ------------
# See https://flask.palletsprojects.com/en/2.0.x/
from flask import current_app, g, url_for
# See http://rdflib.readthedocs.io/
from rdflib import Graph, Namespace, URIRe... |
#!/usr/bin/env python3
#
# (c) 2018-2021 <EMAIL> (<NAME>), for licencing see the LICENCE file
#
from sys import stderr, argv, stdin
from math import sin, cos, radians
from pi3d import Sphere, Display, Camera, Shader, Keyboard, screenshot, Lines, Font, String, Mouse
class Body(Sphere):
def __init__(self, shader, ... |
#===============================================================================
# Copyright 2007 <NAME>
#
# 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/... |
import sublime
import sublime_plugin
def lookup_symbol(window, symbol):
if len(symbol.strip()) < 3:
return []
index_locations = window.lookup_symbol_in_index(symbol)
open_file_locations = window.lookup_symbol_in_open_files(symbol)
def file_in_location_list(fname, locations):
for l in... |
#!/usr/bin/env python3
import os
import sys
import argparse
import logging
import socket
from contextlib import closing
import json
import time
import random
from pathlib import Path
import subprocess
import re
from kubernetes import client as k8s_client
from kubernetes import config as k8s_config
from kubernetes.cli... |
#!/usr/bin/env python
"""
Prints a map of the entire world.
"""
import locale, os, sys
import re, math
from struct import pack, unpack
# local module
try:
import nbt
except ImportError:
# nbt not in search path. Let's see if it can be found in the parent folder
extrasearchpath = os.path.realpath(os.path.jo... |
import os
import subprocess
from sys import exit
from random import random
from platform import system
import json
from time import sleep
from datetime import datetime
import pymysql
import pyttsx3
import pyaudio
import wave
from gtts import gTTS # Google's Text to Speech
from selenium import webdriver
from screeninf... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Optional
from ax.core.base_trial import BaseTrial
from ax.core.experiment import Experiment
from ax... |
#!/usr/bin/env python3
#================================================================
######################## STELLA GUI ############################
#================================================================
''' STELLA GUI
Script to run the STELLA GUI.
- Generate the root window
- Fill the tabs through ... |
#!/usr/bin/env python
# coding: utf-8
# # SEIRS+ Network Model Demo
#
# **This notebook provides a demonstration of the core functionality of the SEIRS+ Network Model and offers a sandbox for easily changing simulation parameters and scenarios.**
# For a more thorough walkthrough of the model and use of this package, ... |
#!/usr/bin/python3
# ******************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved.
# licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a c... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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://aws.amazon.com/apache2.0/
#
# or in the "license" file acco... |
from argparse import ArgumentParser, RawTextHelpFormatter
from blpapi_import_helper import blpapi
from blpapi import Session, Names, CorrelationId
from util.ConnectionAndAuthOptions import \
addConnectionAndAuthOptions, \
createClientServerSetupAuthOptions, \
createSessionOptions
from util.events.SessionRo... |
from typing import Dict, Iterable, Optional, List, Any
from .nameutils import camel_case, pascal_case, swift_safe
from . import typeconversion
def _is_enabled(data: Dict, enabled_tags: Optional[List[str]]):
tags = data.get('tags')
if not tags or enabled_tags is None:
return True
return any(tag i... |
# coding:utf8
import os
import imp
import time
import types
import random
import traceback
from .. import utils
def default_plugin__accept_request(self, msg, rsp, utils, *args, **kwargs):
if msg.was_appeal and msg.args[0].lower() in self.keywords:
return True
return False
class Pluginmanager(obj... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
import os
import subprocess
import sys
import re
import argparse
encoding = sys.getdefaultencoding()
def warn(msg):
print('[powerline-zsh] ', msg)
class Color:
# The following link ... |
import sys
import platform
import os
import hashlib
import re
from colorama import Fore, Style, Back
import itertools
import time
HASH_LIST = (
"md4",
"md5",
"sha1",
"sha256",
"sha512"
)
CHAR_SET = (
"NUM",
"NUM_SPECIAL",
"ALPHA_CAPS",
"ALPHA_LOWER",
"ALPHA_CAPS_LOWER",
"AL... |
#!/usr/bin/env python2
# Copyright (c) 2017-present, Facebook, 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 ... |
#!/usr/bin/env python3
from __future__ import division
import rosbag, rospy, numpy as np
import sys, os, cv2, glob
from itertools import repeat
import imageio
import argparse
import logging
import traceback
import tqdm
# try to find cv_bridge:
try:
from cv_bridge import CvBridge
except ImportError:
# assume w... |
readMe = """A Python 3 script to check the security patch date of Android devices managed by
Meraki Systems Manager and generate a report or apply tags to them to trigger enforcement actions.
Script syntax, Windows:
python android_patch_audit.py [-c <config_file>]
Script syntax, Linux and Mac:
py... |
# Python imports
# Don't add any from __future__ imports here. This code should execute
# against standard Python.
import unittest
import time
import os
# Project imports
import sysv_ipc
# Hack -- add tests directory to sys.path so Python 3 can find base.py.
import sys
sys.path.insert(0, os.path.join(os.getcwd(), 'tes... |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 lambda
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 3 of the License, or
(at your option) any l... |
"""A class for creating PDB files/strings given a protein's sequence and coordinates."""
import itertools
import numpy as np
from sidechainnet.structure.build_info import NUM_COORDS_PER_RES, SC_BUILD_INFO
from sidechainnet.structure.HydrogenBuilder import ATOM_MAP_24, NUM_COORDS_PER_RES_W_HYDROGENS
from sidechainnet.s... |
""" ExifToFinder class """
import pathlib
import osxmetadata
from .exiftool import ExifToolCaching, get_exiftool_path
from .phototemplate import PhotoTemplate, RenderOptions
def noop():
"""Do nothing"""
pass
DEFAULT_GROUP_TAG_TEMPLATE = "{GROUP}:{TAG}: {VALUE}"
DEFAULT_TAG_TEMPLATE = "{TAG}: {VALUE}"
# ... |
#!/usr/bin/env python3
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.