text stringlengths 3.07k 22.1k |
|---|
# based on PTB Model
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import numpy as np
import tensorflow as tf
import reader
import random
import sample_data
from Model import Model
from Config import Config, TestConfig, DebugConfig
from tens... |
# Copyright 2021 [name of copyright owner]
# 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... |
#!/usr/bin/env python3
"""
PNH anatomical segmentation pipeline given by Regis Trapeau warpped in
Nipype.
Description
--------------
TODO :/
Arguments
-----------
-data:
Path to the BIDS directory that contain subjects' MRI data.
-resources:
Path to... |
from django.db import models
from django.db import transaction
from django.db.models import Sum
from team.models import TeamModel, PlayerModel, RelationModel
from scraper.entry import Manager
import jieba
import jieba.analyse
from pathlib import Path
from json import load
from datetime import datetime, timedelta
# sto... |
import typing
import math
from einops import rearrange
import numpy as np
import torch.nn.functional
import torch_complex
from paderbox.array import segment_axis
from paderbox.transform.module_stft import _biorthogonal_window_fastest, _get_window
from padertorch.contrib.cb.array import overlap_add
def stft(
... |
import logging
import inspect
from collections import namedtuple
from google.appengine.api import search as search_api
from google.appengine.ext import ndb
from .ndb import Behavior
def _datetime_coverter(n, v):
date = search_api.DateField(name=n, value=v)
iso = search_api.TextField(name=n + '_iso', value=v.i... |
import multiprocessing
import os
from glob import glob
from typing import List, Dict
import cv2
import numpy as np
from tqdm import tqdm
from tools.correlational_tracker.multi_tracker_with_merge_on_fly import calculate_distance
from tools.crf.IoU_test import get_region_props
from tools.crf.crf_on_labels import get_sa... |
import json
import logging
import furl
import trafaret as T
import venusian
from aiohttp import web
from trafaret_validator import TrafaretValidator
from sprezz.utils.plugin import plugin
from sprezz.utils.accept import NegotiateContent
log = logging.getLogger(__name__)
# Make acct known as scheme
# https://gith... |
from __future__ import print_function
import argparse
import re
import sys
from pyretrace.reader import MappingReader
STACK_TRACE_EXPRESSION = "(?:.*?\\bat\\s+%c\\.%m\\s*\\(.*?(?::%l)?\\)\\s*)|(?:(?:.*?[:\"]\\s+)?%c(?::.*)?)"
REGEX_CLASS = "\\b(?:[A-Za-z0-9_$]+\\.)*[A-Za-z0-9_$]+\\b"
REGEX_CLASS_SLASH = "\\b(?:[A-... |
"""
0.5.1: Simple Expressions
Tasks 0.5.1 to 0.5.3
Arithmetic and Numbers
"""
def SimpleExpressions():
#Task 0.5.1: Use Python to find the number of minutes in a week
minsInHour, hoursInDay, daysInWeek = 60, 24, 7
minsInWeek = daysInWeek * hoursInDay * minsInHour
print("There are %d minutes in a we... |
import torch
import math
from torch import nn, optim
import torch.nn.functional as F
from torch.autograd import Variable
from torch.distributions.multivariate_normal import MultivariateNormal
import ipdb
from torch.distributions import Normal
class BlackAttack(nn.Module):
def __init__(self, input_size, latent):
... |
import itertools as itl
class VariableInfo:
def __init__(self, name,vtype):
self.name = name
self.vmholder = None
self.vtype = vtype
def __eq__(self, other):
return other.name == self.name
# a lo mejor sería buena idea hacer que se pueda instanciar una sola vez.
class Type:
... |
# -*- coding: utf-8 -*-
from datetime import datetime
from flask import render_template, request, url_for, redirect, flash
from flask_login import login_user, login_required, logout_user, current_user
from watchlist import app, db
from watchlist.models import User, Movie
from watchlist.scrip import bian, command
@app... |
import re
import logging
from ats import aetest
from ats.log.utils import banner
#
# create a logger for this testscript
#
logger = logging.getLogger(__name__)
#
# Common Setup Section
#
class common_setup(aetest.CommonSetup):
'''Common Setup Section
Defines subsections that performs configuration
commo... |
import argparse
import glob
import json
import shutil
from multiprocessing import Pool, Value, Lock
from os import path, mkdir, listdir
import numpy as np
import tqdm
import umsgpack
from PIL import Image
from cityscapesscripts.helpers.labels import labels as cs_labels
from pycococreatortools import pycococreatortools... |
from argparse import ArgumentParser
import subprocess
import os.path as path
import sys
import tensorflow as tf
import numpy as np
from deepltl.data.datasets import teacher_forcing_map_fn, decoding_required_map_fn
from deepltl.data.vocabulary import CharacterVocabulary
from deepltl.data import ltl_parser
def prepare... |
"""
This module provides a wrapper over the scipy.optimize.linesearch module
To work with the Factor and FactorJacobian interface defined in
autofit.graphical
Note that this interface assumes that we're performing a maximisation.
In scipy the interface is defined for minimisations.
"""
import warnings
from typing i... |
#! /usr/bin/python3
import json, re, shlex, difflib, os
from subprocess import STDOUT, CalledProcessError, check_output, Popen, PIPE, call
from timeout_decorator import timeout, TimeoutError
from shlex import split
timeout_seconds = 120
def json_to_dict(json_path):
"""
Converts a json data to dictionary ... |
import logging
import configparser
import importlib
import time, os
import threading
from homeserver.device import PhilipsLamp, SamsungTV
from homeserver import logger
from phue import Bridge, PhueRegistrationException, PhueRequestTimeout
import random
###################### classes used internally by the interfa... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: __init__
:synopsis: the top-level module of Mockintosh.
"""
import argparse
import atexit
import json
import logging
import os
import shutil
import signal
import sys
import tempfile
from gettext import gettext
from os import path, environ
from typing impo... |
from glob import glob
from tkinter import * # Python interface to the Tk GUI toolkit
from tkinter import filedialog # open file
from tkinter import ttk
from tkinter.messagebox import showinfo
import tkinter
import database
import database_tools
selected_uuid = ""
root = Tk()
root.title('Database Manager')
... |
"""
Settings is for running experiments with different parameters. Supports
stuff like auto grid search and logging (yes, logging!).
TODO:
- [ ] sanity check passed experiments to be of type 'list'. If passing a
single setting that happens to be iterable it will happily iterate
through, e.g., a... |
#!/usr/bin/env python3
"""QYAML - query YAML with YAML.
Example:
$ echo 'data: { password: <PASSWORD> }' | qyaml 'data: password'
- superman
See README.md for more examples.
"""
import sys
from types import NoneType
import yaml
import re
from typing import Any, Generator, Tuple
def parse(docs, *queries):
... |
from __future__ import annotations
import sys
sys.path.append("./util")
from enum import unique, Enum, IntFlag
from dataclasses import dataclass
from typing import Optional, List, Callable, Union
from func import CaseLessThan, Case
from functools import singledispatch
@unique
class CardSuit(IntFlag):
Spade = 1,
... |
import json
import datetime
import tornado.web
import re
from biothings.utils.web.analytics import GAMixIn
from biothings.utils.web.tracking import StandaloneTrackingMixin
from biothings.utils.common import is_str, is_seq, split_ids
from urllib.parse import urlencode, urlparse, urlunparse, parse_qs, unquote_plus
try:
... |
"""Logic pertraining to preparing the run files and folders."""
import importlib
import shutil
from contextlib import contextmanager
from functools import wraps
from pathlib import Path
from haddock import contact_us, haddock3_source_path, log
from haddock.core.exceptions import ConfigurationError, ModuleError
from ha... |
import hashlib
import hmac
import uuid
from functools import partial
from django.conf import settings
from django.contrib.auth.signals import user_logged_in
from django.core.validators import ValidationError, validate_email
import basket
import commonware.log
from django_statsd.clients import statsd
from rest_framewo... |
# coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from abc import abstractmethod
from collections import defaultdict
from pants.... |
# MIT License
#
# Copyright (c) 2019 Tskit Developers
#
# 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, me... |
# -*- coding: utf-8 -*-
"""A wrapper for functions on a BEL sheets repository."""
import logging
import os
import sys
from collections import defaultdict
from dataclasses import dataclass, field
from typing import Any, Iterable, Mapping, Optional, Tuple, Union
import click
import pandas as pd
from tqdm import tqdm
... |
"""
This module deals with many aspects of the heap data structure.
Author: <NAME>
"""
from __future__ import print_function
from __future__ import division
import numpy as np
from math import floor
import copy
################################################
class MinHeap(object):
"""
Implements the classic da... |
from copy import deepcopy
from typing import Tuple, Dict, Optional, Callable, Any
import click
from .cli import gameta_cli
from .context import gameta_context, GametaContext
__all__ = ['command_cli']
@gameta_cli.group('cmd')
@gameta_context
def command_cli(context: GametaContext) -> None:
"""
CLI for mana... |
#!/usr/bin/python
"""
Copyright 2018-present Open Networking 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 la... |
import wx
import os
import openpyxl
import datetime
import Model
import Utils
def ReissueBibs( bibs, keepCategoryTheSame=True ):
race = Model.race
if not race:
return
# Get the reference Excel sheet.
excelLink = getattr( race, 'excelLink', None )
tNow = datetime.datetime.now()
if excelLink:
# Open the Excel... |
#!/usr/bin/env python3
import gym
from gym import spaces
import numpy as np
import time
import random
import matplotlib.pyplot as plt
class CustomEnv(gym.Env):
"""
The behavior of the agent and the world which he interacts
"""
def __init__(self):
super(CustomEnv, self).__init__()
se... |
"""Predict captions on test images using trained model, with greedy sample method"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from datetime import datetime
import configuration
from ShowAndTellModel import build_model
from ... |
#!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
'''
Project-wide **Python module importer** unit tests.
This submodule unit tests the public API of the private
:mod:`beartype._util.m... |
from sklearn.metrics.pairwise import pairwise_distances
from tensorflow.python.platform import gfile
import tensorflow as tf
import numpy as np
import detect_and_align
import argparse
import time
import cv2
import os
import smtplib,ssl
from email.mime.multipart import MIMEMultipart
from email.mime.base impor... |
import inspect
import itertools
import sys
from contextlib import suppress
from functools import partial, wraps
from types import FrameType, FunctionType, ModuleType
from typing import Any, Dict, Iterable, List, Set, Tuple, Union, cast
from parametrize.utils import copy_func
Parameter = Tuple[str, Any]
Parameters = ... |
'''
Multiple-boundary edit distance. Detailed in [FournierInkpen2012]_.
.. moduleauthor:: <NAME> <<EMAIL>>
'''
#===============================================================================
# Copyright (c) 2011-2012, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or witho... |
#-*- coding: utf-8 -*-
"""
Python CDL parsing library
"""
__version__ = '0.5.5'
__author__ = 'simon'
import sys
import logging
import json
import os
import re
from xml.dom import minidom
import traceback
allow_edls = False
try:
import edl
allow_edls = True
except Exception as e:
allow_edls = False
clas... |
import re
import typing # importing functions/decorators directly is weird
from typing import TypeVar, Protocol, Any, Optional, List
from dis_snek.client.errors import Forbidden, HTTPException
from dis_snek.models.discord.role import Role
from dis_snek.models.discord.guild import Guild
from dis_snek.models.discord.me... |
import sys
sys.path.append("..")
from const.color import output_error
from concurrent.futures import ThreadPoolExecutor
from fake_useragent import UserAgent
from bs4 import BeautifulSoup
from datetime import datetime
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import pandas as... |
import logging
import aiohttp
from aiohttp import web
import aiohttp_session
import uvloop
import google.auth.transport.requests
import google.oauth2.id_token
import google.cloud.storage
import google_auth_oauthlib.flow
from hailtop.config import get_deploy_config
from gear import setup_aiohttp_session, create_database... |
# Copyright (C) 2014 <NAME>
# All rights reserved.
#
# This file is part of phonopy.
#
# 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
# notice, thi... |
"""
@file : model.py
@author : xiaolu
@email : <EMAIL>
@time : 2021-03-16
"""
import torch
from torch import nn
import torch.nn.functional as F
class CIN(nn.Module):
# Compressed_Interaction_net
def __init__(self, in_channels, out_channels):
super(CIN, self).__init__()
self.conv_1 = nn.Co... |
#! /usr/bin/env python
import unittest
import logging
import pyslet.http.messages as messages
import pyslet.http.client as client
from test_http_client import MockClientWrapper
from pyslet.http.auth import * # noqa
def suite():
return unittest.TestSuite((
unittest.makeSuite(HTTP2617Tests, 'test'... |
#!/usr/bin/env python
# Parses masscan xml file into either a list of service visioning nmap commands or an MTL style CSV.
# By: <NAME>
# Version: 0.1.0xxxx
# Last Updated: 12/4/16
# x/7/2021 - pit$$$$$ edits, python3.9, bug fixes, cleanup output,etc..
#
# import of the things (all python default)
import argparse
imp... |
import re
import io
import os
import sys
import json
import time
import discord
import threading
import logging
import functools
from datetime import datetime, timedelta
from discord.ext import commands
from discord import utils
from src import model, sample, encoder
import numpy as np
import tensorflow as tf
class GP... |
import pytest
@pytest.mark.skip(
reason="https://github.com/open-traffic-generator/snappi-ixnetwork/issues/443"
)
def test_raw_tcp_flow_capture(api, utils):
"""
Configures the 2 raw flows ipv4 and ipv6 with dual stack and tcp,
on top of it. traffic shall flow from tx port to rx ports with specific
... |
#!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... |
'''
From <NAME>
No particular license or rights, you can change it as you feel, just be honest. :)
For python puritain, sorry if this script is not "pythonic".
Significant changes made by <NAME>, August 23, 2020
'''
'''
This script picks up the magnitudes and the spectral type from Simbad website.
*How to use it:
... |
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
import plotly.graph_objs as go
import requests
import pandas as pd
import numpy as np
import datetime
from app import app, lo... |
import datetime
import logging
import pathlib
import signal
import codecs
import pickle
import time
import zmq
import sys
import re
from slickrpc import Proxy
from slickrpc import exc
from eccgw_email import sendEmail
from eccgw_tweet import sendTweet
import settings
eccoin = Proxy('http://%s:%s@%s'%(settings.rpc_u... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 20 15:58:02 2020
@author: <NAME>
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import ptan
import numpy as np
from types import SimpleNamespace
# from collections import deque, namedtuple
class PGNet(nn.Module):
r"""P... |
# -*- coding: utf-8 -*-
"""
Module with tools functions used on classes.
"""
import os
import numpy as np
import xarray as xr
from copy import deepcopy
import psutil
import errno
import argparse
import ghalton as gh
# import matplotlib.pyplot as plt
# from matplotlib import cm
# from matplotlib import ticker
# f... |
#!/usr/bin/env python
import logging
import os
import time
import warnings
import click
import requests
from kubernetes import client, config, watch
from prometheus_client import (Counter, Gauge, Histogram, Info,
start_http_server)
from prometheus_client.utils import INF
VERSION = '1.1.... |
__author__ = "<NAME>"
import glob
import logging
import os
import shutil
import tarfile
import zipfile
import iotbx.pdb
from ample.util import ample_util, exit_util, pdb_edit, sequence_util
logger = logging.getLogger(__name__)
class CheckModelsResult:
def __init__(self):
self.created_updated_models = ... |
from functools import update_wrapper
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.core.urlresolvers import reverse
from django.template.response import TemplateResponse
from django.contrib import admin
from django.contrib.admin.options import csrf_protect_m
from django.contrib... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import binascii
import base64
import copy
import os
import json
import unittest
from nose.tools import eq_, ok_
from mock import patch, Mock
from py_vapid import Vapid01, Vapid02, VapidException
from py_vapid.jwt import decode
# This is a private key in DER form.
T_DER = """
<KEY>
"""
key = dict(
d=1119718768762... |
# Copyright (c) 2020 UAVCAN Consortium
# This software is distributed under the terms of the MIT License.
# Author: <NAME> <<EMAIL>>
"""
This module implements forwarding between the standard subject ``uavcan.diagnostic.Record``
and Python's standard logging facilities (:mod:`logging`).
"""
from __future__ import ann... |
import argparse
import numpy as np
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Beta
from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler
# from utils import DrawLine
parser = argparse.ArgumentParser(descr... |
# Copyright 2018 Comcast Cable Communications Management, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# encoding: utf8
#
# This file is part of the Neurons project.
# Copyright (c), Arskom Ltd. (arskom.com.tr),
# <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:
#
# ... |
# Author: <NAME>
# Description: This program takes a directory of images that have already
# been processed by ScanProcessing.py or Scan.py and summarizes
# the distribution of flake sizes and flake contrast values.
# The current plan is to add flake library viewing functiona... |
import argparse
import glob
import os
from pathlib import Path
from test import repeat_eval_ckpt
import torch
import torch.distributed as dist
import torch.nn as nn
from tensorboardX import SummaryWriter
from liga.config import cfg, cfg_from_list, cfg_from_yaml_file, update_cfg_by_args, log_config_to_file
from liga.d... |
# import transformers
# from transformers import AdamW, get_linear_schedule_with_warmup
import torch
import numpy as np
import pandas as pd
# import seaborn as sns
# from pylab import rcParams
# import matplotlib.pyplot as plt
# from matplotlib import rc
# from sklearn.model_selection import train_test_split
from sklea... |
from Chords import Chords
# '++13'から数値13だけを抜き取る
def get_degree_value(degree_name):
v = degree_name
v = v.replace('+','')
v = v.replace('-','')
return int(v)
#9,11,13と変化記号の組合せ '9','+11','--13'等
def tension_note_patterns():
for t in ('9', '11', '13'):
for accidental in ('','+','-','--'):
... |
# https://pyglet.readthedocs.io/en/stable/programming_guide/graphics.html
import pyglet
from pyglet import gl
from pyglet.window import key
import math
import sounddevice as sd
import numpy as np
W, H = 780, 630
BG_COLOR = (.75, .75, .75, 1)
SPEED_POLYGON = 30
SIZE = 30
SPEED_CIRCLE = 300
RADIUS = 20
... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import os
import time
import json
import shutil
import subprocess
import random
import threading
import psutil
import stat
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtWebCh... |
# Copyright (c) 2020, DjaoDjin inc.
# 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 list of conditions and t... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 17 13:20:20 2020
@author: Michi
"""
import tensorflow.compat.v2 as tf
import tensorflow_probability as tfp
tf.enable_v2_behavior()
tfd = tfp.distributions
def make_model(model_name, **params):
if model_name=='dummy':
return make... |
"""Gwyddion object definitions.
See <http://gwyddion.net/documentation/user-guide-en/gwyfile-format.html>
for a specification of Gwyddion native data files.
"""
import struct
from collections import OrderedDict
import numpy as np
from six import BytesIO, string_types
from six.moves import range
class GwyObject(Orde... |
import os
import struct
import mmap
class Bowtie2IndexReference(object):
"""
Given prefix of a Bowtie 2 index, parses the reference names, parses the
extents of the unambiguous stretches, and memory-maps the file containing
the unambiguous-stretch sequences. get_stretch member function can
retrie... |
import logging
import os
# Workaround: Load fiona at the end to avoid segfault on box (???)
import fiona
import numpy as np
import rasterio
from rasterio.crs import CRS
from shapely.geometry import box, shape
from shapely.ops import unary_union
from skimage import exposure
from skimage.io import imsave
from tqdm impor... |
#
# Copyright (c) 2015-2021 <NAME> <tflorac AT ulthar.net>
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE... |
import armor_stand_geo_class
import armor_stand_class
import structure_reader
import animation_class
import render_controller_class as rcc
from tkinter import StringVar, Button, Label, Entry, Tk, Checkbutton, END, ACTIVE
from tkinter import filedialog, Scale,DoubleVar,HORIZONTAL,IntVar,Listbox, ANCHOR
import manifest
f... |
# Clase que contiene la definición de los nodos que almacenarán
# la información dentro de la estructura.
class Node:
def __init__(self, info):
self.node_id = str(info[0])
self.secret_pk = "0"
self.primary_keys = []
self.columns = len(info)
self.info = info
def draw(... |
from src.models.Estimator import Estimator, metric_callable
from src.features.build_features import *
from src.models.Model import Model
from src.utils import *
from src.visualization.heatmap import *
from sklearn.model_selection import train_test_split
# Hyperparameters
p_max = 16
q_max = 16
p = 15
q = 1
alpha = 0.5
... |
# coding: utf-8
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from contextlib import contextmanager
from datetime import datetime, timedelta
from unittest.mock import patch
from odoo.addons.base.tests.common import HttpCaseWithUserDemo
from odoo.addons.website.tools import MockRequest
fro... |
# -*- coding: utf-8 -*-
'''
Created on Aug 6, 2014
@author: tmahrt
Contains a basic workflow of functions that may be useful in force
alignment but are not strictly necessary. If your input is from
textgrid files or files in the form ("start time", "stop time", "text")
you may find these functions useful.
'''
impor... |
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, <NAME>, Inc.
# 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 copyri... |
"""iplib3's functionality specific to validating things"""
from typing import List, Optional, Tuple, Union
from .constants.port import (
PORT_NUMBER_MIN_VALUE,
PORT_NUMBER_MAX_VALUE,
)
from .constants.ipv4 import (
IPV4_MAX_SEGMENT_COUNT,
IPV4_MIN_SEGMENT_COUNT,
IPV4_MIN_SEGMENT_VALUE,
IPV4_MA... |
# pylint: disable=redefined-outer-name, no-self-use
"""Test the stats module."""
import numpy as np
import pytest
import xarray as xr
from scipy import stats
from xarray.testing import assert_allclose
from xarray_einstats import tutorial
from xarray_einstats.stats import (
XrContinuousRV,
XrDiscreteRV,
cir... |
from __future__ import print_function
__author__ = '__fbb__'
#<NAME>, NYU
#github: @fedhere
#<EMAIL>
#cosmo.nyu.edu/~fb55/
#created: December 2015
#module to plot time series as sparkle lines a' la Tufte.
import numpy as np
import pandas as pd
import matplotlib.pyplot as pl
import matplotlib as mpl
from distutils.vers... |
"""
gpt.utils.py
28.09.2019 - @yashbonde
"""
import json
import os
from functools import lru_cache
from glob import glob
from tqdm import tqdm
import regex as re
import tensorflow as tf
import numpy as np
from model import model, past_shape
'''
accumulator.py
'''
class AccumulatingOptimizer(object):
def __init... |
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import urllib
from datadog import statsd
from flask import current_app as app, g
from flask import render_template
import requests
import whoosh
from celery.task import current
from boto.exception import S3ResponseError
from ... |
import functools
import json
import types
import tempfile
from unittest.case import TestCase
from unittest.mock import patch
import pandas as pd
import numpy as np
import biom
from qiime2 import Metadata, Artifact
import microsetta_public_api
import microsetta_public_api.server
import microsetta_public_api.utils._uti... |
# -*- coding: utf-8 -*-
"""
Spell out time to Thai words.
Convert time string or time object to Thai words.
"""
import warnings
from datetime import datetime, time
from typing import Union
from pythainlp.tokenize import Tokenizer
from pythainlp.util.numtoword import num_to_thaiword
from pythainlp.util.wordtonum impor... |
import numpy as np
import tensorflow as tf
from .residual import resnet_2, resnet_1
LATENT_SPACE_SIZE = 128
L2_LAMBDA = 1e-4
LAST_LAYER_DEPTH = 32
LAST_LAYER_SIZE = 16
FILTER_SIZE = 64
def _baseline_encoder(x, filter_size=FILTER_SIZE):
model = tf.layers.conv2d(x, filters=filter_size, kernel_size=4, strides=2, pa... |
# coding: utf-8
"""
Process link to star namespace that contains links to modules. Output links to json (star.json)
"""
# region Imports
from dataclasses import dataclass
import sys
import argparse
import re
import logging
from typing import Dict, List, Tuple, Union
from bs4.element import ResultSet, Tag
from kwhelp.de... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
bias = False
class conv_block(nn.Module):
# base block
def __init__(self, ch_in, ch_out, affine=True, actv=nn.LeakyReLU(inplace=True), downsample=False, upsample=False):
super(conv_block, self).__init__()
... |
from nose.plugins.skip import SkipTest
SKIP = False
try:
from root_numpy.tmva import _libtmvanumpy
from root_numpy.tmva._data import NEW_TMVA_API
except ImportError: # pragma: no cover
SKIP = True
raise
import os
import tempfile
import shutil
from array import array
import atexit
import numpy as np
... |
"""
Team API endpoints - list, create, update teams
"""
import re
import secrets
import flask
import sqlalchemy
from profanity import profanity
import wordfilter
from .. import model, util
from . import util as web_util
from .blueprint import web_api
TEAM_NAME_REGEX = re.compile(r'^[a-zA-Z][a-zA-Z0-9_\-]*$')
TEAM... |
import re as re
from typing import Union, Callable
import numpy as np
__author__ = "piveloper"
__copyright__ = "26.03.2020, piveloper"
__version__ = "1.0"
__email__ = "<EMAIL>"
__doc__ = """This script includes helpful functions to extended PyOpenCl functionality."""
from pyopencl_extension.types.auto_gen.cl_types i... |
import pathlib
import pytest
import concepts
from concepts import algorithms
from concepts import formats
BOB_ROSS = pathlib.Path('bob-ross.cxt')
ENCODING = 'utf-8'
@pytest.fixture
def bob_ross(test_examples, filename=BOB_ROSS):
path = test_examples / filename
context = concepts.load_cxt(str(path), encod... |
import pyglet
import pymunk
from pymunk.pyglet_util import DrawOptions
from pymunk.vec2d import Vec2d
import numpy as np
import random
import gym
from gym import error, spaces, utils
from gym.utils import seeding
class UltrasonicSensor:
def __init__(self, space, car, offset=0, angle=0, color=(0,255,0,255)):
... |
__author__ = 'zhouhaiping'
import zstacklib.utils.daemon as daemon
import zstacklib.utils.http as http
import zstacklib.utils.log as log
import zstacklib.utils.shell as shell
import zstacklib.utils.lichbd as lichbd
import zstacklib.utils.iptables as iptables
import zstacklib.utils.jsonobject as jsonobject
import zstac... |
from typing import Tuple, Optional, Dict, Set, List, Iterable, Any, Callable
import multiprocessing
import os
import psycopg2
import time
import json
import elasticsearch
import spacy
import functools
import re
from elasticsearch.exceptions import ConnectionTimeout, TransportError
from tqdm import tqdm
from multiproc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.