text stringlengths 6.04k 39.5k |
|---|
from __future__ import print_function
# import
## batteries
import os
import sys
import argparse
import functools
from itertools import product
## 3rd party
import numpy as np
import pandas as pd
## package
from pyTecanFluent import Utils
from pyTecanFluent import Fluent
from pyTecanFluent import Labware
# functions
d... |
from collections import defaultdict
import numpy as np
import rlf.rl.utils as rutils
import torch
from rlf.storage.base_storage import BaseStorage
from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler
def get_shape_for_ac(action_space):
if action_space.__class__.__name__ == "Discrete":
a... |
#!/usr/bin/env python3
import argparse
import logging
import os
# matplotlib.use("agg") # isort:skip
import matplotlib.pyplot as plt
import numpy as np
import toml
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.io import fits
from astropy.table import Table
from ics.cobraCharmer... |
from __future__ import annotations
import logging
import os
from typing import TYPE_CHECKING
from dataclasses import dataclass
from functools import cached_property
import numpy as np
from numba import jit, generated_jit
try:
from coloredlogs import ColoredFormatter as Formatter
except ImportError:
from logg... |
"""
Provides methods for comparing strings."""
import difflib
import logging
import operator
import re
from collections import OrderedDict
from itertools import islice
from Levenshtein import distance
from sqlalchemy import func
from api.models import DataStatement, DataIssue
from dbas.database import DBDiscussionSe... |
#########################################
# #
# <NAME> and <NAME> #
# University of Fribourg #
# 2019 #
# Master's thesis #
# #
#######################################... |
from itertools import chain
from django.shortcuts import get_object_or_404
from rest_framework.pagination import PageNumberPagination
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import F, Q
from django.contrib.postgres.search import SearchVector, SearchRank
import logging
from djang... |
import datetime
import math
import numpy as np
import torch
from torch import nn
from torch.nn import Module, Parameter
import torch.nn.functional as F
import pickle
import time
def data_masks(all_usr_pois, item_tail):
us_lens = [len(upois) for upois in all_usr_pois]
len_max = max(us_lens)
us_pois = [upoi... |
# pyOCD debugger
# Copyright (c) 2015-2020 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
#!/usr/bin/env python3
# coding: utf-8
import sys
import re
import logging
import json
import asyncio
from http import HTTPStatus
from copy import deepcopy
from os import path
from collections import namedtuple
from itertools import takewhile
from tornado.ioloop import IOLoop
from tornado.web import Application, Reque... |
import operator
from functools import reduce
from django.conf import settings
from django.db.models import F
from django.db.models.aggregates import Count
from django.db.models.query_utils import Q
from guardian.shortcuts import get_objects_for_user
from library.database_utils import get_queryset_column_names, \
... |
# Copyright 2020 The ElasticDL 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... |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-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 ... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import requests;
import json;
#import configparser
from configparser import ConfigParser,ExtendedInterpolation
import websocket
import hmac
import base64
import zlib
#log config
import logging
from datetime import datetime
import numpy as np
import talib
impo... |
# Copyright 2019 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... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
import copy
import math
import json
import collections
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from tqdm import tqdm
from qlib.utils import... |
# Copyright <NAME> <<EMAIL>>. 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... |
# original code: https://github.com/dyhan0920/PyramidNet-PyTorch/blob/master/train.py
import argparse
import os
import shutil
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
impor... |
# Copyright 2018 The Bazel 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 la... |
"""
Runs all SLK3 scripts
"""
# Imports
import logging
from collections import OrderedDict
import json
# Defining executing functions for each layer, where possible using auto download from the database website
def run_layer8(db, log, path):
if db == 'acsn':
pathway_file_loc = path + 'acsn_v1_pathway_fil... |
########################################################################
# Project Name: Decentralised Deep Learning without Forgetting
# Creators: <NAME> (<EMAIL>)
# <NAME> (<EMAIL>)
# <NAME> (<EMAIL>)
# <NAME> (<EMAIL>)
# Project Owners: <NAME> (<EMAIL>),
# <NAME> (<EMAIL... |
# Copyright 2016 <NAME>
# Apache 2.0.
"""This module contains structures to accumulate, store and use stats
for Term-frequency and Inverse-document-frequency values.
"""
from __future__ import print_function
from __future__ import division
import logging
import math
import re
import sys
sys.path.insert(0, 'subtoo... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
import numpy as np
from Utils import GaussianBlur, CircularGaussKernel
from LAF import abc2A,rectifyAffineTransformationUpIsUp, sc_y_x2LAFs,sc_y_x_and_A2LAFs
from Utils import generate_2dgrid, generate_2d... |
import pygame
import random
import sys
import time
pygame.init() # 初始化
version = '2.0'
# 变量池
line = 15
row = 10
BLO_WID = 30
# WIN_POI_WID, WIN_POI_HEI = 240, 150
WIN_WID, WIN_HEI = row * BLO_WID + 10, line * BLO_WID + 70
OPT_FONT = pygame.font.SysFont('microsoftyaheimicrosoftyaheiui', 16)
NUM_FONT = pygame.font.SysF... |
import json
import logging
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from gensim import matutils
from gensim.matutils import kullback_leibler, jensen_shannon
from gensim.models import CoherenceModel
from matplotlib.ticker import MaxNLocator
from gensim.models.ldamulticore import LdaMultico... |
#imports
import tkinter as tk
import tkinter as Tk
import tkinter
from tkinter import *
from tkinter.ttk import *
import webbrowser
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
matplotlib.use('TkAgg')
from matplotlib.backend... |
from tqdm import tqdm
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.utils as utils
from torch.utils.data import Dataset, DataLoader
import fitlog
# fitlog.debug()
from retrieval_based.data_provider.data_provider import Doc2dialV3
from config_file import *
class Met... |
from tkinter import *
from tkinter import messagebox
import urllib.request
import pyautogui as pg
import webbrowser as ww
import time as t
# variable declaration
number = ""
txt = ""
loop = 0
clr_fun_lock = 0
abc = 0
a_name = ['Canidae','Felidae', 'Cat', 'Cattle', 'Dog', 'Donkey', 'Goat',
'Guinea pi... |
from __future__ import with_statement
import time
import pygame
import numpy
import zlib
from . import googlemapindex
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
from .Resources.header import imgheader
from . import render_lib
from .loadbar import Bar
from .shared import cores
import collecti... |
import codecs
import tempfile
from django.test import SimpleTestCase
from StringIO import StringIO
from corehq.util.spreadsheets.excel import WorkbookJSONReader
from couchexport.export import export_raw
from couchexport.models import Format
from corehq.apps.app_manager.const import APP_V2
from corehq.apps.app_manager... |
# Copyright 2021 Toyota Research Institute. All rights reserved.
# Adapted from AdelaiDet:
# https://github.com/aim-uofa/AdelaiDet
import torch
from fvcore.nn import sigmoid_focal_loss
from torch import nn
from torch.nn import functional as F
from detectron2.layers import Conv2d, batched_nms, cat, get_norm
from det... |
# RA Duty Scheduler
# Copyright (c) 2021, <NAME>
#
# All rights reserved.
# library import statements
import calendar
import pandas as pd
import sys
import random
import os
# module import statements
from datetime import datetime
from RA import ResidentAdviser
from mplcal import MplCalendar
# set global variables
# ... |
from time import sleep
from typing import Any, ByteString, Callable, Generic, Tuple, TypeVar
import serial
import struct
import datetime
from threading import Thread
import commands
__VERSION_STRING_LENGTH_IN_BYTES__ = 14
__SERIAL_NUMBER_LENGTH_IN_BYTES__ = 7
__CONFIGURATION_DATA_LENGTH_IN_BYTES__ = 256
__ASCII__ = "A... |
from pymc3.core import *
from pymc3.step_methods.arraystep import ArrayStepShared
from pymc3.theanof import make_shared_replacements
from pymc3.distributions.transforms import stick_breaking, logodds
from ContinuousTimeMarkovModel.transforms import rate_matrix, rate_matrix_one_way
from scipy import linalg
import thean... |
import numpy as np
import six
import logging
import os
import networkx as nx
from lxml import etree
from sumolib import checkBinary
from sumolib.net import readNet
import traci
from trafficgraphnn.genconfig import ConfigGenerator
from trafficgraphnn.utils import (
parse_detector_output_xml, parse_tls_output_xml, ... |
#!/usr/bin/python3
"""Compile and run specified Java file on connected device.
Compiles a specified java program, pushes it to the device,
and runs it on the device.
Notes:
- first compilation will trigger the creation of a boot image,
so expect it to take a while
"""
import getopt
import os
import re
import s... |
import math
import os
import re
import sys
from string import punctuation
from porter import PorterStemmer
from random import seed, randrange
args = sys.argv
if len(args) != 4:
sys.exit('Usage: python3 tc_train.py stopword-list train-class-list model')
print('Command line arguments accepted.')
stopword_list_file... |
import os
import sys
import glob
import json
import requests
import time
import ipaddress
import socket
import shutil
import random
import hashlib
import base64
import re
import copy
from ast import literal_eval
from pathlib import Path
from itertools import chain
import inspect
import uuid
from bs4 import BeautifulSou... |
#!/usr/bin/env python
# This document is part of CrowdProjects
# https://github.com/skytruth/CrowdProjects
# =========================================================================== #
#
# Copyright (c) 2014, SkyTruth
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without... |
#it includes part of the code of the image_registration repository
"""Copyright (c) 2012 <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 limitati... |
# Install the smartsheet sdk with the command: pip install smartsheet-python-sdk
import smartsheet
import logging
import os
from datetime import datetime, timedelta
_dir = os.path.dirname(os.path.abspath(__file__))
# The API identifies columns by Id, but it's more convenient to refer to column names. Store a map here... |
import torch.nn as nn
from data_loader import get_loader
from model import EncoderCNN, DecoderRNN
from torch.nn.utils.rnn import pack_padded_sequence
from torchvision import transforms
from utils import *
from prepro.build_vocab import *
from prepro.pick_image import make_dir
from infer import infer_caption_by_master, ... |
# -*- mode: python; coding: utf-8; -*-
'''
Created on 20.05.2016
@author: <NAME>
'''
from itertools import permutations
from collections import defaultdict
from collections import deque
from scipy.spatial.distance import cosine
import spacy
from .utils import window
from .resources import connectives_en
from .res... |
"""A module containing the actual :class:`AssertionManager` class.
Index
-----
.. currentmodule:: assertionlib.manager
.. autosummary::
assertion
AssertionManager
AssertionManager.assert_
AssertionManager.__call__
AssertionManager.add_to_instance
Assertions based on the builtin :mod:`operator` mod... |
import json
import logging
from time import monotonic
from collections import OrderedDict
from typing import (Callable, Union, Dict, Tuple, List, Sequence, cast,
MutableMapping, MutableSequence, Optional)
from inspect import signature
from numbers import Number
import numpy as np
import qcodes as ... |
import drawSvg as draw
import colorsys
import numpy as np
import os
from PIL import ImageFont
try:
from core.gradient import Gradient
except ModuleNotFoundError:
from ..core.gradient import Gradient
def convertToPx(quantity, unit):
"""
INTERNAL: Convert values to pixels
:param quantity: ... |
import datetime
import math
import cdo
import cmor
import dateutil.relativedelta
# lpjg related
import gzip
import io
import csv
# lpjg end
import logging
import netCDF4
import numpy
import os
import re
# Log object
from ece2cmor3 import components
log = logging.getLogger(__name__)
# Enum utility class
class cmo... |
from md2py import md2py
from bs4 import BeautifulSoup
import mistune
import re
import pprint as pp
from varname import nameof
import argparse
import os
import shutil
import csv
import pdb
'''
TODO:
- Fix emdashes
- Actually use template variables
'''
#Variables
FULL_URL = "https://"
TITLE = "Shifting the impossible t... |
import inspect
import os
from time import sleep
import types
from typing import Union, List, Dict, Callable, Optional
import uuid
import boto3
from parallelagram.config import AWS_REGION
from parallelagram.utils import LOGGER, prep_s3_object, get_s3_response
from parallelagram.exceptions import (
EcsTaskConfigura... |
from grdb.database.v1_1_0.models import (
Sample,
PreparationStep,
Recipe,
Properties,
RamanSet,
RamanFile,
RamanSpectrum,
SemFile,
Author,
Software,
)
# from gresq.recipe import Recipe
from sqlalchemy import String, Integer, Float
from gresq.util.box_adaptor import BoxAdaptor
i... |
#!/usr/bin/env python
"""
Iterable ZIP archive generator.
Derived directly from zipfile.py
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import open
from builtins import chr
from future import stan... |
import time
import json
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn.cluster import KMeans
from sklearn import metrics
import seaborn as sns
import matplotlib.pyplot as plt
from itertools import cycle
import apr_constants
import common_functions
def plot_correlation_matr... |
"""Functions"""
import os
import sys
from sys import exit, stderr, argv, path, modules
from os.path import isfile, isdir, realpath, dirname, exists
import numpy as np
import pandas as pd
# plotting
import matplotlib
import seaborn.apionly as sns
from matplotlib import rc
import matplotlib.lines as mlines
import pylab a... |
#!/usr/bin/env python3
# Copyright 2020 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
from sklearn.datasets import load_files
from keras.utils import np_utils
import numpy as np
from glob import glob
from keras.layers import Conv2D, MaxPooling2D, GlobalAveragePooling2D
from keras.layers import Dropout, Flatten, Dense
from keras.models import Sequential
from keras.applications.resnet50 import pre... |
# thought for the paper and the high frequency/other variables validation we
# could limit ourselves (at least until we see what happens with this first
# exploration) to look at one stitched output for a model for which the
# emulation is very good, and one for a model for which the emulation shows
# big jumps. F... |
##Collect data:
#SMI: 2021/10/30
# SAF: 308072 Standard Beamline 12-ID proposal: 309075
# create proposal: proposal_id('2021_3', '30000_YZhang_Nov') #create the proposal id and folder
# Energy: 16.1 keV, 0.77009 A
# SAXS distance 1800
# SAXS in and WAXS in air
# WAXS range [ -4, 56 ]
# RE( sho... |
"""
Module Models
=============
Text here
"""
import copy
from collections import OrderedDict
from copy import deepcopy
import pandas as pd
import json
import numpy as np
from solve import solvesas as solve
dtype = np.float64
from mesas.sas.specs import SAS_Spec
from collections import OrderedDict
imp... |
from io import BytesIO
import itertools
import json
import os
import re
import tempfile
from config import DOWNLOAD_DIRECTORY
from PyPDF2 import PdfFileWriter, PdfFileReader
from PyPDF2.generic import Destination, NullObject
from PyPDF2.utils import PdfReadError
from ricecooker.config import LOGGER
from ricecooker.uti... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
A runeberg.org work represents a digitised book.
This most often corresponds to an edition in e.g. Wikidata terminology.
@TODO: load some key metadata as attributes, e.g. title and (co)author
(which requires a lookup of the key so parsing of a.lst)
"""
import os
from ... |
"""tictac.py
This module defines objects for use in experimenting with reinforcement learning
as well as hand-coded bots for playing tic-tac-toe.
If you want to change what kind of player your bot is
playing against, you need to change some lines
at the very end of the program -- talk to me if you're not
sure what to... |
import torch
from torch import nn
from ..builder import RECOGNIZERS
from .base import BaseRecognizer, BaseRecognizerZeroShot
from mmcv.runner import auto_fp16
import numpy as np
from ..localizers.utils import post_processing
from rich import print
from mmaction.localization import soft_nms
import torch.nn.functional ... |
"""
"""
import math
import numpy as np
import tensorflow as tf
from layer import GMM_Layer
from utils import log
from .regularizer.SingleExp import SingleExp
from .regularizer.Time_Decay import TimeDecayReg
from .regularizer.Regularizer i... |
""" Wasm runtime functions.
"""
import struct
import math
from ... import ir
from ...utils.bitfun import rotr, rotl, to_signed, to_unsigned
from ...utils.bitfun import clz, ctz, popcnt, sign_extend
from ..util import make_int
class Unreachable(RuntimeError):
"""WASM kernel panic. Having an exception for this al... |
import ast, copy, difflib, os, random
from .tools import log, powerSet, fastPowerSet
from .astTools import structureTree
from .paths import TEST_PATH
from .display import printFunction
#from .lexerSyntaxHint import getLexerSyntaxHint
from .SyntaxEdit import SyntaxEdit
from .models import SourceState, Hint
def smartSpl... |
import source.common.sqglobal as sqglobal
import sys
import numpy as np
from PyQt5 import QtCore, QtWidgets, QtGui
from datetime import datetime
import pyqtgraph as pg
from .ui_basic import CandlestickItem, VolumeItem
from ..common.datastruct import Event
from ..common.utility import extract_full_symbol
from ..data im... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
import sys
import errno
import logging
import logging.handlers
import simplejson
import datetime
import textwrap
import os
import colorama
import pygments
import pygments.formatters
import pygments.lexers
def make_dir_recursively(path):
"""
Create a directory in a location if it doesn't exist
:param pat... |
#!/usr/bin/env python3
# Copyright RTE - 2020
"""
Module de test du module scd_loader
"""
import os
import logging
import pytest
import hashlib
import cProfile
import pstats
import io
from pstats import SortKey
from lxml import etree
import scl_loader.scl_loader as scdl
from scl_loader import SCD_handler
from scl_loa... |
# -*- coding: utf-8 -*-
"""
jinja.datastructure
~~~~~~~~~~~~~~~~~~~
Module that holds several data types used in the template engine.
:copyright: 2007 by <NAME>.
:license: BSD, see LICENSE for more details.
"""
from jinja.exceptions import TemplateSyntaxError, TemplateRuntimeError
_missing = obje... |
# Copyright (c) 2020, <NAME>. All rights reserved.
"""
Parse raw text (with optional format codes '<b>', '</b>', '<i>', and
'</i>') into a list of FWord objects, which encode bold and ital for
each word.
NOTE: Format codes can only exist at word boundaries (and must be
outside of any punctuation).
ex: '<b>The qui... |
import traceback
import time
__author__ = 'robert'
from threading import Thread, Lock
import sc2lib.mongohelper as mongohelper
import os
import shutil
import logging
import sc2lib.utils as utils
from sc2lib.Config import Config
import sc2lib.sc2parser as sc2parser
import sys
import multiprocessing
import datetime
c... |
from rest_framework import status
from rest_framework.response import Response
from rest_framework.decorators import api_view, permission_classes
from django.db.models import Q
import datetime
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
# import time
from .serializer impo... |
"""Poisson Factorization with coordinate-ascent variational inference.
We use the model and updates from [1].
#### References
[1]: <NAME>, <NAME>, <NAME>. Scalable Recommendation with
Hierarchical Poisson Factorization. In _Conference on Uncertainty in
Artifical Intelligence_, 2015. https://arxiv.org/abs/1... |
import sys
import subprocess
import time
import re
class TrackValidation:
'''
Class for deciding whether a track summary from a run should be
considered valid based on the overheads and response times recorded
'''
def __init__(self, trackname):
self.track_name = trackname
self.inter... |
'''
Here we consider a controller trained for the mountain-car environment in
OpenAI Gym. The controller was taken from the website.
Originally this controller is trained to be non-deterministic sampled from a
gaussian distribution, but we make it deterministic by considering the most
likely control, the mean.
'''
im... |
"""
HyDE Processing Tool - NWP GFS to OBS
__date__ = '20210311'
__version__ = '1.1.0'
__author__ =
'<NAME> (<EMAIL>',
'<NAME> (<EMAIL>'
__library__ = 'hyde'
General command line:
python hyde_nwp_gfs_to_obs.py -settings_file configuration.json -time YYYY-MM-DD HH:MM
Version(s):
20210311 (1.1.0) --> Up... |
from django.test import TestCase
from django.test.client import RequestFactory
from django.http.response import Http404
from metaphor.views import *
from metaphor.random_metaphor import RandomMetaphor
from metaphor.is_a_metaphor import IsAMetaphor
from metaphor.w2v_subs import W2VSubs
from metaphor.metaphor import Meta... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2015, <NAME>
#
# This module is part of anima-tools and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
import shutil
import tempfile
import os
from stalker import (db, Version, Task, Project, Structure, StatusList,
... |
from __future__ import print_function, unicode_literals
import json
import os.path as path
import sys
from collections import Counter
from torchtext.vocab import GloVe
from tqdm import tqdm
from scorer.data_helper.json_reader import read_scores, read_article_refs
sys.path.append(path.dirname(path.dirname(path.dirna... |
# -*- coding: utf-8 -*-
#~Adapted from https://github.com/gschivley/co-fire, which is licensed:
#~
#~The MIT License (MIT)
#~
#~Copyright (c) 2015 <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
#~i... |
# -*- coding: utf-8 -*-
# Copyright 2018 <NAME>, <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... |
from charm.toolbox.pairinggroup import PairingGroup,ZR,G1,GT,pair,extract_key
from charm.core.math.pairing import pc_element
from Crypto.Cipher import AES
from binascii import b2a_hex, a2b_hex
from Crypto import Random
from charm.schemes.abenc.abenc_maabe_yj14 import MAABE as CP_ABE
import json
import sys
import getop... |
from base64 import b64decode
import contextlib
from datetime import datetime
import hashlib
import logging
import os
import re
from typing import Optional
from urllib.parse import urljoin, urlsplit
import uuid
import autopager
import formasaurus
import scrapy
from scrapy import Request, FormRequest
from scrapy.linkext... |
# import internals
import sys, os, itertools, operator, warnings
# import PIL as the image loader
import PIL.Image
file_extensions = {".asc": "ASCII",
".ascii": "ASCII",
".tif": "GeoTIFF",
".tiff": "GeoTIFF",
".geotiff": "GeoTIFF",
... |
import math
from math import sqrt
import plotly.plotly as py
import plotly.graph_objs as go
import numpy as np
from sklearn.externals import joblib
from sklearn.feature_selection import SelectKBest, chi2, SelectPercentile
from sklearn.metrics import precision_recall_fscore_support, mean_absolute_error, mean_squared_err... |
"""
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distri... |
import time
import cv2
import numpy as np
import math
# values for pink (VL, VH, HL, HH, SL, SH)
OPEN = [0, 255, 0, 180, 0, 255]
#target colors
Purple = [36, 189, 172, 179, 26, 251] # the distinctive purple color
Purple_Black = [19, 214, 161, 179, 160, 255] # for ~1ft black background dark
Purple_Black_Day = [19, 255... |
#!/usr/bin/env python3
# Import TensorFlow, Keras
from numpy.core.fromnumeric import argmax
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras.layers.experimental import preprocessing
# Import Panda, Numpy
import pandas as pd
import numpy as np
from rospy.rostime import Time
# Make nu... |
#!/usr/bin/env python
"""
TumbleSLE release script.
Based on test results as available on an openQA instance this script can check
and compare builds. The basic idea is to release a new version of a product,
e.g. a 'SLE development build' as the new version of TumbleSLE if it is as good
or better than the previous T... |
import discord
import matplotlib.pyplot as plt
import numpy as np
import asyncio
from discord.ext import commands
from discord.ext.commands import CommandNotFound
from discord.utils import get
from itertools import cycle
import time, os, random, sys, io
# import aiohttp
# Bagelbot mark1
### Jokes ###
Names = open(... |
import copy
from Superpixel.SuperpixelDataset import SuperpixelSCDataset
from Superpixel.EdgeFlow import PixelBasedEdgeFlow
from Superpixel.ImageProcessor import ImageProcessor, AdversarialImageProcessor
from torch.utils.data import DataLoader
from constants import DEVICE
from models import superpixel_GCN, superpixel_G... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
# Copyright (c) 2010-2013 openpyxl
#
# 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, distr... |
# -*- coding: utf-8 -*-
# Copyright 2018 ICON Foundation
#
# 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 ... |
# Licensed to Modin Development Team under one or more contributor license
# agreements. See the NOTICE file distributed with this work for additional
# information regarding copyright ownership. The Modin Development Team
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
import enum
from collections import namedtuple
AgentTypeInfo = namedtuple('AgentTypeInfo', ['agent_type', 'api_endpoint'])
class AgentType(enum.Enum):
"""
Enumeration for the agent_agent_type controlled value list. The values of
this enum use the AgentTypeInfo named tuple, wrapping the enumeration
v... |
from copy import deepcopy
from pathlib import Path
from typing import Union, Optional, Dict, List
from omegaconf.omegaconf import OmegaConf, DictConfig
import numpy as np
from collections import defaultdict
import pycolmap
from .. import features, bundle_adjustment as ba, logger, pyceres
from .._pixsfm import _localiz... |
from dataclasses import asdict, dataclass
from typing import Tuple, List, Callable, Optional, Any
from collections import defaultdict
import cv2
import numpy as np
import pandas as pd
import h5py
import dgl
import torch
from dgl.data.utils import load_graphs
from torch.utils.data import Dataset, DataLoader
from tqdm.au... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.