text stringlengths 6.04k 39.5k |
|---|
from uuid import UUID
from typing import Union, Optional, List
import warnings
import time
from gemd.entity.link_by_uid import LinkByUID
from gemd.enumeration.base_enumeration import BaseEnumeration
from citrine.jobs.waiting import wait_while_validating
from citrine.informatics.data_sources import GemTableDataSource
... |
# !/usr/bin/env python
# encoding: utf-8
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""Main RLQA retriever training script."""
import argparse
import json
import os
import sys
... |
from PyQt5.QtWidgets import QSpinBox, QAbstractSpinBox
from candy_editor.core import *
from candy_editor.SceneEditor.SceneEditor import SceneEditorModule
from candy_editor.SceneEditor.SceneTool import SceneTool, SceneToolButton
from candy_editor.moai.MOAIEditCanvas import MOAIEditCanvas
##---------------------------... |
# Dedicated to the public domain under CC0: https://creativecommons.org/publicdomain/zero/1.0/.
'''
`craft-py-ext` is an experimental tool for generating the boilerplate to build simple CPython extensions.
It should be considered a work in progress.
To use it, you write a `.pyi` type declaration file, and then genera... |
# PyVision License
#
# Copyright (c) 2006-2008 <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list o... |
"""
Shared methods for Batch pipelines.
Batch docs: https://hail.is/docs/batch/api/batch/hailtop.batch.job.Job.html#hailtop.batch.job.Job
"""
import collections
import contextlib
import itertools
import logging
import os
import subprocess
from typing import List, Union
import configargparse
import hailtop.batch as... |
###############################################################################
# src/$RCSfile$ $Revision$
#
#import sys
#import string
import types
import errno
import os
import sys
OK = 'ok'
TIMEDOUT = 'TIMEDOUT'
KEYERROR = 'KEYERROR'
DOESNOTEXIST = 'DOESNOTEXIST'
WRONGPARAMETER = 'WRONGPARAMETER'
NOWORK ... |
import random, sys, time, os
import tkinter as Tk
import xlrd
from tkinter import Button, Frame, Label, LabelFrame, messagebox, PhotoImage, Tk, W, Entry
from random import seed, randint, shuffle
from termcolor import colored
seed(1)
class Bq:
total_questions = 0
your_score = 0
qcount = 1
answer = ''
... |
"""
We provide an implementation and pretrained weights for Pooling-based Vision
Transformers (PiT).
Paper: Rethinking Spatial Dimensions of Vision Transformers.
`[arXiv:2103.16302] <https://arxiv.org/abs/2103.16302>`_.
Original pytorch code and weights from
`NAVER AI <https://github.com/naver-ai/pit>`_.
This code h... |
import pathlib
import re
from typing import Callable, Iterator, List, Optional, Tuple, TypeVar, Union
import more_itertools
from pyoomph import ast, tokenizer
_T = TypeVar("_T")
class _Parser:
def __init__(self, token_iter: Iterator[Tuple[str, str]]):
self.token_iter = more_itertools.peekable(token_ite... |
import os
import asyncore
import socket
from asynchat import async_chat
import pkgutil
import imp
import json
import threading
import logging
class IRCCommandsMixin(object):
"""
This is just a helpful mixin to provide a few basic irc
command wrappers to different classes.
"""
def msg(sel... |
from typing import Callable, Sequence, Optional, Tuple
import math
import attr
import cv2 as cv
import numpy as np
import numpy.typing as npt
from vkit.label.type import VPoint, VPointList
from .grid_rendering.type import VImageGrid
from .grid_rendering.grid_creator import create_src_image_grid
from .grid_rendering.i... |
from __future__ import absolute_import, division, print_function
from cctbx import xray
from scitbx.math import tensor_rank_2_gradient_transform_matrix
from scitbx import matrix
from scitbx.array_family import flex
import cmath
import math
from six.moves import zip
def scatterer_as_list(self):
if (self.flags.use_u_i... |
#!/usr/bin/env python
# Convert text and standoff annotations into CoNLL format.
from __future__ import print_function
import os
from glob import glob
import re
import sys
from collections import namedtuple
from io import StringIO
from os import path
from sentencesplit import sentencebreaks_to_newlines
# assume sc... |
# Copyright 2014 Huawei Technologies Co. Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
# -*- coding: utf8 -*-
try:
set
except NameError:
from sets import Set as set
try:
sorted
except NameError:
def sorted(l):
l = list(l)
l.sort()
return l
inlineGroupInstance = (list, tuple, set)
side1Prefix = "public.kern1."
side2Prefix = "public.kern2."
side1FeaPrefix = "@ker... |
from __future__ import print_function
import sys
from copy import copy
from enum import Enum
import pytest
from pytest_cases import parametrize, parametrize_with_cases, case, fixture
from decopatch import decorator, InvalidMandatoryArgError
from decopatch.utils_disambiguation import SUPPORTS_INTROSPECTION
from .test... |
# -*- coding: utf-8 -*-
"""
Pygments Lexer for MMT Surface Syntax
========================================
The MMT project can be found at https://uniformal.github.io/.
:author: ComFreek <<EMAIL>>
:copyright: Copyright 2020 ComFreek
:license: ISC, see LICENSE for details.
"""
import re, sys
from pygments.lexe... |
from datetime import date
from telnetlib import STATUS
from dateutil.relativedelta import relativedelta
from django_scopes import scope
from pretix.base.exporter import ListExporter, MultiSheetListExporter
from pretix.base.models.items import Item
from pretix.base.models.orders import Order, QuestionAnswer, OrderPositi... |
import json
import numpy as np
import os
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
from tqdm import trange
import random
import numpy as np
from torch.utils.data import DataLoader
# METRICS = ['glob_acc', 'per_acc', 'glob_loss', 'per_loss', 'user_train_time', 's... |
import pandas as pd
import numpy as np
import config
class Result:
"""
A class used to represent a Result.
Attributes
----------
ticker : sequence
The stock ticker.
data : dataframe
The historical data associated with the ticker.
strategy : Strategy
An instance of ... |
import random
from collections import defaultdict
import torch
from torch.utils.data import Dataset
from data.base_dataset import BaseDataset
from utils import load_json, compute_rel
import pickle
import networkx
import numpy as np
g_use_heuristic_relation_matrix = False
g_add_in_room_relation = False
g_add_random_pa... |
"""
Modeling Relational Data with Graph Convolutional Networks
Paper: https://arxiv.org/abs/1703.06103
Code: https://github.com/tkipf/relational-gcn
Difference compared to tkipf/relation-gcn
* l2norm applied to all weights
* remove nodes that won't be touched
"""
import argparse
import gc
import logging
from pathlib im... |
import sys, os
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../src")
import argparse
from Loader import read_data
import random
from models.AircraftModelFleet import AircraftFleet
from models.Activity import Maintenance
from scheduler.Solution import Solution
import pathlib
import csv
import datetime... |
# pylint: disable = C0103, R0902, W1203, C0301, W0311
import time
import json
import logging
import urllib3
import boto3
from botocore.config import Config
from os import getenv
from time import sleep
from botocore.exceptions import ClientError
logger = logging.getLogger()
logger.setLevel(logging.INFO)
AWS_REGION = g... |
"""
Original code from <NAME> for CS294 Deep Reinforcement Learning Spring 2017
Adapted for CS294-112 Fall 2017 by <NAME> and <NAME>
Adapted for CS294-112 Fall 2018 by <NAME>, <NAME>, and <NAME>
"""
import inspect
import os
import time
from itertools import count
import gym
import numpy as np
import torch
from torch ... |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Compatibility
#
# Copyright (C) 2001-2017 NLTK Project
#
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import absolute_import, print_function
import os
import sys
import types
from functools import wraps
import fractions
# Pyth... |
from heapq import heappop, heappush
import time
from scipy import ndimage as ndi
import numpy as np
import napari
from skimage import filters, morphology, feature
from skimage.morphology._util import _offsets_to_raveled_neighbors, _validate_connectivity
SLEEP_PER_PIX = 0
# ---------
# Watershed
# ---------
def wate... |
# coding=utf-8
import optparse
import itertools
import matplotlib.pyplot as plt
import sys
import visdom
import torch
import pickle
from collections import OrderedDict
from tqdm import tqdm
from torch.autograd import Variable
from sklearn.metrics import classification_report, f1_score, confusion_matrix
import loader
... |
import numpy as np
import scipy.signal
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions.normal import Normal
from torch.distributions.utils import _standard_normal, broadcast_all
from torch.distributions.exp_family import ExponentialFamily
from numbers import Number
from torc... |
#
# This file is part of FaceDancer.
#
""" Helpers for HID keyboards. """
import string
from enum import IntEnum, IntFlag
# Table mapping ASCII codes to their equivalent HID keycodes.
# From the Adafruit HID library; https://github.com/adafruit/Adafruit_CircuitPython_HID/.
# Used under copyright exemption (as these ... |
# -*- coding: utf-8 -*-
import io
import logging
import os
import pickle
import subprocess
import sys
import pandas as pd
import numpy as np
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
#import h5py
from ..trajectory.oracle_core import Oracle
from .scatter_to_grid import scatter_value_to_grid_val... |
# script for Robofont
# written by <NAME>
# august 2014
# Script using glyphPreview to build a 3x3 matrix allowing preview of interpolated and/or extrapolated glyphs
from vanilla import *
from mojo.glyphPreview import GlyphPreview
from mojo.events import addObserver, removeObserver
from AppKit import NSColor
from mat... |
import torch
import os
import random
from torch.utils.data import Dataset
from PIL import Image
import numpy as np
import sys
import json
from glob import glob
from PIL import ImageDraw
from misc.mask_utils import scatterMask
from misc.utils import denorm
import glob
from scipy.io import loadmat
from tqdm import tqdm
m... |
from __future__ import print_function, division
import sys
sys.path.append('core')
import argparse
import os
import cv2
import time
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import DataLoader... |
#!/usr/bin/python3
import sys
import os
import rtmidi
import math
import time
import pulsectl
import alsaaudio
import json
import logging
import getpass
import threading
import subprocess
import shutil
from datetime import datetime
import pystray
from pystray import MenuItem as MenuItem
from PIL import Image, ImageDraw... |
#!/usr/bin/env python
"""
Copyright 2019, <NAME>, HKUST.
Training script.
"""
from __future__ import print_function
import os
import time
import sys
import math
import argparse
from random import randint
import cv2
import numpy as np
import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.com... |
#!/home/<user>/bin/python3.4
#
#This script is written in Python3 by Nimasajedi[at]gmail.com on 20th May 2017 to exctract direct download links for musics/video clips
#(3 different video quality)/podcasts and albums on Radiojavan.com. Moreover, it generates file size and depicts cover photos alongside
#showing artist... |
from tkinter import ttk
import tkinter as tk
from eosim import config
import random
import tkinter.filedialog, tkinter.messagebox
import os
import eosim.gui.helpwindow as helpwindow
import logging
logger = logging.getLogger(__name__)
class GridInfoFrame(ttk.Frame):
""" Class to handle the Grid-info frame, which ... |
import sys
sys.path.append('../')
import constants as cnst
import os
import torch
import tqdm
import numpy as np
import constants
SHAPE = [0, 1, 2]
EXP = [50, 51, 52]
POSE = [150, 151, 152, 153, 154, 155]
def centre_using_nearest(flame_seq, flame_dataset, one_translation_for_whole_seq=True):
shape_weigth = 0
... |
"""
Read UProC results files from an IRODS collections and load the imicrobe database.
"""
import argparse
import gzip
import itertools
import os
import re
import subprocess
import sys
import time
import pandas as pd
import pandas.errors
import sqlalchemy
from orminator import session_manager_from_db_uri
import imic... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import torch
import torch.nn as nn
from torch.nn import init
import functools
from torch.optim import lr_scheduler
from collections import OrderedDict
import torch.nn.functional as F
def get_scheduler(optimizer, opt):
if opt.lr_policy == 'lambda':
def lambda_rule(epoch):
lr_l = 1.0 - max(0, epo... |
"""EDA flow abstraction"""
from __future__ import annotations
import inspect
import logging
import multiprocessing
import os
import re
from abc import ABCMeta, abstractmethod
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union
from typeguard import typechecked
import jin... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
"""
A job class for solving the time-independent Schroedinger equation on a discrete mesh.
"""
from pyiron_base import ... |
#!/usr/bin/env python2
# encoding: utf-8
# This file is taken from the klab repository. Please see that repository for any updates.
# https://github.com/Kortemme-Lab/klab/
# The MIT License (MIT)
#
# Copyright (c) 2016 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this... |
# 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... |
import os
import json
import zipfile
from .expressions import walkExpression, UnsupportedExpressionException
try:
from qgis.core import *
except:
pass
_usedIcons = {}
_warnings = []
class ExpressionConverter():
layer = None
def walkExpression(self, node):
return walkExpression(node, self.laye... |
import geopandas as gpd
import os
import pandas as pd
import numpy as np
path = r'T:\MPO\RTP\FY20 2045 Update\Data and Resources\Data\GISData\Updated'
datapath = r'T:\MPO\RTP\FY20 2045 Update\Data and Resources\Data\ForAppendixF'
categories = ['Auto']*7 + ['Transit']*2 + ['Bike/Ped']*4
project_types = ['Added Freewa... |
# Copyright (c) 2013-2016, OVH SAS.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and t... |
"""
Tests for SimpleFFCEngine
"""
from __future__ import division
from unittest import TestCase
from itertools import product
from numpy import (
full,
isnan,
nan,
)
from numpy.testing import assert_array_equal
from pandas import (
DataFrame,
date_range,
Int64Index,
MultiIndex,
rolling_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 11 16:33:33 2022
@author: stoutjd
"""
import pandas as pd
import mne
import mne_bids
import os, os.path as op
import glob
import re
import copy
import numpy as np
import logging
import subprocess
from pathlib import Path
import shutil
import ma... |
"""A ProFile "magic block" plugin for filesystem operations.
Forfeited into the public domain with NO WARRANTY. Read LICENSE for details.
This plugin allows the Apple to order Cameo/Aphid to perform some basic
filesystem operations on the current working directory. For safety, operations
may be limited to files with ... |
# -*- coding: utf-8 -*-
import os
import xgboost
import matplotlib
import numpy as np
import pandas as pd
import seaborn as sns
import statsmodels
import matplotlib.pyplot as plt
from sklearn import svm
from sklearn import tree
from sklearn import metrics
from sklearn import datasets
from sklearn import ensemble
from ... |
#!/usr/bin/env python3
import copy
import json
import logging
import os
import re
import shutil
import subprocess
import sys
import tarfile
import tempfile
from contextlib import contextmanager
from pathlib import Path
from types import TracebackType
from typing import Optional
import builder
import parsers
import pa... |
from urllib.request import urlopen as urlReq, urlretrieve as urlDownload, Request
from pathlib import Path
import hashlib
import traceback
import sys
import re
import json
import shutil
import os
import yara
ver = ""
badHashFiles = []
def banner():
print("""
_ ... |
#
# Copyright 2019 <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 in writing, soft... |
import torch
from torch import nn
from torch.nn import functional as F
from torch.utils.data import DataLoader
from typing import Optional, Tuple, Dict, Any
import numpy as np
from collections import defaultdict
from mdlearn.utils import PathLike
from mdlearn.nn.utils import Trainer
class LSTM(nn.Module):
"""LSTM... |
# -*- coding: utf-8 -*-
"""
This module holds functions processing the results
of an oemof.solph optimisation model, that are used by methods of the classes
`q100opt.scenario_tools.DistrictScenario` and
`q100opt.scenario_tools.ParetoFront`.
Please use this module with care. It is work in progress!
Contact: <NAME> <... |
from __future__ import unicode_literals, print_function
import os.path
import re
import sys
import mock
from nose.tools import assert_equal, assert_true, assert_false
from mf2py import Parser
from unittest import TestCase
TestCase.maxDiff = None
if sys.version < '3':
text_type = unicode
binary_type = str
e... |
# -*- coding: utf-8 -*-
"""
Processing
==========
This module contains low level processing routines
author: <NAME>
email: <EMAIL>
"""
from __future__ import absolute_import
from __future__ import division
from collections.abc import Container
import copy
import math
import numpy as np
from scipy import ndimage as... |
# The Github-specific SarifState
import sarif_filenames
from sarif_state import SarifState
from sarif_parser import sarif_assert
from sarif_parser import unhandled_warning
from sarif_parser import is_legacy_version
from comment import Comment
from comment import PositionalComment
class GithubSarifState(SarifState):... |
#!/usr/bin/env python
# Python 2/3 compatibility
from __future__ import print_function
"""
cnn_functions.py
Functions for building and training convolutional neural networks
"""
import os
import datetime
import tensorflow as tf
from keras import backend as K
from keras.layers import Layer, InputSpec
from keras.call... |
import numpy as np
from flipper25d.config import *
from flipper25d.util import *
from flipper25d.cspace.cspace import *
from flipper25d.vis.vis import rot_vector
import pdb
from scipy.misc import imsave
import sys
import os
'''
we use the left side S2 as the pivot
right side S2 can be uniquely defined ... |
"""
A module for building and performing inference with cluster graphs
"""
# Standard imports
import collections
# Third-party imports
import IPython
import graphviz
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import networkx as nx
import numpy as np
from tqdm.auto import tqdm
# Local imports... |
def element_lookup(element): #returns full element name
element=element.title()
if (element=='Ac'): return 'Actinium'
if (element=='Al'): return 'Aluminum'
if (element=='Am'): return 'Americium'
if (element=='Sb'): return 'Antimony'
if (element=='Ar'): return 'Argon'
if (element=='As... |
##credit to http://icons8.com(egg.png) and https://icons8.com/ (flour.png, oil.png) for the icons
import tkinter as tk
from PIL import ImageTk, Image
import subprocess
#from win32api import GetSystemMetrics
#from ScaleMethods import getWeightInGrams
import sys
class Step():
def __init__(self, text, weight, ingred... |
# This file has been taken from the earlier SOLOMON project, and modified for this project.
# This file contains the functions necessary to parse a Verilog module AST, given its input
# and output port list and width maps, and obtain the module wire expressions, module width
# maps and topological sort of the AST node... |
# Training a Student network on CIFAR-10
# Teacher architecture: AlexNet, Student architecture: AlexNet half
from __future__ import print_function
import argparse
import torch
import os
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from a... |
import itertools
from functools import reduce
from logging import getLogger
from typing import List, Iterable, Set, Tuple, Dict
import numpy as np
from scipy.stats import binom
from ..pattern import ResponseIdentity, Rank
from ..api import RangeDatabase, RangeAttack, LeakagePattern
log = getLogger(__name__)
class ... |
import OpenEXR
import Imath
import numpy as np
import time
import data.util_exr as exr_utils
import os
def _crop(img, pos, size):
ow, oh = img.shape[0], img.shape[1]
x1, y1 = pos
tw = th = size
if (ow > tw or oh > th):
# return img.crop((x1, y1, x1 + tw, y1 + th)) #CHANGED
ret... |
from collections import defaultdict, namedtuple
import csv
import itertools
from pathlib import Path
import sys
from csvw.metadata import Column, ForeignKey, Datatype, Link
import pycldf
import pyclts
from segments import Tokenizer, Profile
from online_cognacy_ident.align import normalized_levenshtein
bipa = pyclts... |
import torch
import numpy as np
import os
import timeit
from PIL import Image
from torchvision.utils import save_image
import torch.cuda as cutorch
from utils import SimpleProgressBar, IMGs_dataset
from opts import parse_opts
from DiffAugment_pytorch import DiffAugment
''' Settings '''
args = parse_opts()
# some par... |
# ref: https://github.com/bitcoin-core/HWI/blob/master/hwilib/serializations.py
from collections import OrderedDict
from .transaction import Transaction, TransactionOutput, SIGHASH
from . import compact
from . import bip32
from . import ec
from . import hashes
from .script import Script, Witness
from . import script
... |
#
# snimpy -- Interactive SNMP tool
#
# Copyright (C) <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "A... |
import bpy
from islpy import *
from islplot.support import *
def make_material(name, color_diffuse, color_specular, alpha):
"""
Create a blender material.
:param name: The name.
:param color_diffuse: The diffuse color.
:param color_specular: The specular color.
:param alpha: The alpha channel.... |
from __future__ import absolute_import
import collections
import copy
import logging
import os
import six.moves.queue
import socket
import sys
import threading
import time
import ujson
import bisect
import zmq
import resource
from . import utils
import signal
import six
logger = logging.getLogger(__name__)
# Unused
M... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>, University of Bristol, <EMAIL>
This programme will take an input array of peaks in 1D I vs q data (such as those returned from the finder programme),
and returns a dictionary of possible phases that the data can take on, along with the miller plane index and the peaks ... |
#!/usr/bin/env python2.5
'''
Pure Python reader for GeoIP Country Edition databases.
http://python-geoip.googlecode.com/hg/pygeoip.py
'''
__author__ = '<NAME> <<EMAIL>>'
import os
from cStringIO import StringIO
# From GeoIP.h.
SEGMENT_RECORD_LENGTH = 3
STANDARD_RECORD_LENGTH = 3
ORG_RECORD_LENGTH = 4
MAX_RECORD_LE... |
import argparse
import skimage
import skimage.io
import skimage.transform
from PIL import Image
from skimage import io
from math import log10
import sys
import shutil
import os
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
from torch.autogr... |
import copy
import math
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import make_interp_spline, BSpline
def load_datas(filePath):
# feature_1 feature_2 feature_3 feature_4 class
file = open(filePath, 'r')
listOfDatas = [];
while True:
readCheck = file.readline()
... |
import pandas as pd
import re
from IPython.display import display
import matplotlib.pyplot as plt
import numpy as np
import os
from pathlib import Path
from glob import glob
import black
import natsort
import operator
# from matplotlib.pyplot import cm
import matplotlib as mpl
from constants import *
from matplotlib.l... |
from __future__ import division
from itertools import chain
from numpy import inf
from span.chunking.utils.fixed_step import fixed_step_chunker
import random
def fragment_list(tot_len, n_frags):
"""
A little function to help trouble shoot list_chunker. Creates a list of lists
by randomly fragmenting range... |
import numpy as np
from matplotlib import pyplot as plt
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import LeaveOneOut
from sklearn import linear_model, datasets, metrics
from sklear... |
from collections import Counter
from datetime import datetime
from operator import itemgetter
import re
from typing import List
from django.db import models
from django.conf import settings
from iteration_utilities import flatten
from django.utils.translation import gettext_lazy as _
from bills.templatetags.bill_filt... |
"""This module includes all important computation functions which are used internally.
They (normally) should not be used by users.
"""
import logging
from collections import defaultdict
import attr
import joblib
import numpy as np
import scipy
from scipy import stats
from scipy.cluster.hierarchy import fcluster, link... |
import os
import time
import sys
import math
import gzip
import pickle
import glob
import numpy as np
#
from multiprocessing import Process
from joblib import Parallel, delayed
import multiprocessing
#
from multiprocessing.dummy import Pool as ThreadPool
#
from collections import defaultdict
# rdkit che... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2017 by University of Kassel and Fraunhofer Institute for Wind Energy and
# Energy System Technology (IWES), Kassel. All rights reserved. Use of this source code is governed
# by a BSD-style license that can be found in the LICENSE file.
import numpy as np
from pandapower.... |
# -*- coding: utf-8 -*-
"""
Functions to simplify the colab_zirc_dims auto-processing notebook for ALC
datasets. Code here was previously contained within cells in the notebook
itself.
"""
import os
import random
import gc
import datetime
import urllib.request
import shutil
from IPython.display import display
try:
... |
from multiprocessing import Process, Pool
import atexit
from collections import OrderedDict
import subprocess
import logging
import imp
import os
import os.path
import sys
import copy
import argparse
from datetime import datetime
from threading import Thread
import pprint
import psutil
import sys
import time
import tra... |
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2012 CEA
# <NAME>
# Licensed under the terms of the CECILL License
# (see guiqwt/__init__.py for details)
# pylint: disable=C0103
"""
guiqwt.io
---------
The `io` module provides input/output helper functions:
* :py:func:`guiqwt.io.imread`: load an image (.png, .tiff,... |
import logging
import os
import pickle
import sys
from collections import Counter
from itertools import combinations, product
from szz.SzzContributor import SzzContributor
import loggingcfg
import utils.utility as utility
import regex
from alias import Alias
from csvmanager import CsvWriter
d_alias_map = {}
clusters... |
'''
This is a implementation of Quantum State Tomography for Qutrits,
using techniques of following papars.
'Iterative algorithm for reconstruction of entangled states(10.1103/PhysRevA.63.040303)'
'Diluted maximum-likelihood algorithm for quantum tomography(10.1103/PhysRevA.75.042108)'
'Qudit Quantum State Tomography(... |
#!/usr/bin/env python3
"""
Script and class for creating a tf.Record dataset for the simulated disc
tracking task
"""
import numpy as np
import logging
import os
import cv2
import matplotlib.pyplot as plt
import argparse
import sys
from differentiable_filters.utils import recordio as tfr
class DiscTrackingData():
... |
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... |
from __future__ import annotations
from abc import ABCMeta, abstractmethod
from dataclasses import dataclass, field
from functools import wraps
from fractions import Fraction
from io import StringIO
from itertools import chain
from typing import (
cast,
Any,
Callable,
Generic,
Iterator,
List,
... |
import warnings
import glob
import os
from scipy.stats import linregress, norm
import xarray as xr
import pandas as pd
import numpy as np
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
with warnings.catch_warnings():
warnings.simp... |
import json
from os import listdir
from os.path import exists, join, isfile
from argparse import ArgumentParser
from collections import defaultdict
from copy import deepcopy
import torch
import numpy as np
from tqdm import tqdm
from mmcv import Config
from mmcv.parallel import scatter, collate, MMDataParallel
from mm... |
from encodings.utf_8 import encode
from enum import auto
from re import M
from tensorflow.keras import Model
from tensorflow.keras.layers import Input, Conv2D, Conv2DTranspose, ReLU, BatchNormalization, Flatten, Dense, Reshape, Activation, Concatenate
from tensorflow.keras import backend as K
from tensorflow.keras.opti... |
"""
Example template for defining a system.
"""
from argparse import ArgumentParser
import os
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data as data
import torchaudio
import torchvision.transforms as transforms
from pytorch_lightning.c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.