text stringlengths 6.04k 39.5k |
|---|
"""
failnozzle:
A daemon for batching error log messages, emailing digests, and alerting on
error rates.
"""
# even though this violates pep8 import order, it has to be here to
# monkey patch before any potentially blocking modules are imported.
import gevent
import gevent.monkey
gevent.monkey.patch_all()
fro... |
import numpy as np
from scipy.interpolate._cubic import PchipInterpolator
from scipy.interpolate.interpolate import RegularGridInterpolator
from abc import abstractmethod, ABC
from autograd.core import defvjp, primitive
from py_wake.utils.gradients import fd
from scipy.interpolate.fitpack2 import UnivariateSpline
from ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
from backports import csv
import io
import math
import os
import sys
import tempfile
from builtins import zip
from mock import MagicMock
from nos... |
# coding=utf-8
import copy
try:
from cStringIO import StringIO
except:
from io import StringIO
from collections import Iterable
from asdl.asdl import *
from asdl.asdl_ast import AbstractSyntaxTree, RealizedField
def parse_lambda_expr_helper(s, offset):
if s[offset] != '(':
name = ''
whi... |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from google.appengine.ext import ndb
from dashboard.common import testing_common
from dashboard.common import utils
from dashboard.models i... |
# Copyright (c) 2015 Orange.
# 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 a... |
# Copyright 2016-2018, Rigetti Computing
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""
QuantumFlow representations of pure quantum states and actions on states.
.. contents:: :local:
State objects
#############
.... |
"""
A basic (and perhaps strict) implementation of some functions regarding the
rHEALPIX projection.
The primary requirement was for taking arrays of longitudes and latitudes
and generating rHEALPIX region code identifiers. These could then be used
for creating density maps, and survey coverage in general. The coverage... |
import subprocess
import os
import sys
import re
import pipes
from workflow import Workflow3, ICON_WARNING, ICON_INFO, ICON_ERROR, web
reload(sys)
sys.setdefaultencoding("utf-8")
adb_path = os.getenv('adb_path')
aapt_path = os.getenv('aapt_path')
serial = os.getenv('serial')
apkFileOrFolder = pipes.quote(os.getenv('... |
import torch
import torch.nn.functional as F
from framework.base_experiment import BaseExperiment
from framework.vis_mixin import SpatialVisMixin
from ool.metrics import align_masks_iou, dices, ari, ari2
class OOLBoxExp(BaseExperiment, SpatialVisMixin):
"""For models that predict bounding boxes using some form o... |
# -*- coding: utf-8 -*-
"""
RPM Clustering Module
"""
from copy import deepcopy
import geopandas as gpd
import logging
import numpy as np
import pywt
from scipy.spatial import cKDTree
from shapely.geometry import Point
from reVX.handlers.outputs import Outputs
from reVX.utilities.cluster_methods import ClusteringMetho... |
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.soc.cores.code_8b10b import Encoder, Decoder
from migen.genlib.cdc import *
from gtp_7series_init import GTPTXInit, GTPRXInit
from clock_aligner import BruteforceClockAligner
from prbs_files.tx_top import _TX
from prbs_files.rx_... |
"""
Protocols for predicting protein 3D structure from ECs
Authors:
<NAME>
<NAME> (complex_dock)
"""
from os import path
from math import ceil
import billiard as mp
from functools import partial
import shutil
import pandas as pd
from evcouplings.align.alignment import (
read_fasta, parse_header
)
from evcou... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models
import collections
import math
def weights_init(m):
# Initialize filters with Gaussian random weights
if isinstance(m, nn.Conv2d):
n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels
m.weight.data... |
# Author: <NAME> <<EMAIL>>
#
# License: BSD 3 clause
from __future__ import print_function
import locale
from warnings import warn
from scipy.optimize import curve_fit
import numpy as np
import scipy.sparse
import numba
import umato.distances as dist
import umato.sparse as sparse
import umato.sparse_nndescent as s... |
import logging # use instead of print for more control
import inspect # get signature of functions (e.g. to pass kwargs)
from pathlib import Path # filesystem related stuff
import numpy as np # numerical computations
import re
import matplotlib.pyplot as plt
from astropy.io impor... |
import glob
import os
from flask import g
from thanados import app
class Data:
@staticmethod
def get_list():
# noinspection SqlIdentifier
sql_sites = """
DROP TABLE IF EXISTS thanados.tmpsites;
CREATE TABLE thanados.tmpsites AS (
SELEC... |
from operator import itemgetter
from collections import OrderedDict
from typing import List, Tuple, Dict, Optional
import torch
from torch import nn, Tensor
import torch.nn.functional as F
from torchvision.models.detection.image_list import ImageList
from torchvision.models.detection.rpn import (
RegionProposalN... |
# coding: utf-8
# public items
__all__ = ["loaddfits", "savefits", "loadnetcdf", "savenetcdf"]
# standard library
from datetime import datetime
from pytz import timezone
from logging import getLogger
from uuid import uuid4
from pathlib import Path
from pkgutil import get_data
# dependent packages
import tomli
imp... |
#
# Copyright (c) 2013-2014,2017-2018 - Adjacent Link LLC, Bridgewater,
# New Jersey
# 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 co... |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# 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 mus... |
from json import encoder
import pickle
import contextlib
from numpy.core.fromnumeric import argsort
import torch
import torch.nn as nn
from torch.nn.modules import padding
from fairseq.models import lstm, transformer
from fairseq.models.bart import BARTModel, BARTHubInterface
from fairseq.models.wav2vec.wav2vec2 import... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""Write out predictions file for this dataset and method. Output will be
processed by ``make_stats.py`` in ``pose-prediction`` repo."""
import addpaths # noqa: F401
from argparse import ArgumentParser
import h5py
import json
import os
import shlex
import sys
import tim... |
import os
import random
import torch
import utils
# some code from https://github.com/huggingface/pytorch-transformers/blob/master/examples/run_lm_finetuning.py
class Masker:
def __init__(self, tok, p_mask_img=1 / 6, p_mask_txt=1 / 3, p_clobber_other_tgt_txt=5 / 6,
p_clobber_other_txt=1 / 6, **... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# For better print formatting
from __future__ import print_function
# Imports
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
from datetime import datetime
import logging
# CONFIGURABLE CONSTANTS
BOUNDS_ENABLED = False
BASE_... |
import cv2
import os
import sys
import math
import json
import shutil
import random
import argparse
import matplotlib
from xml.dom import minidom
import numpy as np
from matplotlib.patches import Polygon
from shapely.geometry import Polygon as shape_poly
import matplotlib.pyplot as plt
from matplotlib.collections impo... |
'''
FILE NAME
lab_app.py
Version 9
1. WHAT IT DOES
This version adds support for Plotly.
2. REQUIRES
* Any Raspberry Pi
3. ORIGINAL WORK
Raspberry Full Stack 2015, <NAME>
4. HARDWARE
* Any Raspberry Pi
* DHT11 or 22
* 10KOhm resistor
* Breadboard
* Wires
5. SOFTWARE
Command line terminal
Simple text editor
Librari... |
#Pyjsdl - Copyright (C) 2021 <NAME> <https://gatc.ca/>
#Released under the MIT License <https://opensource.org/licenses/MIT>
class Element:
def __init__(self, element=None):
if element is not None:
self._element = element
else:
self._element = None
@property
def s... |
"""Canonical Correlation Analysis."""
import numpy as np
from scipy import linalg
from .utils import cov_lags, pca
from .utils.matrix import _check_shifts, normcol, relshift, _times_to_delays
try:
from tqdm import tqdm
except ImportError:
def tqdm(*args, **kwargs): # noqa
if args:
return ... |
import matplotlib as mpl
import numpy as np
import pandas as pd
import pytest
import xarray as xr
from matplotlib import pyplot as plt
from xarray.testing import assert_allclose, assert_identical
import cf_xarray # noqa
from . import raise_if_dask_computes
from .datasets import airds, anc, ds_no_attrs, multiple, pop... |
import torch
import torchvision
from torch import nn
from torch.autograd import Variable
import torch.nn.functional as F
from torchvision.utils import save_image
from torchvision.models import vgg16
import math
def weights_init_normal(m):
classname = m.__class__.__name__
if classname.find('Conv') != -... |
import streamlit as st
import matplotlib.pyplot as plt
import numpy as np
import requests
import json
import pandas as pd
def main():
##### INIT #####
st.markdown(
'<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymo... |
import json
import os
from PIL import Image
from shapeworld import util
from shapeworld.world import World
def clevr(directory, mode, parts=None):
if parts is not None:
assert len(parts) == 3
parts = dict(train=parts[0], validation=parts[1], test=parts[2])
worlds = images_iter(directory=direct... |
import sys
import os
import logging
import subprocess
import shlex
import tempfile
import time
import getpass
from datetime import datetime
from pathlib import Path
import htcondor
from htcondor_cli.noun import Noun
from htcondor_cli.verb import Verb
from htcondor_cli.dagman import DAGMan
from htcondor_cli import J... |
"""
Configuration utilities.
Settings are stored in a dictionary-like configuration object.
All settings are modifiable by environment variables that encode
the path in the dictionary tree.
Inner nodes in the dictionary tree can be any dictionary.
A leaf node in the dictionary tree is represented by an inner node tha... |
#!/usr/bin/env python
#
# Copyright (c) 2015, 2016, 2017, 2018, 2019, Intel Corporation
#
# 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
# ... |
# coding: utf-8
# ## Using Bigram-Trigram for real-word error detection
# In[180]:
import sys
import os
import json
import re
import io
import pickle
import operator
from collections import defaultdict
import numpy as np
from .bktree import BKTree
from .utility import pickle_dump
import nltk
from nltk import ngr... |
# -*- coding:utf-8 -*-
import os
import time
import configparser
import json
from enum import Enum
from typing import Dict, List
from TopixCore30 import TopixCore30
from Nikkei255 import Nikkei255
from CompanyInformation import CompanyInformation
from CompanyInformation import CompanyInformationRepository... |
from __future__ import annotations
import json
import random
from copy import copy, deepcopy
from io import StringIO
from logging import Logger
from numbers import Number
from typing import (
Sequence,
List,
Tuple,
Deque,
Set,
Counter,
Mapping,
MutableMapping,
Any,
Dict,
Uni... |
"""
Typeclass for Player objects
Note that this object is primarily intended to
store OOC information, not game info! This
object represents the actual user (not their
character) and has NO actual precence in the
game world (this is handled by the associated
character object, so you should customize that
instead for m... |
import logging
import time
import requests
import six.moves.urllib.parse as urlparse
from .. import SSS_VERSION
from .. import SSS_FORMAT
from .. import ACTION_PREFIX
from .. import client
from ..common import constants
from ..common import exceptions
from ..common import serializer
from ..common import utils
from ..... |
"""This module contains Tock's main data structure, the Machine class,
and associated classes and functions."""
import collections
import itertools
import dataclasses
from . import syntax, settings
__all__ = ['Machine',
'FiniteAutomaton', 'PushdownAutomaton', 'TuringMachine',
'BASE', 'STREAM', '... |
from flask import Flask, request
from gensim import corpora, models, similarities
import csv
import numpy as np
import logging
import os
import sys
import gzip
import pkg_resources
from pkg_resources import DistributionNotFound
import pathlib
logging.basicConfig(
handlers=[logging.FileHandler(__file__ + ".log", "... |
import re
import string
import time
import xml.etree.ElementTree as ET
import enchant
import numpy as np
import pandas as pd
import spacy
# Try this if you get a problem with "spacy.load('en')":
# pip install spacy && python -m spacy download en
from nltk.corpus import stopwords
from nltk.stem.snowball import EnglishS... |
# Copyright (c) ZenML GmbH 2021. 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:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
"""Unit tests for modin data structures."""
import os
import typing
from unittest.mock import MagicMock
import modin.pandas as mpd
import pandas as pd
import pytest
import pandera as pa
from pandera import extensions
from pandera.engines import numpy_engine, pandas_engine
from pandera.typing.modin import DataFrame, ... |
from math import ceil, floor
import numpy as np
from cplex import Cplex, SparsePair, infinity as CPX_INFINITY
from .coefficient_set import CoefficientSet
from .utils import print_log
#todo: add loss cut
#todo: add constraint function
#todo: default cplex parameters
#todo: check cores
#todo: pass compute_loss to conver... |
import copy
import os
import time
from collections import defaultdict
import numpy as np
import random as randomlib
import torch
import torch.nn as nn
import torch.nn.functional as F
from random import random
from gym import Env
from gym.spaces import Discrete
from rl.agents.Agent import Agent
from rl.utils.networks... |
#!/usr/bin/python3
#
# Example nfcpy to wpa_supplicant wrapper for DPP NFC operations
# Copyright (c) 2012-2013, <NAME> <<EMAIL>>
# Copyright (c) 2019-2020, The Linux Foundation
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import os
import sys
import time
impo... |
import sys
import copy
THIS = sys.modules[__name__]
GRAPH_VARIABLE = 'rgp:index'
GRAPH_VERTEX = 'rgp:vertex'
GRAPH_VERTEX_ALL = 'rgp:vertex_all'
GRAPH_VERTEX_OUT = 'rgp:vertex_out'
GRAPH_VERTEX_IN = 'rgp:vertex_in'
GRAPH_VERTEX_INDICES = 'rgp:vertex_indices'
GRAPH_EDGE = 'rgp:edge'
GRAPH_EDGE_ALL = 'rgp:edge_all'
GRA... |
"""
Modular ball chaser robot.
To play yourself, type:
python modular_ball_chaser.py
Created by <NAME>. Licensed on the same terms as the rest of OpenAI Gym.
Modified by <NAME>.
"""
import numpy as np
import Box2D
from Box2D.b2 import fixtureDef
from Box2D.b2 import circleShape
from Box2D.b2 import polygonShape
fro... |
# Copyright 2021 The google-cloud-mlflow Authors.
#
# 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... |
# Source: https://www.tensorflow.org/text/api_docs/python/text/BertTokenizer
# Subword tokenizers
import collections
import os
import pathlib
import re
import string
import sys
import tempfile
import time
import numpy as np
import matplotlib.pyplot as plt
import tensorflow_datasets as tfds
import tensorflow_text as... |
import base64
from collections import namedtuple
import io
import os
import os.path
import re
from six.moves import input
import sys
import tempfile
from apitools.base.py import exceptions as apitools_exceptions
from googlecloudsdk.api_lib.deployment_manager import dm_api_util
from googlecloudsdk.api_lib.deployment_ma... |
import _tkreader
import traceback
import pandas as pd
import datetime as dt
class TkReader:
def __init__(self):
self._handle = 0
def __del__(self):
self.close()
def login(self, username, passwd):
self._handle = _tkreader.login(username, passwd)
if(self._handle == 0... |
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2018-2019 Laboratoire de Recherche et Développement de l'Epita
# (LRDE).
#
# This file is part of Spot, a model checking library.
#
# Spot is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
... |
"""
This module include all class objects used
for the management project system MP.
"""
import json
import datetime
import copy
# Load settings of the lib
import settings
class Workflow:
"""
Workflow is the interface that manages all projects.
"""
def __init__(self, db_path):
"""Initialization of the instanc... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# ------------------------------------------------------------------------------
from __future__ import absolute_import
from __future__ import divis... |
from __future__ import unicode_literals
from packaging.version import parse as parse_version
from packaging.specifiers import SpecifierSet
import requests
from safety import safety
from safety.errors import InvalidKeyError
from collections import OrderedDict
from .updates import InitialUpdate, SequentialUpdate, Sche... |
#!/usr/bin/env python3
"""
PiServerStatus Daemon
Display raspberry pi statistics (IP addresses, CPU load), weather, time, on the Scroll pHAT attached to the pi.
"""
import argparse
import configparser
from datetime import datetime
import fcntl
import logging
import logging.handlers
import math
import os
import socke... |
import os
from fusesoc.config import Config
from fusesoc import utils
from fusesoc.utils import pr_warn, pr_info, unique_dirs
class File(object):
name = ""
file_type = ""
is_include_file = False
logical_name = ""
def __init__(self, s):
self.is_include_file = False
if s[-1:] == ... |
from django.contrib import auth
from .models import *
from django.shortcuts import render, redirect, get_object_or_404
from sitio.forms import FormCreateUser, FormLogin, FormCreateArticle, FormCreateComment
from django.contrib.auth.models import User, Group
from django.contrib.auth.decorators import login_required
from... |
################################################################################################################
## IG generates n number of samples along the straight line path between baseline image and the orig image.
## In our implementation, we put all these samples on the cuda. So assign this value as per the gpu... |
#!/usr/bin/env python3
import json
from time import time, sleep # only use the function that gives the current time
import random
import sys
from cscore import CameraServer, VideoSource, UsbCamera, MjpegServer
from networktables import NetworkTablesInstance
import ntcore
import numpy as np
import cv2
from enum import... |
import datetime
import os
import shutil
import StringIO
from collections import Counter
from operator import attrgetter
from flask import current_app, render_template, request, flash, session, render_template_string, jsonify, redirect, make_response
from emonitor.extensions import scheduler, db, signal
from emonitor.mo... |
"""
Compare with the previous dialog_reader, this dialog_reader removes the token type id
but add padding token and other corresponding special tokens instead.
"""
import os
import json
import pickle
import random
import pprint
import logging
import numpy as np
from tqdm import tqdm
from operator import itemgetter
fro... |
import sys, os
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from tqdm import tqdm
import learningHelper as lh
import datetime
# sageconv
from typing import Union, Tuple
from torch_geometric.typing import OptPairTensor, Adj, Size
from torch import Tensor
from torch.n... |
"""
An electrode manager that deals with the relationships between electrode
numbers and electrode positions.
It can be used while importing data, but also to manage electrode positions for
data that does not come with actual electrode positions.
## Possible future features
## Implemented features
* [done] Genera... |
#--- LICENSE ------------------------------------------------------------------
# olefile (formerly OleFileIO_PL) is copyright (c) 2005-2019 <NAME>
# (https://www.decalage.info)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that t... |
from __future__ import annotations
import torch
import numpy as np
from torch import nn
from torch import Tensor
from collections import OrderedDict
from typing import List
from functools import partial
from glasses.nn.blocks import ConvBnAct
from glasses.nn.att import ChannelSE
from ....models.utils.scaler import Comp... |
from data import dex
import random
import math
import re
class Pokemon(object):
def __init__(self, pokemon_set, side_id, side=None, battle=None):
self.side_id = side_id
self.side = side
self.battle = battle
self.pokemon_set = pokemon_set
self.species = re.sub(... |
# MIT License
#
# Copyright (c) 2020 MiscellaneousStuff
#
# 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,... |
from urllib.parse import urljoin
import os.path
import threading
import enchant
import os
from bs4 import BeautifulSoup
import requests
import re
import pyperclip as pc
import time
import multiprocessing as mp
from Tree import *
def getSoup(web):
try:
r=requests.get(web,timeout=(5,25))
print(web+"::Retrived")
re... |
"""object oriented, high-level wrapper of the (some of) cairo graphics library
What is a benu? A benu is a purple heron, a species of Egyptian bird
thought to be the phoenix.
"""
from __future__ import division, with_statement
from __future__ import absolute_import
import cairo
import os, warnings
import numpy as np... |
#!/usr/bin/env python3.8
#Software License Agreement (BSD License)
#Copyright (c) 2017 <NAME> last update on me
#All rights reserved.
from __future__ import division
from pprint import pprint
from scapy.all import *
import numpy
import configparser
import os.path
import json
import scapy
import tldextract #Seperating ... |
import os
import time
import numpy as np
import pandas as pd
import scipy.sparse
import matplotlib.pyplot as plt
import h5py
import argparse
import pickle
import multiprocessing
from copy import copy
import json
import thimbles as tmb
from thimbles.modeling import modeling
from thimbles.hydrogen import get_H_mask
fro... |
#!/bin/env python
#
# output.py: functions for outputting analysis results
# Copyright (C) University of Manchester 2015-2019 <NAME>,
# <NAME> & <NAME>
#
"""
output.py
Functions for outputing analysis results
"""
from . import distances
from .Peaks import Peak
import io
import tempfile
##################... |
#!/usr/bin/env python
"""Helper functions to validate parsed input"""
# Python library imports
import re
# CCPP framework imports
from .parse_source import CCPPError
########################################################################
def check_dimensions(test_val, max_len=0, error=False):
"""Return <test_v... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import sys
import os
import os.path
import numpy as np
from collections import namedtuple
from collections import OrderedDict
import json
import deeplift
import tensorflow as tf
NEAR_ZERO_THRESHOLD = 10**(-7)
... |
import json
import pickle
import time
import cv2
import os
import sys
import numpy as np
# Script which creates training data from the BrnoCompSpeed dataset for the Transform3D and Transform2D variants from
# the paper
# Requires https://github.com/matterport/Mask_RCNN
if os.name == 'nt':
sys.path[0:0] = [os.pat... |
#!/usr/bin/python3
import re
from . import generalcfg
from . import download
def exhtest(htmlContent):
pattern = re.compile(r"Front")
usefulCookies = False
if bool(re.search(pattern, htmlContent)):
usefulCookies = True
return usefulCookies
def Grossdataspider(htmlcontent):
# patternThumb = ... |
from __future__ import absolute_import
import errno
import re
import logging
import os
import mimetypes
import sys
import tempfile
from os.path import splitext
from six import string_types
from six import PY3
from six.moves.urllib.parse import urlparse, unquote_plus
import requests
from fulltext.util import warn
fro... |
from abc import ABC
from typing import Optional, List, Any
from .sql_generic import SqlNode, SqlNodeInspection, SqlContext, SqlKeyword, SqlOperator, SqlNodeIntrospection, \
RewritableSqlNode
from ..parser import ast
K_AND = SqlKeyword("AND")
K_OR = SqlKeyword("OR")
K_AS = SqlKeyword("AS")
K_ON = SqlKeyword("ON")
... |
import os, cv2
import numpy as np
from PIL import Image, ImageFilter
import logging
import torch
import torch.nn as nn
import random
def get_label(data_name, label_file, task_type=None):
label_path = os.path.join('data', data_name, label_file)
with open(label_path, 'r') as f:
labels = f.readlines()
... |
import discord
import config
import requests
import json
import libraries.helper as Helper
import os
import shutil
line_return = '\n' # needed later for f-strings because finicky interpreter
if not os.path.exists("../config/config.json"):
shutil.copyfile("../config/config_example.json", "../config/config.json")
... |
'''相比于model_develop_utils.py, 这部分的代码更有特异性,针对不同领域做了调整'''
import numpy as np
import torch
import torch.optim as optim
import torch.utils.data
from tqdm import tqdm
import time
import csv
import os
from torchtoolbox.tools import mixup_criterion, mixup_data
import time
import os
from sklearn.manifold import TSNE
import t... |
"""
Functional Groups
=================
The purpose of functional groups is to identify which atoms of a
building block are modified during construction. See
:class:`.FunctionalGroup` for more details.
See the documentation of :class:`.Reactor` to see how reactions between
functional groups are performed.
.. _`addin... |
"""
Interactive annotation tool for 3D human pose estimation.
Given an image and a coarse 3D skeleton estimation, the user can interactively
modify the 3D parameters and save them as the ground truth.
"""
from mpl_toolkits.mplot3d import Axes3D
from scipy.spatial.transform import Rotation as R
from cv2 import projectPo... |
# Copyright (c) 2018-2022 curoky(<EMAIL>).
#
# This file is part of my-own-x.
# See https://github.com/curoky/my-own-x for further info.
#
# 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
#
# ... |
"""
MIT License
Copyright (c) 2020 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distri... |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import cv2
from skimage.feature import hog
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn import svm
from sklearn import tree
from sklearn.metrics imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import os
from ooi_data_explorations.common import inputs, m2m_collect, m2m_request, get_deployment_dates, \
get_vocabulary, update_dataset, dt64_epoch, ENCODINGS
ATTRS = {
'raw_oxygen_concentration': {
'long_name': 'Raw Dissolved Oxygen... |
from gurobipy import GRB, quicksum
import gurobipy as gp
import numpy as np
from scipy.stats import norm
from entmoot.acquisition import get_gamma
def get_opt_core_copy(opt_core):
new_opt_core = opt_core.copy()
new_opt_core._n_feat = opt_core._n_feat
# transfer var dicts
new_opt_core._cont_var_dict =... |
import random
from holoclean.global_variables import GlobalVariables
import time
class RandomVar:
"""RandomVar class: class for random variable"""
def __init__(self, **kwargs):
"""
Initializing random variable objects
:param kwargs: dictionary of properties
"""
self._... |
#==============================================================================#
# #
# Author: <NAME> #
# Tree building algorithm based a slide deck on a Symbolic Derivation program #
# ... |
from collections import namedtuple
import logging
import socket
import struct
import zlib
from .codec import gzip_encode, gzip_decode
from .codec import snappy_encode, snappy_decode
log = logging.getLogger("kafka")
error_codes = {
-1: "UnknownError",
0: None,
1: "OffsetOutOfRange",
2: "InvalidMessage"... |
"""
QP-BASIL - Quantiphyse widgets for processing for ASL data
Copyright (c) 2013-2018 University of Oxford
"""
from __future__ import division, unicode_literals, absolute_import
from PySide2 import QtGui, QtCore, QtWidgets
from quantiphyse.gui.widgets import QpWidget, RoiCombo, OverlayCombo, Citation, TitleWidget... |
from copy import copy
import mdtraj as md
import subprocess
import os
from urllib.request import urlretrieve
from tempfile import TemporaryDirectory
import numpy as np
from itertools import tee, count
import mdtraj.core.element as elem
from re import sub
import contextlib
import pathlib
from pathlib import Path
aa_tlc... |
# -*- coding: utf-8 -*-
# Copyright (C) 2018 by
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# All rights reserved.
# BSD license.
#
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
from __future__ im... |
'''
Functions related to pull & push of Issues to/from the Jira API. Also includes conflict analysis and
resolution functions.
'''
import dataclasses
from dataclasses import dataclass, field
import datetime
import logging
import time
from typing import Any, Dict, List, Optional, Set
import click
import dictdiffer
from... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.