text stringlengths 3.07k 22.1k |
|---|
import getpass
import sys
import subprocess
import os
import http.client
import json
import time
import platform
from system_server.version_check import is_container_uptodate
# def deploy_local_cam():
# check_gcp_login()
# exists = os.path.isfile('cloud_config/input.tfvars')
# if not exists:
# sys.... |
"""Implicit Symbolic Regression
Explicit symbolic regression is the search for a function, f, such that
f(x) = constant. One of the most difficult part of this task is avoiding
trivial solutions like f(x) = 0*x.
The classes in this module encapsulate the parts of bingo evolutionary analysis
that are unique to implic... |
import datetime
from flask import Blueprint, render_template, request, \
jsonify, abort, flash, url_for, redirect, escape
from flask_login import login_required, current_user
from flask_babel import _ # gettext
from app import db
from app.decorators import require_role, require_membership
from app.forms import i... |
#-------------------------------------------------------------------------------
#
# Insteon EZRain V1 #5010A
#
import iofun
import message
import time
from device import Device
from switch import Switch
from querier import Querier
from querier import MsgHandler
from threading import Timer
from linkdb import *
from d... |
from datetime import datetime
from textwrap import dedent
from types import FunctionType
from scheme import Field, Format, Structure, Text
from bake.environment import *
from bake.exceptions import *
from bake.util import *
try:
import repr as reprlib
except ImportError:
import reprlib
__all__ = ('Task', 'T... |
import os
import numpy as np
import matplotlib.image as mpimg
import tensorflow as tf
from projection_utils import get_axismatrix, projection_to_rgb
AUTOTUNE = tf.data.experimental.AUTOTUNE
# Change these variables if needed.
ROOT_DIR = '/home/chidubem/deep-3d-reconstruction/scannet/scans/'
BATCH_SIZE = 2
HEIGHT = 9... |
# Copyright 2020 Toyota Research Institute. All rights reserved.
import torch
import numpy as np
from abc import ABC, abstractmethod
class AwarenessEstimator(ABC):
def __init__(self, road_images=None, gaze_inputs=None):
"""
Base class for different types of awareness estimation. Examples of diff... |
from analysis_network_generator import *
from max_flow_generator import *
import matplotlib.pyplot as plt
import numpy as np
import copy
import os
def testFileCreation(network, graphNum, graphType):
'''
A class that creates an output dot file based on the test network created
network - the test_network_ge... |
import os
import sys
import ast
import inspect
from tree_sitter import Language, Parser
tree_sitter_python_file = os.path.join(os.path.dirname(inspect.getfile(sys.modules[__name__])), 'tree-sitter-python.so')
if not os.path.isfile(tree_sitter_python_file):
os.system('git clone --depth 1 https://github.com/tree-sit... |
"""
Interface for the vulnerabilities subsystem.
This component of the engine is hydrated by data from feeds or a local source.
The evaluation and model side of the system are specific to the data, so this is a layer on top of the
general feeds implementation as it consumes the feed data. Other components should inte... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
ssobj --- Solar System objects.
===============================
Classes
-------
SolarSysObject
Functions
---------
getgeom
getspiceobj
getxyz
summarizegeom
"""
import numpy as np
import astropy.units as u
from astropy.tim... |
# -*- coding: utf-8 -*-
# Copyright 2012-2021 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
from chainer.utils import type_check
import numpy
from PyQt5 import QtCore
from PyQt5 import QtWidgets
from chainer_wing.subwindows.prediction import Ui_PredictionWindow
from chainer_wing.subwindows.train_config import TrainParamServer
from chainer_wing.runner import ImagePredictionRunner
from chainer_wing.... |
""" raspinfo
parse and display eng (engine) files
"""
import sys
import math
import argparse
from collections import namedtuple
VERSION = '5.0'
ENG_NAME = "rasp.eng" # name of engine database file
CH1 = '#'
engine_info = {
"t2": ("thrust duration", "seconds"),
"m2": ("propellant wt", "kilograms"),
"wt":... |
"""Helper class which collect and call to database for writing"""
from ncclient import manager
import xmltodict
import ipaddress
import DbOperations as DbOps
import GetWithNetmiko as GetWithNetmiko
import connection as ConnectWith
def is_instance(list_or_dict):
""""""
if isinstance(list_or_dict... |
# Check manifest files for missing id's
import argparse
import configparser
import json
import logging
import os
import sys
from libs.search_record_ids import ExtendedSearchId
from libs.constants import MASTER_DATA_SECTION, REFERENCE_DATA_SECTION # , \
# DATA_SECTION, DATASETS_SECTION, WORK_PRODUCT_SECTION, WORK_PR... |
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem, DataStructs, Draw
from multiobj_rationale.fuseprop import find_clusters, extract_subgraph
import os
def get_fingerprint(mol):
info = {}
features_vec = AllChem.GetMorganFingerprintAsBitVect(mol, 2, nBits=2048, bitInfo=info)
return fe... |
import time
import argparse
import signal
import sys
import serial
import csv
import datetime
from globalvalues import RPI
if RPI:
import RPi.GPIO as GPIO
from auxiliaries import Config, PublicKey
from auxiliaries import datetime_from_epoch, set_verbosity
from sender import ServerSender
from data_handler_aq impor... |
from __future__ import print_function
import scipy.spatial.distance as ssd
import itertools as itl
import numpy as np
from .fslatm import calc_sbot
from .fslatm import calc_sbot_local
from .fslatm import calc_sbop
from .fslatm import calc_sbop_local
import ase
T, F = True, False
def get_boa(z1, zs_):
return z... |
#-------------------------------------------------------------------------------#
# Copyright (C) 2020-2021 ETH Zurich, Switzerland, University of Bologna, Italy.#
# All rights reserved. #
# ... |
# -*- coding: utf-8 -*-
# @Time : 2020/8/29 9:26
# @Author : KevinHoo
# @Site :
# @Title : (Threads)Youtube SingnatureCipher Decryptor
# @File : main.py
# @Software: PyCharm
# @Email : <EMAIL>
import dictTraversal
import json
import configparser
from os import system
from re import compile, findall, S
from urllib impor... |
import functools
from django.db import IntegrityError
from django.core.exceptions import ValidationError
from rest_framework import serializers
from rest_framework.utils.model_meta import get_field_info
from rest_framework.serializers import raise_errors_on_nested_writes
from rest_framework.utils import model_meta
fr... |
""" Masked tensors to handle batches with mixed node numbers """
import itertools
import functools
import torch
import torch.nn.functional as F
def from_list(tensor_list, dims, batch_name='B', base_name='N'):
"""
Build a masked tensor from a list of tensors
Dims is a tuple of dimensions which should be ma... |
from network import LTE
import utime
import binascii
import ure
import uos
# Values acquired from pycom firmware
# pycom-micropython-sigfox/lib/lwip/src/include/lwip/sockets.h
AF_INET = 2
AF_INET6 = 10
SOCK_STREAM = 1 #not supported
SOCK_DGRAM = 2
SOCK_RAW = 3 #not supported
DNS_SERVER_IP = "8.8.8.8"
DNS_SER... |
# encoding: UTF-8
from __future__ import division
from collections import OrderedDict
from datetime import datetime, timedelta
from six import text_type
import copy
from time import sleep
from vnpy.trader.vtConstant import (DIRECTION_LONG, DIRECTION_SHORT)
from vnpy.trader.uiQt import QtWidgets
from vnpy.trader.app.al... |
#!/usr/bin/env python3
# Simulates an "Aeon's End" (a board game) "Turn Order Deck"
# arg0 - the number of players
import math, random, sys
if len(sys.argv) != 2 or sys.argv[1] not in ['2', '3', '4']:
print ("""
Please provide the number of players to play with. The number of players must be 2, 3, or 4:
... |
import os
import sys
import tempfile
from cyvcf2 import VCF, Writer
import subprocess
import shlex
import pandas as pd
def is_variant(call):
"""Check if a variant position qualifies as a variant
0,1,2,3==HOM_REF, HET, UNKNOWN, HOM_ALT"""
if call == 1 or call == 3:
return True
else:
re... |
#!/usr/bin/env python3
import os, sys
import multiprocessing
import subprocess as sp
import shutil
import shlex
import time
import csv
import json
sys.path.append('/home/jrchang/workspace/gym-OptClang/gym_OptClang/envs/')
import RemoteWorker as rwork
def getMultiAppsTargets(path):
"""
path: the root path for ... |
import build_buy
from bucks.bucks_enums import BucksType
from bucks.bucks_recycling import BucksRecycling
from bucks.bucks_utils import BucksUtils
from event_testing.resolver import SingleSimResolver, SingleActorAndObjectResolver
from interactions import ParticipantType
from interactions.utils.loot_basic_op import Base... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: BSD-2-Clause
'''keygone.py -- A cruddy improvised NTPsec keyfile generator
The number in the group_iterator range is the number of keys to generate
per key type.
key_number starts as the first key number and is incremented.
max_bytes is the im... |
#!/usr/bin/env python
'''
Antenna tracker control module
This module catches MAVLINK_MSG_ID_GLOBAL_POSITION_INT
and sends them to a MAVlink connected antenna tracker running
ardupilot AntennaTracker
<NAME>, based on earlier work by <NAME>
June 2012
'''
import sys, os, time
from MAVProxy.modules.lib import mp_settings
... |
"""IntraSubjectAlignment class is a hack of fmralign pairwise_alignment to replicate Tavor 2016
Care is needed, few changes but tricky ones :
* X and Y have different meanings in fit (different sets of contrasts of same subject)
* X_i and Y_i are transposed before fitting Ridge compared to alignment to predict
Y c... |
from motorized.exceptions import DocumentNotSavedError
import pytest
from motorized import Document, Q
from pymongo.results import UpdateResult
from tests.utils import require_db
from tests.models import Book, Named
@pytest.mark.asyncio
@require_db
async def test_queryset_all():
assert await Book.objects.all() ==... |
from dataclasses import dataclass
from functools import reduce, singledispatch
from typing import Any, Callable, Dict, Hashable, List, Optional
from matcho import (
KeyMismatch,
LengthMismatch,
LiteralMismatch,
Mismatch,
Skip,
TypeMismatch,
CastMismatch,
)
from matcho.bindings import Repeat... |
from grid_box import GridBox
class PortfolioDialog:
def getInitialFileName(self):
return "portfolio"
def getInitialFolder(self):
return preferences.portfolio_last_opened_dir()
def addFormElements(self, master):
self.description = self.... |
import sys
import os
import argparse
import util
import time
import datetime
import threading
import logging
from subprocess import call
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED
from os.path import join, getsize
lock = threading.RLock()
gl_threadTotTime = 0
gl_errorNum = 0
#func defin... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
from typing import Dict, Optional, Tuple
import numpy as np
from stable_baselines.common import vec_env
from imitation.util import rollout
class Buffer:
"""A FIFO ring buffer for NumPy arrays of a fixed shape and dtype.
Supports random sampling with replacement.
"""
capacity: int
"""The number of data s... |
import os
import numpy as np
import time
from collections import deque
import glob
import pickle
import shutil
from copy import deepcopy
import matplotlib.pyplot as plt
import torch
from agents import AgentDDPG, AgentMADDPG
from utilities import get_env_info
def run(env, params):
brain_name, n_agents, state_siz... |
#!/usr/bin/env python
"""
FlowMonitor
Requires openflow.discovery and ecmp
"""
from pox.core import core
import pox.openflow.libopenflow_01 as of
from pox.lib.revent import *
from pox.lib.revent.revent import EventMixin, Event
import pox.lib.util as util
from pox.lib.recoco import Timer
from datetime import datetim... |
#!/usr/bin/python3
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2018 IBM Corp.
import argparse
import sys
from collections import namedtuple, OrderedDict
from enum import Enum, unique
from typing import (
Dict,
NamedTuple,
Iterator,
Sequence,
Union,
Optional,
List,
cast,
... |
import sys, os, io
from apiclient.http import MediaFileUpload
from googleapiclient.http import MediaIoBaseDownload
##------------------------------------------------------------
## User 모듈
##------------------------------------------------------------
sys.path.append(os.path.join(os.path.dirname(__file__), '.')) ## No... |
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... |
try:
import cv2
except ImportError:
pass # skip if opencv is not available
import numpy as np
# === copied from utils/keypoints.py as reference ===
_NUM_KEYPOINTS = -1 # cfg.KRCNN.NUM_KEYPOINTS
_INFERENCE_MIN_SIZE = 0 # cfg.KRCNN.INFERENCE_MIN_SIZE
def heatmaps_to_keypoints(maps, rois):
"""Extra... |
import csv
import gzip
from dataclasses import dataclass
@dataclass
class Job:
"""Structure represenitng one job submitted to the system."""
# fileds known when the job is created (spawned)
solution_id: int
group_id: int # corresponds to the lab group where the student gets the assignments
tlgro... |
import os
from fugue.dataframe.array_dataframe import ArrayDataFrame
from fugue.dataframe.pandas_dataframe import PandasDataFrame
from fugue.dataframe.utils import _df_eq as df_eq
from fugue._utils.io import FileParser, load_df, save_df, _FORMAT_MAP
from fugue.exceptions import FugueDataFrameOperationError
from pytest... |
import pdb
import mmh3
import numpy as np
from numpy.linalg import norm
from scipy import sparse as sp
from sklearn.preprocessing import MinMaxScaler, StandardScaler, normalize
from sklearn.utils import check_array, check_random_state
from sklearn.utils.extmath import safe_sparse_dot
from sklearn.utils.validation impor... |
from urllib.parse import urlencode
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.db.models import F, Q
from django.db.transaction import atomic
from django.urls import reverse
from django.utils.timezone import now
from rest_framework import status
from re... |
# -*- coding: UTF-8 -*-
from time import time
import tkinter
from tetris.game import Game
from tkinter import *
from tkinter import ttk
from tetris.block import *
import time
from tetris.dbdao.baseDao import *
def start():
initDb()
# dao = BaseDao()
# # rs = dao.select("gameLists",{"page": 1, "size":2, "le... |
#! /bin/python
import os
import sys
import json
import pickle
from concurrent import futures
# this is a task called by multiple processes,
# so we need to restrict the number of threads used by numpy
from elf.util import set_numpy_threads
set_numpy_threads(1)
import numpy as np
from elf.io.label_multiset_wrapper imp... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © %YEAR% <>
#
# Distributed under terms of the %LICENSE% license.
"""
"""
import sys
import logging
import paramiko
logger = logging.getLogger(__name__)
import argparse
import socket
import os
from stat import S_ISDIR
class SSHSession(o... |
import requests, random, time, rsa, hashlib, base64, re, json
from binascii import b2a_hex
from urllib.parse import quote
import redis
class WeiBo(object):
def __init__(self):
self.session = requests.Session()
self.headers = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64... |
import hashlib
import hmac
import json
import logging
import time
from random import random
from urllib.parse import parse_qs
from urllib.parse import splitquery
from urllib.parse import urlencode
from urllib.parse import urlparse
from cryptojwt.jws.utils import alg2keytype
from oidcservice import sanitize
from oid... |
from __future__ import print_function
import pickle
import os.path
import os
import re
import io
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from googleapiclient.http import MediaFileUpload
from googleapiclient.htt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import copy
from itertools import product
import torch
import torch.nn.functional as F
from ptranking.ltr_adhoc.eval.parameter import ModelParameter
from ptranking.ltr_adversarial.base.ad_machine import AdversarialMachine
from ptranking.ltr_adversarial.pointw... |
import torch
from torch import nn, autograd
from tqdm import tqdm, trange
import numpy as np
from math import *
from hessian import *
import torch.nn.functional as F
import torch.distributions as dist
from backpack import backpack, extend, extensions
from scipy.linalg import block_diag
from backpack.hessianfree.ggnvp i... |
import glob
import os
import threading
from datetime import datetime
from random import choice
from uuid import uuid1
from notion.block import TextBlock, ImageBlock, TodoBlock, AudioBlock
import_start_time = datetime.now()
def logger(*args):
print(datetime.now() - import_start_time, threading.current_thread().n... |
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from models.operations import Identity, drop_path, candidateNameList, candidateOpDict, ReLUConvBN, FactorizedReduce
from collections import namedtuple
import utils
Genotype = namedtuple('Genotype', 'normal reduce')
#
class MixedO... |
# -*- coding: utf-8 -*-
# @Time : 2019/1/20 14:50
import re
import fnmatch
import os
def load_qadata(qa_dir):
"""
:param qa_dir: the file path of the provided QA dataset, eg: /data/preprocessed_data_10k/test;
:return: the dictionary of the QA dataset, for instance QA_1_;
"""
print("begin_load... |
from socket import *
import sys, time, threading
def hash_func(num):
return num%256
class Peer():
def __init__(self, me, suc1, suc2):
self.me = me
self.suc1 = suc1
self.suc2 = suc2
self.pred1 = 0
self.pred2 = 0
def setsuc1(self,suc1):
self.suc1 = suc1
... |
import json
import requests
import xml.etree.ElementTree as ET
# This class implements a wrapper on the User Modeling service
class RelationshipExtraction:
API_RELATIONSHIP = "https://gateway.watsonplatform.net/relationship-extraction-beta/api"
def __init__(self, user, password):
self.user = user
... |
import numpy as np
import os
import glob
import time
import shutil
import pathlib
import psutil
import tempfile
from tqdm import tqdm
import subprocess
import logging
import cv2
try:
from pathlib import Path
except ImportError:
from pathlib2 import Path # python 2 backport
logger = logging.getLogger('LoadSeqFile... |
import nose.tools as nt
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
fX = theano.config.floatX
def test_function_combine_node_serialization():
tn.check_serialization(tn.InputFunctionCombineNode("a"))
def test_concatenate_node_serialization():
tn.chec... |
import torch
import torch.nn as nn
from torchvision.models.resnet import resnet50
from model.resnet import ResNet50
import math
import numpy as np
class Bottleneck(nn.Module):
expansion = 4
def __init__(self, inplanes, planes, kernel_size=3, stride=1, padding=1, downsample=None):
super(Bottleneck, se... |
import os
from app import graph_manager, db
from app.admin import bp
from flask import render_template, redirect, url_for, jsonify, current_app, request, abort
from app.admin.forms import LiteratureForm, StructuredDrugbankForm, StructuredOboForm
from flask_login import login_required, current_user
from functools import... |
# Copyright (C) 2019 <NAME>, <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 ... |
import cv2
import numpy as np
import os
from collections import namedtuple
from torch.utils.data import Dataset
from pysot.core.config import cfg
from tqdm import tqdm
from pysot.datasets.otb import OTBDataset
from pysot.datasets.anchor_target import AnchorTarget
from pysot.datasets.augmentation import Augmentation
f... |
from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from teacher.models import *
from student.models import *
from datetime import date, datetime, timedelta
from icalendar import Calendar, Event
import json
import... |
from graphics import *
from time import sleep
# Button Variables
EMPTY_AREA_SIZE = 10 # The empty area between buttons
buttonList = [] # Using for managing buttons
RBS = True # reverse button statue: false negative, true positive
# Frame Variables
WIDTH = 320 + EMPTY_AREA_SIZE
HEIGHT = 500 + EMPTY_AREA_SI... |
import pandas as pd
import numpy as np
from sklearn.cross_validation import KFold, train_test_split
from sklearn import metrics
from sklearn.ensemble import RandomForestRegressor, ExtraTreesRegressor, GradientBoostingRegressor
from sklearn.linear_model import RidgeCV, LogisticRegressionCV, LogisticRegression, Ridge, La... |
#!/usr/bin/env python
# -*- mode: python; -*-
import argparse
import io
import json
import os
import re
import shutil
import subprocess
import tempfile
import urllib.request
TEMPLATE = os.path.join(os.path.dirname(__file__), 'template')
peer_re = re.compile(r' requires a peer of (?P<peer>[^ ]*) but none is installed... |
from django.db import models
from django.core.exceptions import ValidationError, ObjectDoesNotExist,\
MultipleObjectsReturned
from django.db import IntegrityError
from teams.models import Team
from jsonfield import JSONField
import re
from properties.models import AvailableLanguage, VersionList, DockerText
from... |
# Copyright 2016 The TensorFlow 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
#
# Unless required by applica... |
import torch
import torch.nn as nn
from torch.nn.modules import BCELoss, CrossEntropyLoss, MSELoss
class ObjectLoss(nn.Module):
def __init__(self, threshold=0.5, noobj_weight=0.5, obj_weight=1):
super(ObjectLoss, self).__init__()
self.threshold = threshold
self.noobj_weight = noobj_weight... |
"""
Copyright (C) 2021 NVIDIA Corporation. All rights reserved.
Licensed under The MIT License (MIT)
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 limitat... |
# Define models
# init_nerf_model creates the NeRF baseline and is copied from the original NeRF code
import os
import sys
import tensorflow as tf
import numpy as np
import imageio
import json
# Model architecture
def init_nerf_model(D=8, W=256, input_ch=3, input_ch_views=3, output_ch=4, skips=[4], use_viewdirs=Fals... |
import numbers
from collections.abc import Iterable
import typing
import logging
from enum import IntEnum
import numpy
from .universe import Universe
from .typed import TypedAttr
from hydep.internal import Boundaries
from .exceptions import GeometryError
__all__ = ("Model", "Symmetry")
__logger__ = logging.getLogg... |
import numpy as np
from scipy import signal
from scipy.ndimage.filters import gaussian_filter1d
##############################################
########### Wavelet Transform ################
##############################################
def my_cwt(data, frequencies, dt, w0=6.):
"""
wavelet transform with norm... |
from discord.ext import tasks, commands
import discord
import random
import json
import math
import asyncio
import sqlite3
from discord.utils import get
from disputils import BotConfirmation, BotMultipleChoice
from discord_components import (
DiscordComponents,
Button,
ButtonStyle,
Select,
SelectOpt... |
# IMAGE CLASSIFIER COMMAND LINE APPLICATION
# train.py
#
# Usage:
# python train.py --data_dir flowers --save_dir rabbit_foot --learn_rate 0.01
#
# PROGRAMMER: <NAME>
# DATE CREATED: February 12, 2019
# REVISED DATE:
# PURPOSE:
# Train... |
#
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD.
# See https://nomad-lab.eu for further info.
#
# 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/lic... |
from dataclasses import replace
from tika import parser
import utils
import json
from datetime import datetime
import pandas as pd
pd.set_option('display.max_columns', None)
pd.set_option('display.width', None)
def get_meta_indices(alist):
for index, item in enumerate(alist):
if "AUSFAHRLISTE" in item:
... |
# GUI Front-end for the SMT_simulator
# built using Kivy (https://kivy.org/#home)
# Author: <NAME>
# Kivy-related imports:
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.gridlayout import GridLayout
from kivy.uix.widget import Widget
from kivy.uix.label import Label
from kivy.uix.button impor... |
# TODO decide whether include MAX PV and MAX ST or the percentage of area usage
import pandas as pd
import os
def create_decentral_overview(components_csv_data):
# defining columns of the sheet including decentralized components
decentral_columns = ["Building", "PV 1", "Max. PV 1", "PV 2", "Max. PV 2... |
import os
import time
import numpy as np
import pandas as pd
import torch
import torch.utils.data as data
from skimage import io, transform
from sklearn.utils.class_weight import (compute_class_weight,
compute_sample_weight)
def default_loader(path):
return io.imread(path... |
#!/usr/bin/env python
#
# Copyright 2019 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
""" Gathers the Blender objects from the current scene and returns them as a list of
Model objects. """
import bpy
import bmesh
import math
from enum import Enum
from typing import List, Set, Dict, Tuple
from .msh_scene import Scene
from .msh_material_to_blend import *
from .msh_model import *
from .msh_skeleton... |
from .utils import PyKEArgumentHelpFormatter
import math
import numpy as np
from matplotlib import pyplot as plt
from astropy.io import fits as pyfits
from . import kepio, kepmsg, kepkey, kepstat
from astropy.stats import LombScargle
__all__ = ['kepperiodogram']
def kepperiodogram(infile, outfile=None, datacol='PDCS... |
import os
import time
import random
import numpy as np
import torch.utils.data as data
from torch.utils.data import DataLoader
from DSSM_util import Config
class TF_IDF_Train_Dataset(data.Dataset):
def __init__(self, config: Config):
super(TF_IDF_Train_Dataset, self).__init__()
self.K = config.neg... |
# SIPEC
# MARKUS MARKS
# Dataloader
import keras
import numpy as np
from imblearn.under_sampling import RandomUnderSampler
from sklearn import preprocessing
from tqdm import tqdm
def create_dataset(dataset, look_back=5, oneD=False):
dataX = []
print("creating recurrency")
for i in tqdm(range(look_back, le... |
import gym
import numpy as np
import pandas as pd
import wandb
import time
import cv2
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import matplotlib.pyplot as plt
from dataclasses import dataclass
from typing import Any
from collections import deque
from... |
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "thresher_backend.settings")
import django
django.setup()
from django.db import connection
from django.conf import settings
from django.db import transaction
import logging
logger = logging.getLogger(__name__)
import json
from itertools import groupby
import r... |
# pyre-ignore-all-errors
# Copyright (c) The Diem Core Contributors
# SPDX-License-Identifier: Apache-2.0
from dataclasses import dataclass, field
from typing import Optional, Dict, List, Union, Tuple, cast
import requests
from diem.identifier import decode_account
from diem.jsonrpc import Event
from diem.testnet im... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
#!/usr/bin/env python
'''
Author: Ajinkya
Date: 2018/11/20
Description: This script reads the live camera feed and allows you to set HSV params.
NOTE: Also usable remotely, using keyboard
Credits and source: https://botforge.wordpress.com/2016/07/02/basic-color-tracker-using-opencv-python/
0: hMIN
1: hMA... |
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
import numpy as np
import pandas as pd
from scipy.optimize import minimize
import scipy.stats
import time
from mls import plot_rosenbrock, plot_posterior
#- Optimization
#- Derivatives
#- 1. by hand
def f(x):
return np.cos(np.exp(x)) / x ** 2
def f... |
from dassl.engine import TRAINER_REGISTRY
from dassl.engine.trainer import TrainerMultiAdaptation
from dassl.data import DataManager
from dassl.utils import MetricMeter
from torch.utils.data import Dataset as TorchDataset
from dassl.optim import build_optimizer, build_lr_scheduler
from dassl.utils import count_num_para... |
"""Test a specific audio driver (either for platform or silent). Only checks the use of the
interface. Any playback is silent."""
from __future__ import absolute_import, print_function
from tests import mock
import queue
import pytest
import time
import pyglet
_debug = False
pyglet.options['debug_media'] = _debug
pyg... |
# -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
__license__ = 'MIT'
__copyright__ = '2014, FBReader.ORG Limited <<EMAIL>>'
import platform
from PyQt5.Qt import (
QObject, QSettings, QByteArray, QNetworkCookie, QNetworkCookieJar, QUrl)
from contextlib im... |
import datetime
import logging
import requests
from ask_sdk_core.dispatch_components import AbstractRequestHandler, AbstractExceptionHandler
from ask_sdk_core.utils import is_request_type, is_intent_name, request_util
from ask_sdk_model import Response
from ask_sdk_model.ui import SimpleCard, LinkAccountCard
from ask... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.