text stringlengths 8.04k 46.5k |
|---|
import pygame
import os
from pygame import mixer
from pygame import time
import random
from PIL import Image
# from Graveyardtileset import CROSSHAIR
from PIL import Image
import math
path = os.getcwd()
path1 = os.path.abspath(os.path.join(path, os.pardir))
GAMEPATH = path1
FILEPATH = os.path.join(path1, "Game Modu... |
import math
import torch
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from torch import nn
from torch.nn import Parameter
from torchsummary import summary
import os
from dcp.utils.model_analyse import ModelAnalyse
from dcp.utils.logger import get_logger
__all__ = ['ResNet', 'resnet18', ... |
"""
Script to evaluate the network quality if it is trained for densities or for colors.
They are tested with world-space training and the best configuration from eval_network_configs
"""
import sys
import os
sys.path.insert(0, os.getcwd())
import numpy as np
import sys
import os
import shutil
import subprocess
impor... |
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, <NAME>
# 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 th... |
# Copyright 2017 Google Inc. 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 or agre... |
import time
import usb
from maestro.usc.protocol import *
from maestro.usc.settings import UscSettings, ChannelSetting
class Range:
def __init__(self, numBytes, minimumValue, maximumValue):
self.bytes = numBytes
self.minimumValue = minimumValue
self.maximumValue = maximumValue
def s... |
from dataclasses import dataclass
from tequila import TequilaException, BitString, QubitWaveFunction
from tequila.hamiltonian import QubitHamiltonian, paulis
from tequila.circuit import QCircuit, gates
from tequila.objective.objective import Variable
from tequila.utils import to_float
import typing, numpy, numbers
i... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 6 10:19:00 2019
@author: allan
"""
import pandas as pd
import numpy as np
import os, datetime, json
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from scipy import interpolate, signal
from scipy.ndimage.filters import gaussian_filter
from scip... |
# Author: <NAME> <<EMAIL>>
# License: BSD (3-clause)
import itertools as itt
import os.path as op
import re
import numpy as np
import scipy.io as scio
from scipy import linalg
from mne import (EpochsArray, EvokedArray, pick_info,
rename_channels)
from mne.io.bti.bti import _get_bti_info, read_raw_bt... |
"""
Dashboard connector.
A collection of tools for sending information to the dashboard for the mission log.
- Python functions for sending JSON objects representing mission log to the dashboard.
They can be sent three ways:
1 - REST to the dashboard (free)
2 - SQS messages. Cost: first million requests free... |
#! /usr/bin/env python
##############################################################################
## Copyright (c) 2017 <NAME>.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
##
## *... |
###############################################################################
# Name: ed_keyh.py #
# Purpose: Editra's Vi Emulation Key Handler #
# Author: <NAME> <<EMAIL>> #
# Copyright: (c) 2... |
# ===========================================================================
#
# BMPTK's Stack Size Calculator:
# calculate the stack use from an .lss file
#
# (c) <NAME> (<EMAIL>)
# 2015-12-18 version 0.1 work-in-progress
# license: Boost Software License - Version 1.0
#
# ===========================================... |
from raachem.file_class.xyz import XyzFile
from raachem.util.constants import elements
from raachem.util.gen_purp import is_str_float
import functools, itertools, math
class LogFile:
calc_types = ["TS","Red","IRC","Opt","SP"]
def __init__(self,file_content):
self.list = file_content
self.lenght = len(se... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import stat
import subprocess as sb
import platform
import math
import sys
import re
import json
# utility functions for ana-rel-admin
CONFIG = None
RECIPES = None
def _getTopSubDir(subdir):
an... |
import logging
import os
import hmac
import hashlib
import json
import sys
import time
# import traceback
from datetime import datetime, timedelta
from urllib.parse import parse_qs
import boto3
COMMAND = os.environ['COMMAND']
SET_OPTIONS = {
"basedomain": "basedomain",
"urlpattern": "urlpattern",
... |
"""
The Wub Machine
Python web interface
started August 5 2011 by <NAME> (<EMAIL>)
"""
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2011 <NAME>"
__version__ = "2.2"
import json, time, locale, traceback, gc, logging, os, database, urllib
import tornado.ioloop, tornado.web, tornado.template, tornado... |
import json
import re
import secrets
from decimal import Decimal
from typing import List, Optional
import asyncpg
from fastapi import APIRouter, Depends, File, Form, HTTPException, Query, Response, Security, UploadFile
from fastapi.responses import StreamingResponse
from fastapi.security import SecurityScopes
from pyd... |
#!/usr/bin/env python3
"""
Copyright (c) 2020, <NAME>
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 copyright
notice, this list of condi... |
"""inference.py
"""
from __future__ import annotations
import os
import numpy as np
from jax import random
import json
import numpyro
from numpyro import handlers as hdl
from numpyro.infer import MCMC, NUTS, init_to_median, Predictive, SVI
from numpyro.distributions import constraints
from numpyro.infer import svi
... |
import sys
import traceback
import warnings
from . import jhu
import mechbayes.models.SEIRD
import pandas as pd
import matplotlib.pyplot as plt
import numpy as onp
import jax
import jax.numpy as np
from jax.random import PRNGKey
import numpyro
from numpyro.infer import MCMC, NUTS, Predictive
from pathlib import ... |
from datetime import datetime
import os
import re
from django import forms
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.forms.formsets import formset_factory
import commonware.log
import happyforms
from quieter_formset.formset import BaseFormSet
from to... |
#
# (C) Copyright <NAME> and <NAME> 2021, 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works ... |
import disnake
import numpy as np
from datetime import datetime, timedelta, timezone
from disnake.ext import commands
from PIL import Image, ImageEnhance
from utils.pxls.cooldown import get_best_possible
from utils.discord_utils import (
autocomplete_pxls_name,
format_number,
image_to_file,
STATUS_EMO... |
import wx
import os
import re
import time
import datetime
import bisect
import threading
from ScaledBitmap import ScaledBitmap, GetScaleRatio
from ComputeSpeed import ComputeSpeed
from Database import GlobalDatabase
from AddPhotoHeader import AddPhotoHeader
import Utils
import CVUtil
def _( x ):
return x
def Rescal... |
"""
Solver for Assignment 2 by team <NAME>
For COMP3702, Semester 2, 2019, University of Queensland
"""
#!/usr/bin/env python3
from support import angle, obstacle, problem_spec, robot_config
import tester
import argparse, time, sys, math, random, queue
from numpy import arange
# Handle cmd line args
parser = argparse.... |
"""Non-negative matrix and tensor factorization basic functions
"""
# Author: <NAME>
# License: MIT
# Jan 4, '20
# Initialize progressbar
from typing import List, Union, Tuple
import numpy as np
from scipy.sparse.linalg import svds
import logging
from .nmtf_core import ntf_stack, ntf_solve
from .nmtf_utils import c... |
import numpy as np
import math
import cv2
from imutils import paths
def Angle(x1,y1,x2,y2):
dx=abs(x1-x2)
dy=abs(y1-y2)
if x1==x2:
theta=90
elif y1==y2:
theta=0
elif ((x1>x2)&(y1<y2))|((x1<x2)&(y1>y2)):
theta=(180/math.pi)*math.atan(dy/dx)
else:
theta=180-(180/... |
#!/usr/bin/env python
"""
nn_manager_gan
A simple wrapper to run the training / testing process for GAN
"""
from __future__ import print_function
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import time
import datetime
import core_scripts.data_io.conf as nii_dconf
import core... |
# ------------------------------------------------------------------------------
# Python API to access CodeHawk Binary Analyzer analysis results
# Author: <NAME>
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 Kestrel Technology LLC
#... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# setting up modules used in the program
import a_prefix_variable as apv
from datetime import datetime
from socket import socket
import numpy as np
import threading
import socket
import glob
import time
import copy
import cv2
import sys
import os
# import machine learn... |
# SPDX-FileCopyrightText: Copyright (c) 2021 <NAME>
#
# SPDX-License-Identifier: MIT
"""
`biffobear_as3935`
================================================================================
CircuitPython driver library for the AS3935 lightning detector over SPI or I2C
buses.
.. warning:: The AS3935 chip supports I2C b... |
# Import the new package made specifically for this analysis
from src.utils.paths import REPORTS_DIR
import src.features.chunk_onset_dev as cod
import BirdSongToolbox.free_epoch_tools as fet
from BirdSongToolbox.import_data import ImportData
from BirdSongToolbox.file_utility_functions import _handle_data_path, _save_... |
#!/usr/bin/env python
import datetime
import re
import aiohttp
import asyncio
import time
import platform
from export_spdx import globals
from export_spdx import spdx
from export_spdx import config
from export_spdx import projects
from export_spdx import data
def process_comp(comps_dict, tcomp, comp_data_dict):
... |
# -*- coding: utf-8 -*-
# Copyright 2017 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.
"""Module to manage a setup of moblab and its DUT VMs."""
from __future__ import print_function
import collections
import contex... |
#######################
#
# High-level build tools factored out of build.py to keep that file cleaner.
# Lower-level tools appear in utils.py; most are independent of this project,
# such as shortcuts for reading/writing text files.
# Declarations of constants specific to this project are in build_constants.py.
#... |
#!/usr/bin/env python3
import os, sys, re
import logging as L
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from pprint import pformat
from math import modf
from datetime import datetime
from collections import OrderedDict
import shutil
from hesiod import hesiod_version, glob, load_yaml, abspath, ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from modules.networks import TriResNet
class ProbabilisticModel(nn.Module):
def __init__(self):
super(ProbabilisticModel, self).__init__()
self.dist = None
def _avg_gaussian_log_prob(self, xt, mu, sigma):
... |
import math
import os
import cv2
from osgeo import gdal
from osgeo import ogr
from osgeo import osr
import skimage
from skimage.color import rgb2gray
from skimage._shared._warnings import expected_warnings
from scipy.stats import entropy
import numpy as np
from nmapy.utilities.io import *
class LSR_da... |
import os
import pickle
from typing import List, Optional
import numpy as np
from transformers.trainer_utils import set_seed
from src.ner_model.chunker.abstract_model import Chunker
from src.ner_model.typer.data_translator import (
MSCConfig,
translate_into_msc_datasets,
log_label_ratio,
)
from src.utils.h... |
# # Sistema de clasificación de estilo de manejo
# ## 1. Importando módulos
import os
import pandas as pd
import numpy as np
import warnings
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import seaborn as sns
sns.set()
from statsmodels.graphics.mosaicplot import mosaic
import math
from sklea... |
import sys
import argparse
import numpy as np
import numpy.linalg.linalg as la
import matplotlib.pyplot as plt
from matplotlib import patches
# from scipy import stats
import matplotlib.transforms as transforms
class EKF:
"""
Extended Kalman filter, for filtering input data within nonlinear systems.
"""
... |
import warnings
from hypothesis import example, given
from hypothesis.strategies import composite, integers
import pytest
import mercantile
@pytest.mark.parametrize(
"args", [(486, 332, 10), [(486, 332, 10)], [mercantile.Tile(486, 332, 10)]]
)
def test_ul(args):
expected = (-9.140625, 53.33087298301705)
... |
"""
Programmer: <NAME>
Purpose: Some tools that load/save videos in Python. Also tools for blurring
and corrupting videos by byte errors
"""
import numpy as np
import numpy.linalg as linalg
import time
import os
import subprocess
import matplotlib.image as mpimage
import scipy.misc
import scipy.signal
from scipy.ndima... |
# 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... |
from typing import List, Optional, Dict, Any, Callable, Type, Union
from numbers import Number
import os
import numpy as np
import pandas as pd
from html import escape
import gensim
import torch
import torch.nn as nn
from torch.optim import Adam
from torch.optim.lr_scheduler import ReduceLROnPlateau
from tqdm import t... |
import math
import itertools
import torch as t
import numpy as np
import pandas as pd
import scipy
import matplotlib.pyplot as plt
from matplotlib import gridspec
from .distributions import (
PoissonBetaBinomial,
CorrectedPoissonBetaBinomial,
DiscreteDistribution,
GaussianMixture,
DriftSmoothingDist... |
# Copyright 2020 <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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
#this file will contain all the functions that test the analytic functions from analytic_functions.py
from app_interface import loadJsonFile
#from analytic_functions import average_length_ks, most_funded_category_per_year,countProjects, gatherYears, findAmbitious#other analytic function here
from analytic_functions i... |
"""
A collection of methods to help derive and prepare the launch json objects consumed by BaseSpaceAPI.launchApp
There are three object groups:
1. AppSessionMetaData. This reads the appsession from an existing app run and provides methods to extract details
about these app sessions so that more apps of the same ... |
import logging,math
import pyqtgraph as pg
import pyqtgraph.functions as fn
import numpy as np
from . import AxisItem
from pyqtgraph import QtCore,QtGui
logger=logging.getLogger(__name__)
class IPythonPNGRepr:
"""Class which can represent itself as a PNG in an IPython notebook.
Subclasses need to define meth... |
# MIT License
#
# Copyright (C) IBM Corporation 2018, 2019
#
# 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,... |
import calendar
import logging
import os
import shutil
import zipfile
from datetime import datetime, timedelta
from distutils.dir_util import copy_tree
from pathlib import Path
import ckanapi
import requests
from airflow import DAG
from airflow.models import Variable
from airflow.operators.dummy import DummyOperator
f... |
# Copyright 2019-2021 by <NAME>, The James Hutton Institute.
# All rights reserved.
# This file is part of the THAPBI Phytophthora ITS1 Classifier Tool (PICT),
# and is released under the "MIT License Agreement". Please see the LICENSE
# file that should have been included as part of this package.
"""Summarise classifi... |
from __future__ import print_function, unicode_literals
import mock
from twisted.trial import unittest
from twisted.python import log
from .common import ServerBase, _Util
from ..server import (make_server, Usage,
SidedMessage, CrowdedError, AppNamespace)
from ..database import create_channel_db, ... |
#
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# 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 ... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# moved from habitat_baselines due to dependency issues
import os
from typing import Any, Dict, List, Optional
import m... |
from ctypes import BigEndianStructure
from io import DEFAULT_BUFFER_SIZE
import time
import os
from datetime import datetime
from tkinter import *
from tkinter import ttk
from pyautogui import scroll
from gerais import *
from usuario import *
from relatorio import *
from configuracoes import *
import webbrowser
fro... |
import logging
import os
from operator import itemgetter
import numpy as np
default_hits_descr = [
('event_number', '<i8'),
('frame', '<u2'),
('column', '<u2'),
('row', '<u2'),
('charge', '<f4')]
default_hits_dtype = np.dtype(default_hits_descr)
default_cluster_hits_descr = [
('event_number'... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2012 by Idiap Research Institute, http://www.idiap.ch
#
# See the file COPYING for the licence associated with this software.
#
# Author(s):
# <NAME>, May 2012
#
import ssp
import numpy as np
import numpy.linalg as linalg
from optparse import OptionParser
f... |
"""
Tests for the MDK public API that are easier to do in Python.
"""
from time import time
from builtins import range
from past.builtins import unicode
from unittest import TestCase
from tempfile import mkdtemp
from collections import Counter
import configparser
import hypothesis.strategies as st
from hypothesis imp... |
#! /usr/bin/env python3
SIDEWORDS = {'t': 'top', 'b': 'bottom', 'r': 'right', 'l': 'left'}
FLIPWORDS = {True: 'flipped', False: 'normal'}
class Tile:
edges_cw = []
edges_ccw = []
flipped_edges_cw = []
flipped_edges_ccw = []
def __init__(self, id, data, rotations = 0, flipped = False):
se... |
import datetime
import json
import os
import pickle
import re
import sys
import pandas as pd
from joblib.parallel import Parallel, delayed
from resources import ROUGE_DIR, BASE_DIR
from summariser.oracle.lno_ref_values import SimulatedUser
from summariser.querier.expected_improvement_querier import ExpectedImprovement... |
"""
@ Author : <NAME>
@ Date : 3 Dec 2018
@ Description : Philips Dynalite Library - Unofficial interface for Philips Dynalite over RS485
@ Notes: Requires a RS485 to IP gateway (Do not use the Dynalite one - use something cheaper)
"""
import asyncio
import logging
from .dynet import Dynet, DynetCo... |
import numpy as np
import matrices_new as mat
# h1 = 1 / 2
# q1 = 1 / 4
# q2 = 2 / 4
# q3 = 3 / 4
h1 = 1 / 2 * 2
q1 = 1 / 4 * 2
q2 = 2 / 4 * 2
q3 = 3 / 4 * 2
_translation_a_h1 = np.array([h1, 0, 0])
_translation_b_h1 = np.array([ 0,h1, 0])
_translation_c_h1 = np.array([ 0, 0,h1])
_translation_n_ab_h1 = np.array([h... |
import logging
import re
import xml.etree.ElementTree as ET
from itertools import product
import cv2
import pytesseract as tess
tess.pytesseract.tesseract_cmd = r'C:\\Program Files\\Tesseract-OCR\\tesseract'
JSON = {}
def connect_dict(main_JSON: dict):
""" Used for connecting the JSON database by reference """
... |
#! /usr/bin/python
#
# gridmaker.py
#
# Usage:
# gridmaker.py
#
# Create and fill crossword puzzle grids.
#
import sys
import os
import re
import tkinter as tk
import pygame
print()
# Print instructions
instructions = """
Welcome to Gridwords!
Press CTRL+M to toggle between grid-editing mode and word-filling mod... |
import functools
import logging
import torch
import torch.nn as nn
from torch.nn import init
from options.options import opt_get
#import models.modules.sft_arch as sft_arch
logger = logging.getLogger('base')
####################
# initialize networks
####################
def weights_init_normal(m, bias_fill=0, mean=0... |
'''
NOTES:
-----
The first and last lines in test case "13.JPG" were different not due to miss classification of pitch
They were different because the function vertical_segmentation removes the first 2 symbols
In this test case the clef and the 2 4s were nearly joined so they were considered a single symbol
This led t... |
import unittest
import numpy as np
import scipy.sparse as sparse
import scipy.sparse.linalg
from gridlod import fem, util
class localMatrix_TestCase(unittest.TestCase):
def test_massMatrix1d(self):
M = fem.localMassMatrix(np.array([1]))
self.assertTrue(np.allclose(M, 1./6*np.array([[2, 1], [1, 2]]... |
import os
os.environ["LRU_CACHE_CAPACITY"] = "3"# reduces RAM usage massively with pytorch 1.4 or older
import time
import argparse
import math
import numpy as np
from numpy import finfo
import torch
import torch.nn as nn
import torch.nn.functional as F
from distributed import apply_gradient_allreduce
import torch.dis... |
#!/usr/bin/python3
import os
import shutil
import sys
import platform
from collections import deque
print('')
print('Now in BookMaker.py')
print(f'sys.path = {sys.path}')
print(f'sys.executable = {sys.executable}')
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gio', '2.0')
gi.require_version('Gdk',... |
# -*- coding: utf-8 -*-
import logging
from rest_framework import status as http_status
from django.utils import timezone
from django.core.exceptions import ValidationError
from flask import request
import mailchimp
from framework import sentry
from framework.auth import utils as auth_utils
from framework.auth import... |
#
# Copyright (c) 2010, <NAME>
# 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 copyright
# notice, this list of conditions and t... |
#!/usr/bin/env python3
# This file is covered by the LICENSE file in the root of this project.
import numpy as np
import time
import ipdb
class PanopticEval:
""" Panoptic evaluation using numpy
authors: <NAME> and <NAME>
"""
def __init__(self, n_classes, device=None, ignore=None, offset=2**32, min_poi... |
import os
import logging
from typing import Dict, List, Optional, Tuple, Any, Set, Union
import json
from google.protobuf import json_format
from copy import deepcopy
import ray
from ray.core.generated.runtime_env_common_pb2 import (
RuntimeEnv as ProtoRuntimeEnv,
RuntimeEnvConfig as ProtoRuntimeEnvConfig,
)
f... |
"""
A ribbon gallery is like a `wx.ListBox`, but for bitmaps rather than strings.
Description
===========
It displays a collection of bitmaps arranged in a grid and allows the user to
choose one. As there are typically more bitmaps in a gallery than can be displayed
in the space used for a ribbon, a gallery always h... |
# Band-limiting
# Copyright (c) 2019. <NAME>
# Licensed under The Apache License [see LICENSE for details]
# Written by <NAME>
# If you use Jupyter notebooks uncomment the line below
# %matplotlib inline
# Use the import below to run the code remotely on a server.
# from cnns import matplotlib_backend
# print("Us... |
import locale
import math
import json
from django.conf import settings
from django.core.cache import cache
from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.urls import reverse
from django.http import Http404
from django.http import HttpResponse
from django.http import HttpResponseRedirec... |
# -*- coding: utf-8 -*-
# Copyright 2018 Google Inc. 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 require... |
import math
import torch
from torch import nn
from torch.nn import functional as F
from stylegan2.model import PixelNorm, EqualLinear, EqualConv2d
from stylegan2.op import conv2d_gradfix, upfirdn2d, fused_leaky_relu
def polyval(coef, x):
res = 0
for i, c in enumerate(coef):
res += c *... |
from random import randint
from django.shortcuts import render, redirect, get_object_or_404
from django.http import JsonResponse
from .forms import UserRegisterForm, TopicCreationForm, MessageCreationForm
from django.contrib import messages
from django.contrib.auth import update_session_auth_hash, authenticate, logout,... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import json
import os
from pathlib import Path
import sys
import string
import random
import time
import tempfile
import re
from subprocess import Popen, check_call, CalledProcessError, PIPE, STDOUT
from nni.experiment.config import ExperimentCon... |
""" Nested Transformer (NesT) in PyTorch
A PyTorch implement of Aggregating Nested Transformers as described in:
'Aggregating Nested Transformers'
- https://arxiv.org/abs/2105.12723
The official Jax code is released and available at https://github.com/google-research/nested-transformer. The weights
have been con... |
# file eulfedora/views.py
#
# Copyright 2010,2011 Emory University Libraries
#
# 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
#
# ... |
# Copyright 2009, 2011 Canonical Ltd.
# This file is part of launchpadlib.
#
# launchpadlib is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, version 3 of the License.
#
# launchpadlib is distributed in ... |
# Copyright (C) 2018-2020 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET ... |
# -*- coding: utf-8 -*-
"""Basic structure of a evaluator."""
import gc
import logging
import timeit
from abc import ABC, abstractmethod
from contextlib import contextmanager
from dataclasses import dataclass
from math import ceil
from typing import Any, Collection, List, Mapping, Optional, Tuple, Union
import torch... |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import json
import logging
import os
import tempfile
import time
from typing import Any, Dict, List, Optional, Set, Tuple, Union
from urllib.parse import urlparse
from uuid import UUID
import jmespath
from azure.applicati... |
##########################################################################
#
# Copyright (c) 2011-2012, <NAME>. All rights reserved.
# Copyright (c) 2011-2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... |
import logging
import os
import math
import sys
import torch
import random
import pathlib
import ipdb
from pandarallel import pandarallel
import sentencepiece as spm
import numpy as np
import pandas as pd
from tqdm import tqdm
from copy import deepcopy
from functools import partial
from itertools import cycle, islice
... |
import os
from os import path
import subprocess
import shutil
from datetime import datetime
import jsondate as json
from simplekv.fs import FilesystemStore
import logging
from mytardis_ngs_ingestor.illumina import run_info
from mytardis_ngs_ingestor.illumina.run_info import get_run_id_from_path, \
get_sample_pr... |
# -*- coding: utf-8 -*-
"""
Quantarhei package (http://www.github.com/quantarhei)
lineardichroism module
This module contains classes to support calculation of linear dichroism
spectra.
"""
#import h5py
import numpy
import scipy
import matplotlib.pyplot as plt
#from scipy.optimize import minimiz... |
# noinspection PyUnresolvedReferences
from typing import Dict # noqa
from typing import Set # noqa
from typing import (
Any,
Iterable,
Optional,
Type,
TypeVar,
Union,
cast,
)
import asyncio
import libnacl
import libnacl.public
import os
import struct
import websockets
from . import util
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author : <NAME>
# E-mail : <EMAIL>
# Description:
# Date : 05/08/2018 6:04 PM
# File Name : kinect2grasp.py
import rospy
from sensor_msgs.msg import PointCloud2
from visualization_msgs.msg import MarkerArray
from visualization_msgs.msg import Marker
import... |
#!/usr/bin/env python
#
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
#
##
# Title :run-pmi-diffs.py
#
# Notes:
#
# TODO: Instead of downloading and ext... |
import pathlib
import re
import os
import dash
from dash.dependencies import Input, Output, State, ALL # ClientsideFunction
from dash import dcc
from dash import html
from dash import dash_table as dt
import dash_bootstrap_components as dbc
from dash.exceptions import PreventUpdate
import plotly.graph_objects as go
i... |
"""This module trys to support builtin types and functions."""
import inspect
try:
raw_input
except NameError:
raw_input = input
import rope.base.evaluate
from rope.base.utils import pycompat
from rope.base import pynames, pyobjects, arguments, utils
class BuiltinModule(pyobjects.AbstractModule):
def __... |
"""
this model has these functions:
1. cluster the training sentences for better mix
2. mix in arbitury layer
3. semi supervised learning
"""
import argparse
import glob
import logging as log
import os
import random
import time
import torch.nn.functional as F
import numpy as np
import torch
from eval_utils import f1... |
import pandas as pd
import os
from collections import Counter, OrderedDict
import logging
import re
import difflib
import spacy
import brat_scoring.constants as C
from brat_scoring.corpus import Corpus
from brat_scoring.labels import Entity
from brat_scoring.constants_sdoh import LABELED_ARGUMENTS as SDOH_LABELED_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.