text
stringlengths
1
927k
"""Sphinx configuration file""" # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup ---------------------------------------...
# Copyright 2015 PerfKitBenchmarker 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 appli...
import os import unittest from config.constants import FILE_TYPE_FILE, FILE_TYPE_DIR from model import model_helper from model.model_helper import read_list, read_dict, fill_parameter_values, resolve_env_vars, \ InvalidFileException, read_bool_from_config, InvalidValueException, InvalidValueTypeException, read_str...
# # File: # shapefile1.py # # Synopsis: # Illustrates reading data from a shapefile and coloring U.S. states # by "Percent unemployment". # # Categories: # Maps only # Polygons # # Author: # Mary Haley (based on an NCL script of Rick Brownrigg, CISL/NCAR) # # Date of initial publication: # A...
from .approx_max_iou_assigner import ApproxMaxIoUAssigner from .assign_result import AssignResult from .atss_assigner import ATSSAssigner from .base_assigner import BaseAssigner from .center_region_assigner import CenterRegionAssigner from .grid_assigner import GridAssigner from .max_iou_assigner import MaxIoUAssigner ...
import os import unittest from flask import current_app from flask_testing import TestCase from core import masakhane class TestDevelopmentConfig(TestCase): def create_app(self): masakhane.config.from_object('core.config.DevelopmentConfig') return masakhane def test_app_is_development(self)...
"""Tests some of the helper methods in algorithms.spacy_utils""" import pytest import tests.unit.utils.spacy_utils as utils from analysis.algorithms.spacy_utils import extract_compound_dependencies from analysis.algorithms.spacy_utils import extract_dependencies SHORT_SENTENCE = "Computer hardware is important" SENTE...
# ------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ------------------------------------------------------------------------- from uamqp i...
import random from typing import Dict import torch from torch import Tensor, nn from torch.nn import functional as F class RNNDecoder(nn.Module): @property def max_gen_length(self) -> int: return self.hparams["dec_max_gen_length"] @property def EOS_idx(self) -> int: return self.hpara...
# -*- coding: utf8 -*- from __future__ import absolute_import from __future__ import division, print_function, unicode_literals from collections import namedtuple from operator import attrgetter from ..utils import ItemsCount from .._compat import to_unicode from ..nlp.stemmers import null_stemmer from nltk import w...
import repo from collectors import basic def extract_content(url, soup): return soup.title.string # extract page's title def store_content(url, content): # store in a hash with the URL as the key and the title as the content repo.set_content(url, content) def allow_url_filter(url): return True #...
#!/usr/bin/env python3 # Copyright (c) 2016-2019 The Qtum Core developers # Copyright (c) 2020 The Metrix Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramewo...
# coding=utf-8 # Copyright 2020 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 FWCore.ParameterSet.Config as cms from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import * VtxSmeared = cms.EDProducer("BetafuncEvtVtxGenerator", Run3RoundOptics25ns13TeVLowSigmaZVtxSmearingParameters, VtxSmearedCommon )
## ## For importing data from the database ## # Python SQL toolkit and Object Relational Mapper import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func, desc ######## Set up DB ######## engine = create_engine("sqlite:///static/ag...
import sys sys.path.append('../../../tests') import yaml from functools import partial import time import random import string import ensure from textwrap import dedent from ensure import release from ensure import cluster from ensure import machinedeployment from ensure import kubeadmconfig from ensure import kubead...
""" Simple dataset loaders. For more datasets and more comprehensive loaders, you may turn to dedicated libraries like `fuel`. """ import gzip import hashlib import os import pickle from typing import * import idx2numpy import numpy as np from ..typing_ import * from ..utils import CacheDir, validate_enum_arg __al...
# coding: utf-8 """ ThingsBoard REST API ThingsBoard open-source IoT platform REST API documentation. # noqa: E501 OpenAPI spec version: 3.3.3-SNAPSHOT Contact: info@thingsboard.io Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 impor...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # ------------------------------------------------------------------------- from azure....
from unittest import TestCase from mock import MagicMock import torchbearer from torchbearer.callbacks import EarlyStopping class TestEarlyStopping(TestCase): def test_step_on_batch(self): stopper = EarlyStopping(monitor='test_metric', mode='min', step_on_batch=True) stopper.step = MagicMock() ...
from .axesimtasks import *
# Copyright (C) 2017 shimoda kuri65536@hotmail.com # Copyright (C) 2009 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 r...
from django.db import models from django.contrib.auth.models import User from talk.models import Challenger class Article(models.Model): author = models.ForeignKey(User) title = models.CharField(max_length=128) content = models.TextField(blank=True) date_post = models.DateTimeField(auto_now_add=True) ...
# Space: O(1) # Time: O(n) # Iterative approach # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def mergeTwoLists(self, l1, l2): res = ListNode(0) cur_res = res cur1, cur2 = l1,l2 ...
from cwl_utils import parser_v1_0 from re import sub from cwlab.xls2cwl_job.read_xls import clean_string configs = {} cwl_document = parser_v1_0.load_document("test_files/workflows/wf_fastqc.cwl") if isinstance(cwl_document, list): cwl_documents = cwl_document for cwl_document_ in cwl_documents: if cl...
import cv2 as cv import numpy as np import argparse W = 52 # window size is WxW C_Thr = 0.43 # threshold for coherency LowThr = 35 # threshold1 for orientation, it ranges from 0 to 180 HighThr = 57 # threshold2 for orientation, it ranges from 0 to 180 ## [calcGST] ## [calcJ_header] ## [calcGST_prot...
def get_sidereal_time(time: float, date: (int, int, int), longitude: float) -> float: year, month, day = date # Calculate the Julian Day A = int(year/100) B = 2 - A + int(A/4) jd = int(365.25*(year + 4716)) + int(30.6001*(month + 1)) + day + B - 1524.5 # Calculate Greenwich Sidereal Time T = (jd + time/...
# setup.py from setuptools import find_packages, setup setup( name="rl_toolkit", version="0.0.0", packages=find_packages(exclude=["docs", "scripts", "tests"]), install_requires=[ "gym", "gym_fishing", "gym_conservation", "numpy", "pandas", "matplotlib", ...
import json import logging import subprocess from nodemgr.common import utils from nodemgr.common.sandesh.nodeinfo.cpuinfo.ttypes import ProcessCpuInfo class PodmanContainerMemoryCpuUsage: def __init__(self, query_, pid_): self._query = query_ self._cgroup = '/sys/fs/cgroup/memory{0}/memory.stat'....
from handler.handler import Handler from handler.char_handler import CharHandler from handler.dot_handler import DotHandler from handler.star_handler import StarHandler from handler.abstract_handler import AbstractHandler from match import Match def make_pattern(): head = CharHandler() c = CharHandler() d ...
# Generated by Django 3.1.6 on 2021-02-11 03:58 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='News', fields=[ ('id', models.AutoField(aut...
#!/usr/bin/python3 # Copyright 2020 Timothy Trippel # # 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 o...
import igibson from igibson.envs.igibson_env import iGibsonEnv from time import time import os from igibson.utils.assets_utils import download_assets, download_demo_data from igibson.utils.motion_planning_wrapper import MotionPlanningWrapper import numpy as np import matplotlib.pyplot as plt def test_occupancy_grid():...
# 在python中复制操作重新赋一个标识符,所以可以直接赋值 class Solution(): def removeElement(self, nums: list, val: int) -> int: lst=[] for i in range(len(nums)): if nums[i]!=val: lst.append(nums[i]) nums[:]=lst return len(lst) #python计数与删除操作 class Solution2: def removeE...
import os import subprocess import pytest ################################## @pytest.mark.eda @pytest.mark.quick def test_icebreaker(scroot): '''Basic FPGA test: build the Blinky example by running `sc` as a command-line app. ''' # Use subprocess to test running the `sc` scripts as a command-line program....
from yandex_checkout.domain.models.payment_data.payment_data import PaymentData from yandex_checkout.domain.common.payment_method_type import PaymentMethodType class PaymentDataApplepay(PaymentData): __payment_data = None def __init__(self, *args, **kwargs): super(PaymentDataApplepay, self).__init__(...
import sys import os import numpy as np import random from collections import OrderedDict import pickle import datetime from tqdm import tqdm from recordclass import recordclass import math import torch import torch.autograd as autograd import torch.nn as nn import torch.nn.functional as F import torch.optim as optim ...
#!/usr/bin/env python3 from snipsTools import SnipsConfigParser from hermes_python.hermes import Hermes # imported to get type check and IDE completion from hermes_python.ontology.dialogue.intent import IntentMessage CONFIG_INI = "config.ini" # If this skill is supposed to run on the satellite, # please get this mq...
"""Functions to deal with hases.""" import hashlib def read_in_chunks(file_object, chunk_size=1024): """ Lazy function (generator) to read a file piece by piece. Default chunk size: 1k. borrowed from http://stackoverflow.com/a/519653 Parameters ---------- file_object : file object ...
from autodp.mechanism_zoo import GaussianMechanism from autodp.dp_bank import get_eps_ana_gaussian import numpy as np from absl.testing import absltest from absl.testing import parameterized params = [0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0] def _fdp_conversion(sigma): delta_list = [0,1e-8, 1e-6, 1e-4, 1e-2,...
from django.urls import include, path urlpatterns = [ path( "websocket-notifications/", include("websocket_notifications.urls", namespace="websocket_notifications"), ), path("api/v1/", include("tests.router", namespace="api_v1")), ]
import pyaf.Bench.TS_datasets as tsds import pyaf.tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "constant", cycle_length = 30, transform = "inv", sigma = 0.0, exog_count = 20, ar_order = 0);
from django import forms from django.forms import ModelForm from .models import * class TodoForm(forms.ModelForm): class Meta: model=Todo fields='__all__'
# Copyright (c) 2015 Deutsche Telekom AG # 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 r...
import hmac, hashlib from datetime import datetime from django.conf import settings def static(request): ''' Add static URL to the context, including the revision number (if known) when not in DEBUG mode. ''' if settings.DEBUG and settings.REVISION: static_url = u'%sv%s/' % (settings.STATIC_URL, settin...
from django.contrib import admin from .models import Beach, SelectedBeach admin.site.register(Beach) admin.site.register(SelectedBeach)
import random import os import sys import time sys.path.append("../swig") import snap as Snap numnodes = 100 valrange = numnodes / 10 Edges = Snap.TIntV() for i in range(0,numnodes): Edges.Add(int(random.random() * valrange)) d = {} for i in range(0,numnodes,2): print "Edges", i/2, Edges.GetVal(i).Val, Edg...
# Copyright 2015 Metaswitch Networks # # 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 w...
#!/usr/bin/env python """Tests for the linalg.isolve.gcrotmk module """ from numpy.testing import (assert_, assert_allclose, assert_equal, suppress_warnings) import numpy as np from numpy import zeros, array, allclose from scipy.linalg import norm from scipy.sparse import csr_matrix, eye, r...
"""Add downloads and followers to Mod Revision ID: 1ef399cbd2b Revises: 29cdccab86f Create Date: 2014-06-11 17:10:26.480478 """ # revision identifiers, used by Alembic. revision = '1ef399cbd2b' down_revision = '29cdccab86f' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto genera...
/home/runner/.cache/pip/pool/2c/59/97/f8e5f25cbfc169c1e81504fc2144624a0b7d4d17526ee7745023ffd740
from .core import * from . import Dates
from flask import Flask, render_template_string, request, session, redirect, url_for """ The workflow os this client-side session server should be 1. When new user comes, assign it a random str as identifier. For any further request from the user, the identifier is needed 2. The user can queue either ytb items, or ytb...
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import torch import torch.distributions as torchdist from torch.distributions import constraints import pyro import pyro.distributions as dist from pyro.contrib.gp.models.model import GPModel from pyro.contrib.gp.util import condi...
import gc #PC only import json, socket, re, time import random, os os.system('start /wait cmd /c pip install psutil') import psutil gc.enable() gc.collect() class WebServer: def __init__(self, system): self._call = system self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self...
""" """ from collections import OrderedDict import numpy as np from halotools.utils import sliding_conditional_percentile from astropy.table import Table from ..utils.galprops import compute_lg_ssfr SANDY_SCRATCH_PATH = "/global/cscratch1/sd/sihany/TNG300-1/output" BEBOP = "/lcrc/project/halotools/C3EMC/TNG300-1" NER...
"""Module for implementation the RoundedRect class. """ import pygame # Brightness lowering for border color # Must be in range (0..1) - not inclusively BRIGHTNESS_LOW = 0.5 BORDER_WIDTH = 4 # Inner border width in pixels class RoundedRect(): """The RoundedRect class simplifies drawing filled rectangles with roun...
#!/usr/bin/python import os import sys import glob from mininet.topo import Topo from mininet.net import Mininet from mininet.link import TCLink from mininet.cli import CLI script_deps = [ 'ethtool' ] def check_scripts(): dir = os.path.abspath(os.path.dirname(sys.argv[0])) for fname in glob.glob(dir + ...
load(":repositories.bzl", "closure_repos") # NOTE: THE RULES IN THIS FILE ARE KEPT FOR BACKWARDS COMPATIBILITY ONLY. # Please use the rules in repositories.bzl def closure_proto_compile(**kwargs): print("Import of rules in deps.bzl is deprecated, please use repositories.bzl") closure_repos(**kwargs) de...
# coding: utf-8 """ FlashArray REST API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 2.9 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re import six import typing from ....
# 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 # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
import logging import requests import os import pickle import sys from urllib.parse import urljoin API_HEADERS = { 'User-Agent': 'markdown-to-confluence', } MULTIPART_HEADERS = { 'X-Atlassian-Token': 'nocheck' # Only need this for form uploads } DEFAULT_LABEL_PREFIX = 'global' log = logging.getLogger(__na...
from flask import Flask, render_template, request, g, Response, redirect, url_for from flask_login import LoginManager, current_user from flask_wtf.csrf import CSRFProtect from jinja2 import FileSystemLoader, ChoiceLoader import random import sys import os import locale from srht.config import _cfg, _cfgi from srht.d...
# -*- coding: utf-8 -*- """ Created on Mon Dec 10 15:49:15 2018 @author: fei.wu """ # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import tiny_face_model import util import cv2 import numpy as np import matp...
""" WSGI config for synergyspace project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "synergyspace.settings") from dja...
from ert_gui.tools.manage_cases.case_init_configuration import CaseInitializationConfigurationPanel from ert_gui.tools import Tool from ert_gui.widgets import util from ert_gui.widgets.closable_dialog import ClosableDialog class ManageCasesTool(Tool): def __init__(self): super(ManageCasesTool, self).__ini...
""" used for debugging """ from har2case.cli import main main()
from collimator_zigzagBlade_old import Collimator_geom, Parameter_error import os, sys from instrument.geometry.pml import weave from instrument.geometry import operations,shapes from instrument.geometry.pml.Renderer import Renderer as base parent_dir = os.path.abspath(os.pardir) libpath = os.path.join(parent_dir, 'c3...
# Copyright The PyTorch Lightning team. # # 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 i...
from __future__ import absolute_import, division, print_function, unicode_literals import torch from tests import utils class SimpleAddModule(torch.nn.Module): def __init__(self, inplace=False): super(SimpleAddModule, self).__init__() self.inplace = inplace def forward(self, a, b): i...
'''Encode target locations and labels.''' import torch import math import itertools class DataEncoder: def __init__(self): '''Compute default box sizes with scale and aspect transform.''' scale = 300. steps = [s / scale for s in (8, 16, 32, 64, 100, 300)] sizes = [s / scale for s i...
#!/usr/bin/env python # # Public Domain 2014-2018 MongoDB, Inc. # Public Domain 2008-2014 WiredTiger, Inc. # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compil...
import time, copy, pickle import os, os.path import sys import numpy, pylab sys.path.append('C:/Users/Gregoire/Documents/PythonCode/JCAP') from readplatemap import * modelpath='C:/Users/Gregoire/Documents/CaltechWork/platemaps/Quaternarysingleplate/plate333_1map_full.txt' newpath='C:/Users/Gregoire/Documents/CaltechW...
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
from setuptools import setup, find_packages install_requires = [ 'pandas', 'pyarrow >= 0.12.1', 'pathos >= 0.2.4' ] setup( name='pandarallel', version='1.3.2', python_requires='>=3.5', packages=find_packages(), author='Manu NALEPA', author_email='nalepae@gmail.com', description...
import time import re import jwt import requests import json from pprint import pprint from abc import abstractmethod, ABC import logging logging.basicConfig(filename='app.log', level=logging.DEBUG, format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S') class Response: def __init__(s...
#!/usr/bin/env python """ Merge multiple HDF5 format localization files (tracks only). No alignment is performed. Metadata is taken from the first file. Hazen 01/18 """ import sys import storm_analysis.sa_library.sa_h5py as saH5Py def mergeHDF5(hdf5_files, results_file): """ Note: This only merges the trac...
from django.db import models import uuid class Product(models.Model): """ Creates and saves a new product """ sku = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, unique=True) name = models.CharField(max_length=255, blank=False, null=False) quantity = models.IntegerField(blank=...
import numpy as np class UtilInverse(): def __init__(self, verbose=True): self.verbose = verbose def find_nearest_ind(self, array, value): index = [] for ind in range(len(array)-1): if array[ind] < value and array[ind+1] > value: index.append(ind) ...
print("\nArduboy image viewer v1.0 by Mr.Blinky Jul.2019\n") #requires pyserial and PILlow to be installed. #Use "python -m pip install pyserial" and "python -m pip install pillow" on commandline import sys import time import os try: from serial.tools.list_ports import comports from serial import Serial except:...
from enum import Enum class EventType(Enum): message = "138311609000106303" operation = "138311609100106403" class ContentType(Enum): text = 1 image = 2 video = 3 audio = 4 location = 7 sticker = 8 contact = 10
"""Define distributed graph.""" from collections.abc import MutableMapping from collections import namedtuple import os import numpy as np from ..heterograph import DGLHeteroGraph from ..convert import heterograph as dgl_heterograph from ..convert import graph as dgl_graph from ..transform import compact_graphs from...
r""" ############################################################################### :mod:`OpenPNM.Algorithms` -- Algorithms on Networks ############################################################################### Contents -------- This submodule contains algorithms for performing simulations on pore networks Clas...
import pytest # type: ignore from cree_sro_syllabics import sro2syllabics, syllabics2sro COMBINING_CIRCUMFLEX = "\u0302" @pytest.mark.parametrize( "sro,syllabics", [ ("acimosis", "ᐊᒋᒧᓯᐢ"), ("atahk", "ᐊᑕᕽ"), ("mêriy", "ᒣᕒᐃᐩ"), ("wîstihkêw", "ᐑᐢᑎᐦᑫᐤ"), ("nêhiyawêwin", "...
import pyvtk import struct import matplotlib import numpy as np import mpl_toolkits.axes_grid1 import discretisedfield as df import ubermagutil.typesystem as ts import discretisedfield.util as dfu import matplotlib.pyplot as plt @ts.typesystem(mesh=ts.Typed(expected_type=df.Mesh), dim=ts.Scalar(expecte...
import os import shlex import subprocess import sys from docutils.parsers.rst.directives.admonitions import BaseAdmonition from sphinx.util import compat compat.make_admonition = BaseAdmonition # # Raiden documentation build configuration file, created by # sphinx-quickstart2 on Mon Oct 24 10:55:13 2016. # # This fil...
#!/usr/bin/python # -*- coding: utf-8 -*- # ************************************************************ # Copyright © 2019-2021 Acronis International GmbH. # This source code is distributed under MIT software license. # ************************************************************ import json # used for manipulatin...
from django.db import models from mahjong_portal.models import BaseModel from tournament.models import Tournament class TournamentStatus(BaseModel): tournament = models.ForeignKey(Tournament, on_delete=models.CASCADE) current_round = models.PositiveSmallIntegerField(null=True, blank=True) end_break_time...
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2019-08-27 19:08 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0141_mapsync'), ('osf', '0170_merge_20190807_0515'), ] operations = [ ]
__all__ = [ 'LXMLTreeBuilderForXML', 'LXMLTreeBuilder', ] from StringIO import StringIO import collections from lxml import etree from bs4.element import Comment, Doctype, NamespacedAttribute from bs4.builder import ( FAST, HTML, HTMLTreeBuilder, PERMISSIVE, TreeBuilder, XML) from b...
import torch from luffy.models.palm import * def test_palm_tony(): model = PaLMTony(num_tokens=20000) tokens = torch.randint(0, 20000, (1, 2048)) feat = model(tokens) assert feat.shape == (1, 2048, 20000)
from collections import namedtuple from itertools import starmap from multiprocessing import Pipe, Process, current_process from time import sleep from timeit import default_timer from ..callbacks import Callback from ..utils import import_required # Stores execution data for each task TaskData = namedtuple( "Tas...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (t...
import os import time from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler class Target: watchDir = os.getcwd() #watchDir에 감시하려는 디렉토리를 명시한다. def __init__(self): self.observer = Observer() #observer객체를 만듦 def run(self): event_handler = Handler() ...
# This __init__.py file for the sunSafeACS package is automatically generated by the build system from sunSafeACS import *
# # PySNMP MIB module CADANT-REMOTE-QUERY-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CADANT-REMOTE-QUERY-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:46:22 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 ...
""" obj generator Order of faces position/texcoord/normal https://www.loc.gov/preservation/digital/formats/fdd/fdd000508.shtml Ka: specifies ambient color, to account for light that is scattered about the entire scene. Kd: specifies diffuse color, which typically contributes most of the color ...
## # The MIT License (MIT) # # Copyright (c) 2015 Frankly Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, m...
""" Helpers for training """ from math import pi import tensorflow as tf def piecewise_constant(global_step, *args, **kwargs): """ Constant learning rate decay (uses global_step param instead of x) """ return tf.train.piecewise_constant(global_step, *args, **kwargs) def cyclic_learning_rate(learning_rate, gl...
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"Scorer": "00_core.ipynb", "TiebreakScorer": "00_core.ipynb", "MatchTiebreakScorer": "00_core.ipynb", "GamePointScorer": "00_core.ipynb", "SetTracker": "00_core.ipynb", ...