text stringlengths 3.07k 22.1k |
|---|
#
# Copyright (c) 2015-2018 Canonical, Ltd.
#
# This file is part of Talisker
# (see http://github.com/canonical-ols/talisker).
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regardin... |
import json #libreria para utulizar json en python
import os
import re
from unicodedata import normalize
import logging
import random
#format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
logging.basicConfig(filename='myapp.log',
filemode='a',
format='%(asctime)s, %(levelname)s %(message)s',
... |
import os
import threading
import time
# Imports for lora
import subprocess
import busio
from digitalio import DigitalInOut, Direction, Pull
import board
# Import thte SSD1306 module.
import adafruit_ssd1306
# Import Adafruit TinyLoRa
from adafruit_tinylora.adafruit_tinylora import TTN, TinyLoRa
# Imports for detecti... |
import torch
import torch.nn as nn
import torch.nn.functional as f
import torch.optim as optim
from torch.autograd import Variable
import torchvision.utils as vutils
import constants
from model import Generator, Discriminator, BeganGenerator, BeganDiscriminator
from lstm_model import LSTM
from vocab import get_glove
fr... |
import re
import itertools
import textwrap
import functools
try:
from importlib import resources # type: ignore
except ImportError: # pragma: nocover
import importlib_resources as resources # type: ignore
from jaraco.functools import compose, method_cache
def substitution(old, new):
"""
Return a ... |
#!/usr/bin/python
import struct
import zlib
class Ole10Native(object):
def __init__(self, buf):
offset = 0
self.rec_length = struct.unpack("<I", buf[offset:offset + 4])[0]
offset += 4
self.flags1 = struct.unpack("<H", buf[offset:offset + 2])[0]
offset += 2
label... |
import os
import logging
import yaml
import joblib
import numpy as np
from sklearn import metrics
from matplotlib import pyplot as plt
from mathtools import utils
logger = logging.getLogger(__name__)
def removeSmallSegments(labels, min_seg_len=10):
seg_labels, seg_lens = utils.computeSegments(labels)
seg... |
# Simplified BSD License
#
# Copyright (c) 2012, <NAME>
# <EMAIL>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this... |
"""Functions to load demo datasets."""
import io
import logging
import os
import urllib
from zipfile import ZipFile
import numpy as np
import pandas as pd
from faker import Faker
from sdv.metadata import Metadata
LOGGER = logging.getLogger(__name__)
DEMO_METADATA = {
'tables': {
'users': {
... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import gzip
import json
import math
import random
import shelve
import torch
import numpy as np
import subprocess as sp
from math import ceil
from torch.utils.data import DataLoader, Sampler, Dataset
from torch.nn.utils.rnn import pad_sequence
... |
# Copyright 2019 DeepMind Technologies Ltd. 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 appl... |
#!/usr/bin/env python
import argparse
import plantcv as pcv
def options():
parser = argparse.ArgumentParser(description="Imaging processing with opencv")
parser.add_argument("-i", "--image", help="Input image file.", required=True)
parser.add_argument("-o", "--outdir", help="Output directory for image fi... |
import kubesat.orekit as orekit_utils
from kubesat.base_simulation import BaseSimulation
from kubesat.services import ServiceTypes
from kubesat.validation import check_omni_in_range, MessageSchemas, check_internal, SharedStorageSchemas
simulation = BaseSimulation(ServiceTypes.Orbits, SharedStorageSchemas.ORBIT_SERVICE... |
"""
Created on Thu Mar 23 10:31:59 2017
@author: eccrod2
First Version: 03.23.2017
Second Version: 03.27.2017
Third Version: 03.31.2017
Fourth Version: 05.18.2017
Fifth Version: 01.19.2019
sixth Version: 04.06.2019
seventh Version: 11.7.2021
"""
import pandas as pd
import numpy as np
import datetime
from dateutil.re... |
import argparse
import time
import numpy as np
import cv2
import torch
from tensorboardX import SummaryWriter
import torch.nn.functional as F
from cvpack.torch_modeling.engine.engine import Engine
from cvpack.utils.pyt_utils import ensure_dir
from config import cfg
from model.smap import SMAP
from model.smap_gnn impor... |
# pylint: skip-file
# type: ignore
# -*- coding: utf-8 -*-
#
# tests.models.commondb.site_info.site_info_integration_test.py is part of The
# RAMSTK Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""Test class for testing Options mod... |
"""Module defining routines for reading/writing config files."""
import importlib
import sys
import yaml
from os import path
from pathlib import Path
from scipy import stats
from typing import Tuple
from . import utils
from .component import Component
from .likelihood import Likelihood, LikelihoodContainer, _Likelihoo... |
#!/usr/bin/env python3
# coding: utf-8
from __future__ import annotations
from collections import deque
from typing import List
import unittest
class TreeNode:
def __init__(self, val: int, left: TreeNode = None, right: TreeNode = None):
self.val = val
self.left = left
self.right = right
... |
#!/usr/bin/env python
# encoding=utf-8
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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... |
# -*- coding: utf-8 -*-
import glob
import json
import os
import pathlib
import shutil
import sys
import tarfile
import zipfile
from typing import Optional, Union
import yaml
from loguru import logger
#####################################################################
def load_function(package="mlmodels.util", n... |
""" wrapper definitions to the GraphDB API """
from urllib.parse import quote
from workflow.settings import *
from substances.models import *
from django.db import *
from workflow.log_functions import *
from sciflow.settings import *
import json
import requests
def addgraph(ftype, fid, locale='local', replace=""):
... |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "./app/"))
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.settings")
import json
from datetime import datetime
from datetime import timedelta
from airflow import DAG
from... |
from collections.abc import MutableMapping
from itertools import zip_longest
import numpy as np
import pandas as pd
from IPython.display import display, HTML
from matplotlib import pyplot as plt
from sklearn.metrics import ndcg_score
from sklearn.preprocessing import minmax_scale, QuantileTransformer
def scores_to_ra... |
#!/usr/bin/python
'''
list_category_cloth.txt
50
category_name category_type
7 Blazer 1
11 Jacket 1
20 Skirt 2
21 Sweatpants 2
29 Jumpsuit 3
list_category_img.txt
289222
image_name category_label
img/Sheer_Plea... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 30 15:41:07 2017
@author: abauville
"""
from InputDef import Frozen
import InputDef as Input
import MaterialsDef as Materials
import numpy as np
import json
import os
from collections import namedtuple
def readJson(Filename):
with open(Filen... |
'''
Transforms to jobs.
'''
'''
Spawn reductions can be made either by:
1) Reduced job count:
-Ensures the universe will not grow too have too many ships,
which can particularly happen over a long game as hostile groups get clustered
into sectors where they don't die (eg. random pirate spawns might end up s... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\crafting\crafting_ingredients.py
# Compiled at: 2017-11-17 21:23:53
# Size of source mod 2**32: 1848... |
# update time: 2020.11.02 17:33
import torch
import torch.nn as nn
import torch.nn.functional as F
from dgl import function as fn
from dgl.ops import edge_softmax
from dgl.utils import expand_as_pair
class GATConv(nn.Module):
def __init__(
self,
node_feats,
edge_feats,
out_feats,
... |
from operator import xor
import numpy as np
import scipy.special
from dataclasses import dataclass, field
from pb_bss_eval.distribution.complex_angular_central_gaussian import (
ComplexAngularCentralGaussian,
ComplexAngularCentralGaussianTrainer,
normalize_observation,
)
from pb_bss_eval.distribution.mixtu... |
"""
This module implements a wrapper around DeepWalk as a class. The class
contains a graph used as a basis for running the Deepwalk algorithm. It also
implements a method to run a given number of walks and save the walks as an
attribute of the instance.
"""
import time
import random
import logging
import functools
imp... |
import os
import fnmatch
import io
import re
# constants
rootOfGithub = 'https://github.com/admin-shell-io/submodel-templates/tree/main/'
topReadmeFn = '../README.md'
topReadmeHeader = 'Table of IDTA Submodel templates'
class Badge:
def __init__(self):
self.Name = ""
self.Link = ""
class Ta... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import cv2 ##加载OpenCV模块
def video2frames(pathIn='',
pathOut='',
only_output_video_info = False,
extract_time_points = None,
initial_extract_time = 0,
end_extract_time = None,... |
"""
Defines the instruction set of the processing element.
"""
import sys
# FATE IR
ISA = {
# Loop Instructions
'loop' : {'type':'loop', 'heuristic':1, 'num_operands':3},
'lend' : {'type':'loop', 'heuristic':1, 'num_operands':3},
'while' : {'type':'loop', 'heuris... |
class PacketTypes:
pico_noop = 0
ext_noop = 1
pico_ping = 2
ext_ping = 3
pico_pong = 4
ext_pong = 5
pico_ack = 6
ext_ack = 7
pico_reject = 8
ext_reject = 9
pico_start_msg = 10
ext_start_msg = 11
pico_end_msg = 12
ext_end_msg = 13
class PicoIPCStates:
noop = ... |
import numpy as np
# from hpp.corbaserver.rbprm.hrp2 import Robot as rob
# from hpp.corbaserver.rbprm.tools.obj_to_constraints import load_obj, as_inequalities, rotate_inequalities
# from hpp_centroidal_dynamics import *
# from hpp_spline import *e
from numpy import array, hstack, identity, matrix, ones, vstack, zeros
... |
"""
laby.py
From babel_script.py by Yourself (anti grief by izzy)
+ onectf.py by Yourself
+ intelrpg.py by Danke
Adapted to labyrinth map by ponce
- all players have two powers: +3 HP/sec and grenade-teleport
"""
from pyspades.constants import *
from random import randint
from twisted.internet import reac... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import hmac
import logging
import os
import shutil
from io import BytesIO
from embit import bip32, bip39, networks
from ..device import Device
from ..helpers import alias
from ..key import Key
from ..rpc import get_default_datadir
from ..specter_error import SpecterError
from ..util.base58 import decode_base58, encod... |
# Copyright (c) 2015, <NAME>
# For conditions of distribution and use, see the accompanying LICENSE and README files
# This file is part of the AUMA machine learning based auto tuning application
# developed at the Norwegian University of Science and technology
import os
from settings import Settings
from autotuner i... |
"""
Copyright (c) 2015, 2018 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from atomic_reactor.constants import YUM_REPOS_DIR
from atomic_reactor.inner import DockerBuildWorkflow
from atomic_reactor.plugin imp... |
import json
import sys
from os import listdir
import os.path
import getopt
# loads a single benchmark json at a time, and can access its data
class BenchmarkLoader:
def __init__(self, dir_name, filename_list):
self.dir_name = dir_name
self.filename_list = filename_list
self.data = []
... |
import os
import sys
import time
import random
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
def create_mask(width, height, mask_width, mask_height, x=None, y=None):
mask = np.zeros((height, width))
mask_x = x if x is not None else random.randint(0, width - mask_width)
mask_y ... |
from __future__ import with_statement
import os
import cjson
import datetime
import logging
#from sana.mrs.util import enable_logging
from collections import defaultdict
from django.conf import settings
from django.db.models import ObjectDoesNotExist
from sana.mrs.emr import *
from sana.mrs import models
#from sana... |
import hashlib
import json
import re
import shutil
import tempfile
from datetime import datetime
from pathlib import Path
from typing import Callable, Union
import click
from .common import GrablibError, main_logger, progress_logger
STARTS_DOWNLOAD = re.compile('^(?:DOWNLOAD|DL)/')
STARTS_NODE_M = re.compile('^(?:NO... |
#!/usr/bin/env python
import sys
import logging
import os
import traceback
from aiohttp import web
from opentrons import robot, __version__
from opentrons.api import MainRouter
from opentrons.server.rpc import Server
from opentrons.server import endpoints as endp
from opentrons.server.endpoints import (wifi, control, ... |
from typing import List, Tuple, Optional
import os
import subprocess
import tempfile
import logging
from pathlib import Path
from lxml import etree
from depccg.instance_models import MODEL_DIRECTORY
from depccg.morpha import MorphaStemmer
from depccg.types import Token
logger = logging.getLogger(__name__)
candc_cmd... |
# -*- coding: utf-8 -*-
# <NAME> (<EMAIL>)
# April 2017
import os, sys
BASE_DIR = os.path.normpath(
os.path.join(os.path.dirname(os.path.abspath(__file__))))
from dataset import Dataset
import math
import numpy as np
from scipy import spatial, stats
import tensorflow as tf
import tf_util
def generate_embedd... |
import contextlib
import json
import os
import feedparser
import floppyforms.__future__ as forms
import opml
import requests
import six
from django.core.cache import cache
from django.core.validators import URLValidator, validate_ipv46_address
from django.db import transaction
from django.forms.formsets import formse... |
# encoding: utf-8
from __future__ import annotations
import codecs
import os
import smtplib
import socket
import logging
import mimetypes
from time import time
from typing import Any, Iterable, Optional, Tuple, Union, IO, cast
from email.message import EmailMessage
from email import utils
from ckan.common import _, ... |
# Made by <NAME>
# CRT-screen-test v0.4 2020-03-
# This app is primarily for calibrating CRT computer monitors
# TODO make spacing with commas neater
# TODO add folders with done images at various rezolutions
# TODO merge all color line types with dots (in middle of square)
import sys
import pygame
import c... |
import asyncio
import urllib.parse as urlparse
import discord
import aiohttp
import lxml.html
import lxml.etree
from discord.ext import commands
import avaconfig as cfg
from .common import Cog
class AvaRSS(Cog):
"""Updates users when new Ava's Demon pages are released"""
def __init__(self, bot):
super().__... |
import os
import logging
import time
from dataclasses import dataclass
from typing import List, Tuple, Optional, TypeVar, Type
from medcat.cdb import CDB
from medcat.utils.decorators import check_positive
T = TypeVar("T", bound="Checkpoint")
class Checkpoint(object):
r""" The base class of checkpoint objects
... |
""" UncertaintyQuantification of Icestupa class
"""
import uncertainpy as un
import chaospy as cp
import pandas as pd
import math
import sys
import os
import logging
import coloredlogs
# from sklearn.metrics import mean_squared_error
sys.path.append(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath... |
# coding=utf-8
# Copyright 2022 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... |
# coding: utf-8
# Copyright (c) Qotto, 2018
"""
TP-DU fields according to GSM 03.40.
Unlike elements, fields represent independent datagram chunks, and are decoded from a file-like object.
Fields may contain one or multiple elements.
"""
from .codecs import GSM
from .codecs import UCS2
from .elements import Date
fr... |
# encoding: utf-8
import pytest
import six
from bs4 import BeautifulSoup
import ckan.model as model
import ckan.tests.factories as factories
import ckan.tests.helpers as helpers
from ckan.common import config
from ckan.lib.helpers import url_for
from ckan.model.system_info import get_system_info
@pytest.fixture
def... |
import os
import shlex
import shutil
import socket
import getpass
from subprocess import Popen, PIPE
from threading import Timer
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization
from OpenSSL imp... |
from requests import post
from requests.structures import CaseInsensitiveDict
from bs4 import BeautifulSoup
from unicodedata import normalize
class Utils () :
r"""Class containing auxiliary library functions
"""
API_URL = 'https://www.4devs.com.br'
HEAD = CaseInsensitiveDict()
HEAD["Content-Type"]... |
import time
import gobject
import gtk
import pango
from bot_procman.printf_t import printf_t
DEFAULT_MAX_KB_PER_SECOND = 500
ANSI_CODES_TO_TEXT_TAG_PROPERTIES = { \
"1" : ("weight", pango.WEIGHT_BOLD),
"2" : ("weight", pango.WEIGHT_LIGHT),
"4" : ("underline", pango.UNDERLINE_SINGLE),
... |
from flask import Flask, render_template, g, redirect, url_for, request, flash, render_template_string
from dotenv import load_dotenv
import os
from flask_oidc import OpenIDConnect
import requests
from okta.client import Client
from okta import api_client
from okta import models
import asyncio
from wtforms import Form,... |
import attr
from pathlib import Path
import subprocess
from pylexibank import Concept, Language, Cognate, Lexeme
from pylexibank.dataset import Dataset as BaseDataset
from pylexibank.util import progressbar
from csvw import Datatype
from pyclts import CLTS
try:
from pytular.util import fetch_sheet
except ImportErr... |
from io import BytesIO
import logging
import mimetypes
from .fields import BooleanField, TextField, IntegerField, URIField, DateTimeField, EWSElementField, Base64Field, \
ItemField, IdField
from .properties import RootItemId, EWSElement
from .services import GetAttachment, CreateAttachment, DeleteAttachment
log =... |
import os
from pxr import Usd, UsdGeom, UsdSkel, Sdf
SKELDATA_SOURCE_NAME = r'skel_source.usda'
SKELDATA_NAME = r'skel_data.usda'
class RigPrimSourceExporter(object):
def __init__(self, out_dir, shape_merge=False):
self.out_dir = out_dir
self.shape_merge = shape_merge
self.source_path =... |
#
# * The source code in this file is developed independently by NEC Corporation.
#
# # NLCPy License #
#
# Copyright (c) 2020-2021 NEC Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following cond... |
import os
import pysam
import re
from arcsv.constants import SPLIT_FIRST_PLUS, SPLIT_SECOND_PLUS, \
SPLIT_OVERLAP, SPLIT_TYPES, SPLIT_LEFT_FIRST
from arcsv.helper import get_ucsc_name
def valid_split(aln, bam, min_mapq, max_splits=1):
if (not aln.has_tag('SA')) or aln.mapq < min_mapq:
return False
... |
from typing import Iterable, Tuple, List, Dict, Pattern
import re
import stanza
from stanza.models.common.doc import Document, Sentence
# If Stanza version 1.1
if stanza.__version__ == "1.1.1":
from stanza.models.tokenize.data import NEWLINE_WHITESPACE_RE
else:
from stanza.models.tokenization.data import NEWL... |
import datetime
import ipaddress
import logging
from dataclasses import asdict, dataclass, field
from functools import partial
from typing import Dict, List, Set
from urllib.parse import urljoin
import httpx
import trio
from dateutil.parser import parse as parse_date
from fastly_bouncer.utils import with_suffix
logg... |
"""
A example demonstrating ionization of background H2 gas by an electron beam
"""
from __future__ import division
import numpy as np
import shutil
import time
from shutil import os
import warpoptions
warpoptions.ignoreUnknownArgs = True
import argparse
from warp import *
from warp.data_dumping.openpmd_diag.part... |
import aiohttp
import re
import sqlite3
import textwrap
from urllib.parse import urlparse, parse_qsl
from discord.ext import commands
import chickensmoothie as cs
sqlite_database = "cs_archive.sqlite3"
sqlite_database_items = "cs_item_archive.sqlite3"
months = {
"January",
"February",
"March",
"April... |
# ----------------------------------------------------------------------
# |
# | UpdateRepositoryIgnoreFile.py
# |
# | <NAME> <<EMAIL>>
# | 2017-05-14 08:09:15
# |
# ----------------------------------------------------------------------
# |
# | Copyright <NAME> 2017-18.
# | Distributed under ... |
# This file can only be run in the allennlp environment.
# run: conda activate allennlp
from allennlp.predictors.predictor import Predictor
import allennlp_models.tagging
import spacy
import numpy as np
import _pickle as cPickle
import torch
import torch.nn.functional as F
import re
import argparse
from pytorch_transf... |
import os
import asyncio
import aioredis
import uvloop
import socket
import uuid
import contextvars
from fastapi import FastAPI, Depends, Request, WebSocket, WebSocketDisconnect
from fastapi.staticfiles import StaticFiles
from starlette.templating import Jinja2Templates
from websockets.exceptions import ConnectionClos... |
# JN 2015-04-22
# refactoring
"""
manages spikes and sorting, after concatenation
"""
from __future__ import print_function, division, absolute_import
import numpy as np
import tables
import os
from .. import SIGNS, TYPE_NAMES, TYPE_ART, GROUP_NOCLASS, GROUP_ART, NcsFile,\
TYPE_NON_NOISE, TYPE_ALL
class Sorting... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
import os
import dotenv
import logging
import time
import textwrap
import argparse
import stat
import glob
import pathlib
import datetime
import shutil
import subprocess
from irods.session import iRODSSession
from irods.meta import iRODSMeta
RESOURCE_ID_GLOB = "????????????????????????????????"
EXCLUDED = ["bags", "te... |
from collections import defaultdict
import json
import mmap
import operator
import os
import socket
from struct import Struct
MMDB_META_DATA_START = '\xAB\xCD\xEFMaxMind.com'
MMDB_META_DATA_BLOCK_MAX_SIZE = 131072
MMDB_DATA_SECTION_SEPARATOR = 16
unpack_int = Struct('>I').unpack
unpack_long = Struct('>Q').unpack
unpa... |
#!/usr/bin/env python3
"""Pattoo classes that manage various data."""
# Standard imports
import os
import time
# Import project libraries
from pattoo_shared import log, files, converter
from pattoo.configuration import ConfigIngester as Config
from pattoo.constants import PATTOO_API_AGENT_NAME, PATTOO_INGESTER_NAME
... |
# // _ooOoo_
# // o8888888o
# // 88" . "88
# // (| -_- |)
# // O\ = /O
# // ____/`---'\____
# // .' \\| |// `.
# // / \\||| : |||// \
# // / _||||| -:- |||||- \
# // ... |
import math
import numpy as np
import torch
import torchvision
import wandb
from torch.nn import functional as F
from torch import LongTensor
from lambo import transforms as gfp_transforms, dataset as gfp_dataset
from lambo.models.shared_elements import check_early_stopping
from lambo.utils import str_to_tokens
de... |
import unittest
import re
import pickle
import copy
import six
from yamlize import Object
from yamlize import YamlizingError
from yamlize import Attribute
from yamlize import Map
from yamlize import Typed
from yamlize import Dynamic
from yamlize import KeyedList
from yamlize.attribute_collection import MapAttributeCo... |
"""
" Manages all the license text for possible licenses the user might choose.
"""
# These are helpful for tests
MIT_TEXT = 'The MIT License (MIT)'
GNU_TEXT = 'GNU GENERAL PUBLIC LICENSE'
WTFPL_TEXT = 'DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE'
APACHE_TEXT = 'Apache License'
BSD_TEXT = 'The BSD 3-Clause License'... |
import json
import os
import tempfile
import zipfile
from datetime import timedelta
from django.conf import settings
from django.core.files.storage import default_storage
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils import timezone
from django.utils.translation ... |
#!/usr/bin/env python
# coding: utf-8
import torch
import torchvision
import torchvision.transforms as transforms
import torch.nn as nn
import torch.nn.functional as F
import torchnet.meter as tnt
import torch.onnx
import torch.optim as optim
from torchvision import datasets
import distiller
from distiller.quantizatio... |
import numpy as np
import pandas as pd
from collections import defaultdict
import matplotlib.pyplot as plt
### Initializing the shared variables ###
Q1_res = defaultdict(int)
Q2_res = defaultdict(int)
Q3_res = defaultdict(int)
TOTAL_FRAMES = 1495
# Method to plot the bar graph for the F1 score and Throug... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the TPM 2.0 code generator."""
from __future__ import print_function
import io
import u... |
import tensorflow as tf
from tensorflow.python.keras.engine.base_layer import Layer
from math import sqrt
from utils.masking import TriangularCausalMask, ProbMask
import math
import numpy as np
class FullAttention(Layer):
def __init__(self, mask_flag=True, factor=5, scale=None, attention_dropout=0.1):
sup... |
# -*- coding: utf-8 -*-
"""Page Admin module."""
from pages import settings
from pages.models import Page, Content, PageAlias
from pages.http import get_language_from_request, get_template_from_request
from pages.utils import get_placeholders
from pages.utils import get_language_from_request
from pages.templatetags.pag... |
import os
from os import listdir
from os.path import isfile, join
import time
import sys
import utility
import parser
import server
import SimpleHTTPServer
import SocketServer
import socket
import webbrowser
import thread
class Const:
data_directory = "data"
throughput = "[Throughput] "
latency = "[Latency... |
import time
from fixate.core.exceptions import ParameterError, InstrumentError
def _range_gen(value=None):
if value is None:
while True:
yield True
else:
for _ in range(value + 1):
yield True
def converge_scalar_tolerance(
dmm,
funcgen,
set_point,
tole... |
'''
@lanhuage: python
@Descripttion:
@version: beta
@Author: xiaoshuyui
@Date: 2020-05-11 16:20:32
@LastEditors: xiaoshuyui
@LastEditTime: 2020-05-15 10:14:28
'''
from PyQt5.QtWidgets import QApplication,QWidget, \
QPushButton,QTextEdit,QLabel,QDialog,QComboBox ,\
QLineEdit,QMessageBox,QInputDialog
import sys... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
import numpy as np
FLIP_MAPPER = {
0: 13,
1: 14,
2: 15,
3: 16,
4: 17,
5: 18,
6: 19,
7: 20,
8: 21,
9: 22,
10: 10,
11: 11,
12: 12,
13: 0,
14... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2018, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
# -*- coding: utf-8 -*-
'''
raeting module provides constants and values for the RAET protocol
Production Ports for Raet
Master 4505
Minion(s) 4510
Packet Data Format.
The data used to initialize a packet is an ordered dict with several fields
most of the fields are shared with the header data format below so only th... |
from collections import OrderedDict
import numpy as np
def area_of_polygon(x, y):
"""Calculates the signed area of an arbitrary polygon given its vertices
http://stackoverflow.com/a/4682656/190597 (<NAME>)
http://softsurfer.com/Archive/algorithm_0101/algorithm_0101.htm#2D%20Polygons
"""
area = 0.0... |
import logging
import os
import sys
import h5py
import argparse
import numpy as np
import torch
from torchvision import datasets, transforms
from torch.utils.data import DataLoader, sampler
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.tensorboard.writer import SummaryWriter
import inde... |
import json
import operator
from copy import copy
from django import template
from django.contrib.auth.models import AnonymousUser
from django.template import TemplateSyntaxError
from django.utils.html import escape
import fiber
from fiber.models import Page, ContentItem
from fiber.utils.urls import get_admin_change_... |
'''
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, modify, merge, publish, distri... |
from __future__ import division, print_function, absolute_import
import json
import io
import warnings
import re
import hashlib
import time
try:
import cPickle as pickle # python 2
except:
import pickle
import numpy as np
import xarray as xr
import podpac
from podpac.core.settings import settings
from podp... |
"""
Generalized Linear models.
"""
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD Style.
from abc import ABCMeta, abstractmethod
import numpy as np
import sci... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.