text stringlengths 3.07k 22.1k |
|---|
import logging
import os
import subprocess
import time
import click
import dotenv as de
import pandas as pd
import parallel as par
de.load_dotenv(de.find_dotenv(usecwd=True))
def __subprocess_run(cmd):
try:
logging.debug(cmd)
subprocess.check_output(
cmd,
universal_newlin... |
import hashlib
import re
import requests
import warnings
from io import StringIO
import urllib
from typing import Any, List, Tuple, Union
import pyopenms as oms
import numpy as np
import pronto
from Bio import SeqIO, SeqRecord
"""
Utility functions that do not contribute directly to QC calculations
"""
def sha256fr... |
from __future__ import print_function
from flask import Flask, render_template, request, redirect, url_for
import json
import pygraphviz as pgv
import re
from lxml import etree
#replace StringIO
import io
#from io import BytesIO
#from io import StringIO
import urllib
#import urllib2
import urllib.request
import urllib... |
import numpy as np
import matplotlib.pyplot as plt
import cv2
import mahotas
def plot_histogram(image, title, mask = None):
chans = cv2.split(image)
colors = ("b", "g", "r")
plt.figure()
plt.title(title)
plt.xlabel("Bins")
plt.ylabel("# of Pixels")
for (chan, color) in zip(chans, colors):
... |
#!/usr/bin/env python
from interactive_markers.interactive_marker_server import InteractiveMarkerServer
from visualization_msgs.msg import InteractiveMarker, InteractiveMarkerControl, InteractiveMarkerFeedback
from visualization_msgs.msg import Marker
from geometry_msgs.msg import Quaternion, Pose, Point, Vector3
from... |
# 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.
"""Tests for mb.py."""
import json
import sys
import unittest
import mb
class FakeMBW(mb.MetaBuildWrapper):
def __init__(self):
super(FakeMBW, self... |
'''
Created by <NAME>
ISIA Lab, Faculty of Engineering University of Mons, Mons (Belgium)
<EMAIL>
Source: SEEN SOON
Copyright (C) 2019 - UMons
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; ei... |
"""Functions to fit MRI SPGR signal to obtain T1.
Created 28 September 2020
@authors: <NAME>
@email: <EMAIL>
@institution: University of Edinburgh, UK
Functions:
fit_vfa_2_point: obtain T1 using analytical formula based on two images
fit_vfa_linear: obtain T1 using linear regression
fit_vfa_nonlinear: obt... |
import datetime
from django.contrib.auth.models import User as DjangoUser
from django.core.exceptions import ValidationError
# from django.contrib.postgres.fields import JSONField
from django.db import models
from polymorphic.models import PolymorphicModel
# TODO [audit] remove the on_delete=models.CASCADE and provi... |
import numpy as np
import matplotlib as plt
import torch
import torchvision
from torchvision import datasets, models, transforms
from torch.utils.data import DataLoader
import torch.nn.functional as Function
from torch import nn, optim
from torch.autograd import Variable
from PIL import Image
import json
from workspac... |
# coding:utf-8
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function
import os
import re
import jieba_fast as jieba
import thulac
from src.utils import utils
jieba.initialize()
thu = thulac.thulac(seg_only=True)
PAD, UNK, EOS = copy_head = ['<pad>', '<unk>',... |
import os
import sys
import unittest
sys.path.insert(0, os.path.abspath('..')) # hack to allow simple test structure
import polymaze as pmz
from polymaze import polygrid as _polygrid_module
# silly workaround to allow tests to work in py2 or py3
try:
_assertCountEqual = unittest.TestCase.assertCountEqual # py3... |
"""Support for Screenly OSE digital signage."""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const import (
DOMAIN, MEDIA_TYPE_IMAGE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO,
SUPPORT_NEXT... |
"""
This is a clickup client library, which is more than what we might need for the
sqlite export.
However this hasn't been extracted to another library yet. So I keep it here for
personal use.
"""
import json
from contextlib import contextmanager
from datetime import date, datetime, timedelta
from itertools import co... |
# -*- coding: future_fstrings -*-
# pushover 0.3
#
# Copyright (C) 2013-2016 <NAME> <<EMAIL>>
# This program 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 3 of the License, or
# (at your opt... |
from abc import ABC, abstractmethod
from collections import defaultdict
from itertools import count
import torch
from datasets.executor import evaluate_code
from datasets.karel import mutation
from models.base import InferenceResult
from datasets.karel.utils import chunked
import numpy as np
class IterativeSearch... |
# -*- coding: utf-8 -*-
"""
Author: mcncm 2019
DySART job server
currently using http library; this should not be used in production, as it's
not really a secure solution with sensible defaults. Should migrate to Apache
or Nginx as soon as I understand what I really want.
Why am I doing this?
* Allows multiple clie... |
"""Tools for generating randomized datasets."""
import os
import numpy as np
from scipy.ndimage import gaussian_filter
from ..field import Field, Rock, States, Wells
from .utils import get_config, STATES_KEYWORD
def _apply_uncorrelated_noise(arr, std):
noise = np.random.randn(*arr.shape) * std
return arr + ... |
TIE = "Tie"
HEADER_LENGTH = 6
ANONYMOUS = 'unknown'
# A helper that splits the string into a list of words.
def get_pure_wordlist(tweet):
""" (str) -> list of str
Return a list of string containing all words ending with alphanumerics.
>>> get_pure_wordlist('Hello! @Leehom- @StarWay.')
['... |
#<NAME>
#2018
#Sorting vis thing
# # # PROGRAM VARIABLES # # #
size = width,height = (1920,1080)
numParticles = 75;
amountOfScreen = 3;
# # # # # # # # # # # # # # #
import pygame
import random
from pygame import draw
from pygame.locals import *
import sys
import time
import math
from math impor... |
import os
from copy import deepcopy
from allennlp.commands.train import prepare_environment
from typing import List, Union, Dict, Any
from allennlp.common import Params
from allennlp.common.tee_logger import TeeLogger
from allennlp.data import Vocabulary, DataIterator, DatasetReader, Tokenizer, TokenIndexer,Dataset
f... |
"""This module provides helper functions for subprocess management."""
import logging
import signal
import subprocess
import sys
import os
import psutil
import cook
import cook.io_helper as cio
def launch_process(command, environment):
"""Launches the process using the command and specified environment.
P... |
import os
import numpy as np
import time
from gym import utils
from gym.envs.robotics import hand_env
from gym.envs.robotics.utils import robot_get_obs
from gym import spaces
FINGERTIP_SITE_NAMES = [
'robot0:S_fftip',
'robot0:S_mftip',
'robot0:S_rftip',
'robot0:S_lftip',
'robot0:S_thtip',
]
DEF... |
import numpy as np
from gym import Wrapper
from gym.wrappers.time_limit import TimeLimit
from rlpyt.envs.base import EnvSpaces, EnvStep
from rlpyt.spaces.gym_wrapper import GymSpaceWrapper
import random
import numpy as np
def obs_action_translator(action,power_vec,dim_obs):
trans_action = np.zeros(dim_o... |
#!/usr/bin/env python
# coding: utf-8
# pylint: disable=C0111
# pylint: disable=C0103
# pylint: disable=C0330
from __future__ import print_function
import os
import sys
import argparse
import traceback
import webbrowser
import re
import json
import multiprocessing
from multiprocessing.pool import ThreadPool
from time ... |
"""
Jobs database
"""
from sqlite3 import Error as SQLiteError
from vsutillib.sql import SqlDb
from .. import config
class SqlJobsTable(SqlDb):
"""
SqlJobsDB class to access sqlite database for saving jobs
Args:
**dbFile** (str, pathlib.Path): database file.
"""
def __init__(self, dbFil... |
# example of calculating the frechet inception distance
import os
import json
import argparse
import numpy as np
from PIL import Image
from tqdm import tqdm
import torch
from torchvision import models, transforms
import torch.nn.functional as F
from skimage.measure import compare_ssim as ssim
import torch.nn... |
import eel
import os
import glob
import shutil
import codecs
from OpenGL.GL import *
from OpenGL.WGL import *
from ctypes import *
import numpy
import pyaudio
import array
import re
class FileSystem():
def __init__(self):
self.categoryDir = './category'
self.extension = '.glsl'
... |
#!/usr/bin/env python
#
# Copyright (C) 2015 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 3 of the License, or
# (at your... |
#!/usr/bin/env python3
# -*- coding=utf-8 -*-
# Project: dspus
# injections.py
# Created by @wenchieh on <1/12/2020>
__author__ = 'wenchieh'
# sys
from random import sample
# third-part libs
import numpy as np
from scipy import linalg
from scipy.sparse import *
# parameters in injection -
# spike(M... |
"""
Views to manipulate help entries.
Multi entry object type supported added by DaveWithTheNiceHat 2021
Pull Request #2429
"""
from django.utils.text import slugify
from django.conf import settings
from evennia.utils.utils import inherits_from
from django.views.generic import ListView, DetailView
from django.http... |
from collections import OrderedDict
from enum import Enum
from .base import Message
from ..bot import Bot
class AtableMessage(Message):
def __init__(self, msgtype: str, atMobiles: list = None, isAtAll: bool = None):
super(AtableMessage, self).__init__(msgtype)
if atMobiles or isAtAll:
... |
from django.views.generic import View, FormView, TemplateView, UpdateView, CreateView, ListView
from django.contrib.messages.views import SuccessMessageMixin
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, ... |
"""main program
"""
from tensorflow import make_tensor_proto
from tensorflow_serving.apis import prediction_log_pb2
from tensorflow_serving.apis import predict_pb2
from datetime import datetime
import subprocess
import os
import tensorflow as tf
import pickle
from tensorflow.keras.regularizers import L2
import faiss
im... |
from functools import singledispatch
from typing import (Any,
Callable,
Iterable,
Sequence,
Tuple,
TypeVar,
Union)
from bentley_ottmann.planar import segments_cross_or_overlap
from ground.base import... |
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import Qt, QSize, pyqtSignal, pyqtSlot
from PyQt5.QtCore import pyqtSignal
class SpeedButton(QPushButton):
indexclick = pyqtSignal(int)
def __init__(self, label, parent, index):
super(SpeedButton, self).__init__(label, parent)
s... |
import numpy as np
from pathlib import Path
class Experiment_Information:
def __init__(self, name, path, parameters, modulation):
'''
name: str
path: str
parameters: dict
'''
self.name = name
self.path = path
self.parameters = parameters
self.... |
from __future__ import annotations
from dataclasses import InitVar, dataclass, field
from typing import Optional, Union
from ...public import ecc
from .math import invert
# Notation follows https://tools.ietf.org/html/rfc6979
@dataclass
class Curve:
"""
$y^2 = x^3 + ax + b (mod p)
"""
curve_id: ec... |
# encoding = utf-8
import re
import os
import sys
import time
import json
import copy
import requests
import datetime
import traceback
import hashlib
LP_CHECKPOINT_KEY = 'LastPass_user'
CMD_KEY = 'getuserdata'
PAGE_SIZE = 2000
PAGE_INDEX = 0
'''
IMPORTANT
Edit only the validate_input and collect_events func... |
import pandas as pd
from PySide6.QtGui import QIcon, Qt
from PySide6.QtCore import QThread
from PySide6.QtWidgets import QProgressBar, QDialog, QHeaderView, QTableWidgetItem
from gms_uploader.ui.uploader_dialog import Ui_Dialog as UI_Dialog_Uploader
from gms_uploader.modules.upload.support_classes import ParamikoFileUp... |
'''
AAA lllllll lllllll iiii
A:::A l:::::l l:::::l i::::i
A:::::A l:::::l l:::::l iiii
A:::::::A l:::::l l:::::l
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from scipy.spatial.transform import Rotation as R
from scipy.spatial.transform import Slerp
from airobot.utils import common
class Position:
"""
Class for representing 3D positions... |
import cv2
import numpy as np
from aip import AipOcr
from PIL import Image, ImageDraw, ImageFont
import os, math
def crop_image(src_img, x_start, x_end, y_start, y_end):
"""
图片裁剪
:param src_img: 原始图片
:param x_start: x 起始坐标
:param x_end: x 结束坐标
:param y_start: y 开始坐标
:param y_end: y 结束坐标
... |
# Main file
# ------------------------------------------------------
# Copyright (C) 2020 <NAME>
# Licensed under the MIT license, see LICENSE.
# ------------------------------------------------------
from tkinter import *
import pandas as pd
import PIL.Image
from PIL import ImageTk
#from PIL import ImageTk... |
from functools import partial
import requests
from waiter import terminal, http_util
from waiter.action import ping_token_on_cluster, process_kill_request
from waiter.querying import get_target_cluster_from_token, get_token
from waiter.token_post import post_failed_message, process_post_result
from waiter.util import... |
import base64
import copy
from .utils import dotdict
from uuid import UUID, uuid4
from bson import BSON
from pymongo.errors import OperationFailure
import collections
try:
import cPickle
except:
import _pickle as cPickle
def _flatten_fetched_fields(fields_arg):
""" this method takes either a kwargs 'fiel... |
#!/usr/bin/env python2
"""
Decrypt the TLS Application Data PoC:
Some functions are from here (origin is PHP and RC4):
https://github.com/jaytaph/TLS-decoder
And an interesting guide is here:
https://lowleveldesign.org/2016/03/09/manually-decrypting-https-request/
But mainly was used this:
https://www.ietf.org/rfc/... |
from __future__ import absolute_import, print_function, unicode_literals
from wolframclient.serializers.wxfencoder.constants import (
WXF_HEADER_COMPRESS,
WXF_HEADER_SEPARATOR,
WXF_VERSION,
)
from wolframclient.serializers.wxfencoder.streaming import ZipCompressedWriter
__all__ = ["WXFExprSerializer", "Se... |
# define which model to use
# 1. TF-IDF
import spacy
from spacy.lang.en.stop_words import STOP_WORDS
from string import punctuation
from collections import Counter
import streamlit as st
extra_words = list(STOP_WORDS) + list(punctuation) + ['\n']
nlp = spacy.load("en_core_web_sm")
def model_0(text, limit = 4):
... |
"""
objective function utilized by hyperopt-monogdb-worker
Receives hyperparameters, reformats them as a nwt,
runs the model, pulls trial information from .list
file, computes loss, and returns that loss
"""
# Disabling pylint snake_case warnings, import error warnings, and
# redefining out of scope warnings, too many... |
import os
import re
from collections import defaultdict
from itertools import takewhile
from pathlib import Path
from typing import Dict, List, Match, Tuple
#from fs import note_filename
from roam_to_git.fs import note_filename
from loguru import logger
def read_markdown_directory(raw_directory: Path) -> Dict[str, str... |
# -------- BEGIN LICENSE BLOCK --------
# Copyright 2022 FZI Forschungszentrum Informatik
#
# 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
# n... |
import inspect
from logging import getLogger
from time import time
from typing import Any, Callable
import numpy as np
import torch
import yaml
from ptflops import get_model_complexity_info
from tqdm import tqdm
from .format import format_num, format_time
from .machine_info import get_machine_info
logger = getLogger... |
# coding=UTF-8
import requests_html
import requests
import execjs
import time
import json
import re
import hashlib
# coding=UTF-8
from PIL import Image
import numpy as np
from io import BytesIO
def getpoint(imgcontent, position):
img = Image.open(BytesIO(imgcontent))
img.save('download.png')
... |
"""
usage: render_docs <usage-json> [<descriptions-yaml>]
"""
import json
import html
import docopt
import yaml
template = """\
# Zwift Workout File Reference
This page describes the XML elements (tags) and attributes that can be used in
[Zwift workout files][zwift-support-workouts]. It's automatically generated b... |
#
# Copyright © 2018 United States Government as represented by the Administrator of the
# National Aeronautics and Space Administration. All Rights Reserved.
#
import time
import numpy as np
import sunpy.map
import sunpy.io
import json
import astropy.units as u
import pandas as pd
from scipy import stats
from scipy... |
"""
MVP activity stream. To be extended appropriately as requirements are drawn up.
"""
import time
from datetime import datetime
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.utils import timezone
from api.applications.models import CountryOnApplication
from ... |
import os
import copy
import datetime
import warnings
from matplotlib import pyplot as plt
import matplotlib as mpl
import seaborn as sns
import pandas as pd
import numpy as np
import math
from datetime import datetime
import random
from sklearn.feature_extraction.text import TfidfVectorizer, CountV... |
import pandas as pd
import folium
import math
from itertools import combinations
from pyproj import Proj, transform
from tqdm import tqdm
from typing import List
def preprocess_data(path: str) -> pd.DataFrame:
"""
"Note": Modify and use according to your own data.
Or you don't need to use this code, and ... |
import requests
import json
import datetime
import os
import embeds
import redmine_api
import discord
logger = embeds.Logger("kourage-operations")
get_json = lambda _url, _hdr: requests.get(_url, headers=_hdr)
webpage = "http://sumyak.m.redmine.org/"
header = {
'X-Redmine-API-Key': os.environ.get('... |
"""
Train a logistic regression model.
Input:
data:
Output:
params: parameters of logistic regression model
"""
import os
import pandas as pd
from bokeh.plotting import figure
import torch
import torch.nn as nn
import torch.utils.data
from torch.nn.utils import weight_norm
from torch.nn impo... |
# coding: utf8
from __future__ import print_function, absolute_import
import datetime
import inspect
import re
import sys
import time
import traceback
import types
import os
import multiprocessing
from collections import defaultdict
from spinoff.util.python import dump_method_call
try:
import colorama
except Impo... |
import time
import torch
import wandb
import random
import itertools
import numpy as np
from tqdm import tqdm
from collections import defaultdict
from torchsummary import summary
from mdlearn.utils import (
parse_args,
log_checkpoint,
log_latent_visualization,
resume_checkpoint,
get_torch_optimizer,... |
# getFamaFrenchFactors.py
# Author: Vash
# Version 0.0.4
# Last updated: 18 May 2019
"""
This programme gets cleaned versions of factors including:
* Fama French 3 factor (MRP, SMB, HML)
* Momentum (MOM)
* Carhart 4 factors (MRP, SMB, HML, MOM)
* Fama French 5 factors (MRP, SMB, HML, RMW, CMA)
Updates... |
import os, time, glob
import logging
from absl import flags, app
import importlib
from datetime import datetime
import pickle
import numpy as np
import pandas as pd
from comet_ml import Experiment, OfflineExperiment, Optimizer
from sklearn.preprocessing import StandardScaler, KBinsDiscretizer
from sklearn.ensemble i... |
# -*- coding: utf-8 -*-
#
# Author: <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
# -*- coding: utf-8 -*-
# Copyright (c) 2021, libracore and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils.data import now
from mvd.mvd.doctype.mitgliedschaft.mitgliedschaft import create_... |
#!/usr/bin/env python
"""
Lint md files.
> lint_txt.py -i foo.md -o bar.md
It can be used in vim to prettify a part of the text using stdin / stdout.
:%!lint_txt.py
"""
# TODO(gp): -> lint_md.py
import argparse
import logging
import os
import re
import sys
import tempfile
from typing import List, Optional
import ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
将Omicron中与性能相关比较密切的函数抽取到这个模块。以便将来进行加速。
TODO: 部分函数之前已使用numba加速,但因numba与OS的兼容性问题取消。需要随时保持跟踪。
"""
import logging
import numpy as np
from deprecated import deprecated
logger = logging.getLogger(__name__)
@deprecated(version="1.1")
def index(arr, item): # pragma: no co... |
"""
utils
Copyright (c) 2020 Aiven Ltd
See LICENSE for details
Shared utilities (between coordinator and node)
"""
from abc import ABC
from multiprocessing.dummy import Pool # fastapi + fork = bad idea
from pydantic import BaseModel
from typing import Any, AsyncIterable, Callable, Dict, Iterable, Optional, TypeVar... |
# Config file for define some parameters
import argparse
import numpy as np
import tensorflow as tf
import math
def get_arguments():
"""Parse all the arguments provided from the CLI.
Returns:
A list of parsed arguments.
"""
parser = argparse.ArgumentParser(description="Facade ALK Network")
pa... |
from flask import current_app, jsonify
from functools import wraps
import datetime
import glob
import os
import pandas as pd
from app.database.excel import Workbook
from app.helper import jsonified
from app.api import ApiResult, ApiException
def serialize_mail_data():
def decorator(f):
@wraps(f)
def decorated_fu... |
""" Copyright 2017, <NAME>, All rights reserved. """
import re
from functools import partial
from collections import Counter
import nltk
from nltk.corpus import wordnet
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from nltk.stem.porter import PorterStemmer
def removeUnicode(text):
"""... |
import sys
import os
import numpy as np
import tensorflow as tf
slim = tf.contrib.slim
# sys.path.append('discriminator/')
# sys.path.append('image_stylization/')
# sys.path.append('arbitrary_image_stylization_modified/')
# sys.path.append('../')
import arbitrary_image_stylization_build_model as build_model
# import d... |
from aiida.engine import CalcJob
from aiida.common.exceptions import ValidationError
from aiida.common import CalcInfo, CodeInfo
from aiida.orm import StructureData, Dict
from aiida.plugins import DataFactory
from aiida_lammps.common.utils import convert_date_string
from aiida_lammps.common.generate_structure import ge... |
from django.contrib import admin
from .models import Fossil, Locality, Taxon, Identification, Context
from django.http import StreamingHttpResponse
import csv
import os
import projects.admin
class Echo(object):
"""
From the django docs on streaming large csv files
https://docs.djangoproject.com/en/1.11/ho... |
#===============================================================================
# Author : <NAME> <EMAIL>
#===============================================================================
from bs4 import BeautifulSoup
import requests
from lse.utils.cleaner import cleanQuery, formatHTMLNewLines
from lse.utils.strikea... |
import argparse
import os
import subprocess
import numpy as np
from jinja2 import Template
import datasets as ds
import utils
from vgg16 import vgg16_multilabel_hdf5
from utils import flip_labels as flip_label_matrix
EXP_DIR = os.path.join('data', 'experiments', 'espgame')
DS_DIR = os.path.join('data', 'ESP-Game')
A... |
#!/usr/bin/env python
#
# Copyright (c) 2018 <EMAIL> and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
#
import ... |
import os
import random
import argparse
import multiprocessing
import numpy as np
import torch
import torch.nn as nn
import torch.utils.data as data
from torchvision import models, transforms
import torchvision.datasets as datasets
from utils import Bar, config, mkdir_p, AverageMeter, accuracy
from datetime import date... |
"""
This module contains the CONFIG_SCHEMA for validation with voluptuous.
"""
import typing as T
import voluptuous as vol
from . import expr, schedule, util
from .room import Room
from .thermostat import Thermostat
from .window_sensor import WindowSensor
from .stats import StatisticsZone
def build_schedule_rule(r... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 30 11:58:38 2018
@author: Lützenkirchen, Heberling, Jara
"""
import activity_function_module as afm
class Species:
'''
properties:
name e.g. String that labels the species like CO2, H+, Ca2+ or Q, A, Whatsoever, and etc.
method... |
from lx16a import *
from math import sin, cos, pi
import time
import xlwt
import pandas as pd
import numpy as np
from xlwt import Workbook
class RecordMotorData():
def __init__ (self, servo):
self.servo = servo;
self.id = [];
self.angleOffset = [];
self.physicalPos = [];
self.virtualPos = [];
self.temp = ... |
import json
import os
from typing import Any, Callable, Dict, Optional, Tuple, Union
import reprlib
ConfigKey = Tuple[Union[str, int], ...]
AttrKey = Tuple[Union[str, int], ...]
KeyPair = Tuple[ConfigKey, Optional[AttrKey]]
ConfigType = Any
Loader = Callable[[str], Any]
DumpTrace = Tuple[KeyPair, ...]
LoadTrace = Tup... |
#!/usr/bin/env python
from __future__ import print_function
import logging
import os
import time
import rx
from rx import operators as ops
import concurrent.futures
from kubernetes import client, config
from wielder.util.commander import async_cmd
from wielder.wield.enumerator import KubeResType
from wielder.wield.se... |
from datetime import datetime
import numpy as np
from pup.common.constants import NUM_SECONDS_IN_DAY
from pup.common.datatypes import Traj, Checkin
from pup.common.enums import PricingType, DegradationType, ReconstructionMethod, TrajectoryIntervalType, \
PreviousPurchaseType
from pup.config import Config
from pup... |
import subprocess
import unittest
import copy
import pickle
import math
import os
import numpy as np
from scipy.constants import N_A
from monty.serialization import loadfn, dumpfn
from pymatgen.util.testing import PymatgenTest
from mrnet.core.mol_entry import MoleculeEntry
from mrnet.network.reaction_generation impor... |
# utils.py
#
# MIT License
#
# Copyright (c) 2020 <NAME> <<EMAIL>>
#
# 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, cop... |
#!/usr/bin/env python
"""
A dummy web server used to test the LendingClub API requests
"""
"""
The MIT License (MIT)
Copyright (c) 2013 <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 wi... |
from __future__ import print_function
import os
import pytest
import numpy as np
from numpy.testing import assert_allclose
from keras.utils import test_utils
from keras import optimizers, Input
from keras.models import Sequential, Model, load_model
from keras.layers.core import Dense, Activation, Lambda
from keras.ut... |
from PyQt5 import QtWidgets as qtw
from PyQt5 import QtGui as qtg
from PyQt5 import QtCore as qtc
import csv
from datetime import datetime
import pandas as pd
from PyQt5 import QtChart as qtch
months = ['','January','February','March','April','May','June','July','August','September','October','November',
... |
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.http import Http404
from django.shortcuts import redirect, get_object_or_404, render
from django.utils import timezone
from django.utils.datetime_safe import date
from django.views.generic.base import View
from rest_framew... |
#! /usr/bin/python3
# <NAME> 2019
import tkinter as tk
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import parser
import re
# Importing mathematical functions and constants individually for UX
from numpy import sin, cos, tan, arcsin, arccos, arctan,... |
#!/usr/bin/env python
import numpy as np
import rospy
import time
from sensor_msgs.msg import LaserScan
from nav_msgs.msg import OccupancyGrid
import tf
# p(x) = 1 - \frac{1}{1 + e^l(x)}
def l2p(l):
return 1 - (1/(1+np.exp(l)))
# l(x) = log(\frac{p(x)}{1 - p(x)})
def p2l(p):
return np.log(p/(1-p))
class Gr... |
# -*- coding: utf-8 -*-
"""
Multi Channels VAE (MCVAE)
==========================
Credit: <NAME> & <NAME>
The Multi Channel VAE (MCVAE) is an extension of the variational autoencoder
able to jointly model multiple data source named channels.
The `test` variable must be set to False to run a full training.
"""
impor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import numpy as np
import deeptools.countReadsPerBin as countR
from deeptools import parserCommon
from deeptools.utilities import smartLabels
from deeptools._version import __version__
old_settings = np.seterr(all='ignore')
def pars... |
# Copyright (c) 2020 by Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
import numpy as np
import pandapipes as pp
import pandas as pd
from pandapipes.plottin... |
from baseWidget import *
from enum import Enum, auto
import sys
import math
class Display(Enum):
SOLE = auto()
INSOLE = auto()
MOLD = auto()
class insoleMoldExportWidget(baseWidget):
def __init__(self, nextTab = -1):
super(insoleMoldExportWidget, self).__init__(nextTab)
def initCustomUI... |
import logging
import django
from django.db.models import Q, Sum
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.views.generic import View
from rest_framework import status
from rest_framework.response import Response
from api import models, serializers
from api.excepti... |
# Copyright 2016 MongoDB 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 required by applicable law or agreed to in writing, sof... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.