text stringlengths 6.04k 39.5k |
|---|
import torch
import torch.nn as nn
import torch.nn.functional as F
torch.autograd.set_detect_anomaly(True)
import numpy as np
import math
import json
import time
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from torchtyping import TensorType, patch_typeguard
from typeguard import typechecked
patch_typ... |
from bs4 import BeautifulSoup
import requests
import re
import numpy as np
import json
import csv
from threading import Thread
counter_last_matches = 10
def parse(url):
matches_links = []
page = requests.get(url)
# Success - 200
if page.status_code != 200:
exit(-1)
soup = BeautifulSoup(pa... |
#! /usr/bin/env python3
"""
Script that supports the model layout.
NOTE: These paths are all relative to the juneberry workspace root.
"""
# ==========================================================================================================================================================
# Copyright 2021 Car... |
import itertools as it
import os
import random
import sys
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = 'hide'
import pygame
WINDOW_WIDTH = 640
WINDOW_HEIGHT = 480
SCORE_HEIGHT_OFFSET = 32
SCORE_FONT_SIZE = 24
END_SPLASH_FONT_SIZE = 36
END_SPLASH_PLAYER_OFFSET = 100
WIN_FLASHES = 5
WIN_FLASH_DURATION = 500 # ms
LOSE_... |
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Jun 11 2018)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################
impo... |
'''
Surveillance video module
'''
import io
import glob
from http import server as httpServer
import os
import re
import socketserver
import time
import threading
from threading import Condition
sessionIDPattern = re.compile(r'sessionID=(\d+)')
class StreamingHandler(httpServer.BaseHTTPRequestHandler):
'''
St... |
import json
import pandas as pd
import os.path
import os
import time
import shutil
from experiment_email import sendEmail
from pandas.io.json import json_normalize
from external_evaluation_metrics import *
from cosine import *
from knn_network import *
from parameters import *
#A função create_json_conf... |
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import torch.utils.data as data
import src.utils as utils
from typing import List, Tuple, Optional, Union
from pathlib import Path
from... |
__author__ = '<NAME> (<EMAIL>)'
import heapq
import collections
import numpy as np
import scipy.sparse as spsp
from reveal_popularity_prediction.builder.collect.youtube import extract as youtube_extract
from reveal_popularity_prediction.builder.collect.reddit import extract as reddit_extract
def get_snapshot_graph... |
# Copyright (c) 2017, CNRS-LAAS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the f... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import date
from django.core.exceptions import ValidationError
from django.db import models
from django.urls import reverse
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as ... |
"""
A transpiler that takes in a python source file, tokenizes it, parses the tokens into an AST, and then walk the AST emitting valid C# (C Sharp) code to an output file.
The source to source compiler should therefore create executable C# code.
Attempt to build a transpiler using OpenAI Codex:
https://beta.openai.com... |
import os
import json
import torch
import torch.nn as nn
import numpy as np
import torch.nn.init as init
import torch.nn.functional as F
from utils.tools import get_mask_from_lengths, pad
from .blocks import (
LinearNorm,
LConvBlock,
SCLNLConvBlock,
FFTBlock,
)
from text.symbols import symbols
def ... |
import uuid
import time
import json
import bottle
import rq
import email
import xml.etree.cElementTree as ET
import traceback
from constants import *
from backend.logger import log
from backend.storage import rdb, rdbq
from backend.util import makeset, repo, json_error
import models.template
import models.gateway
@... |
# encoding: utf-8
#
# Copyright (c) 2017 <NAME> <<EMAIL>>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2017-12-22
#
"""CSL locales."""
from __future__ import print_function, absolute_import
import os
LOCALE_DIR = os.path.dirname(__file__)
class Locale(object):
"""A locale understood... |
# Copyright Notice:
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfishtool/blob/master/LICENSE.md
# redfishtool: rawMain.py
#
# contains raw subCommands and access functions
#
# Class RfRawMain
# - functions init, displayUsage, displayH... |
__author__ = 'lisette-espin'
################################################################################
### Local
################################################################################
from org.gesis.libs import graph as c
from org.gesis.libs.janus import JANUS
from org.gesis.libs.graph import DataMatr... |
"""
__author__ = ['christiaanleysen', 'wannesmeert']
This example divides a set of time-series into two clusters of the most similar time-series using the general
model learn over a set of time-series.
Find more information in the following paper:
"Energy consumption profiling using Gaussian Processes",
<NAME>*, <N... |
import torch
import torch.nn as nn
import torch.utils.data as data
from torch.autograd import Variable as V
import cv2
import os
import numpy as np
import matplotlib.pyplot as plt
import pickle
from time import time
import os,shutil
from networks.MMUU_Net import MMUU_Net
from data import ImageFolder
from metrics ... |
import os
import datetime
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
########### Data Constants ###########
DATA_DIR = '../data/'
if not os.access('/tmp/figures', os.F_OK):
os.mkdir('/tmp/figures')
if not os.access('/tmp/figures', os.W_OK):
pr... |
import os.path
import re
from itertools import chain
from . import pkg_config
from .common import BuildCommand, check_which, library_macro
from .. import options as opts, safe_str, shell
from ..arguments.windows import ArgumentParser
from ..builtins.file_types import generated_file
from ..exceptions import PackageReso... |
""" Main process module - Generates layered image and metadata files """
from collections import Counter
import csv
import json
import os
import random
from PIL import Image
from config import layers
def make_dirs():
"""Creates the directories to store final images and later on, their correspondi... |
import sys
import os
import numpy as np
import pandas as pd
from bokeh.models import CustomJS, ColumnDataSource, Row, Select, Column, RangeSlider, DataTable, TableColumn, DateFormatter, RadioButtonGroup, RadioGroup, TextInput, Dropdown
from bokeh.plotting import figure, show, curdoc
from bokeh.models.widgets import But... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from scipy.stats import norm
import numpy as np
def conv2d_block(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, bias=False, add_bn=True, add_relu=True, return_sequential=False):
seq = [nn.Conv2d(in_chan... |
#------------------------------------------------------------------------------
#
# Copyright (c) 2014-2015, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only
# under the conditions descri... |
# irgramd: IRC-Telegram gateway
# telegram.py: Interface to Telethon Telegram library
#
# Copyright (c) 2019 <NAME> <<EMAIL>>
# Copyright (c) 2020-2022 <NAME> <<EMAIL>>
#
# Use of this source code is governed by a MIT style license that
# can be found in the LICENSE file included in this project.
import logging
import... |
import numpy as np
from sklearn.base import BaseEstimator
class Config:
DISABLE_JIT = False
def numba_jit(nopython=True, nogil=True, **kwds):
def wrapped(func):
if Config.DISABLE_JIT:
return func
try:
from numba import jit
except ImportError:
retur... |
# -*- coding: utf-8 -*-
#
# test_pkgreader.py
#
# Copyright (C) 2013 <NAME> <EMAIL>
#
# This module is part of python-opc and is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
"""Test suite for opc.pkgreader module."""
import pytest
from mock import call, Mock, patch
from opc.c... |
#coding:utf-8
#基础模型类
import datetime
import uuid
from main.extensions import db,whooshee
from werkzeug.security import generate_password_hash, check_password_hash#密码验证
from flask_login import UserMixin
from geoalchemy2 import Geometry
from sqlalchemy import Column, Integer, String
from flask_security import RoleMixin
f... |
import sys
import os
import json
import subprocess
from queue import Queue
from threading import Thread
from threading import Lock
import locale
import traceback
import mangler
#run %comspec% /k "D:\ProgramFiles\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" first!!
class context:
def __init... |
################################################################################
##
## BY: <NAME>
##
## This project can be used freely for all uses, any information in the visual
## interface (GUI) can be modified without any implication.
##
##
##########################################################################... |
#! /usr/bin/env python3
#xpcs script to start analysis of the data
#reads the ini configuration file
import shutil
import sys
import os
import numpy as np
import time
from dynamix.io import readdata, EdfMethods, h5reader
from dynamix.tools import tools
os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE"
from collections im... |
import numpy as np
from abc import ABCMeta, abstractmethod
from glmnet import LogitNet
from scipy.stats import gaussian_kde, rankdata, norm
from sklearn.covariance import ledoit_wolf
from abcpy.graphtools import GraphTools
class Approx_likelihood(metaclass=ABCMeta):
"""This abstract base class defines the approx... |
# Copyright 2020-2021 <NAME>
# Copyright 2019-2020 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
import pandas as pd
import numpy as np
from plotly.offline import plot
import plotly.graph_objs as go
import plotly.express as px
import streamlit as st
# data :
games = pd.read_csv('datasets_nba/games.csv')
games_details = pd.read_csv('datasets_nba/games_details.csv')
players = pd.read_csv('datasets_nba/players.csv')... |
#! python
'''LDAP3 enhancements
Some enhancements to existing ldap3 module classes and other new classes.
ToDo:
- Everything
'''
import functools
import logging
import operator
import ldap3
import ldap3.core.exceptions
LOGGER = logging.getLogger(__name__)
class QueryJoin(list):
'''Modeling an LDAP filter join
I... |
from collections import namedtuple
import csv
import torch
import torch.nn as nn
class WalsInfo:
def __init__(self):
### Maps between WALS code and ISO 639-3.
### e.g. "aar" <-> "aiw". Sometimes the ISO 639-3 code is missing,
### which would just be the empty string.
self.wals_code... |
import unittest
import numpy as np
from numpy.testing import assert_array_almost_equal
from skgstat import Variogram
from skgstat import estimators
class TestVariogramInstatiation(unittest.TestCase):
def setUp(self):
# set up default values, whenever c and v are not important
np.random.seed(42)
... |
#
# Temporary script to create network firewall.
# Delete when CFT template available
#
import json
import logging
import os
import sys
import time
import boto3
import requests
logger = logging.getLogger()
logger.setLevel(level=logging.INFO)
filtered_domains = ['awesomeopensource.com']
fw_stateless_rg_name = os.envi... |
import logging
import random
import re
import common.constants as common_constants
import common.dialogflow_framework.utils.state as state_utils
from common.dialogflow_framework.utils.condition import if_was_prev_active
from common.utils import is_no, is_yes
from common.wiki_skill import find_entity_wp, find_entity_nou... |
from math import pi, cos, sin, tan
from Data import get_uids
from Data.Edges import *
from Data.Events import ChangeEvent
from Data.Objects import IdObject, NamedObservableObject
from Data.Point3d import KeyPoint
from Data.Vertex import Vertex
__author__ = 'mamj'
class AreaType(Enum):
EdgeLoop = 0
Composite = 1
... |
from numbers import Number
from typing import Callable, List
from phi import geom
from phi import math
from phi.geom import Box, Geometry
from phi.math import extrapolate_valid_values, channel, Shape, batch
from ._field import Field, SampledField, unstack, SampledFieldType
from ._grid import CenteredGrid, Grid, Stagge... |
from pycode.tinyflow import autodiff as ad
from pycode.tinyflow import gpu_op, train, ndarray
import numpy as np
def identity_block(inputs, kernel_size, in_filter, out_filters, block_name, stride=1):
f1, f2, f3 = out_filters
W1 = ad.Variable(block_name + "W1")
W2 = ad.Variable(block_name + "W2")
W3 = ... |
"""
Mask R-CNN
The main Mask R-CNN model implemenetation.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
"""
import os
import sys
import glob
import random
import math
import datetime
import itertools
import json
import re
import logging
# from collectio... |
import sys
import importlib
from itertools import chain
from ast import parse, Call, Name, UnaryOp, Constant, List, Dict, Return, For, Assign, If, Load, Store, keyword, Compare, BinOp, BoolOp, Add, Sub, Div, Mult, FloorDiv, Mod, MatMult, BitAnd, BitOr, BitXor, Invert, Not, UAdd, USub, LShift, RShift, And, Or, Eq, NotEq... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script for testing coolisf models
"""
# This code is a part of coolisf library: https://github.com/letuananh/intsem.fx
# :copyright: (c) 2014 <NAME> <<EMAIL>>
# :license: MIT, see LICENSE for more details.
import unittest
import logging
from texttaglib.chirptext im... |
from datetime import datetime
from enum import Enum
_ALERT_ID = 0
def _next_id():
global _ALERT_ID
_ALERT_ID += 1
return _ALERT_ID
class SeverityCode(Enum):
INFO = 1
WARNING = 2
CRITICAL = 3
ERROR = 4
class AlertCode(Enum):
ExperiencingDelaysAlert = _next_id(),
CannotAccessNod... |
import tensorflow_datasets as tfds
import tensorflow as tf
import io
from os import path, environ, makedirs
from datetime import datetime
import dataset_manager as dsmg
from model_manager import newModel as newDatabaseModel
from model_manager import addFile, addFeatures
# Allow memory growth on all GPU's
gpu_devices =... |
#-*-coding:utf-8
import datetime
import os, sys
import random
import re
import time
def dirSearch(dirname,file_name, root_path):
filenames = os.listdir(dirname)
# print(filenames)
for filename in filenames:
if filename == "askmarket_google.json":
return os.path.join(root_pat... |
"""
Views for the Entitlements v1 API.
"""
import logging
from django.db import IntegrityError, transaction
from django.db.models import Q
from django.http import HttpResponseBadRequest
from django_filters.rest_framework import DjangoFilterBackend
from edx_rest_framework_extensions.auth.jwt.authentication import JwtA... |
"""
topology.py: Used for storing topological information about a system.
This is part of the OpenMM molecular simulation toolkit originating from
Simbios, the NIH National Center for Physics-Based Simulation of
Biological Structures at Stanford, funded under the NIH Roadmap for
Medical Research, grant U54 GM072970. S... |
# -*- coding: utf-8 -*-
details = """
Author:............. <NAME>
Licence:............ Freeware
Created Date:....... 30.11.2018 (v1.0.0)
Current Version:.... v1.1.1
Description:
School assignment for our computer science class. This is our first program
that we have to create. It is said we require 30 lines ... |
import os
import os.path as osp
import sys
import torch
import torch.utils.data as data
import torch.nn.functional as F
import cv2
import numpy as np
from data.config import cfg, set_dataset
from pycocotools import mask as maskUtils
import random
import json
import abc
def get_label_map():
if cfg.dataset.label_map... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 4 12:55:56 2020
@author: lutra
"""
import glob
import sqlite3
import subprocess
def run(cmd):
# print(cmd)
process = subprocess.Popen(cmd, shell=True)
process.wait()
return
def blast(query, subject, output):
cmd='blastn -quer... |
from skimage.feature import hog
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import cv2
import glob
import time
from sklearn.svm import LinearSVC
from sklearn import svm
from sklearn import tree
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import... |
# visualize inflow/outflw to reservoirs
from datetime import datetime
import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as tick
import pandas as pd
import matplotlib.dates as mdates
from matplotlib import colors
from matplotlib import gridspec
import sys
from dateutil.relativedelta i... |
# Copyright (c) 2011-2012 <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 restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distr... |
# -*- coding: utf-8 -*-
# Copyright 2016-2022 CERN
#
# 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 a... |
import os
import time
import re
from typing import Optional, TypedDict
import pickle
import numpy as np
import pandas as pd
import tifffile as tf
# grabbing functions from .utils_funcs that are used in this script - Prajay's edits (review based on need)
from packerlabimaging.processing.imagingMetadata import Prairi... |
"""
Annotating a sequence means creating a list of annotations for a sequence.
"""
from linse.models import * # noqa: F401, F403
from linse.typedsequence import ints, floats
from linse.util import get_CLTS, get_NORMALIZE
__all__ = ['soundclass', 'REPLACEMENT', 'prosody', 'prosodic_weight',
'codepoints', 'norm... |
import sys
from collections import namedtuple
import pkg_resources
IS_FROZEN = hasattr(sys, '_MEIPASS')
# backup true function
_true_get_distribution = pkg_resources.get_distribution
# create small placeholder for the dash call
# _flask_compress_version = parse_version(get_distribution("flask-compress").version)
_Di... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import math
import dgl
import random
import dgl.nn as dglnn
from . import BaseModel, register_model
from .CompGCN import CompGraphConvLayer
import os
from gensim.models import Word2Vec
def get_norm... |
from optimism.JaxConfig import *
import optimism.LU as LU
from optimism.Timer import Timer
from optimism import WarmStart
from scipy.sparse import save_npz
from scipy.sparse.linalg import LinearOperator, gmres
Settings = namedtuple('Settings', ['t1','t2','eta1','eta2','eta3','max_trust_iters','tol','max_cg_iters','ma... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 20 15:00:00 2019
Performs standard analysis for all runs in a given path (searches
directory tree for runs). For each standard analysis a graph file for
each benchmark is created. A single PDF is created from all of these
including a metadata header... |
import sys
import os
import re
import string
import requests
import nltk
import data_extraction
import json
from nltk import tokenize
from nltk.corpus import stopwords
from bs4 import BeautifulSoup
# Web scraper that finds URL's related to artist <NAME> starting from his wikipedia page.
# Every relevant ... |
# Author: <NAME>, PhD
#
# Email: <EMAIL>
#
#
# Ref: https://scikit-learn.org/stable/modules/generated/sklearn.manifold.TSNE.html
# Ref: https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.jaccard.html#scipy.spatial.distance.jaccard
# Ref: https://docs.scipy.org/doc/scipy/reference/generated/scip... |
import math
import random
from collections.__init__ import namedtuple
import itertools
import numpy as np
import torch
from Levenshtein._levenshtein import distance as edit_distance, editops as edit_ops
from scipy.stats import rankdata
from scipy.special import softmax
from cachetools import cached, LRUCache
from l... |
import unittest
from builtins import next
from builtins import range
from unittest import mock
import numpy
from opentuner.search import manipulator
def faked_random(nums):
f = fake_random(nums)
def inner(*args, **kwargs):
return next(f)
return inner
def fake_random(nums):
i = 0
whil... |
"""
This module finds the network parsers within a firmware sample.
"""
import logging
import os
import pickle
import struct
import time
from functools import partial
from multiprocessing import Pool
import angr
import numpy as np
from archinfo import Endness
from sklearn.cluster import DBSCAN
from loggers import... |
from __future__ import print_function, division
from argparse import ArgumentParser
import yaml
import logging
import copy
import sys
from marmot.experiment.import_utils import *
from marmot.experiment.preprocessing_utils import *
from marmot.experiment.learning_utils import map_classifiers, predict_all
from marmot.e... |
""" Tests for fetching Samples of certain attributes values from a Project """
import itertools
import os
from collections import defaultdict
import mock
import pytest
import yaml
from peppy import Project, Sample
from peppy.const import *
from peppy.project import NEW_PIPES_KEY
from peppy.utils import fetch_samples... |
import sys, os, json, pickle, gettext, hashlib
import aiohttp.web_reqrep
assert sys.version_info >= (3, 5), 'Please use Python 3.5 or higher.'
from urllib.parse import quote, urlparse
import asyncio
import builtins
import jinja2
import aiohttp_jinja2
from aiohttp import web, HttpMessage
from aiohttp import MultiDi... |
# Copyright (c) 2012 NetApp, Inc.
# Copyright (c) 2012 OpenStack Foundation
# 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/l... |
from __future__ import absolute_import
from __future__ import division
from builtins import zip
from builtins import object
import pandas as pd
import numpy as np
import json
from ..misc import all_confignames, json_to_file
import string
import copy
import os
import glob
def generate_condition_from_dict(cond_dict):
... |
import sys
# This function returns the board to be printed as a string.
def prepare_board(board):
board_str = "-------------------------\n"
for i in board:
for j in i:
board_str += j + " "
board_str += "\n"
board_str += "-------------------------"
return board_str
# This ... |
import os.path as osp
from math import ceil
import torch
import torch.nn.functional as F
from torch_geometric.datasets import TUDataset
import torch_geometric.transforms as T
from torch_geometric.data import DenseDataLoader
from torch_geometric.nn import DenseSAGEConv
from torch_geometric.data import DataLoader
from t... |
import json
import os
import datetime
import traceback
import itertools
from functools import reduce, partial
import re
import logging
from sqlalchemy import Table, Column, Integer, String, MetaData, create_engine, func, Sequence, between
from sqlalchemy.sql import select
import numpy as np
import inflection
from tx.fu... |
# CT_Pygame version 1.01
# Import needed modules.
import math
import sys
import time
import pygame
# Define several global variables used for setting up the window
# and keep track of the program state.
__WINDOW = None
__CANVAS = None
__FONT = None
__FONT_NAME = None
__FONT_SIZE = 32
__WINDOW_TITLE = ""
__WINDOW_SIZ... |
import abc
import math
from typing import Any, Dict, Optional, Sequence
import numpy as np
try:
import numpy.typing as npt
except ImportError:
pass
from optur.proto.sampler_pb2 import RandomSamplerConfig, SamplerConfig
from optur.proto.search_space_pb2 import Distribution, ParameterValue, SearchSpace
from op... |
import argparse
import datetime
import pytz
import urllib
import requests
import json
import os
import sys
import glob
import re
import tarfile
import time
import inspect
from dateutil import parser
from girder.models.upload import Upload
from girder.api.v1.item import Folder
from girder.models.token import Token
from... |
import functools
from set_algebra import Set, Interval
from test_set import do_bulk_tests
do_bulk_remove_tests = functools.partial(do_bulk_tests, fn=Set.remove, mode='pieces')
# REMOVE SCALAR
def test_remove_scalar_from_empty_set():
tests = [
([], 1, []),
]
do_bulk_remove_tests(tests)
def t... |
from collections import Counter
import copy
import math
import operator
import os
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import sys
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath)
# Mapbox token for the choropleth maps
MAPBOX_ACCESS_TOKEN = os.enviro... |
# coding: utf-8
# 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... |
import ubelt as ub
import six
class ChannelSpec(ub.NiceRepr):
"""
Parse and extract information about network input channel specs for
early or late fusion networks.
Notes:
The pipe ('|') character represents an early-fused input stream, and
order matters (it is non-communative).
... |
from ..app import db
from ..forms import Form
from wtforms import StringField, validators, SelectField, SelectMultipleField, IntegerField
from sqlalchemy import func
from sqlalchemy.orm import relationship
from wtforms.widgets import TextArea, HiddenInput
from sqlalchemy import (
Column,
Date,
Float,
F... |
import xml.etree.ElementTree as ET
from stemming.porter2 import stem
import re
is_sample = 0
data_folder = ''
sample_txt_path = ''
trec_sample_path = 'trec.5000.xml'
sample_xml_path = ''
stopword_filepath = 'englishST.txt'
stopword_path = 'englishST.txt'
def load_stopword(stopword_path):
stopword... |
"""Run loop implemented for TF 1.15"""
from tensorflow.python.platform import gfile
import os
import math
import itertools
from absl import logging
import numpy as np
import tensorflow as tf
from tensorflow.python.client import device_lib
from tensorflow.contrib.memory_stats.python.ops.memory_stats_ops import BytesInU... |
# coding=UTF-8
from flask import *
from flask_httpauth import HTTPBasicAuth
import os,cv2,urllib.request
import time
from threading import Thread
import numpy as np
import pygame
"""
引入gpio包
"""
import RPi.GPIO as GPIO
app=Flask(__name__)
auth=HTTPBasicAuth()
host = "192.168.3.12"
hoststr = 'http://' + host + '/?ac... |
'''
Runs unit tests for continuum processing functions.
To run the unit tests, type the following from the system command line:
# python -m spectral.tests.continuum
'''
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from numpy.testing import assert_allclose... |
from collections import deque
from enum import Enum
from math import inf
from random import random
from DisjointSetTree import DisjointSetTree
from FibonacciHeap import FibonacciHeap
class Node_Color(Enum):
'''
For use in BFS and DFS
'''
WHITE = 1
GRAY = 2
BLACK = 3
class Edge_Type(En... |
#!/usr/bin/env python
u"""
reduce_OTIS_files.py
Written by <NAME> (10/2020)
Read OTIS-format tidal files and reduce to a regional subset
COMMAND LINE OPTIONS:
-D X, --directory X: working data directory
-T X, --tide X: Tide model to use
-B X, --bounds X: Grid Bounds (xmin,xmax,ymin,ymax)
--projection X... |
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '4'
import tensorflow as tf
import numpy as np
from tensorflow.contrib import layers
import scipy.io as sio
from scipy.sparse.linalg import svds
from sklearn import cluster
from sklearn.preprocessing import normalize
from munkres import Munkres
import matplotlib.pyplot as... |
# --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>, <NAME>, based on code from <NAME>
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import ... |
"""
Dataset samples.
| Copyright 2017-2021, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import os
from fiftyone.core.document import Document, DocumentView
import fiftyone.core.frame as fofr
import fiftyone.core.frame_utils as fofu
import fiftyone.core.labels as fol
import fiftyone.core.metadata as fo... |
# <html><body><pre>
## 3DGraphics combination of 3Dfuncs and surface
# This package creates a 3d graph surface of the data given
"""
graphSurface(window, data, view, color, bounds)
Draws a 3D surface showing 2d data array.
view, color and bounds are optional
if window is None, a window will be created
graphSurfa... |
#動画データベース作成とサムネイル作成
#2019-05-12
#対象ファイルはメディア系コンテンツのみ
#サムネイル作成時のみ再生時間取得
#クラス化 2019-05-25
from pathlib import Path
import datetime,time,subprocess,struct
from pymongo import MongoClient
import pymongo
import sys,random,base64,joblib
from bson.objectid import ObjectId
from io import BytesIO
import memory_tempfile
from mu... |
# -*- coding: utf-8 -*-
WorkingDirectory = ""
ThisDirectory = ""
IsDrawing = False
IsPanelMoving = False
IsLoop = False
IsSelector = False
MAXEVENTS = 100
EventsLog = [False for i in range(MAXEVENTS)]
ThisEvent = 0
SavingPosition = 0
Description = "Векторный графический редактор\nПроект распространяется свободно"
Ev... |
import multiprocessing
import os
import pickle
from itertools import count
from multiprocessing.managers import SyncManager
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import Any, Callable, Dict, Iterator, Optional, Tuple, Type, cast
import dill
import pandas as pd
import psutil
from p... |
from typing import Counter, Dict
import conllu
import torch
from torch.utils.data import Dataset
import numpy as np
from pathlib import Path
class Text8(Dataset):
""" text8 dataset """
"""
Metric is bits/character = entropy over test set / number of characters
this is log2 of ppx
"""
def __i... |
import argparse
import csv
import numpy as np
import os.path
from os import path
import pandas as pd
pd.options.mode.chained_assignment = None
import sys
# from model_utils import get_loader, change_size
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
# warnings.filterwarnings("ignore"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.