text stringlengths 6.04k 39.5k |
|---|
# -*- coding=utf-8 -*-
##############################################################
# description:
# data augmentation for obeject detection
# author:
# maozezhong 2018-6-27
# https://github.com/maozezhong/CV_ToolBox/blob/master/DataAugForObjectDetection/DataAugmentForObejctDetection.py
######################... |
#+
# Name:
# GRIDRAD Python Module
# Purpose:
# This module contains three functions for dealing with Gridded NEXRAD WSR-88D Radar
# (GridRad) data: reading (read_file), filtering (filter), and decluttering (remove_clutter).
# Author and history:
# <NAME> 2017-07-03.
# Edited: <NAME> 2020-04-02
# Warning:
# The... |
# TREC Question classifier
# Dataset : https://cogcomp.seas.upenn.edu/Data/QA/QC/
# Report : https://nlp.stanford.edu/courses/cs224n/2010/reports/olalerew.pdf
# Method: Used SVM to classify the questions
# Code: https://github.com/amankedia/Question-Classification/blob/master/Question%20Classifier.ipynb
import pandas... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Simple Bot to reply to Telegram messages
# This program is dedicated to the public domain under the CC0 license.
"""
This Bot uses the Updater class to handle the bot.
First, a few callback functions are defined. Then, those functions are passed to
the Dispatcher and r... |
"""Includes all object classes that appear in-game"""
import json
import random
from copy import deepcopy
from pathlib import Path
from typing import Callable, Optional
from blessed import Terminal
def four_way_junction_matcher(entrances_exits: list[bool]) -> Optional[dict]:
"""Check existence of 4-way-junction"... |
import cellularAutomata #self-referencing cellular automata
import operator #To get key with maximum value.
class polisherException(Exception):
pass
space_identifiers = {
0:'0',
1:'1',
2:'2',
3:'3',
4:'4',
5:'5',
6:'6',
7:'7',
8:'8',
9:'9',
10:'A',
11:'B',
12:'C... |
##_____________________________________project1
# Lesson: Curate a Dataset
def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT t... |
from django.http import JsonResponse
import requests
import asyncio
import aiohttp
import numpy as np
import pandas as pd
from pandas import json_normalize
import json
from functools import reduce
import unidecode
from random import randint
from time import sleep
import traceback
import sys
import random
import... |
import re
import os
import json
from collections import defaultdict, OrderedDict
import numpy as np # pylint: disable=import-error
import scipy.stats as stats
from scipy.cluster import hierarchy
import pandas as pd # pylint: disable=import-error
import tensorflow as tf # pylint: disable=import-error
from sklearn.fea... |
# -*- coding: utf-8 -*-
# Copyright: (c) 2021, <NAME> (@jborean93) <<EMAIL>>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
import logging
import typing
import uuid
from xml.etree import ElementTree
from psrpcore._crypto import PSRemotingCrypto
from psrpcore._events import PSRPEvent, SessionCapabi... |
import yaml
import time
import datetime
import threading
import os
import re
import string
import urllib
from base64 import b64encode
from datetime import timezone
from jinja2 import Environment, FileSystemLoader, select_autoescape
from kubernetes import client, config
from portal import logger
from portal import app
... |
import sys
import ctypes as ct
import os.path
import config.config as c
import NuToPos as ntp
import rdbparse as rp
import playDarts as pd
import GetNRCDailyInfo as nrc
import distance as sd
import dailyparse as dp
import numpy as np
import ArgParser as p
import PhysicsConstants as pc
basepath = os.path.dirname(__fi... |
"""
Plot training results for regression and classification tasks on both
sequence-mapped and residue-mapped data.
.............................................................................
idptools-parrot was developed by the Holehouse lab
Original release ---- 2020
Question/comments/concerns? Raise an issu... |
PACKAGE = 'herbpy'
import logging
import numbers
import prpy
import prpy.rave
import prpy.util
import yaml
import subprocess
from .barretthand import BarrettHand
from .herbbase import HerbBase
from .herbpantilt import HERBPantilt
from .wam import WAM
from prpy import Cloned
from prpy.action import ActionLibrary
from pr... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# ------------------------------------------------------------------------------
from __future__ import absolute_import
from __future__ import divis... |
""" Metadata Template Language (MTL) parser """
# This parser forms the basis for the template system used by osxphotos, exif2findertags, and autofile
# ZZZ add way to get help for built-ins, add mtlparser.md
import pathlib
import re
import shlex
from typing import Any, Callable, List, Optional
from textx import Te... |
# coding=utf-8
# Copyright 2019 DeepMind Technologies Limited.
#
# 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 applic... |
from isitfit.cost.ec2_analyze import Ec2Iterator
from isitfit.utils import logger
import pandas as pd
from tabulate import tabulate
import tempfile
import csv
from collections import OrderedDict
# https://pypi.org/project/termcolor/
from termcolor import colored
def df2tabulate(df):
return tabulate(df.set_i... |
#!/usr/bin/env python
"""
Generic python script.
"""
__author__ = "<NAME>"
import matplotlib
import pylab as plt
import numpy as np
import ephem
import healpy as hp
import scipy.ndimage as nd
import cartopy.crs as ccrs
from shapely.geometry.polygon import Polygon, LineString
from mpl_toolkits.axes_grid1.inset_locator... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import argparse
import os
import platform
import re
import shutil
import subprocess
import sys
import warnings
import setuptools
from distutils.core import Command
from Cython.Distutils import build_ext as _build_ext
__package__ = 'pydriver'
... |
#!/usr/bin/env python3
# Copyright (c) 2019 <NAME>, <EMAIL>
#
# 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, mo... |
import sqlite3
import os
from dotenv import load_dotenv
import datetime
load_dotenv()
def createSubjectTable():
conn = sqlite3.connect('checktt.db', check_same_thread=False)
db = conn.cursor()
table = """ CREATE TABLE IF NOT EXISTS sub (
id INTEGER PRIMARY KEY,... |
import mosek
from geometry import Ellipsoid
import numpy as np
def extract_solution(dim, xx, barx, n, ndx_d):
bar_ndx = 0
ellipsoid = Ellipsoid(dim, np.zeros((dim, dim)), np.zeros(dim))
for j in range(2 * n):
for i in range(j, 2 * n):
if j < dim and i < dim:
ellipsoid.s... |
import h5py
import json
import lmfit as lm
import os
import numpy as np
import XPyS
import XPyS.config as cfg
from .helper_functions import index_of
from lmfit.models import GaussianModel, LorentzianModel, PseudoVoigtModel, SkewedVoigtModel
def find_files(filename, search_path):
result = []
# Wlaking top-dow... |
#!/usr/bin/env python
from bs4 import BeautifulSoup
import codecs
from collections import defaultdict, OrderedDict
import copy
from git import Repo
import glob
from le_utils.constants import licenses, content_kinds, file_formats
import hashlib
import json
import logging
import markdown2
import ntpath
import os
from pa... |
'''Compute peak prominence on 2d array using contour method.
Compute topographic prominence on a 2d surface. See
https://en.wikipedia.org/wiki/Topographic_prominence
for more details.
This module takes a surface in R3 defined by 2D X, Y and Z arrays,
and use enclosing contours to define local maxima. The prominen... |
import torch
from mmcv.runner import force_fp32
from torch.nn import functional as F
import numpy as np
import numba
import cv2
from mmdet3d.core import bbox3d2result, merge_aug_bboxes_3d, draw_heatmap_gaussian, gaussian_radius
from mmdet3d.ops import Voxelization
from mmdet.models import DETECTORS
from .. import buil... |
# -*- coding: utf-8 -*-
# Copyright 2016 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 that contains unittests for patch_series module."""
from __future__ import print_function
import contextlib
import moc... |
# Import libaries
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import re
import geopy
from geopy.geocoders import Nominatim
from geopy.exc import GeocoderTimedOut
import geocoder
import time
import requests
from bs4 import BeautifulSoup
import jellyfish as jf # http... |
#!/usr/bin/env python
from __future__ import print_function
from builtins import chr
from builtins import str
import argparse
import time
import json
import sys
import os
import subprocess
from subprocess import PIPE, Popen, CalledProcessError
import xml.etree.ElementTree as ET
from datetime import datetime, timedelta... |
from learning_to_adapt.dynamics.core.layers import MLP
from collections import OrderedDict
import tensorflow as tf
import numpy as np
from learning_to_adapt.utils.serializable import Serializable
from learning_to_adapt.utils import tensor_utils
from learning_to_adapt.logger import logger
import time
class MetaMLPDyna... |
from __future__ import print_function
from __future__ import division
import sys
import time, code
###code.interact(local=dict(globals(), **locals()))
import numpy as np
from copy import deepcopy
import tensorflow as tf
from attention_gru_cell import AttentionGRUCell
from tensorflow.contrib.cudnn_rnn.python.ops imp... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import ftrobopy
import webthing
import threading
import asyncio
import uuid
import os
from pathlib import Path
import cv2
import time
import tornado.web
from tornado.httpclient import AsyncHTTPClient, HTTPRequest
from tempfile import TemporaryDirectory
from To... |
# Copyright (c) 2017, 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... |
import torch
from torch.utils.data import Dataset, DataLoader
import torch.nn as nn
from torch.nn import functional as F
from torchvision import transforms as tfs
from torchvision import models
from matplotlib import pyplot as plt
from datetime import datetime
from PIL import Image
import numpy as np
import os
import s... |
import pandas as pd
from lifelines import KaplanMeierFitter, CoxPHFitter
import numpy as np
from sklearn.exceptions import ConvergenceWarning
from multiprocessing import Pool
import numpy as np
import functools
from .correlation import intersection, header_list
import plotly
import plotly.offline as opy
from sklearn.pr... |
from dataclasses import dataclass, field
from typing import Dict, List, Union, Optional
from raytkUtil import RaytkContext
# noinspection PyUnreachableCode
if False:
# noinspection PyUnresolvedReferences
from _stubs import *
from _typeAliases import *
class _Par(ParCollection):
Showedit: 'BoolParamT'
class _CO... |
"""Template Tags for DumpDie"""
import inspect
import pytz
import re
import types
from decimal import Decimal
from django import template
from django.forms.boundfield import BoundField
from django_dump_die.constants import (
SIMPLE_TYPES,
INTERMEDIATE_TYPES,
ADDITIONAL_SIMPLE_TYPES,
ADDITIONAL_INTER... |
import os
# import json
# import ujson as json
import msgpack
import rapidjson as json
import gzip
import numpy as np
import gc
from enum import IntEnum
import copy
import collections
class Image(IntEnum):
ID = 0
WIDTH = 1
HEIGHT = 2
ANNOTATION_COUNT = 3
class Annotation(IntEnum):
ID = 0
IMA... |
import os
import sys
import cv2
import torch
from torchvision import transforms
import json
import shutil
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import math
import datetime
from collections import OrderedDict
import models
sys.path.append(os.getcwd())
cmap = plt.cm.viridis
def raw_... |
"""
NCBImeta Conftest
This is the pytest fixture file.
@author: <NAME>
"""
# -----------------------------------------------------------------------------#
# Modules and Packages #
# -----------------------------------------------------------------------------#
... |
import xml.etree.ElementTree as et
import numpy as np
import pandas as pd
from nltk import (word_tokenize, pos_tag)
from nltk.corpus import sentiwordnet as swn
from nltk.metrics import edit_distance
import hunspell
import re
from tqdm import tqdm
import argparse
import sys
import config as cf
# def parse2014AspectTerm... |
#!/usr/bin/env python
from __future__ import unicode_literals
import operator
import random
import re
import sys
from xml.sax import saxutils
class FrameSample:
"""Represents sampling results for a single frame within a thread trace."""
def __init__(self, frame, sample_count):
self.frame = frame
... |
import numpy as np
import cv2 # OpenCV???C?u????
import matplotlib.pyplot as plt
import torch
import torch.utils.data as data
from itertools import product as product
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torch.autograd import Function
# In[2]:
d... |
"""
Material.
Classes to create and manage music materials and lyrics.
"""
import abjad
from itertools import cycle
class Lyrics:
"""Lyrics."""
def __init__(self, target):
"""Initializer."""
self.lyrics = None
self.target = target
self.name = target + "_Lyrics"
def write... |
import sys
import re
import typing
from PyQt5 import QtCore, QtGui
from PyQt5.QtGui import (QBrush, QClipboard, QColor, QMouseEvent, QPainter,
QPainterPath, QPen)
from PyQt5.QtWidgets import QMenu
from Common import BS, TR
from MapData import MapDataRenderer, MapData, MapDataElement
class S... |
# This script uses tasks and tools that are built inside CASA,
# so it has be run within it. import will not work for the same reason,
# so it has be run using execfile().
import numpy as np
import os
import vis_tools
import scipy.ndimage
# from simutil import simutil
# for CASA 6
from casatasks.private.simutil import ... |
#!/usr/bin/python3
"""
HyDE Downloading Tool - NWP GFS 0.25 historical downloader
__date__ = '20210618'
__version__ = '1.0.0'
__author__ =
'<NAME> (<EMAIL>',
'<NAME> (<EMAIL>',
'<NAME> (<EMAIL>',
__library__ = 'HyDE'
General command line:
python3 hyde_downloader_nwp_gfs_historical.py -setting... |
#!/usr/bin/env python
"""
model.py
Self defined model definition.
Usage:
"""
from __future__ import absolute_import
from __future__ import print_function
import sys
import numpy as np
import torch
import torch.nn as torch_nn
import torch.nn.functional as torch_nn_func
import core_scripts.other_tools.debug as nii_d... |
"""
A collection of GP kernels that express the autovariance structure of CARMA models using
celerite.
"""
import numpy as np
from celerite import terms
from numba import njit, float64, complex128, int32, vectorize
import warnings
__all__ = ["acf", "DRW_term", "DHO_term", "CARMA_term"]
@njit(complex128[:](complex1... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Implement DQN model for training on kingsoopers dataset.
References:
* https://pytorch.org/tutorials/intermediate/reinforcement_q_learning.html
* https://pytorch.org/tutorials/beginner/basics/buildmodel_tutorial.html
* https://pytorch.org/tutorials/recipes/recip... |
# Copyright (c) 2020-2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
"""Support molecules in Tripos MOL2 format.
For further information look at (web page exists: 25 August 2005):
http://www.tripos.com/index.php?family=modules,SimplePage,,,&page=sup_mol2&s=0
"""
import logging
from collections import OrderedDict
from itertools import combinations
from numpy import array
from nu... |
#hargain author :) jangan diganti ya!
#Boleh ubah headers, pw list dan lain" tapi mohon jangan ubah author asli hhe ane buatnya 1 mingguan semoga di mengerti :)
#hubungin saya jika itu penting :
#WhatsApp : 083870396203
#Facebook : <NAME>
author = 'Latip176' #author utama
#libary / module import
import requests as req... |
import flask
from flask import request, Flask, make_response
import json
import traceback
import io
import uuid
import os
import subprocess
import re
import copy
import hashlib
import functools
app=Flask(__name__)
def event_selector(json_data):
#...do the gen here
thisdir=os.path.dirname(os.path.realpath(_... |
"""
=======================================================================================
Utility functions for a Boost Graph Library (BGL) DiGraph via the BGL Python Bindings
"""
import itertools
import pickle
from rdflib import (
BNode,
Namespace,
)
from rdflib.graph import Graph
from rdflib.collection ... |
# pylint: disable=E1101
"""pygame interaction with Santorini game."""
import pygame
import pygame.freetype
from button import Button
from game import Game
from santorini_player import SantoriniPlayer
# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 200, 0)
BLUE = (0, 0, 255)
RED = (255, 0, ... |
#from matplotlib.figure import Figure
import plotly.express as px
import plotly.graph_objects as go
from collections import OrderedDict
import numpy as np
def make_figure(df,pa):
"""Generates figure.
Args:
df (pandas.core.frame.DataFrame): Pandas DataFrame containing the input data.
pa (dict)... |
#!/usr/bin/env python
#===============================================================================
# Copyright 2017 Geoscience Australia
#
# 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... |
import torch
from torch.utils.data import TensorDataset
from torch.utils.data import DataLoader
from torch import nn
import numpy as np
import collections
import random
import re
import copy
import datetime
import traceback
TOKEN_RE = re.compile(r'[\w\d]+')
char_vocab = {' ': 1,'!': 82,'"': 89,'%': 88,'(': 67,')': 6... |
"""
.. _logs:
Log File Analysis (experimental)
================================
Logs contain very detailed information about events happening on computers.
And the extra details that they provide, come with additional complexity that
we need to handle ourselves. A pageview may contain many log lines, and a
session ca... |
# This file is part of qdpy.
#
# qdpy 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, either version 3 of
# the License, or (at your option) any later version.
#
# qdpy is distributed ... |
from base64 import b64encode, b64decode
from ctypes import addressof, c_ubyte, create_string_buffer, c_size_t
from ctypes import c_void_p, c_long, c_longlong, c_ulong, c_ulonglong, POINTER, cast, string_at
from ctypes import windll, Structure, sizeof, WINFUNCTYPE, pointer, byref, c_uint, c_int, c_char, c_wchar, memmove... |
#!/usr/bin/env python
import copy
import logging
import sys
from abc import ABCMeta, abstractmethod
from random import Random
from events.event import EventResult
from models.yarn.objects import YarnRunningContainer, YarnContainerType, YarnResource, YarnErrorType, YarnErrorMode
from stats.decisions import YarnSchedule... |
import socket
import time
from io import BytesIO
from random import randint
from unittest import TestCase, skip
from block import BlockHeader
from helper import (
double_sha256,
encode_varint,
int_to_little_endian,
little_endian_to_int,
bytes_to_ip,
ip_to_bytes,
read_varint,
)
TX_DATA_TYP... |
#!/usr/bin/env python3
import pandas as pd
import ruamel.yaml
from ruamel.yaml import YAML
import glob
import re
from collections import defaultdict
import argparse
import os
from schema_utils import stripper
tosave = set()
noderows = 0
propertyrows = 0
def get_params():
parser = argparse.ArgumentParser(descrip... |
from pydoc import locate
import sys
import numpy as np
import math
import copy
import random
import time
import torch
import matplotlib.pyplot as plt
import itertools
import es_maml
from es_maml import policies
from es_maml import tasks
def create_per_parameter_learning_rates(net,config):
... |
from database.models import UserProfile, CommunityMember, EventAttendee, RealEstateUnit, Location, UserActionRel, Vendor, Action, Data, Community
from _main_.utils.massenergize_errors import MassEnergizeAPIError, InvalidResourceError, ServerError, CustomMassenergizeError, NotAuthorizedError
from _main_.utils.massenergi... |
import numpy as np
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
import implicit_maml.utils as utils
import datetime
from collections import deque
from logger import Logger
from tensorboardX import SummaryWriter
import os
import time
from torch.nn import functional as F
from iq_learn.make_envs im... |
from __future__ import annotations
import bisect
import logging
import re
import warnings
from concurrent.futures.thread import ThreadPoolExecutor
from functools import partial
from hashlib import sha224 as hash_algorithm
from pathlib import Path
from time import sleep
from typing import Any, Callable, Dict, List, Opt... |
import math
import torch
import torch.nn as nn
from utils import get_laplacian
from torch.nn.parameter import Parameter
from torch.functional import F
def chebyshev_convolution(laplacian, signal, weights, k, t0, act_func):
# (num_nodes, num_nodes) x (batch_size, num_nodes, in_feat) x (c_in, c_out)
... |
"""
.. module:: lidar_tour
:platform: Windows
:synopsis: Example starting in west_coast_usa with a vehicle that has a
Lidar attached and drives around the environment using the
builtin AI. Lidar data is displayed using the OpenGL-based
Lidar visualiser.
.. moduleaut... |
# ECOR 1051 Milestone 3 P8: Final Filter Function Code
# Team 109
# Date of Submission: April 2, 2020
# Team Members:
# <NAME> 101143478 (Team Leader)
# <NAME> 101148917
# <NAME> 101150112
from Cimpl import *
from simple_Cimpl_filters import grayscale
#Red Filter Function
def red_channel(image: Image) -> Image:
... |
# coding: utf-8
# In[1]:
import os
os.environ['KERAS_BACKEND'] = 'tensorflow'
os.environ['CUDA_HOME'] = '/usr/local/cuda-7.5'
# In[2]:
import numpy as np
import tensorflow as tf
from keras.datasets import cifar10
from keras.layers import Dense, Dropout, Activation, Flatten, Lambda, BatchNormalization
from kera... |
import asyncio
import logging
from collections import defaultdict, deque
from datetime import datetime, timedelta
from typing import (Awaitable, Callable, Dict, Generic, List, Optional, Tuple,
TypeVar)
from bot.bot import MasarykBOT
from bot.cogs.utils.context import Context
from bot.cogs.utils.db ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 10 15:59:55 2018
@author: branko
"""
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import os
import matplotlib.pyplot as plt
plt.rcParams['image.cmap'] = 'jet'
mnist = input_data.read_data_se... |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... |
# -*- coding: utf-8 -*-
# Copyright (C) 2005 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
import struct
from struct import unpack, pack
from warnings import warn
fro... |
# read_hst.py
import os
import numpy as np
import pandas as pd
from scipy import integrate
import matplotlib.pyplot as plt
import astropy.units as au
import astropy.constants as ac
from ..io.read_hst import read_hst
from ..load_sim import LoadSim
class Hst:
@LoadSim.Decorators.check_pickle_hst
def read_hst(... |
import numpy as np
import scipy.signal
import copy
import warnings
from scipy import stats
from functools import lru_cache
import multiprocessing as mp
from functools import partial
import itertools
L = 5
J = 5
lowH = 1e-11
upH = 1e10
upr = 250
upk = 100
lowU = 1e-12
neighborhood = 1e-8
Sigma = 0... |
# coding=utf-8
# Copyright 2018 Google LLC & <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 o... |
import argparse
import json
from abc import ABC, abstractmethod
from enum import Enum
from typing import NamedTuple, Union, Optional, List, Dict, Tuple
import requests
from uqcsbot import bot, Command
from uqcsbot.api import Channel
from uqcsbot.utils.command_utils import loading_status, UsageSyntaxException
BASE_UR... |
"""Networking module"""
from __future__ import absolute_import
from ipaddress import ip_network
import copy
from functools import partial
import os
import time
import yaml
import logger
from topology import FaucetTopology
from env import DAQ_RUN_DIR
from mininet import node as mininet_node
from mininet import net a... |
# coding=utf-8
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
import json
from importlib import import_module
import logging
from pathlib import Path
import pkg_resources
import shutil
import sys
import tarfile
from furl import furl
import requests
from semver import max_satisfying
from django.apps import apps
from django.utils.encoding import (
force_bytes, force_text, pyt... |
from __future__ import division
import logging
logging.basicConfig(level=logging.WARNING)
class ObjectWithID(object):
_id = 0
_local_id_start = 1
def __init__(self):
self.local_id = type(self).get_local_id()
self.id = ObjectWithID._id
ObjectWithID._id += 1
@classmethod
d... |
#!/usr/bin/env python
# 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
#
# Authors:
# - <NAME>, <EMAIL>, 2018-2019
import os
import time
import sign... |
from django import forms
from .models import TimewebModel, SettingsModel
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from colorfield.widgets import ColorWidget
import datetime
from allauth.socialaccount.forms import SignupForm as SocialaccountSignupForm, Disco... |
# Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# OS and shell utility functions
#
import collections.abc
import errno
import getpass
import grp
import os
import re
import... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
#!/usr/bin/env python3
import datetime
import shutil
import uuid
from io import BytesIO
from pathlib import Path
from dateutil.parser import parse
from ukis_pysat.stacapi import StacApi
try:
import landsatxplore.api
import numpy as np
import pystac
import requests
import sentine... |
import re
import json
import random
import logging
import threading
from binascii import crc32
from requests.models import Response
from localstack import config
from localstack.utils.aws import aws_stack
from localstack.utils.common import to_bytes, to_str, clone
from localstack.utils.analytics import event_publisher
... |
# ElectrumSV - lightweight Bitcoin client
# Copyright (C) 2019 ElectrumSV 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 ... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
r"""
Frieze Patterns
This implements the original frieze patterns due to Conway and Coxeter.
Such a frieze pattern is considered as a sequence of nonnegative
integers following [CoCo1]_ and [CoCo2]_ using
:class:`sage.combinat.path_tableaux.path_tableau`.
AUTHORS:
- <NAME> (2019): initial version
"""
#**************... |
import unittest
import os
import time
# import itertools
from pprint import (
pprint,
pformat
)
from FuXi.DLP import non_DHL_OWL_Semantics # , MapDLPtoNetwork
from FuXi.DLP.ConditionalAxioms import AdditionalRules
from FuXi.Horn.HornRules import HornFromN3
from FuXi.Horn.PositiveConditions import BuildUnit... |
"""As an open source project, we collect usage statistics to inform development priorities.
For more information, check out the docs at https://docs.dagster.io/install/telemetry/'
To see the logs we send, inspect $DAGSTER_HOME/logs/ if $DAGSTER_HOME is set or ~/.dagster/logs/
See class TelemetryEntry for logged field... |
from time import time
import json
import hashlib
import re
from cryptonote.address import validate
from .constants import *
from .errors import *
from . import database, credit, blocks, fee, wallet, daemon, rpc, log
def record_payment(uid, txid, time, amount, fee):
"""Record payment"""
try:
database.... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
TRAIN_NUM_SAMPLES = 10
TEST_NUM_SAMPLES = 50
EPSILON = 1e-8 # Small value to avoid divide-by-zero and log(zero) problems
def concatenate_flattened(tensor_list) -> torch.Tensor:
"""
Given list of tensors, flattens each and concat... |
# Copyright 2022 The Flax 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 applicable law or agreed to in wri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.