text stringlengths 8.04k 46.5k |
|---|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import boto3
import requests
import threading
import uuid
import os
import json
import logging
from datetime import datetime
from collections import defaultdict
# The event type we send to Pinpoint to initiate campa... |
# Copyright (c) 2021 <NAME> and the UCI Networking Group
# <https://athinagroup.eng.uci.edu>.
#
# 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/LICEN... |
# coding: utf8
"""
Analytical module
=================
Defines analytical Uncertainty Quantification oriented functions for test and
model evaluation purpose.
.. seealso:: [Surjanovic2017]_
`Virtual Library <https://www.sfu.ca/~ssurjano/index.html>`_
It implements the following classes:
- :class:`SixHu... |
'''
Information Theory techniques
--------------------------------
Author @ <NAME>
Date: 18 Apr 2019
Version : 0.0.3
Github : https://github.com/Nikeshbajaj/spkit
Contact: <EMAIL>
'''
from __future__ import absolute_import, division, print_function
import sys
if sys.version_info[:2] < (3, 3):
old_print = print
... |
import discord,aiohttp,asyncio,datetime
from discord.ext import commands
from unidecode import unidecode
from lxml import html
import random
class NUFC:
""" NUFC.com player profiles """
def __init__(self, bot):
self.bot = bot
print("FUCKING RELOAD.")
self.bot.streams = []
def nufccheck(ctx):
... |
# -*- coding: utf-8 -*-
# Author: <NAME><<EMAIL>>
# Create:on Fri Sep 10 15:37:59 2021
# Licence: MIT
import os
import inspect
import warnings
import pickle
import joblib
from typing import TypeVar, Iterable , Callable
from abc import ABC, abstractmethod, ABCMeta
from pprint import pprint
import... |
# -*- coding: utf-8 -*-
#
# A way to transform a Fasta file quickly
#
import copy
import mmap
import multiprocessing
import os
import sys
import time
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
import pysam
from . import exceptions
from . import fasta
from . import fast... |
import types
import numpy as np
SMALL_GRID = np.array([[0.5581934, -0.82923452, 0.02811105],
[0.85314824, -0.15111695, 0.49930127],
[0.33363164, 0.92444637, 0.18463162],
[-0.79055406, -0.61207313, -0.0197677],
[0.54115503, -0.6... |
from __future__ import print_function
import csv
import sys
import math
from math import sqrt, factorial
import ndk
import numpy as np
from scipy.signal import convolve, butter, lfilter, decimate
import scipy.special
from ndk.ui import iprint,wprint,eprint
import ndk.ui as ui
# Features submodule for ndk - these are ... |
"""
trip.adapters
~~~~~~~~~~~~~
This module contains the transport adapters that Trip uses to define
and maintain connections.
Classes are rewrite for several reasons:
* add https proxy
* add stream reading
The following is the connections between Trip and Tornado:
tcpclient.TCPClient -> TC... |
import pytest
import defusedxml.lxml as etree
import json
import lxml.etree
import os
import uuid
from django.core.management import call_command
from .lib import iati
from .lib.exceptions import RuleSetStepException
from .rulesets.utils import invalid_date_format, get_child_full_xpath, get_xobjects, register_ruleset... |
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2016 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#... |
#!/usr/bin/env python3
from ev3dev2.motor import Motor, SpeedRPS, MoveTank
from ev3dev2.sensor.lego import ColorSensor, UltrasonicSensor
from ev3dev2.power import PowerSupply
from math import pi, sin, cos, atan, atan2, tan, sqrt
from threading import Thread
import numpy as np
from time import sleep, time
from ev3dev2.... |
#!/usr/bin/python
# Copyright (c) 2019, Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for detail... |
"""Provides the client classes."""
from __future__ import annotations
import abc
import array
import asyncio
import contextlib
import logging
from typing import Any, AsyncGenerator, AsyncIterator, Awaitable, Callable, Dict, MutableMapping, Optional, Tuple, \
TypeVar, Union
import aiowamp
from aiowamp import Clie... |
# coding: utf8
"""
tinycss.css21
-------------
Parser for CSS 2.1
http://www.w3.org/TR/CSS21/syndata.html
:copyright: (c) 2012 by <NAME>.
:license: BSD, see LICENSE for more details.
"""
from __future__ import unicode_literals
from itertools import chain, islice
from .decoding import decode
... |
# Django imports
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.views import generic
from .models import Results
from .forms import *
import os
from django.conf import settings
PROJECT_ROOT = settings.PROJECT_... |
"""
Run a series of rgw admin commands through the rest interface.
The test cases in this file have been annotated for inventory.
To extract the inventory (in csv format) use the command:
grep '^ *# TESTCASE' | sed 's/^ *# TESTCASE //'
"""
import logging
import boto.exception
import boto.s3.connection
import bo... |
# Author: <NAME> (<EMAIL>) 08/25/2016
# Quantization support: <NAME> (<EMAIL>)
"""Evaluation"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
from datetime import datetime
import os.path
import sys
import time
import numpy as np
from six.move... |
from typing import Iterable, Any, List, Dict, Union, AnyStr
from typing import Optional, AsyncGenerator, Sequence
import logging
import pprint
import itertools
import asyncio
import datetime
try:
from enum import StrEnum
except ImportError:
import enum
# Exists only starting Python 3.11
# Reimplement wh... |
"""Modèle de case management adapté au projet Labster."""
from __future__ import annotations
from datetime import date, datetime
from decimal import Decimal
from typing import TYPE_CHECKING, Any, Collection, Dict, List, Optional, \
Text, Type
import dateutil.parser
import structlog
from abilian.core.entities impo... |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 10 14:20:18 2022
@author: docs9
"""
import numpy as np
import pandas as pd
from datetime import datetime, timedelta
from scipy.stats import rankdata
from const import BasicConst, IndicatorConst, ParameterConst
import talib as ta
from pandas_utility import df2dic
from Tec... |
#!/usr/bin/env python
# pylint: disable=unexpected-keyword-arg,no-value-for-parameter
import datetime
import flask
from flask_login import current_user, login_required
from werkzeug.datastructures import MultiDict
import sqlalchemy as sa
from lifeloopweb import (decorators, email, forms, logging, sms, config,
... |
import numpy as np
import random
import cv2
from megengine import Tensor
def img_shelter(img, black_ratio):
H, W, _ = img.shape
S = H * (W / 3) / 2
values = [1, 2, 3, 4]
a = np.random.choice(values) # 随机选择顶点
x = np.random.randint(W / 3, W) # 随机选择一个边长
y = 2 * S / x
scale = random.unifo... |
# -*- coding: utf-8 -*-
"""
Functions for model training and evaluation (single-partner and multi-partner cases)
"""
import os
import utils
from timeit import default_timer as timer
import pickle
import keras
from keras.backend.tensorflow_backend import clear_session
from keras.callbacks import EarlyStopping
import n... |
from char_sim import CharFuncs
from masked_lm import MaskedLM
from bert_modified import modeling
import re
import json
import pickle
import argparse
import numpy
import logging
import plot
import tqdm
import time
####################################################################################################
__au... |
#Copyright 2018 <NAME>.
#Distributed under the MIT License. See LICENSE in root of project.
import inspect
import threading
import traceback
import sys
import types
import datetime
from kervi.spine import Spine
from kervi.core.utility.component import KerviComponent
from kervi.core.utility.superformatter import SuperF... |
import decimal
import io
import logging
import math
import os
import shutil
import time
import urllib2
import json
from time import sleep
import pycoin.ui
import pycoin.key.BIP32Node
import pycoin.key.Key
import pycoin.encoding
from pycoin.tx.Tx import Tx
from pycoin.tx.TxIn import TxIn
from pycoin.tx.TxOut import Tx... |
# -*- coding: utf-8 -*-
import datetime
from dateutil.relativedelta import relativedelta
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models import signals
from django.dispatch import receiver
from django.utils.datefor... |
# Script to make figures for manuscript
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
import matplotlib.cm as cm
from matplotlib.colors import LogNorm
import os
import sys
if not os.path.exists('Outputs_Mixed_200M/input_file'):
print('*'*50)
print('Cannot find file: input_f... |
# Copyright (c) 2017-present, Facebook, 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... |
#pylint: disable=protected-access
# Reference: https://github.com/tandemdude/hikari-lightbulb/blob/development/lightbulb/utils/nav.py
# For self-typing. Not sure why this is not part of Python.
from __future__ import annotations
import asyncio
import typing as t
import hikari
import lightbulb
# Default callback fun... |
# Copyright (C) 2014 Ion Torrent Systems, Inc. All Rights Reserved
import os
import requests
import traceback
import logging
import json
import time
from django.conf import settings
from django.utils.encoding import force_unicode
from django.utils.translation import ugettext_lazy, ugettext
from django.core.urlresolve... |
import re
from html import unescape
from urllib.parse import urljoin
from more_itertools import first
from scrapy import Request, FormRequest
from product_spider.items import AnpelItem
from product_spider.utils.spider_mixin import BaseSpider
def gen_post_data(target, to_page, view_state, view_state_generator, event... |
from bs4 import BeautifulSoup
from bs4.element import Comment
from tld import get_tld
from urllib.parse import parse_qs
from urllib.parse import urljoin
from urllib.parse import urlparse
from urllib.parse import urlsplit
import base64
import binascii
import ipaddress
import json
import logging
import magic
import re
im... |
from __future__ import print_function, division
import os
import shutil
import hashlib
import tempfile
from time import sleep, time
import pytest
from pathspec import RecursionError
from dirhash import (
_get_hasher_factory,
_get_match_spec,
get_included_paths,
dirhash,
algorithms_available,
... |
#!/usr/bin/env python3
import argparse
import re
from operator import itemgetter
from biocode import utils
"""
========
OVERVIEW
========
This reads nucmer output and an annotated GFF3 to provide a lot of statistics and lists
related to coverage of a reference genome.
=====
INPUT
=====
Two steps should be done be... |
import itertools
import re
import typing as typ
from collections import namedtuple
from copy import deepcopy
import cytoolz as tz
import yaml
from funcy import *
from toposort import toposort
from quinine.common.utils import get_only_paths, allequal
from quinine.quinfig import Quinfig
# Parameter = namedtuple('Param... |
import asyncio, discord, re, random
from operator import itemgetter
from discord.ext import commands
from Cogs import Utils, DisplayName, Message
def setup(bot):
# hkan bot dan depenciesnya
settings = bot.get_cog("Settings")
bot.add_cog(BotAdmin(bot, settings))
class BotAdmin(commands.Cog)... |
"""
Copyright Digisim, Computer Architecture team of South China University of Technology,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
... |
# -*- coding: utf-8 -*-
"""observate.py - Python module for storing filter information and tools for
projecting spectra onto filters. Also includes tools for convolving spectra.
Assumed input units are erg/s/cm^2/AA and AA
"""
import numpy as np
import os
try:
from pkg_resources import resource_filename, resour... |
import os
import math
import re
import functools
import pymel.core as pm
import lct.src.core.lcUtility as lcUtility
import lct.src.core.lcGeometry as lcGeometry
import lct.src.core.lcConfiguration as lcConfiguration
import lct.src.core.lcColor as lcColor
import lct.src.core.lcShader as lcShader
import lct.src.core.lcP... |
import sys
import re
import unicodedata
import jaconv
import csv
from collections import (
OrderedDict,
defaultdict,
)
from typing import (
Dict,
List,
Tuple,
)
from zipfile import ZipFile
from os.path import join, splitext
from io import TextIOWrapper
import html5_parser as html
from natto import... |
from typing import (
List,
Any,
Optional,
Collection,
TypeVar,
Sequence,
Union,
Tuple,
Callable,
Dict,
)
import threading
import math
from pathlib import Path
import torch
import torch.distributed as dist
import numpy as np
from operator import methodcaller
import subprocess
from... |
import matplotlib
# matplotlib.use("Agg")
from sklearn.covariance import graphical_lasso
from sklearn import covariance
from profiler.utility import find_all_subsets, visualize_heatmap
from sksparse.cholmod import cholesky, analyze
from scipy import sparse
from copy import deepcopy
from profiler.graph import *
from sci... |
################################################################################
# Module: plot.py
# Description: urban form analysis from OpenStreetMap
# License: MIT, see full license in LICENSE.txt
# Web: https://github.com/atelierlibre/osmuf
##########################################################################... |
#!/usr/bin/env python3
import os
import sys
import time
import json
import pickle
from multiprocessing import Process
from zipfile import ZipFile
import numpy as np
import pandas as pd
import pandasql as psql
#import matplotlib.pyplot as plt
import apollo.trees as trees
import apollo.utils as utils
import sklearn a... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
####
# File: optimizeModel.py
# Project: recognizeShapesOwnData
#-----
# Created Date: Sunday 17.01.2021, 17:32
# Author: Apop85
#-----
# Last Modified: Sunday 17.01.2021, 22:32
#-----
# Copyright (c) 2021 Apop85
# This software is published under the MIT license.
# Che... |
"""Support for ExtaLife devices."""
import asyncio
from datetime import timedelta
import importlib
import logging
from typing import Optional
import voluptuous as vol
from homeassistant.components.binary_sensor import DOMAIN as DOMAIN_BINARY_SENSOR
from homeassistant.components.climate import DOMAIN as DOMAIN_CLIMATE... |
'''
MIT License
Copyright (c) 2019 <NAME> and <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 5 08:55:07 2021
@author: Michi
"""
import sys
import os
os.environ["OMP_NUM_THREADS"] = "1"
PACKAGE_PARENT = '..'
SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(os.path.nor... |
import tensorflow as tf
import numpy as np
import scipy.ndimage
import scipy
import glob
import math
import random
import os
import re
from scipy.ndimage import gaussian_filter
from scipy.signal import convolve2d
def gaussian2(size, sigma):
"""Returns a normalized circularly symmetric 2D gauss kernel array
... |
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
#from builtins import str
from quantities.quantity import Quantity
import sciunit
from sciunit import Test,Score
try:
from sciunit import ObservationError
except:
from sciunit.errors import ObservationEr... |
# @Time : 2/15/2022 2:12 PM
# @Author : <NAME>
import csv
import ast
import argparse
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import scipy
from scipy import stats
from scipy.stats import linregress, skew
from scipy.signal import cwt, find_peaks_cwt, ricker,... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Find Chaos Communication Congress (C3) speakers for a given year
and store their names and Twitter handles (where applicable)
into an SQLite database.
Copyright (c) 2016 <NAME> <code∆k.kollmann·moe>
License: http://opensource.org/licenses/MIT The MIT License (MIT)
... |
#!/usr/bin/env python3
""" Transforms the 2003-2006 Archive into KeyML format and places in the Big Book of Key.
This code does 99.5% of the necessary formatting, but some editing will still be required.
This script is awful, but should only have to be run once. If you want to re-do a file
in the big book,... |
import ast
import csv
import korbinian
import korbinian.utils as utils
import zipfile
from multiprocessing import Pool
import pandas as pd
import pickle
import os
import sys
from Bio import AlignIO
import numpy as np
def save_fastagap(pathdict, s, logging):
"""Runs fastagap_save for each protein, using multiproces... |
##############################################
# Main | 15-112 Term Project
# <NAME> | Janyanti
##############################################
##############################################
# Imports
##############################################
import os
import time
import tkinter
from collections import deque
from ... |
#!/usr/bin/env python3
import base64
import enum
import functools
import itertools
import json
import os
import re
import sys
import traceback
import urllib.parse
import webbrowser
import zipfile
import appdirs
import gi
gi.require_version('Gtk', '3.0') # noqa
gi.require_version('WebKit2', '4.0') # noqa
fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# based on checkgoogleip '<EMAIL>'
import threading
import operator
import time
import Queue
import os, sys
import traceback
current_path = os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
current_path = os.path.dirname(os.path.abspath(__file__))
... |
import gym
gym.logger.set_level(40) # hide warnings
import time
import numpy as np
import copy
import math
import os
import psutil
import signal
import sys
from gym import utils, spaces
from gym_gazebo2.utils import ut_generic, ut_launch_phantomx #ut_math, ut_gazebo, general_utils , ut_mara
from gym.utils import seedin... |
'''
game.py
The main game file for GloryDaze Text Adventure.
started during engine development, debug and test.
by: <NAME>
CS467
Winter 2019
Team Keid :: <NAME>, <NAME>, <NAME>
Credits:
- https://stackoverflow.com/questions/14796323/input-using-backspace-and-arrow-keys
'''
import time
import sys
impo... |
"""A class for managing OpRegularizers."""
from __future__ import absolute_import
from __future__ import division
# [internal] enable type annotations
from __future__ import print_function
import collections
from morph_net.framework import concat_and_slice_regularizers
from morph_net.framework import constant_op_reg... |
import numpy as np
import re
import struct
from pathlib import Path
from collections import namedtuple
# Many of these are simplified in Python 3.9:
from typing import Union
from typing import Optional
from typing import Any
from typing import Sequence
from typing import Literal
from typing import Dict
from typing impo... |
import argparse
import glob
import logging
import os
import subprocess
import time
from multiprocessing import cpu_count
from typing import Any, List, Tuple, Union
import numpy as np
import trimesh
import tqdm
import pymesh
from joblib import Parallel, delayed
from matplotlib.cm import get_cmap
from scipy.interpolate ... |
import torchvision
import torch
import pandas as pd
import torchvision.transforms as transforms
from torch.utils.data import DataLoader, SubsetRandomSampler
from torchvision.datasets import MNIST, CIFAR10,CIFAR100, SVHN, ImageNet
import torchvision.datasets
import torch.nn as nn
from collections import OrderedDict
from... |
import numpy as np
from py_wake.site.shear import PowerShear
from py_wake.site.xrsite import XRSite
import xarray as xr
from py_wake.tests import npt
import pytest
import matplotlib.pyplot as plt
from numpy import newaxis as na
from py_wake.tests.test_files import tfp
from py_wake.examples.data.hornsrev1 import Hornsre... |
# 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... |
#!/usr/bin/env python
from collections import OrderedDict
import torch
from torch import nn
import torch.nn.functional as F
import MinkowskiEngine as ME
from models.unet_2d import ResUnet as model2D
from models.unet_3d import mink_unet as model3D
from models.bpm import Linking
from models.transformer_utils.transform... |
"""
DAGChainer output is fairly involved.
Here we are parsing the output. I have
chosen to parse the table so that
each chrom/contig becomes its own object.
Containing Syntetic regions. Each Syntentic region will
in turn contain the reported genes that support it.
This scheme is a sensible way to interate through the d... |
import os
import argparse
import os
import subprocess as sp
from tqdm import tqdm
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras.applications.vgg16 import VGG16
from tensorflow.keras.models import Model, model_from_json
from tensorflow.keras.layers import Input, Dense... |
# 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 u... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
# * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is *
# * also a registered trademark of Inse... |
#!/usr/bin/env python
# CirKit: A circuit toolkit
# Copyright (C) 2009-2015 University of Bremen
# Copyright (C) 2015-2017 EPFL
#
# 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 versio... |
#! /usr/bin/python
# -*- coding: utf8 -*-
import time, os, random
import tensorflow as tf
import tensorlayer as tl
import math as ma
from model_DPA_optim import *
from utils import *
from config import config
from skimage.measure import compare_psnr
batch_size = config.TRAIN.batch_size
lr_1 = config.TRAIN.lr_1
lr_2... |
# -*- coding: utf-8 -*-
import sys
import re
import os
import argparse
import numpy
import matplotlib.pyplot as plt
#print(plt.rcParams['animation.ffmpeg_path']) # if it does not recognize the ffmpeg, force it to look in the right place
#plt.rcParams['animation.ffmpeg_path'] = 'D:\\Dropbox\\p\\programas\\bin\\ffmpeg\\... |
import re
import bz2
import urllib.parse
"""Wikipedia Extractor:
Extracts and cleans text from Wikipedia database dump and stores output in a
number of files of similar size in a given directory. In each line of these files,
a wikipedia page is stored in JSON format.
(Forked and bettering https://github.com/sjebbara/W... |
# -*- coding: utf-8 -*-
"""
@author: cleartonic
"""
import random
import json
import pandas as pd
import collections
import time
import socket
import re
import os
import traceback
import asyncio
import gspreadmerger as gs
# SETTINGS
class Tw():
infomessage = 'Trivia Bot loaded.'
# SETTINGS FOR END USERS
t... |
from django.utils import timezone
from django.template.defaultfilters import filesizeformat
from django.contrib.auth.models import User, Group
from django.conf import settings
from rest_framework import serializers
from rest_framework.reverse import reverse
from archive.models import Run, MethodOutput, RunInput, RunBa... |
"""Analyze images captured by the DESI GFA cameras for the online ETC.
"""
try:
import DOSlib.logger as logging
except ImportError:
# Fallback when we are not running as a DOS application.
import logging
import numpy as np
import fitsio
import desietc.util
def save_calib_data(name='GFA_calib.fits', com... |
# Hill climing approach to solve a sudoku puzzle
# Inspired by Stochastic search / optimization methods from https://en.wikipedia.org/wiki/Sudoku_solving_algorithms
## Initial code copied from http://norvig.com/sudoku.html
# Will work mostly with grid_values instead of values used in the Norvig sudoku.py (no possib... |
#
# Pocket SDR Python Library - RTKLIB Wrapper Functions
#
# References:
# [1] RTKLIB: An Open Source Program Package for GNSS Positioning
# (https://github.com/tomojitakasu/RTKLIB)
#
# Author:
# T.TAKASU
#
# History:
# 2021-12-24 1.0 new
# 2022-01-13 1.1 add API test_glostr()
# 2022-02-15 1.2 add A... |
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license noti... |
import copy
def run_make_vocabulary_test(make_vocabulary,with_unk):
input_testcases = [
[ ['irn','bru','good'], ['irn','bru','bad'] ],
[ ['go','fish','today'], ['went','fish','yesterday'] ],
[ ['glasgow','city','culture','1990'], ['university','glasgow','founded','1451'] ],
[ ['expanse','season','six','excell... |
# coding: utf-8
# In[1]:
''' SECTION 1: Some variables need to be specified
##
# '''
# This code is modifed from https://github.com/martinarjovsky/WassersteinGAN
# get_ipython().magic(u'matplotlib inline')
''' SECTION 2: Call libraries
##
# '''
import os, io, h5py, math, datetime, sys
import numpy as np
import n... |
#!/usr/bin/env python
# Identify all discordant reads, analyze, and write them to allDiscordants.us.txt
from itertools import izip
import argparse as ap
import numpy as np
import pysam as ps
import logging
import sys
import gc
from shared import formExcludeHash, ignoreRead, readChromosomeLengths
## we would not reco... |
import os, sys, inspect
sys.path.insert(1, os.path.join(sys.path[0], '../../'))
import ctypes
import torch
import torchvision as tv
import argparse
import time
import numpy as np
import scipy.sparse as sparse
from scipy.stats import binom
from PIL import Image
import matplotlib
import matplotlib.pyplot as plt
import p... |
import torch
import torch.nn as nn
from gensim import models
import torch.nn.functional as F
import copy
import math
from torch.nn.parameter import Parameter
from torch.nn.modules.module import Module
import pdb
class Embedding(nn.Module):
def __init__(self, config, input_lang, input_size, embedding_size, dropout=0.5... |
"""
@author: <NAME>
@contact: <EMAIL>
Note: Our implementation is different from ADDA paper in several respects. We do not use separate networks for
source and target domain, nor fix classifier head. Besides, we do not adopt asymmetric objective loss function
of the feature extractor. We achieve promising results on di... |
import argparse
import importlib
import os
import subprocess
import sys
from argparse import Namespace
from datetime import datetime
from importlib import import_module
from pathlib import Path
from types import ModuleType
from typing import Tuple, Iterator
import importlib.util
import bigflow as bf
from typing import ... |
from meld_classifier.experiment import Experiment
from meld_classifier.meld_cohort import MeldCohort, MeldSubject
from meld_classifier.dataset import load_combined_hemisphere_data, Dataset, normalise_data
from meld_classifier.meld_plotting import trim,rotate90
from meld_classifier.evaluation import Evaluator
from meld_... |
# Copyright 2018 Xanadu Quantum Technologies 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 agre... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
import ply.yacc as yacc
from uC_AST import *
from uC_lexer import UCLexer
# NOTE Each rule is defined by a function whose docstring contains the appropriate context-free grammar specification.
# The statements that make up the function body implement the semantic actions of the rule.
# Each function accepts... |
import numpy as np
import scipy.optimize as opt
from multiprocessing import Pool
import multiprocessing
import copy
from scipy.stats import rv_continuous
import scipy.stats as sp
class poly_dens(rv_continuous):
def _pdf(self,x):
return np.sqrt(2)/(np.pi*(1+x**4))
def compute_sqrt(Sigma):
S,V = np.lina... |
# -*- coding: utf-8 -*-
import collections
import functools
import os
import random
import re
import matplotlib.pyplot as plt
from PIL import Image, ImageFile
from matplotlib import colors as mcolors
from matplotlib.collections import PolyCollection
from citlab_python_util.geometry.polygon import Polygon
from citlab_... |
import networkx.algorithms.isomorphism as iso
import random
import re
import numpy as np
import scipy as sp
from scipy.spatial import Delaunay
import networkx as nx
from networkx.readwrite import json_graph
import json
import matplotlib.pyplot as plt
import random
from math import ceil, log10, cos, sin, pi
from skl... |
#!/usr/bin/env python
# import sys
import sys, string, random
import subprocess
def output_denovo_results(candidatePeptides, precursorMass, retention, charge, peptide, benchmark_file, kmerSize, kmerThreshold,reconstructions_file):
#This function just the final reconstructions in the format wanted! This one is for ben... |
#!/usr/bin/python
# Dependencies from the python standard library:
from pathlib import Path
import shutil # For copying files
import subprocess # For calling ffmpeg to make animations
# You can use 'pip' to install these dependencies:
import numpy as np
from scipy.ndimage import rotate
import matplotlib.pyplot as p... |
# Copyright (C) 2015 Midokura SARL.
# 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 requir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.