text stringlengths 6.04k 39.5k |
|---|
from typing import Tuple, List, Any, Union
import e2cnn.nn as enn
from e2cnn import gspaces
from e2cnn.nn import init
from e2cnn.nn import GeometricTensor
from e2cnn.nn import FieldType
from e2cnn.nn import EquivariantModule
from e2cnn.gspaces import *
import math
import numpy as np
import torch
import t... |
# coding: utf-8
# Copyright 2018 D-Wave Systems 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 a... |
from .myqt import QT
import pyqtgraph as pg
import numpy as np
import pandas as pd
from .base import WidgetBase
class MyViewBox(pg.ViewBox):
doubleclicked = QT.pyqtSignal()
gain_zoom = QT.pyqtSignal(float)
def __init__(self, *args, **kwds):
pg.ViewBox.__init__(self, *args, **kwds)
#~ sel... |
# General info
COMPANY_NAME = "Echo Mobile"
SITENAME = "Echo Sense"
EMAIL_PREFIX = "[ %s ] " % SITENAME
APPNAME = "echo-sense"
BASE = "http://%s.appspot.com" % APPNAME
API_AUTH = "bluep4tches"
PLAY_STORE_LINK = ""
DAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
# Branding
CL_P... |
# (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import division
from collections import defaultdict
from datetime import datetime, timedelta
from itertools import islice
from math import ceil, sqrt
from time import time as timestamp
import req... |
#!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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
#
# U... |
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# justice-platform-service (4.10.0)
# pylint: disabl... |
"""
The API basically only provides one class. You can create a :class:`Script` and
use its methods.
Additionally you can add a debug function with :func:`set_debug_function`.
Alternatively, if you don't need a custom function and are happy with printing
debug messages to stdout, simply call :func:`set_debug_function`... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
# Copyright (c) 2009, 2010, 2011, 2012 Nicira Networks
#
# 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 la... |
#!/usr/bin/env python3
import sys
import os
import subprocess as sp
import json
import base64
from PyQt5.QtWidgets import QApplication, QHBoxLayout, QVBoxLayout, QPushButton, QMainWindow, QLabel, QWidget, \
QMessageBox, QScrollArea, QPlainTextEdit
from PyQt5.QtGui import QFont, QIcon, QPalette, QColor
from PyQt5.QtCo... |
from django.shortcuts import render, HttpResponse, redirect
from django.views.generic import ListView, CreateView, TemplateView, UpdateView, DeleteView
from django.urls import reverse_lazy
from django.db.models import Q
from django.http import HttpResponseRedirect, FileResponse
from gestionStock.models import Proveedor... |
import PySimpleGUI as sg
import os, re, subprocess
from flask import Flask, render_template, flash, redirect, url_for, request, session
from classes.forms import RegistrationForm
from classes.functions import Main
import datetime, textwrap
from configparser import ConfigParser
from multiprocessing import Process
import... |
"""Test the detector reader."""
from os import remove
from unittest import TestCase
from collections import OrderedDict
from numpy import arange, array
from numpy.testing import assert_equal
from serpentTools.parsers import read
from serpentTools.data import getFile
from serpentTools.detectors import (
Cartesian... |
#!/usr/bin/python3
import datetime
import os
import time
import requests
import toml
import messwerte_umrechner as mwu
import setup_logging
import weewx_db_model as db_weewx
from peewee import fn
def config_laden():
configfile = os.path.join(SKRIPTPFAD, "wettersektor_export_cfg.toml")
with open(configfile)... |
#!/usr/bin/env python
# Copyright (c) 2011-2013 Stanford University
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS"... |
# coding=utf-8
# Copyright 2022 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... |
# -*- coding: utf-8 -*-
#
# Copyright 2019 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 applicable law... |
import abc
from numpy import kron, sqrt
from netsquid.qubits import dm_fidelity
from qlinklayer.toolbox import LinkLayerException
from netsquid.qubits.ketstates import s00, s01, s10, s11, b01, b11
from easysquid.easynetwork import setup_physical_network, Connections
from qlinklayer.mhp import SimulatedNodeCentricMHPSer... |
# Copyright 2018 DataStax, 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 writin... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import glob
import os
import re
#------------------------------------------------------
#Define a function that can calculate the calibration parameter and retunr them
def camera_cal(images, nx, ny):
# prepare object po... |
from datetime import timedelta
import itertools
class Color(object):
""" Represents a color in the ASS format.
"""
def __init__(self, r, g, b, a=0):
""" Made up of red, green, blue and alpha components (in that order!).
"""
self.r = r
self.g = g
self.b = b
s... |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import sys
import os
import regex
import csv
from decimal import Decimal as D
from pprint import pprint
from datetime import datetime
from pathlib import Path
# - will match owner
# prior to march 2019
owner_regex_v1 = r'Identifiant client\s+(?P<owner>\D*)'
# after mar... |
import pytest
import numpy as np
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
from dtaidistance import dtw, dtw_c
import logging
logger = logging.getLogger("be.kuleuven.dtai.distance")
if dtw_c is None:
print('ERROR: dtw_c is not build')
sys.exit(1)
d... |
# Copyright (c) 2021 Microsoft Corporation. Licensed under the MIT license.
"""
Implements the Scene Parser framework
"""
from matplotlib import projections
import numpy as np
import torch
from maskrcnn_benchmark.structures.bounding_box import BoxList
from maskrcnn_benchmark.structures.image_list import to_image_list
... |
#!/usr/bin/python3
''' Handling the data io '''
'''
MIT License
Copyright (c) 2017 <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 ... |
# pylint: disable=global-statement,redefined-outer-name
import argparse
import csv
import glob
import json
import os
import yaml
from flask import Flask, jsonify, redirect, render_template, send_from_directory
from flask_frozen import Freezer
from flaskext.markdown import Markdown
site_data = {}
by_uid = {}
archive_p... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2014 <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, includin... |
"""
The plugins module defines the components used by the rest of insights and
specializes their interfaces and execution model where required.
This module includes the following :class:`CompoentType` subclasses:
- :class:`datasource`
- :class:`parser`
- :class:`combiner`
- :class:`rule`
- :class:... |
#To detect Moire ́ patternzs, images are first decomposed using Wavelet decomposition (refer to file '') and trained using multi-input Convolutional neural network. The strength of the proposed CNN model is, it uses the LL intensity image (from the Wavelet decomposition) as a weight parameter for the Moire ́ pattern, t... |
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
import locale
import os.path
import random
import re
from os import stat as os_stat, lstat as os_lstat
from collections import deque
from time import time
from ranger.container.fsobject import B... |
import abc
import warnings
import xml.etree.ElementTree as etree
import pprint
import itertools
from functools import reduce
from typing import Any
from typing import Optional
# from lxml import etree # type: ignore
import networkx as nx
import pydot
# from networkx.drawing.nx_pydot import write_dot # type: ignore
... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import time
import os
import itertools
from collections import defaultdict
import pickle
import glob
import numpy as np
from redbaron import RedBaron
import torch
import torch.nn as nn
from torch.utils.data import random_split
import torch.optim as optim
import torch.n... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
DOCUMENTATION = r'''
---
module: nxos_pim_int... |
#
# Pyserini: Python interface to the Anserini IR toolkit built on Lucene
#
# 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... |
# --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
import numpy as np
import os
import cv2
import random
f... |
#!/usr/bin/env python
"""
Code for linting modules in the nf-core/modules repository and
in nf-core pipelines
Command:
nf-core modules lint
"""
from __future__ import print_function
import logging
from nf_core.modules.modules_command import ModuleCommand
import operator
import os
import questionary
import re
import r... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import glob, re, itertools, inspect
import gzip
from datetime import datetime
from collections import OrderedDict
from os import path
import numpy as np
import six
encoding = 'utf-8'
vr_pa... |
# -*- coding: utf-8 -*-
from aiida.orm import Node
__copyright__ = u"Copyright (c), 2015, ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE (Theory and Simulation of Materials (THEOS) and National Centre for Computational Design and Discovery of Novel Materials (NCCR MARVEL)), Switzerland and ROBERT BOSCH LLC, USA. All rights ... |
import datetime
from xml.etree import ElementTree
from asgiref.sync import async_to_sync
from channels.layers import get_channel_layer
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db import models, transaction
from django.utils import timezone
from common.utils im... |
import pandas as pd
import numpy as np
from scipy import interpolate
import os, sys
def pseudo_wells_model(zmin, zmax, sr, no_wells, zones={}, zones_ss={}, depth='Depth', zone_idx='Zone_idx', zone_col='Zone'):
depth_log = np.arange(zmin, zmax, sr)
pseudo_wells = pd.DataFrame(np.zeros((len(depth_log), no_wel... |
# -*- coding: utf-8 -*-
# ===========================================================================
# Copyright 2016-2017 TrungNT
# ===========================================================================
from __future__ import print_function, division, absolute_import
import os
import sys
import inspect
import m... |
#coding=utf-8
import os
import cv2
import math
import lmdb
import random
import numpy as np
import mxnet as mx
from mxnet.gluon.data import Dataset
from . import normalize_fn
__all__ = ['FixSizeDataset', 'BucketDataset']
class FixSizeDataset(Dataset):
def __init__(self, line_path, voc_path, augment_fn=None, short... |
from __future__ import annotations
import contextlib
import warnings
from abc import ABCMeta, abstractmethod
from functools import partial as Partial
from types import MethodType
from typing import Any, Callable, Iterable, TypeVar
import torch
from torch import Tensor, nn
from torch.optim import Optimizer
from torch.... |
import pygame as pg
import random
from settings import *
from sprites import *
import urllib
import topper
name = "Social Dstancer"
import tkinter as tk
class Game:
def __init__(self,name):
# initialize game window, etc
pg.init()
pg.mixer.init()
self.screen = pg.display.set_mode((WI... |
"""
SuckleSync - A wrapper around rsync to simplify continuous synchronization of remote directories.
"""
import logging
from easyprocess import EasyProcess
import sucklesync
from utils import debug
from utils import email
from config import config
sucklesync_instance = None
DEFAULT_CONFIG = ["/etc/sucklesy... |
import re
import json
import requests
import sys
from grafana_backup.commons import log_response, to_python2_and_3_compatible_string
def health_check(grafana_url, http_get_headers, verify_ssl, client_cert, debug):
url = '{0}/api/health'.format(grafana_url)
print("\n[Pre-Check] grafana health check: {0}".forma... |
# -*- coding: utf-8 -*-
from django.utils import formats
from django.utils.translation import ugettext_lazy as _
import math
def _label(_input, _unit):
_input = formats.localize(_input, use_l10n=True)
return u'%s %s' % (_input, _unit)
def convert_unit(value, units, unit_id_in, unit_id_out):
# if units are... |
# Copyright 2014
# The Cloudscaling Group, 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... |
import os
import warnings
import numpy as np
from scipy.spatial import distance
from pycosmosac.molecule.cavity import Cavity
from pycosmosac.param import data
from pycosmosac.utils import elements
BOND_SCALING = 1.2
def get_connectivity(mol, geometry=None):
#TODO improve accuracy
if geometry is None:
... |
import frects
from . import my_state,render_text,draw_text,TEXT_COLOR,Border,default_border
import pygame
import image
import rpgmenu
# respond_event: Receives an event.
# If the widget has a method corresponding to the event,
# that method will be called.
# Note that the widget needs to be added to my_state.widg... |
# This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2022 BigML
#
# 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 ... |
import pygame
import random
import pygameconstants as pgc
import gameconstants as gc
import enums
import utils
class Art():
"""
Class that handles all art assets of the game (visual and sounds).
"""
def __init__(self, screen, game, inputs_):
self.screen = screen
self.game = game
... |
"""Datastore model definitions and utility functions."""
import bisect
import collections
import itertools
import logging
import re
import StringIO
import sys
import time
from google.appengine.api import memcache
from google.appengine.ext import db
class Error(Exception):
pass
class InvalidExpression(Error):
... |
#!/usr/bin/env python
#
# Copyright (c) 2015-2017 Nest Labs, Inc.
# 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/licen... |
import os
import time
import tensorflow as tf
import numpy as np
from scipy.stats import spearmanr
from sklearn.metrics import r2_score
import mnist_input
import multi_mnist_cnn
from sinkhorn import sinkhorn_operator
import util
import random
os.environ['TF_CUDNN_DETERMINISTIC'] = 'true'
tf.set_random_seed(94305)
ran... |
from utils import parse_line
REGISTERS = "abcdefghijklmnopqrstuvwxyz"
VAR_CHARS = "abcdefghijklmnopqrstuvwxyz_"
VARIABLES = {}
CONSTANTS = {}
N_DEFAULT_VARS = 0
def get_var(name, before="", after=""):
if name in VARIABLES:
return before + VARIABLES[name] + after
elif name in CONSTANTS:
return ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cisco Systems, 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... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Imports.--------------------------------------------------------------------
# -Python Imports.
import os
import sys
import pyembroidery
import wx
import wx.grid
import wx.lib.agw.aui as aui
from embroidepy.assets import EmbroidePyLogo
from .embroideryview import Em... |
import logging
import datetime
from sqlalchemy import event
from sqlalchemy import Table
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import types
from sqlalchemy import Index
from sqlalchemy.engine.reflection import Inspector
from sqlalchemy.orm import backref, relation
from sqlalch... |
from torch import nn
from ops.basic_ops import ConsensusModule
from ops.transforms import *
from torch.nn.init import normal_, constant_
import torch.nn.functional as F
from efficientnet_pytorch import EfficientNet
from ops.net_flops_table import feat_dim_dict
from torch.distributions import Categorical
def init_hid... |
"""
This script loads in a trained policy neural network and uses it for inference.
Typically this script will be executed on the Nvidia Jetson TX2 board during an
experiment in the Spacecraft Robotics and Control Laboratory at Carleton
University.
Script created: June 12, 2019
@author: Kirk (<EMAIL>)
"""
import ten... |
from __future__ import annotations
from importlib.abc import Traversable
from logging import DEBUG, INFO, Logger, StreamHandler, getLogger
from mmap import ACCESS_READ, mmap
from pathlib import Path
from typing import IO, Iterable, Iterator, NoReturn, Sequence, cast
import sys
from click import (
BadParameter,
... |
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 28 23:19:09 2020
@author: NAT
"""
from torch import nn
import torch.nn.functional as F
import torchvision
import torch
import sys
sys.path.append("../")
from utils import decimate
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class ... |
import logging
from typing import Dict, List, Sequence, Union, Tuple
# TODO: align with main pypesto multiprocessing format
from multiprocess import Pool, Manager, Queue, Pipe
from tqdm import tqdm
import numpy as np
import copy
import queue
import time
from ..problem import Problem
from .sampler import Sampler, Int... |
# Copyright 2018 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 time
import numpy as np
import pandas as pd
import lightgbm as lgb
import xgboost as xgb
from sklearn.cross_validation import StratifiedKFold
from sklearn.grid_search import GridSearchCV
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import LabelEncoder
from sklearn import preproce... |
"""Correlograms View: show auto- and cross- correlograms of the clusters."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import numpy as np
import numpy.random as rdn
from galry import (Manager... |
"""Miscellaneous utilities"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import asyncio
from binascii import b2a_hex
import concurrent.futures
from datetime import datetime, timezone
import random
import errno
import hashlib
from hmac import compare_digest
imp... |
"""
Climate Platform Device for Wiser Rooms
https://github.com/asantaga/wiserHomeAssistantPlatform
<EMAIL>
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.components.climate import ClimateDevice
from homeassistant.core import callback
from homeassistant.components.climate.const import... |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import sys
import gevent.monkey
gevent.monkey.patch_all()
import logging
import tempfile
from pprint import pformat
import coverage
import fixtures
import testtools
from testtools import content, content_type
from flexmock import flexmock, Mock
from ... |
#!/usr/bin/env python3
# Copyright 2016-2018 <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 ag... |
import math
import clr
from pyaedt.modeler.GeometryOperators import GeometryOperators as go
clr.AddReference("System.Collections")
from pyaedt.generic.constants import AXIS, PLANE, SWEEPDRAFT
from System import Double
from System.Collections.Generic import List
try:
import pytest # noqa: F401
except ImportError... |
# -*- coding: utf-8 -*-
# Most unit tests are based on the tests from Redcarpet.
import re
import codecs
from os import path
from glob import glob
from subprocess import Popen, PIPE, STDOUT
import hoedown
from hoedown import Markdown, BaseRenderer, HtmlRenderer, SmartyPants, \
EXT_NO_INTRA_EMPHASIS, EXT_TABLES,... |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 5 18:56:30 2018
@author: <NAME>
"""
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import numpy as np
from sklearn.decomposition import PCA
from random impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
_name = "AFProxy"
__name = "Another Filtering Proxy"
__author__ = 'phoenix'
__version__ = 'v0.4'
CONFIG = "config.ini"
CA_CERTS = "cacert.pem"
import os
import sys
import time
import importlib
import configparser
import fnmatch
import re
import logging
import threading
... |
# This is a collection of scripts that will allow manipulation of CAMI profiling files
import sys
import copy
import numpy as np
import timeit
class Profile(object):
def __init__(self, profile=None):
self.profile = profile
self._data = dict()
# Stick in the root node just to make sure ever... |
# -*- coding:utf-8 -*-
import sklearn.preprocessing as skp
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
import time
FILE_PATH = './data/train.csv'
TEST_PATH = './data/testA.csv'
label = 'isDefault'
rng = np.random.RandomState(1)
m = [
'Jan',
'Feb',
'Mar',
... |
import sqlite3
import argparse
import queue
import time
import csv
def export_fasta(cursor, outfile='data/gisaid-aligned.fa'):
""" Function that writes fasta to outfile
:params:
:cursor: sqlite3 object
:outfile: (str) output file
"""
data = cursor.execute('SELECT `header`, `aligned` FR... |
### TODO:
# Try adding our 4 pos features
# Try Add TOKTYPE IDS
# Try Set Use_img_layernormtotrue
# Try using transformers version as in theoriginal repo
# Reextract features using the open-sourced bottom up attention to get 2054?
import os
import torch
import torch.nn as nn
from param import args
from src.vilio.... |
"""Generic protoplanetary disk model
The density is given by
.. math::
\\rho = \\frac{\\Sigma(r,\\phi)}{H_p\\sqrt{(2\\pi)}} \\exp{\\left(-\\frac{z^2}{2H_p^2}\\right)}
* :math:`\Sigma` - surface density
* :math:`H_{\\rm p}` - Pressure scale height
There are two options for the functio... |
# -*- coding: utf-8 -*-
import os
import textract
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from prettytable import PrettyTable
from Location_database import add_to_Scripts_DB
from Location_database import add_to_LocationsInfo_DB
import csv
def main():
pri... |
"""
Diagnostic Maps.
Diagnostic to produce images of a map with coastlines from a cube.
These plost show latitude vs longitude and the cube value is used as the colour
scale.
Note that this diagnostic assumes that the preprocessors do the bulk of the
hard work, and that the cube received by this diagnostic (via the s... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import collections
import csv
import functools
import warnings
import io
import json
import boto3
import csv
import codecs
from pathlib import Path
from datetime import datetime
from dataclasses import dataclass, field
import typing as t
from bot... |
#!/usr/bin/env python3
"""
Given a 1-based amino acid range, and a bed12 of transcripts,
convert the amino acid range to a genomic range with exon blocks.
This program is currently specialized to the gnomad missense constraint
track, but can be more generalized if the score conversion part is
commented out.
Example:... |
from __future__ import print_function
__author__ = '<NAME>'
__email__ = '<EMAIL>'
import errno
import imp
import json
import os
import random
import re
import shutil
import sys
import __builtin__
import tempfile
# import framework libs
from galvatron_lib.core import framework
# set the __version__ variable b... |
"""
--- Day 16: Packet Decoder ---
As you leave the cave and reach open waters, you receive a transmission
from the Elves back on the ship.
The transmission was sent using the Buoyancy Interchange Transmission
System (BITS), a method of packing numeric expressions into a binary
sequence. Your submarine's computer has ... |
'''
This is a self-contained orbit fitting routine.
This orbit fitter is unique compared to other common orbit fitters in that it
uses a galactocentric generalized plane coordinate system when fitting data
'''
#TODO: Allow fitting on b, ra, or dec instead of l
import numpy as np
import scipy as sc
import scipy.optim... |
import os
from typing import List
from typing import Tuple
import logging
from collections import defaultdict
from collections import Counter
import json
import torch
import numpy as np
from GroundedScan.dataset import GroundedScan
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
logger = logging... |
import datetime
import flask
import inspect
import jwt
import jwt.exceptions
import redis
import secrets
import user_agents as ua
import user_agents.parsers as ua_parser
import typing
import app.common.utils as utils
import app.database as db_module
import app.database.user as user_module
db = db_module.db
redis_db: ... |
#!/usr/bin/env python
#
# cropimage.py - The CropImagePanel class
#
# Author: <NAME> <<EMAIL>>
#
"""This module provides the :class:`CropImagePanel` class.
The ``CropImagePanel`` is a a FSLeyes control which is used in conjunction
with the :class:`.OrthoCropProfile`, allowing the user to crop an image.
This module als... |
# imports
import numpy as np
import tensorflow as tf
from numpy import random
import math
import time
import matplotlib.pyplot as plt
"""Part 1 - Forward Propagation"""
def initialize_parameters(layer_dims):
"""
Description: This function initializes weights and biases
:param layer_dims: an array of the... |
# imports from core
from pyjamas_core import Supermodel
from pyjamas_core.util import Input, Output
# imports for database
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from Models.Technology.European_power_plant.V001.db.db_declarative import Base, Kraftwerk, Co2Preis
# all other tables ... |
import json
import platform
import re
import struct
import time
from functools import reduce
from pkg_resources import get_distribution, DistributionNotFound
import jsonmerge
import serial
from intelhex import IntelHex
from serial.tools.list_ports import comports
from tqdm import tqdm
from .data_tables import bit_re... |
# coding: utf-8
import sys
import math
def welcome(name):
""" Script test """
return "Loading script successfully ! ! !, " + name
def printList(list):
s = ""
for i in list:
s += str(i.X) + str(i.Y) + str(i.Z)
return s
def get_distance(point1, point2):
""" Get ... |
import imageio
import copy as cp
import numpy as np
import cv2
from PIL import Image
'''
###############
addBoundary(img, kernel)
convolve1(img, kernel, filter_type, mode='same')
convolve(img, kernel, filter_type, mode='same')
wise_element_sum(img, kernel, filter_type)
上面四个函数用于构建高斯滤波器,与我写的第二章节的... |
banner = '''
___ _ _ _
| _ \ (_) __ __ (_) __ __ (_) _ __ __ _ _ __ _ _
| _/ | | \ \ / | | \ V / | | | ' ... |
""" License manager module. Define a license key and a license manager classes.
"""
from __future__ import print_function
import datetime
import hashlib
from os.path import isfile, join
import logging
from six import PY3
from six import string_types
from traits.api import Any, Bool, Date, HasStrictTraits, Instance, L... |
"""[HTTP AGENT SERVER]
"""
# Copyright 2019 BlueCat Networks (USA) Inc. and its affiliates
#
# 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
#
# ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.