text stringlengths 957 885k |
|---|
from numpy import genfromtxt
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
''' load_dataset: Loads and merges cleaned-up data
@param threshold: emittance threshold below which a data point is considered positive example
Set threshold = -1 for non-binary models
@return tupl... |
# Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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; either version 2 of the License, or
# (at your o... |
<gh_stars>10-100
#!/usr/bin/env python
# --------------------------------------------------------
# Fast/er/ R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
"""Generate RPN proposals."""
imp... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 <NAME>, <EMAIL>
#
# This module is part of python-sqlparse and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from sqlparse import sql, tokens as T
from sqlparse.utils import split_unquoted_newlines
class StripWhitespaceFilter(ob... |
<reponame>eupston/Deepbeat-beatbox2midi
import numpy as np
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.opengl as gl
import pyqtgraph as pg
import sys
from opensimplex import OpenSimplex
from PyQt5.QtCore import Qt
from PyQt5 import QtGui
import time
class Terrain(object):
def __init__(self):... |
<reponame>OpenSourceEconomics/handout-eckstein-keane-wolpin-models
"""Figures for the handout.
This module creates all figures for the handout. They are all used in the illustrative example.
"""
import colorsys
import os
from pathlib import Path
import matplotlib as mpl
import matplotlib.colors as mc
import matplotli... |
<reponame>paul-ang/nas-segm-pytorch<gh_stars>100-1000
"""REINFORCE and PPO for controller training"""
import random
import torch
import torch.nn as nn
from helpers.storage import RolloutStorage
from helpers.utils import parse_geno_log
class REINFORCE(object):
"""REINFORCE gradient estimator
"""
def __... |
# coding: utf-8
import os,glob,re
import numpy as np
import tensorflow as tf
from numpy.random import randint,choice
from metrics import *
from augment import *
from multiprocessing import Pool
import itertools
import sys
from scipy.special import logit
from sklearn.metrics import mean_squared_error
from sklearn.me... |
# -*- coding: utf-8 -*-
"""
foulefactoryapilib.models.account_writer_service_model
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ) on 09/16/2016
"""
import dateutil.parser
from .base_model import BaseModel
class AccountWriterServiceModel(BaseModel):
"""Implementation of t... |
import torch.nn as nn
import torch.nn.functional as F
import torch
#import mkl
import os, sys, time, numpy as np, librosa, scipy, pandas as pd,pdb
from tqdm import tqdm
from util import *
# def progress_bar(epoch, epochs, step, n_step, time, loss, mode):
# line = []
# line = f'\rEpoch {epoch}/ {epochs}'
# ... |
<filename>mmdet2trt/converters/generalized_attention.py
import math
import mmdet2trt
import numpy as np
import torch
import torch.nn.functional as F
from torch2trt_dynamic.torch2trt_dynamic import tensorrt_converter
def get_position_embedding(self,
x_q,
x_kv,
... |
<gh_stars>1-10
import os
import re
from googleplaces import GooglePlaces, types, lang
API_KEY = '<KEY>'
google_places = GooglePlaces(API_KEY)
monthAbbreviations = {'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'}
class InfoExtractor:
date = ''
time = ''
locations = []
... |
<gh_stars>100-1000
"""
Copyright 2019 Samsung SDS
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... |
from __future__ import absolute_import
import cgi
import cStringIO as StringIO
from itertools import islice
import logging
import socket, time, urllib, urlparse
import warnings
from .schema import SolrSchema, SolrError
from .search import LuceneQuery, MltSolrSearch, SolrSearch, params_from_dict
MAX_LENGTH_GET_URL =... |
<reponame>danfunk/r01_dropout<gh_stars>0
import numpy as np
from feature_generation import file_read_and_feature_extract, mindtrails_feature_vector_generation, \
templeton_feature_vector_generation
def model_prediction_testing():
prediction_session_index = 2
platform_list = ['mindtrails', 'templeton']
... |
<reponame>carlabguillen/spack
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Chill(AutotoolsPackage):
"""A polyheadral compiler for autot... |
"""
Common code for the pyslim test cases.
"""
import os
import json
import random
import base64
import pyslim
import tskit
import msprime
import pytest
import attr
import numpy as np
class PyslimTestCase:
'''
Base class for test cases in pyslim.
'''
def verify_haplotype_equality(self, ts, slim_ts):... |
<reponame>YangHee-Min/spinalcordtoolbox
#!/usr/bin/env python
# -*- coding: utf-8
#########################################################################################
#
# Function to segment the multiple sclerosis lesions using convolutional neural networks
#
# -----------------------------------------------------... |
<reponame>lahsuk/sanic-cors
# -*- coding: utf-8 -*-
"""
test
~~~~
Sanic-CORS is a simple extension to Sanic allowing you to support cross
origin resource sharing (CORS) using a simple decorator.
:copyright: (c) 2020 by <NAME> (based on flask-cors by <NAME>).
:license: MIT, see LICENSE for more ... |
<gh_stars>100-1000
from pathlib import Path
from typing import Dict
from rotkehlchen.config import default_data_directory
from rotkehlchen.constants.resolver import strethaddress_to_identifier
from rotkehlchen.globaldb.handler import GlobalDBHandler
from rotkehlchen.utils.misc import timestamp_to_date, ts_now
class ... |
import scipy.io.wavfile
import numpy as np
import matplotlib.pyplot as plt
import time
import librosa
from scipy.fftpack import fft
import multiprocessing
audData, rate = librosa.core.load("../SoundSamples/journey_no_noise_8k.wav", sr = None)
sampData_floor11, rate = librosa.core.load("../SoundSamples/eleven_8k_short.... |
<gh_stars>1-10
import numpy
import random
import spacy
from spacy import displacy
from spacy.util import minibatch, compounding
from spacy.training import Example
from spacy.scorer import Scorer
from sklearn.base import BaseEstimator
from utilities import load_cleaned_data, split_data, DROPOUT, ITERATIONS, draw_prf_gra... |
from rdflib import Graph, Namespace
from rdflib.namespace import XSD, RDF, RDFS, OWL, SH
from rdflib.namespace import NamespaceManager
from rdflib.term import URIRef, Literal, BNode
import collections
import json
from rdflib.collection import Collection
import pkg_resources
from .generator import Generator
"""
current... |
<reponame>Ikomia-dev/ikomia-oakd<gh_stars>0
from pathlib import Path
import depthai as dai
import numpy as np
import cv2
import sys
# Importing from parent folder
sys.path.insert(0, str(Path(__file__).parent.parent.parent)) # move to parent path
from utils.compute import to_planar, get_landmark_3d, get_vector_intersec... |
<reponame>guyfleeman/gem5-website
#!/usr/bin/env python3
#This is a job launch script for boot tests
import os
import sys
from uuid import UUID
from gem5art.artifact.artifact import Artifact
from gem5art.run import gem5Run
from gem5art.tasks.tasks import run_gem5_instance
"""packer = Artifact.registerArtifact(
... |
<filename>src/commons/big_query/copy_job_async/copy_job/copy_job_request.py
from src.commons.big_query.big_query_table import BigQueryTable
from src.commons.big_query.copy_job_async.post_copy_action_request import \
PostCopyActionRequest
class CopyJobRequest(object):
def __init__(self, task_name_suffix, copy_... |
<reponame>orionzhou/biolib<filename>formats/vcf.ase.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import os.path as op
import sys
import logging
from jcvi.apps.base import sh, mkdir
from jcvi.formats.base import must_open
def main(args):
pre = args.fo
if op.isfile(f"{pre}.bcf"):
if not a... |
#!/usr/bin/env python
# Copyright 2016 Samsung Electronics Co., Ltd.
# Copyright 2016 University of Szeged.
#
# 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/lice... |
<filename>tests/test_stack.py
import os
from subprocess import STDOUT
from tempfile import TemporaryDirectory
from unittest import mock
from unittest.mock import call
import kubernetes
import pytest
import yaml
from k8s_app_abstraction.models.pod_controllers import (
Daemonset,
Deployment,
Statefulset,
)
... |
"""
Django settings for api project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
import os
from url... |
<reponame>masumhabib/quest<filename>tests/mini_regression/tmfsc_4Contact.py<gh_stars>1-10
# Simulation parameters
import numpy as np
import os
from math import sqrt
from math import pi
from math import exp as exponential
# Geometry
# =============================================================================
def se... |
import os
from datetime import datetime
import time
import argparse
import torch
from torch.utils.data import DataLoader
from torchvision import transforms
import torch.distributed as dist
from torch.utils.data.distributed import DistributedSampler
from torch.nn.parallel import DistributedDataParallel as DDP
from torc... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
<gh_stars>0
import torch, pickle, os
from torch.utils.data import Dataset
use_cuda = torch.cuda.is_available()
import numpy as np
import pandas as pd
from sklearn.utils import shuffle as sk_shuffle
import random as rd
class pretrainDataset:
def __init__(self, file_path, training=True):
with open(file_pat... |
<reponame>zhanzju/bsl
{
'variables': {
'bsltf_sources': [
'bsltf_allocbitwisemoveabletesttype.cpp',
'bsltf_alloctesttype.cpp',
'bsltf_bitwisemoveabletesttype.cpp',
'bsltf_convertiblevaluewrapper.cpp',
'bsltf_degeneratefunctor.cpp',
'bsltf_enumeratedtesttype.cpp',
'bsltf_e... |
# -*- coding: utf-8 -*-
# @Time : 2019-02-22 23:50
# @Author : <NAME>
# @Email : <EMAIL>
import requests
import json
import smtplib
import time
import os
from email.mime.text import MIMEText
from email.header import Header
from db.db_manager import DatabaseManager
from config import mail_host, mail_user, mail_p... |
<filename>tests/test_computations.py
# Copyright 2014 <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 applicab... |
<filename>required_scripts/addRC_to_Delly_VCF_f4d178e.py
from multiprocessing import Process, Queue, cpu_count
import pysam, sys
import getopt
import fileinput
from sys import argv # Used to bring in the feature argv, variables or arguments
def main(scriptname, argv):
vcf = '' ; tbam = '' ; nbam = '' ; slo... |
<reponame>julinas/town-sim-py
# BSD 3-Clause License
#
# Copyright (c) 2019, Augmented Design Lab
# All rights reserved.
import math
from lot import Lot
from util import Type, get_line
def get_closest_point(node, lots, road_segments, road_type, leave_lot, correction=5):
# check if road can leave lot
(x, y) = (node.... |
# Copyright (c) 2020, 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 appli... |
# -*- coding: utf-8 -*-
# Copyright (C) 2019, QuantStack
# SPDX-License-Identifier: BSD-3-Clause
# conda env equivalent environment creation
from __future__ import absolute_import, print_function
from os.path import basename
import os
from conda._vendor.boltons.setutils import IndexedSet
from conda.base.context imp... |
<filename>dragon/python/core/util/six.py
# Copyright (c) 2010-2019 <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 u... |
<filename>temporary/cli_header.py
# cli.py Test of socket. Run on Pyboard D
import gc
gc.collect()
import usocket as socket
import uasyncio as asyncio
import ujson as json
import errno
gc.collect()
import network
import ubinascii
import machine
import uio
MY_ID = ubinascii.hexlify(machine.unique_id()).decode()
PORT... |
<gh_stars>0
# Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this s... |
<reponame>sanyaade-teachings/cep<gh_stars>100-1000
"""
This example demonstrates how to accelerate a facemesh estimation operation
using multiple oak-d cameras. First, frames are grab by one oak-d camera in constant
time. Then they are sent to 3 oak-d cameras for inference with an offset from each
other. The offset is... |
<reponame>rcamuccio/Zeus<gh_stars>0
# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Zeus Weather System
Date: 29 Mar 2020
Last update: 16 Jul 2021
"""
__author__ = "<NAME>"
__version__ = "2.0.0"
import json
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import os
import requests
import ti... |
import pandas
import xmltodict
import os
from urllib import parse
from app.modules.baseClient import BaseClient
from .models.BusStation import BusStation
from .models.BusRoute import BusRoute
from .models.BusStationAround import BusStationAround
from .models.UlsanArrival import UlsanBusArrival
from .KoreaBIS import Ko... |
<reponame>kding1225/PackDet<gh_stars>1-10
import itertools
import torch
import torch.nn.functional as F
from torch import nn
from core.layers import ConvBlock, NoopLayer
from core.utils.registry import Registry
from core.modeling.rpn.utils import meshgrid
MONTAGE_BOXES = Registry()
# register levels
MONTAGE_LEVELS = ... |
import numpy as np
from sklearn.neighbors import NearestNeighbors
from sklearn.base import check_array
from adapt.base import BaseAdaptEstimator, make_insert_doc
from adapt.utils import set_random_seed
@make_insert_doc()
class NearestNeighborsWeighting(BaseAdaptEstimator):
"""
NNW : Nearest Neighbors Weighti... |
<reponame>Rapid-Design-of-Systems-Laboratory/beluga-legacy
from beluga.visualization.renderers import BaseRenderer
from bokeh.plotting import *
from bokeh.palettes import *
from bokeh.models import HoverTool
import webbrowser
class Bokeh(BaseRenderer):
def __init__(self, filename='plot.html'):
self._figur... |
import numpy
import sys
from Utils.conjugate_gradient_method import conjugate_solver
home_dir = '../../../'
sys.path.append(home_dir)
class ACCADELogisticExecutor:
def __init__(self, x_mat, y_vec):
self.s, self.d = x_mat.shape
self.x_mat = x_mat
self.y_vec = y_vec
self.w = numpy.... |
from pathlib import Path
import os
import time
import cv2
import numpy as np
from Model import Model
from EfficientDet.utils import preprocess_image
from EfficientDet.utils.anchors import anchors_for_shape
class EffModel(Model):
def __init__(self,
engine,
size=640,
... |
<gh_stars>0
import requests
from bs4 import BeautifulSoup
from requests.exceptions import ConnectionError, TooManyRedirects
from raccoon_src.utils.web_server_validator import WebServerValidator
from raccoon_src.utils.request_handler import RequestHandler
from raccoon_src.utils.help_utils import HelpUtilities
from... |
<reponame>PacktPublishing/Learning-Python-Artificial-Intelligence-by-Example
"""
Data generators for loading training, validation and test data sets
"""
import pandas as pd
import numpy as np
import cv2
import os
import scipy.misc
from keras.utils import Sequence
def get_image(image_path, crop_position=100, image_s... |
<reponame>ahti87/waldur-mastermind<gh_stars>0
import base64
import datetime
import logging
import os
import traceback
from io import BytesIO
import pdfkit
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django... |
import anndata
import dask.array
import h5py
import numpy as np
import os
import pytest
import scipy.sparse
from sfaira.data import load_store
from sfaira.unit_tests.data_for_tests.loaders import PrepareData
@pytest.mark.parametrize("store_format", ["h5ad", "dao", "anndata"])
def test_fatal(store_format: str):
... |
<filename>hardware/models.py<gh_stars>1-10
from datetime import timedelta
from app import hackathon_variables
from django.db import models
from django.utils import timezone
from user.models import User
class ItemType(models.Model):
"""Represents a kind of hardware"""
# Human readable name
name = models.... |
<gh_stars>100-1000
import unittest
import numpy as np
from skfem.mesh import MeshHex, MeshQuad, MeshTri
from skfem.element import ElementHex1, ElementQuad1, ElementHex2
from skfem.assembly import FacetBasis
from skfem.mapping.mapping_mortar import MappingMortar
class TestIsoparamNormals(unittest.TestCase):
"""Te... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmdet.models import HEADS
@HEADS.register_module()
class ImageSegHead(nn.Module):
def __init__(self, img_feat_dim, seg_pts_dim, num_classes, lidar_fc=[], concat_fc=[], class_weights=None):
super(ImageSegHead, self).__init__()
... |
#! /usr/bin/python3
"""
This file contains GUI code for Configuring of SBS Servo
Developed by - SB Components
http://sb-components.co.uk
"""
from lora_hat import LoraHat
import logging
import os
from tkinter import font
import tkinter as tk
from tkinter import messagebox
import webbrowser
if os.name == "posix":
... |
from enum import Enum
import click
import requests
from bs4 import BeautifulSoup
import agent
from constants import ANIME_STATUS_MAP, ANIME_TYPE_MAP, MANGA_STATUS_MAP, MANGA_TYPE_MAP
import network
import ui
class ListSearchStatusCode(Enum):
""""An Enum represented the type of result of list searches"""
NO_... |
<gh_stars>1-10
import datetime
import json
import os
import requests
import random
import threading
import logging
from flask import Flask
from flask import request
from pymongo import MongoClient
from routing import configuration
from routing import graph
from routing import osm_handler
from routing.utils import bring... |
# MIT License
#
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 VMware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
<gh_stars>0
from models.networks import IntroVAE
from IAF.IAF import IAF_flow
import torch
from models.networks_v2 import *
from IAF.layers.utils import accumulate_kl_div, reset_kl_div
class DIF_net(IntroVAE):
def __init__(self,cdim=3,
hdim=512,
channels=[64, 128, 256,... |
#! /usr/bin/python3
def HE():
q = 0
decimal1 = q
m = 0
decimal2 = m
c = 0
decimal3 = c
fi = 0
decimal4 = fi
ini = 0
decimal5 = ini
dt = 0
s = input('What are we solving for? (q, m, c or ΔT): ').lower()
if s == "q":
if decimal2 is str:
m = int(inp... |
import argparse
import numpy as np
import pandas as pd
import os
from tqdm import tqdm
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.distributed import DistributedSampler
import torch
import random
import pickle
from ... |
<gh_stars>0
# --------------------------------------------------------
# Subcategory CNN
# Copyright (c) 2015 CVGL Stanford
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
import numpy as np
import math
from fast_rcnn.config impo... |
#!/usr/bin/env python
import io
import sys
opcodes = {
'NOP': (0xF1, ''),
'RET': (0xF2, ''),
'IL': (0xF3, ''),
'IU': (0xF4, ''),
'INT': (0x81, 'R'),
'LPC': (0x82, 'R'),
'LSP': (0x83, 'R'),
'LIP': (0x84, 'R'),
'LCR': (0x85, 'R'),
'NOT': (0x86, 'R'),
'PUS': (0x87, 'R'),
... |
<reponame>zhenv5/fedlearner
# Copyright 2020 The FedLearner Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... |
# coding: utf-8
from __future__ import absolute_import
import datetime
import re
import importlib
import six
from huaweicloudsdkcore.client import Client, ClientBuilder
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcore.utils import http_utils
from huaweicloudsdkcore.sdk_stream_request imp... |
<gh_stars>1-10
#!/usr/bin/env python3
import lsimpy
from bench_utils import *
lsim = lsimpy.LSimContext()
HIGH = lsimpy.ValueTrue
LOW = lsimpy.ValueFalse
NONE = lsimpy.ValueUndefined
def test_sr_latch():
truth_table = [
[{'R': HIGH, 'S': LOW}, {'Q': LOW, '/Q': HIGH}],
[{'R': LOW, 'S': LOW}, ... |
from .expression import (
EqualityExpression,
InExpression,
BetweenExpression)
class DynamoDataType(object):
"""Abstract class for all DataTypes
A DynamoDataType defines a column on the Model. They should be classlevel attributes
that are used build models and supplement any sort of Request pe... |
"""Providing a richer backup system than just every hour for 4 days.
In this file, we attempt to provide backups as follows:
1 backup per hour for 24 hours.
1 backup per day for 7 days
1 backup per week for 4 weeks
1 backup per month for 6 months.
"""
import subprocess
import datetime
import itertool... |
<reponame>AntonBankevich/LJA
# (c) 2020 by Authors
# This file is a part of centroFlye program.
# Released under the BSD license (see LICENSE file)
import logging
from collections import defaultdict, Counter
from config.config import config
import networkx as nx
import numpy as np
from sequence_graph.seq_graph impo... |
<reponame>shenzhuxi/node-spatialite<filename>src/spatialite/deps/geos/binding.gyp
{
'target_defaults': {
'default_configuration': 'Debug',
'configurations': {
'Debug': {
'defines': [ 'DEBUG', '_DEBUG' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, ... |
<gh_stars>0
from operator import mul
from sympy.core.sympify import _sympify
from sympy.matrices.common import (NonInvertibleMatrixError,
NonSquareMatrixError, ShapeError)
from sympy.polys.constructor import construct_domain
class DDMError(Exception):
"""Base class for errors raised by DDM"""
pass
clas... |
<filename>dataset_tools/datasets/detection_dataset.py
import os
import json
from collections import OrderedDict
from . import _getters
class DetectionDataset(object):
def __init__(self, dataset_file, root_dir=None, classes=None):
"""
Dataset for detection and segmentation tasks
Either lo... |
<filename>4-1.Seq2Seq/Seq2Seq-Tensor.py<gh_stars>1000+
'''
code by <NAME>(<NAME>) @graykode
reference : https://github.com/golbin/TensorFlow-Tutorials/blob/master/10%20-%20RNN/03%20-%20Seq2Seq.py
'''
import tensorflow as tf
import numpy as np
tf.reset_default_graph()
# S: Symbol that shows starting of decoding inp... |
# Copyright (c) 2011, <NAME> <<EMAIL>>
# 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 condition... |
<reponame>abdellaui/des_pipeline_ui
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main2.ui'
#
# Created by: PyQt5 UI code generator 5.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def... |
<filename>tests/tests_config.py
#
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
<gh_stars>1-10
"""
@author: <NAME>
@brief: graph utils for optimized code generation.
"""
import matplotlib.pyplot as plt
import sympy
"""
Computes the nodes and rank them based on their in node degree and out node degree threshold values.
"""
def sorted_nodes_by_in_degree(expr_g,thresh_in,thresh_out=0):
G=ex... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import glob
import itertools
import landvoc
import time
import io
import json
from llr.LandLibraryResource import LandLibraryResource
import llr.utils as llrutils
import utils
from langdetect import detect
from langdetect.lang_detect_exception import LangDetectException
LANDVO... |
<reponame>larrycameron80/python-novaclient
# Copyright 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.... |
# In[] Libs
import numpy as np
import matplotlib.pyplot as plt
from neural_network_classes.layers import Dense
from neural_network_classes.activations import ReLU, Softmax
from neural_network_classes.error_estimation import CategoricalCrossentropy, Accuracy
from utils.generate_dataset import generate_spiral_data, gener... |
import os
import re
import json
def ltom(list):
map = dict()
i = 0
for name in list:
map[name] = i
i += 1
return map
# Wake up is not on all thermostats, so should only be included when supported
# https://www.ecobee.com/home/developer/api/documentation/v1/objects/Climate.shtml
# Sho... |
<reponame>RubenJ01/blues_bot.py
import discord
from discord.ext import commands
from calcs.agility import Agility
from calcs.alchemy import Alchemy
from calcs.experience import next_level_string
from calcs.tasks import Tasks
from calcs.wines import Wines
from calcs.wintertodt import Wintertodt
from calcs.zeah import Z... |
from .tolact import ShapeTool
from sciapp.object import *
from numpy.linalg import norm
import numpy as np
def mark(shp, types = 'all'):
pts = []
if not (types=='all' or shp.dtype in types): return pts
if shp.dtype == 'point':
pts.append([shp.body])
if shp.dtype == 'points':
pts.append(shp.body)
if shp.dtype ... |
# -*- coding: utf-8 -*-
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
<reponame>LiuHaolan/models
import oneflow as flow
from oneflow import nn
from typing import Any
__all__ = ["PoseNet", "posenet"]
class BasicConv2d(nn.Module):
def __init__(self, input_channels, output_channels, **kwargs):
super().__init__()
self.conv = nn.Conv2d(input_channels, output_channels, ... |
<gh_stars>0
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# ------------------------------------------------------------------------------
from __future__ import absolute_import
from __future__ ... |
<gh_stars>1-10
"""Responsible for rendering markdown content to HTML."""
from typing import Callable, Optional, Mapping, Union, Tuple, List
import re
import warnings
from functools import wraps
import xml.etree.ElementTree as ET
from markdown import markdown, Markdown
from markdown.extensions import Extension
from mar... |
<filename>Final/problem7.py
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 27 15:09:50 2021
@author: akladke
"""
### Do not change the Location or Campus classes. ###
### Location class is the same as in lecture. ###
class Location(object):
def __init__(self, x, y):
self.x = x
self.y = y
d... |
<reponame>BIAOXYZ/bigchaindb
from bigchaindb.common.exceptions import (InvalidSignature, DoubleSpend,
InputDoesNotExist,
TransactionNotInValidBlock,
AssetIdMismatch, AmountError,
... |
<reponame>NASA-IMPACT/covid-api
""" Dataset metadata generator lambda. """
import datetime
import json
import os
import re
from typing import Any, Dict, List, Optional, Union
import boto3
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
DATASETS_JSON_FILEPATH = os.path.join(BASE_PATH, "datasets")
SITES_JSON_FIL... |
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
try:
from utils.priority_queue import PriorityQueue
except:
raise
from pathfinding.heuristic import euclidean_cost
from math import sqrt, inf
from itertools import product
import numpy as np
def reconstruct_path_to_desti... |
<reponame>gilbertekalea/booking.com_crawler
# DO NOT EDIT THIS FILE!
#
# This file is generated from the CDP specification. If you need to make
# changes, edit the generator and regenerate all of the modules.
#
# CDP domain: DOMStorage (experimental)
from __future__ import annotations
from .util import event_class, T_J... |
"""Auto ARIMA transformer is a time series transformer that predicts target using ARIMA models."""
# For more information about the python ARIMA package
# please visit https://www.alkaline-ml.com/pmdarima/index.html
import importlib
import numpy as np
import pandas as pd
import datatable as dt
from sklearn.preprocess... |
<filename>src/Application/PythonScriptModule/pymodules_old/lib/webdav/Connection.py<gh_stars>0
# pylint: disable-msg=W0142,W0102,R0901,R0904,E0203,E1101,C0103
#
# Copyright 2008 German Aerospace Center (DLR)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.