text stringlengths 6.04k 39.5k |
|---|
from time import time
from SPARQLWrapper import SPARQLWrapper, N3, JSON, RDF, TURTLE, JSONLD
from rdflib import Graph, ConjunctiveGraph, Namespace
from rdflib.namespace import RDF
import requests
from jinja2 import Template
from pyshacl import validate
import extruct
import json
from pathlib import Path
from datetime i... |
import numpy as np
import pickle as pkl
import networkx as nx
import scipy.sparse as sp
from scipy.sparse.linalg.eigen.arpack import eigsh
import sys
import torch
import torch.nn as nn
def parse_skipgram(fname):
with open(fname) as f:
toks = list(f.read().split())
nb_nodes = int(toks[0])
nb_feature... |
# -*- coding: utf-8 -*-
"""
pysteps.motion.vet
==================
Variational Echo Tracking (VET) Module
This module implements the VET algorithm presented
by `<NAME> Zawadzki (1995)`_ and used in the
McGill Algorithm for Prediction by Lagrangian Extrapolation (MAPLE) described
in `<NAME> (2002)`_.
.. _`<NAME> (199... |
# 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 agreed to in... |
"""
This module calculates corrections for the species listed below, fitted to the experimental and computed
entries given to the CorrectionCalculator constructor.
"""
import warnings
from collections import OrderedDict
from typing import Dict, List, Tuple, Union, Sequence
try:
import ruamel.yaml as yaml
except I... |
#!/usr/bin/env python
#
# Copyright 2014 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 json
import datetime
import itertools
import logging
import os
import pager
import pool.thread
import random
import shell
import shell.conf
import subprocess
import sys
import time
import util.cached
import util.colors
import util.dicts
import util.exceptions
import util.iter
import util.log
import util.strings
... |
"""Filter classifier"""
import json
import logging
import collections
import math
import scipy.optimize
import numpy as np
import pandas as pd
from pandas.io.json import json_normalize
import sklearn.linear_model
from sklearn.metrics import accuracy_score, confusion_matrix, roc_auc_score, log_loss
from opustools.uti... |
####################################
# Author: <NAME>
# Date: September 2016
# Project: Document Summarization
# H2020 Summa Project
# v1.2 XNET
# author: <NAME>
####################################
"""
Question Answering Modules and Models
"""
from __future__ import absolute_import
from __future__ import division... |
import tkinter as tk
from p_types import PokemonType
from moves import Move
from pokemon import Pokemon
from battle import Battle
class Game:
def __init__(self):
self.battle_num = 0
self.max_battles = 3
self.current_battle = None
def startBattle(self):
self.battle_... |
import os
import numpy as np
import copy
from PIL import Image, ImageDraw
from collections.abc import Sequence
from paddle.io import Dataset
from data.operators import *
from eval_model import get_categories, get_infer_results
class ImageFolder(Dataset):
def __init__(self,
dataset_dir=None,
... |
# -*- coding: utf-8 -*-
from ConfigParser import NoOptionError
import calendar
import datetime
from taxi import remote
from taxi.exceptions import CancelException, UsageError
from taxi.projects import Project
from taxi.timesheet import (
NoActivityInProgressError, Timesheet, TimesheetCollection, TimesheetFile
)
fr... |
# =============================================================================
# Copyright 2020 NVIDIA. All Rights Reserved.
# Copyright 2019 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 obt... |
import numpy as np
import scipy.special as ss
from scipy.optimize import root_scalar
from scipy import integrate
from csr2d.core2 import psi_x0, psi_s, Es_case_B, Fx_case_B_Chris, Es_case_A, Fx_case_A, Es_case_C, Fx_case_C, Es_case_D, Fx_case_D, psi_s_case_E, Es_case_E
from csr2d.core2 import alpha_exact_case_B... |
r"""Functions for nuclear and neutron beta decay effective couplings and $Ft$ values."""
from math import pi, log, sqrt
import flavio
from flavio.config import config
from flavio.physics.betadecays.common import wc_eff
from flavio.physics.ckm import get_ckm
from flavio.physics.taudecays.taulnunu import GFeff
from fla... |
#!/usr/bin/env python
import sys
import os, os.path
import shutil
from ROOT import gROOT,gSystem,gDirectory,RooAbsData,RooRandom,RooWorkspace
## batch mode
sys.argv.insert(1, '-b')
gROOT.Reset()
gROOT.SetBatch(True)
del sys.argv[1]
gSystem.Load("libSusyFitter.so")
gROOT.Reset()
def GenerateFitAndPlot(tl):
from ... |
from collections import OrderedDict
import numpy as np
from qtpy.QtCore import Qt, Signal
from qtpy.QtGui import QPainter, QTransform, QPen
from qtpy.QtWidgets import (QGraphicsView, QGraphicsScene, QApplication,
QGraphicsTextItem, QGraphicsEllipseItem,
QGraphics... |
# encoding: utf8
__all__ = ['CalendarFrame']
import calendar
import locale
import tkinter as tk
import tkinter.ttk as ttk
imgp_data = ('<KEY>' +
'AA<KEY>=')
imgn_data = ('<KEY>' +
'AA<KEY>')
def get_calendar(locale, fwday):
# instantiate proper calendar class
if locale is None:
... |
# original file: https://github.com/dmlc/dgl/blob/master/examples/pytorch/lda/lda_model.py
# with minor modifications (to be considered upstream)
# Copyright 2021 <NAME>
# with references from "sklearn.decomposition.LatentDirichletAllocation"
# with the following original authors:
# * <NAME> (the said scikit-learn imp... |
import logging
import os
from json.decoder import JSONDecodeError
from typing import TYPE_CHECKING, Any, List, Optional, Union
from rotkehlchen.assets.asset import Asset
from rotkehlchen.db.dbhandler import DBHandler
from rotkehlchen.errors import DeserializationError, HistoryCacheInvalid, RemoteError, UnknownAsset
fr... |
#!/usr/bin/env python3
# coding: utf-8
from __future__ import print_function
from .__version__ import S_VERSION
from .__init__ import EP, WINDOWS, COLORS, unicode
from . import util as Util
from . import inetcat as Inetcat
from . import itelnet as Itelnet
from . import world as World
import os
import sys
import time
i... |
import numpy as np
import numpy.typing as npt
from typing import List, Tuple, Optional, Union
from .config.cfg import SweepConfig
from .run import SweepRun, RunState
from .params import HyperParameter, HyperParameterSet
from sklearn import gaussian_process as sklearn_gaussian
from scipy import stats as scipy_stats
f... |
from __future__ import division
from options import get_parsed_commandline_options
from data_3d import WaveFront
# from data_3d import *
from modes import *
from file_utils import *
from modes.manipulate_results_data import *
import logging
from service import GracefulShutdown
# ===================================... |
# coding=utf-8
#
# Copyright 2020 <NAME> Duesseldorf
#
# Part of this code is based on the source code of BERT-DST
# (arXiv:1907.03040)
#
# 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
#
# ... |
# Copyright 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:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
# dis... |
# -*- coding: utf-8 -*-
import heapq
import logging
from itertools import count
from graphit import __module__
__all__ = ['node_neighbors', 'degree', 'dfs', 'dfs_paths', 'dijkstra_shortest_path',
'brandes_betweenness_centrality', 'eigenvector_centrality', 'adjacency',
'is_reachable', 'nodes_ar... |
'''
Population functions.
Code from https://github.com/cortex-lab/phylib/blob/master/phylib/stats/ccg.py by <NAME>.
Code for decoding by <NAME>
'''
import numpy as np
import scipy as sp
import types
from itertools import groupby
from sklearn.ensemble import RandomForestClassifier
from sklearn.naive_bayes ... |
"""
This module uses the pytest infrastructure to produce reports on a large list
of packages. It verifies installation with and without an intact system PATH.
It also generates report summaries and error reports files.
Test pytest outcomes:
PASS - if no pip errors, and no pipx issues, and package apps verified
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: <NAME>
# Date: 2021/1/31 9:47 PM
"""
Lightweight class to record training and dataset file info for later retrieval.
Experiment ID is generated from the exp_ID_config.csv file; 1 if file not exist.
Also includes data FalsePositiveCategorizer class for categorizin... |
import cv2
import os
import sys
import numpy as np
import datetime
from PyQt5 import QtGui, QtCore
from PyQt5.QtWidgets import QDialog, QApplication, QMainWindow, QMessageBox
from PyQt5.uic import loadUi
from PyQt5.QtCore import pyqtSlot, QTimer, QDate, Qt
import csv
import face_recognition
class USER(QD... |
# -*- coding: utf-8 -*-
import numpy as np
import igraph as ig
class BasicNode: # should be interfaced to from a graph object
def __init__(self, content=None, labels=None):
self.content = content
self.incident_edges = set([])
self.incident_outward_edges = set([])
self.incident_inw... |
"""Node that calls the MaskRCNN module for object detection."""
# Copyright (c) 2022, ABB
# 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
... |
"""This module provides the analytical solution for computing the hessian matrix of our
loglikelihood function
"""
import numpy as np
from scipy.stats import norm
def compute_hessian(x0, X1, X0, Z1, Z0, Y1, Y0):
"""This function wraps all subroutines and returns the hessian matrix of our
log-likelihood functi... |
from typing import Optional, List, NoReturn
import copy
from easydict import EasyDict
from ding.utils import find_free_port, find_free_port_slurm, node_to_partition, node_to_host, pretty_print, \
DEFAULT_K8S_COLLECTOR_PORT, DEFAULT_K8S_LEARNER_PORT, DEFAULT_K8S_COORDINATOR_PORT
from dizoo.classic_control.cartpole.... |
#!/usr/bin/env python
# Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License
#
# 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 limi... |
import collections
import copy
import inspect
import re
from functools import wraps
from flask import request
from flask_restful import inputs, reqparse, Resource
class ValidationError(ValueError):
""" """
pass
def auth(request_obj, endpoint, method):
"""Override this function in your application.
... |
import argparse
import codecs
import datetime
import hashlib
import inspect
import logging
import os
import sys
import time
import traceback
import warnings
import dill
import nbformat as nbf
from jupyter_client.kernelspec import KernelSpecManager
from nbconvert import HTMLExporter
from nbconvert.preprocessors import ... |
from __future__ import division, with_statement
from ...._common import block_to_format, get_label_length
from ._helpers import prune_nones_dict, prune_nones_list, read_record
__all__ = [
"read",
]
def read(filename, label_length=None):
"""
Read TOUGH input file.
Parameters
----------
filen... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# PATE Bias Board Evaluation Software (pbbes) 2018
#
# Data.py - <NAME> <<EMAIL>>
# 0.1 2018.09.22 Initial version.
# 0.2 2018.09.23 Modified to use curses instead of war escape sequences
# 0.3 2018.09.30 Clean-up.
# 1.0 2018.10.04 Finalized fo... |
'''
This module converts between lat long and UTM coordinates.
Geographic coordinates are entered and displayed in degrees.
Negative numbers indicate West longitudes and South latitudes.
UTM coordinates are entered and displayed in meters.
The ellipsoid model used for computations is WGS84.
Usage:
import latlonutm ... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... |
__author__ = "@tino-michael"
import logging
import numpy as np
from astropy import units as u
from numba import jit
from ctapipe.instrument import CameraGeometry
logger = logging.getLogger(__name__)
__all__ = [
"convert_geometry_hex1d_to_rect2d",
"convert_geometry_rect2d_back_to_hexe1d"
]
def unskew_hex_... |
#!/usr/bin/env python
# coding: utf-8
# Design and Programming by Lead TA: <NAME> @ Data Analytics Lab - UWaterloo.ca
# COURSE: CS 486/686 - Artificial Intelligence - University of Waterloo - Spring 2020 - Alice Gao
# Please let me know if you find any bugs in the code: <EMAIL>
# The code will be available at https://... |
import pyspark.sql.functions as F
import pyspark.sql.types as T
from typing import Callable
from pyspark.sql import SparkSession, DataFrame
# helper function for looping
def loop(op: Callable[[DataFrame], DataFrame], df: DataFrame = None) -> DataFrame:
for _ in range(10):
df = op(df)
return df
class ... |
import os,sys
from tkinter import *
import tkinter.font as font
from tkinter import filedialog
class Final(Frame):
def __init__(self, parent=None, pid=0,side=LEFT, anchor=N,wt=600,ht=400,is_next=True,is_back=True,next_frame=None,back_frame=None,info_txt="",path_frm=None,path_frm2=None,frames=[],fdict=[],prefix_v... |
#!/usr/bin/env python
##
#
# Reinforcement-Learning Based Controller
#
##
import rospy
import random
from geometry_msgs.msg import Twist
from geometry_msgs.msg import Pose
from sensor_msgs.msg import LaserScan
from nav_msgs.msg import Odometry
from std_msgs.msg import Int8
from std_srvs.srv import Empty
from tf.trans... |
import warnings
with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=RuntimeWarning)
warnings.filterwarnings('ignore', category=FutureWarning)
import tensorflow as tf
from tensorflow.core.protobuf import config_pb2
import os
import numpy as np
from PIL import Image
from tqdm impor... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from datetime import timedelta
import unittest
import icalendar
import pytz
import re
class TestCalComponent(unittest.TestCase):
def test_cal_Component(self):
from icalendar.cal import Component, Calendar, Eve... |
# Mod Importer for SuperGiant Games' Games
import os
from collections import defaultdict
from pathlib import Path
import logging
from collections import OrderedDict
from shutil import copyfile
from datetime import datetime
import xml.etree.ElementTree as xml
can_sjson = False
try:
import sjson
... |
import requests
import json
import datetime
import azure.functions as func
import base64
import hmac
import hashlib
import os
import logging
import re
from .state_manager import StateManager
customer_id = os.environ['WorkspaceID']
shared_key = os.environ['WorkspaceKey']
slack_api_bearer_token = os.envir... |
#!/usr/bin/env python3
# Standard modules
import z3 # pip install z3-solver
# Local modules
from . import alloy
from .z3_wrapper import *
class Relation(dict):
"""A Relation.
This is a Relation within a relational model of the type that herd, Alloy,
or isla-axiomatic would use. Keys have type `tuple`... |
# coding=utf-8
# Copyright 2019 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
""" Contains LotlanTreeVisitor """
# standard libraries
from enum import Enum
import re
# local sources
from lotlan_scheduler.model.transport.transport import Transport
from lotlan_scheduler.model.transport.template import Template
from lotlan_scheduler.model.transport.instance import Instance
from lotlan_scheduler.m... |
import os
import unittest
from itertools import chain
import casex
import numpy as np
import scipy.stats as ss
from seedpod_ground_risk.core.plot_server import PlotServer
from seedpod_ground_risk.core.utils import make_bounds_polygon, remove_raster_nans
from seedpod_ground_risk.layers.strike_risk_layer impo... |
import matplotlib
matplotlib.use('Agg')
import os, sys
import yaml
from argparse import ArgumentParser
from tqdm import tqdm
import imageio
import numpy as np
from skimage.transform import resize
from skimage import img_as_ubyte
import torch
# self
_curr_path = os.path.abspath(__file__) # /home/..../face
_cur_dir = ... |
import pandas as pd
import numpy as np
import math
import cmath
import pickle
joints = ['Nose','Neck','Right_shoulder','Right_elbow','Right_wrist','Left_shoulder',
'Left_elbow','Left_wrist','Right_hip','Right_knee','Right_ankle','Left_hip',
'Left_knee','Left_ankle','Right_eye','Left_eye','Right_ear','L... |
# -*- encoding: utf-8 -*-
"""
Module to fetch ssl certificate data. Can be used by both Audit/FDG
Note: Now each module just returns its output (As Data gathering)
For Audit checks, comparison logic is now moved to comparators.
See below sections for more understanding
Note:
This module can be used i... |
#!/usr/bin/python3
import sys
import os
import argparse
import traceback
import logging
import json
import math
import random
import hashlib
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import data
from board import Board, IllegalMoveError
from genbo... |
# Copyright (C) 2013-2014 SignalFuse, Inc.
# Copyright (C) 2015 SignalFx, Inc.
#
# Docker container orchestration utility.
from __future__ import print_function
import collections
import json
import time
from docker import auth
import os
try:
import urlparse
except ImportError:
# Try for Python3
from urll... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 24 09:40:28 2018
@author: <NAME>
"""
import numpy as np
#from numpy import fft
import matplotlib.pyplot as plt
#import scipy.signal as sig
import os
import random
import emgReaderClass as erc
import threading
import multiprocessing
import dataPlotter
... |
# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
###
# This file is ``gevent._semaphore`` so that it can be compiled by Cython
# individually. However, this is not the place to import from. Everyone,
# gevent internal code included, must import from ``gevent.lock``.
# The only exception are .... |
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# MIT License
#
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without res... |
import numpy as np
import math
import os,sys
from moments.LD import Numerics
from moments.LD import Util
import copy
import moments
from moments.Misc import perturb_params
from moments.Misc import delayed_flush
from moments.LD.LDstats_mod import LDstats
from scipy.special import gammaln
import scipy.optimize
"""
Ad... |
"""
Defines a CUDA Python version of WordGraph.find_adjacent_vertices
to support fast parallel computation via an Nvidia GPU.
Functions (Pure Python):
find_adjacent_vertices, word_from_letters_list, digit_count_int,
ith_digit, letters_from_int
"""
from time import time
from math import log10, floor, fmod, c... |
# -*- coding: utf-8 -*-
import os
import re
#from text2num import text2num
# text2num has to be downloaded and in the same dir as the rest of the code
# num2words supports a wide range of languages, a list can be
# found on the webpage:
# https://pypi.python.org/pypi/num2words
import num2words
# digify is an updat... |
"""
Copyright (c) 2015 SONATA-NFV
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 agreed to... |
# Conservative Q-Learning for Offline Reinforcement Learning
# https://arxiv.org/abs/2006.04779
# https://github.com/aviralkumar2907/CQL
import copy
import torch
import numpy as np
from torch import nn
from torch import optim
from loguru import logger
from offlinerl.algo.base import BaseAlgo
from offlinerl.utils.net.... |
import numpy as np
import nibabel
import pytest
from nilearn.plotting.find_cuts import (find_xyz_cut_coords, find_cut_slices,
_transform_cut_coords,
find_parcellation_cut_coords,
find_probabilistic_a... |
#### standard provider code ####
# import the correct PROVIDER_SUBMODULE and PROVIDER_ID constants for your provider
from .constants import PROVIDER_ID
from ..constants import PROVIDER_SUBMODULE
# define common provider functions based on the constants
from ckan_cloud_operator.providers import manager as providers_ma... |
#!/usr/bin/env python
# Analyze the projects listed in a CSV file, e.g., "projects_to_examine.csv",
# producing "results.csv" that contains a collection of metrics.
# (C) 2015 Institute for Defense Analyses (IDA)
# Authors: <NAME> and <NAME>
# This code is written assuming that speed is irrelevant.
# If speed matters... |
from online_inference import SecondBackend, build_network, inference
import numpy as np
import csv
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib.patches as patches
BOX_COLOUR_SCHEME = {
'Car': '#00FF00', # Green
'Pedestrian': '#00FFFF', # Teal
'Cyclist': '#FFFF00' ... |
#
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import numpy as np
from detectron.core.config import cfg
from detectron.modeling.generate_anchors import generate_anchors
from detectron.utils.c2 ... |
# Python script to migrate all ECAS data to LabCAS
import os
from xml.etree import ElementTree as ET
import pprint
import glob
import urllib.parse
from shutil import copyfile
import xml.sax.saxutils as saxutils
import re
# FIXME
root_dir = "/home/cinquini/ECAS_MIGRATION"
#root_dir = "/Users/cinquini/data/ECAS_MIGRATI... |
import numpy as np
from numpy.linalg import norm
from ase import Atoms
from ase.data import covalent_radii
from ase.neighborlist import NeighborList
import ase.neighborlist
import scipy.stats
from scipy.constants import physical_constants
import itertools
from IPython.display import display, clear_output, HTML
import n... |
"""
@author: eagle705
https://github.com/eagle705/pytorch-bert-crf-ner/
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import torch
from pathlib import Path
from tensorflow import keras
import numpy as np
from konlpy.tag import Twitter
from collections import Counter... |
#! /usr/bin/env python3
import os,string,sys,types
instructions={}
inst_id=1
OpcodeWidth=25
Chip = 'chip'
docfname = 'documentation'
def get_inst_id():
global inst_id
x = inst_id
inst_id=inst_id+1
return x
class Instruction:
def __init__(self,Name):
self.name=Name
self.id=get_inst... |
from algorithms.backtrack import (
add_operators,
permute,
permute_iter,
anagram,
array_sum_combinations,
unique_array_sum_combinations,
combination_sum,
get_factors,
recursive_get_factors,
find_words,
generate_abbreviations,
generate_parenthesis_v1,
generate_parenthe... |
#
# Copyright (c) 2018, Salesforce, Inc.
# The Board of Trustees of the Leland Stanford Junior University
# 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 ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from . import resnet, resnext
try:
from lib.nn import SynchronizedBatchNorm2d
except ImportError:
from torch.nn import BatchNorm2d as SynchronizedBatchNorm2d
class SegmentationModuleBase(nn.Module):
def __init__(self):
... |
# Copyright (c) 2015 SONATA-NFV, 2017 5GTANGO
# 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 ... |
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Oct 26 2018)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################
impor... |
'''
doAzureParallel Getting Started script
'''
import sys
import threading
import time
import uuid
import json
import string
import random
from azure.common import credentials
from azure.graphrbac import GraphRbacManagementClient
from azure.graphrbac.models import ApplicationCreateParameters, PasswordCredential, Se... |
import torch
from torch import nn
import numpy as np
import cv2
### FB Global Reasoning Block ###
# From: https://github.com/facebookresearch/GloRe
class GCN(nn.Module):
""" Graph convolution unit (single layer)
"""
def __init__(self, num_state, num_node, bias=False):
super(GCN, self).__init__()
... |
# Copyright 2015 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... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from .dsnt import spatial_softmax2d, spatial_expectation2d
from cirtorch.utils.grid import create_meshgrid, create_meshgrid3d
from ..conversions import normalize_pixel_coordinates, normalize_pixel_coordinates3d
from cirtorch.features.nms import nms3d
f... |
import os
from pathlib import Path
from typing import Tuple
import boto3
from botocore.client import Config
import gzip
import re
from uuid import uuid4
import json
import query_string
import smart_open.s3
import shutil
import tempfile
import io
from urllib.parse import urlencode
import logging
from .__util_versioned... |
import subprocess
import os
import re
import csv
import contextlib
from datetime import datetime, timedelta
import time
import progressbar
import boto3
import psycopg2
from db_migration.db_migration_lib.helper import RDSHelper, S3Helper, PGHelper, DATALAKE_NAME, logger, DATABASE_TAGS, INSTANCE_TAGS, TABLE_TAGS
"""
T... |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 et:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ### ... |
import logging
import re
import io
import os
from pathlib import Path
from typing import List, Union, Optional, Sequence, Dict, Any, Tuple
import flair
import json
import gdown
import conllu
from flair.file_utils import cached_path
from flair.datasets.conllu import CoNLLUCorpus
log = logging.getLogger("flair")
def ... |
"""Train the full model.
python im_caption_full.py --multi_gpu --batch_size 512 --save_checkpoint_steps\
1000 --gen_lr 0.001 --dis_lr 0.001
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import os
import sys
import numpy as np
impo... |
# -*- encoding: utf-8
"""
Editor class for extending viewer with text editing features.
"""
from . import helpers
from .line import Line
from .cursor import Cursor
from .viewer import Viewer
class State:
"""Store editor state for undo/redo."""
def __init__(self, editor=None):
self.cursors = [Cursor... |
"""
Module to make chemical models. Take messages from RabbitMQ queue,
process it and send data to linked blob storage.
"""
import json
import os
import shutil
import requests
from MLLogger import BaseMLLogger
from exception_handler import MLExceptionHandler
from general_helper import (
get_oauth, fetch_token, g... |
# -o--
"""
MOSMusic.py (module)
Initial focus: Generate MIDI scale sequences.
PUBLIC ENUMS--
. Key
. MIDINote
. Direction
. ModeNames
PUBLIC DICTIONARIES--
. Modes
. ModesAddition... |
"""Provides the Analysis related classes."""
from .base import Base
from pathlib import Path
from functools import partial
import datetime
import tempfile
import requests
from .utils import build_model, attempt_to_import
import tqdm
import time
import re
import json
altair = attempt_to_import('altair')
nib = attempt_t... |
import datetime
import json
import logging
import pytz
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import models
from django.utils import timezone
from . exceptions import InconsinstentSessionDump
from . utils import aware_dt_from_timestamp
logger = logging.getLog... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_equal
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.units import Quantity, Unit
from gammapy.maps import HpxGeom, HpxNDMap, Map, MapAxis, T... |
import uuid
import re
import sys
import textwrap
import time
import yaml
import sublime
import sublime_plugin
if sys.version_info < (3,):
from ordereddict import OrderedDict
from sublime_lib.path import root_at_packages, get_package_name
from sublime_lib.view import (OutputPanel, base_scope, get_viewpor... |
from enum import Enum
from typing import Callable
from ..types import TealType
from ..errors import TealInputError
from ..ir import TealOp, Op, TealBlock
from .leafexpr import LeafExpr
from .int import EnumInt
from .array import Array
class TxnType:
"""Enum of all possible transaction types."""
Unknown = Enum... |
# Copyright © 2019 Province of British Columbia
#
# 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 agr... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import sys
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
sys.path.append(os.path.join(ROOT_DIR, 'utils'))
from .losses import smoothl1_loss, l1_loss, SigmoidFocalClassificationLo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.