text stringlengths 8.04k 46.5k |
|---|
# Code from Chapter 18 of Machine Learning: An Algorithmic Perspective (2nd Edition)
# by <NAME> (http://stephenmonika.net)
# You are free to use, change, or redistribute the code in any way you wish for
# non-commercial purposes, but please maintain the name of the original author.
# This code comes with no warranty ... |
from dataclasses import dataclass
from typing import List, Union, Iterator, Optional, Dict, Any, Tuple
import h5py
import numpy as np
from enum import Enum
from contextlib import contextmanager
import json
from scippneutron.file_loading._json_nexus import LoadFromJson, MissingDataset
h5root = Union[h5py.File, h5py.Gro... |
#! /usr/bin/env python
"""Check properties of Terraformed resources and/or JupyterHub to verify good deployment.
ignore the hub since it may not be delpoyed on the cluster yet.
check creation date
check for global hammer
"""
import sys
import os
import subprocess
import argparse
import re
import json
from collection... |
from functools import lru_cache
from urllib.parse import unquote_to_bytes
from zope.interface import implementer
from zope.interface.interfaces import IInterface
from pyramid.encode import url_quote
from pyramid.exceptions import URLDecodeError
from pyramid.interfaces import (
VH_ROOT_KEY,
IRequestFactory,
... |
#importing neccesary libaries and mudules needed to support functions
from __future__ import unicode_literals
from kivy.app import App
from kivy.config import Config
Config.set('input', 'multitouchscreen1', 'tuio,192.168.2.22:3306')
Config.set('postproc','desktop','1')
Config.set('kivy','exit_on_escape','1')
Config.set... |
#!/bin/python3
'''
Title: build-fortress.py
Purpose: Build the infosec-fortress
Author: <NAME> (DFIRmadness)
Contributors: Check the github page.
Notes: Beta
Version: 0.5
Usage: ./build-fortress.py
Functions:
+ apt update
+ dist upgrade
+ install base packages
+ create /opt/infosec-fortress
+ start log
+ install start... |
from pysnptools.util.mapreduce1.runner import *
import os
import subprocess, sys, os.path
import multiprocessing
import pysnptools.util as pstutil
import pdb
import logging
try:
import dill as pickle
except:
logging.warning("Can't import dill, so won't be able to clusterize lambda expressions. If you try, you'... |
#!/usr/bin/python3 -tt
# -*- coding: utf-8 -*-
# (keep hashbang line for `make install`)
#
# git timestamp — Zeitgitter GIT Timestamping client
#
# Copyright (C) 2019-2021 <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as pu... |
# -*- coding: utf-8 -*-
"""
Functions and classes for manipulating 10X Visium spatial transcriptomic (ST) and
histological imaging data
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import seaborn as sns
import scanpy as sc
sc.set_figure_params(dpi=1... |
import time
import serial
import binascii
from collections import namedtuple
import logging
from ublox.socket import UDPSocket
logger = logging.getLogger(__name__)
Stats = namedtuple('Stats', 'type name value')
class CMEError(Exception):
"""CME ERROR on Module"""
class ATError(Exception):
"""AT Command E... |
import json
import logging
import logging.handlers
import os
import re
import subprocess
import types
import uuid
import librosa
import numpy as np
import torch
from shutil import rmtree
from librosa.filters import mel as librosa_mel_fn
from scipy.io import wavfile
from daft_exprt.symbols import ascii, eos, punctua... |
import sys
import tkinter as tk
import tkinter.font as tkfont
import tkinter.filedialog as tkfile
import tkinter.messagebox as tkmessage
import argparse
import ctypes
import platform
import signal
def signal_handler(signal, frame):
print("\nForced end\n")
sys.exit(0)
class Persist(tk.Frame):
SUBSIZE = 3
X =... |
# Copyright 2015, 2017 IBM Corp.
#
# 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 require... |
"""
The :mod:`mlshell.producers.dataset` contains examples of `Dataset` class for
empty data object creation and `DataProducer` class for filling it.
:class:`mlshell.Dataset` proposes unified interface to interact with underlying
data. Intended to be used in :class:`mlshell.Workflow`. For new data formats
no need to e... |
import numpy as np
from futile.Utils import write
HaeV = 27.21138386
def _occ_and_virt(log):
"""
Extract the number of occupied and empty orbitals from a logfile
"""
norb = log.log['Total Number of Orbitals']
if log.log['Spin treatment'] == 'Averaged':
norbv = log.evals[0].info[0]-norb
... |
"""
gtp_connection.py
Module for playing games of Go using GoTextProtocol
Parts of this code were originally based on the gtp module
in the Deep-Go project by <NAME> and <NAME>
at the University of Edinburgh.
"""
import signal, os
import traceback
from sys import stdin, stdout, stderr
from board_util import GoBoardU... |
#!/bin/env python3
# import os
# os.environ['PYTHONASYNCIODEBUG'] = '1'
# import logging
# logging.getLogger('asyncio').setLevel(logging.DEBUG)
from datetime import datetime
import traceback
import atexit
import argparse
import os
from os import path
import sys
import logging
from struct import pack
import random
fro... |
import re
import copy
from mau.lexers.base_lexer import TokenTypes, Token
from mau.lexers.main_lexer import MainLexer
from mau.parsers.base_parser import (
BaseParser,
TokenError,
ConfigurationError,
parser,
)
from mau.parsers.text_parser import TextParser
from mau.parsers.arguments_parser import Argum... |
import maya.cmds as cmds
import re
import rsTools.utils.openMaya.dataUtils as dUtils
import maya.OpenMayaAnim as OpenMayaAnimOld
import maya.OpenMaya as OpenMayaOld
import maya.api.OpenMaya as om
import maya.api.OpenMayaAnim as oma
def isDeformer(deformer):
if not cmds.objExists(deformer):
return False
... |
"""
Find (old) loanwords between two languages
"""
from ast import literal_eval
from functools import partial
from logging import getLogger
from pandas import DataFrame, Series, concat, read_csv
from tqdm import tqdm
from panphon.distance import Distance
from loanpy.helpers import gensim_multiword
from loanpy.adrc ... |
import os,sys
import numpy as np
import pandas as pd
import geopandas as gpd
import matplotlib.pyplot as plt
import pygeos
from osgeo import gdal
from tqdm import tqdm
import igraph as ig
import contextily as ctx
from rasterstats import zonal_stats
import time
import pylab as pl
from IPython import display
import seabo... |
# The 3-Clause BSD License
# Copyright (C) 2019, KessK, all rights reserved.
# Copyright (C) 2019, Kison.Y, all rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:Redistribution and use in source and binary ... |
import tensorflow as tf
import numpy as np
import os, datetime, itertools, shutil, gym, sys
from tf_rl.common.visualise import plot_Q_values
from tf_rl.common.wrappers import MyWrapper, CartPole_Pixel, wrap_deepmind, make_atari
"""
TF basic Utility functions
"""
def eager_setup():
"""
it eables an eager ex... |
#!/usr/bin/python
#
# This script is used to analyze, tabulate, and graph data generated by
# the JAM weaver and by JAMScript performance instrumentation. It was
# used to produce figures presented in the experimental results section
# of ``Efficient Runtime Enforcement Techniques for Policy Weaving,''
# published at F... |
from enum import Enum
import hashlib
import math
import os
import random
import re
from chainmap import ChainMap
from torch.autograd import Variable
import librosa
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as data
from .manage_audio import AudioPrepr... |
#!/usr/bin/env python
from six import BytesIO
import wx
import wx.richtext as rt
import images
#----------------------------------------------------------------------
class RichTextFrame(wx.Frame):
def __init__(self, *args, **kw):
wx.Frame.__init__(self, *args, **kw)
self.MakeMenuBar()
... |
# -*- coding: utf-8 -*-
'''
feedgen.entry
~~~~~~~~~~~~~
:copyright: 2013-2020, <NAME> <<EMAIL>>
:license: FreeBSD and LGPL, see license.* for more details.
'''
from datetime import datetime
import dateutil.parser
import dateutil.tz
import warnings
from lxml.etree import CDATA # nosec - adding CDAT... |
import sys
from pathlib import Path
import cv2
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
import torchvision
from torchvision import transforms
import torchvision.transforms.functional as F
from skimage.util import random_noise
from dataloading.camera import Camera
cl... |
# -*- coding: utf-8 -*-
import sys
import os
import numpy as np
import fourier as ff
import matplotlib
import warnings
from matplotlib import pyplot as plt
from os.path import isfile
matplotlib.use('Agg')
def warn(*args, **kwargs):
print('WARNING: ', *args, file=sys.stderr, **kwargs)
def fit_validate_model(mod... |
#!/usr/bin/python3
# MIT License
# Copyright (c) 2017 <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, m... |
def trans_date(field: dict) -> str:
text = str(field['date'])
return '%s.%s.%s' % (text[6:], text[4:6], text[:4])
def trans_4xx(field: dict, lang: str) -> str:
text = str(field['bnum'])
return '%s %s %s/%s' % (trans_date(field), labels['bulletin'][lang], text[:4], text[4:])
def trans_ipc(field... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 13 12:12:25 2021
@author: Jordan
"""
import sys
import os
import numpy as np
import pandas as pd
import seaborn as sns
import tempfile
import gc
import re
import collections
import gzip
import bisect
import pickle
import itertools
import math
sns.... |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 11 11:37:39 2014
@author: sm1fg
Construct the magnetic network and generate the adjustments to the
non-magnetic atmosphere for mhs equilibrium.
"""
import os
import warnings
import numpy as np
import astropy.units as u
from scipy.interpolate import RectBivaria... |
"""
Created on Mar 7 2018
@author: MCC
"""
from ctypes import (CDLL, CFUNCTYPE, Structure, c_uint, c_int, c_longlong,
POINTER, c_double, c_char, py_object, c_ulonglong, cast,
c_char_p, c_byte)
from enum import IntEnum
from .ul_structs import DaqDeviceDescriptor, AiQueueElement, ... |
from functools import reduce
import numpy as np
from sparse import SparseTensor
def reduce_prod(seq): return reduce(lambda item_1, item_2: item_1 * item_2, seq)
class Polynomial:
def __init__(self, coeff, indices, merge=True):
"""\\sum_{i=0}^{N-1} coeff[i] \\Pi_{j=0}^{NV-1} x_j^{indices[i, j]}"""
... |
# TEXAS HOLD'EM (Program by <NAME>)
import random, itertools, copy, sys
import os
from playsound import playsound
import pyttsx3
# Set to true to enable betting.
do_bets = False
RANKS = ['2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A']
SUITS = ['C', 'D', 'H', 'S']
SORT_RANKS = {'2': 0, '3': 1, '4': 2... |
"""Convert, load or write JSON."""
import json
import logging
import os
import re
import sys
from os import geteuid, path
from subprocess import CalledProcessError, PIPE, Popen, STDOUT, check_call
from iocage.lib.ioc_common import checkoutput, get_nested_key, open_atomic
def _get_pool_and_iocroot():
"""For inter... |
# -*- coding: utf-8 -*-
"""This class maintains the internal dfTimewolf state.
Use it to track errors, abort on global failures, clean up after modules, etc.
"""
from dataclasses import dataclass
from concurrent.futures import ThreadPoolExecutor, Future
import importlib
import logging
import threading
import tracebac... |
# Copyright 2020 Makani Technologies 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... |
import torch
import numpy as np
import cv2
import os
import h5py
from collections import defaultdict
from mvn.models.triangulation import RANSACTriangulationNet, AlgebraicTriangulationNet, VolumetricTriangulationNet
from mvn.models.loss import KeypointsMSELoss, KeypointsMSESmoothLoss, KeypointsMAELoss, KeypointsL2Loss... |
from __future__ import absolute_import, division, print_function
import six.moves.cPickle as pickle
from glob import glob
import os
import pytest
from dxtbx.model import Experiment, ExperimentList
from dxtbx.model.experiment_list import ExperimentListFactory, \
ExperimentListDumper, ExperimentListDict
def test_ex... |
from abc import ABC, abstractmethod
from enum import Enum
from functools import partial
# from math import isinf
from typing import Union, Optional, Any
from typing import Callable, Tuple, Dict, List, Set, Type # noqa: F401
from ..builtin_values import Bool, ops_symbols
from ..abstract_value import AbstractValue
from... |
import functools
import json as json_pkg # avoid conflict name with json argument employed for some function
import os
from distutils.version import LooseVersion
from typing import TYPE_CHECKING
from urllib.parse import urlparse
import mock
import requests
import requests.exceptions
from pyramid.httpexceptions import... |
# coding=utf8
import os
from tkinter import messagebox
from tkinter import ttk
from tkinter import *
import tkinter as tk
import database
from tkinter import filedialog
databaseName = 'dataBase.db'
who = 0
currentUserID = 0
currentTable = 0
root = tk.Tk()
root.title("Библиотека")
root.geometry("1750x500")
root.resizab... |
#
# HttpServer.py
#
# (c) 2020 by <NAME>
# License: BSD 3-Clause License. See the LICENSE file for further details.
#
# Server to implement the http part of the oneM2M Mcx communication interface.
#
from __future__ import annotations
import logging, sys, traceback, urllib3
from copy import deepcopy
from typing import ... |
import discord
from discord.ext import commands
import asyncio
import logging
import sys
import requests
import datetime
from bs4 import BeautifulSoup
from util import *
from wowapi import WowApi, WowApiException, WowApiConfigException
from killpoints import KillPoints
from math import ceil
base_wow_progress = "http:/... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019-2020 European Commission (JRC);
# Licensed under the EUPL (the 'Licence');
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
"""
Harvest functions & annotate their ... |
# Uno PWM bipolar curve tracer app by simple-circuit 12-22-19
# rev 3 1-13-20
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from tkinter import font
import numpy as np
import serial
root = Tk()
default_font = font.nametofont("TkDefaultFont")
default_font.configure(size=9)
canvas = Canva... |
"""Mutation.
Usage:
mutation play [--verbose] [--exclude=<globs>] [--only-deadcode-detection] [--include=<globs>] [--sampling=<s>] [--randomly-seed=<n>] [--max-workers=<n>] [<file-or-directory> ...] [-- TEST-COMMAND ...]
mutation replay [--verbose] [--max-workers=<n>]
mutation list
mutation show MUTATION
mut... |
# @date 2020-01-31
# @author <NAME>, All rights reserved without prejudices.
# @license Copyright (c) 2020 Dream Overflow
# Binance Websocket connector.
import json
import threading
import traceback
from autobahn.twisted.websocket import WebSocketClientFactory, WebSocketClientProtocol, connectWS
from twisted.internet... |
import pickle
import stanza
import test_stuff
from datetime import datetime
from dictionary import cd, dictionary, nlp_dictionary, ph_outcome, ph_key, ph_value, ph_dvalue, ph_subject
import eric_nlp
#does not do preprocessing
def depparse(sentences, pipeline):
output = ["OUTPUT:\n"]
roots = dict()
for sen... |
#!/usr/bin/env python
# Copyright 2020 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# 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... |
# -*- coding: utf-8 -*-
# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules
# Copyright (C) 2020, <NAME> <<EMAIL>>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details.
"""
"""
import flexsolve a... |
# -*- coding: utf8 -*-
"""
Creates AdExpIF PC and BC populations in Brian2, loads in recurrent connection matrix for PC population
runs simulation and checks the dynamics
authors: <NAME>, <NAME>, <NAME> last update: 07.2019
"""
import os
import sys
import shutil
import numpy as np
import random as pyrandom
from brian2... |
#!/usr/bin/env python3
r"""
Overview
________
This scripts converts bibliographies from RIS to BibTeX format, preserving only
relevant information. The RIS input file can be generated, for example, using
Zotero's "Quick Copy" feature (Edit > Preferences > Export). It may contain
certain Unicode characters, e.g., subs... |
import collections
import itertools
import random
import numpy as np
import torch
import torch.nn.functional as F
import pfrl
from pfrl import agent
from pfrl.utils.batch_states import batch_states
from pfrl.utils.mode_of_distribution import mode_of_distribution
from pfrl.utils.recurrent import (
concatenate_recu... |
# Copyright 2018 Recruit Communications 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 a... |
import asyncio
import json
import logging
import time
import collections
import base64
import binascii
import pathlib
import inspect
import motor.motor_asyncio
import itsdangerous
from aiohttp import web
from itsdangerous import TimestampSigner
import litecord.api as api
import litecord.managers as managers
from .en... |
import json
import pandas as pd
from datetime import datetime
from math import e
from os import path, makedirs, listdir
from re import compile
from pprint import pprint
from itertools import zip_longest
from itertools import combinations, permutations
from operator import itemgetter
from collections import OrderedDict,... |
#! /usr/bin/env python3
# Read from stdin, spit out C header or body.
import argparse
import copy
import fileinput
import re
from collections import namedtuple
Enumtype = namedtuple('Enumtype', ['name', 'value'])
type2size = {
'pad': 1,
'struct channel_id': 32,
'struct short_channel_id': 8,
'struct ... |
# Copyright 2013 NetApp
# 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 applic... |
import numpy as np
import oyaml as yaml
import pandas as pd
from sklearn.metrics import auc, confusion_matrix
import warnings
def confusion_matrix_fine(
Y_true, Y_pred, is_true_incomplete, is_pred_incomplete):
"""
Counts overall numbers of true positives (TP), false positives (FP),
and false negat... |
## DO NOT MODIFY
## 38a033ab94df08dff68592892f214de3308e89ec-1.0.0.11
## DO NOT MODIFY
## Metadata:
# <?xml version="1.0" encoding="utf-8"?>
# <metadata name="Extended High Resistance Test" description="Extended High Resistance Test" bin="25" product="S3908">
# <parameter name="Limits" type="string[][]" des... |
from os.path import join
import sys
sys.path += ['../']
import argparse
import glob
import json
import logging
import os
import random
import numpy as np
import torch
sys.path.append(os.getcwd())
sys.path.append(os.path.abspath(os.path.dirname(os.getcwd())))
#
from torch.utils.data import DataLoader, RandomSampler,... |
from django.db import models
from apps.beneficary.models import Beneficiary, BeneficiaryForm
from apps.professionals.models import Prof_table
from decimal import Decimal
from django.forms import ModelForm
from django.forms.widgets import Textarea
# Create your models here.
YN = [
('NO', 'NO'),
('SI', 'SI')
]
... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 27 2020
@name: WebVariable Objects
@author: <NAME>
"""
import regex as re
import numpy as np
from parse import parse
from functools import reduce
from itertools import groupby
from abc import ABC, abstractmethod
from collections import OrderedDict as ODict
from collect... |
import os
import importlib
from pathlib import Path
import getpass
import inspect
import pickle
from unittest.mock import Mock
import pytest
import yaml
import numpy as np
from ploomber.env.env import Env
from ploomber.env.decorators import with_env, load_env
from ploomber.env import validate
from ploomber.env.envdic... |
# Import libraries
import streamlit as st
import pandas as pd
import yfinance as yf
import talib
import plotly.graph_objects as go
import plotly.express as px
import requests
import seaborn as sns
import os
from streamlit_lottie import st_lottie
from sqlalchemy import create_engine
# Import my custom scri... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__project__ = "Pizza3"
__author__ = "<NAME>"
__copyright__ = "Copyright 2022"
__credits__ = ["<NAME>"]
__license__ = "GPLv3"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__version__ = "0.41"
"""
Matlab-like Structure class
Matlab MS.alias like class (with MS = Molecul... |
#!/usr/bin/env python3
# encoding: utf-8
import os
import argparse
import numpy as np
import sys
import torch
import torch.nn as nn
import csv
from config import config
from utils.pyt_utils import ensure_dir, parse_devices
from engine.evaluator import Evaluator
from engine.logger import get_logger
from seg_opr.metric i... |
#!/usr/bin/env python
__author__ = 'waroquiers'
import unittest
import numpy as np
from pymatgen.util.testing import PymatgenTest
from pymatgen.analysis.chemenv.coordination_environments.coordination_geometries import ExplicitPermutationsAlgorithm
from pymatgen.analysis.chemenv.coordination_environments.coordinatio... |
"""
from bk_ds_libs import bk_utils_ds
done Lint-C
# __c Bottom up!
"""
# __t Environments to use
# Import * plus import the module, for convenience, and to get tooltip help within each module
import math
import typing as tp
from typing import Any
from bk_ds_libs import bk_data_sets
import numpy as np
import p... |
# -*- coding: utf-8 -*-
from functools import partial
from nose.tools import raises
from nose import SkipTest
from crank.util import get_params_with_argspec
import tg
import tests
from json import loads
import datetime
from tg.controllers import TGController, DecoratedController, abort
from tg.controllers.util import... |
import json
import logging
import os
from glob import glob
from multiprocessing.pool import Pool
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import tifffile as tf
from matplotlib.widgets import Button, RectangleSelector
from scipy.interpolate import interp1d
# from skimage.transform im... |
#
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PRO... |
from __future__ import print_function, division, absolute_import
import re
import sys
import logging
from itertools import combinations
from collections import defaultdict
from functools import partial
from conda import verlib
from conda.utils import memoize
from conda.compat import itervalues, iteritems
from conda.l... |
# %%
import os
import numpy as np
import pandas as pd
from interpret.glassbox import ExplainableBoostingClassifier, ExplainableBoostingRegressor
from interpret import show
from matplotlib import pyplot as plt
from pytorch_lightning import LightningModule
from pytorch_lightning.callbacks import ModelCheckpoint
from skl... |
# Use grid search to optimise the hyper-parameters for 6 ML Models
import warnings
warnings.filterwarnings('ignore') # Ignore warnings
import pandas as pd
import numpy as np
import pickle
import math
import time
import sys
import os
import itertools
from collections import Counter
from pathlib import Path
from sklearn.... |
import os
import warnings
import collections
from collections import abc
import sqlalchemy as sql
from .storage import universal_schema
from .tools import group_by, compare_sets, grouper
from . import tools
# import ujson as json # ujson is no longer maintained
import json
from .backend import extract_backend_metadat... |
"""
core/shell.py -- Entry point for the shell interpreter.
"""
from __future__ import print_function
import errno
import time
from _devbuild.gen import arg_types
from _devbuild.gen.option_asdl import option_i, builtin_i
from _devbuild.gen.syntax_asdl import source
from asdl import runtime
from core import alloc
fr... |
"""
Copyright 2020 The OneFlow 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 applicable law or agr... |
#!/usr/bin/env python3
#
# Copyright (c) 2020 <NAME> (github.com/kanflo)
#
# 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 us... |
from abc import abstractmethod
import os
from pathlib import Path
import collections.abc
import logging
import uuid
from urllib.parse import urlparse
import numpy as np
import blake3
from frozendict import frozendict
import pyarrow as pa
import vaex
from vaex.array_types import data_type
from .column import Column, ... |
"""
Tests for quad.py
Notes
-----
Many of tests were derived from the file demqua## in the CompEcon
toolbox.
For all other tests, the MATLAB code is provided here in
a section of comments.
"""
import os
import unittest
from scipy.io import loadmat
import numpy as np
from numpy.testing import assert_allclose
import p... |
#!/home/paek/anaconda2/bin/python2.7
#============================================================
# 1. FILE CHECK, whether new folder was updated.
# 2. pre-processing + log file
# 3. moving
# 4. combine and subtraction (not yet)
# 18.12.04 add something by G.Paek
#============================================... |
from __future__ import absolute_import, division, print_function
import sys,os
import iotbx.phil
from scitbx.array_family import flex
'''
Utilities to generate models and maps from standard or user-selected PDB files
Use map_model_manager to access these utilities
'''
def get_map_manager(map_data,wrapping,
... |
#!/usr/bin/env python
# coding: utf-8
"""Test module to test massedit."""
# Copyright (c) 2012-17 <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 wit... |
import operator
import pickle
from types import SimpleNamespace
import numpy as np
import pandas
import pytest
from pandas.testing import assert_frame_equal, assert_series_equal
import dask
import dask.array
from dask.dataframe.core import has_parallel_type
from dask.sizeof import sizeof
from distributed import Clien... |
'''
@Author: ConghaoWong
@Date: 2019-12-20 09:39:02
LastEditors: <NAME>
LastEditTime: 2020-09-16 16:46:14
@Description: file content
'''
import os
import random
import cv2
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
from helpmethods import (calculate_ADE_FDE_numpy, dir_check,
... |
# measure/controllers.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .models import ContestMeasure, ContestMeasureListManager, ContestMeasureManager, \
CONTEST_MEASURE_UNIQUE_IDENTIFIERS
from ballot.models import MEASURE
from config.base import get_environment_variable
from django.http impor... |
# Development tool - upgrade command plugin
#
# Copyright (C) 2014-2017 Intel Corporation
#
# SPDX-License-Identifier: GPL-2.0-only
#
"""Devtool upgrade plugin"""
import os
import sys
import re
import shutil
import tempfile
import logging
import argparse
import scriptutils
import errno
import bb
devtool_path = os.pat... |
"""Flask-SQLAlchemy-based database ORM models.
Copyright 2016 AURA/LSST.
Copyright 2014 <NAME>.
"""
from __future__ import annotations
import enum
import urllib.parse
import uuid
from datetime import datetime
from typing import Any, List, Optional, Type, Union
from cryptography.fernet import Fernet
from flask impor... |
from ._BasicGraph import BasicGraph
from .graph_style.NodeStyle import NodeStyle
from .graph_style.EdgeStyle import EdgeStyle
from .graph_style.RootAndBranchStylist import RootAndBranchStylist
from graphviz import Source, Graph as GraphvizGraph, Digraph
import os
from functools import wraps
import random
from colourati... |
import logging
import time
import uuid
import base64
import warnings
from urllib.parse import parse_qs
import mock
import pytest
import respx
from httpx import Response, AsyncClient
import ably
from ably import AblyRest
from ably import Auth
from ably import AblyAuthException
from ably.types.tokendetails import Token... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2007-2012, GoodData(R) Corporation. All rights reserved
import datetime
import logging
import multiprocessing
import os
import re
import signal
import simplejson
import setproctitle
import time
import types
from smoker.server.exceptions import *
import smo... |
from pathlib import Path
import argparse
# https://matplotlib.org/stable/api/tri_api.html
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import pandas as pd
import seaborn as sns
from matplotlib.tri import Triangulation, UniformTriRefiner, LinearTriInterpolator, \
CubicTriInterpolator... |
import argparse
import collections
import json
import logging
import os
import pathlib
import pickle
from typing import Dict, List, Tuple
import numpy as np
import torch
from transformers import AutoTokenizer, AutoModel
from beir import util, LoggingHandler
from beir.datasets.data_loader import GenericDataLoader
from... |
"""
@author: <EMAIL>
"""
import numpy as np
import tensorflow as tf
import tensorflow.keras.layers as kl
import tensorflow.keras.losses as kls
import matplotlib.pyplot as plt
import math
import os
from tqdm import tqdm
from scipy.interpolate import interp1d
import time
#disable gpu
physical_devices = tf.config.expe... |
# 01-02-04
# v1.0.2
#
# Date Utils
# By Fuzzyman see www.voidspace.org.uk/atlantibots/pythonutils.html
# Written for the Victory Day program for Jesus Fellowship Church
# www.jesus.org.uk
# These are various functions for dealing with dates (including leap years and so on)
# Useful especially for situations... |
from flask import Flask, flash, request, jsonify, render_template, redirect, url_for, g, session, send_from_directory, abort
from flask_cors import CORS
from flask_api import status
from datetime import date, datetime, timedelta
#from dateutil.parser import parse
import pytz
import os
import sys
import time
import uui... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.