text stringlengths 3.07k 22.1k |
|---|
from __future__ import annotations
import asyncio
import hashlib
from datetime import datetime, date, time, timezone, timedelta
import functools
import pandas as pd
import numpy as np
import typing
from pandas.api.types import is_numeric_dtype, is_datetime64_dtype
class IntLocator:
def __init__(self, tidf: Time... |
#!/bin/env python
"""
Turbofan data preprocessor to download, prepare and split the NASA turbofan data set in needed parts.
"""
import os
import pandas as pd
import random
import argparse
import requests
import zipfile
from tqdm import tqdm
parser = argparse.ArgumentParser(description="Run Data Preprocessor.")
p... |
from astropy import visualization as aviz
from astropy.nddata.utils import block_reduce, Cutout2D
from matplotlib import pyplot as plt
def show_image(image,
percl=99, percu=None, is_mask=False,
figsize=(10, 10),
cmap='viridis', log=False, clip=True,
show_col... |
# Phase harmonic sythesis script using pywph package
import numpy as np
import time
import torch
import scipy.optimize as opt
import pywph as pw
import multiprocessing
print('CPUs"',multiprocessing.cpu_count())
print('GPU count: ' + str(torch.cuda.device_count()) + '\n')
class SoftHistogram(torch.nn.Module):
"""
... |
import os
import sys
from pprint import pprint
import model
from mcutils import menu_manager as mc
class ConfigFiles:
DIRECTORIES = {"input_data": "{}".format(os.path.join(os.getcwd(), "input_data")),
"output": "{}".format(os.path.join(os.getcwd(), "output"))}
class Data:
INPUT_DATA = {}... |
import numpy as np
from scipy import ndimage, optimize
import pdb
import matplotlib.pyplot as plt
import cv2
import matplotlib.patches as patches
import multiprocessing
import datetime
import os
####################################################
def findMaxRect(data):
'''http://stackoverflow.com/a/30418912/5008... |
#
# Copyright 2020- IBM Inc. All rights reserved
# SPDX-License-Identifier: Apache2.0
#
from enum import Enum
from ConnectionSet import ConnectionSet
from NetworkPolicy import PolicyConnections, NetworkPolicy
import Peer
class CalicoPolicyRule:
"""
A class representing a single ingress/egress rule in a Calic... |
# vim: sw=4:ts=4:et:cc=120
import datetime
import logging
from operator import itemgetter
import pytz
import saq
from saq.constants import *
from saq.modules.api_analysis import BaseAPIAnalysis, BaseAPIAnalyzer
from saq.qradar import QRadarAPIClient
#
# Requirements for QRadar queries
#
# to have the log event tim... |
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
from tqdm import tqdm
from matplotlib.colors import LinearSegmentedColormap
# Periodic volume variations
def Vperiodic(t,m=20,p=100,Vavg=2,Vamp=1):
a = 2*np.pi/p
A = np.sqrt(1+(m*np.cos(a*t))**2)
... |
# perhaps this will get bigger...
class Frame(object):
pass
# is it a class?
def is_class(x):
return isinstance(x, type)
# is it an instance? cf. insstance(x,y)
def is_instance(x):
if isinstance(x, type):
return 0
else:
return 1
# what is this class it a subclass of?
# x.__bases__
... |
from collections import Counter, defaultdict
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from metagenomix.io.datainput import save_reads_to_fasta, fill_OTU_results_database
from metagenomix.utils import table_exists, time_exec, timeit, progressbar
def assign_OTU_from_scores(aln_... |
from keras.preprocessing.image import load_img
from keras import Model
from keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau
from keras.models import load_model
from keras.optimizers import Adam
from keras.utils.vis_utils import plot_model
from keras.preprocessing.image import ImageDataGenerator... |
from django.shortcuts import render, redirect
from django.http import Http404, FileResponse
from django.contrib import messages
from zipfile import ZipFile
from plotly.offline import plot
from . import plots
from . import scratch_analysis
from . import unetmodel
from .dash_apps.finished_apps import simpleexample
#from ... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
#sending data
from django.views.decorators.csrf import csrf_exempt # command for csrf exemption
import json
from django.http import JsonResponse,HttpResponseRedirect,HttpResponse
from .models import *
from django.core import serializers
#login
from django.shortcuts import render
from django.contrib.auth imp... |
# -*- coding: utf-8 -*-
from datetime import datetime
from dateutil import parser as date_parser
from itertools import combinations
from slugify import slugify
import re
import string
try:
maketrans = "".maketrans
except AttributeError:
# fallback for Python 2
maketrans = string.maketrans
from . import ... |
"""
This file contains functions to create json metadata used to create
mixtures which simulate a multi-party conversation in a noisy scenario.
Author
------
<NAME>, 2020
"""
import numpy as np
from pathlib import Path
import json
import os
from tqdm import tqdm
import torchaudio
def _read_metadata(file_path, conf... |
import os
from posixpath import split
import PySimpleGUI as sg
from trace import Log
from logicWindows import *
#============================================================#
#=================== Get Path and Files =====================#
def GetPathFiles(data):
Log(None, "GetPathFiles():")
# descobrindo a q... |
import cv2
import numpy as np
import pickle
from PIL import Image
from readwrite import write, ocr_core, writelist
from pixget import getplayers
import os
from multiprocessing import Queue, Process
import itertools
from thefuzz import fuzz
def similar(a,b):
return (fuzz.ratio(a,b))
def processframes(frames, refer... |
import pickle
import sys
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import train_test_split
from sklearn.multi... |
# pylint: disable=C,R,E1101
'''
Architecture to predict molecule energy on database qm7
RMSE test = 5.7
'''
import torch
import torch.utils.data
from se3cnn.blocks.tensor_product import TensorProductBlock
import numpy as np
import scipy.io
import os
import time
class QM7(torch.utils.data.Dataset):
url = 'http:/... |
############################################################################
# Created by: Prof. <NAME>, D.Sc.
# UFF - Universidade Federal Fluminense (Brazil)
# email: <EMAIL>
# Course: Metaheuristics
# Lesson: Variable Neighborhood Search
# Citation:
# PEREIRA, V. (2018). Project: Metaheuristic-Local_Search-Varia... |
from telloFunctions import *
from pynput.keyboard import Key, Listener
import time
import cv2
import threading
import numpy as np
# VARIABLES # ----------------------------------------
# Control panel
listener = None # To check wether listener thread is created
keyPressed = None # Value of pressed keys
trackOn = Fal... |
#!/usr/bin/env python2
#
# dependencies: fontconfig, python-pygame
#
# TODO:
# * Try to reduce CPU usage, currently at ~5%
# - less frequent updates of "static" data (MAC address, hostname,
# stream URL)
# - only redraw what's really necessary instead of the whole block
# * IPv6 address isn't being displayed b... |
"""
Copyright 2018 Johns Hopkins University (Author: <NAME>)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from six.moves import xrange
import pytest
import os
import copy
import numpy as np
f... |
#!/usr/local/bin/python
import traceback
import schedule
import time
import os
import subprocess
import psutil
import boto3
import pickle
import sys, base64, datetime, hashlib, hmac, urllib
import requests # pip install requests
#from datetime import datetime
from operator import itemgetter
rds = boto3.client('rds'... |
# -*- coding: UTF-8 -*-
import re,os,sys,urllib,urllib2,glob,requests,time,shutil
import xbmc,xbmcaddon,xbmcgui,xbmcplugin
from datetime import date, datetime, timedelta
from urllib2 import urlopen
from resources.lib.modules import control
AddonID = control.AddonID
AddonTitle = control.AddonTitle
Notify = control.Not... |
import os
import sys
import re
from argparse import ArgumentParser
import logging
import yaml
kilo_2_significant = lambda x: "%2.2f" % (x / 1000)
two_significant = lambda x: "%2.2f" % x
latency_90 = lambda x: "%2.2f" % x['90.0']
def data_dir(args):
return os.path.join(args.paper_dir, "figs/graphs")
def get_yaml(... |
"""Functions to generate molecule library."""
import os
import json
from itertools import combinations
import numpy as np
import scipy.linalg
from openfermion.hamiltonians import MolecularData
from openfermion.transforms import get_sparse_operator
from openfermionpsi4 import run_psi4
from .load_lib import MOLECULES_... |
import calendar
import datetime
import decimal
import re
from django.core.serializers.json import DjangoJSONEncoder
from typing import Iterator, Optional
from base import constants
class KgDate:
"""
A date class that is more ergonomic to use than ``datetime.date``.
"""
def __init__(self, *, year: in... |
"""
Use label maker (https://github.com/developmentseed/label-maker)
to create training dataset.
author: @developmentseed @NASA-IMPACT
run:
python3 label_maker_get_training_data_from_S3_IL.py
"""
import os, shutil, json, requests, subprocess, base64
from os import makedirs, path as op
import boto3
import numpy ... |
#!/usr/bin/env python
import numpy
import scipy.signal
import pde
import ode
import save
import sys
import logging
from datetime import datetime
#
# function for solving the system in a one temporal step
#
def one_step_evolution(p_density, s_density, police, xx, yy,
p_kernel, cut_off_pirates,... |
######################################################################################################################
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... |
# -*- coding: utf-8 -*-
# <sure - utility belt for automated testing in python>
# Copyright (C) <2010-2017> <NAME> <<EMAIL>>
#
# 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 o... |
# coding: utf-8
# Copyright (C) 2021, [Breezedeus](https://github.com/breezedeus).
# 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 f... |
#! coding=UTF-8
# Copyright 2012 <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 applicable law or agree... |
#!/usr/bin/env python
# coding: utf-8
# 
# # Dirt Simple Matrix Inversion
# [MatrixInversion on Github](https://github.com/ThomIves/MatrixInverse)
# We are going to walk thru a brute force procedural method for inverting a matrix with pure Python. Why wouldn’t we just ... |
# Copyright 2020-present The Material Foundation 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 req... |
#!/usr/bin/env python
from __future__ import print_function
"""This module defines the Yeoman Insight metrics reporter tool."""
__author__ = '<EMAIL> (<NAME>)'
import getopt
import os
import random
import shutil
import sys
import time
PYTHON_VERSION_3 = sys.version_info[0] == 3
if PYTHON_VERSION_3:
import urll... |
import os
import sys
sys.path.append(os.path.abspath(os.path.pardir))
from argparse import ArgumentParser
import torch
from torch import nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import transforms
from torchvision.models import vgg19
from PIL import Image
import matplotlib.pypl... |
# coding: utf-8
"""
this is the source for the yaml utility
"""
from __future__ import print_function
import sys
import os
import io
from textwrap import dedent
from ruamel.std.argparse import ProgramBase, option, sub_parser, version, \
CountAction, SmartFormatter
# from ruamel.appconfig import AppConfig
from .... |
## Django Packages
from django.contrib.gis.db import models
from django.contrib.auth import (
REDIRECT_FIELD_NAME, get_user_model, login as auth_login,
logout as auth_logout, update_session_auth_hash,
)
from datetime import datetime
from django.conf import settings
from django.contrib.postgres.fields import Arr... |
from django.shortcuts import render
#from .models import Trips
from django.db.models import Avg, Count, Max, Min, Sum
from django.http import JsonResponse
from django.views.generic import View
from .forms import QueryForm
from rest_framework.views import APIView
from rest_framework.response import Response
# Create y... |
bl_info = {
"name": "Heightmap Plugin",
"author": "<NAME>",
"version": (1, 0, 3),
"blender": (2, 80, 0),
"location": "View3D > Heightmap Plugin",
"description": "",
"warning": "",
"doc_url": "",
"category": "Object",
}
import bpy, os
from bpy.types import Panel, Operator, GizmoGrou... |
#!/usr/bin/python
# encoding: utf-8
"""
SGE.py
Fragment generation submission module for the Sun Grid Engine.
Created by <NAME> 2013
Use this as a basis for your cluster system module. The following functionality should be provided:
- A FragmentsJob class for array runs which creates a script object member to be ... |
from typing import Callable
import json
import pytest
@pytest.fixture
def path_set_1(client) -> dict:
response = client.get('/paths/bike/green/60.215175,24.980636/60.200423,24.961936')
assert response.status_code == 200
data = json.loads(response.data)
assert len(data) == 2
assert 'edge_FC' in dat... |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
def get_config_schema():
from aksetup_helper import ConfigSchema, Option, \
IncludeDir, LibraryDir, Libraries, BoostLibraries, \
Switch, StringListOption, make_boost_base_options
import sys
if 'darwin' in sys.platform:
import... |
import sys
import numpy as np
import os
from keras.models import model_from_json
from keras.engine.topology import Layer
import theano.tensor as T
import theano.ifelse
from keras import backend as K
from keras.constraints import maxnorm
from keras.models import Model
from keras.layers import Activation, Dense, Dropou... |
# -*- coding: utf-8 -*-
'''
Created on 2017. 10. 31.
@author: HyechurnJang
'''
from core import Tag
# <a>
class A(Tag):
def __init__(self, **attrs): Tag.__init__(self, 'a', **attrs)
# <abbr>
class Abbr(Tag):
def __init__(self, **attrs): Tag.__init__(self, 'abbr', **attrs)
# <address>
class ... |
# -*- coding: utf-8 -*-
import config
from utils import meter
from torch import nn
from torch import optim
from models import PVRNet
from torch.utils.data import DataLoader
from datasets import *
import argparse
def train(train_loader, net, criterion, optimizer, epoch):
"""
train for one epoch on the training... |
# Welcome to the Cairo smart test framework (cairo-smart-test version 0.2.0)
#
# This provides tools for unit- and property-based testing Cairo code from within Python, including the following classes:
#
# * AbstractCairoFunctionClass stores data for calling a cairo function (e.g. the function's name and required built... |
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.model_selection import train_test_split
from sklearn.multiclass import OneVsRestClassifier
from nltk.tokenize import WhitespaceTokenizer
from sklearn import metrics
from sklear... |
import cv2
import numpy as np
import math
import collections
if not cv2.useOptimized():
cv2.setUseOptimized(True)
def crop_roi(image):
h, w = image.shape
cropped_img = image[int(h/2)+20:h,0:w]
return cropped_img
def canny(img, low_threshold, high_threshold):
return cv2.Canny(img, low_threshold, h... |
"""
Created: 17 June 2020
Utils specific for financial security data
"""
import numpy as np
import pandas as pd
from decorators import deprecated
from utils_date import excel_date_to_np
# array methods
def calculate_relative_return_from_array(a: np.array) -> np.array:
"""Calculate relative return of an array"""
... |
import logging
import os
import sys
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstRtsp', '1.0')
from gi.repository import GObject, Gst
from common import nvutils
from common import gstreamer_wrappers as gsw
from common import utils
# Path for pyds library
sys.path.append(os.path.join('/', 'opt', ... |
import numpy as np
import pandas as pd
from pandas import DataFrame, Series
import random
import time
import math
import datetime as dt
import random
import copy
from datetime import datetime
from time import mktime
import os
import json
from functools import cmp_to_key
from itertools import groupby
impo... |
import csv
import hashlib
import inspect
import logging
from numbers import Number
from namespace import *
import codecs
import os
import petl as etl
import re
from loader.prefixes import PREFIX_LANGUAGE, PREFIX_MULTIMEDIA
from lxml import etree
from petl.util.base import Table
from rdflib import Literal, RDF, RDFS, ... |
# Author: <NAME>
# Time: 2020-5-18
import torch
import torch.nn as nn
from .efficientnet import get_same_padding, Swish
import torch.nn.functional as F
from collections import OrderedDict
class Conv2dSamePadding(nn.Conv2d):
"""Conv2dDynamicSamePadding
由于输入大小都是128的倍数,所以动态卷积和静态卷积的结果是一致的。此处用动态卷积代替静态卷积,因为实现方便。
... |
from collections import Counter
import json
import logging
import os
from google.appengine.ext import ndb
from google.appengine.api import urlfetch
from google.appengine.api import search
from google.appengine.ext import deferred
import sys
from google.appengine.runtime import apiproxy_errors
import constants
def f... |
import torch
import torch.nn as nn
from overrides import overrides
from claf.decorator import register
from claf.model.base import ModelWithTokenEmbedder
from claf.model.reading_comprehension.mixin import SQuADv1
import claf.modules.functional as f
import claf.modules.attention as attention
import claf.modules.encode... |
import datetime
import pytz
import json
import string
from urllib.request import Request, urlopen
from autonomus.models import Tag, Event, Link,User
from dateutil import parser
from autonomus.controllers import tags_controller, events_controller
import requests
import re
from autonomus.utils import sms
from concurrent... |
#!/usr/bin/env python3
"""
This script processes an SDC constraint file and replaces all references to
pin names in place of net names with actual net names that are mapped to those
pins. Pin-to-net mapping is read from a PCF constraint file.
Note that this script does not check whether the net names in the input PCF
... |
from config import *
import move_chess as MC
import config as CF
import value_chess as VC
# -*- coding: utf-8 -*-
def init_chess_pieces():
#init white piece characters
chess_pieces['b_pawn'] = u"♙"
chess_pieces['b_knight'] = u"♘"
chess_pieces['b_rook'] = u"♖"
chess_pieces['b_bishop'] = u"♗"
... |
import json
import os
import pytest
import re
from time import sleep
from django.core.signing import get_cookie_signer
from django.urls import path
from formset.views import FormView
from .forms.upload import UploadForm
class DemoFormView(FormView):
template_name = 'testapp/native-form.html'
form_class=Upl... |
from django.shortcuts import render
from django.http import HttpResponse
from bs4 import BeautifulSoup
import requests
import re
import string
def index(request):
return render(request, "pages/index.html")
def frekans(request):
return render(request, "pages/frekans.html")
def frekansResult(request):
u... |
import numpy as np
import os
#import seaborn as sns
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.stats import gaussian_kde
from matplotlib.colors import LinearSegmentedColormap
xgfs_normal6 = [(64, 83, 211), (221, 179, 16), (181, 29, 20), (0, 190, 255), (251, 73, 176), (0, 17... |
# -*- coding: utf-8 -*-
"""
CUDA_VISIBLE_DEVICES=0 python main.py \
--dataset YOUR_DATA_SET --result_dir results --img_size 384 --device cuda:0 --num_workers 1 \
# G网络计算AdaLIN的大小
--light -1 \
# 指标打印
--print_freq 1000 --calc_fid_freq 10000 --save_freq 100000 \
# 模型ema
--ema_start 0.5 --ema_beta 0.9999 \
# 分割损失
--seg_fix... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2014-2016 bromix (plugin.video.youtube)
Copyright (C) 2016-2018 plugin.video.youtube
SPDX-License-Identifier: GPL-2.0-only
See LICENSES/GPL-2.0-only for more information.
"""
from ...kodion.utils.function_cache import FunctionCache
from ... import kodion
fro... |
# Copyright 2021 <NAME> (@vaibhav016)
# Copyright 2021 Dr <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/licenses/LICENSE-2.0
#
# Unless required by app... |
import os
import sqlite3
from flask import Flask, render_template, redirect, flash, url_for, safe_join, send_file, jsonify, request
from datetime import datetime
from pygate_grpc.client import PowerGateClient
from map import app
import requests
images_db = "map/deplatformr-open-images.sqlite"
api = os.getenv('POWERGA... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from keras.preprocessing import text, sequence
from keras.preprocessing.text import Tokenizer
from keras.utils import to_categorical
from keras.models import *
from keras.layers import *
from keras.optimizers import *
from sklearn.model_selection im... |
import logging
import grpc
import departure.board.view_model as view_model
import departure.board.contents as contents
import departure.commons.helpers as helpers
import departure.board.departure_pb2 as departure_pb2
import departure.board.protobuf as protobuf
# type hinting
import departure.board.departure_pb2_grpc... |
#
# aydao ~ 2019
#
# Convert taki0112 StyleGAN checkpoints to network-snapshot-######.pkl StyleGAN models
#
# This script relies on both the NVlabs StyleGAN GitHub repository and the taki0112 StyleGAN repo
# It assumes both are in the same directory as this script
#
from StyleGAN import StyleGAN
import argparse... |
# telemetry_obd/obd_logger.py: Onboard Diagnostic Data Logger.
"""
telemetry_obd/obd_logger.py: Onboard Diagnostic Data Logger.
"""
from sys import stdout, stderr
from os import fsync
from datetime import datetime, timezone
from pathlib import Path
from argparse import ArgumentParser
from pint import OffsetUnitCalculus... |
import hashlib
import warnings
from dataclasses import asdict, dataclass, field
from datetime import datetime
from enum import Enum
from typing import Any, Dict, Generator, List, Optional, Set
from airflow.providers.mongo.hooks.mongo import MongoHook
from bson import ObjectId
DEFAULTS = {"mongo_collection": "ideafast... |
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
import json
import datetime
class Reader:
"""
A reader class stores base info about one person.
:param name: str
:param lection, psalm, believers_pray: bool. Describe relation of reader towards lection function.
:param speech_number: ind. Number of speech... |
from stock import PCLASS, MAIN
import re, sys
from emitter import Emitter
class GrammarObj(object):
def __str__(self):
return self.name
def __repr__(self):
s = self.name + '['
for k,v in self.attrs:
s += "{}:{}, ".format(k,v)
s += ']'
return s
def __init... |
import logging
import os
import enum
from jinja2 import (Environment, FileSystemLoader, TemplateNotFound)
from graviteeio_cli.exeptions import GraviteeioError
from graviteeio_cli.extensions.jinja_filters import filter_loader
from graviteeio_cli.commands.apim.apis.utils import update_dic_with_set
from graviteeio_cli.c... |
import torch
import torchvision
import torch.nn as nn
import torch.nn.functional as F
import math
class Memory:
def __init__(self):
self.actions = []
self.states = []
self.logprobs = []
self.rewards = []
self.is_terminals = []
self.hidden = []
d... |
from core.resource.pool import Constraint, ConnectionConstraint, ResourceDevice, DevicePort, ResourcePool
class PhoneMustBeAndroidConstraint(Constraint):
"""
判断手机必须是安卓系统,可以附带版本大小判断
"""
def __init__(self, version_op=None, version=None):
super().__init__()
self.version = version
... |
"""
Copyright (c) 2020 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WI... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making GameAISDK available.
This source code file is licensed under the GNU General Public License Version 3.
For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package.
Copyright... |
#
# Memento
# Backend
# Notification Ops
#
import time
import gevent
from flask import jsonify
from datetime import datetime
from ..app import db
from ..models.notification import *
from ..mapping.notification import *
from ..utils import apply_bound, map_dict
from ..api.error import NotFoundError
from ..messaging.br... |
"""
generic format,
meant to be an abstraction of
any sequence-like format.
Consists of ``Annotation``s,
each with a ``Sequence`` made up
of ``Segment``s.
Functions in this module
load the format from a .csv,
or write a .csv in the generic format.
Other formats that convert to ``Annotation``s
with ``Sequence``s can b... |
# Advent of Code 2018, Day 15
# (c) blu3r4y
import os
import copy
from abc import abstractmethod
from enum import Enum
from itertools import count
from typing import List, Optional
from colorama import Fore, Back, Style
class Cell:
"""
Abstract class for any cell within the matrix
"""
@abstractmeth... |
import inspect
import os
import pytest
import multiprocessing as mp
from pathlib import Path
from py_config_runner import ConfigObject, load_module
def test_config_object(config_filepath):
config = ConfigObject(config_filepath)
assert "a" in config
assert config["a"] == config.a == config.get("a") == 1
... |
"""
Shared unittests for Swift and S3
=================================
This file contains a number of shared tests that vary only based upon which concrete class
(SwiftPath or S3Path) is tested.
"""
import functools
import gc
import gzip
import mock
import six
from stor import obs
from stor.tests.shared import ass... |
import streamlit as st
import plotly.express as px
import pandas as pd
import numpy as np
import plotly.graph_objects as go
from plotly.subplots import make_subplots
class Loan(object):
def __init__(self, principle, rate, term_months):
self.principle = principle
self.rate = rate
self.term_m... |
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_auc_score
from sklearn.metrics import average_precision_score
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.ensemble import AdaBoostClassifier
import xgboost as xgb
from skl... |
import os
import sys
from typing import Callable, List, Tuple, Union, Optional
import mxnet as mx
import numpy as np
from . import lm_common
from . import lm_model
sys.path.append('../')
import sockeye.constants as C
from sockeye import utils
from sockeye.vocab import Vocab, load_source_vocabs, vocab_from_json, are... |
import sys, os, shutil
import time
import io
from absl import app, flags, logging
import tempfile
import yaml
from pathlib import Path
import torchtext
from torchtext import data, datasets
import torch
import torch.optim as optim
import torch.nn as nn
from transformers import BertTokenizer, BertModel
import opacus
im... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.module import Module
import numpy as np
from collections import deque
import math
#================================================
#++ Prepare Environment state as input for NNs ++
#====================================... |
# imports framework
import sys
sys.path.insert(0, 'evoman')
from environment import Environment
from our_controller import player_controller
# imports other libs
import time
import numpy as np
import pandas as pd
from scipy.stats import hmean
import matplotlib.pyplot as plt
import pickle
import glob, os
import math
m... |
"""
test_mutant.py
Copyright 2006 <NAME>
This file is part of w3af, http://w3af.org/ .
w3af 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 version 2 of the License.
w3af is distributed in the hope that it will... |
'''
Created on Jun 12, 2013
@author: <NAME> <EMAIL>
'''
import scipy.stats as sc_stats
import numpy as np
import pandas as pd
from datetime import datetime
import pytesmo.temporal_matching as temp_match
import pytesmo.scaling as scale
import pytesmo.metrics as metrics
import pytesmo.time_series.anomaly as anomaly_c... |
"""
Active wave breaking segmentation using the neuralnets from
https://github.com/caiostringari/deepwaves
Warning: These models were trained on offshore data. We are applying them to
suf zone data. Do not expect greate results.
PROGRAM : offline_wave_breaking_segmentation.py
POURPOSE : Segmente active wav... |
# -*- coding: UTF-8 -*-
from django.shortcuts import render_to_response, redirect
from forms import *
from django.template import RequestContext
from django.contrib.auth import authenticate, login
from web.models import Book, Reader, Circulation
from django.core.exceptions import ObjectDoesNotExist
from datetime import... |
import hashlib
import os
import re
import subprocess
from exceptions import OptionError
NON_CLI_OPTIONS = {'prepend_statements', 'append_statements'}
CLI_ONLY_OPTIONS = {'mode',}
NORMALIZED_NON_CLI_OPTIONS = {
'jobs_dir', 'target_func_name', 'argument_iterable_name',
'queue', 'processes', 'env', 'prepend_script', 'a... |
import logging, sys, struct, math
from serial import Serial
from kiwi import Kiwi
from datetime import datetime, timedelta
from common import ts2dt, dt2ts
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter
def birdseye_read(kiwi, downsample_N):
config = kiwi.get_config(use_cached=True)
... |
import requests
import re
import sys
import time
import http.cookiejar
import os.path
from win32_setctime import setmtime
from html import unescape
import time, datetime
import glob
import urllib.parse
def sanitize_filename(filename):
return filename.replace("/", "/")\
.replace(":", "։")\
.replace("*", ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.