text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/env python3
import os
import sys
import oyaml
import requests
from yaml.scanner import ScannerError
from xml.etree import ElementTree
from xml.etree.ElementTree import ParseError
from panos import Panos
from colorama import init as colorama_init
from panos import KeyDB
import re
from colorama import Fore, B... |
import os
import asyncio
from PIL import Image
from concurrent.futures import ThreadPoolExecutor
from hoshino import Service, priv
from hoshino.typing import HoshinoBot, CQEvent, MessageSegment, CommandSession
from hoshino.util import FreqLimiter, DailyNumberLimiter, pic2b64
from .src.generator import genImage
from .... |
"""Provide variant calling with VarScan from TGI at Wash U.
http://varscan.sourceforge.net/
"""
import contextlib
from distutils.version import LooseVersion
import os
import shutil
from bcbio import utils
from bcbio.distributed.transaction import file_transaction
from bcbio.pipeline import config_utils
from bcbio.pro... |
from django.db import connection
moderation_filter = """
position(claim_claim.moderation IN
(SELECT claim_moderator.show_claims
FROM claim_moderator WHERE claim_moderator.id = 1)) <> 0
"""
claim_to_polygon_join = """
LEFT OUTER JOIN geoinfo_polygon_organizations ON (houses.polygon_... |
from math import ceil, floor
from typing import Sequence, Union
import numpy as np
import pandas as pd
import xarray as xr
from scipy.linalg import toeplitz
def calc_temp(
data: xr.Dataset,
T_err: Union[str, None],
T_num: int,
n_samples: int,
tau_ar1: float = 10,
random_state: Union[int, None... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Define ray sensors; sensors that cast rays into the world and return the range of the nearest object that were
intersected with these ones.
"""
import numpy as np
from pyrobolearn.robots.sensors.links import LinkSensor
from pyrobolearn.utils.transformation import get_r... |
#!/usr/bin/env python3
"""
MongoDB Setup
This file takes as input a YAML configuration of the AWS instances and
MongoDB cluster topology and brings up a cluster on the remote machines.
"""
import sys
from functools import partial
import logging
import argparse
import common.atlas_setup as atlas_setup
from common.del... |
import pandas as pd
import numpy as np
from math import sqrt
from functools import partial
import plotnine as p9
import re
import os
import xml.etree.ElementTree as ET
_rows = np.array([chr(x) for x in range(65, 91)]
+ ['A' + chr(x) for x in range(65, 71)])
def welln2well(wells, form):
form = int(form)
... |
import os
from pysports import parse_text, _parse_all_table_tags, _parse_all_table_names, _parse_all_column_headers, _parse_all_data
from bs4 import BeautifulSoup
cwd = os.path.dirname(os.path.realpath(__file__))
one_table_full_text = None
one_table_full_text_soup = None
complicated = None
complicated_soup = None
m... |
import logging
import json
import multiprocessing as mp
from luafun.game.inspect.base import BasePage
from luafun.game.action import IPCMessageBuilder, Action
import rpcjs.elements as html
log = logging.getLogger(__name__)
class Config:
def __init__(self, app):
# this is supposed to be inverted, not a ... |
"""
The LcCatalog provides a semantic interface to a collection of (local and remote) read-only LcArchives, which provide
access to physical data.
It is made up of the following components:
* built on an LciaEngine
+ local, persistent storage of resources, indexes, cache data + etc
+ A resolver, which translate... |
"""CLI tool for recursively rekeying ansible-vault encrypted secrets"""
import argparse
import getpass
import logging
import re
import shutil
import sys
from pathlib import Path
from typing import Any
from typing import Iterable
from typing import List
from typing import Optional
import ruamel.yaml
try:
import an... |
r"""
Definition
----------
This model provides the form factor, $P(q)$, for a monodisperse hollow right
angle circular cylinder (rigid tube) where the The inside and outside of the
hollow cylinder are assumed to have the same SLD and the form factor is thus
normalized by the volume of the tube (i.e. not by the total c... |
from tensorflow.keras import layers
from tensorflow.keras.models import Model
from ..modules.attention import BaseAttention
# Attention-insertable Xception
def XceptionWithAttention(include_top=True, input_shape=(256, 3), pooling=None, classes=6,
classifier_activation='softmax', module: ... |
import time, datetime, os, collections
from dateutil import relativedelta
import numpy as np #数値計算用
import pandas as pd #データ処理用
import yfinance as yf
import pandas_datareader
#import requests #クローリング用
#import bs4 #スクレイピング用
pd.set_option('display.unicode.east_asian_width', True) #全角文字幅を考慮して表示
#銘柄情報... |
"""
<NAME>. & <NAME>. (2013).
Virtual Library of Simulation Experiments: Test Functions and Datasets.
Retrieved April 18, 2016, from http://www.sfu.ca/~ssurjano.
"""
from __future__ import print_function
from functools import reduce, wraps
import inspect
from numpy import sin, cos, linspace, meshgrid, e, pi, sqrt, e... |
import numpy
import structlog
from gost.utils import evaluate, evaluate_themes, evaluate_nulls, FmaskThemes
from gost.data_model import Measurement
_LOG = structlog.get_logger("fmask")
def test_evaluate_themes_identical(
ref_fmask_measurement1: Measurement, test_fmask_measurement1: Measurement
):
"""Test th... |
from django.shortcuts import render, redirect
from .models import TransitPassApplication, State, District, TransitPass
from django.core.files.storage import FileSystemStorage
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.db import models
from d... |
# Create your views here.
from django.views.decorators.csrf import csrf_exempt
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from django.shortcuts import render, redirect
from datetime import datetime, timedelta
from django.db import IntegrityError
import time
import json
from... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
import gym
import numpy as np
from cntk.core import Value
from cntk.initializer imp... |
import numpy as np
import matplotlib.pyplot as plt
import math as m
from Bezier import *
import time
RAD2DEG = 57.3
DEG2METER = 111392.84
DEG2RAD = 1/57.3
# X = np.array([0, 3, 6, 3, 1,-1, 1, 2, 4, 2, 1,-0.5,-1.4,-2,-2.7,-4,-4.5,-6.5,-3,0])
# Y = np.array([0, 0, 3, 6, 6,4.5, 3, 3, 2, 1, 1, 1.4, 2.5, 4, 5.4... |
import numpy as np
import foolbox
import json
import pickle
from PIL import Image
class L2(foolbox.distances.Distance):
def _calculate(self):
min_, max_ = self._bounds
diff = (self.other - self.reference) / (max_ - min_)
value = np.linalg.norm(diff.flatten(), ord=2).astype(np.float64)
... |
#!/usr/bin/python3
# Script to build network structure for encoder, quantizer, decoder and discriminator modules of model
# Code borrowed from <NAME> (https://github.com/Justin-Tan/generative-compression) and modified as required
import tensorflow as tf
from utils import Utils
from config import input_attributes
#===... |
'''
.. versionchanged:: 2.32.1
Remove experiment log window.
'''
import hashlib
import json
import logging
import zipfile
from logging_helpers import _L
from markdown2pango import markdown2pango
from path_helpers import path
from pygtkhelpers.gthreads import gtk_threadsafe
import deepdiff
import gtk
from .. impor... |
import csv
import json
import os
import sys
from collections import Counter
import argparse
from typing import Dict, Union, Optional
import torch
from torch import nn
from torch import optim
from bpemb import BPEmb
from torch.nn import CrossEntropyLoss
from torchtext.data import Field, Example, Dataset, BucketIterator... |
# Copyright (c) 2017-2019, <NAME>
# Copyright (c) 2014-2018, iocage
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# noti... |
import json
import os
import time
import sys
import csv
import argparse
import gzip
from contextlib import ExitStack
import logging
logger = logging.getLogger(__name__)
# EX: To parse one json file into a set of compressed csv files for neo4j, try this:
# python3 parse_json.py data/s2-corpus/s2-corpus-001 --unique ... |
from time import sleep
from EDlogger import logger
import json
from pyautogui import typewrite, keyUp, keyDown
from MousePt import MousePoint
from pathlib import Path
"""
File: EDWayPoint.py
Description:
Class will load file called waypoints.json which contains a list of System name to jump to.
Provides ... |
from dataclasses import dataclass
from numbers import Number
from typing import Sequence
from locintel.core.datamodel.geo import GeoCoordinate, Geometry
WAYPOINT_KINDS = [
"STOP", # A stop is expected, next leg may start in any direction
"VIA", # Indicative of path to follow, no stops expected, must continu... |
"""Provides models for representing the contents of a parsed beancount file."""
from __future__ import annotations
import lzma
import pickle
from decimal import Decimal
from typing import Any, Dict, List, Optional, Set, Tuple, Type, TypeVar
from beancount import loader
from beancount.core import data, realization
fr... |
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import argparse
import re
import sys
import time
from multiprocessing import Process, Queue, Condition, Value
'''
***** Example call *****
python3 wikiwindows.py -e entities.txt -w 2 -d 5 -r data.txt
***** Example input *****
data.txt:
1... |
import logging
import math
import threading
import time
from concurrent.futures import ThreadPoolExecutor
from contextlib import suppress
from dataclasses import dataclass
from multiprocessing import Queue
from pathlib import Path
from random import choice
from threading import Thread
from time import perf_counter, sle... |
"""
AUDIO_FEATURE
Extract/manipulate audio features
<NAME> 2018
"""
import librosa
import scipy
import subprocess
import numpy as np
# debug
#
# Feature extactors
# I'm heavily taking ideas from the dcase_utils repo
class FeatureExtractor(object):
"""
FeatureExtractor()
Base class for all feature extra... |
"""
19. Remove Nth Node From End of List
Medium
Given the head of a linked list, remove the nth node from the end of the list and return its head.
Example 1:
Input: head = [1,2,3,4,5], n = 2
Output: [1,2,3,5]
Example 2:
Input: head = [1], n = 1
Output: []
Example 3:
Input: head = [1,2], n = 1
Output: [1]
C... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Proxy models for augmenting our source data tables with methods useful for processing.
"""
from __future__ import unicode_literals
import re
import logging
from calaccess_processed import corrections
from django.db.models.functions import Concat
from django.db.models im... |
import time
import itertools
import numpy as np
from scipy import sparse
from scipy.sparse import lil_matrix, csc_matrix
from Functions.Variables import Variables
class MatMaker:
"""
This class generates a sparse matrix that represents a function described as subclass of Variables.
So-called zero-one tr... |
# -*- coding: utf-8 -*-
import sys
import os
import pprint
import traceback
import sqlalchemy
import requests
import time
from sqlalchemy.orm import scoped_session, sessionmaker
from bs4 import BeautifulSoup
from datetime import datetime
from sqlalchemy.sql.expression import null
from RankingModels import Base, TSearc... |
#-------------------------------------------------------------------------------#
# Copyright (C) 2020-2021 ETH Zurich, Switzerland, University of Bologna, Italy.#
# All rights reserved. #
# ... |
from api import *
class TA:
@classmethod
async def create(cls, slack, uid):
"""
Factory to create a TA object with await
https://stackoverflow.com/questions/33128325/how-to-set-class-attribute-with-await-in-init/33134213
"""
assert isinstance(slack, Slack)
self ... |
# -*- coding:utf-8 -*-
import tensorflow as tf
from tensorflow.python.keras import backend as K
''' tensorflow version < 1.14.0
class AdamWarmupV1(tf.keras.optimizers.Optimizer):
"""Adam optimizer with warmup.
Default parameters follow those provided in the original paper.
# Arguments
decay_step... |
"""_hdf5.py: functions supporting Model methods relating to hdf5 access."""
import logging
log = logging.getLogger(__name__)
import os
import h5py
import numpy as np
import resqpy.olio.uuid as bu
import resqpy.olio.xml_et as rqet
from resqpy.olio.xml_namespaces import curly_namespace as ns
# see also _external_par... |
import json
import os
import psycopg2
import pytest
from aiohttp import web
from services.data.postgres_async_db import AsyncPostgresDB
from services.utils.tests import get_test_dbconf
from services.metadata_service.api.admin import AuthApi
from services.metadata_service.api.flow import FlowApi
from services.metadata_... |
import pytest
from glob import glob
from fontTools.ttLib import TTFont
import tempfile
import os
from gftools.html import *
import re
from copy import deepcopy
TEST_DATA = os.path.join("data", "test")
@pytest.fixture
def SimpleTemplate():
class SimpleTemplate(HtmlTemplater):
def __init__(self, out, temp... |
#download_volumes.py
#Copyright (c) 2020 <NAME> <NAME>
#MIT License
#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, ... |
#!/usr/bin/env python
import argparse
import os
import re
import sys
class ParseError(Exception):
def __init__(self, line_no, value):
self.line_no = line_no
self.value = value
def lex_line(line, line_no):
token_exprs = [
('[ \\n\\t]+', None),
(';[^\\n]*', None),
('mo... |
#!/usr/bin/env python
"""
createCopyNumberStatsFacetedPlot.py
5 April 2011
dent earl dearl (a) soe ucsc edu
used in the assemblathon report project to
create a plot of excess, deficient and total copy bases
from a single copy stats xml file.
"""
##############################
# Copyright (C) 2009-2011 by
# <NAME> (<... |
import matplotlib
# from astropy.timeseries import LombScargle
import matplotlib.gridspec as gridspec
import importlib
from hydroDL import kPath, utils
from hydroDL.app import waterQuality
from hydroDL.master import basins
from hydroDL.data import usgs, gageII, gridMET, ntn
from hydroDL.master import slurm
from hydroD... |
import numpy as np
from sklearn.naive_bayes import GaussianNB
from scipy.special import logsumexp
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import StandardScaler
from sklearn.calibration import CalibratedClassifierCV
from sklearn.model_selection import GroupShuffleSplit
from sklearn... |
# -*- coding: utf-8 -*-
import hashlib
import os
import random
from base64 import b64decode, b64encode
from django.urls import reverse
from django.utils.encoding import force_bytes, force_str
import pytest
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import padding... |
from math import sqrt
gals = {
"<NAME>": {"age": 35, "salary": 75000},
"<NAME>": {"age": 52, "salary": 55000},
"<NAME>": {"age": 27, "salary": 45000},
"<NAME>": {"age": 37, "salary": 115000}
}
guys = {
"<NAME>": {"age": 53, "salary": 70000},
"<NAME>": {"age": 25, "salary": 105000},
"... |
import datetime
import typing
import pandas
import pytest
from tribble import transform
class DataTemplate:
def __init__(self, default: typing.Dict[str, typing.Any]) -> None:
self._default = default
def _generate_rows(self,
overrides: typing.List[typing.Dict[str, typing.Any]]
... |
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from colors import *
from shapes import SolidCylinder
angle_h = 300.0
angle_v = 0
spin = True
turn_h = 1
turn_v = 0
render_quality = 100 # max = 100
def keyboard(key, x, y):
global spin, turn_h, turn_v, angle_h, angle_v, render_quality
... |
from qiskit import QuantumCircuit, Aer, execute
from qiskit.aqua import QuantumInstance
from qiskit import *
from qiskit.visualization import plot_histogram
from qiskit.result import marginal_counts
from qiskit.tools.monitor import job_monitor
import matplotlib.pyplot as plt
import numpy as np
class Qtic:
def __i... |
import torch
from torchvision import datasets, transforms, utils
from torch.utils.data import Dataset, DataLoader
import numpy as np
import scipy.io as sio
import platform
import copy
import math
import matplotlib.pyplot as plt
import glob
from PIL import Image
import os
def generate_dataset(input_channel,input_width... |
import numpy as np
import casadi as ca
from abc import ABC
from collections import namedtuple
from matplotlib import animation
from typing import List, Callable
from acrobotics.geometry import Scene
from acrobotics.link import Link
from acrolib.plotting import plot_reference_frame
JointLimit = namedtuple("JointLimit"... |
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Union
from darwin.path_utils import construct_full_path
Point = Dict[str, float]
BoundingBox = Dict[str, float]
Polygon = List[Point]
ComplexPolygon = List[Polygon]
Node = Di... |
# The following source code was originally obtained from:
# https://github.com/rootpy/rootpy/blob/master/rootpy/tree/tree.py
# ==============================================================================
# Copyright (c) 2012-2017, The rootpy developers
# All rights reserved.
#
# Please refer to LICENSE.rootpy for th... |
# coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# 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 applicab... |
#!/usr/bin/env python3
import sqlite3
import subprocess
from retry import retry
class Instance:
@staticmethod
def get_machine_types(conf, min_mem):
service = conf['Platform']['service']
service = service.lower()
cpu_list = conf['Profiling'].get('thread', [2])
if service in ['... |
import collections
import functools
from typing import List, Callable, NamedTuple, Tuple
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from rgpy import visualize
#------------------------------------------------------------------------
#
# Base Lattice Kernel
#
#--------------------... |
import hashlib
import json
from time import time,sleep
from uuid import uuid4
import pandas as pd
from flask import Flask,jsonify,request,render_template,redirect,url_for,flash
import random
import pokemon
from blockchain import Blockchain
import requests
import ast
import sys
import threading
import pandas as pd
if ... |
"""
County Classes
Module Description
==================
This module contains the CountyData and CountyDataset classes.
Copyright Information
===============================
This file is Copyright (c) 2021 <NAME>, <NAME>, <NAME>, <NAME>.
"""
from dataclasses import dataclass
from typing import Any, Iterable, Union
i... |
'''
Copyright (C) 2021 <NAME> and contributors. All rights reserved.
Licensed under the MIT license.
See LICENSE file in the project root for full license information.
'''
import sys
from pathlib import Path
from typing import Any, Callable, Optional
from constants import ResultCode
class ArgHelper():
... |
# -*- coding: utf-8 -*-
##########################################################################
# NSAp - Copyright (C) CEA, 2021
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
#... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 18 11:25:58 2021
@author: xiatong
"""
import os
import joblib
import librosa
import numpy as np
import pandas as pd
SR = 16000 # sample rate
SR_VGG = 16000 # VGG pretrained model sample rate
FRAME_LEN = int(SR / 10) # 100 ms
HOP = int(FRAME_LEN / 2) # 50%overlap,... |
"""id_transferer_cli
Command line interface to the spectra-cluster id_transferer tool. This tool can be
used to transfer identifications to other incorrectly or unidentified spectra.
Quality criteria can be specified in terms of minimum cluster size and minimum ratio (the
proportion of spectra identified as the most ... |
# Copyright 2016 - Nokia Networks.
#
# 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 11 09:41:10 2022
@author: jac
"""
from numpy import loadtxt, arange, zeros, cumsum, where, ceil, floor, array, ndarray
from scipy.interpolate import interp1d
from matplotlib.pylab import plot, subplots, hist
from pandas import read_csv
import json... |
from __future__ import absolute_import
from __future__ import print_function
import sys,re
try:
import SocketServer
import threading
import signal
import socket
import time
import requests
except ImportError as ie:
print(str(ie),file=sys.stderr)
sys.exit(1)
import Parameters
class DictServerHandler(So... |
from __future__ import print_function
import sys
import os
import serial
import time
import socket
import select
from stat import *
import fcntl
import datetime
class base_log(object):
def __init__(self, tag):
self.tag = ((16 - len(tag[:16])) * " ") + tag
def emit(self, string):
raise NotImpl... |
from typing import Tuple
from bootstrap_datepicker_plus import DatePickerInput
from django import forms
from django.forms import ImageField
from django.views.generic import CreateView
from django.core.exceptions import ValidationError
from presencing_publications.models import *
class DirectorForm(forms.ModelForm):
... |
from distutils.version import LooseVersion
from functools import partial, reduce
import django
from django.db.models import query
from django.db.models.query_utils import Q
from django.db.models.constants import LOOKUP_SEP
from django.db.models import Max, Min, F
from django.utils.module_loading import import_string
... |
#!/usr/bin/python3
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import json
import logging
import os
import random
import numpy as np
import torch
from torch.utils.data import DataLoader
from model import KGEModel
from dataloader impo... |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
import utils
import pandas as pd
import itertools
import analytical
plt.style.use("../physrev.mplstyle")
def load_data(N, which):
"""Load data from file.
Returns (avMM2, avMM3, delta, na_range, avg_see, avg_traces)
"""
# avMM... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (C) 2013-2019 British Crown (Met Office) & Contributors.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import pickle
import shutil
import sys
import time
import json
import numpy as np
import tensorflow as tf
from model import PTBNASModel
from six.moves import xrange
flags = tf.app.flags
FLAGS = fl... |
'''Copyright (c) 2020, TDK Electronics
All rights reserved.
Author: <NAME>, https://github.com/mciepluc
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met (The BSD 2-Clause
License):
1. Redistributions of source code must r... |
import numpy as np
from distributed import Client
import dask.dataframe as dd
from dask import delayed
import dask_ml
from dask_ml.preprocessing import StandardScaler, OneHotEncoder
import dask
import pandas as pd
import time
import argparse
from glob import glob
import warnings
import logging
import argparse
import sy... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : addNet.py
@Contact : <EMAIL>
@Modify Time 2020/4/13 8:50 AM
'''
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : newidea.py.py
@Contact : <EMAIL>
@Modify Time 2020/4/9 10:49 AM
'''
import argparse
import os
from math imp... |
import sys
import os
from typing import List, Tuple, Union
from collections import OrderedDict
import csv
from fuse.metrics.classification.metric_bss import FuseMetricMultiClassBSS
import pandas as pd
import numpy as np
from fuse.utils.utils_hierarchical_dict import FuseUtilsHierarchicalDict
from fuse.utils.utils_fil... |
# ======================================================================================
# Copyright and other protections apply. Please see the accompanying LICENSE file for
# rights and restrictions governing use of this software. All rights not expressly
# waived or licensed are reserved. If that file is missing or ... |
# Copyright 2015 Brocade Communications System, 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
#
#... |
from flask import Flask
from flask.ext import excel
from flask_bootstrap import Bootstrap
from flask import request, redirect, url_for, render_template, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_security import Security, SQLAlchemyUserDatastore, RoleMixin, UserMixin, login_required
from datetime import... |
import sys
import os
import argparse
import json
import traceback
import glob
import subprocess
import requests
import re
URL_KEYS = ["pluginUrl", "authorUrl", "manualUrl", "sourceUrl", "changelogUrl"]
SPDX_URL = "https://raw.githubusercontent.com/spdx/license-list-data/master/json/licenses.json"
RACK_TAG_CPP_URL = "... |
# Performs post-pruning of a rule set by deleting rules that don't improve the training accuracy
from . import simplification as s
from . import evaluation_formulas as ef
from operator import concat
import time
import math
import itertools
import heapq
def post_prune(dnf, class_condition, condition_example_dict, exam... |
#
# 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 wri... |
#需要安装pillow库
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import random
from PIL import Image, ImageFont, ImageDraw
class Book:
def __init__(self, ID=0, name="", authors=None, pub_date="", publisher="", isbn="", language="", cover_path="",
rating=0, file_path="", tags=None, boo... |
from share.transform.chain import * # noqa
from share.transform.chain.utils import format_address
def format_mendeley_address(ctx):
return format_address(
address1=ctx['name'],
city=ctx['city'],
state_or_province=ctx['state'],
country=ctx['country']
)
RELATION_MAP = {
'r... |
"""@package ecohydrolib.ssurgo.rasterize
@brief Rasterize SSURGO features
This software is provided free of charge under the New BSD License. Please see
the following license information:
Copyright (c) 2013, University of North Carolina at Chapel Hill
All rights reserved.
Redistribution and use in source and bi... |
import numpy as np
import random
import pandas as pd
import matplotlib.pyplot as plt
import os
import copy
import seaborn as sns
import utils
from sklearn import preprocessing
from sklearn.metrics import log_loss
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA,FactorAnalysis
im... |
import sys
from datetime import datetime, timedelta
from mongoengine import *
import requests
import json
import pytz
import csv
import time as time
import pandas as pd
from main_project.Logs.service_logs import emergency_service_log
# Structure of collection storing Firestations details
class FireStations(Document):
... |
'''
Modified from https://raw.githubusercontent.com/pytorch/vision/v0.9.1/torchvision/models/vgg.py
BSD 3-Clause License
Copyright (c) <NAME> 2016,
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Re... |
import os
import sys
import gzip
import time
import numpy
import argparse
import math
import random
import copy
import theano
import denet.model.model_cnn as model_cnn
import denet.dataset as dataset
import denet.common.logging as logging
import denet.common as common
#compute per class error rates
def compute_error(... |
'''
Names: <NAME>, <NAME>, <NAME>
Class: CS 582 - Intro to Speech Processing
Des: This program is the main file for the chatbot. Using Markov Chain dictionary to create sentences.
References:
0612 TV, director. Markov Chains - Make a Chatting AI! YouTube, YouTube, 23 Aug. 2016, www.youtube.com/watch?v=L97yQMT0jn8.
Da... |
# Copyright 2020 <NAME>. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the follow... |
"""Common steps used in various GUI testing scenarios
"""
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2016 ACK CYFRONET AGH"
__license__ = "This software is released under the MIT license cited in " \
"LICENSE.txt"
import re
import time
import random
import stat
import subprocess
from selenium... |
import time
import multiprocessing as mp
import cv2
"""
Source: Yonv1943 2018-06-17
https://github.com/Yonv1943/Python
https://zhuanlan.zhihu.com/p/38136322
OpenCV official demo
https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html
海康、大华IpCamera RTSP地址和格式(原创,旧版)- 2014年08月12日 2... |
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Classes and functions for managing platform_BootPerf results.
Results from the platform_BootPerf test in the ChromiumOS autotest
package are store... |
import os
from queue import Queue
from threading import Thread
import subprocess
from collections import ChainMap
import io
import importlib
import yt_dlp
import json
import httpx
import glob
from html.parser import HTMLParser
from time import sleep
import sys
from pathlib import Path
from ydl_server.logdb import Jobs... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.