text stringlengths 6.04k 39.5k |
|---|
import numpy as np
import nltk # For tokenize
from tqdm import tqdm # Progress bar
import pickle # Saving the data
import math # For float comparison
import os # Checking file existance
import random, gzip
import string, copy
from nltk.tokenize import word_tokenize
import jieba
import json
from Hyperparameters im... |
"""Interactive code reloader module."""
import sys
import os
import io
import time
import inspect
import importlib
import modulefinder
import collections
import functools
import warnings
from testplan.common.utils import path as path_utils
from testplan.common.utils import logger
from testplan.common.utils import str... |
# coding=utf-8
#
# This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis-python
#
# Most of this work is copyright (C) 2013-2018 <NAME>
# (<EMAIL>), but it contains contributions by others. See
# CONTRIBUTING.rst for a full list of people who may hold copyright, and
# co... |
#-------------------------------------------------------
# This file provides generic tools for your Python app in RoboDK
# This file includes:
# 1. RunApplication: class to cleanly stop checkable actions (checkable actions get the Terminate/SIGINT signal when they are unchecked)
# 2. AppsSettings class: simple way... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: omi
# @Date: 2014-08-24 21:51:57
'''
网易云音乐 Ui
'''
import hashlib
import re
import curses
from api import NetEase
from scrollstring import scrollstring, truelen
from storage import Storage
from config import Config
from utils import notify
import logger
import ... |
#coding:utf-8
##############################################################################
# Author:QQ173782910
##############################################################################
"""models/model.py"""
from sqlalchemy import create_engine,Column, Integer,Text,DateTime,SMALLINT,Float
from sqlalchemy.orm im... |
#!/usr/bin/env python3
# Copyright 2021, <NAME>, <NAME>
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Perform CTC Re-Segmentation on japanese dataset.
Either start this program as a script or from the interactive python REPL.
# Recommended model:
# Japanese Transformer Model by Shinji (note: this mod... |
# -*- coding: utf-8 -*-
# Authors: <NAME> <<EMAIL>>
# simplified BSD-3 license
import os.path as op
from numpy.testing import assert_allclose, assert_almost_equal, assert_equal
import shutil
import pytest
from mne.datasets.testing import data_path, requires_testing_data
from mne.utils import requires_h5py
f... |
import torch.nn as nn
import torch
import math
import time
import torch.utils.model_zoo as model_zoo
from .utils import BasicBlock, Bottleneck, BBoxTransform, ClipBoxes
from .anchors import Anchors
from torchvision.ops import nms
from .losses import *
'''def nms(dets, thresh):
"Dispatch to either CPU or GPU NMS im... |
# 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... |
from __future__ import print_function
import argparse
import logging
import os
import re
import subprocess
import sys
import pyhhi.build.common.util as util
import pyhhi.build.common.ver as ver
import pyhhi.build.vcsutil as vcsutil
from pyhhi.build.common.system import SystemInfo
from pyhhi.build.common.error impor... |
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may
# not use this file except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... |
from helper import unittest, PillowTestCase, hopper
from PIL import Image
import os
class TestImage(PillowTestCase):
def test_image_modes_success(self):
for mode in [
'1', 'P', 'PA',
'L', 'LA', 'La',
'F', 'I', 'I;16', 'I;16L', 'I;16B', 'I;16N',
'RGB', 'RGB... |
#!/usr/bin/env python3
import time
import re
import logging
logger = logging.getLogger(__name__)
class Component:
name = 'COMPONENT'
defined_properties = {}
delimiter = '@@'
def __init__(self):
self._components = []
self._properties = []
def csv_parse(self, component, rows, colu... |
import os, pygame, pygame.locals, sys, random, math
import numpy as np
#from pybrain.datasets import SupervisedDataSet
from time import sleep
# Helper functions
class obstacle(object):
def __init__(self,xmin,xmax,ymin,ymax):
self.xmin = xmin
self.xmax = xmax
self.ymin = ymin
self.y... |
""" Disperse router for multiple disjoint Steiner Tree Search.
This router uses a set of initial chains as candidates to reduce the search
space of multiple Steiner Trees. As a result, the root of each tree or chain
in the resultant embedding is one of the provided candidates.
"""
import pulp
import warnings
import... |
import os
import numpy as np
import pandas as pd
import pickle
import torch
import torch.nn.functional as F
import torch.nn as nn
import dgl
import dgl.nn as dglnn
import pickle
from collections import defaultdict
def graph_construction(meta, train_mod1, train_mod2, test_mod1, pretrain_path, bidirect = True):
# ... |
"""
Attacker Class
==============
"""
import collections
import logging
import multiprocessing as mp
import os
import queue
import random
import traceback
import torch
import tqdm
import textattack
from textattack.attack_results import (
FailedAttackResult,
MaximizedAttackResult,
SkippedAttackResult,
... |
"""
desispec.heliocentric
========================
heliocentric correction routine
"""
import os
import numpy as np
import astropy.units as u
from astropy.time import Time
from astropy.coordinates import SkyCoord, EarthLocation
import astropy.constants
# In restricted environments, such as ReadTheDocs, this throws
#... |
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
from .taskdataset import EbbFlowStats
class PlotRTs(EbbFlowStats):
"""Plot RT distributions.
Args
----
stats_obj (EbbFlowStats instance): Data from the model/participant.
palette (str, optional): Color p... |
# -*- coding: utf-8 -*-
"""
Interactive test for CollisionManager.objs_into_box
Implements click selection plus elastic box selection
Clicking anywhere will select the ball(s) under the mouse cursor
Drag a rectangle to select balls fully into rectangle
Click outside any ball to unselect
Use arrow keys to move selection... |
import os
import platform
from collections import OrderedDict
from itertools import chain
from conans.client import defs_to_string, join_arguments
from conans.client.build.cppstd_flags import cppstd_flag
from conans.client.tools import cross_building
from conans.client.tools.oss import get_cross_building_settings
fro... |
from typing import List
from core.exceptions.data_exceptions import (DataIndexNotFoundException,
DataIllegalEventTypeException,
DataIllegalActivityTypeException)
from core.exceptions.input_exceptions import (InputFormatException,... |
import traceback
import discord
from discord.ext import commands, tasks
import datetime
import json
import os
import pymongo.errors
class EventsMod(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.database = bot.database
self.batch_delete.start()
@tasks.loop(hours=4.0)
... |
import argparse
import os
import time
from collections import OrderedDict
from typing import Dict, Optional
import lavd
import torch
import torch.cuda.amp as amp
import torch.distributed as dist
import torch.multiprocessing as mp
import torch.nn as nn
import torch.optim as optim
from torch.nn.parallel import Distribut... |
import math
import re
import struct
import collections
import lupa
from PIL import Image, ImageChops, PngImagePlugin, ImageFile
# hack the crc check so that angels bio processing can load
def crc(self, cid, data):
"""Read and verify checksum"""
# Skip CRC checks for ancillary chunks if allowed to load trunca... |
import importlib
import threading
import os
import logging
from os.path import join, exists
import cv2
import h5py
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from object_detection.utils import label_map_util
from object_detection.utils import config_util
from object_detec... |
from scipy.ndimage import gaussian_filter
import cv2
import kornia
from PIL import Image
import math
import shutil
import numpy as np
import copy
import time
from torch.optim import lr_scheduler
from torch.autograd import Variable
import torch.nn as nn
import torch.optim as optim
import torch
from phase_correlation.los... |
# coding=utf-8
# *** WARNING: this file was generated by crd2pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'... |
import threading
import warnings
from dask.delayed import Delayed
import dask
import dask.array as da
from dask.base import tokenize
from pathlib import Path
from dataclasses import dataclass
from typing import Optional, Union, Tuple, Any, Dict
import xarray as xr
import numpy as np
from affine import Affine
import ras... |
from abc import abstractmethod
from collections.abc import Iterable
from logging import getLogger
from typing import TYPE_CHECKING, Optional, Sequence, Tuple, Union
import numpy as np
from scipy.optimize import minimize
from .elements.base import BaseElement
from .utils import PLANE_INDICES
if TYPE_CHECKING: # prag... |
#!/usr/bin/python3
# Copyright 2019 by <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... |
import os
import csv
import numpy as np
import pandas as pd
import logging
from collections import deque
from datetime import date, datetime, timedelta, time
from typing import Dict, List, Iterator
from libs.utils.loggers import get_source_log_directory, get_area_log_directory, get_source_logging_interval
logger = l... |
from __future__ import division, print_function, absolute_import
import argparse
import functools
import json
import logging
import math
import os
import random
import numpy as np
import pandas as pd
import sklearn.metrics as sm
import tensorflow as tf
import tqdm
try:
tf.compat.v1.logging.set_verbosity(tf.compa... |
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 21 20:34:15 2017
@author: <NAME> and Dr.Ho
First Gen Refactoring
By: <NAME>
"""
import numpy as np
import pandas as pd
import scipy.stats
import scipy.optimize
import time
#np.set_printoptions(suppress=True)
def micro_crack_estimator(datafile,ReportPath):
# S... |
import math
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import transforms
import numpy
import pandas
def fit_text(ax, *args, **kwargs):
"""Write text into `ax` by passing `args` and `kwargs` to ax.text,
then change the view limits of `ax` if necessary to include the text.
... |
"""
This module implements the Room class.
"""
import types
import typing as T
if T.TYPE_CHECKING:
# pylint: disable=cyclic-import,unused-import
import uuid
from .app import SchedyApp
from .schedule import Schedule
from .actor.base import ActorBase
import datetime
import functools
import threading... |
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may n... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from .core.blurpool import BlurPool
from .core.coord_conv import CoordConvTh
def _make_grid(h, w):
yy, xx = torch.meshgrid(
torch.arange(h).float() / (h-1)*2-1,
torch.arange(w).float() / (w-1)*2-1)... |
from flask import Flask, jsonify, render_template, request
from google.cloud import datastore
from random import randint
app = Flask(__name__)
db = datastore.Client()
# Note: If these fields are changed and rows*columns becomes an odd number,
# the tie game checking will break because it only checks on even moves.
ST... |
"""
This code contains support code for formatting products to NetCDF for the LP DAAC.
Authors: <NAME>, <EMAIL>
<NAME>, <EMAIL>
"""
"""
#TODO - UMMG updates
TemporalExtent - tbd
Platforms - implemented, test to see if it breaks
X extend add_files (for multiples) - Phil to do
X Winston - extend calls in main... |
"""Contains the classes and functions for scraping a yahoo finance statistics page."""
from collections import ChainMap
from enum import Enum
from typing import Iterable, List, Optional
import numpy as np
import pandas
from pandas import DataFrame
from pendulum.date import Date
from pydantic import BaseModel as Base
... |
"""
Contains all basic neural network tools.
"""
from BasicLib.BasicFunctions import *
import tensorflow as tf
####################
# tensorflow tools #
####################
def print_tensor_process_values(trigger_tensor, tensor_list, tensor_name_list):
"""
Prints all listed tensor shapes an... |
#!/usr/bin/python3
# Calculate new capacitor and resistor values for retuned version
# of YuSynth fixed filter bank
#
# New frequencies are lpf, bpf[], and hpf.
from math import floor
# Currently available at Tayda (nF)
tdhas = [0.,
1., 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8, 8.2,
10., 12... |
__all__ = [
'PredictionSummaryComponent',
'ImportancesComponent',
'PdpComponent',
'WhatIfComponent',
]
import pandas as pd
import dash
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
import dash_table
from dash.dependencies import Input, ... |
import itertools as it
from computation.split_and_merge.util.node_border_iterator import iterate_node_border
class MergeGroup(object):
"""
Class that collects a group of homogenous nodes. Groups that are divided by the periodic border can be
organized in subgroups.
The object is intended to be used in... |
import math
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
from rlbot.utils.structures.game_data_struct import GameTickPacket
from util.orientation import Orientation
from util.vec import Vec3
class BigBoyBot(BaseAgent):
def initialize_agent(self):
# This runs once before the bot ... |
from pathlib import Path
# -----------------------------------------------------------------------------
# TytusDB Parser Grupo 20
# 201612141 <NAME>
#
#
#
# DIC 2020
#
#
# -----------------------------------------------------------------------------
reservedwords = (
'CREATE',
'DROP',
'DATABASE',
... |
# -*- coding:utf-8 -*-
import time
import collections
import numpy as np
import pandas as pd
import copy
import hashlib
import os
import shutil
import pickle
from sklearn.compose import ColumnTransformer
from sklearn.impute import SimpleImputer
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing imp... |
"""
The MIT License (MIT)
Copyright (c) 2015 <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... |
#!/usr/bin/env python3
import sys
sys.path.insert(0, '../build/Release')
import argparse
import glob
import h5py
import numpy as np
import os.path
import wx
import wx.lib.agw.aui as aui
from wx.lib.mixins.listctrl import \
CheckListCtrlMixin, \
ColumnSorterMixin, \
ListCtrlAutoWidthMixin
import matplo... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
@contact: <EMAIL>
@description: image manipulation library.
"""
# DEPENDENCIES =================================================================
import os
import sys
import numpy as np
from scipy import ndimage as ndi
from scipy.ndimage.morphology import distance_transfor... |
# Google API key: <KEY>
# from googleapiclient.discovery import build
# import pprint
#
# my_api_key = "<KEY>"
# my_cse_id = "007090476945672340566:iqdhroqw_x0"
#
# def google_search(search_term, api_key, cse_id, **kwargs):
# service = build("customsearch", "v1", developerKey=api_key)
# res = service.cse().l... |
"""
adapted from https://github.com/maximecb/gym-minigrid/blob/master/gym_minigrid/minigrid.py
"""
import gym
import os
import yaml
from contextual_gridworld.environment.colors import *
from enum import IntEnum
from gym import spaces
from gym.utils import seeding
from gym_minigrid.minigrid import DIR_TO_VEC
from gym_... |
import argparse
import os
import time
import warnings
from abc import ABC
import librosa
import numpy as np
import pytorch_lightning as pl
import torch
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.loggers import WandbLogger
from torch.utils.data import DataLoader
from tqdm import tqdm... |
import math
from datetime import date
NORMALFORMAT=0
BYCFORMAT=1
BYDFORMAT=2
def joinit(iterable, delimiter):
it = iter(iterable)
yield next(it)
for x in it:
yield delimiter
yield x
# To format, in HTML, the cores in the right order.
# First we order the categories
# Then we order the cor... |
import concurrent
import itertools
import multiprocessing
import os
from collections import OrderedDict, Counter
from operator import itemgetter
from os import makedirs
from typing import List
from tqdm import tqdm
from openkge.index_mapper import IndexMapper, UNK
def save_to_file(dataset_dir, file_name, triples):... |
#!/usr/bin/python
# Copyright (c) 2020, Sine Nomine Associates
# BSD 2-Clause License
ANSIBLE_METADATA = {
'metadata_version': '1.1.',
'status': ['preview'],
'supported_by': 'community',
}
DOCUMENTATION = r'''
---
module: openafs_wait_for_registration
short_description: Wait for the fileserver VLDB regis... |
#!/usr/bin/env python3
# Copyright (c) 2019 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
"""
Lists maintainers for files or commits. Similar in function to
scripts/get_maintainer.pl from Linux, but geared towards GitHub. The mapping is
in MAINTAINERS.yml.
The comment at the top of MAINTAINERS.yml i... |
# Copyright 2021 SECTRA AB
#
# 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... |
# -*- coding: utf-8 -*-
"""
(c) 2014-2018 - Copyright Red Hat Inc
Authors:
<NAME> <<EMAIL>>
"""
from __future__ import unicode_literals, absolute_import
import datetime
import gc
import logging
import string
import time
import os
import warnings
import flask
import pygit2
from whitenoise import WhiteNoise
... |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
#
# TITLE : mcmc_pal5
# PROJECT : Pal 5 update MW pot constraints
#
# ----------------------------------------------------------------------------
# Docstring
"""MCMC analysis routines of Palomar 5.
Routing Listi... |
#!/usr/bin/env python
"""TcEx Framework Template Download/Generation Module."""
# standard library
import os
import sys
from typing import Any, Optional
# third-party
import colorama as c
import requests
try:
# third-party
from mako.template import Template
except ImportError:
# mako is only required for ... |
import csv
import logging
import mock
import pytest
from datarobot_batch_scoring.utils import (verify_objectid, UI,
acquire_api_token,
parse_host,
get_endpoint,
... |
""" View validation code (using assertions, not the RNG schema). """
import ast
import collections
import logging
import os
import re
from functools import partial
from lxml import etree
from odoo import tools
from odoo.tools.safe_eval import safe_eval
_logger = logging.getLogger(__name__)
_validators = collection... |
"""Tools for estimating the partition function of an RBM"""
import numpy
import theano
from theano import tensor, config
from theano.tensor import nnet
from pylearn2.utils.rng import make_np_rng, make_theano_rng
from pylearn2.utils.mem import improve_memory_error_message
def compute_log_z(rbm, free_energy_fn, max_bit... |
import argparse
import logging
import os
import re
from abc import ABC, abstractmethod
from contextlib import ExitStack
from itertools import cycle
from time import time
from typing import Dict, List
os.environ['TF_CPP_MIN_LOG_LEVEL'] = "3"
# pylint: disable=wrong-import-position
# flake8: noqa: E402
import tensorfl... |
#!/usr/bin/env python3
from functools import partial
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import netCDF4 as nc4
from e3sm_case_output import E3SMCaseOutput, day_str
START_YEAR = 1
START_MONTH = 1
END_YEAR = 4
END_MONTH = 2
START_AVG_YEAR = 1
START_AVG_MONTH = 3... |
import os
import random
import itertools
import numpy as np
import torch
import torch.nn as nn
import torch.utils.data
import torchvision.transforms as transforms
from torchvision.utils import make_grid
from torch.autograd import Variable
from PIL import Image
import matplotlib.pyplot as plt
from tensorboardX import Su... |
# gemato: CLI routines
# vim:fileencoding=utf-8
# (c) 2017-2019 <NAME>
# Licensed under the terms of 2-clause BSD license
from __future__ import print_function
import argparse
import datetime
import io
import logging
import multiprocessing
import os.path
import sys
import timeit
import gemato.exceptions
import gemat... |
import numpy as np
import torch
import random
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from tqdm import tqdm
from common.arguments import parse_args
from random import choice
from matplotlib.patches import FancyArrowPatch
from mpl_toolkits.mplot3d.proj3d import proj_transf... |
'''
@author: <NAME>
@since: 2020-02-29
@organization: MLSB API
@summary: Holds various cached items that allow API and website to speed up
'''
from sqlalchemy import func
from sqlalchemy.orm import undefer
from sqlalchemy.sql.expression import and_, or_
from datetime import date, datetime, time
from api import cache, ... |
import argparse
import json
import os
import re
import shutil
import subprocess
import time
supported_tools = ["bsdiff", "xdelta", "rsync"]
def save_new_modified_and_deleted_file_lists(new_files, modified_files, deleted_files, patch_path):
new_files_path = patch_path + "/" + "new_files.txt"
modified_files_p... |
import numpy as np
from mayavi import mlab
from ela.classification import extract_single_lithology_class_3d, GeospatialDataFrameColumnNames
from ela.utils import flip
from ela.visual import to_rgba_255, to_rgb, LithologiesClassesVisual
from ela.textproc import EASTING_COL, NORTHING_COL, DEPTH_FROM_AHD_COL, DEPTH_TO_A... |
"""
first_order to train a group of keys
"""
# from sklearn.metrics.pairwise import cosine_similarity
import copy
import matplotlib.pyplot as plt
import numpy as np
import torch
from neurodiffeq import diff # the differentiation operation
from neurodiffeq.conditions import IVP # the initial condition
from neurodiff... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# __author__="<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... |
#!/usr/bin/env python
"""
Compliance Checker
"""
import csv
import itertools
import pprint
import re
import sys
import warnings
from collections import defaultdict
from functools import wraps
from io import StringIO
import validators
from lxml import etree
from netCDF4 import Dataset
from owslib.namespaces import N... |
import os
import argparse
import random
import numpy as np
import time
from datetime import datetime
from torch.utils.data import DataLoader, RandomSampler
from torch.utils.tensorboard import SummaryWriter
from modules.model import *
from commons import NERdataset, logger, init_logger
from processor import NERProcesso... |
# Copyright (c) 2022 CNES
#
# All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""
Testing the array class.
========================
"""
import pickle
import dask.array.core
import numpy
import pytest
import zarr
from .. import array
from ... imp... |
# -*- coding: utf-8 -*-
"""
gridview.py -- A small python app to display ROIs and edit labels driven by FathomNet annotations
Copyright 2020 Monterey Bay Aquarium Research Institute
Distributed under MIT license. See license.txt for more information.
The app loads images from a directory and then sorts them by label,... |
import numpy as np
import os
from ..constants import T_CMB, h_Planck, k_Boltzmann
# Converts from cmb units to brightness.
# Numerical factors not included, it needs proper normalization when used.
def _cmb2bb(nu):
# NB: numerical factors not included
x = nu * h_Planck * 1e9 / k_Boltzmann / T_CMB
retur... |
#!/usr/bin/python3
###############################################################################
#
# Copyright (c) 2015-2020, Intel Corporation
# Copyright (c) 2019-2020, University of Utah
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... |
import json
import atexit
import hashlib
import os
import re
import shutil
import subprocess
import shlex
import tempfile
from contextlib import contextmanager
from insights.config import CommandSpec
from insights.config.static import get_config
from insights.parsers.uname import rhel_release_map
from insights.core im... |
# -*- coding: utf-8 -*-
"""Convert_FHClaimToRDF.ipynb
Convert Food Health Claims to RDF Knowledge Graph
"""
from __future__ import print_function
# import for RDF knowledge graph
from rdflib import Graph, URIRef, Literal, RDF, ConjunctiveGraph
from rdflib import Namespace
from rdflib import Dataset
import pandas as p... |
"""PlannerLayout."""
from collections import OrderedDict
from typing import Dict
from typing import Generator
from typing import Iterable
from typing import List
from typing import Optional
from typing import Tuple
from typing import Type
from typing import Union
import networkx as nx
from pydent.models import Operat... |
from random import choices, shuffle
from typing import List
import tkinter as tk
from tkinter.font import Font as tkFont
from PIL import Image, ImageTk
from time import sleep, time
from envs.oware import Oware
class OwareVisualize:
ROOT = tk.Tk()
ROOT.title("Oware (CS-E4800 Tournament)")
ROOT.iconphoto(T... |
import sys
import numpy as np
from numpy import ma
from jsonschema import ValidationError
from ...types import AsdfType
from ... import util
_datatype_names = {
'int8' : 'i1',
'int16' : 'i2',
'int32' : 'i4',
'int64' : 'i8',
'uint8' : 'u1',
'uint16' : 'u2',
... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test observation.py module."""
# STDLIB
import os
import warnings
# THIRD-PARTY
import numpy as np
import pytest
# ASTROPY
from astropy import units as u
from astropy.modeling.models import Const1D
from astropy.tests.helper import catch_warnings, ass... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Add parent path so we can import modules
import sys
sys.path.insert(0,'..')
from argparse import ArgumentParser
from collections import OrderedDict
import faiss
import glob
import numpy as np
import os
import pandas as pd
import pickle
from sklearn.metrics.pairwise impo... |
"""Inverted pendulum example."""
from cvxpy import Maximize, Problem, Variable
from matplotlib.pyplot import figure, grid, legend, plot, show, subplot, suptitle, title, xlabel, ylabel
from numpy import arange, array, concatenate, dot, identity, linspace, ones, savez, sin, zeros
from numpy.linalg import norm
from numpy... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
from .sklearntools import STSimpleEstimator, safe_assign_subset, safe_column_names, clean_column_name, \
safe_column_select, safe_assign_column
from abc import ABCMeta, abstractmethod
from sympy.core.symbol import Symbol
from toolz.dicttoolz import keymap, itemmap, valfilter
from sympy.functions.elementary.piecewis... |
import torch
import torch.nn.functional as F
# import torch should be first. Unclear issue, mentionned here: https://github.com/pytorch/pytorch/issues/2083
import numpy as np
import os
import csv
import time
import argparse
import heapq
import rasterio
from PIL import Image
import torchvision
import math
from collectio... |
import hashlib
import socket
import sys
import threading
import time
from queue import Queue
from typing import Any, Tuple
from PyQt5 import QtCore
from PyQt5.QtWidgets import QApplication, QSplitter, QWidget, QVBoxLayout, QTabWidget, QTreeWidget, \
QTreeWidgetItem, QPushButton, QLineEdit, QGroupBox, QFormLayout, ... |
# LIBTBX_SET_DISPATCHER_NAME phenix.plan_sad_experiment
from __future__ import absolute_import, division, print_function
import mmtbx.scaling.plan_sad_experiment
from mmtbx.scaling.plan_sad_experiment import get_fp_fdp, get_residues_and_ha
import iotbx.phil
from libtbx.utils import Sorry, null_out
from libtbx import r... |
import sys
sys.exc_info()
from utils.config import process_config
from datasets.sleepset import *
from graphs.models.attention_models.windowFeature_base import *
from sklearn.metrics import f1_score, cohen_kappa_score, roc_auc_score, confusion_matrix
from tqdm import tqdm
import matplotlib.pyplot as plt
def get_predi... |
from tkinter import *
from tkinter import messagebox
from PIL import ImageTk, Image as Image
from Resources.AppResourceManager import AppResourceManager
from TkinterCustomButton import TkinterCustomButton
from pypresence import Presence
from packaging import version
from threading import Thread
from pathlib import Path... |
'''
Created on Jul 12, 2020
@author: willg
'''
import UtilityFunctions
from Placement import DISCONNECTION_TIME, Placement
from collections import defaultdict
from typing import List
import common
CTGP_CTWW_REGION = 'vs_54'
BATTLE_REGION = 'bt'
RT_WW_REGION = 'vs'
PRIVATE_ROOM_REGION = 'priv'
UNKNOWN_REGION = 'unk'
V... |
import time
import numpy
import math
import random
import fnmatch
import scipy
import json
import threading
from PIL import Image
import denet.common as common
import denet.common.logging as logging
class DatasetExportThread(threading.Thread):
def __init__(self, model, data, subset, batch_size, training):
... |
"""
Individual view
"""
import functools
import operator
from collections import Counter
from typing import Dict, List, Optional, Tuple, Union
from bidict import bidict
from db.helpers import cursor2dict, query_user_config
from db.model import Individual, Sex, UserIndividual
from flask import jsonify, request, session... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.