text stringlengths 3.07k 22.1k |
|---|
"""
The purpose of this script is to compare the HMF that RESOLVE used (Warren et.
al 2006) with the HMF I use for abundance matching from the Vishnu simulation
to see if a difference exists and if so, perhaps accounts for the difference
in logmh_s vs grpms for centrals between my AM and that of RESOLVE
"""
from cosm... |
# Copyright 2013-2015 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
#Regression & Classification
#1. Description
'''
Dataset:
1. This dataset explores different factors affecting the people's
rating for a particular food item.
2. Dataset contains over 20k recipes listed by recipe rating,
nutritional information and assigned category (sparse).
Objective (Regression):
1. The obje... |
# coding: utf-8
import sys
import os
import time
import logging
import numpy
import pycuda.driver as cuda
import pycuda.autoinit
import tensorrt as trt
logging.getLogger().setLevel(logging.INFO)
# Simple helper data class that's a little nicer to use than a 2-tuple.
class HostDeviceMem(object):
def __init__(sel... |
import pygame
import os
pygame.init()
def fill(surface, color): # Change colors of image
"""Fill all pixels of the surface with color, preserve transparency."""
w, h = surface.get_size()
r, g, b, _ = color
for x in range(w):
for y in range(h):
a = surface.get_at((x, y))[3]
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#Input:
# input NIfTI filename, e.g. DWI.nii
# full-width half maximum, e.g. 4
#Output
# Binary NIfTI image with 'z' prefix
#Example Usage
# python dog.py ./DWI.nii 4
import nibabel as nib
from scipy import ndimage
import numpy as np
import scipy.stats as st
import os... |
#!python
import airlines
import re, argparse, datetime
# tag::header[]
def read_flight_records(file_path: str):
"""\
Read flight records from a given file and returns the list of take-off records.
Each element is a dict with keys: date, time, code, airline, destination, take-off
Args:
file_... |
import time
import pandas as pd
import numpy as np
import sklearn
from sklearn.model_selection import train_test_split
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
from torch.utils.tensorboard import SummaryWriter
fro... |
# -*- coding: utf-8 -*-
import asyncio
from graia.broadcast import Broadcast
from graia.application import GraiaMiraiApplication, Session
from graia.application.message.elements.internal import Plain
from graia.application.message.elements.internal import At
from graia.application.message.elements.internal import App... |
"""
Emmio console user interface.
"""
import os
import sys
import termios
import tty
from emmio.language import Language
__author__ = "<NAME>"
__email__ = "<EMAIL>"
colors = {
"grey": "2",
"black": "30",
"red": "31",
"green": "32",
"yellow": "33",
"blue": "34",
"magenta": "35",
"cyan... |
#!/usr/bin/env python3
########################################
########################################
##
## Copyright (C) 2014 Korovasoft, Inc.
##
## File:
## \file build.py
##
## Description:
## \brief Python build script.
##
## Author:
## \author <NAME>
##
#######################################... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyspark import SparkConf, SparkContext
from pyspark.sql import SparkSession, Row
from pyspark.ml.linalg import Vectors
from pyspark.ml.classification import \
LogisticRegression,\
DecisionTreeClassifier,\
DecisionTreeClassificationModel,\
Rando... |
"""
mpunet fusion model training script
Optimizes a mpunet fusion model in a specified project folder
The fusion model takes a set of class-probability vectors, one from each view
of a mpunet model, and merges them into a single class-probability
vector. The fusion model learns to apply additional or reduced weight to... |
"""
This is common function codes used by devtool apis.
"""
import enum
import re
import typing
import nitsm.codemoduleapi
from nitsm.codemoduleapi import SemiconductorModuleContext as SMContext
from nitsm.pinquerycontexts import PinQueryContext
_pin_names = [] # pin cache
_pin_types = [] # pin type cache
# class... |
# -*- coding: UTF-8 -*-
# Copyright 2014-2018 <NAME>
#
# License: BSD (see file COPYING for details)
"""
Database models for `lino_xl.lib.humanlinks`.
"""
from __future__ import unicode_literals
from __future__ import print_function
from builtins import str
import logging
logger = logging.getLogger(__name__)
from ... |
# 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 base64
import hashlib
import itertools
import urllib.parse
from pathlib import Path
from typing import Dict, Iterable, List, Optional... |
from __future__ import annotations
from collections import OrderedDict
import itertools
import os
import os.path as osp
from typing import Dict, List, Optional, OrderedDict as OrderedDictType, TypeVar
import matplotlib as mpl
import numpy as np
from .data import Sequence
from .metrics import SegmentMetrics, Transform... |
# Copyright 2019-2021 The University of Manchester, UK
# Copyright 2020-2021 Vlaams Instituut voor Biotechnologie (VIB), BE
# Copyright 2020-2021 Barcelona Supercomputing Center (BSC), ES
# Copyright 2020-2021 Center for Advanced Studies, Research and Development in Sardinia (CRS4), IT
#
# Licensed under the Apache Lic... |
"""
Plot a latent mean projection.
"""
__date__ = "July-October 2019"
from numba.errors import NumbaPerformanceWarning
import matplotlib
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import os
import numpy as np
import joblib
import umap
import warnings
from ava.dat... |
#!/bin/python
import glob
import json
import os
import subprocess
import sys
import time
import traceback
from datetime import datetime
import gflags
import pybars
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from common import misc # noqa
FLAGS = gflags.FLAGS
gflags.DEFINE_string("e... |
"""Calculate Raman linestrength for common gas species."""
import numpy as np
from ._constants import mol_const, univ_const
def linewidth_isolated(pressure, temperature, j):
r"""Temperature-dependent Raman linewidths of N2 from :cite:`Farrow:82`.
.. admonition:: Deprecated
:class: attention
Us... |
from typing import List
import pandas as pd
import datetime
import abc
import enum
import re
import twint
import bs4
import feedparser
import requests
from .styles import Styles
def htmlize(text: str) -> str:
"""
Generate HTML text from a text string, correctly formatting paragraphs etc.
"""
# TODO... |
# -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use
# (c) Copyright IBM Corp. 2010, 2022. All Rights Reserved.
"""Function implementation"""
import datetime
import logging
from circuits import Event, Timer
from resilient_circuits import ResilientComponent, handler
from resilient_lib import v... |
import pandas as pd
import pdb
import numpy as np
import random
import math
import argparse
import tensorflow as tf
import matplotlib.pyplot as plt
from keras import losses
from keras import models
from keras import regularizers
from keras.layers.core import Dense
from keras.layers.core import Dropout
from keras.laye... |
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
'''
geetest offline 5.9.0 - 6.0.0 spider for nm.gsxt.gov.cn
HTTP协议与其他站点略有不同
'''
import time
import random
import logging
from logging import NullHandler
import requests
import execjs
from bs4 import BeautifulSoup
import constants
import util
logging.ge... |
# from app import db, ma
from app.extensions import db, ma
from datetime import datetime
import redis
import rq
from flask import current_app
class EnrollmentTerm(db.Model):
__tablename__ = "enrollment_terms"
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String)
start_at = db.Column... |
import json
from argparse import ArgumentParser
import librosa
import sys
from tqdm import tqdm
from librosa.filters import mel as librosa_mel_fn
import soundfile as sf
import os
import torch.nn as nn
import torch
import numpy as np
import yaml
from torch.nn import functional as F
sys.path.append("..")
from vc_model i... |
# -*- coding: utf-8 -*-
"""
Created on Mar 23 15:29 2017
@author: <NAME>'
"""
from __future__ import division
import os
import json
import numpy as np
from lifting.utils import config
import cv2
import skimage.io
import skimage.transform
import scipy.ndimage as ndimage
import scipy.ndimage.filters as filters
from ite... |
import argparse
import json
import os
import tempfile
import typing as t
import zipfile
from pathlib import Path
import cv2
import numpy as np
import requests
import tqdm
import trimesh
import trimesh.repair
from collections import OrderedDict
OBJECTS_TO_RENDER = OrderedDict(
{
"02691156": [
"... |
##############################################################################
#
# Copyright (c) 2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Converter from MISP to MS-Graph format."""
import logging
import json
from datetime import datetime, timezone, timedelta
# TODO:
# keep track of pushed IOCs
# uuid, timestamp, time expiration
# if time expiration > now, remove from list
# if uuid and timestamp exist ... |
"""Represents a device for xcrun simctl."""
from typing import Any, Dict, List, Optional
import xcrun.simctl.runtime
import xcrun.simctl.listall
import xcrun.simctl
class MultipleMatchesException(Exception):
"""Raised when we have multiple matches, but only expect a single one."""
class DeviceNotFoundError(Exce... |
import threading
import os
from multiprocessing.connection import Client
try:
import Queue as queue
except ImportError:
import queue
__all__ = ["Adafruit_DotStar", ]
# // Method names are silly and inconsistent, but following NeoPixel
# // and prior libraries, which formed through centuries of accretion.
HOS... |
"""
Data preparation for mobvoihotwords.
Author
------
<NAME>
"""
import os
from os import walk
import glob
import shutil
import logging
from typing import Coroutine
import torch
import re
import hashlib
import copy
import numpy as np
from speechbrain.utils.data_utils import download_file
from speechbrain.dataio.da... |
from django_filters import filters
from rest_framework import mixins, generics, viewsets
from rest_framework.generics import ListAPIView
from rest_framework.response import Response
from django.utils import timezone
from data_facility_admin.models import User
from .. import models
from . import serializers
from django... |
import mock
from mock import patch
import unittest
from vnc_api.vnc_api import *
from svc_monitor.vrouter_instance_manager import VRouterInstanceManager
from svc_monitor.config_db import *
class VMObjMatcher(object):
"""
Object for assert_called_with to check if vm object is created properly
"""
def __... |
# Copyright 2016 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
"""Export Ecobee metrics for Prometheus."""
import logging
import re
import shelve
from datetime import datetime
from time import sleep
import pytz
from prometheus_client import Gauge # type: ignore
from pyecobee import * # type: ignore
class EcobeeAuth():
"""Authorize Ecobee token."""
def __init__(self, eco... |
#!/usr/bin/env python3
# Author: <NAME> <<EMAIL>>
# Copyright 2018 Raytheon BBN Technologies Corp.
import sys, docker, subprocess, argparse, os, tarfile
from shutil import copyfile
from ContainerConfig import ContainerConfig
def start_container(conf, docker_client, args):
''' Operates only on containers defined... |
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.utils import timezone
from rest_framework import status, viewsets
from rest_framework.decorators import action
from rest_framework.exceptions import ValidationError
from rest_f... |
import torch
import torch.nn as nn
import torch.nn.functional as func
import torchsupport.distributions as dist
def sample(dist):
value = dist.sample()
logprob = dist.log_prob(value)
return value, logprob
def rsample(dist):
value = dist.rsample()
hard_value = dist.harden(value)
logprob = dist.log_prob(val... |
# The MIT License (MIT)
# Copyright (c) 2016 <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 without limitation the rights
# to use, copy, modify, merg... |
#!/usr/bin/env python
# * @author Devb
# * @License Apache 2.0
#
import logging
import time
from datetime import date, datetime
from flask import Flask
from flask.helpers import make_response
from flask_restful import Api, Resource
import urllib.request
import random
from consclient import *
app = Flask(__name__)
... |
import argparse
import numpy as np
from collections import OrderedDict
import torch
from torch import nn
from torch import optim
from torchvision import datasets,transforms,models
from torch.utils.data import DataLoader
# Setting random seed
torch.manual_seed(0)
torch.cuda.manual_seed(0)
np.random.seed(0)
def proces... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# moving mnistデータセットの生成スクリプト
from PIL import Image
import sys
import os
import math
import numpy as np
import gzip
if sys.version_info[0] == 2:
from urllib import urlretrieve
else:
... |
import os
import logging
import grpc
import service
import service.service_spec.style_transfer_pb2_grpc as grpc_bt_grpc
from service.service_spec.style_transfer_pb2 import Image
import subprocess
import concurrent.futures as futures
import sys
from PIL import Image as PIL_Image
import datetime
import hashlib
logging.b... |
import numpy as np
import tensorflow as tf
from maml_rl.utils.tf_utils import weighted_mean, clone_policy, flatgrad, SetFromFlat, GetFlat, detach_distribution
from .base import BaseOptimizer
class ConjugateGradientOptimizer(BaseOptimizer):
"""
Performs constrained optimization via line search. The search dir... |
import os, sys, h5py
import numpy as np
import pandas as pd
import subprocess
def enforce_constant_size(bed_path, output_path, window, compression=None):
"""generate a bed file where all peaks have same size centered on original peak"""
# load bed file
f = open(bed_path, 'rb')
df = pd.read_table(f, h... |
"""Functions to interpret user input in "Guide for Non-Coders.ipynb"
to simplify useage of wrangling.nanodrop.tidy_data()
Objects
-------
clean_legend_locations : list
a human-readable list of legend locations for bokeh plots
allowed_legend_locations : list
inputs that can be intepreted as legend locations fo... |
#!/usr/bin/python3
"""
_ _
(_) | |
_ __ _ __ __ ___ | |
| '__| | | \ \/ / / _ \ | |
| | | | > < | __/ | |
|_| |_| /_/\_\ \___| |_|
PyTessy
=======
Tesseract-OCR, faster!
This module allows faster access to Tesseract-OCR from Python scripts.
This mod... |
from django.shortcuts import render, redirect
from pages.forms import FormularioPost
from django.contrib import messages
from django.db import connection
from pages.models import Post
from django.core.paginator import Paginator
from bs4 import BeautifulSoup
from urllib.request import urlopen
from careerjet_api import ... |
#!/usr/bin/env python3
"""
Author : schackartk
Date : 2019-04-17
Purpose: Generate a game of sudoku
"""
import argparse
import sys
import random
import re
# --------------------------------------------------
def get_args():
"""get command-line arguments"""
parser = argparse.ArgumentParser(
descript... |
import numpy as np
import scipy.io as sio
import pickle
from typing import List
class LoadDataset(object):
def __init__(self, opt, main_dir, is_val=True):
txt_feat_path = main_dir + 'data/CUB2011/CUB_Porter_7551D_TFIDF_new.mat'
if opt.splitmode == 'easy':
train_test_split_dir = main_di... |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats
from ..stats import mad, summary_plot
from .hrv_utils import _hrv_get_rri, _hrv_sanitize_input
def hrv_time(peaks, sampling_rate=1000, show=False, **kwargs):
"""Computes time-domain indices of Heart ... |
from tensorflow import keras
import tensorflow as tf
import numpy as np
import math
from tensorflow.keras.models import Model
class FGSM:
def __init__(self, model, ep=0.3, isRand=True, clip_min=0, clip_max=1):
"""
args:
model: victim model
ep: FGSM perturbation bound
... |
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver import Chrome
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from argparse import ArgumentParser
from .models import Exam, Course
from typing import List
from .models.course import Co... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.postgres.fields import ArrayField
import uuid
import os
from django.contrib.auth.models import User
from talentalps.models import BaseModel
from talentalps import constants
def get_avatar_image_path(instance, fil... |
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Toolchain """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import pri... |
from __future__ import annotations
import asyncio
import logging
from datetime import timedelta
import functools
from pykefcontrol.kef_connector import KefAsyncConnector
import voluptuous as vol
import homeassistant.util.dt as hass_dt
import homeassistant.helpers.config_validation as cv
import homeassistant.helpers.a... |
"""### Linear Regression Diagonostics and Residual Plots
- linear regression assumptions, residual plots, robust standard errors
- outliers, leverage, multicollinearity
- statsmodels, St Louis Fed FRED
<NAME>
License: MIT
"""
import numpy as np
import pandas as pd
from pandas import DataFrame, Series
import matplotli... |
import unittest
import unittest.mock as mock
import numpy as np
from nuplan.database.utils.plot import build_color_mask, draw_masks, image_with_boxes, rainbow
from PIL import Image, ImageDraw
class TestRainbow(unittest.TestCase):
""" Test the rainbow. """
def test_number_colors(self) -> None:
""" Ch... |
#STANDARD LIB
import datetime
import decimal
import warnings
#LIBRARIES
from django.conf import settings
from django.db.backends import (
BaseDatabaseOperations,
BaseDatabaseClient,
BaseDatabaseIntrospection,
BaseDatabaseWrapper,
BaseDatabaseFeatures,
BaseDatabaseValidation
)
try:
from dja... |
import numpy as np
import matplotlib.pyplot as plt
plt.ion()
from fitstools import mask_fits, row_avg, manage_dtype, common_header, pad_array, display
from spectra import spectrum, interp_add, rmean_spectra, scale_spectra
from astropy.io import fits
class fibers:
def __init__(self, init_spectra={}, init_header=Non... |
from __future__ import print_function
import json
import os
import random
import datetime
from collections import defaultdict, OrderedDict
import numpy as np
from pybullet_planning import add_line, create_cylinder, set_point, Euler, quat_from_euler, \
set_quat, get_movable_joints, set_joint_positions, pairwise_co... |
# GUM: GAMBIT Universal Model Machine
# ***********************************
# \file
#
# Contains all routines for Vevacious output from SARAH.
#
# *************************************
#
# \author <NAME>
# (<EMAIL>)
# \date 2018, 2019, 2020
#
# \author <NAME>
# (<EMAIL>)
# \date 2020
#
# ***... |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2017, 2018, 2019, 2020, 2021, 2022 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Flask application configuration."""
import copy
import json
... |
#!/usr/bin/env python
"""control.py: Reversi Game General Control Code.
This program provides the general functions that are used in the reversi game.
The AI control functions are included in a separate file "AI.py". When called
by "model.py" module, it returns the corresponding results that are needed by
the ... |
import string
from asyncio import sleep
from datetime import datetime, timezone
from re import U
import cogs.utils.logs as logger
import cogs.utils.context as context
import discord
from data.case import Case
from discord.ext import commands
from expiringdict import ExpiringDict
from fold_to_ascii import fold
from asy... |
import os
import sys
import time
import json
import numpy as np
from random import choice
import requests
import reip
# import os
# import time
import glob
import traceback
ALPHABETICALLY = lambda f: f.split('/')[-1]
def get_upload_files(*patterns, interval=12, empty_interval=1, sort=ALPHABETICALLY, min_mtime=3):
... |
import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import os
import re
from minitoolboxVB import FeatureSelection, DropImpute,Outliers
#from tkinter.filedialog import askopenfilename
#MLE Methods
from sklearn.model_selection import train_test_... |
# *****************************************************************************
# © Copyright IBM Corp. 2018. All Rights Reserved.
#
# This program and the accompanying materials
# are made available under the terms of the Apache V2.0
# which accompanies this distribution, and is available at
# http://www.apach... |
'''
configure
=========
Configure icons, stylesheets, and resource files.
'''
import argparse
import glob
import json
import os
import re
import sys
home = os.path.dirname(os.path.realpath(__file__))
def parse_args(argv=None):
'''Parse the command-line options.'''
parser = argparse.ArgumentPars... |
"""A simple torch based gridworld."""
import numpy as np
import torch
from gym.spaces import Discrete
# Define the default tensor type
torch.set_default_tensor_type(
torch.cuda.FloatTensor if torch.cuda.is_available() else torch.FloatTensor
)
# Grid constants
OBSTACLE = 2
GOAL = 6
class IterableDiscrete(Discre... |
from ctypes import *
from ctypes.wintypes import *
from win32api import *
from win32process import *
ntdll = WinDLL('ntdll')
current_process = GetCurrentProcess()
NTSTATUS = LONG
ULONG_PTR = WPARAM
ACCESS_MASK = DWORD
STATUS_SUCCESS = NTSTATUS(0).value
STATUS_BUFFER_OVERFLOW = NTSTATUS(0x80000005).value
STATUS_NO_M... |
# Copyright (C) 2018-2019 <NAME>
# SPDX-License-Identifier: Apache-2.0
from collections import deque
import numpy
import dolfin
from ocellaris.probes.free_surface_locator import get_free_surface_locator
from ocellaris.utils import get_local
class LevelSetView:
def __init__(self, simulation):
"""
... |
import json
# Poleg modela je še slovar.py, ki je uporabljen v obeh vmesnikih.
# razred za beleženje in prikazovanje števila iskanj posameznih kombinatoričnih števil
class Zbirka_stevil:
def __init__(self, ime, datoteka):
self.ime = ime
self.datoteka = datoteka
def zabelezi(self, stevi... |
import copy
import os
import tempfile
import shutil
import pytest
from imageio import imread
from pandas import read_csv
import numpy as np
from histomicstk.annotations_and_masks.annotation_and_mask_utils import \
get_scale_factor_and_appendStr, scale_slide_annotations, \
get_bboxes_from_slide_annotations
from ... |
# coding=utf-8
# Copyright 2021 TUNiB Inc.
# Copyright 2021 The EleutherAI and HuggingFace Teams. 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.apach... |
# Filename: controllers.py
"""
Globe Indexer API Controller Module
"""
# Standard libraries
import json
import os
# Python 3.5+
try:
from http import HTTPStatus as StatusCodes
except ImportError:
# Python 3
from http import client as StatusCodes
# Flask
import flask
# Globe Indexer
from globe_indexer i... |
# Copyright 2015 <EMAIL>
# Copyright 2016-2017 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
#!/usr/bin/env python3
import argparse
import html.parser
import pathlib
import platform
import subprocess
import sys
import urllib.error
import urllib.parse
import urllib.request
from logging import DEBUG, INFO, basicConfig, getLogger
from typing import *
__version__ = '1.0.0'
logger = getLogger(__file__)
def subc... |
"""
Continue on from here : https://docs.streamlit.io/en/stable/
Todo:
* Initiate Unsupervised Labeling
** Clean up UI.
** Allow UI option to specify minimum number of labels, per category
** Update Active Labeled List with an index, only if that has not already been added to that category.
... |
import json
from dataclasses import dataclass, field, asdict
from typing import Any, Dict, Optional, List, Union
from spins_halp_line.constants import Script_New_State, Script_End_State
from spins_halp_line.resources.numbers import PhoneNumber
from spins_halp_line.resources.redis import new_redis
from spins_halp_line.... |
#!/usr/bin/env python
# encoding: utf-8
"""
@File: hsbox.py
@Author: ClanceyHuang
@Time: 19-3-6 上午9:19
@Desc: 炉石盒子的卡组和卡组合集类
@Version: Python
"""
import json
import logging
import multiprocessing
import re
from datetime import datetime
import requests
import scrapy
from scrapy.crawler import CrawlerProcess
from .core... |
import os
from datetime import datetime
from reinforcement_learning.crypto_market.crypto_trader_agent import CryptoTraderAgent
import sys
from reinforcement_learning.crypto_market.util import State
sys.path.insert(0, '../../../etf_data')
from etf_data_loader import load_all_data_from_file2
import numpy as np
impor... |
import turtle
import random #We'll need this later in the lab
import time
turtle.bgcolor("black")
turtle.tracer(1,0) #This helps the turtle move more smoothly
SIZE_X=800
SIZE_Y=500
turtle.setup(1000, 1000) #Curious? It's the turtle window
#size.
turtle.penup()
SQUARE_SIZE = 20
START_L... |
#!/usr/bin/env python
from __future__ import print_function
from collections import OrderedDict
import getopt
import sys
import yaml
class quoted(str): pass
def quoted_presenter(dumper, data):
return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='"')
yaml.add_representer(quoted, quoted_presenter)
... |
# The MIT License (MIT)
#
# Copyright © 2021 <NAME>, <NAME>, <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 without limitation the
# rights to use, copy... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Circle, Rectangle
from matplotlib.collections import PatchCollection
from itertools import product
from itertools import groupby as gb
import networkx as nx
from garageofcode.mip.solver import get_solver
from garageofcode.common.utils ... |
# Gcode display / edit widget for QT_VCP
# Copyright 2016 <NAME>
#
# 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 2 of the License, or
# (at your option) any la... |
# pylint: disable=C0103
from __future__ import absolute_import
import pandas as pd
import re
import sys
import unicodedata
import codecs
import xmltodict as xd
from dateutil import parser
import arrow
import gzip
import numpy as np
import string
from six import unichr
from lxml import etree
from docopt import docopt
... |
"""Implements layers for the spectral CNN."""
from .spectral_pool import _common_spectral_pool
from .frequency_dropout import _frequency_dropout_mask
import numpy as np
import tensorflow as tf
class default_conv_layer(object):
def __init__(self, input_x, in_channel, out_channel,
kernel_shape, ran... |
"""
example cmdline:
python test/reproduction/mo/benchmark_mo_botorch_math.py --problem dtlz2-12-2 --refit 1 --n 200 --rep 1 --start_id 0
"""
import os
import sys
import time
import numpy as np
import argparse
import pickle as pkl
#sys.path.insert(0, '../botorch/') # for dev
sys.path.insert(0, os.getcwd())
from m... |
import numpy as np
from numpy.linalg import norm
__all__ = [
'FLOAT_EPSILON',
'constants',
'geom_units',
'Ray',
'NullRay',
'Plane',
'Sphere',
'plane_intersect',
'sphere_intersect',
'rotate3D',
'wrap',
'unwrap',
'sph... |
import sys
import os
import argparse
import numpy as np
import pandas as pd
from pathlib import Path
from multiprocessing.pool import Pool
import h5py
sys.path.append('../data_tools/')
sys.path.append('../region_model/')
sys.path.append('../sequence_model/')
import DataExtractor
import kfold_mutations_main
import Seq... |
#
# Copyright 2019 <NAME>, <NAME>, <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 applicable law or agreed to... |
from abc import abstractmethod, ABC
from dataclasses import dataclass, field
from functools import cached_property
from itertools import product, compress
from logging import DEBUG
from pathlib import Path
from typing import Union, Optional, Set, Sequence, final, Callable
from ir_datasets import Dataset
from numpy imp... |
#/usr/bin/python3
# taxit_01.py
#
# RBLandau 20180114
#
# Add taxonomic categories to HILR member records, based on bio words.
#
# For finding word stems, use the PorterStemmer algorithm from
# the nltk package. Seems to be derived from the Tukey/Dolby
# algorithm from 66-67.
#
... |
import hashlib
import logging
import random
import re
import subprocess
import tempfile
import time
from os.path import join
import requests
from bs4 import BeautifulSoup
from functional import seq
from requests import HTTPError
class IAPDSession(requests.Session):
def __init__(self, min_delay_time=1.5, max_del... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.