text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# System libs
import json
import argparse
# import scipy.stats
from pandas.io.json import json_normalize
import plotly.graph_objs as go
import plotly.offline as plotly
import plotly.figure_factory as ff
colors = {'pref': 'rgb(85, 239, 196)', '1': 'rgb(255, 201, 26)', '... |
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
# pass in column names for each CSV as the column name is not given in the file and read them using pandas.
# You can check the column names from the readme file
#Reading users file:
u_cols = ['user_id', 'age', 'sex', 'occupation... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import logging
import time
import os
import numpy as np
import cv2
from PIL import Image
import torch
from tqdm import tqdm
from maskrcnn_benchmark.data.datasets.evaluation import evaluate
from ..utils.comm import is_main_process, get_world_size
... |
import json
import matplotlib.pyplot as plt
import numpy as np
from qiskit.quantum_info import Pauli
import matplotlib.patches as mpatches
GREEN = '#4a804f'
RED = '#db4059'
optimal = "0000010101"
correct_solutions = ['0110100011', '0000010101', '0101101010', '0001110001', '0011111000', '0100001110', '0010011100']
font... |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
def histogram(data, columns, log=False):
"""Create histograms for a list of continuous variables."""
fig = plt.figure(figsize=(16, 8))
sns.set_style('whitegrid')
for i, col in enumerate(columns, 1):
plt.subplot(1, len(co... |
#!/usr/bin/env python3
# Copyright (c) 2004-present Facebook All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from typing import Dict, Iterator, Optional
from psym._utils import get_graphql_property_inputs
from psym.client import SymphonyClient... |
import sys
from PySide2 import QtWidgets
from PySide2.QtUiTools import QUiLoader
from PyQt5.QtWidgets import QApplication, QLineEdit, QPushButton, QMainWindow, QDialog, QCheckBox, QMessageBox
from PyQt5.QtCore import QFile, QObject
from selenium import webdriver
from PyQt5 import QtGui, QtCore
from PyQt5 import uic
im... |
""" Non-negative matrix factorization for I divergence
This code was originally written as an alternative to the implementation
of NMF for Frobenius error minimization in the scikit-learn project.
This file is a standalone version of that code.
See http://github.com/omangin/scikit-learn/tree/klnmf
... |
from nonebot.typing import T_State
from nonebot.adapters.cqhttp import Bot, MessageEvent
from nonebot import on_command
from .util import UserExistLimiter, is_number
from .data_source import get_pixiv_urls, download_pixiv_imgs, search_pixiv_urls
import time
from nonebot.adapters.cqhttp.exception import NetworkErr... |
# Copyright (c) 2018-2019, NVIDIA CORPORATION. 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 a... |
import os
import re
from math import ceil, sqrt
import numpy as np
from AO import AtomicOrbital
from constants import ATOMLIST
ALLOWED_XOS = "AO PAO PNAO NAO PNHO NHO PNBO NBO PNLMO NLMO MO NO"
ALLOWED_MS = "S DM F DI K V"
ALLOWED_MATRICES = \
'''
AOPAO AOPNAO AOPNHO AOPNBO AOPNLMO AOMO AONO AONAO AONHO... |
import os
import torch
from torch import nn
import torch.utils.data
from tqdm import tqdm
from torchvision.models.inception import inception_v3
import numpy as np
from sklearn.metrics.pairwise import polynomial_kernel
from scipy import linalg
import sys
from .inception import InceptionV3
class Identity(nn.Module):... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from pprint import pprint
import pytest
from ibm_zos_ims.tests.functional.module_utils.ims_test_gen_utils import PSBInputParameters as ip
__metaclass__ = type
GEN_FAIL_MSG = 'FAILURE - PSBGEN execution unsuccessful'
SOURCE = i... |
# -*- coding: utf-8 -*-
#
# This file is part of Radicale Server - Calendar Server
# Copyright © 2008 <NAME>
# Copyright © 2008 <NAME>
# Copyright © 2008-2015 <NAME>
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free... |
from PIL import Image
import sys
from filestream import format_identifier
from bitarray import bitarray
class Encoder:
def __init__(self, imageUrl):
self.originalArr = []
self.resultArr = []
image = Image.open(imageUrl)
self.width = image.width
self.height = image.height
... |
#!/usr/bin/env python
# coding: utf-8
#this is the python script version of the jupyter notebooks that I used to create the models.
# It's a lot easier to iterate in a jupyter notebook than in a script.
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# ... |
from __future__ import print_function
import sys
import grpc
import json
import logging
import numpy as np
from typing import Dict, List, Any, Union, Optional
sys.path.append('./vearchpb')
import data_model_pb2
import errors_pb2 as epb
import router_grpc_pb2 as rpb
import router_grpc_pb2_grpc as pb
class DocKeyNotFo... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... |
"""Utilities modules"""
from __future__ import print_function
import logging
import random
import numpy as np
import torch
import torch.nn as nn
import torchtext
from model import LMModel
PAD_WORD = "<blank>"
UNK_WORD = "<unk>"
UNK = 0
BOS_WORD = "<s>"
EOS_WORD = "</s>"
logger = logging.getLogger(__name__)
def bui... |
"""
Plot Kato-Phillips test case results:
- Mixed layer depth versus time
- Vertical profiles of variables at the end of the simulation
"""
from thetis import *
from katophillips import katophillips_test as run_test
from katophillips import depth
import matplotlib
import matplotlib.pyplot as plt
from collections impor... |
from sympy import (
symbols,
re,
im,
sign,
I,
Abs,
Symbol,
cos,
sin,
sqrt,
conjugate,
log,
acos,
E,
pi,
Matrix,
diff,
integrate,
trigsimp,
S,
Rational,
)
from sympy.algebras.quaternion import Quaternion
from sympy.testing.pytest import ... |
import os
import pandas as pd
from .structures import AddrMap, Pca
__version__ = "0.0.5"
P, C, R = 0, 1, 2
pwd_path = os.path.abspath(os.path.dirname(__file__))
pcr_path = os.path.join(pwd_path, 'pcr.csv')
def _data_from_csv(pca_path: str):
province_map = {}
city_map = AddrMap()
area_map = AddrMap()
... |
import asyncio
import re
import discord
from discord.ext import commands
import requests
from bs4 import BeautifulSoup
timeout = True
class Toaru(object):
def __init__(self):
self.base_value = [2,4,6,8,10]
def kakera(self,want,assigment_value,detail):
total = 0
... |
#!/usr/bin/env python
DESC = """
__ __ _ _____ _
| \/ | (_) | __ \ (_)
| \ / |_ _ ___ _ ___| |__) |___ _ __ __ _ _ _ __
| |\/| | | | / __| |/ __| _ // _ \ '_ \ / _` | | '__|
| | | | |_| \__ \ | (__| | \ \ __/ |_) | (_| | | |
... |
import cloud_hal.storage
from iso639 import languages
from urllib.request import urlopen
from smart_open import open
from gtts import gTTS
import os
import sys
import gzip
import shutil
import csv
import logging
logger = logging.getLogger(__name__)
logging.getLogger("gtts.tts").setLevel(logging.CRITICAL)
logging.... |
import json
import re
import __ids__
import options
import survey_exceptions as se
import blocks
__qGen__ = __ids__.IdGenerator("q_")
__likert__ = "likert"
__checkbox__ = "checkbox"
__oneof__ = "oneof"
__instruction__ = "instruction"
__freetext__ = "freetext"
qTypes = [__likert__, __checkbox__, __oneof__, __instructi... |
from ItemsClass import Items
class Character:
"""Character master class"""
def __init__(self, base_speed, base_attack, base_defense, base_hp, race):
self.base_speed = base_speed
self.base_attack = base_attack
self.base_defense = base_defense
self.base_hp = base_hp
se... |
import os
import sys
import copy
import numpy as np
from scipy.interpolate import interp1d
from optparse import OptionParser, OptionGroup
from pos_parameters import filename_parameter, string_parameter, list_parameter, value_parameter, filename
from pos_wrapper_skel import generic_workflow
import pos_wrappers
class ... |
import xml.etree.ElementTree as ET
import os
import json
import argparse
coco = dict()
coco['images'] = []
coco['type'] = 'instances'
coco['annotations'] = []
coco['categories'] = []
category_set = dict()
image_set = set()
category_item_id = 0
image_id = 0
annotation_id = 0
def addCatItem(name):
global categor... |
# Atmel SAMD21 core implementation.
# See chip summary at:
# http://www.atmel.com/Images/Atmel-42181-SAM-D21_Summary.pdf
#
# Author: <NAME>
import os
from ..core import Core
from ..errors import AdaLinkError
from ..programmers import JLink, STLink, RasPi2
# DEVICE SELECTION register value to name mapping
DEVSEL_CHI... |
"""
Hello world program
Touches on how to load a C function address.
Run with:
PYTHONPATH=$PYPY_MU:$PYTHONPATH LIBRARY_PATH=$MU/cbinding:$LIBRARY_PATH python target_rmu_funcaddr.py
OR:
rpython target_rmu_funcaddr.py
LD_LIBRARY_PATH=$MU/cbinding:$LD_LIBRARY_PATH ./target_rmu_funcaddr-c
"""
from rpython.rlib... |
import functions as f
import math
stack = []
functions = []
debug_stack = False
def print_stack():
print(str(stack))
def get():
return stack[-1]
def popn(n):
l = []
for x in range(0,n):
val = pop()
if val != None:
l.append(val)
return l
def pop():
if len(stack) >... |
"""Test the main functions of the various ska-sdp commands"""
# pylint: disable=too-many-arguments
from unittest.mock import patch, Mock
import pytest
from ska_sdp_config.ska_sdp_cli import (
ska_sdp,
sdp_list,
sdp_get,
sdp_create,
sdp_update,
sdp_delete,
sdp_import,
)
PATH_PREFIX = "ska_s... |
#!/usr/bin/env python3
import os
import sys
import time
import socket
import json
import boto3
from botocore.exceptions import ClientError, PaginationError
MAX_LS_REQ_COUNT = 8
#http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html
EGRESS_FILTER = ('[version, account_id, interface_id, '... |
"""
This file contains Intents and Ability classes which make out
the Pyttman cli tool, used to administer, bootstrap and create
Pyttman app for users of the framework.
Are you a Pyttman developer or a contributor and want to extend
the 'pyttman' terminal tool with new functionality?
Add Intents to the PyttmanCLI Ab... |
# This script is for running the analysis that comes after the cross-entropy stuff.
import pandas as pd
import os
import sys
from datetime import datetime
import numpy as np
import sqlite3
import nltk
import regex as re
import spacy
import json
with open("../project-config.json") as config_file:
project_config =... |
import datetime
import os.path
import pytz
from vesper.mpg_ranch.recording_file_parser import RecordingFileParser
from vesper.tests.test_case import TestCase
import vesper.tests.test_utils as test_utils
import vesper.util.time_utils as time_utils
DATA_DIR_PATH = test_utils.get_test_data_dir_path(__file__)
class S... |
from flask import render_template, redirect, request, session
from app import app, models
from .forms import *
from .models import *
import json
import requests
import random
import numpy as np
import os
import hashlib
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
gb_path = os.path.join(SITE_ROOT, 'static', ... |
from os import path, makedirs, remove
from shutil import copyfile
from datetime import date
from babel.dates import format_date
from pylatex import Document, Command
from pylatex.base_classes import Environment
from pylatex.package import Package
from pylatex.utils import NoEscape
from pdf2image import convert_from_... |
import discord
from discord.ext import commands
import random, pyfiglet, time
from cogs.utils.gendata import *
from discord.ext.commands import BucketType, Cog
from pyfiglet import Figlet, FigletFont, FontNotFound
from cogs.utils import crack
def render_text(text, delims=None, *,
escape=True, shorten_... |
import copy
import math
from sklearn import metrics
from sklearn.metrics import roc_auc_score, brier_score_loss
import numpy as np
import pandas as pd
from sklearn.metrics import auc
class measures(object):
def __init__(self,actual,predicted,loc,labels = [0,1]):
self.actual = actual
self.predict... |
"""Load plugins through entry points.
This module deals with handling all plugged in strategies through the entry points API
and importlib metadata API.
Special functionality is put in place to handle the OTE-API-specific entry points.
Since the entry points are information complete in and of themselves, there is no... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import os
import six
import tensorflow as tf
from builders import dataset_builder
from builders import preprocessor_builder as preprocessor
slim = tf.contrib.slim
prefetch_queue = slim.pref... |
#!/usr/bin/env python3
import argparse
import csv
import datetime
import itertools
import logging
import os
import re
import subprocess
import sys
import time
from collections import Counter
from lib import logging_helper
if os.name == 'nt':
import tailer
# TODO: figure out how to trigger notifications in multi... |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier
from skgarden import MondrianForestClassifier
from mondrianforest import MondrianRandomForest as OurMondrianForestClassifier
from data_loaders import load_usps, load_letter, loa... |
from django.shortcuts import render, get_object_or_404, reverse, redirect
from . import forms
from dashboard.models import tableThree, senior_users
from django.views.generic import View,TemplateView,ListView,DetailView
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import Logi... |
"""
Contains the path technology behind opt_einsum in addition to several path helpers
"""
import itertools
from . import helpers
def optimal(input_sets, output_set, idx_dict, memory_limit):
"""
Computes all possible pair contractions, sieves the results based
on ``memory_limit`` and returns the lowest c... |
from antlr4 import TerminalNode
from ..grammar import NamingProtocolVisitor
from ..ast import *
__all__ = [
'CST2AST'
]
class BaseVisitor(NamingProtocolVisitor):
def visitChildren(self, ctx):
raise NotImplementedError
class CST2AST(BaseVisitor):
def __init__(self, input_stream):
super(... |
from collections import OrderedDict
import torch
import torch.nn as nn
from torch.nn.utils import weight_norm
import pdb
__all__ = ["UNet","res34_downsample", "downsample_none", "downsample_maxpool", "downsample_stride", "upsample_none", "upsample_upsample", "upsample_conv"]
res34_downsample = [3,4,6,3]
downsample_... |
#
# Copyright (C) 2013 eNovance SAS <<EMAIL>>
#
# Author: <NAME> <<EMAIL>>
#
# 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 requi... |
# -*- coding: utf-8 -*-
"""
Sky Subtract
"""
import matplotlib
matplotlib.use('agg')
import glob
import numpy as np
import os.path as op
import fitsio
from astropy.io import fits
from input_utils import setup_parser, set_daterange, setup_logging
from scipy.interpolate import splev, splrep
from astropy.stats import m... |
"""Multiply primitive optimized for the gemv operation."""
import neon_emitter
class Error(Exception):
"""Module level error."""
class ConfigurationError(Error):
"""Unsupported configuration."""
def GenerateLoadMultiplyAggregate(emitter, registers, lanes_count, aggregators,
... |
#!/usr/bin/python
import sys;
import struct;
# OBJ File Format
objfile = {
# OBJ Header
'header_magic': {'format': '5s', 'cast': str, 'is_macro': True},
'header_type': {'format': 'B', 'cast': int, 'is_macro': True},
'header_order': {'format': 'B', 'cast': int, 'is_macro': True}... |
from collections import Counter
import pprint
import networkx as nx
import random
import sys
class BitcoinConstant(object):
# total number of buckets for tried addresses
ADDRMAN_TRIED_BUCKET_COUNT_LOG2 = 8
# total number of buckets for new addresses
ADDRMAN_NEW_BUCKET_COUNT_LOG2 = 10
... |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
"""Contains functionality for managing Datafactory compute targets in Azure Machine Learning."""
import copy
from azureml._compute._c... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "Sponge"
# Date: 2018/6/28
#CwVW-SIF文本分类
import os
from examples import sif_embedding
import sklearn.datasets
import data_io
import params
import SIF_embedding
import numpy
from sklearn import svm
from sklearn import model_selection
from sklearn import *
imp... |
import numpy as np
import matplotlib.pyplot as plt
def generate_Guassian_cloud(N = 500):
"""
Generates 3 Guassian clouds
"""
#first cloud is centred at (0, -2)
X1 = np.random.randn(500, 2) + np.array([0, -2])
#second cloud is centred at (2, 2)
X2 = np.random.randn(500, 2) + np.array([2, 2]... |
"""
Start up the blossom breathing demo with the CLI client.
Uses demo video from teachers at the Pacific Autism Center for Education.
"""
# make sure that prints will be supported
import argparse, sys
sys.path.append("..")
print(sys.path)
from blossompy import Blossom
from time import sleep
import random
import cv2
i... |
import torch
import torch.nn as nn
from ...ops.pointnet2.pointnet2_batch import pointnet2_modules
from ...ops.pointnet2.pointnet2_stack import pointnet2_modules as pointnet2_modules_stack
from ...ops.pointnet2.pointnet2_stack import pointnet2_utils as pointnet2_utils_stack
from .pointnet2_utils import PointNetSetAbst... |
"""
This contains classes for loading tweet data
In the process of being converted to use sqlalchemy
"""
from sqlalchemy import Table, Column, ForeignKey, Integer, String, JSON, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import inspect
import datetime
from sqlalchemy.sql import f... |
# coding=utf-8
"""
gs_topic_models uses Latent Dirichlet Allocation (LDA) to identify likely topics in the
text of tweets. each Tweet corresponds to a 'Document'.
uses flow established in gs_Tweet_main, the controlling script for the Twitter analytics app
- we want to capture the text of tweets across the current 3 t... |
#!/usr/bin/env python3
from typing import Tuple
from empire import *
def checkHinPath(path):
if "h" in path:
return True
elif 'H' in path:
return True
else:
return False
def itemOutCheck(s, item, change):
if item == "min":
return s.min >= change
elif item ==... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 <NAME>
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Encoder definition."""
import torch
from espnet.nets.pytorch_backend.nets_utils import rename_state_dict
from espnet.nets.pytorch_backend.compressive_transducer.encoder_layer import ... |
#!/usr/bin/python
#
# Copyright (c) 2009, Perpetually.com, LLC.
# 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,... |
import json
from inspect import isclass
from typing import TypeVar, Dict
from django.db import models
from django.urls import reverse
from django.views.generic import TemplateView
from django.http import HttpResponse
from django.template.loader import render_to_string
from .detect_device import detect_device
from .colu... |
import redis
import re
import requests
import json
import logging
import pandas as pd
import uuid
from datetime import datetime
from fastapi import FastAPI
# from sqlalchemy import create_engine
# from typing import Optional
###
### INIT
###
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)... |
# pylint: disable=g-bad-file-header
# Copyright 2020 DeepMind Technologies Limited. 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/... |
#!/usr/bin/env python3
##############################################################################
# Author: <NAME>
# Date: 2019-01-27
# Affiliation: Peking University, TU Dresden
# Function: Translate the criterion into formal expression
######################################################... |
import copy
from dataclasses import dataclass, field
from typing import List, Dict, Callable, Tuple, Optional
from itertools import chain
import numpy as np
from pnlp.pcut import cut_zhchar, cut_part, psent, psubsent
from pnlp.ptxt import Regex
from pnlp.stopwords import chinese_stopwords, english_stopwords
reg = Re... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module which contains afk-related commands """
import time
from datetime import datetime
from random impor... |
from sys import argv
import os
import json
import nwalign3 as nw
SEARCH_ID_PREFIX = "SEARCH"
REF_FIRST_ORF_START_1BASED = 266
REF_LAST_ORF_END_1BASED = 29674
DEPTH_THRESH = 10
FRACTION_THRESH = 0.95
COL_NA = "NA"
SAMP_SEQUENCING_ID = "fastq_id"
IS_ACCEPTED = "is_accepted"
INDELS_FLAGGED = "indels_flagged"
PASS_DEPTH_... |
# -*- coding: utf-8 -*-
from __future__ import annotations
import time
from contextlib import suppress
from datetime import datetime
from threading import Thread
from typing import cast
from typing import Optional
from msgspec.json import decode
from msgspec.json import encode
from pioreactor import exc
from pioreac... |
import math
from deepquantum.circuit import Circuit
import torch
import torch.nn as nn
import numpy as np
class QuLinear(nn.Module):
"""
This layer can be used to replace pytorch's nn.Linear(in_features, out_features)
except that the batch_size can only be one,
out_features must be 2**1 <= 2**i <= 2*... |
# rnglib/__init__.py
"""
See docs.python.org/2/library/random.html for advice on subclassing
random.Random. Override random(), seed(), getstate(), setstate(),
and jumpahead(). For a crypto-grade rng, all but the first of these
will be a no-op.
"""
import os
import random
import re
__version__ = '1.3.10'
__version_... |
from fastapi import FastAPI, APIRouter, Request, Response
from fastapi.responses import JSONResponse
from pydantic import BaseModel
from typing import Tuple, Dict, List, Set, Iterable, Union
from .appstate import state, SrcInfoPackage
from .utils import version_is_newer_than
from .fetch import queue_update
class Que... |
#-------------------------------------------------------------------------------
# Copyright (c) 2011, Kafti team
#
# Released under the MIT license. See the LICENSE file for details.
#-------------------------------------------------------------------------------
"""Visitor for collecting nasl functions statistics""... |
import base64
import hmac
import json
import logging
import os
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from email.utils import formatdate
from enum import Enum
from typing import Dict, Iterator, List, NamedTuple, Optional
import azure.functions as func
import requests
LOG... |
#!/usr/bin/env python3
# Copyright 2020 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.
"""Unit tests for ebuild_function.py
Default values follow the default values of ebuild (see manpage of ebuild).
https://dev.gento... |
"""
Goal is to sample the architecture according to its rank.
"""
# The first step is to collect all the possible architecture. i should make a notebook for this?
# Standard imports
import copy
import json
import numpy as np
import matplotlib.pyplot as plt
import random
# Useful constants
from .nasbench_api_v2 impo... |
import os
from typing import List, Dict, Callable, Tuple, Union
import numpy as np
import torch.nn as nn
import torch
import torch.nn.functional as F
from ..utils.globals import get_global
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
import re
import contractions
import pa... |
from glob import glob
import sys #can be used to perform sys.exit()
import cv2
import numpy as np
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # being tried to avoid unnecessary/warning prints of Tensorfliow
import tensorflow as tf
tf.get_logger().setLevel('INFO') # being tried to avoid unnecessary/warning prints... |
from matplotlib import pyplot as plt
import numpy as np
import tensorflow as tf
from activeClassifier.env.env import ImageForagingEnvironment
from activeClassifier.tools.utility import Utility
from activeClassifier.tools.tf_tools import repeat_axis
from activeClassifier.tools.MSE_distribution import MSEDistribution
fr... |
import sys
sys.path.append("./")
import numpy as np
from scipy.spatial import distance
import math
from fcutils.maths import derivative
def subtract_angles(lhs, rhs):
"""Return the signed difference between angles lhs and rhs
Return ``(lhs - rhs)``, the value will be within ``[-math.pi, math.pi)``.
Bo... |
# ----------------------------------------------------------------------
# |
# | Process.py
# |
# | <NAME> <<EMAIL>>
# | 2018-05-04 18:57:15
# |
# ----------------------------------------------------------------------
# |
# | Copyright <NAME> 2018-22.
# | Distributed under the Boost Software License,... |
import re
import csv
import json
import glob
import datetime
import requests
import collections
import pandas as pd
from bs4 import BeautifulSoup
#市原市HPからソースを取得
url ='https://www.city.ichihara.chiba.jp/kenko/iryo_kansensyou/kansensyouyobou/covid-19/about/kanja.html'
r=requests.get(url)
r.raise_for_statu... |
import numpy as np
from mpl_toolkits.basemap import Basemap
from osgeo import gdal
import georaster
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
from matplotlib.colors import ListedColormap, BoundaryNorm
import matplotlib.patches as patches
import matplotlib.cm as cm
from math ... |
#!/usr/bin/env python
# coding: utf-8
# Author : <NAME>
# Initial Date: Feb 21, 2021
# About: graph building is for the class(es) and related functions used to make radar detections into graphs, and pulling out their data.
# Read associated README for full description
# License: MIT License
# Permission is hereby g... |
import keras as k
from tensorflow.keras import backend as K
from keras.layers import Input, Dense, Concatenate, concatenate, Flatten, Dropout
from keras.models import Model
from keras.losses import cosine_proximity as cosine
import numpy as np
from scipy.spatial import distance
import math
import random
# mush load th... |
from .opcode import *
__all__ = ["disassemble"]
def bits(word, start, end=None, sign=False):
if end is None:
end = start + 1
value = (word >> start) & ((1 << (end - start)) - 1)
if sign and value & (1 << (end - start - 1)):
return -((1 << (end - start)) - value)
else:
return ... |
import torch
from torch import nn
import math
from torch.nn import functional as F
from utils import cat_boxlist, Assigner
from utils import GIoULoss,SigmoidFocalLoss,concat_box_prediction_layers,get_num_gpus,reduce_sum
class ATSSHead(nn.Module):
def __init__(self, in_channels, n_class, n_conv, prior, regr... |
import numpy as np
import cv2
import collections
import datetime
import time
import itertools
DetectionImage = collections.namedtuple("DetectionImage","raw_image image detection_center timestamp")
try:
import urllib.request as urllib
import urllib.error as url_error
PYTHON2 = False
except ImportError:
... |
#
# 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 writing, software
# distr... |
#
# Copyright (C) 2020 Georgia Institute of Technology. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
from typing import Dict, Generator, List, Optional, Tuple, Union
from detectron2.layers import cat, interpolate
from detectron2.modeling.meta_arch import GeneralizedRCNN
from detectron2.structures i... |
'''
Take advantage of carpet symmetries by implementing "classes" procedure.
If a number of oscillators has the same phase - map them into one class.
Then we can solve ODE taking only 1 oscillator from each class, saving some resources.
Important:
- If two oscillators have the same phase, it doesn't in general imply t... |
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.decorators import action
from rest_framework.permissions import IsAuthenticated
from shared_utils import folder_utils, image_utils
from os.path import exists
import json
from PIL import Image
import math
import numpy as... |
'''
Este programa fará a conversão de números decimais
em números romanos, e vice-versa. Ele terá duas funções
em geral, claro, as com o propósito principal
do programa. A primeira converte um número inteiro positivo
na notação decimal posicional para a notação romana; já
a segunda função faz o oposto, de not... |
"""
Simple library to work with Nao robots to detect color and location of balls in robot's camera frame.
Done as part of assignment in BI-ZIVS class on FIT CTU in Prague
Made by <NAME>
"""
# coding=utf-8
import naoqi
import qi
import cv2
import numpy as np
import sys
import matplotlib.pyplot as plt
from na... |
import os
import time
import glob
import logging
import json
from abc import ABC, abstractmethod
from pygazpar.enum import Frequency
from pygazpar.datafileparser import DataFileParser
from pygazpar.webdriverwrapper import WebDriverWrapper
HOME_URL = 'https://monespace.grdf.fr'
LOGIN_URL = HOME_URL + '/monespace/conne... |
from __future__ import print_function, division
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from lib import replay_memory
from lib import util
import Tkinter
from PIL import Image, ImageTk
import numpy as np
import cPickle as pickle
import time
import imgaug as ia
EVERY_NTH = ... |
import os
import torch
import json
import argparse
from global_vars import RUN_DIR
from global_vars import EMBEDDINGS_DIR
def config_from_args(arg_list=None):
""" Argument Parser """
parser = argparse.ArgumentParser()
# Parameter in json to reload an already define config
parser.add_argument("-pf",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.