text stringlengths 6.04k 39.5k |
|---|
#!/usr/bin/env python
#-- <NAME> 2019
#-- Genetics Identificacion Group @ Erasmus MC --
#-- Haplogroup prediction
import pandas as pd
import numpy as np
import collections
import operator
import os
import re
from argparse import ArgumentParser
def get_arguments():
parser = ArgumentParser(description="Erasmus M... |
# coding: utf-8
# pylint: disable=invalid-name, protected-access, too-many-locals, too-many-arguments, too-many-statements
"""Executor manager."""
from __future__ import absolute_import
import logging
import numpy as np
from .base import mx_real_t
from . import ndarray as nd
from .context import cpu
from .io import D... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-03-12 18:25
from __future__ import unicode_literals
import logging
from django.contrib.auth.models import Group
from django.contrib.contenttypes.models import ContentType
from django.db import migrations
from django.db.models import Func, Value, F, Q
from dj... |
# encoding: utf-8
import datetime
import copy
from nose.tools import assert_equal
from ckan.lib.dictization import model_dictize
from ckan import model
from ckan.lib import search
from ckan.tests import helpers, factories
class TestGroupListDictize:
def setup(self):
helpers.reset_db()
search.... |
# Lint as: python2, python3
# Copyright 2019 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
#
... |
import threading
import time
from tkinter import *
from tkinter import ttk, messagebox
import mouse as mouser
from pynput import mouse
from pynput.mouse import Controller as cr, Button as bt
import keyboard
import pyautogui as pg
import pyglet
pyglet.font.add_file("sfprodisplaybold.otf")
pg.FAILSAF... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
# Author: Temigo, cwtliu
from __future__ import print_function
import re
from constants import *
from postbase import Postbase
import time, random
# TODO conversions
def convert(word):
word = word.replace('vv','1')
word = word.replace('ll','2')
word = word.replace(... |
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
BUTTON
Button class, manage elements and adds entries to Menu.
"""
__all__ = [
'Button',
'ButtonManager'
]
import pygame
import pygame_menu
import pygame_menu.events as _events
import re
import webbrowser
from abc import ABC
from pygame_menu.locals im... |
# -*- coding: utf-8 -*-
# FLEDGE_BEGIN
# See: http://fledge.readthedocs.io/
# FLEDGE_END
import json
import copy
import aiohttp
from aiohttp import web
from typing import List, Dict, Tuple
from fledge.common.configuration_manager import ConfigurationManager
from fledge.services.core import connect
from fledge.servic... |
# -*- coding: utf-8 -*-
# cython: language_level=3
# Copyright (c) 2020 Nekokatt
#
# 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... |
from __future__ import (division, absolute_import, print_function, unicode_literals)
import os
import numpy as np
import gzip
import os.path
import nltk
import logging
from nltk import FreqDist
from .WordEmbeddings import wordNormalize
from .CoNLL import readCoNLL
import sys
if (sys.version_info > (3, 0)):
import... |
from environment import *
fp = {
'FUNCTION':'LA FUNCION',
'PROCEDURE': 'EL PROCEDIMIENTO'
}
"""
Clase enum DBType:
_____________________________________________________________
Necesaria para tener un fácil acceso a los tipos definidos para una base de datos.
"""
from enum import Enum
class DBType(Enum):
... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
from math import sqrt
from skimage.feature import blob_dog, blob_log, blob_doh
import imutils
import argparse
import os
import math
from classification import training, getLabel
SIGNS = ["nouvelle",
"STOP",
"TURN LEFT",
"TURN RIGHT"... |
"""
Example python code to call the 3 correlation function
routines from python. (The codes are written in C)
Author: <NAME> <<EMAIL>>
Requires: numpy
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
try:
from future.utils import bytes_to_native_str... |
# Wi-Fi Display test cases
# Copyright (c) 2013, <NAME> <<EMAIL>>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import time
import threading
import Queue
import hwsim_utils
import utils
from test_p2p_autogo import co... |
# ignore warnings
import warnings
warnings.filterwarnings(action='ignore')
import cv2
import numpy as np
from django.http import HttpResponse, JsonResponse
from . import test, FingerCounter, train
# sys.path.append(r"C:\\_workspace\\_python\\2021-3Q\\ai_server\\iot\\main") # Adds higher directory to python modules path... |
"""Demo Kaplan-Meier surivival analysis.
MPyC demo based on work by <NAME>, partly covered in Section 6.2 of his paper
'Pinocchio-Based Adaptive zk-SNARKs and Secure/Correct Adaptive Function Evaluation',
AFRICACRYPT 2017, LNCS 10239, pp. 21-39, Springer (see https://eprint.iacr.org/2017/013
for the latest version).
... |
# Copyright 2020 <NAME>, <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import torch
import argparse
def get_training_parser(task='bert', optimizer='adam', lr_scheduler='PolynomialDecayScheduler'):
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument('--no-progress-bar', action='store_true', help='disable progress bar')
parser.add_argument('--seed', defaul... |
""" Save machine learning data sets to a common location, and load them without
having to specify a path.
All datasets will be saved to `datasets.path`. By default, this will be point to
~/datasets. You can update this path via `datasets.set_path`.
"""
from pathlib import Path
import numpy as np
from .to... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re, copy
import time
import pandas as pd
import numpy as np
from sklearn.preprocessing import scale
import sys, os, platform
import pickle
import itertools
import argparse
import urllib
import json
from tqdm import tqdm
import numpy as np
import pandas as pd
from c... |
"""Methods to collect, analyze and manipulate transition and trajectory rollouts."""
import collections
import dataclasses
import logging
from typing import Callable, Dict, Hashable, List, Mapping, Optional, Sequence, Union
import numpy as np
from stable_baselines3.common.base_class import BaseAlgorithm
from stable_b... |
#!/usr/bin/env python
# Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
# Disable 'Unused variable', 'Unused argument' and 'Method could be a function'.
# pylint: disable=W0612,W0613,R0201
import dateti... |
from __future__ import absolute_import
import datetime
import json
import logging
from unittest import TestCase
import decimal
import requests
from mock import patch, Mock
from nose.plugins.attrib import attr
from nose.tools import assert_equal, assert_true, assert_false, \
assert_is_not_none, assert_not_equal, ... |
##########
# Code from: https://github.com/tobiasbaumann1/Adaptive_Mechanism_Design
##########
import copy
import logging
import numpy as np
import tensorflow as tf
logging.basicConfig(filename='Planning_Agent.log', level=logging.DEBUG, filemode='w')
from marltoolbox.algos.adaptive_mechanism_design.agent import Agent... |
# Adapted Implemntation of MATLAB FCW Fusion logic
# https://www.mathworks.com/help/driving/ug/forward-collision-warning-using-sensor-fusion.html
import numpy as np
from scipy.linalg import block_diag
from collections import deque
from scipy.optimize import linear_sum_assignment
from selfdrive.controls.lib.radar_help... |
"""
Secure Transacted File System - A container format found on Xbox 360 XTAF partitions
See http://free60.org/STFS
"""
import struct
from .constants import ContentTypes, STFSHashInfo
import hashlib
from io import BytesIO as StringIO
# TODO: Handle verifying non-data blocks
class BlockHashRecord(object):
""" Obje... |
from models import EncoderDecoderModule, EncoderDecoderModuleFPN, EncoderDecoderModuleUnetPP
import numpy as np
import glob
from predict_utils import get_3d_images_for_validation_nogt, normalize_mean_std, image_zpad
import torch
import os
import matplotlib.pyplot as plt
import time
from patch_utils import find_bbox
imp... |
from __future__ import absolute_import, division, print_function, unicode_literals
import torch
from torch import nn
from torch.nn import CrossEntropyLoss, MSELoss
from CharBERT.modeling.modeling_bert import BertLayerNorm, CharBertEncoder, BertEncoder, BertPooler, BertPreTrainedModel, BertPredictionHeadTransform, BertO... |
"""
Module for updating dataset with tokenized solutions of given problems.
- Tokenized representations of all solutions of one problem are
placed in a single file.
- The files with tokenized solutions of problems are added into existing
directory.
- Each tokenized source code file is represented in the followin... |
import argparse
import os
import random
import io
import sys
import time
from models.moran import MORAN
import tools.utils as utils
import torch.optim as optim
import numpy as np
import torch.backends.cudnn as cudnn
import torch.utils.data
import tools.dataset as dataset
from torch.autograd import Variable
from collect... |
# Copyright 2017. <NAME>. All rights reserved
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
# dis... |
"""License management.
Customer licenses are simply managed as a list of CustomerLicense instances
read from a CSV file. Demo licenses are stored in simple key-value encoded files.
"""
__docformat__ = 'epytext en'
import os, re, datetime, textwrap, md5
from codebay.common import datatypes
from codebay.common import ... |
from svc_monitor.config_db import *
from os.path import dirname, exists, join
import logging
import yaml
try:
from custom_attributes.haproxy_validator \
import validate_custom_attributes as get_valid_attrs
except ImportError:
custom_attr_dict = {}
def get_valid_attrs(custom_attr_dict, section, cust... |
import numpy
import numpy as np
import math
from scipy.interpolate import InterpolatedUnivariateSpline as interpolate
from scipy.integrate import simps
from scipy.integrate import romberg
import sys
#sys.path.append("/global/homes/c/chmodi/Programs/Py_codes/modules/")
import mycosmology as cosmo_lib
class Mass_Func(... |
#
# The script to run maze navigation experiment with Novelty Search optimization
# using the MultiNEAT library
#
# The Python standard library import
import os
import shutil
import math
import random
import time
import copy
import argparse
import pickle
# The MultiNEAT specific
import MultiNEAT as NEAT
from MultiNEA... |
from __future__ import print_function
import os
import argparse
import torch
import torch.optim as optim
from torch.optim.lr_scheduler import CosineAnnealingLR
from kitti_datasets.frustum import FrustumKittiDataset
from model.kitti.frustum.frustum_net import FrustumPVT
from torch.utils.data import DataLoader
from modul... |
# -*- coding: utf-8 -*-
# Copyright 2014 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
"""
This module has functions that compares the contrast calculation from different methods:
1. E2E coronagraph
2. (Image-based PASTIS)
3. Matrix-based PASTIS
All three methods are currently only supported for JWST, and you can pick between the analytical or numerical matrix.
HiCAT and LUVOIR only have an E2E vs numer... |
import pwndbg.commands
import argparse
import six
import gdb
import math
import pwndbg.color.memory as M
from pwndbg.commands.windbg import dX, ds
from pwndbg.commands.pie import get_exe_name, translate_addr
from pwndbg.commands.heap import heap as hp, bins, tcachebins, fastbins, unsortedbin, smallbins, largebins, bin... |
#
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... |
"""Advisor : 새틀라이트(유니온)
"""
from ..kernel import core
from ..character import characterKernel as ck
from ..status.ability import Ability_tool
from ..execution.rules import RuleSet, ConcurrentRunRule, ReservationRule
from . import globalSkill
from .jobclass import resistance
from .jobbranch import pirates
from . import... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import,print_function
import os
import sys
import code
import warnings
import string
import inspect
import argparse
from flask import _request_ctx_stack
from .cli import prompt, prompt_pass, prompt_bool, prompt_choices
from ._compat import izip, text_type
cl... |
cutoff = 0
prec = 660
dec_prec = int((3.0 / 10.0) * prec)
mpmath.mp.dps = dec_prec
exec("tiny = eval_mpfr(1e-" + str(dec_prec // 2) + ", prec)")
rho_cross = 3 - 2 * mpmath.sqrt(2)
r_cross = eval_mpfr(3 - 2 * sqrt(2), prec)
ell = Symbol('ell')
delta = Symbol('delta')
delta_ext = Symbol('delta_ext')
sdpb_path = "/usr... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# This old version has been retrieved to use the Spectrum class to do photometry
# Functionalities have been removed
import abc
import math
from copy import deepcopy
from collections import OrderedDict
import numpy as np
from astropy.utils import lazypr... |
import torch
import torch.nn
import numpy as np
import warnings
import weakref
######## CONSTANTS #############################################################
# Set B, C to this value to mark a failed search (strategy does not
# fit in memory).
_COST_SEARCH_FAILURE = -1
# Set D to this value to mark no checkpoint;... |
# Copyright 2020 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 qelos as q
import torch
import numpy as np
import six
import copy
import json
import re
import os
""" Heavily borrowed from Hugging Face BERT """
__all__ = ["TransformerBERT", "BertConfig", "BERTClassifier", "BERTMLM"]
class BertConfig(object):
"""Configuration class to store the configuration of a `Be... |
"""
Functions that help in constructing django queries
"""
from typing import Iterable, Optional
import logging
from django.db import models
from django.db.models import Sum, Q
from django.db.models.functions import Coalesce
from django.shortcuts import get_object_or_404
from charts.models import ReportDataView
from ... |
import argparse
import ast
import itertools
import logging as log
import os
import sys
import textwrap
import traceback
import astor
import pandas as pd
from nltocode.generator.codegenerator import PythonCodeGenerator
from nltocode.grammar.grammargraph import PythonGrammarGraphCreator, AsdlGrammarGraphCreator
from nl... |
from bokeh.plotting import figure, show
from bokeh.io import output_notebook
from bokeh.models import Title, ColumnDataSource, Grid, LinearAxis, Plot, Rect
from bokeh.models import DataTable, TableColumn, LinearColorMapper, ColorBar
from bokeh.colors import RGB
from bokeh.transform import linear_cmap
from bokeh import ... |
import numpy as np
from .orcadaq import OrcaDecoder, get_ccc, get_readout_info, get_auxhw_info
from .fcdaq import FlashCamEventDecoder
class ORCAFlashCamListenerConfigDecoder(OrcaDecoder):
'''
Decoder for FlashCam listener config written by ORCA
'''
def __init__(self, *args, **kwargs):
... |
import tkinter as tk
from tkinter.ttk import *
import sqlite3
from tkinter import *
'''
import speech_recognition as sr # for speech recognition to play songs
import pyttsx3 as tts # python module for speech
engine = tts.init()
volume = engine.getProperty('volume')
engine.setProperty('volume',0.75)
voices = engine.g... |
# STUMPY
# Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license.
# STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved.
import logging
import math
import multiprocessing as mp
import os
import numpy as np
from numba import cuda
from . import core, config
logger =... |
"""
This module provides the Scan Op
Scanning is a general form of recurrence, which can be used for looping.
The idea is that you *scan* a function along some input sequence, producing
an output at each time-step that can be seen (but not modified) by the
function at the next time-step. (Technically, the function can... |
from timeit import default_timer
from functools import partial
from tkinter import *
import random
import sys
# limite 420 characters
class Coter():
"""
class which allows to manage all the right frame
"""
def __init__(self, fen, bonneRep):
"""
Init the class
parameters:
... |
"""
Seed job data for combined data set from Mayo (data handoff was March 2016)
"""
import biom
import numpy
from biom.table import Table as BiomTable
import csv
from nest_py.core.jobs.jobs_logger import log
import nest_py.omix.data_types.otus as otus
import nest_py.core.jobs.box_downloads as box_downloads
import nest... |
import os
os.environ["MKL_NUM_THREADS"] = "1"
os.environ["NUMEXPR_NUM_THREADS"] = "1"
os.environ["OMP_NUM_THREADS"] = "1"
from os import path, makedirs, listdir
import sys
import numpy as np
np.random.seed(1)
import random
random.seed(1)
import torch
from torch import nn
from torch.utils.data import ... |
'''
Script collecting rates from Janev & Smith, NF 1993.
These are useful in aurora to compute total (n-unresolved) charge exchange rates between heavy ions and neutrals.
sciortino, 2020
'''
import numpy as np
import matplotlib.pyplot as plt
plt.ion()
import copy
def js_sigma_ioniz_n1_q8(E):
"""Ionization cro... |
#!/usr/bin/env python
#
# Copyright (C) 2008, 2009 Google 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 appli... |
# Leo colorizer control file for shell mode.
# This file is in the public domain.
# Properties for shell mode.
properties = {
"indentCloseBrackets": "}",
"indentOpenBrackets": "{",
"lineComment": "#",
"lineUpClosingBracket": "true",
}
# Attributes dict for shell_main ruleset.
shell_main_at... |
# -*- coding: utf-8 -*-
from __future__ import print_function
# this is the test function set for splat core functions
# imports - internal
import copy
import glob
import os
# # imports - external
import numpy
from astropy import units as u # standard units
from astropy import constants as const # p... |
'''
FromTruth.py
Initialize params of a bnpy model using "ground truth" information,
such as human annotations
These are provided within the Data object's TrueParams attribute.
'''
from __future__ import print_function
from builtins import *
import numpy as np
def init_global_params(hmodel, Data, initname=None, see... |
""" produce
This Is a Python Program For Converting binary data from the BSR AltAcc
to ASCII Data with nice little Headers.
"""
import sys
import argparse
import logging
from math import log, exp
import prodata
VERSION = "1.25c"
flight_modes = (
"Main Only Mode",
"Drogue to Main Mode",
"Drogue to Main M... |
from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
str = type('')
import pytest
from math import sin, cos, radians
from time import time
from itertools import islice
from gpiozero.tools import *
try:
from math import isclose
except ImportError:
from gp... |
"""
Base class for generic `p`-adic polynomials
This provides common functionality for all `p`-adic polynomials, such
as printing and factoring.
AUTHORS:
- <NAME> (2013-11-22): initial version, split off from other
files, made Polynomial_padic the common base class for all p-adic
polynomials.
"""
#************... |
import sys
import json
from urllib import parse
import os
import hashlib
import time
import random
import re
import string
from urllib.parse import quote
import requests
# global variable statement
__cookie = None
__header = {'host': 'h5.qzone.qq.com',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x6... |
__all__ = ('DataGenerator')
import pandas as pd
import numpy as np
from .utils import bound_nonuniform_sampler, uniform_sampler
class DataGenerator():
def __init__(self,
random_state: int = None,
type_noise: str = 'norm'):
self.set_rng(random_state)
self.set_g... |
"""A module dedicated for auxiliary functions for feature summarization.
Attributes:
SUMMARY_METHODS (:obj:`Dict`): dictionary that links summary function
names as keys with methods callables which implements then as values.
"""
import typing as t
import collections
import scipy.stats
import numpy as np
... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 <NAME> (<EMAIL>)
# Copyright (C) 2013 <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,... |
# coding: utf-8
# In[ ]:
import sys
sys.path.append('/Volumes/SANDISK128/Documents/Thesis/Python/')
import pygrib
from scipy import ndimage
from mpl_toolkits.basemap import shiftgrid
import numpy as np
import math
import calc_wind as totalwind
# In[ ]:
def opengrib(yyyy, mm, dd, tt, pm, path):
grib = '%s/... |
# Training script for tiny-imagenet.
# Again, this script has a lot of bugs everywhere.
import argparse
import os
import shutil
import numpy as np
import torch
import torch.utils.data as data
import torch.nn.functional as F
import torch.optim as optim
import tqdm
import losses as L
from models.discriminators.snresnet... |
import os
import glob
import gdown
import sys
from pathlib import Path
import streamlit as st
import numpy as np
#import pandas as pd
import streamlit as st
#import streamlit_authenticator as stauth
from streamlit_autorefresh import st_autorefresh
import subprocess
import seaborn as sns
import io
from pdf2image import... |
import qiskit, time
from numpy import pi
# define pi so that in string gates we can have pi as an angle.
# Because we use eval for string gates. For example, gate = "rz(pi/2, 1)".
name = "IBM"
simulators = simulator, unitary_simulator, state_simulator = (
"qasm_simulator", "unitary_simulator",
"stat... |
#!/usr/bin/python
# Copyright (c) 2020, 2022 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 d... |
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
# file: beammech.py
# vim:fileencoding=utf-8:ft=python:fdm=marker
# Copyright © 2012-2020 <NAME> <<EMAIL>>. All rights reserved.
# SPDX-License-Identifier: MIT
# Last modified: 2020-10-06T21:31:48+0200
#
"""Module for stiffness and strength calculations of beams."""
from datetime import datetime
from os.path import ba... |
# Copyright 2014 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwar... |
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
alphabet_char_to_index = {char: i for i, char in enumerate(alphabet)}
valid_reflector_names = {"A", "B", "C", "UKWB", "UKWC"}
ring_settings = [f'0{i}' if i < 10 else str(i) for i in range(1, 27)]
beta = "LEYJVCNIXWPBQMDRTAKZGFUHOS"
gamma = "FSOKANUERHMBTIYCWLQPZXVGJD"
I = "EKMFL... |
import os
import sys
import uuid
import traceback
import json
try:
from StringIO import StringIO
except:
from io import StringIO
import param
from ._version import __version__
HERE = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(HERE, 'labextension', 'package.json')) as fid:
data = ... |
"""Functions shared between different beamformer types."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from copy import deepcopy
import numpy as np
from scipy import linalg
from ..cov import Covariance
from ..io.constants import FIFF
from ..io.proj... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import logging
import numpy as np
import tensorflow.compat.v2 as tf
from tensorflow.python.tpu import tpu_function
def get_stages_from_blocks(ws, rs):
"""Gets ws/ds of network at each stage from p... |
#@+leo-ver=5-thin
#@+node:ekr.20170428084207.586: * @file ../external/npyscreen/wgeditmultiline.py
#!/usr/bin/python
# pylint: disable=no-member
#@+others
#@+node:ekr.20170428084207.587: ** Declarations
from . import wgwidget as widget
from . import npysGlobalOptions as GlobalOptions
import locale
import sys
import ... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# --------------------------------------------------------------------------
from typing import List, Optional
import gzip
import io as sysio
import json
import re
import tempfile
fro... |
from __future__ import print_function, division, absolute_import
import os
import sys
import numpy as np
import cffi
ffi = cffi.FFI()
ffi.cdef("""
enum DFTI_CONFIG_PARAM
{
DFTI_FORWARD_SCALE = 4,
DFTI_BACKWARD_SCALE = 5,
DFTI_NUMBER_OF_TRANSFORMS = 7,
DFTI_CONJUGATE_EVEN_STORAGE = 10,
DFTI_PLACEM... |
"""Collection of functions to run forwards and backwards algorithms on haploid genotype data encoded with tree sequences."""
import numpy as np
import tskit
def mirror_coordinates(ts):
"""Return a copy of the specified tree sequence in which all coordinates x are transformed into L - x."""
L = ts.sequence_len... |
import copy
import os
from functools import partial
import numpy as np
from scipy.ndimage import measurements as measure
from isobenefit_cities import logger
from isobenefit_cities.image_io import import_2Darray_from_image
LOGGER = logger.get_logger()
DENSITY_LEVELS = ['high', 'medium', 'low']
class MapBlock:
... |
import logging
import random
import uuid
from typing import Any, Dict, List, Tuple, Union
import click
import progressbar
from avrogen.dict_wrapper import DictWrapper
from datahub.cli import cli_utils, delete_cli, migration_utils
from datahub.emitter.mce_builder import (
DEFAULT_ENV,
dataset_urn_to_key,
m... |
"""
A collection of functions for converting dense hypnogram encodings to sparse
(start-duration-stage format) hypnogram encodings.
... and other small utility functions for handling hypnogram data.
-----
HYPNOGRAM FORMATS
utime operates with the following notation on hypnogram encodings:
'Sparse hypnogram':
Th... |
''' Introduction'''
# Name_Exercise_1
print("Hello, World!")
# Name_Exercise_2
if __name__ == '__main__':
n = int(input().strip())
if 1 <= n <= 100:
if (n % 2) == 0:
if 2 <= n <= 5:
print('Not Weird')
elif 6 <= n <= 20:
print('Weird')
... |
""" Module for finding patterns in arc line spectra
.. include common links, assuming primary doc root is up one directory
.. include:: ../include/links.rst
"""
import numpy as np
import inspect
from astropy.io import fits
from pypeit.core.wavecal import autoid
from pypeit.core.wavecal import defs
from pypeit.core ... |
'''Local.py - CGAT project specific functions
=============================================
The :mod:`Local` module contains various utility functions for working
on CGAT projects and are very specific to the CGAT directory layout.
.. note::
Methods in this module need to made to work with arbitrary project
la... |
#!/usr/bin/env python3
# Copyright (C) 2020 <NAME> and mtrycz
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Tests basic functionality of the getblocktemplatelight and submitblocklight RPC methods.
"""
import os
import platf... |
# Copyright (c) 2020 Science and Technology Facilities Council
# All rights reserved.
# Modifications made as part of the fparser project are distributed
# under the following license:
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condi... |
r"""
Wrapper class for abelian groups
This class is intended as a template for anything in Sage that needs the
functionality of abelian groups. One can create an AdditiveAbelianGroupWrapper
object from any given set of elements in some given parent, as long as an
``_add_`` method has been defined.
EXAMPLES:
We crea... |
# -*- coding: utf-8 -*-
import numpy as np
#from dewloosh.solid.model.mindlin.utils import \
# stiffness_data_Mindlin, pproc_Mindlin_3D
from numpy import sin, cos, ndarray as nparray, pi as PI
from numba import njit, prange
from dewloosh.math.array import atleast2d, atleast3d, \
atleast4d, itype_of_ftype
__al... |
# --------------------------------------------------------
# Tensorflow drl-RPN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# Faster R-CNN code by <NAME>, <NAME>, based on code
# from <NAME>
# --------------------------------------------------------
from __future__ import absolute_imp... |
# math2d_planar_graph.py
import copy
import math
from math2d_line_segment import LineSegment
from math2d_vector import Vector
class PlanarGraphEdgeLabel:
NONE = 0
REGION_BORDER = 1
CUT = 2
class PlanarGraph(object):
# These are graphs in the plane where no two edges non-trivially overlap.
# Edge... |
import cloudscraper
from bs4 import BeautifulSoup
import json
import copy
import time
from colorama import Fore, Style
import threading
# GENERAL
verif_sair = False
# if anime.json does not exist:
try:
with open('anime.json', 'r') as anime_json:
pass
except FileNotFoundError:
print('... |
import pygame
import time
import math
pygame.init()
# JANELA
janelaWidth = 800
janelaHeight = 600
janela = pygame.display.set_mode((janelaWidth, janelaHeight))
pygame.display.set_caption('Super Head Soccer')
# PARA DEFINIR FPS
clock = pygame.time.Clock()
FPS = 60
# CORES
white = (255, 255, 255)
bl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.