text stringlengths 6.04k 39.5k |
|---|
# Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
from __future__ import unicode_literals
import configparser
import logging
import re
import time
from urllib.parse import urlparse
from collections import OrderedDict
from contextlib import closing
import requests
import io
import socket
import xml.etree.ElementTree as elementtree
# Constants
PREFIX_COUNTRY = 'countr... |
import numpy as np
import numpy.linalg as npl
from dipy.core.triangle_subdivide import create_half_unit_sphere
from dipy.reconst.dti import design_matrix, lower_triangular
from nose.tools import assert_equal, assert_raises, assert_true, assert_false
from numpy.testing import assert_array_equal, assert_array_almost_eq... |
#!/usr/bin/env python3
#
# Copyright 2019 <NAME> <<EMAIL>>
#
# This file is part of Salus
# (see https://github.com/SymbioticLab/Salus).
#
# 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
#
# ... |
#!/usr/bin/env python
import argparse
import os
import sys
import nltk
import pandas as pd
from colorama import init
from nltk.stem import PorterStemmer
from nltk.tokenize import word_tokenize
def dep_check():
"""
Checks if nltk dependencies are installed
"""
try:
word_tokenize('can you pars... |
import discord
from discord.http import json_or_text
import requests
import json
import random
import aiohttp
from chatterbot import ChatBot
from weather import *
from discord.ext import commands
from discord.ext.commands.core import command
from discord.utils import get
from afks import afkdata
from minichat import m... |
# This file is part of Buildbot. Buildbot 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 Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
import re
from collections import Counter
from typing import Dict, List, Any
import pandas as pd
from dateutil.relativedelta import relativedelta
from django.db.models import Q
import datetime
from portfolio.lib.degiro_api import DegiroAPI
from portfolio.lib.yf_api import YF
from portfolio.models import Depot, Transa... |
from typing import Union, Dict, Tuple, List
import os
import tempfile
import zipfile as zf
import logging
import patsy
import pandas as pd
import numpy as np
import scipy.sparse
import xarray as xr
import dask
import dask.array
try:
import anndata
except ImportError:
anndata = None
logger = logging.getLogge... |
import os
import sys
import random
import math
import time
import pickle
import numpy as np
import skimage.io
from skimage.measure import find_contours
import matplotlib
from matplotlib import patches, lines
from matplotlib.patches import Polygon
import matplotlib.pyplot as plt
from PIL import Image
from paths import ... |
import cv2
import platform
from PIL import Image
import face_recognition
import face_detect_xavier
from queue import Queue
from multiprocessing import Process
import multiprocessing
import time
from time import sleep
import math
from sklearn import neighbors
import os
import os.path
import pickle
from http import serve... |
from mysite.Functions.XMLParser2 import parseXMLwithET, getVideoName
from shutil import copy2, move
from PIL import ImageColor, ImageDraw,Image
import cv2
import os
import mysite.settings as set
objects_information = dict()
all_frames_input_dir = set.MEDIA_ROOT
to_be_annotated_input_dir = set.TO_BE_ANNOTATED
segmenta... |
import random, time, datetime
import curses
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
class InvalidMoveException(Exception):
def __init__(self, value):
... |
#%%
# # -*- coding: utf-8 -*-
"""
Created on Sat Aug 28 17:59:34 2021
@author: kibong
"""
# import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import Dataset, TensorDataset, DataLoader, WeightedRandomSampler
import numpy as np
import random
# from ... |
"""
Script goal,
Predict future FRI based on current climate
"""
#==============================================================================
__title__ = "FRI Prediction"
__author__ = "<NAME>"
__version__ = "v1.0(27.11.2019)"
__email__ = "<EMAIL>"
#==================================================... |
from xscontainer import util
from xscontainer.util import log
import os
import tempfile
import threading
import XenAPI
XSCONTAINER_PRIVATE_SECRET_UUID = 'xscontainer-private-secret-uuid'
XSCONTAINER_PUBLIC_SECRET_UUID = 'xscontainer-public-secret-uuid'
XSCONTAINER_SSH_HOSTKEY = 'xscontainer-sshhostkey'
XSCONTAINER_US... |
from __future__ import annotations
from typing import get_type_hints, Union, List, Any, Dict, Optional
from collections import deque
import re
import yaml
from pyopenapi3.data_types import Component, Parameters, Schemas
from pyopenapi3.utils import (
build_mediatype_schema_from_content,
create_schema,
for... |
import operator
import math
import json
from jmespathv041p.compat import with_repr_method
from jmespathv041p.compat import string_type as STRING_TYPE
from jmespathv041p.compat import zip_longest
from jmespathv041p.exceptions import JMESPathTypeError, UnknownFunctionError
NUMBER_TYPE = (float, int)
_VARIADIC = object... |
# -*- coding:utf-8 -*-
import socket,traceback,hashlib
from multiprocessing import Process
from datetime import datetime
from gsiot.v3 import *
from gsiot.v3.file.jsonfile import gsJsonFile
from gsiot.v3.net.server import Server,ThreadServer
from gsiot.v3.net.client import Client
# class ErrorCode(object):
# OK = "... |
import os.path
import re
from yum.i18n import _, P_
from yum.constants import *
from yum.logginglevels import INFO_1
import rpmUtils.miscutils
import misc
import fnmatch
# newpackages is weird, in that we'll never display that because we filter to
# things relevant to installed pkgs...
_update_info_types_ = ("s... |
import os
import PIL
from PIL import Image
import numpy as np
import torch
from torch.utils.data import Dataset
class Label(object):
def __init__(
self, name, id, trainid, category, catid, hasinstances, ignoreineval, color
):
self.name = name
self.id = id
self.trainid = traini... |
# -*- coding: utf-8 -*-
# Copyright: <EMAIL>
# License: GNU GPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import sys
from anki.stdmodels import addBasicModel
from anki.importing.noteimp import NoteImporter, ForeignNote, ForeignCard
from anki.lang import _
from anki.lang import ngettext
from xml.dom ... |
# -*- coding: utf-8 -*-
"""Veil https api client."""
import asyncio
import json
import logging
from types import TracebackType
from typing import Dict, Optional, Type
from urllib.parse import urlencode
from uuid import UUID, uuid4
try:
import ujson
except ImportError: # pragma: no cover
ujson = None
try:
... |
import os
import shutil
import glob
import cv2 as cv
from lxml import objectify
from lxml import etree
def copy_file_to_dst_dir(target_file, src_dir, dst_dir, format):
"""
target_file: 需要复制的文件的前缀名
src_dir: 源目录
dst_dir: 目的目录
"""
# 输入判断
if not os.path.exists(src_dir) or not os.pa... |
import pickle
import json
import os
import argparse
import numpy as np
from collections import defaultdict
from transfer.ergtransfer import get_tense
import torch
import random
from copy import deepcopy
from dl_pipeline.making_sense import uni_predict, bert_predict, ro_predict, xlnet_predict
from transformers import (
... |
# coding: utf-8
from keras.layers.core import Dense
from keras.layers.core import Masking
from keras.layers.core import Activation
from keras.layers.core import Dropout
from keras.layers import Input
from keras.layers import Lambda
from keras.layers import Multiply
from keras.layers import Maximum
from keras.layers im... |
from celery import Celery,chain
from app import app,celery,db
import redisearch
import time,sys
import pandas as pd
import billiard as mp #multiprocessing substitute to enable daemon
import scipy.stats
import numpy as np
import os
sys.path.insert(0, 'app')
import controller.utils as utils
from timeit import defaul... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
PiPyADC: Microgrid Demo for ADS1256 and DAC8532 in module pipyad_da:
<NAME> 2019-03-28
"""
import logging
import os
import sys
import time
import datetime
import argparse
#from elasticsearch import Elasticsearch
from ADS1256_definitions import *
from ad_da import AD_DA
... |
import math
import tkinter as tk
from decimal import Decimal
from tkinter import ttk
from tkinter.filedialog import askopenfilename, asksaveasfile
import matplotlib.pyplot as plt
from chart_img import Chart_Img
from util.chart import Chart
from util.song import Song
class Application(tk.Tk):
chart_image = None
... |
#!/usr/bin/env python
# coding: utf-8
# In[3]:
import re
import numpy as np
import pandas as pd
from pprint import pprint
# Gensim
import gensim
import gensim.corpora as corpora
from gensim.utils import simple_preprocess
from gensim.models import CoherenceModel
# spacy for lemmatization
import spacy
# Plotting to... |
"""
Bot to monitor for southbound permit spaces on the John Muir Trail
Written by <NAME>
Updated for new website in 2021 by <NAME>
Check whether any spaces are available for the
"Donohue Exit Quota and Trailhead Space Available".
This is for people hiking the John Muir Trail starting in Yosemite.
According to the res... |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A tool to compare functions for finding anomalies to the current default.
This tool provides a way to benchmark an anomaly detection algorithm against
th... |
#!/usr/bin/env python2
from __future__ import print_function
from collections import defaultdict, Counter, namedtuple
import sys
import itertools
import random
import networkx as nx
import re
import StringIO
import scipy.misc
import walker.data
# Constraints:
# - Must have > 10 in group
# - File path rules
#Func... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''Data visualisation
this script reads data samples from PicoScope and
displays data as effective voltage, history display and xy plot
Usage: ./runPhyPiDAQ.py [<PhyPiConf_file>.daq] [Interval]
'''
from __future__ import print_function, division, unicode... |
from math import *
from functools import wraps
################################################################################
def autocast(method): # Optional method decorator
@wraps(method)
def wrapper(self, obj):
try:
return method(self, self.__class__(*obj))
except TypeError:
... |
import pickle
import pytest
from tensora import Mode, Format, Tensor
# The example tensors from the original taco paper:
# http://tensor-compiler.org/kjolstad-oopsla17-tensor-compiler.pdf
figure_5_taco_data = [
('d0d1', [[], []], [6, 0, 9, 8, 0, 0, 0, 0, 5, 0, 0, 7]),
('s0d1', [[[0, 2], [0, 2]], []], [6, 0, ... |
import os
import numpy as np
import logging
import h5py
from ..builder_utils import mpi_rank, mpi_size, barrier
from .edge_props_table import EdgeTypesTableMPI
logger = logging.getLogger(__name__)
class EdgesCollatorSingular(object):
"""Used to collect all the edges data-tables created and stored in the EdgeTy... |
from django.db import models
from django.db.models import Q, QuerySet
from django.http import Http404
from django.shortcuts import redirect
from django.utils import formats
from django.utils.timezone import localdate
from django.utils.translation import ugettext as _
from modelcluster.fields import ParentalKey
from wag... |
import os, sys
from random import randint, choice
from math import sin, cos, radians
import pygame
from pygame import Rect, Color
from pygame.sprite import Sprite
from gridmap import GridMap
from pathfinder import PathFinder
from simpleanimation import SimpleAnimation
from utils import Timer
from vec2d import vec2d
f... |
################################################################
# -*- coding: utf-8 -*-
# Title: Buscaminas
# Developed by: <NAME>
# SavedVariables: board, match
# Notes: Minesweeper game that supports different size games.
# It can save game on files and load them later.
# TODO: Support several languages
############... |
from multiprocessing import cpu_count
from os import path
from socket import gethostname
import os
hostname = gethostname().split('.')
machine_name = hostname[0]
#hypothesis_params = {
# 'START DATE':'2004-01-01',
# 'END DATE': '2018-01-15',
# 'PORTFOLIO': 'US_TOP_500_LIQUID',
# 'NEUTRALI... |
import pandas as pd
import os, requests, logging
import sys
# from bs4 import BeautifulSoup as bs
from .utils import *
class EdgarBase(object):
def __init__(self, dir_edgar=None):
# self.dir_edgar =
# self.__dir_download = None
# self.__dir_data = None
self.__dir_output = None
... |
import os,sys
import numpy as np
import argparse
import keras
import datetime
import glob
#os.environ["HDF5_USE_FILE_LOCKING"] = 'FALSE' # set as True on certain remote servers
from keras_bert import gen_batch_inputs
from keras.callbacks import ModelCheckpoint,EarlyStopping
from keras.callbacks import Callback
from ... |
from sys import stderr
import time
from typing import Any, Callable, Dict, List, Set
from flask_sqlalchemy.model import Model
from sqlalchemy.sql.elements import BinaryExpression
from sqlalchemy.sql.expression import asc, desc, and_
from flaskapp.models import ArgCategories, ArgLinker, ArgSubcategories, Arguments, M... |
""" History related magics and functionality """
#-----------------------------------------------------------------------------
# Copyright (C) 2010 The IPython Development Team.
#
# Distributed under the terms of the BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#----... |
#
# Copyright (c) Dell Inc., or its subsidiaries. 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
#
from __future__ im... |
import os
import heapq
import numpy as np
import networkx as nx
from collections import defaultdict
from scipy.interpolate import interp1d
from graph_tiger.graphs import graph_loader
from graph_tiger.measures import run_measure
from graph_tiger.simulations import Simulation
from graph_tiger.attacks import get_node_ns ... |
from visual import *
# <NAME>, March 2002
# Import this module to create buttons, toggle switches, sliders, and pull-down menus.
# See test routine at end of this module for an example of how to use controls.
lastcontrols = None # the most recently created controls window
gray = (0.7, 0.7, 0.7)
darkgray = (0.... |
#!/usr/bin/env python3
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license
"""
This script imports a RobotCar dataset to the kapture format.
The RobotCar Seasons dataset uses a subset of the images provided in the RobotCar
dataset. It uses images taken under a single reference condition (`overcas... |
#!/usr/bin/python
from __future__ import division
from __future__ import print_function
import numpy as np
import numpy.linalg as la
import math
import tensorflow as tf
class Generator(object):
def __init__(self,A,**kwargs):
self.A = A
M,N = A.shape
vars(self).update(kwargs)
self.x_... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from collections import OrderedDict
from itertools import chain
from typing import List, Any, Iterable, Callable, Union, Dict, Generic, Optional, Tuple
from typing import TypeVar
from functools import reduce
T = TypeVar('T')
K = TypeVar('K')
V = TypeVar('V')
def identity(x:... |
__copyright__ = 'Copyright 2016-2021, The RADICAL-Cybertools Team'
__license__ = 'MIT'
import math
import os
from typing import Optional, List, Tuple, Dict, Any
T_NODES = List[Tuple[str, int]]
T_NODE_LIST = List[Dict[str, Any]]
import radical.utils as ru
from ... import agent as rpa
from ... import con... |
import bottle
from bottle import route, run, static_file, post, request, response, template
import bottle
#import sys
import os
import socket
import requests
import json
import http.client
from PyPDF2 import PdfFileWriter, PdfFileReader
import io
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import l... |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import division
import re
from .association import Association
from .entity import Entity
from .phantom import Phantom
from .diagram_link import DiagramLink
import itertools
from collections import defaultdict
from .grid import Grid
from .mocodo_error import Moc... |
import functools
import importlib
import itertools
import json
import shutil
import sys
import asyncio
import os
import typing
from concurrent.futures import ThreadPoolExecutor
import appdirs
import precept
from .events import DAZZLER_START, DAZZLER_STOP, DAZZLER_SETUP
from .system.auth import Authenticator, Dazzler... |
"""
Provides functionality for logging training and testing batch-level & epoch-level metrics
"""
from collections import OrderedDict
from itertools import product
from numbers import Integral, Real
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
from numpy import ndarray
try:
from xarray ... |
# -*- coding: utf-8 -*-
"""
Functions related to my thesis of forward and inverse modelling of terrestrial
cosmogenic nuclides to detect past glaciations.
The calculations are based on Vermeesch 2007.
Forward function calculates nuclide concentrations with depth.
Find_times function chooses randomly times that are t... |
import datetime
import os
import sys
import platform
from collections import defaultdict
from opentrons import protocol_api
from opentrons.simulate import simulate, format_runlog
# Check if we are on the OT-2, Robotron, or some other computer.
template_parser_path = "{0}var{0}lib{0}jupyter{0}notebooks".format(os.sep)
... |
# Copyright 2016-2017 <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, sof... |
import asyncio, datetime, imageio, os, sys
from dataclasses import dataclass
from pathlib import Path
from discord.ext import commands
import pandas as pd
from functions._local_datetime import local_dt
from functions._timer import timer
from model import covid_age
from view import views_embed as ve
from settings impo... |
"""Module containing the abstract base classes (ABCs) which define the interfaces of
various objects expected by the ``pygmol`` framework.
"""
from abc import ABC, abstractmethod
from typing import Union, Sequence, Dict, Callable, Mapping
from numpy import ndarray, float64
from pyvalem.formula import FormulaParseError... |
import numpy as np
import random
# from imblearn.over_sampling import SMOTE
# following libraries for classification test
# import test_nn
import math
class KNNOR:
# def knnor_over_sample(X,y,n_to_sample,num_neighbors,proportion,max_dist_point,intra=True):
def fit_resample(self,X,y,**params):
thr... |
from __future__ import annotations
import asyncio
import csv
from functools import partial
import gc
import gzip
from itertools import chain
import json
import logging
import multiprocessing as mp
import subprocess
import time
from pathlib import Path
from typing import TYPE_CHECKING, TextIO
import range_streams
impo... |
import os
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import numpy as np
from lmfit import Parameters
from lmfit.models import GaussianModel, LinearModel
from astropy.constants import c
from fitelp.label_tools import line_label
import fitelp.constants as constants
constants.init()
def v... |
#Author: <NAME> <EMAIL>
import socket
import os
import time
import threading
import bracket
import weakref
#from switches import switch, case
import random
from datetime import date
lock = (date.today()>date(2014,4,8))
Shutdown=False
clients={}
sessions={}
submitted=set()
version=1.02
pointSystem=[16,8,4,2,1]
master=N... |
# 元データと低次元表現それぞれに対し精度を計算する
# X:特徴行列, L: ラベル
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.cluster import KMeans
from munkres import Munkres
import csv
from numpy import savetx... |
# classes to hold the physical components of the system
# e.g. the stellar light, dark matter, black hole, globular clusters
import numpy as np
import logging
from dynamite import mges as mge
class System(object):
"""The physical system being modelled
e.g. system is a galaxy. A system is composed of ``Compo... |
from schyntax.internals import token
from schyntax.internals.lexer import tokenize
from schyntax.internals.dateutil import get_days_in_month
from schyntax.exceptions import SchyntaxParseException, InvalidScheduleException
EXPRESSION_TYPE_DATES = 'dates'
EXPRESSION_TYPE_DAYOFMONTH = 'dom'
EXPRESSION_TYPE_DAYOFWEEK = '... |
# -*- coding: utf-8 -*-
__all__ = [
'absorption_probabilities',
'committor_probabilities',
'expected_rewards',
'expected_transitions',
'first_passage_probabilities',
'first_passage_reward',
'hitting_probabilities',
'hitting_times',
'mean_absorption_times',
'mean_first_passage_ti... |
# pcontracts.py
# Copyright (c) 2013-2019 <NAME>
# See LICENSE for details
# pylint: disable=C0103,C0111,C0413
# pylint: disable=E0102,E0611,E1101,F0401,R0912,R0914,R1710,W0212,W0613,W0706
# Standard library imports
import inspect
import os
import re
import sys
# PyPI imports
if os.environ.get("READTHEDOCS", False) !... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, 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 cop... |
#!/usr/bin/env python
# coding: utf-8
# In[47]:
import json
import math
import os
import glob
import numpy as np
import cairosvg
from uuid import uuid4
from vdom import VDOM, style
from vdom.svg import circle, path, rect, svg, g as group, animate, text, clipPath
from IPython.display import display_png, Image, S... |
import torch
import torch.nn.functional as F
import numpy as np
import math
def gradient_loss(s, penalty='l1'):
dy = torch.abs(s[:, :, 1:, :,:] - s[:, :, :-1, :,:])
dx = torch.abs(s[:, :, :, 1:,:] - s[:, :, :, :-1,:])
dz = torch.abs(s[:, :, :, :, 1:] - s[:, :, :, :, :-1])
if (penalty == 'l2'):
... |
from __future__ import absolute_import, division, print_function
import tensorflow.compat.v1 as tf
import numpy as np
import time
from scipy.special import comb, perm
import argparse
import json
import os
import pprint
### self-defined module
import policy
from dataloader import *
import util
import tf... |
from __future__ import annotations
import re
import pytest
import zocalo.configuration
import zocalo.util.rabbitmq as rabbitmq
@pytest.fixture
def zocalo_configuration(mocker):
zc = mocker.MagicMock(zocalo.configuration.Configuration)
zc.rabbitmqapi = {
"base_url": "http://rabbitmq.burrow.com:12345... |
#
# Copyright (c) 2020 Expert System Iberia
#
"""Provides normalisation of a tree of schema.org compliant items into
a dict of identifiers to relatively flat items with references between
each other.
"""
import copy
import logging
from acred import content
from esiutils import dictu, hashu
logger = logging.getLogger(... |
import os
import sys
import subprocess as sp
import numpy as np
from astropy.io import ascii
from astropy.table import Table,Column
def sources_extraction(image,sextractor_pars):
""" Extract sources from the generated image using sextractor """
cat_name, detect_minarea, detect_thresh, analysis_thresh, phot_aper... |
import os
import abc
import swamp
import threading
import numpy as np
import pandas as pd
from statistics import mean
import swamp.utils.swamplibrary
from swamp.logger import SwampLogger
from swamp.wrappers.gesamt import Gesamt
from itertools import groupby, combinations
from sklearn.metrics import silhouette_score
fro... |
from __future__ import print_function
'''
===============================================================================
Contains tools to make the sub-models for the DVRK application
===============================================================================
'''
import keras.backend as K
import keras.losses as ... |
import os
import torch
import numpy as np
import pandas as pd
import traci
from .env import SumoEnvironment
from .module import Agent
# 学習させる関数
def train_agent(
net_file='/home/kato/traffic_light_control/sumo-rl/nets/2x2grid/2x2.net.xml',
route_file='/home/kato/traffic_light_control/sumo-rl/nets/2... |
# Copyright (c) 2015 Intel Research and Development Ireland Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
#
# taxon.py
#
from itertools import chain
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.associationproxy import association_proxy
from bauble.model import Model
import bauble.types as types
import bauble.search as search
class VNList(list):
"""
A Collection class for Taxon.vern... |
import torch
from nlstruct.core.torch import torch_global as tg
IMPOSSIBLE = -10000
class CRF(torch.nn.Module):
def __init__(self, num_tags, start_transitions_mask=None, transitions_mask=None, end_transitions_mask=None, with_start_end_transitions=True):
super().__init__()
self.num_tags = num_tag... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Create GUI frontends for your programs, .e.g. desktops.
import cursed
Cite
----
- Based on GitHub's MrMattBusby/templates/template_curses.py
- Please backport any relevent template changes via fork
TODO
----
- desktop's init should clear all and call all sub's init... |
#!/usr/bin/env python3
#
# Copyright 2019 <NAME> <<EMAIL>>
#
# This file is part of Salus
# (see https://github.com/SymbioticLab/Salus).
#
# 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
#
#... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-import sys
FACEBOOK_SCOPE = "offline_access,email,publish_stream,read_stream,read_friendlists,user_groups,manage_pages,user_photos"
import cgi
import logging
import os,sys,re
import urllib
import urllib2
import datetime
import mimetypes
from django.utils import simplejson... |
__author__ = 'Reid'
import os
import sys
from tkinter import *
from media.documents import *
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Project.settings')
import os
from Project.SecureWitness.models import Report, UserProfile, Upload
from django.contrib.auth.models import User
from datetime import datetime
f... |
# -*- coding: utf-8 -*-
"""
Request Management
"""
module = request.controller
resourcename = request.function
shn_menu(module)
# Load Models
# (events loaded automatically, if-enabled)
s3mgr.load("req_req")
req_create_form_mods = response.s3.req_create_form_mods
req_priority_represent = response.s3.req_priorit... |
###############################################################################
# Copyright 2018 The AnPyLar Team. All Rights Reserved.
# Use of this source code is governed by an MIT-style license that
# can be found in the LICENSE file at http://anpylar.com/mit-license
################################################... |
import json
'''
:copyright: 2015 by The Autoprotocol Development Team, see AUTHORS
for more details.
:license: BSD, see LICENSE for more details
'''
class Instruction(object):
"""Base class for an instruction that is to later be encoded as JSON.
"""
def __init__(self, data):
supe... |
import torch
import torch.nn as nn
from torch.nn import init
import torchvision
import numpy as np
import inspect
from PIL import Image
if torch.cuda.is_available() :
device = torch.device('cuda', 0) # Default CUDA device
else:
device = torch.device('cpu')
device_ids = [0, 1, 2, 3] # CUDA ids
Tensor_gpu... |
import math
import time
import sys
from PyQt4 import QtGui, QtCore
import serial
import new_era_vp as new_era
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
import pdb
# ToDo | 1. Add email address for sending email when done (only works if
# ToDo | connec... |
'''
Object linking and embedding (ole) compound file (cf) definition
This definition was written using information located here:
https://msdn.microsoft.com/en-us/library/dd942335.aspx
https://msdn.microsoft.com/en-us/library/dd941946.aspx
https://msdn.microsoft.com/en-us/library/dd942048.aspx
https://m... |
"""
FiftyOne Tornado server.
| Copyright 2017-2020, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import asyncio
import argparse
from collections import defaultdict
from copy import deepcopy
import json
import os
import posixpath
import traceback
import uuid
from bson import ObjectId
import tornado.esca... |
import os, cv2, sys
import tensorflow as tf
import argparse, os, numpy as np
import scipy.stats
import pathlib
import os
# writes the output boxes
class DishScorer:
def __init__(self, objDetMod, classifyMod, numBoxes, minScr):
self._boxMod = objDetMod
self._classMod = classifyMod
self._min... |
import json
import sys
import os
from tabulate import tabulate
import config
from common import *
# open file to load json data
# standardize destination path
data = merge_padding(read_jsondata(sys.argv[1]))
DESTINATION = sys.argv[2]
# check if debug mode activated or not
if (len(sys.argv) > 3):
if (sys.argv[-2]... |
#!/usr/bin/env python
import sys, os
import unetsl.data
import numpy
import skimage.morphology
import skimage.draw
import skimage.measure
from skimage.feature import peak_local_max
from skimage.morphology import watershed
import scipy.ndimage.filters as filters
from scipy.ndimage.morphology import distance_transfo... |
from typing import Optional
import warnings
import pandas as pd
from macpie._config import get_option
from macpie import lltools, validatortools
def date_proximity(
left,
right,
id_on=None,
id_left_on=None,
id_right_on=None,
date_on=None,
date_left_on=None,
date_right_on=None,
ge... |
"""Compilation of functions for analyzing maizsim output."""
import os
import collections
import pandas as pd
import numpy as np
from numpy import genfromtxt
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LinearRegression
from sklearn.metrics im... |
#!/usr/bin/env python3
"""
BSD 3-Clause License
Copyright (c) 2020, Southern California Earthquake Center
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.